(() => {
  var __create = Object.create;
  var __defProp = Object.defineProperty;
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  var __getOwnPropNames = Object.getOwnPropertyNames;
  var __getProtoOf = Object.getPrototypeOf;
  var __hasOwnProp = Object.prototype.hasOwnProperty;
  var __typeError = (msg) => {
    throw TypeError(msg);
  };
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  var __esm = (fn, res) => function __init() {
    return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
  };
  var __commonJS = (cb, mod) => function __require() {
    return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  };
  var __export = (target, all) => {
    for (var name2 in all)
      __defProp(target, name2, { get: all[name2], enumerable: true });
  };
  var __copyProps = (to, from, except, desc) => {
    if (from && typeof from === "object" || typeof from === "function") {
      for (let key of __getOwnPropNames(from))
        if (!__hasOwnProp.call(to, key) && key !== except)
          __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
    }
    return to;
  };
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
    // If the importer is in node compatibility mode or this is not an ESM
    // file that has been converted to a CommonJS file using a Babel-
    // compatible transform (i.e. "__esModule" has not been set), then set
    // "default" to the CommonJS "module.exports" for node compatibility.
    isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
    mod
  ));
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
  var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
  var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
  var __privateWrapper = (obj, member, setter, getter) => ({
    set _(value) {
      __privateSet(obj, member, value, setter);
    },
    get _() {
      return __privateGet(obj, member, getter);
    }
  });

  // node_modules/react/cjs/react.development.js
  var require_react_development = __commonJS({
    "node_modules/react/cjs/react.development.js"(exports, module) {
      "use strict";
      if (true) {
        (function() {
          "use strict";
          if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
            __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
          }
          var ReactVersion = "18.3.1";
          var REACT_ELEMENT_TYPE = Symbol.for("react.element");
          var REACT_PORTAL_TYPE = Symbol.for("react.portal");
          var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
          var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
          var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
          var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
          var REACT_CONTEXT_TYPE = Symbol.for("react.context");
          var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
          var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
          var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
          var REACT_MEMO_TYPE = Symbol.for("react.memo");
          var REACT_LAZY_TYPE = Symbol.for("react.lazy");
          var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
          var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
          var FAUX_ITERATOR_SYMBOL = "@@iterator";
          function getIteratorFn(maybeIterable) {
            if (maybeIterable === null || typeof maybeIterable !== "object") {
              return null;
            }
            var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
            if (typeof maybeIterator === "function") {
              return maybeIterator;
            }
            return null;
          }
          var ReactCurrentDispatcher = {
            /**
             * @internal
             * @type {ReactComponent}
             */
            current: null
          };
          var ReactCurrentBatchConfig = {
            transition: null
          };
          var ReactCurrentActQueue = {
            current: null,
            // Used to reproduce behavior of `batchedUpdates` in legacy mode.
            isBatchingLegacy: false,
            didScheduleLegacyUpdate: false
          };
          var ReactCurrentOwner = {
            /**
             * @internal
             * @type {ReactComponent}
             */
            current: null
          };
          var ReactDebugCurrentFrame = {};
          var currentExtraStackFrame = null;
          function setExtraStackFrame(stack) {
            {
              currentExtraStackFrame = stack;
            }
          }
          {
            ReactDebugCurrentFrame.setExtraStackFrame = function(stack) {
              {
                currentExtraStackFrame = stack;
              }
            };
            ReactDebugCurrentFrame.getCurrentStack = null;
            ReactDebugCurrentFrame.getStackAddendum = function() {
              var stack = "";
              if (currentExtraStackFrame) {
                stack += currentExtraStackFrame;
              }
              var impl = ReactDebugCurrentFrame.getCurrentStack;
              if (impl) {
                stack += impl() || "";
              }
              return stack;
            };
          }
          var enableScopeAPI = false;
          var enableCacheElement = false;
          var enableTransitionTracing = false;
          var enableLegacyHidden = false;
          var enableDebugTracing = false;
          var ReactSharedInternals = {
            ReactCurrentDispatcher,
            ReactCurrentBatchConfig,
            ReactCurrentOwner
          };
          {
            ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
            ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
          }
          function warn2(format2) {
            {
              {
                for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                  args[_key - 1] = arguments[_key];
                }
                printWarning("warn", format2, args);
              }
            }
          }
          function error(format2) {
            {
              {
                for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
                  args[_key2 - 1] = arguments[_key2];
                }
                printWarning("error", format2, args);
              }
            }
          }
          function printWarning(level, format2, args) {
            {
              var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
              var stack = ReactDebugCurrentFrame2.getStackAddendum();
              if (stack !== "") {
                format2 += "%s";
                args = args.concat([stack]);
              }
              var argsWithFormat = args.map(function(item) {
                return String(item);
              });
              argsWithFormat.unshift("Warning: " + format2);
              Function.prototype.apply.call(console[level], console, argsWithFormat);
            }
          }
          var didWarnStateUpdateForUnmountedComponent = {};
          function warnNoop(publicInstance, callerName) {
            {
              var _constructor = publicInstance.constructor;
              var componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass";
              var warningKey = componentName + "." + callerName;
              if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
                return;
              }
              error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, componentName);
              didWarnStateUpdateForUnmountedComponent[warningKey] = true;
            }
          }
          var ReactNoopUpdateQueue = {
            /**
             * Checks whether or not this composite component is mounted.
             * @param {ReactClass} publicInstance The instance we want to test.
             * @return {boolean} True if mounted, false otherwise.
             * @protected
             * @final
             */
            isMounted: function(publicInstance) {
              return false;
            },
            /**
             * Forces an update. This should only be invoked when it is known with
             * certainty that we are **not** in a DOM transaction.
             *
             * You may want to call this when you know that some deeper aspect of the
             * component's state has changed but `setState` was not called.
             *
             * This will not invoke `shouldComponentUpdate`, but it will invoke
             * `componentWillUpdate` and `componentDidUpdate`.
             *
             * @param {ReactClass} publicInstance The instance that should rerender.
             * @param {?function} callback Called after component is updated.
             * @param {?string} callerName name of the calling function in the public API.
             * @internal
             */
            enqueueForceUpdate: function(publicInstance, callback, callerName) {
              warnNoop(publicInstance, "forceUpdate");
            },
            /**
             * Replaces all of the state. Always use this or `setState` to mutate state.
             * You should treat `this.state` as immutable.
             *
             * There is no guarantee that `this.state` will be immediately updated, so
             * accessing `this.state` after calling this method may return the old value.
             *
             * @param {ReactClass} publicInstance The instance that should rerender.
             * @param {object} completeState Next state.
             * @param {?function} callback Called after component is updated.
             * @param {?string} callerName name of the calling function in the public API.
             * @internal
             */
            enqueueReplaceState: function(publicInstance, completeState, callback, callerName) {
              warnNoop(publicInstance, "replaceState");
            },
            /**
             * Sets a subset of the state. This only exists because _pendingState is
             * internal. This provides a merging strategy that is not available to deep
             * properties which is confusing. TODO: Expose pendingState or don't use it
             * during the merge.
             *
             * @param {ReactClass} publicInstance The instance that should rerender.
             * @param {object} partialState Next partial state to be merged with state.
             * @param {?function} callback Called after component is updated.
             * @param {?string} Name of the calling function in the public API.
             * @internal
             */
            enqueueSetState: function(publicInstance, partialState, callback, callerName) {
              warnNoop(publicInstance, "setState");
            }
          };
          var assign = Object.assign;
          var emptyObject = {};
          {
            Object.freeze(emptyObject);
          }
          function Component40(props, context, updater) {
            this.props = props;
            this.context = context;
            this.refs = emptyObject;
            this.updater = updater || ReactNoopUpdateQueue;
          }
          Component40.prototype.isReactComponent = {};
          Component40.prototype.setState = function(partialState, callback) {
            if (typeof partialState !== "object" && typeof partialState !== "function" && partialState != null) {
              throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
            }
            this.updater.enqueueSetState(this, partialState, callback, "setState");
          };
          Component40.prototype.forceUpdate = function(callback) {
            this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
          };
          {
            var deprecatedAPIs = {
              isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
              replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
            };
            var defineDeprecationWarning = function(methodName, info2) {
              Object.defineProperty(Component40.prototype, methodName, {
                get: function() {
                  warn2("%s(...) is deprecated in plain JavaScript React classes. %s", info2[0], info2[1]);
                  return void 0;
                }
              });
            };
            for (var fnName in deprecatedAPIs) {
              if (deprecatedAPIs.hasOwnProperty(fnName)) {
                defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
              }
            }
          }
          function ComponentDummy() {
          }
          ComponentDummy.prototype = Component40.prototype;
          function PureComponent2(props, context, updater) {
            this.props = props;
            this.context = context;
            this.refs = emptyObject;
            this.updater = updater || ReactNoopUpdateQueue;
          }
          var pureComponentPrototype = PureComponent2.prototype = new ComponentDummy();
          pureComponentPrototype.constructor = PureComponent2;
          assign(pureComponentPrototype, Component40.prototype);
          pureComponentPrototype.isPureReactComponent = true;
          function createRef29() {
            var refObject = {
              current: null
            };
            {
              Object.seal(refObject);
            }
            return refObject;
          }
          var isArrayImpl = Array.isArray;
          function isArray(a2) {
            return isArrayImpl(a2);
          }
          function typeName(value) {
            {
              var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
              var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
              return type;
            }
          }
          function willCoercionThrow(value) {
            {
              try {
                testStringCoercion(value);
                return false;
              } catch (e) {
                return true;
              }
            }
          }
          function testStringCoercion(value) {
            return "" + value;
          }
          function checkKeyStringCoercion(value) {
            {
              if (willCoercionThrow(value)) {
                error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
                return testStringCoercion(value);
              }
            }
          }
          function getWrappedName(outerType, innerType, wrapperName) {
            var displayName = outerType.displayName;
            if (displayName) {
              return displayName;
            }
            var functionName = innerType.displayName || innerType.name || "";
            return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
          }
          function getContextName(type) {
            return type.displayName || "Context";
          }
          function getComponentNameFromType(type) {
            if (type == null) {
              return null;
            }
            {
              if (typeof type.tag === "number") {
                error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
              }
            }
            if (typeof type === "function") {
              return type.displayName || type.name || null;
            }
            if (typeof type === "string") {
              return type;
            }
            switch (type) {
              case REACT_FRAGMENT_TYPE:
                return "Fragment";
              case REACT_PORTAL_TYPE:
                return "Portal";
              case REACT_PROFILER_TYPE:
                return "Profiler";
              case REACT_STRICT_MODE_TYPE:
                return "StrictMode";
              case REACT_SUSPENSE_TYPE:
                return "Suspense";
              case REACT_SUSPENSE_LIST_TYPE:
                return "SuspenseList";
            }
            if (typeof type === "object") {
              switch (type.$$typeof) {
                case REACT_CONTEXT_TYPE:
                  var context = type;
                  return getContextName(context) + ".Consumer";
                case REACT_PROVIDER_TYPE:
                  var provider = type;
                  return getContextName(provider._context) + ".Provider";
                case REACT_FORWARD_REF_TYPE:
                  return getWrappedName(type, type.render, "ForwardRef");
                case REACT_MEMO_TYPE:
                  var outerName = type.displayName || null;
                  if (outerName !== null) {
                    return outerName;
                  }
                  return getComponentNameFromType(type.type) || "Memo";
                case REACT_LAZY_TYPE: {
                  var lazyComponent = type;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    return getComponentNameFromType(init(payload));
                  } catch (x2) {
                    return null;
                  }
                }
              }
            }
            return null;
          }
          var hasOwnProperty = Object.prototype.hasOwnProperty;
          var RESERVED_PROPS = {
            key: true,
            ref: true,
            __self: true,
            __source: true
          };
          var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
          {
            didWarnAboutStringRefs = {};
          }
          function hasValidRef(config) {
            {
              if (hasOwnProperty.call(config, "ref")) {
                var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
                if (getter && getter.isReactWarning) {
                  return false;
                }
              }
            }
            return config.ref !== void 0;
          }
          function hasValidKey(config) {
            {
              if (hasOwnProperty.call(config, "key")) {
                var getter = Object.getOwnPropertyDescriptor(config, "key").get;
                if (getter && getter.isReactWarning) {
                  return false;
                }
              }
            }
            return config.key !== void 0;
          }
          function defineKeyPropWarningGetter(props, displayName) {
            var warnAboutAccessingKey = function() {
              {
                if (!specialPropKeyWarningShown) {
                  specialPropKeyWarningShown = true;
                  error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
                }
              }
            };
            warnAboutAccessingKey.isReactWarning = true;
            Object.defineProperty(props, "key", {
              get: warnAboutAccessingKey,
              configurable: true
            });
          }
          function defineRefPropWarningGetter(props, displayName) {
            var warnAboutAccessingRef = function() {
              {
                if (!specialPropRefWarningShown) {
                  specialPropRefWarningShown = true;
                  error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
                }
              }
            };
            warnAboutAccessingRef.isReactWarning = true;
            Object.defineProperty(props, "ref", {
              get: warnAboutAccessingRef,
              configurable: true
            });
          }
          function warnIfStringRefCannotBeAutoConverted(config) {
            {
              if (typeof config.ref === "string" && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
                var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
                if (!didWarnAboutStringRefs[componentName]) {
                  error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);
                  didWarnAboutStringRefs[componentName] = true;
                }
              }
            }
          }
          var ReactElement = function(type, key, ref, self2, source, owner, props) {
            var element = {
              // This tag allows us to uniquely identify this as a React Element
              $$typeof: REACT_ELEMENT_TYPE,
              // Built-in properties that belong on the element
              type,
              key,
              ref,
              props,
              // Record the component responsible for creating this element.
              _owner: owner
            };
            {
              element._store = {};
              Object.defineProperty(element._store, "validated", {
                configurable: false,
                enumerable: false,
                writable: true,
                value: false
              });
              Object.defineProperty(element, "_self", {
                configurable: false,
                enumerable: false,
                writable: false,
                value: self2
              });
              Object.defineProperty(element, "_source", {
                configurable: false,
                enumerable: false,
                writable: false,
                value: source
              });
              if (Object.freeze) {
                Object.freeze(element.props);
                Object.freeze(element);
              }
            }
            return element;
          };
          function createElement231(type, config, children) {
            var propName;
            var props = {};
            var key = null;
            var ref = null;
            var self2 = null;
            var source = null;
            if (config != null) {
              if (hasValidRef(config)) {
                ref = config.ref;
                {
                  warnIfStringRefCannotBeAutoConverted(config);
                }
              }
              if (hasValidKey(config)) {
                {
                  checkKeyStringCoercion(config.key);
                }
                key = "" + config.key;
              }
              self2 = config.__self === void 0 ? null : config.__self;
              source = config.__source === void 0 ? null : config.__source;
              for (propName in config) {
                if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
                  props[propName] = config[propName];
                }
              }
            }
            var childrenLength = arguments.length - 2;
            if (childrenLength === 1) {
              props.children = children;
            } else if (childrenLength > 1) {
              var childArray = Array(childrenLength);
              for (var i = 0; i < childrenLength; i++) {
                childArray[i] = arguments[i + 2];
              }
              {
                if (Object.freeze) {
                  Object.freeze(childArray);
                }
              }
              props.children = childArray;
            }
            if (type && type.defaultProps) {
              var defaultProps15 = type.defaultProps;
              for (propName in defaultProps15) {
                if (props[propName] === void 0) {
                  props[propName] = defaultProps15[propName];
                }
              }
            }
            {
              if (key || ref) {
                var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
                if (key) {
                  defineKeyPropWarningGetter(props, displayName);
                }
                if (ref) {
                  defineRefPropWarningGetter(props, displayName);
                }
              }
            }
            return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props);
          }
          function cloneAndReplaceKey(oldElement, newKey) {
            var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
            return newElement;
          }
          function cloneElement26(element, config, children) {
            if (element === null || element === void 0) {
              throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
            }
            var propName;
            var props = assign({}, element.props);
            var key = element.key;
            var ref = element.ref;
            var self2 = element._self;
            var source = element._source;
            var owner = element._owner;
            if (config != null) {
              if (hasValidRef(config)) {
                ref = config.ref;
                owner = ReactCurrentOwner.current;
              }
              if (hasValidKey(config)) {
                {
                  checkKeyStringCoercion(config.key);
                }
                key = "" + config.key;
              }
              var defaultProps15;
              if (element.type && element.type.defaultProps) {
                defaultProps15 = element.type.defaultProps;
              }
              for (propName in config) {
                if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
                  if (config[propName] === void 0 && defaultProps15 !== void 0) {
                    props[propName] = defaultProps15[propName];
                  } else {
                    props[propName] = config[propName];
                  }
                }
              }
            }
            var childrenLength = arguments.length - 2;
            if (childrenLength === 1) {
              props.children = children;
            } else if (childrenLength > 1) {
              var childArray = Array(childrenLength);
              for (var i = 0; i < childrenLength; i++) {
                childArray[i] = arguments[i + 2];
              }
              props.children = childArray;
            }
            return ReactElement(element.type, key, ref, self2, source, owner, props);
          }
          function isValidElement14(object) {
            return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
          }
          var SEPARATOR = ".";
          var SUBSEPARATOR = ":";
          function escape(key) {
            var escapeRegex = /[=:]/g;
            var escaperLookup = {
              "=": "=0",
              ":": "=2"
            };
            var escapedString = key.replace(escapeRegex, function(match) {
              return escaperLookup[match];
            });
            return "$" + escapedString;
          }
          var didWarnAboutMaps = false;
          var userProvidedKeyEscapeRegex = /\/+/g;
          function escapeUserProvidedKey(text) {
            return text.replace(userProvidedKeyEscapeRegex, "$&/");
          }
          function getElementKey(element, index) {
            if (typeof element === "object" && element !== null && element.key != null) {
              {
                checkKeyStringCoercion(element.key);
              }
              return escape("" + element.key);
            }
            return index.toString(36);
          }
          function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
            var type = typeof children;
            if (type === "undefined" || type === "boolean") {
              children = null;
            }
            var invokeCallback = false;
            if (children === null) {
              invokeCallback = true;
            } else {
              switch (type) {
                case "string":
                case "number":
                  invokeCallback = true;
                  break;
                case "object":
                  switch (children.$$typeof) {
                    case REACT_ELEMENT_TYPE:
                    case REACT_PORTAL_TYPE:
                      invokeCallback = true;
                  }
              }
            }
            if (invokeCallback) {
              var _child = children;
              var mappedChild = callback(_child);
              var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
              if (isArray(mappedChild)) {
                var escapedChildKey = "";
                if (childKey != null) {
                  escapedChildKey = escapeUserProvidedKey(childKey) + "/";
                }
                mapIntoArray(mappedChild, array, escapedChildKey, "", function(c2) {
                  return c2;
                });
              } else if (mappedChild != null) {
                if (isValidElement14(mappedChild)) {
                  {
                    if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
                      checkKeyStringCoercion(mappedChild.key);
                    }
                  }
                  mappedChild = cloneAndReplaceKey(
                    mappedChild,
                    // Keep both the (mapped) and old keys if they differ, just as
                    // traverseAllChildren used to do for objects as children
                    escapedPrefix + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
                    (mappedChild.key && (!_child || _child.key !== mappedChild.key) ? (
                      // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
                      // eslint-disable-next-line react-internal/safe-string-coercion
                      escapeUserProvidedKey("" + mappedChild.key) + "/"
                    ) : "") + childKey
                  );
                }
                array.push(mappedChild);
              }
              return 1;
            }
            var child;
            var nextName;
            var subtreeCount = 0;
            var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR;
            if (isArray(children)) {
              for (var i = 0; i < children.length; i++) {
                child = children[i];
                nextName = nextNamePrefix + getElementKey(child, i);
                subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
              }
            } else {
              var iteratorFn = getIteratorFn(children);
              if (typeof iteratorFn === "function") {
                var iterableChildren = children;
                {
                  if (iteratorFn === iterableChildren.entries) {
                    if (!didWarnAboutMaps) {
                      warn2("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
                    }
                    didWarnAboutMaps = true;
                  }
                }
                var iterator = iteratorFn.call(iterableChildren);
                var step;
                var ii = 0;
                while (!(step = iterator.next()).done) {
                  child = step.value;
                  nextName = nextNamePrefix + getElementKey(child, ii++);
                  subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
                }
              } else if (type === "object") {
                var childrenString = String(children);
                throw new Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + "). If you meant to render a collection of children, use an array instead.");
              }
            }
            return subtreeCount;
          }
          function mapChildren(children, func, context) {
            if (children == null) {
              return children;
            }
            var result = [];
            var count = 0;
            mapIntoArray(children, result, "", "", function(child) {
              return func.call(context, child, count++);
            });
            return result;
          }
          function countChildren(children) {
            var n = 0;
            mapChildren(children, function() {
              n++;
            });
            return n;
          }
          function forEachChildren(children, forEachFunc, forEachContext) {
            mapChildren(children, function() {
              forEachFunc.apply(this, arguments);
            }, forEachContext);
          }
          function toArray(children) {
            return mapChildren(children, function(child) {
              return child;
            }) || [];
          }
          function onlyChild(children) {
            if (!isValidElement14(children)) {
              throw new Error("React.Children.only expected to receive a single React element child.");
            }
            return children;
          }
          function createContext21(defaultValue) {
            var context = {
              $$typeof: REACT_CONTEXT_TYPE,
              // As a workaround to support multiple concurrent renderers, we categorize
              // some renderers as primary and others as secondary. We only expect
              // there to be two concurrent renderers at most: React Native (primary) and
              // Fabric (secondary); React DOM (primary) and React ART (secondary).
              // Secondary renderers store their context values on separate fields.
              _currentValue: defaultValue,
              _currentValue2: defaultValue,
              // Used to track how many concurrent renderers this context currently
              // supports within in a single renderer. Such as parallel server rendering.
              _threadCount: 0,
              // These are circular
              Provider: null,
              Consumer: null,
              // Add these to use same hidden class in VM as ServerContext
              _defaultValue: null,
              _globalName: null
            };
            context.Provider = {
              $$typeof: REACT_PROVIDER_TYPE,
              _context: context
            };
            var hasWarnedAboutUsingNestedContextConsumers = false;
            var hasWarnedAboutUsingConsumerProvider = false;
            var hasWarnedAboutDisplayNameOnConsumer = false;
            {
              var Consumer = {
                $$typeof: REACT_CONTEXT_TYPE,
                _context: context
              };
              Object.defineProperties(Consumer, {
                Provider: {
                  get: function() {
                    if (!hasWarnedAboutUsingConsumerProvider) {
                      hasWarnedAboutUsingConsumerProvider = true;
                      error("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?");
                    }
                    return context.Provider;
                  },
                  set: function(_Provider) {
                    context.Provider = _Provider;
                  }
                },
                _currentValue: {
                  get: function() {
                    return context._currentValue;
                  },
                  set: function(_currentValue) {
                    context._currentValue = _currentValue;
                  }
                },
                _currentValue2: {
                  get: function() {
                    return context._currentValue2;
                  },
                  set: function(_currentValue2) {
                    context._currentValue2 = _currentValue2;
                  }
                },
                _threadCount: {
                  get: function() {
                    return context._threadCount;
                  },
                  set: function(_threadCount) {
                    context._threadCount = _threadCount;
                  }
                },
                Consumer: {
                  get: function() {
                    if (!hasWarnedAboutUsingNestedContextConsumers) {
                      hasWarnedAboutUsingNestedContextConsumers = true;
                      error("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
                    }
                    return context.Consumer;
                  }
                },
                displayName: {
                  get: function() {
                    return context.displayName;
                  },
                  set: function(displayName) {
                    if (!hasWarnedAboutDisplayNameOnConsumer) {
                      warn2("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", displayName);
                      hasWarnedAboutDisplayNameOnConsumer = true;
                    }
                  }
                }
              });
              context.Consumer = Consumer;
            }
            {
              context._currentRenderer = null;
              context._currentRenderer2 = null;
            }
            return context;
          }
          var Uninitialized = -1;
          var Pending = 0;
          var Resolved = 1;
          var Rejected = 2;
          function lazyInitializer(payload) {
            if (payload._status === Uninitialized) {
              var ctor = payload._result;
              var thenable = ctor();
              thenable.then(function(moduleObject2) {
                if (payload._status === Pending || payload._status === Uninitialized) {
                  var resolved = payload;
                  resolved._status = Resolved;
                  resolved._result = moduleObject2;
                }
              }, function(error2) {
                if (payload._status === Pending || payload._status === Uninitialized) {
                  var rejected = payload;
                  rejected._status = Rejected;
                  rejected._result = error2;
                }
              });
              if (payload._status === Uninitialized) {
                var pending = payload;
                pending._status = Pending;
                pending._result = thenable;
              }
            }
            if (payload._status === Resolved) {
              var moduleObject = payload._result;
              {
                if (moduleObject === void 0) {
                  error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n  const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", moduleObject);
                }
              }
              {
                if (!("default" in moduleObject)) {
                  error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n  const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
                }
              }
              return moduleObject.default;
            } else {
              throw payload._result;
            }
          }
          function lazy(ctor) {
            var payload = {
              // We use these fields to store the result.
              _status: Uninitialized,
              _result: ctor
            };
            var lazyType = {
              $$typeof: REACT_LAZY_TYPE,
              _payload: payload,
              _init: lazyInitializer
            };
            {
              var defaultProps15;
              var propTypes;
              Object.defineProperties(lazyType, {
                defaultProps: {
                  configurable: true,
                  get: function() {
                    return defaultProps15;
                  },
                  set: function(newDefaultProps) {
                    error("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
                    defaultProps15 = newDefaultProps;
                    Object.defineProperty(lazyType, "defaultProps", {
                      enumerable: true
                    });
                  }
                },
                propTypes: {
                  configurable: true,
                  get: function() {
                    return propTypes;
                  },
                  set: function(newPropTypes) {
                    error("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
                    propTypes = newPropTypes;
                    Object.defineProperty(lazyType, "propTypes", {
                      enumerable: true
                    });
                  }
                }
              });
            }
            return lazyType;
          }
          function forwardRef38(render) {
            {
              if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
                error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).");
              } else if (typeof render !== "function") {
                error("forwardRef requires a render function but was given %s.", render === null ? "null" : typeof render);
              } else {
                if (render.length !== 0 && render.length !== 2) {
                  error("forwardRef render functions accept exactly two parameters: props and ref. %s", render.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined.");
                }
              }
              if (render != null) {
                if (render.defaultProps != null || render.propTypes != null) {
                  error("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
                }
              }
            }
            var elementType = {
              $$typeof: REACT_FORWARD_REF_TYPE,
              render
            };
            {
              var ownName;
              Object.defineProperty(elementType, "displayName", {
                enumerable: false,
                configurable: true,
                get: function() {
                  return ownName;
                },
                set: function(name2) {
                  ownName = name2;
                  if (!render.name && !render.displayName) {
                    render.displayName = name2;
                  }
                }
              });
            }
            return elementType;
          }
          var REACT_MODULE_REFERENCE;
          {
            REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
          }
          function isValidElementType(type) {
            if (typeof type === "string" || typeof type === "function") {
              return true;
            }
            if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
              return true;
            }
            if (typeof type === "object" && type !== null) {
              if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
              // types supported by any Flight configuration anywhere since
              // we don't know which Flight build this will end up being used
              // with.
              type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
                return true;
              }
            }
            return false;
          }
          function memo4(type, compare) {
            {
              if (!isValidElementType(type)) {
                error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type);
              }
            }
            var elementType = {
              $$typeof: REACT_MEMO_TYPE,
              type,
              compare: compare === void 0 ? null : compare
            };
            {
              var ownName;
              Object.defineProperty(elementType, "displayName", {
                enumerable: false,
                configurable: true,
                get: function() {
                  return ownName;
                },
                set: function(name2) {
                  ownName = name2;
                  if (!type.name && !type.displayName) {
                    type.displayName = name2;
                  }
                }
              });
            }
            return elementType;
          }
          function resolveDispatcher() {
            var dispatcher = ReactCurrentDispatcher.current;
            {
              if (dispatcher === null) {
                error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
              }
            }
            return dispatcher;
          }
          function useContext20(Context) {
            var dispatcher = resolveDispatcher();
            {
              if (Context._context !== void 0) {
                var realContext = Context._context;
                if (realContext.Consumer === Context) {
                  error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");
                } else if (realContext.Provider === Context) {
                  error("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
                }
              }
            }
            return dispatcher.useContext(Context);
          }
          function useState37(initialState2) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useState(initialState2);
          }
          function useReducer2(reducer2, initialArg, init) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useReducer(reducer2, initialArg, init);
          }
          function useRef34(initialValue) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useRef(initialValue);
          }
          function useEffect38(create, deps) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useEffect(create, deps);
          }
          function useInsertionEffect(create, deps) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useInsertionEffect(create, deps);
          }
          function useLayoutEffect2(create, deps) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useLayoutEffect(create, deps);
          }
          function useCallback5(callback, deps) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useCallback(callback, deps);
          }
          function useMemo7(create, deps) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useMemo(create, deps);
          }
          function useImperativeHandle4(ref, create, deps) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useImperativeHandle(ref, create, deps);
          }
          function useDebugValue(value, formatterFn) {
            {
              var dispatcher = resolveDispatcher();
              return dispatcher.useDebugValue(value, formatterFn);
            }
          }
          function useTransition() {
            var dispatcher = resolveDispatcher();
            return dispatcher.useTransition();
          }
          function useDeferredValue(value) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useDeferredValue(value);
          }
          function useId() {
            var dispatcher = resolveDispatcher();
            return dispatcher.useId();
          }
          function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
            var dispatcher = resolveDispatcher();
            return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
          }
          var disabledDepth = 0;
          var prevLog;
          var prevInfo;
          var prevWarn;
          var prevError;
          var prevGroup;
          var prevGroupCollapsed;
          var prevGroupEnd;
          function disabledLog() {
          }
          disabledLog.__reactDisabledLog = true;
          function disableLogs() {
            {
              if (disabledDepth === 0) {
                prevLog = console.log;
                prevInfo = console.info;
                prevWarn = console.warn;
                prevError = console.error;
                prevGroup = console.group;
                prevGroupCollapsed = console.groupCollapsed;
                prevGroupEnd = console.groupEnd;
                var props = {
                  configurable: true,
                  enumerable: true,
                  value: disabledLog,
                  writable: true
                };
                Object.defineProperties(console, {
                  info: props,
                  log: props,
                  warn: props,
                  error: props,
                  group: props,
                  groupCollapsed: props,
                  groupEnd: props
                });
              }
              disabledDepth++;
            }
          }
          function reenableLogs() {
            {
              disabledDepth--;
              if (disabledDepth === 0) {
                var props = {
                  configurable: true,
                  enumerable: true,
                  writable: true
                };
                Object.defineProperties(console, {
                  log: assign({}, props, {
                    value: prevLog
                  }),
                  info: assign({}, props, {
                    value: prevInfo
                  }),
                  warn: assign({}, props, {
                    value: prevWarn
                  }),
                  error: assign({}, props, {
                    value: prevError
                  }),
                  group: assign({}, props, {
                    value: prevGroup
                  }),
                  groupCollapsed: assign({}, props, {
                    value: prevGroupCollapsed
                  }),
                  groupEnd: assign({}, props, {
                    value: prevGroupEnd
                  })
                });
              }
              if (disabledDepth < 0) {
                error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
              }
            }
          }
          var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
          var prefix;
          function describeBuiltInComponentFrame(name2, source, ownerFn) {
            {
              if (prefix === void 0) {
                try {
                  throw Error();
                } catch (x2) {
                  var match = x2.stack.trim().match(/\n( *(at )?)/);
                  prefix = match && match[1] || "";
                }
              }
              return "\n" + prefix + name2;
            }
          }
          var reentry = false;
          var componentFrameCache;
          {
            var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
            componentFrameCache = new PossiblyWeakMap();
          }
          function describeNativeComponentFrame(fn, construct) {
            if (!fn || reentry) {
              return "";
            }
            {
              var frame2 = componentFrameCache.get(fn);
              if (frame2 !== void 0) {
                return frame2;
              }
            }
            var control;
            reentry = true;
            var previousPrepareStackTrace = Error.prepareStackTrace;
            Error.prepareStackTrace = void 0;
            var previousDispatcher;
            {
              previousDispatcher = ReactCurrentDispatcher$1.current;
              ReactCurrentDispatcher$1.current = null;
              disableLogs();
            }
            try {
              if (construct) {
                var Fake = function() {
                  throw Error();
                };
                Object.defineProperty(Fake.prototype, "props", {
                  set: function() {
                    throw Error();
                  }
                });
                if (typeof Reflect === "object" && Reflect.construct) {
                  try {
                    Reflect.construct(Fake, []);
                  } catch (x2) {
                    control = x2;
                  }
                  Reflect.construct(fn, [], Fake);
                } else {
                  try {
                    Fake.call();
                  } catch (x2) {
                    control = x2;
                  }
                  fn.call(Fake.prototype);
                }
              } else {
                try {
                  throw Error();
                } catch (x2) {
                  control = x2;
                }
                fn();
              }
            } catch (sample) {
              if (sample && control && typeof sample.stack === "string") {
                var sampleLines = sample.stack.split("\n");
                var controlLines = control.stack.split("\n");
                var s2 = sampleLines.length - 1;
                var c2 = controlLines.length - 1;
                while (s2 >= 1 && c2 >= 0 && sampleLines[s2] !== controlLines[c2]) {
                  c2--;
                }
                for (; s2 >= 1 && c2 >= 0; s2--, c2--) {
                  if (sampleLines[s2] !== controlLines[c2]) {
                    if (s2 !== 1 || c2 !== 1) {
                      do {
                        s2--;
                        c2--;
                        if (c2 < 0 || sampleLines[s2] !== controlLines[c2]) {
                          var _frame = "\n" + sampleLines[s2].replace(" at new ", " at ");
                          if (fn.displayName && _frame.includes("<anonymous>")) {
                            _frame = _frame.replace("<anonymous>", fn.displayName);
                          }
                          {
                            if (typeof fn === "function") {
                              componentFrameCache.set(fn, _frame);
                            }
                          }
                          return _frame;
                        }
                      } while (s2 >= 1 && c2 >= 0);
                    }
                    break;
                  }
                }
              }
            } finally {
              reentry = false;
              {
                ReactCurrentDispatcher$1.current = previousDispatcher;
                reenableLogs();
              }
              Error.prepareStackTrace = previousPrepareStackTrace;
            }
            var name2 = fn ? fn.displayName || fn.name : "";
            var syntheticFrame = name2 ? describeBuiltInComponentFrame(name2) : "";
            {
              if (typeof fn === "function") {
                componentFrameCache.set(fn, syntheticFrame);
              }
            }
            return syntheticFrame;
          }
          function describeFunctionComponentFrame(fn, source, ownerFn) {
            {
              return describeNativeComponentFrame(fn, false);
            }
          }
          function shouldConstruct(Component41) {
            var prototype = Component41.prototype;
            return !!(prototype && prototype.isReactComponent);
          }
          function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
            if (type == null) {
              return "";
            }
            if (typeof type === "function") {
              {
                return describeNativeComponentFrame(type, shouldConstruct(type));
              }
            }
            if (typeof type === "string") {
              return describeBuiltInComponentFrame(type);
            }
            switch (type) {
              case REACT_SUSPENSE_TYPE:
                return describeBuiltInComponentFrame("Suspense");
              case REACT_SUSPENSE_LIST_TYPE:
                return describeBuiltInComponentFrame("SuspenseList");
            }
            if (typeof type === "object") {
              switch (type.$$typeof) {
                case REACT_FORWARD_REF_TYPE:
                  return describeFunctionComponentFrame(type.render);
                case REACT_MEMO_TYPE:
                  return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
                case REACT_LAZY_TYPE: {
                  var lazyComponent = type;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
                  } catch (x2) {
                  }
                }
              }
            }
            return "";
          }
          var loggedTypeFailures = {};
          var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
          function setCurrentlyValidatingElement(element) {
            {
              if (element) {
                var owner = element._owner;
                var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
                ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
              } else {
                ReactDebugCurrentFrame$1.setExtraStackFrame(null);
              }
            }
          }
          function checkPropTypes(typeSpecs, values, location, componentName, element) {
            {
              var has = Function.call.bind(hasOwnProperty);
              for (var typeSpecName in typeSpecs) {
                if (has(typeSpecs, typeSpecName)) {
                  var error$1 = void 0;
                  try {
                    if (typeof typeSpecs[typeSpecName] !== "function") {
                      var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                      err.name = "Invariant Violation";
                      throw err;
                    }
                    error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
                  } catch (ex) {
                    error$1 = ex;
                  }
                  if (error$1 && !(error$1 instanceof Error)) {
                    setCurrentlyValidatingElement(element);
                    error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
                    setCurrentlyValidatingElement(null);
                  }
                  if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
                    loggedTypeFailures[error$1.message] = true;
                    setCurrentlyValidatingElement(element);
                    error("Failed %s type: %s", location, error$1.message);
                    setCurrentlyValidatingElement(null);
                  }
                }
              }
            }
          }
          function setCurrentlyValidatingElement$1(element) {
            {
              if (element) {
                var owner = element._owner;
                var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
                setExtraStackFrame(stack);
              } else {
                setExtraStackFrame(null);
              }
            }
          }
          var propTypesMisspellWarningShown;
          {
            propTypesMisspellWarningShown = false;
          }
          function getDeclarationErrorAddendum() {
            if (ReactCurrentOwner.current) {
              var name2 = getComponentNameFromType(ReactCurrentOwner.current.type);
              if (name2) {
                return "\n\nCheck the render method of `" + name2 + "`.";
              }
            }
            return "";
          }
          function getSourceInfoErrorAddendum(source) {
            if (source !== void 0) {
              var fileName = source.fileName.replace(/^.*[\\\/]/, "");
              var lineNumber = source.lineNumber;
              return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
            }
            return "";
          }
          function getSourceInfoErrorAddendumForProps(elementProps) {
            if (elementProps !== null && elementProps !== void 0) {
              return getSourceInfoErrorAddendum(elementProps.__source);
            }
            return "";
          }
          var ownerHasKeyUseWarning = {};
          function getCurrentComponentErrorInfo(parentType) {
            var info2 = getDeclarationErrorAddendum();
            if (!info2) {
              var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
              if (parentName) {
                info2 = "\n\nCheck the top-level render call using <" + parentName + ">.";
              }
            }
            return info2;
          }
          function validateExplicitKey(element, parentType) {
            if (!element._store || element._store.validated || element.key != null) {
              return;
            }
            element._store.validated = true;
            var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
            if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
              return;
            }
            ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
            var childOwner = "";
            if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
              childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
            }
            {
              setCurrentlyValidatingElement$1(element);
              error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
              setCurrentlyValidatingElement$1(null);
            }
          }
          function validateChildKeys(node, parentType) {
            if (typeof node !== "object") {
              return;
            }
            if (isArray(node)) {
              for (var i = 0; i < node.length; i++) {
                var child = node[i];
                if (isValidElement14(child)) {
                  validateExplicitKey(child, parentType);
                }
              }
            } else if (isValidElement14(node)) {
              if (node._store) {
                node._store.validated = true;
              }
            } else if (node) {
              var iteratorFn = getIteratorFn(node);
              if (typeof iteratorFn === "function") {
                if (iteratorFn !== node.entries) {
                  var iterator = iteratorFn.call(node);
                  var step;
                  while (!(step = iterator.next()).done) {
                    if (isValidElement14(step.value)) {
                      validateExplicitKey(step.value, parentType);
                    }
                  }
                }
              }
            }
          }
          function validatePropTypes(element) {
            {
              var type = element.type;
              if (type === null || type === void 0 || typeof type === "string") {
                return;
              }
              var propTypes;
              if (typeof type === "function") {
                propTypes = type.propTypes;
              } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
              // Inner props are checked in the reconciler.
              type.$$typeof === REACT_MEMO_TYPE)) {
                propTypes = type.propTypes;
              } else {
                return;
              }
              if (propTypes) {
                var name2 = getComponentNameFromType(type);
                checkPropTypes(propTypes, element.props, "prop", name2, element);
              } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
                propTypesMisspellWarningShown = true;
                var _name = getComponentNameFromType(type);
                error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
              }
              if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
                error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
              }
            }
          }
          function validateFragmentProps(fragment) {
            {
              var keys = Object.keys(fragment.props);
              for (var i = 0; i < keys.length; i++) {
                var key = keys[i];
                if (key !== "children" && key !== "key") {
                  setCurrentlyValidatingElement$1(fragment);
                  error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
                  setCurrentlyValidatingElement$1(null);
                  break;
                }
              }
              if (fragment.ref !== null) {
                setCurrentlyValidatingElement$1(fragment);
                error("Invalid attribute `ref` supplied to `React.Fragment`.");
                setCurrentlyValidatingElement$1(null);
              }
            }
          }
          function createElementWithValidation(type, props, children) {
            var validType = isValidElementType(type);
            if (!validType) {
              var info2 = "";
              if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
                info2 += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
              }
              var sourceInfo = getSourceInfoErrorAddendumForProps(props);
              if (sourceInfo) {
                info2 += sourceInfo;
              } else {
                info2 += getDeclarationErrorAddendum();
              }
              var typeString;
              if (type === null) {
                typeString = "null";
              } else if (isArray(type)) {
                typeString = "array";
              } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
                typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
                info2 = " Did you accidentally export a JSX literal instead of a component?";
              } else {
                typeString = typeof type;
              }
              {
                error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info2);
              }
            }
            var element = createElement231.apply(this, arguments);
            if (element == null) {
              return element;
            }
            if (validType) {
              for (var i = 2; i < arguments.length; i++) {
                validateChildKeys(arguments[i], type);
              }
            }
            if (type === REACT_FRAGMENT_TYPE) {
              validateFragmentProps(element);
            } else {
              validatePropTypes(element);
            }
            return element;
          }
          var didWarnAboutDeprecatedCreateFactory = false;
          function createFactoryWithValidation(type) {
            var validatedFactory = createElementWithValidation.bind(null, type);
            validatedFactory.type = type;
            {
              if (!didWarnAboutDeprecatedCreateFactory) {
                didWarnAboutDeprecatedCreateFactory = true;
                warn2("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.");
              }
              Object.defineProperty(validatedFactory, "type", {
                enumerable: false,
                get: function() {
                  warn2("Factory.type is deprecated. Access the class directly before passing it to createFactory.");
                  Object.defineProperty(this, "type", {
                    value: type
                  });
                  return type;
                }
              });
            }
            return validatedFactory;
          }
          function cloneElementWithValidation(element, props, children) {
            var newElement = cloneElement26.apply(this, arguments);
            for (var i = 2; i < arguments.length; i++) {
              validateChildKeys(arguments[i], newElement.type);
            }
            validatePropTypes(newElement);
            return newElement;
          }
          function startTransition(scope, options5) {
            var prevTransition = ReactCurrentBatchConfig.transition;
            ReactCurrentBatchConfig.transition = {};
            var currentTransition = ReactCurrentBatchConfig.transition;
            {
              ReactCurrentBatchConfig.transition._updatedFibers = /* @__PURE__ */ new Set();
            }
            try {
              scope();
            } finally {
              ReactCurrentBatchConfig.transition = prevTransition;
              {
                if (prevTransition === null && currentTransition._updatedFibers) {
                  var updatedFibersCount = currentTransition._updatedFibers.size;
                  if (updatedFibersCount > 10) {
                    warn2("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");
                  }
                  currentTransition._updatedFibers.clear();
                }
              }
            }
          }
          var didWarnAboutMessageChannel = false;
          var enqueueTaskImpl = null;
          function enqueueTask(task) {
            if (enqueueTaskImpl === null) {
              try {
                var requireString = ("require" + Math.random()).slice(0, 7);
                var nodeRequire = module && module[requireString];
                enqueueTaskImpl = nodeRequire.call(module, "timers").setImmediate;
              } catch (_err) {
                enqueueTaskImpl = function(callback) {
                  {
                    if (didWarnAboutMessageChannel === false) {
                      didWarnAboutMessageChannel = true;
                      if (typeof MessageChannel === "undefined") {
                        error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.");
                      }
                    }
                  }
                  var channel = new MessageChannel();
                  channel.port1.onmessage = callback;
                  channel.port2.postMessage(void 0);
                };
              }
            }
            return enqueueTaskImpl(task);
          }
          var actScopeDepth = 0;
          var didWarnNoAwaitAct = false;
          function act(callback) {
            {
              var prevActScopeDepth = actScopeDepth;
              actScopeDepth++;
              if (ReactCurrentActQueue.current === null) {
                ReactCurrentActQueue.current = [];
              }
              var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
              var result;
              try {
                ReactCurrentActQueue.isBatchingLegacy = true;
                result = callback();
                if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
                  var queue = ReactCurrentActQueue.current;
                  if (queue !== null) {
                    ReactCurrentActQueue.didScheduleLegacyUpdate = false;
                    flushActQueue(queue);
                  }
                }
              } catch (error2) {
                popActScope(prevActScopeDepth);
                throw error2;
              } finally {
                ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
              }
              if (result !== null && typeof result === "object" && typeof result.then === "function") {
                var thenableResult = result;
                var wasAwaited = false;
                var thenable = {
                  then: function(resolve, reject) {
                    wasAwaited = true;
                    thenableResult.then(function(returnValue2) {
                      popActScope(prevActScopeDepth);
                      if (actScopeDepth === 0) {
                        recursivelyFlushAsyncActWork(returnValue2, resolve, reject);
                      } else {
                        resolve(returnValue2);
                      }
                    }, function(error2) {
                      popActScope(prevActScopeDepth);
                      reject(error2);
                    });
                  }
                };
                {
                  if (!didWarnNoAwaitAct && typeof Promise !== "undefined") {
                    Promise.resolve().then(function() {
                    }).then(function() {
                      if (!wasAwaited) {
                        didWarnNoAwaitAct = true;
                        error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);");
                      }
                    });
                  }
                }
                return thenable;
              } else {
                var returnValue = result;
                popActScope(prevActScopeDepth);
                if (actScopeDepth === 0) {
                  var _queue2 = ReactCurrentActQueue.current;
                  if (_queue2 !== null) {
                    flushActQueue(_queue2);
                    ReactCurrentActQueue.current = null;
                  }
                  var _thenable = {
                    then: function(resolve, reject) {
                      if (ReactCurrentActQueue.current === null) {
                        ReactCurrentActQueue.current = [];
                        recursivelyFlushAsyncActWork(returnValue, resolve, reject);
                      } else {
                        resolve(returnValue);
                      }
                    }
                  };
                  return _thenable;
                } else {
                  var _thenable2 = {
                    then: function(resolve, reject) {
                      resolve(returnValue);
                    }
                  };
                  return _thenable2;
                }
              }
            }
          }
          function popActScope(prevActScopeDepth) {
            {
              if (prevActScopeDepth !== actScopeDepth - 1) {
                error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");
              }
              actScopeDepth = prevActScopeDepth;
            }
          }
          function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
            {
              var queue = ReactCurrentActQueue.current;
              if (queue !== null) {
                try {
                  flushActQueue(queue);
                  enqueueTask(function() {
                    if (queue.length === 0) {
                      ReactCurrentActQueue.current = null;
                      resolve(returnValue);
                    } else {
                      recursivelyFlushAsyncActWork(returnValue, resolve, reject);
                    }
                  });
                } catch (error2) {
                  reject(error2);
                }
              } else {
                resolve(returnValue);
              }
            }
          }
          var isFlushing = false;
          function flushActQueue(queue) {
            {
              if (!isFlushing) {
                isFlushing = true;
                var i = 0;
                try {
                  for (; i < queue.length; i++) {
                    var callback = queue[i];
                    do {
                      callback = callback(true);
                    } while (callback !== null);
                  }
                  queue.length = 0;
                } catch (error2) {
                  queue = queue.slice(i + 1);
                  throw error2;
                } finally {
                  isFlushing = false;
                }
              }
            }
          }
          var createElement$1 = createElementWithValidation;
          var cloneElement$1 = cloneElementWithValidation;
          var createFactory = createFactoryWithValidation;
          var Children15 = {
            map: mapChildren,
            forEach: forEachChildren,
            count: countChildren,
            toArray,
            only: onlyChild
          };
          exports.Children = Children15;
          exports.Component = Component40;
          exports.Fragment = REACT_FRAGMENT_TYPE;
          exports.Profiler = REACT_PROFILER_TYPE;
          exports.PureComponent = PureComponent2;
          exports.StrictMode = REACT_STRICT_MODE_TYPE;
          exports.Suspense = REACT_SUSPENSE_TYPE;
          exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
          exports.act = act;
          exports.cloneElement = cloneElement$1;
          exports.createContext = createContext21;
          exports.createElement = createElement$1;
          exports.createFactory = createFactory;
          exports.createRef = createRef29;
          exports.forwardRef = forwardRef38;
          exports.isValidElement = isValidElement14;
          exports.lazy = lazy;
          exports.memo = memo4;
          exports.startTransition = startTransition;
          exports.unstable_act = act;
          exports.useCallback = useCallback5;
          exports.useContext = useContext20;
          exports.useDebugValue = useDebugValue;
          exports.useDeferredValue = useDeferredValue;
          exports.useEffect = useEffect38;
          exports.useId = useId;
          exports.useImperativeHandle = useImperativeHandle4;
          exports.useInsertionEffect = useInsertionEffect;
          exports.useLayoutEffect = useLayoutEffect2;
          exports.useMemo = useMemo7;
          exports.useReducer = useReducer2;
          exports.useRef = useRef34;
          exports.useState = useState37;
          exports.useSyncExternalStore = useSyncExternalStore;
          exports.useTransition = useTransition;
          exports.version = ReactVersion;
          if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
            __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
          }
        })();
      }
    }
  });

  // node_modules/react/index.js
  var require_react = __commonJS({
    "node_modules/react/index.js"(exports, module) {
      "use strict";
      if (false) {
        module.exports = null;
      } else {
        module.exports = require_react_development();
      }
    }
  });

  // node_modules/scheduler/cjs/scheduler.development.js
  var require_scheduler_development = __commonJS({
    "node_modules/scheduler/cjs/scheduler.development.js"(exports) {
      "use strict";
      if (true) {
        (function() {
          "use strict";
          if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
            __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
          }
          var enableSchedulerDebugging = false;
          var enableProfiling = false;
          var frameYieldMs = 5;
          function push(heap, node) {
            var index = heap.length;
            heap.push(node);
            siftUp(heap, node, index);
          }
          function peek(heap) {
            return heap.length === 0 ? null : heap[0];
          }
          function pop(heap) {
            if (heap.length === 0) {
              return null;
            }
            var first = heap[0];
            var last = heap.pop();
            if (last !== first) {
              heap[0] = last;
              siftDown(heap, last, 0);
            }
            return first;
          }
          function siftUp(heap, node, i) {
            var index = i;
            while (index > 0) {
              var parentIndex = index - 1 >>> 1;
              var parent2 = heap[parentIndex];
              if (compare(parent2, node) > 0) {
                heap[parentIndex] = node;
                heap[index] = parent2;
                index = parentIndex;
              } else {
                return;
              }
            }
          }
          function siftDown(heap, node, i) {
            var index = i;
            var length = heap.length;
            var halfLength = length >>> 1;
            while (index < halfLength) {
              var leftIndex = (index + 1) * 2 - 1;
              var left2 = heap[leftIndex];
              var rightIndex = leftIndex + 1;
              var right2 = heap[rightIndex];
              if (compare(left2, node) < 0) {
                if (rightIndex < length && compare(right2, left2) < 0) {
                  heap[index] = right2;
                  heap[rightIndex] = node;
                  index = rightIndex;
                } else {
                  heap[index] = left2;
                  heap[leftIndex] = node;
                  index = leftIndex;
                }
              } else if (rightIndex < length && compare(right2, node) < 0) {
                heap[index] = right2;
                heap[rightIndex] = node;
                index = rightIndex;
              } else {
                return;
              }
            }
          }
          function compare(a2, b) {
            var diff = a2.sortIndex - b.sortIndex;
            return diff !== 0 ? diff : a2.id - b.id;
          }
          var ImmediatePriority = 1;
          var UserBlockingPriority = 2;
          var NormalPriority = 3;
          var LowPriority = 4;
          var IdlePriority = 5;
          function markTaskErrored(task, ms) {
          }
          var hasPerformanceNow = typeof performance === "object" && typeof performance.now === "function";
          if (hasPerformanceNow) {
            var localPerformance = performance;
            exports.unstable_now = function() {
              return localPerformance.now();
            };
          } else {
            var localDate2 = Date;
            var initialTime = localDate2.now();
            exports.unstable_now = function() {
              return localDate2.now() - initialTime;
            };
          }
          var maxSigned31BitInt = 1073741823;
          var IMMEDIATE_PRIORITY_TIMEOUT = -1;
          var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
          var NORMAL_PRIORITY_TIMEOUT = 5e3;
          var LOW_PRIORITY_TIMEOUT = 1e4;
          var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt;
          var taskQueue = [];
          var timerQueue = [];
          var taskIdCounter = 1;
          var currentTask = null;
          var currentPriorityLevel = NormalPriority;
          var isPerformingWork = false;
          var isHostCallbackScheduled = false;
          var isHostTimeoutScheduled = false;
          var localSetTimeout = typeof setTimeout === "function" ? setTimeout : null;
          var localClearTimeout = typeof clearTimeout === "function" ? clearTimeout : null;
          var localSetImmediate = typeof setImmediate !== "undefined" ? setImmediate : null;
          var isInputPending = typeof navigator !== "undefined" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null;
          function advanceTimers(currentTime) {
            var timer2 = peek(timerQueue);
            while (timer2 !== null) {
              if (timer2.callback === null) {
                pop(timerQueue);
              } else if (timer2.startTime <= currentTime) {
                pop(timerQueue);
                timer2.sortIndex = timer2.expirationTime;
                push(taskQueue, timer2);
              } else {
                return;
              }
              timer2 = peek(timerQueue);
            }
          }
          function handleTimeout(currentTime) {
            isHostTimeoutScheduled = false;
            advanceTimers(currentTime);
            if (!isHostCallbackScheduled) {
              if (peek(taskQueue) !== null) {
                isHostCallbackScheduled = true;
                requestHostCallback(flushWork);
              } else {
                var firstTimer = peek(timerQueue);
                if (firstTimer !== null) {
                  requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
                }
              }
            }
          }
          function flushWork(hasTimeRemaining, initialTime2) {
            isHostCallbackScheduled = false;
            if (isHostTimeoutScheduled) {
              isHostTimeoutScheduled = false;
              cancelHostTimeout();
            }
            isPerformingWork = true;
            var previousPriorityLevel = currentPriorityLevel;
            try {
              if (enableProfiling) {
                try {
                  return workLoop(hasTimeRemaining, initialTime2);
                } catch (error) {
                  if (currentTask !== null) {
                    var currentTime = exports.unstable_now();
                    markTaskErrored(currentTask, currentTime);
                    currentTask.isQueued = false;
                  }
                  throw error;
                }
              } else {
                return workLoop(hasTimeRemaining, initialTime2);
              }
            } finally {
              currentTask = null;
              currentPriorityLevel = previousPriorityLevel;
              isPerformingWork = false;
            }
          }
          function workLoop(hasTimeRemaining, initialTime2) {
            var currentTime = initialTime2;
            advanceTimers(currentTime);
            currentTask = peek(taskQueue);
            while (currentTask !== null && !enableSchedulerDebugging) {
              if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
                break;
              }
              var callback = currentTask.callback;
              if (typeof callback === "function") {
                currentTask.callback = null;
                currentPriorityLevel = currentTask.priorityLevel;
                var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
                var continuationCallback = callback(didUserCallbackTimeout);
                currentTime = exports.unstable_now();
                if (typeof continuationCallback === "function") {
                  currentTask.callback = continuationCallback;
                } else {
                  if (currentTask === peek(taskQueue)) {
                    pop(taskQueue);
                  }
                }
                advanceTimers(currentTime);
              } else {
                pop(taskQueue);
              }
              currentTask = peek(taskQueue);
            }
            if (currentTask !== null) {
              return true;
            } else {
              var firstTimer = peek(timerQueue);
              if (firstTimer !== null) {
                requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
              }
              return false;
            }
          }
          function unstable_runWithPriority(priorityLevel, eventHandler) {
            switch (priorityLevel) {
              case ImmediatePriority:
              case UserBlockingPriority:
              case NormalPriority:
              case LowPriority:
              case IdlePriority:
                break;
              default:
                priorityLevel = NormalPriority;
            }
            var previousPriorityLevel = currentPriorityLevel;
            currentPriorityLevel = priorityLevel;
            try {
              return eventHandler();
            } finally {
              currentPriorityLevel = previousPriorityLevel;
            }
          }
          function unstable_next(eventHandler) {
            var priorityLevel;
            switch (currentPriorityLevel) {
              case ImmediatePriority:
              case UserBlockingPriority:
              case NormalPriority:
                priorityLevel = NormalPriority;
                break;
              default:
                priorityLevel = currentPriorityLevel;
                break;
            }
            var previousPriorityLevel = currentPriorityLevel;
            currentPriorityLevel = priorityLevel;
            try {
              return eventHandler();
            } finally {
              currentPriorityLevel = previousPriorityLevel;
            }
          }
          function unstable_wrapCallback(callback) {
            var parentPriorityLevel = currentPriorityLevel;
            return function() {
              var previousPriorityLevel = currentPriorityLevel;
              currentPriorityLevel = parentPriorityLevel;
              try {
                return callback.apply(this, arguments);
              } finally {
                currentPriorityLevel = previousPriorityLevel;
              }
            };
          }
          function unstable_scheduleCallback(priorityLevel, callback, options5) {
            var currentTime = exports.unstable_now();
            var startTime2;
            if (typeof options5 === "object" && options5 !== null) {
              var delay3 = options5.delay;
              if (typeof delay3 === "number" && delay3 > 0) {
                startTime2 = currentTime + delay3;
              } else {
                startTime2 = currentTime;
              }
            } else {
              startTime2 = currentTime;
            }
            var timeout2;
            switch (priorityLevel) {
              case ImmediatePriority:
                timeout2 = IMMEDIATE_PRIORITY_TIMEOUT;
                break;
              case UserBlockingPriority:
                timeout2 = USER_BLOCKING_PRIORITY_TIMEOUT;
                break;
              case IdlePriority:
                timeout2 = IDLE_PRIORITY_TIMEOUT;
                break;
              case LowPriority:
                timeout2 = LOW_PRIORITY_TIMEOUT;
                break;
              case NormalPriority:
              default:
                timeout2 = NORMAL_PRIORITY_TIMEOUT;
                break;
            }
            var expirationTime = startTime2 + timeout2;
            var newTask = {
              id: taskIdCounter++,
              callback,
              priorityLevel,
              startTime: startTime2,
              expirationTime,
              sortIndex: -1
            };
            if (startTime2 > currentTime) {
              newTask.sortIndex = startTime2;
              push(timerQueue, newTask);
              if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
                if (isHostTimeoutScheduled) {
                  cancelHostTimeout();
                } else {
                  isHostTimeoutScheduled = true;
                }
                requestHostTimeout(handleTimeout, startTime2 - currentTime);
              }
            } else {
              newTask.sortIndex = expirationTime;
              push(taskQueue, newTask);
              if (!isHostCallbackScheduled && !isPerformingWork) {
                isHostCallbackScheduled = true;
                requestHostCallback(flushWork);
              }
            }
            return newTask;
          }
          function unstable_pauseExecution() {
          }
          function unstable_continueExecution() {
            if (!isHostCallbackScheduled && !isPerformingWork) {
              isHostCallbackScheduled = true;
              requestHostCallback(flushWork);
            }
          }
          function unstable_getFirstCallbackNode() {
            return peek(taskQueue);
          }
          function unstable_cancelCallback(task) {
            task.callback = null;
          }
          function unstable_getCurrentPriorityLevel() {
            return currentPriorityLevel;
          }
          var isMessageLoopRunning = false;
          var scheduledHostCallback = null;
          var taskTimeoutID = -1;
          var frameInterval = frameYieldMs;
          var startTime = -1;
          function shouldYieldToHost() {
            var timeElapsed = exports.unstable_now() - startTime;
            if (timeElapsed < frameInterval) {
              return false;
            }
            return true;
          }
          function requestPaint() {
          }
          function forceFrameRate(fps) {
            if (fps < 0 || fps > 125) {
              console["error"]("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");
              return;
            }
            if (fps > 0) {
              frameInterval = Math.floor(1e3 / fps);
            } else {
              frameInterval = frameYieldMs;
            }
          }
          var performWorkUntilDeadline = function() {
            if (scheduledHostCallback !== null) {
              var currentTime = exports.unstable_now();
              startTime = currentTime;
              var hasTimeRemaining = true;
              var hasMoreWork = true;
              try {
                hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
              } finally {
                if (hasMoreWork) {
                  schedulePerformWorkUntilDeadline();
                } else {
                  isMessageLoopRunning = false;
                  scheduledHostCallback = null;
                }
              }
            } else {
              isMessageLoopRunning = false;
            }
          };
          var schedulePerformWorkUntilDeadline;
          if (typeof localSetImmediate === "function") {
            schedulePerformWorkUntilDeadline = function() {
              localSetImmediate(performWorkUntilDeadline);
            };
          } else if (typeof MessageChannel !== "undefined") {
            var channel = new MessageChannel();
            var port = channel.port2;
            channel.port1.onmessage = performWorkUntilDeadline;
            schedulePerformWorkUntilDeadline = function() {
              port.postMessage(null);
            };
          } else {
            schedulePerformWorkUntilDeadline = function() {
              localSetTimeout(performWorkUntilDeadline, 0);
            };
          }
          function requestHostCallback(callback) {
            scheduledHostCallback = callback;
            if (!isMessageLoopRunning) {
              isMessageLoopRunning = true;
              schedulePerformWorkUntilDeadline();
            }
          }
          function requestHostTimeout(callback, ms) {
            taskTimeoutID = localSetTimeout(function() {
              callback(exports.unstable_now());
            }, ms);
          }
          function cancelHostTimeout() {
            localClearTimeout(taskTimeoutID);
            taskTimeoutID = -1;
          }
          var unstable_requestPaint = requestPaint;
          var unstable_Profiling = null;
          exports.unstable_IdlePriority = IdlePriority;
          exports.unstable_ImmediatePriority = ImmediatePriority;
          exports.unstable_LowPriority = LowPriority;
          exports.unstable_NormalPriority = NormalPriority;
          exports.unstable_Profiling = unstable_Profiling;
          exports.unstable_UserBlockingPriority = UserBlockingPriority;
          exports.unstable_cancelCallback = unstable_cancelCallback;
          exports.unstable_continueExecution = unstable_continueExecution;
          exports.unstable_forceFrameRate = forceFrameRate;
          exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
          exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
          exports.unstable_next = unstable_next;
          exports.unstable_pauseExecution = unstable_pauseExecution;
          exports.unstable_requestPaint = unstable_requestPaint;
          exports.unstable_runWithPriority = unstable_runWithPriority;
          exports.unstable_scheduleCallback = unstable_scheduleCallback;
          exports.unstable_shouldYield = shouldYieldToHost;
          exports.unstable_wrapCallback = unstable_wrapCallback;
          if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
            __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
          }
        })();
      }
    }
  });

  // node_modules/scheduler/index.js
  var require_scheduler = __commonJS({
    "node_modules/scheduler/index.js"(exports, module) {
      "use strict";
      if (false) {
        module.exports = null;
      } else {
        module.exports = require_scheduler_development();
      }
    }
  });

  // node_modules/react-dom/cjs/react-dom.development.js
  var require_react_dom_development = __commonJS({
    "node_modules/react-dom/cjs/react-dom.development.js"(exports) {
      "use strict";
      if (true) {
        (function() {
          "use strict";
          if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
            __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
          }
          var React422 = require_react();
          var Scheduler = require_scheduler();
          var ReactSharedInternals = React422.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
          var suppressWarning = false;
          function setSuppressWarning(newSuppressWarning) {
            {
              suppressWarning = newSuppressWarning;
            }
          }
          function warn2(format2) {
            {
              if (!suppressWarning) {
                for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                  args[_key - 1] = arguments[_key];
                }
                printWarning("warn", format2, args);
              }
            }
          }
          function error(format2) {
            {
              if (!suppressWarning) {
                for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
                  args[_key2 - 1] = arguments[_key2];
                }
                printWarning("error", format2, args);
              }
            }
          }
          function printWarning(level, format2, args) {
            {
              var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
              var stack = ReactDebugCurrentFrame2.getStackAddendum();
              if (stack !== "") {
                format2 += "%s";
                args = args.concat([stack]);
              }
              var argsWithFormat = args.map(function(item) {
                return String(item);
              });
              argsWithFormat.unshift("Warning: " + format2);
              Function.prototype.apply.call(console[level], console, argsWithFormat);
            }
          }
          var FunctionComponent2 = 0;
          var ClassComponent = 1;
          var IndeterminateComponent = 2;
          var HostRoot = 3;
          var HostPortal = 4;
          var HostComponent = 5;
          var HostText = 6;
          var Fragment67 = 7;
          var Mode = 8;
          var ContextConsumer = 9;
          var ContextProvider = 10;
          var ForwardRef = 11;
          var Profiler = 12;
          var SuspenseComponent = 13;
          var MemoComponent = 14;
          var SimpleMemoComponent = 15;
          var LazyComponent = 16;
          var IncompleteClassComponent = 17;
          var DehydratedFragment = 18;
          var SuspenseListComponent = 19;
          var ScopeComponent = 21;
          var OffscreenComponent = 22;
          var LegacyHiddenComponent = 23;
          var CacheComponent = 24;
          var TracingMarkerComponent = 25;
          var enableClientRenderFallbackOnTextMismatch = true;
          var enableNewReconciler = false;
          var enableLazyContextPropagation = false;
          var enableLegacyHidden = false;
          var enableSuspenseAvoidThisFallback = false;
          var disableCommentsAsDOMContainers = true;
          var enableCustomElementPropertySupport = false;
          var warnAboutStringRefs = true;
          var enableSchedulingProfiler = true;
          var enableProfilerTimer = true;
          var enableProfilerCommitHooks = true;
          var allNativeEvents = /* @__PURE__ */ new Set();
          var registrationNameDependencies = {};
          var possibleRegistrationNames = {};
          function registerTwoPhaseEvent(registrationName, dependencies) {
            registerDirectEvent(registrationName, dependencies);
            registerDirectEvent(registrationName + "Capture", dependencies);
          }
          function registerDirectEvent(registrationName, dependencies) {
            {
              if (registrationNameDependencies[registrationName]) {
                error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", registrationName);
              }
            }
            registrationNameDependencies[registrationName] = dependencies;
            {
              var lowerCasedName = registrationName.toLowerCase();
              possibleRegistrationNames[lowerCasedName] = registrationName;
              if (registrationName === "onDoubleClick") {
                possibleRegistrationNames.ondblclick = registrationName;
              }
            }
            for (var i = 0; i < dependencies.length; i++) {
              allNativeEvents.add(dependencies[i]);
            }
          }
          var canUseDOM3 = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
          var hasOwnProperty = Object.prototype.hasOwnProperty;
          function typeName(value) {
            {
              var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
              var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
              return type;
            }
          }
          function willCoercionThrow(value) {
            {
              try {
                testStringCoercion(value);
                return false;
              } catch (e) {
                return true;
              }
            }
          }
          function testStringCoercion(value) {
            return "" + value;
          }
          function checkAttributeStringCoercion(value, attributeName) {
            {
              if (willCoercionThrow(value)) {
                error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.", attributeName, typeName(value));
                return testStringCoercion(value);
              }
            }
          }
          function checkKeyStringCoercion(value) {
            {
              if (willCoercionThrow(value)) {
                error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
                return testStringCoercion(value);
              }
            }
          }
          function checkPropStringCoercion(value, propName) {
            {
              if (willCoercionThrow(value)) {
                error("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value));
                return testStringCoercion(value);
              }
            }
          }
          function checkCSSPropertyStringCoercion(value, propName) {
            {
              if (willCoercionThrow(value)) {
                error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value));
                return testStringCoercion(value);
              }
            }
          }
          function checkHtmlStringCoercion(value) {
            {
              if (willCoercionThrow(value)) {
                error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
                return testStringCoercion(value);
              }
            }
          }
          function checkFormFieldValueStringCoercion(value) {
            {
              if (willCoercionThrow(value)) {
                error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.", typeName(value));
                return testStringCoercion(value);
              }
            }
          }
          var RESERVED = 0;
          var STRING = 1;
          var BOOLEANISH_STRING = 2;
          var BOOLEAN = 3;
          var OVERLOADED_BOOLEAN = 4;
          var NUMERIC = 5;
          var POSITIVE_NUMERIC = 6;
          var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
          var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
          var VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$");
          var illegalAttributeNameCache = {};
          var validatedAttributeNameCache = {};
          function isAttributeNameSafe(attributeName) {
            if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
              return true;
            }
            if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
              return false;
            }
            if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
              validatedAttributeNameCache[attributeName] = true;
              return true;
            }
            illegalAttributeNameCache[attributeName] = true;
            {
              error("Invalid attribute name: `%s`", attributeName);
            }
            return false;
          }
          function shouldIgnoreAttribute(name2, propertyInfo, isCustomComponentTag) {
            if (propertyInfo !== null) {
              return propertyInfo.type === RESERVED;
            }
            if (isCustomComponentTag) {
              return false;
            }
            if (name2.length > 2 && (name2[0] === "o" || name2[0] === "O") && (name2[1] === "n" || name2[1] === "N")) {
              return true;
            }
            return false;
          }
          function shouldRemoveAttributeWithWarning(name2, value, propertyInfo, isCustomComponentTag) {
            if (propertyInfo !== null && propertyInfo.type === RESERVED) {
              return false;
            }
            switch (typeof value) {
              case "function":
              // $FlowIssue symbol is perfectly valid here
              case "symbol":
                return true;
              case "boolean": {
                if (isCustomComponentTag) {
                  return false;
                }
                if (propertyInfo !== null) {
                  return !propertyInfo.acceptsBooleans;
                } else {
                  var prefix2 = name2.toLowerCase().slice(0, 5);
                  return prefix2 !== "data-" && prefix2 !== "aria-";
                }
              }
              default:
                return false;
            }
          }
          function shouldRemoveAttribute(name2, value, propertyInfo, isCustomComponentTag) {
            if (value === null || typeof value === "undefined") {
              return true;
            }
            if (shouldRemoveAttributeWithWarning(name2, value, propertyInfo, isCustomComponentTag)) {
              return true;
            }
            if (isCustomComponentTag) {
              return false;
            }
            if (propertyInfo !== null) {
              switch (propertyInfo.type) {
                case BOOLEAN:
                  return !value;
                case OVERLOADED_BOOLEAN:
                  return value === false;
                case NUMERIC:
                  return isNaN(value);
                case POSITIVE_NUMERIC:
                  return isNaN(value) || value < 1;
              }
            }
            return false;
          }
          function getPropertyInfo(name2) {
            return properties.hasOwnProperty(name2) ? properties[name2] : null;
          }
          function PropertyInfoRecord(name2, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL2, removeEmptyString) {
            this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
            this.attributeName = attributeName;
            this.attributeNamespace = attributeNamespace;
            this.mustUseProperty = mustUseProperty;
            this.propertyName = name2;
            this.type = type;
            this.sanitizeURL = sanitizeURL2;
            this.removeEmptyString = removeEmptyString;
          }
          var properties = {};
          var reservedProps = [
            "children",
            "dangerouslySetInnerHTML",
            // TODO: This prevents the assignment of defaultValue to regular
            // elements (not just inputs). Now that ReactDOMInput assigns to the
            // defaultValue property -- do we need this?
            "defaultValue",
            "defaultChecked",
            "innerHTML",
            "suppressContentEditableWarning",
            "suppressHydrationWarning",
            "style"
          ];
          reservedProps.forEach(function(name2) {
            properties[name2] = new PropertyInfoRecord(
              name2,
              RESERVED,
              false,
              // mustUseProperty
              name2,
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(_ref) {
            var name2 = _ref[0], attributeName = _ref[1];
            properties[name2] = new PropertyInfoRecord(
              name2,
              STRING,
              false,
              // mustUseProperty
              attributeName,
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(name2) {
            properties[name2] = new PropertyInfoRecord(
              name2,
              BOOLEANISH_STRING,
              false,
              // mustUseProperty
              name2.toLowerCase(),
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(name2) {
            properties[name2] = new PropertyInfoRecord(
              name2,
              BOOLEANISH_STRING,
              false,
              // mustUseProperty
              name2,
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          [
            "allowFullScreen",
            "async",
            // Note: there is a special case that prevents it from being written to the DOM
            // on the client side because the browsers are inconsistent. Instead we call focus().
            "autoFocus",
            "autoPlay",
            "controls",
            "default",
            "defer",
            "disabled",
            "disablePictureInPicture",
            "disableRemotePlayback",
            "formNoValidate",
            "hidden",
            "loop",
            "noModule",
            "noValidate",
            "open",
            "playsInline",
            "readOnly",
            "required",
            "reversed",
            "scoped",
            "seamless",
            // Microdata
            "itemScope"
          ].forEach(function(name2) {
            properties[name2] = new PropertyInfoRecord(
              name2,
              BOOLEAN,
              false,
              // mustUseProperty
              name2.toLowerCase(),
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          [
            "checked",
            // Note: `option.selected` is not updated if `select.multiple` is
            // disabled with `removeAttribute`. We have special logic for handling this.
            "multiple",
            "muted",
            "selected"
            // NOTE: if you add a camelCased prop to this list,
            // you'll need to set attributeName to name.toLowerCase()
            // instead in the assignment below.
          ].forEach(function(name2) {
            properties[name2] = new PropertyInfoRecord(
              name2,
              BOOLEAN,
              true,
              // mustUseProperty
              name2,
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          [
            "capture",
            "download"
            // NOTE: if you add a camelCased prop to this list,
            // you'll need to set attributeName to name.toLowerCase()
            // instead in the assignment below.
          ].forEach(function(name2) {
            properties[name2] = new PropertyInfoRecord(
              name2,
              OVERLOADED_BOOLEAN,
              false,
              // mustUseProperty
              name2,
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          [
            "cols",
            "rows",
            "size",
            "span"
            // NOTE: if you add a camelCased prop to this list,
            // you'll need to set attributeName to name.toLowerCase()
            // instead in the assignment below.
          ].forEach(function(name2) {
            properties[name2] = new PropertyInfoRecord(
              name2,
              POSITIVE_NUMERIC,
              false,
              // mustUseProperty
              name2,
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          ["rowSpan", "start"].forEach(function(name2) {
            properties[name2] = new PropertyInfoRecord(
              name2,
              NUMERIC,
              false,
              // mustUseProperty
              name2.toLowerCase(),
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          var CAMELIZE = /[\-\:]([a-z])/g;
          var capitalize3 = function(token) {
            return token[1].toUpperCase();
          };
          [
            "accent-height",
            "alignment-baseline",
            "arabic-form",
            "baseline-shift",
            "cap-height",
            "clip-path",
            "clip-rule",
            "color-interpolation",
            "color-interpolation-filters",
            "color-profile",
            "color-rendering",
            "dominant-baseline",
            "enable-background",
            "fill-opacity",
            "fill-rule",
            "flood-color",
            "flood-opacity",
            "font-family",
            "font-size",
            "font-size-adjust",
            "font-stretch",
            "font-style",
            "font-variant",
            "font-weight",
            "glyph-name",
            "glyph-orientation-horizontal",
            "glyph-orientation-vertical",
            "horiz-adv-x",
            "horiz-origin-x",
            "image-rendering",
            "letter-spacing",
            "lighting-color",
            "marker-end",
            "marker-mid",
            "marker-start",
            "overline-position",
            "overline-thickness",
            "paint-order",
            "panose-1",
            "pointer-events",
            "rendering-intent",
            "shape-rendering",
            "stop-color",
            "stop-opacity",
            "strikethrough-position",
            "strikethrough-thickness",
            "stroke-dasharray",
            "stroke-dashoffset",
            "stroke-linecap",
            "stroke-linejoin",
            "stroke-miterlimit",
            "stroke-opacity",
            "stroke-width",
            "text-anchor",
            "text-decoration",
            "text-rendering",
            "underline-position",
            "underline-thickness",
            "unicode-bidi",
            "unicode-range",
            "units-per-em",
            "v-alphabetic",
            "v-hanging",
            "v-ideographic",
            "v-mathematical",
            "vector-effect",
            "vert-adv-y",
            "vert-origin-x",
            "vert-origin-y",
            "word-spacing",
            "writing-mode",
            "xmlns:xlink",
            "x-height"
            // NOTE: if you add a camelCased prop to this list,
            // you'll need to set attributeName to name.toLowerCase()
            // instead in the assignment below.
          ].forEach(function(attributeName) {
            var name2 = attributeName.replace(CAMELIZE, capitalize3);
            properties[name2] = new PropertyInfoRecord(
              name2,
              STRING,
              false,
              // mustUseProperty
              attributeName,
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          [
            "xlink:actuate",
            "xlink:arcrole",
            "xlink:role",
            "xlink:show",
            "xlink:title",
            "xlink:type"
            // NOTE: if you add a camelCased prop to this list,
            // you'll need to set attributeName to name.toLowerCase()
            // instead in the assignment below.
          ].forEach(function(attributeName) {
            var name2 = attributeName.replace(CAMELIZE, capitalize3);
            properties[name2] = new PropertyInfoRecord(
              name2,
              STRING,
              false,
              // mustUseProperty
              attributeName,
              "http://www.w3.org/1999/xlink",
              false,
              // sanitizeURL
              false
            );
          });
          [
            "xml:base",
            "xml:lang",
            "xml:space"
            // NOTE: if you add a camelCased prop to this list,
            // you'll need to set attributeName to name.toLowerCase()
            // instead in the assignment below.
          ].forEach(function(attributeName) {
            var name2 = attributeName.replace(CAMELIZE, capitalize3);
            properties[name2] = new PropertyInfoRecord(
              name2,
              STRING,
              false,
              // mustUseProperty
              attributeName,
              "http://www.w3.org/XML/1998/namespace",
              false,
              // sanitizeURL
              false
            );
          });
          ["tabIndex", "crossOrigin"].forEach(function(attributeName) {
            properties[attributeName] = new PropertyInfoRecord(
              attributeName,
              STRING,
              false,
              // mustUseProperty
              attributeName.toLowerCase(),
              // attributeName
              null,
              // attributeNamespace
              false,
              // sanitizeURL
              false
            );
          });
          var xlinkHref = "xlinkHref";
          properties[xlinkHref] = new PropertyInfoRecord(
            "xlinkHref",
            STRING,
            false,
            // mustUseProperty
            "xlink:href",
            "http://www.w3.org/1999/xlink",
            true,
            // sanitizeURL
            false
          );
          ["src", "href", "action", "formAction"].forEach(function(attributeName) {
            properties[attributeName] = new PropertyInfoRecord(
              attributeName,
              STRING,
              false,
              // mustUseProperty
              attributeName.toLowerCase(),
              // attributeName
              null,
              // attributeNamespace
              true,
              // sanitizeURL
              true
            );
          });
          var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
          var didWarn = false;
          function sanitizeURL(url) {
            {
              if (!didWarn && isJavaScriptProtocol.test(url)) {
                didWarn = true;
                error("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(url));
              }
            }
          }
          function getValueForProperty(node, name2, expected, propertyInfo) {
            {
              if (propertyInfo.mustUseProperty) {
                var propertyName = propertyInfo.propertyName;
                return node[propertyName];
              } else {
                {
                  checkAttributeStringCoercion(expected, name2);
                }
                if (propertyInfo.sanitizeURL) {
                  sanitizeURL("" + expected);
                }
                var attributeName = propertyInfo.attributeName;
                var stringValue = null;
                if (propertyInfo.type === OVERLOADED_BOOLEAN) {
                  if (node.hasAttribute(attributeName)) {
                    var value = node.getAttribute(attributeName);
                    if (value === "") {
                      return true;
                    }
                    if (shouldRemoveAttribute(name2, expected, propertyInfo, false)) {
                      return value;
                    }
                    if (value === "" + expected) {
                      return expected;
                    }
                    return value;
                  }
                } else if (node.hasAttribute(attributeName)) {
                  if (shouldRemoveAttribute(name2, expected, propertyInfo, false)) {
                    return node.getAttribute(attributeName);
                  }
                  if (propertyInfo.type === BOOLEAN) {
                    return expected;
                  }
                  stringValue = node.getAttribute(attributeName);
                }
                if (shouldRemoveAttribute(name2, expected, propertyInfo, false)) {
                  return stringValue === null ? expected : stringValue;
                } else if (stringValue === "" + expected) {
                  return expected;
                } else {
                  return stringValue;
                }
              }
            }
          }
          function getValueForAttribute(node, name2, expected, isCustomComponentTag) {
            {
              if (!isAttributeNameSafe(name2)) {
                return;
              }
              if (!node.hasAttribute(name2)) {
                return expected === void 0 ? void 0 : null;
              }
              var value = node.getAttribute(name2);
              {
                checkAttributeStringCoercion(expected, name2);
              }
              if (value === "" + expected) {
                return expected;
              }
              return value;
            }
          }
          function setValueForProperty(node, name2, value, isCustomComponentTag) {
            var propertyInfo = getPropertyInfo(name2);
            if (shouldIgnoreAttribute(name2, propertyInfo, isCustomComponentTag)) {
              return;
            }
            if (shouldRemoveAttribute(name2, value, propertyInfo, isCustomComponentTag)) {
              value = null;
            }
            if (isCustomComponentTag || propertyInfo === null) {
              if (isAttributeNameSafe(name2)) {
                var _attributeName = name2;
                if (value === null) {
                  node.removeAttribute(_attributeName);
                } else {
                  {
                    checkAttributeStringCoercion(value, name2);
                  }
                  node.setAttribute(_attributeName, "" + value);
                }
              }
              return;
            }
            var mustUseProperty = propertyInfo.mustUseProperty;
            if (mustUseProperty) {
              var propertyName = propertyInfo.propertyName;
              if (value === null) {
                var type = propertyInfo.type;
                node[propertyName] = type === BOOLEAN ? false : "";
              } else {
                node[propertyName] = value;
              }
              return;
            }
            var attributeName = propertyInfo.attributeName, attributeNamespace = propertyInfo.attributeNamespace;
            if (value === null) {
              node.removeAttribute(attributeName);
            } else {
              var _type = propertyInfo.type;
              var attributeValue;
              if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
                attributeValue = "";
              } else {
                {
                  {
                    checkAttributeStringCoercion(value, attributeName);
                  }
                  attributeValue = "" + value;
                }
                if (propertyInfo.sanitizeURL) {
                  sanitizeURL(attributeValue.toString());
                }
              }
              if (attributeNamespace) {
                node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
              } else {
                node.setAttribute(attributeName, attributeValue);
              }
            }
          }
          var REACT_ELEMENT_TYPE = Symbol.for("react.element");
          var REACT_PORTAL_TYPE = Symbol.for("react.portal");
          var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
          var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
          var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
          var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
          var REACT_CONTEXT_TYPE = Symbol.for("react.context");
          var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
          var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
          var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
          var REACT_MEMO_TYPE = Symbol.for("react.memo");
          var REACT_LAZY_TYPE = Symbol.for("react.lazy");
          var REACT_SCOPE_TYPE = Symbol.for("react.scope");
          var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode");
          var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
          var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden");
          var REACT_CACHE_TYPE = Symbol.for("react.cache");
          var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker");
          var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
          var FAUX_ITERATOR_SYMBOL = "@@iterator";
          function getIteratorFn(maybeIterable) {
            if (maybeIterable === null || typeof maybeIterable !== "object") {
              return null;
            }
            var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
            if (typeof maybeIterator === "function") {
              return maybeIterator;
            }
            return null;
          }
          var assign = Object.assign;
          var disabledDepth = 0;
          var prevLog;
          var prevInfo;
          var prevWarn;
          var prevError;
          var prevGroup;
          var prevGroupCollapsed;
          var prevGroupEnd;
          function disabledLog() {
          }
          disabledLog.__reactDisabledLog = true;
          function disableLogs() {
            {
              if (disabledDepth === 0) {
                prevLog = console.log;
                prevInfo = console.info;
                prevWarn = console.warn;
                prevError = console.error;
                prevGroup = console.group;
                prevGroupCollapsed = console.groupCollapsed;
                prevGroupEnd = console.groupEnd;
                var props = {
                  configurable: true,
                  enumerable: true,
                  value: disabledLog,
                  writable: true
                };
                Object.defineProperties(console, {
                  info: props,
                  log: props,
                  warn: props,
                  error: props,
                  group: props,
                  groupCollapsed: props,
                  groupEnd: props
                });
              }
              disabledDepth++;
            }
          }
          function reenableLogs() {
            {
              disabledDepth--;
              if (disabledDepth === 0) {
                var props = {
                  configurable: true,
                  enumerable: true,
                  writable: true
                };
                Object.defineProperties(console, {
                  log: assign({}, props, {
                    value: prevLog
                  }),
                  info: assign({}, props, {
                    value: prevInfo
                  }),
                  warn: assign({}, props, {
                    value: prevWarn
                  }),
                  error: assign({}, props, {
                    value: prevError
                  }),
                  group: assign({}, props, {
                    value: prevGroup
                  }),
                  groupCollapsed: assign({}, props, {
                    value: prevGroupCollapsed
                  }),
                  groupEnd: assign({}, props, {
                    value: prevGroupEnd
                  })
                });
              }
              if (disabledDepth < 0) {
                error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
              }
            }
          }
          var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
          var prefix;
          function describeBuiltInComponentFrame(name2, source, ownerFn) {
            {
              if (prefix === void 0) {
                try {
                  throw Error();
                } catch (x2) {
                  var match = x2.stack.trim().match(/\n( *(at )?)/);
                  prefix = match && match[1] || "";
                }
              }
              return "\n" + prefix + name2;
            }
          }
          var reentry = false;
          var componentFrameCache;
          {
            var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
            componentFrameCache = new PossiblyWeakMap();
          }
          function describeNativeComponentFrame(fn, construct) {
            if (!fn || reentry) {
              return "";
            }
            {
              var frame2 = componentFrameCache.get(fn);
              if (frame2 !== void 0) {
                return frame2;
              }
            }
            var control;
            reentry = true;
            var previousPrepareStackTrace = Error.prepareStackTrace;
            Error.prepareStackTrace = void 0;
            var previousDispatcher;
            {
              previousDispatcher = ReactCurrentDispatcher.current;
              ReactCurrentDispatcher.current = null;
              disableLogs();
            }
            try {
              if (construct) {
                var Fake = function() {
                  throw Error();
                };
                Object.defineProperty(Fake.prototype, "props", {
                  set: function() {
                    throw Error();
                  }
                });
                if (typeof Reflect === "object" && Reflect.construct) {
                  try {
                    Reflect.construct(Fake, []);
                  } catch (x2) {
                    control = x2;
                  }
                  Reflect.construct(fn, [], Fake);
                } else {
                  try {
                    Fake.call();
                  } catch (x2) {
                    control = x2;
                  }
                  fn.call(Fake.prototype);
                }
              } else {
                try {
                  throw Error();
                } catch (x2) {
                  control = x2;
                }
                fn();
              }
            } catch (sample) {
              if (sample && control && typeof sample.stack === "string") {
                var sampleLines = sample.stack.split("\n");
                var controlLines = control.stack.split("\n");
                var s2 = sampleLines.length - 1;
                var c2 = controlLines.length - 1;
                while (s2 >= 1 && c2 >= 0 && sampleLines[s2] !== controlLines[c2]) {
                  c2--;
                }
                for (; s2 >= 1 && c2 >= 0; s2--, c2--) {
                  if (sampleLines[s2] !== controlLines[c2]) {
                    if (s2 !== 1 || c2 !== 1) {
                      do {
                        s2--;
                        c2--;
                        if (c2 < 0 || sampleLines[s2] !== controlLines[c2]) {
                          var _frame = "\n" + sampleLines[s2].replace(" at new ", " at ");
                          if (fn.displayName && _frame.includes("<anonymous>")) {
                            _frame = _frame.replace("<anonymous>", fn.displayName);
                          }
                          {
                            if (typeof fn === "function") {
                              componentFrameCache.set(fn, _frame);
                            }
                          }
                          return _frame;
                        }
                      } while (s2 >= 1 && c2 >= 0);
                    }
                    break;
                  }
                }
              }
            } finally {
              reentry = false;
              {
                ReactCurrentDispatcher.current = previousDispatcher;
                reenableLogs();
              }
              Error.prepareStackTrace = previousPrepareStackTrace;
            }
            var name2 = fn ? fn.displayName || fn.name : "";
            var syntheticFrame = name2 ? describeBuiltInComponentFrame(name2) : "";
            {
              if (typeof fn === "function") {
                componentFrameCache.set(fn, syntheticFrame);
              }
            }
            return syntheticFrame;
          }
          function describeClassComponentFrame(ctor, source, ownerFn) {
            {
              return describeNativeComponentFrame(ctor, true);
            }
          }
          function describeFunctionComponentFrame(fn, source, ownerFn) {
            {
              return describeNativeComponentFrame(fn, false);
            }
          }
          function shouldConstruct(Component40) {
            var prototype = Component40.prototype;
            return !!(prototype && prototype.isReactComponent);
          }
          function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
            if (type == null) {
              return "";
            }
            if (typeof type === "function") {
              {
                return describeNativeComponentFrame(type, shouldConstruct(type));
              }
            }
            if (typeof type === "string") {
              return describeBuiltInComponentFrame(type);
            }
            switch (type) {
              case REACT_SUSPENSE_TYPE:
                return describeBuiltInComponentFrame("Suspense");
              case REACT_SUSPENSE_LIST_TYPE:
                return describeBuiltInComponentFrame("SuspenseList");
            }
            if (typeof type === "object") {
              switch (type.$$typeof) {
                case REACT_FORWARD_REF_TYPE:
                  return describeFunctionComponentFrame(type.render);
                case REACT_MEMO_TYPE:
                  return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
                case REACT_LAZY_TYPE: {
                  var lazyComponent = type;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
                  } catch (x2) {
                  }
                }
              }
            }
            return "";
          }
          function describeFiber(fiber) {
            var owner = fiber._debugOwner ? fiber._debugOwner.type : null;
            var source = fiber._debugSource;
            switch (fiber.tag) {
              case HostComponent:
                return describeBuiltInComponentFrame(fiber.type);
              case LazyComponent:
                return describeBuiltInComponentFrame("Lazy");
              case SuspenseComponent:
                return describeBuiltInComponentFrame("Suspense");
              case SuspenseListComponent:
                return describeBuiltInComponentFrame("SuspenseList");
              case FunctionComponent2:
              case IndeterminateComponent:
              case SimpleMemoComponent:
                return describeFunctionComponentFrame(fiber.type);
              case ForwardRef:
                return describeFunctionComponentFrame(fiber.type.render);
              case ClassComponent:
                return describeClassComponentFrame(fiber.type);
              default:
                return "";
            }
          }
          function getStackByFiberInDevAndProd(workInProgress2) {
            try {
              var info2 = "";
              var node = workInProgress2;
              do {
                info2 += describeFiber(node);
                node = node.return;
              } while (node);
              return info2;
            } catch (x2) {
              return "\nError generating stack: " + x2.message + "\n" + x2.stack;
            }
          }
          function getWrappedName(outerType, innerType, wrapperName) {
            var displayName = outerType.displayName;
            if (displayName) {
              return displayName;
            }
            var functionName = innerType.displayName || innerType.name || "";
            return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
          }
          function getContextName(type) {
            return type.displayName || "Context";
          }
          function getComponentNameFromType(type) {
            if (type == null) {
              return null;
            }
            {
              if (typeof type.tag === "number") {
                error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
              }
            }
            if (typeof type === "function") {
              return type.displayName || type.name || null;
            }
            if (typeof type === "string") {
              return type;
            }
            switch (type) {
              case REACT_FRAGMENT_TYPE:
                return "Fragment";
              case REACT_PORTAL_TYPE:
                return "Portal";
              case REACT_PROFILER_TYPE:
                return "Profiler";
              case REACT_STRICT_MODE_TYPE:
                return "StrictMode";
              case REACT_SUSPENSE_TYPE:
                return "Suspense";
              case REACT_SUSPENSE_LIST_TYPE:
                return "SuspenseList";
            }
            if (typeof type === "object") {
              switch (type.$$typeof) {
                case REACT_CONTEXT_TYPE:
                  var context = type;
                  return getContextName(context) + ".Consumer";
                case REACT_PROVIDER_TYPE:
                  var provider = type;
                  return getContextName(provider._context) + ".Provider";
                case REACT_FORWARD_REF_TYPE:
                  return getWrappedName(type, type.render, "ForwardRef");
                case REACT_MEMO_TYPE:
                  var outerName = type.displayName || null;
                  if (outerName !== null) {
                    return outerName;
                  }
                  return getComponentNameFromType(type.type) || "Memo";
                case REACT_LAZY_TYPE: {
                  var lazyComponent = type;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    return getComponentNameFromType(init(payload));
                  } catch (x2) {
                    return null;
                  }
                }
              }
            }
            return null;
          }
          function getWrappedName$1(outerType, innerType, wrapperName) {
            var functionName = innerType.displayName || innerType.name || "";
            return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
          }
          function getContextName$1(type) {
            return type.displayName || "Context";
          }
          function getComponentNameFromFiber(fiber) {
            var tag = fiber.tag, type = fiber.type;
            switch (tag) {
              case CacheComponent:
                return "Cache";
              case ContextConsumer:
                var context = type;
                return getContextName$1(context) + ".Consumer";
              case ContextProvider:
                var provider = type;
                return getContextName$1(provider._context) + ".Provider";
              case DehydratedFragment:
                return "DehydratedFragment";
              case ForwardRef:
                return getWrappedName$1(type, type.render, "ForwardRef");
              case Fragment67:
                return "Fragment";
              case HostComponent:
                return type;
              case HostPortal:
                return "Portal";
              case HostRoot:
                return "Root";
              case HostText:
                return "Text";
              case LazyComponent:
                return getComponentNameFromType(type);
              case Mode:
                if (type === REACT_STRICT_MODE_TYPE) {
                  return "StrictMode";
                }
                return "Mode";
              case OffscreenComponent:
                return "Offscreen";
              case Profiler:
                return "Profiler";
              case ScopeComponent:
                return "Scope";
              case SuspenseComponent:
                return "Suspense";
              case SuspenseListComponent:
                return "SuspenseList";
              case TracingMarkerComponent:
                return "TracingMarker";
              // The display name for this tags come from the user-provided type:
              case ClassComponent:
              case FunctionComponent2:
              case IncompleteClassComponent:
              case IndeterminateComponent:
              case MemoComponent:
              case SimpleMemoComponent:
                if (typeof type === "function") {
                  return type.displayName || type.name || null;
                }
                if (typeof type === "string") {
                  return type;
                }
                break;
            }
            return null;
          }
          var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
          var current = null;
          var isRendering = false;
          function getCurrentFiberOwnerNameInDevOrNull() {
            {
              if (current === null) {
                return null;
              }
              var owner = current._debugOwner;
              if (owner !== null && typeof owner !== "undefined") {
                return getComponentNameFromFiber(owner);
              }
            }
            return null;
          }
          function getCurrentFiberStackInDev() {
            {
              if (current === null) {
                return "";
              }
              return getStackByFiberInDevAndProd(current);
            }
          }
          function resetCurrentFiber() {
            {
              ReactDebugCurrentFrame.getCurrentStack = null;
              current = null;
              isRendering = false;
            }
          }
          function setCurrentFiber(fiber) {
            {
              ReactDebugCurrentFrame.getCurrentStack = fiber === null ? null : getCurrentFiberStackInDev;
              current = fiber;
              isRendering = false;
            }
          }
          function getCurrentFiber() {
            {
              return current;
            }
          }
          function setIsRendering(rendering) {
            {
              isRendering = rendering;
            }
          }
          function toString(value) {
            return "" + value;
          }
          function getToStringValue(value) {
            switch (typeof value) {
              case "boolean":
              case "number":
              case "string":
              case "undefined":
                return value;
              case "object":
                {
                  checkFormFieldValueStringCoercion(value);
                }
                return value;
              default:
                return "";
            }
          }
          var hasReadOnlyValue = {
            button: true,
            checkbox: true,
            image: true,
            hidden: true,
            radio: true,
            reset: true,
            submit: true
          };
          function checkControlledValueProps(tagName, props) {
            {
              if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) {
                error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.");
              }
              if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) {
                error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.");
              }
            }
          }
          function isCheckable(elem) {
            var type = elem.type;
            var nodeName = elem.nodeName;
            return nodeName && nodeName.toLowerCase() === "input" && (type === "checkbox" || type === "radio");
          }
          function getTracker(node) {
            return node._valueTracker;
          }
          function detachTracker(node) {
            node._valueTracker = null;
          }
          function getValueFromNode(node) {
            var value = "";
            if (!node) {
              return value;
            }
            if (isCheckable(node)) {
              value = node.checked ? "true" : "false";
            } else {
              value = node.value;
            }
            return value;
          }
          function trackValueOnNode(node) {
            var valueField = isCheckable(node) ? "checked" : "value";
            var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
            {
              checkFormFieldValueStringCoercion(node[valueField]);
            }
            var currentValue = "" + node[valueField];
            if (node.hasOwnProperty(valueField) || typeof descriptor === "undefined" || typeof descriptor.get !== "function" || typeof descriptor.set !== "function") {
              return;
            }
            var get2 = descriptor.get, set2 = descriptor.set;
            Object.defineProperty(node, valueField, {
              configurable: true,
              get: function() {
                return get2.call(this);
              },
              set: function(value) {
                {
                  checkFormFieldValueStringCoercion(value);
                }
                currentValue = "" + value;
                set2.call(this, value);
              }
            });
            Object.defineProperty(node, valueField, {
              enumerable: descriptor.enumerable
            });
            var tracker = {
              getValue: function() {
                return currentValue;
              },
              setValue: function(value) {
                {
                  checkFormFieldValueStringCoercion(value);
                }
                currentValue = "" + value;
              },
              stopTracking: function() {
                detachTracker(node);
                delete node[valueField];
              }
            };
            return tracker;
          }
          function track(node) {
            if (getTracker(node)) {
              return;
            }
            node._valueTracker = trackValueOnNode(node);
          }
          function updateValueIfChanged(node) {
            if (!node) {
              return false;
            }
            var tracker = getTracker(node);
            if (!tracker) {
              return true;
            }
            var lastValue = tracker.getValue();
            var nextValue = getValueFromNode(node);
            if (nextValue !== lastValue) {
              tracker.setValue(nextValue);
              return true;
            }
            return false;
          }
          function getActiveElement(doc) {
            doc = doc || (typeof document !== "undefined" ? document : void 0);
            if (typeof doc === "undefined") {
              return null;
            }
            try {
              return doc.activeElement || doc.body;
            } catch (e) {
              return doc.body;
            }
          }
          var didWarnValueDefaultValue = false;
          var didWarnCheckedDefaultChecked = false;
          var didWarnControlledToUncontrolled = false;
          var didWarnUncontrolledToControlled = false;
          function isControlled(props) {
            var usesChecked = props.type === "checkbox" || props.type === "radio";
            return usesChecked ? props.checked != null : props.value != null;
          }
          function getHostProps(element, props) {
            var node = element;
            var checked = props.checked;
            var hostProps = assign({}, props, {
              defaultChecked: void 0,
              defaultValue: void 0,
              value: void 0,
              checked: checked != null ? checked : node._wrapperState.initialChecked
            });
            return hostProps;
          }
          function initWrapperState(element, props) {
            {
              checkControlledValueProps("input", props);
              if (props.checked !== void 0 && props.defaultChecked !== void 0 && !didWarnCheckedDefaultChecked) {
                error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type);
                didWarnCheckedDefaultChecked = true;
              }
              if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue) {
                error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type);
                didWarnValueDefaultValue = true;
              }
            }
            var node = element;
            var defaultValue = props.defaultValue == null ? "" : props.defaultValue;
            node._wrapperState = {
              initialChecked: props.checked != null ? props.checked : props.defaultChecked,
              initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
              controlled: isControlled(props)
            };
          }
          function updateChecked(element, props) {
            var node = element;
            var checked = props.checked;
            if (checked != null) {
              setValueForProperty(node, "checked", checked, false);
            }
          }
          function updateWrapper(element, props) {
            var node = element;
            {
              var controlled = isControlled(props);
              if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
                error("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components");
                didWarnUncontrolledToControlled = true;
              }
              if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
                error("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components");
                didWarnControlledToUncontrolled = true;
              }
            }
            updateChecked(element, props);
            var value = getToStringValue(props.value);
            var type = props.type;
            if (value != null) {
              if (type === "number") {
                if (value === 0 && node.value === "" || // We explicitly want to coerce to number here if possible.
                // eslint-disable-next-line
                node.value != value) {
                  node.value = toString(value);
                }
              } else if (node.value !== toString(value)) {
                node.value = toString(value);
              }
            } else if (type === "submit" || type === "reset") {
              node.removeAttribute("value");
              return;
            }
            {
              if (props.hasOwnProperty("value")) {
                setDefaultValue(node, props.type, value);
              } else if (props.hasOwnProperty("defaultValue")) {
                setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
              }
            }
            {
              if (props.checked == null && props.defaultChecked != null) {
                node.defaultChecked = !!props.defaultChecked;
              }
            }
          }
          function postMountWrapper(element, props, isHydrating2) {
            var node = element;
            if (props.hasOwnProperty("value") || props.hasOwnProperty("defaultValue")) {
              var type = props.type;
              var isButton = type === "submit" || type === "reset";
              if (isButton && (props.value === void 0 || props.value === null)) {
                return;
              }
              var initialValue = toString(node._wrapperState.initialValue);
              if (!isHydrating2) {
                {
                  if (initialValue !== node.value) {
                    node.value = initialValue;
                  }
                }
              }
              {
                node.defaultValue = initialValue;
              }
            }
            var name2 = node.name;
            if (name2 !== "") {
              node.name = "";
            }
            {
              node.defaultChecked = !node.defaultChecked;
              node.defaultChecked = !!node._wrapperState.initialChecked;
            }
            if (name2 !== "") {
              node.name = name2;
            }
          }
          function restoreControlledState(element, props) {
            var node = element;
            updateWrapper(node, props);
            updateNamedCousins(node, props);
          }
          function updateNamedCousins(rootNode, props) {
            var name2 = props.name;
            if (props.type === "radio" && name2 != null) {
              var queryRoot = rootNode;
              while (queryRoot.parentNode) {
                queryRoot = queryRoot.parentNode;
              }
              {
                checkAttributeStringCoercion(name2, "name");
              }
              var group = queryRoot.querySelectorAll("input[name=" + JSON.stringify("" + name2) + '][type="radio"]');
              for (var i = 0; i < group.length; i++) {
                var otherNode = group[i];
                if (otherNode === rootNode || otherNode.form !== rootNode.form) {
                  continue;
                }
                var otherProps = getFiberCurrentPropsFromNode(otherNode);
                if (!otherProps) {
                  throw new Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");
                }
                updateValueIfChanged(otherNode);
                updateWrapper(otherNode, otherProps);
              }
            }
          }
          function setDefaultValue(node, type, value) {
            if (
              // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
              type !== "number" || getActiveElement(node.ownerDocument) !== node
            ) {
              if (value == null) {
                node.defaultValue = toString(node._wrapperState.initialValue);
              } else if (node.defaultValue !== toString(value)) {
                node.defaultValue = toString(value);
              }
            }
          }
          var didWarnSelectedSetOnOption = false;
          var didWarnInvalidChild = false;
          var didWarnInvalidInnerHTML = false;
          function validateProps(element, props) {
            {
              if (props.value == null) {
                if (typeof props.children === "object" && props.children !== null) {
                  React422.Children.forEach(props.children, function(child) {
                    if (child == null) {
                      return;
                    }
                    if (typeof child === "string" || typeof child === "number") {
                      return;
                    }
                    if (!didWarnInvalidChild) {
                      didWarnInvalidChild = true;
                      error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.");
                    }
                  });
                } else if (props.dangerouslySetInnerHTML != null) {
                  if (!didWarnInvalidInnerHTML) {
                    didWarnInvalidInnerHTML = true;
                    error("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.");
                  }
                }
              }
              if (props.selected != null && !didWarnSelectedSetOnOption) {
                error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>.");
                didWarnSelectedSetOnOption = true;
              }
            }
          }
          function postMountWrapper$1(element, props) {
            if (props.value != null) {
              element.setAttribute("value", toString(getToStringValue(props.value)));
            }
          }
          var isArrayImpl = Array.isArray;
          function isArray(a2) {
            return isArrayImpl(a2);
          }
          var didWarnValueDefaultValue$1;
          {
            didWarnValueDefaultValue$1 = false;
          }
          function getDeclarationErrorAddendum() {
            var ownerName = getCurrentFiberOwnerNameInDevOrNull();
            if (ownerName) {
              return "\n\nCheck the render method of `" + ownerName + "`.";
            }
            return "";
          }
          var valuePropNames = ["value", "defaultValue"];
          function checkSelectPropTypes(props) {
            {
              checkControlledValueProps("select", props);
              for (var i = 0; i < valuePropNames.length; i++) {
                var propName = valuePropNames[i];
                if (props[propName] == null) {
                  continue;
                }
                var propNameIsArray = isArray(props[propName]);
                if (props.multiple && !propNameIsArray) {
                  error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s", propName, getDeclarationErrorAddendum());
                } else if (!props.multiple && propNameIsArray) {
                  error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s", propName, getDeclarationErrorAddendum());
                }
              }
            }
          }
          function updateOptions(node, multiple, propValue, setDefaultSelected) {
            var options6 = node.options;
            if (multiple) {
              var selectedValues = propValue;
              var selectedValue = {};
              for (var i = 0; i < selectedValues.length; i++) {
                selectedValue["$" + selectedValues[i]] = true;
              }
              for (var _i = 0; _i < options6.length; _i++) {
                var selected = selectedValue.hasOwnProperty("$" + options6[_i].value);
                if (options6[_i].selected !== selected) {
                  options6[_i].selected = selected;
                }
                if (selected && setDefaultSelected) {
                  options6[_i].defaultSelected = true;
                }
              }
            } else {
              var _selectedValue = toString(getToStringValue(propValue));
              var defaultSelected = null;
              for (var _i2 = 0; _i2 < options6.length; _i2++) {
                if (options6[_i2].value === _selectedValue) {
                  options6[_i2].selected = true;
                  if (setDefaultSelected) {
                    options6[_i2].defaultSelected = true;
                  }
                  return;
                }
                if (defaultSelected === null && !options6[_i2].disabled) {
                  defaultSelected = options6[_i2];
                }
              }
              if (defaultSelected !== null) {
                defaultSelected.selected = true;
              }
            }
          }
          function getHostProps$1(element, props) {
            return assign({}, props, {
              value: void 0
            });
          }
          function initWrapperState$1(element, props) {
            var node = element;
            {
              checkSelectPropTypes(props);
            }
            node._wrapperState = {
              wasMultiple: !!props.multiple
            };
            {
              if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue$1) {
                error("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components");
                didWarnValueDefaultValue$1 = true;
              }
            }
          }
          function postMountWrapper$2(element, props) {
            var node = element;
            node.multiple = !!props.multiple;
            var value = props.value;
            if (value != null) {
              updateOptions(node, !!props.multiple, value, false);
            } else if (props.defaultValue != null) {
              updateOptions(node, !!props.multiple, props.defaultValue, true);
            }
          }
          function postUpdateWrapper(element, props) {
            var node = element;
            var wasMultiple = node._wrapperState.wasMultiple;
            node._wrapperState.wasMultiple = !!props.multiple;
            var value = props.value;
            if (value != null) {
              updateOptions(node, !!props.multiple, value, false);
            } else if (wasMultiple !== !!props.multiple) {
              if (props.defaultValue != null) {
                updateOptions(node, !!props.multiple, props.defaultValue, true);
              } else {
                updateOptions(node, !!props.multiple, props.multiple ? [] : "", false);
              }
            }
          }
          function restoreControlledState$1(element, props) {
            var node = element;
            var value = props.value;
            if (value != null) {
              updateOptions(node, !!props.multiple, value, false);
            }
          }
          var didWarnValDefaultVal = false;
          function getHostProps$2(element, props) {
            var node = element;
            if (props.dangerouslySetInnerHTML != null) {
              throw new Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
            }
            var hostProps = assign({}, props, {
              value: void 0,
              defaultValue: void 0,
              children: toString(node._wrapperState.initialValue)
            });
            return hostProps;
          }
          function initWrapperState$2(element, props) {
            var node = element;
            {
              checkControlledValueProps("textarea", props);
              if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValDefaultVal) {
                error("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component");
                didWarnValDefaultVal = true;
              }
            }
            var initialValue = props.value;
            if (initialValue == null) {
              var children = props.children, defaultValue = props.defaultValue;
              if (children != null) {
                {
                  error("Use the `defaultValue` or `value` props instead of setting children on <textarea>.");
                }
                {
                  if (defaultValue != null) {
                    throw new Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
                  }
                  if (isArray(children)) {
                    if (children.length > 1) {
                      throw new Error("<textarea> can only have at most one child.");
                    }
                    children = children[0];
                  }
                  defaultValue = children;
                }
              }
              if (defaultValue == null) {
                defaultValue = "";
              }
              initialValue = defaultValue;
            }
            node._wrapperState = {
              initialValue: getToStringValue(initialValue)
            };
          }
          function updateWrapper$1(element, props) {
            var node = element;
            var value = getToStringValue(props.value);
            var defaultValue = getToStringValue(props.defaultValue);
            if (value != null) {
              var newValue = toString(value);
              if (newValue !== node.value) {
                node.value = newValue;
              }
              if (props.defaultValue == null && node.defaultValue !== newValue) {
                node.defaultValue = newValue;
              }
            }
            if (defaultValue != null) {
              node.defaultValue = toString(defaultValue);
            }
          }
          function postMountWrapper$3(element, props) {
            var node = element;
            var textContent = node.textContent;
            if (textContent === node._wrapperState.initialValue) {
              if (textContent !== "" && textContent !== null) {
                node.value = textContent;
              }
            }
          }
          function restoreControlledState$2(element, props) {
            updateWrapper$1(element, props);
          }
          var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
          var MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
          var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
          function getIntrinsicNamespace(type) {
            switch (type) {
              case "svg":
                return SVG_NAMESPACE;
              case "math":
                return MATH_NAMESPACE;
              default:
                return HTML_NAMESPACE;
            }
          }
          function getChildNamespace(parentNamespace, type) {
            if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
              return getIntrinsicNamespace(type);
            }
            if (parentNamespace === SVG_NAMESPACE && type === "foreignObject") {
              return HTML_NAMESPACE;
            }
            return parentNamespace;
          }
          var createMicrosoftUnsafeLocalFunction = function(func) {
            if (typeof MSApp !== "undefined" && MSApp.execUnsafeLocalFunction) {
              return function(arg0, arg1, arg2, arg3) {
                MSApp.execUnsafeLocalFunction(function() {
                  return func(arg0, arg1, arg2, arg3);
                });
              };
            } else {
              return func;
            }
          };
          var reusableSVGContainer;
          var setInnerHTML = createMicrosoftUnsafeLocalFunction(function(node, html) {
            if (node.namespaceURI === SVG_NAMESPACE) {
              if (!("innerHTML" in node)) {
                reusableSVGContainer = reusableSVGContainer || document.createElement("div");
                reusableSVGContainer.innerHTML = "<svg>" + html.valueOf().toString() + "</svg>";
                var svgNode = reusableSVGContainer.firstChild;
                while (node.firstChild) {
                  node.removeChild(node.firstChild);
                }
                while (svgNode.firstChild) {
                  node.appendChild(svgNode.firstChild);
                }
                return;
              }
            }
            node.innerHTML = html;
          });
          var ELEMENT_NODE = 1;
          var TEXT_NODE = 3;
          var COMMENT_NODE = 8;
          var DOCUMENT_NODE = 9;
          var DOCUMENT_FRAGMENT_NODE = 11;
          var setTextContent = function(node, text) {
            if (text) {
              var firstChild = node.firstChild;
              if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
                firstChild.nodeValue = text;
                return;
              }
            }
            node.textContent = text;
          };
          var shorthandToLonghand = {
            animation: ["animationDelay", "animationDirection", "animationDuration", "animationFillMode", "animationIterationCount", "animationName", "animationPlayState", "animationTimingFunction"],
            background: ["backgroundAttachment", "backgroundClip", "backgroundColor", "backgroundImage", "backgroundOrigin", "backgroundPositionX", "backgroundPositionY", "backgroundRepeat", "backgroundSize"],
            backgroundPosition: ["backgroundPositionX", "backgroundPositionY"],
            border: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth", "borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth", "borderLeftColor", "borderLeftStyle", "borderLeftWidth", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderTopColor", "borderTopStyle", "borderTopWidth"],
            borderBlockEnd: ["borderBlockEndColor", "borderBlockEndStyle", "borderBlockEndWidth"],
            borderBlockStart: ["borderBlockStartColor", "borderBlockStartStyle", "borderBlockStartWidth"],
            borderBottom: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth"],
            borderColor: ["borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor"],
            borderImage: ["borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth"],
            borderInlineEnd: ["borderInlineEndColor", "borderInlineEndStyle", "borderInlineEndWidth"],
            borderInlineStart: ["borderInlineStartColor", "borderInlineStartStyle", "borderInlineStartWidth"],
            borderLeft: ["borderLeftColor", "borderLeftStyle", "borderLeftWidth"],
            borderRadius: ["borderBottomLeftRadius", "borderBottomRightRadius", "borderTopLeftRadius", "borderTopRightRadius"],
            borderRight: ["borderRightColor", "borderRightStyle", "borderRightWidth"],
            borderStyle: ["borderBottomStyle", "borderLeftStyle", "borderRightStyle", "borderTopStyle"],
            borderTop: ["borderTopColor", "borderTopStyle", "borderTopWidth"],
            borderWidth: ["borderBottomWidth", "borderLeftWidth", "borderRightWidth", "borderTopWidth"],
            columnRule: ["columnRuleColor", "columnRuleStyle", "columnRuleWidth"],
            columns: ["columnCount", "columnWidth"],
            flex: ["flexBasis", "flexGrow", "flexShrink"],
            flexFlow: ["flexDirection", "flexWrap"],
            font: ["fontFamily", "fontFeatureSettings", "fontKerning", "fontLanguageOverride", "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontVariant", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontWeight", "lineHeight"],
            fontVariant: ["fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition"],
            gap: ["columnGap", "rowGap"],
            grid: ["gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
            gridArea: ["gridColumnEnd", "gridColumnStart", "gridRowEnd", "gridRowStart"],
            gridColumn: ["gridColumnEnd", "gridColumnStart"],
            gridColumnGap: ["columnGap"],
            gridGap: ["columnGap", "rowGap"],
            gridRow: ["gridRowEnd", "gridRowStart"],
            gridRowGap: ["rowGap"],
            gridTemplate: ["gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
            listStyle: ["listStyleImage", "listStylePosition", "listStyleType"],
            margin: ["marginBottom", "marginLeft", "marginRight", "marginTop"],
            marker: ["markerEnd", "markerMid", "markerStart"],
            mask: ["maskClip", "maskComposite", "maskImage", "maskMode", "maskOrigin", "maskPositionX", "maskPositionY", "maskRepeat", "maskSize"],
            maskPosition: ["maskPositionX", "maskPositionY"],
            outline: ["outlineColor", "outlineStyle", "outlineWidth"],
            overflow: ["overflowX", "overflowY"],
            padding: ["paddingBottom", "paddingLeft", "paddingRight", "paddingTop"],
            placeContent: ["alignContent", "justifyContent"],
            placeItems: ["alignItems", "justifyItems"],
            placeSelf: ["alignSelf", "justifySelf"],
            textDecoration: ["textDecorationColor", "textDecorationLine", "textDecorationStyle"],
            textEmphasis: ["textEmphasisColor", "textEmphasisStyle"],
            transition: ["transitionDelay", "transitionDuration", "transitionProperty", "transitionTimingFunction"],
            wordWrap: ["overflowWrap"]
          };
          var isUnitlessNumber = {
            animationIterationCount: true,
            aspectRatio: true,
            borderImageOutset: true,
            borderImageSlice: true,
            borderImageWidth: true,
            boxFlex: true,
            boxFlexGroup: true,
            boxOrdinalGroup: true,
            columnCount: true,
            columns: true,
            flex: true,
            flexGrow: true,
            flexPositive: true,
            flexShrink: true,
            flexNegative: true,
            flexOrder: true,
            gridArea: true,
            gridRow: true,
            gridRowEnd: true,
            gridRowSpan: true,
            gridRowStart: true,
            gridColumn: true,
            gridColumnEnd: true,
            gridColumnSpan: true,
            gridColumnStart: true,
            fontWeight: true,
            lineClamp: true,
            lineHeight: true,
            opacity: true,
            order: true,
            orphans: true,
            tabSize: true,
            widows: true,
            zIndex: true,
            zoom: true,
            // SVG-related properties
            fillOpacity: true,
            floodOpacity: true,
            stopOpacity: true,
            strokeDasharray: true,
            strokeDashoffset: true,
            strokeMiterlimit: true,
            strokeOpacity: true,
            strokeWidth: true
          };
          function prefixKey(prefix2, key) {
            return prefix2 + key.charAt(0).toUpperCase() + key.substring(1);
          }
          var prefixes2 = ["Webkit", "ms", "Moz", "O"];
          Object.keys(isUnitlessNumber).forEach(function(prop) {
            prefixes2.forEach(function(prefix2) {
              isUnitlessNumber[prefixKey(prefix2, prop)] = isUnitlessNumber[prop];
            });
          });
          function dangerousStyleValue(name2, value, isCustomProperty) {
            var isEmpty11 = value == null || typeof value === "boolean" || value === "";
            if (isEmpty11) {
              return "";
            }
            if (!isCustomProperty && typeof value === "number" && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name2) && isUnitlessNumber[name2])) {
              return value + "px";
            }
            {
              checkCSSPropertyStringCoercion(value, name2);
            }
            return ("" + value).trim();
          }
          var uppercasePattern = /([A-Z])/g;
          var msPattern = /^ms-/;
          function hyphenateStyleName(name2) {
            return name2.replace(uppercasePattern, "-$1").toLowerCase().replace(msPattern, "-ms-");
          }
          var warnValidStyle = function() {
          };
          {
            var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
            var msPattern$1 = /^-ms-/;
            var hyphenPattern = /-(.)/g;
            var badStyleValueWithSemicolonPattern = /;\s*$/;
            var warnedStyleNames = {};
            var warnedStyleValues = {};
            var warnedForNaNValue = false;
            var warnedForInfinityValue = false;
            var camelize3 = function(string) {
              return string.replace(hyphenPattern, function(_113, character) {
                return character.toUpperCase();
              });
            };
            var warnHyphenatedStyleName = function(name2) {
              if (warnedStyleNames.hasOwnProperty(name2) && warnedStyleNames[name2]) {
                return;
              }
              warnedStyleNames[name2] = true;
              error(
                "Unsupported style property %s. Did you mean %s?",
                name2,
                // As Andi Smith suggests
                // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
                // is converted to lowercase `ms`.
                camelize3(name2.replace(msPattern$1, "ms-"))
              );
            };
            var warnBadVendoredStyleName = function(name2) {
              if (warnedStyleNames.hasOwnProperty(name2) && warnedStyleNames[name2]) {
                return;
              }
              warnedStyleNames[name2] = true;
              error("Unsupported vendor-prefixed style property %s. Did you mean %s?", name2, name2.charAt(0).toUpperCase() + name2.slice(1));
            };
            var warnStyleValueWithSemicolon = function(name2, value) {
              if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
                return;
              }
              warnedStyleValues[value] = true;
              error(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`, name2, value.replace(badStyleValueWithSemicolonPattern, ""));
            };
            var warnStyleValueIsNaN = function(name2, value) {
              if (warnedForNaNValue) {
                return;
              }
              warnedForNaNValue = true;
              error("`NaN` is an invalid value for the `%s` css style property.", name2);
            };
            var warnStyleValueIsInfinity = function(name2, value) {
              if (warnedForInfinityValue) {
                return;
              }
              warnedForInfinityValue = true;
              error("`Infinity` is an invalid value for the `%s` css style property.", name2);
            };
            warnValidStyle = function(name2, value) {
              if (name2.indexOf("-") > -1) {
                warnHyphenatedStyleName(name2);
              } else if (badVendoredStyleNamePattern.test(name2)) {
                warnBadVendoredStyleName(name2);
              } else if (badStyleValueWithSemicolonPattern.test(value)) {
                warnStyleValueWithSemicolon(name2, value);
              }
              if (typeof value === "number") {
                if (isNaN(value)) {
                  warnStyleValueIsNaN(name2, value);
                } else if (!isFinite(value)) {
                  warnStyleValueIsInfinity(name2, value);
                }
              }
            };
          }
          var warnValidStyle$1 = warnValidStyle;
          function createDangerousStringForStyles(styles3) {
            {
              var serialized = "";
              var delimiter = "";
              for (var styleName in styles3) {
                if (!styles3.hasOwnProperty(styleName)) {
                  continue;
                }
                var styleValue = styles3[styleName];
                if (styleValue != null) {
                  var isCustomProperty = styleName.indexOf("--") === 0;
                  serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ":";
                  serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
                  delimiter = ";";
                }
              }
              return serialized || null;
            }
          }
          function setValueForStyles(node, styles3) {
            var style2 = node.style;
            for (var styleName in styles3) {
              if (!styles3.hasOwnProperty(styleName)) {
                continue;
              }
              var isCustomProperty = styleName.indexOf("--") === 0;
              {
                if (!isCustomProperty) {
                  warnValidStyle$1(styleName, styles3[styleName]);
                }
              }
              var styleValue = dangerousStyleValue(styleName, styles3[styleName], isCustomProperty);
              if (styleName === "float") {
                styleName = "cssFloat";
              }
              if (isCustomProperty) {
                style2.setProperty(styleName, styleValue);
              } else {
                style2[styleName] = styleValue;
              }
            }
          }
          function isValueEmpty(value) {
            return value == null || typeof value === "boolean" || value === "";
          }
          function expandShorthandMap(styles3) {
            var expanded = {};
            for (var key in styles3) {
              var longhands = shorthandToLonghand[key] || [key];
              for (var i = 0; i < longhands.length; i++) {
                expanded[longhands[i]] = key;
              }
            }
            return expanded;
          }
          function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
            {
              if (!nextStyles) {
                return;
              }
              var expandedUpdates = expandShorthandMap(styleUpdates);
              var expandedStyles = expandShorthandMap(nextStyles);
              var warnedAbout = {};
              for (var key in expandedUpdates) {
                var originalKey = expandedUpdates[key];
                var correctOriginalKey = expandedStyles[key];
                if (correctOriginalKey && originalKey !== correctOriginalKey) {
                  var warningKey = originalKey + "," + correctOriginalKey;
                  if (warnedAbout[warningKey]) {
                    continue;
                  }
                  warnedAbout[warningKey] = true;
                  error("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.", isValueEmpty(styleUpdates[originalKey]) ? "Removing" : "Updating", originalKey, correctOriginalKey);
                }
              }
            }
          }
          var omittedCloseTags = {
            area: true,
            base: true,
            br: true,
            col: true,
            embed: true,
            hr: true,
            img: true,
            input: true,
            keygen: true,
            link: true,
            meta: true,
            param: true,
            source: true,
            track: true,
            wbr: true
            // NOTE: menuitem's close tag should be omitted, but that causes problems.
          };
          var voidElementTags = assign({
            menuitem: true
          }, omittedCloseTags);
          var HTML = "__html";
          function assertValidProps(tag, props) {
            if (!props) {
              return;
            }
            if (voidElementTags[tag]) {
              if (props.children != null || props.dangerouslySetInnerHTML != null) {
                throw new Error(tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");
              }
            }
            if (props.dangerouslySetInnerHTML != null) {
              if (props.children != null) {
                throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
              }
              if (typeof props.dangerouslySetInnerHTML !== "object" || !(HTML in props.dangerouslySetInnerHTML)) {
                throw new Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");
              }
            }
            {
              if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {
                error("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.");
              }
            }
            if (props.style != null && typeof props.style !== "object") {
              throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");
            }
          }
          function isCustomComponent(tagName, props) {
            if (tagName.indexOf("-") === -1) {
              return typeof props.is === "string";
            }
            switch (tagName) {
              // These are reserved SVG and MathML elements.
              // We don't mind this list too much because we expect it to never grow.
              // The alternative is to track the namespace in a few places which is convoluted.
              // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
              case "annotation-xml":
              case "color-profile":
              case "font-face":
              case "font-face-src":
              case "font-face-uri":
              case "font-face-format":
              case "font-face-name":
              case "missing-glyph":
                return false;
              default:
                return true;
            }
          }
          var possibleStandardNames = {
            // HTML
            accept: "accept",
            acceptcharset: "acceptCharset",
            "accept-charset": "acceptCharset",
            accesskey: "accessKey",
            action: "action",
            allowfullscreen: "allowFullScreen",
            alt: "alt",
            as: "as",
            async: "async",
            autocapitalize: "autoCapitalize",
            autocomplete: "autoComplete",
            autocorrect: "autoCorrect",
            autofocus: "autoFocus",
            autoplay: "autoPlay",
            autosave: "autoSave",
            capture: "capture",
            cellpadding: "cellPadding",
            cellspacing: "cellSpacing",
            challenge: "challenge",
            charset: "charSet",
            checked: "checked",
            children: "children",
            cite: "cite",
            class: "className",
            classid: "classID",
            classname: "className",
            cols: "cols",
            colspan: "colSpan",
            content: "content",
            contenteditable: "contentEditable",
            contextmenu: "contextMenu",
            controls: "controls",
            controlslist: "controlsList",
            coords: "coords",
            crossorigin: "crossOrigin",
            dangerouslysetinnerhtml: "dangerouslySetInnerHTML",
            data: "data",
            datetime: "dateTime",
            default: "default",
            defaultchecked: "defaultChecked",
            defaultvalue: "defaultValue",
            defer: "defer",
            dir: "dir",
            disabled: "disabled",
            disablepictureinpicture: "disablePictureInPicture",
            disableremoteplayback: "disableRemotePlayback",
            download: "download",
            draggable: "draggable",
            enctype: "encType",
            enterkeyhint: "enterKeyHint",
            for: "htmlFor",
            form: "form",
            formmethod: "formMethod",
            formaction: "formAction",
            formenctype: "formEncType",
            formnovalidate: "formNoValidate",
            formtarget: "formTarget",
            frameborder: "frameBorder",
            headers: "headers",
            height: "height",
            hidden: "hidden",
            high: "high",
            href: "href",
            hreflang: "hrefLang",
            htmlfor: "htmlFor",
            httpequiv: "httpEquiv",
            "http-equiv": "httpEquiv",
            icon: "icon",
            id: "id",
            imagesizes: "imageSizes",
            imagesrcset: "imageSrcSet",
            innerhtml: "innerHTML",
            inputmode: "inputMode",
            integrity: "integrity",
            is: "is",
            itemid: "itemID",
            itemprop: "itemProp",
            itemref: "itemRef",
            itemscope: "itemScope",
            itemtype: "itemType",
            keyparams: "keyParams",
            keytype: "keyType",
            kind: "kind",
            label: "label",
            lang: "lang",
            list: "list",
            loop: "loop",
            low: "low",
            manifest: "manifest",
            marginwidth: "marginWidth",
            marginheight: "marginHeight",
            max: "max",
            maxlength: "maxLength",
            media: "media",
            mediagroup: "mediaGroup",
            method: "method",
            min: "min",
            minlength: "minLength",
            multiple: "multiple",
            muted: "muted",
            name: "name",
            nomodule: "noModule",
            nonce: "nonce",
            novalidate: "noValidate",
            open: "open",
            optimum: "optimum",
            pattern: "pattern",
            placeholder: "placeholder",
            playsinline: "playsInline",
            poster: "poster",
            preload: "preload",
            profile: "profile",
            radiogroup: "radioGroup",
            readonly: "readOnly",
            referrerpolicy: "referrerPolicy",
            rel: "rel",
            required: "required",
            reversed: "reversed",
            role: "role",
            rows: "rows",
            rowspan: "rowSpan",
            sandbox: "sandbox",
            scope: "scope",
            scoped: "scoped",
            scrolling: "scrolling",
            seamless: "seamless",
            selected: "selected",
            shape: "shape",
            size: "size",
            sizes: "sizes",
            span: "span",
            spellcheck: "spellCheck",
            src: "src",
            srcdoc: "srcDoc",
            srclang: "srcLang",
            srcset: "srcSet",
            start: "start",
            step: "step",
            style: "style",
            summary: "summary",
            tabindex: "tabIndex",
            target: "target",
            title: "title",
            type: "type",
            usemap: "useMap",
            value: "value",
            width: "width",
            wmode: "wmode",
            wrap: "wrap",
            // SVG
            about: "about",
            accentheight: "accentHeight",
            "accent-height": "accentHeight",
            accumulate: "accumulate",
            additive: "additive",
            alignmentbaseline: "alignmentBaseline",
            "alignment-baseline": "alignmentBaseline",
            allowreorder: "allowReorder",
            alphabetic: "alphabetic",
            amplitude: "amplitude",
            arabicform: "arabicForm",
            "arabic-form": "arabicForm",
            ascent: "ascent",
            attributename: "attributeName",
            attributetype: "attributeType",
            autoreverse: "autoReverse",
            azimuth: "azimuth",
            basefrequency: "baseFrequency",
            baselineshift: "baselineShift",
            "baseline-shift": "baselineShift",
            baseprofile: "baseProfile",
            bbox: "bbox",
            begin: "begin",
            bias: "bias",
            by: "by",
            calcmode: "calcMode",
            capheight: "capHeight",
            "cap-height": "capHeight",
            clip: "clip",
            clippath: "clipPath",
            "clip-path": "clipPath",
            clippathunits: "clipPathUnits",
            cliprule: "clipRule",
            "clip-rule": "clipRule",
            color: "color",
            colorinterpolation: "colorInterpolation",
            "color-interpolation": "colorInterpolation",
            colorinterpolationfilters: "colorInterpolationFilters",
            "color-interpolation-filters": "colorInterpolationFilters",
            colorprofile: "colorProfile",
            "color-profile": "colorProfile",
            colorrendering: "colorRendering",
            "color-rendering": "colorRendering",
            contentscripttype: "contentScriptType",
            contentstyletype: "contentStyleType",
            cursor: "cursor",
            cx: "cx",
            cy: "cy",
            d: "d",
            datatype: "datatype",
            decelerate: "decelerate",
            descent: "descent",
            diffuseconstant: "diffuseConstant",
            direction: "direction",
            display: "display",
            divisor: "divisor",
            dominantbaseline: "dominantBaseline",
            "dominant-baseline": "dominantBaseline",
            dur: "dur",
            dx: "dx",
            dy: "dy",
            edgemode: "edgeMode",
            elevation: "elevation",
            enablebackground: "enableBackground",
            "enable-background": "enableBackground",
            end: "end",
            exponent: "exponent",
            externalresourcesrequired: "externalResourcesRequired",
            fill: "fill",
            fillopacity: "fillOpacity",
            "fill-opacity": "fillOpacity",
            fillrule: "fillRule",
            "fill-rule": "fillRule",
            filter: "filter",
            filterres: "filterRes",
            filterunits: "filterUnits",
            floodopacity: "floodOpacity",
            "flood-opacity": "floodOpacity",
            floodcolor: "floodColor",
            "flood-color": "floodColor",
            focusable: "focusable",
            fontfamily: "fontFamily",
            "font-family": "fontFamily",
            fontsize: "fontSize",
            "font-size": "fontSize",
            fontsizeadjust: "fontSizeAdjust",
            "font-size-adjust": "fontSizeAdjust",
            fontstretch: "fontStretch",
            "font-stretch": "fontStretch",
            fontstyle: "fontStyle",
            "font-style": "fontStyle",
            fontvariant: "fontVariant",
            "font-variant": "fontVariant",
            fontweight: "fontWeight",
            "font-weight": "fontWeight",
            format: "format",
            from: "from",
            fx: "fx",
            fy: "fy",
            g1: "g1",
            g2: "g2",
            glyphname: "glyphName",
            "glyph-name": "glyphName",
            glyphorientationhorizontal: "glyphOrientationHorizontal",
            "glyph-orientation-horizontal": "glyphOrientationHorizontal",
            glyphorientationvertical: "glyphOrientationVertical",
            "glyph-orientation-vertical": "glyphOrientationVertical",
            glyphref: "glyphRef",
            gradienttransform: "gradientTransform",
            gradientunits: "gradientUnits",
            hanging: "hanging",
            horizadvx: "horizAdvX",
            "horiz-adv-x": "horizAdvX",
            horizoriginx: "horizOriginX",
            "horiz-origin-x": "horizOriginX",
            ideographic: "ideographic",
            imagerendering: "imageRendering",
            "image-rendering": "imageRendering",
            in2: "in2",
            in: "in",
            inlist: "inlist",
            intercept: "intercept",
            k1: "k1",
            k2: "k2",
            k3: "k3",
            k4: "k4",
            k: "k",
            kernelmatrix: "kernelMatrix",
            kernelunitlength: "kernelUnitLength",
            kerning: "kerning",
            keypoints: "keyPoints",
            keysplines: "keySplines",
            keytimes: "keyTimes",
            lengthadjust: "lengthAdjust",
            letterspacing: "letterSpacing",
            "letter-spacing": "letterSpacing",
            lightingcolor: "lightingColor",
            "lighting-color": "lightingColor",
            limitingconeangle: "limitingConeAngle",
            local: "local",
            markerend: "markerEnd",
            "marker-end": "markerEnd",
            markerheight: "markerHeight",
            markermid: "markerMid",
            "marker-mid": "markerMid",
            markerstart: "markerStart",
            "marker-start": "markerStart",
            markerunits: "markerUnits",
            markerwidth: "markerWidth",
            mask: "mask",
            maskcontentunits: "maskContentUnits",
            maskunits: "maskUnits",
            mathematical: "mathematical",
            mode: "mode",
            numoctaves: "numOctaves",
            offset: "offset",
            opacity: "opacity",
            operator: "operator",
            order: "order",
            orient: "orient",
            orientation: "orientation",
            origin: "origin",
            overflow: "overflow",
            overlineposition: "overlinePosition",
            "overline-position": "overlinePosition",
            overlinethickness: "overlineThickness",
            "overline-thickness": "overlineThickness",
            paintorder: "paintOrder",
            "paint-order": "paintOrder",
            panose1: "panose1",
            "panose-1": "panose1",
            pathlength: "pathLength",
            patterncontentunits: "patternContentUnits",
            patterntransform: "patternTransform",
            patternunits: "patternUnits",
            pointerevents: "pointerEvents",
            "pointer-events": "pointerEvents",
            points: "points",
            pointsatx: "pointsAtX",
            pointsaty: "pointsAtY",
            pointsatz: "pointsAtZ",
            prefix: "prefix",
            preservealpha: "preserveAlpha",
            preserveaspectratio: "preserveAspectRatio",
            primitiveunits: "primitiveUnits",
            property: "property",
            r: "r",
            radius: "radius",
            refx: "refX",
            refy: "refY",
            renderingintent: "renderingIntent",
            "rendering-intent": "renderingIntent",
            repeatcount: "repeatCount",
            repeatdur: "repeatDur",
            requiredextensions: "requiredExtensions",
            requiredfeatures: "requiredFeatures",
            resource: "resource",
            restart: "restart",
            result: "result",
            results: "results",
            rotate: "rotate",
            rx: "rx",
            ry: "ry",
            scale: "scale",
            security: "security",
            seed: "seed",
            shaperendering: "shapeRendering",
            "shape-rendering": "shapeRendering",
            slope: "slope",
            spacing: "spacing",
            specularconstant: "specularConstant",
            specularexponent: "specularExponent",
            speed: "speed",
            spreadmethod: "spreadMethod",
            startoffset: "startOffset",
            stddeviation: "stdDeviation",
            stemh: "stemh",
            stemv: "stemv",
            stitchtiles: "stitchTiles",
            stopcolor: "stopColor",
            "stop-color": "stopColor",
            stopopacity: "stopOpacity",
            "stop-opacity": "stopOpacity",
            strikethroughposition: "strikethroughPosition",
            "strikethrough-position": "strikethroughPosition",
            strikethroughthickness: "strikethroughThickness",
            "strikethrough-thickness": "strikethroughThickness",
            string: "string",
            stroke: "stroke",
            strokedasharray: "strokeDasharray",
            "stroke-dasharray": "strokeDasharray",
            strokedashoffset: "strokeDashoffset",
            "stroke-dashoffset": "strokeDashoffset",
            strokelinecap: "strokeLinecap",
            "stroke-linecap": "strokeLinecap",
            strokelinejoin: "strokeLinejoin",
            "stroke-linejoin": "strokeLinejoin",
            strokemiterlimit: "strokeMiterlimit",
            "stroke-miterlimit": "strokeMiterlimit",
            strokewidth: "strokeWidth",
            "stroke-width": "strokeWidth",
            strokeopacity: "strokeOpacity",
            "stroke-opacity": "strokeOpacity",
            suppresscontenteditablewarning: "suppressContentEditableWarning",
            suppresshydrationwarning: "suppressHydrationWarning",
            surfacescale: "surfaceScale",
            systemlanguage: "systemLanguage",
            tablevalues: "tableValues",
            targetx: "targetX",
            targety: "targetY",
            textanchor: "textAnchor",
            "text-anchor": "textAnchor",
            textdecoration: "textDecoration",
            "text-decoration": "textDecoration",
            textlength: "textLength",
            textrendering: "textRendering",
            "text-rendering": "textRendering",
            to: "to",
            transform: "transform",
            typeof: "typeof",
            u1: "u1",
            u2: "u2",
            underlineposition: "underlinePosition",
            "underline-position": "underlinePosition",
            underlinethickness: "underlineThickness",
            "underline-thickness": "underlineThickness",
            unicode: "unicode",
            unicodebidi: "unicodeBidi",
            "unicode-bidi": "unicodeBidi",
            unicoderange: "unicodeRange",
            "unicode-range": "unicodeRange",
            unitsperem: "unitsPerEm",
            "units-per-em": "unitsPerEm",
            unselectable: "unselectable",
            valphabetic: "vAlphabetic",
            "v-alphabetic": "vAlphabetic",
            values: "values",
            vectoreffect: "vectorEffect",
            "vector-effect": "vectorEffect",
            version: "version",
            vertadvy: "vertAdvY",
            "vert-adv-y": "vertAdvY",
            vertoriginx: "vertOriginX",
            "vert-origin-x": "vertOriginX",
            vertoriginy: "vertOriginY",
            "vert-origin-y": "vertOriginY",
            vhanging: "vHanging",
            "v-hanging": "vHanging",
            videographic: "vIdeographic",
            "v-ideographic": "vIdeographic",
            viewbox: "viewBox",
            viewtarget: "viewTarget",
            visibility: "visibility",
            vmathematical: "vMathematical",
            "v-mathematical": "vMathematical",
            vocab: "vocab",
            widths: "widths",
            wordspacing: "wordSpacing",
            "word-spacing": "wordSpacing",
            writingmode: "writingMode",
            "writing-mode": "writingMode",
            x1: "x1",
            x2: "x2",
            x: "x",
            xchannelselector: "xChannelSelector",
            xheight: "xHeight",
            "x-height": "xHeight",
            xlinkactuate: "xlinkActuate",
            "xlink:actuate": "xlinkActuate",
            xlinkarcrole: "xlinkArcrole",
            "xlink:arcrole": "xlinkArcrole",
            xlinkhref: "xlinkHref",
            "xlink:href": "xlinkHref",
            xlinkrole: "xlinkRole",
            "xlink:role": "xlinkRole",
            xlinkshow: "xlinkShow",
            "xlink:show": "xlinkShow",
            xlinktitle: "xlinkTitle",
            "xlink:title": "xlinkTitle",
            xlinktype: "xlinkType",
            "xlink:type": "xlinkType",
            xmlbase: "xmlBase",
            "xml:base": "xmlBase",
            xmllang: "xmlLang",
            "xml:lang": "xmlLang",
            xmlns: "xmlns",
            "xml:space": "xmlSpace",
            xmlnsxlink: "xmlnsXlink",
            "xmlns:xlink": "xmlnsXlink",
            xmlspace: "xmlSpace",
            y1: "y1",
            y2: "y2",
            y: "y",
            ychannelselector: "yChannelSelector",
            z: "z",
            zoomandpan: "zoomAndPan"
          };
          var ariaProperties = {
            "aria-current": 0,
            // state
            "aria-description": 0,
            "aria-details": 0,
            "aria-disabled": 0,
            // state
            "aria-hidden": 0,
            // state
            "aria-invalid": 0,
            // state
            "aria-keyshortcuts": 0,
            "aria-label": 0,
            "aria-roledescription": 0,
            // Widget Attributes
            "aria-autocomplete": 0,
            "aria-checked": 0,
            "aria-expanded": 0,
            "aria-haspopup": 0,
            "aria-level": 0,
            "aria-modal": 0,
            "aria-multiline": 0,
            "aria-multiselectable": 0,
            "aria-orientation": 0,
            "aria-placeholder": 0,
            "aria-pressed": 0,
            "aria-readonly": 0,
            "aria-required": 0,
            "aria-selected": 0,
            "aria-sort": 0,
            "aria-valuemax": 0,
            "aria-valuemin": 0,
            "aria-valuenow": 0,
            "aria-valuetext": 0,
            // Live Region Attributes
            "aria-atomic": 0,
            "aria-busy": 0,
            "aria-live": 0,
            "aria-relevant": 0,
            // Drag-and-Drop Attributes
            "aria-dropeffect": 0,
            "aria-grabbed": 0,
            // Relationship Attributes
            "aria-activedescendant": 0,
            "aria-colcount": 0,
            "aria-colindex": 0,
            "aria-colspan": 0,
            "aria-controls": 0,
            "aria-describedby": 0,
            "aria-errormessage": 0,
            "aria-flowto": 0,
            "aria-labelledby": 0,
            "aria-owns": 0,
            "aria-posinset": 0,
            "aria-rowcount": 0,
            "aria-rowindex": 0,
            "aria-rowspan": 0,
            "aria-setsize": 0
          };
          var warnedProperties = {};
          var rARIA = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$");
          var rARIACamel = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$");
          function validateProperty(tagName, name2) {
            {
              if (hasOwnProperty.call(warnedProperties, name2) && warnedProperties[name2]) {
                return true;
              }
              if (rARIACamel.test(name2)) {
                var ariaName = "aria-" + name2.slice(4).toLowerCase();
                var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null;
                if (correctName == null) {
                  error("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", name2);
                  warnedProperties[name2] = true;
                  return true;
                }
                if (name2 !== correctName) {
                  error("Invalid ARIA attribute `%s`. Did you mean `%s`?", name2, correctName);
                  warnedProperties[name2] = true;
                  return true;
                }
              }
              if (rARIA.test(name2)) {
                var lowerCasedName = name2.toLowerCase();
                var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;
                if (standardName == null) {
                  warnedProperties[name2] = true;
                  return false;
                }
                if (name2 !== standardName) {
                  error("Unknown ARIA attribute `%s`. Did you mean `%s`?", name2, standardName);
                  warnedProperties[name2] = true;
                  return true;
                }
              }
            }
            return true;
          }
          function warnInvalidARIAProps(type, props) {
            {
              var invalidProps = [];
              for (var key in props) {
                var isValid = validateProperty(type, key);
                if (!isValid) {
                  invalidProps.push(key);
                }
              }
              var unknownPropString = invalidProps.map(function(prop) {
                return "`" + prop + "`";
              }).join(", ");
              if (invalidProps.length === 1) {
                error("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type);
              } else if (invalidProps.length > 1) {
                error("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type);
              }
            }
          }
          function validateProperties(type, props) {
            if (isCustomComponent(type, props)) {
              return;
            }
            warnInvalidARIAProps(type, props);
          }
          var didWarnValueNull = false;
          function validateProperties$1(type, props) {
            {
              if (type !== "input" && type !== "textarea" && type !== "select") {
                return;
              }
              if (props != null && props.value === null && !didWarnValueNull) {
                didWarnValueNull = true;
                if (type === "select" && props.multiple) {
                  error("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.", type);
                } else {
                  error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", type);
                }
              }
            }
          }
          var validateProperty$1 = function() {
          };
          {
            var warnedProperties$1 = {};
            var EVENT_NAME_REGEX = /^on./;
            var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
            var rARIA$1 = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$");
            var rARIACamel$1 = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$");
            validateProperty$1 = function(tagName, name2, value, eventRegistry) {
              if (hasOwnProperty.call(warnedProperties$1, name2) && warnedProperties$1[name2]) {
                return true;
              }
              var lowerCasedName = name2.toLowerCase();
              if (lowerCasedName === "onfocusin" || lowerCasedName === "onfocusout") {
                error("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React.");
                warnedProperties$1[name2] = true;
                return true;
              }
              if (eventRegistry != null) {
                var registrationNameDependencies2 = eventRegistry.registrationNameDependencies, possibleRegistrationNames2 = eventRegistry.possibleRegistrationNames;
                if (registrationNameDependencies2.hasOwnProperty(name2)) {
                  return true;
                }
                var registrationName = possibleRegistrationNames2.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames2[lowerCasedName] : null;
                if (registrationName != null) {
                  error("Invalid event handler property `%s`. Did you mean `%s`?", name2, registrationName);
                  warnedProperties$1[name2] = true;
                  return true;
                }
                if (EVENT_NAME_REGEX.test(name2)) {
                  error("Unknown event handler property `%s`. It will be ignored.", name2);
                  warnedProperties$1[name2] = true;
                  return true;
                }
              } else if (EVENT_NAME_REGEX.test(name2)) {
                if (INVALID_EVENT_NAME_REGEX.test(name2)) {
                  error("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", name2);
                }
                warnedProperties$1[name2] = true;
                return true;
              }
              if (rARIA$1.test(name2) || rARIACamel$1.test(name2)) {
                return true;
              }
              if (lowerCasedName === "innerhtml") {
                error("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`.");
                warnedProperties$1[name2] = true;
                return true;
              }
              if (lowerCasedName === "aria") {
                error("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead.");
                warnedProperties$1[name2] = true;
                return true;
              }
              if (lowerCasedName === "is" && value !== null && value !== void 0 && typeof value !== "string") {
                error("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.", typeof value);
                warnedProperties$1[name2] = true;
                return true;
              }
              if (typeof value === "number" && isNaN(value)) {
                error("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", name2);
                warnedProperties$1[name2] = true;
                return true;
              }
              var propertyInfo = getPropertyInfo(name2);
              var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED;
              if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
                var standardName = possibleStandardNames[lowerCasedName];
                if (standardName !== name2) {
                  error("Invalid DOM property `%s`. Did you mean `%s`?", name2, standardName);
                  warnedProperties$1[name2] = true;
                  return true;
                }
              } else if (!isReserved && name2 !== lowerCasedName) {
                error("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.", name2, lowerCasedName);
                warnedProperties$1[name2] = true;
                return true;
              }
              if (typeof value === "boolean" && shouldRemoveAttributeWithWarning(name2, value, propertyInfo, false)) {
                if (value) {
                  error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.', value, name2, name2, value, name2);
                } else {
                  error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.', value, name2, name2, value, name2, name2, name2);
                }
                warnedProperties$1[name2] = true;
                return true;
              }
              if (isReserved) {
                return true;
              }
              if (shouldRemoveAttributeWithWarning(name2, value, propertyInfo, false)) {
                warnedProperties$1[name2] = true;
                return false;
              }
              if ((value === "false" || value === "true") && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
                error("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?", value, name2, value === "false" ? "The browser will interpret it as a truthy value." : 'Although this works, it will not work as expected if you pass the string "false".', name2, value);
                warnedProperties$1[name2] = true;
                return true;
              }
              return true;
            };
          }
          var warnUnknownProperties = function(type, props, eventRegistry) {
            {
              var unknownProps = [];
              for (var key in props) {
                var isValid = validateProperty$1(type, key, props[key], eventRegistry);
                if (!isValid) {
                  unknownProps.push(key);
                }
              }
              var unknownPropString = unknownProps.map(function(prop) {
                return "`" + prop + "`";
              }).join(", ");
              if (unknownProps.length === 1) {
                error("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type);
              } else if (unknownProps.length > 1) {
                error("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type);
              }
            }
          };
          function validateProperties$2(type, props, eventRegistry) {
            if (isCustomComponent(type, props)) {
              return;
            }
            warnUnknownProperties(type, props, eventRegistry);
          }
          var IS_EVENT_HANDLE_NON_MANAGED_NODE = 1;
          var IS_NON_DELEGATED = 1 << 1;
          var IS_CAPTURE_PHASE = 1 << 2;
          var SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS = IS_EVENT_HANDLE_NON_MANAGED_NODE | IS_NON_DELEGATED | IS_CAPTURE_PHASE;
          var currentReplayingEvent = null;
          function setReplayingEvent(event) {
            {
              if (currentReplayingEvent !== null) {
                error("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            currentReplayingEvent = event;
          }
          function resetReplayingEvent() {
            {
              if (currentReplayingEvent === null) {
                error("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            currentReplayingEvent = null;
          }
          function isReplayingEvent(event) {
            return event === currentReplayingEvent;
          }
          function getEventTarget(nativeEvent) {
            var target = nativeEvent.target || nativeEvent.srcElement || window;
            if (target.correspondingUseElement) {
              target = target.correspondingUseElement;
            }
            return target.nodeType === TEXT_NODE ? target.parentNode : target;
          }
          var restoreImpl = null;
          var restoreTarget = null;
          var restoreQueue = null;
          function restoreStateOfTarget(target) {
            var internalInstance = getInstanceFromNode(target);
            if (!internalInstance) {
              return;
            }
            if (typeof restoreImpl !== "function") {
              throw new Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");
            }
            var stateNode = internalInstance.stateNode;
            if (stateNode) {
              var _props = getFiberCurrentPropsFromNode(stateNode);
              restoreImpl(internalInstance.stateNode, internalInstance.type, _props);
            }
          }
          function setRestoreImplementation(impl) {
            restoreImpl = impl;
          }
          function enqueueStateRestore(target) {
            if (restoreTarget) {
              if (restoreQueue) {
                restoreQueue.push(target);
              } else {
                restoreQueue = [target];
              }
            } else {
              restoreTarget = target;
            }
          }
          function needsStateRestore() {
            return restoreTarget !== null || restoreQueue !== null;
          }
          function restoreStateIfNeeded() {
            if (!restoreTarget) {
              return;
            }
            var target = restoreTarget;
            var queuedTargets = restoreQueue;
            restoreTarget = null;
            restoreQueue = null;
            restoreStateOfTarget(target);
            if (queuedTargets) {
              for (var i = 0; i < queuedTargets.length; i++) {
                restoreStateOfTarget(queuedTargets[i]);
              }
            }
          }
          var batchedUpdatesImpl = function(fn, bookkeeping) {
            return fn(bookkeeping);
          };
          var flushSyncImpl = function() {
          };
          var isInsideEventHandler = false;
          function finishEventHandler() {
            var controlledComponentsHavePendingUpdates = needsStateRestore();
            if (controlledComponentsHavePendingUpdates) {
              flushSyncImpl();
              restoreStateIfNeeded();
            }
          }
          function batchedUpdates(fn, a2, b) {
            if (isInsideEventHandler) {
              return fn(a2, b);
            }
            isInsideEventHandler = true;
            try {
              return batchedUpdatesImpl(fn, a2, b);
            } finally {
              isInsideEventHandler = false;
              finishEventHandler();
            }
          }
          function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushSyncImpl) {
            batchedUpdatesImpl = _batchedUpdatesImpl;
            flushSyncImpl = _flushSyncImpl;
          }
          function isInteractive(tag) {
            return tag === "button" || tag === "input" || tag === "select" || tag === "textarea";
          }
          function shouldPreventMouseEvent(name2, type, props) {
            switch (name2) {
              case "onClick":
              case "onClickCapture":
              case "onDoubleClick":
              case "onDoubleClickCapture":
              case "onMouseDown":
              case "onMouseDownCapture":
              case "onMouseMove":
              case "onMouseMoveCapture":
              case "onMouseUp":
              case "onMouseUpCapture":
              case "onMouseEnter":
                return !!(props.disabled && isInteractive(type));
              default:
                return false;
            }
          }
          function getListener(inst, registrationName) {
            var stateNode = inst.stateNode;
            if (stateNode === null) {
              return null;
            }
            var props = getFiberCurrentPropsFromNode(stateNode);
            if (props === null) {
              return null;
            }
            var listener = props[registrationName];
            if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
              return null;
            }
            if (listener && typeof listener !== "function") {
              throw new Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type.");
            }
            return listener;
          }
          var passiveBrowserEventsSupported = false;
          if (canUseDOM3) {
            try {
              var options5 = {};
              Object.defineProperty(options5, "passive", {
                get: function() {
                  passiveBrowserEventsSupported = true;
                }
              });
              window.addEventListener("test", options5, options5);
              window.removeEventListener("test", options5, options5);
            } catch (e) {
              passiveBrowserEventsSupported = false;
            }
          }
          function invokeGuardedCallbackProd(name2, func, context, a2, b, c2, d, e, f) {
            var funcArgs = Array.prototype.slice.call(arguments, 3);
            try {
              func.apply(context, funcArgs);
            } catch (error2) {
              this.onError(error2);
            }
          }
          var invokeGuardedCallbackImpl = invokeGuardedCallbackProd;
          {
            if (typeof window !== "undefined" && typeof window.dispatchEvent === "function" && typeof document !== "undefined" && typeof document.createEvent === "function") {
              var fakeNode = document.createElement("react");
              invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name2, func, context, a2, b, c2, d, e, f) {
                if (typeof document === "undefined" || document === null) {
                  throw new Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");
                }
                var evt = document.createEvent("Event");
                var didCall = false;
                var didError = true;
                var windowEvent = window.event;
                var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, "event");
                function restoreAfterDispatch() {
                  fakeNode.removeEventListener(evtType, callCallback2, false);
                  if (typeof window.event !== "undefined" && window.hasOwnProperty("event")) {
                    window.event = windowEvent;
                  }
                }
                var funcArgs = Array.prototype.slice.call(arguments, 3);
                function callCallback2() {
                  didCall = true;
                  restoreAfterDispatch();
                  func.apply(context, funcArgs);
                  didError = false;
                }
                var error2;
                var didSetError = false;
                var isCrossOriginError = false;
                function handleWindowError(event) {
                  error2 = event.error;
                  didSetError = true;
                  if (error2 === null && event.colno === 0 && event.lineno === 0) {
                    isCrossOriginError = true;
                  }
                  if (event.defaultPrevented) {
                    if (error2 != null && typeof error2 === "object") {
                      try {
                        error2._suppressLogging = true;
                      } catch (inner) {
                      }
                    }
                  }
                }
                var evtType = "react-" + (name2 ? name2 : "invokeguardedcallback");
                window.addEventListener("error", handleWindowError);
                fakeNode.addEventListener(evtType, callCallback2, false);
                evt.initEvent(evtType, false, false);
                fakeNode.dispatchEvent(evt);
                if (windowEventDescriptor) {
                  Object.defineProperty(window, "event", windowEventDescriptor);
                }
                if (didCall && didError) {
                  if (!didSetError) {
                    error2 = new Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`);
                  } else if (isCrossOriginError) {
                    error2 = new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.");
                  }
                  this.onError(error2);
                }
                window.removeEventListener("error", handleWindowError);
                if (!didCall) {
                  restoreAfterDispatch();
                  return invokeGuardedCallbackProd.apply(this, arguments);
                }
              };
            }
          }
          var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;
          var hasError = false;
          var caughtError = null;
          var hasRethrowError = false;
          var rethrowError = null;
          var reporter = {
            onError: function(error2) {
              hasError = true;
              caughtError = error2;
            }
          };
          function invokeGuardedCallback(name2, func, context, a2, b, c2, d, e, f) {
            hasError = false;
            caughtError = null;
            invokeGuardedCallbackImpl$1.apply(reporter, arguments);
          }
          function invokeGuardedCallbackAndCatchFirstError(name2, func, context, a2, b, c2, d, e, f) {
            invokeGuardedCallback.apply(this, arguments);
            if (hasError) {
              var error2 = clearCaughtError();
              if (!hasRethrowError) {
                hasRethrowError = true;
                rethrowError = error2;
              }
            }
          }
          function rethrowCaughtError() {
            if (hasRethrowError) {
              var error2 = rethrowError;
              hasRethrowError = false;
              rethrowError = null;
              throw error2;
            }
          }
          function hasCaughtError() {
            return hasError;
          }
          function clearCaughtError() {
            if (hasError) {
              var error2 = caughtError;
              hasError = false;
              caughtError = null;
              return error2;
            } else {
              throw new Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
            }
          }
          function get(key) {
            return key._reactInternals;
          }
          function has(key) {
            return key._reactInternals !== void 0;
          }
          function set(key, value) {
            key._reactInternals = value;
          }
          var NoFlags = (
            /*                      */
            0
          );
          var PerformedWork = (
            /*                */
            1
          );
          var Placement = (
            /*                    */
            2
          );
          var Update = (
            /*                       */
            4
          );
          var ChildDeletion = (
            /*                */
            16
          );
          var ContentReset = (
            /*                 */
            32
          );
          var Callback = (
            /*                     */
            64
          );
          var DidCapture = (
            /*                   */
            128
          );
          var ForceClientRender = (
            /*            */
            256
          );
          var Ref = (
            /*                          */
            512
          );
          var Snapshot = (
            /*                     */
            1024
          );
          var Passive = (
            /*                      */
            2048
          );
          var Hydrating = (
            /*                    */
            4096
          );
          var Visibility2 = (
            /*                   */
            8192
          );
          var StoreConsistency = (
            /*             */
            16384
          );
          var LifecycleEffectMask = Passive | Update | Callback | Ref | Snapshot | StoreConsistency;
          var HostEffectMask = (
            /*               */
            32767
          );
          var Incomplete = (
            /*                   */
            32768
          );
          var ShouldCapture = (
            /*                */
            65536
          );
          var ForceUpdateForLegacySuspense = (
            /* */
            131072
          );
          var Forked = (
            /*                       */
            1048576
          );
          var RefStatic = (
            /*                    */
            2097152
          );
          var LayoutStatic = (
            /*                 */
            4194304
          );
          var PassiveStatic = (
            /*                */
            8388608
          );
          var MountLayoutDev = (
            /*               */
            16777216
          );
          var MountPassiveDev = (
            /*              */
            33554432
          );
          var BeforeMutationMask = (
            // TODO: Remove Update flag from before mutation phase by re-landing Visibility
            // flag logic (see #20043)
            Update | Snapshot | 0
          );
          var MutationMask = Placement | Update | ChildDeletion | ContentReset | Ref | Hydrating | Visibility2;
          var LayoutMask = Update | Callback | Ref | Visibility2;
          var PassiveMask = Passive | ChildDeletion;
          var StaticMask = LayoutStatic | PassiveStatic | RefStatic;
          var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
          function getNearestMountedFiber(fiber) {
            var node = fiber;
            var nearestMounted = fiber;
            if (!fiber.alternate) {
              var nextNode = node;
              do {
                node = nextNode;
                if ((node.flags & (Placement | Hydrating)) !== NoFlags) {
                  nearestMounted = node.return;
                }
                nextNode = node.return;
              } while (nextNode);
            } else {
              while (node.return) {
                node = node.return;
              }
            }
            if (node.tag === HostRoot) {
              return nearestMounted;
            }
            return null;
          }
          function getSuspenseInstanceFromFiber(fiber) {
            if (fiber.tag === SuspenseComponent) {
              var suspenseState = fiber.memoizedState;
              if (suspenseState === null) {
                var current2 = fiber.alternate;
                if (current2 !== null) {
                  suspenseState = current2.memoizedState;
                }
              }
              if (suspenseState !== null) {
                return suspenseState.dehydrated;
              }
            }
            return null;
          }
          function getContainerFromFiber(fiber) {
            return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;
          }
          function isFiberMounted(fiber) {
            return getNearestMountedFiber(fiber) === fiber;
          }
          function isMounted(component) {
            {
              var owner = ReactCurrentOwner.current;
              if (owner !== null && owner.tag === ClassComponent) {
                var ownerFiber = owner;
                var instance = ownerFiber.stateNode;
                if (!instance._warnedAboutRefsInRender) {
                  error("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", getComponentNameFromFiber(ownerFiber) || "A component");
                }
                instance._warnedAboutRefsInRender = true;
              }
            }
            var fiber = get(component);
            if (!fiber) {
              return false;
            }
            return getNearestMountedFiber(fiber) === fiber;
          }
          function assertIsMounted(fiber) {
            if (getNearestMountedFiber(fiber) !== fiber) {
              throw new Error("Unable to find node on an unmounted component.");
            }
          }
          function findCurrentFiberUsingSlowPath(fiber) {
            var alternate = fiber.alternate;
            if (!alternate) {
              var nearestMounted = getNearestMountedFiber(fiber);
              if (nearestMounted === null) {
                throw new Error("Unable to find node on an unmounted component.");
              }
              if (nearestMounted !== fiber) {
                return null;
              }
              return fiber;
            }
            var a2 = fiber;
            var b = alternate;
            while (true) {
              var parentA = a2.return;
              if (parentA === null) {
                break;
              }
              var parentB = parentA.alternate;
              if (parentB === null) {
                var nextParent = parentA.return;
                if (nextParent !== null) {
                  a2 = b = nextParent;
                  continue;
                }
                break;
              }
              if (parentA.child === parentB.child) {
                var child = parentA.child;
                while (child) {
                  if (child === a2) {
                    assertIsMounted(parentA);
                    return fiber;
                  }
                  if (child === b) {
                    assertIsMounted(parentA);
                    return alternate;
                  }
                  child = child.sibling;
                }
                throw new Error("Unable to find node on an unmounted component.");
              }
              if (a2.return !== b.return) {
                a2 = parentA;
                b = parentB;
              } else {
                var didFindChild = false;
                var _child = parentA.child;
                while (_child) {
                  if (_child === a2) {
                    didFindChild = true;
                    a2 = parentA;
                    b = parentB;
                    break;
                  }
                  if (_child === b) {
                    didFindChild = true;
                    b = parentA;
                    a2 = parentB;
                    break;
                  }
                  _child = _child.sibling;
                }
                if (!didFindChild) {
                  _child = parentB.child;
                  while (_child) {
                    if (_child === a2) {
                      didFindChild = true;
                      a2 = parentB;
                      b = parentA;
                      break;
                    }
                    if (_child === b) {
                      didFindChild = true;
                      b = parentB;
                      a2 = parentA;
                      break;
                    }
                    _child = _child.sibling;
                  }
                  if (!didFindChild) {
                    throw new Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");
                  }
                }
              }
              if (a2.alternate !== b) {
                throw new Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            if (a2.tag !== HostRoot) {
              throw new Error("Unable to find node on an unmounted component.");
            }
            if (a2.stateNode.current === a2) {
              return fiber;
            }
            return alternate;
          }
          function findCurrentHostFiber(parent2) {
            var currentParent = findCurrentFiberUsingSlowPath(parent2);
            return currentParent !== null ? findCurrentHostFiberImpl(currentParent) : null;
          }
          function findCurrentHostFiberImpl(node) {
            if (node.tag === HostComponent || node.tag === HostText) {
              return node;
            }
            var child = node.child;
            while (child !== null) {
              var match = findCurrentHostFiberImpl(child);
              if (match !== null) {
                return match;
              }
              child = child.sibling;
            }
            return null;
          }
          function findCurrentHostFiberWithNoPortals(parent2) {
            var currentParent = findCurrentFiberUsingSlowPath(parent2);
            return currentParent !== null ? findCurrentHostFiberWithNoPortalsImpl(currentParent) : null;
          }
          function findCurrentHostFiberWithNoPortalsImpl(node) {
            if (node.tag === HostComponent || node.tag === HostText) {
              return node;
            }
            var child = node.child;
            while (child !== null) {
              if (child.tag !== HostPortal) {
                var match = findCurrentHostFiberWithNoPortalsImpl(child);
                if (match !== null) {
                  return match;
                }
              }
              child = child.sibling;
            }
            return null;
          }
          var scheduleCallback = Scheduler.unstable_scheduleCallback;
          var cancelCallback = Scheduler.unstable_cancelCallback;
          var shouldYield = Scheduler.unstable_shouldYield;
          var requestPaint = Scheduler.unstable_requestPaint;
          var now3 = Scheduler.unstable_now;
          var getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel;
          var ImmediatePriority = Scheduler.unstable_ImmediatePriority;
          var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
          var NormalPriority = Scheduler.unstable_NormalPriority;
          var LowPriority = Scheduler.unstable_LowPriority;
          var IdlePriority = Scheduler.unstable_IdlePriority;
          var unstable_yieldValue = Scheduler.unstable_yieldValue;
          var unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue;
          var rendererID = null;
          var injectedHook = null;
          var injectedProfilingHooks = null;
          var hasLoggedError = false;
          var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined";
          function injectInternals(internals) {
            if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined") {
              return false;
            }
            var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
            if (hook.isDisabled) {
              return true;
            }
            if (!hook.supportsFiber) {
              {
                error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools");
              }
              return true;
            }
            try {
              if (enableSchedulingProfiler) {
                internals = assign({}, internals, {
                  getLaneLabelMap,
                  injectProfilingHooks
                });
              }
              rendererID = hook.inject(internals);
              injectedHook = hook;
            } catch (err) {
              {
                error("React instrumentation encountered an error: %s.", err);
              }
            }
            if (hook.checkDCE) {
              return true;
            } else {
              return false;
            }
          }
          function onScheduleRoot(root2, children) {
            {
              if (injectedHook && typeof injectedHook.onScheduleFiberRoot === "function") {
                try {
                  injectedHook.onScheduleFiberRoot(rendererID, root2, children);
                } catch (err) {
                  if (!hasLoggedError) {
                    hasLoggedError = true;
                    error("React instrumentation encountered an error: %s", err);
                  }
                }
              }
            }
          }
          function onCommitRoot(root2, eventPriority) {
            if (injectedHook && typeof injectedHook.onCommitFiberRoot === "function") {
              try {
                var didError = (root2.current.flags & DidCapture) === DidCapture;
                if (enableProfilerTimer) {
                  var schedulerPriority;
                  switch (eventPriority) {
                    case DiscreteEventPriority:
                      schedulerPriority = ImmediatePriority;
                      break;
                    case ContinuousEventPriority:
                      schedulerPriority = UserBlockingPriority;
                      break;
                    case DefaultEventPriority:
                      schedulerPriority = NormalPriority;
                      break;
                    case IdleEventPriority:
                      schedulerPriority = IdlePriority;
                      break;
                    default:
                      schedulerPriority = NormalPriority;
                      break;
                  }
                  injectedHook.onCommitFiberRoot(rendererID, root2, schedulerPriority, didError);
                } else {
                  injectedHook.onCommitFiberRoot(rendererID, root2, void 0, didError);
                }
              } catch (err) {
                {
                  if (!hasLoggedError) {
                    hasLoggedError = true;
                    error("React instrumentation encountered an error: %s", err);
                  }
                }
              }
            }
          }
          function onPostCommitRoot(root2) {
            if (injectedHook && typeof injectedHook.onPostCommitFiberRoot === "function") {
              try {
                injectedHook.onPostCommitFiberRoot(rendererID, root2);
              } catch (err) {
                {
                  if (!hasLoggedError) {
                    hasLoggedError = true;
                    error("React instrumentation encountered an error: %s", err);
                  }
                }
              }
            }
          }
          function onCommitUnmount(fiber) {
            if (injectedHook && typeof injectedHook.onCommitFiberUnmount === "function") {
              try {
                injectedHook.onCommitFiberUnmount(rendererID, fiber);
              } catch (err) {
                {
                  if (!hasLoggedError) {
                    hasLoggedError = true;
                    error("React instrumentation encountered an error: %s", err);
                  }
                }
              }
            }
          }
          function setIsStrictModeForDevtools(newIsStrictMode) {
            {
              if (typeof unstable_yieldValue === "function") {
                unstable_setDisableYieldValue(newIsStrictMode);
                setSuppressWarning(newIsStrictMode);
              }
              if (injectedHook && typeof injectedHook.setStrictMode === "function") {
                try {
                  injectedHook.setStrictMode(rendererID, newIsStrictMode);
                } catch (err) {
                  {
                    if (!hasLoggedError) {
                      hasLoggedError = true;
                      error("React instrumentation encountered an error: %s", err);
                    }
                  }
                }
              }
            }
          }
          function injectProfilingHooks(profilingHooks) {
            injectedProfilingHooks = profilingHooks;
          }
          function getLaneLabelMap() {
            {
              var map2 = /* @__PURE__ */ new Map();
              var lane = 1;
              for (var index2 = 0; index2 < TotalLanes; index2++) {
                var label = getLabelForLane(lane);
                map2.set(lane, label);
                lane *= 2;
              }
              return map2;
            }
          }
          function markCommitStarted(lanes) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStarted === "function") {
                injectedProfilingHooks.markCommitStarted(lanes);
              }
            }
          }
          function markCommitStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStopped === "function") {
                injectedProfilingHooks.markCommitStopped();
              }
            }
          }
          function markComponentRenderStarted(fiber) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStarted === "function") {
                injectedProfilingHooks.markComponentRenderStarted(fiber);
              }
            }
          }
          function markComponentRenderStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStopped === "function") {
                injectedProfilingHooks.markComponentRenderStopped();
              }
            }
          }
          function markComponentPassiveEffectMountStarted(fiber) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted === "function") {
                injectedProfilingHooks.markComponentPassiveEffectMountStarted(fiber);
              }
            }
          }
          function markComponentPassiveEffectMountStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped === "function") {
                injectedProfilingHooks.markComponentPassiveEffectMountStopped();
              }
            }
          }
          function markComponentPassiveEffectUnmountStarted(fiber) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted === "function") {
                injectedProfilingHooks.markComponentPassiveEffectUnmountStarted(fiber);
              }
            }
          }
          function markComponentPassiveEffectUnmountStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped === "function") {
                injectedProfilingHooks.markComponentPassiveEffectUnmountStopped();
              }
            }
          }
          function markComponentLayoutEffectMountStarted(fiber) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted === "function") {
                injectedProfilingHooks.markComponentLayoutEffectMountStarted(fiber);
              }
            }
          }
          function markComponentLayoutEffectMountStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped === "function") {
                injectedProfilingHooks.markComponentLayoutEffectMountStopped();
              }
            }
          }
          function markComponentLayoutEffectUnmountStarted(fiber) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted === "function") {
                injectedProfilingHooks.markComponentLayoutEffectUnmountStarted(fiber);
              }
            }
          }
          function markComponentLayoutEffectUnmountStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped === "function") {
                injectedProfilingHooks.markComponentLayoutEffectUnmountStopped();
              }
            }
          }
          function markComponentErrored(fiber, thrownValue, lanes) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentErrored === "function") {
                injectedProfilingHooks.markComponentErrored(fiber, thrownValue, lanes);
              }
            }
          }
          function markComponentSuspended(fiber, wakeable, lanes) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentSuspended === "function") {
                injectedProfilingHooks.markComponentSuspended(fiber, wakeable, lanes);
              }
            }
          }
          function markLayoutEffectsStarted(lanes) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStarted === "function") {
                injectedProfilingHooks.markLayoutEffectsStarted(lanes);
              }
            }
          }
          function markLayoutEffectsStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStopped === "function") {
                injectedProfilingHooks.markLayoutEffectsStopped();
              }
            }
          }
          function markPassiveEffectsStarted(lanes) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStarted === "function") {
                injectedProfilingHooks.markPassiveEffectsStarted(lanes);
              }
            }
          }
          function markPassiveEffectsStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStopped === "function") {
                injectedProfilingHooks.markPassiveEffectsStopped();
              }
            }
          }
          function markRenderStarted(lanes) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStarted === "function") {
                injectedProfilingHooks.markRenderStarted(lanes);
              }
            }
          }
          function markRenderYielded() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderYielded === "function") {
                injectedProfilingHooks.markRenderYielded();
              }
            }
          }
          function markRenderStopped() {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStopped === "function") {
                injectedProfilingHooks.markRenderStopped();
              }
            }
          }
          function markRenderScheduled(lane) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderScheduled === "function") {
                injectedProfilingHooks.markRenderScheduled(lane);
              }
            }
          }
          function markForceUpdateScheduled(fiber, lane) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markForceUpdateScheduled === "function") {
                injectedProfilingHooks.markForceUpdateScheduled(fiber, lane);
              }
            }
          }
          function markStateUpdateScheduled(fiber, lane) {
            {
              if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markStateUpdateScheduled === "function") {
                injectedProfilingHooks.markStateUpdateScheduled(fiber, lane);
              }
            }
          }
          var NoMode = (
            /*                         */
            0
          );
          var ConcurrentMode = (
            /*                 */
            1
          );
          var ProfileMode = (
            /*                    */
            2
          );
          var StrictLegacyMode = (
            /*               */
            8
          );
          var StrictEffectsMode = (
            /*              */
            16
          );
          var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback;
          var log2 = Math.log;
          var LN2 = Math.LN2;
          function clz32Fallback(x2) {
            var asUint = x2 >>> 0;
            if (asUint === 0) {
              return 32;
            }
            return 31 - (log2(asUint) / LN2 | 0) | 0;
          }
          var TotalLanes = 31;
          var NoLanes = (
            /*                        */
            0
          );
          var NoLane = (
            /*                          */
            0
          );
          var SyncLane = (
            /*                        */
            1
          );
          var InputContinuousHydrationLane = (
            /*    */
            2
          );
          var InputContinuousLane = (
            /*             */
            4
          );
          var DefaultHydrationLane = (
            /*            */
            8
          );
          var DefaultLane = (
            /*                     */
            16
          );
          var TransitionHydrationLane = (
            /*                */
            32
          );
          var TransitionLanes = (
            /*                       */
            4194240
          );
          var TransitionLane1 = (
            /*                        */
            64
          );
          var TransitionLane2 = (
            /*                        */
            128
          );
          var TransitionLane3 = (
            /*                        */
            256
          );
          var TransitionLane4 = (
            /*                        */
            512
          );
          var TransitionLane5 = (
            /*                        */
            1024
          );
          var TransitionLane6 = (
            /*                        */
            2048
          );
          var TransitionLane7 = (
            /*                        */
            4096
          );
          var TransitionLane8 = (
            /*                        */
            8192
          );
          var TransitionLane9 = (
            /*                        */
            16384
          );
          var TransitionLane10 = (
            /*                       */
            32768
          );
          var TransitionLane11 = (
            /*                       */
            65536
          );
          var TransitionLane12 = (
            /*                       */
            131072
          );
          var TransitionLane13 = (
            /*                       */
            262144
          );
          var TransitionLane14 = (
            /*                       */
            524288
          );
          var TransitionLane15 = (
            /*                       */
            1048576
          );
          var TransitionLane16 = (
            /*                       */
            2097152
          );
          var RetryLanes = (
            /*                            */
            130023424
          );
          var RetryLane1 = (
            /*                             */
            4194304
          );
          var RetryLane2 = (
            /*                             */
            8388608
          );
          var RetryLane3 = (
            /*                             */
            16777216
          );
          var RetryLane4 = (
            /*                             */
            33554432
          );
          var RetryLane5 = (
            /*                             */
            67108864
          );
          var SomeRetryLane = RetryLane1;
          var SelectiveHydrationLane = (
            /*          */
            134217728
          );
          var NonIdleLanes = (
            /*                          */
            268435455
          );
          var IdleHydrationLane = (
            /*               */
            268435456
          );
          var IdleLane = (
            /*                        */
            536870912
          );
          var OffscreenLane = (
            /*                   */
            1073741824
          );
          function getLabelForLane(lane) {
            {
              if (lane & SyncLane) {
                return "Sync";
              }
              if (lane & InputContinuousHydrationLane) {
                return "InputContinuousHydration";
              }
              if (lane & InputContinuousLane) {
                return "InputContinuous";
              }
              if (lane & DefaultHydrationLane) {
                return "DefaultHydration";
              }
              if (lane & DefaultLane) {
                return "Default";
              }
              if (lane & TransitionHydrationLane) {
                return "TransitionHydration";
              }
              if (lane & TransitionLanes) {
                return "Transition";
              }
              if (lane & RetryLanes) {
                return "Retry";
              }
              if (lane & SelectiveHydrationLane) {
                return "SelectiveHydration";
              }
              if (lane & IdleHydrationLane) {
                return "IdleHydration";
              }
              if (lane & IdleLane) {
                return "Idle";
              }
              if (lane & OffscreenLane) {
                return "Offscreen";
              }
            }
          }
          var NoTimestamp = -1;
          var nextTransitionLane = TransitionLane1;
          var nextRetryLane = RetryLane1;
          function getHighestPriorityLanes(lanes) {
            switch (getHighestPriorityLane(lanes)) {
              case SyncLane:
                return SyncLane;
              case InputContinuousHydrationLane:
                return InputContinuousHydrationLane;
              case InputContinuousLane:
                return InputContinuousLane;
              case DefaultHydrationLane:
                return DefaultHydrationLane;
              case DefaultLane:
                return DefaultLane;
              case TransitionHydrationLane:
                return TransitionHydrationLane;
              case TransitionLane1:
              case TransitionLane2:
              case TransitionLane3:
              case TransitionLane4:
              case TransitionLane5:
              case TransitionLane6:
              case TransitionLane7:
              case TransitionLane8:
              case TransitionLane9:
              case TransitionLane10:
              case TransitionLane11:
              case TransitionLane12:
              case TransitionLane13:
              case TransitionLane14:
              case TransitionLane15:
              case TransitionLane16:
                return lanes & TransitionLanes;
              case RetryLane1:
              case RetryLane2:
              case RetryLane3:
              case RetryLane4:
              case RetryLane5:
                return lanes & RetryLanes;
              case SelectiveHydrationLane:
                return SelectiveHydrationLane;
              case IdleHydrationLane:
                return IdleHydrationLane;
              case IdleLane:
                return IdleLane;
              case OffscreenLane:
                return OffscreenLane;
              default:
                {
                  error("Should have found matching lanes. This is a bug in React.");
                }
                return lanes;
            }
          }
          function getNextLanes(root2, wipLanes) {
            var pendingLanes = root2.pendingLanes;
            if (pendingLanes === NoLanes) {
              return NoLanes;
            }
            var nextLanes = NoLanes;
            var suspendedLanes = root2.suspendedLanes;
            var pingedLanes = root2.pingedLanes;
            var nonIdlePendingLanes = pendingLanes & NonIdleLanes;
            if (nonIdlePendingLanes !== NoLanes) {
              var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes;
              if (nonIdleUnblockedLanes !== NoLanes) {
                nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes);
              } else {
                var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes;
                if (nonIdlePingedLanes !== NoLanes) {
                  nextLanes = getHighestPriorityLanes(nonIdlePingedLanes);
                }
              }
            } else {
              var unblockedLanes = pendingLanes & ~suspendedLanes;
              if (unblockedLanes !== NoLanes) {
                nextLanes = getHighestPriorityLanes(unblockedLanes);
              } else {
                if (pingedLanes !== NoLanes) {
                  nextLanes = getHighestPriorityLanes(pingedLanes);
                }
              }
            }
            if (nextLanes === NoLanes) {
              return NoLanes;
            }
            if (wipLanes !== NoLanes && wipLanes !== nextLanes && // If we already suspended with a delay, then interrupting is fine. Don't
            // bother waiting until the root is complete.
            (wipLanes & suspendedLanes) === NoLanes) {
              var nextLane = getHighestPriorityLane(nextLanes);
              var wipLane = getHighestPriorityLane(wipLanes);
              if (
                // Tests whether the next lane is equal or lower priority than the wip
                // one. This works because the bits decrease in priority as you go left.
                nextLane >= wipLane || // Default priority updates should not interrupt transition updates. The
                // only difference between default updates and transition updates is that
                // default updates do not support refresh transitions.
                nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes
              ) {
                return wipLanes;
              }
            }
            if ((nextLanes & InputContinuousLane) !== NoLanes) {
              nextLanes |= pendingLanes & DefaultLane;
            }
            var entangledLanes = root2.entangledLanes;
            if (entangledLanes !== NoLanes) {
              var entanglements = root2.entanglements;
              var lanes = nextLanes & entangledLanes;
              while (lanes > 0) {
                var index2 = pickArbitraryLaneIndex(lanes);
                var lane = 1 << index2;
                nextLanes |= entanglements[index2];
                lanes &= ~lane;
              }
            }
            return nextLanes;
          }
          function getMostRecentEventTime(root2, lanes) {
            var eventTimes = root2.eventTimes;
            var mostRecentEventTime = NoTimestamp;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              var eventTime = eventTimes[index2];
              if (eventTime > mostRecentEventTime) {
                mostRecentEventTime = eventTime;
              }
              lanes &= ~lane;
            }
            return mostRecentEventTime;
          }
          function computeExpirationTime(lane, currentTime) {
            switch (lane) {
              case SyncLane:
              case InputContinuousHydrationLane:
              case InputContinuousLane:
                return currentTime + 250;
              case DefaultHydrationLane:
              case DefaultLane:
              case TransitionHydrationLane:
              case TransitionLane1:
              case TransitionLane2:
              case TransitionLane3:
              case TransitionLane4:
              case TransitionLane5:
              case TransitionLane6:
              case TransitionLane7:
              case TransitionLane8:
              case TransitionLane9:
              case TransitionLane10:
              case TransitionLane11:
              case TransitionLane12:
              case TransitionLane13:
              case TransitionLane14:
              case TransitionLane15:
              case TransitionLane16:
                return currentTime + 5e3;
              case RetryLane1:
              case RetryLane2:
              case RetryLane3:
              case RetryLane4:
              case RetryLane5:
                return NoTimestamp;
              case SelectiveHydrationLane:
              case IdleHydrationLane:
              case IdleLane:
              case OffscreenLane:
                return NoTimestamp;
              default:
                {
                  error("Should have found matching lanes. This is a bug in React.");
                }
                return NoTimestamp;
            }
          }
          function markStarvedLanesAsExpired(root2, currentTime) {
            var pendingLanes = root2.pendingLanes;
            var suspendedLanes = root2.suspendedLanes;
            var pingedLanes = root2.pingedLanes;
            var expirationTimes = root2.expirationTimes;
            var lanes = pendingLanes;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              var expirationTime = expirationTimes[index2];
              if (expirationTime === NoTimestamp) {
                if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) {
                  expirationTimes[index2] = computeExpirationTime(lane, currentTime);
                }
              } else if (expirationTime <= currentTime) {
                root2.expiredLanes |= lane;
              }
              lanes &= ~lane;
            }
          }
          function getHighestPriorityPendingLanes(root2) {
            return getHighestPriorityLanes(root2.pendingLanes);
          }
          function getLanesToRetrySynchronouslyOnError(root2) {
            var everythingButOffscreen = root2.pendingLanes & ~OffscreenLane;
            if (everythingButOffscreen !== NoLanes) {
              return everythingButOffscreen;
            }
            if (everythingButOffscreen & OffscreenLane) {
              return OffscreenLane;
            }
            return NoLanes;
          }
          function includesSyncLane(lanes) {
            return (lanes & SyncLane) !== NoLanes;
          }
          function includesNonIdleWork(lanes) {
            return (lanes & NonIdleLanes) !== NoLanes;
          }
          function includesOnlyRetries(lanes) {
            return (lanes & RetryLanes) === lanes;
          }
          function includesOnlyNonUrgentLanes(lanes) {
            var UrgentLanes = SyncLane | InputContinuousLane | DefaultLane;
            return (lanes & UrgentLanes) === NoLanes;
          }
          function includesOnlyTransitions(lanes) {
            return (lanes & TransitionLanes) === lanes;
          }
          function includesBlockingLane(root2, lanes) {
            var SyncDefaultLanes = InputContinuousHydrationLane | InputContinuousLane | DefaultHydrationLane | DefaultLane;
            return (lanes & SyncDefaultLanes) !== NoLanes;
          }
          function includesExpiredLane(root2, lanes) {
            return (lanes & root2.expiredLanes) !== NoLanes;
          }
          function isTransitionLane(lane) {
            return (lane & TransitionLanes) !== NoLanes;
          }
          function claimNextTransitionLane() {
            var lane = nextTransitionLane;
            nextTransitionLane <<= 1;
            if ((nextTransitionLane & TransitionLanes) === NoLanes) {
              nextTransitionLane = TransitionLane1;
            }
            return lane;
          }
          function claimNextRetryLane() {
            var lane = nextRetryLane;
            nextRetryLane <<= 1;
            if ((nextRetryLane & RetryLanes) === NoLanes) {
              nextRetryLane = RetryLane1;
            }
            return lane;
          }
          function getHighestPriorityLane(lanes) {
            return lanes & -lanes;
          }
          function pickArbitraryLane(lanes) {
            return getHighestPriorityLane(lanes);
          }
          function pickArbitraryLaneIndex(lanes) {
            return 31 - clz32(lanes);
          }
          function laneToIndex(lane) {
            return pickArbitraryLaneIndex(lane);
          }
          function includesSomeLane(a2, b) {
            return (a2 & b) !== NoLanes;
          }
          function isSubsetOfLanes(set2, subset) {
            return (set2 & subset) === subset;
          }
          function mergeLanes(a2, b) {
            return a2 | b;
          }
          function removeLanes(set2, subset) {
            return set2 & ~subset;
          }
          function intersectLanes(a2, b) {
            return a2 & b;
          }
          function laneToLanes(lane) {
            return lane;
          }
          function higherPriorityLane(a2, b) {
            return a2 !== NoLane && a2 < b ? a2 : b;
          }
          function createLaneMap(initial) {
            var laneMap = [];
            for (var i = 0; i < TotalLanes; i++) {
              laneMap.push(initial);
            }
            return laneMap;
          }
          function markRootUpdated(root2, updateLane, eventTime) {
            root2.pendingLanes |= updateLane;
            if (updateLane !== IdleLane) {
              root2.suspendedLanes = NoLanes;
              root2.pingedLanes = NoLanes;
            }
            var eventTimes = root2.eventTimes;
            var index2 = laneToIndex(updateLane);
            eventTimes[index2] = eventTime;
          }
          function markRootSuspended(root2, suspendedLanes) {
            root2.suspendedLanes |= suspendedLanes;
            root2.pingedLanes &= ~suspendedLanes;
            var expirationTimes = root2.expirationTimes;
            var lanes = suspendedLanes;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              expirationTimes[index2] = NoTimestamp;
              lanes &= ~lane;
            }
          }
          function markRootPinged(root2, pingedLanes, eventTime) {
            root2.pingedLanes |= root2.suspendedLanes & pingedLanes;
          }
          function markRootFinished(root2, remainingLanes) {
            var noLongerPendingLanes = root2.pendingLanes & ~remainingLanes;
            root2.pendingLanes = remainingLanes;
            root2.suspendedLanes = NoLanes;
            root2.pingedLanes = NoLanes;
            root2.expiredLanes &= remainingLanes;
            root2.mutableReadLanes &= remainingLanes;
            root2.entangledLanes &= remainingLanes;
            var entanglements = root2.entanglements;
            var eventTimes = root2.eventTimes;
            var expirationTimes = root2.expirationTimes;
            var lanes = noLongerPendingLanes;
            while (lanes > 0) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              entanglements[index2] = NoLanes;
              eventTimes[index2] = NoTimestamp;
              expirationTimes[index2] = NoTimestamp;
              lanes &= ~lane;
            }
          }
          function markRootEntangled(root2, entangledLanes) {
            var rootEntangledLanes = root2.entangledLanes |= entangledLanes;
            var entanglements = root2.entanglements;
            var lanes = rootEntangledLanes;
            while (lanes) {
              var index2 = pickArbitraryLaneIndex(lanes);
              var lane = 1 << index2;
              if (
                // Is this one of the newly entangled lanes?
                lane & entangledLanes | // Is this lane transitively entangled with the newly entangled lanes?
                entanglements[index2] & entangledLanes
              ) {
                entanglements[index2] |= entangledLanes;
              }
              lanes &= ~lane;
            }
          }
          function getBumpedLaneForHydration(root2, renderLanes2) {
            var renderLane = getHighestPriorityLane(renderLanes2);
            var lane;
            switch (renderLane) {
              case InputContinuousLane:
                lane = InputContinuousHydrationLane;
                break;
              case DefaultLane:
                lane = DefaultHydrationLane;
                break;
              case TransitionLane1:
              case TransitionLane2:
              case TransitionLane3:
              case TransitionLane4:
              case TransitionLane5:
              case TransitionLane6:
              case TransitionLane7:
              case TransitionLane8:
              case TransitionLane9:
              case TransitionLane10:
              case TransitionLane11:
              case TransitionLane12:
              case TransitionLane13:
              case TransitionLane14:
              case TransitionLane15:
              case TransitionLane16:
              case RetryLane1:
              case RetryLane2:
              case RetryLane3:
              case RetryLane4:
              case RetryLane5:
                lane = TransitionHydrationLane;
                break;
              case IdleLane:
                lane = IdleHydrationLane;
                break;
              default:
                lane = NoLane;
                break;
            }
            if ((lane & (root2.suspendedLanes | renderLanes2)) !== NoLane) {
              return NoLane;
            }
            return lane;
          }
          function addFiberToLanesMap(root2, fiber, lanes) {
            if (!isDevToolsPresent) {
              return;
            }
            var pendingUpdatersLaneMap = root2.pendingUpdatersLaneMap;
            while (lanes > 0) {
              var index2 = laneToIndex(lanes);
              var lane = 1 << index2;
              var updaters = pendingUpdatersLaneMap[index2];
              updaters.add(fiber);
              lanes &= ~lane;
            }
          }
          function movePendingFibersToMemoized(root2, lanes) {
            if (!isDevToolsPresent) {
              return;
            }
            var pendingUpdatersLaneMap = root2.pendingUpdatersLaneMap;
            var memoizedUpdaters = root2.memoizedUpdaters;
            while (lanes > 0) {
              var index2 = laneToIndex(lanes);
              var lane = 1 << index2;
              var updaters = pendingUpdatersLaneMap[index2];
              if (updaters.size > 0) {
                updaters.forEach(function(fiber) {
                  var alternate = fiber.alternate;
                  if (alternate === null || !memoizedUpdaters.has(alternate)) {
                    memoizedUpdaters.add(fiber);
                  }
                });
                updaters.clear();
              }
              lanes &= ~lane;
            }
          }
          function getTransitionsForLanes(root2, lanes) {
            {
              return null;
            }
          }
          var DiscreteEventPriority = SyncLane;
          var ContinuousEventPriority = InputContinuousLane;
          var DefaultEventPriority = DefaultLane;
          var IdleEventPriority = IdleLane;
          var currentUpdatePriority = NoLane;
          function getCurrentUpdatePriority() {
            return currentUpdatePriority;
          }
          function setCurrentUpdatePriority(newPriority) {
            currentUpdatePriority = newPriority;
          }
          function runWithPriority(priority, fn) {
            var previousPriority = currentUpdatePriority;
            try {
              currentUpdatePriority = priority;
              return fn();
            } finally {
              currentUpdatePriority = previousPriority;
            }
          }
          function higherEventPriority(a2, b) {
            return a2 !== 0 && a2 < b ? a2 : b;
          }
          function lowerEventPriority(a2, b) {
            return a2 === 0 || a2 > b ? a2 : b;
          }
          function isHigherEventPriority(a2, b) {
            return a2 !== 0 && a2 < b;
          }
          function lanesToEventPriority(lanes) {
            var lane = getHighestPriorityLane(lanes);
            if (!isHigherEventPriority(DiscreteEventPriority, lane)) {
              return DiscreteEventPriority;
            }
            if (!isHigherEventPriority(ContinuousEventPriority, lane)) {
              return ContinuousEventPriority;
            }
            if (includesNonIdleWork(lane)) {
              return DefaultEventPriority;
            }
            return IdleEventPriority;
          }
          function isRootDehydrated(root2) {
            var currentState = root2.current.memoizedState;
            return currentState.isDehydrated;
          }
          var _attemptSynchronousHydration;
          function setAttemptSynchronousHydration(fn) {
            _attemptSynchronousHydration = fn;
          }
          function attemptSynchronousHydration(fiber) {
            _attemptSynchronousHydration(fiber);
          }
          var attemptContinuousHydration;
          function setAttemptContinuousHydration(fn) {
            attemptContinuousHydration = fn;
          }
          var attemptHydrationAtCurrentPriority;
          function setAttemptHydrationAtCurrentPriority(fn) {
            attemptHydrationAtCurrentPriority = fn;
          }
          var getCurrentUpdatePriority$1;
          function setGetCurrentUpdatePriority(fn) {
            getCurrentUpdatePriority$1 = fn;
          }
          var attemptHydrationAtPriority;
          function setAttemptHydrationAtPriority(fn) {
            attemptHydrationAtPriority = fn;
          }
          var hasScheduledReplayAttempt = false;
          var queuedDiscreteEvents = [];
          var queuedFocus = null;
          var queuedDrag = null;
          var queuedMouse = null;
          var queuedPointers = /* @__PURE__ */ new Map();
          var queuedPointerCaptures = /* @__PURE__ */ new Map();
          var queuedExplicitHydrationTargets = [];
          var discreteReplayableEvents = [
            "mousedown",
            "mouseup",
            "touchcancel",
            "touchend",
            "touchstart",
            "auxclick",
            "dblclick",
            "pointercancel",
            "pointerdown",
            "pointerup",
            "dragend",
            "dragstart",
            "drop",
            "compositionend",
            "compositionstart",
            "keydown",
            "keypress",
            "keyup",
            "input",
            "textInput",
            // Intentionally camelCase
            "copy",
            "cut",
            "paste",
            "click",
            "change",
            "contextmenu",
            "reset",
            "submit"
          ];
          function isDiscreteEventThatRequiresHydration(eventType) {
            return discreteReplayableEvents.indexOf(eventType) > -1;
          }
          function createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            return {
              blockedOn,
              domEventName,
              eventSystemFlags,
              nativeEvent,
              targetContainers: [targetContainer]
            };
          }
          function clearIfContinuousEvent(domEventName, nativeEvent) {
            switch (domEventName) {
              case "focusin":
              case "focusout":
                queuedFocus = null;
                break;
              case "dragenter":
              case "dragleave":
                queuedDrag = null;
                break;
              case "mouseover":
              case "mouseout":
                queuedMouse = null;
                break;
              case "pointerover":
              case "pointerout": {
                var pointerId = nativeEvent.pointerId;
                queuedPointers.delete(pointerId);
                break;
              }
              case "gotpointercapture":
              case "lostpointercapture": {
                var _pointerId = nativeEvent.pointerId;
                queuedPointerCaptures.delete(_pointerId);
                break;
              }
            }
          }
          function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {
              var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
              if (blockedOn !== null) {
                var _fiber2 = getInstanceFromNode(blockedOn);
                if (_fiber2 !== null) {
                  attemptContinuousHydration(_fiber2);
                }
              }
              return queuedEvent;
            }
            existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
            var targetContainers = existingQueuedEvent.targetContainers;
            if (targetContainer !== null && targetContainers.indexOf(targetContainer) === -1) {
              targetContainers.push(targetContainer);
            }
            return existingQueuedEvent;
          }
          function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            switch (domEventName) {
              case "focusin": {
                var focusEvent = nativeEvent;
                queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, domEventName, eventSystemFlags, targetContainer, focusEvent);
                return true;
              }
              case "dragenter": {
                var dragEvent = nativeEvent;
                queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, domEventName, eventSystemFlags, targetContainer, dragEvent);
                return true;
              }
              case "mouseover": {
                var mouseEvent = nativeEvent;
                queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, domEventName, eventSystemFlags, targetContainer, mouseEvent);
                return true;
              }
              case "pointerover": {
                var pointerEvent = nativeEvent;
                var pointerId = pointerEvent.pointerId;
                queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, pointerEvent));
                return true;
              }
              case "gotpointercapture": {
                var _pointerEvent = nativeEvent;
                var _pointerId2 = _pointerEvent.pointerId;
                queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, _pointerEvent));
                return true;
              }
            }
            return false;
          }
          function attemptExplicitHydrationTarget(queuedTarget) {
            var targetInst = getClosestInstanceFromNode(queuedTarget.target);
            if (targetInst !== null) {
              var nearestMounted = getNearestMountedFiber(targetInst);
              if (nearestMounted !== null) {
                var tag = nearestMounted.tag;
                if (tag === SuspenseComponent) {
                  var instance = getSuspenseInstanceFromFiber(nearestMounted);
                  if (instance !== null) {
                    queuedTarget.blockedOn = instance;
                    attemptHydrationAtPriority(queuedTarget.priority, function() {
                      attemptHydrationAtCurrentPriority(nearestMounted);
                    });
                    return;
                  }
                } else if (tag === HostRoot) {
                  var root2 = nearestMounted.stateNode;
                  if (isRootDehydrated(root2)) {
                    queuedTarget.blockedOn = getContainerFromFiber(nearestMounted);
                    return;
                  }
                }
              }
            }
            queuedTarget.blockedOn = null;
          }
          function queueExplicitHydrationTarget(target) {
            var updatePriority = getCurrentUpdatePriority$1();
            var queuedTarget = {
              blockedOn: null,
              target,
              priority: updatePriority
            };
            var i = 0;
            for (; i < queuedExplicitHydrationTargets.length; i++) {
              if (!isHigherEventPriority(updatePriority, queuedExplicitHydrationTargets[i].priority)) {
                break;
              }
            }
            queuedExplicitHydrationTargets.splice(i, 0, queuedTarget);
            if (i === 0) {
              attemptExplicitHydrationTarget(queuedTarget);
            }
          }
          function attemptReplayContinuousQueuedEvent(queuedEvent) {
            if (queuedEvent.blockedOn !== null) {
              return false;
            }
            var targetContainers = queuedEvent.targetContainers;
            while (targetContainers.length > 0) {
              var targetContainer = targetContainers[0];
              var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.domEventName, queuedEvent.eventSystemFlags, targetContainer, queuedEvent.nativeEvent);
              if (nextBlockedOn === null) {
                {
                  var nativeEvent = queuedEvent.nativeEvent;
                  var nativeEventClone = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
                  setReplayingEvent(nativeEventClone);
                  nativeEvent.target.dispatchEvent(nativeEventClone);
                  resetReplayingEvent();
                }
              } else {
                var _fiber3 = getInstanceFromNode(nextBlockedOn);
                if (_fiber3 !== null) {
                  attemptContinuousHydration(_fiber3);
                }
                queuedEvent.blockedOn = nextBlockedOn;
                return false;
              }
              targetContainers.shift();
            }
            return true;
          }
          function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map2) {
            if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
              map2.delete(key);
            }
          }
          function replayUnblockedEvents() {
            hasScheduledReplayAttempt = false;
            if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {
              queuedFocus = null;
            }
            if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {
              queuedDrag = null;
            }
            if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {
              queuedMouse = null;
            }
            queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
            queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
          }
          function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
            if (queuedEvent.blockedOn === unblocked) {
              queuedEvent.blockedOn = null;
              if (!hasScheduledReplayAttempt) {
                hasScheduledReplayAttempt = true;
                Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);
              }
            }
          }
          function retryIfBlockedOn(unblocked) {
            if (queuedDiscreteEvents.length > 0) {
              scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked);
              for (var i = 1; i < queuedDiscreteEvents.length; i++) {
                var queuedEvent = queuedDiscreteEvents[i];
                if (queuedEvent.blockedOn === unblocked) {
                  queuedEvent.blockedOn = null;
                }
              }
            }
            if (queuedFocus !== null) {
              scheduleCallbackIfUnblocked(queuedFocus, unblocked);
            }
            if (queuedDrag !== null) {
              scheduleCallbackIfUnblocked(queuedDrag, unblocked);
            }
            if (queuedMouse !== null) {
              scheduleCallbackIfUnblocked(queuedMouse, unblocked);
            }
            var unblock = function(queuedEvent2) {
              return scheduleCallbackIfUnblocked(queuedEvent2, unblocked);
            };
            queuedPointers.forEach(unblock);
            queuedPointerCaptures.forEach(unblock);
            for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {
              var queuedTarget = queuedExplicitHydrationTargets[_i];
              if (queuedTarget.blockedOn === unblocked) {
                queuedTarget.blockedOn = null;
              }
            }
            while (queuedExplicitHydrationTargets.length > 0) {
              var nextExplicitTarget = queuedExplicitHydrationTargets[0];
              if (nextExplicitTarget.blockedOn !== null) {
                break;
              } else {
                attemptExplicitHydrationTarget(nextExplicitTarget);
                if (nextExplicitTarget.blockedOn === null) {
                  queuedExplicitHydrationTargets.shift();
                }
              }
            }
          }
          var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
          var _enabled = true;
          function setEnabled(enabled) {
            _enabled = !!enabled;
          }
          function isEnabled() {
            return _enabled;
          }
          function createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) {
            var eventPriority = getEventPriority(domEventName);
            var listenerWrapper;
            switch (eventPriority) {
              case DiscreteEventPriority:
                listenerWrapper = dispatchDiscreteEvent;
                break;
              case ContinuousEventPriority:
                listenerWrapper = dispatchContinuousEvent;
                break;
              case DefaultEventPriority:
              default:
                listenerWrapper = dispatchEvent;
                break;
            }
            return listenerWrapper.bind(null, domEventName, eventSystemFlags, targetContainer);
          }
          function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {
            var previousPriority = getCurrentUpdatePriority();
            var prevTransition = ReactCurrentBatchConfig.transition;
            ReactCurrentBatchConfig.transition = null;
            try {
              setCurrentUpdatePriority(DiscreteEventPriority);
              dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
            } finally {
              setCurrentUpdatePriority(previousPriority);
              ReactCurrentBatchConfig.transition = prevTransition;
            }
          }
          function dispatchContinuousEvent(domEventName, eventSystemFlags, container, nativeEvent) {
            var previousPriority = getCurrentUpdatePriority();
            var prevTransition = ReactCurrentBatchConfig.transition;
            ReactCurrentBatchConfig.transition = null;
            try {
              setCurrentUpdatePriority(ContinuousEventPriority);
              dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
            } finally {
              setCurrentUpdatePriority(previousPriority);
              ReactCurrentBatchConfig.transition = prevTransition;
            }
          }
          function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            if (!_enabled) {
              return;
            }
            {
              dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent);
            }
          }
          function dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            var blockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);
            if (blockedOn === null) {
              dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer);
              clearIfContinuousEvent(domEventName, nativeEvent);
              return;
            }
            if (queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent)) {
              nativeEvent.stopPropagation();
              return;
            }
            clearIfContinuousEvent(domEventName, nativeEvent);
            if (eventSystemFlags & IS_CAPTURE_PHASE && isDiscreteEventThatRequiresHydration(domEventName)) {
              while (blockedOn !== null) {
                var fiber = getInstanceFromNode(blockedOn);
                if (fiber !== null) {
                  attemptSynchronousHydration(fiber);
                }
                var nextBlockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);
                if (nextBlockedOn === null) {
                  dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer);
                }
                if (nextBlockedOn === blockedOn) {
                  break;
                }
                blockedOn = nextBlockedOn;
              }
              if (blockedOn !== null) {
                nativeEvent.stopPropagation();
              }
              return;
            }
            dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, null, targetContainer);
          }
          var return_targetInst = null;
          function findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
            return_targetInst = null;
            var nativeEventTarget = getEventTarget(nativeEvent);
            var targetInst = getClosestInstanceFromNode(nativeEventTarget);
            if (targetInst !== null) {
              var nearestMounted = getNearestMountedFiber(targetInst);
              if (nearestMounted === null) {
                targetInst = null;
              } else {
                var tag = nearestMounted.tag;
                if (tag === SuspenseComponent) {
                  var instance = getSuspenseInstanceFromFiber(nearestMounted);
                  if (instance !== null) {
                    return instance;
                  }
                  targetInst = null;
                } else if (tag === HostRoot) {
                  var root2 = nearestMounted.stateNode;
                  if (isRootDehydrated(root2)) {
                    return getContainerFromFiber(nearestMounted);
                  }
                  targetInst = null;
                } else if (nearestMounted !== targetInst) {
                  targetInst = null;
                }
              }
            }
            return_targetInst = targetInst;
            return null;
          }
          function getEventPriority(domEventName) {
            switch (domEventName) {
              // Used by SimpleEventPlugin:
              case "cancel":
              case "click":
              case "close":
              case "contextmenu":
              case "copy":
              case "cut":
              case "auxclick":
              case "dblclick":
              case "dragend":
              case "dragstart":
              case "drop":
              case "focusin":
              case "focusout":
              case "input":
              case "invalid":
              case "keydown":
              case "keypress":
              case "keyup":
              case "mousedown":
              case "mouseup":
              case "paste":
              case "pause":
              case "play":
              case "pointercancel":
              case "pointerdown":
              case "pointerup":
              case "ratechange":
              case "reset":
              case "resize":
              case "seeked":
              case "submit":
              case "touchcancel":
              case "touchend":
              case "touchstart":
              case "volumechange":
              // Used by polyfills:
              // eslint-disable-next-line no-fallthrough
              case "change":
              case "selectionchange":
              case "textInput":
              case "compositionstart":
              case "compositionend":
              case "compositionupdate":
              // Only enableCreateEventHandleAPI:
              // eslint-disable-next-line no-fallthrough
              case "beforeblur":
              case "afterblur":
              // Not used by React but could be by user code:
              // eslint-disable-next-line no-fallthrough
              case "beforeinput":
              case "blur":
              case "fullscreenchange":
              case "focus":
              case "hashchange":
              case "popstate":
              case "select":
              case "selectstart":
                return DiscreteEventPriority;
              case "drag":
              case "dragenter":
              case "dragexit":
              case "dragleave":
              case "dragover":
              case "mousemove":
              case "mouseout":
              case "mouseover":
              case "pointermove":
              case "pointerout":
              case "pointerover":
              case "scroll":
              case "toggle":
              case "touchmove":
              case "wheel":
              // Not used by React but could be by user code:
              // eslint-disable-next-line no-fallthrough
              case "mouseenter":
              case "mouseleave":
              case "pointerenter":
              case "pointerleave":
                return ContinuousEventPriority;
              case "message": {
                var schedulerPriority = getCurrentPriorityLevel();
                switch (schedulerPriority) {
                  case ImmediatePriority:
                    return DiscreteEventPriority;
                  case UserBlockingPriority:
                    return ContinuousEventPriority;
                  case NormalPriority:
                  case LowPriority:
                    return DefaultEventPriority;
                  case IdlePriority:
                    return IdleEventPriority;
                  default:
                    return DefaultEventPriority;
                }
              }
              default:
                return DefaultEventPriority;
            }
          }
          function addEventBubbleListener(target, eventType, listener) {
            target.addEventListener(eventType, listener, false);
            return listener;
          }
          function addEventCaptureListener(target, eventType, listener) {
            target.addEventListener(eventType, listener, true);
            return listener;
          }
          function addEventCaptureListenerWithPassiveFlag(target, eventType, listener, passive2) {
            target.addEventListener(eventType, listener, {
              capture: true,
              passive: passive2
            });
            return listener;
          }
          function addEventBubbleListenerWithPassiveFlag(target, eventType, listener, passive2) {
            target.addEventListener(eventType, listener, {
              passive: passive2
            });
            return listener;
          }
          var root = null;
          var startText = null;
          var fallbackText = null;
          function initialize(nativeEventTarget) {
            root = nativeEventTarget;
            startText = getText2();
            return true;
          }
          function reset() {
            root = null;
            startText = null;
            fallbackText = null;
          }
          function getData3() {
            if (fallbackText) {
              return fallbackText;
            }
            var start2;
            var startValue = startText;
            var startLength = startValue.length;
            var end2;
            var endValue = getText2();
            var endLength = endValue.length;
            for (start2 = 0; start2 < startLength; start2++) {
              if (startValue[start2] !== endValue[start2]) {
                break;
              }
            }
            var minEnd = startLength - start2;
            for (end2 = 1; end2 <= minEnd; end2++) {
              if (startValue[startLength - end2] !== endValue[endLength - end2]) {
                break;
              }
            }
            var sliceTail = end2 > 1 ? 1 - end2 : void 0;
            fallbackText = endValue.slice(start2, sliceTail);
            return fallbackText;
          }
          function getText2() {
            if ("value" in root) {
              return root.value;
            }
            return root.textContent;
          }
          function getEventCharCode(nativeEvent) {
            var charCode;
            var keyCode = nativeEvent.keyCode;
            if ("charCode" in nativeEvent) {
              charCode = nativeEvent.charCode;
              if (charCode === 0 && keyCode === 13) {
                charCode = 13;
              }
            } else {
              charCode = keyCode;
            }
            if (charCode === 10) {
              charCode = 13;
            }
            if (charCode >= 32 || charCode === 13) {
              return charCode;
            }
            return 0;
          }
          function functionThatReturnsTrue() {
            return true;
          }
          function functionThatReturnsFalse() {
            return false;
          }
          function createSyntheticEvent(Interface) {
            function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {
              this._reactName = reactName;
              this._targetInst = targetInst;
              this.type = reactEventType;
              this.nativeEvent = nativeEvent;
              this.target = nativeEventTarget;
              this.currentTarget = null;
              for (var _propName in Interface) {
                if (!Interface.hasOwnProperty(_propName)) {
                  continue;
                }
                var normalize2 = Interface[_propName];
                if (normalize2) {
                  this[_propName] = normalize2(nativeEvent);
                } else {
                  this[_propName] = nativeEvent[_propName];
                }
              }
              var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
              if (defaultPrevented) {
                this.isDefaultPrevented = functionThatReturnsTrue;
              } else {
                this.isDefaultPrevented = functionThatReturnsFalse;
              }
              this.isPropagationStopped = functionThatReturnsFalse;
              return this;
            }
            assign(SyntheticBaseEvent.prototype, {
              preventDefault: function() {
                this.defaultPrevented = true;
                var event = this.nativeEvent;
                if (!event) {
                  return;
                }
                if (event.preventDefault) {
                  event.preventDefault();
                } else if (typeof event.returnValue !== "unknown") {
                  event.returnValue = false;
                }
                this.isDefaultPrevented = functionThatReturnsTrue;
              },
              stopPropagation: function() {
                var event = this.nativeEvent;
                if (!event) {
                  return;
                }
                if (event.stopPropagation) {
                  event.stopPropagation();
                } else if (typeof event.cancelBubble !== "unknown") {
                  event.cancelBubble = true;
                }
                this.isPropagationStopped = functionThatReturnsTrue;
              },
              /**
               * We release all dispatched `SyntheticEvent`s after each event loop, adding
               * them back into the pool. This allows a way to hold onto a reference that
               * won't be added back into the pool.
               */
              persist: function() {
              },
              /**
               * Checks if this event should be released back into the pool.
               *
               * @return {boolean} True if this should not be released, false otherwise.
               */
              isPersistent: functionThatReturnsTrue
            });
            return SyntheticBaseEvent;
          }
          var EventInterface = {
            eventPhase: 0,
            bubbles: 0,
            cancelable: 0,
            timeStamp: function(event) {
              return event.timeStamp || Date.now();
            },
            defaultPrevented: 0,
            isTrusted: 0
          };
          var SyntheticEvent = createSyntheticEvent(EventInterface);
          var UIEventInterface = assign({}, EventInterface, {
            view: 0,
            detail: 0
          });
          var SyntheticUIEvent = createSyntheticEvent(UIEventInterface);
          var lastMovementX;
          var lastMovementY;
          var lastMouseEvent;
          function updateMouseMovementPolyfillState(event) {
            if (event !== lastMouseEvent) {
              if (lastMouseEvent && event.type === "mousemove") {
                lastMovementX = event.screenX - lastMouseEvent.screenX;
                lastMovementY = event.screenY - lastMouseEvent.screenY;
              } else {
                lastMovementX = 0;
                lastMovementY = 0;
              }
              lastMouseEvent = event;
            }
          }
          var MouseEventInterface = assign({}, UIEventInterface, {
            screenX: 0,
            screenY: 0,
            clientX: 0,
            clientY: 0,
            pageX: 0,
            pageY: 0,
            ctrlKey: 0,
            shiftKey: 0,
            altKey: 0,
            metaKey: 0,
            getModifierState: getEventModifierState,
            button: 0,
            buttons: 0,
            relatedTarget: function(event) {
              if (event.relatedTarget === void 0) return event.fromElement === event.srcElement ? event.toElement : event.fromElement;
              return event.relatedTarget;
            },
            movementX: function(event) {
              if ("movementX" in event) {
                return event.movementX;
              }
              updateMouseMovementPolyfillState(event);
              return lastMovementX;
            },
            movementY: function(event) {
              if ("movementY" in event) {
                return event.movementY;
              }
              return lastMovementY;
            }
          });
          var SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface);
          var DragEventInterface = assign({}, MouseEventInterface, {
            dataTransfer: 0
          });
          var SyntheticDragEvent = createSyntheticEvent(DragEventInterface);
          var FocusEventInterface = assign({}, UIEventInterface, {
            relatedTarget: 0
          });
          var SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface);
          var AnimationEventInterface = assign({}, EventInterface, {
            animationName: 0,
            elapsedTime: 0,
            pseudoElement: 0
          });
          var SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface);
          var ClipboardEventInterface = assign({}, EventInterface, {
            clipboardData: function(event) {
              return "clipboardData" in event ? event.clipboardData : window.clipboardData;
            }
          });
          var SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface);
          var CompositionEventInterface = assign({}, EventInterface, {
            data: 0
          });
          var SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface);
          var SyntheticInputEvent = SyntheticCompositionEvent;
          var normalizeKey = {
            Esc: "Escape",
            Spacebar: " ",
            Left: "ArrowLeft",
            Up: "ArrowUp",
            Right: "ArrowRight",
            Down: "ArrowDown",
            Del: "Delete",
            Win: "OS",
            Menu: "ContextMenu",
            Apps: "ContextMenu",
            Scroll: "ScrollLock",
            MozPrintableKey: "Unidentified"
          };
          var translateToKey = {
            "8": "Backspace",
            "9": "Tab",
            "12": "Clear",
            "13": "Enter",
            "16": "Shift",
            "17": "Control",
            "18": "Alt",
            "19": "Pause",
            "20": "CapsLock",
            "27": "Escape",
            "32": " ",
            "33": "PageUp",
            "34": "PageDown",
            "35": "End",
            "36": "Home",
            "37": "ArrowLeft",
            "38": "ArrowUp",
            "39": "ArrowRight",
            "40": "ArrowDown",
            "45": "Insert",
            "46": "Delete",
            "112": "F1",
            "113": "F2",
            "114": "F3",
            "115": "F4",
            "116": "F5",
            "117": "F6",
            "118": "F7",
            "119": "F8",
            "120": "F9",
            "121": "F10",
            "122": "F11",
            "123": "F12",
            "144": "NumLock",
            "145": "ScrollLock",
            "224": "Meta"
          };
          function getEventKey2(nativeEvent) {
            if (nativeEvent.key) {
              var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
              if (key !== "Unidentified") {
                return key;
              }
            }
            if (nativeEvent.type === "keypress") {
              var charCode = getEventCharCode(nativeEvent);
              return charCode === 13 ? "Enter" : String.fromCharCode(charCode);
            }
            if (nativeEvent.type === "keydown" || nativeEvent.type === "keyup") {
              return translateToKey[nativeEvent.keyCode] || "Unidentified";
            }
            return "";
          }
          var modifierKeyToProp = {
            Alt: "altKey",
            Control: "ctrlKey",
            Meta: "metaKey",
            Shift: "shiftKey"
          };
          function modifierStateGetter(keyArg) {
            var syntheticEvent = this;
            var nativeEvent = syntheticEvent.nativeEvent;
            if (nativeEvent.getModifierState) {
              return nativeEvent.getModifierState(keyArg);
            }
            var keyProp = modifierKeyToProp[keyArg];
            return keyProp ? !!nativeEvent[keyProp] : false;
          }
          function getEventModifierState(nativeEvent) {
            return modifierStateGetter;
          }
          var KeyboardEventInterface = assign({}, UIEventInterface, {
            key: getEventKey2,
            code: 0,
            location: 0,
            ctrlKey: 0,
            shiftKey: 0,
            altKey: 0,
            metaKey: 0,
            repeat: 0,
            locale: 0,
            getModifierState: getEventModifierState,
            // Legacy Interface
            charCode: function(event) {
              if (event.type === "keypress") {
                return getEventCharCode(event);
              }
              return 0;
            },
            keyCode: function(event) {
              if (event.type === "keydown" || event.type === "keyup") {
                return event.keyCode;
              }
              return 0;
            },
            which: function(event) {
              if (event.type === "keypress") {
                return getEventCharCode(event);
              }
              if (event.type === "keydown" || event.type === "keyup") {
                return event.keyCode;
              }
              return 0;
            }
          });
          var SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface);
          var PointerEventInterface = assign({}, MouseEventInterface, {
            pointerId: 0,
            width: 0,
            height: 0,
            pressure: 0,
            tangentialPressure: 0,
            tiltX: 0,
            tiltY: 0,
            twist: 0,
            pointerType: 0,
            isPrimary: 0
          });
          var SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface);
          var TouchEventInterface = assign({}, UIEventInterface, {
            touches: 0,
            targetTouches: 0,
            changedTouches: 0,
            altKey: 0,
            metaKey: 0,
            ctrlKey: 0,
            shiftKey: 0,
            getModifierState: getEventModifierState
          });
          var SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface);
          var TransitionEventInterface = assign({}, EventInterface, {
            propertyName: 0,
            elapsedTime: 0,
            pseudoElement: 0
          });
          var SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface);
          var WheelEventInterface = assign({}, MouseEventInterface, {
            deltaX: function(event) {
              return "deltaX" in event ? event.deltaX : (
                // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
                "wheelDeltaX" in event ? -event.wheelDeltaX : 0
              );
            },
            deltaY: function(event) {
              return "deltaY" in event ? event.deltaY : (
                // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
                "wheelDeltaY" in event ? -event.wheelDeltaY : (
                  // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
                  "wheelDelta" in event ? -event.wheelDelta : 0
                )
              );
            },
            deltaZ: 0,
            // Browsers without "deltaMode" is reporting in raw wheel delta where one
            // notch on the scroll is always +/- 120, roughly equivalent to pixels.
            // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
            // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
            deltaMode: 0
          });
          var SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface);
          var END_KEYCODES = [9, 13, 27, 32];
          var START_KEYCODE = 229;
          var canUseCompositionEvent = canUseDOM3 && "CompositionEvent" in window;
          var documentMode = null;
          if (canUseDOM3 && "documentMode" in document) {
            documentMode = document.documentMode;
          }
          var canUseTextInputEvent = canUseDOM3 && "TextEvent" in window && !documentMode;
          var useFallbackCompositionData = canUseDOM3 && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
          var SPACEBAR_CODE = 32;
          var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
          function registerEvents() {
            registerTwoPhaseEvent("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]);
            registerTwoPhaseEvent("onCompositionEnd", ["compositionend", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
            registerTwoPhaseEvent("onCompositionStart", ["compositionstart", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
            registerTwoPhaseEvent("onCompositionUpdate", ["compositionupdate", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
          }
          var hasSpaceKeypress = false;
          function isKeypressCommand(nativeEvent) {
            return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.
            !(nativeEvent.ctrlKey && nativeEvent.altKey);
          }
          function getCompositionEventType(domEventName) {
            switch (domEventName) {
              case "compositionstart":
                return "onCompositionStart";
              case "compositionend":
                return "onCompositionEnd";
              case "compositionupdate":
                return "onCompositionUpdate";
            }
          }
          function isFallbackCompositionStart(domEventName, nativeEvent) {
            return domEventName === "keydown" && nativeEvent.keyCode === START_KEYCODE;
          }
          function isFallbackCompositionEnd(domEventName, nativeEvent) {
            switch (domEventName) {
              case "keyup":
                return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
              case "keydown":
                return nativeEvent.keyCode !== START_KEYCODE;
              case "keypress":
              case "mousedown":
              case "focusout":
                return true;
              default:
                return false;
            }
          }
          function getDataFromCustomEvent(nativeEvent) {
            var detail = nativeEvent.detail;
            if (typeof detail === "object" && "data" in detail) {
              return detail.data;
            }
            return null;
          }
          function isUsingKoreanIME(nativeEvent) {
            return nativeEvent.locale === "ko";
          }
          var isComposing = false;
          function extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
            var eventType;
            var fallbackData;
            if (canUseCompositionEvent) {
              eventType = getCompositionEventType(domEventName);
            } else if (!isComposing) {
              if (isFallbackCompositionStart(domEventName, nativeEvent)) {
                eventType = "onCompositionStart";
              }
            } else if (isFallbackCompositionEnd(domEventName, nativeEvent)) {
              eventType = "onCompositionEnd";
            }
            if (!eventType) {
              return null;
            }
            if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
              if (!isComposing && eventType === "onCompositionStart") {
                isComposing = initialize(nativeEventTarget);
              } else if (eventType === "onCompositionEnd") {
                if (isComposing) {
                  fallbackData = getData3();
                }
              }
            }
            var listeners = accumulateTwoPhaseListeners(targetInst, eventType);
            if (listeners.length > 0) {
              var event = new SyntheticCompositionEvent(eventType, domEventName, null, nativeEvent, nativeEventTarget);
              dispatchQueue.push({
                event,
                listeners
              });
              if (fallbackData) {
                event.data = fallbackData;
              } else {
                var customData = getDataFromCustomEvent(nativeEvent);
                if (customData !== null) {
                  event.data = customData;
                }
              }
            }
          }
          function getNativeBeforeInputChars(domEventName, nativeEvent) {
            switch (domEventName) {
              case "compositionend":
                return getDataFromCustomEvent(nativeEvent);
              case "keypress":
                var which = nativeEvent.which;
                if (which !== SPACEBAR_CODE) {
                  return null;
                }
                hasSpaceKeypress = true;
                return SPACEBAR_CHAR;
              case "textInput":
                var chars = nativeEvent.data;
                if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
                  return null;
                }
                return chars;
              default:
                return null;
            }
          }
          function getFallbackBeforeInputChars(domEventName, nativeEvent) {
            if (isComposing) {
              if (domEventName === "compositionend" || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {
                var chars = getData3();
                reset();
                isComposing = false;
                return chars;
              }
              return null;
            }
            switch (domEventName) {
              case "paste":
                return null;
              case "keypress":
                if (!isKeypressCommand(nativeEvent)) {
                  if (nativeEvent.char && nativeEvent.char.length > 1) {
                    return nativeEvent.char;
                  } else if (nativeEvent.which) {
                    return String.fromCharCode(nativeEvent.which);
                  }
                }
                return null;
              case "compositionend":
                return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
              default:
                return null;
            }
          }
          function extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
            var chars;
            if (canUseTextInputEvent) {
              chars = getNativeBeforeInputChars(domEventName, nativeEvent);
            } else {
              chars = getFallbackBeforeInputChars(domEventName, nativeEvent);
            }
            if (!chars) {
              return null;
            }
            var listeners = accumulateTwoPhaseListeners(targetInst, "onBeforeInput");
            if (listeners.length > 0) {
              var event = new SyntheticInputEvent("onBeforeInput", "beforeinput", null, nativeEvent, nativeEventTarget);
              dispatchQueue.push({
                event,
                listeners
              });
              event.data = chars;
            }
          }
          function extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
            extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
          }
          var supportedInputTypes = {
            color: true,
            date: true,
            datetime: true,
            "datetime-local": true,
            email: true,
            month: true,
            number: true,
            password: true,
            range: true,
            search: true,
            tel: true,
            text: true,
            time: true,
            url: true,
            week: true
          };
          function isTextInputElement(elem) {
            var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
            if (nodeName === "input") {
              return !!supportedInputTypes[elem.type];
            }
            if (nodeName === "textarea") {
              return true;
            }
            return false;
          }
          function isEventSupported(eventNameSuffix) {
            if (!canUseDOM3) {
              return false;
            }
            var eventName = "on" + eventNameSuffix;
            var isSupported = eventName in document;
            if (!isSupported) {
              var element = document.createElement("div");
              element.setAttribute(eventName, "return;");
              isSupported = typeof element[eventName] === "function";
            }
            return isSupported;
          }
          function registerEvents$1() {
            registerTwoPhaseEvent("onChange", ["change", "click", "focusin", "focusout", "input", "keydown", "keyup", "selectionchange"]);
          }
          function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {
            enqueueStateRestore(target);
            var listeners = accumulateTwoPhaseListeners(inst, "onChange");
            if (listeners.length > 0) {
              var event = new SyntheticEvent("onChange", "change", null, nativeEvent, target);
              dispatchQueue.push({
                event,
                listeners
              });
            }
          }
          var activeElement = null;
          var activeElementInst = null;
          function shouldUseChangeEvent(elem) {
            var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
            return nodeName === "select" || nodeName === "input" && elem.type === "file";
          }
          function manualDispatchChangeEvent(nativeEvent) {
            var dispatchQueue = [];
            createAndAccumulateChangeEvent(dispatchQueue, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
            batchedUpdates(runEventInBatch, dispatchQueue);
          }
          function runEventInBatch(dispatchQueue) {
            processDispatchQueue(dispatchQueue, 0);
          }
          function getInstIfValueChanged(targetInst) {
            var targetNode = getNodeFromInstance(targetInst);
            if (updateValueIfChanged(targetNode)) {
              return targetInst;
            }
          }
          function getTargetInstForChangeEvent(domEventName, targetInst) {
            if (domEventName === "change") {
              return targetInst;
            }
          }
          var isInputEventSupported = false;
          if (canUseDOM3) {
            isInputEventSupported = isEventSupported("input") && (!document.documentMode || document.documentMode > 9);
          }
          function startWatchingForValueChange(target, targetInst) {
            activeElement = target;
            activeElementInst = targetInst;
            activeElement.attachEvent("onpropertychange", handlePropertyChange);
          }
          function stopWatchingForValueChange() {
            if (!activeElement) {
              return;
            }
            activeElement.detachEvent("onpropertychange", handlePropertyChange);
            activeElement = null;
            activeElementInst = null;
          }
          function handlePropertyChange(nativeEvent) {
            if (nativeEvent.propertyName !== "value") {
              return;
            }
            if (getInstIfValueChanged(activeElementInst)) {
              manualDispatchChangeEvent(nativeEvent);
            }
          }
          function handleEventsForInputEventPolyfill(domEventName, target, targetInst) {
            if (domEventName === "focusin") {
              stopWatchingForValueChange();
              startWatchingForValueChange(target, targetInst);
            } else if (domEventName === "focusout") {
              stopWatchingForValueChange();
            }
          }
          function getTargetInstForInputEventPolyfill(domEventName, targetInst) {
            if (domEventName === "selectionchange" || domEventName === "keyup" || domEventName === "keydown") {
              return getInstIfValueChanged(activeElementInst);
            }
          }
          function shouldUseClickEvent(elem) {
            var nodeName = elem.nodeName;
            return nodeName && nodeName.toLowerCase() === "input" && (elem.type === "checkbox" || elem.type === "radio");
          }
          function getTargetInstForClickEvent(domEventName, targetInst) {
            if (domEventName === "click") {
              return getInstIfValueChanged(targetInst);
            }
          }
          function getTargetInstForInputOrChangeEvent(domEventName, targetInst) {
            if (domEventName === "input" || domEventName === "change") {
              return getInstIfValueChanged(targetInst);
            }
          }
          function handleControlledInputBlur(node) {
            var state = node._wrapperState;
            if (!state || !state.controlled || node.type !== "number") {
              return;
            }
            {
              setDefaultValue(node, "number", node.value);
            }
          }
          function extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
            var getTargetInstFunc, handleEventFunc;
            if (shouldUseChangeEvent(targetNode)) {
              getTargetInstFunc = getTargetInstForChangeEvent;
            } else if (isTextInputElement(targetNode)) {
              if (isInputEventSupported) {
                getTargetInstFunc = getTargetInstForInputOrChangeEvent;
              } else {
                getTargetInstFunc = getTargetInstForInputEventPolyfill;
                handleEventFunc = handleEventsForInputEventPolyfill;
              }
            } else if (shouldUseClickEvent(targetNode)) {
              getTargetInstFunc = getTargetInstForClickEvent;
            }
            if (getTargetInstFunc) {
              var inst = getTargetInstFunc(domEventName, targetInst);
              if (inst) {
                createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, nativeEventTarget);
                return;
              }
            }
            if (handleEventFunc) {
              handleEventFunc(domEventName, targetNode, targetInst);
            }
            if (domEventName === "focusout") {
              handleControlledInputBlur(targetNode);
            }
          }
          function registerEvents$2() {
            registerDirectEvent("onMouseEnter", ["mouseout", "mouseover"]);
            registerDirectEvent("onMouseLeave", ["mouseout", "mouseover"]);
            registerDirectEvent("onPointerEnter", ["pointerout", "pointerover"]);
            registerDirectEvent("onPointerLeave", ["pointerout", "pointerover"]);
          }
          function extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            var isOverEvent = domEventName === "mouseover" || domEventName === "pointerover";
            var isOutEvent = domEventName === "mouseout" || domEventName === "pointerout";
            if (isOverEvent && !isReplayingEvent(nativeEvent)) {
              var related = nativeEvent.relatedTarget || nativeEvent.fromElement;
              if (related) {
                if (getClosestInstanceFromNode(related) || isContainerMarkedAsRoot(related)) {
                  return;
                }
              }
            }
            if (!isOutEvent && !isOverEvent) {
              return;
            }
            var win;
            if (nativeEventTarget.window === nativeEventTarget) {
              win = nativeEventTarget;
            } else {
              var doc = nativeEventTarget.ownerDocument;
              if (doc) {
                win = doc.defaultView || doc.parentWindow;
              } else {
                win = window;
              }
            }
            var from;
            var to;
            if (isOutEvent) {
              var _related = nativeEvent.relatedTarget || nativeEvent.toElement;
              from = targetInst;
              to = _related ? getClosestInstanceFromNode(_related) : null;
              if (to !== null) {
                var nearestMounted = getNearestMountedFiber(to);
                if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {
                  to = null;
                }
              }
            } else {
              from = null;
              to = targetInst;
            }
            if (from === to) {
              return;
            }
            var SyntheticEventCtor = SyntheticMouseEvent;
            var leaveEventType = "onMouseLeave";
            var enterEventType = "onMouseEnter";
            var eventTypePrefix = "mouse";
            if (domEventName === "pointerout" || domEventName === "pointerover") {
              SyntheticEventCtor = SyntheticPointerEvent;
              leaveEventType = "onPointerLeave";
              enterEventType = "onPointerEnter";
              eventTypePrefix = "pointer";
            }
            var fromNode = from == null ? win : getNodeFromInstance(from);
            var toNode = to == null ? win : getNodeFromInstance(to);
            var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + "leave", from, nativeEvent, nativeEventTarget);
            leave.target = fromNode;
            leave.relatedTarget = toNode;
            var enter = null;
            var nativeTargetInst = getClosestInstanceFromNode(nativeEventTarget);
            if (nativeTargetInst === targetInst) {
              var enterEvent = new SyntheticEventCtor(enterEventType, eventTypePrefix + "enter", to, nativeEvent, nativeEventTarget);
              enterEvent.target = toNode;
              enterEvent.relatedTarget = fromNode;
              enter = enterEvent;
            }
            accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leave, enter, from, to);
          }
          function is(x2, y2) {
            return x2 === y2 && (x2 !== 0 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
          }
          var objectIs = typeof Object.is === "function" ? Object.is : is;
          function shallowEqual(objA, objB) {
            if (objectIs(objA, objB)) {
              return true;
            }
            if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
              return false;
            }
            var keysA = Object.keys(objA);
            var keysB = Object.keys(objB);
            if (keysA.length !== keysB.length) {
              return false;
            }
            for (var i = 0; i < keysA.length; i++) {
              var currentKey = keysA[i];
              if (!hasOwnProperty.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey])) {
                return false;
              }
            }
            return true;
          }
          function getLeafNode(node) {
            while (node && node.firstChild) {
              node = node.firstChild;
            }
            return node;
          }
          function getSiblingNode(node) {
            while (node) {
              if (node.nextSibling) {
                return node.nextSibling;
              }
              node = node.parentNode;
            }
          }
          function getNodeForCharacterOffset(root2, offset2) {
            var node = getLeafNode(root2);
            var nodeStart = 0;
            var nodeEnd = 0;
            while (node) {
              if (node.nodeType === TEXT_NODE) {
                nodeEnd = nodeStart + node.textContent.length;
                if (nodeStart <= offset2 && nodeEnd >= offset2) {
                  return {
                    node,
                    offset: offset2 - nodeStart
                  };
                }
                nodeStart = nodeEnd;
              }
              node = getLeafNode(getSiblingNode(node));
            }
          }
          function getOffsets(outerNode) {
            var ownerDocument = outerNode.ownerDocument;
            var win = ownerDocument && ownerDocument.defaultView || window;
            var selection = win.getSelection && win.getSelection();
            if (!selection || selection.rangeCount === 0) {
              return null;
            }
            var anchorNode = selection.anchorNode, anchorOffset = selection.anchorOffset, focusNode = selection.focusNode, focusOffset = selection.focusOffset;
            try {
              anchorNode.nodeType;
              focusNode.nodeType;
            } catch (e) {
              return null;
            }
            return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
          }
          function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
            var length = 0;
            var start2 = -1;
            var end2 = -1;
            var indexWithinAnchor = 0;
            var indexWithinFocus = 0;
            var node = outerNode;
            var parentNode = null;
            outer: while (true) {
              var next = null;
              while (true) {
                if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
                  start2 = length + anchorOffset;
                }
                if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
                  end2 = length + focusOffset;
                }
                if (node.nodeType === TEXT_NODE) {
                  length += node.nodeValue.length;
                }
                if ((next = node.firstChild) === null) {
                  break;
                }
                parentNode = node;
                node = next;
              }
              while (true) {
                if (node === outerNode) {
                  break outer;
                }
                if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
                  start2 = length;
                }
                if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
                  end2 = length;
                }
                if ((next = node.nextSibling) !== null) {
                  break;
                }
                node = parentNode;
                parentNode = node.parentNode;
              }
              node = next;
            }
            if (start2 === -1 || end2 === -1) {
              return null;
            }
            return {
              start: start2,
              end: end2
            };
          }
          function setOffsets(node, offsets) {
            var doc = node.ownerDocument || document;
            var win = doc && doc.defaultView || window;
            if (!win.getSelection) {
              return;
            }
            var selection = win.getSelection();
            var length = node.textContent.length;
            var start2 = Math.min(offsets.start, length);
            var end2 = offsets.end === void 0 ? start2 : Math.min(offsets.end, length);
            if (!selection.extend && start2 > end2) {
              var temp = end2;
              end2 = start2;
              start2 = temp;
            }
            var startMarker = getNodeForCharacterOffset(node, start2);
            var endMarker = getNodeForCharacterOffset(node, end2);
            if (startMarker && endMarker) {
              if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
                return;
              }
              var range4 = doc.createRange();
              range4.setStart(startMarker.node, startMarker.offset);
              selection.removeAllRanges();
              if (start2 > end2) {
                selection.addRange(range4);
                selection.extend(endMarker.node, endMarker.offset);
              } else {
                range4.setEnd(endMarker.node, endMarker.offset);
                selection.addRange(range4);
              }
            }
          }
          function isTextNode(node) {
            return node && node.nodeType === TEXT_NODE;
          }
          function containsNode(outerNode, innerNode) {
            if (!outerNode || !innerNode) {
              return false;
            } else if (outerNode === innerNode) {
              return true;
            } else if (isTextNode(outerNode)) {
              return false;
            } else if (isTextNode(innerNode)) {
              return containsNode(outerNode, innerNode.parentNode);
            } else if ("contains" in outerNode) {
              return outerNode.contains(innerNode);
            } else if (outerNode.compareDocumentPosition) {
              return !!(outerNode.compareDocumentPosition(innerNode) & 16);
            } else {
              return false;
            }
          }
          function isInDocument(node) {
            return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
          }
          function isSameOriginFrame(iframe) {
            try {
              return typeof iframe.contentWindow.location.href === "string";
            } catch (err) {
              return false;
            }
          }
          function getActiveElementDeep() {
            var win = window;
            var element = getActiveElement();
            while (element instanceof win.HTMLIFrameElement) {
              if (isSameOriginFrame(element)) {
                win = element.contentWindow;
              } else {
                return element;
              }
              element = getActiveElement(win.document);
            }
            return element;
          }
          function hasSelectionCapabilities(elem) {
            var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
            return nodeName && (nodeName === "input" && (elem.type === "text" || elem.type === "search" || elem.type === "tel" || elem.type === "url" || elem.type === "password") || nodeName === "textarea" || elem.contentEditable === "true");
          }
          function getSelectionInformation() {
            var focusedElem = getActiveElementDeep();
            return {
              focusedElem,
              selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null
            };
          }
          function restoreSelection(priorSelectionInformation) {
            var curFocusedElem = getActiveElementDeep();
            var priorFocusedElem = priorSelectionInformation.focusedElem;
            var priorSelectionRange = priorSelectionInformation.selectionRange;
            if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
              if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
                setSelection(priorFocusedElem, priorSelectionRange);
              }
              var ancestors = [];
              var ancestor = priorFocusedElem;
              while (ancestor = ancestor.parentNode) {
                if (ancestor.nodeType === ELEMENT_NODE) {
                  ancestors.push({
                    element: ancestor,
                    left: ancestor.scrollLeft,
                    top: ancestor.scrollTop
                  });
                }
              }
              if (typeof priorFocusedElem.focus === "function") {
                priorFocusedElem.focus();
              }
              for (var i = 0; i < ancestors.length; i++) {
                var info2 = ancestors[i];
                info2.element.scrollLeft = info2.left;
                info2.element.scrollTop = info2.top;
              }
            }
          }
          function getSelection(input) {
            var selection;
            if ("selectionStart" in input) {
              selection = {
                start: input.selectionStart,
                end: input.selectionEnd
              };
            } else {
              selection = getOffsets(input);
            }
            return selection || {
              start: 0,
              end: 0
            };
          }
          function setSelection(input, offsets) {
            var start2 = offsets.start;
            var end2 = offsets.end;
            if (end2 === void 0) {
              end2 = start2;
            }
            if ("selectionStart" in input) {
              input.selectionStart = start2;
              input.selectionEnd = Math.min(end2, input.value.length);
            } else {
              setOffsets(input, offsets);
            }
          }
          var skipSelectionChangeEvent = canUseDOM3 && "documentMode" in document && document.documentMode <= 11;
          function registerEvents$3() {
            registerTwoPhaseEvent("onSelect", ["focusout", "contextmenu", "dragend", "focusin", "keydown", "keyup", "mousedown", "mouseup", "selectionchange"]);
          }
          var activeElement$1 = null;
          var activeElementInst$1 = null;
          var lastSelection = null;
          var mouseDown = false;
          function getSelection$1(node) {
            if ("selectionStart" in node && hasSelectionCapabilities(node)) {
              return {
                start: node.selectionStart,
                end: node.selectionEnd
              };
            } else {
              var win = node.ownerDocument && node.ownerDocument.defaultView || window;
              var selection = win.getSelection();
              return {
                anchorNode: selection.anchorNode,
                anchorOffset: selection.anchorOffset,
                focusNode: selection.focusNode,
                focusOffset: selection.focusOffset
              };
            }
          }
          function getEventTargetDocument(eventTarget) {
            return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
          }
          function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
            var doc = getEventTargetDocument(nativeEventTarget);
            if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
              return;
            }
            var currentSelection = getSelection$1(activeElement$1);
            if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
              lastSelection = currentSelection;
              var listeners = accumulateTwoPhaseListeners(activeElementInst$1, "onSelect");
              if (listeners.length > 0) {
                var event = new SyntheticEvent("onSelect", "select", null, nativeEvent, nativeEventTarget);
                dispatchQueue.push({
                  event,
                  listeners
                });
                event.target = activeElement$1;
              }
            }
          }
          function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
            switch (domEventName) {
              // Track the input node that has focus.
              case "focusin":
                if (isTextInputElement(targetNode) || targetNode.contentEditable === "true") {
                  activeElement$1 = targetNode;
                  activeElementInst$1 = targetInst;
                  lastSelection = null;
                }
                break;
              case "focusout":
                activeElement$1 = null;
                activeElementInst$1 = null;
                lastSelection = null;
                break;
              // Don't fire the event while the user is dragging. This matches the
              // semantics of the native select event.
              case "mousedown":
                mouseDown = true;
                break;
              case "contextmenu":
              case "mouseup":
              case "dragend":
                mouseDown = false;
                constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
                break;
              // Chrome and IE fire non-standard event when selection is changed (and
              // sometimes when it hasn't). IE's event fires out of order with respect
              // to key and input events on deletion, so we discard it.
              //
              // Firefox doesn't support selectionchange, so check selection status
              // after each key entry. The selection changes after keydown and before
              // keyup, but we check on keydown as well in the case of holding down a
              // key, when multiple keydown events are fired but only one keyup is.
              // This is also our approach for IE handling, for the reason above.
              case "selectionchange":
                if (skipSelectionChangeEvent) {
                  break;
                }
              // falls through
              case "keydown":
              case "keyup":
                constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
            }
          }
          function makePrefixMap(styleProp, eventName) {
            var prefixes3 = {};
            prefixes3[styleProp.toLowerCase()] = eventName.toLowerCase();
            prefixes3["Webkit" + styleProp] = "webkit" + eventName;
            prefixes3["Moz" + styleProp] = "moz" + eventName;
            return prefixes3;
          }
          var vendorPrefixes = {
            animationend: makePrefixMap("Animation", "AnimationEnd"),
            animationiteration: makePrefixMap("Animation", "AnimationIteration"),
            animationstart: makePrefixMap("Animation", "AnimationStart"),
            transitionend: makePrefixMap("Transition", "TransitionEnd")
          };
          var prefixedEventNames = {};
          var style = {};
          if (canUseDOM3) {
            style = document.createElement("div").style;
            if (!("AnimationEvent" in window)) {
              delete vendorPrefixes.animationend.animation;
              delete vendorPrefixes.animationiteration.animation;
              delete vendorPrefixes.animationstart.animation;
            }
            if (!("TransitionEvent" in window)) {
              delete vendorPrefixes.transitionend.transition;
            }
          }
          function getVendorPrefixedEventName(eventName) {
            if (prefixedEventNames[eventName]) {
              return prefixedEventNames[eventName];
            } else if (!vendorPrefixes[eventName]) {
              return eventName;
            }
            var prefixMap = vendorPrefixes[eventName];
            for (var styleProp in prefixMap) {
              if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
                return prefixedEventNames[eventName] = prefixMap[styleProp];
              }
            }
            return eventName;
          }
          var ANIMATION_END = getVendorPrefixedEventName("animationend");
          var ANIMATION_ITERATION = getVendorPrefixedEventName("animationiteration");
          var ANIMATION_START = getVendorPrefixedEventName("animationstart");
          var TRANSITION_END = getVendorPrefixedEventName("transitionend");
          var topLevelEventsToReactNames = /* @__PURE__ */ new Map();
          var simpleEventPluginEvents = ["abort", "auxClick", "cancel", "canPlay", "canPlayThrough", "click", "close", "contextMenu", "copy", "cut", "drag", "dragEnd", "dragEnter", "dragExit", "dragLeave", "dragOver", "dragStart", "drop", "durationChange", "emptied", "encrypted", "ended", "error", "gotPointerCapture", "input", "invalid", "keyDown", "keyPress", "keyUp", "load", "loadedData", "loadedMetadata", "loadStart", "lostPointerCapture", "mouseDown", "mouseMove", "mouseOut", "mouseOver", "mouseUp", "paste", "pause", "play", "playing", "pointerCancel", "pointerDown", "pointerMove", "pointerOut", "pointerOver", "pointerUp", "progress", "rateChange", "reset", "resize", "seeked", "seeking", "stalled", "submit", "suspend", "timeUpdate", "touchCancel", "touchEnd", "touchStart", "volumeChange", "scroll", "toggle", "touchMove", "waiting", "wheel"];
          function registerSimpleEvent(domEventName, reactName) {
            topLevelEventsToReactNames.set(domEventName, reactName);
            registerTwoPhaseEvent(reactName, [domEventName]);
          }
          function registerSimpleEvents() {
            for (var i = 0; i < simpleEventPluginEvents.length; i++) {
              var eventName = simpleEventPluginEvents[i];
              var domEventName = eventName.toLowerCase();
              var capitalizedEvent = eventName[0].toUpperCase() + eventName.slice(1);
              registerSimpleEvent(domEventName, "on" + capitalizedEvent);
            }
            registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
            registerSimpleEvent(ANIMATION_ITERATION, "onAnimationIteration");
            registerSimpleEvent(ANIMATION_START, "onAnimationStart");
            registerSimpleEvent("dblclick", "onDoubleClick");
            registerSimpleEvent("focusin", "onFocus");
            registerSimpleEvent("focusout", "onBlur");
            registerSimpleEvent(TRANSITION_END, "onTransitionEnd");
          }
          function extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            var reactName = topLevelEventsToReactNames.get(domEventName);
            if (reactName === void 0) {
              return;
            }
            var SyntheticEventCtor = SyntheticEvent;
            var reactEventType = domEventName;
            switch (domEventName) {
              case "keypress":
                if (getEventCharCode(nativeEvent) === 0) {
                  return;
                }
              /* falls through */
              case "keydown":
              case "keyup":
                SyntheticEventCtor = SyntheticKeyboardEvent;
                break;
              case "focusin":
                reactEventType = "focus";
                SyntheticEventCtor = SyntheticFocusEvent;
                break;
              case "focusout":
                reactEventType = "blur";
                SyntheticEventCtor = SyntheticFocusEvent;
                break;
              case "beforeblur":
              case "afterblur":
                SyntheticEventCtor = SyntheticFocusEvent;
                break;
              case "click":
                if (nativeEvent.button === 2) {
                  return;
                }
              /* falls through */
              case "auxclick":
              case "dblclick":
              case "mousedown":
              case "mousemove":
              case "mouseup":
              // TODO: Disabled elements should not respond to mouse events
              /* falls through */
              case "mouseout":
              case "mouseover":
              case "contextmenu":
                SyntheticEventCtor = SyntheticMouseEvent;
                break;
              case "drag":
              case "dragend":
              case "dragenter":
              case "dragexit":
              case "dragleave":
              case "dragover":
              case "dragstart":
              case "drop":
                SyntheticEventCtor = SyntheticDragEvent;
                break;
              case "touchcancel":
              case "touchend":
              case "touchmove":
              case "touchstart":
                SyntheticEventCtor = SyntheticTouchEvent;
                break;
              case ANIMATION_END:
              case ANIMATION_ITERATION:
              case ANIMATION_START:
                SyntheticEventCtor = SyntheticAnimationEvent;
                break;
              case TRANSITION_END:
                SyntheticEventCtor = SyntheticTransitionEvent;
                break;
              case "scroll":
                SyntheticEventCtor = SyntheticUIEvent;
                break;
              case "wheel":
                SyntheticEventCtor = SyntheticWheelEvent;
                break;
              case "copy":
              case "cut":
              case "paste":
                SyntheticEventCtor = SyntheticClipboardEvent;
                break;
              case "gotpointercapture":
              case "lostpointercapture":
              case "pointercancel":
              case "pointerdown":
              case "pointermove":
              case "pointerout":
              case "pointerover":
              case "pointerup":
                SyntheticEventCtor = SyntheticPointerEvent;
                break;
            }
            var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;
            {
              var accumulateTargetOnly = !inCapturePhase && // TODO: ideally, we'd eventually add all events from
              // nonDelegatedEvents list in DOMPluginEventSystem.
              // Then we can remove this special list.
              // This is a breaking change that can wait until React 18.
              domEventName === "scroll";
              var _listeners2 = accumulateSinglePhaseListeners(targetInst, reactName, nativeEvent.type, inCapturePhase, accumulateTargetOnly);
              if (_listeners2.length > 0) {
                var _event = new SyntheticEventCtor(reactName, reactEventType, null, nativeEvent, nativeEventTarget);
                dispatchQueue.push({
                  event: _event,
                  listeners: _listeners2
                });
              }
            }
          }
          registerSimpleEvents();
          registerEvents$2();
          registerEvents$1();
          registerEvents$3();
          registerEvents();
          function extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
            extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
            var shouldProcessPolyfillPlugins = (eventSystemFlags & SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS) === 0;
            if (shouldProcessPolyfillPlugins) {
              extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
              extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
              extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
              extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
            }
          }
          var mediaEventTypes = ["abort", "canplay", "canplaythrough", "durationchange", "emptied", "encrypted", "ended", "error", "loadeddata", "loadedmetadata", "loadstart", "pause", "play", "playing", "progress", "ratechange", "resize", "seeked", "seeking", "stalled", "suspend", "timeupdate", "volumechange", "waiting"];
          var nonDelegatedEvents = new Set(["cancel", "close", "invalid", "load", "scroll", "toggle"].concat(mediaEventTypes));
          function executeDispatch(event, listener, currentTarget) {
            var type = event.type || "unknown-event";
            event.currentTarget = currentTarget;
            invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event);
            event.currentTarget = null;
          }
          function processDispatchQueueItemsInOrder(event, dispatchListeners, inCapturePhase) {
            var previousInstance;
            if (inCapturePhase) {
              for (var i = dispatchListeners.length - 1; i >= 0; i--) {
                var _dispatchListeners$i = dispatchListeners[i], instance = _dispatchListeners$i.instance, currentTarget = _dispatchListeners$i.currentTarget, listener = _dispatchListeners$i.listener;
                if (instance !== previousInstance && event.isPropagationStopped()) {
                  return;
                }
                executeDispatch(event, listener, currentTarget);
                previousInstance = instance;
              }
            } else {
              for (var _i = 0; _i < dispatchListeners.length; _i++) {
                var _dispatchListeners$_i = dispatchListeners[_i], _instance = _dispatchListeners$_i.instance, _currentTarget = _dispatchListeners$_i.currentTarget, _listener = _dispatchListeners$_i.listener;
                if (_instance !== previousInstance && event.isPropagationStopped()) {
                  return;
                }
                executeDispatch(event, _listener, _currentTarget);
                previousInstance = _instance;
              }
            }
          }
          function processDispatchQueue(dispatchQueue, eventSystemFlags) {
            var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;
            for (var i = 0; i < dispatchQueue.length; i++) {
              var _dispatchQueue$i = dispatchQueue[i], event = _dispatchQueue$i.event, listeners = _dispatchQueue$i.listeners;
              processDispatchQueueItemsInOrder(event, listeners, inCapturePhase);
            }
            rethrowCaughtError();
          }
          function dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
            var nativeEventTarget = getEventTarget(nativeEvent);
            var dispatchQueue = [];
            extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
            processDispatchQueue(dispatchQueue, eventSystemFlags);
          }
          function listenToNonDelegatedEvent(domEventName, targetElement) {
            {
              if (!nonDelegatedEvents.has(domEventName)) {
                error('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.', domEventName);
              }
            }
            var isCapturePhaseListener = false;
            var listenerSet = getEventListenerSet(targetElement);
            var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener);
            if (!listenerSet.has(listenerSetKey)) {
              addTrappedEventListener(targetElement, domEventName, IS_NON_DELEGATED, isCapturePhaseListener);
              listenerSet.add(listenerSetKey);
            }
          }
          function listenToNativeEvent(domEventName, isCapturePhaseListener, target) {
            {
              if (nonDelegatedEvents.has(domEventName) && !isCapturePhaseListener) {
                error('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.', domEventName);
              }
            }
            var eventSystemFlags = 0;
            if (isCapturePhaseListener) {
              eventSystemFlags |= IS_CAPTURE_PHASE;
            }
            addTrappedEventListener(target, domEventName, eventSystemFlags, isCapturePhaseListener);
          }
          var listeningMarker = "_reactListening" + Math.random().toString(36).slice(2);
          function listenToAllSupportedEvents(rootContainerElement) {
            if (!rootContainerElement[listeningMarker]) {
              rootContainerElement[listeningMarker] = true;
              allNativeEvents.forEach(function(domEventName) {
                if (domEventName !== "selectionchange") {
                  if (!nonDelegatedEvents.has(domEventName)) {
                    listenToNativeEvent(domEventName, false, rootContainerElement);
                  }
                  listenToNativeEvent(domEventName, true, rootContainerElement);
                }
              });
              var ownerDocument = rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
              if (ownerDocument !== null) {
                if (!ownerDocument[listeningMarker]) {
                  ownerDocument[listeningMarker] = true;
                  listenToNativeEvent("selectionchange", false, ownerDocument);
                }
              }
            }
          }
          function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport) {
            var listener = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags);
            var isPassiveListener = void 0;
            if (passiveBrowserEventsSupported) {
              if (domEventName === "touchstart" || domEventName === "touchmove" || domEventName === "wheel") {
                isPassiveListener = true;
              }
            }
            targetContainer = targetContainer;
            var unsubscribeListener;
            if (isCapturePhaseListener) {
              if (isPassiveListener !== void 0) {
                unsubscribeListener = addEventCaptureListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);
              } else {
                unsubscribeListener = addEventCaptureListener(targetContainer, domEventName, listener);
              }
            } else {
              if (isPassiveListener !== void 0) {
                unsubscribeListener = addEventBubbleListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);
              } else {
                unsubscribeListener = addEventBubbleListener(targetContainer, domEventName, listener);
              }
            }
          }
          function isMatchingRootContainer(grandContainer, targetContainer) {
            return grandContainer === targetContainer || grandContainer.nodeType === COMMENT_NODE && grandContainer.parentNode === targetContainer;
          }
          function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
            var ancestorInst = targetInst;
            if ((eventSystemFlags & IS_EVENT_HANDLE_NON_MANAGED_NODE) === 0 && (eventSystemFlags & IS_NON_DELEGATED) === 0) {
              var targetContainerNode = targetContainer;
              if (targetInst !== null) {
                var node = targetInst;
                mainLoop: while (true) {
                  if (node === null) {
                    return;
                  }
                  var nodeTag = node.tag;
                  if (nodeTag === HostRoot || nodeTag === HostPortal) {
                    var container = node.stateNode.containerInfo;
                    if (isMatchingRootContainer(container, targetContainerNode)) {
                      break;
                    }
                    if (nodeTag === HostPortal) {
                      var grandNode = node.return;
                      while (grandNode !== null) {
                        var grandTag = grandNode.tag;
                        if (grandTag === HostRoot || grandTag === HostPortal) {
                          var grandContainer = grandNode.stateNode.containerInfo;
                          if (isMatchingRootContainer(grandContainer, targetContainerNode)) {
                            return;
                          }
                        }
                        grandNode = grandNode.return;
                      }
                    }
                    while (container !== null) {
                      var parentNode = getClosestInstanceFromNode(container);
                      if (parentNode === null) {
                        return;
                      }
                      var parentTag = parentNode.tag;
                      if (parentTag === HostComponent || parentTag === HostText) {
                        node = ancestorInst = parentNode;
                        continue mainLoop;
                      }
                      container = container.parentNode;
                    }
                  }
                  node = node.return;
                }
              }
            }
            batchedUpdates(function() {
              return dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, ancestorInst);
            });
          }
          function createDispatchListener(instance, listener, currentTarget) {
            return {
              instance,
              listener,
              currentTarget
            };
          }
          function accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly, nativeEvent) {
            var captureName = reactName !== null ? reactName + "Capture" : null;
            var reactEventName = inCapturePhase ? captureName : reactName;
            var listeners = [];
            var instance = targetFiber;
            var lastHostComponent = null;
            while (instance !== null) {
              var _instance2 = instance, stateNode = _instance2.stateNode, tag = _instance2.tag;
              if (tag === HostComponent && stateNode !== null) {
                lastHostComponent = stateNode;
                if (reactEventName !== null) {
                  var listener = getListener(instance, reactEventName);
                  if (listener != null) {
                    listeners.push(createDispatchListener(instance, listener, lastHostComponent));
                  }
                }
              }
              if (accumulateTargetOnly) {
                break;
              }
              instance = instance.return;
            }
            return listeners;
          }
          function accumulateTwoPhaseListeners(targetFiber, reactName) {
            var captureName = reactName + "Capture";
            var listeners = [];
            var instance = targetFiber;
            while (instance !== null) {
              var _instance3 = instance, stateNode = _instance3.stateNode, tag = _instance3.tag;
              if (tag === HostComponent && stateNode !== null) {
                var currentTarget = stateNode;
                var captureListener = getListener(instance, captureName);
                if (captureListener != null) {
                  listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
                }
                var bubbleListener = getListener(instance, reactName);
                if (bubbleListener != null) {
                  listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
                }
              }
              instance = instance.return;
            }
            return listeners;
          }
          function getParent(inst) {
            if (inst === null) {
              return null;
            }
            do {
              inst = inst.return;
            } while (inst && inst.tag !== HostComponent);
            if (inst) {
              return inst;
            }
            return null;
          }
          function getLowestCommonAncestor(instA, instB) {
            var nodeA = instA;
            var nodeB = instB;
            var depthA = 0;
            for (var tempA = nodeA; tempA; tempA = getParent(tempA)) {
              depthA++;
            }
            var depthB = 0;
            for (var tempB = nodeB; tempB; tempB = getParent(tempB)) {
              depthB++;
            }
            while (depthA - depthB > 0) {
              nodeA = getParent(nodeA);
              depthA--;
            }
            while (depthB - depthA > 0) {
              nodeB = getParent(nodeB);
              depthB--;
            }
            var depth = depthA;
            while (depth--) {
              if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) {
                return nodeA;
              }
              nodeA = getParent(nodeA);
              nodeB = getParent(nodeB);
            }
            return null;
          }
          function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) {
            var registrationName = event._reactName;
            var listeners = [];
            var instance = target;
            while (instance !== null) {
              if (instance === common) {
                break;
              }
              var _instance4 = instance, alternate = _instance4.alternate, stateNode = _instance4.stateNode, tag = _instance4.tag;
              if (alternate !== null && alternate === common) {
                break;
              }
              if (tag === HostComponent && stateNode !== null) {
                var currentTarget = stateNode;
                if (inCapturePhase) {
                  var captureListener = getListener(instance, registrationName);
                  if (captureListener != null) {
                    listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
                  }
                } else if (!inCapturePhase) {
                  var bubbleListener = getListener(instance, registrationName);
                  if (bubbleListener != null) {
                    listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
                  }
                }
              }
              instance = instance.return;
            }
            if (listeners.length !== 0) {
              dispatchQueue.push({
                event,
                listeners
              });
            }
          }
          function accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leaveEvent, enterEvent, from, to) {
            var common = from && to ? getLowestCommonAncestor(from, to) : null;
            if (from !== null) {
              accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from, common, false);
            }
            if (to !== null && enterEvent !== null) {
              accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, true);
            }
          }
          function getListenerSetKey(domEventName, capture) {
            return domEventName + "__" + (capture ? "capture" : "bubble");
          }
          var didWarnInvalidHydration = false;
          var DANGEROUSLY_SET_INNER_HTML = "dangerouslySetInnerHTML";
          var SUPPRESS_CONTENT_EDITABLE_WARNING = "suppressContentEditableWarning";
          var SUPPRESS_HYDRATION_WARNING = "suppressHydrationWarning";
          var AUTOFOCUS = "autoFocus";
          var CHILDREN = "children";
          var STYLE = "style";
          var HTML$1 = "__html";
          var warnedUnknownTags;
          var validatePropertiesInDevelopment;
          var warnForPropDifference;
          var warnForExtraAttributes;
          var warnForInvalidEventListener;
          var canDiffStyleForHydrationWarning;
          var normalizeHTML;
          {
            warnedUnknownTags = {
              // There are working polyfills for <dialog>. Let people use it.
              dialog: true,
              // Electron ships a custom <webview> tag to display external web content in
              // an isolated frame and process.
              // This tag is not present in non Electron environments such as JSDom which
              // is often used for testing purposes.
              // @see https://electronjs.org/docs/api/webview-tag
              webview: true
            };
            validatePropertiesInDevelopment = function(type, props) {
              validateProperties(type, props);
              validateProperties$1(type, props);
              validateProperties$2(type, props, {
                registrationNameDependencies,
                possibleRegistrationNames
              });
            };
            canDiffStyleForHydrationWarning = canUseDOM3 && !document.documentMode;
            warnForPropDifference = function(propName, serverValue, clientValue) {
              if (didWarnInvalidHydration) {
                return;
              }
              var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
              var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);
              if (normalizedServerValue === normalizedClientValue) {
                return;
              }
              didWarnInvalidHydration = true;
              error("Prop `%s` did not match. Server: %s Client: %s", propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
            };
            warnForExtraAttributes = function(attributeNames) {
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              var names = [];
              attributeNames.forEach(function(name2) {
                names.push(name2);
              });
              error("Extra attributes from the server: %s", names);
            };
            warnForInvalidEventListener = function(registrationName, listener) {
              if (listener === false) {
                error("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.", registrationName, registrationName, registrationName);
              } else {
                error("Expected `%s` listener to be a function, instead got a value of `%s` type.", registrationName, typeof listener);
              }
            };
            normalizeHTML = function(parent2, html) {
              var testElement = parent2.namespaceURI === HTML_NAMESPACE ? parent2.ownerDocument.createElement(parent2.tagName) : parent2.ownerDocument.createElementNS(parent2.namespaceURI, parent2.tagName);
              testElement.innerHTML = html;
              return testElement.innerHTML;
            };
          }
          var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
          var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
          function normalizeMarkupForTextOrAttribute(markup) {
            {
              checkHtmlStringCoercion(markup);
            }
            var markupString = typeof markup === "string" ? markup : "" + markup;
            return markupString.replace(NORMALIZE_NEWLINES_REGEX, "\n").replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
          }
          function checkForUnmatchedText(serverText, clientText, isConcurrentMode, shouldWarnDev) {
            var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
            var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
            if (normalizedServerText === normalizedClientText) {
              return;
            }
            if (shouldWarnDev) {
              {
                if (!didWarnInvalidHydration) {
                  didWarnInvalidHydration = true;
                  error('Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
                }
              }
            }
            if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) {
              throw new Error("Text content does not match server-rendered HTML.");
            }
          }
          function getOwnerDocumentFromRootContainer(rootContainerElement) {
            return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
          }
          function noop2() {
          }
          function trapClickOnNonInteractiveElement(node) {
            node.onclick = noop2;
          }
          function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
            for (var propKey in nextProps) {
              if (!nextProps.hasOwnProperty(propKey)) {
                continue;
              }
              var nextProp = nextProps[propKey];
              if (propKey === STYLE) {
                {
                  if (nextProp) {
                    Object.freeze(nextProp);
                  }
                }
                setValueForStyles(domElement, nextProp);
              } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
                var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
                if (nextHtml != null) {
                  setInnerHTML(domElement, nextHtml);
                }
              } else if (propKey === CHILDREN) {
                if (typeof nextProp === "string") {
                  var canSetTextContent = tag !== "textarea" || nextProp !== "";
                  if (canSetTextContent) {
                    setTextContent(domElement, nextProp);
                  }
                } else if (typeof nextProp === "number") {
                  setTextContent(domElement, "" + nextProp);
                }
              } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ;
              else if (propKey === AUTOFOCUS) ;
              else if (registrationNameDependencies.hasOwnProperty(propKey)) {
                if (nextProp != null) {
                  if (typeof nextProp !== "function") {
                    warnForInvalidEventListener(propKey, nextProp);
                  }
                  if (propKey === "onScroll") {
                    listenToNonDelegatedEvent("scroll", domElement);
                  }
                }
              } else if (nextProp != null) {
                setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
              }
            }
          }
          function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
            for (var i = 0; i < updatePayload.length; i += 2) {
              var propKey = updatePayload[i];
              var propValue = updatePayload[i + 1];
              if (propKey === STYLE) {
                setValueForStyles(domElement, propValue);
              } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
                setInnerHTML(domElement, propValue);
              } else if (propKey === CHILDREN) {
                setTextContent(domElement, propValue);
              } else {
                setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
              }
            }
          }
          function createElement231(type, props, rootContainerElement, parentNamespace) {
            var isCustomComponentTag;
            var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
            var domElement;
            var namespaceURI = parentNamespace;
            if (namespaceURI === HTML_NAMESPACE) {
              namespaceURI = getIntrinsicNamespace(type);
            }
            if (namespaceURI === HTML_NAMESPACE) {
              {
                isCustomComponentTag = isCustomComponent(type, props);
                if (!isCustomComponentTag && type !== type.toLowerCase()) {
                  error("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", type);
                }
              }
              if (type === "script") {
                var div = ownerDocument.createElement("div");
                div.innerHTML = "<script><\/script>";
                var firstChild = div.firstChild;
                domElement = div.removeChild(firstChild);
              } else if (typeof props.is === "string") {
                domElement = ownerDocument.createElement(type, {
                  is: props.is
                });
              } else {
                domElement = ownerDocument.createElement(type);
                if (type === "select") {
                  var node = domElement;
                  if (props.multiple) {
                    node.multiple = true;
                  } else if (props.size) {
                    node.size = props.size;
                  }
                }
              }
            } else {
              domElement = ownerDocument.createElementNS(namespaceURI, type);
            }
            {
              if (namespaceURI === HTML_NAMESPACE) {
                if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === "[object HTMLUnknownElement]" && !hasOwnProperty.call(warnedUnknownTags, type)) {
                  warnedUnknownTags[type] = true;
                  error("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.", type);
                }
              }
            }
            return domElement;
          }
          function createTextNode(text, rootContainerElement) {
            return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
          }
          function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
            var isCustomComponentTag = isCustomComponent(tag, rawProps);
            {
              validatePropertiesInDevelopment(tag, rawProps);
            }
            var props;
            switch (tag) {
              case "dialog":
                listenToNonDelegatedEvent("cancel", domElement);
                listenToNonDelegatedEvent("close", domElement);
                props = rawProps;
                break;
              case "iframe":
              case "object":
              case "embed":
                listenToNonDelegatedEvent("load", domElement);
                props = rawProps;
                break;
              case "video":
              case "audio":
                for (var i = 0; i < mediaEventTypes.length; i++) {
                  listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
                }
                props = rawProps;
                break;
              case "source":
                listenToNonDelegatedEvent("error", domElement);
                props = rawProps;
                break;
              case "img":
              case "image":
              case "link":
                listenToNonDelegatedEvent("error", domElement);
                listenToNonDelegatedEvent("load", domElement);
                props = rawProps;
                break;
              case "details":
                listenToNonDelegatedEvent("toggle", domElement);
                props = rawProps;
                break;
              case "input":
                initWrapperState(domElement, rawProps);
                props = getHostProps(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              case "option":
                validateProps(domElement, rawProps);
                props = rawProps;
                break;
              case "select":
                initWrapperState$1(domElement, rawProps);
                props = getHostProps$1(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              case "textarea":
                initWrapperState$2(domElement, rawProps);
                props = getHostProps$2(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              default:
                props = rawProps;
            }
            assertValidProps(tag, props);
            setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);
            switch (tag) {
              case "input":
                track(domElement);
                postMountWrapper(domElement, rawProps, false);
                break;
              case "textarea":
                track(domElement);
                postMountWrapper$3(domElement);
                break;
              case "option":
                postMountWrapper$1(domElement, rawProps);
                break;
              case "select":
                postMountWrapper$2(domElement, rawProps);
                break;
              default:
                if (typeof props.onClick === "function") {
                  trapClickOnNonInteractiveElement(domElement);
                }
                break;
            }
          }
          function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
            {
              validatePropertiesInDevelopment(tag, nextRawProps);
            }
            var updatePayload = null;
            var lastProps;
            var nextProps;
            switch (tag) {
              case "input":
                lastProps = getHostProps(domElement, lastRawProps);
                nextProps = getHostProps(domElement, nextRawProps);
                updatePayload = [];
                break;
              case "select":
                lastProps = getHostProps$1(domElement, lastRawProps);
                nextProps = getHostProps$1(domElement, nextRawProps);
                updatePayload = [];
                break;
              case "textarea":
                lastProps = getHostProps$2(domElement, lastRawProps);
                nextProps = getHostProps$2(domElement, nextRawProps);
                updatePayload = [];
                break;
              default:
                lastProps = lastRawProps;
                nextProps = nextRawProps;
                if (typeof lastProps.onClick !== "function" && typeof nextProps.onClick === "function") {
                  trapClickOnNonInteractiveElement(domElement);
                }
                break;
            }
            assertValidProps(tag, nextProps);
            var propKey;
            var styleName;
            var styleUpdates = null;
            for (propKey in lastProps) {
              if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
                continue;
              }
              if (propKey === STYLE) {
                var lastStyle = lastProps[propKey];
                for (styleName in lastStyle) {
                  if (lastStyle.hasOwnProperty(styleName)) {
                    if (!styleUpdates) {
                      styleUpdates = {};
                    }
                    styleUpdates[styleName] = "";
                  }
                }
              } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) ;
              else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ;
              else if (propKey === AUTOFOCUS) ;
              else if (registrationNameDependencies.hasOwnProperty(propKey)) {
                if (!updatePayload) {
                  updatePayload = [];
                }
              } else {
                (updatePayload = updatePayload || []).push(propKey, null);
              }
            }
            for (propKey in nextProps) {
              var nextProp = nextProps[propKey];
              var lastProp = lastProps != null ? lastProps[propKey] : void 0;
              if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
                continue;
              }
              if (propKey === STYLE) {
                {
                  if (nextProp) {
                    Object.freeze(nextProp);
                  }
                }
                if (lastProp) {
                  for (styleName in lastProp) {
                    if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
                      if (!styleUpdates) {
                        styleUpdates = {};
                      }
                      styleUpdates[styleName] = "";
                    }
                  }
                  for (styleName in nextProp) {
                    if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
                      if (!styleUpdates) {
                        styleUpdates = {};
                      }
                      styleUpdates[styleName] = nextProp[styleName];
                    }
                  }
                } else {
                  if (!styleUpdates) {
                    if (!updatePayload) {
                      updatePayload = [];
                    }
                    updatePayload.push(propKey, styleUpdates);
                  }
                  styleUpdates = nextProp;
                }
              } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
                var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
                var lastHtml = lastProp ? lastProp[HTML$1] : void 0;
                if (nextHtml != null) {
                  if (lastHtml !== nextHtml) {
                    (updatePayload = updatePayload || []).push(propKey, nextHtml);
                  }
                }
              } else if (propKey === CHILDREN) {
                if (typeof nextProp === "string" || typeof nextProp === "number") {
                  (updatePayload = updatePayload || []).push(propKey, "" + nextProp);
                }
              } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ;
              else if (registrationNameDependencies.hasOwnProperty(propKey)) {
                if (nextProp != null) {
                  if (typeof nextProp !== "function") {
                    warnForInvalidEventListener(propKey, nextProp);
                  }
                  if (propKey === "onScroll") {
                    listenToNonDelegatedEvent("scroll", domElement);
                  }
                }
                if (!updatePayload && lastProp !== nextProp) {
                  updatePayload = [];
                }
              } else {
                (updatePayload = updatePayload || []).push(propKey, nextProp);
              }
            }
            if (styleUpdates) {
              {
                validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);
              }
              (updatePayload = updatePayload || []).push(STYLE, styleUpdates);
            }
            return updatePayload;
          }
          function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
            if (tag === "input" && nextRawProps.type === "radio" && nextRawProps.name != null) {
              updateChecked(domElement, nextRawProps);
            }
            var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
            var isCustomComponentTag = isCustomComponent(tag, nextRawProps);
            updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag);
            switch (tag) {
              case "input":
                updateWrapper(domElement, nextRawProps);
                break;
              case "textarea":
                updateWrapper$1(domElement, nextRawProps);
                break;
              case "select":
                postUpdateWrapper(domElement, nextRawProps);
                break;
            }
          }
          function getPossibleStandardName(propName) {
            {
              var lowerCasedName = propName.toLowerCase();
              if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
                return null;
              }
              return possibleStandardNames[lowerCasedName] || null;
            }
          }
          function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement, isConcurrentMode, shouldWarnDev) {
            var isCustomComponentTag;
            var extraAttributeNames;
            {
              isCustomComponentTag = isCustomComponent(tag, rawProps);
              validatePropertiesInDevelopment(tag, rawProps);
            }
            switch (tag) {
              case "dialog":
                listenToNonDelegatedEvent("cancel", domElement);
                listenToNonDelegatedEvent("close", domElement);
                break;
              case "iframe":
              case "object":
              case "embed":
                listenToNonDelegatedEvent("load", domElement);
                break;
              case "video":
              case "audio":
                for (var i = 0; i < mediaEventTypes.length; i++) {
                  listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
                }
                break;
              case "source":
                listenToNonDelegatedEvent("error", domElement);
                break;
              case "img":
              case "image":
              case "link":
                listenToNonDelegatedEvent("error", domElement);
                listenToNonDelegatedEvent("load", domElement);
                break;
              case "details":
                listenToNonDelegatedEvent("toggle", domElement);
                break;
              case "input":
                initWrapperState(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              case "option":
                validateProps(domElement, rawProps);
                break;
              case "select":
                initWrapperState$1(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
              case "textarea":
                initWrapperState$2(domElement, rawProps);
                listenToNonDelegatedEvent("invalid", domElement);
                break;
            }
            assertValidProps(tag, rawProps);
            {
              extraAttributeNames = /* @__PURE__ */ new Set();
              var attributes = domElement.attributes;
              for (var _i = 0; _i < attributes.length; _i++) {
                var name2 = attributes[_i].name.toLowerCase();
                switch (name2) {
                  // Controlled attributes are not validated
                  // TODO: Only ignore them on controlled tags.
                  case "value":
                    break;
                  case "checked":
                    break;
                  case "selected":
                    break;
                  default:
                    extraAttributeNames.add(attributes[_i].name);
                }
              }
            }
            var updatePayload = null;
            for (var propKey in rawProps) {
              if (!rawProps.hasOwnProperty(propKey)) {
                continue;
              }
              var nextProp = rawProps[propKey];
              if (propKey === CHILDREN) {
                if (typeof nextProp === "string") {
                  if (domElement.textContent !== nextProp) {
                    if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) {
                      checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev);
                    }
                    updatePayload = [CHILDREN, nextProp];
                  }
                } else if (typeof nextProp === "number") {
                  if (domElement.textContent !== "" + nextProp) {
                    if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) {
                      checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev);
                    }
                    updatePayload = [CHILDREN, "" + nextProp];
                  }
                }
              } else if (registrationNameDependencies.hasOwnProperty(propKey)) {
                if (nextProp != null) {
                  if (typeof nextProp !== "function") {
                    warnForInvalidEventListener(propKey, nextProp);
                  }
                  if (propKey === "onScroll") {
                    listenToNonDelegatedEvent("scroll", domElement);
                  }
                }
              } else if (shouldWarnDev && true && // Convince Flow we've calculated it (it's DEV-only in this method.)
              typeof isCustomComponentTag === "boolean") {
                var serverValue = void 0;
                var propertyInfo = isCustomComponentTag && enableCustomElementPropertySupport ? null : getPropertyInfo(propKey);
                if (rawProps[SUPPRESS_HYDRATION_WARNING] === true) ;
                else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || // Controlled attributes are not validated
                // TODO: Only ignore them on controlled tags.
                propKey === "value" || propKey === "checked" || propKey === "selected") ;
                else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
                  var serverHTML = domElement.innerHTML;
                  var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
                  if (nextHtml != null) {
                    var expectedHTML = normalizeHTML(domElement, nextHtml);
                    if (expectedHTML !== serverHTML) {
                      warnForPropDifference(propKey, serverHTML, expectedHTML);
                    }
                  }
                } else if (propKey === STYLE) {
                  extraAttributeNames.delete(propKey);
                  if (canDiffStyleForHydrationWarning) {
                    var expectedStyle = createDangerousStringForStyles(nextProp);
                    serverValue = domElement.getAttribute("style");
                    if (expectedStyle !== serverValue) {
                      warnForPropDifference(propKey, serverValue, expectedStyle);
                    }
                  }
                } else if (isCustomComponentTag && !enableCustomElementPropertySupport) {
                  extraAttributeNames.delete(propKey.toLowerCase());
                  serverValue = getValueForAttribute(domElement, propKey, nextProp);
                  if (nextProp !== serverValue) {
                    warnForPropDifference(propKey, serverValue, nextProp);
                  }
                } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
                  var isMismatchDueToBadCasing = false;
                  if (propertyInfo !== null) {
                    extraAttributeNames.delete(propertyInfo.attributeName);
                    serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
                  } else {
                    var ownNamespace = parentNamespace;
                    if (ownNamespace === HTML_NAMESPACE) {
                      ownNamespace = getIntrinsicNamespace(tag);
                    }
                    if (ownNamespace === HTML_NAMESPACE) {
                      extraAttributeNames.delete(propKey.toLowerCase());
                    } else {
                      var standardName = getPossibleStandardName(propKey);
                      if (standardName !== null && standardName !== propKey) {
                        isMismatchDueToBadCasing = true;
                        extraAttributeNames.delete(standardName);
                      }
                      extraAttributeNames.delete(propKey);
                    }
                    serverValue = getValueForAttribute(domElement, propKey, nextProp);
                  }
                  var dontWarnCustomElement = enableCustomElementPropertySupport;
                  if (!dontWarnCustomElement && nextProp !== serverValue && !isMismatchDueToBadCasing) {
                    warnForPropDifference(propKey, serverValue, nextProp);
                  }
                }
              }
            }
            {
              if (shouldWarnDev) {
                if (
                  // $FlowFixMe - Should be inferred as not undefined.
                  extraAttributeNames.size > 0 && rawProps[SUPPRESS_HYDRATION_WARNING] !== true
                ) {
                  warnForExtraAttributes(extraAttributeNames);
                }
              }
            }
            switch (tag) {
              case "input":
                track(domElement);
                postMountWrapper(domElement, rawProps, true);
                break;
              case "textarea":
                track(domElement);
                postMountWrapper$3(domElement);
                break;
              case "select":
              case "option":
                break;
              default:
                if (typeof rawProps.onClick === "function") {
                  trapClickOnNonInteractiveElement(domElement);
                }
                break;
            }
            return updatePayload;
          }
          function diffHydratedText(textNode, text, isConcurrentMode) {
            var isDifferent = textNode.nodeValue !== text;
            return isDifferent;
          }
          function warnForDeletedHydratableElement(parentNode, child) {
            {
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              error("Did not expect server HTML to contain a <%s> in <%s>.", child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
            }
          }
          function warnForDeletedHydratableText(parentNode, child) {
            {
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              error('Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
            }
          }
          function warnForInsertedHydratedElement(parentNode, tag, props) {
            {
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              error("Expected server HTML to contain a matching <%s> in <%s>.", tag, parentNode.nodeName.toLowerCase());
            }
          }
          function warnForInsertedHydratedText(parentNode, text) {
            {
              if (text === "") {
                return;
              }
              if (didWarnInvalidHydration) {
                return;
              }
              didWarnInvalidHydration = true;
              error('Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
            }
          }
          function restoreControlledState$3(domElement, tag, props) {
            switch (tag) {
              case "input":
                restoreControlledState(domElement, props);
                return;
              case "textarea":
                restoreControlledState$2(domElement, props);
                return;
              case "select":
                restoreControlledState$1(domElement, props);
                return;
            }
          }
          var validateDOMNesting = function() {
          };
          var updatedAncestorInfo = function() {
          };
          {
            var specialTags = ["address", "applet", "area", "article", "aside", "base", "basefont", "bgsound", "blockquote", "body", "br", "button", "caption", "center", "col", "colgroup", "dd", "details", "dir", "div", "dl", "dt", "embed", "fieldset", "figcaption", "figure", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "iframe", "img", "input", "isindex", "li", "link", "listing", "main", "marquee", "menu", "menuitem", "meta", "nav", "noembed", "noframes", "noscript", "object", "ol", "p", "param", "plaintext", "pre", "script", "section", "select", "source", "style", "summary", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "title", "tr", "track", "ul", "wbr", "xmp"];
            var inScopeTags = [
              "applet",
              "caption",
              "html",
              "table",
              "td",
              "th",
              "marquee",
              "object",
              "template",
              // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
              // TODO: Distinguish by namespace here -- for <title>, including it here
              // errs on the side of fewer warnings
              "foreignObject",
              "desc",
              "title"
            ];
            var buttonScopeTags = inScopeTags.concat(["button"]);
            var impliedEndTags = ["dd", "dt", "li", "option", "optgroup", "p", "rp", "rt"];
            var emptyAncestorInfo = {
              current: null,
              formTag: null,
              aTagInScope: null,
              buttonTagInScope: null,
              nobrTagInScope: null,
              pTagInButtonScope: null,
              listItemTagAutoclosing: null,
              dlItemTagAutoclosing: null
            };
            updatedAncestorInfo = function(oldInfo, tag) {
              var ancestorInfo = assign({}, oldInfo || emptyAncestorInfo);
              var info2 = {
                tag
              };
              if (inScopeTags.indexOf(tag) !== -1) {
                ancestorInfo.aTagInScope = null;
                ancestorInfo.buttonTagInScope = null;
                ancestorInfo.nobrTagInScope = null;
              }
              if (buttonScopeTags.indexOf(tag) !== -1) {
                ancestorInfo.pTagInButtonScope = null;
              }
              if (specialTags.indexOf(tag) !== -1 && tag !== "address" && tag !== "div" && tag !== "p") {
                ancestorInfo.listItemTagAutoclosing = null;
                ancestorInfo.dlItemTagAutoclosing = null;
              }
              ancestorInfo.current = info2;
              if (tag === "form") {
                ancestorInfo.formTag = info2;
              }
              if (tag === "a") {
                ancestorInfo.aTagInScope = info2;
              }
              if (tag === "button") {
                ancestorInfo.buttonTagInScope = info2;
              }
              if (tag === "nobr") {
                ancestorInfo.nobrTagInScope = info2;
              }
              if (tag === "p") {
                ancestorInfo.pTagInButtonScope = info2;
              }
              if (tag === "li") {
                ancestorInfo.listItemTagAutoclosing = info2;
              }
              if (tag === "dd" || tag === "dt") {
                ancestorInfo.dlItemTagAutoclosing = info2;
              }
              return ancestorInfo;
            };
            var isTagValidWithParent = function(tag, parentTag) {
              switch (parentTag) {
                // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
                case "select":
                  return tag === "option" || tag === "optgroup" || tag === "#text";
                case "optgroup":
                  return tag === "option" || tag === "#text";
                // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
                // but
                case "option":
                  return tag === "#text";
                // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
                // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
                // No special behavior since these rules fall back to "in body" mode for
                // all except special table nodes which cause bad parsing behavior anyway.
                // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
                case "tr":
                  return tag === "th" || tag === "td" || tag === "style" || tag === "script" || tag === "template";
                // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
                case "tbody":
                case "thead":
                case "tfoot":
                  return tag === "tr" || tag === "style" || tag === "script" || tag === "template";
                // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
                case "colgroup":
                  return tag === "col" || tag === "template";
                // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
                case "table":
                  return tag === "caption" || tag === "colgroup" || tag === "tbody" || tag === "tfoot" || tag === "thead" || tag === "style" || tag === "script" || tag === "template";
                // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
                case "head":
                  return tag === "base" || tag === "basefont" || tag === "bgsound" || tag === "link" || tag === "meta" || tag === "title" || tag === "noscript" || tag === "noframes" || tag === "style" || tag === "script" || tag === "template";
                // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
                case "html":
                  return tag === "head" || tag === "body" || tag === "frameset";
                case "frameset":
                  return tag === "frame";
                case "#document":
                  return tag === "html";
              }
              switch (tag) {
                case "h1":
                case "h2":
                case "h3":
                case "h4":
                case "h5":
                case "h6":
                  return parentTag !== "h1" && parentTag !== "h2" && parentTag !== "h3" && parentTag !== "h4" && parentTag !== "h5" && parentTag !== "h6";
                case "rp":
                case "rt":
                  return impliedEndTags.indexOf(parentTag) === -1;
                case "body":
                case "caption":
                case "col":
                case "colgroup":
                case "frameset":
                case "frame":
                case "head":
                case "html":
                case "tbody":
                case "td":
                case "tfoot":
                case "th":
                case "thead":
                case "tr":
                  return parentTag == null;
              }
              return true;
            };
            var findInvalidAncestorForTag = function(tag, ancestorInfo) {
              switch (tag) {
                case "address":
                case "article":
                case "aside":
                case "blockquote":
                case "center":
                case "details":
                case "dialog":
                case "dir":
                case "div":
                case "dl":
                case "fieldset":
                case "figcaption":
                case "figure":
                case "footer":
                case "header":
                case "hgroup":
                case "main":
                case "menu":
                case "nav":
                case "ol":
                case "p":
                case "section":
                case "summary":
                case "ul":
                case "pre":
                case "listing":
                case "table":
                case "hr":
                case "xmp":
                case "h1":
                case "h2":
                case "h3":
                case "h4":
                case "h5":
                case "h6":
                  return ancestorInfo.pTagInButtonScope;
                case "form":
                  return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
                case "li":
                  return ancestorInfo.listItemTagAutoclosing;
                case "dd":
                case "dt":
                  return ancestorInfo.dlItemTagAutoclosing;
                case "button":
                  return ancestorInfo.buttonTagInScope;
                case "a":
                  return ancestorInfo.aTagInScope;
                case "nobr":
                  return ancestorInfo.nobrTagInScope;
              }
              return null;
            };
            var didWarn$1 = {};
            validateDOMNesting = function(childTag, childText, ancestorInfo) {
              ancestorInfo = ancestorInfo || emptyAncestorInfo;
              var parentInfo = ancestorInfo.current;
              var parentTag = parentInfo && parentInfo.tag;
              if (childText != null) {
                if (childTag != null) {
                  error("validateDOMNesting: when childText is passed, childTag should be null");
                }
                childTag = "#text";
              }
              var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
              var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
              var invalidParentOrAncestor = invalidParent || invalidAncestor;
              if (!invalidParentOrAncestor) {
                return;
              }
              var ancestorTag = invalidParentOrAncestor.tag;
              var warnKey = !!invalidParent + "|" + childTag + "|" + ancestorTag;
              if (didWarn$1[warnKey]) {
                return;
              }
              didWarn$1[warnKey] = true;
              var tagDisplayName = childTag;
              var whitespaceInfo = "";
              if (childTag === "#text") {
                if (/\S/.test(childText)) {
                  tagDisplayName = "Text nodes";
                } else {
                  tagDisplayName = "Whitespace text nodes";
                  whitespaceInfo = " Make sure you don't have any extra whitespace between tags on each line of your source code.";
                }
              } else {
                tagDisplayName = "<" + childTag + ">";
              }
              if (invalidParent) {
                var info2 = "";
                if (ancestorTag === "table" && childTag === "tr") {
                  info2 += " Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser.";
                }
                error("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s", tagDisplayName, ancestorTag, whitespaceInfo, info2);
              } else {
                error("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.", tagDisplayName, ancestorTag);
              }
            };
          }
          var SUPPRESS_HYDRATION_WARNING$1 = "suppressHydrationWarning";
          var SUSPENSE_START_DATA = "$";
          var SUSPENSE_END_DATA = "/$";
          var SUSPENSE_PENDING_START_DATA = "$?";
          var SUSPENSE_FALLBACK_START_DATA = "$!";
          var STYLE$1 = "style";
          var eventsEnabled = null;
          var selectionInformation = null;
          function getRootHostContext(rootContainerInstance) {
            var type;
            var namespace;
            var nodeType = rootContainerInstance.nodeType;
            switch (nodeType) {
              case DOCUMENT_NODE:
              case DOCUMENT_FRAGMENT_NODE: {
                type = nodeType === DOCUMENT_NODE ? "#document" : "#fragment";
                var root2 = rootContainerInstance.documentElement;
                namespace = root2 ? root2.namespaceURI : getChildNamespace(null, "");
                break;
              }
              default: {
                var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
                var ownNamespace = container.namespaceURI || null;
                type = container.tagName;
                namespace = getChildNamespace(ownNamespace, type);
                break;
              }
            }
            {
              var validatedTag = type.toLowerCase();
              var ancestorInfo = updatedAncestorInfo(null, validatedTag);
              return {
                namespace,
                ancestorInfo
              };
            }
          }
          function getChildHostContext(parentHostContext, type, rootContainerInstance) {
            {
              var parentHostContextDev = parentHostContext;
              var namespace = getChildNamespace(parentHostContextDev.namespace, type);
              var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
              return {
                namespace,
                ancestorInfo
              };
            }
          }
          function getPublicInstance(instance) {
            return instance;
          }
          function prepareForCommit(containerInfo) {
            eventsEnabled = isEnabled();
            selectionInformation = getSelectionInformation();
            var activeInstance = null;
            setEnabled(false);
            return activeInstance;
          }
          function resetAfterCommit(containerInfo) {
            restoreSelection(selectionInformation);
            setEnabled(eventsEnabled);
            eventsEnabled = null;
            selectionInformation = null;
          }
          function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
            var parentNamespace;
            {
              var hostContextDev = hostContext;
              validateDOMNesting(type, null, hostContextDev.ancestorInfo);
              if (typeof props.children === "string" || typeof props.children === "number") {
                var string = "" + props.children;
                var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
                validateDOMNesting(null, string, ownAncestorInfo);
              }
              parentNamespace = hostContextDev.namespace;
            }
            var domElement = createElement231(type, props, rootContainerInstance, parentNamespace);
            precacheFiberNode(internalInstanceHandle, domElement);
            updateFiberProps(domElement, props);
            return domElement;
          }
          function appendInitialChild(parentInstance, child) {
            parentInstance.appendChild(child);
          }
          function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
            setInitialProperties(domElement, type, props, rootContainerInstance);
            switch (type) {
              case "button":
              case "input":
              case "select":
              case "textarea":
                return !!props.autoFocus;
              case "img":
                return true;
              default:
                return false;
            }
          }
          function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
            {
              var hostContextDev = hostContext;
              if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === "string" || typeof newProps.children === "number")) {
                var string = "" + newProps.children;
                var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
                validateDOMNesting(null, string, ownAncestorInfo);
              }
            }
            return diffProperties(domElement, type, oldProps, newProps);
          }
          function shouldSetTextContent(type, props) {
            return type === "textarea" || type === "noscript" || typeof props.children === "string" || typeof props.children === "number" || typeof props.dangerouslySetInnerHTML === "object" && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
          }
          function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
            {
              var hostContextDev = hostContext;
              validateDOMNesting(null, text, hostContextDev.ancestorInfo);
            }
            var textNode = createTextNode(text, rootContainerInstance);
            precacheFiberNode(internalInstanceHandle, textNode);
            return textNode;
          }
          function getCurrentEventPriority() {
            var currentEvent = window.event;
            if (currentEvent === void 0) {
              return DefaultEventPriority;
            }
            return getEventPriority(currentEvent.type);
          }
          var scheduleTimeout = typeof setTimeout === "function" ? setTimeout : void 0;
          var cancelTimeout2 = typeof clearTimeout === "function" ? clearTimeout : void 0;
          var noTimeout = -1;
          var localPromise = typeof Promise === "function" ? Promise : void 0;
          var scheduleMicrotask = typeof queueMicrotask === "function" ? queueMicrotask : typeof localPromise !== "undefined" ? function(callback) {
            return localPromise.resolve(null).then(callback).catch(handleErrorInNextTick);
          } : scheduleTimeout;
          function handleErrorInNextTick(error2) {
            setTimeout(function() {
              throw error2;
            });
          }
          function commitMount(domElement, type, newProps, internalInstanceHandle) {
            switch (type) {
              case "button":
              case "input":
              case "select":
              case "textarea":
                if (newProps.autoFocus) {
                  domElement.focus();
                }
                return;
              case "img": {
                if (newProps.src) {
                  domElement.src = newProps.src;
                }
                return;
              }
            }
          }
          function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
            updateProperties(domElement, updatePayload, type, oldProps, newProps);
            updateFiberProps(domElement, newProps);
          }
          function resetTextContent(domElement) {
            setTextContent(domElement, "");
          }
          function commitTextUpdate(textInstance, oldText, newText) {
            textInstance.nodeValue = newText;
          }
          function appendChild(parentInstance, child) {
            parentInstance.appendChild(child);
          }
          function appendChildToContainer(container, child) {
            var parentNode;
            if (container.nodeType === COMMENT_NODE) {
              parentNode = container.parentNode;
              parentNode.insertBefore(child, container);
            } else {
              parentNode = container;
              parentNode.appendChild(child);
            }
            var reactRootContainer = container._reactRootContainer;
            if ((reactRootContainer === null || reactRootContainer === void 0) && parentNode.onclick === null) {
              trapClickOnNonInteractiveElement(parentNode);
            }
          }
          function insertBefore(parentInstance, child, beforeChild) {
            parentInstance.insertBefore(child, beforeChild);
          }
          function insertInContainerBefore(container, child, beforeChild) {
            if (container.nodeType === COMMENT_NODE) {
              container.parentNode.insertBefore(child, beforeChild);
            } else {
              container.insertBefore(child, beforeChild);
            }
          }
          function removeChild(parentInstance, child) {
            parentInstance.removeChild(child);
          }
          function removeChildFromContainer(container, child) {
            if (container.nodeType === COMMENT_NODE) {
              container.parentNode.removeChild(child);
            } else {
              container.removeChild(child);
            }
          }
          function clearSuspenseBoundary(parentInstance, suspenseInstance) {
            var node = suspenseInstance;
            var depth = 0;
            do {
              var nextNode = node.nextSibling;
              parentInstance.removeChild(node);
              if (nextNode && nextNode.nodeType === COMMENT_NODE) {
                var data = nextNode.data;
                if (data === SUSPENSE_END_DATA) {
                  if (depth === 0) {
                    parentInstance.removeChild(nextNode);
                    retryIfBlockedOn(suspenseInstance);
                    return;
                  } else {
                    depth--;
                  }
                } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_PENDING_START_DATA || data === SUSPENSE_FALLBACK_START_DATA) {
                  depth++;
                }
              }
              node = nextNode;
            } while (node);
            retryIfBlockedOn(suspenseInstance);
          }
          function clearSuspenseBoundaryFromContainer(container, suspenseInstance) {
            if (container.nodeType === COMMENT_NODE) {
              clearSuspenseBoundary(container.parentNode, suspenseInstance);
            } else if (container.nodeType === ELEMENT_NODE) {
              clearSuspenseBoundary(container, suspenseInstance);
            }
            retryIfBlockedOn(container);
          }
          function hideInstance(instance) {
            instance = instance;
            var style2 = instance.style;
            if (typeof style2.setProperty === "function") {
              style2.setProperty("display", "none", "important");
            } else {
              style2.display = "none";
            }
          }
          function hideTextInstance(textInstance) {
            textInstance.nodeValue = "";
          }
          function unhideInstance(instance, props) {
            instance = instance;
            var styleProp = props[STYLE$1];
            var display = styleProp !== void 0 && styleProp !== null && styleProp.hasOwnProperty("display") ? styleProp.display : null;
            instance.style.display = dangerousStyleValue("display", display);
          }
          function unhideTextInstance(textInstance, text) {
            textInstance.nodeValue = text;
          }
          function clearContainer(container) {
            if (container.nodeType === ELEMENT_NODE) {
              container.textContent = "";
            } else if (container.nodeType === DOCUMENT_NODE) {
              if (container.documentElement) {
                container.removeChild(container.documentElement);
              }
            }
          }
          function canHydrateInstance(instance, type, props) {
            if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
              return null;
            }
            return instance;
          }
          function canHydrateTextInstance(instance, text) {
            if (text === "" || instance.nodeType !== TEXT_NODE) {
              return null;
            }
            return instance;
          }
          function canHydrateSuspenseInstance(instance) {
            if (instance.nodeType !== COMMENT_NODE) {
              return null;
            }
            return instance;
          }
          function isSuspenseInstancePending(instance) {
            return instance.data === SUSPENSE_PENDING_START_DATA;
          }
          function isSuspenseInstanceFallback(instance) {
            return instance.data === SUSPENSE_FALLBACK_START_DATA;
          }
          function getSuspenseInstanceFallbackErrorDetails(instance) {
            var dataset = instance.nextSibling && instance.nextSibling.dataset;
            var digest, message, stack;
            if (dataset) {
              digest = dataset.dgst;
              {
                message = dataset.msg;
                stack = dataset.stck;
              }
            }
            {
              return {
                message,
                digest,
                stack
              };
            }
          }
          function registerSuspenseInstanceRetry(instance, callback) {
            instance._reactRetry = callback;
          }
          function getNextHydratable(node) {
            for (; node != null; node = node.nextSibling) {
              var nodeType = node.nodeType;
              if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
                break;
              }
              if (nodeType === COMMENT_NODE) {
                var nodeData = node.data;
                if (nodeData === SUSPENSE_START_DATA || nodeData === SUSPENSE_FALLBACK_START_DATA || nodeData === SUSPENSE_PENDING_START_DATA) {
                  break;
                }
                if (nodeData === SUSPENSE_END_DATA) {
                  return null;
                }
              }
            }
            return node;
          }
          function getNextHydratableSibling(instance) {
            return getNextHydratable(instance.nextSibling);
          }
          function getFirstHydratableChild(parentInstance) {
            return getNextHydratable(parentInstance.firstChild);
          }
          function getFirstHydratableChildWithinContainer(parentContainer) {
            return getNextHydratable(parentContainer.firstChild);
          }
          function getFirstHydratableChildWithinSuspenseInstance(parentInstance) {
            return getNextHydratable(parentInstance.nextSibling);
          }
          function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle, shouldWarnDev) {
            precacheFiberNode(internalInstanceHandle, instance);
            updateFiberProps(instance, props);
            var parentNamespace;
            {
              var hostContextDev = hostContext;
              parentNamespace = hostContextDev.namespace;
            }
            var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
            return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance, isConcurrentMode, shouldWarnDev);
          }
          function hydrateTextInstance(textInstance, text, internalInstanceHandle, shouldWarnDev) {
            precacheFiberNode(internalInstanceHandle, textInstance);
            var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
            return diffHydratedText(textInstance, text);
          }
          function hydrateSuspenseInstance(suspenseInstance, internalInstanceHandle) {
            precacheFiberNode(internalInstanceHandle, suspenseInstance);
          }
          function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
            var node = suspenseInstance.nextSibling;
            var depth = 0;
            while (node) {
              if (node.nodeType === COMMENT_NODE) {
                var data = node.data;
                if (data === SUSPENSE_END_DATA) {
                  if (depth === 0) {
                    return getNextHydratableSibling(node);
                  } else {
                    depth--;
                  }
                } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
                  depth++;
                }
              }
              node = node.nextSibling;
            }
            return null;
          }
          function getParentSuspenseInstance(targetInstance) {
            var node = targetInstance.previousSibling;
            var depth = 0;
            while (node) {
              if (node.nodeType === COMMENT_NODE) {
                var data = node.data;
                if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
                  if (depth === 0) {
                    return node;
                  } else {
                    depth--;
                  }
                } else if (data === SUSPENSE_END_DATA) {
                  depth++;
                }
              }
              node = node.previousSibling;
            }
            return null;
          }
          function commitHydratedContainer(container) {
            retryIfBlockedOn(container);
          }
          function commitHydratedSuspenseInstance(suspenseInstance) {
            retryIfBlockedOn(suspenseInstance);
          }
          function shouldDeleteUnhydratedTailInstances(parentType) {
            return parentType !== "head" && parentType !== "body";
          }
          function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text, isConcurrentMode) {
            var shouldWarnDev = true;
            checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, shouldWarnDev);
          }
          function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text, isConcurrentMode) {
            if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
              var shouldWarnDev = true;
              checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, shouldWarnDev);
            }
          }
          function didNotHydrateInstanceWithinContainer(parentContainer, instance) {
            {
              if (instance.nodeType === ELEMENT_NODE) {
                warnForDeletedHydratableElement(parentContainer, instance);
              } else if (instance.nodeType === COMMENT_NODE) ;
              else {
                warnForDeletedHydratableText(parentContainer, instance);
              }
            }
          }
          function didNotHydrateInstanceWithinSuspenseInstance(parentInstance, instance) {
            {
              var parentNode = parentInstance.parentNode;
              if (parentNode !== null) {
                if (instance.nodeType === ELEMENT_NODE) {
                  warnForDeletedHydratableElement(parentNode, instance);
                } else if (instance.nodeType === COMMENT_NODE) ;
                else {
                  warnForDeletedHydratableText(parentNode, instance);
                }
              }
            }
          }
          function didNotHydrateInstance(parentType, parentProps, parentInstance, instance, isConcurrentMode) {
            {
              if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
                if (instance.nodeType === ELEMENT_NODE) {
                  warnForDeletedHydratableElement(parentInstance, instance);
                } else if (instance.nodeType === COMMENT_NODE) ;
                else {
                  warnForDeletedHydratableText(parentInstance, instance);
                }
              }
            }
          }
          function didNotFindHydratableInstanceWithinContainer(parentContainer, type, props) {
            {
              warnForInsertedHydratedElement(parentContainer, type);
            }
          }
          function didNotFindHydratableTextInstanceWithinContainer(parentContainer, text) {
            {
              warnForInsertedHydratedText(parentContainer, text);
            }
          }
          function didNotFindHydratableInstanceWithinSuspenseInstance(parentInstance, type, props) {
            {
              var parentNode = parentInstance.parentNode;
              if (parentNode !== null) warnForInsertedHydratedElement(parentNode, type);
            }
          }
          function didNotFindHydratableTextInstanceWithinSuspenseInstance(parentInstance, text) {
            {
              var parentNode = parentInstance.parentNode;
              if (parentNode !== null) warnForInsertedHydratedText(parentNode, text);
            }
          }
          function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props, isConcurrentMode) {
            {
              if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
                warnForInsertedHydratedElement(parentInstance, type);
              }
            }
          }
          function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text, isConcurrentMode) {
            {
              if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
                warnForInsertedHydratedText(parentInstance, text);
              }
            }
          }
          function errorHydratingContainer(parentContainer) {
            {
              error("An error occurred during hydration. The server HTML was replaced with client content in <%s>.", parentContainer.nodeName.toLowerCase());
            }
          }
          function preparePortalMount(portalInstance) {
            listenToAllSupportedEvents(portalInstance);
          }
          var randomKey = Math.random().toString(36).slice(2);
          var internalInstanceKey = "__reactFiber$" + randomKey;
          var internalPropsKey = "__reactProps$" + randomKey;
          var internalContainerInstanceKey = "__reactContainer$" + randomKey;
          var internalEventHandlersKey = "__reactEvents$" + randomKey;
          var internalEventHandlerListenersKey = "__reactListeners$" + randomKey;
          var internalEventHandlesSetKey = "__reactHandles$" + randomKey;
          function detachDeletedInstance(node) {
            delete node[internalInstanceKey];
            delete node[internalPropsKey];
            delete node[internalEventHandlersKey];
            delete node[internalEventHandlerListenersKey];
            delete node[internalEventHandlesSetKey];
          }
          function precacheFiberNode(hostInst, node) {
            node[internalInstanceKey] = hostInst;
          }
          function markContainerAsRoot(hostRoot, node) {
            node[internalContainerInstanceKey] = hostRoot;
          }
          function unmarkContainerAsRoot(node) {
            node[internalContainerInstanceKey] = null;
          }
          function isContainerMarkedAsRoot(node) {
            return !!node[internalContainerInstanceKey];
          }
          function getClosestInstanceFromNode(targetNode) {
            var targetInst = targetNode[internalInstanceKey];
            if (targetInst) {
              return targetInst;
            }
            var parentNode = targetNode.parentNode;
            while (parentNode) {
              targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];
              if (targetInst) {
                var alternate = targetInst.alternate;
                if (targetInst.child !== null || alternate !== null && alternate.child !== null) {
                  var suspenseInstance = getParentSuspenseInstance(targetNode);
                  while (suspenseInstance !== null) {
                    var targetSuspenseInst = suspenseInstance[internalInstanceKey];
                    if (targetSuspenseInst) {
                      return targetSuspenseInst;
                    }
                    suspenseInstance = getParentSuspenseInstance(suspenseInstance);
                  }
                }
                return targetInst;
              }
              targetNode = parentNode;
              parentNode = targetNode.parentNode;
            }
            return null;
          }
          function getInstanceFromNode(node) {
            var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];
            if (inst) {
              if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {
                return inst;
              } else {
                return null;
              }
            }
            return null;
          }
          function getNodeFromInstance(inst) {
            if (inst.tag === HostComponent || inst.tag === HostText) {
              return inst.stateNode;
            }
            throw new Error("getNodeFromInstance: Invalid argument.");
          }
          function getFiberCurrentPropsFromNode(node) {
            return node[internalPropsKey] || null;
          }
          function updateFiberProps(node, props) {
            node[internalPropsKey] = props;
          }
          function getEventListenerSet(node) {
            var elementListenerSet = node[internalEventHandlersKey];
            if (elementListenerSet === void 0) {
              elementListenerSet = node[internalEventHandlersKey] = /* @__PURE__ */ new Set();
            }
            return elementListenerSet;
          }
          var loggedTypeFailures = {};
          var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
          function setCurrentlyValidatingElement(element) {
            {
              if (element) {
                var owner = element._owner;
                var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
                ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
              } else {
                ReactDebugCurrentFrame$1.setExtraStackFrame(null);
              }
            }
          }
          function checkPropTypes(typeSpecs, values, location, componentName, element) {
            {
              var has2 = Function.call.bind(hasOwnProperty);
              for (var typeSpecName in typeSpecs) {
                if (has2(typeSpecs, typeSpecName)) {
                  var error$1 = void 0;
                  try {
                    if (typeof typeSpecs[typeSpecName] !== "function") {
                      var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                      err.name = "Invariant Violation";
                      throw err;
                    }
                    error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
                  } catch (ex) {
                    error$1 = ex;
                  }
                  if (error$1 && !(error$1 instanceof Error)) {
                    setCurrentlyValidatingElement(element);
                    error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
                    setCurrentlyValidatingElement(null);
                  }
                  if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
                    loggedTypeFailures[error$1.message] = true;
                    setCurrentlyValidatingElement(element);
                    error("Failed %s type: %s", location, error$1.message);
                    setCurrentlyValidatingElement(null);
                  }
                }
              }
            }
          }
          var valueStack = [];
          var fiberStack;
          {
            fiberStack = [];
          }
          var index = -1;
          function createCursor(defaultValue) {
            return {
              current: defaultValue
            };
          }
          function pop(cursor, fiber) {
            if (index < 0) {
              {
                error("Unexpected pop.");
              }
              return;
            }
            {
              if (fiber !== fiberStack[index]) {
                error("Unexpected Fiber popped.");
              }
            }
            cursor.current = valueStack[index];
            valueStack[index] = null;
            {
              fiberStack[index] = null;
            }
            index--;
          }
          function push(cursor, value, fiber) {
            index++;
            valueStack[index] = cursor.current;
            {
              fiberStack[index] = fiber;
            }
            cursor.current = value;
          }
          var warnedAboutMissingGetChildContext;
          {
            warnedAboutMissingGetChildContext = {};
          }
          var emptyContextObject = {};
          {
            Object.freeze(emptyContextObject);
          }
          var contextStackCursor = createCursor(emptyContextObject);
          var didPerformWorkStackCursor = createCursor(false);
          var previousContext = emptyContextObject;
          function getUnmaskedContext(workInProgress2, Component40, didPushOwnContextIfProvider) {
            {
              if (didPushOwnContextIfProvider && isContextProvider(Component40)) {
                return previousContext;
              }
              return contextStackCursor.current;
            }
          }
          function cacheContext(workInProgress2, unmaskedContext, maskedContext) {
            {
              var instance = workInProgress2.stateNode;
              instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
              instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
            }
          }
          function getMaskedContext(workInProgress2, unmaskedContext) {
            {
              var type = workInProgress2.type;
              var contextTypes = type.contextTypes;
              if (!contextTypes) {
                return emptyContextObject;
              }
              var instance = workInProgress2.stateNode;
              if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
                return instance.__reactInternalMemoizedMaskedChildContext;
              }
              var context = {};
              for (var key in contextTypes) {
                context[key] = unmaskedContext[key];
              }
              {
                var name2 = getComponentNameFromFiber(workInProgress2) || "Unknown";
                checkPropTypes(contextTypes, context, "context", name2);
              }
              if (instance) {
                cacheContext(workInProgress2, unmaskedContext, context);
              }
              return context;
            }
          }
          function hasContextChanged() {
            {
              return didPerformWorkStackCursor.current;
            }
          }
          function isContextProvider(type) {
            {
              var childContextTypes = type.childContextTypes;
              return childContextTypes !== null && childContextTypes !== void 0;
            }
          }
          function popContext(fiber) {
            {
              pop(didPerformWorkStackCursor, fiber);
              pop(contextStackCursor, fiber);
            }
          }
          function popTopLevelContextObject(fiber) {
            {
              pop(didPerformWorkStackCursor, fiber);
              pop(contextStackCursor, fiber);
            }
          }
          function pushTopLevelContextObject(fiber, context, didChange) {
            {
              if (contextStackCursor.current !== emptyContextObject) {
                throw new Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");
              }
              push(contextStackCursor, context, fiber);
              push(didPerformWorkStackCursor, didChange, fiber);
            }
          }
          function processChildContext(fiber, type, parentContext) {
            {
              var instance = fiber.stateNode;
              var childContextTypes = type.childContextTypes;
              if (typeof instance.getChildContext !== "function") {
                {
                  var componentName = getComponentNameFromFiber(fiber) || "Unknown";
                  if (!warnedAboutMissingGetChildContext[componentName]) {
                    warnedAboutMissingGetChildContext[componentName] = true;
                    error("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", componentName, componentName);
                  }
                }
                return parentContext;
              }
              var childContext = instance.getChildContext();
              for (var contextKey in childContext) {
                if (!(contextKey in childContextTypes)) {
                  throw new Error((getComponentNameFromFiber(fiber) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.');
                }
              }
              {
                var name2 = getComponentNameFromFiber(fiber) || "Unknown";
                checkPropTypes(childContextTypes, childContext, "child context", name2);
              }
              return assign({}, parentContext, childContext);
            }
          }
          function pushContextProvider(workInProgress2) {
            {
              var instance = workInProgress2.stateNode;
              var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject;
              previousContext = contextStackCursor.current;
              push(contextStackCursor, memoizedMergedChildContext, workInProgress2);
              push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress2);
              return true;
            }
          }
          function invalidateContextProvider(workInProgress2, type, didChange) {
            {
              var instance = workInProgress2.stateNode;
              if (!instance) {
                throw new Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");
              }
              if (didChange) {
                var mergedContext = processChildContext(workInProgress2, type, previousContext);
                instance.__reactInternalMemoizedMergedChildContext = mergedContext;
                pop(didPerformWorkStackCursor, workInProgress2);
                pop(contextStackCursor, workInProgress2);
                push(contextStackCursor, mergedContext, workInProgress2);
                push(didPerformWorkStackCursor, didChange, workInProgress2);
              } else {
                pop(didPerformWorkStackCursor, workInProgress2);
                push(didPerformWorkStackCursor, didChange, workInProgress2);
              }
            }
          }
          function findCurrentUnmaskedContext(fiber) {
            {
              if (!isFiberMounted(fiber) || fiber.tag !== ClassComponent) {
                throw new Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");
              }
              var node = fiber;
              do {
                switch (node.tag) {
                  case HostRoot:
                    return node.stateNode.context;
                  case ClassComponent: {
                    var Component40 = node.type;
                    if (isContextProvider(Component40)) {
                      return node.stateNode.__reactInternalMemoizedMergedChildContext;
                    }
                    break;
                  }
                }
                node = node.return;
              } while (node !== null);
              throw new Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
            }
          }
          var LegacyRoot = 0;
          var ConcurrentRoot = 1;
          var syncQueue = null;
          var includesLegacySyncCallbacks = false;
          var isFlushingSyncQueue = false;
          function scheduleSyncCallback(callback) {
            if (syncQueue === null) {
              syncQueue = [callback];
            } else {
              syncQueue.push(callback);
            }
          }
          function scheduleLegacySyncCallback(callback) {
            includesLegacySyncCallbacks = true;
            scheduleSyncCallback(callback);
          }
          function flushSyncCallbacksOnlyInLegacyMode() {
            if (includesLegacySyncCallbacks) {
              flushSyncCallbacks();
            }
          }
          function flushSyncCallbacks() {
            if (!isFlushingSyncQueue && syncQueue !== null) {
              isFlushingSyncQueue = true;
              var i = 0;
              var previousUpdatePriority = getCurrentUpdatePriority();
              try {
                var isSync = true;
                var queue = syncQueue;
                setCurrentUpdatePriority(DiscreteEventPriority);
                for (; i < queue.length; i++) {
                  var callback = queue[i];
                  do {
                    callback = callback(isSync);
                  } while (callback !== null);
                }
                syncQueue = null;
                includesLegacySyncCallbacks = false;
              } catch (error2) {
                if (syncQueue !== null) {
                  syncQueue = syncQueue.slice(i + 1);
                }
                scheduleCallback(ImmediatePriority, flushSyncCallbacks);
                throw error2;
              } finally {
                setCurrentUpdatePriority(previousUpdatePriority);
                isFlushingSyncQueue = false;
              }
            }
            return null;
          }
          var forkStack = [];
          var forkStackIndex = 0;
          var treeForkProvider = null;
          var treeForkCount = 0;
          var idStack = [];
          var idStackIndex = 0;
          var treeContextProvider = null;
          var treeContextId = 1;
          var treeContextOverflow = "";
          function isForkedChild(workInProgress2) {
            warnIfNotHydrating();
            return (workInProgress2.flags & Forked) !== NoFlags;
          }
          function getForksAtLevel(workInProgress2) {
            warnIfNotHydrating();
            return treeForkCount;
          }
          function getTreeId() {
            var overflow = treeContextOverflow;
            var idWithLeadingBit = treeContextId;
            var id = idWithLeadingBit & ~getLeadingBit(idWithLeadingBit);
            return id.toString(32) + overflow;
          }
          function pushTreeFork(workInProgress2, totalChildren) {
            warnIfNotHydrating();
            forkStack[forkStackIndex++] = treeForkCount;
            forkStack[forkStackIndex++] = treeForkProvider;
            treeForkProvider = workInProgress2;
            treeForkCount = totalChildren;
          }
          function pushTreeId(workInProgress2, totalChildren, index2) {
            warnIfNotHydrating();
            idStack[idStackIndex++] = treeContextId;
            idStack[idStackIndex++] = treeContextOverflow;
            idStack[idStackIndex++] = treeContextProvider;
            treeContextProvider = workInProgress2;
            var baseIdWithLeadingBit = treeContextId;
            var baseOverflow = treeContextOverflow;
            var baseLength = getBitLength(baseIdWithLeadingBit) - 1;
            var baseId = baseIdWithLeadingBit & ~(1 << baseLength);
            var slot = index2 + 1;
            var length = getBitLength(totalChildren) + baseLength;
            if (length > 30) {
              var numberOfOverflowBits = baseLength - baseLength % 5;
              var newOverflowBits = (1 << numberOfOverflowBits) - 1;
              var newOverflow = (baseId & newOverflowBits).toString(32);
              var restOfBaseId = baseId >> numberOfOverflowBits;
              var restOfBaseLength = baseLength - numberOfOverflowBits;
              var restOfLength = getBitLength(totalChildren) + restOfBaseLength;
              var restOfNewBits = slot << restOfBaseLength;
              var id = restOfNewBits | restOfBaseId;
              var overflow = newOverflow + baseOverflow;
              treeContextId = 1 << restOfLength | id;
              treeContextOverflow = overflow;
            } else {
              var newBits = slot << baseLength;
              var _id = newBits | baseId;
              var _overflow = baseOverflow;
              treeContextId = 1 << length | _id;
              treeContextOverflow = _overflow;
            }
          }
          function pushMaterializedTreeId(workInProgress2) {
            warnIfNotHydrating();
            var returnFiber = workInProgress2.return;
            if (returnFiber !== null) {
              var numberOfForks = 1;
              var slotIndex = 0;
              pushTreeFork(workInProgress2, numberOfForks);
              pushTreeId(workInProgress2, numberOfForks, slotIndex);
            }
          }
          function getBitLength(number4) {
            return 32 - clz32(number4);
          }
          function getLeadingBit(id) {
            return 1 << getBitLength(id) - 1;
          }
          function popTreeContext(workInProgress2) {
            while (workInProgress2 === treeForkProvider) {
              treeForkProvider = forkStack[--forkStackIndex];
              forkStack[forkStackIndex] = null;
              treeForkCount = forkStack[--forkStackIndex];
              forkStack[forkStackIndex] = null;
            }
            while (workInProgress2 === treeContextProvider) {
              treeContextProvider = idStack[--idStackIndex];
              idStack[idStackIndex] = null;
              treeContextOverflow = idStack[--idStackIndex];
              idStack[idStackIndex] = null;
              treeContextId = idStack[--idStackIndex];
              idStack[idStackIndex] = null;
            }
          }
          function getSuspendedTreeContext() {
            warnIfNotHydrating();
            if (treeContextProvider !== null) {
              return {
                id: treeContextId,
                overflow: treeContextOverflow
              };
            } else {
              return null;
            }
          }
          function restoreSuspendedTreeContext(workInProgress2, suspendedContext) {
            warnIfNotHydrating();
            idStack[idStackIndex++] = treeContextId;
            idStack[idStackIndex++] = treeContextOverflow;
            idStack[idStackIndex++] = treeContextProvider;
            treeContextId = suspendedContext.id;
            treeContextOverflow = suspendedContext.overflow;
            treeContextProvider = workInProgress2;
          }
          function warnIfNotHydrating() {
            {
              if (!getIsHydrating()) {
                error("Expected to be hydrating. This is a bug in React. Please file an issue.");
              }
            }
          }
          var hydrationParentFiber = null;
          var nextHydratableInstance = null;
          var isHydrating = false;
          var didSuspendOrErrorDEV = false;
          var hydrationErrors = null;
          function warnIfHydrating() {
            {
              if (isHydrating) {
                error("We should not be hydrating here. This is a bug in React. Please file a bug.");
              }
            }
          }
          function markDidThrowWhileHydratingDEV() {
            {
              didSuspendOrErrorDEV = true;
            }
          }
          function didSuspendOrErrorWhileHydratingDEV() {
            {
              return didSuspendOrErrorDEV;
            }
          }
          function enterHydrationState(fiber) {
            var parentInstance = fiber.stateNode.containerInfo;
            nextHydratableInstance = getFirstHydratableChildWithinContainer(parentInstance);
            hydrationParentFiber = fiber;
            isHydrating = true;
            hydrationErrors = null;
            didSuspendOrErrorDEV = false;
            return true;
          }
          function reenterHydrationStateFromDehydratedSuspenseInstance(fiber, suspenseInstance, treeContext) {
            nextHydratableInstance = getFirstHydratableChildWithinSuspenseInstance(suspenseInstance);
            hydrationParentFiber = fiber;
            isHydrating = true;
            hydrationErrors = null;
            didSuspendOrErrorDEV = false;
            if (treeContext !== null) {
              restoreSuspendedTreeContext(fiber, treeContext);
            }
            return true;
          }
          function warnUnhydratedInstance(returnFiber, instance) {
            {
              switch (returnFiber.tag) {
                case HostRoot: {
                  didNotHydrateInstanceWithinContainer(returnFiber.stateNode.containerInfo, instance);
                  break;
                }
                case HostComponent: {
                  var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
                  didNotHydrateInstance(
                    returnFiber.type,
                    returnFiber.memoizedProps,
                    returnFiber.stateNode,
                    instance,
                    // TODO: Delete this argument when we remove the legacy root API.
                    isConcurrentMode
                  );
                  break;
                }
                case SuspenseComponent: {
                  var suspenseState = returnFiber.memoizedState;
                  if (suspenseState.dehydrated !== null) didNotHydrateInstanceWithinSuspenseInstance(suspenseState.dehydrated, instance);
                  break;
                }
              }
            }
          }
          function deleteHydratableInstance(returnFiber, instance) {
            warnUnhydratedInstance(returnFiber, instance);
            var childToDelete = createFiberFromHostInstanceForDeletion();
            childToDelete.stateNode = instance;
            childToDelete.return = returnFiber;
            var deletions = returnFiber.deletions;
            if (deletions === null) {
              returnFiber.deletions = [childToDelete];
              returnFiber.flags |= ChildDeletion;
            } else {
              deletions.push(childToDelete);
            }
          }
          function warnNonhydratedInstance(returnFiber, fiber) {
            {
              if (didSuspendOrErrorDEV) {
                return;
              }
              switch (returnFiber.tag) {
                case HostRoot: {
                  var parentContainer = returnFiber.stateNode.containerInfo;
                  switch (fiber.tag) {
                    case HostComponent:
                      var type = fiber.type;
                      var props = fiber.pendingProps;
                      didNotFindHydratableInstanceWithinContainer(parentContainer, type);
                      break;
                    case HostText:
                      var text = fiber.pendingProps;
                      didNotFindHydratableTextInstanceWithinContainer(parentContainer, text);
                      break;
                  }
                  break;
                }
                case HostComponent: {
                  var parentType = returnFiber.type;
                  var parentProps = returnFiber.memoizedProps;
                  var parentInstance = returnFiber.stateNode;
                  switch (fiber.tag) {
                    case HostComponent: {
                      var _type = fiber.type;
                      var _props = fiber.pendingProps;
                      var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
                      didNotFindHydratableInstance(
                        parentType,
                        parentProps,
                        parentInstance,
                        _type,
                        _props,
                        // TODO: Delete this argument when we remove the legacy root API.
                        isConcurrentMode
                      );
                      break;
                    }
                    case HostText: {
                      var _text = fiber.pendingProps;
                      var _isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
                      didNotFindHydratableTextInstance(
                        parentType,
                        parentProps,
                        parentInstance,
                        _text,
                        // TODO: Delete this argument when we remove the legacy root API.
                        _isConcurrentMode
                      );
                      break;
                    }
                  }
                  break;
                }
                case SuspenseComponent: {
                  var suspenseState = returnFiber.memoizedState;
                  var _parentInstance = suspenseState.dehydrated;
                  if (_parentInstance !== null) switch (fiber.tag) {
                    case HostComponent:
                      var _type2 = fiber.type;
                      var _props2 = fiber.pendingProps;
                      didNotFindHydratableInstanceWithinSuspenseInstance(_parentInstance, _type2);
                      break;
                    case HostText:
                      var _text2 = fiber.pendingProps;
                      didNotFindHydratableTextInstanceWithinSuspenseInstance(_parentInstance, _text2);
                      break;
                  }
                  break;
                }
                default:
                  return;
              }
            }
          }
          function insertNonHydratedInstance(returnFiber, fiber) {
            fiber.flags = fiber.flags & ~Hydrating | Placement;
            warnNonhydratedInstance(returnFiber, fiber);
          }
          function tryHydrate(fiber, nextInstance) {
            switch (fiber.tag) {
              case HostComponent: {
                var type = fiber.type;
                var props = fiber.pendingProps;
                var instance = canHydrateInstance(nextInstance, type);
                if (instance !== null) {
                  fiber.stateNode = instance;
                  hydrationParentFiber = fiber;
                  nextHydratableInstance = getFirstHydratableChild(instance);
                  return true;
                }
                return false;
              }
              case HostText: {
                var text = fiber.pendingProps;
                var textInstance = canHydrateTextInstance(nextInstance, text);
                if (textInstance !== null) {
                  fiber.stateNode = textInstance;
                  hydrationParentFiber = fiber;
                  nextHydratableInstance = null;
                  return true;
                }
                return false;
              }
              case SuspenseComponent: {
                var suspenseInstance = canHydrateSuspenseInstance(nextInstance);
                if (suspenseInstance !== null) {
                  var suspenseState = {
                    dehydrated: suspenseInstance,
                    treeContext: getSuspendedTreeContext(),
                    retryLane: OffscreenLane
                  };
                  fiber.memoizedState = suspenseState;
                  var dehydratedFragment = createFiberFromDehydratedFragment(suspenseInstance);
                  dehydratedFragment.return = fiber;
                  fiber.child = dehydratedFragment;
                  hydrationParentFiber = fiber;
                  nextHydratableInstance = null;
                  return true;
                }
                return false;
              }
              default:
                return false;
            }
          }
          function shouldClientRenderOnMismatch(fiber) {
            return (fiber.mode & ConcurrentMode) !== NoMode && (fiber.flags & DidCapture) === NoFlags;
          }
          function throwOnHydrationMismatch(fiber) {
            throw new Error("Hydration failed because the initial UI does not match what was rendered on the server.");
          }
          function tryToClaimNextHydratableInstance(fiber) {
            if (!isHydrating) {
              return;
            }
            var nextInstance = nextHydratableInstance;
            if (!nextInstance) {
              if (shouldClientRenderOnMismatch(fiber)) {
                warnNonhydratedInstance(hydrationParentFiber, fiber);
                throwOnHydrationMismatch();
              }
              insertNonHydratedInstance(hydrationParentFiber, fiber);
              isHydrating = false;
              hydrationParentFiber = fiber;
              return;
            }
            var firstAttemptedInstance = nextInstance;
            if (!tryHydrate(fiber, nextInstance)) {
              if (shouldClientRenderOnMismatch(fiber)) {
                warnNonhydratedInstance(hydrationParentFiber, fiber);
                throwOnHydrationMismatch();
              }
              nextInstance = getNextHydratableSibling(firstAttemptedInstance);
              var prevHydrationParentFiber = hydrationParentFiber;
              if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
                insertNonHydratedInstance(hydrationParentFiber, fiber);
                isHydrating = false;
                hydrationParentFiber = fiber;
                return;
              }
              deleteHydratableInstance(prevHydrationParentFiber, firstAttemptedInstance);
            }
          }
          function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
            var instance = fiber.stateNode;
            var shouldWarnIfMismatchDev = !didSuspendOrErrorDEV;
            var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber, shouldWarnIfMismatchDev);
            fiber.updateQueue = updatePayload;
            if (updatePayload !== null) {
              return true;
            }
            return false;
          }
          function prepareToHydrateHostTextInstance(fiber) {
            var textInstance = fiber.stateNode;
            var textContent = fiber.memoizedProps;
            var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);
            if (shouldUpdate) {
              var returnFiber = hydrationParentFiber;
              if (returnFiber !== null) {
                switch (returnFiber.tag) {
                  case HostRoot: {
                    var parentContainer = returnFiber.stateNode.containerInfo;
                    var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
                    didNotMatchHydratedContainerTextInstance(
                      parentContainer,
                      textInstance,
                      textContent,
                      // TODO: Delete this argument when we remove the legacy root API.
                      isConcurrentMode
                    );
                    break;
                  }
                  case HostComponent: {
                    var parentType = returnFiber.type;
                    var parentProps = returnFiber.memoizedProps;
                    var parentInstance = returnFiber.stateNode;
                    var _isConcurrentMode2 = (returnFiber.mode & ConcurrentMode) !== NoMode;
                    didNotMatchHydratedTextInstance(
                      parentType,
                      parentProps,
                      parentInstance,
                      textInstance,
                      textContent,
                      // TODO: Delete this argument when we remove the legacy root API.
                      _isConcurrentMode2
                    );
                    break;
                  }
                }
              }
            }
            return shouldUpdate;
          }
          function prepareToHydrateHostSuspenseInstance(fiber) {
            var suspenseState = fiber.memoizedState;
            var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
            if (!suspenseInstance) {
              throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
            }
            hydrateSuspenseInstance(suspenseInstance, fiber);
          }
          function skipPastDehydratedSuspenseInstance(fiber) {
            var suspenseState = fiber.memoizedState;
            var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
            if (!suspenseInstance) {
              throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
            }
            return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
          }
          function popToNextHostParent(fiber) {
            var parent2 = fiber.return;
            while (parent2 !== null && parent2.tag !== HostComponent && parent2.tag !== HostRoot && parent2.tag !== SuspenseComponent) {
              parent2 = parent2.return;
            }
            hydrationParentFiber = parent2;
          }
          function popHydrationState(fiber) {
            if (fiber !== hydrationParentFiber) {
              return false;
            }
            if (!isHydrating) {
              popToNextHostParent(fiber);
              isHydrating = true;
              return false;
            }
            if (fiber.tag !== HostRoot && (fiber.tag !== HostComponent || shouldDeleteUnhydratedTailInstances(fiber.type) && !shouldSetTextContent(fiber.type, fiber.memoizedProps))) {
              var nextInstance = nextHydratableInstance;
              if (nextInstance) {
                if (shouldClientRenderOnMismatch(fiber)) {
                  warnIfUnhydratedTailNodes(fiber);
                  throwOnHydrationMismatch();
                } else {
                  while (nextInstance) {
                    deleteHydratableInstance(fiber, nextInstance);
                    nextInstance = getNextHydratableSibling(nextInstance);
                  }
                }
              }
            }
            popToNextHostParent(fiber);
            if (fiber.tag === SuspenseComponent) {
              nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);
            } else {
              nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
            }
            return true;
          }
          function hasUnhydratedTailNodes() {
            return isHydrating && nextHydratableInstance !== null;
          }
          function warnIfUnhydratedTailNodes(fiber) {
            var nextInstance = nextHydratableInstance;
            while (nextInstance) {
              warnUnhydratedInstance(fiber, nextInstance);
              nextInstance = getNextHydratableSibling(nextInstance);
            }
          }
          function resetHydrationState() {
            hydrationParentFiber = null;
            nextHydratableInstance = null;
            isHydrating = false;
            didSuspendOrErrorDEV = false;
          }
          function upgradeHydrationErrorsToRecoverable() {
            if (hydrationErrors !== null) {
              queueRecoverableErrors(hydrationErrors);
              hydrationErrors = null;
            }
          }
          function getIsHydrating() {
            return isHydrating;
          }
          function queueHydrationError(error2) {
            if (hydrationErrors === null) {
              hydrationErrors = [error2];
            } else {
              hydrationErrors.push(error2);
            }
          }
          var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
          var NoTransition = null;
          function requestCurrentTransition() {
            return ReactCurrentBatchConfig$1.transition;
          }
          var ReactStrictModeWarnings = {
            recordUnsafeLifecycleWarnings: function(fiber, instance) {
            },
            flushPendingUnsafeLifecycleWarnings: function() {
            },
            recordLegacyContextWarning: function(fiber, instance) {
            },
            flushLegacyContextWarning: function() {
            },
            discardPendingWarnings: function() {
            }
          };
          {
            var findStrictRoot = function(fiber) {
              var maybeStrictRoot = null;
              var node = fiber;
              while (node !== null) {
                if (node.mode & StrictLegacyMode) {
                  maybeStrictRoot = node;
                }
                node = node.return;
              }
              return maybeStrictRoot;
            };
            var setToSortedString = function(set2) {
              var array = [];
              set2.forEach(function(value) {
                array.push(value);
              });
              return array.sort().join(", ");
            };
            var pendingComponentWillMountWarnings = [];
            var pendingUNSAFE_ComponentWillMountWarnings = [];
            var pendingComponentWillReceivePropsWarnings = [];
            var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
            var pendingComponentWillUpdateWarnings = [];
            var pendingUNSAFE_ComponentWillUpdateWarnings = [];
            var didWarnAboutUnsafeLifecycles = /* @__PURE__ */ new Set();
            ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function(fiber, instance) {
              if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
                return;
              }
              if (typeof instance.componentWillMount === "function" && // Don't warn about react-lifecycles-compat polyfilled components.
              instance.componentWillMount.__suppressDeprecationWarning !== true) {
                pendingComponentWillMountWarnings.push(fiber);
              }
              if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillMount === "function") {
                pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
              }
              if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
                pendingComponentWillReceivePropsWarnings.push(fiber);
              }
              if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillReceiveProps === "function") {
                pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
              }
              if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
                pendingComponentWillUpdateWarnings.push(fiber);
              }
              if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillUpdate === "function") {
                pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);
              }
            };
            ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function() {
              var componentWillMountUniqueNames = /* @__PURE__ */ new Set();
              if (pendingComponentWillMountWarnings.length > 0) {
                pendingComponentWillMountWarnings.forEach(function(fiber) {
                  componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingComponentWillMountWarnings = [];
              }
              var UNSAFE_componentWillMountUniqueNames = /* @__PURE__ */ new Set();
              if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
                pendingUNSAFE_ComponentWillMountWarnings.forEach(function(fiber) {
                  UNSAFE_componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingUNSAFE_ComponentWillMountWarnings = [];
              }
              var componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
              if (pendingComponentWillReceivePropsWarnings.length > 0) {
                pendingComponentWillReceivePropsWarnings.forEach(function(fiber) {
                  componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingComponentWillReceivePropsWarnings = [];
              }
              var UNSAFE_componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
              if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
                pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function(fiber) {
                  UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
              }
              var componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
              if (pendingComponentWillUpdateWarnings.length > 0) {
                pendingComponentWillUpdateWarnings.forEach(function(fiber) {
                  componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingComponentWillUpdateWarnings = [];
              }
              var UNSAFE_componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
              if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
                pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function(fiber) {
                  UNSAFE_componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
                  didWarnAboutUnsafeLifecycles.add(fiber.type);
                });
                pendingUNSAFE_ComponentWillUpdateWarnings = [];
              }
              if (UNSAFE_componentWillMountUniqueNames.size > 0) {
                var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);
                error("Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n\nPlease update the following components: %s", sortedNames);
              }
              if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {
                var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);
                error("Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n\nPlease update the following components: %s", _sortedNames);
              }
              if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {
                var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);
                error("Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n\nPlease update the following components: %s", _sortedNames2);
              }
              if (componentWillMountUniqueNames.size > 0) {
                var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);
                warn2("componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames3);
              }
              if (componentWillReceivePropsUniqueNames.size > 0) {
                var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);
                warn2("componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames4);
              }
              if (componentWillUpdateUniqueNames.size > 0) {
                var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);
                warn2("componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames5);
              }
            };
            var pendingLegacyContextWarning = /* @__PURE__ */ new Map();
            var didWarnAboutLegacyContext = /* @__PURE__ */ new Set();
            ReactStrictModeWarnings.recordLegacyContextWarning = function(fiber, instance) {
              var strictRoot = findStrictRoot(fiber);
              if (strictRoot === null) {
                error("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.");
                return;
              }
              if (didWarnAboutLegacyContext.has(fiber.type)) {
                return;
              }
              var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);
              if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === "function") {
                if (warningsForRoot === void 0) {
                  warningsForRoot = [];
                  pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
                }
                warningsForRoot.push(fiber);
              }
            };
            ReactStrictModeWarnings.flushLegacyContextWarning = function() {
              pendingLegacyContextWarning.forEach(function(fiberArray, strictRoot) {
                if (fiberArray.length === 0) {
                  return;
                }
                var firstFiber = fiberArray[0];
                var uniqueNames = /* @__PURE__ */ new Set();
                fiberArray.forEach(function(fiber) {
                  uniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
                  didWarnAboutLegacyContext.add(fiber.type);
                });
                var sortedNames = setToSortedString(uniqueNames);
                try {
                  setCurrentFiber(firstFiber);
                  error("Legacy context API has been detected within a strict-mode tree.\n\nThe old API will be supported in all 16.x releases, but applications using it should migrate to the new version.\n\nPlease update the following components: %s\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context", sortedNames);
                } finally {
                  resetCurrentFiber();
                }
              });
            };
            ReactStrictModeWarnings.discardPendingWarnings = function() {
              pendingComponentWillMountWarnings = [];
              pendingUNSAFE_ComponentWillMountWarnings = [];
              pendingComponentWillReceivePropsWarnings = [];
              pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
              pendingComponentWillUpdateWarnings = [];
              pendingUNSAFE_ComponentWillUpdateWarnings = [];
              pendingLegacyContextWarning = /* @__PURE__ */ new Map();
            };
          }
          var didWarnAboutMaps;
          var didWarnAboutGenerators;
          var didWarnAboutStringRefs;
          var ownerHasKeyUseWarning;
          var ownerHasFunctionTypeWarning;
          var warnForMissingKey = function(child, returnFiber) {
          };
          {
            didWarnAboutMaps = false;
            didWarnAboutGenerators = false;
            didWarnAboutStringRefs = {};
            ownerHasKeyUseWarning = {};
            ownerHasFunctionTypeWarning = {};
            warnForMissingKey = function(child, returnFiber) {
              if (child === null || typeof child !== "object") {
                return;
              }
              if (!child._store || child._store.validated || child.key != null) {
                return;
              }
              if (typeof child._store !== "object") {
                throw new Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");
              }
              child._store.validated = true;
              var componentName = getComponentNameFromFiber(returnFiber) || "Component";
              if (ownerHasKeyUseWarning[componentName]) {
                return;
              }
              ownerHasKeyUseWarning[componentName] = true;
              error('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.');
            };
          }
          function isReactClass(type) {
            return type.prototype && type.prototype.isReactComponent;
          }
          function coerceRef(returnFiber, current2, element) {
            var mixedRef = element.ref;
            if (mixedRef !== null && typeof mixedRef !== "function" && typeof mixedRef !== "object") {
              {
                if ((returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs
                // because these cannot be automatically converted to an arrow function
                // using a codemod. Therefore, we don't have to warn about string refs again.
                !(element._owner && element._self && element._owner.stateNode !== element._self) && // Will already throw with "Function components cannot have string refs"
                !(element._owner && element._owner.tag !== ClassComponent) && // Will already warn with "Function components cannot be given refs"
                !(typeof element.type === "function" && !isReactClass(element.type)) && // Will already throw with "Element ref was specified as a string (someStringRef) but no owner was set"
                element._owner) {
                  var componentName = getComponentNameFromFiber(returnFiber) || "Component";
                  if (!didWarnAboutStringRefs[componentName]) {
                    {
                      error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', componentName, mixedRef);
                    }
                    didWarnAboutStringRefs[componentName] = true;
                  }
                }
              }
              if (element._owner) {
                var owner = element._owner;
                var inst;
                if (owner) {
                  var ownerFiber = owner;
                  if (ownerFiber.tag !== ClassComponent) {
                    throw new Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");
                  }
                  inst = ownerFiber.stateNode;
                }
                if (!inst) {
                  throw new Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue.");
                }
                var resolvedInst = inst;
                {
                  checkPropStringCoercion(mixedRef, "ref");
                }
                var stringRef = "" + mixedRef;
                if (current2 !== null && current2.ref !== null && typeof current2.ref === "function" && current2.ref._stringRef === stringRef) {
                  return current2.ref;
                }
                var ref = function(value) {
                  var refs = resolvedInst.refs;
                  if (value === null) {
                    delete refs[stringRef];
                  } else {
                    refs[stringRef] = value;
                  }
                };
                ref._stringRef = stringRef;
                return ref;
              } else {
                if (typeof mixedRef !== "string") {
                  throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
                }
                if (!element._owner) {
                  throw new Error("Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://reactjs.org/link/refs-must-have-owner for more information.");
                }
              }
            }
            return mixedRef;
          }
          function throwOnInvalidObjectType(returnFiber, newChild) {
            var childString = Object.prototype.toString.call(newChild);
            throw new Error("Objects are not valid as a React child (found: " + (childString === "[object Object]" ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : childString) + "). If you meant to render a collection of children, use an array instead.");
          }
          function warnOnFunctionType(returnFiber) {
            {
              var componentName = getComponentNameFromFiber(returnFiber) || "Component";
              if (ownerHasFunctionTypeWarning[componentName]) {
                return;
              }
              ownerHasFunctionTypeWarning[componentName] = true;
              error("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.");
            }
          }
          function resolveLazy(lazyType) {
            var payload = lazyType._payload;
            var init = lazyType._init;
            return init(payload);
          }
          function ChildReconciler(shouldTrackSideEffects) {
            function deleteChild(returnFiber, childToDelete) {
              if (!shouldTrackSideEffects) {
                return;
              }
              var deletions = returnFiber.deletions;
              if (deletions === null) {
                returnFiber.deletions = [childToDelete];
                returnFiber.flags |= ChildDeletion;
              } else {
                deletions.push(childToDelete);
              }
            }
            function deleteRemainingChildren(returnFiber, currentFirstChild) {
              if (!shouldTrackSideEffects) {
                return null;
              }
              var childToDelete = currentFirstChild;
              while (childToDelete !== null) {
                deleteChild(returnFiber, childToDelete);
                childToDelete = childToDelete.sibling;
              }
              return null;
            }
            function mapRemainingChildren(returnFiber, currentFirstChild) {
              var existingChildren = /* @__PURE__ */ new Map();
              var existingChild = currentFirstChild;
              while (existingChild !== null) {
                if (existingChild.key !== null) {
                  existingChildren.set(existingChild.key, existingChild);
                } else {
                  existingChildren.set(existingChild.index, existingChild);
                }
                existingChild = existingChild.sibling;
              }
              return existingChildren;
            }
            function useFiber(fiber, pendingProps) {
              var clone = createWorkInProgress(fiber, pendingProps);
              clone.index = 0;
              clone.sibling = null;
              return clone;
            }
            function placeChild(newFiber, lastPlacedIndex, newIndex) {
              newFiber.index = newIndex;
              if (!shouldTrackSideEffects) {
                newFiber.flags |= Forked;
                return lastPlacedIndex;
              }
              var current2 = newFiber.alternate;
              if (current2 !== null) {
                var oldIndex = current2.index;
                if (oldIndex < lastPlacedIndex) {
                  newFiber.flags |= Placement;
                  return lastPlacedIndex;
                } else {
                  return oldIndex;
                }
              } else {
                newFiber.flags |= Placement;
                return lastPlacedIndex;
              }
            }
            function placeSingleChild(newFiber) {
              if (shouldTrackSideEffects && newFiber.alternate === null) {
                newFiber.flags |= Placement;
              }
              return newFiber;
            }
            function updateTextNode(returnFiber, current2, textContent, lanes) {
              if (current2 === null || current2.tag !== HostText) {
                var created = createFiberFromText(textContent, returnFiber.mode, lanes);
                created.return = returnFiber;
                return created;
              } else {
                var existing = useFiber(current2, textContent);
                existing.return = returnFiber;
                return existing;
              }
            }
            function updateElement(returnFiber, current2, element, lanes) {
              var elementType = element.type;
              if (elementType === REACT_FRAGMENT_TYPE) {
                return updateFragment2(returnFiber, current2, element.props.children, lanes, element.key);
              }
              if (current2 !== null) {
                if (current2.elementType === elementType || // Keep this check inline so it only runs on the false path:
                isCompatibleFamilyForHotReloading(current2, element) || // Lazy types should reconcile their resolved type.
                // We need to do this after the Hot Reloading check above,
                // because hot reloading has different semantics than prod because
                // it doesn't resuspend. So we can't let the call below suspend.
                typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current2.type) {
                  var existing = useFiber(current2, element.props);
                  existing.ref = coerceRef(returnFiber, current2, element);
                  existing.return = returnFiber;
                  {
                    existing._debugSource = element._source;
                    existing._debugOwner = element._owner;
                  }
                  return existing;
                }
              }
              var created = createFiberFromElement(element, returnFiber.mode, lanes);
              created.ref = coerceRef(returnFiber, current2, element);
              created.return = returnFiber;
              return created;
            }
            function updatePortal(returnFiber, current2, portal, lanes) {
              if (current2 === null || current2.tag !== HostPortal || current2.stateNode.containerInfo !== portal.containerInfo || current2.stateNode.implementation !== portal.implementation) {
                var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
                created.return = returnFiber;
                return created;
              } else {
                var existing = useFiber(current2, portal.children || []);
                existing.return = returnFiber;
                return existing;
              }
            }
            function updateFragment2(returnFiber, current2, fragment, lanes, key) {
              if (current2 === null || current2.tag !== Fragment67) {
                var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
                created.return = returnFiber;
                return created;
              } else {
                var existing = useFiber(current2, fragment);
                existing.return = returnFiber;
                return existing;
              }
            }
            function createChild(returnFiber, newChild, lanes) {
              if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
                var created = createFiberFromText("" + newChild, returnFiber.mode, lanes);
                created.return = returnFiber;
                return created;
              }
              if (typeof newChild === "object" && newChild !== null) {
                switch (newChild.$$typeof) {
                  case REACT_ELEMENT_TYPE: {
                    var _created = createFiberFromElement(newChild, returnFiber.mode, lanes);
                    _created.ref = coerceRef(returnFiber, null, newChild);
                    _created.return = returnFiber;
                    return _created;
                  }
                  case REACT_PORTAL_TYPE: {
                    var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes);
                    _created2.return = returnFiber;
                    return _created2;
                  }
                  case REACT_LAZY_TYPE: {
                    var payload = newChild._payload;
                    var init = newChild._init;
                    return createChild(returnFiber, init(payload), lanes);
                  }
                }
                if (isArray(newChild) || getIteratorFn(newChild)) {
                  var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null);
                  _created3.return = returnFiber;
                  return _created3;
                }
                throwOnInvalidObjectType(returnFiber, newChild);
              }
              {
                if (typeof newChild === "function") {
                  warnOnFunctionType(returnFiber);
                }
              }
              return null;
            }
            function updateSlot(returnFiber, oldFiber, newChild, lanes) {
              var key = oldFiber !== null ? oldFiber.key : null;
              if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
                if (key !== null) {
                  return null;
                }
                return updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
              }
              if (typeof newChild === "object" && newChild !== null) {
                switch (newChild.$$typeof) {
                  case REACT_ELEMENT_TYPE: {
                    if (newChild.key === key) {
                      return updateElement(returnFiber, oldFiber, newChild, lanes);
                    } else {
                      return null;
                    }
                  }
                  case REACT_PORTAL_TYPE: {
                    if (newChild.key === key) {
                      return updatePortal(returnFiber, oldFiber, newChild, lanes);
                    } else {
                      return null;
                    }
                  }
                  case REACT_LAZY_TYPE: {
                    var payload = newChild._payload;
                    var init = newChild._init;
                    return updateSlot(returnFiber, oldFiber, init(payload), lanes);
                  }
                }
                if (isArray(newChild) || getIteratorFn(newChild)) {
                  if (key !== null) {
                    return null;
                  }
                  return updateFragment2(returnFiber, oldFiber, newChild, lanes, null);
                }
                throwOnInvalidObjectType(returnFiber, newChild);
              }
              {
                if (typeof newChild === "function") {
                  warnOnFunctionType(returnFiber);
                }
              }
              return null;
            }
            function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {
              if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
                var matchedFiber = existingChildren.get(newIdx) || null;
                return updateTextNode(returnFiber, matchedFiber, "" + newChild, lanes);
              }
              if (typeof newChild === "object" && newChild !== null) {
                switch (newChild.$$typeof) {
                  case REACT_ELEMENT_TYPE: {
                    var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
                    return updateElement(returnFiber, _matchedFiber, newChild, lanes);
                  }
                  case REACT_PORTAL_TYPE: {
                    var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
                    return updatePortal(returnFiber, _matchedFiber2, newChild, lanes);
                  }
                  case REACT_LAZY_TYPE:
                    var payload = newChild._payload;
                    var init = newChild._init;
                    return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes);
                }
                if (isArray(newChild) || getIteratorFn(newChild)) {
                  var _matchedFiber3 = existingChildren.get(newIdx) || null;
                  return updateFragment2(returnFiber, _matchedFiber3, newChild, lanes, null);
                }
                throwOnInvalidObjectType(returnFiber, newChild);
              }
              {
                if (typeof newChild === "function") {
                  warnOnFunctionType(returnFiber);
                }
              }
              return null;
            }
            function warnOnInvalidKey(child, knownKeys, returnFiber) {
              {
                if (typeof child !== "object" || child === null) {
                  return knownKeys;
                }
                switch (child.$$typeof) {
                  case REACT_ELEMENT_TYPE:
                  case REACT_PORTAL_TYPE:
                    warnForMissingKey(child, returnFiber);
                    var key = child.key;
                    if (typeof key !== "string") {
                      break;
                    }
                    if (knownKeys === null) {
                      knownKeys = /* @__PURE__ */ new Set();
                      knownKeys.add(key);
                      break;
                    }
                    if (!knownKeys.has(key)) {
                      knownKeys.add(key);
                      break;
                    }
                    error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.", key);
                    break;
                  case REACT_LAZY_TYPE:
                    var payload = child._payload;
                    var init = child._init;
                    warnOnInvalidKey(init(payload), knownKeys, returnFiber);
                    break;
                }
              }
              return knownKeys;
            }
            function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {
              {
                var knownKeys = null;
                for (var i = 0; i < newChildren.length; i++) {
                  var child = newChildren[i];
                  knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
                }
              }
              var resultingFirstChild = null;
              var previousNewFiber = null;
              var oldFiber = currentFirstChild;
              var lastPlacedIndex = 0;
              var newIdx = 0;
              var nextOldFiber = null;
              for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
                if (oldFiber.index > newIdx) {
                  nextOldFiber = oldFiber;
                  oldFiber = null;
                } else {
                  nextOldFiber = oldFiber.sibling;
                }
                var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes);
                if (newFiber === null) {
                  if (oldFiber === null) {
                    oldFiber = nextOldFiber;
                  }
                  break;
                }
                if (shouldTrackSideEffects) {
                  if (oldFiber && newFiber.alternate === null) {
                    deleteChild(returnFiber, oldFiber);
                  }
                }
                lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
                if (previousNewFiber === null) {
                  resultingFirstChild = newFiber;
                } else {
                  previousNewFiber.sibling = newFiber;
                }
                previousNewFiber = newFiber;
                oldFiber = nextOldFiber;
              }
              if (newIdx === newChildren.length) {
                deleteRemainingChildren(returnFiber, oldFiber);
                if (getIsHydrating()) {
                  var numberOfForks = newIdx;
                  pushTreeFork(returnFiber, numberOfForks);
                }
                return resultingFirstChild;
              }
              if (oldFiber === null) {
                for (; newIdx < newChildren.length; newIdx++) {
                  var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes);
                  if (_newFiber === null) {
                    continue;
                  }
                  lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
                  if (previousNewFiber === null) {
                    resultingFirstChild = _newFiber;
                  } else {
                    previousNewFiber.sibling = _newFiber;
                  }
                  previousNewFiber = _newFiber;
                }
                if (getIsHydrating()) {
                  var _numberOfForks = newIdx;
                  pushTreeFork(returnFiber, _numberOfForks);
                }
                return resultingFirstChild;
              }
              var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
              for (; newIdx < newChildren.length; newIdx++) {
                var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes);
                if (_newFiber2 !== null) {
                  if (shouldTrackSideEffects) {
                    if (_newFiber2.alternate !== null) {
                      existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
                    }
                  }
                  lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
                  if (previousNewFiber === null) {
                    resultingFirstChild = _newFiber2;
                  } else {
                    previousNewFiber.sibling = _newFiber2;
                  }
                  previousNewFiber = _newFiber2;
                }
              }
              if (shouldTrackSideEffects) {
                existingChildren.forEach(function(child2) {
                  return deleteChild(returnFiber, child2);
                });
              }
              if (getIsHydrating()) {
                var _numberOfForks2 = newIdx;
                pushTreeFork(returnFiber, _numberOfForks2);
              }
              return resultingFirstChild;
            }
            function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) {
              var iteratorFn = getIteratorFn(newChildrenIterable);
              if (typeof iteratorFn !== "function") {
                throw new Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");
              }
              {
                if (typeof Symbol === "function" && // $FlowFixMe Flow doesn't know about toStringTag
                newChildrenIterable[Symbol.toStringTag] === "Generator") {
                  if (!didWarnAboutGenerators) {
                    error("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers.");
                  }
                  didWarnAboutGenerators = true;
                }
                if (newChildrenIterable.entries === iteratorFn) {
                  if (!didWarnAboutMaps) {
                    error("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
                  }
                  didWarnAboutMaps = true;
                }
                var _newChildren = iteratorFn.call(newChildrenIterable);
                if (_newChildren) {
                  var knownKeys = null;
                  var _step = _newChildren.next();
                  for (; !_step.done; _step = _newChildren.next()) {
                    var child = _step.value;
                    knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
                  }
                }
              }
              var newChildren = iteratorFn.call(newChildrenIterable);
              if (newChildren == null) {
                throw new Error("An iterable object provided no iterator.");
              }
              var resultingFirstChild = null;
              var previousNewFiber = null;
              var oldFiber = currentFirstChild;
              var lastPlacedIndex = 0;
              var newIdx = 0;
              var nextOldFiber = null;
              var step = newChildren.next();
              for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
                if (oldFiber.index > newIdx) {
                  nextOldFiber = oldFiber;
                  oldFiber = null;
                } else {
                  nextOldFiber = oldFiber.sibling;
                }
                var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
                if (newFiber === null) {
                  if (oldFiber === null) {
                    oldFiber = nextOldFiber;
                  }
                  break;
                }
                if (shouldTrackSideEffects) {
                  if (oldFiber && newFiber.alternate === null) {
                    deleteChild(returnFiber, oldFiber);
                  }
                }
                lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
                if (previousNewFiber === null) {
                  resultingFirstChild = newFiber;
                } else {
                  previousNewFiber.sibling = newFiber;
                }
                previousNewFiber = newFiber;
                oldFiber = nextOldFiber;
              }
              if (step.done) {
                deleteRemainingChildren(returnFiber, oldFiber);
                if (getIsHydrating()) {
                  var numberOfForks = newIdx;
                  pushTreeFork(returnFiber, numberOfForks);
                }
                return resultingFirstChild;
              }
              if (oldFiber === null) {
                for (; !step.done; newIdx++, step = newChildren.next()) {
                  var _newFiber3 = createChild(returnFiber, step.value, lanes);
                  if (_newFiber3 === null) {
                    continue;
                  }
                  lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
                  if (previousNewFiber === null) {
                    resultingFirstChild = _newFiber3;
                  } else {
                    previousNewFiber.sibling = _newFiber3;
                  }
                  previousNewFiber = _newFiber3;
                }
                if (getIsHydrating()) {
                  var _numberOfForks3 = newIdx;
                  pushTreeFork(returnFiber, _numberOfForks3);
                }
                return resultingFirstChild;
              }
              var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
              for (; !step.done; newIdx++, step = newChildren.next()) {
                var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes);
                if (_newFiber4 !== null) {
                  if (shouldTrackSideEffects) {
                    if (_newFiber4.alternate !== null) {
                      existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
                    }
                  }
                  lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
                  if (previousNewFiber === null) {
                    resultingFirstChild = _newFiber4;
                  } else {
                    previousNewFiber.sibling = _newFiber4;
                  }
                  previousNewFiber = _newFiber4;
                }
              }
              if (shouldTrackSideEffects) {
                existingChildren.forEach(function(child2) {
                  return deleteChild(returnFiber, child2);
                });
              }
              if (getIsHydrating()) {
                var _numberOfForks4 = newIdx;
                pushTreeFork(returnFiber, _numberOfForks4);
              }
              return resultingFirstChild;
            }
            function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) {
              if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
                deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
                var existing = useFiber(currentFirstChild, textContent);
                existing.return = returnFiber;
                return existing;
              }
              deleteRemainingChildren(returnFiber, currentFirstChild);
              var created = createFiberFromText(textContent, returnFiber.mode, lanes);
              created.return = returnFiber;
              return created;
            }
            function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) {
              var key = element.key;
              var child = currentFirstChild;
              while (child !== null) {
                if (child.key === key) {
                  var elementType = element.type;
                  if (elementType === REACT_FRAGMENT_TYPE) {
                    if (child.tag === Fragment67) {
                      deleteRemainingChildren(returnFiber, child.sibling);
                      var existing = useFiber(child, element.props.children);
                      existing.return = returnFiber;
                      {
                        existing._debugSource = element._source;
                        existing._debugOwner = element._owner;
                      }
                      return existing;
                    }
                  } else {
                    if (child.elementType === elementType || // Keep this check inline so it only runs on the false path:
                    isCompatibleFamilyForHotReloading(child, element) || // Lazy types should reconcile their resolved type.
                    // We need to do this after the Hot Reloading check above,
                    // because hot reloading has different semantics than prod because
                    // it doesn't resuspend. So we can't let the call below suspend.
                    typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === child.type) {
                      deleteRemainingChildren(returnFiber, child.sibling);
                      var _existing = useFiber(child, element.props);
                      _existing.ref = coerceRef(returnFiber, child, element);
                      _existing.return = returnFiber;
                      {
                        _existing._debugSource = element._source;
                        _existing._debugOwner = element._owner;
                      }
                      return _existing;
                    }
                  }
                  deleteRemainingChildren(returnFiber, child);
                  break;
                } else {
                  deleteChild(returnFiber, child);
                }
                child = child.sibling;
              }
              if (element.type === REACT_FRAGMENT_TYPE) {
                var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key);
                created.return = returnFiber;
                return created;
              } else {
                var _created4 = createFiberFromElement(element, returnFiber.mode, lanes);
                _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
                _created4.return = returnFiber;
                return _created4;
              }
            }
            function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) {
              var key = portal.key;
              var child = currentFirstChild;
              while (child !== null) {
                if (child.key === key) {
                  if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
                    deleteRemainingChildren(returnFiber, child.sibling);
                    var existing = useFiber(child, portal.children || []);
                    existing.return = returnFiber;
                    return existing;
                  } else {
                    deleteRemainingChildren(returnFiber, child);
                    break;
                  }
                } else {
                  deleteChild(returnFiber, child);
                }
                child = child.sibling;
              }
              var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
              created.return = returnFiber;
              return created;
            }
            function reconcileChildFibers2(returnFiber, currentFirstChild, newChild, lanes) {
              var isUnkeyedTopLevelFragment = typeof newChild === "object" && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
              if (isUnkeyedTopLevelFragment) {
                newChild = newChild.props.children;
              }
              if (typeof newChild === "object" && newChild !== null) {
                switch (newChild.$$typeof) {
                  case REACT_ELEMENT_TYPE:
                    return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes));
                  case REACT_PORTAL_TYPE:
                    return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes));
                  case REACT_LAZY_TYPE:
                    var payload = newChild._payload;
                    var init = newChild._init;
                    return reconcileChildFibers2(returnFiber, currentFirstChild, init(payload), lanes);
                }
                if (isArray(newChild)) {
                  return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes);
                }
                if (getIteratorFn(newChild)) {
                  return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes);
                }
                throwOnInvalidObjectType(returnFiber, newChild);
              }
              if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
                return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, "" + newChild, lanes));
              }
              {
                if (typeof newChild === "function") {
                  warnOnFunctionType(returnFiber);
                }
              }
              return deleteRemainingChildren(returnFiber, currentFirstChild);
            }
            return reconcileChildFibers2;
          }
          var reconcileChildFibers = ChildReconciler(true);
          var mountChildFibers = ChildReconciler(false);
          function cloneChildFibers(current2, workInProgress2) {
            if (current2 !== null && workInProgress2.child !== current2.child) {
              throw new Error("Resuming work not yet implemented.");
            }
            if (workInProgress2.child === null) {
              return;
            }
            var currentChild = workInProgress2.child;
            var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);
            workInProgress2.child = newChild;
            newChild.return = workInProgress2;
            while (currentChild.sibling !== null) {
              currentChild = currentChild.sibling;
              newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);
              newChild.return = workInProgress2;
            }
            newChild.sibling = null;
          }
          function resetChildFibers(workInProgress2, lanes) {
            var child = workInProgress2.child;
            while (child !== null) {
              resetWorkInProgress(child, lanes);
              child = child.sibling;
            }
          }
          var valueCursor = createCursor(null);
          var rendererSigil;
          {
            rendererSigil = {};
          }
          var currentlyRenderingFiber = null;
          var lastContextDependency = null;
          var lastFullyObservedContext = null;
          var isDisallowedContextReadInDEV = false;
          function resetContextDependencies() {
            currentlyRenderingFiber = null;
            lastContextDependency = null;
            lastFullyObservedContext = null;
            {
              isDisallowedContextReadInDEV = false;
            }
          }
          function enterDisallowedContextReadInDEV() {
            {
              isDisallowedContextReadInDEV = true;
            }
          }
          function exitDisallowedContextReadInDEV() {
            {
              isDisallowedContextReadInDEV = false;
            }
          }
          function pushProvider(providerFiber, context, nextValue) {
            {
              push(valueCursor, context._currentValue, providerFiber);
              context._currentValue = nextValue;
              {
                if (context._currentRenderer !== void 0 && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {
                  error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.");
                }
                context._currentRenderer = rendererSigil;
              }
            }
          }
          function popProvider(context, providerFiber) {
            var currentValue = valueCursor.current;
            pop(valueCursor, providerFiber);
            {
              {
                context._currentValue = currentValue;
              }
            }
          }
          function scheduleContextWorkOnParentPath(parent2, renderLanes2, propagationRoot) {
            var node = parent2;
            while (node !== null) {
              var alternate = node.alternate;
              if (!isSubsetOfLanes(node.childLanes, renderLanes2)) {
                node.childLanes = mergeLanes(node.childLanes, renderLanes2);
                if (alternate !== null) {
                  alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes2);
                }
              } else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes2)) {
                alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes2);
              }
              if (node === propagationRoot) {
                break;
              }
              node = node.return;
            }
            {
              if (node !== propagationRoot) {
                error("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
          }
          function propagateContextChange(workInProgress2, context, renderLanes2) {
            {
              propagateContextChange_eager(workInProgress2, context, renderLanes2);
            }
          }
          function propagateContextChange_eager(workInProgress2, context, renderLanes2) {
            var fiber = workInProgress2.child;
            if (fiber !== null) {
              fiber.return = workInProgress2;
            }
            while (fiber !== null) {
              var nextFiber = void 0;
              var list = fiber.dependencies;
              if (list !== null) {
                nextFiber = fiber.child;
                var dependency = list.firstContext;
                while (dependency !== null) {
                  if (dependency.context === context) {
                    if (fiber.tag === ClassComponent) {
                      var lane = pickArbitraryLane(renderLanes2);
                      var update = createUpdate(NoTimestamp, lane);
                      update.tag = ForceUpdate;
                      var updateQueue = fiber.updateQueue;
                      if (updateQueue === null) ;
                      else {
                        var sharedQueue = updateQueue.shared;
                        var pending = sharedQueue.pending;
                        if (pending === null) {
                          update.next = update;
                        } else {
                          update.next = pending.next;
                          pending.next = update;
                        }
                        sharedQueue.pending = update;
                      }
                    }
                    fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
                    var alternate = fiber.alternate;
                    if (alternate !== null) {
                      alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
                    }
                    scheduleContextWorkOnParentPath(fiber.return, renderLanes2, workInProgress2);
                    list.lanes = mergeLanes(list.lanes, renderLanes2);
                    break;
                  }
                  dependency = dependency.next;
                }
              } else if (fiber.tag === ContextProvider) {
                nextFiber = fiber.type === workInProgress2.type ? null : fiber.child;
              } else if (fiber.tag === DehydratedFragment) {
                var parentSuspense = fiber.return;
                if (parentSuspense === null) {
                  throw new Error("We just came from a parent so we must have had a parent. This is a bug in React.");
                }
                parentSuspense.lanes = mergeLanes(parentSuspense.lanes, renderLanes2);
                var _alternate = parentSuspense.alternate;
                if (_alternate !== null) {
                  _alternate.lanes = mergeLanes(_alternate.lanes, renderLanes2);
                }
                scheduleContextWorkOnParentPath(parentSuspense, renderLanes2, workInProgress2);
                nextFiber = fiber.sibling;
              } else {
                nextFiber = fiber.child;
              }
              if (nextFiber !== null) {
                nextFiber.return = fiber;
              } else {
                nextFiber = fiber;
                while (nextFiber !== null) {
                  if (nextFiber === workInProgress2) {
                    nextFiber = null;
                    break;
                  }
                  var sibling = nextFiber.sibling;
                  if (sibling !== null) {
                    sibling.return = nextFiber.return;
                    nextFiber = sibling;
                    break;
                  }
                  nextFiber = nextFiber.return;
                }
              }
              fiber = nextFiber;
            }
          }
          function prepareToReadContext(workInProgress2, renderLanes2) {
            currentlyRenderingFiber = workInProgress2;
            lastContextDependency = null;
            lastFullyObservedContext = null;
            var dependencies = workInProgress2.dependencies;
            if (dependencies !== null) {
              {
                var firstContext = dependencies.firstContext;
                if (firstContext !== null) {
                  if (includesSomeLane(dependencies.lanes, renderLanes2)) {
                    markWorkInProgressReceivedUpdate();
                  }
                  dependencies.firstContext = null;
                }
              }
            }
          }
          function readContext(context) {
            {
              if (isDisallowedContextReadInDEV) {
                error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
              }
            }
            var value = context._currentValue;
            if (lastFullyObservedContext === context) ;
            else {
              var contextItem = {
                context,
                memoizedValue: value,
                next: null
              };
              if (lastContextDependency === null) {
                if (currentlyRenderingFiber === null) {
                  throw new Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
                }
                lastContextDependency = contextItem;
                currentlyRenderingFiber.dependencies = {
                  lanes: NoLanes,
                  firstContext: contextItem
                };
              } else {
                lastContextDependency = lastContextDependency.next = contextItem;
              }
            }
            return value;
          }
          var concurrentQueues = null;
          function pushConcurrentUpdateQueue(queue) {
            if (concurrentQueues === null) {
              concurrentQueues = [queue];
            } else {
              concurrentQueues.push(queue);
            }
          }
          function finishQueueingConcurrentUpdates() {
            if (concurrentQueues !== null) {
              for (var i = 0; i < concurrentQueues.length; i++) {
                var queue = concurrentQueues[i];
                var lastInterleavedUpdate = queue.interleaved;
                if (lastInterleavedUpdate !== null) {
                  queue.interleaved = null;
                  var firstInterleavedUpdate = lastInterleavedUpdate.next;
                  var lastPendingUpdate = queue.pending;
                  if (lastPendingUpdate !== null) {
                    var firstPendingUpdate = lastPendingUpdate.next;
                    lastPendingUpdate.next = firstInterleavedUpdate;
                    lastInterleavedUpdate.next = firstPendingUpdate;
                  }
                  queue.pending = lastInterleavedUpdate;
                }
              }
              concurrentQueues = null;
            }
          }
          function enqueueConcurrentHookUpdate(fiber, queue, update, lane) {
            var interleaved = queue.interleaved;
            if (interleaved === null) {
              update.next = update;
              pushConcurrentUpdateQueue(queue);
            } else {
              update.next = interleaved.next;
              interleaved.next = update;
            }
            queue.interleaved = update;
            return markUpdateLaneFromFiberToRoot(fiber, lane);
          }
          function enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane) {
            var interleaved = queue.interleaved;
            if (interleaved === null) {
              update.next = update;
              pushConcurrentUpdateQueue(queue);
            } else {
              update.next = interleaved.next;
              interleaved.next = update;
            }
            queue.interleaved = update;
          }
          function enqueueConcurrentClassUpdate(fiber, queue, update, lane) {
            var interleaved = queue.interleaved;
            if (interleaved === null) {
              update.next = update;
              pushConcurrentUpdateQueue(queue);
            } else {
              update.next = interleaved.next;
              interleaved.next = update;
            }
            queue.interleaved = update;
            return markUpdateLaneFromFiberToRoot(fiber, lane);
          }
          function enqueueConcurrentRenderForLane(fiber, lane) {
            return markUpdateLaneFromFiberToRoot(fiber, lane);
          }
          var unsafe_markUpdateLaneFromFiberToRoot = markUpdateLaneFromFiberToRoot;
          function markUpdateLaneFromFiberToRoot(sourceFiber, lane) {
            sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane);
            var alternate = sourceFiber.alternate;
            if (alternate !== null) {
              alternate.lanes = mergeLanes(alternate.lanes, lane);
            }
            {
              if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) {
                warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
              }
            }
            var node = sourceFiber;
            var parent2 = sourceFiber.return;
            while (parent2 !== null) {
              parent2.childLanes = mergeLanes(parent2.childLanes, lane);
              alternate = parent2.alternate;
              if (alternate !== null) {
                alternate.childLanes = mergeLanes(alternate.childLanes, lane);
              } else {
                {
                  if ((parent2.flags & (Placement | Hydrating)) !== NoFlags) {
                    warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
                  }
                }
              }
              node = parent2;
              parent2 = parent2.return;
            }
            if (node.tag === HostRoot) {
              var root2 = node.stateNode;
              return root2;
            } else {
              return null;
            }
          }
          var UpdateState = 0;
          var ReplaceState = 1;
          var ForceUpdate = 2;
          var CaptureUpdate = 3;
          var hasForceUpdate = false;
          var didWarnUpdateInsideUpdate;
          var currentlyProcessingQueue;
          {
            didWarnUpdateInsideUpdate = false;
            currentlyProcessingQueue = null;
          }
          function initializeUpdateQueue(fiber) {
            var queue = {
              baseState: fiber.memoizedState,
              firstBaseUpdate: null,
              lastBaseUpdate: null,
              shared: {
                pending: null,
                interleaved: null,
                lanes: NoLanes
              },
              effects: null
            };
            fiber.updateQueue = queue;
          }
          function cloneUpdateQueue(current2, workInProgress2) {
            var queue = workInProgress2.updateQueue;
            var currentQueue = current2.updateQueue;
            if (queue === currentQueue) {
              var clone = {
                baseState: currentQueue.baseState,
                firstBaseUpdate: currentQueue.firstBaseUpdate,
                lastBaseUpdate: currentQueue.lastBaseUpdate,
                shared: currentQueue.shared,
                effects: currentQueue.effects
              };
              workInProgress2.updateQueue = clone;
            }
          }
          function createUpdate(eventTime, lane) {
            var update = {
              eventTime,
              lane,
              tag: UpdateState,
              payload: null,
              callback: null,
              next: null
            };
            return update;
          }
          function enqueueUpdate(fiber, update, lane) {
            var updateQueue = fiber.updateQueue;
            if (updateQueue === null) {
              return null;
            }
            var sharedQueue = updateQueue.shared;
            {
              if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {
                error("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.");
                didWarnUpdateInsideUpdate = true;
              }
            }
            if (isUnsafeClassRenderPhaseUpdate()) {
              var pending = sharedQueue.pending;
              if (pending === null) {
                update.next = update;
              } else {
                update.next = pending.next;
                pending.next = update;
              }
              sharedQueue.pending = update;
              return unsafe_markUpdateLaneFromFiberToRoot(fiber, lane);
            } else {
              return enqueueConcurrentClassUpdate(fiber, sharedQueue, update, lane);
            }
          }
          function entangleTransitions(root2, fiber, lane) {
            var updateQueue = fiber.updateQueue;
            if (updateQueue === null) {
              return;
            }
            var sharedQueue = updateQueue.shared;
            if (isTransitionLane(lane)) {
              var queueLanes = sharedQueue.lanes;
              queueLanes = intersectLanes(queueLanes, root2.pendingLanes);
              var newQueueLanes = mergeLanes(queueLanes, lane);
              sharedQueue.lanes = newQueueLanes;
              markRootEntangled(root2, newQueueLanes);
            }
          }
          function enqueueCapturedUpdate(workInProgress2, capturedUpdate) {
            var queue = workInProgress2.updateQueue;
            var current2 = workInProgress2.alternate;
            if (current2 !== null) {
              var currentQueue = current2.updateQueue;
              if (queue === currentQueue) {
                var newFirst = null;
                var newLast = null;
                var firstBaseUpdate = queue.firstBaseUpdate;
                if (firstBaseUpdate !== null) {
                  var update = firstBaseUpdate;
                  do {
                    var clone = {
                      eventTime: update.eventTime,
                      lane: update.lane,
                      tag: update.tag,
                      payload: update.payload,
                      callback: update.callback,
                      next: null
                    };
                    if (newLast === null) {
                      newFirst = newLast = clone;
                    } else {
                      newLast.next = clone;
                      newLast = clone;
                    }
                    update = update.next;
                  } while (update !== null);
                  if (newLast === null) {
                    newFirst = newLast = capturedUpdate;
                  } else {
                    newLast.next = capturedUpdate;
                    newLast = capturedUpdate;
                  }
                } else {
                  newFirst = newLast = capturedUpdate;
                }
                queue = {
                  baseState: currentQueue.baseState,
                  firstBaseUpdate: newFirst,
                  lastBaseUpdate: newLast,
                  shared: currentQueue.shared,
                  effects: currentQueue.effects
                };
                workInProgress2.updateQueue = queue;
                return;
              }
            }
            var lastBaseUpdate = queue.lastBaseUpdate;
            if (lastBaseUpdate === null) {
              queue.firstBaseUpdate = capturedUpdate;
            } else {
              lastBaseUpdate.next = capturedUpdate;
            }
            queue.lastBaseUpdate = capturedUpdate;
          }
          function getStateFromUpdate(workInProgress2, queue, update, prevState, nextProps, instance) {
            switch (update.tag) {
              case ReplaceState: {
                var payload = update.payload;
                if (typeof payload === "function") {
                  {
                    enterDisallowedContextReadInDEV();
                  }
                  var nextState = payload.call(instance, prevState, nextProps);
                  {
                    if (workInProgress2.mode & StrictLegacyMode) {
                      setIsStrictModeForDevtools(true);
                      try {
                        payload.call(instance, prevState, nextProps);
                      } finally {
                        setIsStrictModeForDevtools(false);
                      }
                    }
                    exitDisallowedContextReadInDEV();
                  }
                  return nextState;
                }
                return payload;
              }
              case CaptureUpdate: {
                workInProgress2.flags = workInProgress2.flags & ~ShouldCapture | DidCapture;
              }
              // Intentional fallthrough
              case UpdateState: {
                var _payload = update.payload;
                var partialState;
                if (typeof _payload === "function") {
                  {
                    enterDisallowedContextReadInDEV();
                  }
                  partialState = _payload.call(instance, prevState, nextProps);
                  {
                    if (workInProgress2.mode & StrictLegacyMode) {
                      setIsStrictModeForDevtools(true);
                      try {
                        _payload.call(instance, prevState, nextProps);
                      } finally {
                        setIsStrictModeForDevtools(false);
                      }
                    }
                    exitDisallowedContextReadInDEV();
                  }
                } else {
                  partialState = _payload;
                }
                if (partialState === null || partialState === void 0) {
                  return prevState;
                }
                return assign({}, prevState, partialState);
              }
              case ForceUpdate: {
                hasForceUpdate = true;
                return prevState;
              }
            }
            return prevState;
          }
          function processUpdateQueue(workInProgress2, props, instance, renderLanes2) {
            var queue = workInProgress2.updateQueue;
            hasForceUpdate = false;
            {
              currentlyProcessingQueue = queue.shared;
            }
            var firstBaseUpdate = queue.firstBaseUpdate;
            var lastBaseUpdate = queue.lastBaseUpdate;
            var pendingQueue = queue.shared.pending;
            if (pendingQueue !== null) {
              queue.shared.pending = null;
              var lastPendingUpdate = pendingQueue;
              var firstPendingUpdate = lastPendingUpdate.next;
              lastPendingUpdate.next = null;
              if (lastBaseUpdate === null) {
                firstBaseUpdate = firstPendingUpdate;
              } else {
                lastBaseUpdate.next = firstPendingUpdate;
              }
              lastBaseUpdate = lastPendingUpdate;
              var current2 = workInProgress2.alternate;
              if (current2 !== null) {
                var currentQueue = current2.updateQueue;
                var currentLastBaseUpdate = currentQueue.lastBaseUpdate;
                if (currentLastBaseUpdate !== lastBaseUpdate) {
                  if (currentLastBaseUpdate === null) {
                    currentQueue.firstBaseUpdate = firstPendingUpdate;
                  } else {
                    currentLastBaseUpdate.next = firstPendingUpdate;
                  }
                  currentQueue.lastBaseUpdate = lastPendingUpdate;
                }
              }
            }
            if (firstBaseUpdate !== null) {
              var newState = queue.baseState;
              var newLanes = NoLanes;
              var newBaseState = null;
              var newFirstBaseUpdate = null;
              var newLastBaseUpdate = null;
              var update = firstBaseUpdate;
              do {
                var updateLane = update.lane;
                var updateEventTime = update.eventTime;
                if (!isSubsetOfLanes(renderLanes2, updateLane)) {
                  var clone = {
                    eventTime: updateEventTime,
                    lane: updateLane,
                    tag: update.tag,
                    payload: update.payload,
                    callback: update.callback,
                    next: null
                  };
                  if (newLastBaseUpdate === null) {
                    newFirstBaseUpdate = newLastBaseUpdate = clone;
                    newBaseState = newState;
                  } else {
                    newLastBaseUpdate = newLastBaseUpdate.next = clone;
                  }
                  newLanes = mergeLanes(newLanes, updateLane);
                } else {
                  if (newLastBaseUpdate !== null) {
                    var _clone = {
                      eventTime: updateEventTime,
                      // This update is going to be committed so we never want uncommit
                      // it. Using NoLane works because 0 is a subset of all bitmasks, so
                      // this will never be skipped by the check above.
                      lane: NoLane,
                      tag: update.tag,
                      payload: update.payload,
                      callback: update.callback,
                      next: null
                    };
                    newLastBaseUpdate = newLastBaseUpdate.next = _clone;
                  }
                  newState = getStateFromUpdate(workInProgress2, queue, update, newState, props, instance);
                  var callback = update.callback;
                  if (callback !== null && // If the update was already committed, we should not queue its
                  // callback again.
                  update.lane !== NoLane) {
                    workInProgress2.flags |= Callback;
                    var effects = queue.effects;
                    if (effects === null) {
                      queue.effects = [update];
                    } else {
                      effects.push(update);
                    }
                  }
                }
                update = update.next;
                if (update === null) {
                  pendingQueue = queue.shared.pending;
                  if (pendingQueue === null) {
                    break;
                  } else {
                    var _lastPendingUpdate = pendingQueue;
                    var _firstPendingUpdate = _lastPendingUpdate.next;
                    _lastPendingUpdate.next = null;
                    update = _firstPendingUpdate;
                    queue.lastBaseUpdate = _lastPendingUpdate;
                    queue.shared.pending = null;
                  }
                }
              } while (true);
              if (newLastBaseUpdate === null) {
                newBaseState = newState;
              }
              queue.baseState = newBaseState;
              queue.firstBaseUpdate = newFirstBaseUpdate;
              queue.lastBaseUpdate = newLastBaseUpdate;
              var lastInterleaved = queue.shared.interleaved;
              if (lastInterleaved !== null) {
                var interleaved = lastInterleaved;
                do {
                  newLanes = mergeLanes(newLanes, interleaved.lane);
                  interleaved = interleaved.next;
                } while (interleaved !== lastInterleaved);
              } else if (firstBaseUpdate === null) {
                queue.shared.lanes = NoLanes;
              }
              markSkippedUpdateLanes(newLanes);
              workInProgress2.lanes = newLanes;
              workInProgress2.memoizedState = newState;
            }
            {
              currentlyProcessingQueue = null;
            }
          }
          function callCallback(callback, context) {
            if (typeof callback !== "function") {
              throw new Error("Invalid argument passed as callback. Expected a function. Instead " + ("received: " + callback));
            }
            callback.call(context);
          }
          function resetHasForceUpdateBeforeProcessing() {
            hasForceUpdate = false;
          }
          function checkHasForceUpdateAfterProcessing() {
            return hasForceUpdate;
          }
          function commitUpdateQueue(finishedWork, finishedQueue, instance) {
            var effects = finishedQueue.effects;
            finishedQueue.effects = null;
            if (effects !== null) {
              for (var i = 0; i < effects.length; i++) {
                var effect4 = effects[i];
                var callback = effect4.callback;
                if (callback !== null) {
                  effect4.callback = null;
                  callCallback(callback, instance);
                }
              }
            }
          }
          var NO_CONTEXT = {};
          var contextStackCursor$1 = createCursor(NO_CONTEXT);
          var contextFiberStackCursor = createCursor(NO_CONTEXT);
          var rootInstanceStackCursor = createCursor(NO_CONTEXT);
          function requiredContext(c2) {
            if (c2 === NO_CONTEXT) {
              throw new Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
            }
            return c2;
          }
          function getRootHostContainer() {
            var rootInstance = requiredContext(rootInstanceStackCursor.current);
            return rootInstance;
          }
          function pushHostContainer(fiber, nextRootInstance) {
            push(rootInstanceStackCursor, nextRootInstance, fiber);
            push(contextFiberStackCursor, fiber, fiber);
            push(contextStackCursor$1, NO_CONTEXT, fiber);
            var nextRootContext = getRootHostContext(nextRootInstance);
            pop(contextStackCursor$1, fiber);
            push(contextStackCursor$1, nextRootContext, fiber);
          }
          function popHostContainer(fiber) {
            pop(contextStackCursor$1, fiber);
            pop(contextFiberStackCursor, fiber);
            pop(rootInstanceStackCursor, fiber);
          }
          function getHostContext() {
            var context = requiredContext(contextStackCursor$1.current);
            return context;
          }
          function pushHostContext(fiber) {
            var rootInstance = requiredContext(rootInstanceStackCursor.current);
            var context = requiredContext(contextStackCursor$1.current);
            var nextContext = getChildHostContext(context, fiber.type);
            if (context === nextContext) {
              return;
            }
            push(contextFiberStackCursor, fiber, fiber);
            push(contextStackCursor$1, nextContext, fiber);
          }
          function popHostContext(fiber) {
            if (contextFiberStackCursor.current !== fiber) {
              return;
            }
            pop(contextStackCursor$1, fiber);
            pop(contextFiberStackCursor, fiber);
          }
          var DefaultSuspenseContext = 0;
          var SubtreeSuspenseContextMask = 1;
          var InvisibleParentSuspenseContext = 1;
          var ForceSuspenseFallback = 2;
          var suspenseStackCursor = createCursor(DefaultSuspenseContext);
          function hasSuspenseContext(parentContext, flag) {
            return (parentContext & flag) !== 0;
          }
          function setDefaultShallowSuspenseContext(parentContext) {
            return parentContext & SubtreeSuspenseContextMask;
          }
          function setShallowSuspenseContext(parentContext, shallowContext) {
            return parentContext & SubtreeSuspenseContextMask | shallowContext;
          }
          function addSubtreeSuspenseContext(parentContext, subtreeContext) {
            return parentContext | subtreeContext;
          }
          function pushSuspenseContext(fiber, newContext) {
            push(suspenseStackCursor, newContext, fiber);
          }
          function popSuspenseContext(fiber) {
            pop(suspenseStackCursor, fiber);
          }
          function shouldCaptureSuspense(workInProgress2, hasInvisibleParent) {
            var nextState = workInProgress2.memoizedState;
            if (nextState !== null) {
              if (nextState.dehydrated !== null) {
                return true;
              }
              return false;
            }
            var props = workInProgress2.memoizedProps;
            {
              return true;
            }
          }
          function findFirstSuspended(row) {
            var node = row;
            while (node !== null) {
              if (node.tag === SuspenseComponent) {
                var state = node.memoizedState;
                if (state !== null) {
                  var dehydrated = state.dehydrated;
                  if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {
                    return node;
                  }
                }
              } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't
              // keep track of whether it suspended or not.
              node.memoizedProps.revealOrder !== void 0) {
                var didSuspend = (node.flags & DidCapture) !== NoFlags;
                if (didSuspend) {
                  return node;
                }
              } else if (node.child !== null) {
                node.child.return = node;
                node = node.child;
                continue;
              }
              if (node === row) {
                return null;
              }
              while (node.sibling === null) {
                if (node.return === null || node.return === row) {
                  return null;
                }
                node = node.return;
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
            return null;
          }
          var NoFlags$1 = (
            /*   */
            0
          );
          var HasEffect = (
            /* */
            1
          );
          var Insertion = (
            /*  */
            2
          );
          var Layout = (
            /*    */
            4
          );
          var Passive$1 = (
            /*   */
            8
          );
          var workInProgressSources = [];
          function resetWorkInProgressVersions() {
            for (var i = 0; i < workInProgressSources.length; i++) {
              var mutableSource = workInProgressSources[i];
              {
                mutableSource._workInProgressVersionPrimary = null;
              }
            }
            workInProgressSources.length = 0;
          }
          function registerMutableSourceForHydration(root2, mutableSource) {
            var getVersion = mutableSource._getVersion;
            var version = getVersion(mutableSource._source);
            if (root2.mutableSourceEagerHydrationData == null) {
              root2.mutableSourceEagerHydrationData = [mutableSource, version];
            } else {
              root2.mutableSourceEagerHydrationData.push(mutableSource, version);
            }
          }
          var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig;
          var didWarnAboutMismatchedHooksForComponent;
          var didWarnUncachedGetSnapshot;
          {
            didWarnAboutMismatchedHooksForComponent = /* @__PURE__ */ new Set();
          }
          var renderLanes = NoLanes;
          var currentlyRenderingFiber$1 = null;
          var currentHook = null;
          var workInProgressHook = null;
          var didScheduleRenderPhaseUpdate = false;
          var didScheduleRenderPhaseUpdateDuringThisPass = false;
          var localIdCounter = 0;
          var globalClientIdCounter = 0;
          var RE_RENDER_LIMIT = 25;
          var currentHookNameInDev = null;
          var hookTypesDev = null;
          var hookTypesUpdateIndexDev = -1;
          var ignorePreviousDependencies = false;
          function mountHookTypesDev() {
            {
              var hookName = currentHookNameInDev;
              if (hookTypesDev === null) {
                hookTypesDev = [hookName];
              } else {
                hookTypesDev.push(hookName);
              }
            }
          }
          function updateHookTypesDev() {
            {
              var hookName = currentHookNameInDev;
              if (hookTypesDev !== null) {
                hookTypesUpdateIndexDev++;
                if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
                  warnOnHookMismatchInDev(hookName);
                }
              }
            }
          }
          function checkDepsAreArrayDev(deps) {
            {
              if (deps !== void 0 && deps !== null && !isArray(deps)) {
                error("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", currentHookNameInDev, typeof deps);
              }
            }
          }
          function warnOnHookMismatchInDev(currentHookName) {
            {
              var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1);
              if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
                didWarnAboutMismatchedHooksForComponent.add(componentName);
                if (hookTypesDev !== null) {
                  var table = "";
                  var secondColumnStart = 30;
                  for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
                    var oldHookName = hookTypesDev[i];
                    var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
                    var row = i + 1 + ". " + oldHookName;
                    while (row.length < secondColumnStart) {
                      row += " ";
                    }
                    row += newHookName + "\n";
                    table += row;
                  }
                  error("React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks\n\n   Previous render            Next render\n   ------------------------------------------------------\n%s   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", componentName, table);
                }
              }
            }
          }
          function throwInvalidHookError() {
            throw new Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
          }
          function areHookInputsEqual(nextDeps, prevDeps) {
            {
              if (ignorePreviousDependencies) {
                return false;
              }
            }
            if (prevDeps === null) {
              {
                error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", currentHookNameInDev);
              }
              return false;
            }
            {
              if (nextDeps.length !== prevDeps.length) {
                error("The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + nextDeps.join(", ") + "]");
              }
            }
            for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
              if (objectIs(nextDeps[i], prevDeps[i])) {
                continue;
              }
              return false;
            }
            return true;
          }
          function renderWithHooks(current2, workInProgress2, Component40, props, secondArg, nextRenderLanes) {
            renderLanes = nextRenderLanes;
            currentlyRenderingFiber$1 = workInProgress2;
            {
              hookTypesDev = current2 !== null ? current2._debugHookTypes : null;
              hookTypesUpdateIndexDev = -1;
              ignorePreviousDependencies = current2 !== null && current2.type !== workInProgress2.type;
            }
            workInProgress2.memoizedState = null;
            workInProgress2.updateQueue = null;
            workInProgress2.lanes = NoLanes;
            {
              if (current2 !== null && current2.memoizedState !== null) {
                ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
              } else if (hookTypesDev !== null) {
                ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
              } else {
                ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
              }
            }
            var children = Component40(props, secondArg);
            if (didScheduleRenderPhaseUpdateDuringThisPass) {
              var numberOfReRenders = 0;
              do {
                didScheduleRenderPhaseUpdateDuringThisPass = false;
                localIdCounter = 0;
                if (numberOfReRenders >= RE_RENDER_LIMIT) {
                  throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
                }
                numberOfReRenders += 1;
                {
                  ignorePreviousDependencies = false;
                }
                currentHook = null;
                workInProgressHook = null;
                workInProgress2.updateQueue = null;
                {
                  hookTypesUpdateIndexDev = -1;
                }
                ReactCurrentDispatcher$1.current = HooksDispatcherOnRerenderInDEV;
                children = Component40(props, secondArg);
              } while (didScheduleRenderPhaseUpdateDuringThisPass);
            }
            ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
            {
              workInProgress2._debugHookTypes = hookTypesDev;
            }
            var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
            renderLanes = NoLanes;
            currentlyRenderingFiber$1 = null;
            currentHook = null;
            workInProgressHook = null;
            {
              currentHookNameInDev = null;
              hookTypesDev = null;
              hookTypesUpdateIndexDev = -1;
              if (current2 !== null && (current2.flags & StaticMask) !== (workInProgress2.flags & StaticMask) && // Disable this warning in legacy mode, because legacy Suspense is weird
              // and creates false positives. To make this work in legacy mode, we'd
              // need to mark fibers that commit in an incomplete state, somehow. For
              // now I'll disable the warning that most of the bugs that would trigger
              // it are either exclusive to concurrent mode or exist in both.
              (current2.mode & ConcurrentMode) !== NoMode) {
                error("Internal React error: Expected static flag was missing. Please notify the React team.");
              }
            }
            didScheduleRenderPhaseUpdate = false;
            if (didRenderTooFewHooks) {
              throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
            }
            return children;
          }
          function checkDidRenderIdHook() {
            var didRenderIdHook = localIdCounter !== 0;
            localIdCounter = 0;
            return didRenderIdHook;
          }
          function bailoutHooks(current2, workInProgress2, lanes) {
            workInProgress2.updateQueue = current2.updateQueue;
            if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
              workInProgress2.flags &= ~(MountPassiveDev | MountLayoutDev | Passive | Update);
            } else {
              workInProgress2.flags &= ~(Passive | Update);
            }
            current2.lanes = removeLanes(current2.lanes, lanes);
          }
          function resetHooksAfterThrow() {
            ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
            if (didScheduleRenderPhaseUpdate) {
              var hook = currentlyRenderingFiber$1.memoizedState;
              while (hook !== null) {
                var queue = hook.queue;
                if (queue !== null) {
                  queue.pending = null;
                }
                hook = hook.next;
              }
              didScheduleRenderPhaseUpdate = false;
            }
            renderLanes = NoLanes;
            currentlyRenderingFiber$1 = null;
            currentHook = null;
            workInProgressHook = null;
            {
              hookTypesDev = null;
              hookTypesUpdateIndexDev = -1;
              currentHookNameInDev = null;
              isUpdatingOpaqueValueInRenderPhase = false;
            }
            didScheduleRenderPhaseUpdateDuringThisPass = false;
            localIdCounter = 0;
          }
          function mountWorkInProgressHook() {
            var hook = {
              memoizedState: null,
              baseState: null,
              baseQueue: null,
              queue: null,
              next: null
            };
            if (workInProgressHook === null) {
              currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;
            } else {
              workInProgressHook = workInProgressHook.next = hook;
            }
            return workInProgressHook;
          }
          function updateWorkInProgressHook() {
            var nextCurrentHook;
            if (currentHook === null) {
              var current2 = currentlyRenderingFiber$1.alternate;
              if (current2 !== null) {
                nextCurrentHook = current2.memoizedState;
              } else {
                nextCurrentHook = null;
              }
            } else {
              nextCurrentHook = currentHook.next;
            }
            var nextWorkInProgressHook;
            if (workInProgressHook === null) {
              nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;
            } else {
              nextWorkInProgressHook = workInProgressHook.next;
            }
            if (nextWorkInProgressHook !== null) {
              workInProgressHook = nextWorkInProgressHook;
              nextWorkInProgressHook = workInProgressHook.next;
              currentHook = nextCurrentHook;
            } else {
              if (nextCurrentHook === null) {
                throw new Error("Rendered more hooks than during the previous render.");
              }
              currentHook = nextCurrentHook;
              var newHook = {
                memoizedState: currentHook.memoizedState,
                baseState: currentHook.baseState,
                baseQueue: currentHook.baseQueue,
                queue: currentHook.queue,
                next: null
              };
              if (workInProgressHook === null) {
                currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;
              } else {
                workInProgressHook = workInProgressHook.next = newHook;
              }
            }
            return workInProgressHook;
          }
          function createFunctionComponentUpdateQueue() {
            return {
              lastEffect: null,
              stores: null
            };
          }
          function basicStateReducer(state, action) {
            return typeof action === "function" ? action(state) : action;
          }
          function mountReducer(reducer2, initialArg, init) {
            var hook = mountWorkInProgressHook();
            var initialState2;
            if (init !== void 0) {
              initialState2 = init(initialArg);
            } else {
              initialState2 = initialArg;
            }
            hook.memoizedState = hook.baseState = initialState2;
            var queue = {
              pending: null,
              interleaved: null,
              lanes: NoLanes,
              dispatch: null,
              lastRenderedReducer: reducer2,
              lastRenderedState: initialState2
            };
            hook.queue = queue;
            var dispatch = queue.dispatch = dispatchReducerAction.bind(null, currentlyRenderingFiber$1, queue);
            return [hook.memoizedState, dispatch];
          }
          function updateReducer(reducer2, initialArg, init) {
            var hook = updateWorkInProgressHook();
            var queue = hook.queue;
            if (queue === null) {
              throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");
            }
            queue.lastRenderedReducer = reducer2;
            var current2 = currentHook;
            var baseQueue = current2.baseQueue;
            var pendingQueue = queue.pending;
            if (pendingQueue !== null) {
              if (baseQueue !== null) {
                var baseFirst = baseQueue.next;
                var pendingFirst = pendingQueue.next;
                baseQueue.next = pendingFirst;
                pendingQueue.next = baseFirst;
              }
              {
                if (current2.baseQueue !== baseQueue) {
                  error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React.");
                }
              }
              current2.baseQueue = baseQueue = pendingQueue;
              queue.pending = null;
            }
            if (baseQueue !== null) {
              var first = baseQueue.next;
              var newState = current2.baseState;
              var newBaseState = null;
              var newBaseQueueFirst = null;
              var newBaseQueueLast = null;
              var update = first;
              do {
                var updateLane = update.lane;
                if (!isSubsetOfLanes(renderLanes, updateLane)) {
                  var clone = {
                    lane: updateLane,
                    action: update.action,
                    hasEagerState: update.hasEagerState,
                    eagerState: update.eagerState,
                    next: null
                  };
                  if (newBaseQueueLast === null) {
                    newBaseQueueFirst = newBaseQueueLast = clone;
                    newBaseState = newState;
                  } else {
                    newBaseQueueLast = newBaseQueueLast.next = clone;
                  }
                  currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane);
                  markSkippedUpdateLanes(updateLane);
                } else {
                  if (newBaseQueueLast !== null) {
                    var _clone = {
                      // This update is going to be committed so we never want uncommit
                      // it. Using NoLane works because 0 is a subset of all bitmasks, so
                      // this will never be skipped by the check above.
                      lane: NoLane,
                      action: update.action,
                      hasEagerState: update.hasEagerState,
                      eagerState: update.eagerState,
                      next: null
                    };
                    newBaseQueueLast = newBaseQueueLast.next = _clone;
                  }
                  if (update.hasEagerState) {
                    newState = update.eagerState;
                  } else {
                    var action = update.action;
                    newState = reducer2(newState, action);
                  }
                }
                update = update.next;
              } while (update !== null && update !== first);
              if (newBaseQueueLast === null) {
                newBaseState = newState;
              } else {
                newBaseQueueLast.next = newBaseQueueFirst;
              }
              if (!objectIs(newState, hook.memoizedState)) {
                markWorkInProgressReceivedUpdate();
              }
              hook.memoizedState = newState;
              hook.baseState = newBaseState;
              hook.baseQueue = newBaseQueueLast;
              queue.lastRenderedState = newState;
            }
            var lastInterleaved = queue.interleaved;
            if (lastInterleaved !== null) {
              var interleaved = lastInterleaved;
              do {
                var interleavedLane = interleaved.lane;
                currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, interleavedLane);
                markSkippedUpdateLanes(interleavedLane);
                interleaved = interleaved.next;
              } while (interleaved !== lastInterleaved);
            } else if (baseQueue === null) {
              queue.lanes = NoLanes;
            }
            var dispatch = queue.dispatch;
            return [hook.memoizedState, dispatch];
          }
          function rerenderReducer(reducer2, initialArg, init) {
            var hook = updateWorkInProgressHook();
            var queue = hook.queue;
            if (queue === null) {
              throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");
            }
            queue.lastRenderedReducer = reducer2;
            var dispatch = queue.dispatch;
            var lastRenderPhaseUpdate = queue.pending;
            var newState = hook.memoizedState;
            if (lastRenderPhaseUpdate !== null) {
              queue.pending = null;
              var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;
              var update = firstRenderPhaseUpdate;
              do {
                var action = update.action;
                newState = reducer2(newState, action);
                update = update.next;
              } while (update !== firstRenderPhaseUpdate);
              if (!objectIs(newState, hook.memoizedState)) {
                markWorkInProgressReceivedUpdate();
              }
              hook.memoizedState = newState;
              if (hook.baseQueue === null) {
                hook.baseState = newState;
              }
              queue.lastRenderedState = newState;
            }
            return [newState, dispatch];
          }
          function mountMutableSource(source, getSnapshot, subscribe) {
            {
              return void 0;
            }
          }
          function updateMutableSource(source, getSnapshot, subscribe) {
            {
              return void 0;
            }
          }
          function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
            var fiber = currentlyRenderingFiber$1;
            var hook = mountWorkInProgressHook();
            var nextSnapshot;
            var isHydrating2 = getIsHydrating();
            if (isHydrating2) {
              if (getServerSnapshot === void 0) {
                throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");
              }
              nextSnapshot = getServerSnapshot();
              {
                if (!didWarnUncachedGetSnapshot) {
                  if (nextSnapshot !== getServerSnapshot()) {
                    error("The result of getServerSnapshot should be cached to avoid an infinite loop");
                    didWarnUncachedGetSnapshot = true;
                  }
                }
              }
            } else {
              nextSnapshot = getSnapshot();
              {
                if (!didWarnUncachedGetSnapshot) {
                  var cachedSnapshot = getSnapshot();
                  if (!objectIs(nextSnapshot, cachedSnapshot)) {
                    error("The result of getSnapshot should be cached to avoid an infinite loop");
                    didWarnUncachedGetSnapshot = true;
                  }
                }
              }
              var root2 = getWorkInProgressRoot();
              if (root2 === null) {
                throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
              }
              if (!includesBlockingLane(root2, renderLanes)) {
                pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
              }
            }
            hook.memoizedState = nextSnapshot;
            var inst = {
              value: nextSnapshot,
              getSnapshot
            };
            hook.queue = inst;
            mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]);
            fiber.flags |= Passive;
            pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null);
            return nextSnapshot;
          }
          function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
            var fiber = currentlyRenderingFiber$1;
            var hook = updateWorkInProgressHook();
            var nextSnapshot = getSnapshot();
            {
              if (!didWarnUncachedGetSnapshot) {
                var cachedSnapshot = getSnapshot();
                if (!objectIs(nextSnapshot, cachedSnapshot)) {
                  error("The result of getSnapshot should be cached to avoid an infinite loop");
                  didWarnUncachedGetSnapshot = true;
                }
              }
            }
            var prevSnapshot = hook.memoizedState;
            var snapshotChanged = !objectIs(prevSnapshot, nextSnapshot);
            if (snapshotChanged) {
              hook.memoizedState = nextSnapshot;
              markWorkInProgressReceivedUpdate();
            }
            var inst = hook.queue;
            updateEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]);
            if (inst.getSnapshot !== getSnapshot || snapshotChanged || // Check if the susbcribe function changed. We can save some memory by
            // checking whether we scheduled a subscription effect above.
            workInProgressHook !== null && workInProgressHook.memoizedState.tag & HasEffect) {
              fiber.flags |= Passive;
              pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null);
              var root2 = getWorkInProgressRoot();
              if (root2 === null) {
                throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
              }
              if (!includesBlockingLane(root2, renderLanes)) {
                pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
              }
            }
            return nextSnapshot;
          }
          function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
            fiber.flags |= StoreConsistency;
            var check = {
              getSnapshot,
              value: renderedSnapshot
            };
            var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
            if (componentUpdateQueue === null) {
              componentUpdateQueue = createFunctionComponentUpdateQueue();
              currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
              componentUpdateQueue.stores = [check];
            } else {
              var stores = componentUpdateQueue.stores;
              if (stores === null) {
                componentUpdateQueue.stores = [check];
              } else {
                stores.push(check);
              }
            }
          }
          function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
            inst.value = nextSnapshot;
            inst.getSnapshot = getSnapshot;
            if (checkIfSnapshotChanged(inst)) {
              forceStoreRerender(fiber);
            }
          }
          function subscribeToStore(fiber, inst, subscribe) {
            var handleStoreChange = function() {
              if (checkIfSnapshotChanged(inst)) {
                forceStoreRerender(fiber);
              }
            };
            return subscribe(handleStoreChange);
          }
          function checkIfSnapshotChanged(inst) {
            var latestGetSnapshot = inst.getSnapshot;
            var prevValue = inst.value;
            try {
              var nextValue = latestGetSnapshot();
              return !objectIs(prevValue, nextValue);
            } catch (error2) {
              return true;
            }
          }
          function forceStoreRerender(fiber) {
            var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
            if (root2 !== null) {
              scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
            }
          }
          function mountState(initialState2) {
            var hook = mountWorkInProgressHook();
            if (typeof initialState2 === "function") {
              initialState2 = initialState2();
            }
            hook.memoizedState = hook.baseState = initialState2;
            var queue = {
              pending: null,
              interleaved: null,
              lanes: NoLanes,
              dispatch: null,
              lastRenderedReducer: basicStateReducer,
              lastRenderedState: initialState2
            };
            hook.queue = queue;
            var dispatch = queue.dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue);
            return [hook.memoizedState, dispatch];
          }
          function updateState(initialState2) {
            return updateReducer(basicStateReducer);
          }
          function rerenderState(initialState2) {
            return rerenderReducer(basicStateReducer);
          }
          function pushEffect(tag, create, destroy, deps) {
            var effect4 = {
              tag,
              create,
              destroy,
              deps,
              // Circular
              next: null
            };
            var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
            if (componentUpdateQueue === null) {
              componentUpdateQueue = createFunctionComponentUpdateQueue();
              currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
              componentUpdateQueue.lastEffect = effect4.next = effect4;
            } else {
              var lastEffect = componentUpdateQueue.lastEffect;
              if (lastEffect === null) {
                componentUpdateQueue.lastEffect = effect4.next = effect4;
              } else {
                var firstEffect = lastEffect.next;
                lastEffect.next = effect4;
                effect4.next = firstEffect;
                componentUpdateQueue.lastEffect = effect4;
              }
            }
            return effect4;
          }
          function mountRef(initialValue) {
            var hook = mountWorkInProgressHook();
            {
              var _ref2 = {
                current: initialValue
              };
              hook.memoizedState = _ref2;
              return _ref2;
            }
          }
          function updateRef(initialValue) {
            var hook = updateWorkInProgressHook();
            return hook.memoizedState;
          }
          function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
            var hook = mountWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            currentlyRenderingFiber$1.flags |= fiberFlags;
            hook.memoizedState = pushEffect(HasEffect | hookFlags, create, void 0, nextDeps);
          }
          function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
            var hook = updateWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            var destroy = void 0;
            if (currentHook !== null) {
              var prevEffect = currentHook.memoizedState;
              destroy = prevEffect.destroy;
              if (nextDeps !== null) {
                var prevDeps = prevEffect.deps;
                if (areHookInputsEqual(nextDeps, prevDeps)) {
                  hook.memoizedState = pushEffect(hookFlags, create, destroy, nextDeps);
                  return;
                }
              }
            }
            currentlyRenderingFiber$1.flags |= fiberFlags;
            hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps);
          }
          function mountEffect(create, deps) {
            if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
              return mountEffectImpl(MountPassiveDev | Passive | PassiveStatic, Passive$1, create, deps);
            } else {
              return mountEffectImpl(Passive | PassiveStatic, Passive$1, create, deps);
            }
          }
          function updateEffect(create, deps) {
            return updateEffectImpl(Passive, Passive$1, create, deps);
          }
          function mountInsertionEffect(create, deps) {
            return mountEffectImpl(Update, Insertion, create, deps);
          }
          function updateInsertionEffect(create, deps) {
            return updateEffectImpl(Update, Insertion, create, deps);
          }
          function mountLayoutEffect(create, deps) {
            var fiberFlags = Update;
            {
              fiberFlags |= LayoutStatic;
            }
            if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
              fiberFlags |= MountLayoutDev;
            }
            return mountEffectImpl(fiberFlags, Layout, create, deps);
          }
          function updateLayoutEffect(create, deps) {
            return updateEffectImpl(Update, Layout, create, deps);
          }
          function imperativeHandleEffect(create, ref) {
            if (typeof ref === "function") {
              var refCallback = ref;
              var _inst = create();
              refCallback(_inst);
              return function() {
                refCallback(null);
              };
            } else if (ref !== null && ref !== void 0) {
              var refObject = ref;
              {
                if (!refObject.hasOwnProperty("current")) {
                  error("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", "an object with keys {" + Object.keys(refObject).join(", ") + "}");
                }
              }
              var _inst2 = create();
              refObject.current = _inst2;
              return function() {
                refObject.current = null;
              };
            }
          }
          function mountImperativeHandle(ref, create, deps) {
            {
              if (typeof create !== "function") {
                error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null");
              }
            }
            var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
            var fiberFlags = Update;
            {
              fiberFlags |= LayoutStatic;
            }
            if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
              fiberFlags |= MountLayoutDev;
            }
            return mountEffectImpl(fiberFlags, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
          }
          function updateImperativeHandle(ref, create, deps) {
            {
              if (typeof create !== "function") {
                error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null");
              }
            }
            var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
            return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
          }
          function mountDebugValue(value, formatterFn) {
          }
          var updateDebugValue = mountDebugValue;
          function mountCallback(callback, deps) {
            var hook = mountWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            hook.memoizedState = [callback, nextDeps];
            return callback;
          }
          function updateCallback(callback, deps) {
            var hook = updateWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            var prevState = hook.memoizedState;
            if (prevState !== null) {
              if (nextDeps !== null) {
                var prevDeps = prevState[1];
                if (areHookInputsEqual(nextDeps, prevDeps)) {
                  return prevState[0];
                }
              }
            }
            hook.memoizedState = [callback, nextDeps];
            return callback;
          }
          function mountMemo(nextCreate, deps) {
            var hook = mountWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            var nextValue = nextCreate();
            hook.memoizedState = [nextValue, nextDeps];
            return nextValue;
          }
          function updateMemo(nextCreate, deps) {
            var hook = updateWorkInProgressHook();
            var nextDeps = deps === void 0 ? null : deps;
            var prevState = hook.memoizedState;
            if (prevState !== null) {
              if (nextDeps !== null) {
                var prevDeps = prevState[1];
                if (areHookInputsEqual(nextDeps, prevDeps)) {
                  return prevState[0];
                }
              }
            }
            var nextValue = nextCreate();
            hook.memoizedState = [nextValue, nextDeps];
            return nextValue;
          }
          function mountDeferredValue(value) {
            var hook = mountWorkInProgressHook();
            hook.memoizedState = value;
            return value;
          }
          function updateDeferredValue(value) {
            var hook = updateWorkInProgressHook();
            var resolvedCurrentHook = currentHook;
            var prevValue = resolvedCurrentHook.memoizedState;
            return updateDeferredValueImpl(hook, prevValue, value);
          }
          function rerenderDeferredValue(value) {
            var hook = updateWorkInProgressHook();
            if (currentHook === null) {
              hook.memoizedState = value;
              return value;
            } else {
              var prevValue = currentHook.memoizedState;
              return updateDeferredValueImpl(hook, prevValue, value);
            }
          }
          function updateDeferredValueImpl(hook, prevValue, value) {
            var shouldDeferValue = !includesOnlyNonUrgentLanes(renderLanes);
            if (shouldDeferValue) {
              if (!objectIs(value, prevValue)) {
                var deferredLane = claimNextTransitionLane();
                currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, deferredLane);
                markSkippedUpdateLanes(deferredLane);
                hook.baseState = true;
              }
              return prevValue;
            } else {
              if (hook.baseState) {
                hook.baseState = false;
                markWorkInProgressReceivedUpdate();
              }
              hook.memoizedState = value;
              return value;
            }
          }
          function startTransition(setPending, callback, options6) {
            var previousPriority = getCurrentUpdatePriority();
            setCurrentUpdatePriority(higherEventPriority(previousPriority, ContinuousEventPriority));
            setPending(true);
            var prevTransition = ReactCurrentBatchConfig$2.transition;
            ReactCurrentBatchConfig$2.transition = {};
            var currentTransition = ReactCurrentBatchConfig$2.transition;
            {
              ReactCurrentBatchConfig$2.transition._updatedFibers = /* @__PURE__ */ new Set();
            }
            try {
              setPending(false);
              callback();
            } finally {
              setCurrentUpdatePriority(previousPriority);
              ReactCurrentBatchConfig$2.transition = prevTransition;
              {
                if (prevTransition === null && currentTransition._updatedFibers) {
                  var updatedFibersCount = currentTransition._updatedFibers.size;
                  if (updatedFibersCount > 10) {
                    warn2("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");
                  }
                  currentTransition._updatedFibers.clear();
                }
              }
            }
          }
          function mountTransition() {
            var _mountState = mountState(false), isPending = _mountState[0], setPending = _mountState[1];
            var start2 = startTransition.bind(null, setPending);
            var hook = mountWorkInProgressHook();
            hook.memoizedState = start2;
            return [isPending, start2];
          }
          function updateTransition() {
            var _updateState = updateState(), isPending = _updateState[0];
            var hook = updateWorkInProgressHook();
            var start2 = hook.memoizedState;
            return [isPending, start2];
          }
          function rerenderTransition() {
            var _rerenderState = rerenderState(), isPending = _rerenderState[0];
            var hook = updateWorkInProgressHook();
            var start2 = hook.memoizedState;
            return [isPending, start2];
          }
          var isUpdatingOpaqueValueInRenderPhase = false;
          function getIsUpdatingOpaqueValueInRenderPhaseInDEV() {
            {
              return isUpdatingOpaqueValueInRenderPhase;
            }
          }
          function mountId() {
            var hook = mountWorkInProgressHook();
            var root2 = getWorkInProgressRoot();
            var identifierPrefix = root2.identifierPrefix;
            var id;
            if (getIsHydrating()) {
              var treeId = getTreeId();
              id = ":" + identifierPrefix + "R" + treeId;
              var localId = localIdCounter++;
              if (localId > 0) {
                id += "H" + localId.toString(32);
              }
              id += ":";
            } else {
              var globalClientId = globalClientIdCounter++;
              id = ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":";
            }
            hook.memoizedState = id;
            return id;
          }
          function updateId() {
            var hook = updateWorkInProgressHook();
            var id = hook.memoizedState;
            return id;
          }
          function dispatchReducerAction(fiber, queue, action) {
            {
              if (typeof arguments[3] === "function") {
                error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");
              }
            }
            var lane = requestUpdateLane(fiber);
            var update = {
              lane,
              action,
              hasEagerState: false,
              eagerState: null,
              next: null
            };
            if (isRenderPhaseUpdate(fiber)) {
              enqueueRenderPhaseUpdate(queue, update);
            } else {
              var root2 = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
              if (root2 !== null) {
                var eventTime = requestEventTime();
                scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
                entangleTransitionUpdate(root2, queue, lane);
              }
            }
            markUpdateInDevTools(fiber, lane);
          }
          function dispatchSetState(fiber, queue, action) {
            {
              if (typeof arguments[3] === "function") {
                error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");
              }
            }
            var lane = requestUpdateLane(fiber);
            var update = {
              lane,
              action,
              hasEagerState: false,
              eagerState: null,
              next: null
            };
            if (isRenderPhaseUpdate(fiber)) {
              enqueueRenderPhaseUpdate(queue, update);
            } else {
              var alternate = fiber.alternate;
              if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) {
                var lastRenderedReducer = queue.lastRenderedReducer;
                if (lastRenderedReducer !== null) {
                  var prevDispatcher;
                  {
                    prevDispatcher = ReactCurrentDispatcher$1.current;
                    ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                  }
                  try {
                    var currentState = queue.lastRenderedState;
                    var eagerState = lastRenderedReducer(currentState, action);
                    update.hasEagerState = true;
                    update.eagerState = eagerState;
                    if (objectIs(eagerState, currentState)) {
                      enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane);
                      return;
                    }
                  } catch (error2) {
                  } finally {
                    {
                      ReactCurrentDispatcher$1.current = prevDispatcher;
                    }
                  }
                }
              }
              var root2 = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
              if (root2 !== null) {
                var eventTime = requestEventTime();
                scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
                entangleTransitionUpdate(root2, queue, lane);
              }
            }
            markUpdateInDevTools(fiber, lane);
          }
          function isRenderPhaseUpdate(fiber) {
            var alternate = fiber.alternate;
            return fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1;
          }
          function enqueueRenderPhaseUpdate(queue, update) {
            didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
            var pending = queue.pending;
            if (pending === null) {
              update.next = update;
            } else {
              update.next = pending.next;
              pending.next = update;
            }
            queue.pending = update;
          }
          function entangleTransitionUpdate(root2, queue, lane) {
            if (isTransitionLane(lane)) {
              var queueLanes = queue.lanes;
              queueLanes = intersectLanes(queueLanes, root2.pendingLanes);
              var newQueueLanes = mergeLanes(queueLanes, lane);
              queue.lanes = newQueueLanes;
              markRootEntangled(root2, newQueueLanes);
            }
          }
          function markUpdateInDevTools(fiber, lane, action) {
            {
              markStateUpdateScheduled(fiber, lane);
            }
          }
          var ContextOnlyDispatcher = {
            readContext,
            useCallback: throwInvalidHookError,
            useContext: throwInvalidHookError,
            useEffect: throwInvalidHookError,
            useImperativeHandle: throwInvalidHookError,
            useInsertionEffect: throwInvalidHookError,
            useLayoutEffect: throwInvalidHookError,
            useMemo: throwInvalidHookError,
            useReducer: throwInvalidHookError,
            useRef: throwInvalidHookError,
            useState: throwInvalidHookError,
            useDebugValue: throwInvalidHookError,
            useDeferredValue: throwInvalidHookError,
            useTransition: throwInvalidHookError,
            useMutableSource: throwInvalidHookError,
            useSyncExternalStore: throwInvalidHookError,
            useId: throwInvalidHookError,
            unstable_isNewReconciler: enableNewReconciler
          };
          var HooksDispatcherOnMountInDEV = null;
          var HooksDispatcherOnMountWithHookTypesInDEV = null;
          var HooksDispatcherOnUpdateInDEV = null;
          var HooksDispatcherOnRerenderInDEV = null;
          var InvalidNestedHooksDispatcherOnMountInDEV = null;
          var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
          var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
          {
            var warnInvalidContextAccess = function() {
              error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
            };
            var warnInvalidHookAccess = function() {
              error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks");
            };
            HooksDispatcherOnMountInDEV = {
              readContext: function(context) {
                return readContext(context);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountCallback(callback, deps);
              },
              useContext: function(context) {
                currentHookNameInDev = "useContext";
                mountHookTypesDev();
                return readContext(context);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountImperativeHandle(ref, create, deps);
              },
              useInsertionEffect: function(create, deps) {
                currentHookNameInDev = "useInsertionEffect";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountInsertionEffect(create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                return mountLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                mountHookTypesDev();
                checkDepsAreArrayDev(deps);
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer2, initialArg, init) {
                currentHookNameInDev = "useReducer";
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountReducer(reducer2, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                mountHookTypesDev();
                return mountRef(initialValue);
              },
              useState: function(initialState2) {
                currentHookNameInDev = "useState";
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountState(initialState2);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                mountHookTypesDev();
                return mountDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                mountHookTypesDev();
                return mountDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                mountHookTypesDev();
                return mountTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                mountHookTypesDev();
                return mountMutableSource();
              },
              useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
                currentHookNameInDev = "useSyncExternalStore";
                mountHookTypesDev();
                return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
              },
              useId: function() {
                currentHookNameInDev = "useId";
                mountHookTypesDev();
                return mountId();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            HooksDispatcherOnMountWithHookTypesInDEV = {
              readContext: function(context) {
                return readContext(context);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                updateHookTypesDev();
                return mountCallback(callback, deps);
              },
              useContext: function(context) {
                currentHookNameInDev = "useContext";
                updateHookTypesDev();
                return readContext(context);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                updateHookTypesDev();
                return mountEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                updateHookTypesDev();
                return mountImperativeHandle(ref, create, deps);
              },
              useInsertionEffect: function(create, deps) {
                currentHookNameInDev = "useInsertionEffect";
                updateHookTypesDev();
                return mountInsertionEffect(create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                updateHookTypesDev();
                return mountLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer2, initialArg, init) {
                currentHookNameInDev = "useReducer";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountReducer(reducer2, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                updateHookTypesDev();
                return mountRef(initialValue);
              },
              useState: function(initialState2) {
                currentHookNameInDev = "useState";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountState(initialState2);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                updateHookTypesDev();
                return mountDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                updateHookTypesDev();
                return mountDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                updateHookTypesDev();
                return mountTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                updateHookTypesDev();
                return mountMutableSource();
              },
              useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
                currentHookNameInDev = "useSyncExternalStore";
                updateHookTypesDev();
                return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
              },
              useId: function() {
                currentHookNameInDev = "useId";
                updateHookTypesDev();
                return mountId();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            HooksDispatcherOnUpdateInDEV = {
              readContext: function(context) {
                return readContext(context);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                updateHookTypesDev();
                return updateCallback(callback, deps);
              },
              useContext: function(context) {
                currentHookNameInDev = "useContext";
                updateHookTypesDev();
                return readContext(context);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                updateHookTypesDev();
                return updateEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                updateHookTypesDev();
                return updateImperativeHandle(ref, create, deps);
              },
              useInsertionEffect: function(create, deps) {
                currentHookNameInDev = "useInsertionEffect";
                updateHookTypesDev();
                return updateInsertionEffect(create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                updateHookTypesDev();
                return updateLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer2, initialArg, init) {
                currentHookNameInDev = "useReducer";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateReducer(reducer2, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                updateHookTypesDev();
                return updateRef();
              },
              useState: function(initialState2) {
                currentHookNameInDev = "useState";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateState(initialState2);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                updateHookTypesDev();
                return updateDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                updateHookTypesDev();
                return updateDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                updateHookTypesDev();
                return updateTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                updateHookTypesDev();
                return updateMutableSource();
              },
              useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
                currentHookNameInDev = "useSyncExternalStore";
                updateHookTypesDev();
                return updateSyncExternalStore(subscribe, getSnapshot);
              },
              useId: function() {
                currentHookNameInDev = "useId";
                updateHookTypesDev();
                return updateId();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            HooksDispatcherOnRerenderInDEV = {
              readContext: function(context) {
                return readContext(context);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                updateHookTypesDev();
                return updateCallback(callback, deps);
              },
              useContext: function(context) {
                currentHookNameInDev = "useContext";
                updateHookTypesDev();
                return readContext(context);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                updateHookTypesDev();
                return updateEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                updateHookTypesDev();
                return updateImperativeHandle(ref, create, deps);
              },
              useInsertionEffect: function(create, deps) {
                currentHookNameInDev = "useInsertionEffect";
                updateHookTypesDev();
                return updateInsertionEffect(create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                updateHookTypesDev();
                return updateLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
                try {
                  return updateMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer2, initialArg, init) {
                currentHookNameInDev = "useReducer";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
                try {
                  return rerenderReducer(reducer2, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                updateHookTypesDev();
                return updateRef();
              },
              useState: function(initialState2) {
                currentHookNameInDev = "useState";
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
                try {
                  return rerenderState(initialState2);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                updateHookTypesDev();
                return updateDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                updateHookTypesDev();
                return rerenderDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                updateHookTypesDev();
                return rerenderTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                updateHookTypesDev();
                return updateMutableSource();
              },
              useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
                currentHookNameInDev = "useSyncExternalStore";
                updateHookTypesDev();
                return updateSyncExternalStore(subscribe, getSnapshot);
              },
              useId: function() {
                currentHookNameInDev = "useId";
                updateHookTypesDev();
                return updateId();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            InvalidNestedHooksDispatcherOnMountInDEV = {
              readContext: function(context) {
                warnInvalidContextAccess();
                return readContext(context);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountCallback(callback, deps);
              },
              useContext: function(context) {
                currentHookNameInDev = "useContext";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return readContext(context);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountImperativeHandle(ref, create, deps);
              },
              useInsertionEffect: function(create, deps) {
                currentHookNameInDev = "useInsertionEffect";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountInsertionEffect(create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                warnInvalidHookAccess();
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer2, initialArg, init) {
                currentHookNameInDev = "useReducer";
                warnInvalidHookAccess();
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountReducer(reducer2, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountRef(initialValue);
              },
              useState: function(initialState2) {
                currentHookNameInDev = "useState";
                warnInvalidHookAccess();
                mountHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
                try {
                  return mountState(initialState2);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountMutableSource();
              },
              useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
                currentHookNameInDev = "useSyncExternalStore";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
              },
              useId: function() {
                currentHookNameInDev = "useId";
                warnInvalidHookAccess();
                mountHookTypesDev();
                return mountId();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            InvalidNestedHooksDispatcherOnUpdateInDEV = {
              readContext: function(context) {
                warnInvalidContextAccess();
                return readContext(context);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateCallback(callback, deps);
              },
              useContext: function(context) {
                currentHookNameInDev = "useContext";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return readContext(context);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateImperativeHandle(ref, create, deps);
              },
              useInsertionEffect: function(create, deps) {
                currentHookNameInDev = "useInsertionEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateInsertionEffect(create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer2, initialArg, init) {
                currentHookNameInDev = "useReducer";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateReducer(reducer2, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateRef();
              },
              useState: function(initialState2) {
                currentHookNameInDev = "useState";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateState(initialState2);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateMutableSource();
              },
              useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
                currentHookNameInDev = "useSyncExternalStore";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateSyncExternalStore(subscribe, getSnapshot);
              },
              useId: function() {
                currentHookNameInDev = "useId";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateId();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
            InvalidNestedHooksDispatcherOnRerenderInDEV = {
              readContext: function(context) {
                warnInvalidContextAccess();
                return readContext(context);
              },
              useCallback: function(callback, deps) {
                currentHookNameInDev = "useCallback";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateCallback(callback, deps);
              },
              useContext: function(context) {
                currentHookNameInDev = "useContext";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return readContext(context);
              },
              useEffect: function(create, deps) {
                currentHookNameInDev = "useEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateEffect(create, deps);
              },
              useImperativeHandle: function(ref, create, deps) {
                currentHookNameInDev = "useImperativeHandle";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateImperativeHandle(ref, create, deps);
              },
              useInsertionEffect: function(create, deps) {
                currentHookNameInDev = "useInsertionEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateInsertionEffect(create, deps);
              },
              useLayoutEffect: function(create, deps) {
                currentHookNameInDev = "useLayoutEffect";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateLayoutEffect(create, deps);
              },
              useMemo: function(create, deps) {
                currentHookNameInDev = "useMemo";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return updateMemo(create, deps);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useReducer: function(reducer2, initialArg, init) {
                currentHookNameInDev = "useReducer";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return rerenderReducer(reducer2, initialArg, init);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useRef: function(initialValue) {
                currentHookNameInDev = "useRef";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateRef();
              },
              useState: function(initialState2) {
                currentHookNameInDev = "useState";
                warnInvalidHookAccess();
                updateHookTypesDev();
                var prevDispatcher = ReactCurrentDispatcher$1.current;
                ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
                try {
                  return rerenderState(initialState2);
                } finally {
                  ReactCurrentDispatcher$1.current = prevDispatcher;
                }
              },
              useDebugValue: function(value, formatterFn) {
                currentHookNameInDev = "useDebugValue";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateDebugValue();
              },
              useDeferredValue: function(value) {
                currentHookNameInDev = "useDeferredValue";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return rerenderDeferredValue(value);
              },
              useTransition: function() {
                currentHookNameInDev = "useTransition";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return rerenderTransition();
              },
              useMutableSource: function(source, getSnapshot, subscribe) {
                currentHookNameInDev = "useMutableSource";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateMutableSource();
              },
              useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
                currentHookNameInDev = "useSyncExternalStore";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateSyncExternalStore(subscribe, getSnapshot);
              },
              useId: function() {
                currentHookNameInDev = "useId";
                warnInvalidHookAccess();
                updateHookTypesDev();
                return updateId();
              },
              unstable_isNewReconciler: enableNewReconciler
            };
          }
          var now$1 = Scheduler.unstable_now;
          var commitTime = 0;
          var layoutEffectStartTime = -1;
          var profilerStartTime = -1;
          var passiveEffectStartTime = -1;
          var currentUpdateIsNested = false;
          var nestedUpdateScheduled = false;
          function isCurrentUpdateNested() {
            return currentUpdateIsNested;
          }
          function markNestedUpdateScheduled() {
            {
              nestedUpdateScheduled = true;
            }
          }
          function resetNestedUpdateFlag() {
            {
              currentUpdateIsNested = false;
              nestedUpdateScheduled = false;
            }
          }
          function syncNestedUpdateFlag() {
            {
              currentUpdateIsNested = nestedUpdateScheduled;
              nestedUpdateScheduled = false;
            }
          }
          function getCommitTime() {
            return commitTime;
          }
          function recordCommitTime() {
            commitTime = now$1();
          }
          function startProfilerTimer(fiber) {
            profilerStartTime = now$1();
            if (fiber.actualStartTime < 0) {
              fiber.actualStartTime = now$1();
            }
          }
          function stopProfilerTimerIfRunning(fiber) {
            profilerStartTime = -1;
          }
          function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
            if (profilerStartTime >= 0) {
              var elapsedTime = now$1() - profilerStartTime;
              fiber.actualDuration += elapsedTime;
              if (overrideBaseTime) {
                fiber.selfBaseDuration = elapsedTime;
              }
              profilerStartTime = -1;
            }
          }
          function recordLayoutEffectDuration(fiber) {
            if (layoutEffectStartTime >= 0) {
              var elapsedTime = now$1() - layoutEffectStartTime;
              layoutEffectStartTime = -1;
              var parentFiber = fiber.return;
              while (parentFiber !== null) {
                switch (parentFiber.tag) {
                  case HostRoot:
                    var root2 = parentFiber.stateNode;
                    root2.effectDuration += elapsedTime;
                    return;
                  case Profiler:
                    var parentStateNode = parentFiber.stateNode;
                    parentStateNode.effectDuration += elapsedTime;
                    return;
                }
                parentFiber = parentFiber.return;
              }
            }
          }
          function recordPassiveEffectDuration(fiber) {
            if (passiveEffectStartTime >= 0) {
              var elapsedTime = now$1() - passiveEffectStartTime;
              passiveEffectStartTime = -1;
              var parentFiber = fiber.return;
              while (parentFiber !== null) {
                switch (parentFiber.tag) {
                  case HostRoot:
                    var root2 = parentFiber.stateNode;
                    if (root2 !== null) {
                      root2.passiveEffectDuration += elapsedTime;
                    }
                    return;
                  case Profiler:
                    var parentStateNode = parentFiber.stateNode;
                    if (parentStateNode !== null) {
                      parentStateNode.passiveEffectDuration += elapsedTime;
                    }
                    return;
                }
                parentFiber = parentFiber.return;
              }
            }
          }
          function startLayoutEffectTimer() {
            layoutEffectStartTime = now$1();
          }
          function startPassiveEffectTimer() {
            passiveEffectStartTime = now$1();
          }
          function transferActualDuration(fiber) {
            var child = fiber.child;
            while (child) {
              fiber.actualDuration += child.actualDuration;
              child = child.sibling;
            }
          }
          function resolveDefaultProps(Component40, baseProps4) {
            if (Component40 && Component40.defaultProps) {
              var props = assign({}, baseProps4);
              var defaultProps15 = Component40.defaultProps;
              for (var propName in defaultProps15) {
                if (props[propName] === void 0) {
                  props[propName] = defaultProps15[propName];
                }
              }
              return props;
            }
            return baseProps4;
          }
          var fakeInternalInstance = {};
          var didWarnAboutStateAssignmentForComponent;
          var didWarnAboutUninitializedState;
          var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
          var didWarnAboutLegacyLifecyclesAndDerivedState;
          var didWarnAboutUndefinedDerivedState;
          var warnOnUndefinedDerivedState;
          var warnOnInvalidCallback;
          var didWarnAboutDirectlyAssigningPropsToState;
          var didWarnAboutContextTypeAndContextTypes;
          var didWarnAboutInvalidateContextType;
          var didWarnAboutLegacyContext$1;
          {
            didWarnAboutStateAssignmentForComponent = /* @__PURE__ */ new Set();
            didWarnAboutUninitializedState = /* @__PURE__ */ new Set();
            didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = /* @__PURE__ */ new Set();
            didWarnAboutLegacyLifecyclesAndDerivedState = /* @__PURE__ */ new Set();
            didWarnAboutDirectlyAssigningPropsToState = /* @__PURE__ */ new Set();
            didWarnAboutUndefinedDerivedState = /* @__PURE__ */ new Set();
            didWarnAboutContextTypeAndContextTypes = /* @__PURE__ */ new Set();
            didWarnAboutInvalidateContextType = /* @__PURE__ */ new Set();
            didWarnAboutLegacyContext$1 = /* @__PURE__ */ new Set();
            var didWarnOnInvalidCallback = /* @__PURE__ */ new Set();
            warnOnInvalidCallback = function(callback, callerName) {
              if (callback === null || typeof callback === "function") {
                return;
              }
              var key = callerName + "_" + callback;
              if (!didWarnOnInvalidCallback.has(key)) {
                didWarnOnInvalidCallback.add(key);
                error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback);
              }
            };
            warnOnUndefinedDerivedState = function(type, partialState) {
              if (partialState === void 0) {
                var componentName = getComponentNameFromType(type) || "Component";
                if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
                  didWarnAboutUndefinedDerivedState.add(componentName);
                  error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", componentName);
                }
              }
            };
            Object.defineProperty(fakeInternalInstance, "_processChildContext", {
              enumerable: false,
              value: function() {
                throw new Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).");
              }
            });
            Object.freeze(fakeInternalInstance);
          }
          function applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, nextProps) {
            var prevState = workInProgress2.memoizedState;
            var partialState = getDerivedStateFromProps(nextProps, prevState);
            {
              if (workInProgress2.mode & StrictLegacyMode) {
                setIsStrictModeForDevtools(true);
                try {
                  partialState = getDerivedStateFromProps(nextProps, prevState);
                } finally {
                  setIsStrictModeForDevtools(false);
                }
              }
              warnOnUndefinedDerivedState(ctor, partialState);
            }
            var memoizedState = partialState === null || partialState === void 0 ? prevState : assign({}, prevState, partialState);
            workInProgress2.memoizedState = memoizedState;
            if (workInProgress2.lanes === NoLanes) {
              var updateQueue = workInProgress2.updateQueue;
              updateQueue.baseState = memoizedState;
            }
          }
          var classComponentUpdater = {
            isMounted,
            enqueueSetState: function(inst, payload, callback) {
              var fiber = get(inst);
              var eventTime = requestEventTime();
              var lane = requestUpdateLane(fiber);
              var update = createUpdate(eventTime, lane);
              update.payload = payload;
              if (callback !== void 0 && callback !== null) {
                {
                  warnOnInvalidCallback(callback, "setState");
                }
                update.callback = callback;
              }
              var root2 = enqueueUpdate(fiber, update, lane);
              if (root2 !== null) {
                scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
                entangleTransitions(root2, fiber, lane);
              }
              {
                markStateUpdateScheduled(fiber, lane);
              }
            },
            enqueueReplaceState: function(inst, payload, callback) {
              var fiber = get(inst);
              var eventTime = requestEventTime();
              var lane = requestUpdateLane(fiber);
              var update = createUpdate(eventTime, lane);
              update.tag = ReplaceState;
              update.payload = payload;
              if (callback !== void 0 && callback !== null) {
                {
                  warnOnInvalidCallback(callback, "replaceState");
                }
                update.callback = callback;
              }
              var root2 = enqueueUpdate(fiber, update, lane);
              if (root2 !== null) {
                scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
                entangleTransitions(root2, fiber, lane);
              }
              {
                markStateUpdateScheduled(fiber, lane);
              }
            },
            enqueueForceUpdate: function(inst, callback) {
              var fiber = get(inst);
              var eventTime = requestEventTime();
              var lane = requestUpdateLane(fiber);
              var update = createUpdate(eventTime, lane);
              update.tag = ForceUpdate;
              if (callback !== void 0 && callback !== null) {
                {
                  warnOnInvalidCallback(callback, "forceUpdate");
                }
                update.callback = callback;
              }
              var root2 = enqueueUpdate(fiber, update, lane);
              if (root2 !== null) {
                scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
                entangleTransitions(root2, fiber, lane);
              }
              {
                markForceUpdateScheduled(fiber, lane);
              }
            }
          };
          function checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) {
            var instance = workInProgress2.stateNode;
            if (typeof instance.shouldComponentUpdate === "function") {
              var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
              {
                if (workInProgress2.mode & StrictLegacyMode) {
                  setIsStrictModeForDevtools(true);
                  try {
                    shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
                  } finally {
                    setIsStrictModeForDevtools(false);
                  }
                }
                if (shouldUpdate === void 0) {
                  error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", getComponentNameFromType(ctor) || "Component");
                }
              }
              return shouldUpdate;
            }
            if (ctor.prototype && ctor.prototype.isPureReactComponent) {
              return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
            }
            return true;
          }
          function checkClassInstance(workInProgress2, ctor, newProps) {
            var instance = workInProgress2.stateNode;
            {
              var name2 = getComponentNameFromType(ctor) || "Component";
              var renderPresent = instance.render;
              if (!renderPresent) {
                if (ctor.prototype && typeof ctor.prototype.render === "function") {
                  error("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?", name2);
                } else {
                  error("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", name2);
                }
              }
              if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {
                error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", name2);
              }
              if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {
                error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", name2);
              }
              if (instance.propTypes) {
                error("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", name2);
              }
              if (instance.contextType) {
                error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.", name2);
              }
              {
                if (ctor.childContextTypes && !didWarnAboutLegacyContext$1.has(ctor) && // Strict Mode has its own warning for legacy context, so we can skip
                // this one.
                (workInProgress2.mode & StrictLegacyMode) === NoMode) {
                  didWarnAboutLegacyContext$1.add(ctor);
                  error("%s uses the legacy childContextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() instead\n\n.Learn more about this warning here: https://reactjs.org/link/legacy-context", name2);
                }
                if (ctor.contextTypes && !didWarnAboutLegacyContext$1.has(ctor) && // Strict Mode has its own warning for legacy context, so we can skip
                // this one.
                (workInProgress2.mode & StrictLegacyMode) === NoMode) {
                  didWarnAboutLegacyContext$1.add(ctor);
                  error("%s uses the legacy contextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() with static contextType instead.\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context", name2);
                }
                if (instance.contextTypes) {
                  error("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", name2);
                }
                if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
                  didWarnAboutContextTypeAndContextTypes.add(ctor);
                  error("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", name2);
                }
              }
              if (typeof instance.componentShouldUpdate === "function") {
                error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", name2);
              }
              if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== "undefined") {
                error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", getComponentNameFromType(ctor) || "A pure component");
              }
              if (typeof instance.componentDidUnmount === "function") {
                error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", name2);
              }
              if (typeof instance.componentDidReceiveProps === "function") {
                error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", name2);
              }
              if (typeof instance.componentWillRecieveProps === "function") {
                error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", name2);
              }
              if (typeof instance.UNSAFE_componentWillRecieveProps === "function") {
                error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", name2);
              }
              var hasMutatedProps = instance.props !== newProps;
              if (instance.props !== void 0 && hasMutatedProps) {
                error("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", name2, name2);
              }
              if (instance.defaultProps) {
                error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", name2, name2);
              }
              if (typeof instance.getSnapshotBeforeUpdate === "function" && typeof instance.componentDidUpdate !== "function" && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
                didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);
                error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", getComponentNameFromType(ctor));
              }
              if (typeof instance.getDerivedStateFromProps === "function") {
                error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name2);
              }
              if (typeof instance.getDerivedStateFromError === "function") {
                error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name2);
              }
              if (typeof ctor.getSnapshotBeforeUpdate === "function") {
                error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", name2);
              }
              var _state = instance.state;
              if (_state && (typeof _state !== "object" || isArray(_state))) {
                error("%s.state: must be set to an object or null", name2);
              }
              if (typeof instance.getChildContext === "function" && typeof ctor.childContextTypes !== "object") {
                error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", name2);
              }
            }
          }
          function adoptClassInstance(workInProgress2, instance) {
            instance.updater = classComponentUpdater;
            workInProgress2.stateNode = instance;
            set(instance, workInProgress2);
            {
              instance._reactInternalInstance = fakeInternalInstance;
            }
          }
          function constructClassInstance(workInProgress2, ctor, props) {
            var isLegacyContextConsumer = false;
            var unmaskedContext = emptyContextObject;
            var context = emptyContextObject;
            var contextType = ctor.contextType;
            {
              if ("contextType" in ctor) {
                var isValid = (
                  // Allow null for conditional declaration
                  contextType === null || contextType !== void 0 && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === void 0
                );
                if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {
                  didWarnAboutInvalidateContextType.add(ctor);
                  var addendum = "";
                  if (contextType === void 0) {
                    addendum = " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.";
                  } else if (typeof contextType !== "object") {
                    addendum = " However, it is set to a " + typeof contextType + ".";
                  } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
                    addendum = " Did you accidentally pass the Context.Provider instead?";
                  } else if (contextType._context !== void 0) {
                    addendum = " Did you accidentally pass the Context.Consumer instead?";
                  } else {
                    addendum = " However, it is set to an object with keys {" + Object.keys(contextType).join(", ") + "}.";
                  }
                  error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", getComponentNameFromType(ctor) || "Component", addendum);
                }
              }
            }
            if (typeof contextType === "object" && contextType !== null) {
              context = readContext(contextType);
            } else {
              unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
              var contextTypes = ctor.contextTypes;
              isLegacyContextConsumer = contextTypes !== null && contextTypes !== void 0;
              context = isLegacyContextConsumer ? getMaskedContext(workInProgress2, unmaskedContext) : emptyContextObject;
            }
            var instance = new ctor(props, context);
            {
              if (workInProgress2.mode & StrictLegacyMode) {
                setIsStrictModeForDevtools(true);
                try {
                  instance = new ctor(props, context);
                } finally {
                  setIsStrictModeForDevtools(false);
                }
              }
            }
            var state = workInProgress2.memoizedState = instance.state !== null && instance.state !== void 0 ? instance.state : null;
            adoptClassInstance(workInProgress2, instance);
            {
              if (typeof ctor.getDerivedStateFromProps === "function" && state === null) {
                var componentName = getComponentNameFromType(ctor) || "Component";
                if (!didWarnAboutUninitializedState.has(componentName)) {
                  didWarnAboutUninitializedState.add(componentName);
                  error("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", componentName, instance.state === null ? "null" : "undefined", componentName);
                }
              }
              if (typeof ctor.getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function") {
                var foundWillMountName = null;
                var foundWillReceivePropsName = null;
                var foundWillUpdateName = null;
                if (typeof instance.componentWillMount === "function" && instance.componentWillMount.__suppressDeprecationWarning !== true) {
                  foundWillMountName = "componentWillMount";
                } else if (typeof instance.UNSAFE_componentWillMount === "function") {
                  foundWillMountName = "UNSAFE_componentWillMount";
                }
                if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
                  foundWillReceivePropsName = "componentWillReceiveProps";
                } else if (typeof instance.UNSAFE_componentWillReceiveProps === "function") {
                  foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps";
                }
                if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
                  foundWillUpdateName = "componentWillUpdate";
                } else if (typeof instance.UNSAFE_componentWillUpdate === "function") {
                  foundWillUpdateName = "UNSAFE_componentWillUpdate";
                }
                if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
                  var _componentName = getComponentNameFromType(ctor) || "Component";
                  var newApiName = typeof ctor.getDerivedStateFromProps === "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
                  if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
                    didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);
                    error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://reactjs.org/link/unsafe-component-lifecycles", _componentName, newApiName, foundWillMountName !== null ? "\n  " + foundWillMountName : "", foundWillReceivePropsName !== null ? "\n  " + foundWillReceivePropsName : "", foundWillUpdateName !== null ? "\n  " + foundWillUpdateName : "");
                  }
                }
              }
            }
            if (isLegacyContextConsumer) {
              cacheContext(workInProgress2, unmaskedContext, context);
            }
            return instance;
          }
          function callComponentWillMount(workInProgress2, instance) {
            var oldState = instance.state;
            if (typeof instance.componentWillMount === "function") {
              instance.componentWillMount();
            }
            if (typeof instance.UNSAFE_componentWillMount === "function") {
              instance.UNSAFE_componentWillMount();
            }
            if (oldState !== instance.state) {
              {
                error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", getComponentNameFromFiber(workInProgress2) || "Component");
              }
              classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
            }
          }
          function callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext) {
            var oldState = instance.state;
            if (typeof instance.componentWillReceiveProps === "function") {
              instance.componentWillReceiveProps(newProps, nextContext);
            }
            if (typeof instance.UNSAFE_componentWillReceiveProps === "function") {
              instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
            }
            if (instance.state !== oldState) {
              {
                var componentName = getComponentNameFromFiber(workInProgress2) || "Component";
                if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
                  didWarnAboutStateAssignmentForComponent.add(componentName);
                  error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", componentName);
                }
              }
              classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
            }
          }
          function mountClassInstance(workInProgress2, ctor, newProps, renderLanes2) {
            {
              checkClassInstance(workInProgress2, ctor, newProps);
            }
            var instance = workInProgress2.stateNode;
            instance.props = newProps;
            instance.state = workInProgress2.memoizedState;
            instance.refs = {};
            initializeUpdateQueue(workInProgress2);
            var contextType = ctor.contextType;
            if (typeof contextType === "object" && contextType !== null) {
              instance.context = readContext(contextType);
            } else {
              var unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
              instance.context = getMaskedContext(workInProgress2, unmaskedContext);
            }
            {
              if (instance.state === newProps) {
                var componentName = getComponentNameFromType(ctor) || "Component";
                if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
                  didWarnAboutDirectlyAssigningPropsToState.add(componentName);
                  error("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", componentName);
                }
              }
              if (workInProgress2.mode & StrictLegacyMode) {
                ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, instance);
              }
              {
                ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress2, instance);
              }
            }
            instance.state = workInProgress2.memoizedState;
            var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
            if (typeof getDerivedStateFromProps === "function") {
              applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
              instance.state = workInProgress2.memoizedState;
            }
            if (typeof ctor.getDerivedStateFromProps !== "function" && typeof instance.getSnapshotBeforeUpdate !== "function" && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) {
              callComponentWillMount(workInProgress2, instance);
              processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
              instance.state = workInProgress2.memoizedState;
            }
            if (typeof instance.componentDidMount === "function") {
              var fiberFlags = Update;
              {
                fiberFlags |= LayoutStatic;
              }
              if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
                fiberFlags |= MountLayoutDev;
              }
              workInProgress2.flags |= fiberFlags;
            }
          }
          function resumeMountClassInstance(workInProgress2, ctor, newProps, renderLanes2) {
            var instance = workInProgress2.stateNode;
            var oldProps = workInProgress2.memoizedProps;
            instance.props = oldProps;
            var oldContext = instance.context;
            var contextType = ctor.contextType;
            var nextContext = emptyContextObject;
            if (typeof contextType === "object" && contextType !== null) {
              nextContext = readContext(contextType);
            } else {
              var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
              nextContext = getMaskedContext(workInProgress2, nextLegacyUnmaskedContext);
            }
            var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
            var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function";
            if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) {
              if (oldProps !== newProps || oldContext !== nextContext) {
                callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext);
              }
            }
            resetHasForceUpdateBeforeProcessing();
            var oldState = workInProgress2.memoizedState;
            var newState = instance.state = oldState;
            processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
            newState = workInProgress2.memoizedState;
            if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
              if (typeof instance.componentDidMount === "function") {
                var fiberFlags = Update;
                {
                  fiberFlags |= LayoutStatic;
                }
                if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
                  fiberFlags |= MountLayoutDev;
                }
                workInProgress2.flags |= fiberFlags;
              }
              return false;
            }
            if (typeof getDerivedStateFromProps === "function") {
              applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
              newState = workInProgress2.memoizedState;
            }
            var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext);
            if (shouldUpdate) {
              if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) {
                if (typeof instance.componentWillMount === "function") {
                  instance.componentWillMount();
                }
                if (typeof instance.UNSAFE_componentWillMount === "function") {
                  instance.UNSAFE_componentWillMount();
                }
              }
              if (typeof instance.componentDidMount === "function") {
                var _fiberFlags = Update;
                {
                  _fiberFlags |= LayoutStatic;
                }
                if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
                  _fiberFlags |= MountLayoutDev;
                }
                workInProgress2.flags |= _fiberFlags;
              }
            } else {
              if (typeof instance.componentDidMount === "function") {
                var _fiberFlags2 = Update;
                {
                  _fiberFlags2 |= LayoutStatic;
                }
                if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
                  _fiberFlags2 |= MountLayoutDev;
                }
                workInProgress2.flags |= _fiberFlags2;
              }
              workInProgress2.memoizedProps = newProps;
              workInProgress2.memoizedState = newState;
            }
            instance.props = newProps;
            instance.state = newState;
            instance.context = nextContext;
            return shouldUpdate;
          }
          function updateClassInstance(current2, workInProgress2, ctor, newProps, renderLanes2) {
            var instance = workInProgress2.stateNode;
            cloneUpdateQueue(current2, workInProgress2);
            var unresolvedOldProps = workInProgress2.memoizedProps;
            var oldProps = workInProgress2.type === workInProgress2.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress2.type, unresolvedOldProps);
            instance.props = oldProps;
            var unresolvedNewProps = workInProgress2.pendingProps;
            var oldContext = instance.context;
            var contextType = ctor.contextType;
            var nextContext = emptyContextObject;
            if (typeof contextType === "object" && contextType !== null) {
              nextContext = readContext(contextType);
            } else {
              var nextUnmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
              nextContext = getMaskedContext(workInProgress2, nextUnmaskedContext);
            }
            var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
            var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function";
            if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) {
              if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) {
                callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext);
              }
            }
            resetHasForceUpdateBeforeProcessing();
            var oldState = workInProgress2.memoizedState;
            var newState = instance.state = oldState;
            processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
            newState = workInProgress2.memoizedState;
            if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing() && !enableLazyContextPropagation) {
              if (typeof instance.componentDidUpdate === "function") {
                if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
                  workInProgress2.flags |= Update;
                }
              }
              if (typeof instance.getSnapshotBeforeUpdate === "function") {
                if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
                  workInProgress2.flags |= Snapshot;
                }
              }
              return false;
            }
            if (typeof getDerivedStateFromProps === "function") {
              applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
              newState = workInProgress2.memoizedState;
            }
            var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) || // TODO: In some cases, we'll end up checking if context has changed twice,
            // both before and after `shouldComponentUpdate` has been called. Not ideal,
            // but I'm loath to refactor this function. This only happens for memoized
            // components so it's not that common.
            enableLazyContextPropagation;
            if (shouldUpdate) {
              if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === "function" || typeof instance.componentWillUpdate === "function")) {
                if (typeof instance.componentWillUpdate === "function") {
                  instance.componentWillUpdate(newProps, newState, nextContext);
                }
                if (typeof instance.UNSAFE_componentWillUpdate === "function") {
                  instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
                }
              }
              if (typeof instance.componentDidUpdate === "function") {
                workInProgress2.flags |= Update;
              }
              if (typeof instance.getSnapshotBeforeUpdate === "function") {
                workInProgress2.flags |= Snapshot;
              }
            } else {
              if (typeof instance.componentDidUpdate === "function") {
                if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
                  workInProgress2.flags |= Update;
                }
              }
              if (typeof instance.getSnapshotBeforeUpdate === "function") {
                if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
                  workInProgress2.flags |= Snapshot;
                }
              }
              workInProgress2.memoizedProps = newProps;
              workInProgress2.memoizedState = newState;
            }
            instance.props = newProps;
            instance.state = newState;
            instance.context = nextContext;
            return shouldUpdate;
          }
          function createCapturedValueAtFiber(value, source) {
            return {
              value,
              source,
              stack: getStackByFiberInDevAndProd(source),
              digest: null
            };
          }
          function createCapturedValue(value, digest, stack) {
            return {
              value,
              source: null,
              stack: stack != null ? stack : null,
              digest: digest != null ? digest : null
            };
          }
          function showErrorDialog(boundary, errorInfo) {
            return true;
          }
          function logCapturedError(boundary, errorInfo) {
            try {
              var logError = showErrorDialog(boundary, errorInfo);
              if (logError === false) {
                return;
              }
              var error2 = errorInfo.value;
              if (true) {
                var source = errorInfo.source;
                var stack = errorInfo.stack;
                var componentStack = stack !== null ? stack : "";
                if (error2 != null && error2._suppressLogging) {
                  if (boundary.tag === ClassComponent) {
                    return;
                  }
                  console["error"](error2);
                }
                var componentName = source ? getComponentNameFromFiber(source) : null;
                var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:";
                var errorBoundaryMessage;
                if (boundary.tag === HostRoot) {
                  errorBoundaryMessage = "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://reactjs.org/link/error-boundaries to learn more about error boundaries.";
                } else {
                  var errorBoundaryName = getComponentNameFromFiber(boundary) || "Anonymous";
                  errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + ".");
                }
                var combinedMessage = componentNameMessage + "\n" + componentStack + "\n\n" + ("" + errorBoundaryMessage);
                console["error"](combinedMessage);
              } else {
                console["error"](error2);
              }
            } catch (e) {
              setTimeout(function() {
                throw e;
              });
            }
          }
          var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map;
          function createRootErrorUpdate(fiber, errorInfo, lane) {
            var update = createUpdate(NoTimestamp, lane);
            update.tag = CaptureUpdate;
            update.payload = {
              element: null
            };
            var error2 = errorInfo.value;
            update.callback = function() {
              onUncaughtError(error2);
              logCapturedError(fiber, errorInfo);
            };
            return update;
          }
          function createClassErrorUpdate(fiber, errorInfo, lane) {
            var update = createUpdate(NoTimestamp, lane);
            update.tag = CaptureUpdate;
            var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
            if (typeof getDerivedStateFromError === "function") {
              var error$1 = errorInfo.value;
              update.payload = function() {
                return getDerivedStateFromError(error$1);
              };
              update.callback = function() {
                {
                  markFailedErrorBoundaryForHotReloading(fiber);
                }
                logCapturedError(fiber, errorInfo);
              };
            }
            var inst = fiber.stateNode;
            if (inst !== null && typeof inst.componentDidCatch === "function") {
              update.callback = function callback() {
                {
                  markFailedErrorBoundaryForHotReloading(fiber);
                }
                logCapturedError(fiber, errorInfo);
                if (typeof getDerivedStateFromError !== "function") {
                  markLegacyErrorBoundaryAsFailed(this);
                }
                var error$12 = errorInfo.value;
                var stack = errorInfo.stack;
                this.componentDidCatch(error$12, {
                  componentStack: stack !== null ? stack : ""
                });
                {
                  if (typeof getDerivedStateFromError !== "function") {
                    if (!includesSomeLane(fiber.lanes, SyncLane)) {
                      error("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", getComponentNameFromFiber(fiber) || "Unknown");
                    }
                  }
                }
              };
            }
            return update;
          }
          function attachPingListener(root2, wakeable, lanes) {
            var pingCache = root2.pingCache;
            var threadIDs;
            if (pingCache === null) {
              pingCache = root2.pingCache = new PossiblyWeakMap$1();
              threadIDs = /* @__PURE__ */ new Set();
              pingCache.set(wakeable, threadIDs);
            } else {
              threadIDs = pingCache.get(wakeable);
              if (threadIDs === void 0) {
                threadIDs = /* @__PURE__ */ new Set();
                pingCache.set(wakeable, threadIDs);
              }
            }
            if (!threadIDs.has(lanes)) {
              threadIDs.add(lanes);
              var ping = pingSuspendedRoot.bind(null, root2, wakeable, lanes);
              {
                if (isDevToolsPresent) {
                  restorePendingUpdaters(root2, lanes);
                }
              }
              wakeable.then(ping, ping);
            }
          }
          function attachRetryListener(suspenseBoundary, root2, wakeable, lanes) {
            var wakeables = suspenseBoundary.updateQueue;
            if (wakeables === null) {
              var updateQueue = /* @__PURE__ */ new Set();
              updateQueue.add(wakeable);
              suspenseBoundary.updateQueue = updateQueue;
            } else {
              wakeables.add(wakeable);
            }
          }
          function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
            var tag = sourceFiber.tag;
            if ((sourceFiber.mode & ConcurrentMode) === NoMode && (tag === FunctionComponent2 || tag === ForwardRef || tag === SimpleMemoComponent)) {
              var currentSource = sourceFiber.alternate;
              if (currentSource) {
                sourceFiber.updateQueue = currentSource.updateQueue;
                sourceFiber.memoizedState = currentSource.memoizedState;
                sourceFiber.lanes = currentSource.lanes;
              } else {
                sourceFiber.updateQueue = null;
                sourceFiber.memoizedState = null;
              }
            }
          }
          function getNearestSuspenseBoundaryToCapture(returnFiber) {
            var node = returnFiber;
            do {
              if (node.tag === SuspenseComponent && shouldCaptureSuspense(node)) {
                return node;
              }
              node = node.return;
            } while (node !== null);
            return null;
          }
          function markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes) {
            if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) {
              if (suspenseBoundary === returnFiber) {
                suspenseBoundary.flags |= ShouldCapture;
              } else {
                suspenseBoundary.flags |= DidCapture;
                sourceFiber.flags |= ForceUpdateForLegacySuspense;
                sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);
                if (sourceFiber.tag === ClassComponent) {
                  var currentSourceFiber = sourceFiber.alternate;
                  if (currentSourceFiber === null) {
                    sourceFiber.tag = IncompleteClassComponent;
                  } else {
                    var update = createUpdate(NoTimestamp, SyncLane);
                    update.tag = ForceUpdate;
                    enqueueUpdate(sourceFiber, update, SyncLane);
                  }
                }
                sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane);
              }
              return suspenseBoundary;
            }
            suspenseBoundary.flags |= ShouldCapture;
            suspenseBoundary.lanes = rootRenderLanes;
            return suspenseBoundary;
          }
          function throwException(root2, returnFiber, sourceFiber, value, rootRenderLanes) {
            sourceFiber.flags |= Incomplete;
            {
              if (isDevToolsPresent) {
                restorePendingUpdaters(root2, rootRenderLanes);
              }
            }
            if (value !== null && typeof value === "object" && typeof value.then === "function") {
              var wakeable = value;
              resetSuspendedComponent(sourceFiber);
              {
                if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) {
                  markDidThrowWhileHydratingDEV();
                }
              }
              var suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber);
              if (suspenseBoundary !== null) {
                suspenseBoundary.flags &= ~ForceClientRender;
                markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes);
                if (suspenseBoundary.mode & ConcurrentMode) {
                  attachPingListener(root2, wakeable, rootRenderLanes);
                }
                attachRetryListener(suspenseBoundary, root2, wakeable);
                return;
              } else {
                if (!includesSyncLane(rootRenderLanes)) {
                  attachPingListener(root2, wakeable, rootRenderLanes);
                  renderDidSuspendDelayIfPossible();
                  return;
                }
                var uncaughtSuspenseError = new Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.");
                value = uncaughtSuspenseError;
              }
            } else {
              if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) {
                markDidThrowWhileHydratingDEV();
                var _suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber);
                if (_suspenseBoundary !== null) {
                  if ((_suspenseBoundary.flags & ShouldCapture) === NoFlags) {
                    _suspenseBoundary.flags |= ForceClientRender;
                  }
                  markSuspenseBoundaryShouldCapture(_suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes);
                  queueHydrationError(createCapturedValueAtFiber(value, sourceFiber));
                  return;
                }
              }
            }
            value = createCapturedValueAtFiber(value, sourceFiber);
            renderDidError(value);
            var workInProgress2 = returnFiber;
            do {
              switch (workInProgress2.tag) {
                case HostRoot: {
                  var _errorInfo = value;
                  workInProgress2.flags |= ShouldCapture;
                  var lane = pickArbitraryLane(rootRenderLanes);
                  workInProgress2.lanes = mergeLanes(workInProgress2.lanes, lane);
                  var update = createRootErrorUpdate(workInProgress2, _errorInfo, lane);
                  enqueueCapturedUpdate(workInProgress2, update);
                  return;
                }
                case ClassComponent:
                  var errorInfo = value;
                  var ctor = workInProgress2.type;
                  var instance = workInProgress2.stateNode;
                  if ((workInProgress2.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === "function" || instance !== null && typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance))) {
                    workInProgress2.flags |= ShouldCapture;
                    var _lane = pickArbitraryLane(rootRenderLanes);
                    workInProgress2.lanes = mergeLanes(workInProgress2.lanes, _lane);
                    var _update = createClassErrorUpdate(workInProgress2, errorInfo, _lane);
                    enqueueCapturedUpdate(workInProgress2, _update);
                    return;
                  }
                  break;
              }
              workInProgress2 = workInProgress2.return;
            } while (workInProgress2 !== null);
          }
          function getSuspendedCache() {
            {
              return null;
            }
          }
          var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
          var didReceiveUpdate = false;
          var didWarnAboutBadClass;
          var didWarnAboutModulePatternComponent;
          var didWarnAboutContextTypeOnFunctionComponent;
          var didWarnAboutGetDerivedStateOnFunctionComponent;
          var didWarnAboutFunctionRefs;
          var didWarnAboutReassigningProps;
          var didWarnAboutRevealOrder;
          var didWarnAboutTailOptions;
          var didWarnAboutDefaultPropsOnFunctionComponent;
          {
            didWarnAboutBadClass = {};
            didWarnAboutModulePatternComponent = {};
            didWarnAboutContextTypeOnFunctionComponent = {};
            didWarnAboutGetDerivedStateOnFunctionComponent = {};
            didWarnAboutFunctionRefs = {};
            didWarnAboutReassigningProps = false;
            didWarnAboutRevealOrder = {};
            didWarnAboutTailOptions = {};
            didWarnAboutDefaultPropsOnFunctionComponent = {};
          }
          function reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2) {
            if (current2 === null) {
              workInProgress2.child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
            } else {
              workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, nextChildren, renderLanes2);
            }
          }
          function forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderLanes2) {
            workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
            workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderLanes2);
          }
          function updateForwardRef(current2, workInProgress2, Component40, nextProps, renderLanes2) {
            {
              if (workInProgress2.type !== workInProgress2.elementType) {
                var innerPropTypes = Component40.propTypes;
                if (innerPropTypes) {
                  checkPropTypes(
                    innerPropTypes,
                    nextProps,
                    // Resolved props
                    "prop",
                    getComponentNameFromType(Component40)
                  );
                }
              }
            }
            var render2 = Component40.render;
            var ref = workInProgress2.ref;
            var nextChildren;
            var hasId;
            prepareToReadContext(workInProgress2, renderLanes2);
            {
              markComponentRenderStarted(workInProgress2);
            }
            {
              ReactCurrentOwner$1.current = workInProgress2;
              setIsRendering(true);
              nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
              hasId = checkDidRenderIdHook();
              if (workInProgress2.mode & StrictLegacyMode) {
                setIsStrictModeForDevtools(true);
                try {
                  nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
                  hasId = checkDidRenderIdHook();
                } finally {
                  setIsStrictModeForDevtools(false);
                }
              }
              setIsRendering(false);
            }
            {
              markComponentRenderStopped();
            }
            if (current2 !== null && !didReceiveUpdate) {
              bailoutHooks(current2, workInProgress2, renderLanes2);
              return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
            }
            if (getIsHydrating() && hasId) {
              pushMaterializedTreeId(workInProgress2);
            }
            workInProgress2.flags |= PerformedWork;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateMemoComponent(current2, workInProgress2, Component40, nextProps, renderLanes2) {
            if (current2 === null) {
              var type = Component40.type;
              if (isSimpleFunctionComponent(type) && Component40.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.
              Component40.defaultProps === void 0) {
                var resolvedType = type;
                {
                  resolvedType = resolveFunctionForHotReloading(type);
                }
                workInProgress2.tag = SimpleMemoComponent;
                workInProgress2.type = resolvedType;
                {
                  validateFunctionComponentInDev(workInProgress2, type);
                }
                return updateSimpleMemoComponent(current2, workInProgress2, resolvedType, nextProps, renderLanes2);
              }
              {
                var innerPropTypes = type.propTypes;
                if (innerPropTypes) {
                  checkPropTypes(
                    innerPropTypes,
                    nextProps,
                    // Resolved props
                    "prop",
                    getComponentNameFromType(type)
                  );
                }
                if (Component40.defaultProps !== void 0) {
                  var componentName = getComponentNameFromType(type) || "Unknown";
                  if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) {
                    error("%s: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.", componentName);
                    didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true;
                  }
                }
              }
              var child = createFiberFromTypeAndProps(Component40.type, null, nextProps, workInProgress2, workInProgress2.mode, renderLanes2);
              child.ref = workInProgress2.ref;
              child.return = workInProgress2;
              workInProgress2.child = child;
              return child;
            }
            {
              var _type = Component40.type;
              var _innerPropTypes = _type.propTypes;
              if (_innerPropTypes) {
                checkPropTypes(
                  _innerPropTypes,
                  nextProps,
                  // Resolved props
                  "prop",
                  getComponentNameFromType(_type)
                );
              }
            }
            var currentChild = current2.child;
            var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current2, renderLanes2);
            if (!hasScheduledUpdateOrContext) {
              var prevProps = currentChild.memoizedProps;
              var compare = Component40.compare;
              compare = compare !== null ? compare : shallowEqual;
              if (compare(prevProps, nextProps) && current2.ref === workInProgress2.ref) {
                return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
              }
            }
            workInProgress2.flags |= PerformedWork;
            var newChild = createWorkInProgress(currentChild, nextProps);
            newChild.ref = workInProgress2.ref;
            newChild.return = workInProgress2;
            workInProgress2.child = newChild;
            return newChild;
          }
          function updateSimpleMemoComponent(current2, workInProgress2, Component40, nextProps, renderLanes2) {
            {
              if (workInProgress2.type !== workInProgress2.elementType) {
                var outerMemoType = workInProgress2.elementType;
                if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
                  var lazyComponent = outerMemoType;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    outerMemoType = init(payload);
                  } catch (x2) {
                    outerMemoType = null;
                  }
                  var outerPropTypes = outerMemoType && outerMemoType.propTypes;
                  if (outerPropTypes) {
                    checkPropTypes(
                      outerPropTypes,
                      nextProps,
                      // Resolved (SimpleMemoComponent has no defaultProps)
                      "prop",
                      getComponentNameFromType(outerMemoType)
                    );
                  }
                }
              }
            }
            if (current2 !== null) {
              var prevProps = current2.memoizedProps;
              if (shallowEqual(prevProps, nextProps) && current2.ref === workInProgress2.ref && // Prevent bailout if the implementation changed due to hot reload.
              workInProgress2.type === current2.type) {
                didReceiveUpdate = false;
                workInProgress2.pendingProps = nextProps = prevProps;
                if (!checkScheduledUpdateOrContext(current2, renderLanes2)) {
                  workInProgress2.lanes = current2.lanes;
                  return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
                } else if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
                  didReceiveUpdate = true;
                }
              }
            }
            return updateFunctionComponent(current2, workInProgress2, Component40, nextProps, renderLanes2);
          }
          function updateOffscreenComponent(current2, workInProgress2, renderLanes2) {
            var nextProps = workInProgress2.pendingProps;
            var nextChildren = nextProps.children;
            var prevState = current2 !== null ? current2.memoizedState : null;
            if (nextProps.mode === "hidden" || enableLegacyHidden) {
              if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
                var nextState = {
                  baseLanes: NoLanes,
                  cachePool: null,
                  transitions: null
                };
                workInProgress2.memoizedState = nextState;
                pushRenderLanes(workInProgress2, renderLanes2);
              } else if (!includesSomeLane(renderLanes2, OffscreenLane)) {
                var spawnedCachePool = null;
                var nextBaseLanes;
                if (prevState !== null) {
                  var prevBaseLanes = prevState.baseLanes;
                  nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes2);
                } else {
                  nextBaseLanes = renderLanes2;
                }
                workInProgress2.lanes = workInProgress2.childLanes = laneToLanes(OffscreenLane);
                var _nextState = {
                  baseLanes: nextBaseLanes,
                  cachePool: spawnedCachePool,
                  transitions: null
                };
                workInProgress2.memoizedState = _nextState;
                workInProgress2.updateQueue = null;
                pushRenderLanes(workInProgress2, nextBaseLanes);
                return null;
              } else {
                var _nextState2 = {
                  baseLanes: NoLanes,
                  cachePool: null,
                  transitions: null
                };
                workInProgress2.memoizedState = _nextState2;
                var subtreeRenderLanes2 = prevState !== null ? prevState.baseLanes : renderLanes2;
                pushRenderLanes(workInProgress2, subtreeRenderLanes2);
              }
            } else {
              var _subtreeRenderLanes;
              if (prevState !== null) {
                _subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes2);
                workInProgress2.memoizedState = null;
              } else {
                _subtreeRenderLanes = renderLanes2;
              }
              pushRenderLanes(workInProgress2, _subtreeRenderLanes);
            }
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateFragment(current2, workInProgress2, renderLanes2) {
            var nextChildren = workInProgress2.pendingProps;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateMode(current2, workInProgress2, renderLanes2) {
            var nextChildren = workInProgress2.pendingProps.children;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateProfiler(current2, workInProgress2, renderLanes2) {
            {
              workInProgress2.flags |= Update;
              {
                var stateNode = workInProgress2.stateNode;
                stateNode.effectDuration = 0;
                stateNode.passiveEffectDuration = 0;
              }
            }
            var nextProps = workInProgress2.pendingProps;
            var nextChildren = nextProps.children;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function markRef(current2, workInProgress2) {
            var ref = workInProgress2.ref;
            if (current2 === null && ref !== null || current2 !== null && current2.ref !== ref) {
              workInProgress2.flags |= Ref;
              {
                workInProgress2.flags |= RefStatic;
              }
            }
          }
          function updateFunctionComponent(current2, workInProgress2, Component40, nextProps, renderLanes2) {
            {
              if (workInProgress2.type !== workInProgress2.elementType) {
                var innerPropTypes = Component40.propTypes;
                if (innerPropTypes) {
                  checkPropTypes(
                    innerPropTypes,
                    nextProps,
                    // Resolved props
                    "prop",
                    getComponentNameFromType(Component40)
                  );
                }
              }
            }
            var context;
            {
              var unmaskedContext = getUnmaskedContext(workInProgress2, Component40, true);
              context = getMaskedContext(workInProgress2, unmaskedContext);
            }
            var nextChildren;
            var hasId;
            prepareToReadContext(workInProgress2, renderLanes2);
            {
              markComponentRenderStarted(workInProgress2);
            }
            {
              ReactCurrentOwner$1.current = workInProgress2;
              setIsRendering(true);
              nextChildren = renderWithHooks(current2, workInProgress2, Component40, nextProps, context, renderLanes2);
              hasId = checkDidRenderIdHook();
              if (workInProgress2.mode & StrictLegacyMode) {
                setIsStrictModeForDevtools(true);
                try {
                  nextChildren = renderWithHooks(current2, workInProgress2, Component40, nextProps, context, renderLanes2);
                  hasId = checkDidRenderIdHook();
                } finally {
                  setIsStrictModeForDevtools(false);
                }
              }
              setIsRendering(false);
            }
            {
              markComponentRenderStopped();
            }
            if (current2 !== null && !didReceiveUpdate) {
              bailoutHooks(current2, workInProgress2, renderLanes2);
              return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
            }
            if (getIsHydrating() && hasId) {
              pushMaterializedTreeId(workInProgress2);
            }
            workInProgress2.flags |= PerformedWork;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateClassComponent(current2, workInProgress2, Component40, nextProps, renderLanes2) {
            {
              switch (shouldError(workInProgress2)) {
                case false: {
                  var _instance = workInProgress2.stateNode;
                  var ctor = workInProgress2.type;
                  var tempInstance = new ctor(workInProgress2.memoizedProps, _instance.context);
                  var state = tempInstance.state;
                  _instance.updater.enqueueSetState(_instance, state, null);
                  break;
                }
                case true: {
                  workInProgress2.flags |= DidCapture;
                  workInProgress2.flags |= ShouldCapture;
                  var error$1 = new Error("Simulated error coming from DevTools");
                  var lane = pickArbitraryLane(renderLanes2);
                  workInProgress2.lanes = mergeLanes(workInProgress2.lanes, lane);
                  var update = createClassErrorUpdate(workInProgress2, createCapturedValueAtFiber(error$1, workInProgress2), lane);
                  enqueueCapturedUpdate(workInProgress2, update);
                  break;
                }
              }
              if (workInProgress2.type !== workInProgress2.elementType) {
                var innerPropTypes = Component40.propTypes;
                if (innerPropTypes) {
                  checkPropTypes(
                    innerPropTypes,
                    nextProps,
                    // Resolved props
                    "prop",
                    getComponentNameFromType(Component40)
                  );
                }
              }
            }
            var hasContext;
            if (isContextProvider(Component40)) {
              hasContext = true;
              pushContextProvider(workInProgress2);
            } else {
              hasContext = false;
            }
            prepareToReadContext(workInProgress2, renderLanes2);
            var instance = workInProgress2.stateNode;
            var shouldUpdate;
            if (instance === null) {
              resetSuspendedCurrentOnMountInLegacyMode(current2, workInProgress2);
              constructClassInstance(workInProgress2, Component40, nextProps);
              mountClassInstance(workInProgress2, Component40, nextProps, renderLanes2);
              shouldUpdate = true;
            } else if (current2 === null) {
              shouldUpdate = resumeMountClassInstance(workInProgress2, Component40, nextProps, renderLanes2);
            } else {
              shouldUpdate = updateClassInstance(current2, workInProgress2, Component40, nextProps, renderLanes2);
            }
            var nextUnitOfWork = finishClassComponent(current2, workInProgress2, Component40, shouldUpdate, hasContext, renderLanes2);
            {
              var inst = workInProgress2.stateNode;
              if (shouldUpdate && inst.props !== nextProps) {
                if (!didWarnAboutReassigningProps) {
                  error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", getComponentNameFromFiber(workInProgress2) || "a component");
                }
                didWarnAboutReassigningProps = true;
              }
            }
            return nextUnitOfWork;
          }
          function finishClassComponent(current2, workInProgress2, Component40, shouldUpdate, hasContext, renderLanes2) {
            markRef(current2, workInProgress2);
            var didCaptureError = (workInProgress2.flags & DidCapture) !== NoFlags;
            if (!shouldUpdate && !didCaptureError) {
              if (hasContext) {
                invalidateContextProvider(workInProgress2, Component40, false);
              }
              return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
            }
            var instance = workInProgress2.stateNode;
            ReactCurrentOwner$1.current = workInProgress2;
            var nextChildren;
            if (didCaptureError && typeof Component40.getDerivedStateFromError !== "function") {
              nextChildren = null;
              {
                stopProfilerTimerIfRunning();
              }
            } else {
              {
                markComponentRenderStarted(workInProgress2);
              }
              {
                setIsRendering(true);
                nextChildren = instance.render();
                if (workInProgress2.mode & StrictLegacyMode) {
                  setIsStrictModeForDevtools(true);
                  try {
                    instance.render();
                  } finally {
                    setIsStrictModeForDevtools(false);
                  }
                }
                setIsRendering(false);
              }
              {
                markComponentRenderStopped();
              }
            }
            workInProgress2.flags |= PerformedWork;
            if (current2 !== null && didCaptureError) {
              forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderLanes2);
            } else {
              reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            }
            workInProgress2.memoizedState = instance.state;
            if (hasContext) {
              invalidateContextProvider(workInProgress2, Component40, true);
            }
            return workInProgress2.child;
          }
          function pushHostRootContext(workInProgress2) {
            var root2 = workInProgress2.stateNode;
            if (root2.pendingContext) {
              pushTopLevelContextObject(workInProgress2, root2.pendingContext, root2.pendingContext !== root2.context);
            } else if (root2.context) {
              pushTopLevelContextObject(workInProgress2, root2.context, false);
            }
            pushHostContainer(workInProgress2, root2.containerInfo);
          }
          function updateHostRoot(current2, workInProgress2, renderLanes2) {
            pushHostRootContext(workInProgress2);
            if (current2 === null) {
              throw new Error("Should have a current fiber. This is a bug in React.");
            }
            var nextProps = workInProgress2.pendingProps;
            var prevState = workInProgress2.memoizedState;
            var prevChildren = prevState.element;
            cloneUpdateQueue(current2, workInProgress2);
            processUpdateQueue(workInProgress2, nextProps, null, renderLanes2);
            var nextState = workInProgress2.memoizedState;
            var root2 = workInProgress2.stateNode;
            var nextChildren = nextState.element;
            if (prevState.isDehydrated) {
              var overrideState = {
                element: nextChildren,
                isDehydrated: false,
                cache: nextState.cache,
                pendingSuspenseBoundaries: nextState.pendingSuspenseBoundaries,
                transitions: nextState.transitions
              };
              var updateQueue = workInProgress2.updateQueue;
              updateQueue.baseState = overrideState;
              workInProgress2.memoizedState = overrideState;
              if (workInProgress2.flags & ForceClientRender) {
                var recoverableError = createCapturedValueAtFiber(new Error("There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering."), workInProgress2);
                return mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, recoverableError);
              } else if (nextChildren !== prevChildren) {
                var _recoverableError = createCapturedValueAtFiber(new Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."), workInProgress2);
                return mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, _recoverableError);
              } else {
                enterHydrationState(workInProgress2);
                var child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
                workInProgress2.child = child;
                var node = child;
                while (node) {
                  node.flags = node.flags & ~Placement | Hydrating;
                  node = node.sibling;
                }
              }
            } else {
              resetHydrationState();
              if (nextChildren === prevChildren) {
                return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
              }
              reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            }
            return workInProgress2.child;
          }
          function mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, recoverableError) {
            resetHydrationState();
            queueHydrationError(recoverableError);
            workInProgress2.flags |= ForceClientRender;
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateHostComponent(current2, workInProgress2, renderLanes2) {
            pushHostContext(workInProgress2);
            if (current2 === null) {
              tryToClaimNextHydratableInstance(workInProgress2);
            }
            var type = workInProgress2.type;
            var nextProps = workInProgress2.pendingProps;
            var prevProps = current2 !== null ? current2.memoizedProps : null;
            var nextChildren = nextProps.children;
            var isDirectTextChild = shouldSetTextContent(type, nextProps);
            if (isDirectTextChild) {
              nextChildren = null;
            } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
              workInProgress2.flags |= ContentReset;
            }
            markRef(current2, workInProgress2);
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            return workInProgress2.child;
          }
          function updateHostText(current2, workInProgress2) {
            if (current2 === null) {
              tryToClaimNextHydratableInstance(workInProgress2);
            }
            return null;
          }
          function mountLazyComponent(_current, workInProgress2, elementType, renderLanes2) {
            resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
            var props = workInProgress2.pendingProps;
            var lazyComponent = elementType;
            var payload = lazyComponent._payload;
            var init = lazyComponent._init;
            var Component40 = init(payload);
            workInProgress2.type = Component40;
            var resolvedTag = workInProgress2.tag = resolveLazyComponentTag(Component40);
            var resolvedProps = resolveDefaultProps(Component40, props);
            var child;
            switch (resolvedTag) {
              case FunctionComponent2: {
                {
                  validateFunctionComponentInDev(workInProgress2, Component40);
                  workInProgress2.type = Component40 = resolveFunctionForHotReloading(Component40);
                }
                child = updateFunctionComponent(null, workInProgress2, Component40, resolvedProps, renderLanes2);
                return child;
              }
              case ClassComponent: {
                {
                  workInProgress2.type = Component40 = resolveClassForHotReloading(Component40);
                }
                child = updateClassComponent(null, workInProgress2, Component40, resolvedProps, renderLanes2);
                return child;
              }
              case ForwardRef: {
                {
                  workInProgress2.type = Component40 = resolveForwardRefForHotReloading(Component40);
                }
                child = updateForwardRef(null, workInProgress2, Component40, resolvedProps, renderLanes2);
                return child;
              }
              case MemoComponent: {
                {
                  if (workInProgress2.type !== workInProgress2.elementType) {
                    var outerPropTypes = Component40.propTypes;
                    if (outerPropTypes) {
                      checkPropTypes(
                        outerPropTypes,
                        resolvedProps,
                        // Resolved for outer only
                        "prop",
                        getComponentNameFromType(Component40)
                      );
                    }
                  }
                }
                child = updateMemoComponent(
                  null,
                  workInProgress2,
                  Component40,
                  resolveDefaultProps(Component40.type, resolvedProps),
                  // The inner type can have defaults too
                  renderLanes2
                );
                return child;
              }
            }
            var hint = "";
            {
              if (Component40 !== null && typeof Component40 === "object" && Component40.$$typeof === REACT_LAZY_TYPE) {
                hint = " Did you wrap a component in React.lazy() more than once?";
              }
            }
            throw new Error("Element type is invalid. Received a promise that resolves to: " + Component40 + ". " + ("Lazy element type must resolve to a class or function." + hint));
          }
          function mountIncompleteClassComponent(_current, workInProgress2, Component40, nextProps, renderLanes2) {
            resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
            workInProgress2.tag = ClassComponent;
            var hasContext;
            if (isContextProvider(Component40)) {
              hasContext = true;
              pushContextProvider(workInProgress2);
            } else {
              hasContext = false;
            }
            prepareToReadContext(workInProgress2, renderLanes2);
            constructClassInstance(workInProgress2, Component40, nextProps);
            mountClassInstance(workInProgress2, Component40, nextProps, renderLanes2);
            return finishClassComponent(null, workInProgress2, Component40, true, hasContext, renderLanes2);
          }
          function mountIndeterminateComponent(_current, workInProgress2, Component40, renderLanes2) {
            resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
            var props = workInProgress2.pendingProps;
            var context;
            {
              var unmaskedContext = getUnmaskedContext(workInProgress2, Component40, false);
              context = getMaskedContext(workInProgress2, unmaskedContext);
            }
            prepareToReadContext(workInProgress2, renderLanes2);
            var value;
            var hasId;
            {
              markComponentRenderStarted(workInProgress2);
            }
            {
              if (Component40.prototype && typeof Component40.prototype.render === "function") {
                var componentName = getComponentNameFromType(Component40) || "Unknown";
                if (!didWarnAboutBadClass[componentName]) {
                  error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", componentName, componentName);
                  didWarnAboutBadClass[componentName] = true;
                }
              }
              if (workInProgress2.mode & StrictLegacyMode) {
                ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, null);
              }
              setIsRendering(true);
              ReactCurrentOwner$1.current = workInProgress2;
              value = renderWithHooks(null, workInProgress2, Component40, props, context, renderLanes2);
              hasId = checkDidRenderIdHook();
              setIsRendering(false);
            }
            {
              markComponentRenderStopped();
            }
            workInProgress2.flags |= PerformedWork;
            {
              if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) {
                var _componentName = getComponentNameFromType(Component40) || "Unknown";
                if (!didWarnAboutModulePatternComponent[_componentName]) {
                  error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName, _componentName, _componentName);
                  didWarnAboutModulePatternComponent[_componentName] = true;
                }
              }
            }
            if (
              // Run these checks in production only if the flag is off.
              // Eventually we'll delete this branch altogether.
              typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0
            ) {
              {
                var _componentName2 = getComponentNameFromType(Component40) || "Unknown";
                if (!didWarnAboutModulePatternComponent[_componentName2]) {
                  error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName2, _componentName2, _componentName2);
                  didWarnAboutModulePatternComponent[_componentName2] = true;
                }
              }
              workInProgress2.tag = ClassComponent;
              workInProgress2.memoizedState = null;
              workInProgress2.updateQueue = null;
              var hasContext = false;
              if (isContextProvider(Component40)) {
                hasContext = true;
                pushContextProvider(workInProgress2);
              } else {
                hasContext = false;
              }
              workInProgress2.memoizedState = value.state !== null && value.state !== void 0 ? value.state : null;
              initializeUpdateQueue(workInProgress2);
              adoptClassInstance(workInProgress2, value);
              mountClassInstance(workInProgress2, Component40, props, renderLanes2);
              return finishClassComponent(null, workInProgress2, Component40, true, hasContext, renderLanes2);
            } else {
              workInProgress2.tag = FunctionComponent2;
              {
                if (workInProgress2.mode & StrictLegacyMode) {
                  setIsStrictModeForDevtools(true);
                  try {
                    value = renderWithHooks(null, workInProgress2, Component40, props, context, renderLanes2);
                    hasId = checkDidRenderIdHook();
                  } finally {
                    setIsStrictModeForDevtools(false);
                  }
                }
              }
              if (getIsHydrating() && hasId) {
                pushMaterializedTreeId(workInProgress2);
              }
              reconcileChildren(null, workInProgress2, value, renderLanes2);
              {
                validateFunctionComponentInDev(workInProgress2, Component40);
              }
              return workInProgress2.child;
            }
          }
          function validateFunctionComponentInDev(workInProgress2, Component40) {
            {
              if (Component40) {
                if (Component40.childContextTypes) {
                  error("%s(...): childContextTypes cannot be defined on a function component.", Component40.displayName || Component40.name || "Component");
                }
              }
              if (workInProgress2.ref !== null) {
                var info2 = "";
                var ownerName = getCurrentFiberOwnerNameInDevOrNull();
                if (ownerName) {
                  info2 += "\n\nCheck the render method of `" + ownerName + "`.";
                }
                var warningKey = ownerName || "";
                var debugSource = workInProgress2._debugSource;
                if (debugSource) {
                  warningKey = debugSource.fileName + ":" + debugSource.lineNumber;
                }
                if (!didWarnAboutFunctionRefs[warningKey]) {
                  didWarnAboutFunctionRefs[warningKey] = true;
                  error("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s", info2);
                }
              }
              if (Component40.defaultProps !== void 0) {
                var componentName = getComponentNameFromType(Component40) || "Unknown";
                if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) {
                  error("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.", componentName);
                  didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true;
                }
              }
              if (typeof Component40.getDerivedStateFromProps === "function") {
                var _componentName3 = getComponentNameFromType(Component40) || "Unknown";
                if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) {
                  error("%s: Function components do not support getDerivedStateFromProps.", _componentName3);
                  didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true;
                }
              }
              if (typeof Component40.contextType === "object" && Component40.contextType !== null) {
                var _componentName4 = getComponentNameFromType(Component40) || "Unknown";
                if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {
                  error("%s: Function components do not support contextType.", _componentName4);
                  didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;
                }
              }
            }
          }
          var SUSPENDED_MARKER = {
            dehydrated: null,
            treeContext: null,
            retryLane: NoLane
          };
          function mountSuspenseOffscreenState(renderLanes2) {
            return {
              baseLanes: renderLanes2,
              cachePool: getSuspendedCache(),
              transitions: null
            };
          }
          function updateSuspenseOffscreenState(prevOffscreenState, renderLanes2) {
            var cachePool = null;
            return {
              baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes2),
              cachePool,
              transitions: prevOffscreenState.transitions
            };
          }
          function shouldRemainOnFallback(suspenseContext, current2, workInProgress2, renderLanes2) {
            if (current2 !== null) {
              var suspenseState = current2.memoizedState;
              if (suspenseState === null) {
                return false;
              }
            }
            return hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
          }
          function getRemainingWorkInPrimaryTree(current2, renderLanes2) {
            return removeLanes(current2.childLanes, renderLanes2);
          }
          function updateSuspenseComponent(current2, workInProgress2, renderLanes2) {
            var nextProps = workInProgress2.pendingProps;
            {
              if (shouldSuspend(workInProgress2)) {
                workInProgress2.flags |= DidCapture;
              }
            }
            var suspenseContext = suspenseStackCursor.current;
            var showFallback = false;
            var didSuspend = (workInProgress2.flags & DidCapture) !== NoFlags;
            if (didSuspend || shouldRemainOnFallback(suspenseContext, current2)) {
              showFallback = true;
              workInProgress2.flags &= ~DidCapture;
            } else {
              if (current2 === null || current2.memoizedState !== null) {
                {
                  suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
                }
              }
            }
            suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
            pushSuspenseContext(workInProgress2, suspenseContext);
            if (current2 === null) {
              tryToClaimNextHydratableInstance(workInProgress2);
              var suspenseState = workInProgress2.memoizedState;
              if (suspenseState !== null) {
                var dehydrated = suspenseState.dehydrated;
                if (dehydrated !== null) {
                  return mountDehydratedSuspenseComponent(workInProgress2, dehydrated);
                }
              }
              var nextPrimaryChildren = nextProps.children;
              var nextFallbackChildren = nextProps.fallback;
              if (showFallback) {
                var fallbackFragment = mountSuspenseFallbackChildren(workInProgress2, nextPrimaryChildren, nextFallbackChildren, renderLanes2);
                var primaryChildFragment = workInProgress2.child;
                primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes2);
                workInProgress2.memoizedState = SUSPENDED_MARKER;
                return fallbackFragment;
              } else {
                return mountSuspensePrimaryChildren(workInProgress2, nextPrimaryChildren);
              }
            } else {
              var prevState = current2.memoizedState;
              if (prevState !== null) {
                var _dehydrated = prevState.dehydrated;
                if (_dehydrated !== null) {
                  return updateDehydratedSuspenseComponent(current2, workInProgress2, didSuspend, nextProps, _dehydrated, prevState, renderLanes2);
                }
              }
              if (showFallback) {
                var _nextFallbackChildren = nextProps.fallback;
                var _nextPrimaryChildren = nextProps.children;
                var fallbackChildFragment = updateSuspenseFallbackChildren(current2, workInProgress2, _nextPrimaryChildren, _nextFallbackChildren, renderLanes2);
                var _primaryChildFragment2 = workInProgress2.child;
                var prevOffscreenState = current2.child.memoizedState;
                _primaryChildFragment2.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes2) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes2);
                _primaryChildFragment2.childLanes = getRemainingWorkInPrimaryTree(current2, renderLanes2);
                workInProgress2.memoizedState = SUSPENDED_MARKER;
                return fallbackChildFragment;
              } else {
                var _nextPrimaryChildren2 = nextProps.children;
                var _primaryChildFragment3 = updateSuspensePrimaryChildren(current2, workInProgress2, _nextPrimaryChildren2, renderLanes2);
                workInProgress2.memoizedState = null;
                return _primaryChildFragment3;
              }
            }
          }
          function mountSuspensePrimaryChildren(workInProgress2, primaryChildren, renderLanes2) {
            var mode = workInProgress2.mode;
            var primaryChildProps = {
              mode: "visible",
              children: primaryChildren
            };
            var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode);
            primaryChildFragment.return = workInProgress2;
            workInProgress2.child = primaryChildFragment;
            return primaryChildFragment;
          }
          function mountSuspenseFallbackChildren(workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
            var mode = workInProgress2.mode;
            var progressedPrimaryFragment = workInProgress2.child;
            var primaryChildProps = {
              mode: "hidden",
              children: primaryChildren
            };
            var primaryChildFragment;
            var fallbackChildFragment;
            if ((mode & ConcurrentMode) === NoMode && progressedPrimaryFragment !== null) {
              primaryChildFragment = progressedPrimaryFragment;
              primaryChildFragment.childLanes = NoLanes;
              primaryChildFragment.pendingProps = primaryChildProps;
              if (workInProgress2.mode & ProfileMode) {
                primaryChildFragment.actualDuration = 0;
                primaryChildFragment.actualStartTime = -1;
                primaryChildFragment.selfBaseDuration = 0;
                primaryChildFragment.treeBaseDuration = 0;
              }
              fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
            } else {
              primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode);
              fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
            }
            primaryChildFragment.return = workInProgress2;
            fallbackChildFragment.return = workInProgress2;
            primaryChildFragment.sibling = fallbackChildFragment;
            workInProgress2.child = primaryChildFragment;
            return fallbackChildFragment;
          }
          function mountWorkInProgressOffscreenFiber(offscreenProps, mode, renderLanes2) {
            return createFiberFromOffscreen(offscreenProps, mode, NoLanes, null);
          }
          function updateWorkInProgressOffscreenFiber(current2, offscreenProps) {
            return createWorkInProgress(current2, offscreenProps);
          }
          function updateSuspensePrimaryChildren(current2, workInProgress2, primaryChildren, renderLanes2) {
            var currentPrimaryChildFragment = current2.child;
            var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
            var primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, {
              mode: "visible",
              children: primaryChildren
            });
            if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
              primaryChildFragment.lanes = renderLanes2;
            }
            primaryChildFragment.return = workInProgress2;
            primaryChildFragment.sibling = null;
            if (currentFallbackChildFragment !== null) {
              var deletions = workInProgress2.deletions;
              if (deletions === null) {
                workInProgress2.deletions = [currentFallbackChildFragment];
                workInProgress2.flags |= ChildDeletion;
              } else {
                deletions.push(currentFallbackChildFragment);
              }
            }
            workInProgress2.child = primaryChildFragment;
            return primaryChildFragment;
          }
          function updateSuspenseFallbackChildren(current2, workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
            var mode = workInProgress2.mode;
            var currentPrimaryChildFragment = current2.child;
            var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
            var primaryChildProps = {
              mode: "hidden",
              children: primaryChildren
            };
            var primaryChildFragment;
            if (
              // In legacy mode, we commit the primary tree as if it successfully
              // completed, even though it's in an inconsistent state.
              (mode & ConcurrentMode) === NoMode && // Make sure we're on the second pass, i.e. the primary child fragment was
              // already cloned. In legacy mode, the only case where this isn't true is
              // when DevTools forces us to display a fallback; we skip the first render
              // pass entirely and go straight to rendering the fallback. (In Concurrent
              // Mode, SuspenseList can also trigger this scenario, but this is a legacy-
              // only codepath.)
              workInProgress2.child !== currentPrimaryChildFragment
            ) {
              var progressedPrimaryFragment = workInProgress2.child;
              primaryChildFragment = progressedPrimaryFragment;
              primaryChildFragment.childLanes = NoLanes;
              primaryChildFragment.pendingProps = primaryChildProps;
              if (workInProgress2.mode & ProfileMode) {
                primaryChildFragment.actualDuration = 0;
                primaryChildFragment.actualStartTime = -1;
                primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration;
                primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration;
              }
              workInProgress2.deletions = null;
            } else {
              primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps);
              primaryChildFragment.subtreeFlags = currentPrimaryChildFragment.subtreeFlags & StaticMask;
            }
            var fallbackChildFragment;
            if (currentFallbackChildFragment !== null) {
              fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren);
            } else {
              fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
              fallbackChildFragment.flags |= Placement;
            }
            fallbackChildFragment.return = workInProgress2;
            primaryChildFragment.return = workInProgress2;
            primaryChildFragment.sibling = fallbackChildFragment;
            workInProgress2.child = primaryChildFragment;
            return fallbackChildFragment;
          }
          function retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, recoverableError) {
            if (recoverableError !== null) {
              queueHydrationError(recoverableError);
            }
            reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
            var nextProps = workInProgress2.pendingProps;
            var primaryChildren = nextProps.children;
            var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress2, primaryChildren);
            primaryChildFragment.flags |= Placement;
            workInProgress2.memoizedState = null;
            return primaryChildFragment;
          }
          function mountSuspenseFallbackAfterRetryWithoutHydrating(current2, workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
            var fiberMode = workInProgress2.mode;
            var primaryChildProps = {
              mode: "visible",
              children: primaryChildren
            };
            var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, fiberMode);
            var fallbackChildFragment = createFiberFromFragment(fallbackChildren, fiberMode, renderLanes2, null);
            fallbackChildFragment.flags |= Placement;
            primaryChildFragment.return = workInProgress2;
            fallbackChildFragment.return = workInProgress2;
            primaryChildFragment.sibling = fallbackChildFragment;
            workInProgress2.child = primaryChildFragment;
            if ((workInProgress2.mode & ConcurrentMode) !== NoMode) {
              reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
            }
            return fallbackChildFragment;
          }
          function mountDehydratedSuspenseComponent(workInProgress2, suspenseInstance, renderLanes2) {
            if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
              {
                error("Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components.");
              }
              workInProgress2.lanes = laneToLanes(SyncLane);
            } else if (isSuspenseInstanceFallback(suspenseInstance)) {
              workInProgress2.lanes = laneToLanes(DefaultHydrationLane);
            } else {
              workInProgress2.lanes = laneToLanes(OffscreenLane);
            }
            return null;
          }
          function updateDehydratedSuspenseComponent(current2, workInProgress2, didSuspend, nextProps, suspenseInstance, suspenseState, renderLanes2) {
            if (!didSuspend) {
              warnIfHydrating();
              if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
                return retrySuspenseComponentWithoutHydrating(
                  current2,
                  workInProgress2,
                  renderLanes2,
                  // TODO: When we delete legacy mode, we should make this error argument
                  // required — every concurrent mode path that causes hydration to
                  // de-opt to client rendering should have an error message.
                  null
                );
              }
              if (isSuspenseInstanceFallback(suspenseInstance)) {
                var digest, message, stack;
                {
                  var _getSuspenseInstanceF = getSuspenseInstanceFallbackErrorDetails(suspenseInstance);
                  digest = _getSuspenseInstanceF.digest;
                  message = _getSuspenseInstanceF.message;
                  stack = _getSuspenseInstanceF.stack;
                }
                var error2;
                if (message) {
                  error2 = new Error(message);
                } else {
                  error2 = new Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.");
                }
                var capturedValue = createCapturedValue(error2, digest, stack);
                return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, capturedValue);
              }
              var hasContextChanged2 = includesSomeLane(renderLanes2, current2.childLanes);
              if (didReceiveUpdate || hasContextChanged2) {
                var root2 = getWorkInProgressRoot();
                if (root2 !== null) {
                  var attemptHydrationAtLane = getBumpedLaneForHydration(root2, renderLanes2);
                  if (attemptHydrationAtLane !== NoLane && attemptHydrationAtLane !== suspenseState.retryLane) {
                    suspenseState.retryLane = attemptHydrationAtLane;
                    var eventTime = NoTimestamp;
                    enqueueConcurrentRenderForLane(current2, attemptHydrationAtLane);
                    scheduleUpdateOnFiber(root2, current2, attemptHydrationAtLane, eventTime);
                  }
                }
                renderDidSuspendDelayIfPossible();
                var _capturedValue = createCapturedValue(new Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition."));
                return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, _capturedValue);
              } else if (isSuspenseInstancePending(suspenseInstance)) {
                workInProgress2.flags |= DidCapture;
                workInProgress2.child = current2.child;
                var retry = retryDehydratedSuspenseBoundary.bind(null, current2);
                registerSuspenseInstanceRetry(suspenseInstance, retry);
                return null;
              } else {
                reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress2, suspenseInstance, suspenseState.treeContext);
                var primaryChildren = nextProps.children;
                var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress2, primaryChildren);
                primaryChildFragment.flags |= Hydrating;
                return primaryChildFragment;
              }
            } else {
              if (workInProgress2.flags & ForceClientRender) {
                workInProgress2.flags &= ~ForceClientRender;
                var _capturedValue2 = createCapturedValue(new Error("There was an error while hydrating this Suspense boundary. Switched to client rendering."));
                return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, _capturedValue2);
              } else if (workInProgress2.memoizedState !== null) {
                workInProgress2.child = current2.child;
                workInProgress2.flags |= DidCapture;
                return null;
              } else {
                var nextPrimaryChildren = nextProps.children;
                var nextFallbackChildren = nextProps.fallback;
                var fallbackChildFragment = mountSuspenseFallbackAfterRetryWithoutHydrating(current2, workInProgress2, nextPrimaryChildren, nextFallbackChildren, renderLanes2);
                var _primaryChildFragment4 = workInProgress2.child;
                _primaryChildFragment4.memoizedState = mountSuspenseOffscreenState(renderLanes2);
                workInProgress2.memoizedState = SUSPENDED_MARKER;
                return fallbackChildFragment;
              }
            }
          }
          function scheduleSuspenseWorkOnFiber(fiber, renderLanes2, propagationRoot) {
            fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
            var alternate = fiber.alternate;
            if (alternate !== null) {
              alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
            }
            scheduleContextWorkOnParentPath(fiber.return, renderLanes2, propagationRoot);
          }
          function propagateSuspenseContextChange(workInProgress2, firstChild, renderLanes2) {
            var node = firstChild;
            while (node !== null) {
              if (node.tag === SuspenseComponent) {
                var state = node.memoizedState;
                if (state !== null) {
                  scheduleSuspenseWorkOnFiber(node, renderLanes2, workInProgress2);
                }
              } else if (node.tag === SuspenseListComponent) {
                scheduleSuspenseWorkOnFiber(node, renderLanes2, workInProgress2);
              } else if (node.child !== null) {
                node.child.return = node;
                node = node.child;
                continue;
              }
              if (node === workInProgress2) {
                return;
              }
              while (node.sibling === null) {
                if (node.return === null || node.return === workInProgress2) {
                  return;
                }
                node = node.return;
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
          }
          function findLastContentRow(firstChild) {
            var row = firstChild;
            var lastContentRow = null;
            while (row !== null) {
              var currentRow = row.alternate;
              if (currentRow !== null && findFirstSuspended(currentRow) === null) {
                lastContentRow = row;
              }
              row = row.sibling;
            }
            return lastContentRow;
          }
          function validateRevealOrder(revealOrder) {
            {
              if (revealOrder !== void 0 && revealOrder !== "forwards" && revealOrder !== "backwards" && revealOrder !== "together" && !didWarnAboutRevealOrder[revealOrder]) {
                didWarnAboutRevealOrder[revealOrder] = true;
                if (typeof revealOrder === "string") {
                  switch (revealOrder.toLowerCase()) {
                    case "together":
                    case "forwards":
                    case "backwards": {
                      error('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase());
                      break;
                    }
                    case "forward":
                    case "backward": {
                      error('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase());
                      break;
                    }
                    default:
                      error('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', revealOrder);
                      break;
                  }
                } else {
                  error('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', revealOrder);
                }
              }
            }
          }
          function validateTailOptions(tailMode, revealOrder) {
            {
              if (tailMode !== void 0 && !didWarnAboutTailOptions[tailMode]) {
                if (tailMode !== "collapsed" && tailMode !== "hidden") {
                  didWarnAboutTailOptions[tailMode] = true;
                  error('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?', tailMode);
                } else if (revealOrder !== "forwards" && revealOrder !== "backwards") {
                  didWarnAboutTailOptions[tailMode] = true;
                  error('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', tailMode);
                }
              }
            }
          }
          function validateSuspenseListNestedChild(childSlot, index2) {
            {
              var isAnArray = isArray(childSlot);
              var isIterable2 = !isAnArray && typeof getIteratorFn(childSlot) === "function";
              if (isAnArray || isIterable2) {
                var type = isAnArray ? "array" : "iterable";
                error("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>", type, index2, type);
                return false;
              }
            }
            return true;
          }
          function validateSuspenseListChildren(children, revealOrder) {
            {
              if ((revealOrder === "forwards" || revealOrder === "backwards") && children !== void 0 && children !== null && children !== false) {
                if (isArray(children)) {
                  for (var i = 0; i < children.length; i++) {
                    if (!validateSuspenseListNestedChild(children[i], i)) {
                      return;
                    }
                  }
                } else {
                  var iteratorFn = getIteratorFn(children);
                  if (typeof iteratorFn === "function") {
                    var childrenIterator = iteratorFn.call(children);
                    if (childrenIterator) {
                      var step = childrenIterator.next();
                      var _i = 0;
                      for (; !step.done; step = childrenIterator.next()) {
                        if (!validateSuspenseListNestedChild(step.value, _i)) {
                          return;
                        }
                        _i++;
                      }
                    }
                  } else {
                    error('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', revealOrder);
                  }
                }
              }
            }
          }
          function initSuspenseListRenderState(workInProgress2, isBackwards, tail, lastContentRow, tailMode) {
            var renderState = workInProgress2.memoizedState;
            if (renderState === null) {
              workInProgress2.memoizedState = {
                isBackwards,
                rendering: null,
                renderingStartTime: 0,
                last: lastContentRow,
                tail,
                tailMode
              };
            } else {
              renderState.isBackwards = isBackwards;
              renderState.rendering = null;
              renderState.renderingStartTime = 0;
              renderState.last = lastContentRow;
              renderState.tail = tail;
              renderState.tailMode = tailMode;
            }
          }
          function updateSuspenseListComponent(current2, workInProgress2, renderLanes2) {
            var nextProps = workInProgress2.pendingProps;
            var revealOrder = nextProps.revealOrder;
            var tailMode = nextProps.tail;
            var newChildren = nextProps.children;
            validateRevealOrder(revealOrder);
            validateTailOptions(tailMode, revealOrder);
            validateSuspenseListChildren(newChildren, revealOrder);
            reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
            var suspenseContext = suspenseStackCursor.current;
            var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
            if (shouldForceFallback) {
              suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
              workInProgress2.flags |= DidCapture;
            } else {
              var didSuspendBefore = current2 !== null && (current2.flags & DidCapture) !== NoFlags;
              if (didSuspendBefore) {
                propagateSuspenseContextChange(workInProgress2, workInProgress2.child, renderLanes2);
              }
              suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
            }
            pushSuspenseContext(workInProgress2, suspenseContext);
            if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
              workInProgress2.memoizedState = null;
            } else {
              switch (revealOrder) {
                case "forwards": {
                  var lastContentRow = findLastContentRow(workInProgress2.child);
                  var tail;
                  if (lastContentRow === null) {
                    tail = workInProgress2.child;
                    workInProgress2.child = null;
                  } else {
                    tail = lastContentRow.sibling;
                    lastContentRow.sibling = null;
                  }
                  initSuspenseListRenderState(
                    workInProgress2,
                    false,
                    // isBackwards
                    tail,
                    lastContentRow,
                    tailMode
                  );
                  break;
                }
                case "backwards": {
                  var _tail = null;
                  var row = workInProgress2.child;
                  workInProgress2.child = null;
                  while (row !== null) {
                    var currentRow = row.alternate;
                    if (currentRow !== null && findFirstSuspended(currentRow) === null) {
                      workInProgress2.child = row;
                      break;
                    }
                    var nextRow = row.sibling;
                    row.sibling = _tail;
                    _tail = row;
                    row = nextRow;
                  }
                  initSuspenseListRenderState(
                    workInProgress2,
                    true,
                    // isBackwards
                    _tail,
                    null,
                    // last
                    tailMode
                  );
                  break;
                }
                case "together": {
                  initSuspenseListRenderState(
                    workInProgress2,
                    false,
                    // isBackwards
                    null,
                    // tail
                    null,
                    // last
                    void 0
                  );
                  break;
                }
                default: {
                  workInProgress2.memoizedState = null;
                }
              }
            }
            return workInProgress2.child;
          }
          function updatePortalComponent(current2, workInProgress2, renderLanes2) {
            pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
            var nextChildren = workInProgress2.pendingProps;
            if (current2 === null) {
              workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderLanes2);
            } else {
              reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
            }
            return workInProgress2.child;
          }
          var hasWarnedAboutUsingNoValuePropOnContextProvider = false;
          function updateContextProvider(current2, workInProgress2, renderLanes2) {
            var providerType = workInProgress2.type;
            var context = providerType._context;
            var newProps = workInProgress2.pendingProps;
            var oldProps = workInProgress2.memoizedProps;
            var newValue = newProps.value;
            {
              if (!("value" in newProps)) {
                if (!hasWarnedAboutUsingNoValuePropOnContextProvider) {
                  hasWarnedAboutUsingNoValuePropOnContextProvider = true;
                  error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?");
                }
              }
              var providerPropTypes = workInProgress2.type.propTypes;
              if (providerPropTypes) {
                checkPropTypes(providerPropTypes, newProps, "prop", "Context.Provider");
              }
            }
            pushProvider(workInProgress2, context, newValue);
            {
              if (oldProps !== null) {
                var oldValue = oldProps.value;
                if (objectIs(oldValue, newValue)) {
                  if (oldProps.children === newProps.children && !hasContextChanged()) {
                    return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
                  }
                } else {
                  propagateContextChange(workInProgress2, context, renderLanes2);
                }
              }
            }
            var newChildren = newProps.children;
            reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
            return workInProgress2.child;
          }
          var hasWarnedAboutUsingContextAsConsumer = false;
          function updateContextConsumer(current2, workInProgress2, renderLanes2) {
            var context = workInProgress2.type;
            {
              if (context._context === void 0) {
                if (context !== context.Consumer) {
                  if (!hasWarnedAboutUsingContextAsConsumer) {
                    hasWarnedAboutUsingContextAsConsumer = true;
                    error("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
                  }
                }
              } else {
                context = context._context;
              }
            }
            var newProps = workInProgress2.pendingProps;
            var render2 = newProps.children;
            {
              if (typeof render2 !== "function") {
                error("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it.");
              }
            }
            prepareToReadContext(workInProgress2, renderLanes2);
            var newValue = readContext(context);
            {
              markComponentRenderStarted(workInProgress2);
            }
            var newChildren;
            {
              ReactCurrentOwner$1.current = workInProgress2;
              setIsRendering(true);
              newChildren = render2(newValue);
              setIsRendering(false);
            }
            {
              markComponentRenderStopped();
            }
            workInProgress2.flags |= PerformedWork;
            reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
            return workInProgress2.child;
          }
          function markWorkInProgressReceivedUpdate() {
            didReceiveUpdate = true;
          }
          function resetSuspendedCurrentOnMountInLegacyMode(current2, workInProgress2) {
            if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
              if (current2 !== null) {
                current2.alternate = null;
                workInProgress2.alternate = null;
                workInProgress2.flags |= Placement;
              }
            }
          }
          function bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2) {
            if (current2 !== null) {
              workInProgress2.dependencies = current2.dependencies;
            }
            {
              stopProfilerTimerIfRunning();
            }
            markSkippedUpdateLanes(workInProgress2.lanes);
            if (!includesSomeLane(renderLanes2, workInProgress2.childLanes)) {
              {
                return null;
              }
            }
            cloneChildFibers(current2, workInProgress2);
            return workInProgress2.child;
          }
          function remountFiber(current2, oldWorkInProgress, newWorkInProgress) {
            {
              var returnFiber = oldWorkInProgress.return;
              if (returnFiber === null) {
                throw new Error("Cannot swap the root fiber.");
              }
              current2.alternate = null;
              oldWorkInProgress.alternate = null;
              newWorkInProgress.index = oldWorkInProgress.index;
              newWorkInProgress.sibling = oldWorkInProgress.sibling;
              newWorkInProgress.return = oldWorkInProgress.return;
              newWorkInProgress.ref = oldWorkInProgress.ref;
              if (oldWorkInProgress === returnFiber.child) {
                returnFiber.child = newWorkInProgress;
              } else {
                var prevSibling = returnFiber.child;
                if (prevSibling === null) {
                  throw new Error("Expected parent to have a child.");
                }
                while (prevSibling.sibling !== oldWorkInProgress) {
                  prevSibling = prevSibling.sibling;
                  if (prevSibling === null) {
                    throw new Error("Expected to find the previous sibling.");
                  }
                }
                prevSibling.sibling = newWorkInProgress;
              }
              var deletions = returnFiber.deletions;
              if (deletions === null) {
                returnFiber.deletions = [current2];
                returnFiber.flags |= ChildDeletion;
              } else {
                deletions.push(current2);
              }
              newWorkInProgress.flags |= Placement;
              return newWorkInProgress;
            }
          }
          function checkScheduledUpdateOrContext(current2, renderLanes2) {
            var updateLanes = current2.lanes;
            if (includesSomeLane(updateLanes, renderLanes2)) {
              return true;
            }
            return false;
          }
          function attemptEarlyBailoutIfNoScheduledUpdate(current2, workInProgress2, renderLanes2) {
            switch (workInProgress2.tag) {
              case HostRoot:
                pushHostRootContext(workInProgress2);
                var root2 = workInProgress2.stateNode;
                resetHydrationState();
                break;
              case HostComponent:
                pushHostContext(workInProgress2);
                break;
              case ClassComponent: {
                var Component40 = workInProgress2.type;
                if (isContextProvider(Component40)) {
                  pushContextProvider(workInProgress2);
                }
                break;
              }
              case HostPortal:
                pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
                break;
              case ContextProvider: {
                var newValue = workInProgress2.memoizedProps.value;
                var context = workInProgress2.type._context;
                pushProvider(workInProgress2, context, newValue);
                break;
              }
              case Profiler:
                {
                  var hasChildWork = includesSomeLane(renderLanes2, workInProgress2.childLanes);
                  if (hasChildWork) {
                    workInProgress2.flags |= Update;
                  }
                  {
                    var stateNode = workInProgress2.stateNode;
                    stateNode.effectDuration = 0;
                    stateNode.passiveEffectDuration = 0;
                  }
                }
                break;
              case SuspenseComponent: {
                var state = workInProgress2.memoizedState;
                if (state !== null) {
                  if (state.dehydrated !== null) {
                    pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
                    workInProgress2.flags |= DidCapture;
                    return null;
                  }
                  var primaryChildFragment = workInProgress2.child;
                  var primaryChildLanes = primaryChildFragment.childLanes;
                  if (includesSomeLane(renderLanes2, primaryChildLanes)) {
                    return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
                  } else {
                    pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
                    var child = bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
                    if (child !== null) {
                      return child.sibling;
                    } else {
                      return null;
                    }
                  }
                } else {
                  pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
                }
                break;
              }
              case SuspenseListComponent: {
                var didSuspendBefore = (current2.flags & DidCapture) !== NoFlags;
                var _hasChildWork = includesSomeLane(renderLanes2, workInProgress2.childLanes);
                if (didSuspendBefore) {
                  if (_hasChildWork) {
                    return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
                  }
                  workInProgress2.flags |= DidCapture;
                }
                var renderState = workInProgress2.memoizedState;
                if (renderState !== null) {
                  renderState.rendering = null;
                  renderState.tail = null;
                  renderState.lastEffect = null;
                }
                pushSuspenseContext(workInProgress2, suspenseStackCursor.current);
                if (_hasChildWork) {
                  break;
                } else {
                  return null;
                }
              }
              case OffscreenComponent:
              case LegacyHiddenComponent: {
                workInProgress2.lanes = NoLanes;
                return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
              }
            }
            return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
          }
          function beginWork(current2, workInProgress2, renderLanes2) {
            {
              if (workInProgress2._debugNeedsRemount && current2 !== null) {
                return remountFiber(current2, workInProgress2, createFiberFromTypeAndProps(workInProgress2.type, workInProgress2.key, workInProgress2.pendingProps, workInProgress2._debugOwner || null, workInProgress2.mode, workInProgress2.lanes));
              }
            }
            if (current2 !== null) {
              var oldProps = current2.memoizedProps;
              var newProps = workInProgress2.pendingProps;
              if (oldProps !== newProps || hasContextChanged() || // Force a re-render if the implementation changed due to hot reload:
              workInProgress2.type !== current2.type) {
                didReceiveUpdate = true;
              } else {
                var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current2, renderLanes2);
                if (!hasScheduledUpdateOrContext && // If this is the second pass of an error or suspense boundary, there
                // may not be work scheduled on `current`, so we check for this flag.
                (workInProgress2.flags & DidCapture) === NoFlags) {
                  didReceiveUpdate = false;
                  return attemptEarlyBailoutIfNoScheduledUpdate(current2, workInProgress2, renderLanes2);
                }
                if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
                  didReceiveUpdate = true;
                } else {
                  didReceiveUpdate = false;
                }
              }
            } else {
              didReceiveUpdate = false;
              if (getIsHydrating() && isForkedChild(workInProgress2)) {
                var slotIndex = workInProgress2.index;
                var numberOfForks = getForksAtLevel();
                pushTreeId(workInProgress2, numberOfForks, slotIndex);
              }
            }
            workInProgress2.lanes = NoLanes;
            switch (workInProgress2.tag) {
              case IndeterminateComponent: {
                return mountIndeterminateComponent(current2, workInProgress2, workInProgress2.type, renderLanes2);
              }
              case LazyComponent: {
                var elementType = workInProgress2.elementType;
                return mountLazyComponent(current2, workInProgress2, elementType, renderLanes2);
              }
              case FunctionComponent2: {
                var Component40 = workInProgress2.type;
                var unresolvedProps = workInProgress2.pendingProps;
                var resolvedProps = workInProgress2.elementType === Component40 ? unresolvedProps : resolveDefaultProps(Component40, unresolvedProps);
                return updateFunctionComponent(current2, workInProgress2, Component40, resolvedProps, renderLanes2);
              }
              case ClassComponent: {
                var _Component = workInProgress2.type;
                var _unresolvedProps = workInProgress2.pendingProps;
                var _resolvedProps = workInProgress2.elementType === _Component ? _unresolvedProps : resolveDefaultProps(_Component, _unresolvedProps);
                return updateClassComponent(current2, workInProgress2, _Component, _resolvedProps, renderLanes2);
              }
              case HostRoot:
                return updateHostRoot(current2, workInProgress2, renderLanes2);
              case HostComponent:
                return updateHostComponent(current2, workInProgress2, renderLanes2);
              case HostText:
                return updateHostText(current2, workInProgress2);
              case SuspenseComponent:
                return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
              case HostPortal:
                return updatePortalComponent(current2, workInProgress2, renderLanes2);
              case ForwardRef: {
                var type = workInProgress2.type;
                var _unresolvedProps2 = workInProgress2.pendingProps;
                var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
                return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
              }
              case Fragment67:
                return updateFragment(current2, workInProgress2, renderLanes2);
              case Mode:
                return updateMode(current2, workInProgress2, renderLanes2);
              case Profiler:
                return updateProfiler(current2, workInProgress2, renderLanes2);
              case ContextProvider:
                return updateContextProvider(current2, workInProgress2, renderLanes2);
              case ContextConsumer:
                return updateContextConsumer(current2, workInProgress2, renderLanes2);
              case MemoComponent: {
                var _type2 = workInProgress2.type;
                var _unresolvedProps3 = workInProgress2.pendingProps;
                var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);
                {
                  if (workInProgress2.type !== workInProgress2.elementType) {
                    var outerPropTypes = _type2.propTypes;
                    if (outerPropTypes) {
                      checkPropTypes(
                        outerPropTypes,
                        _resolvedProps3,
                        // Resolved for outer only
                        "prop",
                        getComponentNameFromType(_type2)
                      );
                    }
                  }
                }
                _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
                return updateMemoComponent(current2, workInProgress2, _type2, _resolvedProps3, renderLanes2);
              }
              case SimpleMemoComponent: {
                return updateSimpleMemoComponent(current2, workInProgress2, workInProgress2.type, workInProgress2.pendingProps, renderLanes2);
              }
              case IncompleteClassComponent: {
                var _Component2 = workInProgress2.type;
                var _unresolvedProps4 = workInProgress2.pendingProps;
                var _resolvedProps4 = workInProgress2.elementType === _Component2 ? _unresolvedProps4 : resolveDefaultProps(_Component2, _unresolvedProps4);
                return mountIncompleteClassComponent(current2, workInProgress2, _Component2, _resolvedProps4, renderLanes2);
              }
              case SuspenseListComponent: {
                return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
              }
              case ScopeComponent: {
                break;
              }
              case OffscreenComponent: {
                return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
              }
            }
            throw new Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
          }
          function markUpdate(workInProgress2) {
            workInProgress2.flags |= Update;
          }
          function markRef$1(workInProgress2) {
            workInProgress2.flags |= Ref;
            {
              workInProgress2.flags |= RefStatic;
            }
          }
          var appendAllChildren;
          var updateHostContainer;
          var updateHostComponent$1;
          var updateHostText$1;
          {
            appendAllChildren = function(parent2, workInProgress2, needsVisibilityToggle, isHidden3) {
              var node = workInProgress2.child;
              while (node !== null) {
                if (node.tag === HostComponent || node.tag === HostText) {
                  appendInitialChild(parent2, node.stateNode);
                } else if (node.tag === HostPortal) ;
                else if (node.child !== null) {
                  node.child.return = node;
                  node = node.child;
                  continue;
                }
                if (node === workInProgress2) {
                  return;
                }
                while (node.sibling === null) {
                  if (node.return === null || node.return === workInProgress2) {
                    return;
                  }
                  node = node.return;
                }
                node.sibling.return = node.return;
                node = node.sibling;
              }
            };
            updateHostContainer = function(current2, workInProgress2) {
            };
            updateHostComponent$1 = function(current2, workInProgress2, type, newProps, rootContainerInstance) {
              var oldProps = current2.memoizedProps;
              if (oldProps === newProps) {
                return;
              }
              var instance = workInProgress2.stateNode;
              var currentHostContext = getHostContext();
              var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
              workInProgress2.updateQueue = updatePayload;
              if (updatePayload) {
                markUpdate(workInProgress2);
              }
            };
            updateHostText$1 = function(current2, workInProgress2, oldText, newText) {
              if (oldText !== newText) {
                markUpdate(workInProgress2);
              }
            };
          }
          function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
            if (getIsHydrating()) {
              return;
            }
            switch (renderState.tailMode) {
              case "hidden": {
                var tailNode = renderState.tail;
                var lastTailNode = null;
                while (tailNode !== null) {
                  if (tailNode.alternate !== null) {
                    lastTailNode = tailNode;
                  }
                  tailNode = tailNode.sibling;
                }
                if (lastTailNode === null) {
                  renderState.tail = null;
                } else {
                  lastTailNode.sibling = null;
                }
                break;
              }
              case "collapsed": {
                var _tailNode = renderState.tail;
                var _lastTailNode = null;
                while (_tailNode !== null) {
                  if (_tailNode.alternate !== null) {
                    _lastTailNode = _tailNode;
                  }
                  _tailNode = _tailNode.sibling;
                }
                if (_lastTailNode === null) {
                  if (!hasRenderedATailFallback && renderState.tail !== null) {
                    renderState.tail.sibling = null;
                  } else {
                    renderState.tail = null;
                  }
                } else {
                  _lastTailNode.sibling = null;
                }
                break;
              }
            }
          }
          function bubbleProperties(completedWork) {
            var didBailout = completedWork.alternate !== null && completedWork.alternate.child === completedWork.child;
            var newChildLanes = NoLanes;
            var subtreeFlags = NoFlags;
            if (!didBailout) {
              if ((completedWork.mode & ProfileMode) !== NoMode) {
                var actualDuration = completedWork.actualDuration;
                var treeBaseDuration = completedWork.selfBaseDuration;
                var child = completedWork.child;
                while (child !== null) {
                  newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes));
                  subtreeFlags |= child.subtreeFlags;
                  subtreeFlags |= child.flags;
                  actualDuration += child.actualDuration;
                  treeBaseDuration += child.treeBaseDuration;
                  child = child.sibling;
                }
                completedWork.actualDuration = actualDuration;
                completedWork.treeBaseDuration = treeBaseDuration;
              } else {
                var _child = completedWork.child;
                while (_child !== null) {
                  newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes));
                  subtreeFlags |= _child.subtreeFlags;
                  subtreeFlags |= _child.flags;
                  _child.return = completedWork;
                  _child = _child.sibling;
                }
              }
              completedWork.subtreeFlags |= subtreeFlags;
            } else {
              if ((completedWork.mode & ProfileMode) !== NoMode) {
                var _treeBaseDuration = completedWork.selfBaseDuration;
                var _child2 = completedWork.child;
                while (_child2 !== null) {
                  newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child2.lanes, _child2.childLanes));
                  subtreeFlags |= _child2.subtreeFlags & StaticMask;
                  subtreeFlags |= _child2.flags & StaticMask;
                  _treeBaseDuration += _child2.treeBaseDuration;
                  _child2 = _child2.sibling;
                }
                completedWork.treeBaseDuration = _treeBaseDuration;
              } else {
                var _child3 = completedWork.child;
                while (_child3 !== null) {
                  newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child3.lanes, _child3.childLanes));
                  subtreeFlags |= _child3.subtreeFlags & StaticMask;
                  subtreeFlags |= _child3.flags & StaticMask;
                  _child3.return = completedWork;
                  _child3 = _child3.sibling;
                }
              }
              completedWork.subtreeFlags |= subtreeFlags;
            }
            completedWork.childLanes = newChildLanes;
            return didBailout;
          }
          function completeDehydratedSuspenseBoundary(current2, workInProgress2, nextState) {
            if (hasUnhydratedTailNodes() && (workInProgress2.mode & ConcurrentMode) !== NoMode && (workInProgress2.flags & DidCapture) === NoFlags) {
              warnIfUnhydratedTailNodes(workInProgress2);
              resetHydrationState();
              workInProgress2.flags |= ForceClientRender | Incomplete | ShouldCapture;
              return false;
            }
            var wasHydrated = popHydrationState(workInProgress2);
            if (nextState !== null && nextState.dehydrated !== null) {
              if (current2 === null) {
                if (!wasHydrated) {
                  throw new Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");
                }
                prepareToHydrateHostSuspenseInstance(workInProgress2);
                bubbleProperties(workInProgress2);
                {
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    var isTimedOutSuspense = nextState !== null;
                    if (isTimedOutSuspense) {
                      var primaryChildFragment = workInProgress2.child;
                      if (primaryChildFragment !== null) {
                        workInProgress2.treeBaseDuration -= primaryChildFragment.treeBaseDuration;
                      }
                    }
                  }
                }
                return false;
              } else {
                resetHydrationState();
                if ((workInProgress2.flags & DidCapture) === NoFlags) {
                  workInProgress2.memoizedState = null;
                }
                workInProgress2.flags |= Update;
                bubbleProperties(workInProgress2);
                {
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    var _isTimedOutSuspense = nextState !== null;
                    if (_isTimedOutSuspense) {
                      var _primaryChildFragment = workInProgress2.child;
                      if (_primaryChildFragment !== null) {
                        workInProgress2.treeBaseDuration -= _primaryChildFragment.treeBaseDuration;
                      }
                    }
                  }
                }
                return false;
              }
            } else {
              upgradeHydrationErrorsToRecoverable();
              return true;
            }
          }
          function completeWork(current2, workInProgress2, renderLanes2) {
            var newProps = workInProgress2.pendingProps;
            popTreeContext(workInProgress2);
            switch (workInProgress2.tag) {
              case IndeterminateComponent:
              case LazyComponent:
              case SimpleMemoComponent:
              case FunctionComponent2:
              case ForwardRef:
              case Fragment67:
              case Mode:
              case Profiler:
              case ContextConsumer:
              case MemoComponent:
                bubbleProperties(workInProgress2);
                return null;
              case ClassComponent: {
                var Component40 = workInProgress2.type;
                if (isContextProvider(Component40)) {
                  popContext(workInProgress2);
                }
                bubbleProperties(workInProgress2);
                return null;
              }
              case HostRoot: {
                var fiberRoot = workInProgress2.stateNode;
                popHostContainer(workInProgress2);
                popTopLevelContextObject(workInProgress2);
                resetWorkInProgressVersions();
                if (fiberRoot.pendingContext) {
                  fiberRoot.context = fiberRoot.pendingContext;
                  fiberRoot.pendingContext = null;
                }
                if (current2 === null || current2.child === null) {
                  var wasHydrated = popHydrationState(workInProgress2);
                  if (wasHydrated) {
                    markUpdate(workInProgress2);
                  } else {
                    if (current2 !== null) {
                      var prevState = current2.memoizedState;
                      if (
                        // Check if this is a client root
                        !prevState.isDehydrated || // Check if we reverted to client rendering (e.g. due to an error)
                        (workInProgress2.flags & ForceClientRender) !== NoFlags
                      ) {
                        workInProgress2.flags |= Snapshot;
                        upgradeHydrationErrorsToRecoverable();
                      }
                    }
                  }
                }
                updateHostContainer(current2, workInProgress2);
                bubbleProperties(workInProgress2);
                return null;
              }
              case HostComponent: {
                popHostContext(workInProgress2);
                var rootContainerInstance = getRootHostContainer();
                var type = workInProgress2.type;
                if (current2 !== null && workInProgress2.stateNode != null) {
                  updateHostComponent$1(current2, workInProgress2, type, newProps, rootContainerInstance);
                  if (current2.ref !== workInProgress2.ref) {
                    markRef$1(workInProgress2);
                  }
                } else {
                  if (!newProps) {
                    if (workInProgress2.stateNode === null) {
                      throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
                    }
                    bubbleProperties(workInProgress2);
                    return null;
                  }
                  var currentHostContext = getHostContext();
                  var _wasHydrated = popHydrationState(workInProgress2);
                  if (_wasHydrated) {
                    if (prepareToHydrateHostInstance(workInProgress2, rootContainerInstance, currentHostContext)) {
                      markUpdate(workInProgress2);
                    }
                  } else {
                    var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress2);
                    appendAllChildren(instance, workInProgress2, false, false);
                    workInProgress2.stateNode = instance;
                    if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {
                      markUpdate(workInProgress2);
                    }
                  }
                  if (workInProgress2.ref !== null) {
                    markRef$1(workInProgress2);
                  }
                }
                bubbleProperties(workInProgress2);
                return null;
              }
              case HostText: {
                var newText = newProps;
                if (current2 && workInProgress2.stateNode != null) {
                  var oldText = current2.memoizedProps;
                  updateHostText$1(current2, workInProgress2, oldText, newText);
                } else {
                  if (typeof newText !== "string") {
                    if (workInProgress2.stateNode === null) {
                      throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
                    }
                  }
                  var _rootContainerInstance = getRootHostContainer();
                  var _currentHostContext = getHostContext();
                  var _wasHydrated2 = popHydrationState(workInProgress2);
                  if (_wasHydrated2) {
                    if (prepareToHydrateHostTextInstance(workInProgress2)) {
                      markUpdate(workInProgress2);
                    }
                  } else {
                    workInProgress2.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress2);
                  }
                }
                bubbleProperties(workInProgress2);
                return null;
              }
              case SuspenseComponent: {
                popSuspenseContext(workInProgress2);
                var nextState = workInProgress2.memoizedState;
                if (current2 === null || current2.memoizedState !== null && current2.memoizedState.dehydrated !== null) {
                  var fallthroughToNormalSuspensePath = completeDehydratedSuspenseBoundary(current2, workInProgress2, nextState);
                  if (!fallthroughToNormalSuspensePath) {
                    if (workInProgress2.flags & ShouldCapture) {
                      return workInProgress2;
                    } else {
                      return null;
                    }
                  }
                }
                if ((workInProgress2.flags & DidCapture) !== NoFlags) {
                  workInProgress2.lanes = renderLanes2;
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    transferActualDuration(workInProgress2);
                  }
                  return workInProgress2;
                }
                var nextDidTimeout = nextState !== null;
                var prevDidTimeout = current2 !== null && current2.memoizedState !== null;
                if (nextDidTimeout !== prevDidTimeout) {
                  if (nextDidTimeout) {
                    var _offscreenFiber2 = workInProgress2.child;
                    _offscreenFiber2.flags |= Visibility2;
                    if ((workInProgress2.mode & ConcurrentMode) !== NoMode) {
                      var hasInvisibleChildContext = current2 === null && (workInProgress2.memoizedProps.unstable_avoidThisFallback !== true || !enableSuspenseAvoidThisFallback);
                      if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
                        renderDidSuspend();
                      } else {
                        renderDidSuspendDelayIfPossible();
                      }
                    }
                  }
                }
                var wakeables = workInProgress2.updateQueue;
                if (wakeables !== null) {
                  workInProgress2.flags |= Update;
                }
                bubbleProperties(workInProgress2);
                {
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    if (nextDidTimeout) {
                      var primaryChildFragment = workInProgress2.child;
                      if (primaryChildFragment !== null) {
                        workInProgress2.treeBaseDuration -= primaryChildFragment.treeBaseDuration;
                      }
                    }
                  }
                }
                return null;
              }
              case HostPortal:
                popHostContainer(workInProgress2);
                updateHostContainer(current2, workInProgress2);
                if (current2 === null) {
                  preparePortalMount(workInProgress2.stateNode.containerInfo);
                }
                bubbleProperties(workInProgress2);
                return null;
              case ContextProvider:
                var context = workInProgress2.type._context;
                popProvider(context, workInProgress2);
                bubbleProperties(workInProgress2);
                return null;
              case IncompleteClassComponent: {
                var _Component = workInProgress2.type;
                if (isContextProvider(_Component)) {
                  popContext(workInProgress2);
                }
                bubbleProperties(workInProgress2);
                return null;
              }
              case SuspenseListComponent: {
                popSuspenseContext(workInProgress2);
                var renderState = workInProgress2.memoizedState;
                if (renderState === null) {
                  bubbleProperties(workInProgress2);
                  return null;
                }
                var didSuspendAlready = (workInProgress2.flags & DidCapture) !== NoFlags;
                var renderedTail = renderState.rendering;
                if (renderedTail === null) {
                  if (!didSuspendAlready) {
                    var cannotBeSuspended = renderHasNotSuspendedYet() && (current2 === null || (current2.flags & DidCapture) === NoFlags);
                    if (!cannotBeSuspended) {
                      var row = workInProgress2.child;
                      while (row !== null) {
                        var suspended = findFirstSuspended(row);
                        if (suspended !== null) {
                          didSuspendAlready = true;
                          workInProgress2.flags |= DidCapture;
                          cutOffTailIfNeeded(renderState, false);
                          var newThenables = suspended.updateQueue;
                          if (newThenables !== null) {
                            workInProgress2.updateQueue = newThenables;
                            workInProgress2.flags |= Update;
                          }
                          workInProgress2.subtreeFlags = NoFlags;
                          resetChildFibers(workInProgress2, renderLanes2);
                          pushSuspenseContext(workInProgress2, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
                          return workInProgress2.child;
                        }
                        row = row.sibling;
                      }
                    }
                    if (renderState.tail !== null && now3() > getRenderTargetTime()) {
                      workInProgress2.flags |= DidCapture;
                      didSuspendAlready = true;
                      cutOffTailIfNeeded(renderState, false);
                      workInProgress2.lanes = SomeRetryLane;
                    }
                  } else {
                    cutOffTailIfNeeded(renderState, false);
                  }
                } else {
                  if (!didSuspendAlready) {
                    var _suspended = findFirstSuspended(renderedTail);
                    if (_suspended !== null) {
                      workInProgress2.flags |= DidCapture;
                      didSuspendAlready = true;
                      var _newThenables = _suspended.updateQueue;
                      if (_newThenables !== null) {
                        workInProgress2.updateQueue = _newThenables;
                        workInProgress2.flags |= Update;
                      }
                      cutOffTailIfNeeded(renderState, true);
                      if (renderState.tail === null && renderState.tailMode === "hidden" && !renderedTail.alternate && !getIsHydrating()) {
                        bubbleProperties(workInProgress2);
                        return null;
                      }
                    } else if (
                      // The time it took to render last row is greater than the remaining
                      // time we have to render. So rendering one more row would likely
                      // exceed it.
                      now3() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes2 !== OffscreenLane
                    ) {
                      workInProgress2.flags |= DidCapture;
                      didSuspendAlready = true;
                      cutOffTailIfNeeded(renderState, false);
                      workInProgress2.lanes = SomeRetryLane;
                    }
                  }
                  if (renderState.isBackwards) {
                    renderedTail.sibling = workInProgress2.child;
                    workInProgress2.child = renderedTail;
                  } else {
                    var previousSibling = renderState.last;
                    if (previousSibling !== null) {
                      previousSibling.sibling = renderedTail;
                    } else {
                      workInProgress2.child = renderedTail;
                    }
                    renderState.last = renderedTail;
                  }
                }
                if (renderState.tail !== null) {
                  var next = renderState.tail;
                  renderState.rendering = next;
                  renderState.tail = next.sibling;
                  renderState.renderingStartTime = now3();
                  next.sibling = null;
                  var suspenseContext = suspenseStackCursor.current;
                  if (didSuspendAlready) {
                    suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
                  } else {
                    suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
                  }
                  pushSuspenseContext(workInProgress2, suspenseContext);
                  return next;
                }
                bubbleProperties(workInProgress2);
                return null;
              }
              case ScopeComponent: {
                break;
              }
              case OffscreenComponent:
              case LegacyHiddenComponent: {
                popRenderLanes(workInProgress2);
                var _nextState = workInProgress2.memoizedState;
                var nextIsHidden = _nextState !== null;
                if (current2 !== null) {
                  var _prevState = current2.memoizedState;
                  var prevIsHidden = _prevState !== null;
                  if (prevIsHidden !== nextIsHidden && // LegacyHidden doesn't do any hiding — it only pre-renders.
                  !enableLegacyHidden) {
                    workInProgress2.flags |= Visibility2;
                  }
                }
                if (!nextIsHidden || (workInProgress2.mode & ConcurrentMode) === NoMode) {
                  bubbleProperties(workInProgress2);
                } else {
                  if (includesSomeLane(subtreeRenderLanes, OffscreenLane)) {
                    bubbleProperties(workInProgress2);
                    {
                      if (workInProgress2.subtreeFlags & (Placement | Update)) {
                        workInProgress2.flags |= Visibility2;
                      }
                    }
                  }
                }
                return null;
              }
              case CacheComponent: {
                return null;
              }
              case TracingMarkerComponent: {
                return null;
              }
            }
            throw new Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
          }
          function unwindWork(current2, workInProgress2, renderLanes2) {
            popTreeContext(workInProgress2);
            switch (workInProgress2.tag) {
              case ClassComponent: {
                var Component40 = workInProgress2.type;
                if (isContextProvider(Component40)) {
                  popContext(workInProgress2);
                }
                var flags = workInProgress2.flags;
                if (flags & ShouldCapture) {
                  workInProgress2.flags = flags & ~ShouldCapture | DidCapture;
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    transferActualDuration(workInProgress2);
                  }
                  return workInProgress2;
                }
                return null;
              }
              case HostRoot: {
                var root2 = workInProgress2.stateNode;
                popHostContainer(workInProgress2);
                popTopLevelContextObject(workInProgress2);
                resetWorkInProgressVersions();
                var _flags = workInProgress2.flags;
                if ((_flags & ShouldCapture) !== NoFlags && (_flags & DidCapture) === NoFlags) {
                  workInProgress2.flags = _flags & ~ShouldCapture | DidCapture;
                  return workInProgress2;
                }
                return null;
              }
              case HostComponent: {
                popHostContext(workInProgress2);
                return null;
              }
              case SuspenseComponent: {
                popSuspenseContext(workInProgress2);
                var suspenseState = workInProgress2.memoizedState;
                if (suspenseState !== null && suspenseState.dehydrated !== null) {
                  if (workInProgress2.alternate === null) {
                    throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");
                  }
                  resetHydrationState();
                }
                var _flags2 = workInProgress2.flags;
                if (_flags2 & ShouldCapture) {
                  workInProgress2.flags = _flags2 & ~ShouldCapture | DidCapture;
                  if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                    transferActualDuration(workInProgress2);
                  }
                  return workInProgress2;
                }
                return null;
              }
              case SuspenseListComponent: {
                popSuspenseContext(workInProgress2);
                return null;
              }
              case HostPortal:
                popHostContainer(workInProgress2);
                return null;
              case ContextProvider:
                var context = workInProgress2.type._context;
                popProvider(context, workInProgress2);
                return null;
              case OffscreenComponent:
              case LegacyHiddenComponent:
                popRenderLanes(workInProgress2);
                return null;
              case CacheComponent:
                return null;
              default:
                return null;
            }
          }
          function unwindInterruptedWork(current2, interruptedWork, renderLanes2) {
            popTreeContext(interruptedWork);
            switch (interruptedWork.tag) {
              case ClassComponent: {
                var childContextTypes = interruptedWork.type.childContextTypes;
                if (childContextTypes !== null && childContextTypes !== void 0) {
                  popContext(interruptedWork);
                }
                break;
              }
              case HostRoot: {
                var root2 = interruptedWork.stateNode;
                popHostContainer(interruptedWork);
                popTopLevelContextObject(interruptedWork);
                resetWorkInProgressVersions();
                break;
              }
              case HostComponent: {
                popHostContext(interruptedWork);
                break;
              }
              case HostPortal:
                popHostContainer(interruptedWork);
                break;
              case SuspenseComponent:
                popSuspenseContext(interruptedWork);
                break;
              case SuspenseListComponent:
                popSuspenseContext(interruptedWork);
                break;
              case ContextProvider:
                var context = interruptedWork.type._context;
                popProvider(context, interruptedWork);
                break;
              case OffscreenComponent:
              case LegacyHiddenComponent:
                popRenderLanes(interruptedWork);
                break;
            }
          }
          var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
          {
            didWarnAboutUndefinedSnapshotBeforeUpdate = /* @__PURE__ */ new Set();
          }
          var offscreenSubtreeIsHidden = false;
          var offscreenSubtreeWasHidden = false;
          var PossiblyWeakSet = typeof WeakSet === "function" ? WeakSet : Set;
          var nextEffect = null;
          var inProgressLanes = null;
          var inProgressRoot = null;
          function reportUncaughtErrorInDEV(error2) {
            {
              invokeGuardedCallback(null, function() {
                throw error2;
              });
              clearCaughtError();
            }
          }
          var callComponentWillUnmountWithTimer = function(current2, instance) {
            instance.props = current2.memoizedProps;
            instance.state = current2.memoizedState;
            if (current2.mode & ProfileMode) {
              try {
                startLayoutEffectTimer();
                instance.componentWillUnmount();
              } finally {
                recordLayoutEffectDuration(current2);
              }
            } else {
              instance.componentWillUnmount();
            }
          };
          function safelyCallCommitHookLayoutEffectListMount(current2, nearestMountedAncestor) {
            try {
              commitHookEffectListMount(Layout, current2);
            } catch (error2) {
              captureCommitPhaseError(current2, nearestMountedAncestor, error2);
            }
          }
          function safelyCallComponentWillUnmount(current2, nearestMountedAncestor, instance) {
            try {
              callComponentWillUnmountWithTimer(current2, instance);
            } catch (error2) {
              captureCommitPhaseError(current2, nearestMountedAncestor, error2);
            }
          }
          function safelyCallComponentDidMount(current2, nearestMountedAncestor, instance) {
            try {
              instance.componentDidMount();
            } catch (error2) {
              captureCommitPhaseError(current2, nearestMountedAncestor, error2);
            }
          }
          function safelyAttachRef(current2, nearestMountedAncestor) {
            try {
              commitAttachRef(current2);
            } catch (error2) {
              captureCommitPhaseError(current2, nearestMountedAncestor, error2);
            }
          }
          function safelyDetachRef(current2, nearestMountedAncestor) {
            var ref = current2.ref;
            if (ref !== null) {
              if (typeof ref === "function") {
                var retVal;
                try {
                  if (enableProfilerTimer && enableProfilerCommitHooks && current2.mode & ProfileMode) {
                    try {
                      startLayoutEffectTimer();
                      retVal = ref(null);
                    } finally {
                      recordLayoutEffectDuration(current2);
                    }
                  } else {
                    retVal = ref(null);
                  }
                } catch (error2) {
                  captureCommitPhaseError(current2, nearestMountedAncestor, error2);
                }
                {
                  if (typeof retVal === "function") {
                    error("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", getComponentNameFromFiber(current2));
                  }
                }
              } else {
                ref.current = null;
              }
            }
          }
          function safelyCallDestroy(current2, nearestMountedAncestor, destroy) {
            try {
              destroy();
            } catch (error2) {
              captureCommitPhaseError(current2, nearestMountedAncestor, error2);
            }
          }
          var focusedInstanceHandle = null;
          var shouldFireAfterActiveInstanceBlur = false;
          function commitBeforeMutationEffects(root2, firstChild) {
            focusedInstanceHandle = prepareForCommit(root2.containerInfo);
            nextEffect = firstChild;
            commitBeforeMutationEffects_begin();
            var shouldFire = shouldFireAfterActiveInstanceBlur;
            shouldFireAfterActiveInstanceBlur = false;
            focusedInstanceHandle = null;
            return shouldFire;
          }
          function commitBeforeMutationEffects_begin() {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              var child = fiber.child;
              if ((fiber.subtreeFlags & BeforeMutationMask) !== NoFlags && child !== null) {
                child.return = fiber;
                nextEffect = child;
              } else {
                commitBeforeMutationEffects_complete();
              }
            }
          }
          function commitBeforeMutationEffects_complete() {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              setCurrentFiber(fiber);
              try {
                commitBeforeMutationEffectsOnFiber(fiber);
              } catch (error2) {
                captureCommitPhaseError(fiber, fiber.return, error2);
              }
              resetCurrentFiber();
              var sibling = fiber.sibling;
              if (sibling !== null) {
                sibling.return = fiber.return;
                nextEffect = sibling;
                return;
              }
              nextEffect = fiber.return;
            }
          }
          function commitBeforeMutationEffectsOnFiber(finishedWork) {
            var current2 = finishedWork.alternate;
            var flags = finishedWork.flags;
            if ((flags & Snapshot) !== NoFlags) {
              setCurrentFiber(finishedWork);
              switch (finishedWork.tag) {
                case FunctionComponent2:
                case ForwardRef:
                case SimpleMemoComponent: {
                  break;
                }
                case ClassComponent: {
                  if (current2 !== null) {
                    var prevProps = current2.memoizedProps;
                    var prevState = current2.memoizedState;
                    var instance = finishedWork.stateNode;
                    {
                      if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                        if (instance.props !== finishedWork.memoizedProps) {
                          error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
                        }
                        if (instance.state !== finishedWork.memoizedState) {
                          error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
                        }
                      }
                    }
                    var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);
                    {
                      var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;
                      if (snapshot === void 0 && !didWarnSet.has(finishedWork.type)) {
                        didWarnSet.add(finishedWork.type);
                        error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", getComponentNameFromFiber(finishedWork));
                      }
                    }
                    instance.__reactInternalSnapshotBeforeUpdate = snapshot;
                  }
                  break;
                }
                case HostRoot: {
                  {
                    var root2 = finishedWork.stateNode;
                    clearContainer(root2.containerInfo);
                  }
                  break;
                }
                case HostComponent:
                case HostText:
                case HostPortal:
                case IncompleteClassComponent:
                  break;
                default: {
                  throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
              resetCurrentFiber();
            }
          }
          function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor) {
            var updateQueue = finishedWork.updateQueue;
            var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
            if (lastEffect !== null) {
              var firstEffect = lastEffect.next;
              var effect4 = firstEffect;
              do {
                if ((effect4.tag & flags) === flags) {
                  var destroy = effect4.destroy;
                  effect4.destroy = void 0;
                  if (destroy !== void 0) {
                    {
                      if ((flags & Passive$1) !== NoFlags$1) {
                        markComponentPassiveEffectUnmountStarted(finishedWork);
                      } else if ((flags & Layout) !== NoFlags$1) {
                        markComponentLayoutEffectUnmountStarted(finishedWork);
                      }
                    }
                    {
                      if ((flags & Insertion) !== NoFlags$1) {
                        setIsRunningInsertionEffect(true);
                      }
                    }
                    safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy);
                    {
                      if ((flags & Insertion) !== NoFlags$1) {
                        setIsRunningInsertionEffect(false);
                      }
                    }
                    {
                      if ((flags & Passive$1) !== NoFlags$1) {
                        markComponentPassiveEffectUnmountStopped();
                      } else if ((flags & Layout) !== NoFlags$1) {
                        markComponentLayoutEffectUnmountStopped();
                      }
                    }
                  }
                }
                effect4 = effect4.next;
              } while (effect4 !== firstEffect);
            }
          }
          function commitHookEffectListMount(flags, finishedWork) {
            var updateQueue = finishedWork.updateQueue;
            var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
            if (lastEffect !== null) {
              var firstEffect = lastEffect.next;
              var effect4 = firstEffect;
              do {
                if ((effect4.tag & flags) === flags) {
                  {
                    if ((flags & Passive$1) !== NoFlags$1) {
                      markComponentPassiveEffectMountStarted(finishedWork);
                    } else if ((flags & Layout) !== NoFlags$1) {
                      markComponentLayoutEffectMountStarted(finishedWork);
                    }
                  }
                  var create = effect4.create;
                  {
                    if ((flags & Insertion) !== NoFlags$1) {
                      setIsRunningInsertionEffect(true);
                    }
                  }
                  effect4.destroy = create();
                  {
                    if ((flags & Insertion) !== NoFlags$1) {
                      setIsRunningInsertionEffect(false);
                    }
                  }
                  {
                    if ((flags & Passive$1) !== NoFlags$1) {
                      markComponentPassiveEffectMountStopped();
                    } else if ((flags & Layout) !== NoFlags$1) {
                      markComponentLayoutEffectMountStopped();
                    }
                  }
                  {
                    var destroy = effect4.destroy;
                    if (destroy !== void 0 && typeof destroy !== "function") {
                      var hookName = void 0;
                      if ((effect4.tag & Layout) !== NoFlags) {
                        hookName = "useLayoutEffect";
                      } else if ((effect4.tag & Insertion) !== NoFlags) {
                        hookName = "useInsertionEffect";
                      } else {
                        hookName = "useEffect";
                      }
                      var addendum = void 0;
                      if (destroy === null) {
                        addendum = " You returned null. If your effect does not require clean up, return undefined (or nothing).";
                      } else if (typeof destroy.then === "function") {
                        addendum = "\n\nIt looks like you wrote " + hookName + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + hookName + "(() => {\n  async function fetchData() {\n    // You can await here\n    const response = await MyAPI.getData(someId);\n    // ...\n  }\n  fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching";
                      } else {
                        addendum = " You returned: " + destroy;
                      }
                      error("%s must not return anything besides a function, which is used for clean-up.%s", hookName, addendum);
                    }
                  }
                }
                effect4 = effect4.next;
              } while (effect4 !== firstEffect);
            }
          }
          function commitPassiveEffectDurations(finishedRoot, finishedWork) {
            {
              if ((finishedWork.flags & Update) !== NoFlags) {
                switch (finishedWork.tag) {
                  case Profiler: {
                    var passiveEffectDuration = finishedWork.stateNode.passiveEffectDuration;
                    var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onPostCommit = _finishedWork$memoize.onPostCommit;
                    var commitTime2 = getCommitTime();
                    var phase = finishedWork.alternate === null ? "mount" : "update";
                    {
                      if (isCurrentUpdateNested()) {
                        phase = "nested-update";
                      }
                    }
                    if (typeof onPostCommit === "function") {
                      onPostCommit(id, phase, passiveEffectDuration, commitTime2);
                    }
                    var parentFiber = finishedWork.return;
                    outer: while (parentFiber !== null) {
                      switch (parentFiber.tag) {
                        case HostRoot:
                          var root2 = parentFiber.stateNode;
                          root2.passiveEffectDuration += passiveEffectDuration;
                          break outer;
                        case Profiler:
                          var parentStateNode = parentFiber.stateNode;
                          parentStateNode.passiveEffectDuration += passiveEffectDuration;
                          break outer;
                      }
                      parentFiber = parentFiber.return;
                    }
                    break;
                  }
                }
              }
            }
          }
          function commitLayoutEffectOnFiber(finishedRoot, current2, finishedWork, committedLanes) {
            if ((finishedWork.flags & LayoutMask) !== NoFlags) {
              switch (finishedWork.tag) {
                case FunctionComponent2:
                case ForwardRef:
                case SimpleMemoComponent: {
                  if (!offscreenSubtreeWasHidden) {
                    if (finishedWork.mode & ProfileMode) {
                      try {
                        startLayoutEffectTimer();
                        commitHookEffectListMount(Layout | HasEffect, finishedWork);
                      } finally {
                        recordLayoutEffectDuration(finishedWork);
                      }
                    } else {
                      commitHookEffectListMount(Layout | HasEffect, finishedWork);
                    }
                  }
                  break;
                }
                case ClassComponent: {
                  var instance = finishedWork.stateNode;
                  if (finishedWork.flags & Update) {
                    if (!offscreenSubtreeWasHidden) {
                      if (current2 === null) {
                        {
                          if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                            if (instance.props !== finishedWork.memoizedProps) {
                              error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
                            }
                            if (instance.state !== finishedWork.memoizedState) {
                              error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
                            }
                          }
                        }
                        if (finishedWork.mode & ProfileMode) {
                          try {
                            startLayoutEffectTimer();
                            instance.componentDidMount();
                          } finally {
                            recordLayoutEffectDuration(finishedWork);
                          }
                        } else {
                          instance.componentDidMount();
                        }
                      } else {
                        var prevProps = finishedWork.elementType === finishedWork.type ? current2.memoizedProps : resolveDefaultProps(finishedWork.type, current2.memoizedProps);
                        var prevState = current2.memoizedState;
                        {
                          if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                            if (instance.props !== finishedWork.memoizedProps) {
                              error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
                            }
                            if (instance.state !== finishedWork.memoizedState) {
                              error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
                            }
                          }
                        }
                        if (finishedWork.mode & ProfileMode) {
                          try {
                            startLayoutEffectTimer();
                            instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
                          } finally {
                            recordLayoutEffectDuration(finishedWork);
                          }
                        } else {
                          instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
                        }
                      }
                    }
                  }
                  var updateQueue = finishedWork.updateQueue;
                  if (updateQueue !== null) {
                    {
                      if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                        if (instance.props !== finishedWork.memoizedProps) {
                          error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
                        }
                        if (instance.state !== finishedWork.memoizedState) {
                          error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
                        }
                      }
                    }
                    commitUpdateQueue(finishedWork, updateQueue, instance);
                  }
                  break;
                }
                case HostRoot: {
                  var _updateQueue = finishedWork.updateQueue;
                  if (_updateQueue !== null) {
                    var _instance = null;
                    if (finishedWork.child !== null) {
                      switch (finishedWork.child.tag) {
                        case HostComponent:
                          _instance = getPublicInstance(finishedWork.child.stateNode);
                          break;
                        case ClassComponent:
                          _instance = finishedWork.child.stateNode;
                          break;
                      }
                    }
                    commitUpdateQueue(finishedWork, _updateQueue, _instance);
                  }
                  break;
                }
                case HostComponent: {
                  var _instance2 = finishedWork.stateNode;
                  if (current2 === null && finishedWork.flags & Update) {
                    var type = finishedWork.type;
                    var props = finishedWork.memoizedProps;
                    commitMount(_instance2, type, props);
                  }
                  break;
                }
                case HostText: {
                  break;
                }
                case HostPortal: {
                  break;
                }
                case Profiler: {
                  {
                    var _finishedWork$memoize2 = finishedWork.memoizedProps, onCommit = _finishedWork$memoize2.onCommit, onRender = _finishedWork$memoize2.onRender;
                    var effectDuration = finishedWork.stateNode.effectDuration;
                    var commitTime2 = getCommitTime();
                    var phase = current2 === null ? "mount" : "update";
                    {
                      if (isCurrentUpdateNested()) {
                        phase = "nested-update";
                      }
                    }
                    if (typeof onRender === "function") {
                      onRender(finishedWork.memoizedProps.id, phase, finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime2);
                    }
                    {
                      if (typeof onCommit === "function") {
                        onCommit(finishedWork.memoizedProps.id, phase, effectDuration, commitTime2);
                      }
                      enqueuePendingPassiveProfilerEffect(finishedWork);
                      var parentFiber = finishedWork.return;
                      outer: while (parentFiber !== null) {
                        switch (parentFiber.tag) {
                          case HostRoot:
                            var root2 = parentFiber.stateNode;
                            root2.effectDuration += effectDuration;
                            break outer;
                          case Profiler:
                            var parentStateNode = parentFiber.stateNode;
                            parentStateNode.effectDuration += effectDuration;
                            break outer;
                        }
                        parentFiber = parentFiber.return;
                      }
                    }
                  }
                  break;
                }
                case SuspenseComponent: {
                  commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
                  break;
                }
                case SuspenseListComponent:
                case IncompleteClassComponent:
                case ScopeComponent:
                case OffscreenComponent:
                case LegacyHiddenComponent:
                case TracingMarkerComponent: {
                  break;
                }
                default:
                  throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            if (!offscreenSubtreeWasHidden) {
              {
                if (finishedWork.flags & Ref) {
                  commitAttachRef(finishedWork);
                }
              }
            }
          }
          function reappearLayoutEffectsOnFiber(node) {
            switch (node.tag) {
              case FunctionComponent2:
              case ForwardRef:
              case SimpleMemoComponent: {
                if (node.mode & ProfileMode) {
                  try {
                    startLayoutEffectTimer();
                    safelyCallCommitHookLayoutEffectListMount(node, node.return);
                  } finally {
                    recordLayoutEffectDuration(node);
                  }
                } else {
                  safelyCallCommitHookLayoutEffectListMount(node, node.return);
                }
                break;
              }
              case ClassComponent: {
                var instance = node.stateNode;
                if (typeof instance.componentDidMount === "function") {
                  safelyCallComponentDidMount(node, node.return, instance);
                }
                safelyAttachRef(node, node.return);
                break;
              }
              case HostComponent: {
                safelyAttachRef(node, node.return);
                break;
              }
            }
          }
          function hideOrUnhideAllChildren(finishedWork, isHidden3) {
            var hostSubtreeRoot = null;
            {
              var node = finishedWork;
              while (true) {
                if (node.tag === HostComponent) {
                  if (hostSubtreeRoot === null) {
                    hostSubtreeRoot = node;
                    try {
                      var instance = node.stateNode;
                      if (isHidden3) {
                        hideInstance(instance);
                      } else {
                        unhideInstance(node.stateNode, node.memoizedProps);
                      }
                    } catch (error2) {
                      captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                    }
                  }
                } else if (node.tag === HostText) {
                  if (hostSubtreeRoot === null) {
                    try {
                      var _instance3 = node.stateNode;
                      if (isHidden3) {
                        hideTextInstance(_instance3);
                      } else {
                        unhideTextInstance(_instance3, node.memoizedProps);
                      }
                    } catch (error2) {
                      captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                    }
                  }
                } else if ((node.tag === OffscreenComponent || node.tag === LegacyHiddenComponent) && node.memoizedState !== null && node !== finishedWork) ;
                else if (node.child !== null) {
                  node.child.return = node;
                  node = node.child;
                  continue;
                }
                if (node === finishedWork) {
                  return;
                }
                while (node.sibling === null) {
                  if (node.return === null || node.return === finishedWork) {
                    return;
                  }
                  if (hostSubtreeRoot === node) {
                    hostSubtreeRoot = null;
                  }
                  node = node.return;
                }
                if (hostSubtreeRoot === node) {
                  hostSubtreeRoot = null;
                }
                node.sibling.return = node.return;
                node = node.sibling;
              }
            }
          }
          function commitAttachRef(finishedWork) {
            var ref = finishedWork.ref;
            if (ref !== null) {
              var instance = finishedWork.stateNode;
              var instanceToUse;
              switch (finishedWork.tag) {
                case HostComponent:
                  instanceToUse = getPublicInstance(instance);
                  break;
                default:
                  instanceToUse = instance;
              }
              if (typeof ref === "function") {
                var retVal;
                if (finishedWork.mode & ProfileMode) {
                  try {
                    startLayoutEffectTimer();
                    retVal = ref(instanceToUse);
                  } finally {
                    recordLayoutEffectDuration(finishedWork);
                  }
                } else {
                  retVal = ref(instanceToUse);
                }
                {
                  if (typeof retVal === "function") {
                    error("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", getComponentNameFromFiber(finishedWork));
                  }
                }
              } else {
                {
                  if (!ref.hasOwnProperty("current")) {
                    error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", getComponentNameFromFiber(finishedWork));
                  }
                }
                ref.current = instanceToUse;
              }
            }
          }
          function detachFiberMutation(fiber) {
            var alternate = fiber.alternate;
            if (alternate !== null) {
              alternate.return = null;
            }
            fiber.return = null;
          }
          function detachFiberAfterEffects(fiber) {
            var alternate = fiber.alternate;
            if (alternate !== null) {
              fiber.alternate = null;
              detachFiberAfterEffects(alternate);
            }
            {
              fiber.child = null;
              fiber.deletions = null;
              fiber.sibling = null;
              if (fiber.tag === HostComponent) {
                var hostInstance = fiber.stateNode;
                if (hostInstance !== null) {
                  detachDeletedInstance(hostInstance);
                }
              }
              fiber.stateNode = null;
              {
                fiber._debugOwner = null;
              }
              {
                fiber.return = null;
                fiber.dependencies = null;
                fiber.memoizedProps = null;
                fiber.memoizedState = null;
                fiber.pendingProps = null;
                fiber.stateNode = null;
                fiber.updateQueue = null;
              }
            }
          }
          function getHostParentFiber(fiber) {
            var parent2 = fiber.return;
            while (parent2 !== null) {
              if (isHostParent(parent2)) {
                return parent2;
              }
              parent2 = parent2.return;
            }
            throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
          }
          function isHostParent(fiber) {
            return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
          }
          function getHostSibling(fiber) {
            var node = fiber;
            siblings: while (true) {
              while (node.sibling === null) {
                if (node.return === null || isHostParent(node.return)) {
                  return null;
                }
                node = node.return;
              }
              node.sibling.return = node.return;
              node = node.sibling;
              while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {
                if (node.flags & Placement) {
                  continue siblings;
                }
                if (node.child === null || node.tag === HostPortal) {
                  continue siblings;
                } else {
                  node.child.return = node;
                  node = node.child;
                }
              }
              if (!(node.flags & Placement)) {
                return node.stateNode;
              }
            }
          }
          function commitPlacement(finishedWork) {
            var parentFiber = getHostParentFiber(finishedWork);
            switch (parentFiber.tag) {
              case HostComponent: {
                var parent2 = parentFiber.stateNode;
                if (parentFiber.flags & ContentReset) {
                  resetTextContent(parent2);
                  parentFiber.flags &= ~ContentReset;
                }
                var before = getHostSibling(finishedWork);
                insertOrAppendPlacementNode(finishedWork, before, parent2);
                break;
              }
              case HostRoot:
              case HostPortal: {
                var _parent = parentFiber.stateNode.containerInfo;
                var _before = getHostSibling(finishedWork);
                insertOrAppendPlacementNodeIntoContainer(finishedWork, _before, _parent);
                break;
              }
              // eslint-disable-next-line-no-fallthrough
              default:
                throw new Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
            }
          }
          function insertOrAppendPlacementNodeIntoContainer(node, before, parent2) {
            var tag = node.tag;
            var isHost = tag === HostComponent || tag === HostText;
            if (isHost) {
              var stateNode = node.stateNode;
              if (before) {
                insertInContainerBefore(parent2, stateNode, before);
              } else {
                appendChildToContainer(parent2, stateNode);
              }
            } else if (tag === HostPortal) ;
            else {
              var child = node.child;
              if (child !== null) {
                insertOrAppendPlacementNodeIntoContainer(child, before, parent2);
                var sibling = child.sibling;
                while (sibling !== null) {
                  insertOrAppendPlacementNodeIntoContainer(sibling, before, parent2);
                  sibling = sibling.sibling;
                }
              }
            }
          }
          function insertOrAppendPlacementNode(node, before, parent2) {
            var tag = node.tag;
            var isHost = tag === HostComponent || tag === HostText;
            if (isHost) {
              var stateNode = node.stateNode;
              if (before) {
                insertBefore(parent2, stateNode, before);
              } else {
                appendChild(parent2, stateNode);
              }
            } else if (tag === HostPortal) ;
            else {
              var child = node.child;
              if (child !== null) {
                insertOrAppendPlacementNode(child, before, parent2);
                var sibling = child.sibling;
                while (sibling !== null) {
                  insertOrAppendPlacementNode(sibling, before, parent2);
                  sibling = sibling.sibling;
                }
              }
            }
          }
          var hostParent = null;
          var hostParentIsContainer = false;
          function commitDeletionEffects(root2, returnFiber, deletedFiber) {
            {
              var parent2 = returnFiber;
              findParent: while (parent2 !== null) {
                switch (parent2.tag) {
                  case HostComponent: {
                    hostParent = parent2.stateNode;
                    hostParentIsContainer = false;
                    break findParent;
                  }
                  case HostRoot: {
                    hostParent = parent2.stateNode.containerInfo;
                    hostParentIsContainer = true;
                    break findParent;
                  }
                  case HostPortal: {
                    hostParent = parent2.stateNode.containerInfo;
                    hostParentIsContainer = true;
                    break findParent;
                  }
                }
                parent2 = parent2.return;
              }
              if (hostParent === null) {
                throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
              }
              commitDeletionEffectsOnFiber(root2, returnFiber, deletedFiber);
              hostParent = null;
              hostParentIsContainer = false;
            }
            detachFiberMutation(deletedFiber);
          }
          function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent2) {
            var child = parent2.child;
            while (child !== null) {
              commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, child);
              child = child.sibling;
            }
          }
          function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) {
            onCommitUnmount(deletedFiber);
            switch (deletedFiber.tag) {
              case HostComponent: {
                if (!offscreenSubtreeWasHidden) {
                  safelyDetachRef(deletedFiber, nearestMountedAncestor);
                }
              }
              // eslint-disable-next-line-no-fallthrough
              case HostText: {
                {
                  var prevHostParent = hostParent;
                  var prevHostParentIsContainer = hostParentIsContainer;
                  hostParent = null;
                  recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                  hostParent = prevHostParent;
                  hostParentIsContainer = prevHostParentIsContainer;
                  if (hostParent !== null) {
                    if (hostParentIsContainer) {
                      removeChildFromContainer(hostParent, deletedFiber.stateNode);
                    } else {
                      removeChild(hostParent, deletedFiber.stateNode);
                    }
                  }
                }
                return;
              }
              case DehydratedFragment: {
                {
                  if (hostParent !== null) {
                    if (hostParentIsContainer) {
                      clearSuspenseBoundaryFromContainer(hostParent, deletedFiber.stateNode);
                    } else {
                      clearSuspenseBoundary(hostParent, deletedFiber.stateNode);
                    }
                  }
                }
                return;
              }
              case HostPortal: {
                {
                  var _prevHostParent = hostParent;
                  var _prevHostParentIsContainer = hostParentIsContainer;
                  hostParent = deletedFiber.stateNode.containerInfo;
                  hostParentIsContainer = true;
                  recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                  hostParent = _prevHostParent;
                  hostParentIsContainer = _prevHostParentIsContainer;
                }
                return;
              }
              case FunctionComponent2:
              case ForwardRef:
              case MemoComponent:
              case SimpleMemoComponent: {
                if (!offscreenSubtreeWasHidden) {
                  var updateQueue = deletedFiber.updateQueue;
                  if (updateQueue !== null) {
                    var lastEffect = updateQueue.lastEffect;
                    if (lastEffect !== null) {
                      var firstEffect = lastEffect.next;
                      var effect4 = firstEffect;
                      do {
                        var _effect = effect4, destroy = _effect.destroy, tag = _effect.tag;
                        if (destroy !== void 0) {
                          if ((tag & Insertion) !== NoFlags$1) {
                            safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
                          } else if ((tag & Layout) !== NoFlags$1) {
                            {
                              markComponentLayoutEffectUnmountStarted(deletedFiber);
                            }
                            if (deletedFiber.mode & ProfileMode) {
                              startLayoutEffectTimer();
                              safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
                              recordLayoutEffectDuration(deletedFiber);
                            } else {
                              safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
                            }
                            {
                              markComponentLayoutEffectUnmountStopped();
                            }
                          }
                        }
                        effect4 = effect4.next;
                      } while (effect4 !== firstEffect);
                    }
                  }
                }
                recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                return;
              }
              case ClassComponent: {
                if (!offscreenSubtreeWasHidden) {
                  safelyDetachRef(deletedFiber, nearestMountedAncestor);
                  var instance = deletedFiber.stateNode;
                  if (typeof instance.componentWillUnmount === "function") {
                    safelyCallComponentWillUnmount(deletedFiber, nearestMountedAncestor, instance);
                  }
                }
                recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                return;
              }
              case ScopeComponent: {
                recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                return;
              }
              case OffscreenComponent: {
                if (
                  // TODO: Remove this dead flag
                  deletedFiber.mode & ConcurrentMode
                ) {
                  var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
                  offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || deletedFiber.memoizedState !== null;
                  recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                  offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
                } else {
                  recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                }
                break;
              }
              default: {
                recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                return;
              }
            }
          }
          function commitSuspenseCallback(finishedWork) {
            var newState = finishedWork.memoizedState;
          }
          function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
            var newState = finishedWork.memoizedState;
            if (newState === null) {
              var current2 = finishedWork.alternate;
              if (current2 !== null) {
                var prevState = current2.memoizedState;
                if (prevState !== null) {
                  var suspenseInstance = prevState.dehydrated;
                  if (suspenseInstance !== null) {
                    commitHydratedSuspenseInstance(suspenseInstance);
                  }
                }
              }
            }
          }
          function attachSuspenseRetryListeners(finishedWork) {
            var wakeables = finishedWork.updateQueue;
            if (wakeables !== null) {
              finishedWork.updateQueue = null;
              var retryCache = finishedWork.stateNode;
              if (retryCache === null) {
                retryCache = finishedWork.stateNode = new PossiblyWeakSet();
              }
              wakeables.forEach(function(wakeable) {
                var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
                if (!retryCache.has(wakeable)) {
                  retryCache.add(wakeable);
                  {
                    if (isDevToolsPresent) {
                      if (inProgressLanes !== null && inProgressRoot !== null) {
                        restorePendingUpdaters(inProgressRoot, inProgressLanes);
                      } else {
                        throw Error("Expected finished root and lanes to be set. This is a bug in React.");
                      }
                    }
                  }
                  wakeable.then(retry, retry);
                }
              });
            }
          }
          function commitMutationEffects(root2, finishedWork, committedLanes) {
            inProgressLanes = committedLanes;
            inProgressRoot = root2;
            setCurrentFiber(finishedWork);
            commitMutationEffectsOnFiber(finishedWork, root2);
            setCurrentFiber(finishedWork);
            inProgressLanes = null;
            inProgressRoot = null;
          }
          function recursivelyTraverseMutationEffects(root2, parentFiber, lanes) {
            var deletions = parentFiber.deletions;
            if (deletions !== null) {
              for (var i = 0; i < deletions.length; i++) {
                var childToDelete = deletions[i];
                try {
                  commitDeletionEffects(root2, parentFiber, childToDelete);
                } catch (error2) {
                  captureCommitPhaseError(childToDelete, parentFiber, error2);
                }
              }
            }
            var prevDebugFiber = getCurrentFiber();
            if (parentFiber.subtreeFlags & MutationMask) {
              var child = parentFiber.child;
              while (child !== null) {
                setCurrentFiber(child);
                commitMutationEffectsOnFiber(child, root2);
                child = child.sibling;
              }
            }
            setCurrentFiber(prevDebugFiber);
          }
          function commitMutationEffectsOnFiber(finishedWork, root2, lanes) {
            var current2 = finishedWork.alternate;
            var flags = finishedWork.flags;
            switch (finishedWork.tag) {
              case FunctionComponent2:
              case ForwardRef:
              case MemoComponent:
              case SimpleMemoComponent: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                if (flags & Update) {
                  try {
                    commitHookEffectListUnmount(Insertion | HasEffect, finishedWork, finishedWork.return);
                    commitHookEffectListMount(Insertion | HasEffect, finishedWork);
                  } catch (error2) {
                    captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                  }
                  if (finishedWork.mode & ProfileMode) {
                    try {
                      startLayoutEffectTimer();
                      commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return);
                    } catch (error2) {
                      captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                    }
                    recordLayoutEffectDuration(finishedWork);
                  } else {
                    try {
                      commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return);
                    } catch (error2) {
                      captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                    }
                  }
                }
                return;
              }
              case ClassComponent: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                if (flags & Ref) {
                  if (current2 !== null) {
                    safelyDetachRef(current2, current2.return);
                  }
                }
                return;
              }
              case HostComponent: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                if (flags & Ref) {
                  if (current2 !== null) {
                    safelyDetachRef(current2, current2.return);
                  }
                }
                {
                  if (finishedWork.flags & ContentReset) {
                    var instance = finishedWork.stateNode;
                    try {
                      resetTextContent(instance);
                    } catch (error2) {
                      captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                    }
                  }
                  if (flags & Update) {
                    var _instance4 = finishedWork.stateNode;
                    if (_instance4 != null) {
                      var newProps = finishedWork.memoizedProps;
                      var oldProps = current2 !== null ? current2.memoizedProps : newProps;
                      var type = finishedWork.type;
                      var updatePayload = finishedWork.updateQueue;
                      finishedWork.updateQueue = null;
                      if (updatePayload !== null) {
                        try {
                          commitUpdate(_instance4, updatePayload, type, oldProps, newProps, finishedWork);
                        } catch (error2) {
                          captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                        }
                      }
                    }
                  }
                }
                return;
              }
              case HostText: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                if (flags & Update) {
                  {
                    if (finishedWork.stateNode === null) {
                      throw new Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");
                    }
                    var textInstance = finishedWork.stateNode;
                    var newText = finishedWork.memoizedProps;
                    var oldText = current2 !== null ? current2.memoizedProps : newText;
                    try {
                      commitTextUpdate(textInstance, oldText, newText);
                    } catch (error2) {
                      captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                    }
                  }
                }
                return;
              }
              case HostRoot: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                if (flags & Update) {
                  {
                    if (current2 !== null) {
                      var prevRootState = current2.memoizedState;
                      if (prevRootState.isDehydrated) {
                        try {
                          commitHydratedContainer(root2.containerInfo);
                        } catch (error2) {
                          captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                        }
                      }
                    }
                  }
                }
                return;
              }
              case HostPortal: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                return;
              }
              case SuspenseComponent: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                var offscreenFiber = finishedWork.child;
                if (offscreenFiber.flags & Visibility2) {
                  var offscreenInstance = offscreenFiber.stateNode;
                  var newState = offscreenFiber.memoizedState;
                  var isHidden3 = newState !== null;
                  offscreenInstance.isHidden = isHidden3;
                  if (isHidden3) {
                    var wasHidden = offscreenFiber.alternate !== null && offscreenFiber.alternate.memoizedState !== null;
                    if (!wasHidden) {
                      markCommitTimeOfFallback();
                    }
                  }
                }
                if (flags & Update) {
                  try {
                    commitSuspenseCallback(finishedWork);
                  } catch (error2) {
                    captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                  }
                  attachSuspenseRetryListeners(finishedWork);
                }
                return;
              }
              case OffscreenComponent: {
                var _wasHidden = current2 !== null && current2.memoizedState !== null;
                if (
                  // TODO: Remove this dead flag
                  finishedWork.mode & ConcurrentMode
                ) {
                  var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
                  offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || _wasHidden;
                  recursivelyTraverseMutationEffects(root2, finishedWork);
                  offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
                } else {
                  recursivelyTraverseMutationEffects(root2, finishedWork);
                }
                commitReconciliationEffects(finishedWork);
                if (flags & Visibility2) {
                  var _offscreenInstance = finishedWork.stateNode;
                  var _newState = finishedWork.memoizedState;
                  var _isHidden = _newState !== null;
                  var offscreenBoundary = finishedWork;
                  _offscreenInstance.isHidden = _isHidden;
                  {
                    if (_isHidden) {
                      if (!_wasHidden) {
                        if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
                          nextEffect = offscreenBoundary;
                          var offscreenChild = offscreenBoundary.child;
                          while (offscreenChild !== null) {
                            nextEffect = offscreenChild;
                            disappearLayoutEffects_begin(offscreenChild);
                            offscreenChild = offscreenChild.sibling;
                          }
                        }
                      }
                    }
                  }
                  {
                    hideOrUnhideAllChildren(offscreenBoundary, _isHidden);
                  }
                }
                return;
              }
              case SuspenseListComponent: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                if (flags & Update) {
                  attachSuspenseRetryListeners(finishedWork);
                }
                return;
              }
              case ScopeComponent: {
                return;
              }
              default: {
                recursivelyTraverseMutationEffects(root2, finishedWork);
                commitReconciliationEffects(finishedWork);
                return;
              }
            }
          }
          function commitReconciliationEffects(finishedWork) {
            var flags = finishedWork.flags;
            if (flags & Placement) {
              try {
                commitPlacement(finishedWork);
              } catch (error2) {
                captureCommitPhaseError(finishedWork, finishedWork.return, error2);
              }
              finishedWork.flags &= ~Placement;
            }
            if (flags & Hydrating) {
              finishedWork.flags &= ~Hydrating;
            }
          }
          function commitLayoutEffects(finishedWork, root2, committedLanes) {
            inProgressLanes = committedLanes;
            inProgressRoot = root2;
            nextEffect = finishedWork;
            commitLayoutEffects_begin(finishedWork, root2, committedLanes);
            inProgressLanes = null;
            inProgressRoot = null;
          }
          function commitLayoutEffects_begin(subtreeRoot, root2, committedLanes) {
            var isModernRoot = (subtreeRoot.mode & ConcurrentMode) !== NoMode;
            while (nextEffect !== null) {
              var fiber = nextEffect;
              var firstChild = fiber.child;
              if (fiber.tag === OffscreenComponent && isModernRoot) {
                var isHidden3 = fiber.memoizedState !== null;
                var newOffscreenSubtreeIsHidden = isHidden3 || offscreenSubtreeIsHidden;
                if (newOffscreenSubtreeIsHidden) {
                  commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
                  continue;
                } else {
                  var current2 = fiber.alternate;
                  var wasHidden = current2 !== null && current2.memoizedState !== null;
                  var newOffscreenSubtreeWasHidden = wasHidden || offscreenSubtreeWasHidden;
                  var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden;
                  var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
                  offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden;
                  offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden;
                  if (offscreenSubtreeWasHidden && !prevOffscreenSubtreeWasHidden) {
                    nextEffect = fiber;
                    reappearLayoutEffects_begin(fiber);
                  }
                  var child = firstChild;
                  while (child !== null) {
                    nextEffect = child;
                    commitLayoutEffects_begin(
                      child,
                      // New root; bubble back up to here and stop.
                      root2,
                      committedLanes
                    );
                    child = child.sibling;
                  }
                  nextEffect = fiber;
                  offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
                  offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
                  commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
                  continue;
                }
              }
              if ((fiber.subtreeFlags & LayoutMask) !== NoFlags && firstChild !== null) {
                firstChild.return = fiber;
                nextEffect = firstChild;
              } else {
                commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
              }
            }
          }
          function commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              if ((fiber.flags & LayoutMask) !== NoFlags) {
                var current2 = fiber.alternate;
                setCurrentFiber(fiber);
                try {
                  commitLayoutEffectOnFiber(root2, current2, fiber, committedLanes);
                } catch (error2) {
                  captureCommitPhaseError(fiber, fiber.return, error2);
                }
                resetCurrentFiber();
              }
              if (fiber === subtreeRoot) {
                nextEffect = null;
                return;
              }
              var sibling = fiber.sibling;
              if (sibling !== null) {
                sibling.return = fiber.return;
                nextEffect = sibling;
                return;
              }
              nextEffect = fiber.return;
            }
          }
          function disappearLayoutEffects_begin(subtreeRoot) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              var firstChild = fiber.child;
              switch (fiber.tag) {
                case FunctionComponent2:
                case ForwardRef:
                case MemoComponent:
                case SimpleMemoComponent: {
                  if (fiber.mode & ProfileMode) {
                    try {
                      startLayoutEffectTimer();
                      commitHookEffectListUnmount(Layout, fiber, fiber.return);
                    } finally {
                      recordLayoutEffectDuration(fiber);
                    }
                  } else {
                    commitHookEffectListUnmount(Layout, fiber, fiber.return);
                  }
                  break;
                }
                case ClassComponent: {
                  safelyDetachRef(fiber, fiber.return);
                  var instance = fiber.stateNode;
                  if (typeof instance.componentWillUnmount === "function") {
                    safelyCallComponentWillUnmount(fiber, fiber.return, instance);
                  }
                  break;
                }
                case HostComponent: {
                  safelyDetachRef(fiber, fiber.return);
                  break;
                }
                case OffscreenComponent: {
                  var isHidden3 = fiber.memoizedState !== null;
                  if (isHidden3) {
                    disappearLayoutEffects_complete(subtreeRoot);
                    continue;
                  }
                  break;
                }
              }
              if (firstChild !== null) {
                firstChild.return = fiber;
                nextEffect = firstChild;
              } else {
                disappearLayoutEffects_complete(subtreeRoot);
              }
            }
          }
          function disappearLayoutEffects_complete(subtreeRoot) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              if (fiber === subtreeRoot) {
                nextEffect = null;
                return;
              }
              var sibling = fiber.sibling;
              if (sibling !== null) {
                sibling.return = fiber.return;
                nextEffect = sibling;
                return;
              }
              nextEffect = fiber.return;
            }
          }
          function reappearLayoutEffects_begin(subtreeRoot) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              var firstChild = fiber.child;
              if (fiber.tag === OffscreenComponent) {
                var isHidden3 = fiber.memoizedState !== null;
                if (isHidden3) {
                  reappearLayoutEffects_complete(subtreeRoot);
                  continue;
                }
              }
              if (firstChild !== null) {
                firstChild.return = fiber;
                nextEffect = firstChild;
              } else {
                reappearLayoutEffects_complete(subtreeRoot);
              }
            }
          }
          function reappearLayoutEffects_complete(subtreeRoot) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              setCurrentFiber(fiber);
              try {
                reappearLayoutEffectsOnFiber(fiber);
              } catch (error2) {
                captureCommitPhaseError(fiber, fiber.return, error2);
              }
              resetCurrentFiber();
              if (fiber === subtreeRoot) {
                nextEffect = null;
                return;
              }
              var sibling = fiber.sibling;
              if (sibling !== null) {
                sibling.return = fiber.return;
                nextEffect = sibling;
                return;
              }
              nextEffect = fiber.return;
            }
          }
          function commitPassiveMountEffects(root2, finishedWork, committedLanes, committedTransitions) {
            nextEffect = finishedWork;
            commitPassiveMountEffects_begin(finishedWork, root2, committedLanes, committedTransitions);
          }
          function commitPassiveMountEffects_begin(subtreeRoot, root2, committedLanes, committedTransitions) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              var firstChild = fiber.child;
              if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && firstChild !== null) {
                firstChild.return = fiber;
                nextEffect = firstChild;
              } else {
                commitPassiveMountEffects_complete(subtreeRoot, root2, committedLanes, committedTransitions);
              }
            }
          }
          function commitPassiveMountEffects_complete(subtreeRoot, root2, committedLanes, committedTransitions) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              if ((fiber.flags & Passive) !== NoFlags) {
                setCurrentFiber(fiber);
                try {
                  commitPassiveMountOnFiber(root2, fiber, committedLanes, committedTransitions);
                } catch (error2) {
                  captureCommitPhaseError(fiber, fiber.return, error2);
                }
                resetCurrentFiber();
              }
              if (fiber === subtreeRoot) {
                nextEffect = null;
                return;
              }
              var sibling = fiber.sibling;
              if (sibling !== null) {
                sibling.return = fiber.return;
                nextEffect = sibling;
                return;
              }
              nextEffect = fiber.return;
            }
          }
          function commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions) {
            switch (finishedWork.tag) {
              case FunctionComponent2:
              case ForwardRef:
              case SimpleMemoComponent: {
                if (finishedWork.mode & ProfileMode) {
                  startPassiveEffectTimer();
                  try {
                    commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);
                  } finally {
                    recordPassiveEffectDuration(finishedWork);
                  }
                } else {
                  commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);
                }
                break;
              }
            }
          }
          function commitPassiveUnmountEffects(firstChild) {
            nextEffect = firstChild;
            commitPassiveUnmountEffects_begin();
          }
          function commitPassiveUnmountEffects_begin() {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              var child = fiber.child;
              if ((nextEffect.flags & ChildDeletion) !== NoFlags) {
                var deletions = fiber.deletions;
                if (deletions !== null) {
                  for (var i = 0; i < deletions.length; i++) {
                    var fiberToDelete = deletions[i];
                    nextEffect = fiberToDelete;
                    commitPassiveUnmountEffectsInsideOfDeletedTree_begin(fiberToDelete, fiber);
                  }
                  {
                    var previousFiber = fiber.alternate;
                    if (previousFiber !== null) {
                      var detachedChild = previousFiber.child;
                      if (detachedChild !== null) {
                        previousFiber.child = null;
                        do {
                          var detachedSibling = detachedChild.sibling;
                          detachedChild.sibling = null;
                          detachedChild = detachedSibling;
                        } while (detachedChild !== null);
                      }
                    }
                  }
                  nextEffect = fiber;
                }
              }
              if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && child !== null) {
                child.return = fiber;
                nextEffect = child;
              } else {
                commitPassiveUnmountEffects_complete();
              }
            }
          }
          function commitPassiveUnmountEffects_complete() {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              if ((fiber.flags & Passive) !== NoFlags) {
                setCurrentFiber(fiber);
                commitPassiveUnmountOnFiber(fiber);
                resetCurrentFiber();
              }
              var sibling = fiber.sibling;
              if (sibling !== null) {
                sibling.return = fiber.return;
                nextEffect = sibling;
                return;
              }
              nextEffect = fiber.return;
            }
          }
          function commitPassiveUnmountOnFiber(finishedWork) {
            switch (finishedWork.tag) {
              case FunctionComponent2:
              case ForwardRef:
              case SimpleMemoComponent: {
                if (finishedWork.mode & ProfileMode) {
                  startPassiveEffectTimer();
                  commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return);
                  recordPassiveEffectDuration(finishedWork);
                } else {
                  commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return);
                }
                break;
              }
            }
          }
          function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              setCurrentFiber(fiber);
              commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);
              resetCurrentFiber();
              var child = fiber.child;
              if (child !== null) {
                child.return = fiber;
                nextEffect = child;
              } else {
                commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot);
              }
            }
          }
          function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot) {
            while (nextEffect !== null) {
              var fiber = nextEffect;
              var sibling = fiber.sibling;
              var returnFiber = fiber.return;
              {
                detachFiberAfterEffects(fiber);
                if (fiber === deletedSubtreeRoot) {
                  nextEffect = null;
                  return;
                }
              }
              if (sibling !== null) {
                sibling.return = returnFiber;
                nextEffect = sibling;
                return;
              }
              nextEffect = returnFiber;
            }
          }
          function commitPassiveUnmountInsideDeletedTreeOnFiber(current2, nearestMountedAncestor) {
            switch (current2.tag) {
              case FunctionComponent2:
              case ForwardRef:
              case SimpleMemoComponent: {
                if (current2.mode & ProfileMode) {
                  startPassiveEffectTimer();
                  commitHookEffectListUnmount(Passive$1, current2, nearestMountedAncestor);
                  recordPassiveEffectDuration(current2);
                } else {
                  commitHookEffectListUnmount(Passive$1, current2, nearestMountedAncestor);
                }
                break;
              }
            }
          }
          function invokeLayoutEffectMountInDEV(fiber) {
            {
              switch (fiber.tag) {
                case FunctionComponent2:
                case ForwardRef:
                case SimpleMemoComponent: {
                  try {
                    commitHookEffectListMount(Layout | HasEffect, fiber);
                  } catch (error2) {
                    captureCommitPhaseError(fiber, fiber.return, error2);
                  }
                  break;
                }
                case ClassComponent: {
                  var instance = fiber.stateNode;
                  try {
                    instance.componentDidMount();
                  } catch (error2) {
                    captureCommitPhaseError(fiber, fiber.return, error2);
                  }
                  break;
                }
              }
            }
          }
          function invokePassiveEffectMountInDEV(fiber) {
            {
              switch (fiber.tag) {
                case FunctionComponent2:
                case ForwardRef:
                case SimpleMemoComponent: {
                  try {
                    commitHookEffectListMount(Passive$1 | HasEffect, fiber);
                  } catch (error2) {
                    captureCommitPhaseError(fiber, fiber.return, error2);
                  }
                  break;
                }
              }
            }
          }
          function invokeLayoutEffectUnmountInDEV(fiber) {
            {
              switch (fiber.tag) {
                case FunctionComponent2:
                case ForwardRef:
                case SimpleMemoComponent: {
                  try {
                    commitHookEffectListUnmount(Layout | HasEffect, fiber, fiber.return);
                  } catch (error2) {
                    captureCommitPhaseError(fiber, fiber.return, error2);
                  }
                  break;
                }
                case ClassComponent: {
                  var instance = fiber.stateNode;
                  if (typeof instance.componentWillUnmount === "function") {
                    safelyCallComponentWillUnmount(fiber, fiber.return, instance);
                  }
                  break;
                }
              }
            }
          }
          function invokePassiveEffectUnmountInDEV(fiber) {
            {
              switch (fiber.tag) {
                case FunctionComponent2:
                case ForwardRef:
                case SimpleMemoComponent: {
                  try {
                    commitHookEffectListUnmount(Passive$1 | HasEffect, fiber, fiber.return);
                  } catch (error2) {
                    captureCommitPhaseError(fiber, fiber.return, error2);
                  }
                }
              }
            }
          }
          var COMPONENT_TYPE = 0;
          var HAS_PSEUDO_CLASS_TYPE = 1;
          var ROLE_TYPE = 2;
          var TEST_NAME_TYPE = 3;
          var TEXT_TYPE = 4;
          if (typeof Symbol === "function" && Symbol.for) {
            var symbolFor = Symbol.for;
            COMPONENT_TYPE = symbolFor("selector.component");
            HAS_PSEUDO_CLASS_TYPE = symbolFor("selector.has_pseudo_class");
            ROLE_TYPE = symbolFor("selector.role");
            TEST_NAME_TYPE = symbolFor("selector.test_id");
            TEXT_TYPE = symbolFor("selector.text");
          }
          var commitHooks = [];
          function onCommitRoot$1() {
            {
              commitHooks.forEach(function(commitHook) {
                return commitHook();
              });
            }
          }
          var ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue;
          function isLegacyActEnvironment(fiber) {
            {
              var isReactActEnvironmentGlobal = (
                // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
                typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : void 0
              );
              var jestIsDefined = typeof jest !== "undefined";
              return jestIsDefined && isReactActEnvironmentGlobal !== false;
            }
          }
          function isConcurrentActEnvironment() {
            {
              var isReactActEnvironmentGlobal = (
                // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
                typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : void 0
              );
              if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) {
                error("The current testing environment is not configured to support act(...)");
              }
              return isReactActEnvironmentGlobal;
            }
          }
          var ceil = Math.ceil;
          var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, ReactCurrentBatchConfig$3 = ReactSharedInternals.ReactCurrentBatchConfig, ReactCurrentActQueue$1 = ReactSharedInternals.ReactCurrentActQueue;
          var NoContext = (
            /*             */
            0
          );
          var BatchedContext = (
            /*               */
            1
          );
          var RenderContext = (
            /*                */
            2
          );
          var CommitContext = (
            /*                */
            4
          );
          var RootInProgress = 0;
          var RootFatalErrored = 1;
          var RootErrored = 2;
          var RootSuspended = 3;
          var RootSuspendedWithDelay = 4;
          var RootCompleted = 5;
          var RootDidNotComplete = 6;
          var executionContext = NoContext;
          var workInProgressRoot = null;
          var workInProgress = null;
          var workInProgressRootRenderLanes = NoLanes;
          var subtreeRenderLanes = NoLanes;
          var subtreeRenderLanesCursor = createCursor(NoLanes);
          var workInProgressRootExitStatus = RootInProgress;
          var workInProgressRootFatalError = null;
          var workInProgressRootIncludedLanes = NoLanes;
          var workInProgressRootSkippedLanes = NoLanes;
          var workInProgressRootInterleavedUpdatedLanes = NoLanes;
          var workInProgressRootPingedLanes = NoLanes;
          var workInProgressRootConcurrentErrors = null;
          var workInProgressRootRecoverableErrors = null;
          var globalMostRecentFallbackTime = 0;
          var FALLBACK_THROTTLE_MS = 500;
          var workInProgressRootRenderTargetTime = Infinity;
          var RENDER_TIMEOUT_MS = 500;
          var workInProgressTransitions = null;
          function resetRenderTimer() {
            workInProgressRootRenderTargetTime = now3() + RENDER_TIMEOUT_MS;
          }
          function getRenderTargetTime() {
            return workInProgressRootRenderTargetTime;
          }
          var hasUncaughtError = false;
          var firstUncaughtError = null;
          var legacyErrorBoundariesThatAlreadyFailed = null;
          var rootDoesHavePassiveEffects = false;
          var rootWithPendingPassiveEffects = null;
          var pendingPassiveEffectsLanes = NoLanes;
          var pendingPassiveProfilerEffects = [];
          var pendingPassiveTransitions = null;
          var NESTED_UPDATE_LIMIT = 50;
          var nestedUpdateCount = 0;
          var rootWithNestedUpdates = null;
          var isFlushingPassiveEffects = false;
          var didScheduleUpdateDuringPassiveEffects = false;
          var NESTED_PASSIVE_UPDATE_LIMIT = 50;
          var nestedPassiveUpdateCount = 0;
          var rootWithPassiveNestedUpdates = null;
          var currentEventTime = NoTimestamp;
          var currentEventTransitionLane = NoLanes;
          var isRunningInsertionEffect = false;
          function getWorkInProgressRoot() {
            return workInProgressRoot;
          }
          function requestEventTime() {
            if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
              return now3();
            }
            if (currentEventTime !== NoTimestamp) {
              return currentEventTime;
            }
            currentEventTime = now3();
            return currentEventTime;
          }
          function requestUpdateLane(fiber) {
            var mode = fiber.mode;
            if ((mode & ConcurrentMode) === NoMode) {
              return SyncLane;
            } else if ((executionContext & RenderContext) !== NoContext && workInProgressRootRenderLanes !== NoLanes) {
              return pickArbitraryLane(workInProgressRootRenderLanes);
            }
            var isTransition = requestCurrentTransition() !== NoTransition;
            if (isTransition) {
              if (ReactCurrentBatchConfig$3.transition !== null) {
                var transition = ReactCurrentBatchConfig$3.transition;
                if (!transition._updatedFibers) {
                  transition._updatedFibers = /* @__PURE__ */ new Set();
                }
                transition._updatedFibers.add(fiber);
              }
              if (currentEventTransitionLane === NoLane) {
                currentEventTransitionLane = claimNextTransitionLane();
              }
              return currentEventTransitionLane;
            }
            var updateLane = getCurrentUpdatePriority();
            if (updateLane !== NoLane) {
              return updateLane;
            }
            var eventLane = getCurrentEventPriority();
            return eventLane;
          }
          function requestRetryLane(fiber) {
            var mode = fiber.mode;
            if ((mode & ConcurrentMode) === NoMode) {
              return SyncLane;
            }
            return claimNextRetryLane();
          }
          function scheduleUpdateOnFiber(root2, fiber, lane, eventTime) {
            checkForNestedUpdates();
            {
              if (isRunningInsertionEffect) {
                error("useInsertionEffect must not schedule updates.");
              }
            }
            {
              if (isFlushingPassiveEffects) {
                didScheduleUpdateDuringPassiveEffects = true;
              }
            }
            markRootUpdated(root2, lane, eventTime);
            if ((executionContext & RenderContext) !== NoLanes && root2 === workInProgressRoot) {
              warnAboutRenderPhaseUpdatesInDEV(fiber);
            } else {
              {
                if (isDevToolsPresent) {
                  addFiberToLanesMap(root2, fiber, lane);
                }
              }
              warnIfUpdatesNotWrappedWithActDEV(fiber);
              if (root2 === workInProgressRoot) {
                if ((executionContext & RenderContext) === NoContext) {
                  workInProgressRootInterleavedUpdatedLanes = mergeLanes(workInProgressRootInterleavedUpdatedLanes, lane);
                }
                if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
                  markRootSuspended$1(root2, workInProgressRootRenderLanes);
                }
              }
              ensureRootIsScheduled(root2, eventTime);
              if (lane === SyncLane && executionContext === NoContext && (fiber.mode & ConcurrentMode) === NoMode && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
              !ReactCurrentActQueue$1.isBatchingLegacy) {
                resetRenderTimer();
                flushSyncCallbacksOnlyInLegacyMode();
              }
            }
          }
          function scheduleInitialHydrationOnRoot(root2, lane, eventTime) {
            var current2 = root2.current;
            current2.lanes = lane;
            markRootUpdated(root2, lane, eventTime);
            ensureRootIsScheduled(root2, eventTime);
          }
          function isUnsafeClassRenderPhaseUpdate(fiber) {
            return (
              // TODO: Remove outdated deferRenderPhaseUpdateToNextBatch experiment. We
              // decided not to enable it.
              (executionContext & RenderContext) !== NoContext
            );
          }
          function ensureRootIsScheduled(root2, currentTime) {
            var existingCallbackNode = root2.callbackNode;
            markStarvedLanesAsExpired(root2, currentTime);
            var nextLanes = getNextLanes(root2, root2 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
            if (nextLanes === NoLanes) {
              if (existingCallbackNode !== null) {
                cancelCallback$1(existingCallbackNode);
              }
              root2.callbackNode = null;
              root2.callbackPriority = NoLane;
              return;
            }
            var newCallbackPriority = getHighestPriorityLane(nextLanes);
            var existingCallbackPriority = root2.callbackPriority;
            if (existingCallbackPriority === newCallbackPriority && // Special case related to `act`. If the currently scheduled task is a
            // Scheduler task, rather than an `act` task, cancel it and re-scheduled
            // on the `act` queue.
            !(ReactCurrentActQueue$1.current !== null && existingCallbackNode !== fakeActCallbackNode)) {
              {
                if (existingCallbackNode == null && existingCallbackPriority !== SyncLane) {
                  error("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.");
                }
              }
              return;
            }
            if (existingCallbackNode != null) {
              cancelCallback$1(existingCallbackNode);
            }
            var newCallbackNode;
            if (newCallbackPriority === SyncLane) {
              if (root2.tag === LegacyRoot) {
                if (ReactCurrentActQueue$1.isBatchingLegacy !== null) {
                  ReactCurrentActQueue$1.didScheduleLegacyUpdate = true;
                }
                scheduleLegacySyncCallback(performSyncWorkOnRoot.bind(null, root2));
              } else {
                scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root2));
              }
              {
                if (ReactCurrentActQueue$1.current !== null) {
                  ReactCurrentActQueue$1.current.push(flushSyncCallbacks);
                } else {
                  scheduleMicrotask(function() {
                    if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
                      flushSyncCallbacks();
                    }
                  });
                }
              }
              newCallbackNode = null;
            } else {
              var schedulerPriorityLevel;
              switch (lanesToEventPriority(nextLanes)) {
                case DiscreteEventPriority:
                  schedulerPriorityLevel = ImmediatePriority;
                  break;
                case ContinuousEventPriority:
                  schedulerPriorityLevel = UserBlockingPriority;
                  break;
                case DefaultEventPriority:
                  schedulerPriorityLevel = NormalPriority;
                  break;
                case IdleEventPriority:
                  schedulerPriorityLevel = IdlePriority;
                  break;
                default:
                  schedulerPriorityLevel = NormalPriority;
                  break;
              }
              newCallbackNode = scheduleCallback$1(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root2));
            }
            root2.callbackPriority = newCallbackPriority;
            root2.callbackNode = newCallbackNode;
          }
          function performConcurrentWorkOnRoot(root2, didTimeout) {
            {
              resetNestedUpdateFlag();
            }
            currentEventTime = NoTimestamp;
            currentEventTransitionLane = NoLanes;
            if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
              throw new Error("Should not already be working.");
            }
            var originalCallbackNode = root2.callbackNode;
            var didFlushPassiveEffects = flushPassiveEffects();
            if (didFlushPassiveEffects) {
              if (root2.callbackNode !== originalCallbackNode) {
                return null;
              }
            }
            var lanes = getNextLanes(root2, root2 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
            if (lanes === NoLanes) {
              return null;
            }
            var shouldTimeSlice = !includesBlockingLane(root2, lanes) && !includesExpiredLane(root2, lanes) && !didTimeout;
            var exitStatus = shouldTimeSlice ? renderRootConcurrent(root2, lanes) : renderRootSync(root2, lanes);
            if (exitStatus !== RootInProgress) {
              if (exitStatus === RootErrored) {
                var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
                if (errorRetryLanes !== NoLanes) {
                  lanes = errorRetryLanes;
                  exitStatus = recoverFromConcurrentError(root2, errorRetryLanes);
                }
              }
              if (exitStatus === RootFatalErrored) {
                var fatalError = workInProgressRootFatalError;
                prepareFreshStack(root2, NoLanes);
                markRootSuspended$1(root2, lanes);
                ensureRootIsScheduled(root2, now3());
                throw fatalError;
              }
              if (exitStatus === RootDidNotComplete) {
                markRootSuspended$1(root2, lanes);
              } else {
                var renderWasConcurrent = !includesBlockingLane(root2, lanes);
                var finishedWork = root2.current.alternate;
                if (renderWasConcurrent && !isRenderConsistentWithExternalStores(finishedWork)) {
                  exitStatus = renderRootSync(root2, lanes);
                  if (exitStatus === RootErrored) {
                    var _errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
                    if (_errorRetryLanes !== NoLanes) {
                      lanes = _errorRetryLanes;
                      exitStatus = recoverFromConcurrentError(root2, _errorRetryLanes);
                    }
                  }
                  if (exitStatus === RootFatalErrored) {
                    var _fatalError = workInProgressRootFatalError;
                    prepareFreshStack(root2, NoLanes);
                    markRootSuspended$1(root2, lanes);
                    ensureRootIsScheduled(root2, now3());
                    throw _fatalError;
                  }
                }
                root2.finishedWork = finishedWork;
                root2.finishedLanes = lanes;
                finishConcurrentRender(root2, exitStatus, lanes);
              }
            }
            ensureRootIsScheduled(root2, now3());
            if (root2.callbackNode === originalCallbackNode) {
              return performConcurrentWorkOnRoot.bind(null, root2);
            }
            return null;
          }
          function recoverFromConcurrentError(root2, errorRetryLanes) {
            var errorsFromFirstAttempt = workInProgressRootConcurrentErrors;
            if (isRootDehydrated(root2)) {
              var rootWorkInProgress = prepareFreshStack(root2, errorRetryLanes);
              rootWorkInProgress.flags |= ForceClientRender;
              {
                errorHydratingContainer(root2.containerInfo);
              }
            }
            var exitStatus = renderRootSync(root2, errorRetryLanes);
            if (exitStatus !== RootErrored) {
              var errorsFromSecondAttempt = workInProgressRootRecoverableErrors;
              workInProgressRootRecoverableErrors = errorsFromFirstAttempt;
              if (errorsFromSecondAttempt !== null) {
                queueRecoverableErrors(errorsFromSecondAttempt);
              }
            }
            return exitStatus;
          }
          function queueRecoverableErrors(errors) {
            if (workInProgressRootRecoverableErrors === null) {
              workInProgressRootRecoverableErrors = errors;
            } else {
              workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors, errors);
            }
          }
          function finishConcurrentRender(root2, exitStatus, lanes) {
            switch (exitStatus) {
              case RootInProgress:
              case RootFatalErrored: {
                throw new Error("Root did not complete. This is a bug in React.");
              }
              // Flow knows about invariant, so it complains if I add a break
              // statement, but eslint doesn't know about invariant, so it complains
              // if I do. eslint-disable-next-line no-fallthrough
              case RootErrored: {
                commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
                break;
              }
              case RootSuspended: {
                markRootSuspended$1(root2, lanes);
                if (includesOnlyRetries(lanes) && // do not delay if we're inside an act() scope
                !shouldForceFlushFallbacksInDEV()) {
                  var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now3();
                  if (msUntilTimeout > 10) {
                    var nextLanes = getNextLanes(root2, NoLanes);
                    if (nextLanes !== NoLanes) {
                      break;
                    }
                    var suspendedLanes = root2.suspendedLanes;
                    if (!isSubsetOfLanes(suspendedLanes, lanes)) {
                      var eventTime = requestEventTime();
                      markRootPinged(root2, suspendedLanes);
                      break;
                    }
                    root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2, workInProgressRootRecoverableErrors, workInProgressTransitions), msUntilTimeout);
                    break;
                  }
                }
                commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
                break;
              }
              case RootSuspendedWithDelay: {
                markRootSuspended$1(root2, lanes);
                if (includesOnlyTransitions(lanes)) {
                  break;
                }
                if (!shouldForceFlushFallbacksInDEV()) {
                  var mostRecentEventTime = getMostRecentEventTime(root2, lanes);
                  var eventTimeMs = mostRecentEventTime;
                  var timeElapsedMs = now3() - eventTimeMs;
                  var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs;
                  if (_msUntilTimeout > 10) {
                    root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2, workInProgressRootRecoverableErrors, workInProgressTransitions), _msUntilTimeout);
                    break;
                  }
                }
                commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
                break;
              }
              case RootCompleted: {
                commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
                break;
              }
              default: {
                throw new Error("Unknown root exit status.");
              }
            }
          }
          function isRenderConsistentWithExternalStores(finishedWork) {
            var node = finishedWork;
            while (true) {
              if (node.flags & StoreConsistency) {
                var updateQueue = node.updateQueue;
                if (updateQueue !== null) {
                  var checks = updateQueue.stores;
                  if (checks !== null) {
                    for (var i = 0; i < checks.length; i++) {
                      var check = checks[i];
                      var getSnapshot = check.getSnapshot;
                      var renderedValue = check.value;
                      try {
                        if (!objectIs(getSnapshot(), renderedValue)) {
                          return false;
                        }
                      } catch (error2) {
                        return false;
                      }
                    }
                  }
                }
              }
              var child = node.child;
              if (node.subtreeFlags & StoreConsistency && child !== null) {
                child.return = node;
                node = child;
                continue;
              }
              if (node === finishedWork) {
                return true;
              }
              while (node.sibling === null) {
                if (node.return === null || node.return === finishedWork) {
                  return true;
                }
                node = node.return;
              }
              node.sibling.return = node.return;
              node = node.sibling;
            }
            return true;
          }
          function markRootSuspended$1(root2, suspendedLanes) {
            suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes);
            suspendedLanes = removeLanes(suspendedLanes, workInProgressRootInterleavedUpdatedLanes);
            markRootSuspended(root2, suspendedLanes);
          }
          function performSyncWorkOnRoot(root2) {
            {
              syncNestedUpdateFlag();
            }
            if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
              throw new Error("Should not already be working.");
            }
            flushPassiveEffects();
            var lanes = getNextLanes(root2, NoLanes);
            if (!includesSomeLane(lanes, SyncLane)) {
              ensureRootIsScheduled(root2, now3());
              return null;
            }
            var exitStatus = renderRootSync(root2, lanes);
            if (root2.tag !== LegacyRoot && exitStatus === RootErrored) {
              var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
              if (errorRetryLanes !== NoLanes) {
                lanes = errorRetryLanes;
                exitStatus = recoverFromConcurrentError(root2, errorRetryLanes);
              }
            }
            if (exitStatus === RootFatalErrored) {
              var fatalError = workInProgressRootFatalError;
              prepareFreshStack(root2, NoLanes);
              markRootSuspended$1(root2, lanes);
              ensureRootIsScheduled(root2, now3());
              throw fatalError;
            }
            if (exitStatus === RootDidNotComplete) {
              throw new Error("Root did not complete. This is a bug in React.");
            }
            var finishedWork = root2.current.alternate;
            root2.finishedWork = finishedWork;
            root2.finishedLanes = lanes;
            commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
            ensureRootIsScheduled(root2, now3());
            return null;
          }
          function flushRoot(root2, lanes) {
            if (lanes !== NoLanes) {
              markRootEntangled(root2, mergeLanes(lanes, SyncLane));
              ensureRootIsScheduled(root2, now3());
              if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
                resetRenderTimer();
                flushSyncCallbacks();
              }
            }
          }
          function batchedUpdates$1(fn, a2) {
            var prevExecutionContext = executionContext;
            executionContext |= BatchedContext;
            try {
              return fn(a2);
            } finally {
              executionContext = prevExecutionContext;
              if (executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
              !ReactCurrentActQueue$1.isBatchingLegacy) {
                resetRenderTimer();
                flushSyncCallbacksOnlyInLegacyMode();
              }
            }
          }
          function discreteUpdates(fn, a2, b, c2, d) {
            var previousPriority = getCurrentUpdatePriority();
            var prevTransition = ReactCurrentBatchConfig$3.transition;
            try {
              ReactCurrentBatchConfig$3.transition = null;
              setCurrentUpdatePriority(DiscreteEventPriority);
              return fn(a2, b, c2, d);
            } finally {
              setCurrentUpdatePriority(previousPriority);
              ReactCurrentBatchConfig$3.transition = prevTransition;
              if (executionContext === NoContext) {
                resetRenderTimer();
              }
            }
          }
          function flushSync(fn) {
            if (rootWithPendingPassiveEffects !== null && rootWithPendingPassiveEffects.tag === LegacyRoot && (executionContext & (RenderContext | CommitContext)) === NoContext) {
              flushPassiveEffects();
            }
            var prevExecutionContext = executionContext;
            executionContext |= BatchedContext;
            var prevTransition = ReactCurrentBatchConfig$3.transition;
            var previousPriority = getCurrentUpdatePriority();
            try {
              ReactCurrentBatchConfig$3.transition = null;
              setCurrentUpdatePriority(DiscreteEventPriority);
              if (fn) {
                return fn();
              } else {
                return void 0;
              }
            } finally {
              setCurrentUpdatePriority(previousPriority);
              ReactCurrentBatchConfig$3.transition = prevTransition;
              executionContext = prevExecutionContext;
              if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
                flushSyncCallbacks();
              }
            }
          }
          function isAlreadyRendering() {
            return (executionContext & (RenderContext | CommitContext)) !== NoContext;
          }
          function pushRenderLanes(fiber, lanes) {
            push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber);
            subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes);
            workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes);
          }
          function popRenderLanes(fiber) {
            subtreeRenderLanes = subtreeRenderLanesCursor.current;
            pop(subtreeRenderLanesCursor, fiber);
          }
          function prepareFreshStack(root2, lanes) {
            root2.finishedWork = null;
            root2.finishedLanes = NoLanes;
            var timeoutHandle = root2.timeoutHandle;
            if (timeoutHandle !== noTimeout) {
              root2.timeoutHandle = noTimeout;
              cancelTimeout2(timeoutHandle);
            }
            if (workInProgress !== null) {
              var interruptedWork = workInProgress.return;
              while (interruptedWork !== null) {
                var current2 = interruptedWork.alternate;
                unwindInterruptedWork(current2, interruptedWork);
                interruptedWork = interruptedWork.return;
              }
            }
            workInProgressRoot = root2;
            var rootWorkInProgress = createWorkInProgress(root2.current, null);
            workInProgress = rootWorkInProgress;
            workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes;
            workInProgressRootExitStatus = RootInProgress;
            workInProgressRootFatalError = null;
            workInProgressRootSkippedLanes = NoLanes;
            workInProgressRootInterleavedUpdatedLanes = NoLanes;
            workInProgressRootPingedLanes = NoLanes;
            workInProgressRootConcurrentErrors = null;
            workInProgressRootRecoverableErrors = null;
            finishQueueingConcurrentUpdates();
            {
              ReactStrictModeWarnings.discardPendingWarnings();
            }
            return rootWorkInProgress;
          }
          function handleError(root2, thrownValue) {
            do {
              var erroredWork = workInProgress;
              try {
                resetContextDependencies();
                resetHooksAfterThrow();
                resetCurrentFiber();
                ReactCurrentOwner$2.current = null;
                if (erroredWork === null || erroredWork.return === null) {
                  workInProgressRootExitStatus = RootFatalErrored;
                  workInProgressRootFatalError = thrownValue;
                  workInProgress = null;
                  return;
                }
                if (enableProfilerTimer && erroredWork.mode & ProfileMode) {
                  stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true);
                }
                if (enableSchedulingProfiler) {
                  markComponentRenderStopped();
                  if (thrownValue !== null && typeof thrownValue === "object" && typeof thrownValue.then === "function") {
                    var wakeable = thrownValue;
                    markComponentSuspended(erroredWork, wakeable, workInProgressRootRenderLanes);
                  } else {
                    markComponentErrored(erroredWork, thrownValue, workInProgressRootRenderLanes);
                  }
                }
                throwException(root2, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes);
                completeUnitOfWork(erroredWork);
              } catch (yetAnotherThrownValue) {
                thrownValue = yetAnotherThrownValue;
                if (workInProgress === erroredWork && erroredWork !== null) {
                  erroredWork = erroredWork.return;
                  workInProgress = erroredWork;
                } else {
                  erroredWork = workInProgress;
                }
                continue;
              }
              return;
            } while (true);
          }
          function pushDispatcher() {
            var prevDispatcher = ReactCurrentDispatcher$2.current;
            ReactCurrentDispatcher$2.current = ContextOnlyDispatcher;
            if (prevDispatcher === null) {
              return ContextOnlyDispatcher;
            } else {
              return prevDispatcher;
            }
          }
          function popDispatcher(prevDispatcher) {
            ReactCurrentDispatcher$2.current = prevDispatcher;
          }
          function markCommitTimeOfFallback() {
            globalMostRecentFallbackTime = now3();
          }
          function markSkippedUpdateLanes(lane) {
            workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes);
          }
          function renderDidSuspend() {
            if (workInProgressRootExitStatus === RootInProgress) {
              workInProgressRootExitStatus = RootSuspended;
            }
          }
          function renderDidSuspendDelayIfPossible() {
            if (workInProgressRootExitStatus === RootInProgress || workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootErrored) {
              workInProgressRootExitStatus = RootSuspendedWithDelay;
            }
            if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootInterleavedUpdatedLanes))) {
              markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes);
            }
          }
          function renderDidError(error2) {
            if (workInProgressRootExitStatus !== RootSuspendedWithDelay) {
              workInProgressRootExitStatus = RootErrored;
            }
            if (workInProgressRootConcurrentErrors === null) {
              workInProgressRootConcurrentErrors = [error2];
            } else {
              workInProgressRootConcurrentErrors.push(error2);
            }
          }
          function renderHasNotSuspendedYet() {
            return workInProgressRootExitStatus === RootInProgress;
          }
          function renderRootSync(root2, lanes) {
            var prevExecutionContext = executionContext;
            executionContext |= RenderContext;
            var prevDispatcher = pushDispatcher();
            if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
              {
                if (isDevToolsPresent) {
                  var memoizedUpdaters = root2.memoizedUpdaters;
                  if (memoizedUpdaters.size > 0) {
                    restorePendingUpdaters(root2, workInProgressRootRenderLanes);
                    memoizedUpdaters.clear();
                  }
                  movePendingFibersToMemoized(root2, lanes);
                }
              }
              workInProgressTransitions = getTransitionsForLanes();
              prepareFreshStack(root2, lanes);
            }
            {
              markRenderStarted(lanes);
            }
            do {
              try {
                workLoopSync();
                break;
              } catch (thrownValue) {
                handleError(root2, thrownValue);
              }
            } while (true);
            resetContextDependencies();
            executionContext = prevExecutionContext;
            popDispatcher(prevDispatcher);
            if (workInProgress !== null) {
              throw new Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
            }
            {
              markRenderStopped();
            }
            workInProgressRoot = null;
            workInProgressRootRenderLanes = NoLanes;
            return workInProgressRootExitStatus;
          }
          function workLoopSync() {
            while (workInProgress !== null) {
              performUnitOfWork(workInProgress);
            }
          }
          function renderRootConcurrent(root2, lanes) {
            var prevExecutionContext = executionContext;
            executionContext |= RenderContext;
            var prevDispatcher = pushDispatcher();
            if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
              {
                if (isDevToolsPresent) {
                  var memoizedUpdaters = root2.memoizedUpdaters;
                  if (memoizedUpdaters.size > 0) {
                    restorePendingUpdaters(root2, workInProgressRootRenderLanes);
                    memoizedUpdaters.clear();
                  }
                  movePendingFibersToMemoized(root2, lanes);
                }
              }
              workInProgressTransitions = getTransitionsForLanes();
              resetRenderTimer();
              prepareFreshStack(root2, lanes);
            }
            {
              markRenderStarted(lanes);
            }
            do {
              try {
                workLoopConcurrent();
                break;
              } catch (thrownValue) {
                handleError(root2, thrownValue);
              }
            } while (true);
            resetContextDependencies();
            popDispatcher(prevDispatcher);
            executionContext = prevExecutionContext;
            if (workInProgress !== null) {
              {
                markRenderYielded();
              }
              return RootInProgress;
            } else {
              {
                markRenderStopped();
              }
              workInProgressRoot = null;
              workInProgressRootRenderLanes = NoLanes;
              return workInProgressRootExitStatus;
            }
          }
          function workLoopConcurrent() {
            while (workInProgress !== null && !shouldYield()) {
              performUnitOfWork(workInProgress);
            }
          }
          function performUnitOfWork(unitOfWork) {
            var current2 = unitOfWork.alternate;
            setCurrentFiber(unitOfWork);
            var next;
            if ((unitOfWork.mode & ProfileMode) !== NoMode) {
              startProfilerTimer(unitOfWork);
              next = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
              stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
            } else {
              next = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
            }
            resetCurrentFiber();
            unitOfWork.memoizedProps = unitOfWork.pendingProps;
            if (next === null) {
              completeUnitOfWork(unitOfWork);
            } else {
              workInProgress = next;
            }
            ReactCurrentOwner$2.current = null;
          }
          function completeUnitOfWork(unitOfWork) {
            var completedWork = unitOfWork;
            do {
              var current2 = completedWork.alternate;
              var returnFiber = completedWork.return;
              if ((completedWork.flags & Incomplete) === NoFlags) {
                setCurrentFiber(completedWork);
                var next = void 0;
                if ((completedWork.mode & ProfileMode) === NoMode) {
                  next = completeWork(current2, completedWork, subtreeRenderLanes);
                } else {
                  startProfilerTimer(completedWork);
                  next = completeWork(current2, completedWork, subtreeRenderLanes);
                  stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
                }
                resetCurrentFiber();
                if (next !== null) {
                  workInProgress = next;
                  return;
                }
              } else {
                var _next = unwindWork(current2, completedWork);
                if (_next !== null) {
                  _next.flags &= HostEffectMask;
                  workInProgress = _next;
                  return;
                }
                if ((completedWork.mode & ProfileMode) !== NoMode) {
                  stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
                  var actualDuration = completedWork.actualDuration;
                  var child = completedWork.child;
                  while (child !== null) {
                    actualDuration += child.actualDuration;
                    child = child.sibling;
                  }
                  completedWork.actualDuration = actualDuration;
                }
                if (returnFiber !== null) {
                  returnFiber.flags |= Incomplete;
                  returnFiber.subtreeFlags = NoFlags;
                  returnFiber.deletions = null;
                } else {
                  workInProgressRootExitStatus = RootDidNotComplete;
                  workInProgress = null;
                  return;
                }
              }
              var siblingFiber = completedWork.sibling;
              if (siblingFiber !== null) {
                workInProgress = siblingFiber;
                return;
              }
              completedWork = returnFiber;
              workInProgress = completedWork;
            } while (completedWork !== null);
            if (workInProgressRootExitStatus === RootInProgress) {
              workInProgressRootExitStatus = RootCompleted;
            }
          }
          function commitRoot(root2, recoverableErrors, transitions) {
            var previousUpdateLanePriority = getCurrentUpdatePriority();
            var prevTransition = ReactCurrentBatchConfig$3.transition;
            try {
              ReactCurrentBatchConfig$3.transition = null;
              setCurrentUpdatePriority(DiscreteEventPriority);
              commitRootImpl(root2, recoverableErrors, transitions, previousUpdateLanePriority);
            } finally {
              ReactCurrentBatchConfig$3.transition = prevTransition;
              setCurrentUpdatePriority(previousUpdateLanePriority);
            }
            return null;
          }
          function commitRootImpl(root2, recoverableErrors, transitions, renderPriorityLevel) {
            do {
              flushPassiveEffects();
            } while (rootWithPendingPassiveEffects !== null);
            flushRenderPhaseStrictModeWarningsInDEV();
            if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
              throw new Error("Should not already be working.");
            }
            var finishedWork = root2.finishedWork;
            var lanes = root2.finishedLanes;
            {
              markCommitStarted(lanes);
            }
            if (finishedWork === null) {
              {
                markCommitStopped();
              }
              return null;
            } else {
              {
                if (lanes === NoLanes) {
                  error("root.finishedLanes should not be empty during a commit. This is a bug in React.");
                }
              }
            }
            root2.finishedWork = null;
            root2.finishedLanes = NoLanes;
            if (finishedWork === root2.current) {
              throw new Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");
            }
            root2.callbackNode = null;
            root2.callbackPriority = NoLane;
            var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes);
            markRootFinished(root2, remainingLanes);
            if (root2 === workInProgressRoot) {
              workInProgressRoot = null;
              workInProgress = null;
              workInProgressRootRenderLanes = NoLanes;
            }
            if ((finishedWork.subtreeFlags & PassiveMask) !== NoFlags || (finishedWork.flags & PassiveMask) !== NoFlags) {
              if (!rootDoesHavePassiveEffects) {
                rootDoesHavePassiveEffects = true;
                pendingPassiveTransitions = transitions;
                scheduleCallback$1(NormalPriority, function() {
                  flushPassiveEffects();
                  return null;
                });
              }
            }
            var subtreeHasEffects = (finishedWork.subtreeFlags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags;
            var rootHasEffect = (finishedWork.flags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags;
            if (subtreeHasEffects || rootHasEffect) {
              var prevTransition = ReactCurrentBatchConfig$3.transition;
              ReactCurrentBatchConfig$3.transition = null;
              var previousPriority = getCurrentUpdatePriority();
              setCurrentUpdatePriority(DiscreteEventPriority);
              var prevExecutionContext = executionContext;
              executionContext |= CommitContext;
              ReactCurrentOwner$2.current = null;
              var shouldFireAfterActiveInstanceBlur2 = commitBeforeMutationEffects(root2, finishedWork);
              {
                recordCommitTime();
              }
              commitMutationEffects(root2, finishedWork, lanes);
              resetAfterCommit(root2.containerInfo);
              root2.current = finishedWork;
              {
                markLayoutEffectsStarted(lanes);
              }
              commitLayoutEffects(finishedWork, root2, lanes);
              {
                markLayoutEffectsStopped();
              }
              requestPaint();
              executionContext = prevExecutionContext;
              setCurrentUpdatePriority(previousPriority);
              ReactCurrentBatchConfig$3.transition = prevTransition;
            } else {
              root2.current = finishedWork;
              {
                recordCommitTime();
              }
            }
            var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;
            if (rootDoesHavePassiveEffects) {
              rootDoesHavePassiveEffects = false;
              rootWithPendingPassiveEffects = root2;
              pendingPassiveEffectsLanes = lanes;
            } else {
              {
                nestedPassiveUpdateCount = 0;
                rootWithPassiveNestedUpdates = null;
              }
            }
            remainingLanes = root2.pendingLanes;
            if (remainingLanes === NoLanes) {
              legacyErrorBoundariesThatAlreadyFailed = null;
            }
            {
              if (!rootDidHavePassiveEffects) {
                commitDoubleInvokeEffectsInDEV(root2.current, false);
              }
            }
            onCommitRoot(finishedWork.stateNode, renderPriorityLevel);
            {
              if (isDevToolsPresent) {
                root2.memoizedUpdaters.clear();
              }
            }
            {
              onCommitRoot$1();
            }
            ensureRootIsScheduled(root2, now3());
            if (recoverableErrors !== null) {
              var onRecoverableError = root2.onRecoverableError;
              for (var i = 0; i < recoverableErrors.length; i++) {
                var recoverableError = recoverableErrors[i];
                var componentStack = recoverableError.stack;
                var digest = recoverableError.digest;
                onRecoverableError(recoverableError.value, {
                  componentStack,
                  digest
                });
              }
            }
            if (hasUncaughtError) {
              hasUncaughtError = false;
              var error$1 = firstUncaughtError;
              firstUncaughtError = null;
              throw error$1;
            }
            if (includesSomeLane(pendingPassiveEffectsLanes, SyncLane) && root2.tag !== LegacyRoot) {
              flushPassiveEffects();
            }
            remainingLanes = root2.pendingLanes;
            if (includesSomeLane(remainingLanes, SyncLane)) {
              {
                markNestedUpdateScheduled();
              }
              if (root2 === rootWithNestedUpdates) {
                nestedUpdateCount++;
              } else {
                nestedUpdateCount = 0;
                rootWithNestedUpdates = root2;
              }
            } else {
              nestedUpdateCount = 0;
            }
            flushSyncCallbacks();
            {
              markCommitStopped();
            }
            return null;
          }
          function flushPassiveEffects() {
            if (rootWithPendingPassiveEffects !== null) {
              var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes);
              var priority = lowerEventPriority(DefaultEventPriority, renderPriority);
              var prevTransition = ReactCurrentBatchConfig$3.transition;
              var previousPriority = getCurrentUpdatePriority();
              try {
                ReactCurrentBatchConfig$3.transition = null;
                setCurrentUpdatePriority(priority);
                return flushPassiveEffectsImpl();
              } finally {
                setCurrentUpdatePriority(previousPriority);
                ReactCurrentBatchConfig$3.transition = prevTransition;
              }
            }
            return false;
          }
          function enqueuePendingPassiveProfilerEffect(fiber) {
            {
              pendingPassiveProfilerEffects.push(fiber);
              if (!rootDoesHavePassiveEffects) {
                rootDoesHavePassiveEffects = true;
                scheduleCallback$1(NormalPriority, function() {
                  flushPassiveEffects();
                  return null;
                });
              }
            }
          }
          function flushPassiveEffectsImpl() {
            if (rootWithPendingPassiveEffects === null) {
              return false;
            }
            var transitions = pendingPassiveTransitions;
            pendingPassiveTransitions = null;
            var root2 = rootWithPendingPassiveEffects;
            var lanes = pendingPassiveEffectsLanes;
            rootWithPendingPassiveEffects = null;
            pendingPassiveEffectsLanes = NoLanes;
            if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
              throw new Error("Cannot flush passive effects while already rendering.");
            }
            {
              isFlushingPassiveEffects = true;
              didScheduleUpdateDuringPassiveEffects = false;
            }
            {
              markPassiveEffectsStarted(lanes);
            }
            var prevExecutionContext = executionContext;
            executionContext |= CommitContext;
            commitPassiveUnmountEffects(root2.current);
            commitPassiveMountEffects(root2, root2.current, lanes, transitions);
            {
              var profilerEffects = pendingPassiveProfilerEffects;
              pendingPassiveProfilerEffects = [];
              for (var i = 0; i < profilerEffects.length; i++) {
                var _fiber = profilerEffects[i];
                commitPassiveEffectDurations(root2, _fiber);
              }
            }
            {
              markPassiveEffectsStopped();
            }
            {
              commitDoubleInvokeEffectsInDEV(root2.current, true);
            }
            executionContext = prevExecutionContext;
            flushSyncCallbacks();
            {
              if (didScheduleUpdateDuringPassiveEffects) {
                if (root2 === rootWithPassiveNestedUpdates) {
                  nestedPassiveUpdateCount++;
                } else {
                  nestedPassiveUpdateCount = 0;
                  rootWithPassiveNestedUpdates = root2;
                }
              } else {
                nestedPassiveUpdateCount = 0;
              }
              isFlushingPassiveEffects = false;
              didScheduleUpdateDuringPassiveEffects = false;
            }
            onPostCommitRoot(root2);
            {
              var stateNode = root2.current.stateNode;
              stateNode.effectDuration = 0;
              stateNode.passiveEffectDuration = 0;
            }
            return true;
          }
          function isAlreadyFailedLegacyErrorBoundary(instance) {
            return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
          }
          function markLegacyErrorBoundaryAsFailed(instance) {
            if (legacyErrorBoundariesThatAlreadyFailed === null) {
              legacyErrorBoundariesThatAlreadyFailed = /* @__PURE__ */ new Set([instance]);
            } else {
              legacyErrorBoundariesThatAlreadyFailed.add(instance);
            }
          }
          function prepareToThrowUncaughtError(error2) {
            if (!hasUncaughtError) {
              hasUncaughtError = true;
              firstUncaughtError = error2;
            }
          }
          var onUncaughtError = prepareToThrowUncaughtError;
          function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error2) {
            var errorInfo = createCapturedValueAtFiber(error2, sourceFiber);
            var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane);
            var root2 = enqueueUpdate(rootFiber, update, SyncLane);
            var eventTime = requestEventTime();
            if (root2 !== null) {
              markRootUpdated(root2, SyncLane, eventTime);
              ensureRootIsScheduled(root2, eventTime);
            }
          }
          function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) {
            {
              reportUncaughtErrorInDEV(error$1);
              setIsRunningInsertionEffect(false);
            }
            if (sourceFiber.tag === HostRoot) {
              captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error$1);
              return;
            }
            var fiber = null;
            {
              fiber = nearestMountedAncestor;
            }
            while (fiber !== null) {
              if (fiber.tag === HostRoot) {
                captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error$1);
                return;
              } else if (fiber.tag === ClassComponent) {
                var ctor = fiber.type;
                var instance = fiber.stateNode;
                if (typeof ctor.getDerivedStateFromError === "function" || typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance)) {
                  var errorInfo = createCapturedValueAtFiber(error$1, sourceFiber);
                  var update = createClassErrorUpdate(fiber, errorInfo, SyncLane);
                  var root2 = enqueueUpdate(fiber, update, SyncLane);
                  var eventTime = requestEventTime();
                  if (root2 !== null) {
                    markRootUpdated(root2, SyncLane, eventTime);
                    ensureRootIsScheduled(root2, eventTime);
                  }
                  return;
                }
              }
              fiber = fiber.return;
            }
            {
              error("Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.\n\nError message:\n\n%s", error$1);
            }
          }
          function pingSuspendedRoot(root2, wakeable, pingedLanes) {
            var pingCache = root2.pingCache;
            if (pingCache !== null) {
              pingCache.delete(wakeable);
            }
            var eventTime = requestEventTime();
            markRootPinged(root2, pingedLanes);
            warnIfSuspenseResolutionNotWrappedWithActDEV(root2);
            if (workInProgressRoot === root2 && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) {
              if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now3() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
                prepareFreshStack(root2, NoLanes);
              } else {
                workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes);
              }
            }
            ensureRootIsScheduled(root2, eventTime);
          }
          function retryTimedOutBoundary(boundaryFiber, retryLane) {
            if (retryLane === NoLane) {
              retryLane = requestRetryLane(boundaryFiber);
            }
            var eventTime = requestEventTime();
            var root2 = enqueueConcurrentRenderForLane(boundaryFiber, retryLane);
            if (root2 !== null) {
              markRootUpdated(root2, retryLane, eventTime);
              ensureRootIsScheduled(root2, eventTime);
            }
          }
          function retryDehydratedSuspenseBoundary(boundaryFiber) {
            var suspenseState = boundaryFiber.memoizedState;
            var retryLane = NoLane;
            if (suspenseState !== null) {
              retryLane = suspenseState.retryLane;
            }
            retryTimedOutBoundary(boundaryFiber, retryLane);
          }
          function resolveRetryWakeable(boundaryFiber, wakeable) {
            var retryLane = NoLane;
            var retryCache;
            switch (boundaryFiber.tag) {
              case SuspenseComponent:
                retryCache = boundaryFiber.stateNode;
                var suspenseState = boundaryFiber.memoizedState;
                if (suspenseState !== null) {
                  retryLane = suspenseState.retryLane;
                }
                break;
              case SuspenseListComponent:
                retryCache = boundaryFiber.stateNode;
                break;
              default:
                throw new Error("Pinged unknown suspense boundary type. This is probably a bug in React.");
            }
            if (retryCache !== null) {
              retryCache.delete(wakeable);
            }
            retryTimedOutBoundary(boundaryFiber, retryLane);
          }
          function jnd(timeElapsed) {
            return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3e3 ? 3e3 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
          }
          function checkForNestedUpdates() {
            if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
              nestedUpdateCount = 0;
              rootWithNestedUpdates = null;
              throw new Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");
            }
            {
              if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {
                nestedPassiveUpdateCount = 0;
                rootWithPassiveNestedUpdates = null;
                error("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.");
              }
            }
          }
          function flushRenderPhaseStrictModeWarningsInDEV() {
            {
              ReactStrictModeWarnings.flushLegacyContextWarning();
              {
                ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
              }
            }
          }
          function commitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) {
            {
              setCurrentFiber(fiber);
              invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectUnmountInDEV);
              if (hasPassiveEffects) {
                invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectUnmountInDEV);
              }
              invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectMountInDEV);
              if (hasPassiveEffects) {
                invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectMountInDEV);
              }
              resetCurrentFiber();
            }
          }
          function invokeEffectsInDev(firstChild, fiberFlags, invokeEffectFn) {
            {
              var current2 = firstChild;
              var subtreeRoot = null;
              while (current2 !== null) {
                var primarySubtreeFlag = current2.subtreeFlags & fiberFlags;
                if (current2 !== subtreeRoot && current2.child !== null && primarySubtreeFlag !== NoFlags) {
                  current2 = current2.child;
                } else {
                  if ((current2.flags & fiberFlags) !== NoFlags) {
                    invokeEffectFn(current2);
                  }
                  if (current2.sibling !== null) {
                    current2 = current2.sibling;
                  } else {
                    current2 = subtreeRoot = current2.return;
                  }
                }
              }
            }
          }
          var didWarnStateUpdateForNotYetMountedComponent = null;
          function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) {
            {
              if ((executionContext & RenderContext) !== NoContext) {
                return;
              }
              if (!(fiber.mode & ConcurrentMode)) {
                return;
              }
              var tag = fiber.tag;
              if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent2 && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent) {
                return;
              }
              var componentName = getComponentNameFromFiber(fiber) || "ReactComponent";
              if (didWarnStateUpdateForNotYetMountedComponent !== null) {
                if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) {
                  return;
                }
                didWarnStateUpdateForNotYetMountedComponent.add(componentName);
              } else {
                didWarnStateUpdateForNotYetMountedComponent = /* @__PURE__ */ new Set([componentName]);
              }
              var previousFiber = current;
              try {
                setCurrentFiber(fiber);
                error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.");
              } finally {
                if (previousFiber) {
                  setCurrentFiber(fiber);
                } else {
                  resetCurrentFiber();
                }
              }
            }
          }
          var beginWork$1;
          {
            var dummyFiber = null;
            beginWork$1 = function(current2, unitOfWork, lanes) {
              var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);
              try {
                return beginWork(current2, unitOfWork, lanes);
              } catch (originalError) {
                if (didSuspendOrErrorWhileHydratingDEV() || originalError !== null && typeof originalError === "object" && typeof originalError.then === "function") {
                  throw originalError;
                }
                resetContextDependencies();
                resetHooksAfterThrow();
                unwindInterruptedWork(current2, unitOfWork);
                assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
                if (unitOfWork.mode & ProfileMode) {
                  startProfilerTimer(unitOfWork);
                }
                invokeGuardedCallback(null, beginWork, null, current2, unitOfWork, lanes);
                if (hasCaughtError()) {
                  var replayError = clearCaughtError();
                  if (typeof replayError === "object" && replayError !== null && replayError._suppressLogging && typeof originalError === "object" && originalError !== null && !originalError._suppressLogging) {
                    originalError._suppressLogging = true;
                  }
                }
                throw originalError;
              }
            };
          }
          var didWarnAboutUpdateInRender = false;
          var didWarnAboutUpdateInRenderForAnotherComponent;
          {
            didWarnAboutUpdateInRenderForAnotherComponent = /* @__PURE__ */ new Set();
          }
          function warnAboutRenderPhaseUpdatesInDEV(fiber) {
            {
              if (isRendering && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {
                switch (fiber.tag) {
                  case FunctionComponent2:
                  case ForwardRef:
                  case SimpleMemoComponent: {
                    var renderingComponentName = workInProgress && getComponentNameFromFiber(workInProgress) || "Unknown";
                    var dedupeKey = renderingComponentName;
                    if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {
                      didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);
                      var setStateComponentName = getComponentNameFromFiber(fiber) || "Unknown";
                      error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render", setStateComponentName, renderingComponentName, renderingComponentName);
                    }
                    break;
                  }
                  case ClassComponent: {
                    if (!didWarnAboutUpdateInRender) {
                      error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state.");
                      didWarnAboutUpdateInRender = true;
                    }
                    break;
                  }
                }
              }
            }
          }
          function restorePendingUpdaters(root2, lanes) {
            {
              if (isDevToolsPresent) {
                var memoizedUpdaters = root2.memoizedUpdaters;
                memoizedUpdaters.forEach(function(schedulingFiber) {
                  addFiberToLanesMap(root2, schedulingFiber, lanes);
                });
              }
            }
          }
          var fakeActCallbackNode = {};
          function scheduleCallback$1(priorityLevel, callback) {
            {
              var actQueue = ReactCurrentActQueue$1.current;
              if (actQueue !== null) {
                actQueue.push(callback);
                return fakeActCallbackNode;
              } else {
                return scheduleCallback(priorityLevel, callback);
              }
            }
          }
          function cancelCallback$1(callbackNode) {
            if (callbackNode === fakeActCallbackNode) {
              return;
            }
            return cancelCallback(callbackNode);
          }
          function shouldForceFlushFallbacksInDEV() {
            return ReactCurrentActQueue$1.current !== null;
          }
          function warnIfUpdatesNotWrappedWithActDEV(fiber) {
            {
              if (fiber.mode & ConcurrentMode) {
                if (!isConcurrentActEnvironment()) {
                  return;
                }
              } else {
                if (!isLegacyActEnvironment()) {
                  return;
                }
                if (executionContext !== NoContext) {
                  return;
                }
                if (fiber.tag !== FunctionComponent2 && fiber.tag !== ForwardRef && fiber.tag !== SimpleMemoComponent) {
                  return;
                }
              }
              if (ReactCurrentActQueue$1.current === null) {
                var previousFiber = current;
                try {
                  setCurrentFiber(fiber);
                  error("An update to %s inside a test was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n  /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act", getComponentNameFromFiber(fiber));
                } finally {
                  if (previousFiber) {
                    setCurrentFiber(fiber);
                  } else {
                    resetCurrentFiber();
                  }
                }
              }
            }
          }
          function warnIfSuspenseResolutionNotWrappedWithActDEV(root2) {
            {
              if (root2.tag !== LegacyRoot && isConcurrentActEnvironment() && ReactCurrentActQueue$1.current === null) {
                error("A suspended resource finished loading inside a test, but the event was not wrapped in act(...).\n\nWhen testing, code that resolves suspended data should be wrapped into act(...):\n\nact(() => {\n  /* finish loading suspended data */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act");
              }
            }
          }
          function setIsRunningInsertionEffect(isRunning) {
            {
              isRunningInsertionEffect = isRunning;
            }
          }
          var resolveFamily = null;
          var failedBoundaries = null;
          var setRefreshHandler = function(handler) {
            {
              resolveFamily = handler;
            }
          };
          function resolveFunctionForHotReloading(type) {
            {
              if (resolveFamily === null) {
                return type;
              }
              var family = resolveFamily(type);
              if (family === void 0) {
                return type;
              }
              return family.current;
            }
          }
          function resolveClassForHotReloading(type) {
            return resolveFunctionForHotReloading(type);
          }
          function resolveForwardRefForHotReloading(type) {
            {
              if (resolveFamily === null) {
                return type;
              }
              var family = resolveFamily(type);
              if (family === void 0) {
                if (type !== null && type !== void 0 && typeof type.render === "function") {
                  var currentRender = resolveFunctionForHotReloading(type.render);
                  if (type.render !== currentRender) {
                    var syntheticType = {
                      $$typeof: REACT_FORWARD_REF_TYPE,
                      render: currentRender
                    };
                    if (type.displayName !== void 0) {
                      syntheticType.displayName = type.displayName;
                    }
                    return syntheticType;
                  }
                }
                return type;
              }
              return family.current;
            }
          }
          function isCompatibleFamilyForHotReloading(fiber, element) {
            {
              if (resolveFamily === null) {
                return false;
              }
              var prevType = fiber.elementType;
              var nextType = element.type;
              var needsCompareFamilies = false;
              var $$typeofNextType = typeof nextType === "object" && nextType !== null ? nextType.$$typeof : null;
              switch (fiber.tag) {
                case ClassComponent: {
                  if (typeof nextType === "function") {
                    needsCompareFamilies = true;
                  }
                  break;
                }
                case FunctionComponent2: {
                  if (typeof nextType === "function") {
                    needsCompareFamilies = true;
                  } else if ($$typeofNextType === REACT_LAZY_TYPE) {
                    needsCompareFamilies = true;
                  }
                  break;
                }
                case ForwardRef: {
                  if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {
                    needsCompareFamilies = true;
                  } else if ($$typeofNextType === REACT_LAZY_TYPE) {
                    needsCompareFamilies = true;
                  }
                  break;
                }
                case MemoComponent:
                case SimpleMemoComponent: {
                  if ($$typeofNextType === REACT_MEMO_TYPE) {
                    needsCompareFamilies = true;
                  } else if ($$typeofNextType === REACT_LAZY_TYPE) {
                    needsCompareFamilies = true;
                  }
                  break;
                }
                default:
                  return false;
              }
              if (needsCompareFamilies) {
                var prevFamily = resolveFamily(prevType);
                if (prevFamily !== void 0 && prevFamily === resolveFamily(nextType)) {
                  return true;
                }
              }
              return false;
            }
          }
          function markFailedErrorBoundaryForHotReloading(fiber) {
            {
              if (resolveFamily === null) {
                return;
              }
              if (typeof WeakSet !== "function") {
                return;
              }
              if (failedBoundaries === null) {
                failedBoundaries = /* @__PURE__ */ new WeakSet();
              }
              failedBoundaries.add(fiber);
            }
          }
          var scheduleRefresh = function(root2, update) {
            {
              if (resolveFamily === null) {
                return;
              }
              var staleFamilies = update.staleFamilies, updatedFamilies = update.updatedFamilies;
              flushPassiveEffects();
              flushSync(function() {
                scheduleFibersWithFamiliesRecursively(root2.current, updatedFamilies, staleFamilies);
              });
            }
          };
          var scheduleRoot = function(root2, element) {
            {
              if (root2.context !== emptyContextObject) {
                return;
              }
              flushPassiveEffects();
              flushSync(function() {
                updateContainer(element, root2, null, null);
              });
            }
          };
          function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
            {
              var alternate = fiber.alternate, child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
              var candidateType = null;
              switch (tag) {
                case FunctionComponent2:
                case SimpleMemoComponent:
                case ClassComponent:
                  candidateType = type;
                  break;
                case ForwardRef:
                  candidateType = type.render;
                  break;
              }
              if (resolveFamily === null) {
                throw new Error("Expected resolveFamily to be set during hot reload.");
              }
              var needsRender = false;
              var needsRemount = false;
              if (candidateType !== null) {
                var family = resolveFamily(candidateType);
                if (family !== void 0) {
                  if (staleFamilies.has(family)) {
                    needsRemount = true;
                  } else if (updatedFamilies.has(family)) {
                    if (tag === ClassComponent) {
                      needsRemount = true;
                    } else {
                      needsRender = true;
                    }
                  }
                }
              }
              if (failedBoundaries !== null) {
                if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {
                  needsRemount = true;
                }
              }
              if (needsRemount) {
                fiber._debugNeedsRemount = true;
              }
              if (needsRemount || needsRender) {
                var _root = enqueueConcurrentRenderForLane(fiber, SyncLane);
                if (_root !== null) {
                  scheduleUpdateOnFiber(_root, fiber, SyncLane, NoTimestamp);
                }
              }
              if (child !== null && !needsRemount) {
                scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
              }
              if (sibling !== null) {
                scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
              }
            }
          }
          var findHostInstancesForRefresh = function(root2, families) {
            {
              var hostInstances = /* @__PURE__ */ new Set();
              var types = new Set(families.map(function(family) {
                return family.current;
              }));
              findHostInstancesForMatchingFibersRecursively(root2.current, types, hostInstances);
              return hostInstances;
            }
          };
          function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {
            {
              var child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
              var candidateType = null;
              switch (tag) {
                case FunctionComponent2:
                case SimpleMemoComponent:
                case ClassComponent:
                  candidateType = type;
                  break;
                case ForwardRef:
                  candidateType = type.render;
                  break;
              }
              var didMatch = false;
              if (candidateType !== null) {
                if (types.has(candidateType)) {
                  didMatch = true;
                }
              }
              if (didMatch) {
                findHostInstancesForFiberShallowly(fiber, hostInstances);
              } else {
                if (child !== null) {
                  findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);
                }
              }
              if (sibling !== null) {
                findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);
              }
            }
          }
          function findHostInstancesForFiberShallowly(fiber, hostInstances) {
            {
              var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);
              if (foundHostInstances) {
                return;
              }
              var node = fiber;
              while (true) {
                switch (node.tag) {
                  case HostComponent:
                    hostInstances.add(node.stateNode);
                    return;
                  case HostPortal:
                    hostInstances.add(node.stateNode.containerInfo);
                    return;
                  case HostRoot:
                    hostInstances.add(node.stateNode.containerInfo);
                    return;
                }
                if (node.return === null) {
                  throw new Error("Expected to reach root first.");
                }
                node = node.return;
              }
            }
          }
          function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
            {
              var node = fiber;
              var foundHostInstances = false;
              while (true) {
                if (node.tag === HostComponent) {
                  foundHostInstances = true;
                  hostInstances.add(node.stateNode);
                } else if (node.child !== null) {
                  node.child.return = node;
                  node = node.child;
                  continue;
                }
                if (node === fiber) {
                  return foundHostInstances;
                }
                while (node.sibling === null) {
                  if (node.return === null || node.return === fiber) {
                    return foundHostInstances;
                  }
                  node = node.return;
                }
                node.sibling.return = node.return;
                node = node.sibling;
              }
            }
            return false;
          }
          var hasBadMapPolyfill;
          {
            hasBadMapPolyfill = false;
            try {
              var nonExtensibleObject = Object.preventExtensions({});
              /* @__PURE__ */ new Map([[nonExtensibleObject, null]]);
              /* @__PURE__ */ new Set([nonExtensibleObject]);
            } catch (e) {
              hasBadMapPolyfill = true;
            }
          }
          function FiberNode(tag, pendingProps, key, mode) {
            this.tag = tag;
            this.key = key;
            this.elementType = null;
            this.type = null;
            this.stateNode = null;
            this.return = null;
            this.child = null;
            this.sibling = null;
            this.index = 0;
            this.ref = null;
            this.pendingProps = pendingProps;
            this.memoizedProps = null;
            this.updateQueue = null;
            this.memoizedState = null;
            this.dependencies = null;
            this.mode = mode;
            this.flags = NoFlags;
            this.subtreeFlags = NoFlags;
            this.deletions = null;
            this.lanes = NoLanes;
            this.childLanes = NoLanes;
            this.alternate = null;
            {
              this.actualDuration = Number.NaN;
              this.actualStartTime = Number.NaN;
              this.selfBaseDuration = Number.NaN;
              this.treeBaseDuration = Number.NaN;
              this.actualDuration = 0;
              this.actualStartTime = -1;
              this.selfBaseDuration = 0;
              this.treeBaseDuration = 0;
            }
            {
              this._debugSource = null;
              this._debugOwner = null;
              this._debugNeedsRemount = false;
              this._debugHookTypes = null;
              if (!hasBadMapPolyfill && typeof Object.preventExtensions === "function") {
                Object.preventExtensions(this);
              }
            }
          }
          var createFiber = function(tag, pendingProps, key, mode) {
            return new FiberNode(tag, pendingProps, key, mode);
          };
          function shouldConstruct$1(Component40) {
            var prototype = Component40.prototype;
            return !!(prototype && prototype.isReactComponent);
          }
          function isSimpleFunctionComponent(type) {
            return typeof type === "function" && !shouldConstruct$1(type) && type.defaultProps === void 0;
          }
          function resolveLazyComponentTag(Component40) {
            if (typeof Component40 === "function") {
              return shouldConstruct$1(Component40) ? ClassComponent : FunctionComponent2;
            } else if (Component40 !== void 0 && Component40 !== null) {
              var $$typeof = Component40.$$typeof;
              if ($$typeof === REACT_FORWARD_REF_TYPE) {
                return ForwardRef;
              }
              if ($$typeof === REACT_MEMO_TYPE) {
                return MemoComponent;
              }
            }
            return IndeterminateComponent;
          }
          function createWorkInProgress(current2, pendingProps) {
            var workInProgress2 = current2.alternate;
            if (workInProgress2 === null) {
              workInProgress2 = createFiber(current2.tag, pendingProps, current2.key, current2.mode);
              workInProgress2.elementType = current2.elementType;
              workInProgress2.type = current2.type;
              workInProgress2.stateNode = current2.stateNode;
              {
                workInProgress2._debugSource = current2._debugSource;
                workInProgress2._debugOwner = current2._debugOwner;
                workInProgress2._debugHookTypes = current2._debugHookTypes;
              }
              workInProgress2.alternate = current2;
              current2.alternate = workInProgress2;
            } else {
              workInProgress2.pendingProps = pendingProps;
              workInProgress2.type = current2.type;
              workInProgress2.flags = NoFlags;
              workInProgress2.subtreeFlags = NoFlags;
              workInProgress2.deletions = null;
              {
                workInProgress2.actualDuration = 0;
                workInProgress2.actualStartTime = -1;
              }
            }
            workInProgress2.flags = current2.flags & StaticMask;
            workInProgress2.childLanes = current2.childLanes;
            workInProgress2.lanes = current2.lanes;
            workInProgress2.child = current2.child;
            workInProgress2.memoizedProps = current2.memoizedProps;
            workInProgress2.memoizedState = current2.memoizedState;
            workInProgress2.updateQueue = current2.updateQueue;
            var currentDependencies = current2.dependencies;
            workInProgress2.dependencies = currentDependencies === null ? null : {
              lanes: currentDependencies.lanes,
              firstContext: currentDependencies.firstContext
            };
            workInProgress2.sibling = current2.sibling;
            workInProgress2.index = current2.index;
            workInProgress2.ref = current2.ref;
            {
              workInProgress2.selfBaseDuration = current2.selfBaseDuration;
              workInProgress2.treeBaseDuration = current2.treeBaseDuration;
            }
            {
              workInProgress2._debugNeedsRemount = current2._debugNeedsRemount;
              switch (workInProgress2.tag) {
                case IndeterminateComponent:
                case FunctionComponent2:
                case SimpleMemoComponent:
                  workInProgress2.type = resolveFunctionForHotReloading(current2.type);
                  break;
                case ClassComponent:
                  workInProgress2.type = resolveClassForHotReloading(current2.type);
                  break;
                case ForwardRef:
                  workInProgress2.type = resolveForwardRefForHotReloading(current2.type);
                  break;
              }
            }
            return workInProgress2;
          }
          function resetWorkInProgress(workInProgress2, renderLanes2) {
            workInProgress2.flags &= StaticMask | Placement;
            var current2 = workInProgress2.alternate;
            if (current2 === null) {
              workInProgress2.childLanes = NoLanes;
              workInProgress2.lanes = renderLanes2;
              workInProgress2.child = null;
              workInProgress2.subtreeFlags = NoFlags;
              workInProgress2.memoizedProps = null;
              workInProgress2.memoizedState = null;
              workInProgress2.updateQueue = null;
              workInProgress2.dependencies = null;
              workInProgress2.stateNode = null;
              {
                workInProgress2.selfBaseDuration = 0;
                workInProgress2.treeBaseDuration = 0;
              }
            } else {
              workInProgress2.childLanes = current2.childLanes;
              workInProgress2.lanes = current2.lanes;
              workInProgress2.child = current2.child;
              workInProgress2.subtreeFlags = NoFlags;
              workInProgress2.deletions = null;
              workInProgress2.memoizedProps = current2.memoizedProps;
              workInProgress2.memoizedState = current2.memoizedState;
              workInProgress2.updateQueue = current2.updateQueue;
              workInProgress2.type = current2.type;
              var currentDependencies = current2.dependencies;
              workInProgress2.dependencies = currentDependencies === null ? null : {
                lanes: currentDependencies.lanes,
                firstContext: currentDependencies.firstContext
              };
              {
                workInProgress2.selfBaseDuration = current2.selfBaseDuration;
                workInProgress2.treeBaseDuration = current2.treeBaseDuration;
              }
            }
            return workInProgress2;
          }
          function createHostRootFiber(tag, isStrictMode, concurrentUpdatesByDefaultOverride) {
            var mode;
            if (tag === ConcurrentRoot) {
              mode = ConcurrentMode;
              if (isStrictMode === true) {
                mode |= StrictLegacyMode;
                {
                  mode |= StrictEffectsMode;
                }
              }
            } else {
              mode = NoMode;
            }
            if (isDevToolsPresent) {
              mode |= ProfileMode;
            }
            return createFiber(HostRoot, null, null, mode);
          }
          function createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes) {
            var fiberTag = IndeterminateComponent;
            var resolvedType = type;
            if (typeof type === "function") {
              if (shouldConstruct$1(type)) {
                fiberTag = ClassComponent;
                {
                  resolvedType = resolveClassForHotReloading(resolvedType);
                }
              } else {
                {
                  resolvedType = resolveFunctionForHotReloading(resolvedType);
                }
              }
            } else if (typeof type === "string") {
              fiberTag = HostComponent;
            } else {
              getTag: switch (type) {
                case REACT_FRAGMENT_TYPE:
                  return createFiberFromFragment(pendingProps.children, mode, lanes, key);
                case REACT_STRICT_MODE_TYPE:
                  fiberTag = Mode;
                  mode |= StrictLegacyMode;
                  if ((mode & ConcurrentMode) !== NoMode) {
                    mode |= StrictEffectsMode;
                  }
                  break;
                case REACT_PROFILER_TYPE:
                  return createFiberFromProfiler(pendingProps, mode, lanes, key);
                case REACT_SUSPENSE_TYPE:
                  return createFiberFromSuspense(pendingProps, mode, lanes, key);
                case REACT_SUSPENSE_LIST_TYPE:
                  return createFiberFromSuspenseList(pendingProps, mode, lanes, key);
                case REACT_OFFSCREEN_TYPE:
                  return createFiberFromOffscreen(pendingProps, mode, lanes, key);
                case REACT_LEGACY_HIDDEN_TYPE:
                // eslint-disable-next-line no-fallthrough
                case REACT_SCOPE_TYPE:
                // eslint-disable-next-line no-fallthrough
                case REACT_CACHE_TYPE:
                // eslint-disable-next-line no-fallthrough
                case REACT_TRACING_MARKER_TYPE:
                // eslint-disable-next-line no-fallthrough
                case REACT_DEBUG_TRACING_MODE_TYPE:
                // eslint-disable-next-line no-fallthrough
                default: {
                  if (typeof type === "object" && type !== null) {
                    switch (type.$$typeof) {
                      case REACT_PROVIDER_TYPE:
                        fiberTag = ContextProvider;
                        break getTag;
                      case REACT_CONTEXT_TYPE:
                        fiberTag = ContextConsumer;
                        break getTag;
                      case REACT_FORWARD_REF_TYPE:
                        fiberTag = ForwardRef;
                        {
                          resolvedType = resolveForwardRefForHotReloading(resolvedType);
                        }
                        break getTag;
                      case REACT_MEMO_TYPE:
                        fiberTag = MemoComponent;
                        break getTag;
                      case REACT_LAZY_TYPE:
                        fiberTag = LazyComponent;
                        resolvedType = null;
                        break getTag;
                    }
                  }
                  var info2 = "";
                  {
                    if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
                      info2 += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
                    }
                    var ownerName = owner ? getComponentNameFromFiber(owner) : null;
                    if (ownerName) {
                      info2 += "\n\nCheck the render method of `" + ownerName + "`.";
                    }
                  }
                  throw new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) " + ("but got: " + (type == null ? type : typeof type) + "." + info2));
                }
              }
            }
            var fiber = createFiber(fiberTag, pendingProps, key, mode);
            fiber.elementType = type;
            fiber.type = resolvedType;
            fiber.lanes = lanes;
            {
              fiber._debugOwner = owner;
            }
            return fiber;
          }
          function createFiberFromElement(element, mode, lanes) {
            var owner = null;
            {
              owner = element._owner;
            }
            var type = element.type;
            var key = element.key;
            var pendingProps = element.props;
            var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes);
            {
              fiber._debugSource = element._source;
              fiber._debugOwner = element._owner;
            }
            return fiber;
          }
          function createFiberFromFragment(elements, mode, lanes, key) {
            var fiber = createFiber(Fragment67, elements, key, mode);
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromProfiler(pendingProps, mode, lanes, key) {
            {
              if (typeof pendingProps.id !== "string") {
                error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', typeof pendingProps.id);
              }
            }
            var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode);
            fiber.elementType = REACT_PROFILER_TYPE;
            fiber.lanes = lanes;
            {
              fiber.stateNode = {
                effectDuration: 0,
                passiveEffectDuration: 0
              };
            }
            return fiber;
          }
          function createFiberFromSuspense(pendingProps, mode, lanes, key) {
            var fiber = createFiber(SuspenseComponent, pendingProps, key, mode);
            fiber.elementType = REACT_SUSPENSE_TYPE;
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
            var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);
            fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
            var fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
            fiber.elementType = REACT_OFFSCREEN_TYPE;
            fiber.lanes = lanes;
            var primaryChildInstance = {
              isHidden: false
            };
            fiber.stateNode = primaryChildInstance;
            return fiber;
          }
          function createFiberFromText(content, mode, lanes) {
            var fiber = createFiber(HostText, content, null, mode);
            fiber.lanes = lanes;
            return fiber;
          }
          function createFiberFromHostInstanceForDeletion() {
            var fiber = createFiber(HostComponent, null, null, NoMode);
            fiber.elementType = "DELETED";
            return fiber;
          }
          function createFiberFromDehydratedFragment(dehydratedNode) {
            var fiber = createFiber(DehydratedFragment, null, null, NoMode);
            fiber.stateNode = dehydratedNode;
            return fiber;
          }
          function createFiberFromPortal(portal, mode, lanes) {
            var pendingProps = portal.children !== null ? portal.children : [];
            var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
            fiber.lanes = lanes;
            fiber.stateNode = {
              containerInfo: portal.containerInfo,
              pendingChildren: null,
              // Used by persistent updates
              implementation: portal.implementation
            };
            return fiber;
          }
          function assignFiberPropertiesInDEV(target, source) {
            if (target === null) {
              target = createFiber(IndeterminateComponent, null, null, NoMode);
            }
            target.tag = source.tag;
            target.key = source.key;
            target.elementType = source.elementType;
            target.type = source.type;
            target.stateNode = source.stateNode;
            target.return = source.return;
            target.child = source.child;
            target.sibling = source.sibling;
            target.index = source.index;
            target.ref = source.ref;
            target.pendingProps = source.pendingProps;
            target.memoizedProps = source.memoizedProps;
            target.updateQueue = source.updateQueue;
            target.memoizedState = source.memoizedState;
            target.dependencies = source.dependencies;
            target.mode = source.mode;
            target.flags = source.flags;
            target.subtreeFlags = source.subtreeFlags;
            target.deletions = source.deletions;
            target.lanes = source.lanes;
            target.childLanes = source.childLanes;
            target.alternate = source.alternate;
            {
              target.actualDuration = source.actualDuration;
              target.actualStartTime = source.actualStartTime;
              target.selfBaseDuration = source.selfBaseDuration;
              target.treeBaseDuration = source.treeBaseDuration;
            }
            target._debugSource = source._debugSource;
            target._debugOwner = source._debugOwner;
            target._debugNeedsRemount = source._debugNeedsRemount;
            target._debugHookTypes = source._debugHookTypes;
            return target;
          }
          function FiberRootNode(containerInfo, tag, hydrate2, identifierPrefix, onRecoverableError) {
            this.tag = tag;
            this.containerInfo = containerInfo;
            this.pendingChildren = null;
            this.current = null;
            this.pingCache = null;
            this.finishedWork = null;
            this.timeoutHandle = noTimeout;
            this.context = null;
            this.pendingContext = null;
            this.callbackNode = null;
            this.callbackPriority = NoLane;
            this.eventTimes = createLaneMap(NoLanes);
            this.expirationTimes = createLaneMap(NoTimestamp);
            this.pendingLanes = NoLanes;
            this.suspendedLanes = NoLanes;
            this.pingedLanes = NoLanes;
            this.expiredLanes = NoLanes;
            this.mutableReadLanes = NoLanes;
            this.finishedLanes = NoLanes;
            this.entangledLanes = NoLanes;
            this.entanglements = createLaneMap(NoLanes);
            this.identifierPrefix = identifierPrefix;
            this.onRecoverableError = onRecoverableError;
            {
              this.mutableSourceEagerHydrationData = null;
            }
            {
              this.effectDuration = 0;
              this.passiveEffectDuration = 0;
            }
            {
              this.memoizedUpdaters = /* @__PURE__ */ new Set();
              var pendingUpdatersLaneMap = this.pendingUpdatersLaneMap = [];
              for (var _i = 0; _i < TotalLanes; _i++) {
                pendingUpdatersLaneMap.push(/* @__PURE__ */ new Set());
              }
            }
            {
              switch (tag) {
                case ConcurrentRoot:
                  this._debugRootType = hydrate2 ? "hydrateRoot()" : "createRoot()";
                  break;
                case LegacyRoot:
                  this._debugRootType = hydrate2 ? "hydrate()" : "render()";
                  break;
              }
            }
          }
          function createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
            var root2 = new FiberRootNode(containerInfo, tag, hydrate2, identifierPrefix, onRecoverableError);
            var uninitializedFiber = createHostRootFiber(tag, isStrictMode);
            root2.current = uninitializedFiber;
            uninitializedFiber.stateNode = root2;
            {
              var _initialState = {
                element: initialChildren,
                isDehydrated: hydrate2,
                cache: null,
                // not enabled yet
                transitions: null,
                pendingSuspenseBoundaries: null
              };
              uninitializedFiber.memoizedState = _initialState;
            }
            initializeUpdateQueue(uninitializedFiber);
            return root2;
          }
          var ReactVersion = "18.3.1";
          function createPortal4(children, containerInfo, implementation) {
            var key = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
            {
              checkKeyStringCoercion(key);
            }
            return {
              // This tag allow us to uniquely identify this as a React Portal
              $$typeof: REACT_PORTAL_TYPE,
              key: key == null ? null : "" + key,
              children,
              containerInfo,
              implementation
            };
          }
          var didWarnAboutNestedUpdates;
          var didWarnAboutFindNodeInStrictMode;
          {
            didWarnAboutNestedUpdates = false;
            didWarnAboutFindNodeInStrictMode = {};
          }
          function getContextForSubtree(parentComponent) {
            if (!parentComponent) {
              return emptyContextObject;
            }
            var fiber = get(parentComponent);
            var parentContext = findCurrentUnmaskedContext(fiber);
            if (fiber.tag === ClassComponent) {
              var Component40 = fiber.type;
              if (isContextProvider(Component40)) {
                return processChildContext(fiber, Component40, parentContext);
              }
            }
            return parentContext;
          }
          function findHostInstanceWithWarning(component, methodName) {
            {
              var fiber = get(component);
              if (fiber === void 0) {
                if (typeof component.render === "function") {
                  throw new Error("Unable to find node on an unmounted component.");
                } else {
                  var keys = Object.keys(component).join(",");
                  throw new Error("Argument appears to not be a ReactComponent. Keys: " + keys);
                }
              }
              var hostFiber = findCurrentHostFiber(fiber);
              if (hostFiber === null) {
                return null;
              }
              if (hostFiber.mode & StrictLegacyMode) {
                var componentName = getComponentNameFromFiber(fiber) || "Component";
                if (!didWarnAboutFindNodeInStrictMode[componentName]) {
                  didWarnAboutFindNodeInStrictMode[componentName] = true;
                  var previousFiber = current;
                  try {
                    setCurrentFiber(hostFiber);
                    if (fiber.mode & StrictLegacyMode) {
                      error("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", methodName, methodName, componentName);
                    } else {
                      error("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", methodName, methodName, componentName);
                    }
                  } finally {
                    if (previousFiber) {
                      setCurrentFiber(previousFiber);
                    } else {
                      resetCurrentFiber();
                    }
                  }
                }
              }
              return hostFiber.stateNode;
            }
          }
          function createContainer(containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
            var hydrate2 = false;
            var initialChildren = null;
            return createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
          }
          function createHydrationContainer(initialChildren, callback, containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
            var hydrate2 = true;
            var root2 = createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
            root2.context = getContextForSubtree(null);
            var current2 = root2.current;
            var eventTime = requestEventTime();
            var lane = requestUpdateLane(current2);
            var update = createUpdate(eventTime, lane);
            update.callback = callback !== void 0 && callback !== null ? callback : null;
            enqueueUpdate(current2, update, lane);
            scheduleInitialHydrationOnRoot(root2, lane, eventTime);
            return root2;
          }
          function updateContainer(element, container, parentComponent, callback) {
            {
              onScheduleRoot(container, element);
            }
            var current$1 = container.current;
            var eventTime = requestEventTime();
            var lane = requestUpdateLane(current$1);
            {
              markRenderScheduled(lane);
            }
            var context = getContextForSubtree(parentComponent);
            if (container.context === null) {
              container.context = context;
            } else {
              container.pendingContext = context;
            }
            {
              if (isRendering && current !== null && !didWarnAboutNestedUpdates) {
                didWarnAboutNestedUpdates = true;
                error("Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s.", getComponentNameFromFiber(current) || "Unknown");
              }
            }
            var update = createUpdate(eventTime, lane);
            update.payload = {
              element
            };
            callback = callback === void 0 ? null : callback;
            if (callback !== null) {
              {
                if (typeof callback !== "function") {
                  error("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callback);
                }
              }
              update.callback = callback;
            }
            var root2 = enqueueUpdate(current$1, update, lane);
            if (root2 !== null) {
              scheduleUpdateOnFiber(root2, current$1, lane, eventTime);
              entangleTransitions(root2, current$1, lane);
            }
            return lane;
          }
          function getPublicRootInstance(container) {
            var containerFiber = container.current;
            if (!containerFiber.child) {
              return null;
            }
            switch (containerFiber.child.tag) {
              case HostComponent:
                return getPublicInstance(containerFiber.child.stateNode);
              default:
                return containerFiber.child.stateNode;
            }
          }
          function attemptSynchronousHydration$1(fiber) {
            switch (fiber.tag) {
              case HostRoot: {
                var root2 = fiber.stateNode;
                if (isRootDehydrated(root2)) {
                  var lanes = getHighestPriorityPendingLanes(root2);
                  flushRoot(root2, lanes);
                }
                break;
              }
              case SuspenseComponent: {
                flushSync(function() {
                  var root3 = enqueueConcurrentRenderForLane(fiber, SyncLane);
                  if (root3 !== null) {
                    var eventTime = requestEventTime();
                    scheduleUpdateOnFiber(root3, fiber, SyncLane, eventTime);
                  }
                });
                var retryLane = SyncLane;
                markRetryLaneIfNotHydrated(fiber, retryLane);
                break;
              }
            }
          }
          function markRetryLaneImpl(fiber, retryLane) {
            var suspenseState = fiber.memoizedState;
            if (suspenseState !== null && suspenseState.dehydrated !== null) {
              suspenseState.retryLane = higherPriorityLane(suspenseState.retryLane, retryLane);
            }
          }
          function markRetryLaneIfNotHydrated(fiber, retryLane) {
            markRetryLaneImpl(fiber, retryLane);
            var alternate = fiber.alternate;
            if (alternate) {
              markRetryLaneImpl(alternate, retryLane);
            }
          }
          function attemptContinuousHydration$1(fiber) {
            if (fiber.tag !== SuspenseComponent) {
              return;
            }
            var lane = SelectiveHydrationLane;
            var root2 = enqueueConcurrentRenderForLane(fiber, lane);
            if (root2 !== null) {
              var eventTime = requestEventTime();
              scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
            }
            markRetryLaneIfNotHydrated(fiber, lane);
          }
          function attemptHydrationAtCurrentPriority$1(fiber) {
            if (fiber.tag !== SuspenseComponent) {
              return;
            }
            var lane = requestUpdateLane(fiber);
            var root2 = enqueueConcurrentRenderForLane(fiber, lane);
            if (root2 !== null) {
              var eventTime = requestEventTime();
              scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
            }
            markRetryLaneIfNotHydrated(fiber, lane);
          }
          function findHostInstanceWithNoPortals(fiber) {
            var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
            if (hostFiber === null) {
              return null;
            }
            return hostFiber.stateNode;
          }
          var shouldErrorImpl = function(fiber) {
            return null;
          };
          function shouldError(fiber) {
            return shouldErrorImpl(fiber);
          }
          var shouldSuspendImpl = function(fiber) {
            return false;
          };
          function shouldSuspend(fiber) {
            return shouldSuspendImpl(fiber);
          }
          var overrideHookState = null;
          var overrideHookStateDeletePath = null;
          var overrideHookStateRenamePath = null;
          var overrideProps = null;
          var overridePropsDeletePath = null;
          var overridePropsRenamePath = null;
          var scheduleUpdate = null;
          var setErrorHandler = null;
          var setSuspenseHandler = null;
          {
            var copyWithDeleteImpl = function(obj, path2, index2) {
              var key = path2[index2];
              var updated = isArray(obj) ? obj.slice() : assign({}, obj);
              if (index2 + 1 === path2.length) {
                if (isArray(updated)) {
                  updated.splice(key, 1);
                } else {
                  delete updated[key];
                }
                return updated;
              }
              updated[key] = copyWithDeleteImpl(obj[key], path2, index2 + 1);
              return updated;
            };
            var copyWithDelete = function(obj, path2) {
              return copyWithDeleteImpl(obj, path2, 0);
            };
            var copyWithRenameImpl = function(obj, oldPath, newPath, index2) {
              var oldKey = oldPath[index2];
              var updated = isArray(obj) ? obj.slice() : assign({}, obj);
              if (index2 + 1 === oldPath.length) {
                var newKey = newPath[index2];
                updated[newKey] = updated[oldKey];
                if (isArray(updated)) {
                  updated.splice(oldKey, 1);
                } else {
                  delete updated[oldKey];
                }
              } else {
                updated[oldKey] = copyWithRenameImpl(
                  // $FlowFixMe number or string is fine here
                  obj[oldKey],
                  oldPath,
                  newPath,
                  index2 + 1
                );
              }
              return updated;
            };
            var copyWithRename = function(obj, oldPath, newPath) {
              if (oldPath.length !== newPath.length) {
                warn2("copyWithRename() expects paths of the same length");
                return;
              } else {
                for (var i = 0; i < newPath.length - 1; i++) {
                  if (oldPath[i] !== newPath[i]) {
                    warn2("copyWithRename() expects paths to be the same except for the deepest key");
                    return;
                  }
                }
              }
              return copyWithRenameImpl(obj, oldPath, newPath, 0);
            };
            var copyWithSetImpl = function(obj, path2, index2, value) {
              if (index2 >= path2.length) {
                return value;
              }
              var key = path2[index2];
              var updated = isArray(obj) ? obj.slice() : assign({}, obj);
              updated[key] = copyWithSetImpl(obj[key], path2, index2 + 1, value);
              return updated;
            };
            var copyWithSet = function(obj, path2, value) {
              return copyWithSetImpl(obj, path2, 0, value);
            };
            var findHook = function(fiber, id) {
              var currentHook2 = fiber.memoizedState;
              while (currentHook2 !== null && id > 0) {
                currentHook2 = currentHook2.next;
                id--;
              }
              return currentHook2;
            };
            overrideHookState = function(fiber, id, path2, value) {
              var hook = findHook(fiber, id);
              if (hook !== null) {
                var newState = copyWithSet(hook.memoizedState, path2, value);
                hook.memoizedState = newState;
                hook.baseState = newState;
                fiber.memoizedProps = assign({}, fiber.memoizedProps);
                var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
                if (root2 !== null) {
                  scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
                }
              }
            };
            overrideHookStateDeletePath = function(fiber, id, path2) {
              var hook = findHook(fiber, id);
              if (hook !== null) {
                var newState = copyWithDelete(hook.memoizedState, path2);
                hook.memoizedState = newState;
                hook.baseState = newState;
                fiber.memoizedProps = assign({}, fiber.memoizedProps);
                var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
                if (root2 !== null) {
                  scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
                }
              }
            };
            overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) {
              var hook = findHook(fiber, id);
              if (hook !== null) {
                var newState = copyWithRename(hook.memoizedState, oldPath, newPath);
                hook.memoizedState = newState;
                hook.baseState = newState;
                fiber.memoizedProps = assign({}, fiber.memoizedProps);
                var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
                if (root2 !== null) {
                  scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
                }
              }
            };
            overrideProps = function(fiber, path2, value) {
              fiber.pendingProps = copyWithSet(fiber.memoizedProps, path2, value);
              if (fiber.alternate) {
                fiber.alternate.pendingProps = fiber.pendingProps;
              }
              var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
              if (root2 !== null) {
                scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
              }
            };
            overridePropsDeletePath = function(fiber, path2) {
              fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path2);
              if (fiber.alternate) {
                fiber.alternate.pendingProps = fiber.pendingProps;
              }
              var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
              if (root2 !== null) {
                scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
              }
            };
            overridePropsRenamePath = function(fiber, oldPath, newPath) {
              fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath);
              if (fiber.alternate) {
                fiber.alternate.pendingProps = fiber.pendingProps;
              }
              var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
              if (root2 !== null) {
                scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
              }
            };
            scheduleUpdate = function(fiber) {
              var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
              if (root2 !== null) {
                scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
              }
            };
            setErrorHandler = function(newShouldErrorImpl) {
              shouldErrorImpl = newShouldErrorImpl;
            };
            setSuspenseHandler = function(newShouldSuspendImpl) {
              shouldSuspendImpl = newShouldSuspendImpl;
            };
          }
          function findHostInstanceByFiber(fiber) {
            var hostFiber = findCurrentHostFiber(fiber);
            if (hostFiber === null) {
              return null;
            }
            return hostFiber.stateNode;
          }
          function emptyFindFiberByHostInstance(instance) {
            return null;
          }
          function getCurrentFiberForDevTools() {
            return current;
          }
          function injectIntoDevTools(devToolsConfig) {
            var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
            var ReactCurrentDispatcher2 = ReactSharedInternals.ReactCurrentDispatcher;
            return injectInternals({
              bundleType: devToolsConfig.bundleType,
              version: devToolsConfig.version,
              rendererPackageName: devToolsConfig.rendererPackageName,
              rendererConfig: devToolsConfig.rendererConfig,
              overrideHookState,
              overrideHookStateDeletePath,
              overrideHookStateRenamePath,
              overrideProps,
              overridePropsDeletePath,
              overridePropsRenamePath,
              setErrorHandler,
              setSuspenseHandler,
              scheduleUpdate,
              currentDispatcherRef: ReactCurrentDispatcher2,
              findHostInstanceByFiber,
              findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance,
              // React Refresh
              findHostInstancesForRefresh,
              scheduleRefresh,
              scheduleRoot,
              setRefreshHandler,
              // Enables DevTools to append owner stacks to error messages in DEV mode.
              getCurrentFiber: getCurrentFiberForDevTools,
              // Enables DevTools to detect reconciler version rather than renderer version
              // which may not match for third party renderers.
              reconcilerVersion: ReactVersion
            });
          }
          var defaultOnRecoverableError = typeof reportError === "function" ? (
            // In modern browsers, reportError will dispatch an error event,
            // emulating an uncaught JavaScript error.
            reportError
          ) : function(error2) {
            console["error"](error2);
          };
          function ReactDOMRoot(internalRoot) {
            this._internalRoot = internalRoot;
          }
          ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function(children) {
            var root2 = this._internalRoot;
            if (root2 === null) {
              throw new Error("Cannot update an unmounted root.");
            }
            {
              if (typeof arguments[1] === "function") {
                error("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
              } else if (isValidContainer(arguments[1])) {
                error("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root.");
              } else if (typeof arguments[1] !== "undefined") {
                error("You passed a second argument to root.render(...) but it only accepts one argument.");
              }
              var container = root2.containerInfo;
              if (container.nodeType !== COMMENT_NODE) {
                var hostInstance = findHostInstanceWithNoPortals(root2.current);
                if (hostInstance) {
                  if (hostInstance.parentNode !== container) {
                    error("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container.");
                  }
                }
              }
            }
            updateContainer(children, root2, null, null);
          };
          ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function() {
            {
              if (typeof arguments[0] === "function") {
                error("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
              }
            }
            var root2 = this._internalRoot;
            if (root2 !== null) {
              this._internalRoot = null;
              var container = root2.containerInfo;
              {
                if (isAlreadyRendering()) {
                  error("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition.");
                }
              }
              flushSync(function() {
                updateContainer(null, root2, null, null);
              });
              unmarkContainerAsRoot(container);
            }
          };
          function createRoot(container, options6) {
            if (!isValidContainer(container)) {
              throw new Error("createRoot(...): Target container is not a DOM element.");
            }
            warnIfReactDOMContainerInDEV(container);
            var isStrictMode = false;
            var concurrentUpdatesByDefaultOverride = false;
            var identifierPrefix = "";
            var onRecoverableError = defaultOnRecoverableError;
            var transitionCallbacks = null;
            if (options6 !== null && options6 !== void 0) {
              {
                if (options6.hydrate) {
                  warn2("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead.");
                } else {
                  if (typeof options6 === "object" && options6 !== null && options6.$$typeof === REACT_ELEMENT_TYPE) {
                    error("You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:\n\n  let root = createRoot(domContainer);\n  root.render(<App />);");
                  }
                }
              }
              if (options6.unstable_strictMode === true) {
                isStrictMode = true;
              }
              if (options6.identifierPrefix !== void 0) {
                identifierPrefix = options6.identifierPrefix;
              }
              if (options6.onRecoverableError !== void 0) {
                onRecoverableError = options6.onRecoverableError;
              }
              if (options6.transitionCallbacks !== void 0) {
                transitionCallbacks = options6.transitionCallbacks;
              }
            }
            var root2 = createContainer(container, ConcurrentRoot, null, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
            markContainerAsRoot(root2.current, container);
            var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
            listenToAllSupportedEvents(rootContainerElement);
            return new ReactDOMRoot(root2);
          }
          function ReactDOMHydrationRoot(internalRoot) {
            this._internalRoot = internalRoot;
          }
          function scheduleHydration(target) {
            if (target) {
              queueExplicitHydrationTarget(target);
            }
          }
          ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = scheduleHydration;
          function hydrateRoot(container, initialChildren, options6) {
            if (!isValidContainer(container)) {
              throw new Error("hydrateRoot(...): Target container is not a DOM element.");
            }
            warnIfReactDOMContainerInDEV(container);
            {
              if (initialChildren === void 0) {
                error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");
              }
            }
            var hydrationCallbacks = options6 != null ? options6 : null;
            var mutableSources = options6 != null && options6.hydratedSources || null;
            var isStrictMode = false;
            var concurrentUpdatesByDefaultOverride = false;
            var identifierPrefix = "";
            var onRecoverableError = defaultOnRecoverableError;
            if (options6 !== null && options6 !== void 0) {
              if (options6.unstable_strictMode === true) {
                isStrictMode = true;
              }
              if (options6.identifierPrefix !== void 0) {
                identifierPrefix = options6.identifierPrefix;
              }
              if (options6.onRecoverableError !== void 0) {
                onRecoverableError = options6.onRecoverableError;
              }
            }
            var root2 = createHydrationContainer(initialChildren, null, container, ConcurrentRoot, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
            markContainerAsRoot(root2.current, container);
            listenToAllSupportedEvents(container);
            if (mutableSources) {
              for (var i = 0; i < mutableSources.length; i++) {
                var mutableSource = mutableSources[i];
                registerMutableSourceForHydration(root2, mutableSource);
              }
            }
            return new ReactDOMHydrationRoot(root2);
          }
          function isValidContainer(node) {
            return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || !disableCommentsAsDOMContainers));
          }
          function isValidContainerLegacy(node) {
            return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === " react-mount-point-unstable "));
          }
          function warnIfReactDOMContainerInDEV(container) {
            {
              if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === "BODY") {
                error("createRoot(): Creating roots directly with document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try using a container element created for your app.");
              }
              if (isContainerMarkedAsRoot(container)) {
                if (container._reactRootContainer) {
                  error("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported.");
                } else {
                  error("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it.");
                }
              }
            }
          }
          var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
          var topLevelUpdateWarnings;
          {
            topLevelUpdateWarnings = function(container) {
              if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
                var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer.current);
                if (hostInstance) {
                  if (hostInstance.parentNode !== container) {
                    error("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.");
                  }
                }
              }
              var isRootRenderedBySomeReact = !!container._reactRootContainer;
              var rootEl = getReactRootElementInContainer(container);
              var hasNonRootReactChild = !!(rootEl && getInstanceFromNode(rootEl));
              if (hasNonRootReactChild && !isRootRenderedBySomeReact) {
                error("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render.");
              }
              if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === "BODY") {
                error("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.");
              }
            };
          }
          function getReactRootElementInContainer(container) {
            if (!container) {
              return null;
            }
            if (container.nodeType === DOCUMENT_NODE) {
              return container.documentElement;
            } else {
              return container.firstChild;
            }
          }
          function noopOnRecoverableError() {
          }
          function legacyCreateRootFromDOMContainer(container, initialChildren, parentComponent, callback, isHydrationContainer) {
            if (isHydrationContainer) {
              if (typeof callback === "function") {
                var originalCallback = callback;
                callback = function() {
                  var instance = getPublicRootInstance(root2);
                  originalCallback.call(instance);
                };
              }
              var root2 = createHydrationContainer(
                initialChildren,
                callback,
                container,
                LegacyRoot,
                null,
                // hydrationCallbacks
                false,
                // isStrictMode
                false,
                // concurrentUpdatesByDefaultOverride,
                "",
                // identifierPrefix
                noopOnRecoverableError
              );
              container._reactRootContainer = root2;
              markContainerAsRoot(root2.current, container);
              var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
              listenToAllSupportedEvents(rootContainerElement);
              flushSync();
              return root2;
            } else {
              var rootSibling;
              while (rootSibling = container.lastChild) {
                container.removeChild(rootSibling);
              }
              if (typeof callback === "function") {
                var _originalCallback = callback;
                callback = function() {
                  var instance = getPublicRootInstance(_root);
                  _originalCallback.call(instance);
                };
              }
              var _root = createContainer(
                container,
                LegacyRoot,
                null,
                // hydrationCallbacks
                false,
                // isStrictMode
                false,
                // concurrentUpdatesByDefaultOverride,
                "",
                // identifierPrefix
                noopOnRecoverableError
              );
              container._reactRootContainer = _root;
              markContainerAsRoot(_root.current, container);
              var _rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
              listenToAllSupportedEvents(_rootContainerElement);
              flushSync(function() {
                updateContainer(initialChildren, _root, parentComponent, callback);
              });
              return _root;
            }
          }
          function warnOnInvalidCallback$1(callback, callerName) {
            {
              if (callback !== null && typeof callback !== "function") {
                error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback);
              }
            }
          }
          function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
            {
              topLevelUpdateWarnings(container);
              warnOnInvalidCallback$1(callback === void 0 ? null : callback, "render");
            }
            var maybeRoot = container._reactRootContainer;
            var root2;
            if (!maybeRoot) {
              root2 = legacyCreateRootFromDOMContainer(container, children, parentComponent, callback, forceHydrate);
            } else {
              root2 = maybeRoot;
              if (typeof callback === "function") {
                var originalCallback = callback;
                callback = function() {
                  var instance = getPublicRootInstance(root2);
                  originalCallback.call(instance);
                };
              }
              updateContainer(children, root2, parentComponent, callback);
            }
            return getPublicRootInstance(root2);
          }
          var didWarnAboutFindDOMNode = false;
          function findDOMNode3(componentOrElement) {
            {
              if (!didWarnAboutFindDOMNode) {
                didWarnAboutFindDOMNode = true;
                error("findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node");
              }
              var owner = ReactCurrentOwner$3.current;
              if (owner !== null && owner.stateNode !== null) {
                var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;
                if (!warnedAboutRefsInRender) {
                  error("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", getComponentNameFromType(owner.type) || "A component");
                }
                owner.stateNode._warnedAboutRefsInRender = true;
              }
            }
            if (componentOrElement == null) {
              return null;
            }
            if (componentOrElement.nodeType === ELEMENT_NODE) {
              return componentOrElement;
            }
            {
              return findHostInstanceWithWarning(componentOrElement, "findDOMNode");
            }
          }
          function hydrate(element, container, callback) {
            {
              error("ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot");
            }
            if (!isValidContainerLegacy(container)) {
              throw new Error("Target container is not a DOM element.");
            }
            {
              var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
              if (isModernRoot) {
                error("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?");
              }
            }
            return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
          }
          function render(element, container, callback) {
            {
              error("ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot");
            }
            if (!isValidContainerLegacy(container)) {
              throw new Error("Target container is not a DOM element.");
            }
            {
              var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
              if (isModernRoot) {
                error("You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?");
              }
            }
            return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
          }
          function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
            {
              error("ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot");
            }
            if (!isValidContainerLegacy(containerNode)) {
              throw new Error("Target container is not a DOM element.");
            }
            if (parentComponent == null || !has(parentComponent)) {
              throw new Error("parentComponent must be a valid React Component");
            }
            return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
          }
          var didWarnAboutUnmountComponentAtNode = false;
          function unmountComponentAtNode(container) {
            {
              if (!didWarnAboutUnmountComponentAtNode) {
                didWarnAboutUnmountComponentAtNode = true;
                error("unmountComponentAtNode is deprecated and will be removed in the next major release. Switch to the createRoot API. Learn more: https://reactjs.org/link/switch-to-createroot");
              }
            }
            if (!isValidContainerLegacy(container)) {
              throw new Error("unmountComponentAtNode(...): Target container is not a DOM element.");
            }
            {
              var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
              if (isModernRoot) {
                error("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?");
              }
            }
            if (container._reactRootContainer) {
              {
                var rootEl = getReactRootElementInContainer(container);
                var renderedByDifferentReact = rootEl && !getInstanceFromNode(rootEl);
                if (renderedByDifferentReact) {
                  error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.");
                }
              }
              flushSync(function() {
                legacyRenderSubtreeIntoContainer(null, null, container, false, function() {
                  container._reactRootContainer = null;
                  unmarkContainerAsRoot(container);
                });
              });
              return true;
            } else {
              {
                var _rootEl = getReactRootElementInContainer(container);
                var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode(_rootEl));
                var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainerLegacy(container.parentNode) && !!container.parentNode._reactRootContainer;
                if (hasNonRootReactChild) {
                  error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s", isContainerReactRoot ? "You may have accidentally passed in a React root node instead of its container." : "Instead, have the parent component update its state and rerender in order to remove this component.");
                }
              }
              return false;
            }
          }
          setAttemptSynchronousHydration(attemptSynchronousHydration$1);
          setAttemptContinuousHydration(attemptContinuousHydration$1);
          setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);
          setGetCurrentUpdatePriority(getCurrentUpdatePriority);
          setAttemptHydrationAtPriority(runWithPriority);
          {
            if (typeof Map !== "function" || // $FlowIssue Flow incorrectly thinks Map has no prototype
            Map.prototype == null || typeof Map.prototype.forEach !== "function" || typeof Set !== "function" || // $FlowIssue Flow incorrectly thinks Set has no prototype
            Set.prototype == null || typeof Set.prototype.clear !== "function" || typeof Set.prototype.forEach !== "function") {
              error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
            }
          }
          setRestoreImplementation(restoreControlledState$3);
          setBatchingImplementation(batchedUpdates$1, discreteUpdates, flushSync);
          function createPortal$1(children, container) {
            var key = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
            if (!isValidContainer(container)) {
              throw new Error("Target container is not a DOM element.");
            }
            return createPortal4(children, container, null, key);
          }
          function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
            return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);
          }
          var Internals = {
            usingClientEntryPoint: false,
            // Keep in sync with ReactTestUtils.js.
            // This is an array for better minification.
            Events: [getInstanceFromNode, getNodeFromInstance, getFiberCurrentPropsFromNode, enqueueStateRestore, restoreStateIfNeeded, batchedUpdates$1]
          };
          function createRoot$1(container, options6) {
            {
              if (!Internals.usingClientEntryPoint && true) {
                error('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');
              }
            }
            return createRoot(container, options6);
          }
          function hydrateRoot$1(container, initialChildren, options6) {
            {
              if (!Internals.usingClientEntryPoint && true) {
                error('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');
              }
            }
            return hydrateRoot(container, initialChildren, options6);
          }
          function flushSync$1(fn) {
            {
              if (isAlreadyRendering()) {
                error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.");
              }
            }
            return flushSync(fn);
          }
          var foundDevTools = injectIntoDevTools({
            findFiberByHostInstance: getClosestInstanceFromNode,
            bundleType: 1,
            version: ReactVersion,
            rendererPackageName: "react-dom"
          });
          {
            if (!foundDevTools && canUseDOM3 && window.top === window.self) {
              if (navigator.userAgent.indexOf("Chrome") > -1 && navigator.userAgent.indexOf("Edge") === -1 || navigator.userAgent.indexOf("Firefox") > -1) {
                var protocol = window.location.protocol;
                if (/^(https?|file):$/.test(protocol)) {
                  console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools" + (protocol === "file:" ? "\nYou might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq" : ""), "font-weight:bold");
                }
              }
            }
          }
          exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
          exports.createPortal = createPortal$1;
          exports.createRoot = createRoot$1;
          exports.findDOMNode = findDOMNode3;
          exports.flushSync = flushSync$1;
          exports.hydrate = hydrate;
          exports.hydrateRoot = hydrateRoot$1;
          exports.render = render;
          exports.unmountComponentAtNode = unmountComponentAtNode;
          exports.unstable_batchedUpdates = batchedUpdates$1;
          exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;
          exports.version = ReactVersion;
          if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
            __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
          }
        })();
      }
    }
  });

  // node_modules/react-dom/index.js
  var require_react_dom = __commonJS({
    "node_modules/react-dom/index.js"(exports, module) {
      "use strict";
      if (false) {
        checkDCE();
        module.exports = null;
      } else {
        module.exports = require_react_dom_development();
      }
    }
  });

  // node_modules/react-is/cjs/react-is.development.js
  var require_react_is_development = __commonJS({
    "node_modules/react-is/cjs/react-is.development.js"(exports) {
      "use strict";
      if (true) {
        (function() {
          "use strict";
          var hasSymbol = typeof Symbol === "function" && Symbol.for;
          var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
          var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
          var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
          var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
          var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
          var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
          var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
          var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
          var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
          var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
          var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
          var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
          var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
          var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
          var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
          var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
          var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
          var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
          function isValidElementType(type) {
            return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
            type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
          }
          function typeOf(object) {
            if (typeof object === "object" && object !== null) {
              var $$typeof = object.$$typeof;
              switch ($$typeof) {
                case REACT_ELEMENT_TYPE:
                  var type = object.type;
                  switch (type) {
                    case REACT_ASYNC_MODE_TYPE:
                    case REACT_CONCURRENT_MODE_TYPE:
                    case REACT_FRAGMENT_TYPE:
                    case REACT_PROFILER_TYPE:
                    case REACT_STRICT_MODE_TYPE:
                    case REACT_SUSPENSE_TYPE:
                      return type;
                    default:
                      var $$typeofType = type && type.$$typeof;
                      switch ($$typeofType) {
                        case REACT_CONTEXT_TYPE:
                        case REACT_FORWARD_REF_TYPE:
                        case REACT_LAZY_TYPE:
                        case REACT_MEMO_TYPE:
                        case REACT_PROVIDER_TYPE:
                          return $$typeofType;
                        default:
                          return $$typeof;
                      }
                  }
                case REACT_PORTAL_TYPE:
                  return $$typeof;
              }
            }
            return void 0;
          }
          var AsyncMode = REACT_ASYNC_MODE_TYPE;
          var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
          var ContextConsumer = REACT_CONTEXT_TYPE;
          var ContextProvider = REACT_PROVIDER_TYPE;
          var Element2 = REACT_ELEMENT_TYPE;
          var ForwardRef = REACT_FORWARD_REF_TYPE;
          var Fragment67 = REACT_FRAGMENT_TYPE;
          var Lazy = REACT_LAZY_TYPE;
          var Memo = REACT_MEMO_TYPE;
          var Portal2 = REACT_PORTAL_TYPE;
          var Profiler = REACT_PROFILER_TYPE;
          var StrictMode = REACT_STRICT_MODE_TYPE;
          var Suspense = REACT_SUSPENSE_TYPE;
          var hasWarnedAboutDeprecatedIsAsyncMode = false;
          function isAsyncMode(object) {
            {
              if (!hasWarnedAboutDeprecatedIsAsyncMode) {
                hasWarnedAboutDeprecatedIsAsyncMode = true;
                console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
              }
            }
            return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
          }
          function isConcurrentMode(object) {
            return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
          }
          function isContextConsumer(object) {
            return typeOf(object) === REACT_CONTEXT_TYPE;
          }
          function isContextProvider(object) {
            return typeOf(object) === REACT_PROVIDER_TYPE;
          }
          function isElement2(object) {
            return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
          }
          function isForwardRef(object) {
            return typeOf(object) === REACT_FORWARD_REF_TYPE;
          }
          function isFragment(object) {
            return typeOf(object) === REACT_FRAGMENT_TYPE;
          }
          function isLazy(object) {
            return typeOf(object) === REACT_LAZY_TYPE;
          }
          function isMemo(object) {
            return typeOf(object) === REACT_MEMO_TYPE;
          }
          function isPortal(object) {
            return typeOf(object) === REACT_PORTAL_TYPE;
          }
          function isProfiler(object) {
            return typeOf(object) === REACT_PROFILER_TYPE;
          }
          function isStrictMode(object) {
            return typeOf(object) === REACT_STRICT_MODE_TYPE;
          }
          function isSuspense(object) {
            return typeOf(object) === REACT_SUSPENSE_TYPE;
          }
          exports.AsyncMode = AsyncMode;
          exports.ConcurrentMode = ConcurrentMode;
          exports.ContextConsumer = ContextConsumer;
          exports.ContextProvider = ContextProvider;
          exports.Element = Element2;
          exports.ForwardRef = ForwardRef;
          exports.Fragment = Fragment67;
          exports.Lazy = Lazy;
          exports.Memo = Memo;
          exports.Portal = Portal2;
          exports.Profiler = Profiler;
          exports.StrictMode = StrictMode;
          exports.Suspense = Suspense;
          exports.isAsyncMode = isAsyncMode;
          exports.isConcurrentMode = isConcurrentMode;
          exports.isContextConsumer = isContextConsumer;
          exports.isContextProvider = isContextProvider;
          exports.isElement = isElement2;
          exports.isForwardRef = isForwardRef;
          exports.isFragment = isFragment;
          exports.isLazy = isLazy;
          exports.isMemo = isMemo;
          exports.isPortal = isPortal;
          exports.isProfiler = isProfiler;
          exports.isStrictMode = isStrictMode;
          exports.isSuspense = isSuspense;
          exports.isValidElementType = isValidElementType;
          exports.typeOf = typeOf;
        })();
      }
    }
  });

  // node_modules/react-is/index.js
  var require_react_is = __commonJS({
    "node_modules/react-is/index.js"(exports, module) {
      "use strict";
      if (false) {
        module.exports = null;
      } else {
        module.exports = require_react_is_development();
      }
    }
  });

  // node_modules/object-assign/index.js
  var require_object_assign = __commonJS({
    "node_modules/object-assign/index.js"(exports, module) {
      "use strict";
      var getOwnPropertySymbols = Object.getOwnPropertySymbols;
      var hasOwnProperty = Object.prototype.hasOwnProperty;
      var propIsEnumerable = Object.prototype.propertyIsEnumerable;
      function toObject(val) {
        if (val === null || val === void 0) {
          throw new TypeError("Object.assign cannot be called with null or undefined");
        }
        return Object(val);
      }
      function shouldUseNative() {
        try {
          if (!Object.assign) {
            return false;
          }
          var test1 = new String("abc");
          test1[5] = "de";
          if (Object.getOwnPropertyNames(test1)[0] === "5") {
            return false;
          }
          var test2 = {};
          for (var i = 0; i < 10; i++) {
            test2["_" + String.fromCharCode(i)] = i;
          }
          var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
            return test2[n];
          });
          if (order2.join("") !== "0123456789") {
            return false;
          }
          var test3 = {};
          "abcdefghijklmnopqrst".split("").forEach(function(letter) {
            test3[letter] = letter;
          });
          if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
            return false;
          }
          return true;
        } catch (err) {
          return false;
        }
      }
      module.exports = shouldUseNative() ? Object.assign : function(target, source) {
        var from;
        var to = toObject(target);
        var symbols;
        for (var s2 = 1; s2 < arguments.length; s2++) {
          from = Object(arguments[s2]);
          for (var key in from) {
            if (hasOwnProperty.call(from, key)) {
              to[key] = from[key];
            }
          }
          if (getOwnPropertySymbols) {
            symbols = getOwnPropertySymbols(from);
            for (var i = 0; i < symbols.length; i++) {
              if (propIsEnumerable.call(from, symbols[i])) {
                to[symbols[i]] = from[symbols[i]];
              }
            }
          }
        }
        return to;
      };
    }
  });

  // node_modules/prop-types/lib/ReactPropTypesSecret.js
  var require_ReactPropTypesSecret = __commonJS({
    "node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) {
      "use strict";
      var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
      module.exports = ReactPropTypesSecret;
    }
  });

  // node_modules/prop-types/lib/has.js
  var require_has = __commonJS({
    "node_modules/prop-types/lib/has.js"(exports, module) {
      module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
    }
  });

  // node_modules/prop-types/checkPropTypes.js
  var require_checkPropTypes = __commonJS({
    "node_modules/prop-types/checkPropTypes.js"(exports, module) {
      "use strict";
      var printWarning = function() {
      };
      if (true) {
        ReactPropTypesSecret = require_ReactPropTypesSecret();
        loggedTypeFailures = {};
        has = require_has();
        printWarning = function(text) {
          var message = "Warning: " + text;
          if (typeof console !== "undefined") {
            console.error(message);
          }
          try {
            throw new Error(message);
          } catch (x2) {
          }
        };
      }
      var ReactPropTypesSecret;
      var loggedTypeFailures;
      var has;
      function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
        if (true) {
          for (var typeSpecName in typeSpecs) {
            if (has(typeSpecs, typeSpecName)) {
              var error;
              try {
                if (typeof typeSpecs[typeSpecName] !== "function") {
                  var err = Error(
                    (componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
                  );
                  err.name = "Invariant Violation";
                  throw err;
                }
                error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
              } catch (ex) {
                error = ex;
              }
              if (error && !(error instanceof Error)) {
                printWarning(
                  (componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
                );
              }
              if (error instanceof Error && !(error.message in loggedTypeFailures)) {
                loggedTypeFailures[error.message] = true;
                var stack = getStack ? getStack() : "";
                printWarning(
                  "Failed " + location + " type: " + error.message + (stack != null ? stack : "")
                );
              }
            }
          }
        }
      }
      checkPropTypes.resetWarningCache = function() {
        if (true) {
          loggedTypeFailures = {};
        }
      };
      module.exports = checkPropTypes;
    }
  });

  // node_modules/prop-types/factoryWithTypeCheckers.js
  var require_factoryWithTypeCheckers = __commonJS({
    "node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) {
      "use strict";
      var ReactIs = require_react_is();
      var assign = require_object_assign();
      var ReactPropTypesSecret = require_ReactPropTypesSecret();
      var has = require_has();
      var checkPropTypes = require_checkPropTypes();
      var printWarning = function() {
      };
      if (true) {
        printWarning = function(text) {
          var message = "Warning: " + text;
          if (typeof console !== "undefined") {
            console.error(message);
          }
          try {
            throw new Error(message);
          } catch (x2) {
          }
        };
      }
      function emptyFunctionThatReturnsNull() {
        return null;
      }
      module.exports = function(isValidElement14, throwOnDirectAccess) {
        var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
        var FAUX_ITERATOR_SYMBOL = "@@iterator";
        function getIteratorFn(maybeIterable) {
          var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
          if (typeof iteratorFn === "function") {
            return iteratorFn;
          }
        }
        var ANONYMOUS = "<<anonymous>>";
        var ReactPropTypes = {
          array: createPrimitiveTypeChecker("array"),
          bigint: createPrimitiveTypeChecker("bigint"),
          bool: createPrimitiveTypeChecker("boolean"),
          func: createPrimitiveTypeChecker("function"),
          number: createPrimitiveTypeChecker("number"),
          object: createPrimitiveTypeChecker("object"),
          string: createPrimitiveTypeChecker("string"),
          symbol: createPrimitiveTypeChecker("symbol"),
          any: createAnyTypeChecker(),
          arrayOf: createArrayOfTypeChecker,
          element: createElementTypeChecker(),
          elementType: createElementTypeTypeChecker(),
          instanceOf: createInstanceTypeChecker,
          node: createNodeChecker(),
          objectOf: createObjectOfTypeChecker,
          oneOf: createEnumTypeChecker,
          oneOfType: createUnionTypeChecker,
          shape: createShapeTypeChecker,
          exact: createStrictShapeTypeChecker
        };
        function is(x2, y2) {
          if (x2 === y2) {
            return x2 !== 0 || 1 / x2 === 1 / y2;
          } else {
            return x2 !== x2 && y2 !== y2;
          }
        }
        function PropTypeError(message, data) {
          this.message = message;
          this.data = data && typeof data === "object" ? data : {};
          this.stack = "";
        }
        PropTypeError.prototype = Error.prototype;
        function createChainableTypeChecker(validate) {
          if (true) {
            var manualPropTypeCallCache = {};
            var manualPropTypeWarningCount = 0;
          }
          function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
            componentName = componentName || ANONYMOUS;
            propFullName = propFullName || propName;
            if (secret !== ReactPropTypesSecret) {
              if (throwOnDirectAccess) {
                var err = new Error(
                  "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
                );
                err.name = "Invariant Violation";
                throw err;
              } else if (typeof console !== "undefined") {
                var cacheKey = componentName + ":" + propName;
                if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
                manualPropTypeWarningCount < 3) {
                  printWarning(
                    "You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
                  );
                  manualPropTypeCallCache[cacheKey] = true;
                  manualPropTypeWarningCount++;
                }
              }
            }
            if (props[propName] == null) {
              if (isRequired) {
                if (props[propName] === null) {
                  return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
                }
                return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
              }
              return null;
            } else {
              return validate(props, propName, componentName, location, propFullName);
            }
          }
          var chainedCheckType = checkType.bind(null, false);
          chainedCheckType.isRequired = checkType.bind(null, true);
          return chainedCheckType;
        }
        function createPrimitiveTypeChecker(expectedType) {
          function validate(props, propName, componentName, location, propFullName, secret) {
            var propValue = props[propName];
            var propType = getPropType(propValue);
            if (propType !== expectedType) {
              var preciseType = getPreciseType(propValue);
              return new PropTypeError(
                "Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
                { expectedType }
              );
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function createAnyTypeChecker() {
          return createChainableTypeChecker(emptyFunctionThatReturnsNull);
        }
        function createArrayOfTypeChecker(typeChecker) {
          function validate(props, propName, componentName, location, propFullName) {
            if (typeof typeChecker !== "function") {
              return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
            }
            var propValue = props[propName];
            if (!Array.isArray(propValue)) {
              var propType = getPropType(propValue);
              return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
            }
            for (var i = 0; i < propValue.length; i++) {
              var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
              if (error instanceof Error) {
                return error;
              }
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function createElementTypeChecker() {
          function validate(props, propName, componentName, location, propFullName) {
            var propValue = props[propName];
            if (!isValidElement14(propValue)) {
              var propType = getPropType(propValue);
              return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function createElementTypeTypeChecker() {
          function validate(props, propName, componentName, location, propFullName) {
            var propValue = props[propName];
            if (!ReactIs.isValidElementType(propValue)) {
              var propType = getPropType(propValue);
              return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function createInstanceTypeChecker(expectedClass) {
          function validate(props, propName, componentName, location, propFullName) {
            if (!(props[propName] instanceof expectedClass)) {
              var expectedClassName = expectedClass.name || ANONYMOUS;
              var actualClassName = getClassName2(props[propName]);
              return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function createEnumTypeChecker(expectedValues) {
          if (!Array.isArray(expectedValues)) {
            if (true) {
              if (arguments.length > 1) {
                printWarning(
                  "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
                );
              } else {
                printWarning("Invalid argument supplied to oneOf, expected an array.");
              }
            }
            return emptyFunctionThatReturnsNull;
          }
          function validate(props, propName, componentName, location, propFullName) {
            var propValue = props[propName];
            for (var i = 0; i < expectedValues.length; i++) {
              if (is(propValue, expectedValues[i])) {
                return null;
              }
            }
            var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
              var type = getPreciseType(value);
              if (type === "symbol") {
                return String(value);
              }
              return value;
            });
            return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
          }
          return createChainableTypeChecker(validate);
        }
        function createObjectOfTypeChecker(typeChecker) {
          function validate(props, propName, componentName, location, propFullName) {
            if (typeof typeChecker !== "function") {
              return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
            }
            var propValue = props[propName];
            var propType = getPropType(propValue);
            if (propType !== "object") {
              return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
            }
            for (var key in propValue) {
              if (has(propValue, key)) {
                var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
                if (error instanceof Error) {
                  return error;
                }
              }
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function createUnionTypeChecker(arrayOfTypeCheckers) {
          if (!Array.isArray(arrayOfTypeCheckers)) {
            true ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
            return emptyFunctionThatReturnsNull;
          }
          for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
            var checker = arrayOfTypeCheckers[i];
            if (typeof checker !== "function") {
              printWarning(
                "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
              );
              return emptyFunctionThatReturnsNull;
            }
          }
          function validate(props, propName, componentName, location, propFullName) {
            var expectedTypes = [];
            for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
              var checker2 = arrayOfTypeCheckers[i2];
              var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
              if (checkerResult == null) {
                return null;
              }
              if (checkerResult.data && has(checkerResult.data, "expectedType")) {
                expectedTypes.push(checkerResult.data.expectedType);
              }
            }
            var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
            return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
          }
          return createChainableTypeChecker(validate);
        }
        function createNodeChecker() {
          function validate(props, propName, componentName, location, propFullName) {
            if (!isNode(props[propName])) {
              return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function invalidValidatorError(componentName, location, propFullName, key, type) {
          return new PropTypeError(
            (componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
          );
        }
        function createShapeTypeChecker(shapeTypes) {
          function validate(props, propName, componentName, location, propFullName) {
            var propValue = props[propName];
            var propType = getPropType(propValue);
            if (propType !== "object") {
              return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
            }
            for (var key in shapeTypes) {
              var checker = shapeTypes[key];
              if (typeof checker !== "function") {
                return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
              }
              var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
              if (error) {
                return error;
              }
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function createStrictShapeTypeChecker(shapeTypes) {
          function validate(props, propName, componentName, location, propFullName) {
            var propValue = props[propName];
            var propType = getPropType(propValue);
            if (propType !== "object") {
              return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
            }
            var allKeys = assign({}, props[propName], shapeTypes);
            for (var key in allKeys) {
              var checker = shapeTypes[key];
              if (has(shapeTypes, key) && typeof checker !== "function") {
                return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
              }
              if (!checker) {
                return new PropTypeError(
                  "Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, "  ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, "  ")
                );
              }
              var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
              if (error) {
                return error;
              }
            }
            return null;
          }
          return createChainableTypeChecker(validate);
        }
        function isNode(propValue) {
          switch (typeof propValue) {
            case "number":
            case "string":
            case "undefined":
              return true;
            case "boolean":
              return !propValue;
            case "object":
              if (Array.isArray(propValue)) {
                return propValue.every(isNode);
              }
              if (propValue === null || isValidElement14(propValue)) {
                return true;
              }
              var iteratorFn = getIteratorFn(propValue);
              if (iteratorFn) {
                var iterator = iteratorFn.call(propValue);
                var step;
                if (iteratorFn !== propValue.entries) {
                  while (!(step = iterator.next()).done) {
                    if (!isNode(step.value)) {
                      return false;
                    }
                  }
                } else {
                  while (!(step = iterator.next()).done) {
                    var entry = step.value;
                    if (entry) {
                      if (!isNode(entry[1])) {
                        return false;
                      }
                    }
                  }
                }
              } else {
                return false;
              }
              return true;
            default:
              return false;
          }
        }
        function isSymbol(propType, propValue) {
          if (propType === "symbol") {
            return true;
          }
          if (!propValue) {
            return false;
          }
          if (propValue["@@toStringTag"] === "Symbol") {
            return true;
          }
          if (typeof Symbol === "function" && propValue instanceof Symbol) {
            return true;
          }
          return false;
        }
        function getPropType(propValue) {
          var propType = typeof propValue;
          if (Array.isArray(propValue)) {
            return "array";
          }
          if (propValue instanceof RegExp) {
            return "object";
          }
          if (isSymbol(propType, propValue)) {
            return "symbol";
          }
          return propType;
        }
        function getPreciseType(propValue) {
          if (typeof propValue === "undefined" || propValue === null) {
            return "" + propValue;
          }
          var propType = getPropType(propValue);
          if (propType === "object") {
            if (propValue instanceof Date) {
              return "date";
            } else if (propValue instanceof RegExp) {
              return "regexp";
            }
          }
          return propType;
        }
        function getPostfixForTypeWarning(value) {
          var type = getPreciseType(value);
          switch (type) {
            case "array":
            case "object":
              return "an " + type;
            case "boolean":
            case "date":
            case "regexp":
              return "a " + type;
            default:
              return type;
          }
        }
        function getClassName2(propValue) {
          if (!propValue.constructor || !propValue.constructor.name) {
            return ANONYMOUS;
          }
          return propValue.constructor.name;
        }
        ReactPropTypes.checkPropTypes = checkPropTypes;
        ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
        ReactPropTypes.PropTypes = ReactPropTypes;
        return ReactPropTypes;
      };
    }
  });

  // node_modules/prop-types/index.js
  var require_prop_types = __commonJS({
    "node_modules/prop-types/index.js"(exports, module) {
      if (true) {
        ReactIs = require_react_is();
        throwOnDirectAccess = true;
        module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
      } else {
        module.exports = null();
      }
      var ReactIs;
      var throwOnDirectAccess;
    }
  });

  // node_modules/tslib/tslib.es6.mjs
  var tslib_es6_exports = {};
  __export(tslib_es6_exports, {
    __addDisposableResource: () => __addDisposableResource,
    __assign: () => __assign,
    __asyncDelegator: () => __asyncDelegator,
    __asyncGenerator: () => __asyncGenerator,
    __asyncValues: () => __asyncValues,
    __await: () => __await,
    __awaiter: () => __awaiter,
    __classPrivateFieldGet: () => __classPrivateFieldGet,
    __classPrivateFieldIn: () => __classPrivateFieldIn,
    __classPrivateFieldSet: () => __classPrivateFieldSet,
    __createBinding: () => __createBinding,
    __decorate: () => __decorate,
    __disposeResources: () => __disposeResources,
    __esDecorate: () => __esDecorate,
    __exportStar: () => __exportStar,
    __extends: () => __extends,
    __generator: () => __generator,
    __importDefault: () => __importDefault,
    __importStar: () => __importStar,
    __makeTemplateObject: () => __makeTemplateObject,
    __metadata: () => __metadata,
    __param: () => __param,
    __propKey: () => __propKey,
    __read: () => __read,
    __rest: () => __rest,
    __rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension,
    __runInitializers: () => __runInitializers,
    __setFunctionName: () => __setFunctionName,
    __spread: () => __spread,
    __spreadArray: () => __spreadArray,
    __spreadArrays: () => __spreadArrays,
    __values: () => __values,
    default: () => tslib_es6_default
  });
  function __extends(d, b) {
    if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  }
  function __rest(s2, e) {
    var t = {};
    for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p) && e.indexOf(p) < 0)
      t[p] = s2[p];
    if (s2 != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p = Object.getOwnPropertySymbols(s2); i < p.length; i++) {
        if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p[i]))
          t[p[i]] = s2[p[i]];
      }
    return t;
  }
  function __decorate(decorators, target, key, desc) {
    var c2 = arguments.length, r = c2 < 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 = (c2 < 3 ? d(r) : c2 > 3 ? d(target, key, r) : d(target, key)) || r;
    return c2 > 3 && r && Object.defineProperty(target, key, r), r;
  }
  function __param(paramIndex, decorator) {
    return function(target, key) {
      decorator(target, key, paramIndex);
    };
  }
  function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
    function accept(f) {
      if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
      return f;
    }
    var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
    var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
    var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
    var _113, done = false;
    for (var i = decorators.length - 1; i >= 0; i--) {
      var context = {};
      for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
      for (var p in contextIn.access) context.access[p] = contextIn.access[p];
      context.addInitializer = function(f) {
        if (done) throw new TypeError("Cannot add initializers after decoration has completed");
        extraInitializers.push(accept(f || null));
      };
      var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
      if (kind === "accessor") {
        if (result === void 0) continue;
        if (result === null || typeof result !== "object") throw new TypeError("Object expected");
        if (_113 = accept(result.get)) descriptor.get = _113;
        if (_113 = accept(result.set)) descriptor.set = _113;
        if (_113 = accept(result.init)) initializers.unshift(_113);
      } else if (_113 = accept(result)) {
        if (kind === "field") initializers.unshift(_113);
        else descriptor[key] = _113;
      }
    }
    if (target) Object.defineProperty(target, contextIn.name, descriptor);
    done = true;
  }
  function __runInitializers(thisArg, initializers, value) {
    var useValue = arguments.length > 2;
    for (var i = 0; i < initializers.length; i++) {
      value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
    }
    return useValue ? value : void 0;
  }
  function __propKey(x2) {
    return typeof x2 === "symbol" ? x2 : "".concat(x2);
  }
  function __setFunctionName(f, name2, prefix) {
    if (typeof name2 === "symbol") name2 = name2.description ? "[".concat(name2.description, "]") : "";
    return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name2) : name2 });
  }
  function __metadata(metadataKey, metadataValue) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  }
  function __awaiter(thisArg, _arguments, P, generator) {
    function adopt(value) {
      return value instanceof P ? value : new P(function(resolve) {
        resolve(value);
      });
    }
    return new (P || (P = Promise))(function(resolve, reject) {
      function fulfilled(value) {
        try {
          step(generator.next(value));
        } catch (e) {
          reject(e);
        }
      }
      function rejected(value) {
        try {
          step(generator["throw"](value));
        } catch (e) {
          reject(e);
        }
      }
      function step(result) {
        result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
      }
      step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
  }
  function __generator(thisArg, body) {
    var _113 = { label: 0, sent: function() {
      if (t[0] & 1) throw t[1];
      return t[1];
    }, trys: [], ops: [] }, f, y2, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
    return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
      return this;
    }), g;
    function verb(n) {
      return function(v) {
        return step([n, v]);
      };
    }
    function step(op) {
      if (f) throw new TypeError("Generator is already executing.");
      while (g && (g = 0, op[0] && (_113 = 0)), _113) try {
        if (f = 1, y2 && (t = op[0] & 2 ? y2["return"] : op[0] ? y2["throw"] || ((t = y2["return"]) && t.call(y2), 0) : y2.next) && !(t = t.call(y2, op[1])).done) return t;
        if (y2 = 0, t) op = [op[0] & 2, t.value];
        switch (op[0]) {
          case 0:
          case 1:
            t = op;
            break;
          case 4:
            _113.label++;
            return { value: op[1], done: false };
          case 5:
            _113.label++;
            y2 = op[1];
            op = [0];
            continue;
          case 7:
            op = _113.ops.pop();
            _113.trys.pop();
            continue;
          default:
            if (!(t = _113.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
              _113 = 0;
              continue;
            }
            if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
              _113.label = op[1];
              break;
            }
            if (op[0] === 6 && _113.label < t[1]) {
              _113.label = t[1];
              t = op;
              break;
            }
            if (t && _113.label < t[2]) {
              _113.label = t[2];
              _113.ops.push(op);
              break;
            }
            if (t[2]) _113.ops.pop();
            _113.trys.pop();
            continue;
        }
        op = body.call(thisArg, _113);
      } catch (e) {
        op = [6, e];
        y2 = 0;
      } finally {
        f = t = 0;
      }
      if (op[0] & 5) throw op[1];
      return { value: op[0] ? op[1] : void 0, done: true };
    }
  }
  function __exportStar(m, o) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
  }
  function __values(o) {
    var s2 = typeof Symbol === "function" && Symbol.iterator, m = s2 && o[s2], i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
      next: function() {
        if (o && i >= o.length) o = void 0;
        return { value: o && o[i++], done: !o };
      }
    };
    throw new TypeError(s2 ? "Object is not iterable." : "Symbol.iterator is not defined.");
  }
  function __read(o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
      while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    } catch (error) {
      e = { error };
    } finally {
      try {
        if (r && !r.done && (m = i["return"])) m.call(i);
      } finally {
        if (e) throw e.error;
      }
    }
    return ar;
  }
  function __spread() {
    for (var ar = [], i = 0; i < arguments.length; i++)
      ar = ar.concat(__read(arguments[i]));
    return ar;
  }
  function __spreadArrays() {
    for (var s2 = 0, i = 0, il = arguments.length; i < il; i++) s2 += arguments[i].length;
    for (var r = Array(s2), k2 = 0, i = 0; i < il; i++)
      for (var a2 = arguments[i], j = 0, jl = a2.length; j < jl; j++, k2++)
        r[k2] = a2[j];
    return r;
  }
  function __spreadArray(to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
      if (ar || !(i in from)) {
        if (!ar) ar = Array.prototype.slice.call(from, 0, i);
        ar[i] = from[i];
      }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
  }
  function __await(v) {
    return this instanceof __await ? (this.v = v, this) : new __await(v);
  }
  function __asyncGenerator(thisArg, _arguments, generator) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var g = generator.apply(thisArg, _arguments || []), i, q = [];
    return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
      return this;
    }, i;
    function awaitReturn(f) {
      return function(v) {
        return Promise.resolve(v).then(f, reject);
      };
    }
    function verb(n, f) {
      if (g[n]) {
        i[n] = function(v) {
          return new Promise(function(a2, b) {
            q.push([n, v, a2, b]) > 1 || resume(n, v);
          });
        };
        if (f) i[n] = f(i[n]);
      }
    }
    function resume(n, v) {
      try {
        step(g[n](v));
      } catch (e) {
        settle(q[0][3], e);
      }
    }
    function step(r) {
      r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
    }
    function fulfill(value) {
      resume("next", value);
    }
    function reject(value) {
      resume("throw", value);
    }
    function settle(f, v) {
      if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
    }
  }
  function __asyncDelegator(o) {
    var i, p;
    return i = {}, verb("next"), verb("throw", function(e) {
      throw e;
    }), verb("return"), i[Symbol.iterator] = function() {
      return this;
    }, i;
    function verb(n, f) {
      i[n] = o[n] ? function(v) {
        return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v;
      } : f;
    }
  }
  function __asyncValues(o) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var m = o[Symbol.asyncIterator], i;
    return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
      return this;
    }, i);
    function verb(n) {
      i[n] = o[n] && function(v) {
        return new Promise(function(resolve, reject) {
          v = o[n](v), settle(resolve, reject, v.done, v.value);
        });
      };
    }
    function settle(resolve, reject, d, v) {
      Promise.resolve(v).then(function(v2) {
        resolve({ value: v2, done: d });
      }, reject);
    }
  }
  function __makeTemplateObject(cooked, raw) {
    if (Object.defineProperty) {
      Object.defineProperty(cooked, "raw", { value: raw });
    } else {
      cooked.raw = raw;
    }
    return cooked;
  }
  function __importStar(mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) {
      for (var k2 = ownKeys(mod), i = 0; i < k2.length; i++) if (k2[i] !== "default") __createBinding(result, mod, k2[i]);
    }
    __setModuleDefault(result, mod);
    return result;
  }
  function __importDefault(mod) {
    return mod && mod.__esModule ? mod : { default: mod };
  }
  function __classPrivateFieldGet(receiver, state, kind, f) {
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
  }
  function __classPrivateFieldSet(receiver, state, value, kind, f) {
    if (kind === "m") throw new TypeError("Private method is not writable");
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
    return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
  }
  function __classPrivateFieldIn(state, receiver) {
    if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object");
    return typeof state === "function" ? receiver === state : state.has(receiver);
  }
  function __addDisposableResource(env, value, async) {
    if (value !== null && value !== void 0) {
      if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
      var dispose, inner;
      if (async) {
        if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
        dispose = value[Symbol.asyncDispose];
      }
      if (dispose === void 0) {
        if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
        dispose = value[Symbol.dispose];
        if (async) inner = dispose;
      }
      if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
      if (inner) dispose = function() {
        try {
          inner.call(this);
        } catch (e) {
          return Promise.reject(e);
        }
      };
      env.stack.push({ value, dispose, async });
    } else if (async) {
      env.stack.push({ async: true });
    }
    return value;
  }
  function __disposeResources(env) {
    function fail(e) {
      env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
      env.hasError = true;
    }
    var r, s2 = 0;
    function next() {
      while (r = env.stack.pop()) {
        try {
          if (!r.async && s2 === 1) return s2 = 0, env.stack.push(r), Promise.resolve().then(next);
          if (r.dispose) {
            var result = r.dispose.call(r.value);
            if (r.async) return s2 |= 2, Promise.resolve(result).then(next, function(e) {
              fail(e);
              return next();
            });
          } else s2 |= 1;
        } catch (e) {
          fail(e);
        }
      }
      if (s2 === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
      if (env.hasError) throw env.error;
    }
    return next();
  }
  function __rewriteRelativeImportExtension(path2, preserveJsx) {
    if (typeof path2 === "string" && /^\.\.?\//.test(path2)) {
      return path2.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
        return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
      });
    }
    return path2;
  }
  var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
  var init_tslib_es6 = __esm({
    "node_modules/tslib/tslib.es6.mjs"() {
      extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b10) {
          d2.__proto__ = b10;
        } || function(d2, b10) {
          for (var p in b10) if (Object.prototype.hasOwnProperty.call(b10, p)) d2[p] = b10[p];
        };
        return extendStatics(d, b);
      };
      __assign = function() {
        __assign = Object.assign || function __assign2(t) {
          for (var s2, i = 1, n = arguments.length; i < n; i++) {
            s2 = arguments[i];
            for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p)) t[p] = s2[p];
          }
          return t;
        };
        return __assign.apply(this, arguments);
      };
      __createBinding = Object.create ? function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        var desc = Object.getOwnPropertyDescriptor(m, k2);
        if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
          desc = { enumerable: true, get: function() {
            return m[k2];
          } };
        }
        Object.defineProperty(o, k22, desc);
      } : function(o, m, k2, k22) {
        if (k22 === void 0) k22 = k2;
        o[k22] = m[k2];
      };
      __setModuleDefault = Object.create ? function(o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
      } : function(o, v) {
        o["default"] = v;
      };
      ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function(o2) {
          var ar = [];
          for (var k2 in o2) if (Object.prototype.hasOwnProperty.call(o2, k2)) ar[ar.length] = k2;
          return ar;
        };
        return ownKeys(o);
      };
      _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
        var e = new Error(message);
        return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
      };
      tslib_es6_default = {
        __extends,
        __assign,
        __rest,
        __decorate,
        __param,
        __esDecorate,
        __runInitializers,
        __propKey,
        __setFunctionName,
        __metadata,
        __awaiter,
        __generator,
        __createBinding,
        __exportStar,
        __values,
        __read,
        __spread,
        __spreadArrays,
        __spreadArray,
        __await,
        __asyncGenerator,
        __asyncDelegator,
        __asyncValues,
        __makeTemplateObject,
        __importStar,
        __importDefault,
        __classPrivateFieldGet,
        __classPrivateFieldSet,
        __classPrivateFieldIn,
        __addDisposableResource,
        __disposeResources,
        __rewriteRelativeImportExtension
      };
    }
  });

  // node_modules/attr-accept/dist/es/index.js
  var require_es = __commonJS({
    "node_modules/attr-accept/dist/es/index.js"(exports) {
      "use strict";
      exports.__esModule = true;
      exports.default = function(file, acceptedFiles) {
        if (file && acceptedFiles) {
          var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(",");
          if (acceptedFilesArray.length === 0) {
            return true;
          }
          var fileName = file.name || "";
          var mimeType = (file.type || "").toLowerCase();
          var baseMimeType = mimeType.replace(/\/.*$/, "");
          return acceptedFilesArray.some(function(type) {
            var validType = type.trim().toLowerCase();
            if (validType.charAt(0) === ".") {
              return fileName.toLowerCase().endsWith(validType);
            } else if (validType.endsWith("/*")) {
              return baseMimeType === validType.replace(/\/.*$/, "");
            }
            return mimeType === validType;
          });
        }
        return true;
      };
    }
  });

  // node_modules/react/cjs/react-jsx-runtime.development.js
  var require_react_jsx_runtime_development = __commonJS({
    "node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
      "use strict";
      if (true) {
        (function() {
          "use strict";
          var React422 = require_react();
          var REACT_ELEMENT_TYPE = Symbol.for("react.element");
          var REACT_PORTAL_TYPE = Symbol.for("react.portal");
          var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
          var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
          var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
          var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
          var REACT_CONTEXT_TYPE = Symbol.for("react.context");
          var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
          var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
          var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
          var REACT_MEMO_TYPE = Symbol.for("react.memo");
          var REACT_LAZY_TYPE = Symbol.for("react.lazy");
          var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
          var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
          var FAUX_ITERATOR_SYMBOL = "@@iterator";
          function getIteratorFn(maybeIterable) {
            if (maybeIterable === null || typeof maybeIterable !== "object") {
              return null;
            }
            var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
            if (typeof maybeIterator === "function") {
              return maybeIterator;
            }
            return null;
          }
          var ReactSharedInternals = React422.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
          function error(format2) {
            {
              {
                for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
                  args[_key2 - 1] = arguments[_key2];
                }
                printWarning("error", format2, args);
              }
            }
          }
          function printWarning(level, format2, args) {
            {
              var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
              var stack = ReactDebugCurrentFrame2.getStackAddendum();
              if (stack !== "") {
                format2 += "%s";
                args = args.concat([stack]);
              }
              var argsWithFormat = args.map(function(item) {
                return String(item);
              });
              argsWithFormat.unshift("Warning: " + format2);
              Function.prototype.apply.call(console[level], console, argsWithFormat);
            }
          }
          var enableScopeAPI = false;
          var enableCacheElement = false;
          var enableTransitionTracing = false;
          var enableLegacyHidden = false;
          var enableDebugTracing = false;
          var REACT_MODULE_REFERENCE;
          {
            REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
          }
          function isValidElementType(type) {
            if (typeof type === "string" || typeof type === "function") {
              return true;
            }
            if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
              return true;
            }
            if (typeof type === "object" && type !== null) {
              if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
              // types supported by any Flight configuration anywhere since
              // we don't know which Flight build this will end up being used
              // with.
              type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
                return true;
              }
            }
            return false;
          }
          function getWrappedName(outerType, innerType, wrapperName) {
            var displayName = outerType.displayName;
            if (displayName) {
              return displayName;
            }
            var functionName = innerType.displayName || innerType.name || "";
            return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
          }
          function getContextName(type) {
            return type.displayName || "Context";
          }
          function getComponentNameFromType(type) {
            if (type == null) {
              return null;
            }
            {
              if (typeof type.tag === "number") {
                error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
              }
            }
            if (typeof type === "function") {
              return type.displayName || type.name || null;
            }
            if (typeof type === "string") {
              return type;
            }
            switch (type) {
              case REACT_FRAGMENT_TYPE:
                return "Fragment";
              case REACT_PORTAL_TYPE:
                return "Portal";
              case REACT_PROFILER_TYPE:
                return "Profiler";
              case REACT_STRICT_MODE_TYPE:
                return "StrictMode";
              case REACT_SUSPENSE_TYPE:
                return "Suspense";
              case REACT_SUSPENSE_LIST_TYPE:
                return "SuspenseList";
            }
            if (typeof type === "object") {
              switch (type.$$typeof) {
                case REACT_CONTEXT_TYPE:
                  var context = type;
                  return getContextName(context) + ".Consumer";
                case REACT_PROVIDER_TYPE:
                  var provider = type;
                  return getContextName(provider._context) + ".Provider";
                case REACT_FORWARD_REF_TYPE:
                  return getWrappedName(type, type.render, "ForwardRef");
                case REACT_MEMO_TYPE:
                  var outerName = type.displayName || null;
                  if (outerName !== null) {
                    return outerName;
                  }
                  return getComponentNameFromType(type.type) || "Memo";
                case REACT_LAZY_TYPE: {
                  var lazyComponent = type;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    return getComponentNameFromType(init(payload));
                  } catch (x2) {
                    return null;
                  }
                }
              }
            }
            return null;
          }
          var assign = Object.assign;
          var disabledDepth = 0;
          var prevLog;
          var prevInfo;
          var prevWarn;
          var prevError;
          var prevGroup;
          var prevGroupCollapsed;
          var prevGroupEnd;
          function disabledLog() {
          }
          disabledLog.__reactDisabledLog = true;
          function disableLogs() {
            {
              if (disabledDepth === 0) {
                prevLog = console.log;
                prevInfo = console.info;
                prevWarn = console.warn;
                prevError = console.error;
                prevGroup = console.group;
                prevGroupCollapsed = console.groupCollapsed;
                prevGroupEnd = console.groupEnd;
                var props = {
                  configurable: true,
                  enumerable: true,
                  value: disabledLog,
                  writable: true
                };
                Object.defineProperties(console, {
                  info: props,
                  log: props,
                  warn: props,
                  error: props,
                  group: props,
                  groupCollapsed: props,
                  groupEnd: props
                });
              }
              disabledDepth++;
            }
          }
          function reenableLogs() {
            {
              disabledDepth--;
              if (disabledDepth === 0) {
                var props = {
                  configurable: true,
                  enumerable: true,
                  writable: true
                };
                Object.defineProperties(console, {
                  log: assign({}, props, {
                    value: prevLog
                  }),
                  info: assign({}, props, {
                    value: prevInfo
                  }),
                  warn: assign({}, props, {
                    value: prevWarn
                  }),
                  error: assign({}, props, {
                    value: prevError
                  }),
                  group: assign({}, props, {
                    value: prevGroup
                  }),
                  groupCollapsed: assign({}, props, {
                    value: prevGroupCollapsed
                  }),
                  groupEnd: assign({}, props, {
                    value: prevGroupEnd
                  })
                });
              }
              if (disabledDepth < 0) {
                error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
              }
            }
          }
          var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
          var prefix;
          function describeBuiltInComponentFrame(name2, source, ownerFn) {
            {
              if (prefix === void 0) {
                try {
                  throw Error();
                } catch (x2) {
                  var match = x2.stack.trim().match(/\n( *(at )?)/);
                  prefix = match && match[1] || "";
                }
              }
              return "\n" + prefix + name2;
            }
          }
          var reentry = false;
          var componentFrameCache;
          {
            var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
            componentFrameCache = new PossiblyWeakMap();
          }
          function describeNativeComponentFrame(fn, construct) {
            if (!fn || reentry) {
              return "";
            }
            {
              var frame2 = componentFrameCache.get(fn);
              if (frame2 !== void 0) {
                return frame2;
              }
            }
            var control;
            reentry = true;
            var previousPrepareStackTrace = Error.prepareStackTrace;
            Error.prepareStackTrace = void 0;
            var previousDispatcher;
            {
              previousDispatcher = ReactCurrentDispatcher.current;
              ReactCurrentDispatcher.current = null;
              disableLogs();
            }
            try {
              if (construct) {
                var Fake = function() {
                  throw Error();
                };
                Object.defineProperty(Fake.prototype, "props", {
                  set: function() {
                    throw Error();
                  }
                });
                if (typeof Reflect === "object" && Reflect.construct) {
                  try {
                    Reflect.construct(Fake, []);
                  } catch (x2) {
                    control = x2;
                  }
                  Reflect.construct(fn, [], Fake);
                } else {
                  try {
                    Fake.call();
                  } catch (x2) {
                    control = x2;
                  }
                  fn.call(Fake.prototype);
                }
              } else {
                try {
                  throw Error();
                } catch (x2) {
                  control = x2;
                }
                fn();
              }
            } catch (sample) {
              if (sample && control && typeof sample.stack === "string") {
                var sampleLines = sample.stack.split("\n");
                var controlLines = control.stack.split("\n");
                var s2 = sampleLines.length - 1;
                var c2 = controlLines.length - 1;
                while (s2 >= 1 && c2 >= 0 && sampleLines[s2] !== controlLines[c2]) {
                  c2--;
                }
                for (; s2 >= 1 && c2 >= 0; s2--, c2--) {
                  if (sampleLines[s2] !== controlLines[c2]) {
                    if (s2 !== 1 || c2 !== 1) {
                      do {
                        s2--;
                        c2--;
                        if (c2 < 0 || sampleLines[s2] !== controlLines[c2]) {
                          var _frame = "\n" + sampleLines[s2].replace(" at new ", " at ");
                          if (fn.displayName && _frame.includes("<anonymous>")) {
                            _frame = _frame.replace("<anonymous>", fn.displayName);
                          }
                          {
                            if (typeof fn === "function") {
                              componentFrameCache.set(fn, _frame);
                            }
                          }
                          return _frame;
                        }
                      } while (s2 >= 1 && c2 >= 0);
                    }
                    break;
                  }
                }
              }
            } finally {
              reentry = false;
              {
                ReactCurrentDispatcher.current = previousDispatcher;
                reenableLogs();
              }
              Error.prepareStackTrace = previousPrepareStackTrace;
            }
            var name2 = fn ? fn.displayName || fn.name : "";
            var syntheticFrame = name2 ? describeBuiltInComponentFrame(name2) : "";
            {
              if (typeof fn === "function") {
                componentFrameCache.set(fn, syntheticFrame);
              }
            }
            return syntheticFrame;
          }
          function describeFunctionComponentFrame(fn, source, ownerFn) {
            {
              return describeNativeComponentFrame(fn, false);
            }
          }
          function shouldConstruct(Component40) {
            var prototype = Component40.prototype;
            return !!(prototype && prototype.isReactComponent);
          }
          function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
            if (type == null) {
              return "";
            }
            if (typeof type === "function") {
              {
                return describeNativeComponentFrame(type, shouldConstruct(type));
              }
            }
            if (typeof type === "string") {
              return describeBuiltInComponentFrame(type);
            }
            switch (type) {
              case REACT_SUSPENSE_TYPE:
                return describeBuiltInComponentFrame("Suspense");
              case REACT_SUSPENSE_LIST_TYPE:
                return describeBuiltInComponentFrame("SuspenseList");
            }
            if (typeof type === "object") {
              switch (type.$$typeof) {
                case REACT_FORWARD_REF_TYPE:
                  return describeFunctionComponentFrame(type.render);
                case REACT_MEMO_TYPE:
                  return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
                case REACT_LAZY_TYPE: {
                  var lazyComponent = type;
                  var payload = lazyComponent._payload;
                  var init = lazyComponent._init;
                  try {
                    return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
                  } catch (x2) {
                  }
                }
              }
            }
            return "";
          }
          var hasOwnProperty = Object.prototype.hasOwnProperty;
          var loggedTypeFailures = {};
          var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
          function setCurrentlyValidatingElement(element) {
            {
              if (element) {
                var owner = element._owner;
                var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
                ReactDebugCurrentFrame.setExtraStackFrame(stack);
              } else {
                ReactDebugCurrentFrame.setExtraStackFrame(null);
              }
            }
          }
          function checkPropTypes(typeSpecs, values, location, componentName, element) {
            {
              var has = Function.call.bind(hasOwnProperty);
              for (var typeSpecName in typeSpecs) {
                if (has(typeSpecs, typeSpecName)) {
                  var error$1 = void 0;
                  try {
                    if (typeof typeSpecs[typeSpecName] !== "function") {
                      var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                      err.name = "Invariant Violation";
                      throw err;
                    }
                    error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
                  } catch (ex) {
                    error$1 = ex;
                  }
                  if (error$1 && !(error$1 instanceof Error)) {
                    setCurrentlyValidatingElement(element);
                    error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
                    setCurrentlyValidatingElement(null);
                  }
                  if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
                    loggedTypeFailures[error$1.message] = true;
                    setCurrentlyValidatingElement(element);
                    error("Failed %s type: %s", location, error$1.message);
                    setCurrentlyValidatingElement(null);
                  }
                }
              }
            }
          }
          var isArrayImpl = Array.isArray;
          function isArray(a2) {
            return isArrayImpl(a2);
          }
          function typeName(value) {
            {
              var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
              var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
              return type;
            }
          }
          function willCoercionThrow(value) {
            {
              try {
                testStringCoercion(value);
                return false;
              } catch (e) {
                return true;
              }
            }
          }
          function testStringCoercion(value) {
            return "" + value;
          }
          function checkKeyStringCoercion(value) {
            {
              if (willCoercionThrow(value)) {
                error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
                return testStringCoercion(value);
              }
            }
          }
          var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
          var RESERVED_PROPS = {
            key: true,
            ref: true,
            __self: true,
            __source: true
          };
          var specialPropKeyWarningShown;
          var specialPropRefWarningShown;
          var didWarnAboutStringRefs;
          {
            didWarnAboutStringRefs = {};
          }
          function hasValidRef(config) {
            {
              if (hasOwnProperty.call(config, "ref")) {
                var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
                if (getter && getter.isReactWarning) {
                  return false;
                }
              }
            }
            return config.ref !== void 0;
          }
          function hasValidKey(config) {
            {
              if (hasOwnProperty.call(config, "key")) {
                var getter = Object.getOwnPropertyDescriptor(config, "key").get;
                if (getter && getter.isReactWarning) {
                  return false;
                }
              }
            }
            return config.key !== void 0;
          }
          function warnIfStringRefCannotBeAutoConverted(config, self2) {
            {
              if (typeof config.ref === "string" && ReactCurrentOwner.current && self2 && ReactCurrentOwner.current.stateNode !== self2) {
                var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
                if (!didWarnAboutStringRefs[componentName]) {
                  error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
                  didWarnAboutStringRefs[componentName] = true;
                }
              }
            }
          }
          function defineKeyPropWarningGetter(props, displayName) {
            {
              var warnAboutAccessingKey = function() {
                if (!specialPropKeyWarningShown) {
                  specialPropKeyWarningShown = true;
                  error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
                }
              };
              warnAboutAccessingKey.isReactWarning = true;
              Object.defineProperty(props, "key", {
                get: warnAboutAccessingKey,
                configurable: true
              });
            }
          }
          function defineRefPropWarningGetter(props, displayName) {
            {
              var warnAboutAccessingRef = function() {
                if (!specialPropRefWarningShown) {
                  specialPropRefWarningShown = true;
                  error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
                }
              };
              warnAboutAccessingRef.isReactWarning = true;
              Object.defineProperty(props, "ref", {
                get: warnAboutAccessingRef,
                configurable: true
              });
            }
          }
          var ReactElement = function(type, key, ref, self2, source, owner, props) {
            var element = {
              // This tag allows us to uniquely identify this as a React Element
              $$typeof: REACT_ELEMENT_TYPE,
              // Built-in properties that belong on the element
              type,
              key,
              ref,
              props,
              // Record the component responsible for creating this element.
              _owner: owner
            };
            {
              element._store = {};
              Object.defineProperty(element._store, "validated", {
                configurable: false,
                enumerable: false,
                writable: true,
                value: false
              });
              Object.defineProperty(element, "_self", {
                configurable: false,
                enumerable: false,
                writable: false,
                value: self2
              });
              Object.defineProperty(element, "_source", {
                configurable: false,
                enumerable: false,
                writable: false,
                value: source
              });
              if (Object.freeze) {
                Object.freeze(element.props);
                Object.freeze(element);
              }
            }
            return element;
          };
          function jsxDEV(type, config, maybeKey, source, self2) {
            {
              var propName;
              var props = {};
              var key = null;
              var ref = null;
              if (maybeKey !== void 0) {
                {
                  checkKeyStringCoercion(maybeKey);
                }
                key = "" + maybeKey;
              }
              if (hasValidKey(config)) {
                {
                  checkKeyStringCoercion(config.key);
                }
                key = "" + config.key;
              }
              if (hasValidRef(config)) {
                ref = config.ref;
                warnIfStringRefCannotBeAutoConverted(config, self2);
              }
              for (propName in config) {
                if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
                  props[propName] = config[propName];
                }
              }
              if (type && type.defaultProps) {
                var defaultProps15 = type.defaultProps;
                for (propName in defaultProps15) {
                  if (props[propName] === void 0) {
                    props[propName] = defaultProps15[propName];
                  }
                }
              }
              if (key || ref) {
                var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
                if (key) {
                  defineKeyPropWarningGetter(props, displayName);
                }
                if (ref) {
                  defineRefPropWarningGetter(props, displayName);
                }
              }
              return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props);
            }
          }
          var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
          var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
          function setCurrentlyValidatingElement$1(element) {
            {
              if (element) {
                var owner = element._owner;
                var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
                ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
              } else {
                ReactDebugCurrentFrame$1.setExtraStackFrame(null);
              }
            }
          }
          var propTypesMisspellWarningShown;
          {
            propTypesMisspellWarningShown = false;
          }
          function isValidElement14(object) {
            {
              return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
            }
          }
          function getDeclarationErrorAddendum() {
            {
              if (ReactCurrentOwner$1.current) {
                var name2 = getComponentNameFromType(ReactCurrentOwner$1.current.type);
                if (name2) {
                  return "\n\nCheck the render method of `" + name2 + "`.";
                }
              }
              return "";
            }
          }
          function getSourceInfoErrorAddendum(source) {
            {
              if (source !== void 0) {
                var fileName = source.fileName.replace(/^.*[\\\/]/, "");
                var lineNumber = source.lineNumber;
                return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
              }
              return "";
            }
          }
          var ownerHasKeyUseWarning = {};
          function getCurrentComponentErrorInfo(parentType) {
            {
              var info2 = getDeclarationErrorAddendum();
              if (!info2) {
                var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
                if (parentName) {
                  info2 = "\n\nCheck the top-level render call using <" + parentName + ">.";
                }
              }
              return info2;
            }
          }
          function validateExplicitKey(element, parentType) {
            {
              if (!element._store || element._store.validated || element.key != null) {
                return;
              }
              element._store.validated = true;
              var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
              if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
                return;
              }
              ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
              var childOwner = "";
              if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
                childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
              }
              setCurrentlyValidatingElement$1(element);
              error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
              setCurrentlyValidatingElement$1(null);
            }
          }
          function validateChildKeys(node, parentType) {
            {
              if (typeof node !== "object") {
                return;
              }
              if (isArray(node)) {
                for (var i = 0; i < node.length; i++) {
                  var child = node[i];
                  if (isValidElement14(child)) {
                    validateExplicitKey(child, parentType);
                  }
                }
              } else if (isValidElement14(node)) {
                if (node._store) {
                  node._store.validated = true;
                }
              } else if (node) {
                var iteratorFn = getIteratorFn(node);
                if (typeof iteratorFn === "function") {
                  if (iteratorFn !== node.entries) {
                    var iterator = iteratorFn.call(node);
                    var step;
                    while (!(step = iterator.next()).done) {
                      if (isValidElement14(step.value)) {
                        validateExplicitKey(step.value, parentType);
                      }
                    }
                  }
                }
              }
            }
          }
          function validatePropTypes(element) {
            {
              var type = element.type;
              if (type === null || type === void 0 || typeof type === "string") {
                return;
              }
              var propTypes;
              if (typeof type === "function") {
                propTypes = type.propTypes;
              } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
              // Inner props are checked in the reconciler.
              type.$$typeof === REACT_MEMO_TYPE)) {
                propTypes = type.propTypes;
              } else {
                return;
              }
              if (propTypes) {
                var name2 = getComponentNameFromType(type);
                checkPropTypes(propTypes, element.props, "prop", name2, element);
              } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
                propTypesMisspellWarningShown = true;
                var _name = getComponentNameFromType(type);
                error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
              }
              if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
                error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
              }
            }
          }
          function validateFragmentProps(fragment) {
            {
              var keys = Object.keys(fragment.props);
              for (var i = 0; i < keys.length; i++) {
                var key = keys[i];
                if (key !== "children" && key !== "key") {
                  setCurrentlyValidatingElement$1(fragment);
                  error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
                  setCurrentlyValidatingElement$1(null);
                  break;
                }
              }
              if (fragment.ref !== null) {
                setCurrentlyValidatingElement$1(fragment);
                error("Invalid attribute `ref` supplied to `React.Fragment`.");
                setCurrentlyValidatingElement$1(null);
              }
            }
          }
          var didWarnAboutKeySpread = {};
          function jsxWithValidation(type, props, key, isStaticChildren, source, self2) {
            {
              var validType = isValidElementType(type);
              if (!validType) {
                var info2 = "";
                if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
                  info2 += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
                }
                var sourceInfo = getSourceInfoErrorAddendum(source);
                if (sourceInfo) {
                  info2 += sourceInfo;
                } else {
                  info2 += getDeclarationErrorAddendum();
                }
                var typeString;
                if (type === null) {
                  typeString = "null";
                } else if (isArray(type)) {
                  typeString = "array";
                } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
                  typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
                  info2 = " Did you accidentally export a JSX literal instead of a component?";
                } else {
                  typeString = typeof type;
                }
                error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info2);
              }
              var element = jsxDEV(type, props, key, source, self2);
              if (element == null) {
                return element;
              }
              if (validType) {
                var children = props.children;
                if (children !== void 0) {
                  if (isStaticChildren) {
                    if (isArray(children)) {
                      for (var i = 0; i < children.length; i++) {
                        validateChildKeys(children[i], type);
                      }
                      if (Object.freeze) {
                        Object.freeze(children);
                      }
                    } else {
                      error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
                    }
                  } else {
                    validateChildKeys(children, type);
                  }
                }
              }
              {
                if (hasOwnProperty.call(props, "key")) {
                  var componentName = getComponentNameFromType(type);
                  var keys = Object.keys(props).filter(function(k2) {
                    return k2 !== "key";
                  });
                  var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
                  if (!didWarnAboutKeySpread[componentName + beforeExample]) {
                    var afterExample = keys.length > 0 ? "{" + keys.join(": ..., ") + ": ...}" : "{}";
                    error('A props object containing a "key" prop is being spread into JSX:\n  let props = %s;\n  <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n  let props = %s;\n  <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
                    didWarnAboutKeySpread[componentName + beforeExample] = true;
                  }
                }
              }
              if (type === REACT_FRAGMENT_TYPE) {
                validateFragmentProps(element);
              } else {
                validatePropTypes(element);
              }
              return element;
            }
          }
          function jsxWithValidationStatic(type, props, key) {
            {
              return jsxWithValidation(type, props, key, true);
            }
          }
          function jsxWithValidationDynamic(type, props, key) {
            {
              return jsxWithValidation(type, props, key, false);
            }
          }
          var jsx114 = jsxWithValidationDynamic;
          var jsxs111 = jsxWithValidationStatic;
          exports.Fragment = REACT_FRAGMENT_TYPE;
          exports.jsx = jsx114;
          exports.jsxs = jsxs111;
        })();
      }
    }
  });

  // node_modules/react/jsx-runtime.js
  var require_jsx_runtime = __commonJS({
    "node_modules/react/jsx-runtime.js"(exports, module) {
      "use strict";
      if (false) {
        module.exports = null;
      } else {
        module.exports = require_react_jsx_runtime_development();
      }
    }
  });

  // node_modules/lodash/_listCacheClear.js
  var require_listCacheClear = __commonJS({
    "node_modules/lodash/_listCacheClear.js"(exports, module) {
      function listCacheClear() {
        this.__data__ = [];
        this.size = 0;
      }
      module.exports = listCacheClear;
    }
  });

  // node_modules/lodash/eq.js
  var require_eq = __commonJS({
    "node_modules/lodash/eq.js"(exports, module) {
      function eq(value, other) {
        return value === other || value !== value && other !== other;
      }
      module.exports = eq;
    }
  });

  // node_modules/lodash/_assocIndexOf.js
  var require_assocIndexOf = __commonJS({
    "node_modules/lodash/_assocIndexOf.js"(exports, module) {
      var eq = require_eq();
      function assocIndexOf(array, key) {
        var length = array.length;
        while (length--) {
          if (eq(array[length][0], key)) {
            return length;
          }
        }
        return -1;
      }
      module.exports = assocIndexOf;
    }
  });

  // node_modules/lodash/_listCacheDelete.js
  var require_listCacheDelete = __commonJS({
    "node_modules/lodash/_listCacheDelete.js"(exports, module) {
      var assocIndexOf = require_assocIndexOf();
      var arrayProto = Array.prototype;
      var splice = arrayProto.splice;
      function listCacheDelete(key) {
        var data = this.__data__, index = assocIndexOf(data, key);
        if (index < 0) {
          return false;
        }
        var lastIndex = data.length - 1;
        if (index == lastIndex) {
          data.pop();
        } else {
          splice.call(data, index, 1);
        }
        --this.size;
        return true;
      }
      module.exports = listCacheDelete;
    }
  });

  // node_modules/lodash/_listCacheGet.js
  var require_listCacheGet = __commonJS({
    "node_modules/lodash/_listCacheGet.js"(exports, module) {
      var assocIndexOf = require_assocIndexOf();
      function listCacheGet(key) {
        var data = this.__data__, index = assocIndexOf(data, key);
        return index < 0 ? void 0 : data[index][1];
      }
      module.exports = listCacheGet;
    }
  });

  // node_modules/lodash/_listCacheHas.js
  var require_listCacheHas = __commonJS({
    "node_modules/lodash/_listCacheHas.js"(exports, module) {
      var assocIndexOf = require_assocIndexOf();
      function listCacheHas(key) {
        return assocIndexOf(this.__data__, key) > -1;
      }
      module.exports = listCacheHas;
    }
  });

  // node_modules/lodash/_listCacheSet.js
  var require_listCacheSet = __commonJS({
    "node_modules/lodash/_listCacheSet.js"(exports, module) {
      var assocIndexOf = require_assocIndexOf();
      function listCacheSet(key, value) {
        var data = this.__data__, index = assocIndexOf(data, key);
        if (index < 0) {
          ++this.size;
          data.push([key, value]);
        } else {
          data[index][1] = value;
        }
        return this;
      }
      module.exports = listCacheSet;
    }
  });

  // node_modules/lodash/_ListCache.js
  var require_ListCache = __commonJS({
    "node_modules/lodash/_ListCache.js"(exports, module) {
      var listCacheClear = require_listCacheClear();
      var listCacheDelete = require_listCacheDelete();
      var listCacheGet = require_listCacheGet();
      var listCacheHas = require_listCacheHas();
      var listCacheSet = require_listCacheSet();
      function ListCache(entries) {
        var index = -1, length = entries == null ? 0 : entries.length;
        this.clear();
        while (++index < length) {
          var entry = entries[index];
          this.set(entry[0], entry[1]);
        }
      }
      ListCache.prototype.clear = listCacheClear;
      ListCache.prototype["delete"] = listCacheDelete;
      ListCache.prototype.get = listCacheGet;
      ListCache.prototype.has = listCacheHas;
      ListCache.prototype.set = listCacheSet;
      module.exports = ListCache;
    }
  });

  // node_modules/lodash/_stackClear.js
  var require_stackClear = __commonJS({
    "node_modules/lodash/_stackClear.js"(exports, module) {
      var ListCache = require_ListCache();
      function stackClear() {
        this.__data__ = new ListCache();
        this.size = 0;
      }
      module.exports = stackClear;
    }
  });

  // node_modules/lodash/_stackDelete.js
  var require_stackDelete = __commonJS({
    "node_modules/lodash/_stackDelete.js"(exports, module) {
      function stackDelete(key) {
        var data = this.__data__, result = data["delete"](key);
        this.size = data.size;
        return result;
      }
      module.exports = stackDelete;
    }
  });

  // node_modules/lodash/_stackGet.js
  var require_stackGet = __commonJS({
    "node_modules/lodash/_stackGet.js"(exports, module) {
      function stackGet(key) {
        return this.__data__.get(key);
      }
      module.exports = stackGet;
    }
  });

  // node_modules/lodash/_stackHas.js
  var require_stackHas = __commonJS({
    "node_modules/lodash/_stackHas.js"(exports, module) {
      function stackHas(key) {
        return this.__data__.has(key);
      }
      module.exports = stackHas;
    }
  });

  // node_modules/lodash/_freeGlobal.js
  var require_freeGlobal = __commonJS({
    "node_modules/lodash/_freeGlobal.js"(exports, module) {
      var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
      module.exports = freeGlobal;
    }
  });

  // node_modules/lodash/_root.js
  var require_root = __commonJS({
    "node_modules/lodash/_root.js"(exports, module) {
      var freeGlobal = require_freeGlobal();
      var freeSelf = typeof self == "object" && self && self.Object === Object && self;
      var root = freeGlobal || freeSelf || Function("return this")();
      module.exports = root;
    }
  });

  // node_modules/lodash/_Symbol.js
  var require_Symbol = __commonJS({
    "node_modules/lodash/_Symbol.js"(exports, module) {
      var root = require_root();
      var Symbol3 = root.Symbol;
      module.exports = Symbol3;
    }
  });

  // node_modules/lodash/_getRawTag.js
  var require_getRawTag = __commonJS({
    "node_modules/lodash/_getRawTag.js"(exports, module) {
      var Symbol3 = require_Symbol();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      var nativeObjectToString = objectProto.toString;
      var symToStringTag = Symbol3 ? Symbol3.toStringTag : void 0;
      function getRawTag(value) {
        var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
        try {
          value[symToStringTag] = void 0;
          var unmasked = true;
        } catch (e) {
        }
        var result = nativeObjectToString.call(value);
        if (unmasked) {
          if (isOwn) {
            value[symToStringTag] = tag;
          } else {
            delete value[symToStringTag];
          }
        }
        return result;
      }
      module.exports = getRawTag;
    }
  });

  // node_modules/lodash/_objectToString.js
  var require_objectToString = __commonJS({
    "node_modules/lodash/_objectToString.js"(exports, module) {
      var objectProto = Object.prototype;
      var nativeObjectToString = objectProto.toString;
      function objectToString(value) {
        return nativeObjectToString.call(value);
      }
      module.exports = objectToString;
    }
  });

  // node_modules/lodash/_baseGetTag.js
  var require_baseGetTag = __commonJS({
    "node_modules/lodash/_baseGetTag.js"(exports, module) {
      var Symbol3 = require_Symbol();
      var getRawTag = require_getRawTag();
      var objectToString = require_objectToString();
      var nullTag = "[object Null]";
      var undefinedTag = "[object Undefined]";
      var symToStringTag = Symbol3 ? Symbol3.toStringTag : void 0;
      function baseGetTag(value) {
        if (value == null) {
          return value === void 0 ? undefinedTag : nullTag;
        }
        return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
      }
      module.exports = baseGetTag;
    }
  });

  // node_modules/lodash/isObject.js
  var require_isObject = __commonJS({
    "node_modules/lodash/isObject.js"(exports, module) {
      function isObject3(value) {
        var type = typeof value;
        return value != null && (type == "object" || type == "function");
      }
      module.exports = isObject3;
    }
  });

  // node_modules/lodash/isFunction.js
  var require_isFunction = __commonJS({
    "node_modules/lodash/isFunction.js"(exports, module) {
      var baseGetTag = require_baseGetTag();
      var isObject3 = require_isObject();
      var asyncTag = "[object AsyncFunction]";
      var funcTag = "[object Function]";
      var genTag = "[object GeneratorFunction]";
      var proxyTag = "[object Proxy]";
      function isFunction2(value) {
        if (!isObject3(value)) {
          return false;
        }
        var tag = baseGetTag(value);
        return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
      }
      module.exports = isFunction2;
    }
  });

  // node_modules/lodash/_coreJsData.js
  var require_coreJsData = __commonJS({
    "node_modules/lodash/_coreJsData.js"(exports, module) {
      var root = require_root();
      var coreJsData = root["__core-js_shared__"];
      module.exports = coreJsData;
    }
  });

  // node_modules/lodash/_isMasked.js
  var require_isMasked = __commonJS({
    "node_modules/lodash/_isMasked.js"(exports, module) {
      var coreJsData = require_coreJsData();
      var maskSrcKey = function() {
        var uid2 = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
        return uid2 ? "Symbol(src)_1." + uid2 : "";
      }();
      function isMasked(func) {
        return !!maskSrcKey && maskSrcKey in func;
      }
      module.exports = isMasked;
    }
  });

  // node_modules/lodash/_toSource.js
  var require_toSource = __commonJS({
    "node_modules/lodash/_toSource.js"(exports, module) {
      var funcProto = Function.prototype;
      var funcToString = funcProto.toString;
      function toSource(func) {
        if (func != null) {
          try {
            return funcToString.call(func);
          } catch (e) {
          }
          try {
            return func + "";
          } catch (e) {
          }
        }
        return "";
      }
      module.exports = toSource;
    }
  });

  // node_modules/lodash/_baseIsNative.js
  var require_baseIsNative = __commonJS({
    "node_modules/lodash/_baseIsNative.js"(exports, module) {
      var isFunction2 = require_isFunction();
      var isMasked = require_isMasked();
      var isObject3 = require_isObject();
      var toSource = require_toSource();
      var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
      var reIsHostCtor = /^\[object .+?Constructor\]$/;
      var funcProto = Function.prototype;
      var objectProto = Object.prototype;
      var funcToString = funcProto.toString;
      var hasOwnProperty = objectProto.hasOwnProperty;
      var reIsNative = RegExp(
        "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
      );
      function baseIsNative(value) {
        if (!isObject3(value) || isMasked(value)) {
          return false;
        }
        var pattern = isFunction2(value) ? reIsNative : reIsHostCtor;
        return pattern.test(toSource(value));
      }
      module.exports = baseIsNative;
    }
  });

  // node_modules/lodash/_getValue.js
  var require_getValue = __commonJS({
    "node_modules/lodash/_getValue.js"(exports, module) {
      function getValue(object, key) {
        return object == null ? void 0 : object[key];
      }
      module.exports = getValue;
    }
  });

  // node_modules/lodash/_getNative.js
  var require_getNative = __commonJS({
    "node_modules/lodash/_getNative.js"(exports, module) {
      var baseIsNative = require_baseIsNative();
      var getValue = require_getValue();
      function getNative(object, key) {
        var value = getValue(object, key);
        return baseIsNative(value) ? value : void 0;
      }
      module.exports = getNative;
    }
  });

  // node_modules/lodash/_Map.js
  var require_Map = __commonJS({
    "node_modules/lodash/_Map.js"(exports, module) {
      var getNative = require_getNative();
      var root = require_root();
      var Map2 = getNative(root, "Map");
      module.exports = Map2;
    }
  });

  // node_modules/lodash/_nativeCreate.js
  var require_nativeCreate = __commonJS({
    "node_modules/lodash/_nativeCreate.js"(exports, module) {
      var getNative = require_getNative();
      var nativeCreate = getNative(Object, "create");
      module.exports = nativeCreate;
    }
  });

  // node_modules/lodash/_hashClear.js
  var require_hashClear = __commonJS({
    "node_modules/lodash/_hashClear.js"(exports, module) {
      var nativeCreate = require_nativeCreate();
      function hashClear() {
        this.__data__ = nativeCreate ? nativeCreate(null) : {};
        this.size = 0;
      }
      module.exports = hashClear;
    }
  });

  // node_modules/lodash/_hashDelete.js
  var require_hashDelete = __commonJS({
    "node_modules/lodash/_hashDelete.js"(exports, module) {
      function hashDelete(key) {
        var result = this.has(key) && delete this.__data__[key];
        this.size -= result ? 1 : 0;
        return result;
      }
      module.exports = hashDelete;
    }
  });

  // node_modules/lodash/_hashGet.js
  var require_hashGet = __commonJS({
    "node_modules/lodash/_hashGet.js"(exports, module) {
      var nativeCreate = require_nativeCreate();
      var HASH_UNDEFINED = "__lodash_hash_undefined__";
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function hashGet(key) {
        var data = this.__data__;
        if (nativeCreate) {
          var result = data[key];
          return result === HASH_UNDEFINED ? void 0 : result;
        }
        return hasOwnProperty.call(data, key) ? data[key] : void 0;
      }
      module.exports = hashGet;
    }
  });

  // node_modules/lodash/_hashHas.js
  var require_hashHas = __commonJS({
    "node_modules/lodash/_hashHas.js"(exports, module) {
      var nativeCreate = require_nativeCreate();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function hashHas(key) {
        var data = this.__data__;
        return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
      }
      module.exports = hashHas;
    }
  });

  // node_modules/lodash/_hashSet.js
  var require_hashSet = __commonJS({
    "node_modules/lodash/_hashSet.js"(exports, module) {
      var nativeCreate = require_nativeCreate();
      var HASH_UNDEFINED = "__lodash_hash_undefined__";
      function hashSet(key, value) {
        var data = this.__data__;
        this.size += this.has(key) ? 0 : 1;
        data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
        return this;
      }
      module.exports = hashSet;
    }
  });

  // node_modules/lodash/_Hash.js
  var require_Hash = __commonJS({
    "node_modules/lodash/_Hash.js"(exports, module) {
      var hashClear = require_hashClear();
      var hashDelete = require_hashDelete();
      var hashGet = require_hashGet();
      var hashHas = require_hashHas();
      var hashSet = require_hashSet();
      function Hash(entries) {
        var index = -1, length = entries == null ? 0 : entries.length;
        this.clear();
        while (++index < length) {
          var entry = entries[index];
          this.set(entry[0], entry[1]);
        }
      }
      Hash.prototype.clear = hashClear;
      Hash.prototype["delete"] = hashDelete;
      Hash.prototype.get = hashGet;
      Hash.prototype.has = hashHas;
      Hash.prototype.set = hashSet;
      module.exports = Hash;
    }
  });

  // node_modules/lodash/_mapCacheClear.js
  var require_mapCacheClear = __commonJS({
    "node_modules/lodash/_mapCacheClear.js"(exports, module) {
      var Hash = require_Hash();
      var ListCache = require_ListCache();
      var Map2 = require_Map();
      function mapCacheClear() {
        this.size = 0;
        this.__data__ = {
          "hash": new Hash(),
          "map": new (Map2 || ListCache)(),
          "string": new Hash()
        };
      }
      module.exports = mapCacheClear;
    }
  });

  // node_modules/lodash/_isKeyable.js
  var require_isKeyable = __commonJS({
    "node_modules/lodash/_isKeyable.js"(exports, module) {
      function isKeyable(value) {
        var type = typeof value;
        return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
      }
      module.exports = isKeyable;
    }
  });

  // node_modules/lodash/_getMapData.js
  var require_getMapData = __commonJS({
    "node_modules/lodash/_getMapData.js"(exports, module) {
      var isKeyable = require_isKeyable();
      function getMapData(map2, key) {
        var data = map2.__data__;
        return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
      }
      module.exports = getMapData;
    }
  });

  // node_modules/lodash/_mapCacheDelete.js
  var require_mapCacheDelete = __commonJS({
    "node_modules/lodash/_mapCacheDelete.js"(exports, module) {
      var getMapData = require_getMapData();
      function mapCacheDelete(key) {
        var result = getMapData(this, key)["delete"](key);
        this.size -= result ? 1 : 0;
        return result;
      }
      module.exports = mapCacheDelete;
    }
  });

  // node_modules/lodash/_mapCacheGet.js
  var require_mapCacheGet = __commonJS({
    "node_modules/lodash/_mapCacheGet.js"(exports, module) {
      var getMapData = require_getMapData();
      function mapCacheGet(key) {
        return getMapData(this, key).get(key);
      }
      module.exports = mapCacheGet;
    }
  });

  // node_modules/lodash/_mapCacheHas.js
  var require_mapCacheHas = __commonJS({
    "node_modules/lodash/_mapCacheHas.js"(exports, module) {
      var getMapData = require_getMapData();
      function mapCacheHas(key) {
        return getMapData(this, key).has(key);
      }
      module.exports = mapCacheHas;
    }
  });

  // node_modules/lodash/_mapCacheSet.js
  var require_mapCacheSet = __commonJS({
    "node_modules/lodash/_mapCacheSet.js"(exports, module) {
      var getMapData = require_getMapData();
      function mapCacheSet(key, value) {
        var data = getMapData(this, key), size = data.size;
        data.set(key, value);
        this.size += data.size == size ? 0 : 1;
        return this;
      }
      module.exports = mapCacheSet;
    }
  });

  // node_modules/lodash/_MapCache.js
  var require_MapCache = __commonJS({
    "node_modules/lodash/_MapCache.js"(exports, module) {
      var mapCacheClear = require_mapCacheClear();
      var mapCacheDelete = require_mapCacheDelete();
      var mapCacheGet = require_mapCacheGet();
      var mapCacheHas = require_mapCacheHas();
      var mapCacheSet = require_mapCacheSet();
      function MapCache(entries) {
        var index = -1, length = entries == null ? 0 : entries.length;
        this.clear();
        while (++index < length) {
          var entry = entries[index];
          this.set(entry[0], entry[1]);
        }
      }
      MapCache.prototype.clear = mapCacheClear;
      MapCache.prototype["delete"] = mapCacheDelete;
      MapCache.prototype.get = mapCacheGet;
      MapCache.prototype.has = mapCacheHas;
      MapCache.prototype.set = mapCacheSet;
      module.exports = MapCache;
    }
  });

  // node_modules/lodash/_stackSet.js
  var require_stackSet = __commonJS({
    "node_modules/lodash/_stackSet.js"(exports, module) {
      var ListCache = require_ListCache();
      var Map2 = require_Map();
      var MapCache = require_MapCache();
      var LARGE_ARRAY_SIZE = 200;
      function stackSet(key, value) {
        var data = this.__data__;
        if (data instanceof ListCache) {
          var pairs = data.__data__;
          if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
            pairs.push([key, value]);
            this.size = ++data.size;
            return this;
          }
          data = this.__data__ = new MapCache(pairs);
        }
        data.set(key, value);
        this.size = data.size;
        return this;
      }
      module.exports = stackSet;
    }
  });

  // node_modules/lodash/_Stack.js
  var require_Stack = __commonJS({
    "node_modules/lodash/_Stack.js"(exports, module) {
      var ListCache = require_ListCache();
      var stackClear = require_stackClear();
      var stackDelete = require_stackDelete();
      var stackGet = require_stackGet();
      var stackHas = require_stackHas();
      var stackSet = require_stackSet();
      function Stack(entries) {
        var data = this.__data__ = new ListCache(entries);
        this.size = data.size;
      }
      Stack.prototype.clear = stackClear;
      Stack.prototype["delete"] = stackDelete;
      Stack.prototype.get = stackGet;
      Stack.prototype.has = stackHas;
      Stack.prototype.set = stackSet;
      module.exports = Stack;
    }
  });

  // node_modules/lodash/_defineProperty.js
  var require_defineProperty = __commonJS({
    "node_modules/lodash/_defineProperty.js"(exports, module) {
      var getNative = require_getNative();
      var defineProperty = function() {
        try {
          var func = getNative(Object, "defineProperty");
          func({}, "", {});
          return func;
        } catch (e) {
        }
      }();
      module.exports = defineProperty;
    }
  });

  // node_modules/lodash/_baseAssignValue.js
  var require_baseAssignValue = __commonJS({
    "node_modules/lodash/_baseAssignValue.js"(exports, module) {
      var defineProperty = require_defineProperty();
      function baseAssignValue(object, key, value) {
        if (key == "__proto__" && defineProperty) {
          defineProperty(object, key, {
            "configurable": true,
            "enumerable": true,
            "value": value,
            "writable": true
          });
        } else {
          object[key] = value;
        }
      }
      module.exports = baseAssignValue;
    }
  });

  // node_modules/lodash/_assignMergeValue.js
  var require_assignMergeValue = __commonJS({
    "node_modules/lodash/_assignMergeValue.js"(exports, module) {
      var baseAssignValue = require_baseAssignValue();
      var eq = require_eq();
      function assignMergeValue(object, key, value) {
        if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) {
          baseAssignValue(object, key, value);
        }
      }
      module.exports = assignMergeValue;
    }
  });

  // node_modules/lodash/_createBaseFor.js
  var require_createBaseFor = __commonJS({
    "node_modules/lodash/_createBaseFor.js"(exports, module) {
      function createBaseFor(fromRight) {
        return function(object, iteratee, keysFunc) {
          var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
          while (length--) {
            var key = props[fromRight ? length : ++index];
            if (iteratee(iterable[key], key, iterable) === false) {
              break;
            }
          }
          return object;
        };
      }
      module.exports = createBaseFor;
    }
  });

  // node_modules/lodash/_baseFor.js
  var require_baseFor = __commonJS({
    "node_modules/lodash/_baseFor.js"(exports, module) {
      var createBaseFor = require_createBaseFor();
      var baseFor = createBaseFor();
      module.exports = baseFor;
    }
  });

  // node_modules/lodash/_cloneBuffer.js
  var require_cloneBuffer = __commonJS({
    "node_modules/lodash/_cloneBuffer.js"(exports, module) {
      var root = require_root();
      var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
      var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
      var moduleExports = freeModule && freeModule.exports === freeExports;
      var Buffer2 = moduleExports ? root.Buffer : void 0;
      var allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0;
      function cloneBuffer(buffer, isDeep) {
        if (isDeep) {
          return buffer.slice();
        }
        var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
        buffer.copy(result);
        return result;
      }
      module.exports = cloneBuffer;
    }
  });

  // node_modules/lodash/_Uint8Array.js
  var require_Uint8Array = __commonJS({
    "node_modules/lodash/_Uint8Array.js"(exports, module) {
      var root = require_root();
      var Uint8Array2 = root.Uint8Array;
      module.exports = Uint8Array2;
    }
  });

  // node_modules/lodash/_cloneArrayBuffer.js
  var require_cloneArrayBuffer = __commonJS({
    "node_modules/lodash/_cloneArrayBuffer.js"(exports, module) {
      var Uint8Array2 = require_Uint8Array();
      function cloneArrayBuffer(arrayBuffer) {
        var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
        new Uint8Array2(result).set(new Uint8Array2(arrayBuffer));
        return result;
      }
      module.exports = cloneArrayBuffer;
    }
  });

  // node_modules/lodash/_cloneTypedArray.js
  var require_cloneTypedArray = __commonJS({
    "node_modules/lodash/_cloneTypedArray.js"(exports, module) {
      var cloneArrayBuffer = require_cloneArrayBuffer();
      function cloneTypedArray(typedArray, isDeep) {
        var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
        return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
      }
      module.exports = cloneTypedArray;
    }
  });

  // node_modules/lodash/_copyArray.js
  var require_copyArray = __commonJS({
    "node_modules/lodash/_copyArray.js"(exports, module) {
      function copyArray(source, array) {
        var index = -1, length = source.length;
        array || (array = Array(length));
        while (++index < length) {
          array[index] = source[index];
        }
        return array;
      }
      module.exports = copyArray;
    }
  });

  // node_modules/lodash/_baseCreate.js
  var require_baseCreate = __commonJS({
    "node_modules/lodash/_baseCreate.js"(exports, module) {
      var isObject3 = require_isObject();
      var objectCreate = Object.create;
      var baseCreate = /* @__PURE__ */ function() {
        function object() {
        }
        return function(proto) {
          if (!isObject3(proto)) {
            return {};
          }
          if (objectCreate) {
            return objectCreate(proto);
          }
          object.prototype = proto;
          var result = new object();
          object.prototype = void 0;
          return result;
        };
      }();
      module.exports = baseCreate;
    }
  });

  // node_modules/lodash/_overArg.js
  var require_overArg = __commonJS({
    "node_modules/lodash/_overArg.js"(exports, module) {
      function overArg(func, transform) {
        return function(arg) {
          return func(transform(arg));
        };
      }
      module.exports = overArg;
    }
  });

  // node_modules/lodash/_getPrototype.js
  var require_getPrototype = __commonJS({
    "node_modules/lodash/_getPrototype.js"(exports, module) {
      var overArg = require_overArg();
      var getPrototype = overArg(Object.getPrototypeOf, Object);
      module.exports = getPrototype;
    }
  });

  // node_modules/lodash/_isPrototype.js
  var require_isPrototype = __commonJS({
    "node_modules/lodash/_isPrototype.js"(exports, module) {
      var objectProto = Object.prototype;
      function isPrototype(value) {
        var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
        return value === proto;
      }
      module.exports = isPrototype;
    }
  });

  // node_modules/lodash/_initCloneObject.js
  var require_initCloneObject = __commonJS({
    "node_modules/lodash/_initCloneObject.js"(exports, module) {
      var baseCreate = require_baseCreate();
      var getPrototype = require_getPrototype();
      var isPrototype = require_isPrototype();
      function initCloneObject(object) {
        return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
      }
      module.exports = initCloneObject;
    }
  });

  // node_modules/lodash/isObjectLike.js
  var require_isObjectLike = __commonJS({
    "node_modules/lodash/isObjectLike.js"(exports, module) {
      function isObjectLike(value) {
        return value != null && typeof value == "object";
      }
      module.exports = isObjectLike;
    }
  });

  // node_modules/lodash/_baseIsArguments.js
  var require_baseIsArguments = __commonJS({
    "node_modules/lodash/_baseIsArguments.js"(exports, module) {
      var baseGetTag = require_baseGetTag();
      var isObjectLike = require_isObjectLike();
      var argsTag = "[object Arguments]";
      function baseIsArguments(value) {
        return isObjectLike(value) && baseGetTag(value) == argsTag;
      }
      module.exports = baseIsArguments;
    }
  });

  // node_modules/lodash/isArguments.js
  var require_isArguments = __commonJS({
    "node_modules/lodash/isArguments.js"(exports, module) {
      var baseIsArguments = require_baseIsArguments();
      var isObjectLike = require_isObjectLike();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      var propertyIsEnumerable = objectProto.propertyIsEnumerable;
      var isArguments = baseIsArguments(/* @__PURE__ */ function() {
        return arguments;
      }()) ? baseIsArguments : function(value) {
        return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
      };
      module.exports = isArguments;
    }
  });

  // node_modules/lodash/isArray.js
  var require_isArray = __commonJS({
    "node_modules/lodash/isArray.js"(exports, module) {
      var isArray = Array.isArray;
      module.exports = isArray;
    }
  });

  // node_modules/lodash/isLength.js
  var require_isLength = __commonJS({
    "node_modules/lodash/isLength.js"(exports, module) {
      var MAX_SAFE_INTEGER = 9007199254740991;
      function isLength(value) {
        return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
      }
      module.exports = isLength;
    }
  });

  // node_modules/lodash/isArrayLike.js
  var require_isArrayLike = __commonJS({
    "node_modules/lodash/isArrayLike.js"(exports, module) {
      var isFunction2 = require_isFunction();
      var isLength = require_isLength();
      function isArrayLike(value) {
        return value != null && isLength(value.length) && !isFunction2(value);
      }
      module.exports = isArrayLike;
    }
  });

  // node_modules/lodash/isArrayLikeObject.js
  var require_isArrayLikeObject = __commonJS({
    "node_modules/lodash/isArrayLikeObject.js"(exports, module) {
      var isArrayLike = require_isArrayLike();
      var isObjectLike = require_isObjectLike();
      function isArrayLikeObject(value) {
        return isObjectLike(value) && isArrayLike(value);
      }
      module.exports = isArrayLikeObject;
    }
  });

  // node_modules/lodash/stubFalse.js
  var require_stubFalse = __commonJS({
    "node_modules/lodash/stubFalse.js"(exports, module) {
      function stubFalse() {
        return false;
      }
      module.exports = stubFalse;
    }
  });

  // node_modules/lodash/isBuffer.js
  var require_isBuffer = __commonJS({
    "node_modules/lodash/isBuffer.js"(exports, module) {
      var root = require_root();
      var stubFalse = require_stubFalse();
      var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
      var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
      var moduleExports = freeModule && freeModule.exports === freeExports;
      var Buffer2 = moduleExports ? root.Buffer : void 0;
      var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
      var isBuffer = nativeIsBuffer || stubFalse;
      module.exports = isBuffer;
    }
  });

  // node_modules/lodash/isPlainObject.js
  var require_isPlainObject = __commonJS({
    "node_modules/lodash/isPlainObject.js"(exports, module) {
      var baseGetTag = require_baseGetTag();
      var getPrototype = require_getPrototype();
      var isObjectLike = require_isObjectLike();
      var objectTag = "[object Object]";
      var funcProto = Function.prototype;
      var objectProto = Object.prototype;
      var funcToString = funcProto.toString;
      var hasOwnProperty = objectProto.hasOwnProperty;
      var objectCtorString = funcToString.call(Object);
      function isPlainObject6(value) {
        if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
          return false;
        }
        var proto = getPrototype(value);
        if (proto === null) {
          return true;
        }
        var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
        return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
      }
      module.exports = isPlainObject6;
    }
  });

  // node_modules/lodash/_baseIsTypedArray.js
  var require_baseIsTypedArray = __commonJS({
    "node_modules/lodash/_baseIsTypedArray.js"(exports, module) {
      var baseGetTag = require_baseGetTag();
      var isLength = require_isLength();
      var isObjectLike = require_isObjectLike();
      var argsTag = "[object Arguments]";
      var arrayTag = "[object Array]";
      var boolTag = "[object Boolean]";
      var dateTag = "[object Date]";
      var errorTag = "[object Error]";
      var funcTag = "[object Function]";
      var mapTag = "[object Map]";
      var numberTag = "[object Number]";
      var objectTag = "[object Object]";
      var regexpTag = "[object RegExp]";
      var setTag = "[object Set]";
      var stringTag = "[object String]";
      var weakMapTag = "[object WeakMap]";
      var arrayBufferTag = "[object ArrayBuffer]";
      var dataViewTag = "[object DataView]";
      var float32Tag = "[object Float32Array]";
      var float64Tag = "[object Float64Array]";
      var int8Tag = "[object Int8Array]";
      var int16Tag = "[object Int16Array]";
      var int32Tag = "[object Int32Array]";
      var uint8Tag = "[object Uint8Array]";
      var uint8ClampedTag = "[object Uint8ClampedArray]";
      var uint16Tag = "[object Uint16Array]";
      var uint32Tag = "[object Uint32Array]";
      var typedArrayTags = {};
      typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
      typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
      function baseIsTypedArray(value) {
        return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
      }
      module.exports = baseIsTypedArray;
    }
  });

  // node_modules/lodash/_baseUnary.js
  var require_baseUnary = __commonJS({
    "node_modules/lodash/_baseUnary.js"(exports, module) {
      function baseUnary(func) {
        return function(value) {
          return func(value);
        };
      }
      module.exports = baseUnary;
    }
  });

  // node_modules/lodash/_nodeUtil.js
  var require_nodeUtil = __commonJS({
    "node_modules/lodash/_nodeUtil.js"(exports, module) {
      var freeGlobal = require_freeGlobal();
      var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
      var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
      var moduleExports = freeModule && freeModule.exports === freeExports;
      var freeProcess = moduleExports && freeGlobal.process;
      var nodeUtil = function() {
        try {
          var types = freeModule && freeModule.require && freeModule.require("util").types;
          if (types) {
            return types;
          }
          return freeProcess && freeProcess.binding && freeProcess.binding("util");
        } catch (e) {
        }
      }();
      module.exports = nodeUtil;
    }
  });

  // node_modules/lodash/isTypedArray.js
  var require_isTypedArray = __commonJS({
    "node_modules/lodash/isTypedArray.js"(exports, module) {
      var baseIsTypedArray = require_baseIsTypedArray();
      var baseUnary = require_baseUnary();
      var nodeUtil = require_nodeUtil();
      var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
      var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
      module.exports = isTypedArray;
    }
  });

  // node_modules/lodash/_safeGet.js
  var require_safeGet = __commonJS({
    "node_modules/lodash/_safeGet.js"(exports, module) {
      function safeGet(object, key) {
        if (key === "constructor" && typeof object[key] === "function") {
          return;
        }
        if (key == "__proto__") {
          return;
        }
        return object[key];
      }
      module.exports = safeGet;
    }
  });

  // node_modules/lodash/_assignValue.js
  var require_assignValue = __commonJS({
    "node_modules/lodash/_assignValue.js"(exports, module) {
      var baseAssignValue = require_baseAssignValue();
      var eq = require_eq();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function assignValue(object, key, value) {
        var objValue = object[key];
        if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
          baseAssignValue(object, key, value);
        }
      }
      module.exports = assignValue;
    }
  });

  // node_modules/lodash/_copyObject.js
  var require_copyObject = __commonJS({
    "node_modules/lodash/_copyObject.js"(exports, module) {
      var assignValue = require_assignValue();
      var baseAssignValue = require_baseAssignValue();
      function copyObject(source, props, object, customizer) {
        var isNew = !object;
        object || (object = {});
        var index = -1, length = props.length;
        while (++index < length) {
          var key = props[index];
          var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
          if (newValue === void 0) {
            newValue = source[key];
          }
          if (isNew) {
            baseAssignValue(object, key, newValue);
          } else {
            assignValue(object, key, newValue);
          }
        }
        return object;
      }
      module.exports = copyObject;
    }
  });

  // node_modules/lodash/_baseTimes.js
  var require_baseTimes = __commonJS({
    "node_modules/lodash/_baseTimes.js"(exports, module) {
      function baseTimes(n, iteratee) {
        var index = -1, result = Array(n);
        while (++index < n) {
          result[index] = iteratee(index);
        }
        return result;
      }
      module.exports = baseTimes;
    }
  });

  // node_modules/lodash/_isIndex.js
  var require_isIndex = __commonJS({
    "node_modules/lodash/_isIndex.js"(exports, module) {
      var MAX_SAFE_INTEGER = 9007199254740991;
      var reIsUint = /^(?:0|[1-9]\d*)$/;
      function isIndex(value, length) {
        var type = typeof value;
        length = length == null ? MAX_SAFE_INTEGER : length;
        return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
      }
      module.exports = isIndex;
    }
  });

  // node_modules/lodash/_arrayLikeKeys.js
  var require_arrayLikeKeys = __commonJS({
    "node_modules/lodash/_arrayLikeKeys.js"(exports, module) {
      var baseTimes = require_baseTimes();
      var isArguments = require_isArguments();
      var isArray = require_isArray();
      var isBuffer = require_isBuffer();
      var isIndex = require_isIndex();
      var isTypedArray = require_isTypedArray();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function arrayLikeKeys(value, inherited) {
        var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
        for (var key in value) {
          if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
          (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
          isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
          isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
          isIndex(key, length)))) {
            result.push(key);
          }
        }
        return result;
      }
      module.exports = arrayLikeKeys;
    }
  });

  // node_modules/lodash/_nativeKeysIn.js
  var require_nativeKeysIn = __commonJS({
    "node_modules/lodash/_nativeKeysIn.js"(exports, module) {
      function nativeKeysIn(object) {
        var result = [];
        if (object != null) {
          for (var key in Object(object)) {
            result.push(key);
          }
        }
        return result;
      }
      module.exports = nativeKeysIn;
    }
  });

  // node_modules/lodash/_baseKeysIn.js
  var require_baseKeysIn = __commonJS({
    "node_modules/lodash/_baseKeysIn.js"(exports, module) {
      var isObject3 = require_isObject();
      var isPrototype = require_isPrototype();
      var nativeKeysIn = require_nativeKeysIn();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function baseKeysIn(object) {
        if (!isObject3(object)) {
          return nativeKeysIn(object);
        }
        var isProto = isPrototype(object), result = [];
        for (var key in object) {
          if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
            result.push(key);
          }
        }
        return result;
      }
      module.exports = baseKeysIn;
    }
  });

  // node_modules/lodash/keysIn.js
  var require_keysIn = __commonJS({
    "node_modules/lodash/keysIn.js"(exports, module) {
      var arrayLikeKeys = require_arrayLikeKeys();
      var baseKeysIn = require_baseKeysIn();
      var isArrayLike = require_isArrayLike();
      function keysIn(object) {
        return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
      }
      module.exports = keysIn;
    }
  });

  // node_modules/lodash/toPlainObject.js
  var require_toPlainObject = __commonJS({
    "node_modules/lodash/toPlainObject.js"(exports, module) {
      var copyObject = require_copyObject();
      var keysIn = require_keysIn();
      function toPlainObject(value) {
        return copyObject(value, keysIn(value));
      }
      module.exports = toPlainObject;
    }
  });

  // node_modules/lodash/_baseMergeDeep.js
  var require_baseMergeDeep = __commonJS({
    "node_modules/lodash/_baseMergeDeep.js"(exports, module) {
      var assignMergeValue = require_assignMergeValue();
      var cloneBuffer = require_cloneBuffer();
      var cloneTypedArray = require_cloneTypedArray();
      var copyArray = require_copyArray();
      var initCloneObject = require_initCloneObject();
      var isArguments = require_isArguments();
      var isArray = require_isArray();
      var isArrayLikeObject = require_isArrayLikeObject();
      var isBuffer = require_isBuffer();
      var isFunction2 = require_isFunction();
      var isObject3 = require_isObject();
      var isPlainObject6 = require_isPlainObject();
      var isTypedArray = require_isTypedArray();
      var safeGet = require_safeGet();
      var toPlainObject = require_toPlainObject();
      function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
        var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
        if (stacked) {
          assignMergeValue(object, key, stacked);
          return;
        }
        var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
        var isCommon = newValue === void 0;
        if (isCommon) {
          var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
          newValue = srcValue;
          if (isArr || isBuff || isTyped) {
            if (isArray(objValue)) {
              newValue = objValue;
            } else if (isArrayLikeObject(objValue)) {
              newValue = copyArray(objValue);
            } else if (isBuff) {
              isCommon = false;
              newValue = cloneBuffer(srcValue, true);
            } else if (isTyped) {
              isCommon = false;
              newValue = cloneTypedArray(srcValue, true);
            } else {
              newValue = [];
            }
          } else if (isPlainObject6(srcValue) || isArguments(srcValue)) {
            newValue = objValue;
            if (isArguments(objValue)) {
              newValue = toPlainObject(objValue);
            } else if (!isObject3(objValue) || isFunction2(objValue)) {
              newValue = initCloneObject(srcValue);
            }
          } else {
            isCommon = false;
          }
        }
        if (isCommon) {
          stack.set(srcValue, newValue);
          mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
          stack["delete"](srcValue);
        }
        assignMergeValue(object, key, newValue);
      }
      module.exports = baseMergeDeep;
    }
  });

  // node_modules/lodash/_baseMerge.js
  var require_baseMerge = __commonJS({
    "node_modules/lodash/_baseMerge.js"(exports, module) {
      var Stack = require_Stack();
      var assignMergeValue = require_assignMergeValue();
      var baseFor = require_baseFor();
      var baseMergeDeep = require_baseMergeDeep();
      var isObject3 = require_isObject();
      var keysIn = require_keysIn();
      var safeGet = require_safeGet();
      function baseMerge(object, source, srcIndex, customizer, stack) {
        if (object === source) {
          return;
        }
        baseFor(source, function(srcValue, key) {
          stack || (stack = new Stack());
          if (isObject3(srcValue)) {
            baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
          } else {
            var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0;
            if (newValue === void 0) {
              newValue = srcValue;
            }
            assignMergeValue(object, key, newValue);
          }
        }, keysIn);
      }
      module.exports = baseMerge;
    }
  });

  // node_modules/lodash/identity.js
  var require_identity = __commonJS({
    "node_modules/lodash/identity.js"(exports, module) {
      function identity5(value) {
        return value;
      }
      module.exports = identity5;
    }
  });

  // node_modules/lodash/_apply.js
  var require_apply = __commonJS({
    "node_modules/lodash/_apply.js"(exports, module) {
      function apply(func, thisArg, args) {
        switch (args.length) {
          case 0:
            return func.call(thisArg);
          case 1:
            return func.call(thisArg, args[0]);
          case 2:
            return func.call(thisArg, args[0], args[1]);
          case 3:
            return func.call(thisArg, args[0], args[1], args[2]);
        }
        return func.apply(thisArg, args);
      }
      module.exports = apply;
    }
  });

  // node_modules/lodash/_overRest.js
  var require_overRest = __commonJS({
    "node_modules/lodash/_overRest.js"(exports, module) {
      var apply = require_apply();
      var nativeMax = Math.max;
      function overRest(func, start2, transform) {
        start2 = nativeMax(start2 === void 0 ? func.length - 1 : start2, 0);
        return function() {
          var args = arguments, index = -1, length = nativeMax(args.length - start2, 0), array = Array(length);
          while (++index < length) {
            array[index] = args[start2 + index];
          }
          index = -1;
          var otherArgs = Array(start2 + 1);
          while (++index < start2) {
            otherArgs[index] = args[index];
          }
          otherArgs[start2] = transform(array);
          return apply(func, this, otherArgs);
        };
      }
      module.exports = overRest;
    }
  });

  // node_modules/lodash/constant.js
  var require_constant = __commonJS({
    "node_modules/lodash/constant.js"(exports, module) {
      function constant(value) {
        return function() {
          return value;
        };
      }
      module.exports = constant;
    }
  });

  // node_modules/lodash/_baseSetToString.js
  var require_baseSetToString = __commonJS({
    "node_modules/lodash/_baseSetToString.js"(exports, module) {
      var constant = require_constant();
      var defineProperty = require_defineProperty();
      var identity5 = require_identity();
      var baseSetToString = !defineProperty ? identity5 : function(func, string) {
        return defineProperty(func, "toString", {
          "configurable": true,
          "enumerable": false,
          "value": constant(string),
          "writable": true
        });
      };
      module.exports = baseSetToString;
    }
  });

  // node_modules/lodash/_shortOut.js
  var require_shortOut = __commonJS({
    "node_modules/lodash/_shortOut.js"(exports, module) {
      var HOT_COUNT = 800;
      var HOT_SPAN = 16;
      var nativeNow = Date.now;
      function shortOut(func) {
        var count = 0, lastCalled = 0;
        return function() {
          var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
          lastCalled = stamp;
          if (remaining > 0) {
            if (++count >= HOT_COUNT) {
              return arguments[0];
            }
          } else {
            count = 0;
          }
          return func.apply(void 0, arguments);
        };
      }
      module.exports = shortOut;
    }
  });

  // node_modules/lodash/_setToString.js
  var require_setToString = __commonJS({
    "node_modules/lodash/_setToString.js"(exports, module) {
      var baseSetToString = require_baseSetToString();
      var shortOut = require_shortOut();
      var setToString = shortOut(baseSetToString);
      module.exports = setToString;
    }
  });

  // node_modules/lodash/_baseRest.js
  var require_baseRest = __commonJS({
    "node_modules/lodash/_baseRest.js"(exports, module) {
      var identity5 = require_identity();
      var overRest = require_overRest();
      var setToString = require_setToString();
      function baseRest(func, start2) {
        return setToString(overRest(func, start2, identity5), func + "");
      }
      module.exports = baseRest;
    }
  });

  // node_modules/lodash/_isIterateeCall.js
  var require_isIterateeCall = __commonJS({
    "node_modules/lodash/_isIterateeCall.js"(exports, module) {
      var eq = require_eq();
      var isArrayLike = require_isArrayLike();
      var isIndex = require_isIndex();
      var isObject3 = require_isObject();
      function isIterateeCall(value, index, object) {
        if (!isObject3(object)) {
          return false;
        }
        var type = typeof index;
        if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
          return eq(object[index], value);
        }
        return false;
      }
      module.exports = isIterateeCall;
    }
  });

  // node_modules/lodash/_createAssigner.js
  var require_createAssigner = __commonJS({
    "node_modules/lodash/_createAssigner.js"(exports, module) {
      var baseRest = require_baseRest();
      var isIterateeCall = require_isIterateeCall();
      function createAssigner(assigner) {
        return baseRest(function(object, sources) {
          var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
          customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
          if (guard && isIterateeCall(sources[0], sources[1], guard)) {
            customizer = length < 3 ? void 0 : customizer;
            length = 1;
          }
          object = Object(object);
          while (++index < length) {
            var source = sources[index];
            if (source) {
              assigner(object, source, index, customizer);
            }
          }
          return object;
        });
      }
      module.exports = createAssigner;
    }
  });

  // node_modules/lodash/mergeWith.js
  var require_mergeWith = __commonJS({
    "node_modules/lodash/mergeWith.js"(exports, module) {
      var baseMerge = require_baseMerge();
      var createAssigner = require_createAssigner();
      var mergeWith2 = createAssigner(function(object, source, srcIndex, customizer) {
        baseMerge(object, source, srcIndex, customizer);
      });
      module.exports = mergeWith2;
    }
  });

  // node_modules/@patternfly/react-icons/dist/js/createIcon.js
  var require_createIcon = __commonJS({
    "node_modules/@patternfly/react-icons/dist/js/createIcon.js"(exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", { value: true });
      exports.createIcon = void 0;
      var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
      var React422 = tslib_1.__importStar(require_react());
      var currentId3 = 0;
      function createIcon2({ name: name2, xOffset = 0, yOffset = 0, width, height, svgPath }) {
        var _a;
        return _a = class SVGIcon extends React422.Component {
          constructor() {
            super(...arguments);
            this.id = `icon-title-${currentId3++}`;
          }
          render() {
            const _b = this.props, { title, className } = _b, props = tslib_1.__rest(_b, ["title", "className"]);
            const classes = className ? `pf-v5-svg ${className}` : "pf-v5-svg";
            const hasTitle = Boolean(title);
            const viewBox = [xOffset, yOffset, width, height].join(" ");
            return React422.createElement(
              "svg",
              Object.assign({ className: classes, viewBox, fill: "currentColor", "aria-labelledby": hasTitle ? this.id : null, "aria-hidden": hasTitle ? null : true, role: "img", width: "1em", height: "1em" }, props),
              hasTitle && React422.createElement("title", { id: this.id }, title),
              React422.createElement("path", { d: svgPath })
            );
          }
        }, _a.displayName = name2, _a;
      }
      exports.createIcon = createIcon2;
    }
  });

  // node_modules/@patternfly/react-icons/dist/js/icons/outlined-question-circle-icon.js
  var require_outlined_question_circle_icon = __commonJS({
    "node_modules/@patternfly/react-icons/dist/js/icons/outlined-question-circle-icon.js"(exports) {
      "use strict";
      exports.__esModule = true;
      exports.OutlinedQuestionCircleIconConfig = {
        name: "OutlinedQuestionCircleIcon",
        height: 512,
        width: 512,
        svgPath: "M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 448c-110.532 0-200-89.431-200-200 0-110.495 89.472-200 200-200 110.491 0 200 89.471 200 200 0 110.53-89.431 200-200 200zm107.244-255.2c0 67.052-72.421 68.084-72.421 92.863V300c0 6.627-5.373 12-12 12h-45.647c-6.627 0-12-5.373-12-12v-8.659c0-35.745 27.1-50.034 47.579-61.516 17.561-9.845 28.324-16.541 28.324-29.579 0-17.246-21.999-28.693-39.784-28.693-23.189 0-33.894 10.977-48.942 29.969-4.057 5.12-11.46 6.071-16.666 2.124l-27.824-21.098c-5.107-3.872-6.251-11.066-2.644-16.363C184.846 131.491 214.94 112 261.794 112c49.071 0 101.45 38.304 101.45 88.8zM298 368c0 23.159-18.841 42-42 42s-42-18.841-42-42 18.841-42 42-42 42 18.841 42 42z",
        yOffset: 0,
        xOffset: 0
      };
      exports.OutlinedQuestionCircleIcon = require_createIcon().createIcon(exports.OutlinedQuestionCircleIconConfig);
      exports["default"] = exports.OutlinedQuestionCircleIcon;
    }
  });

  // node_modules/@patternfly/react-styles/css/components/LogViewer/log-viewer.css
  var require_log_viewer = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/LogViewer/log-viewer.css"(exports, module) {
      module.exports = {};
    }
  });

  // node_modules/@patternfly/react-styles/css/components/LogViewer/log-viewer.js
  var require_log_viewer2 = __commonJS({
    "node_modules/@patternfly/react-styles/css/components/LogViewer/log-viewer.js"(exports) {
      "use strict";
      exports.__esModule = true;
      require_log_viewer();
      exports.default = {
        "button": "pf-v5-c-button",
        "logViewer": "pf-v5-c-log-viewer",
        "logViewerHeader": "pf-v5-c-log-viewer__header",
        "logViewerIndex": "pf-v5-c-log-viewer__index",
        "logViewerList": "pf-v5-c-log-viewer__list",
        "logViewerListItem": "pf-v5-c-log-viewer__list-item",
        "logViewerMain": "pf-v5-c-log-viewer__main",
        "logViewerScrollContainer": "pf-v5-c-log-viewer__scroll-container",
        "logViewerString": "pf-v5-c-log-viewer__string",
        "logViewerText": "pf-v5-c-log-viewer__text",
        "logViewerTimestamp": "pf-v5-c-log-viewer__timestamp",
        "modifiers": {
          "dark": "pf-m-dark",
          "wrapText": "pf-m-wrap-text",
          "nowrap": "pf-m-nowrap",
          "lineNumbers": "pf-m-line-numbers",
          "lineNumberChars": "pf-m-line-number-chars",
          "match": "pf-m-match",
          "current": "pf-m-current"
        },
        "themeDark": "pf-v5-theme-dark",
        "toolbar": "pf-v5-c-toolbar",
        "toolbarContentSection": "pf-v5-c-toolbar__content-section"
      };
    }
  });

  // node_modules/@patternfly/react-icons/dist/js/icons/trash-alt-icon.js
  var require_trash_alt_icon = __commonJS({
    "node_modules/@patternfly/react-icons/dist/js/icons/trash-alt-icon.js"(exports) {
      "use strict";
      exports.__esModule = true;
      exports.TrashAltIconConfig = {
        name: "TrashAltIcon",
        height: 512,
        width: 448,
        svgPath: "M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z",
        yOffset: 0,
        xOffset: 0
      };
      exports.TrashAltIcon = require_createIcon().createIcon(exports.TrashAltIconConfig);
      exports["default"] = exports.TrashAltIcon;
    }
  });

  // node_modules/@patternfly/react-icons/dist/js/icons/arrow-right-icon.js
  var require_arrow_right_icon = __commonJS({
    "node_modules/@patternfly/react-icons/dist/js/icons/arrow-right-icon.js"(exports) {
      "use strict";
      exports.__esModule = true;
      exports.ArrowRightIconConfig = {
        name: "ArrowRightIcon",
        height: 512,
        width: 448,
        svgPath: "M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z",
        yOffset: 0,
        xOffset: 0
      };
      exports.ArrowRightIcon = require_createIcon().createIcon(exports.ArrowRightIconConfig);
      exports["default"] = exports.ArrowRightIcon;
    }
  });

  // node_modules/@patternfly/react-icons/dist/js/icons/exclamation-circle-icon.js
  var require_exclamation_circle_icon = __commonJS({
    "node_modules/@patternfly/react-icons/dist/js/icons/exclamation-circle-icon.js"(exports) {
      "use strict";
      exports.__esModule = true;
      exports.ExclamationCircleIconConfig = {
        name: "ExclamationCircleIcon",
        height: 512,
        width: 512,
        svgPath: "M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z",
        yOffset: 0,
        xOffset: 0
      };
      exports.ExclamationCircleIcon = require_createIcon().createIcon(exports.ExclamationCircleIconConfig);
      exports["default"] = exports.ExclamationCircleIcon;
    }
  });

  // node_modules/@patternfly/react-icons/dist/js/icons/plus-icon.js
  var require_plus_icon = __commonJS({
    "node_modules/@patternfly/react-icons/dist/js/icons/plus-icon.js"(exports) {
      "use strict";
      exports.__esModule = true;
      exports.PlusIconConfig = {
        name: "PlusIcon",
        height: 512,
        width: 448,
        svgPath: "M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",
        yOffset: 0,
        xOffset: 0
      };
      exports.PlusIcon = require_createIcon().createIcon(exports.PlusIconConfig);
      exports["default"] = exports.PlusIcon;
    }
  });

  // node_modules/@patternfly/react-icons/dist/js/icons/exclamation-triangle-icon.js
  var require_exclamation_triangle_icon = __commonJS({
    "node_modules/@patternfly/react-icons/dist/js/icons/exclamation-triangle-icon.js"(exports) {
      "use strict";
      exports.__esModule = true;
      exports.ExclamationTriangleIconConfig = {
        name: "ExclamationTriangleIcon",
        height: 512,
        width: 576,
        svgPath: "M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z",
        yOffset: 0,
        xOffset: 0
      };
      exports.ExclamationTriangleIcon = require_createIcon().createIcon(exports.ExclamationTriangleIconConfig);
      exports["default"] = exports.ExclamationTriangleIcon;
    }
  });

  // node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
  var require_hoist_non_react_statics_cjs = __commonJS({
    "node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"(exports, module) {
      "use strict";
      var reactIs = require_react_is();
      var REACT_STATICS = {
        childContextTypes: true,
        contextType: true,
        contextTypes: true,
        defaultProps: true,
        displayName: true,
        getDefaultProps: true,
        getDerivedStateFromError: true,
        getDerivedStateFromProps: true,
        mixins: true,
        propTypes: true,
        type: true
      };
      var KNOWN_STATICS = {
        name: true,
        length: true,
        prototype: true,
        caller: true,
        callee: true,
        arguments: true,
        arity: true
      };
      var FORWARD_REF_STATICS = {
        "$$typeof": true,
        render: true,
        defaultProps: true,
        displayName: true,
        propTypes: true
      };
      var MEMO_STATICS = {
        "$$typeof": true,
        compare: true,
        defaultProps: true,
        displayName: true,
        propTypes: true,
        type: true
      };
      var TYPE_STATICS = {};
      TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
      TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
      function getStatics(component) {
        if (reactIs.isMemo(component)) {
          return MEMO_STATICS;
        }
        return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS;
      }
      var defineProperty = Object.defineProperty;
      var getOwnPropertyNames = Object.getOwnPropertyNames;
      var getOwnPropertySymbols = Object.getOwnPropertySymbols;
      var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
      var getPrototypeOf = Object.getPrototypeOf;
      var objectPrototype = Object.prototype;
      function hoistNonReactStatics12(targetComponent, sourceComponent, blacklist) {
        if (typeof sourceComponent !== "string") {
          if (objectPrototype) {
            var inheritedComponent = getPrototypeOf(sourceComponent);
            if (inheritedComponent && inheritedComponent !== objectPrototype) {
              hoistNonReactStatics12(targetComponent, inheritedComponent, blacklist);
            }
          }
          var keys = getOwnPropertyNames(sourceComponent);
          if (getOwnPropertySymbols) {
            keys = keys.concat(getOwnPropertySymbols(sourceComponent));
          }
          var targetStatics = getStatics(targetComponent);
          var sourceStatics = getStatics(sourceComponent);
          for (var i = 0; i < keys.length; ++i) {
            var key = keys[i];
            if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
              var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
              try {
                defineProperty(targetComponent, key, descriptor);
              } catch (e) {
              }
            }
          }
        }
        return targetComponent;
      }
      module.exports = hoistNonReactStatics12;
    }
  });

  // node_modules/lodash/defaults.js
  var require_defaults = __commonJS({
    "node_modules/lodash/defaults.js"(exports, module) {
      var baseRest = require_baseRest();
      var eq = require_eq();
      var isIterateeCall = require_isIterateeCall();
      var keysIn = require_keysIn();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      var defaults32 = baseRest(function(object, sources) {
        object = Object(object);
        var index = -1;
        var length = sources.length;
        var guard = length > 2 ? sources[2] : void 0;
        if (guard && isIterateeCall(sources[0], sources[1], guard)) {
          length = 1;
        }
        while (++index < length) {
          var source = sources[index];
          var props = keysIn(source);
          var propsIndex = -1;
          var propsLength = props.length;
          while (++propsIndex < propsLength) {
            var key = props[propsIndex];
            var value = object[key];
            if (value === void 0 || eq(value, objectProto[key]) && !hasOwnProperty.call(object, key)) {
              object[key] = source[key];
            }
          }
        }
        return object;
      });
      module.exports = defaults32;
    }
  });

  // node_modules/lodash/_nativeKeys.js
  var require_nativeKeys = __commonJS({
    "node_modules/lodash/_nativeKeys.js"(exports, module) {
      var overArg = require_overArg();
      var nativeKeys = overArg(Object.keys, Object);
      module.exports = nativeKeys;
    }
  });

  // node_modules/lodash/_baseKeys.js
  var require_baseKeys = __commonJS({
    "node_modules/lodash/_baseKeys.js"(exports, module) {
      var isPrototype = require_isPrototype();
      var nativeKeys = require_nativeKeys();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function baseKeys(object) {
        if (!isPrototype(object)) {
          return nativeKeys(object);
        }
        var result = [];
        for (var key in Object(object)) {
          if (hasOwnProperty.call(object, key) && key != "constructor") {
            result.push(key);
          }
        }
        return result;
      }
      module.exports = baseKeys;
    }
  });

  // node_modules/lodash/_DataView.js
  var require_DataView = __commonJS({
    "node_modules/lodash/_DataView.js"(exports, module) {
      var getNative = require_getNative();
      var root = require_root();
      var DataView2 = getNative(root, "DataView");
      module.exports = DataView2;
    }
  });

  // node_modules/lodash/_Promise.js
  var require_Promise = __commonJS({
    "node_modules/lodash/_Promise.js"(exports, module) {
      var getNative = require_getNative();
      var root = require_root();
      var Promise2 = getNative(root, "Promise");
      module.exports = Promise2;
    }
  });

  // node_modules/lodash/_Set.js
  var require_Set = __commonJS({
    "node_modules/lodash/_Set.js"(exports, module) {
      var getNative = require_getNative();
      var root = require_root();
      var Set2 = getNative(root, "Set");
      module.exports = Set2;
    }
  });

  // node_modules/lodash/_WeakMap.js
  var require_WeakMap = __commonJS({
    "node_modules/lodash/_WeakMap.js"(exports, module) {
      var getNative = require_getNative();
      var root = require_root();
      var WeakMap2 = getNative(root, "WeakMap");
      module.exports = WeakMap2;
    }
  });

  // node_modules/lodash/_getTag.js
  var require_getTag = __commonJS({
    "node_modules/lodash/_getTag.js"(exports, module) {
      var DataView2 = require_DataView();
      var Map2 = require_Map();
      var Promise2 = require_Promise();
      var Set2 = require_Set();
      var WeakMap2 = require_WeakMap();
      var baseGetTag = require_baseGetTag();
      var toSource = require_toSource();
      var mapTag = "[object Map]";
      var objectTag = "[object Object]";
      var promiseTag = "[object Promise]";
      var setTag = "[object Set]";
      var weakMapTag = "[object WeakMap]";
      var dataViewTag = "[object DataView]";
      var dataViewCtorString = toSource(DataView2);
      var mapCtorString = toSource(Map2);
      var promiseCtorString = toSource(Promise2);
      var setCtorString = toSource(Set2);
      var weakMapCtorString = toSource(WeakMap2);
      var getTag = baseGetTag;
      if (DataView2 && getTag(new DataView2(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
        getTag = function(value) {
          var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
          if (ctorString) {
            switch (ctorString) {
              case dataViewCtorString:
                return dataViewTag;
              case mapCtorString:
                return mapTag;
              case promiseCtorString:
                return promiseTag;
              case setCtorString:
                return setTag;
              case weakMapCtorString:
                return weakMapTag;
            }
          }
          return result;
        };
      }
      module.exports = getTag;
    }
  });

  // node_modules/lodash/isEmpty.js
  var require_isEmpty = __commonJS({
    "node_modules/lodash/isEmpty.js"(exports, module) {
      var baseKeys = require_baseKeys();
      var getTag = require_getTag();
      var isArguments = require_isArguments();
      var isArray = require_isArray();
      var isArrayLike = require_isArrayLike();
      var isBuffer = require_isBuffer();
      var isPrototype = require_isPrototype();
      var isTypedArray = require_isTypedArray();
      var mapTag = "[object Map]";
      var setTag = "[object Set]";
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function isEmpty11(value) {
        if (value == null) {
          return true;
        }
        if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
          return !value.length;
        }
        var tag = getTag(value);
        if (tag == mapTag || tag == setTag) {
          return !value.size;
        }
        if (isPrototype(value)) {
          return !baseKeys(value).length;
        }
        for (var key in value) {
          if (hasOwnProperty.call(value, key)) {
            return false;
          }
        }
        return true;
      }
      module.exports = isEmpty11;
    }
  });

  // node_modules/lodash/_arrayMap.js
  var require_arrayMap = __commonJS({
    "node_modules/lodash/_arrayMap.js"(exports, module) {
      function arrayMap(array, iteratee) {
        var index = -1, length = array == null ? 0 : array.length, result = Array(length);
        while (++index < length) {
          result[index] = iteratee(array[index], index, array);
        }
        return result;
      }
      module.exports = arrayMap;
    }
  });

  // node_modules/lodash/isSymbol.js
  var require_isSymbol = __commonJS({
    "node_modules/lodash/isSymbol.js"(exports, module) {
      var baseGetTag = require_baseGetTag();
      var isObjectLike = require_isObjectLike();
      var symbolTag = "[object Symbol]";
      function isSymbol(value) {
        return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
      }
      module.exports = isSymbol;
    }
  });

  // node_modules/lodash/_isKey.js
  var require_isKey = __commonJS({
    "node_modules/lodash/_isKey.js"(exports, module) {
      var isArray = require_isArray();
      var isSymbol = require_isSymbol();
      var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
      var reIsPlainProp = /^\w*$/;
      function isKey(value, object) {
        if (isArray(value)) {
          return false;
        }
        var type = typeof value;
        if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
          return true;
        }
        return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
      }
      module.exports = isKey;
    }
  });

  // node_modules/lodash/memoize.js
  var require_memoize = __commonJS({
    "node_modules/lodash/memoize.js"(exports, module) {
      var MapCache = require_MapCache();
      var FUNC_ERROR_TEXT = "Expected a function";
      function memoize2(func, resolver) {
        if (typeof func != "function" || resolver != null && typeof resolver != "function") {
          throw new TypeError(FUNC_ERROR_TEXT);
        }
        var memoized = function() {
          var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
          if (cache.has(key)) {
            return cache.get(key);
          }
          var result = func.apply(this, args);
          memoized.cache = cache.set(key, result) || cache;
          return result;
        };
        memoized.cache = new (memoize2.Cache || MapCache)();
        return memoized;
      }
      memoize2.Cache = MapCache;
      module.exports = memoize2;
    }
  });

  // node_modules/lodash/_memoizeCapped.js
  var require_memoizeCapped = __commonJS({
    "node_modules/lodash/_memoizeCapped.js"(exports, module) {
      var memoize2 = require_memoize();
      var MAX_MEMOIZE_SIZE = 500;
      function memoizeCapped(func) {
        var result = memoize2(func, function(key) {
          if (cache.size === MAX_MEMOIZE_SIZE) {
            cache.clear();
          }
          return key;
        });
        var cache = result.cache;
        return result;
      }
      module.exports = memoizeCapped;
    }
  });

  // node_modules/lodash/_stringToPath.js
  var require_stringToPath = __commonJS({
    "node_modules/lodash/_stringToPath.js"(exports, module) {
      var memoizeCapped = require_memoizeCapped();
      var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
      var reEscapeChar = /\\(\\)?/g;
      var stringToPath = memoizeCapped(function(string) {
        var result = [];
        if (string.charCodeAt(0) === 46) {
          result.push("");
        }
        string.replace(rePropName, function(match, number4, quote, subString) {
          result.push(quote ? subString.replace(reEscapeChar, "$1") : number4 || match);
        });
        return result;
      });
      module.exports = stringToPath;
    }
  });

  // node_modules/lodash/_baseToString.js
  var require_baseToString = __commonJS({
    "node_modules/lodash/_baseToString.js"(exports, module) {
      var Symbol3 = require_Symbol();
      var arrayMap = require_arrayMap();
      var isArray = require_isArray();
      var isSymbol = require_isSymbol();
      var INFINITY = 1 / 0;
      var symbolProto = Symbol3 ? Symbol3.prototype : void 0;
      var symbolToString = symbolProto ? symbolProto.toString : void 0;
      function baseToString(value) {
        if (typeof value == "string") {
          return value;
        }
        if (isArray(value)) {
          return arrayMap(value, baseToString) + "";
        }
        if (isSymbol(value)) {
          return symbolToString ? symbolToString.call(value) : "";
        }
        var result = value + "";
        return result == "0" && 1 / value == -INFINITY ? "-0" : result;
      }
      module.exports = baseToString;
    }
  });

  // node_modules/lodash/toString.js
  var require_toString = __commonJS({
    "node_modules/lodash/toString.js"(exports, module) {
      var baseToString = require_baseToString();
      function toString(value) {
        return value == null ? "" : baseToString(value);
      }
      module.exports = toString;
    }
  });

  // node_modules/lodash/_castPath.js
  var require_castPath = __commonJS({
    "node_modules/lodash/_castPath.js"(exports, module) {
      var isArray = require_isArray();
      var isKey = require_isKey();
      var stringToPath = require_stringToPath();
      var toString = require_toString();
      function castPath(value, object) {
        if (isArray(value)) {
          return value;
        }
        return isKey(value, object) ? [value] : stringToPath(toString(value));
      }
      module.exports = castPath;
    }
  });

  // node_modules/lodash/_toKey.js
  var require_toKey = __commonJS({
    "node_modules/lodash/_toKey.js"(exports, module) {
      var isSymbol = require_isSymbol();
      var INFINITY = 1 / 0;
      function toKey(value) {
        if (typeof value == "string" || isSymbol(value)) {
          return value;
        }
        var result = value + "";
        return result == "0" && 1 / value == -INFINITY ? "-0" : result;
      }
      module.exports = toKey;
    }
  });

  // node_modules/lodash/_baseGet.js
  var require_baseGet = __commonJS({
    "node_modules/lodash/_baseGet.js"(exports, module) {
      var castPath = require_castPath();
      var toKey = require_toKey();
      function baseGet(object, path2) {
        path2 = castPath(path2, object);
        var index = 0, length = path2.length;
        while (object != null && index < length) {
          object = object[toKey(path2[index++])];
        }
        return index && index == length ? object : void 0;
      }
      module.exports = baseGet;
    }
  });

  // node_modules/lodash/_setCacheAdd.js
  var require_setCacheAdd = __commonJS({
    "node_modules/lodash/_setCacheAdd.js"(exports, module) {
      var HASH_UNDEFINED = "__lodash_hash_undefined__";
      function setCacheAdd(value) {
        this.__data__.set(value, HASH_UNDEFINED);
        return this;
      }
      module.exports = setCacheAdd;
    }
  });

  // node_modules/lodash/_setCacheHas.js
  var require_setCacheHas = __commonJS({
    "node_modules/lodash/_setCacheHas.js"(exports, module) {
      function setCacheHas(value) {
        return this.__data__.has(value);
      }
      module.exports = setCacheHas;
    }
  });

  // node_modules/lodash/_SetCache.js
  var require_SetCache = __commonJS({
    "node_modules/lodash/_SetCache.js"(exports, module) {
      var MapCache = require_MapCache();
      var setCacheAdd = require_setCacheAdd();
      var setCacheHas = require_setCacheHas();
      function SetCache(values) {
        var index = -1, length = values == null ? 0 : values.length;
        this.__data__ = new MapCache();
        while (++index < length) {
          this.add(values[index]);
        }
      }
      SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
      SetCache.prototype.has = setCacheHas;
      module.exports = SetCache;
    }
  });

  // node_modules/lodash/_arraySome.js
  var require_arraySome = __commonJS({
    "node_modules/lodash/_arraySome.js"(exports, module) {
      function arraySome(array, predicate) {
        var index = -1, length = array == null ? 0 : array.length;
        while (++index < length) {
          if (predicate(array[index], index, array)) {
            return true;
          }
        }
        return false;
      }
      module.exports = arraySome;
    }
  });

  // node_modules/lodash/_cacheHas.js
  var require_cacheHas = __commonJS({
    "node_modules/lodash/_cacheHas.js"(exports, module) {
      function cacheHas(cache, key) {
        return cache.has(key);
      }
      module.exports = cacheHas;
    }
  });

  // node_modules/lodash/_equalArrays.js
  var require_equalArrays = __commonJS({
    "node_modules/lodash/_equalArrays.js"(exports, module) {
      var SetCache = require_SetCache();
      var arraySome = require_arraySome();
      var cacheHas = require_cacheHas();
      var COMPARE_PARTIAL_FLAG = 1;
      var COMPARE_UNORDERED_FLAG = 2;
      function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
        var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
        if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
          return false;
        }
        var arrStacked = stack.get(array);
        var othStacked = stack.get(other);
        if (arrStacked && othStacked) {
          return arrStacked == other && othStacked == array;
        }
        var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
        stack.set(array, other);
        stack.set(other, array);
        while (++index < arrLength) {
          var arrValue = array[index], othValue = other[index];
          if (customizer) {
            var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
          }
          if (compared !== void 0) {
            if (compared) {
              continue;
            }
            result = false;
            break;
          }
          if (seen) {
            if (!arraySome(other, function(othValue2, othIndex) {
              if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
                return seen.push(othIndex);
              }
            })) {
              result = false;
              break;
            }
          } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
            result = false;
            break;
          }
        }
        stack["delete"](array);
        stack["delete"](other);
        return result;
      }
      module.exports = equalArrays;
    }
  });

  // node_modules/lodash/_mapToArray.js
  var require_mapToArray = __commonJS({
    "node_modules/lodash/_mapToArray.js"(exports, module) {
      function mapToArray(map2) {
        var index = -1, result = Array(map2.size);
        map2.forEach(function(value, key) {
          result[++index] = [key, value];
        });
        return result;
      }
      module.exports = mapToArray;
    }
  });

  // node_modules/lodash/_setToArray.js
  var require_setToArray = __commonJS({
    "node_modules/lodash/_setToArray.js"(exports, module) {
      function setToArray(set) {
        var index = -1, result = Array(set.size);
        set.forEach(function(value) {
          result[++index] = value;
        });
        return result;
      }
      module.exports = setToArray;
    }
  });

  // node_modules/lodash/_equalByTag.js
  var require_equalByTag = __commonJS({
    "node_modules/lodash/_equalByTag.js"(exports, module) {
      var Symbol3 = require_Symbol();
      var Uint8Array2 = require_Uint8Array();
      var eq = require_eq();
      var equalArrays = require_equalArrays();
      var mapToArray = require_mapToArray();
      var setToArray = require_setToArray();
      var COMPARE_PARTIAL_FLAG = 1;
      var COMPARE_UNORDERED_FLAG = 2;
      var boolTag = "[object Boolean]";
      var dateTag = "[object Date]";
      var errorTag = "[object Error]";
      var mapTag = "[object Map]";
      var numberTag = "[object Number]";
      var regexpTag = "[object RegExp]";
      var setTag = "[object Set]";
      var stringTag = "[object String]";
      var symbolTag = "[object Symbol]";
      var arrayBufferTag = "[object ArrayBuffer]";
      var dataViewTag = "[object DataView]";
      var symbolProto = Symbol3 ? Symbol3.prototype : void 0;
      var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
      function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
        switch (tag) {
          case dataViewTag:
            if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
              return false;
            }
            object = object.buffer;
            other = other.buffer;
          case arrayBufferTag:
            if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
              return false;
            }
            return true;
          case boolTag:
          case dateTag:
          case numberTag:
            return eq(+object, +other);
          case errorTag:
            return object.name == other.name && object.message == other.message;
          case regexpTag:
          case stringTag:
            return object == other + "";
          case mapTag:
            var convert = mapToArray;
          case setTag:
            var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
            convert || (convert = setToArray);
            if (object.size != other.size && !isPartial) {
              return false;
            }
            var stacked = stack.get(object);
            if (stacked) {
              return stacked == other;
            }
            bitmask |= COMPARE_UNORDERED_FLAG;
            stack.set(object, other);
            var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
            stack["delete"](object);
            return result;
          case symbolTag:
            if (symbolValueOf) {
              return symbolValueOf.call(object) == symbolValueOf.call(other);
            }
        }
        return false;
      }
      module.exports = equalByTag;
    }
  });

  // node_modules/lodash/_arrayPush.js
  var require_arrayPush = __commonJS({
    "node_modules/lodash/_arrayPush.js"(exports, module) {
      function arrayPush(array, values) {
        var index = -1, length = values.length, offset2 = array.length;
        while (++index < length) {
          array[offset2 + index] = values[index];
        }
        return array;
      }
      module.exports = arrayPush;
    }
  });

  // node_modules/lodash/_baseGetAllKeys.js
  var require_baseGetAllKeys = __commonJS({
    "node_modules/lodash/_baseGetAllKeys.js"(exports, module) {
      var arrayPush = require_arrayPush();
      var isArray = require_isArray();
      function baseGetAllKeys(object, keysFunc, symbolsFunc) {
        var result = keysFunc(object);
        return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
      }
      module.exports = baseGetAllKeys;
    }
  });

  // node_modules/lodash/_arrayFilter.js
  var require_arrayFilter = __commonJS({
    "node_modules/lodash/_arrayFilter.js"(exports, module) {
      function arrayFilter(array, predicate) {
        var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
        while (++index < length) {
          var value = array[index];
          if (predicate(value, index, array)) {
            result[resIndex++] = value;
          }
        }
        return result;
      }
      module.exports = arrayFilter;
    }
  });

  // node_modules/lodash/stubArray.js
  var require_stubArray = __commonJS({
    "node_modules/lodash/stubArray.js"(exports, module) {
      function stubArray() {
        return [];
      }
      module.exports = stubArray;
    }
  });

  // node_modules/lodash/_getSymbols.js
  var require_getSymbols = __commonJS({
    "node_modules/lodash/_getSymbols.js"(exports, module) {
      var arrayFilter = require_arrayFilter();
      var stubArray = require_stubArray();
      var objectProto = Object.prototype;
      var propertyIsEnumerable = objectProto.propertyIsEnumerable;
      var nativeGetSymbols = Object.getOwnPropertySymbols;
      var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
        if (object == null) {
          return [];
        }
        object = Object(object);
        return arrayFilter(nativeGetSymbols(object), function(symbol) {
          return propertyIsEnumerable.call(object, symbol);
        });
      };
      module.exports = getSymbols;
    }
  });

  // node_modules/lodash/keys.js
  var require_keys = __commonJS({
    "node_modules/lodash/keys.js"(exports, module) {
      var arrayLikeKeys = require_arrayLikeKeys();
      var baseKeys = require_baseKeys();
      var isArrayLike = require_isArrayLike();
      function keys(object) {
        return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
      }
      module.exports = keys;
    }
  });

  // node_modules/lodash/_getAllKeys.js
  var require_getAllKeys = __commonJS({
    "node_modules/lodash/_getAllKeys.js"(exports, module) {
      var baseGetAllKeys = require_baseGetAllKeys();
      var getSymbols = require_getSymbols();
      var keys = require_keys();
      function getAllKeys(object) {
        return baseGetAllKeys(object, keys, getSymbols);
      }
      module.exports = getAllKeys;
    }
  });

  // node_modules/lodash/_equalObjects.js
  var require_equalObjects = __commonJS({
    "node_modules/lodash/_equalObjects.js"(exports, module) {
      var getAllKeys = require_getAllKeys();
      var COMPARE_PARTIAL_FLAG = 1;
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
        var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
        if (objLength != othLength && !isPartial) {
          return false;
        }
        var index = objLength;
        while (index--) {
          var key = objProps[index];
          if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
            return false;
          }
        }
        var objStacked = stack.get(object);
        var othStacked = stack.get(other);
        if (objStacked && othStacked) {
          return objStacked == other && othStacked == object;
        }
        var result = true;
        stack.set(object, other);
        stack.set(other, object);
        var skipCtor = isPartial;
        while (++index < objLength) {
          key = objProps[index];
          var objValue = object[key], othValue = other[key];
          if (customizer) {
            var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
          }
          if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
            result = false;
            break;
          }
          skipCtor || (skipCtor = key == "constructor");
        }
        if (result && !skipCtor) {
          var objCtor = object.constructor, othCtor = other.constructor;
          if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
            result = false;
          }
        }
        stack["delete"](object);
        stack["delete"](other);
        return result;
      }
      module.exports = equalObjects;
    }
  });

  // node_modules/lodash/_baseIsEqualDeep.js
  var require_baseIsEqualDeep = __commonJS({
    "node_modules/lodash/_baseIsEqualDeep.js"(exports, module) {
      var Stack = require_Stack();
      var equalArrays = require_equalArrays();
      var equalByTag = require_equalByTag();
      var equalObjects = require_equalObjects();
      var getTag = require_getTag();
      var isArray = require_isArray();
      var isBuffer = require_isBuffer();
      var isTypedArray = require_isTypedArray();
      var COMPARE_PARTIAL_FLAG = 1;
      var argsTag = "[object Arguments]";
      var arrayTag = "[object Array]";
      var objectTag = "[object Object]";
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
        var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
        objTag = objTag == argsTag ? objectTag : objTag;
        othTag = othTag == argsTag ? objectTag : othTag;
        var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
        if (isSameTag && isBuffer(object)) {
          if (!isBuffer(other)) {
            return false;
          }
          objIsArr = true;
          objIsObj = false;
        }
        if (isSameTag && !objIsObj) {
          stack || (stack = new Stack());
          return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
        }
        if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
          var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
          if (objIsWrapped || othIsWrapped) {
            var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
            stack || (stack = new Stack());
            return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
          }
        }
        if (!isSameTag) {
          return false;
        }
        stack || (stack = new Stack());
        return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
      }
      module.exports = baseIsEqualDeep;
    }
  });

  // node_modules/lodash/_baseIsEqual.js
  var require_baseIsEqual = __commonJS({
    "node_modules/lodash/_baseIsEqual.js"(exports, module) {
      var baseIsEqualDeep = require_baseIsEqualDeep();
      var isObjectLike = require_isObjectLike();
      function baseIsEqual(value, other, bitmask, customizer, stack) {
        if (value === other) {
          return true;
        }
        if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
          return value !== value && other !== other;
        }
        return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
      }
      module.exports = baseIsEqual;
    }
  });

  // node_modules/lodash/_baseIsMatch.js
  var require_baseIsMatch = __commonJS({
    "node_modules/lodash/_baseIsMatch.js"(exports, module) {
      var Stack = require_Stack();
      var baseIsEqual = require_baseIsEqual();
      var COMPARE_PARTIAL_FLAG = 1;
      var COMPARE_UNORDERED_FLAG = 2;
      function baseIsMatch(object, source, matchData, customizer) {
        var index = matchData.length, length = index, noCustomizer = !customizer;
        if (object == null) {
          return !length;
        }
        object = Object(object);
        while (index--) {
          var data = matchData[index];
          if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
            return false;
          }
        }
        while (++index < length) {
          data = matchData[index];
          var key = data[0], objValue = object[key], srcValue = data[1];
          if (noCustomizer && data[2]) {
            if (objValue === void 0 && !(key in object)) {
              return false;
            }
          } else {
            var stack = new Stack();
            if (customizer) {
              var result = customizer(objValue, srcValue, key, object, source, stack);
            }
            if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) {
              return false;
            }
          }
        }
        return true;
      }
      module.exports = baseIsMatch;
    }
  });

  // node_modules/lodash/_isStrictComparable.js
  var require_isStrictComparable = __commonJS({
    "node_modules/lodash/_isStrictComparable.js"(exports, module) {
      var isObject3 = require_isObject();
      function isStrictComparable(value) {
        return value === value && !isObject3(value);
      }
      module.exports = isStrictComparable;
    }
  });

  // node_modules/lodash/_getMatchData.js
  var require_getMatchData = __commonJS({
    "node_modules/lodash/_getMatchData.js"(exports, module) {
      var isStrictComparable = require_isStrictComparable();
      var keys = require_keys();
      function getMatchData(object) {
        var result = keys(object), length = result.length;
        while (length--) {
          var key = result[length], value = object[key];
          result[length] = [key, value, isStrictComparable(value)];
        }
        return result;
      }
      module.exports = getMatchData;
    }
  });

  // node_modules/lodash/_matchesStrictComparable.js
  var require_matchesStrictComparable = __commonJS({
    "node_modules/lodash/_matchesStrictComparable.js"(exports, module) {
      function matchesStrictComparable(key, srcValue) {
        return function(object) {
          if (object == null) {
            return false;
          }
          return object[key] === srcValue && (srcValue !== void 0 || key in Object(object));
        };
      }
      module.exports = matchesStrictComparable;
    }
  });

  // node_modules/lodash/_baseMatches.js
  var require_baseMatches = __commonJS({
    "node_modules/lodash/_baseMatches.js"(exports, module) {
      var baseIsMatch = require_baseIsMatch();
      var getMatchData = require_getMatchData();
      var matchesStrictComparable = require_matchesStrictComparable();
      function baseMatches(source) {
        var matchData = getMatchData(source);
        if (matchData.length == 1 && matchData[0][2]) {
          return matchesStrictComparable(matchData[0][0], matchData[0][1]);
        }
        return function(object) {
          return object === source || baseIsMatch(object, source, matchData);
        };
      }
      module.exports = baseMatches;
    }
  });

  // node_modules/lodash/get.js
  var require_get = __commonJS({
    "node_modules/lodash/get.js"(exports, module) {
      var baseGet = require_baseGet();
      function get(object, path2, defaultValue) {
        var result = object == null ? void 0 : baseGet(object, path2);
        return result === void 0 ? defaultValue : result;
      }
      module.exports = get;
    }
  });

  // node_modules/lodash/_baseHasIn.js
  var require_baseHasIn = __commonJS({
    "node_modules/lodash/_baseHasIn.js"(exports, module) {
      function baseHasIn(object, key) {
        return object != null && key in Object(object);
      }
      module.exports = baseHasIn;
    }
  });

  // node_modules/lodash/_hasPath.js
  var require_hasPath = __commonJS({
    "node_modules/lodash/_hasPath.js"(exports, module) {
      var castPath = require_castPath();
      var isArguments = require_isArguments();
      var isArray = require_isArray();
      var isIndex = require_isIndex();
      var isLength = require_isLength();
      var toKey = require_toKey();
      function hasPath(object, path2, hasFunc) {
        path2 = castPath(path2, object);
        var index = -1, length = path2.length, result = false;
        while (++index < length) {
          var key = toKey(path2[index]);
          if (!(result = object != null && hasFunc(object, key))) {
            break;
          }
          object = object[key];
        }
        if (result || ++index != length) {
          return result;
        }
        length = object == null ? 0 : object.length;
        return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
      }
      module.exports = hasPath;
    }
  });

  // node_modules/lodash/hasIn.js
  var require_hasIn = __commonJS({
    "node_modules/lodash/hasIn.js"(exports, module) {
      var baseHasIn = require_baseHasIn();
      var hasPath = require_hasPath();
      function hasIn(object, path2) {
        return object != null && hasPath(object, path2, baseHasIn);
      }
      module.exports = hasIn;
    }
  });

  // node_modules/lodash/_baseMatchesProperty.js
  var require_baseMatchesProperty = __commonJS({
    "node_modules/lodash/_baseMatchesProperty.js"(exports, module) {
      var baseIsEqual = require_baseIsEqual();
      var get = require_get();
      var hasIn = require_hasIn();
      var isKey = require_isKey();
      var isStrictComparable = require_isStrictComparable();
      var matchesStrictComparable = require_matchesStrictComparable();
      var toKey = require_toKey();
      var COMPARE_PARTIAL_FLAG = 1;
      var COMPARE_UNORDERED_FLAG = 2;
      function baseMatchesProperty(path2, srcValue) {
        if (isKey(path2) && isStrictComparable(srcValue)) {
          return matchesStrictComparable(toKey(path2), srcValue);
        }
        return function(object) {
          var objValue = get(object, path2);
          return objValue === void 0 && objValue === srcValue ? hasIn(object, path2) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
        };
      }
      module.exports = baseMatchesProperty;
    }
  });

  // node_modules/lodash/_baseProperty.js
  var require_baseProperty = __commonJS({
    "node_modules/lodash/_baseProperty.js"(exports, module) {
      function baseProperty(key) {
        return function(object) {
          return object == null ? void 0 : object[key];
        };
      }
      module.exports = baseProperty;
    }
  });

  // node_modules/lodash/_basePropertyDeep.js
  var require_basePropertyDeep = __commonJS({
    "node_modules/lodash/_basePropertyDeep.js"(exports, module) {
      var baseGet = require_baseGet();
      function basePropertyDeep(path2) {
        return function(object) {
          return baseGet(object, path2);
        };
      }
      module.exports = basePropertyDeep;
    }
  });

  // node_modules/lodash/property.js
  var require_property = __commonJS({
    "node_modules/lodash/property.js"(exports, module) {
      var baseProperty = require_baseProperty();
      var basePropertyDeep = require_basePropertyDeep();
      var isKey = require_isKey();
      var toKey = require_toKey();
      function property3(path2) {
        return isKey(path2) ? baseProperty(toKey(path2)) : basePropertyDeep(path2);
      }
      module.exports = property3;
    }
  });

  // node_modules/lodash/_baseIteratee.js
  var require_baseIteratee = __commonJS({
    "node_modules/lodash/_baseIteratee.js"(exports, module) {
      var baseMatches = require_baseMatches();
      var baseMatchesProperty = require_baseMatchesProperty();
      var identity5 = require_identity();
      var isArray = require_isArray();
      var property3 = require_property();
      function baseIteratee(value) {
        if (typeof value == "function") {
          return value;
        }
        if (value == null) {
          return identity5;
        }
        if (typeof value == "object") {
          return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
        }
        return property3(value);
      }
      module.exports = baseIteratee;
    }
  });

  // node_modules/lodash/_baseForOwn.js
  var require_baseForOwn = __commonJS({
    "node_modules/lodash/_baseForOwn.js"(exports, module) {
      var baseFor = require_baseFor();
      var keys = require_keys();
      function baseForOwn(object, iteratee) {
        return object && baseFor(object, iteratee, keys);
      }
      module.exports = baseForOwn;
    }
  });

  // node_modules/lodash/_createBaseEach.js
  var require_createBaseEach = __commonJS({
    "node_modules/lodash/_createBaseEach.js"(exports, module) {
      var isArrayLike = require_isArrayLike();
      function createBaseEach(eachFunc, fromRight) {
        return function(collection, iteratee) {
          if (collection == null) {
            return collection;
          }
          if (!isArrayLike(collection)) {
            return eachFunc(collection, iteratee);
          }
          var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection);
          while (fromRight ? index-- : ++index < length) {
            if (iteratee(iterable[index], index, iterable) === false) {
              break;
            }
          }
          return collection;
        };
      }
      module.exports = createBaseEach;
    }
  });

  // node_modules/lodash/_baseEach.js
  var require_baseEach = __commonJS({
    "node_modules/lodash/_baseEach.js"(exports, module) {
      var baseForOwn = require_baseForOwn();
      var createBaseEach = require_createBaseEach();
      var baseEach = createBaseEach(baseForOwn);
      module.exports = baseEach;
    }
  });

  // node_modules/lodash/_baseMap.js
  var require_baseMap = __commonJS({
    "node_modules/lodash/_baseMap.js"(exports, module) {
      var baseEach = require_baseEach();
      var isArrayLike = require_isArrayLike();
      function baseMap(collection, iteratee) {
        var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
        baseEach(collection, function(value, key, collection2) {
          result[++index] = iteratee(value, key, collection2);
        });
        return result;
      }
      module.exports = baseMap;
    }
  });

  // node_modules/lodash/_baseSortBy.js
  var require_baseSortBy = __commonJS({
    "node_modules/lodash/_baseSortBy.js"(exports, module) {
      function baseSortBy(array, comparer) {
        var length = array.length;
        array.sort(comparer);
        while (length--) {
          array[length] = array[length].value;
        }
        return array;
      }
      module.exports = baseSortBy;
    }
  });

  // node_modules/lodash/_compareAscending.js
  var require_compareAscending = __commonJS({
    "node_modules/lodash/_compareAscending.js"(exports, module) {
      var isSymbol = require_isSymbol();
      function compareAscending(value, other) {
        if (value !== other) {
          var valIsDefined = value !== void 0, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
          var othIsDefined = other !== void 0, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
          if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
            return 1;
          }
          if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
            return -1;
          }
        }
        return 0;
      }
      module.exports = compareAscending;
    }
  });

  // node_modules/lodash/_compareMultiple.js
  var require_compareMultiple = __commonJS({
    "node_modules/lodash/_compareMultiple.js"(exports, module) {
      var compareAscending = require_compareAscending();
      function compareMultiple(object, other, orders) {
        var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
        while (++index < length) {
          var result = compareAscending(objCriteria[index], othCriteria[index]);
          if (result) {
            if (index >= ordersLength) {
              return result;
            }
            var order2 = orders[index];
            return result * (order2 == "desc" ? -1 : 1);
          }
        }
        return object.index - other.index;
      }
      module.exports = compareMultiple;
    }
  });

  // node_modules/lodash/_baseOrderBy.js
  var require_baseOrderBy = __commonJS({
    "node_modules/lodash/_baseOrderBy.js"(exports, module) {
      var arrayMap = require_arrayMap();
      var baseGet = require_baseGet();
      var baseIteratee = require_baseIteratee();
      var baseMap = require_baseMap();
      var baseSortBy = require_baseSortBy();
      var baseUnary = require_baseUnary();
      var compareMultiple = require_compareMultiple();
      var identity5 = require_identity();
      var isArray = require_isArray();
      function baseOrderBy(collection, iteratees, orders) {
        if (iteratees.length) {
          iteratees = arrayMap(iteratees, function(iteratee) {
            if (isArray(iteratee)) {
              return function(value) {
                return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
              };
            }
            return iteratee;
          });
        } else {
          iteratees = [identity5];
        }
        var index = -1;
        iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
        var result = baseMap(collection, function(value, key, collection2) {
          var criteria = arrayMap(iteratees, function(iteratee) {
            return iteratee(value);
          });
          return { "criteria": criteria, "index": ++index, "value": value };
        });
        return baseSortBy(result, function(object, other) {
          return compareMultiple(object, other, orders);
        });
      }
      module.exports = baseOrderBy;
    }
  });

  // node_modules/lodash/orderBy.js
  var require_orderBy = __commonJS({
    "node_modules/lodash/orderBy.js"(exports, module) {
      var baseOrderBy = require_baseOrderBy();
      var isArray = require_isArray();
      function orderBy5(collection, iteratees, orders, guard) {
        if (collection == null) {
          return [];
        }
        if (!isArray(iteratees)) {
          iteratees = iteratees == null ? [] : [iteratees];
        }
        orders = guard ? void 0 : orders;
        if (!isArray(orders)) {
          orders = orders == null ? [] : [orders];
        }
        return baseOrderBy(collection, iteratees, orders);
      }
      module.exports = orderBy5;
    }
  });

  // node_modules/lodash/uniqueId.js
  var require_uniqueId = __commonJS({
    "node_modules/lodash/uniqueId.js"(exports, module) {
      var toString = require_toString();
      var idCounter = 0;
      function uniqueId6(prefix) {
        var id = ++idCounter;
        return toString(prefix) + id;
      }
      module.exports = uniqueId6;
    }
  });

  // node_modules/lodash/_baseSet.js
  var require_baseSet = __commonJS({
    "node_modules/lodash/_baseSet.js"(exports, module) {
      var assignValue = require_assignValue();
      var castPath = require_castPath();
      var isIndex = require_isIndex();
      var isObject3 = require_isObject();
      var toKey = require_toKey();
      function baseSet(object, path2, value, customizer) {
        if (!isObject3(object)) {
          return object;
        }
        path2 = castPath(path2, object);
        var index = -1, length = path2.length, lastIndex = length - 1, nested = object;
        while (nested != null && ++index < length) {
          var key = toKey(path2[index]), newValue = value;
          if (key === "__proto__" || key === "constructor" || key === "prototype") {
            return object;
          }
          if (index != lastIndex) {
            var objValue = nested[key];
            newValue = customizer ? customizer(objValue, key, nested) : void 0;
            if (newValue === void 0) {
              newValue = isObject3(objValue) ? objValue : isIndex(path2[index + 1]) ? [] : {};
            }
          }
          assignValue(nested, key, newValue);
          nested = nested[key];
        }
        return object;
      }
      module.exports = baseSet;
    }
  });

  // node_modules/lodash/_basePickBy.js
  var require_basePickBy = __commonJS({
    "node_modules/lodash/_basePickBy.js"(exports, module) {
      var baseGet = require_baseGet();
      var baseSet = require_baseSet();
      var castPath = require_castPath();
      function basePickBy(object, paths, predicate) {
        var index = -1, length = paths.length, result = {};
        while (++index < length) {
          var path2 = paths[index], value = baseGet(object, path2);
          if (predicate(value, path2)) {
            baseSet(result, castPath(path2, object), value);
          }
        }
        return result;
      }
      module.exports = basePickBy;
    }
  });

  // node_modules/lodash/_basePick.js
  var require_basePick = __commonJS({
    "node_modules/lodash/_basePick.js"(exports, module) {
      var basePickBy = require_basePickBy();
      var hasIn = require_hasIn();
      function basePick(object, paths) {
        return basePickBy(object, paths, function(value, path2) {
          return hasIn(object, path2);
        });
      }
      module.exports = basePick;
    }
  });

  // node_modules/lodash/_isFlattenable.js
  var require_isFlattenable = __commonJS({
    "node_modules/lodash/_isFlattenable.js"(exports, module) {
      var Symbol3 = require_Symbol();
      var isArguments = require_isArguments();
      var isArray = require_isArray();
      var spreadableSymbol = Symbol3 ? Symbol3.isConcatSpreadable : void 0;
      function isFlattenable(value) {
        return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
      }
      module.exports = isFlattenable;
    }
  });

  // node_modules/lodash/_baseFlatten.js
  var require_baseFlatten = __commonJS({
    "node_modules/lodash/_baseFlatten.js"(exports, module) {
      var arrayPush = require_arrayPush();
      var isFlattenable = require_isFlattenable();
      function baseFlatten(array, depth, predicate, isStrict, result) {
        var index = -1, length = array.length;
        predicate || (predicate = isFlattenable);
        result || (result = []);
        while (++index < length) {
          var value = array[index];
          if (depth > 0 && predicate(value)) {
            if (depth > 1) {
              baseFlatten(value, depth - 1, predicate, isStrict, result);
            } else {
              arrayPush(result, value);
            }
          } else if (!isStrict) {
            result[result.length] = value;
          }
        }
        return result;
      }
      module.exports = baseFlatten;
    }
  });

  // node_modules/lodash/flatten.js
  var require_flatten = __commonJS({
    "node_modules/lodash/flatten.js"(exports, module) {
      var baseFlatten = require_baseFlatten();
      function flatten2(array) {
        var length = array == null ? 0 : array.length;
        return length ? baseFlatten(array, 1) : [];
      }
      module.exports = flatten2;
    }
  });

  // node_modules/lodash/_flatRest.js
  var require_flatRest = __commonJS({
    "node_modules/lodash/_flatRest.js"(exports, module) {
      var flatten2 = require_flatten();
      var overRest = require_overRest();
      var setToString = require_setToString();
      function flatRest(func) {
        return setToString(overRest(func, void 0, flatten2), func + "");
      }
      module.exports = flatRest;
    }
  });

  // node_modules/lodash/pick.js
  var require_pick = __commonJS({
    "node_modules/lodash/pick.js"(exports, module) {
      var basePick = require_basePick();
      var flatRest = require_flatRest();
      var pick5 = flatRest(function(object, paths) {
        return object == null ? {} : basePick(object, paths);
      });
      module.exports = pick5;
    }
  });

  // node_modules/react-fast-compare/index.js
  var require_react_fast_compare = __commonJS({
    "node_modules/react-fast-compare/index.js"(exports, module) {
      var hasElementType = typeof Element !== "undefined";
      var hasMap = typeof Map === "function";
      var hasSet = typeof Set === "function";
      var hasArrayBuffer = typeof ArrayBuffer === "function" && !!ArrayBuffer.isView;
      function equal(a2, b) {
        if (a2 === b) return true;
        if (a2 && b && typeof a2 == "object" && typeof b == "object") {
          if (a2.constructor !== b.constructor) return false;
          var length, i, keys;
          if (Array.isArray(a2)) {
            length = a2.length;
            if (length != b.length) return false;
            for (i = length; i-- !== 0; )
              if (!equal(a2[i], b[i])) return false;
            return true;
          }
          var it;
          if (hasMap && a2 instanceof Map && b instanceof Map) {
            if (a2.size !== b.size) return false;
            it = a2.entries();
            while (!(i = it.next()).done)
              if (!b.has(i.value[0])) return false;
            it = a2.entries();
            while (!(i = it.next()).done)
              if (!equal(i.value[1], b.get(i.value[0]))) return false;
            return true;
          }
          if (hasSet && a2 instanceof Set && b instanceof Set) {
            if (a2.size !== b.size) return false;
            it = a2.entries();
            while (!(i = it.next()).done)
              if (!b.has(i.value[0])) return false;
            return true;
          }
          if (hasArrayBuffer && ArrayBuffer.isView(a2) && ArrayBuffer.isView(b)) {
            length = a2.length;
            if (length != b.length) return false;
            for (i = length; i-- !== 0; )
              if (a2[i] !== b[i]) return false;
            return true;
          }
          if (a2.constructor === RegExp) return a2.source === b.source && a2.flags === b.flags;
          if (a2.valueOf !== Object.prototype.valueOf && typeof a2.valueOf === "function" && typeof b.valueOf === "function") return a2.valueOf() === b.valueOf();
          if (a2.toString !== Object.prototype.toString && typeof a2.toString === "function" && typeof b.toString === "function") return a2.toString() === b.toString();
          keys = Object.keys(a2);
          length = keys.length;
          if (length !== Object.keys(b).length) return false;
          for (i = length; i-- !== 0; )
            if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
          if (hasElementType && a2 instanceof Element) return false;
          for (i = length; i-- !== 0; ) {
            if ((keys[i] === "_owner" || keys[i] === "__v" || keys[i] === "__o") && a2.$$typeof) {
              continue;
            }
            if (!equal(a2[keys[i]], b[keys[i]])) return false;
          }
          return true;
        }
        return a2 !== a2 && b !== b;
      }
      module.exports = function isEqual12(a2, b) {
        try {
          return equal(a2, b);
        } catch (error) {
          if ((error.message || "").match(/stack|recursion/i)) {
            console.warn("react-fast-compare cannot handle circular refs");
            return false;
          }
          throw error;
        }
      };
    }
  });

  // node_modules/lodash/_getSymbolsIn.js
  var require_getSymbolsIn = __commonJS({
    "node_modules/lodash/_getSymbolsIn.js"(exports, module) {
      var arrayPush = require_arrayPush();
      var getPrototype = require_getPrototype();
      var getSymbols = require_getSymbols();
      var stubArray = require_stubArray();
      var nativeGetSymbols = Object.getOwnPropertySymbols;
      var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
        var result = [];
        while (object) {
          arrayPush(result, getSymbols(object));
          object = getPrototype(object);
        }
        return result;
      };
      module.exports = getSymbolsIn;
    }
  });

  // node_modules/lodash/_getAllKeysIn.js
  var require_getAllKeysIn = __commonJS({
    "node_modules/lodash/_getAllKeysIn.js"(exports, module) {
      var baseGetAllKeys = require_baseGetAllKeys();
      var getSymbolsIn = require_getSymbolsIn();
      var keysIn = require_keysIn();
      function getAllKeysIn(object) {
        return baseGetAllKeys(object, keysIn, getSymbolsIn);
      }
      module.exports = getAllKeysIn;
    }
  });

  // node_modules/lodash/pickBy.js
  var require_pickBy = __commonJS({
    "node_modules/lodash/pickBy.js"(exports, module) {
      var arrayMap = require_arrayMap();
      var baseIteratee = require_baseIteratee();
      var basePickBy = require_basePickBy();
      var getAllKeysIn = require_getAllKeysIn();
      function pickBy2(object, predicate) {
        if (object == null) {
          return {};
        }
        var props = arrayMap(getAllKeysIn(object), function(prop) {
          return [prop];
        });
        predicate = baseIteratee(predicate);
        return basePickBy(object, props, function(value, path2) {
          return predicate(value, path2[0]);
        });
      }
      module.exports = pickBy2;
    }
  });

  // node_modules/lodash/negate.js
  var require_negate = __commonJS({
    "node_modules/lodash/negate.js"(exports, module) {
      var FUNC_ERROR_TEXT = "Expected a function";
      function negate(predicate) {
        if (typeof predicate != "function") {
          throw new TypeError(FUNC_ERROR_TEXT);
        }
        return function() {
          var args = arguments;
          switch (args.length) {
            case 0:
              return !predicate.call(this);
            case 1:
              return !predicate.call(this, args[0]);
            case 2:
              return !predicate.call(this, args[0], args[1]);
            case 3:
              return !predicate.call(this, args[0], args[1], args[2]);
          }
          return !predicate.apply(this, args);
        };
      }
      module.exports = negate;
    }
  });

  // node_modules/lodash/omitBy.js
  var require_omitBy = __commonJS({
    "node_modules/lodash/omitBy.js"(exports, module) {
      var baseIteratee = require_baseIteratee();
      var negate = require_negate();
      var pickBy2 = require_pickBy();
      function omitBy3(object, predicate) {
        return pickBy2(object, negate(baseIteratee(predicate)));
      }
      module.exports = omitBy3;
    }
  });

  // node_modules/lodash/_baseFindIndex.js
  var require_baseFindIndex = __commonJS({
    "node_modules/lodash/_baseFindIndex.js"(exports, module) {
      function baseFindIndex(array, predicate, fromIndex, fromRight) {
        var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
        while (fromRight ? index-- : ++index < length) {
          if (predicate(array[index], index, array)) {
            return index;
          }
        }
        return -1;
      }
      module.exports = baseFindIndex;
    }
  });

  // node_modules/lodash/_baseIsNaN.js
  var require_baseIsNaN = __commonJS({
    "node_modules/lodash/_baseIsNaN.js"(exports, module) {
      function baseIsNaN(value) {
        return value !== value;
      }
      module.exports = baseIsNaN;
    }
  });

  // node_modules/lodash/_strictIndexOf.js
  var require_strictIndexOf = __commonJS({
    "node_modules/lodash/_strictIndexOf.js"(exports, module) {
      function strictIndexOf(array, value, fromIndex) {
        var index = fromIndex - 1, length = array.length;
        while (++index < length) {
          if (array[index] === value) {
            return index;
          }
        }
        return -1;
      }
      module.exports = strictIndexOf;
    }
  });

  // node_modules/lodash/_baseIndexOf.js
  var require_baseIndexOf = __commonJS({
    "node_modules/lodash/_baseIndexOf.js"(exports, module) {
      var baseFindIndex = require_baseFindIndex();
      var baseIsNaN = require_baseIsNaN();
      var strictIndexOf = require_strictIndexOf();
      function baseIndexOf(array, value, fromIndex) {
        return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
      }
      module.exports = baseIndexOf;
    }
  });

  // node_modules/lodash/_arrayIncludes.js
  var require_arrayIncludes = __commonJS({
    "node_modules/lodash/_arrayIncludes.js"(exports, module) {
      var baseIndexOf = require_baseIndexOf();
      function arrayIncludes(array, value) {
        var length = array == null ? 0 : array.length;
        return !!length && baseIndexOf(array, value, 0) > -1;
      }
      module.exports = arrayIncludes;
    }
  });

  // node_modules/lodash/_arrayIncludesWith.js
  var require_arrayIncludesWith = __commonJS({
    "node_modules/lodash/_arrayIncludesWith.js"(exports, module) {
      function arrayIncludesWith(array, value, comparator) {
        var index = -1, length = array == null ? 0 : array.length;
        while (++index < length) {
          if (comparator(value, array[index])) {
            return true;
          }
        }
        return false;
      }
      module.exports = arrayIncludesWith;
    }
  });

  // node_modules/lodash/noop.js
  var require_noop = __commonJS({
    "node_modules/lodash/noop.js"(exports, module) {
      function noop2() {
      }
      module.exports = noop2;
    }
  });

  // node_modules/lodash/_createSet.js
  var require_createSet = __commonJS({
    "node_modules/lodash/_createSet.js"(exports, module) {
      var Set2 = require_Set();
      var noop2 = require_noop();
      var setToArray = require_setToArray();
      var INFINITY = 1 / 0;
      var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop2 : function(values) {
        return new Set2(values);
      };
      module.exports = createSet;
    }
  });

  // node_modules/lodash/_baseUniq.js
  var require_baseUniq = __commonJS({
    "node_modules/lodash/_baseUniq.js"(exports, module) {
      var SetCache = require_SetCache();
      var arrayIncludes = require_arrayIncludes();
      var arrayIncludesWith = require_arrayIncludesWith();
      var cacheHas = require_cacheHas();
      var createSet = require_createSet();
      var setToArray = require_setToArray();
      var LARGE_ARRAY_SIZE = 200;
      function baseUniq(array, iteratee, comparator) {
        var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
        if (comparator) {
          isCommon = false;
          includes = arrayIncludesWith;
        } else if (length >= LARGE_ARRAY_SIZE) {
          var set = iteratee ? null : createSet(array);
          if (set) {
            return setToArray(set);
          }
          isCommon = false;
          includes = cacheHas;
          seen = new SetCache();
        } else {
          seen = iteratee ? [] : result;
        }
        outer:
          while (++index < length) {
            var value = array[index], computed = iteratee ? iteratee(value) : value;
            value = comparator || value !== 0 ? value : 0;
            if (isCommon && computed === computed) {
              var seenIndex = seen.length;
              while (seenIndex--) {
                if (seen[seenIndex] === computed) {
                  continue outer;
                }
              }
              if (iteratee) {
                seen.push(computed);
              }
              result.push(value);
            } else if (!includes(seen, computed, comparator)) {
              if (seen !== result) {
                seen.push(computed);
              }
              result.push(value);
            }
          }
        return result;
      }
      module.exports = baseUniq;
    }
  });

  // node_modules/lodash/uniq.js
  var require_uniq = __commonJS({
    "node_modules/lodash/uniq.js"(exports, module) {
      var baseUniq = require_baseUniq();
      function uniq5(array) {
        return array && array.length ? baseUniq(array) : [];
      }
      module.exports = uniq5;
    }
  });

  // node_modules/lodash/_baseIsDate.js
  var require_baseIsDate = __commonJS({
    "node_modules/lodash/_baseIsDate.js"(exports, module) {
      var baseGetTag = require_baseGetTag();
      var isObjectLike = require_isObjectLike();
      var dateTag = "[object Date]";
      function baseIsDate(value) {
        return isObjectLike(value) && baseGetTag(value) == dateTag;
      }
      module.exports = baseIsDate;
    }
  });

  // node_modules/lodash/isDate.js
  var require_isDate = __commonJS({
    "node_modules/lodash/isDate.js"(exports, module) {
      var baseIsDate = require_baseIsDate();
      var baseUnary = require_baseUnary();
      var nodeUtil = require_nodeUtil();
      var nodeIsDate = nodeUtil && nodeUtil.isDate;
      var isDate2 = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
      module.exports = isDate2;
    }
  });

  // node_modules/lodash/_baseSortedUniq.js
  var require_baseSortedUniq = __commonJS({
    "node_modules/lodash/_baseSortedUniq.js"(exports, module) {
      var eq = require_eq();
      function baseSortedUniq(array, iteratee) {
        var index = -1, length = array.length, resIndex = 0, result = [];
        while (++index < length) {
          var value = array[index], computed = iteratee ? iteratee(value) : value;
          if (!index || !eq(computed, seen)) {
            var seen = computed;
            result[resIndex++] = value === 0 ? 0 : value;
          }
        }
        return result;
      }
      module.exports = baseSortedUniq;
    }
  });

  // node_modules/lodash/sortedUniq.js
  var require_sortedUniq = __commonJS({
    "node_modules/lodash/sortedUniq.js"(exports, module) {
      var baseSortedUniq = require_baseSortedUniq();
      function sortedUniq2(array) {
        return array && array.length ? baseSortedUniq(array) : [];
      }
      module.exports = sortedUniq2;
    }
  });

  // node_modules/lodash/isEqual.js
  var require_isEqual = __commonJS({
    "node_modules/lodash/isEqual.js"(exports, module) {
      var baseIsEqual = require_baseIsEqual();
      function isEqual12(value, other) {
        return baseIsEqual(value, other);
      }
      module.exports = isEqual12;
    }
  });

  // node_modules/lodash/isUndefined.js
  var require_isUndefined = __commonJS({
    "node_modules/lodash/isUndefined.js"(exports, module) {
      function isUndefined2(value) {
        return value === void 0;
      }
      module.exports = isUndefined2;
    }
  });

  // node_modules/lodash/_arrayAggregator.js
  var require_arrayAggregator = __commonJS({
    "node_modules/lodash/_arrayAggregator.js"(exports, module) {
      function arrayAggregator(array, setter, iteratee, accumulator) {
        var index = -1, length = array == null ? 0 : array.length;
        while (++index < length) {
          var value = array[index];
          setter(accumulator, value, iteratee(value), array);
        }
        return accumulator;
      }
      module.exports = arrayAggregator;
    }
  });

  // node_modules/lodash/_baseAggregator.js
  var require_baseAggregator = __commonJS({
    "node_modules/lodash/_baseAggregator.js"(exports, module) {
      var baseEach = require_baseEach();
      function baseAggregator(collection, setter, iteratee, accumulator) {
        baseEach(collection, function(value, key, collection2) {
          setter(accumulator, value, iteratee(value), collection2);
        });
        return accumulator;
      }
      module.exports = baseAggregator;
    }
  });

  // node_modules/lodash/_createAggregator.js
  var require_createAggregator = __commonJS({
    "node_modules/lodash/_createAggregator.js"(exports, module) {
      var arrayAggregator = require_arrayAggregator();
      var baseAggregator = require_baseAggregator();
      var baseIteratee = require_baseIteratee();
      var isArray = require_isArray();
      function createAggregator(setter, initializer) {
        return function(collection, iteratee) {
          var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
          return func(collection, setter, baseIteratee(iteratee, 2), accumulator);
        };
      }
      module.exports = createAggregator;
    }
  });

  // node_modules/lodash/groupBy.js
  var require_groupBy = __commonJS({
    "node_modules/lodash/groupBy.js"(exports, module) {
      var baseAssignValue = require_baseAssignValue();
      var createAggregator = require_createAggregator();
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      var groupBy3 = createAggregator(function(result, value, key) {
        if (hasOwnProperty.call(result, key)) {
          result[key].push(value);
        } else {
          baseAssignValue(result, key, [value]);
        }
      });
      module.exports = groupBy3;
    }
  });

  // node_modules/lodash/uniqBy.js
  var require_uniqBy = __commonJS({
    "node_modules/lodash/uniqBy.js"(exports, module) {
      var baseIteratee = require_baseIteratee();
      var baseUniq = require_baseUniq();
      function uniqBy3(array, iteratee) {
        return array && array.length ? baseUniq(array, baseIteratee(iteratee, 2)) : [];
      }
      module.exports = uniqBy3;
    }
  });

  // node_modules/lodash/fromPairs.js
  var require_fromPairs = __commonJS({
    "node_modules/lodash/fromPairs.js"(exports, module) {
      var baseAssignValue = require_baseAssignValue();
      function fromPairs2(pairs) {
        var index = -1, length = pairs == null ? 0 : pairs.length, result = {};
        while (++index < length) {
          var pair = pairs[index];
          baseAssignValue(result, pair[0], pair[1]);
        }
        return result;
      }
      module.exports = fromPairs2;
    }
  });

  // node_modules/json-stringify-safe/stringify.js
  var require_stringify = __commonJS({
    "node_modules/json-stringify-safe/stringify.js"(exports, module) {
      exports = module.exports = stringify2;
      exports.getSerialize = serializer;
      function stringify2(obj, replacer, spaces, cycleReplacer) {
        return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces);
      }
      function serializer(replacer, cycleReplacer) {
        var stack = [], keys = [];
        if (cycleReplacer == null) cycleReplacer = function(key, value) {
          if (stack[0] === value) return "[Circular ~]";
          return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
        };
        return function(key, value) {
          if (stack.length > 0) {
            var thisPos = stack.indexOf(this);
            ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
            ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
            if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value);
          } else stack.push(value);
          return replacer == null ? value : replacer.call(this, key, value);
        };
      }
    }
  });

  // node_modules/lodash/_arrayEach.js
  var require_arrayEach = __commonJS({
    "node_modules/lodash/_arrayEach.js"(exports, module) {
      function arrayEach(array, iteratee) {
        var index = -1, length = array == null ? 0 : array.length;
        while (++index < length) {
          if (iteratee(array[index], index, array) === false) {
            break;
          }
        }
        return array;
      }
      module.exports = arrayEach;
    }
  });

  // node_modules/lodash/_baseAssign.js
  var require_baseAssign = __commonJS({
    "node_modules/lodash/_baseAssign.js"(exports, module) {
      var copyObject = require_copyObject();
      var keys = require_keys();
      function baseAssign(object, source) {
        return object && copyObject(source, keys(source), object);
      }
      module.exports = baseAssign;
    }
  });

  // node_modules/lodash/_baseAssignIn.js
  var require_baseAssignIn = __commonJS({
    "node_modules/lodash/_baseAssignIn.js"(exports, module) {
      var copyObject = require_copyObject();
      var keysIn = require_keysIn();
      function baseAssignIn(object, source) {
        return object && copyObject(source, keysIn(source), object);
      }
      module.exports = baseAssignIn;
    }
  });

  // node_modules/lodash/_copySymbols.js
  var require_copySymbols = __commonJS({
    "node_modules/lodash/_copySymbols.js"(exports, module) {
      var copyObject = require_copyObject();
      var getSymbols = require_getSymbols();
      function copySymbols(source, object) {
        return copyObject(source, getSymbols(source), object);
      }
      module.exports = copySymbols;
    }
  });

  // node_modules/lodash/_copySymbolsIn.js
  var require_copySymbolsIn = __commonJS({
    "node_modules/lodash/_copySymbolsIn.js"(exports, module) {
      var copyObject = require_copyObject();
      var getSymbolsIn = require_getSymbolsIn();
      function copySymbolsIn(source, object) {
        return copyObject(source, getSymbolsIn(source), object);
      }
      module.exports = copySymbolsIn;
    }
  });

  // node_modules/lodash/_initCloneArray.js
  var require_initCloneArray = __commonJS({
    "node_modules/lodash/_initCloneArray.js"(exports, module) {
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function initCloneArray(array) {
        var length = array.length, result = new array.constructor(length);
        if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
          result.index = array.index;
          result.input = array.input;
        }
        return result;
      }
      module.exports = initCloneArray;
    }
  });

  // node_modules/lodash/_cloneDataView.js
  var require_cloneDataView = __commonJS({
    "node_modules/lodash/_cloneDataView.js"(exports, module) {
      var cloneArrayBuffer = require_cloneArrayBuffer();
      function cloneDataView(dataView, isDeep) {
        var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
        return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
      }
      module.exports = cloneDataView;
    }
  });

  // node_modules/lodash/_cloneRegExp.js
  var require_cloneRegExp = __commonJS({
    "node_modules/lodash/_cloneRegExp.js"(exports, module) {
      var reFlags = /\w*$/;
      function cloneRegExp(regexp) {
        var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
        result.lastIndex = regexp.lastIndex;
        return result;
      }
      module.exports = cloneRegExp;
    }
  });

  // node_modules/lodash/_cloneSymbol.js
  var require_cloneSymbol = __commonJS({
    "node_modules/lodash/_cloneSymbol.js"(exports, module) {
      var Symbol3 = require_Symbol();
      var symbolProto = Symbol3 ? Symbol3.prototype : void 0;
      var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
      function cloneSymbol(symbol) {
        return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
      }
      module.exports = cloneSymbol;
    }
  });

  // node_modules/lodash/_initCloneByTag.js
  var require_initCloneByTag = __commonJS({
    "node_modules/lodash/_initCloneByTag.js"(exports, module) {
      var cloneArrayBuffer = require_cloneArrayBuffer();
      var cloneDataView = require_cloneDataView();
      var cloneRegExp = require_cloneRegExp();
      var cloneSymbol = require_cloneSymbol();
      var cloneTypedArray = require_cloneTypedArray();
      var boolTag = "[object Boolean]";
      var dateTag = "[object Date]";
      var mapTag = "[object Map]";
      var numberTag = "[object Number]";
      var regexpTag = "[object RegExp]";
      var setTag = "[object Set]";
      var stringTag = "[object String]";
      var symbolTag = "[object Symbol]";
      var arrayBufferTag = "[object ArrayBuffer]";
      var dataViewTag = "[object DataView]";
      var float32Tag = "[object Float32Array]";
      var float64Tag = "[object Float64Array]";
      var int8Tag = "[object Int8Array]";
      var int16Tag = "[object Int16Array]";
      var int32Tag = "[object Int32Array]";
      var uint8Tag = "[object Uint8Array]";
      var uint8ClampedTag = "[object Uint8ClampedArray]";
      var uint16Tag = "[object Uint16Array]";
      var uint32Tag = "[object Uint32Array]";
      function initCloneByTag(object, tag, isDeep) {
        var Ctor = object.constructor;
        switch (tag) {
          case arrayBufferTag:
            return cloneArrayBuffer(object);
          case boolTag:
          case dateTag:
            return new Ctor(+object);
          case dataViewTag:
            return cloneDataView(object, isDeep);
          case float32Tag:
          case float64Tag:
          case int8Tag:
          case int16Tag:
          case int32Tag:
          case uint8Tag:
          case uint8ClampedTag:
          case uint16Tag:
          case uint32Tag:
            return cloneTypedArray(object, isDeep);
          case mapTag:
            return new Ctor();
          case numberTag:
          case stringTag:
            return new Ctor(object);
          case regexpTag:
            return cloneRegExp(object);
          case setTag:
            return new Ctor();
          case symbolTag:
            return cloneSymbol(object);
        }
      }
      module.exports = initCloneByTag;
    }
  });

  // node_modules/lodash/_baseIsMap.js
  var require_baseIsMap = __commonJS({
    "node_modules/lodash/_baseIsMap.js"(exports, module) {
      var getTag = require_getTag();
      var isObjectLike = require_isObjectLike();
      var mapTag = "[object Map]";
      function baseIsMap(value) {
        return isObjectLike(value) && getTag(value) == mapTag;
      }
      module.exports = baseIsMap;
    }
  });

  // node_modules/lodash/isMap.js
  var require_isMap = __commonJS({
    "node_modules/lodash/isMap.js"(exports, module) {
      var baseIsMap = require_baseIsMap();
      var baseUnary = require_baseUnary();
      var nodeUtil = require_nodeUtil();
      var nodeIsMap = nodeUtil && nodeUtil.isMap;
      var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
      module.exports = isMap;
    }
  });

  // node_modules/lodash/_baseIsSet.js
  var require_baseIsSet = __commonJS({
    "node_modules/lodash/_baseIsSet.js"(exports, module) {
      var getTag = require_getTag();
      var isObjectLike = require_isObjectLike();
      var setTag = "[object Set]";
      function baseIsSet(value) {
        return isObjectLike(value) && getTag(value) == setTag;
      }
      module.exports = baseIsSet;
    }
  });

  // node_modules/lodash/isSet.js
  var require_isSet = __commonJS({
    "node_modules/lodash/isSet.js"(exports, module) {
      var baseIsSet = require_baseIsSet();
      var baseUnary = require_baseUnary();
      var nodeUtil = require_nodeUtil();
      var nodeIsSet = nodeUtil && nodeUtil.isSet;
      var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
      module.exports = isSet;
    }
  });

  // node_modules/lodash/_baseClone.js
  var require_baseClone = __commonJS({
    "node_modules/lodash/_baseClone.js"(exports, module) {
      var Stack = require_Stack();
      var arrayEach = require_arrayEach();
      var assignValue = require_assignValue();
      var baseAssign = require_baseAssign();
      var baseAssignIn = require_baseAssignIn();
      var cloneBuffer = require_cloneBuffer();
      var copyArray = require_copyArray();
      var copySymbols = require_copySymbols();
      var copySymbolsIn = require_copySymbolsIn();
      var getAllKeys = require_getAllKeys();
      var getAllKeysIn = require_getAllKeysIn();
      var getTag = require_getTag();
      var initCloneArray = require_initCloneArray();
      var initCloneByTag = require_initCloneByTag();
      var initCloneObject = require_initCloneObject();
      var isArray = require_isArray();
      var isBuffer = require_isBuffer();
      var isMap = require_isMap();
      var isObject3 = require_isObject();
      var isSet = require_isSet();
      var keys = require_keys();
      var keysIn = require_keysIn();
      var CLONE_DEEP_FLAG = 1;
      var CLONE_FLAT_FLAG = 2;
      var CLONE_SYMBOLS_FLAG = 4;
      var argsTag = "[object Arguments]";
      var arrayTag = "[object Array]";
      var boolTag = "[object Boolean]";
      var dateTag = "[object Date]";
      var errorTag = "[object Error]";
      var funcTag = "[object Function]";
      var genTag = "[object GeneratorFunction]";
      var mapTag = "[object Map]";
      var numberTag = "[object Number]";
      var objectTag = "[object Object]";
      var regexpTag = "[object RegExp]";
      var setTag = "[object Set]";
      var stringTag = "[object String]";
      var symbolTag = "[object Symbol]";
      var weakMapTag = "[object WeakMap]";
      var arrayBufferTag = "[object ArrayBuffer]";
      var dataViewTag = "[object DataView]";
      var float32Tag = "[object Float32Array]";
      var float64Tag = "[object Float64Array]";
      var int8Tag = "[object Int8Array]";
      var int16Tag = "[object Int16Array]";
      var int32Tag = "[object Int32Array]";
      var uint8Tag = "[object Uint8Array]";
      var uint8ClampedTag = "[object Uint8ClampedArray]";
      var uint16Tag = "[object Uint16Array]";
      var uint32Tag = "[object Uint32Array]";
      var cloneableTags = {};
      cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
      cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
      function baseClone(value, bitmask, customizer, key, object, stack) {
        var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
        if (customizer) {
          result = object ? customizer(value, key, object, stack) : customizer(value);
        }
        if (result !== void 0) {
          return result;
        }
        if (!isObject3(value)) {
          return value;
        }
        var isArr = isArray(value);
        if (isArr) {
          result = initCloneArray(value);
          if (!isDeep) {
            return copyArray(value, result);
          }
        } else {
          var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
          if (isBuffer(value)) {
            return cloneBuffer(value, isDeep);
          }
          if (tag == objectTag || tag == argsTag || isFunc && !object) {
            result = isFlat || isFunc ? {} : initCloneObject(value);
            if (!isDeep) {
              return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
            }
          } else {
            if (!cloneableTags[tag]) {
              return object ? value : {};
            }
            result = initCloneByTag(value, tag, isDeep);
          }
        }
        stack || (stack = new Stack());
        var stacked = stack.get(value);
        if (stacked) {
          return stacked;
        }
        stack.set(value, result);
        if (isSet(value)) {
          value.forEach(function(subValue) {
            result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
          });
        } else if (isMap(value)) {
          value.forEach(function(subValue, key2) {
            result.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
          });
        }
        var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
        var props = isArr ? void 0 : keysFunc(value);
        arrayEach(props || value, function(subValue, key2) {
          if (props) {
            key2 = subValue;
            subValue = value[key2];
          }
          assignValue(result, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
        });
        return result;
      }
      module.exports = baseClone;
    }
  });

  // node_modules/lodash/cloneDeep.js
  var require_cloneDeep = __commonJS({
    "node_modules/lodash/cloneDeep.js"(exports, module) {
      var baseClone = require_baseClone();
      var CLONE_DEEP_FLAG = 1;
      var CLONE_SYMBOLS_FLAG = 4;
      function cloneDeep2(value) {
        return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
      }
      module.exports = cloneDeep2;
    }
  });

  // node_modules/lodash/merge.js
  var require_merge = __commonJS({
    "node_modules/lodash/merge.js"(exports, module) {
      var baseMerge = require_baseMerge();
      var createAssigner = require_createAssigner();
      var merge3 = createAssigner(function(object, source, srcIndex) {
        baseMerge(object, source, srcIndex);
      });
      module.exports = merge3;
    }
  });

  // node_modules/lodash/_baseRange.js
  var require_baseRange = __commonJS({
    "node_modules/lodash/_baseRange.js"(exports, module) {
      var nativeCeil = Math.ceil;
      var nativeMax = Math.max;
      function baseRange(start2, end2, step, fromRight) {
        var index = -1, length = nativeMax(nativeCeil((end2 - start2) / (step || 1)), 0), result = Array(length);
        while (length--) {
          result[fromRight ? length : ++index] = start2;
          start2 += step;
        }
        return result;
      }
      module.exports = baseRange;
    }
  });

  // node_modules/lodash/_trimmedEndIndex.js
  var require_trimmedEndIndex = __commonJS({
    "node_modules/lodash/_trimmedEndIndex.js"(exports, module) {
      var reWhitespace = /\s/;
      function trimmedEndIndex(string) {
        var index = string.length;
        while (index-- && reWhitespace.test(string.charAt(index))) {
        }
        return index;
      }
      module.exports = trimmedEndIndex;
    }
  });

  // node_modules/lodash/_baseTrim.js
  var require_baseTrim = __commonJS({
    "node_modules/lodash/_baseTrim.js"(exports, module) {
      var trimmedEndIndex = require_trimmedEndIndex();
      var reTrimStart = /^\s+/;
      function baseTrim(string) {
        return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
      }
      module.exports = baseTrim;
    }
  });

  // node_modules/lodash/toNumber.js
  var require_toNumber = __commonJS({
    "node_modules/lodash/toNumber.js"(exports, module) {
      var baseTrim = require_baseTrim();
      var isObject3 = require_isObject();
      var isSymbol = require_isSymbol();
      var NAN = 0 / 0;
      var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
      var reIsBinary = /^0b[01]+$/i;
      var reIsOctal = /^0o[0-7]+$/i;
      var freeParseInt = parseInt;
      function toNumber(value) {
        if (typeof value == "number") {
          return value;
        }
        if (isSymbol(value)) {
          return NAN;
        }
        if (isObject3(value)) {
          var other = typeof value.valueOf == "function" ? value.valueOf() : value;
          value = isObject3(other) ? other + "" : other;
        }
        if (typeof value != "string") {
          return value === 0 ? value : +value;
        }
        value = baseTrim(value);
        var isBinary = reIsBinary.test(value);
        return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
      }
      module.exports = toNumber;
    }
  });

  // node_modules/lodash/toFinite.js
  var require_toFinite = __commonJS({
    "node_modules/lodash/toFinite.js"(exports, module) {
      var toNumber = require_toNumber();
      var INFINITY = 1 / 0;
      var MAX_INTEGER = 17976931348623157e292;
      function toFinite(value) {
        if (!value) {
          return value === 0 ? value : 0;
        }
        value = toNumber(value);
        if (value === INFINITY || value === -INFINITY) {
          var sign2 = value < 0 ? -1 : 1;
          return sign2 * MAX_INTEGER;
        }
        return value === value ? value : 0;
      }
      module.exports = toFinite;
    }
  });

  // node_modules/lodash/_createRange.js
  var require_createRange = __commonJS({
    "node_modules/lodash/_createRange.js"(exports, module) {
      var baseRange = require_baseRange();
      var isIterateeCall = require_isIterateeCall();
      var toFinite = require_toFinite();
      function createRange(fromRight) {
        return function(start2, end2, step) {
          if (step && typeof step != "number" && isIterateeCall(start2, end2, step)) {
            end2 = step = void 0;
          }
          start2 = toFinite(start2);
          if (end2 === void 0) {
            end2 = start2;
            start2 = 0;
          } else {
            end2 = toFinite(end2);
          }
          step = step === void 0 ? start2 < end2 ? 1 : -1 : toFinite(step);
          return baseRange(start2, end2, step, fromRight);
        };
      }
      module.exports = createRange;
    }
  });

  // node_modules/lodash/range.js
  var require_range = __commonJS({
    "node_modules/lodash/range.js"(exports, module) {
      var createRange = require_createRange();
      var range4 = createRange();
      module.exports = range4;
    }
  });

  // node_modules/lodash/now.js
  var require_now = __commonJS({
    "node_modules/lodash/now.js"(exports, module) {
      var root = require_root();
      var now3 = function() {
        return root.Date.now();
      };
      module.exports = now3;
    }
  });

  // node_modules/lodash/debounce.js
  var require_debounce = __commonJS({
    "node_modules/lodash/debounce.js"(exports, module) {
      var isObject3 = require_isObject();
      var now3 = require_now();
      var toNumber = require_toNumber();
      var FUNC_ERROR_TEXT = "Expected a function";
      var nativeMax = Math.max;
      var nativeMin = Math.min;
      function debounce3(func, wait, options5) {
        var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
        if (typeof func != "function") {
          throw new TypeError(FUNC_ERROR_TEXT);
        }
        wait = toNumber(wait) || 0;
        if (isObject3(options5)) {
          leading = !!options5.leading;
          maxing = "maxWait" in options5;
          maxWait = maxing ? nativeMax(toNumber(options5.maxWait) || 0, wait) : maxWait;
          trailing = "trailing" in options5 ? !!options5.trailing : trailing;
        }
        function invokeFunc(time2) {
          var args = lastArgs, thisArg = lastThis;
          lastArgs = lastThis = void 0;
          lastInvokeTime = time2;
          result = func.apply(thisArg, args);
          return result;
        }
        function leadingEdge(time2) {
          lastInvokeTime = time2;
          timerId = setTimeout(timerExpired, wait);
          return leading ? invokeFunc(time2) : result;
        }
        function remainingWait(time2) {
          var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
          return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
        }
        function shouldInvoke(time2) {
          var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime;
          return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
        }
        function timerExpired() {
          var time2 = now3();
          if (shouldInvoke(time2)) {
            return trailingEdge(time2);
          }
          timerId = setTimeout(timerExpired, remainingWait(time2));
        }
        function trailingEdge(time2) {
          timerId = void 0;
          if (trailing && lastArgs) {
            return invokeFunc(time2);
          }
          lastArgs = lastThis = void 0;
          return result;
        }
        function cancel() {
          if (timerId !== void 0) {
            clearTimeout(timerId);
          }
          lastInvokeTime = 0;
          lastArgs = lastCallTime = lastThis = timerId = void 0;
        }
        function flush() {
          return timerId === void 0 ? result : trailingEdge(now3());
        }
        function debounced() {
          var time2 = now3(), isInvoking = shouldInvoke(time2);
          lastArgs = arguments;
          lastThis = this;
          lastCallTime = time2;
          if (isInvoking) {
            if (timerId === void 0) {
              return leadingEdge(lastCallTime);
            }
            if (maxing) {
              clearTimeout(timerId);
              timerId = setTimeout(timerExpired, wait);
              return invokeFunc(lastCallTime);
            }
          }
          if (timerId === void 0) {
            timerId = setTimeout(timerExpired, wait);
          }
          return result;
        }
        debounced.cancel = cancel;
        debounced.flush = flush;
        return debounced;
      }
      module.exports = debounce3;
    }
  });

  // node_modules/lodash/throttle.js
  var require_throttle = __commonJS({
    "node_modules/lodash/throttle.js"(exports, module) {
      var debounce3 = require_debounce();
      var isObject3 = require_isObject();
      var FUNC_ERROR_TEXT = "Expected a function";
      function throttle2(func, wait, options5) {
        var leading = true, trailing = true;
        if (typeof func != "function") {
          throw new TypeError(FUNC_ERROR_TEXT);
        }
        if (isObject3(options5)) {
          leading = "leading" in options5 ? !!options5.leading : leading;
          trailing = "trailing" in options5 ? !!options5.trailing : trailing;
        }
        return debounce3(func, wait, {
          "leading": leading,
          "maxWait": wait,
          "trailing": trailing
        });
      }
      module.exports = throttle2;
    }
  });

  // node_modules/lodash/_baseIsRegExp.js
  var require_baseIsRegExp = __commonJS({
    "node_modules/lodash/_baseIsRegExp.js"(exports, module) {
      var baseGetTag = require_baseGetTag();
      var isObjectLike = require_isObjectLike();
      var regexpTag = "[object RegExp]";
      function baseIsRegExp(value) {
        return isObjectLike(value) && baseGetTag(value) == regexpTag;
      }
      module.exports = baseIsRegExp;
    }
  });

  // node_modules/lodash/isRegExp.js
  var require_isRegExp = __commonJS({
    "node_modules/lodash/isRegExp.js"(exports, module) {
      var baseIsRegExp = require_baseIsRegExp();
      var baseUnary = require_baseUnary();
      var nodeUtil = require_nodeUtil();
      var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;
      var isRegExp2 = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
      module.exports = isRegExp2;
    }
  });

  // node_modules/delaunator/delaunator.js
  var require_delaunator = __commonJS({
    "node_modules/delaunator/delaunator.js"(exports, module) {
      (function(global2, factory2) {
        typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory2() : typeof define === "function" && define.amd ? define(factory2) : (global2 = global2 || self, global2.Delaunator = factory2());
      })(exports, function() {
        "use strict";
        var EPSILON = Math.pow(2, -52);
        var EDGE_STACK = new Uint32Array(512);
        var Delaunator = function Delaunator2(coords) {
          var n = coords.length >> 1;
          if (n > 0 && typeof coords[0] !== "number") {
            throw new Error("Expected coords to contain numbers.");
          }
          this.coords = coords;
          var maxTriangles = Math.max(2 * n - 5, 0);
          this._triangles = new Uint32Array(maxTriangles * 3);
          this._halfedges = new Int32Array(maxTriangles * 3);
          this._hashSize = Math.ceil(Math.sqrt(n));
          this._hullPrev = new Uint32Array(n);
          this._hullNext = new Uint32Array(n);
          this._hullTri = new Uint32Array(n);
          this._hullHash = new Int32Array(this._hashSize).fill(-1);
          this._ids = new Uint32Array(n);
          this._dists = new Float64Array(n);
          this.update();
        };
        Delaunator.from = function from(points, getX, getY) {
          if (getX === void 0) getX = defaultGetX;
          if (getY === void 0) getY = defaultGetY;
          var n = points.length;
          var coords = new Float64Array(n * 2);
          for (var i = 0; i < n; i++) {
            var p = points[i];
            coords[2 * i] = getX(p);
            coords[2 * i + 1] = getY(p);
          }
          return new Delaunator(coords);
        };
        Delaunator.prototype.update = function update() {
          var ref = this;
          var coords = ref.coords;
          var hullPrev = ref._hullPrev;
          var hullNext = ref._hullNext;
          var hullTri = ref._hullTri;
          var hullHash = ref._hullHash;
          var n = coords.length >> 1;
          var minX = Infinity;
          var minY = Infinity;
          var maxX = -Infinity;
          var maxY = -Infinity;
          for (var i = 0; i < n; i++) {
            var x2 = coords[2 * i];
            var y2 = coords[2 * i + 1];
            if (x2 < minX) {
              minX = x2;
            }
            if (y2 < minY) {
              minY = y2;
            }
            if (x2 > maxX) {
              maxX = x2;
            }
            if (y2 > maxY) {
              maxY = y2;
            }
            this._ids[i] = i;
          }
          var cx = (minX + maxX) / 2;
          var cy = (minY + maxY) / 2;
          var minDist = Infinity;
          var i0, i1, i2;
          for (var i$1 = 0; i$1 < n; i$1++) {
            var d = dist(cx, cy, coords[2 * i$1], coords[2 * i$1 + 1]);
            if (d < minDist) {
              i0 = i$1;
              minDist = d;
            }
          }
          var i0x = coords[2 * i0];
          var i0y = coords[2 * i0 + 1];
          minDist = Infinity;
          for (var i$2 = 0; i$2 < n; i$2++) {
            if (i$2 === i0) {
              continue;
            }
            var d$1 = dist(i0x, i0y, coords[2 * i$2], coords[2 * i$2 + 1]);
            if (d$1 < minDist && d$1 > 0) {
              i1 = i$2;
              minDist = d$1;
            }
          }
          var i1x = coords[2 * i1];
          var i1y = coords[2 * i1 + 1];
          var minRadius = Infinity;
          for (var i$3 = 0; i$3 < n; i$3++) {
            if (i$3 === i0 || i$3 === i1) {
              continue;
            }
            var r = circumradius(i0x, i0y, i1x, i1y, coords[2 * i$3], coords[2 * i$3 + 1]);
            if (r < minRadius) {
              i2 = i$3;
              minRadius = r;
            }
          }
          var i2x = coords[2 * i2];
          var i2y = coords[2 * i2 + 1];
          if (minRadius === Infinity) {
            for (var i$4 = 0; i$4 < n; i$4++) {
              this._dists[i$4] = coords[2 * i$4] - coords[0] || coords[2 * i$4 + 1] - coords[1];
            }
            quicksort(this._ids, this._dists, 0, n - 1);
            var hull = new Uint32Array(n);
            var j = 0;
            for (var i$5 = 0, d0 = -Infinity; i$5 < n; i$5++) {
              var id = this._ids[i$5];
              if (this._dists[id] > d0) {
                hull[j++] = id;
                d0 = this._dists[id];
              }
            }
            this.hull = hull.subarray(0, j);
            this.triangles = new Uint32Array(0);
            this.halfedges = new Uint32Array(0);
            return;
          }
          if (orient(i0x, i0y, i1x, i1y, i2x, i2y)) {
            var i$6 = i1;
            var x$1 = i1x;
            var y$1 = i1y;
            i1 = i2;
            i1x = i2x;
            i1y = i2y;
            i2 = i$6;
            i2x = x$1;
            i2y = y$1;
          }
          var center = circumcenter(i0x, i0y, i1x, i1y, i2x, i2y);
          this._cx = center.x;
          this._cy = center.y;
          for (var i$7 = 0; i$7 < n; i$7++) {
            this._dists[i$7] = dist(coords[2 * i$7], coords[2 * i$7 + 1], center.x, center.y);
          }
          quicksort(this._ids, this._dists, 0, n - 1);
          this._hullStart = i0;
          var hullSize = 3;
          hullNext[i0] = hullPrev[i2] = i1;
          hullNext[i1] = hullPrev[i0] = i2;
          hullNext[i2] = hullPrev[i1] = i0;
          hullTri[i0] = 0;
          hullTri[i1] = 1;
          hullTri[i2] = 2;
          hullHash.fill(-1);
          hullHash[this._hashKey(i0x, i0y)] = i0;
          hullHash[this._hashKey(i1x, i1y)] = i1;
          hullHash[this._hashKey(i2x, i2y)] = i2;
          this.trianglesLen = 0;
          this._addTriangle(i0, i1, i2, -1, -1, -1);
          for (var k2 = 0, xp = void 0, yp = void 0; k2 < this._ids.length; k2++) {
            var i$8 = this._ids[k2];
            var x$2 = coords[2 * i$8];
            var y$2 = coords[2 * i$8 + 1];
            if (k2 > 0 && Math.abs(x$2 - xp) <= EPSILON && Math.abs(y$2 - yp) <= EPSILON) {
              continue;
            }
            xp = x$2;
            yp = y$2;
            if (i$8 === i0 || i$8 === i1 || i$8 === i2) {
              continue;
            }
            var start2 = 0;
            for (var j$1 = 0, key = this._hashKey(x$2, y$2); j$1 < this._hashSize; j$1++) {
              start2 = hullHash[(key + j$1) % this._hashSize];
              if (start2 !== -1 && start2 !== hullNext[start2]) {
                break;
              }
            }
            start2 = hullPrev[start2];
            var e = start2, q = void 0;
            while (q = hullNext[e], !orient(x$2, y$2, coords[2 * e], coords[2 * e + 1], coords[2 * q], coords[2 * q + 1])) {
              e = q;
              if (e === start2) {
                e = -1;
                break;
              }
            }
            if (e === -1) {
              continue;
            }
            var t = this._addTriangle(e, i$8, hullNext[e], -1, -1, hullTri[e]);
            hullTri[i$8] = this._legalize(t + 2);
            hullTri[e] = t;
            hullSize++;
            var n$1 = hullNext[e];
            while (q = hullNext[n$1], orient(x$2, y$2, coords[2 * n$1], coords[2 * n$1 + 1], coords[2 * q], coords[2 * q + 1])) {
              t = this._addTriangle(n$1, i$8, q, hullTri[i$8], -1, hullTri[n$1]);
              hullTri[i$8] = this._legalize(t + 2);
              hullNext[n$1] = n$1;
              hullSize--;
              n$1 = q;
            }
            if (e === start2) {
              while (q = hullPrev[e], orient(x$2, y$2, coords[2 * q], coords[2 * q + 1], coords[2 * e], coords[2 * e + 1])) {
                t = this._addTriangle(q, i$8, e, -1, hullTri[e], hullTri[q]);
                this._legalize(t + 2);
                hullTri[q] = t;
                hullNext[e] = e;
                hullSize--;
                e = q;
              }
            }
            this._hullStart = hullPrev[i$8] = e;
            hullNext[e] = hullPrev[n$1] = i$8;
            hullNext[i$8] = n$1;
            hullHash[this._hashKey(x$2, y$2)] = i$8;
            hullHash[this._hashKey(coords[2 * e], coords[2 * e + 1])] = e;
          }
          this.hull = new Uint32Array(hullSize);
          for (var i$9 = 0, e$1 = this._hullStart; i$9 < hullSize; i$9++) {
            this.hull[i$9] = e$1;
            e$1 = hullNext[e$1];
          }
          this.triangles = this._triangles.subarray(0, this.trianglesLen);
          this.halfedges = this._halfedges.subarray(0, this.trianglesLen);
        };
        Delaunator.prototype._hashKey = function _hashKey(x2, y2) {
          return Math.floor(pseudoAngle(x2 - this._cx, y2 - this._cy) * this._hashSize) % this._hashSize;
        };
        Delaunator.prototype._legalize = function _legalize(a2) {
          var ref = this;
          var triangles = ref._triangles;
          var halfedges = ref._halfedges;
          var coords = ref.coords;
          var i = 0;
          var ar = 0;
          while (true) {
            var b = halfedges[a2];
            var a0 = a2 - a2 % 3;
            ar = a0 + (a2 + 2) % 3;
            if (b === -1) {
              if (i === 0) {
                break;
              }
              a2 = EDGE_STACK[--i];
              continue;
            }
            var b02 = b - b % 3;
            var al = a0 + (a2 + 1) % 3;
            var bl = b02 + (b + 2) % 3;
            var p0 = triangles[ar];
            var pr = triangles[a2];
            var pl = triangles[al];
            var p1 = triangles[bl];
            var illegal = inCircle(
              coords[2 * p0],
              coords[2 * p0 + 1],
              coords[2 * pr],
              coords[2 * pr + 1],
              coords[2 * pl],
              coords[2 * pl + 1],
              coords[2 * p1],
              coords[2 * p1 + 1]
            );
            if (illegal) {
              triangles[a2] = p1;
              triangles[b] = p0;
              var hbl = halfedges[bl];
              if (hbl === -1) {
                var e = this._hullStart;
                do {
                  if (this._hullTri[e] === bl) {
                    this._hullTri[e] = a2;
                    break;
                  }
                  e = this._hullPrev[e];
                } while (e !== this._hullStart);
              }
              this._link(a2, hbl);
              this._link(b, halfedges[ar]);
              this._link(ar, bl);
              var br = b02 + (b + 1) % 3;
              if (i < EDGE_STACK.length) {
                EDGE_STACK[i++] = br;
              }
            } else {
              if (i === 0) {
                break;
              }
              a2 = EDGE_STACK[--i];
            }
          }
          return ar;
        };
        Delaunator.prototype._link = function _link(a2, b) {
          this._halfedges[a2] = b;
          if (b !== -1) {
            this._halfedges[b] = a2;
          }
        };
        Delaunator.prototype._addTriangle = function _addTriangle(i0, i1, i2, a2, b, c2) {
          var t = this.trianglesLen;
          this._triangles[t] = i0;
          this._triangles[t + 1] = i1;
          this._triangles[t + 2] = i2;
          this._link(t, a2);
          this._link(t + 1, b);
          this._link(t + 2, c2);
          this.trianglesLen += 3;
          return t;
        };
        function pseudoAngle(dx, dy) {
          var p = dx / (Math.abs(dx) + Math.abs(dy));
          return (dy > 0 ? 3 - p : 1 + p) / 4;
        }
        function dist(ax, ay, bx, by) {
          var dx = ax - bx;
          var dy = ay - by;
          return dx * dx + dy * dy;
        }
        function orientIfSure(px, py, rx, ry, qx, qy) {
          var l = (ry - py) * (qx - px);
          var r = (rx - px) * (qy - py);
          return Math.abs(l - r) >= 33306690738754716e-32 * Math.abs(l + r) ? l - r : 0;
        }
        function orient(rx, ry, qx, qy, px, py) {
          var sign2 = orientIfSure(px, py, rx, ry, qx, qy) || orientIfSure(rx, ry, qx, qy, px, py) || orientIfSure(qx, qy, px, py, rx, ry);
          return sign2 < 0;
        }
        function inCircle(ax, ay, bx, by, cx, cy, px, py) {
          var dx = ax - px;
          var dy = ay - py;
          var ex = bx - px;
          var ey = by - py;
          var fx = cx - px;
          var fy = cy - py;
          var ap = dx * dx + dy * dy;
          var bp = ex * ex + ey * ey;
          var cp = fx * fx + fy * fy;
          return dx * (ey * cp - bp * fy) - dy * (ex * cp - bp * fx) + ap * (ex * fy - ey * fx) < 0;
        }
        function circumradius(ax, ay, bx, by, cx, cy) {
          var dx = bx - ax;
          var dy = by - ay;
          var ex = cx - ax;
          var ey = cy - ay;
          var bl = dx * dx + dy * dy;
          var cl = ex * ex + ey * ey;
          var d = 0.5 / (dx * ey - dy * ex);
          var x2 = (ey * bl - dy * cl) * d;
          var y2 = (dx * cl - ex * bl) * d;
          return x2 * x2 + y2 * y2;
        }
        function circumcenter(ax, ay, bx, by, cx, cy) {
          var dx = bx - ax;
          var dy = by - ay;
          var ex = cx - ax;
          var ey = cy - ay;
          var bl = dx * dx + dy * dy;
          var cl = ex * ex + ey * ey;
          var d = 0.5 / (dx * ey - dy * ex);
          var x2 = ax + (ey * bl - dy * cl) * d;
          var y2 = ay + (dx * cl - ex * bl) * d;
          return { x: x2, y: y2 };
        }
        function quicksort(ids, dists, left2, right2) {
          if (right2 - left2 <= 20) {
            for (var i = left2 + 1; i <= right2; i++) {
              var temp = ids[i];
              var tempDist = dists[temp];
              var j = i - 1;
              while (j >= left2 && dists[ids[j]] > tempDist) {
                ids[j + 1] = ids[j--];
              }
              ids[j + 1] = temp;
            }
          } else {
            var median = left2 + right2 >> 1;
            var i$1 = left2 + 1;
            var j$1 = right2;
            swap2(ids, median, i$1);
            if (dists[ids[left2]] > dists[ids[right2]]) {
              swap2(ids, left2, right2);
            }
            if (dists[ids[i$1]] > dists[ids[right2]]) {
              swap2(ids, i$1, right2);
            }
            if (dists[ids[left2]] > dists[ids[i$1]]) {
              swap2(ids, left2, i$1);
            }
            var temp$1 = ids[i$1];
            var tempDist$1 = dists[temp$1];
            while (true) {
              do {
                i$1++;
              } while (dists[ids[i$1]] < tempDist$1);
              do {
                j$1--;
              } while (dists[ids[j$1]] > tempDist$1);
              if (j$1 < i$1) {
                break;
              }
              swap2(ids, i$1, j$1);
            }
            ids[left2 + 1] = ids[j$1];
            ids[j$1] = temp$1;
            if (right2 - i$1 + 1 >= j$1 - left2) {
              quicksort(ids, dists, i$1, right2);
              quicksort(ids, dists, left2, j$1 - 1);
            } else {
              quicksort(ids, dists, left2, j$1 - 1);
              quicksort(ids, dists, i$1, right2);
            }
          }
        }
        function swap2(arr, i, j) {
          var tmp = arr[i];
          arr[i] = arr[j];
          arr[j] = tmp;
        }
        function defaultGetX(p) {
          return p[0];
        }
        function defaultGetY(p) {
          return p[1];
        }
        return Delaunator;
      });
    }
  });

  // node_modules/delaunay-find/lib/index.js
  var require_lib = __commonJS({
    "node_modules/delaunay-find/lib/index.js"(exports) {
      "use strict";
      exports.__esModule = true;
      exports["default"] = void 0;
      var _delaunator = _interopRequireDefault(require_delaunator());
      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { "default": obj };
      }
      function pointX(p) {
        return p[0];
      }
      function pointY(p) {
        return p[1];
      }
      function collinear(d) {
        var triangles = d.triangles, coords = d.coords;
        for (var i = 0; i < triangles.length; i += 3) {
          var a2 = 2 * triangles[i];
          var b = 2 * triangles[i + 1];
          var c2 = 2 * triangles[i + 2];
          var cross2 = (coords[c2] - coords[a2]) * (coords[b + 1] - coords[a2 + 1]) - (coords[b] - coords[a2]) * (coords[c2 + 1] - coords[a2 + 1]);
          if (cross2 > 1e-10) {
            return false;
          }
        }
        return true;
      }
      function jitter(x2, y2, r) {
        return [x2 + Math.sin(x2 + y2) * r, y2 + Math.cos(x2 - y2) * r];
      }
      function flatArray(points, fx, fy, that) {
        var n = points.length;
        var array = new Float64Array(n * 2);
        for (var i = 0; i < n; ++i) {
          var p = points[i];
          array[i * 2] = fx.call(that, p, i, points);
          array[i * 2 + 1] = fy.call(that, p, i, points);
        }
        return array;
      }
      var Delaunay2 = /* @__PURE__ */ function() {
        function Delaunay3(points) {
          var delaunator = new _delaunator["default"](points);
          this.inedges = new Int32Array(points.length / 2);
          this._hullIndex = new Int32Array(points.length / 2);
          this.points = delaunator.coords;
          this._init(delaunator);
        }
        var _proto = Delaunay3.prototype;
        _proto._init = function _init(delaunator) {
          var d = delaunator;
          var points = this.points;
          if (d.hull && d.hull.length > 2 && collinear(d)) {
            this.collinear = Int32Array.from({
              length: points.length / 2
            }, function(_113, i2) {
              return i2;
            }).sort(function(i2, j) {
              return points[2 * i2] - points[2 * j] || points[2 * i2 + 1] - points[2 * j + 1];
            });
            var e = this.collinear[0];
            var f = this.collinear[this.collinear.length - 1];
            var bounds = [points[2 * e], points[2 * e + 1], points[2 * f], points[2 * f + 1]];
            var r = 1e-8 * // eslint-disable-line no-magic-numbers
            Math.sqrt(Math.pow(bounds[3] - bounds[1], 2) + Math.pow(bounds[2] - bounds[0], 2));
            for (var i = 0, n = points.length / 2; i < n; ++i) {
              var p = jitter(points[2 * i], points[2 * i + 1], r);
              points[2 * i] = p[0];
              points[2 * i + 1] = p[1];
            }
            delaunator = new _delaunator["default"](points);
          }
          var halfedges = this.halfedges = delaunator.halfedges;
          var hull = this.hull = delaunator.hull;
          var triangles = this.triangles = delaunator.triangles;
          var inedges = this.inedges.fill(-1);
          var hullIndex = this._hullIndex.fill(-1);
          for (var _e = 0, _n = halfedges.length; _e < _n; ++_e) {
            var _p = triangles[_e % 3 === 2 ? _e - 2 : _e + 1];
            if (halfedges[_e] === -1 || inedges[_p] === -1) inedges[_p] = _e;
          }
          for (var _i = 0, _n2 = hull.length; _i < _n2; ++_i) {
            hullIndex[hull[_i]] = _i;
          }
          if (hull.length <= 2 && hull.length > 0) {
            this.triangles = new Int32Array(3).fill(-1);
            this.halfedges = new Int32Array(3).fill(-1);
            this.triangles[0] = hull[0];
            this.triangles[1] = hull[1];
            this.triangles[2] = hull[1];
            inedges[hull[0]] = 1;
            if (hull.length === 2) inedges[hull[1]] = 0;
          }
        };
        _proto.neighbors = function neighbors(i) {
          var results = [];
          var inedges = this.inedges, hull = this.hull, _hullIndex = this._hullIndex, halfedges = this.halfedges, triangles = this.triangles;
          var e0 = inedges[i];
          if (e0 === -1) return results;
          var e = e0;
          var p0 = -1;
          do {
            p0 = triangles[e];
            results.push(p0);
            e = e % 3 === 2 ? e - 2 : e + 1;
            if (triangles[e] !== i) break;
            e = halfedges[e];
            if (e === -1) {
              var p = hull[(_hullIndex[i] + 1) % hull.length];
              if (p !== p0) results.push(p);
              break;
            }
          } while (e !== e0);
          return results;
        };
        _proto.find = function find(x2, y2, i) {
          if (i === void 0) {
            i = 0;
          }
          if ((x2 = +x2, x2 !== x2) || (y2 = +y2, y2 !== y2)) return -1;
          var i0 = i;
          var c2;
          while ((c2 = this._step(i, x2, y2)) >= 0 && c2 !== i && c2 !== i0) {
            i = c2;
          }
          return c2;
        };
        _proto._step = function _step(i, x2, y2) {
          var inedges = this.inedges, points = this.points;
          if (inedges[i] === -1 || !points.length) return (i + 1) % (points.length >> 1);
          var c2 = i;
          var dc = Math.pow(x2 - points[i * 2], 2) + Math.pow(y2 - points[i * 2 + 1], 2);
          for (var _iterator = this.neighbors(i), _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) {
            var _ref;
            if (_isArray) {
              if (_i2 >= _iterator.length) break;
              _ref = _iterator[_i2++];
            } else {
              _i2 = _iterator.next();
              if (_i2.done) break;
              _ref = _i2.value;
            }
            var t = _ref;
            var dt = Math.pow(x2 - points[t * 2], 2) + Math.pow(y2 - points[t * 2 + 1], 2);
            if (dt < dc) {
              dc = dt;
              c2 = t;
            }
          }
          return c2;
        };
        return Delaunay3;
      }();
      exports["default"] = Delaunay2;
      Delaunay2.from = function(points, fx, fy, that) {
        if (fx === void 0) {
          fx = pointX;
        }
        if (fy === void 0) {
          fy = pointY;
        }
        return new Delaunay2(flatArray(points, fx, fy, that));
      };
    }
  });

  // node_modules/@patternfly/react-icons/dist/js/icons/info-circle-icon.js
  var require_info_circle_icon = __commonJS({
    "node_modules/@patternfly/react-icons/dist/js/icons/info-circle-icon.js"(exports) {
      "use strict";
      exports.__esModule = true;
      exports.InfoCircleIconConfig = {
        name: "InfoCircleIcon",
        height: 512,
        width: 512,
        svgPath: "M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z",
        yOffset: 0,
        xOffset: 0
      };
      exports.InfoCircleIcon = require_createIcon().createIcon(exports.InfoCircleIconConfig);
      exports["default"] = exports.InfoCircleIcon;
    }
  });

  // pkg/lib/cockpit-dark-theme.ts
  function debug(...args) {
    if (window.debugging == "all" || window.debugging?.includes("style")) {
      console.debug([`cockpit-dark-theme: ${document.documentElement.id}:`, ...args].join(" "));
    }
  }
  function changeDarkThemeClass(documentElement, dark_mode) {
    debug(`Setting cockpit theme to ${dark_mode ? "dark" : "light"}`);
    if (dark_mode) {
      documentElement.classList.add("pf-v5-theme-dark");
    } else {
      documentElement.classList.remove("pf-v5-theme-dark");
    }
  }
  function _setDarkMode(_style) {
    const style = _style || localStorage.getItem("shell:style") || "auto";
    let dark_mode;
    if (window.matchMedia?.("(prefers-color-scheme: dark)").matches && style === "auto" || style === "dark") {
      dark_mode = true;
    } else {
      dark_mode = false;
    }
    changeDarkThemeClass(document.documentElement, dark_mode);
  }
  window.addEventListener("storage", (event) => {
    if (event.key === "shell:style") {
      debug(`Storage element 'shell:style' changed from  ${event.oldValue} to ${event.newValue}`);
      _setDarkMode();
    }
  });
  window.addEventListener("cockpit-style", (event) => {
    if (event instanceof CustomEvent) {
      const style = event.detail.style;
      debug(`Event received from shell with 'cockpit-style'  ${style}`);
      _setDarkMode(style);
    }
  });
  window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
    debug(`Operating system theme preference changed to ${window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light"}`);
    _setDarkMode();
  });
  _setDarkMode();

  // src/index.js
  var import_react184 = __toESM(require_react(), 1);
  var import_react_dom = __toESM(require_react_dom(), 1);

  // pkg/lib/cockpit/_internal/base64.js
  function uint6_to_b64(x2) {
    return x2 < 26 ? x2 + 65 : x2 < 52 ? x2 + 71 : x2 < 62 ? x2 - 4 : x2 === 62 ? 43 : x2 === 63 ? 47 : 65;
  }
  function base64_encode(data) {
    if (typeof data === "string")
      return window.btoa(data);
    if (data instanceof window.ArrayBuffer)
      data = new window.Uint8Array(data);
    const length = data.length;
    let mod3 = 2;
    let str = "";
    for (let uint24 = 0, i = 0; i < length; i++) {
      mod3 = i % 3;
      uint24 |= data[i] << (16 >>> mod3 & 24);
      if (mod3 === 2 || length - i === 1) {
        str += String.fromCharCode(
          uint6_to_b64(uint24 >>> 18 & 63),
          uint6_to_b64(uint24 >>> 12 & 63),
          uint6_to_b64(uint24 >>> 6 & 63),
          uint6_to_b64(uint24 & 63)
        );
        uint24 = 0;
      }
    }
    return str.substr(0, str.length - 2 + mod3) + (mod3 === 2 ? "" : mod3 === 1 ? "=" : "==");
  }
  function b64_to_uint6(x2) {
    return x2 > 64 && x2 < 91 ? x2 - 65 : x2 > 96 && x2 < 123 ? x2 - 71 : x2 > 47 && x2 < 58 ? x2 + 4 : x2 === 43 ? 62 : x2 === 47 ? 63 : 0;
  }
  function base64_decode(str, constructor) {
    if (constructor === String)
      return window.atob(str);
    const ilen = str.length;
    let eq;
    for (eq = 0; eq < 3; eq++) {
      if (str[ilen - (eq + 1)] != "=")
        break;
    }
    const olen = (ilen * 3 + 1 >> 2) - eq;
    const data = new (constructor || Array)(olen);
    for (let mod3, mod4, uint24 = 0, oi = 0, ii = 0; ii < ilen; ii++) {
      mod4 = ii & 3;
      uint24 |= b64_to_uint6(str.charCodeAt(ii)) << 18 - 6 * mod4;
      if (mod4 === 3 || ilen - ii === 1) {
        for (mod3 = 0; mod3 < 3 && oi < olen; mod3++, oi++)
          data[oi] = uint24 >>> (16 >>> mod3 & 24) & 255;
        uint24 = 0;
      }
    }
    return data;
  }

  // pkg/lib/cockpit/_internal/common.ts
  if (typeof window.debugging === "undefined") {
    try {
      Object.defineProperty(window, "debugging", {
        get: function() {
          return window.sessionStorage.debugging || window.localStorage.debugging;
        },
        set: function(x2) {
          window.sessionStorage.debugging = x2;
        }
      });
    } catch {
    }
  }
  function in_array(array, val) {
    const length = array.length;
    for (let i = 0; i < length; i++) {
      if (val === array[i])
        return true;
    }
    return false;
  }
  function is_function(x2) {
    return typeof x2 === "function";
  }
  function is_object(x2) {
    return x2 !== null && typeof x2 === "object";
  }
  function is_plain_object(x2) {
    return is_object(x2) && Object.prototype.toString.call(x2) === "[object Object]";
  }
  function invoke_functions(functions, self2, args) {
    const length = functions?.length ?? 0;
    for (let i = 0; i < length; i++) {
      if (functions[i])
        functions[i].apply(self2, args);
    }
  }
  function iterate_data(data, callback, batch = 64 * 1024) {
    if (typeof data === "string") {
      for (let i = 0; i < data.length; i += batch) {
        callback(data.substring(i, i + batch));
      }
    } else if (data) {
      for (let i = 0; i < data.byteLength; i += batch) {
        const n = Math.min(data.byteLength - i, batch);
        callback(new Uint8Array(data.buffer, i, n));
      }
    }
  }
  function join_data(buffers, binary) {
    if (!binary)
      return buffers.join("");
    let total = 0;
    const length = buffers.length;
    for (let i = 0; i < length; i++)
      total += buffers[i].length;
    const data = new Uint8Array(total);
    for (let j = 0, i = 0; i < length; i++) {
      data.set(buffers[i], j);
      j += buffers[i].length;
    }
    return data;
  }

  // pkg/lib/cockpit/_internal/deferred.js
  var later_queue = [];
  var later_timeout = null;
  function later_drain() {
    const queue = later_queue;
    later_timeout = null;
    later_queue = [];
    for (; ; ) {
      const func = queue.shift();
      if (!func)
        break;
      func();
    }
  }
  function later_invoke(func) {
    if (func)
      later_queue.push(func);
    if (later_timeout === null)
      later_timeout = window.setTimeout(later_drain, 0);
  }
  function promise_then(state, fulfilled, rejected, updated) {
    if (fulfilled === void 0 && rejected === void 0 && updated === void 0)
      return null;
    const result = new Deferred();
    state.pending = state.pending || [];
    state.pending.push([result, fulfilled, rejected, updated]);
    if (state.status > 0)
      schedule_process_queue(state);
    return result.promise;
  }
  function create_promise(state) {
    const self2 = function Promise2(target) {
      if (target) {
        Object.assign(target, self2);
        return target;
      }
      return self2;
    };
    state.status = 0;
    self2.then = function then(fulfilled, rejected, updated) {
      return promise_then(state, fulfilled, rejected, updated) || self2;
    };
    self2.catch = function catch_(callback) {
      return promise_then(state, null, callback) || self2;
    };
    self2.finally = function finally_(callback, updated) {
      return promise_then(state, function() {
        return handle_callback(arguments, true, callback);
      }, function() {
        return handle_callback(arguments, false, callback);
      }, updated) || self2;
    };
    self2.done = function done(fulfilled) {
      promise_then(state, fulfilled);
      return self2;
    };
    self2.fail = function fail(rejected) {
      promise_then(state, null, rejected);
      return self2;
    };
    self2.always = function always(callback) {
      promise_then(state, callback, callback);
      return self2;
    };
    self2.progress = function progress(updated) {
      promise_then(state, null, null, updated);
      return self2;
    };
    self2.state = function state_() {
      if (state.status == 1)
        return "resolved";
      if (state.status == 2)
        return "rejected";
      return "pending";
    };
    self2.promise = self2;
    return self2;
  }
  function process_queue(state) {
    const pending = state.pending;
    state.process_scheduled = false;
    state.pending = void 0;
    for (let i = 0, ii = pending.length; i < ii; ++i) {
      state.pur = true;
      const deferred = pending[i][0];
      const fn = pending[i][state.status];
      if (is_function(fn)) {
        deferred.resolve(fn.apply(state.promise, state.values));
      } else if (state.status === 1) {
        deferred.resolve.apply(deferred.resolve, state.values);
      } else {
        deferred.reject.apply(deferred.reject, state.values);
      }
    }
  }
  function schedule_process_queue(state) {
    if (state.process_scheduled || !state.pending)
      return;
    state.process_scheduled = true;
    later_invoke(function() {
      process_queue(state);
    });
  }
  function deferred_resolve(state, values) {
    let then;
    let done = false;
    if (is_object(values[0]) || is_function(values[0]))
      then = values[0]?.then;
    if (is_function(then)) {
      state.status = -1;
      then.call(values[0], function() {
        if (done)
          return;
        done = true;
        deferred_resolve(state, arguments);
      }, function() {
        if (done)
          return;
        done = true;
        deferred_reject(state, arguments);
      }, function() {
        deferred_notify(state, arguments);
      });
    } else {
      state.values = values;
      state.status = 1;
      schedule_process_queue(state);
    }
  }
  function deferred_reject(state, values) {
    state.values = values;
    state.status = 2;
    schedule_process_queue(state);
  }
  function deferred_notify(state, values) {
    const callbacks = state.pending;
    if (state.status <= 0 && callbacks?.length) {
      later_invoke(function() {
        for (let i = 0, ii = callbacks.length; i < ii; i++) {
          const result = callbacks[i][0];
          const callback = callbacks[i][3];
          if (is_function(callback))
            result.notify(callback.apply(state.promise, values));
          else
            result.notify.apply(result, values);
        }
      });
    }
  }
  function Deferred() {
    const self2 = this;
    const state = {};
    self2.promise = state.promise = create_promise(state);
    self2.resolve = function resolve() {
      if (arguments[0] === state.promise)
        throw new Error("Expected promise to be resolved with other value than itself");
      if (!state.status)
        deferred_resolve(state, arguments);
      return self2;
    };
    self2.reject = function reject() {
      if (state.status)
        return;
      deferred_reject(state, arguments);
      return self2;
    };
    self2.notify = function notify() {
      deferred_notify(state, arguments);
      return self2;
    };
  }
  function prep_promise(values, resolved) {
    const result = new Deferred();
    if (resolved)
      result.resolve.apply(result, values);
    else
      result.reject.apply(result, values);
    return result.promise;
  }
  function handle_callback(values, is_resolved, callback) {
    let callback_output = null;
    if (is_function(callback))
      callback_output = callback();
    if (callback_output && is_function(callback_output.then)) {
      return callback_output.then(function() {
        return prep_promise(values, is_resolved);
      }, function() {
        return prep_promise(arguments, false);
      });
    } else {
      return prep_promise(values, is_resolved);
    }
  }

  // pkg/lib/cockpit/_internal/event-mixin.js
  function event_mixin(obj, handlers) {
    Object.defineProperties(obj, {
      addEventListener: {
        enumerable: false,
        value: function addEventListener(type, handler) {
          if (handlers[type] === void 0)
            handlers[type] = [];
          handlers[type].push(handler);
        }
      },
      removeEventListener: {
        enumerable: false,
        value: function removeEventListener(type, handler) {
          const length = handlers[type] ? handlers[type].length : 0;
          for (let i = 0; i < length; i++) {
            if (handlers[type][i] === handler) {
              handlers[type][i] = null;
              break;
            }
          }
        }
      },
      dispatchEvent: {
        enumerable: false,
        value: function dispatchEvent(event) {
          let type, args;
          if (typeof event === "string") {
            type = event;
            args = Array.prototype.slice.call(arguments, 1);
            let detail = null;
            if (arguments.length == 2)
              detail = arguments[1];
            else if (arguments.length > 2)
              detail = args;
            event = new CustomEvent(type, {
              bubbles: false,
              cancelable: false,
              detail
            });
            args.unshift(event);
          } else {
            type = event.type;
            args = arguments;
          }
          if (is_function(obj["on" + type]))
            obj["on" + type].apply(obj, args);
          invoke_functions(handlers[type], obj, args);
        }
      }
    });
  }

  // pkg/lib/cockpit/event.ts
  var _listeners;
  var EventEmitter = class {
    constructor() {
      __privateAdd(this, _listeners, {});
    }
    on(event, listener) {
      var _a;
      const listeners = (_a = __privateGet(this, _listeners))[event] || (_a[event] = []);
      listeners.push(listener);
      return () => {
        listeners.splice(listeners.indexOf(listener), 1);
      };
    }
    emit(event, ...args) {
      for (const listener of __privateGet(this, _listeners)[event] || []) {
        listener(...args);
      }
    }
  };
  _listeners = new WeakMap();

  // pkg/lib/cockpit/_internal/location.ts
  function get_url_root() {
    const meta_url_root = document.head.querySelector("meta[name='url-root']");
    if (meta_url_root instanceof HTMLMetaElement) {
      return meta_url_root.content.replace(/^\/+|\/+$/g, "");
    } else {
      try {
        return window.localStorage.getItem("url-root");
      } catch {
        return null;
      }
    }
  }
  var url_root = get_url_root();
  var transport_origin = window.location.origin;
  function calculate_application() {
    let path2 = window.location.pathname || "/";
    let _url_root = url_root;
    if (window.mock?.pathname)
      path2 = window.mock.pathname;
    if (window.mock?.url_root)
      _url_root = window.mock.url_root;
    if (_url_root && path2.indexOf("/" + _url_root) === 0)
      path2 = path2.replace("/" + _url_root, "") || "/";
    if (path2.indexOf("/cockpit/") !== 0 && path2.indexOf("/cockpit+") !== 0) {
      if (path2.indexOf("/=") === 0)
        path2 = "/cockpit+" + path2.split("/")[1];
      else
        path2 = "/cockpit";
    }
    return path2.split("/")[1];
  }
  function calculate_url(suffix) {
    if (!suffix)
      suffix = "socket";
    const window_loc = window.location.toString();
    let _url_root = url_root;
    if (window.mock?.url)
      return window.mock.url;
    if (window.mock?.url_root)
      _url_root = window.mock.url_root;
    let prefix = calculate_application();
    if (_url_root)
      prefix = _url_root + "/" + prefix;
    if (window_loc.indexOf("http:") === 0) {
      return "ws://" + window.location.host + "/" + prefix + "/" + suffix;
    } else if (window_loc.indexOf("https:") === 0) {
      return "wss://" + window.location.host + "/" + prefix + "/" + suffix;
    } else {
      throw new Error("Cockpit must be used over http or https");
    }
  }

  // pkg/lib/cockpit/_internal/parentwebsocket.ts
  var ParentWebSocket = class {
    constructor(parent2) {
      this.binaryType = "arraybuffer";
      // compatibility with Transport, which sets this
      this.readyState = 0;
      window.addEventListener("message", (event) => {
        if (event.origin !== transport_origin || event.source !== parent2)
          return;
        const data = event.data;
        if (data === void 0 || data.length === void 0 && data.byteLength === void 0)
          return;
        if (data.length === 0) {
          this.readyState = 3;
          this.onclose();
        } else {
          this.onmessage(event);
        }
      }, false);
      window.setTimeout(() => {
        this.readyState = 1;
        this.onopen();
      }, 0);
    }
    // essentially signal handlers: these are assigned to from Transport
    onopen() {
    }
    onclose() {
    }
    onmessage(_event) {
    }
    // same types as the real WebSocket
    send(message) {
      parent.postMessage(message, transport_origin);
    }
    close() {
      this.readyState = 3;
      parent.postMessage("", transport_origin);
      this.onclose();
    }
  };

  // pkg/lib/cockpit/_internal/transport.ts
  var TransportGlobals = class {
    constructor() {
      this.default_transport = null;
      this.reload_after_disconnect = false;
      this.expect_disconnect = false;
      this.init_callback = null;
      this.default_host = null;
      this.process_hints = null;
      this.incoming_filters = [];
    }
  };
  var transport_globals = new TransportGlobals();
  window.addEventListener("beforeunload", () => {
    transport_globals.expect_disconnect = true;
  }, false);
  function transport_debug(...args) {
    if (window.debugging == "all" || window.debugging?.includes("channel"))
      console.debug(...args);
  }
  var _last_channel, _channel_seed, _ws, _ignore_health_check, _got_message, _check_health_timer, _control_cbs, _message_cbs, _waiting_for_init, _Transport_instances, ready_for_channels_fn, process_init_fn, process_control_fn, process_message_fn;
  var Transport = class extends EventEmitter {
    constructor() {
      super();
      __privateAdd(this, _Transport_instances);
      __privateAdd(this, _last_channel, 0);
      __privateAdd(this, _channel_seed, "");
      __privateAdd(this, _ws);
      __privateAdd(this, _ignore_health_check, false);
      __privateAdd(this, _got_message, false);
      __privateAdd(this, _check_health_timer);
      __privateAdd(this, _control_cbs, {});
      __privateAdd(this, _message_cbs, {});
      __privateAdd(this, _waiting_for_init, true);
      this.application = calculate_application();
      if (window.mock)
        window.mock.last_transport = this;
      if (window.parent !== window && window.name.indexOf("cockpit1:") === 0) {
        __privateSet(this, _ws, new ParentWebSocket(window.parent));
      } else {
        const ws_loc = calculate_url();
        transport_debug("connecting to " + ws_loc);
        __privateSet(this, _ws, new WebSocket(ws_loc, "cockpit1"));
        __privateSet(this, _check_health_timer, window.setInterval(() => {
          if (this.ready && __privateGet(this, _ws))
            __privateGet(this, _ws).send('\n{ "command": "ping" }');
          if (!__privateGet(this, _got_message)) {
            if (__privateGet(this, _ignore_health_check)) {
              console.log("health check failure ignored");
            } else {
              console.log("health check failed");
              this.close({ problem: "timeout" });
            }
          }
          __privateSet(this, _got_message, false);
        }, 3e4));
      }
      this.ready = false;
      __privateGet(this, _ws).onopen = () => {
        if (__privateGet(this, _ws)) {
          if (typeof __privateGet(this, _ws).binaryType !== "undefined")
            __privateGet(this, _ws).binaryType = "arraybuffer";
          __privateGet(this, _ws).send('\n{ "command": "init", "version": 1 }');
        }
      };
      __privateGet(this, _ws).onclose = () => {
        transport_debug("WebSocket onclose");
        __privateSet(this, _ws, null);
        if (transport_globals.reload_after_disconnect) {
          transport_globals.expect_disconnect = true;
          window.location.reload(true);
        }
        this.close();
      };
      __privateGet(this, _ws).onmessage = (event) => this.dispatch_data(event);
    }
    dispatch_data(arg) {
      __privateSet(this, _got_message, true);
      const message = arg.data;
      let channel;
      let control = null;
      let payload = null;
      if (message instanceof ArrayBuffer) {
        const frame2 = new window.Uint8Array(message);
        const nl = frame2.indexOf(10);
        channel = new TextDecoder().decode(frame2.subarray(0, nl));
        if (!channel) {
          console.warn("Received invalid binary message without a channel");
          return false;
        }
        payload = frame2.subarray(nl + 1);
        transport_debug("recv binary message:", control, payload);
      } else {
        const nl = message.indexOf("\n");
        channel = message.substring(0, nl);
        if (nl == 0) {
          control = JSON.parse(message);
          transport_debug("recv control:", control);
        } else {
          payload = message.substring(nl + 1);
          transport_debug("recv text message:", channel, payload);
        }
      }
      for (const filter of transport_globals.incoming_filters)
        if (filter(message, channel, control) === false)
          return false;
      if (control)
        __privateMethod(this, _Transport_instances, process_control_fn).call(this, control);
      else if (channel && payload)
        __privateMethod(this, _Transport_instances, process_message_fn).call(this, channel, payload);
      return true;
    }
    close(options5) {
      if (!options5)
        options5 = { problem: "disconnected" };
      options5.command = "close";
      window.clearInterval(__privateGet(this, _check_health_timer));
      const ows = __privateGet(this, _ws);
      __privateSet(this, _ws, null);
      if (ows)
        ows.close();
      if (transport_globals.expect_disconnect)
        return;
      __privateMethod(this, _Transport_instances, ready_for_channels_fn).call(this);
      for (const chan in __privateGet(this, _control_cbs))
        __privateGet(this, _control_cbs)[chan].apply(null, [options5]);
    }
    next_channel() {
      __privateWrapper(this, _last_channel)._++;
      return __privateGet(this, _channel_seed) + String(__privateGet(this, _last_channel));
    }
    send_data(data) {
      if (!__privateGet(this, _ws)) {
        return false;
      }
      __privateGet(this, _ws).send(data);
      return true;
    }
    send_message(payload, channel) {
      if (channel)
        transport_debug("send " + channel, payload);
      else
        transport_debug("send control:", payload);
      if (typeof payload !== "string") {
        const body = payload instanceof ArrayBuffer ? new Uint8Array(payload) : payload;
        const header = new TextEncoder().encode(`${channel}
`);
        const output = new Uint8Array(header.length + body.length);
        output.set(header);
        output.set(body, header.length);
        return this.send_data(output.buffer);
      } else {
        return this.send_data(channel.toString() + "\n" + payload);
      }
    }
    send_control(data) {
      if (!__privateGet(this, _ws) && (data.command == "close" || data.command == "kill"))
        return false;
      if (__privateGet(this, _check_health_timer) && data.command == "hint" && data.hint == "ignore_transport_health_check") {
        __privateSet(this, _ignore_health_check, !!data.data);
        return false;
      }
      return this.send_message(JSON.stringify(data), "");
    }
    register(channel, control_cb, message_cb) {
      __privateGet(this, _control_cbs)[channel] = control_cb;
      __privateGet(this, _message_cbs)[channel] = message_cb;
    }
    unregister(channel) {
      delete __privateGet(this, _control_cbs)[channel];
      delete __privateGet(this, _message_cbs)[channel];
    }
  };
  _last_channel = new WeakMap();
  _channel_seed = new WeakMap();
  _ws = new WeakMap();
  _ignore_health_check = new WeakMap();
  _got_message = new WeakMap();
  _check_health_timer = new WeakMap();
  _control_cbs = new WeakMap();
  _message_cbs = new WeakMap();
  _waiting_for_init = new WeakMap();
  _Transport_instances = new WeakSet();
  /* Called when ready for channels to interact */
  ready_for_channels_fn = function() {
    if (!this.ready) {
      this.ready = true;
      this.emit("ready");
    }
  };
  process_init_fn = function(options5) {
    if (options5.problem) {
      this.close({ problem: options5.problem });
      return;
    }
    if (options5.version !== 1) {
      console.error("received unsupported version in init message: " + options5.version);
      this.close({ problem: "not-supported" });
      return;
    }
    if (options5["channel-seed"])
      __privateSet(this, _channel_seed, String(options5["channel-seed"]));
    if (typeof options5.host === "string")
      transport_globals.default_host = options5.host;
    if (transport_globals.init_callback)
      transport_globals.init_callback(options5);
    if (__privateGet(this, _waiting_for_init)) {
      __privateSet(this, _waiting_for_init, false);
      __privateMethod(this, _Transport_instances, ready_for_channels_fn).call(this);
    }
  };
  process_control_fn = function(data) {
    const channel = data.channel;
    if (data.command == "init") {
      __privateMethod(this, _Transport_instances, process_init_fn).call(this, data);
    } else if (__privateGet(this, _waiting_for_init)) {
      __privateSet(this, _waiting_for_init, false);
      if (data.command != "close" || channel) {
        console.error("received message before init: ", data.command);
        data = { problem: "protocol-error" };
      }
      this.close(data);
    } else if (data.command == "ping") {
      data.command = "pong";
      this.send_control(data);
    } else if (data.command == "pong") {
    } else if (data.command == "hint") {
      if (transport_globals.process_hints)
        transport_globals.process_hints(data);
    } else if (typeof channel === "string") {
      const func = __privateGet(this, _control_cbs)[channel];
      if (func)
        func(data);
    }
  };
  process_message_fn = function(channel, payload) {
    const func = __privateGet(this, _message_cbs)[channel];
    if (func)
      func(payload);
  };
  function ensure_transport(callback) {
    if (!transport_globals.default_transport)
      transport_globals.default_transport = new Transport();
    const transport = transport_globals.default_transport;
    if (transport.ready) {
      callback(transport);
    } else {
      transport.on("ready", () => {
        callback(transport);
      });
    }
  }
  window.addEventListener("unload", () => {
    if (transport_globals.default_transport)
      transport_globals.default_transport.close();
  });

  // pkg/lib/cockpit/_internal/channel.js
  function Channel(options5) {
    const self2 = this;
    event_mixin(self2, {});
    let transport;
    let ready = null;
    let closed = null;
    let waiting = null;
    let received_done = false;
    let sent_done = false;
    let id = null;
    const binary = options5.binary === true;
    const queue = [];
    self2.valid = true;
    self2.options = options5;
    self2.binary = binary;
    self2.id = id;
    function on_message(payload) {
      if (received_done) {
        console.warn("received message after done");
        self2.close("protocol-error");
      } else {
        self2.dispatchEvent("message", payload);
      }
    }
    function on_close(data) {
      closed = data;
      self2.valid = false;
      if (transport && id)
        transport.unregister(id);
      if (closed.message && !options5.err)
        console.warn(closed.message);
      self2.dispatchEvent("close", closed);
      if (waiting)
        waiting.resolve(closed);
    }
    function on_ready(data) {
      ready = data;
      self2.dispatchEvent("ready", ready);
    }
    function on_control(data) {
      if (data.command == "close") {
        on_close(data);
        return;
      } else if (data.command == "ready") {
        on_ready(data);
      }
      const done = data.command === "done";
      if (done && received_done) {
        console.warn("received two done commands on channel");
        self2.close("protocol-error");
      } else {
        if (done)
          received_done = true;
        self2.dispatchEvent("control", data);
      }
    }
    function send_payload(payload) {
      if (!binary) {
        if (typeof payload !== "string")
          payload = String(payload);
      }
      transport.send_message(payload, id);
    }
    ensure_transport(function(trans) {
      transport = trans;
      if (closed)
        return;
      id = transport.next_channel();
      self2.id = id;
      transport.register(id, on_control, on_message);
      const command = {};
      for (const i in options5)
        command[i] = options5[i];
      command.command = "open";
      command.channel = id;
      if (!command.host) {
        if (transport_globals.default_host)
          command.host = transport_globals.default_host;
      }
      if (binary)
        command.binary = "raw";
      else
        delete command.binary;
      command["flow-control"] = true;
      transport.send_control(command);
      while (queue.length > 0) {
        const item = queue.shift();
        if (item[0]) {
          item[1].channel = id;
          transport.send_control(item[1]);
        } else {
          send_payload(item[1]);
        }
      }
    });
    self2.send = function send(message) {
      if (closed)
        console.warn("sending message on closed channel");
      else if (sent_done)
        console.warn("sending message after done");
      else if (!transport)
        queue.push([false, message]);
      else
        send_payload(message);
    };
    self2.control = function control(options6) {
      options6 = options6 || {};
      if (!options6.command)
        options6.command = "options";
      if (options6.command === "done")
        sent_done = true;
      options6.channel = id;
      if (!transport)
        queue.push([true, options6]);
      else
        transport.send_control(options6);
    };
    self2.wait = function wait(callback) {
      if (!waiting) {
        waiting = new Deferred();
        if (closed) {
          waiting.reject(closed);
        } else if (ready) {
          waiting.resolve(ready);
        } else {
          self2.addEventListener("ready", function(event, data) {
            waiting.resolve(data);
          });
          self2.addEventListener("close", function(event, data) {
            waiting.reject(data);
          });
        }
      }
      const promise = waiting.promise;
      if (callback)
        promise.then(callback, callback);
      return promise;
    };
    self2.close = function close(options6) {
      if (closed)
        return;
      if (!options6)
        options6 = {};
      else if (typeof options6 == "string")
        options6 = { problem: options6 };
      options6.command = "close";
      options6.channel = id;
      if (!transport)
        queue.push([true, options6]);
      else
        transport.send_control(options6);
      on_close(options6);
    };
    self2.buffer = function buffer(callback) {
      const buffers = [];
      buffers.callback = callback;
      buffers.squash = function squash() {
        return join_data(buffers, binary);
      };
      function on_message2(event, data) {
        buffers.push(data);
        if (buffers.callback) {
          const block = join_data(buffers, binary);
          if (block.length > 0) {
            const consumed = buffers.callback.call(self2, block);
            if (typeof consumed !== "number" || consumed === block.length) {
              buffers.length = 0;
            } else if (consumed === 0) {
              buffers.length = 1;
              buffers[0] = block;
            } else if (consumed !== 0) {
              buffers.length = 1;
              if (block.subarray)
                buffers[0] = block.subarray(consumed);
              else if (block.substring)
                buffers[0] = block.substring(consumed);
              else
                buffers[0] = block.slice(consumed);
            }
          }
        }
      }
      function on_close2() {
        self2.removeEventListener("message", on_message2);
        self2.removeEventListener("close", on_close2);
      }
      self2.addEventListener("message", on_message2);
      self2.addEventListener("close", on_close2);
      return buffers;
    };
    self2.toString = function toString() {
      const host = options5.host || "localhost";
      return "[Channel " + (self2.valid ? id : "<invalid>") + " -> " + host + "]";
    };
  }

  // pkg/lib/cockpit/channel.ts
  var _transport, _received, _queue, _sent_done, _Channel_instances, on_control_fn;
  var Channel2 = class extends EventEmitter {
    /**
     * Open a new channel to the bridge.
     *
     * @options: The options for the channel.  A payload type must be specified.
     */
    constructor(options5) {
      super();
      __privateAdd(this, _Channel_instances);
      this.id = null;
      __privateAdd(this, _transport, null);
      __privateAdd(this, _received, {});
      __privateAdd(this, _queue, []);
      __privateAdd(this, _sent_done, false);
      this.options = { ...options5 };
      this.binary = options5?.binary === true;
      ensure_transport((transport) => {
        if (__privateGet(this, _received).close)
          return;
        __privateSet(this, _transport, transport);
        this.id = transport.next_channel();
        transport.register(
          this.id,
          (control) => {
            if (typeof control.command !== "string") {
              console.error("Received control message without command", this.id, this.options, control);
            } else {
              __privateMethod(this, _Channel_instances, on_control_fn).call(this, control);
            }
          },
          (data) => {
            if (this.binary && typeof data === "string") {
              console.error("Text message received on binary channel", this.id, this.options, data);
            } else if (!this.binary && typeof data !== "string") {
              console.error("Binary message received on text channel", this.id, this.options, data);
            } else {
              this.emit("data", data);
            }
          }
        );
        const command = { ...this.options };
        if (!command.host && transport_globals.default_host) {
          command.host = transport_globals.default_host;
        }
        if (this.binary) {
          command.binary = "raw";
        } else {
          delete command.binary;
        }
        transport.send_control({ ...command, command: "open", channel: this.id, "flow-control": true });
        for (const [is_control, message] of __privateGet(this, _queue)) {
          if (is_control) {
            transport.send_control({ ...message, channel: this.id });
          } else {
            transport.send_message(message, this.id);
          }
        }
        __privateSet(this, _queue, []);
      });
    }
    /**
     * Sends a payload frame.
     *
     * You may not call this after you've sent a 'done' control message or
     * after the channel has been closed.  This implies that you need to
     * register a 'close' event handler, and stop sending data after it's
     * called.
     *
     * @message the payload to send, either a string or a Uint8Array.
     */
    send_data(message) {
      if (__privateGet(this, _sent_done)) {
        console.error("sending data after .done()", this.id, this.options, message);
      } else if (__privateGet(this, _received).close) {
        console.error("sending data after close", this.id, this.options, message);
      } else if (__privateGet(this, _transport) && this.id) {
        __privateGet(this, _transport).send_message(message, this.id);
      } else {
        __privateGet(this, _queue).push([false, message]);
      }
    }
    /**
     * Sends a control message on the channel.
     *
     * You may not call this after the channel is closed.  This implies that
     * you need to register a 'close' event handler, and stop sending data
     * after it's called.
     *
     * @options: the message to send.  A command must be specified.
     */
    send_control(options5) {
      if (__privateGet(this, _received).close) {
        console.error("sending control after close", this.id, this.options, options5);
        return;
      }
      if (options5.command === "close") {
        __privateMethod(this, _Channel_instances, on_control_fn).call(this, options5);
      } else if (options5.command === "done") {
        __privateSet(this, _sent_done, true);
      }
      if (__privateGet(this, _transport) && this.id) {
        __privateGet(this, _transport).send_control({ ...options5, channel: this.id });
      } else {
        __privateGet(this, _queue).push([true, options5]);
      }
    }
    /**
     * Sends a done control message on the channel.  This is something like
     * EOF: it means that you won't send any more data using `.send_data()`.
     *
     * @options: optional extra arguments for the message.
     */
    done(options5) {
      this.send_control({ ...options5, command: "done" });
    }
    /**
     * Closes the channel.
     *
     * This means that you're completely finished with the channel.  Any
     * underlying resources will be freed as soon as possible.  When you call
     * this you'll receive a 'close' signal (synchronously) and then nothing
     * else.
     *
     * @problem: a problem code.  If this is unset it implies something like a
     * "successful" close.  Otherwise, it indicates an error.
     * @options: the bridge will ignore this, but it will be thrown as the
     * result of any pending wait() operations and passed to the 'close' signal
     * handler, so you can use it to communicate with your own code.
     */
    close(problem, options5) {
      if (!__privateGet(this, _received).close) {
        this.send_control({ ...options5, ...problem && { problem }, command: "close" });
      }
    }
    /**
     * Waits for the result of the channel open request.
     *
     * @return: the content of the ready message, on success
     * @throws: the content of the close message, on fail
     */
    wait() {
      return new Promise((resolve, reject) => {
        if (__privateGet(this, _received).ready) {
          resolve(__privateGet(this, _received).ready);
        } else if (__privateGet(this, _received).close) {
          reject(__privateGet(this, _received).close);
        } else {
          this.on("ready", resolve);
          this.on("close", reject);
        }
      });
    }
    /**
     * Provides a text description of the channel.
     */
    toString() {
      const state = !this.id && "waiting for transport" || __privateGet(this, _received).close?.problem && `${this.id} error ${__privateGet(this, _received).close.problem}` || __privateGet(this, _received).close && `${this.id} closed` || __privateGet(this, _received).ready && `${this.id} opened` || `${this.id} waiting for open`;
      const host = this.options?.host || "localhost";
      return `[Channel ${state} -> ${this.options?.payload}@${host}]`;
    }
  };
  _transport = new WeakMap();
  _received = new WeakMap();
  _queue = new WeakMap();
  _sent_done = new WeakMap();
  _Channel_instances = new WeakSet();
  on_control_fn = function(control) {
    const command = control.command;
    if (command === "ready" || command === "close" || command === "done") {
      if (__privateGet(this, _received)[command]) {
        console.error("received duplicate control message", this.id, this.options, control);
        return;
      }
      __privateGet(this, _received)[command] = control;
      this.emit(command, control);
    } else {
      this.emit("control", control);
    }
    if (command === "close") {
      if (__privateGet(this, _transport) && this.id)
        __privateGet(this, _transport).unregister(this.id);
      if (control.message && !this.options?.err)
        console.warn("channel error", control.message, this.id, this.options);
    }
  };

  // pkg/lib/cockpit/fsinfo.ts
  function is_json_dict(value) {
    return value?.constructor === Object;
  }
  function json_merge(current, patch) {
    if (is_json_dict(patch)) {
      const updated = is_json_dict(current) ? { ...current } : {};
      for (const [key, value] of Object.entries(patch)) {
        if (value === null) {
          delete updated[key];
        } else {
          updated[key] = json_merge(updated[key], value);
        }
      }
      return updated;
    } else {
      return patch;
    }
  }
  var FsInfoClient = class extends EventEmitter {
    constructor(path2, attrs, options5) {
      super();
      this.state = { loading: true };
      this.partial_state = null;
      this.channel = new Channel2({
        payload: "fsinfo",
        path: path2,
        attrs,
        watch: true,
        ...options5
      });
      this.channel.on("data", (payload) => {
        this.partial_state = json_merge(this.partial_state, JSON.parse(payload));
        if (is_json_dict(this.partial_state) && !this.partial_state.partial) {
          this.state = { ...this.partial_state };
          this.emit("change", this.state);
        }
      });
      this.channel.on("close", (message) => {
        this.emit("close", message);
      });
    }
    close() {
      this.channel.close();
    }
    static entry(info2, name2) {
      return info2.entries?.[name2] ?? null;
    }
    static target(info2, name2) {
      const entries = info2.entries ?? {};
      const targets = info2.targets ?? {};
      let entry = entries[name2] ?? null;
      for (let i = 0; i < 40; i++) {
        const target = entry?.target;
        if (!target)
          return entry;
        if (target === ".")
          return info2;
        entry = entries[target] ?? targets[target] ?? null;
      }
      return null;
    }
  };

  // pkg/lib/cockpit.js
  function factory() {
    const cockpit2 = {};
    event_mixin(cockpit2, {});
    cockpit2.channel = function channel(options5) {
      return new Channel(options5);
    };
    cockpit2.event_target = function event_target(obj) {
      event_mixin(obj, {});
      return obj;
    };
    cockpit2.extend = Object.assign;
    cockpit2.manifests = {};
    cockpit2.base64_encode = base64_encode;
    cockpit2.base64_decode = base64_decode;
    cockpit2.kill = function kill(host, group) {
      const options5 = {};
      if (host)
        options5.host = host;
      if (group)
        options5.group = group;
      cockpit2.transport.control("kill", options5);
    };
    cockpit2.hint = function hint(name2, options5) {
      if (!transport_globals.default_transport)
        return;
      if (!options5)
        options5 = transport_globals.default_host;
      if (typeof options5 == "string")
        options5 = { host: options5 };
      options5.hint = name2;
      cockpit2.transport.control("hint", options5);
    };
    cockpit2.transport = {
      wait: ensure_transport,
      inject: function inject(message, out) {
        if (!transport_globals.default_transport)
          return false;
        if (out === void 0 || out)
          return transport_globals.default_transport.send_data(message);
        else
          return transport_globals.default_transport.dispatch_data({ data: message });
      },
      filter: function filter(callback, out) {
        if (out) {
          console.error("'out' filters are no longer supported");
        } else {
          transport_globals.incoming_filters.push(callback);
        }
      },
      close: function close(problem) {
        if (transport_globals.default_transport)
          transport_globals.default_transport.close(problem ? { problem } : void 0);
        transport_globals.default_transport = null;
        this.options = {};
      },
      origin: transport_origin,
      options: {},
      uri: calculate_url,
      control: function(command, options5) {
        options5 = { ...options5, command };
        ensure_transport(function(transport) {
          transport.send_control(options5);
        });
      },
      application: function() {
        if (!transport_globals.default_transport || window.mock)
          return calculate_application();
        return transport_globals.default_transport.application;
      }
    };
    cockpit2.when = function when(value, fulfilled, rejected, updated) {
      const result = cockpit2.defer();
      result.resolve(value);
      return result.promise.then(fulfilled, rejected, updated);
    };
    cockpit2.resolve = function resolve(result) {
      return cockpit2.defer().resolve(result).promise;
    };
    cockpit2.reject = function reject(ex) {
      return cockpit2.defer().reject(ex).promise;
    };
    cockpit2.defer = function() {
      return new Deferred();
    };
    const fmt_re = /\$\{([^}]+)\}|\$([a-zA-Z0-9_]+)/g;
    cockpit2.format = function format2(fmt, args) {
      if (arguments.length != 2 || !is_object(args) || args === null)
        args = Array.prototype.slice.call(arguments, 1);
      function replace(m, x2, y2) {
        const value = args[x2 || y2];
        if (value === 0)
          return "0";
        return value || "";
      }
      return fmt.replace(fmt_re, replace);
    };
    cockpit2.format_number = function format_number(number4, precision) {
      if (precision === void 0)
        precision = 3;
      const lang = cockpit2.language === void 0 ? void 0 : cockpit2.language.replace("_", "-");
      const smallestValue = 10 ** -precision;
      if (!number4 && number4 !== 0)
        return "";
      else if (number4 % 1 === 0)
        return number4.toString();
      else if (number4 > 0 && number4 <= smallestValue)
        return smallestValue.toLocaleString(lang);
      else if (number4 < 0 && number4 >= -smallestValue)
        return (-smallestValue).toLocaleString(lang);
      else if (number4 > 999 || number4 < -999)
        return number4.toFixed(0);
      else
        return number4.toLocaleString(lang, {
          maximumSignificantDigits: precision,
          minimumSignificantDigits: precision
        });
    };
    let deprecated_format_warned = false;
    function format_units(suffixes, number4, second_arg, third_arg) {
      let options5 = second_arg;
      let factor = options5?.base2 ? 1024 : 1e3;
      if (third_arg || second_arg && !is_object(second_arg)) {
        if (!deprecated_format_warned) {
          console.warn(`cockpit.format_{bytes,bits}[_per_sec](..., ${second_arg}, ${third_arg}) is deprecated.`);
          deprecated_format_warned = true;
        }
        factor = second_arg || 1e3;
        options5 = third_arg;
        if (!is_object(options5))
          options5 = { separate: options5 };
      }
      let suffix = null;
      if (!number4 && number4 !== 0) {
        suffix = null;
      } else if (typeof factor === "string") {
        const keys = [];
        for (const key in suffixes)
          keys.push(key);
        keys.sort().reverse();
        for (let y2 = 0; y2 < keys.length; y2++) {
          for (let x2 = 0; x2 < suffixes[keys[y2]].length; x2++) {
            if (factor == suffixes[keys[y2]][x2]) {
              number4 = number4 / Math.pow(keys[y2], x2);
              suffix = factor;
              break;
            }
          }
          if (suffix)
            break;
        }
      } else if (factor in suffixes) {
        let divisor = 1;
        for (let i = 0; i < suffixes[factor].length; i++) {
          const quotient = number4 / divisor;
          if (quotient < factor) {
            number4 = quotient;
            suffix = suffixes[factor][i];
            break;
          }
          divisor *= factor;
        }
      }
      const string_representation = cockpit2.format_number(number4, options5?.precision);
      let ret;
      if (string_representation && suffix)
        ret = [string_representation, suffix];
      else
        ret = [string_representation];
      if (!options5?.separate)
        ret = ret.join(" ");
      return ret;
    }
    const byte_suffixes = {
      1e3: ["B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB"],
      1024: ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB"]
    };
    cockpit2.format_bytes = function format_bytes(number4, ...args) {
      return format_units(byte_suffixes, number4, ...args);
    };
    const byte_sec_suffixes = {
      1e3: ["B/s", "kB/s", "MB/s", "GB/s", "TB/s", "PB/s", "EB/s", "ZB/s"],
      1024: ["B/s", "KiB/s", "MiB/s", "GiB/s", "TiB/s", "PiB/s", "EiB/s", "ZiB/s"]
    };
    cockpit2.format_bytes_per_sec = function format_bytes_per_sec(number4, ...args) {
      return format_units(byte_sec_suffixes, number4, ...args);
    };
    const bit_suffixes = {
      1e3: ["bps", "Kbps", "Mbps", "Gbps", "Tbps", "Pbps", "Ebps", "Zbps"]
    };
    cockpit2.format_bits_per_sec = function format_bits_per_sec(number4, ...args) {
      return format_units(bit_suffixes, number4, ...args);
    };
    function StorageHelper(storageName) {
      const self2 = this;
      let storage;
      try {
        storage = window[storageName];
      } catch (e) {
      }
      self2.prefixedKey = function(key) {
        return cockpit2.transport.application() + ":" + key;
      };
      self2.getItem = function(key, both) {
        let value = storage.getItem(self2.prefixedKey(key));
        if (!value && both)
          value = storage.getItem(key);
        return value;
      };
      self2.setItem = function(key, value, both) {
        storage.setItem(self2.prefixedKey(key), value);
        if (both)
          storage.setItem(key, value);
      };
      self2.removeItem = function(key, both) {
        storage.removeItem(self2.prefixedKey(key));
        if (both)
          storage.removeItem(key);
      };
      self2.clear = function(full) {
        let i = 0;
        while (i < storage.length) {
          const k2 = storage.key(i);
          if (full && k2.indexOf("cockpit") !== 0)
            storage.removeItem(k2);
          else if (k2.indexOf(cockpit2.transport.application()) === 0)
            storage.removeItem(k2);
          else
            i++;
        }
      };
    }
    cockpit2.localStorage = new StorageHelper("localStorage");
    cockpit2.sessionStorage = new StorageHelper("sessionStorage");
    function lookup_storage(win) {
      let storage;
      if (win.parent && win.parent !== win)
        storage = lookup_storage(win.parent);
      if (!storage) {
        try {
          storage = win["cv1-storage"];
          if (!storage)
            win["cv1-storage"] = storage = {};
        } catch (ex) {
        }
      }
      return storage;
    }
    function StorageCache(org_key, provider, consumer) {
      const self2 = this;
      const key = cockpit2.transport.application() + ":" + org_key;
      const trigger = window.sessionStorage;
      let last;
      const storage = lookup_storage(window);
      let claimed = false;
      let source;
      function callback() {
        if (storage[key] !== void 0) {
          const value = storage[key];
          window.setTimeout(function() {
            if (consumer(value, org_key) === false)
              self2.close();
          });
        }
      }
      function result(value) {
        if (source && !claimed)
          claimed = true;
        if (!claimed)
          return;
        const version = Math.floor(Math.random() * 1e7) + 1;
        const ev = document.createEvent("StorageEvent");
        ev.initStorageEvent(
          "storage",
          false,
          false,
          key,
          null,
          version,
          window.location,
          trigger
        );
        storage[key] = value;
        trigger.setItem(key, version);
        ev.self = self2;
        window.dispatchEvent(ev);
      }
      self2.claim = function claim() {
        if (source)
          return;
        const claiming = { close: function() {
        } };
        source = claiming;
        const changed2 = provider(result, org_key);
        if (source === claiming)
          source = changed2;
        else
          changed2.close();
      };
      function unclaim() {
        if (source?.close)
          source.close();
        source = null;
        if (!claimed)
          return;
        claimed = false;
        let current_value = trigger.getItem(key);
        if (current_value)
          current_value = parseInt(current_value, 10);
        else
          current_value = null;
        if (last && last === current_value) {
          const ev = document.createEvent("StorageEvent");
          const version = trigger[key];
          ev.initStorageEvent(
            "storage",
            false,
            false,
            key,
            version,
            null,
            window.location,
            trigger
          );
          delete storage[key];
          trigger.removeItem(key);
          ev.self = self2;
          window.dispatchEvent(ev);
        }
      }
      function changed(event) {
        if (event.key !== key)
          return;
        if (event.self !== self2) {
          if (!event.newValue && !claimed) {
            self2.claim();
            return;
          }
        } else if (claimed && !event.oldValue && event.newValue !== trigger.getItem(key)) {
          unclaim();
        }
        let new_value = null;
        if (event.newValue)
          new_value = parseInt(event.newValue, 10);
        if (last !== new_value) {
          last = new_value;
          callback();
        }
      }
      self2.close = function() {
        window.removeEventListener("storage", changed, true);
        unclaim();
      };
      window.addEventListener("storage", changed, true);
      window.addEventListener("beforeunload", function() {
        self2.close();
      });
      window.addEventListener("unload", function() {
        self2.close();
      });
      if (trigger.getItem(key))
        callback();
      else
        self2.claim();
    }
    cockpit2.cache = function cache(key, provider, consumer) {
      return new StorageCache(key, provider, consumer);
    };
    function SeriesSink(interval2, identifier, fetch_callback) {
      const self2 = this;
      self2.interval = interval2;
      self2.limit = identifier ? 64 * 1024 : 1024;
      const index = setup_index(identifier);
      let count = 0;
      let head = null;
      let tail = null;
      function setup_index(id) {
        if (!id)
          return [];
        const storage = lookup_storage(window);
        let index2 = storage[id];
        if (!index2)
          storage[id] = index2 = [];
        return index2;
      }
      function search(idx, beg) {
        let low = 0;
        let high = idx.length - 1;
        while (low <= high) {
          const mid = (low + high) / 2 | 0;
          const val = idx[mid].beg;
          if (val < beg)
            low = mid + 1;
          else if (val > beg)
            high = mid - 1;
          else
            return mid;
        }
        return low;
      }
      function fetch(beg, end2, for_walking) {
        if (fetch_callback) {
          if (!for_walking) {
            stash(beg, new Array(end2 - beg), {});
          }
          fetch_callback(beg, end2, for_walking);
        }
      }
      self2.load = function load(beg, end2, for_walking) {
        if (end2 <= beg)
          return;
        const at = search(index, beg);
        const len = index.length;
        let last = beg;
        const fetches = [];
        for (let i = at > 0 ? at - 1 : at; i < len; i++) {
          const entry = index[i];
          const en = entry.items.length;
          if (!en)
            continue;
          const eb = entry.beg;
          const b = Math.max(eb, beg);
          const e = Math.min(eb + en, end2);
          if (b < e) {
            if (b > last)
              fetches.push([last, b]);
            process2(b, entry.items.slice(b - eb, e - eb), entry.mapping);
            last = e;
          } else if (i >= at) {
            break;
          }
        }
        for (let i = 0; i < fetches.length; i++)
          fetch(fetches[i][0], fetches[i][1], for_walking);
        if (last != end2)
          fetch(last, end2, for_walking);
      };
      function stash(beg, items, mapping) {
        if (!items.length)
          return;
        let at = search(index, beg);
        const end2 = beg + items.length;
        const len = index.length;
        let i;
        for (i = at > 0 ? at - 1 : at; i < len; i++) {
          const entry2 = index[i];
          const en = entry2.items.length;
          if (!en)
            continue;
          const eb = entry2.beg;
          const b = Math.max(eb, beg);
          const e = Math.min(eb + en, end2);
          if (b < e) {
            const num = e - b;
            entry2.items.splice(b - eb, num);
            count -= num;
            if (b - eb === 0)
              entry2.beg += e - eb;
          } else if (i >= at) {
            break;
          }
        }
        const entry = { beg, items, mapping };
        if (!head)
          head = entry;
        if (tail)
          tail.next = entry;
        tail = entry;
        count += items.length;
        index.splice(at, 0, entry);
        for (at--; at <= i; at++) {
          const entry2 = index[at];
          if (entry2 && !entry2.items.length) {
            index.splice(at, 1);
            at--;
          }
        }
        while (head && count > self2.limit) {
          count -= head.items.length;
          head.items = [];
          head.mapping = null;
          head = head.next || null;
        }
        const newlen = index.length;
        for (i = 0; i < newlen; i++) {
          if (index[i].items.length > 0)
            break;
        }
        index.splice(0, i);
      }
      const registered = {};
      self2._register = function _register(grid, id) {
        if (grid.interval != interval2)
          throw Error("mismatched metric interval between grid and sink");
        let gdata = registered[id];
        if (!gdata) {
          gdata = registered[id] = { grid, links: [] };
          gdata.links.remove = function remove() {
            delete registered[id];
          };
        }
        return gdata.links;
      };
      function process2(beg, items, mapping) {
        const end2 = beg + items.length;
        for (const id in registered) {
          const gdata = registered[id];
          const grid = gdata.grid;
          const b = Math.max(beg, grid.beg);
          const e = Math.min(end2, grid.end);
          if (b < e) {
            const f = b - beg;
            const t = b - grid.beg;
            const n = e - b;
            for (let i = 0; i < n; i++) {
              const klen = gdata.links.length;
              for (let k2 = 0; k2 < klen; k2++) {
                const path2 = gdata.links[k2][0];
                const row = gdata.links[k2][1];
                let data = items[f + i];
                let map2 = mapping;
                const jlen = path2.length;
                for (let j = 0; data !== void 0 && j < jlen; j++) {
                  if (!data) {
                    data = void 0;
                  } else if (map2 !== void 0 && map2 !== null) {
                    map2 = map2[path2[j]];
                    if (map2)
                      data = data[map2[""]];
                    else
                      data = data[path2[j]];
                  } else {
                    data = data[path2[j]];
                  }
                }
                row[t + i] = data;
              }
            }
            grid.notify(t, n);
          }
        }
      }
      self2.input = function input(beg, items, mapping) {
        process2(beg, items, mapping);
        stash(beg, items, mapping);
      };
      self2.close = function() {
        for (const id in registered) {
          const grid = registered[id];
          if (grid?.grid)
            grid.grid.remove_sink(self2);
        }
      };
    }
    cockpit2.series = function series(interval2, cache, fetch) {
      return new SeriesSink(interval2, cache, fetch);
    };
    let unique = 1;
    function SeriesGrid(interval2, beg, end2) {
      const self2 = this;
      event_mixin(self2, {});
      const rows = [];
      self2.interval = interval2;
      self2.beg = 0;
      self2.end = 0;
      const callbacks = [];
      const sinks = [];
      let suppress = 0;
      const id = "g1-" + unique;
      unique += 1;
      let walking = null;
      let offset2 = null;
      self2.notify = function notify(x2, n) {
        if (suppress)
          return;
        if (x2 + n > self2.end - self2.beg)
          n = self2.end - self2.beg - x2;
        if (n <= 0)
          return;
        const jlen = callbacks.length;
        for (let j = 0; j < jlen; j++) {
          const callback = callbacks[j][0];
          const row = callbacks[j][1];
          callback.call(self2, row, x2, n);
        }
        self2.dispatchEvent("notify", x2, n);
      };
      self2.add = function add() {
        const row = [];
        rows.push(row);
        if (is_object(arguments[0])) {
          const sink = arguments[0].series || arguments[0];
          let path2 = arguments[1];
          if (!path2)
            path2 = [];
          else if (typeof path2 === "string")
            path2 = path2.split(".");
          const links = sink._register(self2, id);
          if (!links.length)
            sinks.push({ sink, links });
          links.push([path2, row]);
        } else if (is_function(arguments[0])) {
          const cb = [arguments[0], row];
          if (arguments[1] === true)
            callbacks.unshift(cb);
          else
            callbacks.push(cb);
        } else if (arguments.length !== 0) {
          throw Error("invalid args to grid.add()");
        }
        return row;
      };
      self2.remove = function remove(row) {
        let ilen = sinks.length;
        for (let i = 0; i < ilen; i++) {
          const jlen = sinks[i].links.length;
          for (let j = 0; j < jlen; j++) {
            if (sinks[i].links[j][1] === row) {
              sinks[i].links.splice(j, 1);
              break;
            }
          }
        }
        ilen = rows.length;
        for (let i = 0; i < ilen; i++) {
          if (rows[i] === row) {
            rows.splice(i, 1);
            break;
          }
        }
      };
      self2.remove_sink = function remove_sink(sink) {
        const len = sinks.length;
        for (let i = 0; i < len; i++) {
          if (sinks[i].sink === sink) {
            sinks[i].links.remove();
            sinks.splice(i, 1);
            break;
          }
        }
      };
      self2.sync = function sync(for_walking) {
        suppress++;
        const len = sinks.length;
        for (let i = 0; i < len; i++) {
          const sink = sinks[i].sink;
          sink.load(self2.beg, self2.end, for_walking);
        }
        suppress--;
        self2.notify(0, self2.end - self2.beg);
      };
      function move_internal(beg2, end3, for_walking) {
        if (end3 === void 0)
          end3 = beg2 + (self2.end - self2.beg);
        if (end3 < beg2)
          beg2 = end3;
        self2.beg = beg2;
        self2.end = end3;
        if (!rows.length)
          return;
        rows.forEach(function(row) {
          row.length = 0;
        });
        self2.sync(for_walking);
      }
      function stop_walking() {
        window.clearInterval(walking);
        walking = null;
        offset2 = null;
      }
      function is_negative(n) {
        return ((n = +n) || 1 / n) < 0;
      }
      self2.move = function move(beg2, end3) {
        stop_walking();
        let now3 = null;
        if (beg2 === void 0) {
          beg2 = 0;
        } else if (is_negative(beg2)) {
          now3 = Date.now();
          beg2 = Math.floor(now3 / self2.interval) + beg2;
        }
        if (end3 !== void 0 && is_negative(end3)) {
          if (now3 === null)
            now3 = Date.now();
          end3 = Math.floor(now3 / self2.interval) + end3;
        }
        move_internal(beg2, end3, false);
      };
      self2.walk = function walk() {
        const start2 = Date.now();
        if (self2.interval > 2e9)
          return;
        stop_walking();
        offset2 = start2 - self2.beg * self2.interval;
        walking = window.setInterval(function() {
          const now3 = Date.now();
          move_internal(Math.floor((now3 - offset2) / self2.interval), void 0, true);
        }, self2.interval);
      };
      self2.close = function close() {
        stop_walking();
        while (sinks.length)
          sinks.pop().links.remove();
      };
      self2.move(beg, end2);
    }
    cockpit2.grid = function grid(interval2, beg, end2) {
      return new SeriesGrid(interval2, beg, end2);
    };
    function BasicError(problem, message) {
      this.problem = problem;
      this.message = message || cockpit2.message(problem);
      this.toString = function() {
        return this.message;
      };
    }
    cockpit2.logout = function logout(reload, reason) {
      cockpit2.sessionStorage.clear(true);
      cockpit2.localStorage.removeItem("login-data", true);
      cockpit2.localStorage.clear(false);
      if (reload !== false)
        transport_globals.reload_after_disconnect = true;
      ensure_transport(function(transport) {
        if (!transport.send_control({ command: "logout", disconnect: true }))
          window.location.reload(transport_globals.reload_after_disconnect);
      });
      window.sessionStorage.setItem("logout-intent", "explicit");
      if (reason)
        window.sessionStorage.setItem("logout-reason", reason);
    };
    cockpit2.drop_privileges = function drop_privileges() {
      ensure_transport(function(transport) {
        transport.send_control({ command: "logout", disconnect: false });
      });
    };
    cockpit2.info = {};
    event_mixin(cockpit2.info, {});
    transport_globals.init_callback = function(options5) {
      if (options5.system)
        Object.assign(cockpit2.info, options5.system);
      if (options5.system)
        cockpit2.info.dispatchEvent("changed");
      cockpit2.transport.options = options5;
      cockpit2.transport.csrf_token = options5["csrf-token"];
      cockpit2.transport.host = transport_globals.default_host;
    };
    let the_user = null;
    cockpit2.user = function() {
      if (!the_user) {
        const dbus = cockpit2.dbus(null, { bus: "internal" });
        return dbus.call(
          "/user",
          "org.freedesktop.DBus.Properties",
          "GetAll",
          ["cockpit.User"],
          { type: "s" }
        ).then(([user]) => {
          the_user = {
            id: user.Id.v,
            gid: user.Gid?.v,
            name: user.Name.v,
            full_name: user.Full.v,
            groups: user.Groups.v,
            home: user.Home.v,
            shell: user.Shell.v
          };
          return the_user;
        }).finally(() => dbus.close());
      } else {
        return Promise.resolve(the_user);
      }
    };
    document.addEventListener("click", function(ev) {
      if (ev.target.classList && in_array(ev.target.classList, "disabled"))
        ev.stopPropagation();
    }, true);
    let last_loc = null;
    function get_window_location_hash() {
      return window.location.href.split("#")[1] || "";
    }
    function Location() {
      const self2 = this;
      const application = cockpit2.transport.application();
      self2.url_root = url_root || "";
      if (window.mock?.url_root)
        self2.url_root = window.mock.url_root;
      if (application.indexOf("cockpit+=") === 0) {
        if (self2.url_root)
          self2.url_root += "/";
        self2.url_root = self2.url_root + application.replace("cockpit+", "");
      }
      const href = get_window_location_hash();
      const options5 = {};
      self2.path = decode(href, options5);
      function resolve_path_dots(parts) {
        const out = [];
        const length = parts.length;
        for (let i = 0; i < length; i++) {
          const part = parts[i];
          if (part === "" || part == ".") {
            continue;
          } else if (part == "..") {
            if (out.length === 0)
              return null;
            out.pop();
          } else {
            out.push(part);
          }
        }
        return out;
      }
      function decode_path(input) {
        const parts = input.split("/").map(decodeURIComponent);
        let result, i;
        let pre_parts = [];
        if (self2.url_root)
          pre_parts = self2.url_root.split("/").map(decodeURIComponent);
        if (input && input[0] !== "/") {
          result = [].concat(self2.path);
          result.pop();
          result = result.concat(parts);
        } else {
          result = parts;
        }
        result = resolve_path_dots(result);
        for (i = 0; i < pre_parts.length; i++) {
          if (pre_parts[i] !== result[i])
            break;
        }
        if (i == pre_parts.length)
          result.splice(0, pre_parts.length);
        return result;
      }
      function encode(path2, options6, with_root) {
        if (typeof path2 == "string")
          path2 = decode_path(path2);
        let href2 = "/" + path2.map(encodeURIComponent).join("/");
        if (with_root && self2.url_root && href2.indexOf("/" + self2.url_root + "/") !== 0)
          href2 = "/" + self2.url_root + href2;
        href2 = href2.replaceAll("%40", "@");
        href2 = href2.replaceAll("%3D", "=");
        href2 = href2.replaceAll("%2B", "+");
        href2 = href2.replaceAll("%23", "#");
        let opt;
        const query = [];
        function push_option(v) {
          query.push(encodeURIComponent(opt) + "=" + encodeURIComponent(v));
        }
        if (options6) {
          for (opt in options6) {
            let value = options6[opt];
            if (!Array.isArray(value))
              value = [value];
            value.forEach(push_option);
          }
          if (query.length > 0)
            href2 += "?" + query.join("&");
        }
        return href2;
      }
      function decode(href2, options6) {
        if (href2[0] == "#")
          href2 = href2.substr(1);
        const pos = href2.indexOf("?");
        const first = pos === -1 ? href2 : href2.substr(0, pos);
        const path2 = decode_path(first);
        if (pos !== -1 && options6) {
          href2.substring(pos + 1).split("&").forEach(function(opt) {
            const parts = opt.split("=");
            const name2 = decodeURIComponent(parts[0]);
            const value = decodeURIComponent(parts[1]);
            if (options6[name2]) {
              let last = options6[name2];
              if (!Array.isArray(value))
                last = options6[name2] = [last];
              last.push(value);
            } else {
              options6[name2] = value;
            }
          });
        }
        return path2;
      }
      function href_for_go_or_replace() {
        let href2;
        if (arguments.length == 1 && arguments[0] instanceof Location) {
          href2 = String(arguments[0]);
        } else if (typeof arguments[0] == "string") {
          const options6 = arguments[1] || {};
          href2 = encode(decode(arguments[0], options6), options6);
        } else {
          href2 = encode.apply(self2, arguments);
        }
        return href2;
      }
      function replace() {
        if (self2 !== last_loc)
          return;
        const href2 = href_for_go_or_replace.apply(self2, arguments);
        window.location.replace(window.location.pathname + "#" + href2);
      }
      function go() {
        if (self2 !== last_loc)
          return;
        const href2 = href_for_go_or_replace.apply(self2, arguments);
        window.location.hash = "#" + href2;
      }
      Object.defineProperties(self2, {
        path: {
          enumerable: true,
          writable: false,
          value: self2.path
        },
        options: {
          enumerable: true,
          writable: false,
          value: options5
        },
        href: {
          enumerable: true,
          value: href
        },
        go: { value: go },
        replace: { value: replace },
        encode: { value: encode },
        decode: { value: decode },
        toString: { value: function() {
          return href;
        } }
      });
    }
    Object.defineProperty(cockpit2, "location", {
      enumerable: true,
      get: function() {
        if (!last_loc || last_loc.href !== get_window_location_hash())
          last_loc = new Location();
        return last_loc;
      },
      set: function(v) {
        cockpit2.location.go(v);
      }
    });
    window.addEventListener("hashchange", function() {
      last_loc = null;
      let hash4 = window.location.hash;
      if (hash4.indexOf("#") === 0)
        hash4 = hash4.substring(1);
      cockpit2.hint("location", { hash: hash4 });
      cockpit2.dispatchEvent("locationchanged");
    });
    cockpit2.jump = function jump(path2, host) {
      if (Array.isArray(path2))
        path2 = "/" + path2.map(encodeURIComponent).join("/").replaceAll("%40", "@").replaceAll("%3D", "=").replaceAll("%2B", "+");
      else
        path2 = "" + path2;
      if (host === void 0)
        host = cockpit2.transport.host;
      const options5 = { command: "jump", location: path2, host };
      cockpit2.transport.inject("\n" + JSON.stringify(options5));
    };
    (function() {
      let hiddenHint = false;
      function visibility_change() {
        let value = document.hidden;
        if (value === false)
          value = hiddenHint;
        if (cockpit2.hidden !== value) {
          cockpit2.hidden = value;
          cockpit2.dispatchEvent("visibilitychange");
        }
      }
      document.addEventListener("visibilitychange", visibility_change);
      transport_globals.process_hints = function(data) {
        if ("hidden" in data) {
          hiddenHint = data.hidden;
          visibility_change();
        }
      };
      visibility_change();
    })();
    function ProcessError(options5, name2) {
      this.problem = options5.problem || null;
      this.exit_status = options5["exit-status"];
      if (this.exit_status === void 0)
        this.exit_status = null;
      this.exit_signal = options5["exit-signal"];
      if (this.exit_signal === void 0)
        this.exit_signal = null;
      this.message = options5.message;
      if (this.message === void 0) {
        if (this.problem)
          this.message = cockpit2.message(options5.problem);
        else if (this.exit_signal !== null)
          this.message = cockpit2.format(_113("$0 killed with signal $1"), name2, this.exit_signal);
        else if (this.exit_status !== void 0)
          this.message = cockpit2.format(_113("$0 exited with code $1"), name2, this.exit_status);
        else
          this.message = cockpit2.format(_113("$0 failed"), name2);
      } else {
        this.message = this.message.trim();
      }
      this.toString = function() {
        return this.message;
      };
    }
    function spawn_debug() {
      if (window.debugging == "all" || window.debugging?.includes("spawn"))
        console.debug.apply(console, arguments);
    }
    cockpit2.spawn = function(command, options5) {
      const dfd = cockpit2.defer();
      const args = { payload: "stream", spawn: [] };
      if (command instanceof Array) {
        for (let i = 0; i < command.length; i++)
          args.spawn.push(String(command[i]));
      } else {
        args.spawn.push(String(command));
      }
      if (options5 !== void 0)
        Object.assign(args, options5);
      spawn_debug("process spawn:", JSON.stringify(args.spawn));
      const name2 = args.spawn[0] || "process";
      const channel = cockpit2.channel(args);
      const buffer = channel.buffer(null);
      channel.addEventListener("close", function(event, options6) {
        const data = buffer.squash();
        spawn_debug("process closed:", JSON.stringify(options6));
        if (data)
          spawn_debug("process output:", data);
        if (options6.message !== void 0)
          spawn_debug("process error:", options6.message);
        if (options6.problem)
          dfd.reject(new ProcessError(options6, name2));
        else if (options6["exit-status"] || options6["exit-signal"])
          dfd.reject(new ProcessError(options6, name2), data);
        else if (options6.message !== void 0)
          dfd.resolve(data, options6.message);
        else
          dfd.resolve(data);
      });
      const ret = dfd.promise;
      ret.stream = function(callback) {
        buffer.callback = callback.bind(ret);
        return this;
      };
      ret.input = function(message, stream) {
        if (message !== null && message !== void 0) {
          spawn_debug("process input:", message);
          iterate_data(message, function(data) {
            channel.send(data);
          });
        }
        if (!stream)
          channel.control({ command: "done" });
        return this;
      };
      ret.close = function(problem) {
        spawn_debug("process closing:", problem);
        if (channel.valid)
          channel.close(problem);
        return this;
      };
      return ret;
    };
    cockpit2.script = function(script, args, options5) {
      if (!options5 && is_plain_object(args)) {
        options5 = args;
        args = [];
      }
      const command = ["/bin/sh", "-c", script, "--"];
      command.push.apply(command, args);
      return cockpit2.spawn(command, options5);
    };
    function dbus_debug() {
      if (window.debugging == "all" || window.debugging?.includes("dbus"))
        console.debug.apply(console, arguments);
    }
    function DBusError(arg, arg1) {
      if (typeof arg == "string") {
        this.problem = arg;
        this.name = null;
        this.message = arg1 || cockpit2.message(arg);
      } else {
        this.problem = null;
        this.name = arg[0];
        this.message = arg[1][0] || arg[0];
      }
      this.toString = function() {
        return this.message;
      };
    }
    function DBusCache() {
      const self2 = this;
      let callbacks = [];
      self2.data = {};
      self2.meta = {};
      self2.connect = function connect(path2, iface, callback, first) {
        const cb = [path2, iface, callback];
        if (first)
          callbacks.unshift(cb);
        else
          callbacks.push(cb);
        return {
          remove: function remove() {
            const length = callbacks.length;
            for (let i = 0; i < length; i++) {
              const cb2 = callbacks[i];
              if (cb2[0] === path2 && cb2[1] === iface && cb2[2] === callback) {
                delete cb2[i];
                break;
              }
            }
          }
        };
      };
      function emit(path2, iface, props) {
        const copy3 = callbacks.slice();
        const length = copy3.length;
        for (let i = 0; i < length; i++) {
          const cb = copy3[i];
          if ((!cb[0] || cb[0] === path2) && (!cb[1] || cb[1] === iface)) {
            cb[2](props, path2);
          }
        }
      }
      self2.update = function update(path2, iface, props) {
        if (!self2.data[path2])
          self2.data[path2] = {};
        if (!self2.data[path2][iface])
          self2.data[path2][iface] = props;
        else
          props = Object.assign(self2.data[path2][iface], props);
        emit(path2, iface, props);
      };
      self2.remove = function remove(path2, iface) {
        if (self2.data[path2]) {
          delete self2.data[path2][iface];
          emit(path2, iface, null);
        }
      };
      self2.lookup = function lookup(path2, iface) {
        if (self2.data[path2])
          return self2.data[path2][iface];
        return void 0;
      };
      self2.each = function each(iface, callback) {
        for (const path2 in self2.data) {
          for (const ifa in self2.data[path2]) {
            if (ifa == iface)
              callback(self2.data[path2][iface], path2);
          }
        }
      };
      self2.close = function close() {
        self2.data = {};
        const copy3 = callbacks;
        callbacks = [];
        const length = copy3.length;
        for (let i = 0; i < length; i++)
          copy3[i].callback();
      };
    }
    function DBusProxy(client, cache, iface, path2, options5) {
      const self2 = this;
      event_mixin(self2, {});
      let valid = false;
      let defined3 = false;
      const waits = cockpit2.defer();
      Object.defineProperties(self2, {
        client: { value: client, enumerable: false, writable: false },
        path: { value: path2, enumerable: false, writable: false },
        iface: { value: iface, enumerable: false, writable: false },
        valid: { get: function() {
          return valid;
        }, enumerable: false },
        wait: {
          enumerable: false,
          writable: false,
          value: function(func) {
            if (func)
              waits.promise.always(func);
            return waits.promise;
          }
        },
        call: {
          value: function(name2, args, options6) {
            return client.call(path2, iface, name2, args, options6);
          },
          enumerable: false,
          writable: false
        },
        data: { value: {}, enumerable: false }
      });
      if (!options5)
        options5 = {};
      function define2() {
        if (!cache.meta[iface])
          return;
        const meta = cache.meta[iface];
        defined3 = true;
        Object.keys(meta.methods || {}).forEach(function(name2) {
          if (name2[0].toLowerCase() == name2[0])
            return;
          Object.defineProperty(self2, name2, {
            enumerable: false,
            value: function() {
              const dfd = cockpit2.defer();
              client.call(path2, iface, name2, Array.prototype.slice.call(arguments)).done(function(reply) {
                dfd.resolve.apply(dfd, reply);
              }).fail(function(ex) {
                dfd.reject(ex);
              });
              return dfd.promise;
            }
          });
        });
        Object.keys(meta.properties || {}).forEach(function(name2) {
          if (name2[0].toLowerCase() == name2[0])
            return;
          const config = {
            enumerable: true,
            get: function() {
              return self2.data[name2];
            },
            set: function(v) {
              throw Error(name2 + "is not writable");
            }
          };
          const prop = meta.properties[name2];
          if (prop.flags && prop.flags.indexOf("w") !== -1) {
            config.set = function(v) {
              client.call(
                path2,
                "org.freedesktop.DBus.Properties",
                "Set",
                [iface, name2, cockpit2.variant(prop.type, v)]
              ).fail(function(ex) {
                console.log("Couldn't set " + iface + " " + name2 + " at " + path2 + ": " + ex);
              });
            };
          }
          Object.defineProperty(self2, name2, config);
        });
      }
      function update(props) {
        if (props) {
          Object.assign(self2.data, props);
          if (!defined3)
            define2();
          valid = true;
        } else {
          valid = false;
        }
        self2.dispatchEvent("changed", props);
      }
      cache.connect(path2, iface, update, true);
      update(cache.lookup(path2, iface));
      function signal(path3, iface2, name2, args) {
        self2.dispatchEvent("signal", name2, args);
        if (name2[0].toLowerCase() != name2[0]) {
          args = args.slice();
          args.unshift(name2);
          self2.dispatchEvent.apply(self2, args);
        }
      }
      client.subscribe({ path: path2, interface: iface }, signal, options5.subscribe !== false);
      function waited(ex) {
        if (valid)
          waits.resolve();
        else
          waits.reject(ex);
      }
      if (options5.watch !== false)
        client.watch({ path: path2, interface: iface }).always(waited);
      else
        waited();
    }
    function DBusProxies(client, cache, iface, path_namespace, options5) {
      const self2 = this;
      event_mixin(self2, {});
      let waits;
      Object.defineProperties(self2, {
        client: { value: client, enumerable: false, writable: false },
        iface: { value: iface, enumerable: false, writable: false },
        path_namespace: { value: path_namespace, enumerable: false, writable: false },
        wait: {
          enumerable: false,
          writable: false,
          value: function(func) {
            if (func)
              waits.always(func);
            return waits;
          }
        }
      });
      const match = { interface: iface, path_namespace };
      client.subscribe(match);
      if (options5.watch !== false) {
        waits = client.watch(match);
      } else {
        waits = cockpit2.defer().resolve().promise;
      }
      options5 = { watch: false, subscribe: false, ...options5 };
      function update(props, path2) {
        let proxy = self2[path2];
        if (path2) {
          if (!props && proxy) {
            delete self2[path2];
            self2.dispatchEvent("removed", proxy);
          } else if (props) {
            if (!proxy) {
              proxy = self2[path2] = client.proxy(iface, path2, options5);
              self2.dispatchEvent("added", proxy);
            }
            self2.dispatchEvent("changed", proxy);
          }
        }
      }
      cache.connect(null, iface, update, false);
      cache.each(iface, update);
    }
    function DBusClient(name2, options5) {
      const self2 = this;
      event_mixin(self2, {});
      const args = {};
      let track = false;
      let owner = null;
      if (options5) {
        if (options5.track)
          track = true;
        delete options5.track;
        Object.assign(args, options5);
      }
      args.payload = "dbus-json3";
      if (name2)
        args.name = name2;
      self2.options = options5;
      self2.unique_name = null;
      dbus_debug("dbus open: ", args);
      let channel = cockpit2.channel(args);
      const subscribers = {};
      let calls = {};
      let cache;
      let closed;
      self2.constructors = { "*": DBusProxy };
      self2.wait = channel.wait;
      function ensure_cache() {
        if (!cache)
          cache = new DBusCache();
      }
      function send(payload) {
        if (channel?.valid) {
          dbus_debug("dbus:", payload);
          channel.send(payload);
          return true;
        }
        return false;
      }
      function matches2(signal, match) {
        if (match.path && signal[0] !== match.path)
          return false;
        if (match.path_namespace && signal[0].indexOf(match.path_namespace) !== 0)
          return false;
        if (match.interface && signal[1] !== match.interface)
          return false;
        if (match.member && signal[2] !== match.member)
          return false;
        if (match.arg0 && (!signal[3] || signal[3][0] !== match.arg0))
          return false;
        return true;
      }
      function on_message(event, payload) {
        dbus_debug("dbus:", payload);
        let msg;
        try {
          msg = JSON.parse(payload);
        } catch (ex) {
          console.warn("received invalid dbus json message:", ex);
        }
        if (msg === void 0) {
          channel.close({ problem: "protocol-error" });
          return;
        }
        const dfd = msg.id !== void 0 ? calls[msg.id] : void 0;
        if (msg.reply) {
          if (dfd) {
            const options6 = {};
            if (msg.type)
              options6.type = msg.type;
            if (msg.flags)
              options6.flags = msg.flags;
            dfd.resolve(msg.reply[0] || [], options6);
            delete calls[msg.id];
          }
          return;
        } else if (msg.error) {
          if (dfd) {
            dfd.reject(new DBusError(msg.error));
            delete calls[msg.id];
          }
          return;
        }
        later_invoke(function() {
          if (msg.signal) {
            for (const id in subscribers) {
              const subscription = subscribers[id];
              if (subscription.callback) {
                if (matches2(msg.signal, subscription.match))
                  subscription.callback.apply(self2, msg.signal);
              }
            }
          } else if (msg.notify) {
            notify(msg.notify);
          } else if (msg.meta) {
            meta(msg.meta);
          } else if (msg.owner !== void 0) {
            self2.dispatchEvent("owner", msg.owner);
            if (track && owner)
              self2.close();
            owner = msg.owner;
          } else {
            dbus_debug("received unexpected dbus json message:", payload);
          }
        });
      }
      function meta(data) {
        ensure_cache();
        Object.assign(cache.meta, data);
        self2.dispatchEvent("meta", data);
      }
      function notify(data) {
        ensure_cache();
        for (const path2 in data) {
          for (const iface in data[path2]) {
            const props = data[path2][iface];
            if (!props)
              cache.remove(path2, iface);
            else
              cache.update(path2, iface, props);
          }
        }
        self2.dispatchEvent("notify", data);
      }
      this.notify = notify;
      function close_perform(options6) {
        closed = options6.problem || "disconnected";
        const outstanding = calls;
        calls = {};
        for (const id in outstanding) {
          outstanding[id].reject(new DBusError(closed, options6.message));
        }
        self2.dispatchEvent("close", options6);
      }
      this.close = function close(options6) {
        if (typeof options6 == "string")
          options6 = { problem: options6 };
        if (!options6)
          options6 = {};
        if (channel)
          channel.close(options6);
        else
          close_perform(options6);
      };
      function on_ready(event, message) {
        dbus_debug("dbus ready:", options5);
        self2.unique_name = message["unique-name"];
      }
      function on_close(event, options6) {
        dbus_debug("dbus close:", options6);
        channel.removeEventListener("ready", on_ready);
        channel.removeEventListener("message", on_message);
        channel.removeEventListener("close", on_close);
        channel = null;
        close_perform(options6);
      }
      channel.addEventListener("ready", on_ready);
      channel.addEventListener("message", on_message);
      channel.addEventListener("close", on_close);
      let last_cookie = 1;
      this.call = function call(path2, iface, method, args2, options6) {
        const dfd = cockpit2.defer();
        const id = String(last_cookie);
        last_cookie++;
        const method_call = {
          ...options6,
          call: [path2, iface, method, args2 || []],
          id
        };
        const msg = JSON.stringify(method_call);
        if (send(msg))
          calls[id] = dfd;
        else
          dfd.reject(new DBusError(closed));
        return dfd.promise;
      };
      self2.signal = function signal(path2, iface, member, args2, options6) {
        if (!channel || !channel.valid)
          return;
        const message = { ...options6, signal: [path2, iface, member, args2 || []] };
        send(JSON.stringify(message));
      };
      this.subscribe = function subscribe(match, callback, rule) {
        const subscription = {
          match: { ...match },
          callback
        };
        if (rule !== false)
          send(JSON.stringify({ "add-match": subscription.match }));
        let id;
        if (callback) {
          id = String(last_cookie);
          last_cookie++;
          subscribers[id] = subscription;
        }
        return {
          remove: function() {
            let prev;
            if (id) {
              prev = subscribers[id];
              if (prev)
                delete subscribers[id];
            }
            if (rule !== false && prev)
              send(JSON.stringify({ "remove-match": prev.match }));
          }
        };
      };
      self2.watch = function watch(path2) {
        const match = is_plain_object(path2) ? { ...path2 } : { path: String(path2) };
        const id = String(last_cookie);
        last_cookie++;
        const dfd = cockpit2.defer();
        const msg = JSON.stringify({ watch: match, id });
        if (send(msg))
          calls[id] = dfd;
        else
          dfd.reject(new DBusError(closed));
        const ret = dfd.promise;
        ret.remove = function remove() {
          if (id in calls) {
            dfd.reject(new DBusError("cancelled"));
            delete calls[id];
          }
          send(JSON.stringify({ unwatch: match }));
        };
        return ret;
      };
      self2.proxy = function proxy(iface, path2, options6) {
        if (!iface)
          iface = name2;
        iface = String(iface);
        if (!path2)
          path2 = "/" + iface.replaceAll(".", "/");
        let Constructor = self2.constructors[iface];
        if (!Constructor)
          Constructor = self2.constructors["*"];
        if (!options6)
          options6 = {};
        ensure_cache();
        return new Constructor(self2, cache, iface, String(path2), options6);
      };
      self2.proxies = function proxies(iface, path_namespace, options6) {
        if (!iface)
          iface = name2;
        if (!path_namespace)
          path_namespace = "/";
        if (!options6)
          options6 = {};
        ensure_cache();
        return new DBusProxies(self2, cache, String(iface), String(path_namespace), options6);
      };
    }
    const shared_dbus = {
      internal: null,
      session: null,
      system: null
    };
    cockpit2.dbus = function dbus(name2, options5) {
      if (!options5)
        options5 = { bus: "system" };
      const keys = Object.keys(options5);
      const bus = options5.bus;
      const shared = !name2 && keys.length == 1 && bus in shared_dbus;
      if (shared && shared_dbus[bus])
        return shared_dbus[bus];
      const client = new DBusClient(name2, options5);
      if (shared) {
        const old_close = client.close;
        client.close = function() {
          if (arguments.length > 0)
            old_close.apply(client, arguments);
        };
        client.addEventListener("close", function() {
          if (shared_dbus[bus] == client)
            shared_dbus[bus] = null;
        });
        shared_dbus[bus] = client;
      }
      return client;
    };
    cockpit2.variant = function variant(type, value) {
      return { v: value, t: type };
    };
    cockpit2.byte_array = function byte_array(string) {
      return window.btoa(string);
    };
    cockpit2.file = function file(path2, options5) {
      options5 = options5 || {};
      const binary = options5.binary;
      const self2 = {
        path: path2,
        read: read2,
        replace,
        modify,
        watch,
        close
      };
      const base_channel_options = { ...options5 };
      delete base_channel_options.syntax;
      function parse(str) {
        if (options5.syntax?.parse)
          return options5.syntax.parse(str);
        else
          return str;
      }
      function stringify2(obj) {
        if (options5.syntax?.stringify)
          return options5.syntax.stringify(obj);
        else
          return obj;
      }
      let read_promise = null;
      let read_channel;
      function read2() {
        if (read_promise)
          return read_promise;
        const dfd = cockpit2.defer();
        const opts = {
          ...base_channel_options,
          payload: "fsread1",
          path: path2
        };
        function try_read() {
          read_channel = cockpit2.channel(opts);
          const content_parts = [];
          read_channel.addEventListener("message", function(event, message) {
            content_parts.push(message);
          });
          read_channel.addEventListener("close", function(event, message) {
            read_channel = null;
            if (message.problem == "change-conflict") {
              try_read();
              return;
            }
            read_promise = null;
            if (message.problem) {
              const error = new BasicError(message.problem, message.message);
              fire_watch_callbacks(null, null, error);
              dfd.reject(error);
              return;
            }
            let content;
            if (message.tag == "-")
              content = null;
            else {
              try {
                content = parse(join_data(content_parts, binary));
              } catch (e) {
                fire_watch_callbacks(null, null, e);
                dfd.reject(e);
                return;
              }
            }
            fire_watch_callbacks(content, message.tag);
            dfd.resolve(content, message.tag);
          });
        }
        try_read();
        read_promise = dfd.promise;
        return read_promise;
      }
      let replace_channel = null;
      function replace(new_content, expected_tag) {
        const dfd = cockpit2.defer();
        let file_content;
        try {
          file_content = new_content === null ? null : stringify2(new_content);
        } catch (e) {
          dfd.reject(e);
          return dfd.promise;
        }
        if (replace_channel)
          replace_channel.close("abort");
        const opts = {
          ...base_channel_options,
          payload: "fsreplace1",
          path: path2,
          tag: expected_tag
        };
        replace_channel = cockpit2.channel(opts);
        replace_channel.addEventListener("close", function(event, message) {
          replace_channel = null;
          if (message.problem) {
            dfd.reject(new BasicError(message.problem, message.message));
          } else {
            fire_watch_callbacks(new_content, message.tag);
            dfd.resolve(message.tag);
          }
        });
        if (file_content !== null) {
          if (file_content.length === 0 || file_content.byteLength === 0) {
            replace_channel.send(file_content);
          } else {
            iterate_data(file_content, (data) => {
              replace_channel.send(data);
            });
          }
        }
        replace_channel.control({ command: "done" });
        return dfd.promise;
      }
      function modify(callback, initial_content, initial_tag) {
        const dfd = cockpit2.defer();
        function update(content, tag) {
          let new_content = callback(content);
          if (new_content === void 0)
            new_content = content;
          replace(new_content, tag).done(function(new_tag) {
            dfd.resolve(new_content, new_tag);
          }).fail(function(error) {
            if (error.problem == "change-conflict")
              read_then_update();
            else
              dfd.reject(error);
          });
        }
        function read_then_update() {
          read2().done(update).fail(function(error) {
            dfd.reject(error);
          });
        }
        if (initial_content === void 0)
          read_then_update();
        else
          update(initial_content, initial_tag);
        return dfd.promise;
      }
      const watch_callbacks = [];
      let n_watch_callbacks = 0;
      let watch_channel = null;
      let watch_tag;
      function ensure_watch_channel(options6) {
        if (n_watch_callbacks > 0) {
          if (watch_channel)
            return;
          watch_channel = new FsInfoClient(path2, ["tag"], { superuser: base_channel_options.superuser });
          watch_channel.on("change", (state) => {
            if (state.error) {
              if (state.error.problem === "not-found") {
                fire_watch_callbacks(null, "-");
              } else {
                const error = new BasicError(state.error.problem, state.error.message);
                fire_watch_callbacks(null, null, error);
              }
            } else if (state.info && state.info.tag) {
              if (state.info.tag !== watch_tag) {
                if (options6?.read === false)
                  fire_watch_callbacks(null, state.info.tag);
                else
                  read2();
              }
            }
          });
          watch_channel.on("close", (ex) => {
            if (ex.problem === "not-supported") {
              const opts = {
                payload: "fswatch1",
                path: path2,
                superuser: base_channel_options.superuser
              };
              watch_channel = cockpit2.channel(opts);
              watch_channel.addEventListener("message", (event, message_string) => {
                let message;
                try {
                  message = JSON.parse(message_string);
                } catch (e) {
                  message = null;
                }
                if (message && message.path == path2 && message.tag && message.tag != watch_tag) {
                  if (options6 && options6.read !== void 0 && !options6.read)
                    fire_watch_callbacks(null, message.tag);
                  else
                    read2();
                }
              });
              read2();
            }
          });
        } else {
          if (watch_channel) {
            watch_channel.close();
            watch_channel = null;
          }
        }
      }
      function fire_watch_callbacks() {
        watch_tag = arguments[1] || null;
        invoke_functions(watch_callbacks, self2, arguments);
      }
      function watch(callback, options6) {
        if (callback)
          watch_callbacks.push(callback);
        n_watch_callbacks += 1;
        ensure_watch_channel(options6);
        watch_tag = null;
        return {
          remove: function() {
            if (callback) {
              const index = watch_callbacks.indexOf(callback);
              if (index > -1)
                watch_callbacks[index] = null;
            }
            n_watch_callbacks -= 1;
            ensure_watch_channel(options6);
          }
        };
      }
      function close() {
        if (read_channel)
          read_channel.close("cancelled");
        if (replace_channel)
          replace_channel.close("cancelled");
        if (watch_channel)
          watch_channel.close();
      }
      return self2;
    };
    let po_data = {};
    let po_plural;
    cockpit2.language = "en";
    cockpit2.language_direction = "ltr";
    const test_l10n = window.localStorage.test_l10n;
    cockpit2.locale = function locale3(po) {
      let lang = cockpit2.language;
      let lang_dir = cockpit2.language_direction;
      let header;
      if (po) {
        Object.assign(po_data, po);
        header = po[""];
      } else if (po === null) {
        po_data = {};
      }
      if (header) {
        if (header["plural-forms"])
          po_plural = header["plural-forms"];
        if (header.language)
          lang = header.language;
        if (header["language-direction"])
          lang_dir = header["language-direction"];
      }
      cockpit2.language = lang;
      cockpit2.language_direction = lang_dir;
    };
    cockpit2.translate = function translate() {
      let what;
      if (arguments.length === 0)
        what = [document];
      else if (arguments.length === 1 && arguments[0].length)
        what = arguments[0];
      else
        what = arguments;
      const wlen = what.length;
      for (let w = 0; w < wlen; w++) {
        let list = null;
        if (what[w].querySelectorAll)
          list = what[w].querySelectorAll("[translatable], [translate]");
        if (!list)
          continue;
        for (let i = 0; i < list.length; i++) {
          const el = list[i];
          let val = el.getAttribute("translate") || el.getAttribute("translatable") || "yes";
          if (val == "no")
            continue;
          const tasks = val.split(" ");
          val = el.getAttribute("translate-context") || el.getAttribute("context");
          for (let t = 0; t < tasks.length; t++) {
            if (tasks[t] == "yes" || tasks[t] == "translate")
              el.textContent = cockpit2.gettext(val, el.textContent);
            else if (tasks[t])
              el.setAttribute(tasks[t], cockpit2.gettext(val, el.getAttribute(tasks[t]) || ""));
          }
          el.removeAttribute("translatable");
          el.removeAttribute("translate");
        }
      }
    };
    cockpit2.gettext = function gettext(context, string) {
      if (arguments.length == 1) {
        string = context;
        context = void 0;
      }
      const key = context ? context + "" + string : string;
      if (po_data) {
        const translated = po_data[key];
        if (translated?.[1])
          string = translated[1];
      }
      if (test_l10n === "true")
        return "\xBB" + string + "\xAB";
      return string;
    };
    function imply(val) {
      return val === true ? 1 : val || 0;
    }
    cockpit2.ngettext = function ngettext(context, string1, stringN, num) {
      if (arguments.length == 3) {
        num = stringN;
        stringN = string1;
        string1 = context;
        context = void 0;
      }
      const key = context ? context + "" + string1 : string1;
      if (po_data && po_plural) {
        const translated = po_data[key];
        if (translated) {
          const i = imply(po_plural(num)) + 1;
          if (translated[i])
            return translated[i];
        }
      }
      if (num == 1)
        return string1;
      return stringN;
    };
    cockpit2.noop = function noop2(arg0, arg1) {
      return arguments[arguments.length - 1];
    };
    const _113 = cockpit2.gettext;
    cockpit2.message = function message(arg) {
      if (arg.message)
        return arg.message;
      let problem = null;
      if (arg.problem)
        problem = arg.problem;
      else
        problem = arg + "";
      if (problem == "terminated")
        return _113("Your session has been terminated.");
      else if (problem == "no-session")
        return _113("Your session has expired. Please log in again.");
      else if (problem == "access-denied")
        return _113("Not permitted to perform this action.");
      else if (problem == "authentication-failed")
        return _113("Login failed");
      else if (problem == "authentication-not-supported")
        return _113("The server refused to authenticate using any supported methods.");
      else if (problem == "unknown-hostkey")
        return _113("Untrusted host");
      else if (problem == "unknown-host")
        return _113("Untrusted host");
      else if (problem == "invalid-hostkey")
        return _113("Host key is incorrect");
      else if (problem == "internal-error")
        return _113("Internal error");
      else if (problem == "timeout")
        return _113("Connection has timed out.");
      else if (problem == "no-cockpit")
        return _113("Cockpit is not installed on the system.");
      else if (problem == "no-forwarding")
        return _113("Cannot forward login credentials");
      else if (problem == "disconnected")
        return _113("Server has closed the connection.");
      else if (problem == "not-supported")
        return _113("Cockpit is not compatible with the software on the system.");
      else if (problem == "no-host")
        return _113("Cockpit could not contact the given host.");
      else if (problem == "too-large")
        return _113("Too much data");
      else
        return problem;
    };
    function HttpError(arg0, arg1, message) {
      this.status = parseInt(arg0, 10);
      this.reason = arg1;
      this.message = message || arg1;
      this.problem = null;
      this.valueOf = function() {
        return this.status;
      };
      this.toString = function() {
        return this.status + " " + this.message;
      };
    }
    function http_debug() {
      if (window.debugging == "all" || window.debugging?.includes("http"))
        console.debug.apply(console, arguments);
    }
    function find_header(headers, name2) {
      if (!headers)
        return void 0;
      name2 = name2.toLowerCase();
      for (const head in headers) {
        if (head.toLowerCase() == name2)
          return headers[head];
      }
      return void 0;
    }
    function HttpClient(endpoint, options5) {
      const self2 = this;
      self2.options = options5;
      options5.payload = "http-stream2";
      const active_requests = [];
      if (endpoint !== void 0) {
        if (endpoint.indexOf && endpoint.indexOf("/") === 0) {
          options5.unix = endpoint;
        } else {
          const port = parseInt(endpoint, 10);
          if (!isNaN(port))
            options5.port = port;
          else
            throw Error("The endpoint must be either a unix path or port number");
        }
      }
      if (options5.address) {
        if (!options5.capabilities)
          options5.capabilities = [];
        options5.capabilities.push("address");
      }
      function param(obj) {
        return Object.keys(obj).map(function(k2) {
          return encodeURIComponent(k2) + "=" + encodeURIComponent(obj[k2]);
        }).join("&").split("%20").join("+");
      }
      self2.request = function request(req) {
        const dfd = cockpit2.defer();
        const ret = dfd.promise;
        if (!req.path)
          req.path = "/";
        if (!req.method)
          req.method = "GET";
        if (req.params) {
          if (req.path.indexOf("?") === -1)
            req.path += "?" + param(req.params);
          else
            req.path += "&" + param(req.params);
        }
        delete req.params;
        const input = req.body;
        delete req.body;
        const headers = req.headers;
        delete req.headers;
        Object.assign(req, options5);
        if (options5.headers && headers)
          req.headers = { ...options5.headers, ...headers };
        else if (options5.headers)
          req.headers = options5.headers;
        else
          req.headers = headers;
        http_debug("http request:", JSON.stringify(req));
        const channel = cockpit2.channel(req);
        if (input !== void 0) {
          if (input !== "") {
            http_debug("http input:", input);
            iterate_data(input, function(data) {
              channel.send(data);
            });
          }
          http_debug("http done");
          channel.control({ command: "done" });
        }
        let streamer = null;
        let responsers = null;
        let resp = null;
        const buffer = channel.buffer(function(data) {
          if (resp && resp.status >= 200 && resp.status <= 299 && streamer)
            return streamer.call(ret, data);
          return 0;
        });
        function on_control(event, options6) {
          if (options6.command == "response") {
            resp = options6;
            if (responsers) {
              resp.headers = resp.headers || {};
              invoke_functions(responsers, ret, [resp.status, resp.headers]);
            }
          }
        }
        function on_close(event, options6) {
          const pos = active_requests.indexOf(ret);
          if (pos >= 0)
            active_requests.splice(pos, 1);
          if (options6.problem) {
            http_debug("http problem: ", options6.problem);
            dfd.reject(new BasicError(options6.problem, options6.message));
          } else {
            const body = buffer.squash();
            if (resp && (resp.status < 200 || resp.status > 299)) {
              let message;
              const type = find_header(resp.headers, "Content-Type");
              if (type && !channel.binary) {
                if (type.indexOf("text/plain") === 0)
                  message = body;
              }
              http_debug("http status: ", resp.status);
              dfd.reject(new HttpError(resp.status, resp.reason, message), body);
            } else {
              http_debug("http done");
              dfd.resolve(body);
            }
          }
          channel.removeEventListener("control", on_control);
          channel.removeEventListener("close", on_close);
        }
        channel.addEventListener("control", on_control);
        channel.addEventListener("close", on_close);
        ret.stream = function(callback) {
          streamer = callback;
          return ret;
        };
        ret.response = function(callback) {
          if (responsers === null)
            responsers = [];
          responsers.push(callback);
          return ret;
        };
        ret.input = function(message, stream) {
          if (message !== null && message !== void 0) {
            http_debug("http input:", message);
            iterate_data(message, function(data) {
              channel.send(data);
            });
          }
          if (!stream) {
            http_debug("http done");
            channel.control({ command: "done" });
          }
          return ret;
        };
        ret.close = function(problem) {
          http_debug("http closing:", problem);
          channel.close(problem);
          return ret;
        };
        active_requests.push(ret);
        return ret;
      };
      self2.get = function get(path2, params, headers) {
        return self2.request({
          method: "GET",
          params,
          path: path2,
          body: "",
          headers
        });
      };
      self2.post = function post(path2, body, headers) {
        headers = headers || {};
        if (is_plain_object(body) || Array.isArray(body)) {
          body = JSON.stringify(body);
          if (find_header(headers, "Content-Type") === void 0)
            headers["Content-Type"] = "application/json";
        } else if (body === void 0 || body === null) {
          body = "";
        } else if (typeof body !== "string") {
          body = String(body);
        }
        return self2.request({
          method: "POST",
          path: path2,
          body,
          headers
        });
      };
      self2.close = function close(problem) {
        const reqs = active_requests.slice();
        for (let i = 0; i < reqs.length; i++)
          reqs[i].close(problem);
      };
    }
    cockpit2.http = function(endpoint, options5) {
      if (is_plain_object(endpoint) && options5 === void 0) {
        options5 = endpoint;
        endpoint = void 0;
      }
      return new HttpClient(endpoint, options5 || {});
    };
    function check_superuser() {
      return new Promise((resolve, reject) => {
        const ch = cockpit2.channel({ payload: "null", superuser: "require" });
        ch.wait().then(() => resolve(true)).catch(() => resolve(false)).always(() => ch.close());
      });
    }
    function Permission(options5) {
      const self2 = this;
      event_mixin(self2, {});
      const api = cockpit2.dbus(null, { bus: "internal" }).proxy("cockpit.Superuser", "/superuser");
      api.addEventListener("changed", maybe_reload);
      function maybe_reload() {
        if (api.valid && self2.allowed !== null) {
          if (self2.allowed != (api.Current != "none"))
            window.location.reload(true);
        }
      }
      self2.allowed = null;
      self2.user = options5 ? options5.user : null;
      self2.is_superuser = options5 ? options5._is_superuser : null;
      let group = null;
      let admin = false;
      if (options5)
        group = options5.group;
      if (options5?.admin)
        admin = true;
      function decide(user) {
        if (user.id === 0)
          return true;
        if (group)
          return !!(user.groups || []).includes(group);
        if (admin)
          return self2.is_superuser;
        if (user.id === void 0)
          return null;
        return false;
      }
      if (self2.user && self2.is_superuser !== null) {
        self2.allowed = decide(self2.user);
      } else {
        Promise.all([cockpit2.user(), check_superuser()]).then(([user, is_superuser]) => {
          self2.user = user;
          self2.is_superuser = is_superuser;
          const allowed = decide(user);
          if (self2.allowed !== allowed) {
            self2.allowed = allowed;
            maybe_reload();
            self2.dispatchEvent("changed");
          }
        });
      }
      self2.close = function close() {
      };
    }
    cockpit2.permission = function permission(arg) {
      return new Permission(arg);
    };
    function MetricsChannel(interval2, options_list, cache) {
      const self2 = this;
      event_mixin(self2, {});
      if (options_list.length === void 0)
        options_list = [options_list];
      const channels = [];
      let following = false;
      self2.series = cockpit2.series(interval2, cache, fetch_for_series);
      self2.archives = null;
      self2.meta = null;
      function fetch_for_series(beg, end2, for_walking) {
        if (!for_walking)
          self2.fetch(beg, end2);
        else
          self2.follow();
      }
      function transfer(options_list2, callback, is_archive) {
        if (options_list2.length === 0)
          return;
        if (!is_archive) {
          if (following)
            return;
          following = true;
        }
        const options5 = {
          payload: "metrics1",
          interval: interval2,
          source: "internal",
          ...options_list2[0]
        };
        delete options5.archive_source;
        const channel = cockpit2.channel(options5);
        channels.push(channel);
        let meta = null;
        let last = null;
        let beg;
        channel.addEventListener("close", function(ev, close_options) {
          if (!is_archive)
            following = false;
          if (options_list2.length > 1 && (close_options.problem == "not-supported" || close_options.problem == "not-found")) {
            transfer(options_list2.slice(1), callback);
          } else if (close_options.problem) {
            if (close_options.problem != "terminated" && close_options.problem != "disconnected" && close_options.problem != "authentication-failed" && (close_options.problem != "not-found" || !is_archive) && (close_options.problem != "not-supported" || !is_archive)) {
              console.warn("metrics channel failed: " + close_options.problem);
            }
          } else if (is_archive) {
            if (!self2.archives) {
              self2.archives = true;
              self2.dispatchEvent("changed");
            }
          }
        });
        channel.addEventListener("message", function(ev, payload) {
          const message = JSON.parse(payload);
          const message_len = message.length;
          if (message_len === void 0) {
            meta = message;
            let timestamp = 0;
            if (meta.now && meta.timestamp)
              timestamp = meta.timestamp + (Date.now() - meta.now);
            beg = Math.floor(timestamp / interval2);
            callback(beg, meta, null, options_list2[0]);
            self2.meta = meta;
            self2.dispatchEvent("changed");
          } else if (meta) {
            for (let i = 0; i < message_len; i++) {
              const data = message[i];
              if (last) {
                for (let j = 0; j < last.length; j++) {
                  const dataj = data[j];
                  if (dataj === null || dataj === void 0) {
                    data[j] = last[j];
                  } else {
                    const dataj_len = dataj.length;
                    if (dataj_len !== void 0) {
                      const lastj = last[j];
                      const lastj_len = last[j].length;
                      let k2;
                      for (k2 = 0; k2 < dataj_len; k2++) {
                        if (dataj[k2] === null)
                          dataj[k2] = lastj[k2];
                      }
                      for (; k2 < lastj_len; k2++)
                        dataj[k2] = lastj[k2];
                    }
                  }
                }
              }
              last = data;
            }
            callback(beg, meta, message, options_list2[0]);
            beg += message_len;
            meta.timestamp += interval2 * message_len;
          }
        });
      }
      function drain(beg, meta, message, options5) {
        let mapping = meta.mapping;
        if (!mapping) {
          mapping = {};
          meta.metrics.forEach(function(metric, i) {
            const map2 = { "": i };
            const name2 = options5.metrics_path_names?.[i] ?? metric.name;
            mapping[name2] = map2;
            if (metric.instances) {
              metric.instances.forEach(function(instance, i2) {
                if (instance === "")
                  instance = "/";
                map2[instance] = { "": i2 };
              });
            }
          });
          meta.mapping = mapping;
        }
        if (message)
          self2.series.input(beg, message, mapping);
      }
      self2.fetch = function fetch(beg, end2) {
        const timestamp = beg * interval2 - Date.now();
        const limit = end2 - beg;
        const archive_options_list = [];
        for (let i = 0; i < options_list.length; i++) {
          if (options_list[i].archive_source) {
            archive_options_list.push({
              ...options_list[i],
              source: options_list[i].archive_source,
              timestamp,
              limit
            });
          }
        }
        transfer(archive_options_list, drain, true);
      };
      self2.follow = function follow() {
        transfer(options_list, drain);
      };
      self2.close = function close(options5) {
        const len = channels.length;
        if (self2.series)
          self2.series.close();
        for (let i = 0; i < len; i++)
          channels[i].close(options5);
      };
    }
    cockpit2.metrics = function metrics(interval2, options5) {
      return new MetricsChannel(interval2, options5);
    };
    cockpit2.oops = function oops() {
      if (window.parent !== window && window.name.indexOf("cockpit1:") === 0)
        window.parent.postMessage('\n{ "command": "oops" }', transport_origin);
    };
    const old_onerror = window.onerror;
    window.onerror = function(msg, url, line) {
      if (url != "")
        cockpit2.oops();
      if (old_onerror)
        return old_onerror(msg, url, line);
      return false;
    };
    cockpit2.assert = (predicate, message) => {
      if (!predicate) {
        throw new Error(`Assertion failed: ${message}`);
      }
    };
    return cockpit2;
  }
  var cockpit = factory();
  var cockpit_default = cockpit;
  window.cockpit = cockpit;

  // src/ds.jsx
  var import_react183 = __toESM(require_react(), 1);

  // src/plugins.jsx
  var import_react36 = __toESM(require_react(), 1);
  var import_prop_types21 = __toESM(require_prop_types(), 1);

  // src/lib/tools.jsx
  var _ = cockpit_default.gettext;
  function searchFilter(searchFilterValue, columnsToSearch, rows) {
    if (searchFilterValue && rows && rows.length) {
      const filteredRows = [];
      rows.forEach((row) => {
        let rowToSearch = [];
        if (columnsToSearch && columnsToSearch.length) {
          columnsToSearch.forEach((column) => {
            if (column in row) {
              if (row[column] != null) {
                rowToSearch.push(row[column]);
              }
            }
          });
        } else {
          rowToSearch = row;
        }
        const match = Object.values(rowToSearch).some(
          (value) => value.join().toLowerCase().includes(searchFilterValue.toLowerCase())
        );
        if (match) {
          filteredRows.push(row);
        }
      });
      return filteredRows;
    }
    return rows;
  }
  function log_cmd(js_func, desc, cmd_array) {
    if (console) {
      const pw_args = ["--passwd", "--bind-pw", "--nsslapd-rootpw"];
      const cmd_list = [];
      let converted_pw = false;
      for (const idx in cmd_array) {
        const cmd = cmd_array[idx].toString();
        converted_pw = false;
        for (const arg_idx in pw_args) {
          if (cmd.startsWith(pw_args[arg_idx])) {
            const arg_len = cmd.indexOf("=");
            const arg = cmd.substring(0, arg_len);
            if (cmd.length !== arg_len + 1) {
              cmd_list.push(arg + "=**********");
              converted_pw = true;
            }
            break;
          }
        }
        if (!converted_pw) {
          cmd_list.push(cmd);
        }
      }
      console.log("CMD: " + js_func + ": " + desc + " ==> " + cmd_list.join(" "));
    }
  }
  function get_date_string(timestamp) {
    const year = timestamp.substr(0, 4);
    const month = timestamp.substr(4, 2);
    const day = timestamp.substr(6, 2);
    const hour = timestamp.substr(8, 2);
    const minute = timestamp.substr(10, 2);
    const sec = timestamp.substr(12, 2);
    const date2 = new Date(
      parseInt(year),
      parseInt(month) - 1,
      parseInt(day),
      parseInt(hour),
      parseInt(minute),
      parseInt(sec)
    );
    return date2.toLocaleString("en-ZA");
  }
  function get_date_diff(start2, end2) {
    let year = start2.substr(0, 4);
    let month = start2.substr(4, 2);
    let day = start2.substr(6, 2);
    let hour = start2.substr(8, 2);
    let minute = start2.substr(10, 2);
    let sec = start2.substr(12, 2);
    const startDate = new Date(
      parseInt(year),
      parseInt(month),
      parseInt(day),
      parseInt(hour),
      parseInt(minute),
      parseInt(sec)
    );
    year = end2.substr(0, 4);
    month = end2.substr(4, 2);
    day = end2.substr(6, 2);
    hour = end2.substr(8, 2);
    minute = end2.substr(10, 2);
    sec = end2.substr(12, 2);
    const currDate = new Date(
      parseInt(year),
      parseInt(month),
      parseInt(day),
      parseInt(hour),
      parseInt(minute),
      parseInt(sec)
    );
    let seconds2 = Math.floor((currDate - startDate) / 1e3);
    let minutes = Math.floor(seconds2 / 60);
    let hours = Math.floor(minutes / 60);
    const days = Math.floor(hours / 24);
    hours = hours - days * 24;
    minutes = minutes - days * 24 * 60 - hours * 60;
    seconds2 = seconds2 - days * 24 * 60 * 60 - hours * 60 * 60 - minutes * 60;
    if (days === "1") {
      day = "day";
    } else {
      day = "days";
    }
    if (hours === "1") {
      hour = "hour";
    } else {
      hour = "hours";
    }
    if (minutes === "1") {
      minute = "minute";
    } else {
      minute = "minutes";
    }
    if (seconds2 === "1") {
      sec = "second";
    } else {
      sec = "seconds";
    }
    return `${days} ${day}, ${hours} ${hour}, ${minutes} ${minute}, and ${seconds2} ${sec}`;
  }
  function bad_file_name(file_name) {
    if (file_name.includes("/")) {
      return true;
    }
    return false;
  }
  function file_is_path(file_name) {
    if (file_name.length >= 2 && file_name.startsWith("/") && !file_name.endsWith("/")) {
      return true;
    } else {
      return false;
    }
  }
  function isValidIpAddress(ipAddress) {
    const regexIPv4 = /^(?=(?:[^.]*\.){2,3}[^.]*$)(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){1,3}(?:\.\*)?$/;
    const regexIPv6 = /(?:^|(?<=\s))(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(?=\s|$)/;
    let result = false;
    if (typeof ipAddress !== "string") {
      return result;
    }
    if (ipAddress.includes(":")) {
      result = ipAddress.match(regexIPv6);
    } else {
      result = ipAddress.match(regexIPv4);
    }
    return result !== null;
  }
  function isValidIpAddressOrCIDR(ipAddressOrCIDR) {
    if (typeof ipAddressOrCIDR !== "string") {
      return false;
    }
    if (ipAddressOrCIDR.includes("/")) {
      const parts = ipAddressOrCIDR.split("/");
      if (parts.length !== 2) {
        return false;
      }
      const ipPart = parts[0];
      const prefixPart = parts[1];
      const regexIPv4CIDR = /^(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/;
      const regexIPv6CIDR = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
      let ipValid = false;
      if (ipPart.includes(":")) {
        ipValid = regexIPv6CIDR.test(ipPart);
      } else {
        ipValid = regexIPv4CIDR.test(ipPart);
      }
      if (!ipValid) {
        return false;
      }
      const prefix = parseInt(prefixPart, 10);
      if (isNaN(prefix)) {
        return false;
      }
      if (ipPart.includes(":")) {
        return prefix >= 0 && prefix <= 128;
      } else {
        return prefix >= 0 && prefix <= 32;
      }
    }
    return isValidIpAddress(ipAddressOrCIDR);
  }
  function isValidHostname(hostname) {
    if (typeof hostname !== "string") {
      return false;
    }
    const regex = /^((\*)|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|((\*\.)?([a-zA-Z0-9-]+\.){0,5}[a-zA-Z0-9-]+\.[a-zA-Z]{2,63}?))$/;
    const result = hostname.match(regex);
    return result !== null;
  }
  function isValidLDAPUrl(url) {
    if (url.startsWith("ldap:///")) {
      return true;
    }
    return false;
  }
  function valid_port(val) {
    let result = !isNaN(val);
    if (result) {
      if (val < 1 || val > 65535) {
        result = false;
      }
    }
    return result;
  }
  function is_port_in_use(port) {
    return new Promise((resolve, reject) => {
      if (!valid_port(port)) {
        reject("Invalid port number");
        return;
      }
      let cmd = ["bash", "-c", `ss -ntplu | grep -w :${port} || echo "free"`];
      log_cmd("is_port_in_use", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((result) => {
        const isPortInUse = result.trim() !== "free";
        resolve(isPortInUse);
      }).fail((error) => {
        reject("Error checking port");
      });
    });
  }
  function valid_dn(dn) {
    if (dn === "" || dn.endsWith(",")) {
      return false;
    }
    if (dn.includes("\\,")) {
      dn = dn.replace("\\,", "ZZ");
    }
    if (dn.includes("\\<")) {
      dn = dn.replace("\\<", "ZZ");
    }
    if (dn.includes("\\>")) {
      dn = dn.replace("\\>", "ZZ");
    }
    if (dn.includes('\\"')) {
      dn = dn.replace('\\"', "ZZ");
    }
    if (dn.includes("\\;")) {
      dn = dn.replace("\\;", "ZZ");
    }
    if (dn.includes("\\=")) {
      dn = dn.replace("\\=", "ZZ");
    }
    if (dn.includes("\\+")) {
      dn = dn.replace("\\+", "ZZ");
    }
    const dn_regex = /^([A-Za-z])+=([A-Za-z0-9 _\-$^*!~.])+$/;
    const parts = dn.split(",");
    for (const part of parts) {
      if (!dn_regex.test(part)) {
        return false;
      }
    }
    return true;
  }
  function valid_db_name(name2) {
    if (name2 === "") {
      return false;
    }
    const name_regex = /^[A-Za-z][A-Za-z_\-0-9]+$/;
    return name_regex.test(name2);
  }
  function valid_filter(filter) {
    if (filter.startsWith("(") && filter.endsWith(")")) {
      return true;
    }
    return false;
  }
  function numToCommas(num) {
    if (num === void 0 || num === "") {
      return num;
    }
    return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
  }
  function displayBytes(bytes) {
    if (bytes === 0 || bytes === "0" || isNaN(bytes)) {
      return "0 Bytes";
    }
    const k2 = 1024;
    const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
    const i = Math.floor(Math.log(bytes) / Math.log(k2));
    return parseFloat((bytes / Math.pow(k2, i)).toFixed(2)) + " " + sizes[i];
  }
  function listsEqual(list1, list2) {
    if (Array.isArray(list1) && Array.isArray(list2)) {
      const list1_sorted = [...list1].sort();
      const list2_sorted = [...list2].sort();
      if (list1_sorted.length !== list2_sorted.length) {
        return false;
      }
      for (let i = list1_sorted.length; i--; ) {
        if (list1_sorted[i].toLowerCase() !== list2_sorted[i].toLowerCase()) {
          return false;
        }
      }
      return true;
    } else if (list1 === void 0 && list2 === void 0) {
      return true;
    } else {
      return false;
    }
  }
  function validHostname(hostname) {
    const reHostname = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/;
    return reHostname.exec(hostname);
  }
  function callCmdStreamPassword(config) {
    const cmd = [...config.cmd];
    if (config.passwd !== "" && config.promptArg !== "") {
      cmd.push(config.promptArg);
    }
    let buffer = "";
    const proc = cockpit_default.spawn(cmd, { pty: true, environ: ["LC_ALL=C"], superuser: true, err: "message" });
    proc.done((data) => {
      config.addNotification("success", config.success_msg);
      config.state_callback();
      if (config.reload_func) {
        config.reload_func(config.reload_arg);
      }
      if (config.ext_func) {
        config.ext_func(config.ext_arg);
      }
    }).fail((_113) => {
      config.addNotification("error", config.error_msg + ": " + buffer);
      config.state_callback();
      if (config.reload_func) {
        config.reload_func(config.reload_arg);
      }
      if (config.ext_func) {
        config.ext_func(config.ext_arg);
      }
    }).stream((data) => {
      buffer += data;
      proc.input(config.passwd + "\n", true);
    });
  }
  function parentExists(params) {
    if (!params || !params.configDN || !params.serverId) {
      console.error("parentExists: Missing required parameters");
      return Promise.resolve(false);
    }
    let parentDN = params.configDN;
    const idx = params.configDN.indexOf(",");
    if (idx !== -1) {
      parentDN = params.configDN.substring(idx + 1);
    }
    const cmd = [
      "ldapsearch",
      "-LLL",
      "-Y",
      "EXTERNAL",
      "-b",
      parentDN,
      "-H",
      "ldapi://%2fvar%2frun%2fslapd-" + params.serverId + ".socket",
      "-s",
      "base",
      "1.1"
    ];
    log_cmd("parentExists", "Checking parent DN exists", cmd);
    return new Promise((resolve) => {
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
        resolve(data && data.includes("dn:"));
      }).fail((err) => {
        console.log(`parentExists: Parent DN:${parentDN} Error:${err.exit_status}`);
        resolve(false);
      });
    });
  }
  function getApiErrorMessage(err) {
    const fallback = _("Unknown error");
    if (err === null || err === void 0) {
      return fallback;
    }
    const raw = typeof err === "string" ? err : err.toString();
    try {
      const errObj = JSON.parse(raw);
      if (errObj && typeof errObj === "object") {
        let msg = errObj.desc || errObj.message || raw;
        if ("info" in errObj && errObj.info) {
          msg = `${msg} - ${errObj.info}`;
        }
        return msg;
      }
    } catch (e) {
    }
    return raw || fallback;
  }

  // src/lib/notifications.jsx
  var import_react17 = __toESM(require_react(), 1);
  var import_prop_types2 = __toESM(require_prop_types(), 1);

  // node_modules/@patternfly/react-styles/dist/esm/index.js
  function css(...args) {
    const classes = [];
    const hasOwn = {}.hasOwnProperty;
    args.filter(Boolean).forEach((arg) => {
      const argType = typeof arg;
      if (argType === "string" || argType === "number") {
        classes.push(arg);
      } else if (Array.isArray(arg) && arg.length) {
        const inner = css(...arg);
        if (inner) {
          classes.push(inner);
        }
      } else if (argType === "object") {
        for (const key in arg) {
          if (hasOwn.call(arg, key) && arg[key]) {
            classes.push(key);
          }
        }
      }
    });
    return classes.join(" ");
  }

  // node_modules/@patternfly/react-styles/css/components/Content/content.mjs
  var content_default = {
    "content": "pf-v5-c-content",
    "modifiers": {
      "visited": "pf-m-visited",
      "plain": "pf-m-plain"
    }
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Title/Title.js
  init_tslib_es6();
  var React7 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Title/title.mjs
  var title_default = {
    "modifiers": {
      "4xl": "pf-m-4xl",
      "3xl": "pf-m-3xl",
      "2xl": "pf-m-2xl",
      "xl": "pf-m-xl",
      "lg": "pf-m-lg",
      "md": "pf-m-md"
    },
    "title": "pf-v5-c-title"
  };

  // node_modules/@patternfly/react-tokens/dist/esm/global_breakpoint_sm.js
  var global_breakpoint_sm = {
    "name": "--pf-v5-global--breakpoint--sm",
    "value": "576px",
    "var": "var(--pf-v5-global--breakpoint--sm)"
  };
  var global_breakpoint_sm_default = global_breakpoint_sm;

  // node_modules/@patternfly/react-tokens/dist/esm/global_breakpoint_md.js
  var global_breakpoint_md = {
    "name": "--pf-v5-global--breakpoint--md",
    "value": "768px",
    "var": "var(--pf-v5-global--breakpoint--md)"
  };
  var global_breakpoint_md_default = global_breakpoint_md;

  // node_modules/@patternfly/react-tokens/dist/esm/global_breakpoint_lg.js
  var global_breakpoint_lg = {
    "name": "--pf-v5-global--breakpoint--lg",
    "value": "992px",
    "var": "var(--pf-v5-global--breakpoint--lg)"
  };
  var global_breakpoint_lg_default = global_breakpoint_lg;

  // node_modules/@patternfly/react-tokens/dist/esm/global_breakpoint_xl.js
  var global_breakpoint_xl = {
    "name": "--pf-v5-global--breakpoint--xl",
    "value": "1200px",
    "var": "var(--pf-v5-global--breakpoint--xl)"
  };
  var global_breakpoint_xl_default = global_breakpoint_xl;

  // node_modules/@patternfly/react-tokens/dist/esm/global_breakpoint_2xl.js
  var global_breakpoint_2xl = {
    "name": "--pf-v5-global--breakpoint--2xl",
    "value": "1450px",
    "var": "var(--pf-v5-global--breakpoint--2xl)"
  };
  var global_breakpoint_2xl_default = global_breakpoint_2xl;

  // node_modules/@patternfly/react-tokens/dist/esm/global_height_breakpoint_sm.js
  var global_height_breakpoint_sm = {
    "name": "--pf-v5-global--height-breakpoint--sm",
    "value": "0",
    "var": "var(--pf-v5-global--height-breakpoint--sm)"
  };
  var global_height_breakpoint_sm_default = global_height_breakpoint_sm;

  // node_modules/@patternfly/react-tokens/dist/esm/global_height_breakpoint_md.js
  var global_height_breakpoint_md = {
    "name": "--pf-v5-global--height-breakpoint--md",
    "value": "40rem",
    "var": "var(--pf-v5-global--height-breakpoint--md)"
  };
  var global_height_breakpoint_md_default = global_height_breakpoint_md;

  // node_modules/@patternfly/react-tokens/dist/esm/global_height_breakpoint_lg.js
  var global_height_breakpoint_lg = {
    "name": "--pf-v5-global--height-breakpoint--lg",
    "value": "48rem",
    "var": "var(--pf-v5-global--height-breakpoint--lg)"
  };
  var global_height_breakpoint_lg_default = global_height_breakpoint_lg;

  // node_modules/@patternfly/react-tokens/dist/esm/global_height_breakpoint_xl.js
  var global_height_breakpoint_xl = {
    "name": "--pf-v5-global--height-breakpoint--xl",
    "value": "60rem",
    "var": "var(--pf-v5-global--height-breakpoint--xl)"
  };
  var global_height_breakpoint_xl_default = global_height_breakpoint_xl;

  // node_modules/@patternfly/react-tokens/dist/esm/global_height_breakpoint_2xl.js
  var global_height_breakpoint_2xl = {
    "name": "--pf-v5-global--height-breakpoint--2xl",
    "value": "80rem",
    "var": "var(--pf-v5-global--height-breakpoint--2xl)"
  };
  var global_height_breakpoint_2xl_default = global_height_breakpoint_2xl;

  // node_modules/@patternfly/react-core/dist/esm/helpers/constants.js
  var KEYHANDLER_DIRECTION = { UP: "up", DOWN: "down", RIGHT: "right", LEFT: "left" };
  var ValidatedOptions;
  (function(ValidatedOptions2) {
    ValidatedOptions2["success"] = "success";
    ValidatedOptions2["error"] = "error";
    ValidatedOptions2["warning"] = "warning";
    ValidatedOptions2["default"] = "default";
  })(ValidatedOptions || (ValidatedOptions = {}));
  var KeyTypes = {
    Tab: "Tab",
    Space: " ",
    Escape: "Escape",
    Enter: "Enter",
    ArrowUp: "ArrowUp",
    ArrowDown: "ArrowDown",
    ArrowLeft: "ArrowLeft",
    ArrowRight: "ArrowRight"
  };
  var globalWidthBreakpoints = {
    sm: parseInt(global_breakpoint_sm_default.value),
    md: parseInt(global_breakpoint_md_default.value),
    lg: parseInt(global_breakpoint_lg_default.value),
    xl: parseInt(global_breakpoint_xl_default.value),
    "2xl": parseInt(global_breakpoint_2xl_default.value)
  };
  var globalHeightBreakpoints = {
    sm: parseInt(global_height_breakpoint_sm_default.value),
    md: parseInt(global_height_breakpoint_md_default.value),
    lg: parseInt(global_height_breakpoint_lg_default.value),
    xl: parseInt(global_height_breakpoint_xl_default.value),
    "2xl": parseInt(global_height_breakpoint_2xl_default.value)
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/FocusTrap/FocusTrap.js
  init_tslib_es6();

  // node_modules/tabbable/dist/index.esm.js
  var candidateSelectors = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"];
  var candidateSelector = /* @__PURE__ */ candidateSelectors.join(",");
  var NoElement = typeof Element === "undefined";
  var matches = NoElement ? function() {
  } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
  var getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) {
    var _element$getRootNode;
    return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element);
  } : function(element) {
    return element === null || element === void 0 ? void 0 : element.ownerDocument;
  };
  var _isInert = function isInert(node, lookUp) {
    var _node$getAttribute;
    if (lookUp === void 0) {
      lookUp = true;
    }
    var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, "inert");
    var inert = inertAtt === "" || inertAtt === "true";
    var result = inert || lookUp && node && // closest does not exist on shadow roots, so we fall back to a manual
    // lookup upward, in case it is not defined.
    (typeof node.closest === "function" ? node.closest("[inert]") : _isInert(node.parentNode));
    return result;
  };
  var isContentEditable = function isContentEditable2(node) {
    var _node$getAttribute2;
    var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, "contenteditable");
    return attValue === "" || attValue === "true";
  };
  var getCandidates = function getCandidates2(el, includeContainer, filter) {
    if (_isInert(el)) {
      return [];
    }
    var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
    if (includeContainer && matches.call(el, candidateSelector)) {
      candidates.unshift(el);
    }
    candidates = candidates.filter(filter);
    return candidates;
  };
  var _getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options5) {
    var candidates = [];
    var elementsToCheck = Array.from(elements);
    while (elementsToCheck.length) {
      var element = elementsToCheck.shift();
      if (_isInert(element, false)) {
        continue;
      }
      if (element.tagName === "SLOT") {
        var assigned = element.assignedElements();
        var content = assigned.length ? assigned : element.children;
        var nestedCandidates = _getCandidatesIteratively(content, true, options5);
        if (options5.flatten) {
          candidates.push.apply(candidates, nestedCandidates);
        } else {
          candidates.push({
            scopeParent: element,
            candidates: nestedCandidates
          });
        }
      } else {
        var validCandidate = matches.call(element, candidateSelector);
        if (validCandidate && options5.filter(element) && (includeContainer || !elements.includes(element))) {
          candidates.push(element);
        }
        var shadowRoot = element.shadowRoot || // check for an undisclosed shadow
        typeof options5.getShadowRoot === "function" && options5.getShadowRoot(element);
        var validShadowRoot = !_isInert(shadowRoot, false) && (!options5.shadowRootFilter || options5.shadowRootFilter(element));
        if (shadowRoot && validShadowRoot) {
          var _nestedCandidates = _getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options5);
          if (options5.flatten) {
            candidates.push.apply(candidates, _nestedCandidates);
          } else {
            candidates.push({
              scopeParent: element,
              candidates: _nestedCandidates
            });
          }
        } else {
          elementsToCheck.unshift.apply(elementsToCheck, element.children);
        }
      }
    }
    return candidates;
  };
  var hasTabIndex = function hasTabIndex2(node) {
    return !isNaN(parseInt(node.getAttribute("tabindex"), 10));
  };
  var getTabIndex = function getTabIndex2(node) {
    if (!node) {
      throw new Error("No node provided");
    }
    if (node.tabIndex < 0) {
      if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) {
        return 0;
      }
    }
    return node.tabIndex;
  };
  var getSortOrderTabIndex = function getSortOrderTabIndex2(node, isScope) {
    var tabIndex = getTabIndex(node);
    if (tabIndex < 0 && isScope && !hasTabIndex(node)) {
      return 0;
    }
    return tabIndex;
  };
  var sortOrderedTabbables = function sortOrderedTabbables2(a2, b) {
    return a2.tabIndex === b.tabIndex ? a2.documentOrder - b.documentOrder : a2.tabIndex - b.tabIndex;
  };
  var isInput = function isInput2(node) {
    return node.tagName === "INPUT";
  };
  var isHiddenInput = function isHiddenInput2(node) {
    return isInput(node) && node.type === "hidden";
  };
  var isDetailsWithSummary = function isDetailsWithSummary2(node) {
    var r = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) {
      return child.tagName === "SUMMARY";
    });
    return r;
  };
  var getCheckedRadio = function getCheckedRadio2(nodes, form) {
    for (var i = 0; i < nodes.length; i++) {
      if (nodes[i].checked && nodes[i].form === form) {
        return nodes[i];
      }
    }
  };
  var isTabbableRadio = function isTabbableRadio2(node) {
    if (!node.name) {
      return true;
    }
    var radioScope = node.form || getRootNode(node);
    var queryRadios = function queryRadios2(name2) {
      return radioScope.querySelectorAll('input[type="radio"][name="' + name2 + '"]');
    };
    var radioSet;
    if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") {
      radioSet = queryRadios(window.CSS.escape(node.name));
    } else {
      try {
        radioSet = queryRadios(node.name);
      } catch (err) {
        console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", err.message);
        return false;
      }
    }
    var checked = getCheckedRadio(radioSet, node.form);
    return !checked || checked === node;
  };
  var isRadio = function isRadio2(node) {
    return isInput(node) && node.type === "radio";
  };
  var isNonTabbableRadio = function isNonTabbableRadio2(node) {
    return isRadio(node) && !isTabbableRadio(node);
  };
  var isNodeAttached = function isNodeAttached2(node) {
    var _nodeRoot;
    var nodeRoot = node && getRootNode(node);
    var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === void 0 ? void 0 : _nodeRoot.host;
    var attached = false;
    if (nodeRoot && nodeRoot !== node) {
      var _nodeRootHost, _nodeRootHost$ownerDo, _node$ownerDocument;
      attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && (_nodeRootHost$ownerDo = _nodeRootHost.ownerDocument) !== null && _nodeRootHost$ownerDo !== void 0 && _nodeRootHost$ownerDo.contains(nodeRootHost) || node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.contains(node));
      while (!attached && nodeRootHost) {
        var _nodeRoot2, _nodeRootHost2, _nodeRootHost2$ownerD;
        nodeRoot = getRootNode(nodeRootHost);
        nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === void 0 ? void 0 : _nodeRoot2.host;
        attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== void 0 && _nodeRootHost2$ownerD.contains(nodeRootHost));
      }
    }
    return attached;
  };
  var isZeroArea = function isZeroArea2(node) {
    var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height;
    return width === 0 && height === 0;
  };
  var isHidden = function isHidden2(node, _ref) {
    var displayCheck = _ref.displayCheck, getShadowRoot = _ref.getShadowRoot;
    if (displayCheck === "full-native") {
      if ("checkVisibility" in node) {
        var visible = node.checkVisibility({
          // Checking opacity might be desirable for some use cases, but natively,
          // opacity zero elements _are_ focusable and tabbable.
          checkOpacity: false,
          opacityProperty: false,
          contentVisibilityAuto: true,
          visibilityProperty: true,
          // This is an alias for `visibilityProperty`. Contemporary browsers
          // support both. However, this alias has wider browser support (Chrome
          // >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so
          // we include it anyway.
          checkVisibilityCSS: true
        });
        return !visible;
      }
    }
    if (getComputedStyle(node).visibility === "hidden") {
      return true;
    }
    var isDirectSummary = matches.call(node, "details>summary:first-of-type");
    var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
    if (matches.call(nodeUnderDetails, "details:not([open]) *")) {
      return true;
    }
    if (!displayCheck || displayCheck === "full" || // full-native can run this branch when it falls through in case
    // Element#checkVisibility is unsupported
    displayCheck === "full-native" || displayCheck === "legacy-full") {
      if (typeof getShadowRoot === "function") {
        var originalNode = node;
        while (node) {
          var parentElement = node.parentElement;
          var rootNode = getRootNode(node);
          if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true) {
            return isZeroArea(node);
          } else if (node.assignedSlot) {
            node = node.assignedSlot;
          } else if (!parentElement && rootNode !== node.ownerDocument) {
            node = rootNode.host;
          } else {
            node = parentElement;
          }
        }
        node = originalNode;
      }
      if (isNodeAttached(node)) {
        return !node.getClientRects().length;
      }
      if (displayCheck !== "legacy-full") {
        return true;
      }
    } else if (displayCheck === "non-zero-area") {
      return isZeroArea(node);
    }
    return false;
  };
  var isDisabledFromFieldset = function isDisabledFromFieldset2(node) {
    if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {
      var parentNode = node.parentElement;
      while (parentNode) {
        if (parentNode.tagName === "FIELDSET" && parentNode.disabled) {
          for (var i = 0; i < parentNode.children.length; i++) {
            var child = parentNode.children.item(i);
            if (child.tagName === "LEGEND") {
              return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node);
            }
          }
          return true;
        }
        parentNode = parentNode.parentElement;
      }
    }
    return false;
  };
  var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options5, node) {
    if (node.disabled || isHiddenInput(node) || isHidden(node, options5) || // For a details element with a summary, the summary element gets the focus
    isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
      return false;
    }
    return true;
  };
  var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options5, node) {
    if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options5, node)) {
      return false;
    }
    return true;
  };
  var isShadowRootTabbable = function isShadowRootTabbable2(shadowHostNode) {
    var tabIndex = parseInt(shadowHostNode.getAttribute("tabindex"), 10);
    if (isNaN(tabIndex) || tabIndex >= 0) {
      return true;
    }
    return false;
  };
  var _sortByOrder = function sortByOrder(candidates) {
    var regularTabbables = [];
    var orderedTabbables = [];
    candidates.forEach(function(item, i) {
      var isScope = !!item.scopeParent;
      var element = isScope ? item.scopeParent : item;
      var candidateTabindex = getSortOrderTabIndex(element, isScope);
      var elements = isScope ? _sortByOrder(item.candidates) : element;
      if (candidateTabindex === 0) {
        isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
      } else {
        orderedTabbables.push({
          documentOrder: i,
          tabIndex: candidateTabindex,
          item,
          isScope,
          content: elements
        });
      }
    });
    return orderedTabbables.sort(sortOrderedTabbables).reduce(function(acc, sortable2) {
      sortable2.isScope ? acc.push.apply(acc, sortable2.content) : acc.push(sortable2.content);
      return acc;
    }, []).concat(regularTabbables);
  };
  var tabbable = function tabbable2(container, options5) {
    options5 = options5 || {};
    var candidates;
    if (options5.getShadowRoot) {
      candidates = _getCandidatesIteratively([container], options5.includeContainer, {
        filter: isNodeMatchingSelectorTabbable.bind(null, options5),
        flatten: false,
        getShadowRoot: options5.getShadowRoot,
        shadowRootFilter: isShadowRootTabbable
      });
    } else {
      candidates = getCandidates(container, options5.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options5));
    }
    return _sortByOrder(candidates);
  };
  var focusable = function focusable2(container, options5) {
    options5 = options5 || {};
    var candidates;
    if (options5.getShadowRoot) {
      candidates = _getCandidatesIteratively([container], options5.includeContainer, {
        filter: isNodeMatchingSelectorFocusable.bind(null, options5),
        flatten: true,
        getShadowRoot: options5.getShadowRoot
      });
    } else {
      candidates = getCandidates(container, options5.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options5));
    }
    return candidates;
  };
  var isTabbable = function isTabbable2(node, options5) {
    options5 = options5 || {};
    if (!node) {
      throw new Error("No node provided");
    }
    if (matches.call(node, candidateSelector) === false) {
      return false;
    }
    return isNodeMatchingSelectorTabbable(options5, node);
  };
  var focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe:not([inert]):not([inert] *)").join(",");
  var isFocusable = function isFocusable2(node, options5) {
    options5 = options5 || {};
    if (!node) {
      throw new Error("No node provided");
    }
    if (matches.call(node, focusableCandidateSelector) === false) {
      return false;
    }
    return isNodeMatchingSelectorFocusable(options5, node);
  };

  // node_modules/focus-trap/dist/focus-trap.esm.js
  function ownKeys2(e, r) {
    var t = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o = Object.getOwnPropertySymbols(e);
      r && (o = o.filter(function(r2) {
        return Object.getOwnPropertyDescriptor(e, r2).enumerable;
      })), t.push.apply(t, o);
    }
    return t;
  }
  function _objectSpread2(e) {
    for (var r = 1; r < arguments.length; r++) {
      var t = null != arguments[r] ? arguments[r] : {};
      r % 2 ? ownKeys2(Object(t), true).forEach(function(r2) {
        _defineProperty(e, r2, t[r2]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys2(Object(t)).forEach(function(r2) {
        Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
      });
    }
    return e;
  }
  function _defineProperty(obj, key, value) {
    key = _toPropertyKey(key);
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPrimitive(input, hint) {
    if (typeof input !== "object" || input === null) return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint || "default");
      if (typeof res !== "object") return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  function _toPropertyKey(arg) {
    var key = _toPrimitive(arg, "string");
    return typeof key === "symbol" ? key : String(key);
  }
  var activeFocusTraps = {
    activateTrap: function activateTrap(trapStack, trap) {
      if (trapStack.length > 0) {
        var activeTrap = trapStack[trapStack.length - 1];
        if (activeTrap !== trap) {
          activeTrap.pause();
        }
      }
      var trapIndex = trapStack.indexOf(trap);
      if (trapIndex === -1) {
        trapStack.push(trap);
      } else {
        trapStack.splice(trapIndex, 1);
        trapStack.push(trap);
      }
    },
    deactivateTrap: function deactivateTrap(trapStack, trap) {
      var trapIndex = trapStack.indexOf(trap);
      if (trapIndex !== -1) {
        trapStack.splice(trapIndex, 1);
      }
      if (trapStack.length > 0) {
        trapStack[trapStack.length - 1].unpause();
      }
    }
  };
  var isSelectableInput = function isSelectableInput2(node) {
    return node.tagName && node.tagName.toLowerCase() === "input" && typeof node.select === "function";
  };
  var isEscapeEvent = function isEscapeEvent2(e) {
    return (e === null || e === void 0 ? void 0 : e.key) === "Escape" || (e === null || e === void 0 ? void 0 : e.key) === "Esc" || (e === null || e === void 0 ? void 0 : e.keyCode) === 27;
  };
  var isTabEvent = function isTabEvent2(e) {
    return (e === null || e === void 0 ? void 0 : e.key) === "Tab" || (e === null || e === void 0 ? void 0 : e.keyCode) === 9;
  };
  var isKeyForward = function isKeyForward2(e) {
    return isTabEvent(e) && !e.shiftKey;
  };
  var isKeyBackward = function isKeyBackward2(e) {
    return isTabEvent(e) && e.shiftKey;
  };
  var delay = function delay2(fn) {
    return setTimeout(fn, 0);
  };
  var findIndex = function findIndex2(arr, fn) {
    var idx = -1;
    arr.every(function(value, i) {
      if (fn(value)) {
        idx = i;
        return false;
      }
      return true;
    });
    return idx;
  };
  var valueOrHandler = function valueOrHandler2(value) {
    for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      params[_key - 1] = arguments[_key];
    }
    return typeof value === "function" ? value.apply(void 0, params) : value;
  };
  var getActualTarget = function getActualTarget2(event) {
    return event.target.shadowRoot && typeof event.composedPath === "function" ? event.composedPath()[0] : event.target;
  };
  var internalTrapStack = [];
  var createFocusTrap = function createFocusTrap2(elements, userOptions) {
    var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document;
    var trapStack = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.trapStack) || internalTrapStack;
    var config = _objectSpread2({
      returnFocusOnDeactivate: true,
      escapeDeactivates: true,
      delayInitialFocus: true,
      isKeyForward,
      isKeyBackward
    }, userOptions);
    var state = {
      // containers given to createFocusTrap()
      // @type {Array<HTMLElement>}
      containers: [],
      // list of objects identifying tabbable nodes in `containers` in the trap
      // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
      //  is active, but the trap should never get to a state where there isn't at least one group
      //  with at least one tabbable node in it (that would lead to an error condition that would
      //  result in an error being thrown)
      // @type {Array<{
      //   container: HTMLElement,
      //   tabbableNodes: Array<HTMLElement>, // empty if none
      //   focusableNodes: Array<HTMLElement>, // empty if none
      //   posTabIndexesFound: boolean,
      //   firstTabbableNode: HTMLElement|undefined,
      //   lastTabbableNode: HTMLElement|undefined,
      //   firstDomTabbableNode: HTMLElement|undefined,
      //   lastDomTabbableNode: HTMLElement|undefined,
      //   nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
      // }>}
      containerGroups: [],
      // same order/length as `containers` list
      // references to objects in `containerGroups`, but only those that actually have
      //  tabbable nodes in them
      // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
      //  the same length
      tabbableGroups: [],
      nodeFocusedBeforeActivation: null,
      mostRecentlyFocusedNode: null,
      active: false,
      paused: false,
      // timer ID for when delayInitialFocus is true and initial focus in this trap
      //  has been delayed during activation
      delayInitialFocusTimer: void 0,
      // the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
      recentNavEvent: void 0
    };
    var trap;
    var getOption = function getOption2(configOverrideOptions, optionName, configOptionName) {
      return configOverrideOptions && configOverrideOptions[optionName] !== void 0 ? configOverrideOptions[optionName] : config[configOptionName || optionName];
    };
    var findContainerIndex = function findContainerIndex2(element, event) {
      var composedPath = typeof (event === null || event === void 0 ? void 0 : event.composedPath) === "function" ? event.composedPath() : void 0;
      return state.containerGroups.findIndex(function(_ref) {
        var container = _ref.container, tabbableNodes = _ref.tabbableNodes;
        return container.contains(element) || // fall back to explicit tabbable search which will take into consideration any
        //  web components if the `tabbableOptions.getShadowRoot` option was used for
        //  the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
        //  look inside web components even if open)
        (composedPath === null || composedPath === void 0 ? void 0 : composedPath.includes(container)) || tabbableNodes.find(function(node) {
          return node === element;
        });
      });
    };
    var getNodeForOption = function getNodeForOption2(optionName) {
      var optionValue = config[optionName];
      if (typeof optionValue === "function") {
        for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
          params[_key2 - 1] = arguments[_key2];
        }
        optionValue = optionValue.apply(void 0, params);
      }
      if (optionValue === true) {
        optionValue = void 0;
      }
      if (!optionValue) {
        if (optionValue === void 0 || optionValue === false) {
          return optionValue;
        }
        throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node"));
      }
      var node = optionValue;
      if (typeof optionValue === "string") {
        node = doc.querySelector(optionValue);
        if (!node) {
          throw new Error("`".concat(optionName, "` as selector refers to no known node"));
        }
      }
      return node;
    };
    var getInitialFocusNode = function getInitialFocusNode2() {
      var node = getNodeForOption("initialFocus");
      if (node === false) {
        return false;
      }
      if (node === void 0 || !isFocusable(node, config.tabbableOptions)) {
        if (findContainerIndex(doc.activeElement) >= 0) {
          node = doc.activeElement;
        } else {
          var firstTabbableGroup = state.tabbableGroups[0];
          var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode;
          node = firstTabbableNode || getNodeForOption("fallbackFocus");
        }
      }
      if (!node) {
        throw new Error("Your focus-trap needs to have at least one focusable element");
      }
      return node;
    };
    var updateTabbableNodes = function updateTabbableNodes2() {
      state.containerGroups = state.containers.map(function(container) {
        var tabbableNodes = tabbable(container, config.tabbableOptions);
        var focusableNodes = focusable(container, config.tabbableOptions);
        var firstTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[0] : void 0;
        var lastTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : void 0;
        var firstDomTabbableNode = focusableNodes.find(function(node) {
          return isTabbable(node);
        });
        var lastDomTabbableNode = focusableNodes.slice().reverse().find(function(node) {
          return isTabbable(node);
        });
        var posTabIndexesFound = !!tabbableNodes.find(function(node) {
          return getTabIndex(node) > 0;
        });
        return {
          container,
          tabbableNodes,
          focusableNodes,
          /** True if at least one node with positive `tabindex` was found in this container. */
          posTabIndexesFound,
          /** First tabbable node in container, __tabindex__ order; `undefined` if none. */
          firstTabbableNode,
          /** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
          lastTabbableNode,
          // NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
          //  would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
          //  because that API doesn't work with Shadow DOM as well as it should (@see
          //  https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far,
          //  to address an edge case related to positive tabindex support, this seems like a much easier,
          //  "close enough most of the time" alternative for positive tabindexes which should generally
          //  be avoided anyway...
          /** First tabbable node in container, __DOM__ order; `undefined` if none. */
          firstDomTabbableNode,
          /** Last tabbable node in container, __DOM__ order; `undefined` if none. */
          lastDomTabbableNode,
          /**
           * Finds the __tabbable__ node that follows the given node in the specified direction,
           *  in this container, if any.
           * @param {HTMLElement} node
           * @param {boolean} [forward] True if going in forward tab order; false if going
           *  in reverse.
           * @returns {HTMLElement|undefined} The next tabbable node, if any.
           */
          nextTabbableNode: function nextTabbableNode(node) {
            var forward = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
            var nodeIdx = tabbableNodes.indexOf(node);
            if (nodeIdx < 0) {
              if (forward) {
                return focusableNodes.slice(focusableNodes.indexOf(node) + 1).find(function(el) {
                  return isTabbable(el);
                });
              }
              return focusableNodes.slice(0, focusableNodes.indexOf(node)).reverse().find(function(el) {
                return isTabbable(el);
              });
            }
            return tabbableNodes[nodeIdx + (forward ? 1 : -1)];
          }
        };
      });
      state.tabbableGroups = state.containerGroups.filter(function(group) {
        return group.tabbableNodes.length > 0;
      });
      if (state.tabbableGroups.length <= 0 && !getNodeForOption("fallbackFocus")) {
        throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
      }
      if (state.containerGroups.find(function(g) {
        return g.posTabIndexesFound;
      }) && state.containerGroups.length > 1) {
        throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
      }
    };
    var getActiveElement = function getActiveElement2(el) {
      var activeElement = el.activeElement;
      if (!activeElement) {
        return;
      }
      if (activeElement.shadowRoot && activeElement.shadowRoot.activeElement !== null) {
        return getActiveElement2(activeElement.shadowRoot);
      }
      return activeElement;
    };
    var tryFocus = function tryFocus2(node) {
      if (node === false) {
        return;
      }
      if (node === getActiveElement(document)) {
        return;
      }
      if (!node || !node.focus) {
        tryFocus2(getInitialFocusNode());
        return;
      }
      node.focus({
        preventScroll: !!config.preventScroll
      });
      state.mostRecentlyFocusedNode = node;
      if (isSelectableInput(node)) {
        node.select();
      }
    };
    var getReturnFocusNode = function getReturnFocusNode2(previousActiveElement) {
      var node = getNodeForOption("setReturnFocus", previousActiveElement);
      return node ? node : node === false ? false : previousActiveElement;
    };
    var findNextNavNode = function findNextNavNode2(_ref2) {
      var target = _ref2.target, event = _ref2.event, _ref2$isBackward = _ref2.isBackward, isBackward = _ref2$isBackward === void 0 ? false : _ref2$isBackward;
      target = target || getActualTarget(event);
      updateTabbableNodes();
      var destinationNode = null;
      if (state.tabbableGroups.length > 0) {
        var containerIndex = findContainerIndex(target, event);
        var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : void 0;
        if (containerIndex < 0) {
          if (isBackward) {
            destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode;
          } else {
            destinationNode = state.tabbableGroups[0].firstTabbableNode;
          }
        } else if (isBackward) {
          var startOfGroupIndex = findIndex(state.tabbableGroups, function(_ref3) {
            var firstTabbableNode = _ref3.firstTabbableNode;
            return target === firstTabbableNode;
          });
          if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {
            startOfGroupIndex = containerIndex;
          }
          if (startOfGroupIndex >= 0) {
            var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1;
            var destinationGroup = state.tabbableGroups[destinationGroupIndex];
            destinationNode = getTabIndex(target) >= 0 ? destinationGroup.lastTabbableNode : destinationGroup.lastDomTabbableNode;
          } else if (!isTabEvent(event)) {
            destinationNode = containerGroup.nextTabbableNode(target, false);
          }
        } else {
          var lastOfGroupIndex = findIndex(state.tabbableGroups, function(_ref4) {
            var lastTabbableNode = _ref4.lastTabbableNode;
            return target === lastTabbableNode;
          });
          if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {
            lastOfGroupIndex = containerIndex;
          }
          if (lastOfGroupIndex >= 0) {
            var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
            var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
            destinationNode = getTabIndex(target) >= 0 ? _destinationGroup.firstTabbableNode : _destinationGroup.firstDomTabbableNode;
          } else if (!isTabEvent(event)) {
            destinationNode = containerGroup.nextTabbableNode(target);
          }
        }
      } else {
        destinationNode = getNodeForOption("fallbackFocus");
      }
      return destinationNode;
    };
    var checkPointerDown = function checkPointerDown2(e) {
      var target = getActualTarget(e);
      if (findContainerIndex(target, e) >= 0) {
        return;
      }
      if (valueOrHandler(config.clickOutsideDeactivates, e)) {
        trap.deactivate({
          // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
          //  which will result in the outside click setting focus to the node
          //  that was clicked (and if not focusable, to "nothing"); by setting
          //  `returnFocus: true`, we'll attempt to re-focus the node originally-focused
          //  on activation (or the configured `setReturnFocus` node), whether the
          //  outside click was on a focusable node or not
          returnFocus: config.returnFocusOnDeactivate
        });
        return;
      }
      if (valueOrHandler(config.allowOutsideClick, e)) {
        return;
      }
      e.preventDefault();
    };
    var checkFocusIn = function checkFocusIn2(event) {
      var target = getActualTarget(event);
      var targetContained = findContainerIndex(target, event) >= 0;
      if (targetContained || target instanceof Document) {
        if (targetContained) {
          state.mostRecentlyFocusedNode = target;
        }
      } else {
        event.stopImmediatePropagation();
        var nextNode;
        var navAcrossContainers = true;
        if (state.mostRecentlyFocusedNode) {
          if (getTabIndex(state.mostRecentlyFocusedNode) > 0) {
            var mruContainerIdx = findContainerIndex(state.mostRecentlyFocusedNode);
            var tabbableNodes = state.containerGroups[mruContainerIdx].tabbableNodes;
            if (tabbableNodes.length > 0) {
              var mruTabIdx = tabbableNodes.findIndex(function(node) {
                return node === state.mostRecentlyFocusedNode;
              });
              if (mruTabIdx >= 0) {
                if (config.isKeyForward(state.recentNavEvent)) {
                  if (mruTabIdx + 1 < tabbableNodes.length) {
                    nextNode = tabbableNodes[mruTabIdx + 1];
                    navAcrossContainers = false;
                  }
                } else {
                  if (mruTabIdx - 1 >= 0) {
                    nextNode = tabbableNodes[mruTabIdx - 1];
                    navAcrossContainers = false;
                  }
                }
              }
            }
          } else {
            if (!state.containerGroups.some(function(g) {
              return g.tabbableNodes.some(function(n) {
                return getTabIndex(n) > 0;
              });
            })) {
              navAcrossContainers = false;
            }
          }
        } else {
          navAcrossContainers = false;
        }
        if (navAcrossContainers) {
          nextNode = findNextNavNode({
            // move FROM the MRU node, not event-related node (which will be the node that is
            //  outside the trap causing the focus escape we're trying to fix)
            target: state.mostRecentlyFocusedNode,
            isBackward: config.isKeyBackward(state.recentNavEvent)
          });
        }
        if (nextNode) {
          tryFocus(nextNode);
        } else {
          tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
        }
      }
      state.recentNavEvent = void 0;
    };
    var checkKeyNav = function checkKeyNav2(event) {
      var isBackward = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
      state.recentNavEvent = event;
      var destinationNode = findNextNavNode({
        event,
        isBackward
      });
      if (destinationNode) {
        if (isTabEvent(event)) {
          event.preventDefault();
        }
        tryFocus(destinationNode);
      }
    };
    var checkKey = function checkKey2(event) {
      if (isEscapeEvent(event) && valueOrHandler(config.escapeDeactivates, event) !== false) {
        event.preventDefault();
        trap.deactivate();
        return;
      }
      if (config.isKeyForward(event) || config.isKeyBackward(event)) {
        checkKeyNav(event, config.isKeyBackward(event));
      }
    };
    var checkClick = function checkClick2(e) {
      var target = getActualTarget(e);
      if (findContainerIndex(target, e) >= 0) {
        return;
      }
      if (valueOrHandler(config.clickOutsideDeactivates, e)) {
        return;
      }
      if (valueOrHandler(config.allowOutsideClick, e)) {
        return;
      }
      e.preventDefault();
      e.stopImmediatePropagation();
    };
    var addListeners = function addListeners2() {
      if (!state.active) {
        return;
      }
      activeFocusTraps.activateTrap(trapStack, trap);
      state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function() {
        tryFocus(getInitialFocusNode());
      }) : tryFocus(getInitialFocusNode());
      doc.addEventListener("focusin", checkFocusIn, true);
      doc.addEventListener("mousedown", checkPointerDown, {
        capture: true,
        passive: false
      });
      doc.addEventListener("touchstart", checkPointerDown, {
        capture: true,
        passive: false
      });
      doc.addEventListener("click", checkClick, {
        capture: true,
        passive: false
      });
      doc.addEventListener("keydown", checkKey, {
        capture: true,
        passive: false
      });
      return trap;
    };
    var removeListeners = function removeListeners2() {
      if (!state.active) {
        return;
      }
      doc.removeEventListener("focusin", checkFocusIn, true);
      doc.removeEventListener("mousedown", checkPointerDown, true);
      doc.removeEventListener("touchstart", checkPointerDown, true);
      doc.removeEventListener("click", checkClick, true);
      doc.removeEventListener("keydown", checkKey, true);
      return trap;
    };
    var checkDomRemoval = function checkDomRemoval2(mutations) {
      var isFocusedNodeRemoved = mutations.some(function(mutation) {
        var removedNodes = Array.from(mutation.removedNodes);
        return removedNodes.some(function(node) {
          return node === state.mostRecentlyFocusedNode;
        });
      });
      if (isFocusedNodeRemoved) {
        tryFocus(getInitialFocusNode());
      }
    };
    var mutationObserver = typeof window !== "undefined" && "MutationObserver" in window ? new MutationObserver(checkDomRemoval) : void 0;
    var updateObservedNodes = function updateObservedNodes2() {
      if (!mutationObserver) {
        return;
      }
      mutationObserver.disconnect();
      if (state.active && !state.paused) {
        state.containers.map(function(container) {
          mutationObserver.observe(container, {
            subtree: true,
            childList: true
          });
        });
      }
    };
    trap = {
      get active() {
        return state.active;
      },
      get paused() {
        return state.paused;
      },
      activate: function activate(activateOptions) {
        if (state.active) {
          return this;
        }
        var onActivate = getOption(activateOptions, "onActivate");
        var onPostActivate = getOption(activateOptions, "onPostActivate");
        var checkCanFocusTrap = getOption(activateOptions, "checkCanFocusTrap");
        if (!checkCanFocusTrap) {
          updateTabbableNodes();
        }
        state.active = true;
        state.paused = false;
        state.nodeFocusedBeforeActivation = doc.activeElement;
        onActivate === null || onActivate === void 0 || onActivate();
        var finishActivation = function finishActivation2() {
          if (checkCanFocusTrap) {
            updateTabbableNodes();
          }
          addListeners();
          updateObservedNodes();
          onPostActivate === null || onPostActivate === void 0 || onPostActivate();
        };
        if (checkCanFocusTrap) {
          checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
          return this;
        }
        finishActivation();
        return this;
      },
      deactivate: function deactivate(deactivateOptions) {
        if (!state.active) {
          return this;
        }
        var options5 = _objectSpread2({
          onDeactivate: config.onDeactivate,
          onPostDeactivate: config.onPostDeactivate,
          checkCanReturnFocus: config.checkCanReturnFocus
        }, deactivateOptions);
        clearTimeout(state.delayInitialFocusTimer);
        state.delayInitialFocusTimer = void 0;
        removeListeners();
        state.active = false;
        state.paused = false;
        updateObservedNodes();
        activeFocusTraps.deactivateTrap(trapStack, trap);
        var onDeactivate = getOption(options5, "onDeactivate");
        var onPostDeactivate = getOption(options5, "onPostDeactivate");
        var checkCanReturnFocus = getOption(options5, "checkCanReturnFocus");
        var returnFocus = getOption(options5, "returnFocus", "returnFocusOnDeactivate");
        onDeactivate === null || onDeactivate === void 0 || onDeactivate();
        var finishDeactivation = function finishDeactivation2() {
          delay(function() {
            if (returnFocus) {
              tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
            }
            onPostDeactivate === null || onPostDeactivate === void 0 || onPostDeactivate();
          });
        };
        if (returnFocus && checkCanReturnFocus) {
          checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation);
          return this;
        }
        finishDeactivation();
        return this;
      },
      pause: function pause(pauseOptions) {
        if (state.paused || !state.active) {
          return this;
        }
        var onPause = getOption(pauseOptions, "onPause");
        var onPostPause = getOption(pauseOptions, "onPostPause");
        state.paused = true;
        onPause === null || onPause === void 0 || onPause();
        removeListeners();
        updateObservedNodes();
        onPostPause === null || onPostPause === void 0 || onPostPause();
        return this;
      },
      unpause: function unpause(unpauseOptions) {
        if (!state.paused || !state.active) {
          return this;
        }
        var onUnpause = getOption(unpauseOptions, "onUnpause");
        var onPostUnpause = getOption(unpauseOptions, "onPostUnpause");
        state.paused = false;
        onUnpause === null || onUnpause === void 0 || onUnpause();
        updateTabbableNodes();
        addListeners();
        updateObservedNodes();
        onPostUnpause === null || onPostUnpause === void 0 || onPostUnpause();
        return this;
      },
      updateContainerElements: function updateContainerElements(containerElements) {
        var elementsAsArray = [].concat(containerElements).filter(Boolean);
        state.containers = elementsAsArray.map(function(element) {
          return typeof element === "string" ? doc.querySelector(element) : element;
        });
        if (state.active) {
          updateTabbableNodes();
        }
        updateObservedNodes();
        return this;
      }
    };
    trap.updateContainerElements(elements);
    return trap;
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/FocusTrap/FocusTrap.js
  var import_react2 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/helpers/useUnmountEffect.js
  var import_react = __toESM(require_react());
  function useUnmountEffect(effect4) {
    const effectRef = (0, import_react.useRef)(effect4);
    effectRef.current = effect4;
    (0, import_react.useEffect)(() => () => {
      effectRef.current();
    }, []);
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/FocusTrap/FocusTrap.js
  var FocusTrap = (0, import_react2.forwardRef)(function FocusTrap2(_a, forwardedRef) {
    var { active = true, paused = false, focusTrapOptions = {}, preventScrollOnDeactivate = false } = _a, props = __rest(_a, ["active", "paused", "focusTrapOptions", "preventScrollOnDeactivate"]);
    const ref = (0, import_react2.useRef)(null);
    (0, import_react2.useImperativeHandle)(forwardedRef, () => ref.current);
    const focusTrapRef = (0, import_react2.useRef)(null);
    (0, import_react2.useEffect)(() => {
      const focusTrap = createFocusTrap(ref.current, Object.assign(Object.assign({}, focusTrapOptions), { returnFocusOnDeactivate: false }));
      focusTrapRef.current = focusTrap;
      return () => {
        focusTrap.deactivate();
      };
    }, []);
    (0, import_react2.useEffect)(() => {
      const focusTrap = focusTrapRef.current;
      active ? focusTrap === null || focusTrap === void 0 ? void 0 : focusTrap.activate() : focusTrap === null || focusTrap === void 0 ? void 0 : focusTrap.deactivate();
    }, [active]);
    (0, import_react2.useEffect)(() => {
      const focusTrap = focusTrapRef.current;
      paused ? focusTrap === null || focusTrap === void 0 ? void 0 : focusTrap.pause() : focusTrap === null || focusTrap === void 0 ? void 0 : focusTrap.unpause();
    }, [paused]);
    const previousElementRef = (0, import_react2.useRef)(typeof document !== "undefined" ? document.activeElement : null);
    useUnmountEffect(() => {
      if (focusTrapOptions.returnFocusOnDeactivate !== false && previousElementRef.current instanceof HTMLElement) {
        previousElementRef.current.focus({
          preventScroll: preventScrollOnDeactivate
        });
      }
    });
    return import_react2.default.createElement("div", Object.assign({ ref }, props));
  });
  FocusTrap.displayName = "FocusTrap";

  // node_modules/@patternfly/react-core/dist/esm/helpers/GenerateId/GenerateId.js
  var React2 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/helpers/util.js
  var ReactDOM = __toESM(require_react_dom());
  function capitalize(input) {
    return input[0].toUpperCase() + input.substring(1);
  }
  function getUniqueId(prefix = "pf") {
    const uid2 = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(2);
    return `${prefix}-${uid2}`;
  }
  function debounce(func, wait) {
    let timeout2;
    return (...args) => {
      clearTimeout(timeout2);
      timeout2 = setTimeout(() => func.apply(this, args), wait);
    };
  }
  function isElementInView(container, element, partial, strict = false) {
    if (!container || !element) {
      return false;
    }
    const containerBounds = container.getBoundingClientRect();
    const elementBounds = element.getBoundingClientRect();
    const containerBoundsLeft = Math.ceil(containerBounds.left);
    const containerBoundsRight = Math.floor(containerBounds.right);
    const elementBoundsLeft = Math.ceil(elementBounds.left);
    const elementBoundsRight = Math.floor(elementBounds.right);
    const isTotallyInView = elementBoundsLeft >= containerBoundsLeft && elementBoundsRight <= containerBoundsRight;
    const isPartiallyInView = (partial || !strict && containerBounds.width < elementBounds.width) && (elementBoundsLeft < containerBoundsLeft && elementBoundsRight > containerBoundsLeft || elementBoundsRight > containerBoundsRight && elementBoundsLeft < containerBoundsRight);
    return isTotallyInView || isPartiallyInView;
  }
  function fillTemplate(templateString, templateVars) {
    return templateString.replace(/\${(.*?)}/g, (_113, match) => templateVars[match] || "");
  }
  function keyHandler(index, innerIndex, position, refsCollection, kids, custom17 = false) {
    if (!Array.isArray(kids)) {
      return;
    }
    const isMultiDimensional = refsCollection.filter((ref) => ref)[0].constructor === Array;
    let nextIndex = index;
    let nextInnerIndex = innerIndex;
    if (position === "up") {
      if (index === 0) {
        nextIndex = kids.length - 1;
      } else {
        nextIndex = index - 1;
      }
    } else if (position === "down") {
      if (index === kids.length - 1) {
        nextIndex = 0;
      } else {
        nextIndex = index + 1;
      }
    } else if (position === "left") {
      if (innerIndex === 0) {
        nextInnerIndex = refsCollection[index].length - 1;
      } else {
        nextInnerIndex = innerIndex - 1;
      }
    } else if (position === "right") {
      if (innerIndex === refsCollection[index].length - 1) {
        nextInnerIndex = 0;
      } else {
        nextInnerIndex = innerIndex + 1;
      }
    }
    if (refsCollection[nextIndex] === null || refsCollection[nextIndex] === void 0 || isMultiDimensional && (refsCollection[nextIndex][nextInnerIndex] === null || refsCollection[nextIndex][nextInnerIndex] === void 0)) {
      keyHandler(nextIndex, nextInnerIndex, position, refsCollection, kids, custom17);
    } else if (custom17) {
      if (refsCollection[nextIndex].focus) {
        refsCollection[nextIndex].focus();
      }
      const element = ReactDOM.findDOMNode(refsCollection[nextIndex]);
      element.focus();
    } else if (position !== "tab") {
      if (isMultiDimensional) {
        refsCollection[nextIndex][nextInnerIndex].focus();
      } else {
        refsCollection[nextIndex].focus();
      }
    }
  }
  function pluralize(i, singular, plural) {
    if (!plural) {
      plural = `${singular}s`;
    }
    return `${i || 0} ${i === 1 ? singular : plural}`;
  }
  var setBreakpointCssVars = (mods, cssVar) => Object.entries(mods || {}).reduce((acc, [breakpoint, value]) => breakpoint === "default" ? Object.assign(Object.assign({}, acc), { [cssVar]: value }) : Object.assign(Object.assign({}, acc), { [`${cssVar}-on-${breakpoint}`]: value }), {});
  var formatBreakpointMods = (mods, styles3, stylePrefix = "", breakpoint, vertical) => {
    if (!mods) {
      return "";
    }
    if (breakpoint && !vertical) {
      if (breakpoint in mods) {
        return styles3.modifiers[toCamel(`${stylePrefix}${mods[breakpoint]}`)];
      }
      const breakpointsOrder = ["2xl", "xl", "lg", "md", "sm", "default"];
      const breakpointsIndex = breakpointsOrder.indexOf(breakpoint);
      for (let i = breakpointsIndex; i < breakpointsOrder.length; i++) {
        if (breakpointsOrder[i] in mods) {
          return styles3.modifiers[toCamel(`${stylePrefix}${mods[breakpointsOrder[i]]}`)];
        }
      }
      return "";
    }
    return Object.entries(mods || {}).map(([breakpoint2, mod]) => `${stylePrefix}${mod}${breakpoint2 !== "default" ? `-on-${breakpoint2}` : ""}${vertical && breakpoint2 !== "default" ? "-height" : ""}`).map(toCamel).map((mod) => mod.replace(/-?(\dxl)/gi, (_res, group) => `_${group}`)).map((modifierKey) => styles3.modifiers[modifierKey]).filter(Boolean).join(" ");
  };
  var getVerticalBreakpoint = (height) => {
    if (height === null) {
      return null;
    }
    if (height >= globalHeightBreakpoints["2xl"]) {
      return "2xl";
    }
    if (height >= globalHeightBreakpoints.xl) {
      return "xl";
    }
    if (height >= globalHeightBreakpoints.lg) {
      return "lg";
    }
    if (height >= globalHeightBreakpoints.md) {
      return "md";
    }
    if (height >= globalHeightBreakpoints.sm) {
      return "sm";
    }
    return "default";
  };
  var getBreakpoint = (width) => {
    if (width === null) {
      return null;
    }
    if (width >= globalWidthBreakpoints["2xl"]) {
      return "2xl";
    }
    if (width >= globalWidthBreakpoints.xl) {
      return "xl";
    }
    if (width >= globalWidthBreakpoints.lg) {
      return "lg";
    }
    if (width >= globalWidthBreakpoints.md) {
      return "md";
    }
    if (width >= globalWidthBreakpoints.sm) {
      return "sm";
    }
    return "default";
  };
  var camelize = (s2) => s2.toUpperCase().replace("-", "").replace("_", "");
  var toCamel = (s2) => s2.replace(/([-_][a-z])/gi, camelize);
  var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
  var getTextWidth = (text, node) => {
    const computedStyle = getComputedStyle(node);
    const getFontFromComputedStyle = () => {
      let computedFont = "";
      const fontStretchLookupTable = {
        "50%": "ultra-condensed",
        "62.5%": "extra-condensed",
        "75%": "condensed",
        "87.5%": "semi-condensed",
        "100%": "normal",
        "112.5%": "semi-expanded",
        "125%": "expanded",
        "150%": "extra-expanded",
        "200%": "ultra-expanded"
      };
      let fontStretch;
      if (computedStyle.fontStretch in fontStretchLookupTable) {
        fontStretch = fontStretchLookupTable[computedStyle.fontStretch];
      } else {
        fontStretch = "normal";
      }
      computedFont = computedStyle.fontStyle + " " + computedStyle.fontVariant + " " + computedStyle.fontWeight + " " + fontStretch + " " + computedStyle.fontSize + "/" + computedStyle.lineHeight + " " + computedStyle.fontFamily;
      return computedFont;
    };
    const canvas2 = document.createElement("canvas");
    const context = canvas2.getContext("2d");
    context.font = computedStyle.font || getFontFromComputedStyle();
    return context.measureText(text).width;
  };
  var innerDimensions = (node) => {
    const computedStyle = getComputedStyle(node);
    let width = node.clientWidth;
    let height = node.clientHeight;
    height -= parseFloat(computedStyle.paddingTop) + parseFloat(computedStyle.paddingBottom);
    width -= parseFloat(computedStyle.paddingLeft) + parseFloat(computedStyle.paddingRight);
    return { height, width };
  };
  var trimLeft = (node, value) => {
    const availableWidth = innerDimensions(node).width;
    let newValue = value;
    if (getTextWidth(value, node) > availableWidth) {
      while (getTextWidth(`...${newValue}`, node) > availableWidth) {
        newValue = newValue.substring(1);
      }
      if (node.value) {
        node.value = `...${newValue}`;
      } else {
        node.innerText = `...${newValue}`;
      }
    } else {
      if (node.value) {
        node.value = value;
      } else {
        node.innerText = value;
      }
    }
  };
  var preventedEvents = (events) => events.reduce((handlers, eventToPrevent) => Object.assign(Object.assign({}, handlers), { [eventToPrevent]: (event) => {
    event.preventDefault();
  } }), {});
  var clearTimeouts = (timeoutRefs) => {
    timeoutRefs.forEach((ref) => {
      if (ref.current) {
        clearTimeout(ref.current);
      }
    });
  };
  var getLanguageDirection = (targetElement, defaultDirection = "ltr") => {
    if (!targetElement) {
      return defaultDirection;
    }
    const computedDirection = getComputedStyle(targetElement).getPropertyValue("direction");
    if (["ltr", "rtl"].includes(computedDirection)) {
      return computedDirection;
    }
    return defaultDirection;
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/GenerateId/GenerateId.js
  var currentId = 0;
  function getRandomId() {
    if (typeof crypto !== "undefined" && crypto.randomUUID) {
      return crypto.randomUUID();
    } else {
      return getUniqueId();
    }
  }
  var GenerateId = class extends React2.Component {
    constructor() {
      super(...arguments);
      this.uniqueElement = this.props.isRandom ? getRandomId() : currentId++;
      this.id = `${this.props.prefix}${this.uniqueElement}`;
    }
    render() {
      return this.props.children(this.id);
    }
  };
  GenerateId.displayName = "GenerateId";
  GenerateId.defaultProps = {
    prefix: "pf-random-id-",
    isRandom: false
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/htmlConstants.js
  var ASTERISK = "*";

  // node_modules/@patternfly/react-core/dist/esm/helpers/OUIA/ouia.js
  var import_react3 = __toESM(require_react());
  var uid = 0;
  var ouiaPrefix = "OUIA-Generated-";
  var ouiaIdByRoute = {};
  function getOUIAProps(componentType, id, ouiaSafe = true) {
    return {
      "data-ouia-component-type": `PF5/${componentType}`,
      "data-ouia-safe": ouiaSafe,
      "data-ouia-component-id": id
    };
  }
  var useOUIAProps = (componentType, id, ouiaSafe = true, variant) => ({
    "data-ouia-component-type": `PF5/${componentType}`,
    "data-ouia-safe": ouiaSafe,
    "data-ouia-component-id": useOUIAId(componentType, id, variant)
  });
  var useOUIAId = (componentType, id, variant) => {
    const defaultOUIAId = (0, import_react3.useMemo)(() => getDefaultOUIAId(componentType, variant), [componentType, variant]);
    return id !== null && id !== void 0 ? id : defaultOUIAId;
  };
  function getDefaultOUIAId(componentType, variant) {
    try {
      let key;
      if (typeof window !== "undefined") {
        key = `${window.location.href}-${componentType}-${variant || ""}`;
      } else {
        key = `${componentType}-${variant || ""}`;
      }
      if (!ouiaIdByRoute[key]) {
        ouiaIdByRoute[key] = 0;
      }
      return `${ouiaPrefix}${componentType}-${variant ? `${variant}-` : ""}${++ouiaIdByRoute[key]}`;
    } catch (exception) {
      return `${ouiaPrefix}${componentType}-${variant ? `${variant}-` : ""}${++uid}`;
    }
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/Popper.js
  var React5 = __toESM(require_react());
  var ReactDOM2 = __toESM(require_react_dom());

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/react-popper/usePopper.js
  var React4 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getBoundingClientRect.js
  function getBoundingClientRect(element) {
    const rect = element.getBoundingClientRect();
    return {
      width: rect.width,
      height: rect.height,
      top: rect.top,
      right: rect.right,
      bottom: rect.bottom,
      left: rect.left,
      x: rect.left,
      y: rect.top
    };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getWindow.js
  function getWindow(node) {
    if (node.toString() !== "[object Window]") {
      const ownerDocument = node.ownerDocument;
      return ownerDocument ? ownerDocument.defaultView : window;
    }
    return node;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getWindowScroll.js
  function getWindowScroll(node) {
    const win = getWindow(node);
    const scrollLeft = win.pageXOffset;
    const scrollTop = win.pageYOffset;
    return {
      scrollLeft,
      scrollTop
    };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/instanceOf.js
  function isElement(node) {
    const OwnElement = getWindow(node).Element;
    return node instanceof OwnElement || node instanceof Element;
  }
  function isHTMLElement(node) {
    const OwnElement = getWindow(node).HTMLElement;
    return node instanceof OwnElement || node instanceof HTMLElement;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getHTMLElementScroll.js
  function getHTMLElementScroll(element) {
    return {
      scrollLeft: element.scrollLeft,
      scrollTop: element.scrollTop
    };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getNodeScroll.js
  function getNodeScroll(node) {
    if (node === getWindow(node) || !isHTMLElement(node)) {
      return getWindowScroll(node);
    } else {
      return getHTMLElementScroll(node);
    }
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getNodeName.js
  function getNodeName(element) {
    return element ? (element.nodeName || "").toLowerCase() : null;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getDocumentElement.js
  function getDocumentElement(element) {
    return (isElement(element) ? element.ownerDocument : element.document).documentElement;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getWindowScrollBarX.js
  function getWindowScrollBarX(element) {
    return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getComputedStyle.js
  function getComputedStyle2(element) {
    return getWindow(element).getComputedStyle(element);
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/isScrollParent.js
  function isScrollParent(element) {
    const { overflow, overflowX, overflowY } = getComputedStyle2(element);
    return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getCompositeRect.js
  function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed = false) {
    const documentElement = getDocumentElement(offsetParent);
    const rect = getBoundingClientRect(elementOrVirtualElement);
    const isOffsetParentAnElement = isHTMLElement(offsetParent);
    let scroll = { scrollLeft: 0, scrollTop: 0 };
    let offsets = { x: 0, y: 0 };
    if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
      if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
      isScrollParent(documentElement)) {
        scroll = getNodeScroll(offsetParent);
      }
      if (isHTMLElement(offsetParent)) {
        offsets = getBoundingClientRect(offsetParent);
        offsets.x += offsetParent.clientLeft;
        offsets.y += offsetParent.clientTop;
      } else if (documentElement) {
        offsets.x = getWindowScrollBarX(documentElement);
      }
    }
    return {
      x: rect.left + scroll.scrollLeft - offsets.x,
      y: rect.top + scroll.scrollTop - offsets.y,
      width: rect.width,
      height: rect.height
    };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getLayoutRect.js
  function getLayoutRect(element) {
    return {
      x: element.offsetLeft,
      y: element.offsetTop,
      width: element.offsetWidth,
      height: element.offsetHeight
    };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getParentNode.js
  function getParentNode(element) {
    if (getNodeName(element) === "html") {
      return element;
    }
    return (
      // $FlowFixMe: this is a quicker (but less type safe) way to save quite some bytes from the bundle
      element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
      element.parentNode || // DOM Element detected
      // $FlowFixMe: need a better way to handle this...
      element.host || // ShadowRoot detected
      // $FlowFixMe: HTMLElement is a Node
      getDocumentElement(element)
    );
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getScrollParent.js
  function getScrollParent(node) {
    if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
      return node.ownerDocument.body;
    }
    if (isHTMLElement(node) && isScrollParent(node)) {
      return node;
    }
    return getScrollParent(getParentNode(node));
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/listScrollParents.js
  function listScrollParents(element, list = []) {
    const scrollParent = getScrollParent(element);
    const isBody = getNodeName(scrollParent) === "body";
    const win = getWindow(scrollParent);
    const target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
    const updatedList = list.concat(target);
    return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target)));
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/isTableElement.js
  function isTableElement(element) {
    return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getOffsetParent.js
  function getTrueOffsetParent(element) {
    if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
    getComputedStyle2(element).position === "fixed") {
      return null;
    }
    const offsetParent = element.offsetParent;
    if (offsetParent) {
      const html = getDocumentElement(offsetParent);
      if (getNodeName(offsetParent) === "body" && getComputedStyle2(offsetParent).position === "static" && getComputedStyle2(html).position !== "static") {
        return html;
      }
    }
    return offsetParent;
  }
  function getContainingBlock(element) {
    let currentNode = getParentNode(element);
    while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
      const css2 = getComputedStyle2(currentNode);
      if (css2.transform !== "none" || css2.perspective !== "none" || css2.willChange && css2.willChange !== "auto") {
        return currentNode;
      } else {
        currentNode = currentNode.parentNode;
      }
    }
    return null;
  }
  function getOffsetParent(element) {
    const window2 = getWindow(element);
    let offsetParent = getTrueOffsetParent(element);
    while (offsetParent && isTableElement(offsetParent) && getComputedStyle2(offsetParent).position === "static") {
      offsetParent = getTrueOffsetParent(offsetParent);
    }
    if (offsetParent && getNodeName(offsetParent) === "body" && getComputedStyle2(offsetParent).position === "static") {
      return window2;
    }
    return offsetParent || getContainingBlock(element) || window2;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/enums.js
  var top = "top";
  var bottom = "bottom";
  var right = "right";
  var left = "left";
  var auto = "auto";
  var basePlacements = [top, bottom, right, left];
  var start = "start";
  var end = "end";
  var clippingParents = "clippingParents";
  var viewport = "viewport";
  var popper = "popper";
  var reference = "reference";
  var variationPlacements = basePlacements.reduce((acc, placement) => acc.concat([`${placement}-${start}`, `${placement}-${end}`]), []);
  var placements = [...basePlacements, auto].reduce((acc, placement) => acc.concat([placement, `${placement}-${start}`, `${placement}-${end}`]), []);
  var beforeRead = "beforeRead";
  var read = "read";
  var afterRead = "afterRead";
  var beforeMain = "beforeMain";
  var main = "main";
  var afterMain = "afterMain";
  var beforeWrite = "beforeWrite";
  var write = "write";
  var afterWrite = "afterWrite";
  var modifierPhases = [
    beforeRead,
    read,
    afterRead,
    beforeMain,
    main,
    afterMain,
    beforeWrite,
    write,
    afterWrite
  ];

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/orderModifiers.js
  function order(modifiers) {
    const map2 = /* @__PURE__ */ new Map();
    const visited = /* @__PURE__ */ new Set();
    const result = [];
    modifiers.forEach((modifier) => {
      map2.set(modifier.name, modifier);
    });
    function sort(modifier) {
      visited.add(modifier.name);
      const requires = [...modifier.requires || [], ...modifier.requiresIfExists || []];
      requires.forEach((dep) => {
        if (!visited.has(dep)) {
          const depModifier = map2.get(dep);
          if (depModifier) {
            sort(depModifier);
          }
        }
      });
      result.push(modifier);
    }
    modifiers.forEach((modifier) => {
      if (!visited.has(modifier.name)) {
        sort(modifier);
      }
    });
    return result;
  }
  function orderModifiers(modifiers) {
    const orderedModifiers = order(modifiers);
    return modifierPhases.reduce((acc, phase) => acc.concat(orderedModifiers.filter((modifier) => modifier.phase === phase)), []);
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/debounce.js
  function debounce2(fn) {
    let pending;
    return () => {
      if (!pending) {
        pending = new Promise((resolve) => {
          Promise.resolve().then(() => {
            pending = void 0;
            resolve(fn());
          });
        });
      }
      return pending;
    };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/getBasePlacement.js
  function getBasePlacement(placement) {
    return placement.split("-")[0];
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/mergeByName.js
  function mergeByName(modifiers) {
    const merged = modifiers.reduce((merged2, current) => {
      const existing = merged2[current.name];
      merged2[current.name] = existing ? Object.assign(Object.assign(Object.assign({}, existing), current), { options: Object.assign(Object.assign({}, existing.options), current.options), data: Object.assign(Object.assign({}, existing.data), current.data) }) : current;
      return merged2;
    }, {});
    return Object.keys(merged).map((key) => merged[key]);
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getViewportRect.js
  function getViewportRect(element) {
    const win = getWindow(element);
    const html = getDocumentElement(element);
    const visualViewport = win.visualViewport;
    let width = html.clientWidth;
    let height = html.clientHeight;
    let x2 = 0;
    let y2 = 0;
    if (visualViewport) {
      width = visualViewport.width;
      height = visualViewport.height;
      if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
        x2 = visualViewport.offsetLeft;
        y2 = visualViewport.offsetTop;
      }
    }
    return {
      width,
      height,
      x: x2 + getWindowScrollBarX(element),
      y: y2
    };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getDocumentRect.js
  function getDocumentRect(element) {
    const html = getDocumentElement(element);
    const winScroll = getWindowScroll(element);
    const body = element.ownerDocument.body;
    const width = Math.max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
    const height = Math.max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
    let x2 = -winScroll.scrollLeft + getWindowScrollBarX(element);
    const y2 = -winScroll.scrollTop;
    if (getComputedStyle2(body || html).direction === "rtl") {
      x2 += Math.max(html.clientWidth, body ? body.clientWidth : 0) - width;
    }
    return { width, height, x: x2, y: y2 };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/contains.js
  function contains(parent2, child) {
    const isShadow = Boolean(child.getRootNode && child.getRootNode().host);
    if (parent2.contains(child)) {
      return true;
    } else if (isShadow) {
      let next = child;
      do {
        if (next && parent2.isSameNode(next)) {
          return true;
        }
        next = next.parentNode || next.host;
      } while (next);
    }
    return false;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/rectToClientRect.js
  function rectToClientRect(rect) {
    return Object.assign(Object.assign({}, rect), { left: rect.x, top: rect.y, right: rect.x + rect.width, bottom: rect.y + rect.height });
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/dom-utils/getClippingRect.js
  function getInnerBoundingClientRect(element) {
    const rect = getBoundingClientRect(element);
    rect.top = rect.top + element.clientTop;
    rect.left = rect.left + element.clientLeft;
    rect.bottom = rect.top + element.clientHeight;
    rect.right = rect.left + element.clientWidth;
    rect.width = element.clientWidth;
    rect.height = element.clientHeight;
    rect.x = rect.left;
    rect.y = rect.top;
    return rect;
  }
  function getClientRectFromMixedType(element, clippingParent) {
    return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
  }
  function getClippingParents(element) {
    const clippingParents2 = listScrollParents(getParentNode(element));
    const canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle2(element).position) >= 0;
    const clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
    if (!isElement(clipperElement)) {
      return [];
    }
    return clippingParents2.filter((clippingParent) => isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body");
  }
  function getClippingRect(element, boundary, rootBoundary) {
    const mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
    const clippingParents2 = [...mainClippingParents, rootBoundary];
    const firstClippingParent = clippingParents2[0];
    const clippingRect = clippingParents2.reduce((accRect, clippingParent) => {
      const rect = getClientRectFromMixedType(element, clippingParent);
      accRect.top = Math.max(rect.top, accRect.top);
      accRect.right = Math.min(rect.right, accRect.right);
      accRect.bottom = Math.min(rect.bottom, accRect.bottom);
      accRect.left = Math.max(rect.left, accRect.left);
      return accRect;
    }, getClientRectFromMixedType(element, firstClippingParent));
    clippingRect.width = clippingRect.right - clippingRect.left;
    clippingRect.height = clippingRect.bottom - clippingRect.top;
    clippingRect.x = clippingRect.left;
    clippingRect.y = clippingRect.top;
    return clippingRect;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/getVariation.js
  function getVariation(placement) {
    return placement.split("-")[1];
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/getMainAxisFromPlacement.js
  function getMainAxisFromPlacement(placement) {
    return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/computeOffsets.js
  function computeOffsets({ reference: reference2, element, placement }) {
    const basePlacement = placement ? getBasePlacement(placement) : null;
    const variation = placement ? getVariation(placement) : null;
    const commonX = reference2.x + reference2.width / 2 - element.width / 2;
    const commonY = reference2.y + reference2.height / 2 - element.height / 2;
    let offsets;
    switch (basePlacement) {
      case top:
        offsets = {
          x: commonX,
          y: reference2.y - element.height
        };
        break;
      case bottom:
        offsets = {
          x: commonX,
          y: reference2.y + reference2.height
        };
        break;
      case right:
        offsets = {
          x: reference2.x + reference2.width,
          y: commonY
        };
        break;
      case left:
        offsets = {
          x: reference2.x - element.width,
          y: commonY
        };
        break;
      default:
        offsets = {
          x: reference2.x,
          y: reference2.y
        };
    }
    const mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
    if (mainAxis != null) {
      const len = mainAxis === "y" ? "height" : "width";
      switch (variation) {
        case start:
          offsets[mainAxis] = Math.floor(offsets[mainAxis]) - Math.floor(reference2[len] / 2 - element[len] / 2);
          break;
        case end:
          offsets[mainAxis] = Math.floor(offsets[mainAxis]) + Math.ceil(reference2[len] / 2 - element[len] / 2);
          break;
        default:
      }
    }
    return offsets;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/getFreshSideObject.js
  function getFreshSideObject() {
    return {
      top: 0,
      right: 0,
      bottom: 0,
      left: 0
    };
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/mergePaddingObject.js
  function mergePaddingObject(paddingObject) {
    return Object.assign(Object.assign({}, getFreshSideObject()), paddingObject);
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/expandToHashMap.js
  function expandToHashMap(value, keys) {
    return keys.reduce((hashMap, key) => {
      hashMap[key] = value;
      return hashMap;
    }, {});
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/detectOverflow.js
  function detectOverflow(state, options5 = {}) {
    const { placement = state.placement, boundary = clippingParents, rootBoundary = viewport, elementContext = popper, altBoundary = false, padding: padding3 = 0 } = options5;
    const paddingObject = mergePaddingObject(typeof padding3 !== "number" ? padding3 : expandToHashMap(padding3, basePlacements));
    const altContext = elementContext === popper ? reference : popper;
    const referenceElement = state.elements.reference;
    const popperRect = state.rects.popper;
    const element = state.elements[altBoundary ? altContext : elementContext];
    const clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
    const referenceClientRect = getBoundingClientRect(referenceElement);
    const popperOffsets2 = computeOffsets({
      reference: referenceClientRect,
      element: popperRect,
      strategy: "absolute",
      placement
    });
    const popperClientRect = rectToClientRect(Object.assign(Object.assign({}, popperRect), popperOffsets2));
    const elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
    const overflowOffsets = {
      top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
      bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
      left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
      right: elementClientRect.right - clippingClientRect.right + paddingObject.right
    };
    const offsetData = state.modifiersData.offset;
    if (elementContext === popper && offsetData) {
      const offset2 = offsetData[placement];
      Object.keys(overflowOffsets).forEach((key) => {
        const multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
        const axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x";
        overflowOffsets[key] += offset2[axis] * multiply;
      });
    }
    return overflowOffsets;
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/index.js
  var DEFAULT_OPTIONS = {
    placement: "bottom",
    modifiers: [],
    strategy: "absolute"
  };
  function areValidElements(...args) {
    return !args.some((element) => !(element && typeof element.getBoundingClientRect === "function"));
  }
  function popperGenerator(generatorOptions = {}) {
    const { defaultModifiers: defaultModifiers2 = [], defaultOptions = DEFAULT_OPTIONS } = generatorOptions;
    return function createPopper3(reference2, popper2, options5 = defaultOptions) {
      let state = {
        placement: "bottom",
        orderedModifiers: [],
        options: Object.assign(Object.assign({}, DEFAULT_OPTIONS), defaultOptions),
        modifiersData: {},
        elements: {
          reference: reference2,
          popper: popper2
        },
        attributes: {},
        styles: {}
      };
      let effectCleanupFns = [];
      let isDestroyed = false;
      const instance = {
        state,
        setOptions(options6) {
          cleanupModifierEffects();
          state.options = Object.assign(Object.assign(Object.assign({}, defaultOptions), state.options), options6);
          state.scrollParents = {
            reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
            popper: listScrollParents(popper2)
          };
          const orderedModifiers = orderModifiers(mergeByName([...defaultModifiers2, ...state.options.modifiers]));
          state.orderedModifiers = orderedModifiers.filter((m) => m.enabled);
          if (false) {
            const modifiers = uniqueBy([...orderedModifiers, ...state.options.modifiers], ({ name: name2 }) => name2);
            validateModifiers(modifiers);
            if (getBasePlacement(state.options.placement) === auto) {
              const flipModifier = state.orderedModifiers.find(({ name: name2 }) => name2 === "flip");
              if (!flipModifier) {
                console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" "));
              }
            }
            const { marginTop, marginRight, marginBottom, marginLeft } = getComputedStyle2(popper2);
            if ([marginTop, marginRight, marginBottom, marginLeft].some((margin) => parseFloat(margin))) {
              console.warn([
                'Popper: CSS "margin" styles cannot be used to apply padding',
                "between the popper and its reference element or boundary.",
                "To replicate margin, use the `offset` modifier, as well as",
                "the `padding` option in the `preventOverflow` and `flip`",
                "modifiers."
              ].join(" "));
            }
          }
          runModifierEffects();
          return instance.update();
        },
        // Sync update – it will always be executed, even if not necessary. This
        // is useful for low frequency updates where sync behavior simplifies the
        // logic.
        // For high frequency updates (e.g. `resize` and `scroll` events), always
        // prefer the async Popper#update method
        forceUpdate() {
          if (isDestroyed) {
            return;
          }
          const { reference: reference3, popper: popper3 } = state.elements;
          if (!areValidElements(reference3, popper3)) {
            if (false) {
              console.error(INVALID_ELEMENT_ERROR);
            }
            return;
          }
          state.rects = {
            reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"),
            popper: getLayoutRect(popper3)
          };
          state.reset = false;
          state.placement = state.options.placement;
          state.orderedModifiers.forEach((modifier) => state.modifiersData[modifier.name] = Object.assign({}, modifier.data));
          let __debug_loops__ = 0;
          for (let index = 0; index < state.orderedModifiers.length; index++) {
            if (false) {
              __debug_loops__ += 1;
              if (__debug_loops__ > 100) {
                console.error(INFINITE_LOOP_ERROR);
                break;
              }
            }
            if (state.reset === true) {
              state.reset = false;
              index = -1;
              continue;
            }
            const { fn, options: options6 = {}, name: name2 } = state.orderedModifiers[index];
            if (typeof fn === "function") {
              state = fn({ state, options: options6, name: name2, instance }) || state;
            }
          }
        },
        // Async and optimistically optimized update – it will not be executed if
        // not necessary (debounced to run at most once-per-tick)
        update: debounce2(() => new Promise((resolve) => {
          instance.forceUpdate();
          resolve(state);
        })),
        destroy() {
          cleanupModifierEffects();
          isDestroyed = true;
        }
      };
      if (!areValidElements(reference2, popper2)) {
        if (false) {
          console.error(INVALID_ELEMENT_ERROR);
        }
        return instance;
      }
      instance.setOptions(options5).then((state2) => {
        if (!isDestroyed && options5.onFirstUpdate) {
          options5.onFirstUpdate(state2);
        }
      });
      function runModifierEffects() {
        state.orderedModifiers.forEach(({ name: name2, options: options6 = {}, effect: effect4 }) => {
          if (typeof effect4 === "function") {
            const cleanupFn = effect4({ state, name: name2, instance, options: options6 });
            const noopFn = () => {
            };
            effectCleanupFns.push(cleanupFn || noopFn);
          }
        });
      }
      function cleanupModifierEffects() {
        effectCleanupFns.forEach((fn) => fn());
        effectCleanupFns = [];
      }
      return instance;
    };
  }
  var createPopper = popperGenerator();

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/eventListeners.js
  var passive = { passive: true };
  function effect({ state, instance, options: options5 }) {
    const { scroll = true, resize = true } = options5;
    const window2 = getWindow(state.elements.popper);
    const scrollParents = [...state.scrollParents.reference, ...state.scrollParents.popper];
    if (scroll) {
      scrollParents.forEach((scrollParent) => {
        scrollParent.addEventListener("scroll", instance.update, passive);
      });
    }
    if (resize) {
      window2.addEventListener("resize", instance.update, passive);
    }
    return () => {
      if (scroll) {
        scrollParents.forEach((scrollParent) => {
          scrollParent.removeEventListener("scroll", instance.update, passive);
        });
      }
      if (resize) {
        window2.removeEventListener("resize", instance.update, passive);
      }
    };
  }
  var eventListeners_default = {
    name: "eventListeners",
    enabled: true,
    phase: "write",
    fn: () => {
    },
    effect,
    data: {}
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/popperOffsets.js
  function popperOffsets({ state, name: name2 }) {
    state.modifiersData[name2] = computeOffsets({
      reference: state.rects.reference,
      element: state.rects.popper,
      strategy: "absolute",
      placement: state.placement
    });
  }
  var popperOffsets_default = {
    name: "popperOffsets",
    enabled: true,
    phase: "read",
    fn: popperOffsets,
    data: {}
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/computeStyles.js
  var unsetSides = {
    top: "auto",
    right: "auto",
    bottom: "auto",
    left: "auto"
  };
  function roundOffsets({ x: x2, y: y2 }) {
    const win = window;
    const dpr = win.devicePixelRatio || 1;
    return {
      x: Math.round(x2 * dpr) / dpr || 0,
      y: Math.round(y2 * dpr) / dpr || 0
    };
  }
  function mapToStyles({ popper: popper2, popperRect, placement, offsets, position, gpuAcceleration, adaptive }) {
    let { x: x2, y: y2 } = roundOffsets(offsets);
    const hasX = offsets.hasOwnProperty("x");
    const hasY = offsets.hasOwnProperty("y");
    let sideX = left;
    let sideY = top;
    const win = window;
    if (adaptive) {
      let offsetParent = getOffsetParent(popper2);
      if (offsetParent === getWindow(popper2)) {
        offsetParent = getDocumentElement(popper2);
      }
      if (placement === top) {
        sideY = bottom;
        y2 -= offsetParent.clientHeight - popperRect.height;
        y2 *= gpuAcceleration ? 1 : -1;
      }
      if (placement === left) {
        sideX = right;
        x2 -= offsetParent.clientWidth - popperRect.width;
        x2 *= gpuAcceleration ? 1 : -1;
      }
    }
    const commonStyles = Object.assign({ position }, adaptive && unsetSides);
    if (gpuAcceleration) {
      return Object.assign(Object.assign({}, commonStyles), {
        [sideY]: hasY ? "0" : "",
        [sideX]: hasX ? "0" : "",
        // Layer acceleration can disable subpixel rendering which causes slightly
        // blurry text on low PPI displays, so we want to use 2D transforms
        // instead
        transform: (win.devicePixelRatio || 1) < 2 ? `translate(${x2}px, ${y2}px)` : `translate3d(${x2}px, ${y2}px, 0)`
      });
    }
    return Object.assign(Object.assign({}, commonStyles), { [sideY]: hasY ? `${y2}px` : "", [sideX]: hasX ? `${x2}px` : "", transform: "" });
  }
  function computeStyles({ state, options: options5 }) {
    const { gpuAcceleration = true, adaptive = true } = options5;
    if (false) {
      const transitionProperty = getComputedStyle2(state.elements.popper).transitionProperty || "";
      if (adaptive && ["transform", "top", "right", "bottom", "left"].some((property3) => transitionProperty.indexOf(property3) >= 0)) {
        console.warn([
          "Popper: Detected CSS transitions on at least one of the following",
          'CSS properties: "transform", "top", "right", "bottom", "left".',
          "\n\n",
          'Disable the "computeStyles" modifier\'s `adaptive` option to allow',
          "for smooth transitions, or remove these properties from the CSS",
          "transition declaration on the popper element if only transitioning",
          "opacity or background-color for example.",
          "\n\n",
          "We recommend using the popper element as a wrapper around an inner",
          "element that can have any CSS property transitioned for animations."
        ].join(" "));
      }
    }
    const commonStyles = {
      placement: getBasePlacement(state.placement),
      popper: state.elements.popper,
      popperRect: state.rects.popper,
      gpuAcceleration
    };
    if (state.modifiersData.popperOffsets != null) {
      state.styles.popper = Object.assign(Object.assign({}, state.styles.popper), mapToStyles(Object.assign(Object.assign({}, commonStyles), { offsets: state.modifiersData.popperOffsets, position: state.options.strategy, adaptive })));
    }
    if (state.modifiersData.arrow != null) {
      state.styles.arrow = Object.assign(Object.assign({}, state.styles.arrow), mapToStyles(Object.assign(Object.assign({}, commonStyles), { offsets: state.modifiersData.arrow, position: "absolute", adaptive: false })));
    }
    state.attributes.popper = Object.assign(Object.assign({}, state.attributes.popper), { "data-popper-placement": state.placement });
  }
  var computeStyles_default = {
    name: "computeStyles",
    enabled: true,
    phase: "beforeWrite",
    fn: computeStyles,
    data: {}
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/applyStyles.js
  function applyStyles({ state }) {
    Object.keys(state.elements).forEach((name2) => {
      const style = state.styles[name2] || {};
      const attributes = state.attributes[name2] || {};
      const element = state.elements[name2];
      if (!isHTMLElement(element) || !getNodeName(element)) {
        return;
      }
      Object.assign(element.style, style);
      Object.keys(attributes).forEach((name3) => {
        const value = attributes[name3];
        if (value === false) {
          element.removeAttribute(name3);
        } else {
          element.setAttribute(name3, value === true ? "" : value);
        }
      });
    });
  }
  function effect2({ state }) {
    const initialStyles = {
      popper: {
        position: state.options.strategy,
        left: "0",
        top: "0",
        margin: "0"
      },
      arrow: {
        position: "absolute"
      },
      reference: {}
    };
    Object.assign(state.elements.popper.style, initialStyles.popper);
    if (state.elements.arrow) {
      Object.assign(state.elements.arrow.style, initialStyles.arrow);
    }
    return () => {
      Object.keys(state.elements).forEach((name2) => {
        const element = state.elements[name2];
        const attributes = state.attributes[name2] || {};
        const styleProperties = Object.keys(state.styles.hasOwnProperty(name2) ? state.styles[name2] : initialStyles[name2]);
        const style = styleProperties.reduce((style2, property3) => {
          style2[property3] = "";
          return style2;
        }, {});
        if (!isHTMLElement(element) || !getNodeName(element)) {
          return;
        }
        Object.assign(element.style, style);
        Object.keys(attributes).forEach((attribute) => {
          element.removeAttribute(attribute);
        });
      });
    };
  }
  var applyStyles_default = {
    name: "applyStyles",
    enabled: true,
    phase: "write",
    fn: applyStyles,
    effect: effect2,
    requires: ["computeStyles"]
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/offset.js
  function distanceAndSkiddingToXY(placement, rects, offset2) {
    const basePlacement = getBasePlacement(placement);
    const invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
    let [skidding, distance] = typeof offset2 === "function" ? offset2(Object.assign(Object.assign({}, rects), { placement })) : offset2;
    skidding = skidding || 0;
    distance = (distance || 0) * invertDistance;
    return [left, right].indexOf(basePlacement) >= 0 ? { x: distance, y: skidding } : { x: skidding, y: distance };
  }
  function offset({ state, options: options5, name: name2 }) {
    const { offset: offset2 = [0, 0] } = options5;
    const data = placements.reduce((acc, placement) => {
      acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
      return acc;
    }, {});
    const { x: x2, y: y2 } = data[state.placement];
    if (state.modifiersData.popperOffsets != null) {
      state.modifiersData.popperOffsets.x += x2;
      state.modifiersData.popperOffsets.y += y2;
    }
    state.modifiersData[name2] = data;
  }
  var offset_default = {
    name: "offset",
    enabled: true,
    phase: "main",
    requires: ["popperOffsets"],
    fn: offset
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/getOppositePlacement.js
  var hash = { left: "right", right: "left", bottom: "top", top: "bottom" };
  function getOppositePlacement(placement) {
    return placement.replace(/left|right|bottom|top/g, (matched) => hash[matched]);
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/getOppositeVariationPlacement.js
  var hash2 = { start: "end", end: "start" };
  function getOppositeVariationPlacement(placement) {
    return placement.replace(/start|end/g, (matched) => hash2[matched]);
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/computeAutoPlacement.js
  function computeAutoPlacement(state, options5 = {}) {
    const { placement, boundary, rootBoundary, padding: padding3, flipVariations, allowedAutoPlacements = placements } = options5;
    const variation = getVariation(placement);
    const placements2 = variation ? flipVariations ? variationPlacements : variationPlacements.filter((placement2) => getVariation(placement2) === variation) : basePlacements;
    let allowedPlacements = placements2.filter((placement2) => allowedAutoPlacements.indexOf(placement2) >= 0);
    if (allowedPlacements.length === 0) {
      allowedPlacements = placements2;
      if (false) {
        console.error([
          "Popper: The `allowedAutoPlacements` option did not allow any",
          "placements. Ensure the `placement` option matches the variation",
          "of the allowed placements.",
          'For example, "auto" cannot be used to allow "bottom-start".',
          'Use "auto-start" instead.'
        ].join(" "));
      }
    }
    const overflows = allowedPlacements.reduce((acc, placement2) => {
      acc[placement2] = detectOverflow(state, {
        placement: placement2,
        boundary,
        rootBoundary,
        padding: padding3
      })[getBasePlacement(placement2)];
      return acc;
    }, {});
    return Object.keys(overflows).sort((a2, b) => overflows[a2] - overflows[b]);
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/flip.js
  function getExpandedFallbackPlacements(placement) {
    if (getBasePlacement(placement) === auto) {
      return [];
    }
    const oppositePlacement = getOppositePlacement(placement);
    return [
      getOppositeVariationPlacement(placement),
      oppositePlacement,
      getOppositeVariationPlacement(oppositePlacement)
    ];
  }
  function flip({ state, options: options5, name: name2 }) {
    if (state.modifiersData[name2]._skip) {
      return;
    }
    const { mainAxis: checkMainAxis = true, altAxis: checkAltAxis = true, fallbackPlacements: specifiedFallbackPlacements, padding: padding3, boundary, rootBoundary, altBoundary, flipVariations = true, allowedAutoPlacements } = options5;
    const preferredPlacement = state.options.placement;
    const basePlacement = getBasePlacement(preferredPlacement);
    const isBasePlacement = basePlacement === preferredPlacement;
    const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
    const placements2 = [preferredPlacement, ...fallbackPlacements].reduce((acc, placement) => acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
      placement,
      boundary,
      rootBoundary,
      padding: padding3,
      flipVariations,
      allowedAutoPlacements
    }) : placement), []);
    const referenceRect = state.rects.reference;
    const popperRect = state.rects.popper;
    const checksMap = /* @__PURE__ */ new Map();
    let makeFallbackChecks = true;
    let firstFittingPlacement = placements2[0];
    for (let i = 0; i < placements2.length; i++) {
      const placement = placements2[i];
      const basePlacement2 = getBasePlacement(placement);
      const isStartVariation = getVariation(placement) === start;
      const isVertical2 = [top, bottom].indexOf(basePlacement2) >= 0;
      const len = isVertical2 ? "width" : "height";
      const overflow = detectOverflow(state, {
        placement,
        boundary,
        rootBoundary,
        altBoundary,
        padding: padding3
      });
      let mainVariationSide = isVertical2 ? isStartVariation ? right : left : isStartVariation ? bottom : top;
      if (referenceRect[len] > popperRect[len]) {
        mainVariationSide = getOppositePlacement(mainVariationSide);
      }
      const altVariationSide = getOppositePlacement(mainVariationSide);
      const checks = [];
      if (checkMainAxis) {
        checks.push(overflow[basePlacement2] <= 0);
      }
      if (checkAltAxis) {
        checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
      }
      if (checks.every((check) => check)) {
        firstFittingPlacement = placement;
        makeFallbackChecks = false;
        break;
      }
      checksMap.set(placement, checks);
    }
    if (makeFallbackChecks) {
      const numberOfChecks = flipVariations ? 3 : 1;
      for (let i = numberOfChecks; i > 0; i--) {
        const fittingPlacement = placements2.find((placement) => {
          const checks = checksMap.get(placement);
          if (checks) {
            return checks.slice(0, i).every((check) => check);
          }
        });
        if (fittingPlacement) {
          firstFittingPlacement = fittingPlacement;
          break;
        }
      }
    }
    if (state.placement !== firstFittingPlacement) {
      state.modifiersData[name2]._skip = true;
      state.placement = firstFittingPlacement;
      state.reset = true;
    }
  }
  var flip_default = {
    name: "flip",
    enabled: true,
    phase: "main",
    fn: flip,
    requiresIfExists: ["offset"],
    data: { _skip: false }
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/getAltAxis.js
  function getAltAxis(axis) {
    return axis === "x" ? "y" : "x";
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/utils/within.js
  function within(min3, value, max3) {
    return Math.max(min3, Math.min(value, max3));
  }

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/preventOverflow.js
  function preventOverflow({ state, options: options5, name: name2 }) {
    const { mainAxis: checkMainAxis = true, altAxis: checkAltAxis = false, boundary, rootBoundary, altBoundary, padding: padding3, tether = true, tetherOffset = 0 } = options5;
    const overflow = detectOverflow(state, {
      boundary,
      rootBoundary,
      padding: padding3,
      altBoundary
    });
    const basePlacement = getBasePlacement(state.placement);
    const variation = getVariation(state.placement);
    const isBasePlacement = !variation;
    const mainAxis = getMainAxisFromPlacement(basePlacement);
    const altAxis = getAltAxis(mainAxis);
    const popperOffsets2 = state.modifiersData.popperOffsets;
    const referenceRect = state.rects.reference;
    const popperRect = state.rects.popper;
    const tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign(Object.assign({}, state.rects), { placement: state.placement })) : tetherOffset;
    const data = { x: 0, y: 0 };
    if (!popperOffsets2) {
      return;
    }
    if (checkMainAxis) {
      const mainSide = mainAxis === "y" ? top : left;
      const altSide = mainAxis === "y" ? bottom : right;
      const len = mainAxis === "y" ? "height" : "width";
      const offset2 = popperOffsets2[mainAxis];
      const min3 = popperOffsets2[mainAxis] + overflow[mainSide];
      const max3 = popperOffsets2[mainAxis] - overflow[altSide];
      const additive = tether ? -popperRect[len] / 2 : 0;
      const minLen = variation === start ? referenceRect[len] : popperRect[len];
      const maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
      const arrowElement = state.elements.arrow;
      const arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { width: 0, height: 0 };
      const arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject();
      const arrowPaddingMin = arrowPaddingObject[mainSide];
      const arrowPaddingMax = arrowPaddingObject[altSide];
      const arrowLen = within(0, referenceRect[len], arrowRect[len]);
      const minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
      const maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;
      const arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
      const clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
      const offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
      const tetherMin = popperOffsets2[mainAxis] + minOffset - offsetModifierValue - clientOffset;
      const tetherMax = popperOffsets2[mainAxis] + maxOffset - offsetModifierValue;
      const preventedOffset = within(tether ? Math.min(min3, tetherMin) : min3, offset2, tether ? Math.max(max3, tetherMax) : max3);
      popperOffsets2[mainAxis] = preventedOffset;
      data[mainAxis] = preventedOffset - offset2;
    }
    if (checkAltAxis) {
      const mainSide = mainAxis === "x" ? top : left;
      const altSide = mainAxis === "x" ? bottom : right;
      const offset2 = popperOffsets2[altAxis];
      const min3 = offset2 + overflow[mainSide];
      const max3 = offset2 - overflow[altSide];
      const preventedOffset = within(min3, offset2, max3);
      popperOffsets2[altAxis] = preventedOffset;
      data[altAxis] = preventedOffset - offset2;
    }
    state.modifiersData[name2] = data;
  }
  var preventOverflow_default = {
    name: "preventOverflow",
    enabled: true,
    phase: "main",
    fn: preventOverflow,
    requiresIfExists: ["offset"]
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/arrow.js
  function arrow({ state, name: name2 }) {
    const arrowElement = state.elements.arrow;
    const popperOffsets2 = state.modifiersData.popperOffsets;
    const basePlacement = getBasePlacement(state.placement);
    const axis = getMainAxisFromPlacement(basePlacement);
    const isVertical2 = [left, right].indexOf(basePlacement) >= 0;
    const len = isVertical2 ? "height" : "width";
    if (!arrowElement || !popperOffsets2) {
      return;
    }
    const paddingObject = state.modifiersData[`${name2}#persistent`].padding;
    const arrowRect = getLayoutRect(arrowElement);
    const minProp = axis === "y" ? top : left;
    const maxProp = axis === "y" ? bottom : right;
    const endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len];
    const startDiff = popperOffsets2[axis] - state.rects.reference[axis];
    const arrowOffsetParent = getOffsetParent(arrowElement);
    const clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
    const centerToReference = endDiff / 2 - startDiff / 2;
    const min3 = paddingObject[minProp];
    const max3 = clientSize - arrowRect[len] - paddingObject[maxProp];
    const center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
    const offset2 = within(min3, center, max3);
    const axisProp = axis;
    state.modifiersData[name2] = {
      [axisProp]: offset2,
      centerOffset: offset2 - center
    };
  }
  function effect3({ state, options: options5, name: name2 }) {
    let { element: arrowElement = "[data-popper-arrow]", padding: padding3 = 0 } = options5;
    if (arrowElement == null) {
      return;
    }
    if (typeof arrowElement === "string") {
      arrowElement = state.elements.popper.querySelector(arrowElement);
      if (!arrowElement) {
        return;
      }
    }
    if (false) {
      if (!isHTMLElement(arrowElement)) {
        console.error([
          'Popper: "arrow" element must be an HTMLElement (not an SVGElement).',
          "To use an SVG arrow, wrap it in an HTMLElement that will be used as",
          "the arrow."
        ].join(" "));
      }
    }
    if (!contains(state.elements.popper, arrowElement)) {
      if (false) {
        console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', "element."].join(" "));
      }
      return;
    }
    state.elements.arrow = arrowElement;
    state.modifiersData[`${name2}#persistent`] = {
      padding: mergePaddingObject(typeof padding3 !== "number" ? padding3 : expandToHashMap(padding3, basePlacements))
    };
  }
  var arrow_default = {
    name: "arrow",
    enabled: true,
    phase: "main",
    fn: arrow,
    effect: effect3,
    requires: ["popperOffsets"],
    requiresIfExists: ["preventOverflow"]
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/modifiers/hide.js
  function getSideOffsets(overflow, rect, preventedOffsets = { x: 0, y: 0 }) {
    return {
      top: overflow.top - rect.height - preventedOffsets.y,
      right: overflow.right - rect.width + preventedOffsets.x,
      bottom: overflow.bottom - rect.height + preventedOffsets.y,
      left: overflow.left - rect.width - preventedOffsets.x
    };
  }
  function isAnySideFullyClipped(overflow) {
    return [top, right, bottom, left].some((side) => overflow[side] >= 0);
  }
  function hide({ state, name: name2 }) {
    const referenceRect = state.rects.reference;
    const popperRect = state.rects.popper;
    const preventedOffsets = state.modifiersData.preventOverflow;
    const referenceOverflow = detectOverflow(state, {
      elementContext: "reference"
    });
    const popperAltOverflow = detectOverflow(state, {
      altBoundary: true
    });
    const referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
    const popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
    const isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
    const hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
    state.modifiersData[name2] = {
      referenceClippingOffsets,
      popperEscapeOffsets,
      isReferenceHidden,
      hasPopperEscaped
    };
    state.attributes.popper = Object.assign(Object.assign({}, state.attributes.popper), { "data-popper-reference-hidden": isReferenceHidden, "data-popper-escaped": hasPopperEscaped });
  }
  var hide_default = {
    name: "hide",
    enabled: true,
    phase: "main",
    requiresIfExists: ["preventOverflow"],
    fn: hide
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/popper.js
  var defaultModifiers = [
    eventListeners_default,
    popperOffsets_default,
    computeStyles_default,
    applyStyles_default,
    offset_default,
    flip_default,
    preventOverflow_default,
    arrow_default,
    hide_default
  ];
  var createPopper2 = popperGenerator({ defaultModifiers });

  // node_modules/@patternfly/react-core/dist/esm/helpers/useIsomorphicLayout.js
  var React3 = __toESM(require_react());
  var useIsomorphicLayoutEffect = canUseDOM ? React3.useLayoutEffect : React3.useEffect;

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/react-popper/usePopper.js
  var isEqual = (a2, b) => JSON.stringify(a2) === JSON.stringify(b);
  var fromEntries = (entries) => entries.reduce((acc, [key, value]) => {
    acc[key] = value;
    return acc;
  }, {});
  var EMPTY_MODIFIERS = [];
  var usePopper = (referenceElement, popperElement, options5 = {}) => {
    const prevOptions = React4.useRef(null);
    const optionsWithDefaults = {
      onFirstUpdate: options5.onFirstUpdate,
      placement: options5.placement || "bottom",
      strategy: options5.strategy || "absolute",
      modifiers: options5.modifiers || EMPTY_MODIFIERS
    };
    const [state, setState] = React4.useState({
      styles: {
        popper: {
          position: optionsWithDefaults.strategy,
          left: "0",
          top: "0"
        }
      },
      attributes: {}
    });
    const updateStateModifier = React4.useMemo(() => ({
      name: "updateState",
      enabled: true,
      phase: "write",
      // eslint-disable-next-line no-shadow
      fn: ({ state: state2 }) => {
        const elements = Object.keys(state2.elements);
        setState({
          styles: fromEntries(elements.map((element) => [element, state2.styles[element] || {}])),
          attributes: fromEntries(elements.map((element) => [element, state2.attributes[element]]))
        });
      },
      requires: ["computeStyles"]
    }), []);
    const popperOptions = React4.useMemo(() => {
      const newOptions = {
        onFirstUpdate: optionsWithDefaults.onFirstUpdate,
        placement: optionsWithDefaults.placement,
        strategy: optionsWithDefaults.strategy,
        modifiers: [...optionsWithDefaults.modifiers, updateStateModifier, { name: "applyStyles", enabled: false }]
      };
      if (isEqual(prevOptions.current, newOptions)) {
        return prevOptions.current || newOptions;
      } else {
        prevOptions.current = newOptions;
        return newOptions;
      }
    }, [
      optionsWithDefaults.onFirstUpdate,
      optionsWithDefaults.placement,
      optionsWithDefaults.strategy,
      optionsWithDefaults.modifiers,
      updateStateModifier
    ]);
    const popperInstanceRef = React4.useRef();
    useIsomorphicLayoutEffect(() => {
      if (popperInstanceRef && popperInstanceRef.current) {
        popperInstanceRef.current.setOptions(popperOptions);
      }
    }, [popperOptions]);
    useIsomorphicLayoutEffect(() => {
      if (referenceElement == null || popperElement == null) {
        return;
      }
      const createPopper3 = options5.createPopper || createPopper2;
      const popperInstance = createPopper3(referenceElement, popperElement, popperOptions);
      popperInstanceRef.current = popperInstance;
      return () => {
        popperInstance.destroy();
        popperInstanceRef.current = null;
      };
    }, [referenceElement, popperElement, options5.createPopper]);
    return {
      state: popperInstanceRef.current ? popperInstanceRef.current.state : null,
      styles: state.styles,
      attributes: state.attributes,
      update: popperInstanceRef.current ? popperInstanceRef.current.update : null,
      forceUpdate: popperInstanceRef.current ? popperInstanceRef.current.forceUpdate : null
    };
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/Popper/Popper.js
  var hash3 = {
    left: "right",
    right: "left",
    bottom: "top",
    top: "bottom",
    "top-start": "bottom-end",
    "top-end": "bottom-start",
    "bottom-start": "top-end",
    "bottom-end": "top-start",
    "left-start": "right-end",
    "left-end": "right-start",
    "right-start": "left-end",
    "right-end": "left-start"
  };
  var getOppositePlacement2 = (placement) => placement.replace(/left|right|bottom|top|top-start|top-end|bottom-start|bottom-end|right-start|right-end|left-start|left-end/g, (matched) => hash3[matched]);
  var getOpacityTransition = (animationDuration) => `opacity ${animationDuration}ms cubic-bezier(.54, 1.5, .38, 1.11)`;
  var Popper = ({ trigger, popper: popper2, direction = "down", position = "start", placement, width, minWidth = "trigger", maxWidth, appendTo = "inline", zIndex = 9999, isVisible = true, positionModifiers, distance = 0, onMouseEnter, onMouseLeave, onFocus, onBlur, onDocumentClick, onTriggerClick, onTriggerEnter, onPopperClick, onPopperMouseEnter, onPopperMouseLeave, onDocumentKeyDown, enableFlip = true, flipBehavior = "flip", triggerRef, popperRef, animationDuration = 0, entryDelay = 0, exitDelay = 0, onHidden = () => {
  }, onHide = () => {
  }, onMount = () => {
  }, onShow = () => {
  }, onShown = () => {
  }, preventOverflow: preventOverflow2 = false }) => {
    var _a;
    const [triggerElement, setTriggerElement] = React5.useState(null);
    const [refElement, setRefElement] = React5.useState(null);
    const [popperElement, setPopperElement] = React5.useState(null);
    const [popperContent, setPopperContent] = React5.useState(null);
    const [ready, setReady] = React5.useState(false);
    const [opacity, setOpacity] = React5.useState(0);
    const [internalIsVisible, setInternalIsVisible] = React5.useState(isVisible);
    const transitionTimerRef = React5.useRef(null);
    const showTimerRef = React5.useRef(null);
    const hideTimerRef = React5.useRef(null);
    const prevExitDelayRef = React5.useRef();
    const refOrTrigger = refElement || triggerElement;
    const showPopper = isVisible || internalIsVisible;
    const triggerParent = (_a = (triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.current) || triggerElement) === null || _a === void 0 ? void 0 : _a.parentElement;
    const languageDirection = getLanguageDirection(triggerParent);
    const internalPosition = React5.useMemo(() => {
      const fixedPositions = { left: "left", right: "right", center: "center" };
      const positionMap = {
        ltr: Object.assign({ start: "left", end: "right" }, fixedPositions),
        rtl: Object.assign({ start: "right", end: "left" }, fixedPositions)
      };
      return positionMap[languageDirection][position];
    }, [position, languageDirection]);
    const onDocumentClickCallback = React5.useCallback((event) => onDocumentClick(event, refOrTrigger, popperElement), [showPopper, triggerElement, refElement, popperElement, onDocumentClick]);
    React5.useEffect(() => {
      setReady(true);
      onMount();
    }, []);
    React5.useEffect(() => () => {
      clearTimeouts([transitionTimerRef, hideTimerRef, showTimerRef]);
    }, []);
    React5.useEffect(() => {
      if (triggerRef) {
        if (triggerRef.current) {
          setRefElement(triggerRef.current);
        } else if (typeof triggerRef === "function") {
          setRefElement(triggerRef());
        }
      }
    }, [triggerRef, trigger]);
    React5.useEffect(() => {
      if (popperRef) {
        if (popperRef.current) {
          setPopperElement(popperRef.current);
        } else if (typeof popperRef === "function") {
          setPopperElement(popperRef());
        }
      }
    }, [showPopper, popperRef]);
    React5.useEffect(() => {
      const observer = new MutationObserver(() => {
        update && update();
      });
      popperElement && observer.observe(popperElement, { attributes: true, childList: true, subtree: true });
      return () => {
        observer.disconnect();
      };
    }, [popperElement]);
    const addEventListener = (listener, element, event, capture = false) => {
      if (listener && element) {
        element.addEventListener(event, listener, { capture });
      }
    };
    const removeEventListener = (listener, element, event, capture = false) => {
      if (listener && element) {
        element.removeEventListener(event, listener, { capture });
      }
    };
    React5.useEffect(() => {
      addEventListener(onMouseEnter, refOrTrigger, "mouseenter");
      addEventListener(onMouseLeave, refOrTrigger, "mouseleave");
      addEventListener(onFocus, refOrTrigger, "focus");
      addEventListener(onBlur, refOrTrigger, "blur");
      addEventListener(onTriggerClick, refOrTrigger, "click");
      addEventListener(onTriggerEnter, refOrTrigger, "keydown");
      addEventListener(onPopperClick, popperElement, "click");
      addEventListener(onPopperMouseEnter, popperElement, "mouseenter");
      addEventListener(onPopperMouseLeave, popperElement, "mouseleave");
      onDocumentClick && addEventListener(onDocumentClickCallback, document, "click", true);
      addEventListener(onDocumentKeyDown, document, "keydown", true);
      return () => {
        removeEventListener(onMouseEnter, refOrTrigger, "mouseenter");
        removeEventListener(onMouseLeave, refOrTrigger, "mouseleave");
        removeEventListener(onFocus, refOrTrigger, "focus");
        removeEventListener(onBlur, refOrTrigger, "blur");
        removeEventListener(onTriggerClick, refOrTrigger, "click");
        removeEventListener(onTriggerEnter, refOrTrigger, "keydown");
        removeEventListener(onPopperClick, popperElement, "click");
        removeEventListener(onPopperMouseEnter, popperElement, "mouseenter");
        removeEventListener(onPopperMouseLeave, popperElement, "mouseleave");
        onDocumentClick && removeEventListener(onDocumentClickCallback, document, "click", true);
        removeEventListener(onDocumentKeyDown, document, "keydown", true);
      };
    }, [
      triggerElement,
      popperElement,
      onMouseEnter,
      onMouseLeave,
      onFocus,
      onBlur,
      onTriggerClick,
      onTriggerEnter,
      onPopperClick,
      onPopperMouseEnter,
      onPopperMouseLeave,
      onDocumentClick,
      onDocumentKeyDown,
      refElement
    ]);
    const getPlacement = () => {
      if (placement) {
        return placement;
      }
      let convertedPlacement = direction === "up" ? "top" : "bottom";
      if (internalPosition !== "center") {
        convertedPlacement = `${convertedPlacement}-${internalPosition === "right" ? "end" : "start"}`;
      }
      return convertedPlacement;
    };
    const getPlacementMemo = React5.useMemo(getPlacement, [direction, internalPosition, placement]);
    const getOppositePlacementMemo = React5.useMemo(() => getOppositePlacement2(getPlacement()), [direction, internalPosition, placement]);
    const widthMods = React5.useMemo(() => ({
      name: "widthMods",
      enabled: width !== void 0 || minWidth !== void 0 || maxWidth !== void 0,
      phase: "beforeWrite",
      requires: ["computeStyles"],
      fn: ({ state }) => {
        const triggerWidth = state.rects.reference.width;
        if (width) {
          state.styles.popper.width = width === "trigger" ? `${triggerWidth}px` : width;
        }
        if (minWidth) {
          state.styles.popper.minWidth = minWidth === "trigger" ? `${triggerWidth}px` : minWidth;
        }
        if (maxWidth) {
          state.styles.popper.maxWidth = maxWidth === "trigger" ? `${triggerWidth}px` : maxWidth;
        }
      },
      effect: ({ state }) => {
        const triggerWidth = state.elements.reference.offsetWidth;
        if (width) {
          state.elements.popper.style.width = width === "trigger" ? `${triggerWidth}px` : width;
        }
        if (minWidth) {
          state.elements.popper.style.minWidth = minWidth === "trigger" ? `${triggerWidth}px` : minWidth;
        }
        if (maxWidth) {
          state.elements.popper.style.maxWidth = maxWidth === "trigger" ? `${triggerWidth}px` : maxWidth;
        }
        return () => {
        };
      }
    }), [width, minWidth, maxWidth]);
    const { styles: popperStyles, attributes, update, forceUpdate } = usePopper(refOrTrigger, popperElement, {
      placement: getPlacementMemo,
      modifiers: [
        {
          name: "offset",
          options: {
            offset: [0, distance]
          }
        },
        {
          name: "preventOverflow",
          enabled: preventOverflow2
        },
        {
          // adds attribute [data-popper-reference-hidden] to the popper element which can be used to hide it using CSS
          name: "hide",
          enabled: true
        },
        {
          name: "flip",
          enabled: getPlacementMemo.startsWith("auto") || enableFlip,
          options: {
            fallbackPlacements: flipBehavior === "flip" ? [getOppositePlacementMemo] : flipBehavior
          }
        },
        widthMods
      ]
    });
    React5.useEffect(() => {
      var _a2, _b, _c, _d, _e, _f, _g;
      const currentPopperContent = ((_d = (_c = (_b = (_a2 = popper2 === null || popper2 === void 0 ? void 0 : popper2.props) === null || _a2 === void 0 ? void 0 : _a2.children) === null || _b === void 0 ? void 0 : _b[1]) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.children) || ((_g = (_f = (_e = popper2 === null || popper2 === void 0 ? void 0 : popper2.props) === null || _e === void 0 ? void 0 : _e.children) === null || _f === void 0 ? void 0 : _f.props) === null || _g === void 0 ? void 0 : _g.children);
      setPopperContent(currentPopperContent);
      if (currentPopperContent && popperContent && currentPopperContent !== popperContent) {
        forceUpdate && forceUpdate();
      }
    }, [popper2]);
    React5.useEffect(() => {
      if (prevExitDelayRef.current < exitDelay) {
        clearTimeouts([transitionTimerRef, hideTimerRef]);
        hideTimerRef.current = setTimeout(() => {
          transitionTimerRef.current = setTimeout(() => {
            setInternalIsVisible(false);
          }, animationDuration);
        }, exitDelay);
      }
      prevExitDelayRef.current = exitDelay;
    }, [exitDelay]);
    const show = () => {
      onShow();
      clearTimeouts([transitionTimerRef, hideTimerRef]);
      showTimerRef.current = setTimeout(() => {
        setInternalIsVisible(true);
        setOpacity(1);
        onShown();
      }, entryDelay);
    };
    const hide2 = () => {
      onHide();
      clearTimeouts([showTimerRef]);
      hideTimerRef.current = setTimeout(() => {
        setOpacity(0);
        transitionTimerRef.current = setTimeout(() => {
          setInternalIsVisible(false);
          onHidden();
        }, animationDuration);
      }, exitDelay);
    };
    React5.useEffect(() => {
      if (isVisible) {
        show();
      } else {
        hide2();
      }
    }, [isVisible]);
    const modifierFromPopperPosition = () => {
      if (attributes && attributes.popper && attributes.popper["data-popper-placement"]) {
        const popperPlacement = attributes.popper["data-popper-placement"];
        return positionModifiers[popperPlacement];
      }
      return positionModifiers.top;
    };
    const options5 = Object.assign({ className: css(popper2.props && popper2.props.className, positionModifiers && modifierFromPopperPosition()), style: Object.assign(Object.assign(Object.assign({}, popper2.props && popper2.props.style || {}), popperStyles.popper), {
      zIndex,
      opacity,
      transition: getOpacityTransition(animationDuration)
    }) }, attributes.popper);
    const getMenuWithPopper = () => {
      const localPopper = React5.cloneElement(popper2, options5);
      return popperRef ? localPopper : React5.createElement("div", { style: { display: "contents" }, ref: (node) => setPopperElement(node === null || node === void 0 ? void 0 : node.firstElementChild) }, localPopper);
    };
    const getPopper = () => {
      if (appendTo === "inline") {
        return getMenuWithPopper();
      } else {
        const target = typeof appendTo === "function" ? appendTo() : appendTo;
        return ReactDOM2.createPortal(getMenuWithPopper(), target);
      }
    };
    return React5.createElement(
      React5.Fragment,
      null,
      !triggerRef && trigger && React5.isValidElement(trigger) && React5.createElement("div", { style: { display: "contents" }, ref: (node) => setTriggerElement(node === null || node === void 0 ? void 0 : node.firstElementChild) }, trigger),
      triggerRef && trigger && React5.isValidElement(trigger) && trigger,
      ready && showPopper && getPopper()
    );
  };
  Popper.displayName = "Popper";

  // node_modules/@patternfly/react-core/dist/esm/helpers/KeyboardHandler.js
  var React6 = __toESM(require_react());
  var handleArrows = (event, navigableElements, isActiveElement = (element) => document.activeElement.contains(element), getFocusableElement = (element) => element, validSiblingTags = ["A", "BUTTON", "INPUT"], noVerticalArrowHandling = false, noHorizontalArrowHandling = false, updateTabIndex = true, onlyTraverseSiblings = true) => {
    const activeElement = document.activeElement;
    const key = event.key;
    let moveTarget = null;
    if (!noVerticalArrowHandling) {
      if (["ArrowUp", "ArrowDown"].includes(key)) {
        event.preventDefault();
        event.stopImmediatePropagation();
        let currentIndex = -1;
        navigableElements.forEach((element, index) => {
          if (isActiveElement(element)) {
            let increment = 0;
            while (!moveTarget && increment < navigableElements.length && increment * -1 < navigableElements.length) {
              key === "ArrowUp" ? increment-- : increment++;
              currentIndex = index + increment;
              if (currentIndex >= navigableElements.length) {
                currentIndex = 0;
              }
              if (currentIndex < 0) {
                currentIndex = navigableElements.length - 1;
              }
              moveTarget = getFocusableElement(navigableElements[currentIndex]);
            }
          }
        });
      }
    }
    if (!noHorizontalArrowHandling) {
      if (["ArrowLeft", "ArrowRight"].includes(key)) {
        event.preventDefault();
        event.stopImmediatePropagation();
        let currentIndex = -1;
        navigableElements.forEach((element, index) => {
          if (isActiveElement(element)) {
            const activeRow = navigableElements[index].querySelectorAll(validSiblingTags.join(","));
            if (!activeRow.length || onlyTraverseSiblings) {
              let nextSibling = activeElement;
              while (nextSibling) {
                nextSibling = key === "ArrowLeft" ? nextSibling.previousElementSibling : nextSibling.nextElementSibling;
                if (nextSibling) {
                  if (validSiblingTags.includes(nextSibling.tagName)) {
                    moveTarget = nextSibling;
                    break;
                  }
                }
              }
            } else {
              activeRow.forEach((focusableElement, index2) => {
                if (event.target === focusableElement) {
                  const increment = key === "ArrowLeft" ? -1 : 1;
                  currentIndex = index2 + increment;
                  if (currentIndex >= activeRow.length) {
                    currentIndex = 0;
                  }
                  if (currentIndex < 0) {
                    currentIndex = activeRow.length - 1;
                  }
                  moveTarget = activeRow[currentIndex];
                }
              });
            }
          }
        });
      }
    }
    if (moveTarget) {
      if (updateTabIndex) {
        activeElement.tabIndex = -1;
        moveTarget.tabIndex = 0;
      }
      moveTarget.focus();
    }
  };
  var setTabIndex = (options5) => {
    if (options5 && options5.length > 0) {
      options5.forEach((option) => {
        option.tabIndex = -1;
      });
      options5[0].tabIndex = 0;
    }
  };
  var KeyboardHandler = class extends React6.Component {
    constructor() {
      super(...arguments);
      this.keyHandler = (event) => {
        const { isEventFromContainer } = this.props;
        if (isEventFromContainer ? !isEventFromContainer(event) : !this._isEventFromContainer(event)) {
          return;
        }
        const { isActiveElement, getFocusableElement, noVerticalArrowHandling, noHorizontalArrowHandling, noEnterHandling, noSpaceHandling, updateTabIndex, validSiblingTags, additionalKeyHandler, createNavigableElements, onlyTraverseSiblings } = this.props;
        additionalKeyHandler && additionalKeyHandler(event);
        const navigableElements = createNavigableElements();
        if (!navigableElements) {
          console.warn("No navigable elements have been passed to the KeyboardHandler. Keyboard navigation provided by this component will be ignored.");
          return;
        }
        const key = event.key;
        if (!noEnterHandling) {
          if (key === "Enter") {
            event.preventDefault();
            event.stopImmediatePropagation();
            document.activeElement.click();
          }
        }
        if (!noSpaceHandling) {
          if (key === " ") {
            event.preventDefault();
            event.stopImmediatePropagation();
            document.activeElement.click();
          }
        }
        handleArrows(event, navigableElements, isActiveElement, getFocusableElement, validSiblingTags, noVerticalArrowHandling, noHorizontalArrowHandling, updateTabIndex, onlyTraverseSiblings);
      };
      this._isEventFromContainer = (event) => {
        const { containerRef } = this.props;
        return containerRef.current && containerRef.current.contains(event.target);
      };
    }
    componentDidMount() {
      if (canUseDOM) {
        window.addEventListener("keydown", this.keyHandler);
      }
    }
    componentWillUnmount() {
      if (canUseDOM) {
        window.removeEventListener("keydown", this.keyHandler);
      }
    }
    render() {
      return null;
    }
  };
  KeyboardHandler.displayName = "KeyboardHandler";
  KeyboardHandler.defaultProps = {
    containerRef: null,
    createNavigableElements: () => null,
    isActiveElement: (navigableElement) => document.activeElement === navigableElement,
    getFocusableElement: (navigableElement) => navigableElement,
    validSiblingTags: ["BUTTON", "A"],
    onlyTraverseSiblings: true,
    updateTabIndex: true,
    noHorizontalArrowHandling: false,
    noVerticalArrowHandling: false,
    noEnterHandling: false,
    noSpaceHandling: false
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/resizeObserver.js
  var getResizeObserver = (containerRefElement, handleResize, useRequestAnimationFrame) => {
    let unobserve;
    if (canUseDOM) {
      const { ResizeObserver } = window;
      if (containerRefElement && ResizeObserver) {
        const resizeObserver = new ResizeObserver((entries) => {
          if (useRequestAnimationFrame) {
            window.requestAnimationFrame(() => {
              if (Array.isArray(entries) && entries.length > 0) {
                debounce(handleResize, 100);
              }
            });
          } else {
            if (Array.isArray(entries) && entries.length > 0) {
              handleResize();
            }
          }
        });
        resizeObserver.observe(containerRefElement);
        unobserve = () => resizeObserver.unobserve(containerRefElement);
      } else {
        window.addEventListener("resize", handleResize);
        unobserve = () => window.removeEventListener("resize", handleResize);
      }
    }
    return () => {
      if (unobserve) {
        unobserve();
      }
    };
  };

  // node_modules/@patternfly/react-core/dist/esm/helpers/datetimeUtils.js
  var isValidDate = (date2) => Boolean(date2 && !isNaN(date2));

  // node_modules/@patternfly/react-core/dist/esm/components/Title/Title.js
  var TitleSizes;
  (function(TitleSizes2) {
    TitleSizes2["md"] = "md";
    TitleSizes2["lg"] = "lg";
    TitleSizes2["xl"] = "xl";
    TitleSizes2["2xl"] = "2xl";
    TitleSizes2["3xl"] = "3xl";
    TitleSizes2["4xl"] = "4xl";
  })(TitleSizes || (TitleSizes = {}));
  var headingLevelSizeMap;
  (function(headingLevelSizeMap2) {
    headingLevelSizeMap2["h1"] = "2xl";
    headingLevelSizeMap2["h2"] = "xl";
    headingLevelSizeMap2["h3"] = "lg";
    headingLevelSizeMap2["h4"] = "md";
    headingLevelSizeMap2["h5"] = "md";
    headingLevelSizeMap2["h6"] = "md";
  })(headingLevelSizeMap || (headingLevelSizeMap = {}));
  var Title = (_a) => {
    var { className = "", children = "", headingLevel: HeadingLevel, size = headingLevelSizeMap[HeadingLevel], ouiaId, ouiaSafe = true } = _a, props = __rest(_a, ["className", "children", "headingLevel", "size", "ouiaId", "ouiaSafe"]);
    const ouiaProps = useOUIAProps(Title.displayName, ouiaId, ouiaSafe);
    return React7.createElement(HeadingLevel, Object.assign({}, ouiaProps, props, { className: css(title_default.title, size && title_default.modifiers[size], className) }), children);
  };
  Title.displayName = "Title";

  // node_modules/@patternfly/react-core/dist/esm/components/Button/Button.js
  init_tslib_es6();
  var React10 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Button/button.mjs
  var button_default = {
    "badge": "pf-v5-c-badge",
    "button": "pf-v5-c-button",
    "buttonCount": "pf-v5-c-button__count",
    "buttonIcon": "pf-v5-c-button__icon",
    "buttonProgress": "pf-v5-c-button__progress",
    "modifiers": {
      "active": "pf-m-active",
      "block": "pf-m-block",
      "small": "pf-m-small",
      "primary": "pf-m-primary",
      "displayLg": "pf-m-display-lg",
      "secondary": "pf-m-secondary",
      "tertiary": "pf-m-tertiary",
      "link": "pf-m-link",
      "unread": "pf-m-unread",
      "inline": "pf-m-inline",
      "danger": "pf-m-danger",
      "warning": "pf-m-warning",
      "control": "pf-m-control",
      "expanded": "pf-m-expanded",
      "plain": "pf-m-plain",
      "noPadding": "pf-m-no-padding",
      "disabled": "pf-m-disabled",
      "ariaDisabled": "pf-m-aria-disabled",
      "progress": "pf-m-progress",
      "inProgress": "pf-m-in-progress",
      "start": "pf-m-start",
      "end": "pf-m-end"
    },
    "spinner": "pf-v5-c-spinner",
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Spinner/Spinner.js
  init_tslib_es6();
  var React8 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Spinner/spinner.mjs
  var spinner_default = {
    "modifiers": {
      "inline": "pf-m-inline",
      "sm": "pf-m-sm",
      "md": "pf-m-md",
      "lg": "pf-m-lg",
      "xl": "pf-m-xl"
    },
    "spinner": "pf-v5-c-spinner",
    "spinnerPath": "pf-v5-c-spinner__path"
  };

  // node_modules/@patternfly/react-tokens/dist/esm/c_spinner_diameter.js
  var c_spinner_diameter = {
    "name": "--pf-v5-c-spinner--diameter",
    "value": "3.375rem",
    "var": "var(--pf-v5-c-spinner--diameter)"
  };
  var c_spinner_diameter_default = c_spinner_diameter;

  // node_modules/@patternfly/react-core/dist/esm/components/Spinner/Spinner.js
  var spinnerSize;
  (function(spinnerSize2) {
    spinnerSize2["sm"] = "sm";
    spinnerSize2["md"] = "md";
    spinnerSize2["lg"] = "lg";
    spinnerSize2["xl"] = "xl";
  })(spinnerSize || (spinnerSize = {}));
  var Spinner = (_a) => {
    var { className = "", size = "xl", "aria-valuetext": ariaValueText = "Loading...", diameter, isInline = false, "aria-label": ariaLabel, "aria-labelledBy": ariaLabelledBy } = _a, props = __rest(_a, ["className", "size", "aria-valuetext", "diameter", "isInline", "aria-label", "aria-labelledBy"]);
    return React8.createElement(
      "svg",
      Object.assign({ className: css(spinner_default.spinner, isInline ? spinner_default.modifiers.inline : spinner_default.modifiers[size], className), role: "progressbar", "aria-valuetext": ariaValueText, viewBox: "0 0 100 100" }, diameter && { style: { [c_spinner_diameter_default.name]: diameter } }, ariaLabel && { "aria-label": ariaLabel }, ariaLabelledBy && { "aria-labelledBy": ariaLabelledBy }, !ariaLabel && !ariaLabelledBy && { "aria-label": "Contents" }, props),
      React8.createElement("circle", { className: spinner_default.spinnerPath, cx: "50", cy: "50", r: "45", fill: "none" })
    );
  };
  Spinner.displayName = "Spinner";

  // node_modules/@patternfly/react-core/dist/esm/components/Badge/Badge.js
  init_tslib_es6();
  var React9 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Badge/badge.mjs
  var badge_default = {
    "badge": "pf-v5-c-badge",
    "modifiers": {
      "read": "pf-m-read",
      "unread": "pf-m-unread"
    },
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Badge/Badge.js
  var Badge = (_a) => {
    var { isRead = false, className = "", children = "", screenReaderText } = _a, props = __rest(_a, ["isRead", "className", "children", "screenReaderText"]);
    return React9.createElement(
      "span",
      Object.assign({}, props, { className: css(badge_default.badge, isRead ? badge_default.modifiers.read : badge_default.modifiers.unread, className) }),
      children,
      screenReaderText && React9.createElement("span", { className: "pf-v5-screen-reader" }, screenReaderText)
    );
  };
  Badge.displayName = "Badge";

  // node_modules/@patternfly/react-core/dist/esm/components/Button/Button.js
  var ButtonVariant;
  (function(ButtonVariant2) {
    ButtonVariant2["primary"] = "primary";
    ButtonVariant2["secondary"] = "secondary";
    ButtonVariant2["tertiary"] = "tertiary";
    ButtonVariant2["danger"] = "danger";
    ButtonVariant2["warning"] = "warning";
    ButtonVariant2["link"] = "link";
    ButtonVariant2["plain"] = "plain";
    ButtonVariant2["control"] = "control";
  })(ButtonVariant || (ButtonVariant = {}));
  var ButtonType;
  (function(ButtonType2) {
    ButtonType2["button"] = "button";
    ButtonType2["submit"] = "submit";
    ButtonType2["reset"] = "reset";
  })(ButtonType || (ButtonType = {}));
  var ButtonSize;
  (function(ButtonSize2) {
    ButtonSize2["default"] = "default";
    ButtonSize2["sm"] = "sm";
    ButtonSize2["lg"] = "lg";
  })(ButtonSize || (ButtonSize = {}));
  var ButtonBase = (_a) => {
    var { children = null, className = "", component = "button", isActive = false, isBlock = false, isDisabled = false, isAriaDisabled = false, isLoading = null, isDanger = false, spinnerAriaValueText, spinnerAriaLabelledBy, spinnerAriaLabel, size = ButtonSize.default, inoperableEvents = ["onClick", "onKeyPress"], isInline = false, type = ButtonType.button, variant = ButtonVariant.primary, iconPosition = "start", "aria-label": ariaLabel = null, icon = null, ouiaId, ouiaSafe = true, tabIndex = null, innerRef, countOptions } = _a, props = __rest(_a, ["children", "className", "component", "isActive", "isBlock", "isDisabled", "isAriaDisabled", "isLoading", "isDanger", "spinnerAriaValueText", "spinnerAriaLabelledBy", "spinnerAriaLabel", "size", "inoperableEvents", "isInline", "type", "variant", "iconPosition", "aria-label", "icon", "ouiaId", "ouiaSafe", "tabIndex", "innerRef", "countOptions"]);
    const ouiaProps = useOUIAProps(Button.displayName, ouiaId, ouiaSafe, variant);
    const Component40 = component;
    const isButtonElement = Component40 === "button";
    const isInlineSpan = isInline && Component40 === "span";
    const preventedEvents2 = inoperableEvents.reduce((handlers, eventToPrevent) => Object.assign(Object.assign({}, handlers), { [eventToPrevent]: (event) => {
      event.preventDefault();
    } }), {});
    const getDefaultTabIdx = () => {
      if (isDisabled) {
        return isButtonElement ? null : -1;
      } else if (isAriaDisabled) {
        return null;
      } else if (isInlineSpan) {
        return 0;
      }
    };
    return React10.createElement(
      Component40,
      Object.assign({}, props, isAriaDisabled ? preventedEvents2 : null, { "aria-disabled": isDisabled || isAriaDisabled, "aria-label": ariaLabel, className: css(button_default.button, button_default.modifiers[variant], isBlock && button_default.modifiers.block, isDisabled && button_default.modifiers.disabled, isAriaDisabled && button_default.modifiers.ariaDisabled, isActive && button_default.modifiers.active, isInline && variant === ButtonVariant.link && button_default.modifiers.inline, isDanger && (variant === ButtonVariant.secondary || variant === ButtonVariant.link) && button_default.modifiers.danger, isLoading !== null && variant !== ButtonVariant.plain && button_default.modifiers.progress, isLoading && button_default.modifiers.inProgress, size === ButtonSize.sm && button_default.modifiers.small, size === ButtonSize.lg && button_default.modifiers.displayLg, className), disabled: isButtonElement ? isDisabled : null, tabIndex: tabIndex !== null ? tabIndex : getDefaultTabIdx(), type: isButtonElement || isInlineSpan ? type : null, role: isInlineSpan ? "button" : null, ref: innerRef }, ouiaProps),
      isLoading && React10.createElement(
        "span",
        { className: css(button_default.buttonProgress) },
        React10.createElement(Spinner, { size: spinnerSize.md, isInline, "aria-valuetext": spinnerAriaValueText, "aria-label": spinnerAriaLabel, "aria-labelledby": spinnerAriaLabelledBy })
      ),
      variant === ButtonVariant.plain && children === null && icon ? icon : null,
      variant !== ButtonVariant.plain && icon && (iconPosition === "start" || iconPosition === "left") && React10.createElement("span", { className: css(button_default.buttonIcon, button_default.modifiers.start) }, icon),
      children,
      variant !== ButtonVariant.plain && icon && (iconPosition === "end" || iconPosition === "right") && React10.createElement("span", { className: css(button_default.buttonIcon, button_default.modifiers.end) }, icon),
      countOptions && React10.createElement(
        "span",
        { className: css(button_default.buttonCount, countOptions.className) },
        React10.createElement(Badge, { isRead: countOptions.isRead }, countOptions.count)
      )
    );
  };
  var Button = React10.forwardRef((props, ref) => React10.createElement(ButtonBase, Object.assign({ innerRef: ref }, props)));
  Button.displayName = "Button";

  // node_modules/@patternfly/react-icons/dist/esm/createIcon.js
  init_tslib_es6();
  var React11 = __toESM(require_react());
  var currentId2 = 0;
  function createIcon({ name: name2, xOffset = 0, yOffset = 0, width, height, svgPath }) {
    var _a;
    return _a = class SVGIcon extends React11.Component {
      constructor() {
        super(...arguments);
        this.id = `icon-title-${currentId2++}`;
      }
      render() {
        const _b = this.props, { title, className } = _b, props = __rest(_b, ["title", "className"]);
        const classes = className ? `pf-v5-svg ${className}` : "pf-v5-svg";
        const hasTitle = Boolean(title);
        const viewBox = [xOffset, yOffset, width, height].join(" ");
        return React11.createElement(
          "svg",
          Object.assign({ className: classes, viewBox, fill: "currentColor", "aria-labelledby": hasTitle ? this.id : null, "aria-hidden": hasTitle ? null : true, role: "img", width: "1em", height: "1em" }, props),
          hasTitle && React11.createElement("title", { id: this.id }, title),
          React11.createElement("path", { d: svgPath })
        );
      }
    }, _a.displayName = name2, _a;
  }

  // node_modules/@patternfly/react-icons/dist/esm/icons/times-icon.js
  var TimesIconConfig = {
    name: "TimesIcon",
    height: 512,
    width: 352,
    svgPath: "M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z",
    yOffset: 0,
    xOffset: 0
  };
  var TimesIcon = createIcon(TimesIconConfig);
  var times_icon_default = TimesIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/Modal.js
  init_tslib_es6();
  var React24 = __toESM(require_react());
  var ReactDOM3 = __toESM(require_react_dom());

  // node_modules/@patternfly/react-styles/css/components/Backdrop/backdrop.mjs
  var backdrop_default = {
    "backdrop": "pf-v5-c-backdrop",
    "backdropOpen": "pf-v5-c-backdrop__open"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalContent.js
  init_tslib_es6();
  var React23 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/ModalBox/modal-box.mjs
  var modal_box_default = {
    "button": "pf-v5-c-button",
    "modalBox": "pf-v5-c-modal-box",
    "modalBoxBody": "pf-v5-c-modal-box__body",
    "modalBoxClose": "pf-v5-c-modal-box__close",
    "modalBoxDescription": "pf-v5-c-modal-box__description",
    "modalBoxFooter": "pf-v5-c-modal-box__footer",
    "modalBoxHeader": "pf-v5-c-modal-box__header",
    "modalBoxHeaderMain": "pf-v5-c-modal-box__header-main",
    "modalBoxTitle": "pf-v5-c-modal-box__title",
    "modalBoxTitleIcon": "pf-v5-c-modal-box__title-icon",
    "modalBoxTitleText": "pf-v5-c-modal-box__title-text",
    "modifiers": {
      "sm": "pf-m-sm",
      "md": "pf-m-md",
      "lg": "pf-m-lg",
      "alignTop": "pf-m-align-top",
      "danger": "pf-m-danger",
      "warning": "pf-m-warning",
      "success": "pf-m-success",
      "custom": "pf-m-custom",
      "info": "pf-m-info",
      "help": "pf-m-help",
      "icon": "pf-m-icon"
    },
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-styles/css/layouts/Bullseye/bullseye.mjs
  var bullseye_default = {
    "bullseye": "pf-v5-l-bullseye"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Backdrop/Backdrop.js
  init_tslib_es6();
  var React12 = __toESM(require_react());
  var Backdrop = (_a) => {
    var { children = null, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    return React12.createElement("div", Object.assign({}, props, { className: css(backdrop_default.backdrop, className) }), children);
  };
  Backdrop.displayName = "Backdrop";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalBoxBody.js
  init_tslib_es6();
  var React13 = __toESM(require_react());
  var ModalBoxBody = (_a) => {
    var { children = null, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    return React13.createElement("div", Object.assign({}, props, { className: css(modal_box_default.modalBoxBody, className) }), children);
  };
  ModalBoxBody.displayName = "ModalBoxBody";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalBoxCloseButton.js
  init_tslib_es6();
  var React14 = __toESM(require_react());
  var ModalBoxCloseButton = (_a) => {
    var { className, onClose = () => void 0, "aria-label": ariaLabel = "Close", ouiaId } = _a, props = __rest(_a, ["className", "onClose", "aria-label", "ouiaId"]);
    return React14.createElement(
      "div",
      { className: css(modal_box_default.modalBoxClose, className) },
      React14.createElement(
        Button,
        Object.assign({ variant: "plain", onClick: (event) => onClose(event), "aria-label": ariaLabel }, ouiaId && { ouiaId: `${ouiaId}-${ModalBoxCloseButton.displayName}` }, props),
        React14.createElement(times_icon_default, null)
      )
    );
  };
  ModalBoxCloseButton.displayName = "ModalBoxCloseButton";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalBox.js
  init_tslib_es6();
  var React15 = __toESM(require_react());

  // node_modules/@patternfly/react-tokens/dist/esm/c_modal_box_m_align_top_spacer.js
  var c_modal_box_m_align_top_spacer = {
    "name": "--pf-v5-c-modal-box--m-align-top--spacer",
    "value": "0.5rem",
    "var": "var(--pf-v5-c-modal-box--m-align-top--spacer)"
  };
  var c_modal_box_m_align_top_spacer_default = c_modal_box_m_align_top_spacer;

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalBox.js
  var ModalBox = (_a) => {
    var { children, className = "", variant = "default", position, positionOffset, "aria-labelledby": ariaLabelledby, "aria-label": ariaLabel = "", "aria-describedby": ariaDescribedby, style } = _a, props = __rest(_a, ["children", "className", "variant", "position", "positionOffset", "aria-labelledby", "aria-label", "aria-describedby", "style"]);
    if (positionOffset) {
      style = style || {};
      style[c_modal_box_m_align_top_spacer_default.name] = positionOffset;
    }
    return React15.createElement("div", Object.assign({}, props, { role: "dialog", "aria-label": ariaLabel || null, "aria-labelledby": ariaLabelledby || null, "aria-describedby": ariaDescribedby, "aria-modal": "true", className: css(modal_box_default.modalBox, className, position === "top" && modal_box_default.modifiers.alignTop, variant === "large" && modal_box_default.modifiers.lg, variant === "small" && modal_box_default.modifiers.sm, variant === "medium" && modal_box_default.modifiers.md), style }), children);
  };
  ModalBox.displayName = "ModalBox";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalBoxFooter.js
  init_tslib_es6();
  var React16 = __toESM(require_react());
  var ModalBoxFooter = (_a) => {
    var { children = null, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    return React16.createElement("footer", Object.assign({}, props, { className: css(modal_box_default.modalBoxFooter, className) }), children);
  };
  ModalBoxFooter.displayName = "ModalBoxFooter";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalBoxDescription.js
  init_tslib_es6();
  var React17 = __toESM(require_react());
  var ModalBoxDescription = (_a) => {
    var { children = null, className = "", id = "" } = _a, props = __rest(_a, ["children", "className", "id"]);
    return React17.createElement("div", Object.assign({}, props, { id, className: css(modal_box_default.modalBoxDescription, className) }), children);
  };
  ModalBoxDescription.displayName = "ModalBoxDescription";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalBoxHeader.js
  init_tslib_es6();
  var React18 = __toESM(require_react());
  var ModalBoxHeader = (_a) => {
    var { children = null, className = "", help = null } = _a, props = __rest(_a, ["children", "className", "help"]);
    return React18.createElement(
      "header",
      Object.assign({ className: css(modal_box_default.modalBoxHeader, help && modal_box_default.modifiers.help, className) }, props),
      help && React18.createElement(
        React18.Fragment,
        null,
        React18.createElement("div", { className: css(modal_box_default.modalBoxHeaderMain) }, children),
        React18.createElement("div", { className: `${modal_box_default.modalBoxHeader}-help` }, help)
      ),
      !help && children
    );
  };
  ModalBoxHeader.displayName = "ModalBoxHeader";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalBoxTitle.js
  init_tslib_es6();
  var React22 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Tooltip/Tooltip.js
  init_tslib_es6();
  var React21 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Tooltip/tooltip.mjs
  var tooltip_default = {
    "modifiers": {
      "top": "pf-m-top",
      "topLeft": "pf-m-top-left",
      "topRight": "pf-m-top-right",
      "bottom": "pf-m-bottom",
      "bottomLeft": "pf-m-bottom-left",
      "bottomRight": "pf-m-bottom-right",
      "left": "pf-m-left",
      "leftTop": "pf-m-left-top",
      "leftBottom": "pf-m-left-bottom",
      "right": "pf-m-right",
      "rightTop": "pf-m-right-top",
      "rightBottom": "pf-m-right-bottom",
      "textAlignLeft": "pf-m-text-align-left"
    },
    "themeDark": "pf-v5-theme-dark",
    "tooltip": "pf-v5-c-tooltip",
    "tooltipArrow": "pf-v5-c-tooltip__arrow",
    "tooltipContent": "pf-v5-c-tooltip__content"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Tooltip/TooltipContent.js
  init_tslib_es6();
  var React19 = __toESM(require_react());
  var TooltipContent = (_a) => {
    var { className, children, isLeftAligned } = _a, props = __rest(_a, ["className", "children", "isLeftAligned"]);
    return React19.createElement("div", Object.assign({ className: css(tooltip_default.tooltipContent, isLeftAligned && tooltip_default.modifiers.textAlignLeft, className) }, props), children);
  };
  TooltipContent.displayName = "TooltipContent";

  // node_modules/@patternfly/react-core/dist/esm/components/Tooltip/TooltipArrow.js
  init_tslib_es6();
  var React20 = __toESM(require_react());
  var TooltipArrow = (_a) => {
    var { className } = _a, props = __rest(_a, ["className"]);
    return React20.createElement("div", Object.assign({ className: css(tooltip_default.tooltipArrow, className) }, props));
  };
  TooltipArrow.displayName = "TooltipArrow";

  // node_modules/@patternfly/react-tokens/dist/esm/c_tooltip_MaxWidth.js
  var c_tooltip_MaxWidth = {
    "name": "--pf-v5-c-tooltip--MaxWidth",
    "value": "18.75rem",
    "var": "var(--pf-v5-c-tooltip--MaxWidth)"
  };
  var c_tooltip_MaxWidth_default = c_tooltip_MaxWidth;

  // node_modules/@patternfly/react-core/dist/esm/components/Tooltip/Tooltip.js
  var TooltipPosition;
  (function(TooltipPosition2) {
    TooltipPosition2["auto"] = "auto";
    TooltipPosition2["top"] = "top";
    TooltipPosition2["bottom"] = "bottom";
    TooltipPosition2["left"] = "left";
    TooltipPosition2["right"] = "right";
    TooltipPosition2["topStart"] = "top-start";
    TooltipPosition2["topEnd"] = "top-end";
    TooltipPosition2["bottomStart"] = "bottom-start";
    TooltipPosition2["bottomEnd"] = "bottom-end";
    TooltipPosition2["leftStart"] = "left-start";
    TooltipPosition2["leftEnd"] = "left-end";
    TooltipPosition2["rightStart"] = "right-start";
    TooltipPosition2["rightEnd"] = "right-end";
  })(TooltipPosition || (TooltipPosition = {}));
  var pfTooltipIdCounter = 1;
  var Tooltip = (_a) => {
    var {
      content: bodyContent,
      position = "top",
      trigger = "mouseenter focus",
      isVisible = false,
      isContentLeftAligned = false,
      enableFlip = true,
      className = "",
      entryDelay = 300,
      exitDelay = 300,
      appendTo = () => document.body,
      zIndex = 9999,
      minWidth,
      maxWidth = c_tooltip_MaxWidth_default.value,
      distance = 15,
      aria = "describedby",
      // For every initial starting position, there are 3 escape positions
      flipBehavior = ["top", "right", "bottom", "left", "top", "right", "bottom"],
      id = `pf-tooltip-${pfTooltipIdCounter++}`,
      children,
      animationDuration = 300,
      triggerRef,
      "aria-live": ariaLive = triggerRef ? "polite" : "off",
      onTooltipHidden = () => {
      }
    } = _a, rest = __rest(_a, ["content", "position", "trigger", "isVisible", "isContentLeftAligned", "enableFlip", "className", "entryDelay", "exitDelay", "appendTo", "zIndex", "minWidth", "maxWidth", "distance", "aria", "flipBehavior", "id", "children", "animationDuration", "triggerRef", "aria-live", "onTooltipHidden"]);
    const hideOnClick = true;
    const triggerOnMouseenter = trigger.includes("mouseenter");
    const triggerOnFocus = trigger.includes("focus");
    const triggerOnClick = trigger.includes("click");
    const triggerManually = trigger === "manual";
    const [visible, setVisible] = React21.useState(false);
    const popperRef = React21.createRef();
    const onDocumentKeyDown = (event) => {
      if (!triggerManually) {
        if (event.key === KeyTypes.Escape && visible) {
          hide2();
        }
      }
    };
    const onTriggerEnter = (event) => {
      if (event.key === KeyTypes.Enter) {
        if (!visible) {
          show();
        } else {
          hide2();
        }
      }
    };
    React21.useEffect(() => {
      if (isVisible) {
        show();
      } else {
        hide2();
      }
    }, [isVisible]);
    const show = () => {
      setVisible(true);
    };
    const hide2 = () => {
      setVisible(false);
    };
    const positionModifiers = {
      top: tooltip_default.modifiers.top,
      bottom: tooltip_default.modifiers.bottom,
      left: tooltip_default.modifiers.left,
      right: tooltip_default.modifiers.right,
      "top-start": tooltip_default.modifiers.topLeft,
      "top-end": tooltip_default.modifiers.topRight,
      "bottom-start": tooltip_default.modifiers.bottomLeft,
      "bottom-end": tooltip_default.modifiers.bottomRight,
      "left-start": tooltip_default.modifiers.leftTop,
      "left-end": tooltip_default.modifiers.leftBottom,
      "right-start": tooltip_default.modifiers.rightTop,
      "right-end": tooltip_default.modifiers.rightBottom
    };
    const hasCustomMaxWidth = maxWidth !== c_tooltip_MaxWidth_default.value;
    const content = React21.createElement(
      "div",
      Object.assign({ "aria-live": ariaLive, className: css(tooltip_default.tooltip, className), role: "tooltip", id, style: {
        maxWidth: hasCustomMaxWidth ? maxWidth : null
      }, ref: popperRef }, rest),
      React21.createElement(TooltipArrow, null),
      React21.createElement(TooltipContent, { isLeftAligned: isContentLeftAligned }, bodyContent)
    );
    const onDocumentClick = (event, triggerElement) => {
      if (hideOnClick === true) {
        if (visible) {
          hide2();
        } else if (event.target === triggerElement) {
          show();
        }
      } else if (hideOnClick === "toggle" && event.target === triggerElement) {
        if (visible) {
          hide2();
        } else {
          show();
        }
      } else if (hideOnClick === false && !visible && event.target === triggerElement) {
        show();
      }
    };
    const addAriaToTrigger = () => {
      if (aria === "describedby" && children && children.props && !children.props["aria-describedby"]) {
        return React21.cloneElement(children, { "aria-describedby": id });
      } else if (aria === "labelledby" && children.props && !children.props["aria-labelledby"]) {
        return React21.cloneElement(children, { "aria-labelledby": id });
      }
      return children;
    };
    return React21.createElement(Popper, { trigger: aria !== "none" && visible ? addAriaToTrigger() : children, triggerRef, popper: content, popperRef, minWidth: minWidth !== void 0 ? minWidth : "revert", appendTo, isVisible: visible, positionModifiers, distance, placement: position, onMouseEnter: triggerOnMouseenter && show, onMouseLeave: triggerOnMouseenter && hide2, onPopperMouseEnter: triggerOnMouseenter && show, onPopperMouseLeave: triggerOnMouseenter && hide2, onFocus: triggerOnFocus && show, onBlur: triggerOnFocus && hide2, onDocumentClick: triggerOnClick && onDocumentClick, onDocumentKeyDown: triggerManually ? null : onDocumentKeyDown, onTriggerEnter: triggerManually ? null : onTriggerEnter, enableFlip, zIndex, flipBehavior, animationDuration, entryDelay, exitDelay, onHidden: onTooltipHidden });
  };
  Tooltip.displayName = "Tooltip";

  // node_modules/@patternfly/react-icons/dist/esm/icons/check-circle-icon.js
  var CheckCircleIconConfig = {
    name: "CheckCircleIcon",
    height: 512,
    width: 512,
    svgPath: "M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z",
    yOffset: 0,
    xOffset: 0
  };
  var CheckCircleIcon = createIcon(CheckCircleIconConfig);
  var check_circle_icon_default = CheckCircleIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon.js
  var ExclamationCircleIconConfig = {
    name: "ExclamationCircleIcon",
    height: 512,
    width: 512,
    svgPath: "M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z",
    yOffset: 0,
    xOffset: 0
  };
  var ExclamationCircleIcon = createIcon(ExclamationCircleIconConfig);
  var exclamation_circle_icon_default = ExclamationCircleIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/exclamation-triangle-icon.js
  var ExclamationTriangleIconConfig = {
    name: "ExclamationTriangleIcon",
    height: 512,
    width: 576,
    svgPath: "M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z",
    yOffset: 0,
    xOffset: 0
  };
  var ExclamationTriangleIcon = createIcon(ExclamationTriangleIconConfig);
  var exclamation_triangle_icon_default = ExclamationTriangleIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/info-circle-icon.js
  var InfoCircleIconConfig = {
    name: "InfoCircleIcon",
    height: 512,
    width: 512,
    svgPath: "M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z",
    yOffset: 0,
    xOffset: 0
  };
  var InfoCircleIcon = createIcon(InfoCircleIconConfig);
  var info_circle_icon_default = InfoCircleIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/bell-icon.js
  var BellIconConfig = {
    name: "BellIcon",
    height: 1024,
    width: 896,
    svgPath: "M448,0 C465.333333,0 480.333333,6.33333333 493,19 C505.666667,31.6666667 512,46.6666667 512,64 L512,106 L514.23,106.45 C587.89,121.39 648.48,157.24 696,214 C744,271.333333 768,338.666667 768,416 C768,500 780,568.666667 804,622 C818.666667,652.666667 841.333333,684 872,716 C873.773676,718.829136 875.780658,721.505113 878,724 C890,737.333333 896,752.333333 896,769 C896,785.666667 890,800.333333 878,813 C866,825.666667 850.666667,832 832,832 L63.3,832 C44.9533333,831.84 29.8533333,825.506667 18,813 C6,800.333333 0,785.666667 0,769 C0,752.333333 6,737.333333 18,724 L24,716 L25.06,714.9 C55.1933333,683.28 77.5066667,652.313333 92,622 C116,568.666667 128,500 128,416 C128,338.666667 152,271.333333 200,214 C248,156.666667 309.333333,120.666667 384,106 L384,63.31 C384.166667,46.27 390.5,31.5 403,19 C415.666667,6.33333333 430.666667,0 448,0 Z M576,896 L576,897.08 C575.74,932.6 563.073333,962.573333 538,987 C512.666667,1011.66667 482.666667,1024 448,1024 C413.333333,1024 383.333333,1011.66667 358,987 C332.666667,962.333333 320,932 320,896 L576,896 Z",
    yOffset: 0,
    xOffset: 0
  };
  var BellIcon = createIcon(BellIconConfig);
  var bell_icon_default = BellIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalBoxTitle.js
  var isVariantIcon = (icon) => ["success", "danger", "warning", "info", "custom"].includes(icon);
  var ModalBoxTitle = (_a) => {
    var { className = "", id, title, titleIconVariant, titleLabel = "" } = _a, props = __rest(_a, ["className", "id", "title", "titleIconVariant", "titleLabel"]);
    const [hasTooltip, setHasTooltip] = React22.useState(false);
    const h1 = React22.useRef(null);
    const label = titleLabel || (isVariantIcon(titleIconVariant) ? `${capitalize(titleIconVariant)} alert:` : titleLabel);
    const variantIcons3 = {
      success: React22.createElement(check_circle_icon_default, null),
      danger: React22.createElement(exclamation_circle_icon_default, null),
      warning: React22.createElement(exclamation_triangle_icon_default, null),
      info: React22.createElement(info_circle_icon_default, null),
      custom: React22.createElement(bell_icon_default, null)
    };
    const CustomIcon = !isVariantIcon(titleIconVariant) && titleIconVariant;
    useIsomorphicLayoutEffect(() => {
      setHasTooltip(h1.current && h1.current.offsetWidth < h1.current.scrollWidth);
    }, []);
    const content = React22.createElement(
      "h1",
      Object.assign({ id, ref: h1, className: css(modal_box_default.modalBoxTitle, titleIconVariant && modal_box_default.modifiers.icon, className) }, props),
      titleIconVariant && React22.createElement("span", { className: css(modal_box_default.modalBoxTitleIcon) }, isVariantIcon(titleIconVariant) ? variantIcons3[titleIconVariant] : React22.createElement(CustomIcon, null)),
      label && React22.createElement("span", { className: "pf-v5-screen-reader" }, label),
      React22.createElement("span", { className: css(modal_box_default.modalBoxTitleText) }, title)
    );
    return hasTooltip ? React22.createElement(Tooltip, { content: title }, content) : content;
  };
  ModalBoxTitle.displayName = "ModalBoxTitle";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/ModalContent.js
  var ModalContent = (_a) => {
    var { children, className = "", isOpen = false, header = null, help = null, description = null, title = "", titleIconVariant = null, titleLabel = "", "aria-label": ariaLabel = "", "aria-describedby": ariaDescribedby, "aria-labelledby": ariaLabelledby, bodyAriaLabel, bodyAriaRole, showClose = true, footer = null, actions = [], onClose = () => void 0, variant = "default", position, positionOffset, width, maxWidth, boxId, labelId, descriptorId, disableFocusTrap = false, hasNoBodyWrapper = false, ouiaId, ouiaSafe = true, elementToFocus } = _a, props = __rest(_a, ["children", "className", "isOpen", "header", "help", "description", "title", "titleIconVariant", "titleLabel", "aria-label", "aria-describedby", "aria-labelledby", "bodyAriaLabel", "bodyAriaRole", "showClose", "footer", "actions", "onClose", "variant", "position", "positionOffset", "width", "maxWidth", "boxId", "labelId", "descriptorId", "disableFocusTrap", "hasNoBodyWrapper", "ouiaId", "ouiaSafe", "elementToFocus"]);
    if (!isOpen) {
      return null;
    }
    const modalBoxHeader = header ? React23.createElement(ModalBoxHeader, { help }, header) : title && React23.createElement(
      ModalBoxHeader,
      { help },
      React23.createElement(ModalBoxTitle, { title, titleIconVariant, titleLabel, id: labelId }),
      description && React23.createElement(ModalBoxDescription, { id: descriptorId }, description)
    );
    const modalBoxFooter = footer ? React23.createElement(ModalBoxFooter, null, footer) : actions.length > 0 && React23.createElement(ModalBoxFooter, null, actions);
    const defaultModalBodyAriaRole = bodyAriaLabel ? "region" : void 0;
    const hasNoDescription = !description && !ariaDescribedby;
    const id = hasNoDescription ? descriptorId : void 0;
    const modalBody = hasNoBodyWrapper ? children : React23.createElement(ModalBoxBody, Object.assign({ "aria-label": bodyAriaLabel, role: bodyAriaRole || defaultModalBodyAriaRole }, props, { id }), children);
    const ariaLabelledbyFormatted = () => {
      if (ariaLabelledby === null) {
        return null;
      }
      const idRefList = [];
      if ((ariaLabel && boxId) !== "") {
        idRefList.push(ariaLabel && boxId);
      }
      if (ariaLabelledby) {
        idRefList.push(ariaLabelledby);
      }
      if (title) {
        idRefList.push(labelId);
      }
      return idRefList.join(" ");
    };
    const modalBox = React23.createElement(
      ModalBox,
      Object.assign({ id: boxId, className: css(className, isVariantIcon(titleIconVariant) && modal_box_default.modifiers[titleIconVariant]), variant, position, positionOffset, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledbyFormatted(), "aria-describedby": ariaDescribedby || (hasNoBodyWrapper ? null : descriptorId) }, getOUIAProps(ModalContent.displayName, ouiaId, ouiaSafe), { style: Object.assign(Object.assign({}, width && { "--pf-v5-c-modal-box--Width": typeof width !== "number" ? width : `${width}px` }), maxWidth && {
        "--pf-v5-c-modal-box--MaxWidth": typeof maxWidth !== "number" ? maxWidth : `${maxWidth}px`
      }) }),
      showClose && React23.createElement(ModalBoxCloseButton, { onClose: (event) => onClose(event), ouiaId }),
      modalBoxHeader,
      modalBody,
      modalBoxFooter
    );
    return React23.createElement(
      Backdrop,
      null,
      React23.createElement(FocusTrap, { active: !disableFocusTrap, focusTrapOptions: {
        clickOutsideDeactivates: true,
        tabbableOptions: { displayCheck: "none" },
        // FocusTrap's initialFocus can accept false as a value to prevent initial focus.
        // We want to prevent this in case false is ever passed in.
        initialFocus: elementToFocus || void 0
      }, className: css(bullseye_default.bullseye) }, modalBox)
    );
  };
  ModalContent.displayName = "ModalContent";

  // node_modules/@patternfly/react-core/dist/esm/components/Modal/Modal.js
  var ModalVariant;
  (function(ModalVariant2) {
    ModalVariant2["small"] = "small";
    ModalVariant2["medium"] = "medium";
    ModalVariant2["large"] = "large";
    ModalVariant2["default"] = "default";
  })(ModalVariant || (ModalVariant = {}));
  var Modal = class _Modal extends React24.Component {
    constructor(props) {
      super(props);
      this.boxId = "";
      this.labelId = "";
      this.descriptorId = "";
      this.handleEscKeyClick = (event) => {
        var _a, _b;
        const { onEscapePress } = this.props;
        if (event.key === KeyTypes.Escape && this.props.isOpen) {
          onEscapePress ? onEscapePress(event) : (_b = (_a = this.props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a, event);
        }
      };
      this.getElement = (appendTo) => {
        if (typeof appendTo === "function") {
          return appendTo();
        }
        return appendTo || document.body;
      };
      this.toggleSiblingsFromScreenReaders = (hide2) => {
        const { appendTo } = this.props;
        const target = this.getElement(appendTo);
        const bodyChildren = target.children;
        for (const child of Array.from(bodyChildren)) {
          if (child !== this.state.container) {
            hide2 ? child.setAttribute("aria-hidden", "" + hide2) : child.removeAttribute("aria-hidden");
          }
        }
      };
      this.isEmpty = (value) => value === null || value === void 0 || value === "";
      const boxIdNum = _Modal.currentId++;
      const labelIdNum = boxIdNum + 1;
      const descriptorIdNum = boxIdNum + 2;
      this.boxId = props.id || `pf-modal-part-${boxIdNum}`;
      this.labelId = `pf-modal-part-${labelIdNum}`;
      this.descriptorId = `pf-modal-part-${descriptorIdNum}`;
      this.state = {
        container: void 0,
        ouiaStateId: getDefaultOUIAId(_Modal.displayName, props.variant)
      };
    }
    componentDidMount() {
      const { appendTo, title, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, hasNoBodyWrapper, header } = this.props;
      const target = this.getElement(appendTo);
      const container = document.createElement("div");
      this.setState({ container });
      target.appendChild(container);
      target.addEventListener("keydown", this.handleEscKeyClick, false);
      if (this.props.isOpen) {
        target.classList.add(css(backdrop_default.backdropOpen));
      } else {
        target.classList.remove(css(backdrop_default.backdropOpen));
      }
      if (!title && this.isEmpty(ariaLabel) && this.isEmpty(ariaLabelledby)) {
        console.error("Modal: Specify at least one of: title, aria-label, aria-labelledby.");
      }
      if (this.isEmpty(ariaLabel) && this.isEmpty(ariaLabelledby) && (hasNoBodyWrapper || header)) {
        console.error("Modal: When using hasNoBodyWrapper or setting a custom header, ensure you assign an accessible name to the the modal container with aria-label or aria-labelledby.");
      }
    }
    componentDidUpdate() {
      const { appendTo } = this.props;
      const target = this.getElement(appendTo);
      if (this.props.isOpen) {
        target.classList.add(css(backdrop_default.backdropOpen));
        this.toggleSiblingsFromScreenReaders(true);
      } else {
        target.classList.remove(css(backdrop_default.backdropOpen));
        this.toggleSiblingsFromScreenReaders(false);
      }
    }
    componentWillUnmount() {
      const { appendTo } = this.props;
      const target = this.getElement(appendTo);
      if (this.state.container) {
        target.removeChild(this.state.container);
      }
      target.removeEventListener("keydown", this.handleEscKeyClick, false);
      target.classList.remove(css(backdrop_default.backdropOpen));
      this.toggleSiblingsFromScreenReaders(false);
    }
    render() {
      const _a = this.props, {
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        appendTo,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        onEscapePress,
        "aria-labelledby": ariaLabelledby,
        "aria-label": ariaLabel,
        "aria-describedby": ariaDescribedby,
        bodyAriaLabel,
        bodyAriaRole,
        title,
        titleIconVariant,
        titleLabel,
        ouiaId,
        ouiaSafe,
        position,
        elementToFocus
      } = _a, props = __rest(_a, ["appendTo", "onEscapePress", "aria-labelledby", "aria-label", "aria-describedby", "bodyAriaLabel", "bodyAriaRole", "title", "titleIconVariant", "titleLabel", "ouiaId", "ouiaSafe", "position", "elementToFocus"]);
      const { container } = this.state;
      if (!canUseDOM || !container) {
        return null;
      }
      return ReactDOM3.createPortal(React24.createElement(ModalContent, Object.assign({}, props, { boxId: this.boxId, labelId: this.labelId, descriptorId: this.descriptorId, title, titleIconVariant, titleLabel, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, "aria-labelledby": ariaLabelledby, bodyAriaLabel, bodyAriaRole, ouiaId: ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe, position, elementToFocus })), container);
    }
  };
  Modal.displayName = "Modal";
  Modal.currentId = 0;
  Modal.defaultProps = {
    className: "",
    isOpen: false,
    title: "",
    titleIconVariant: null,
    titleLabel: "",
    "aria-label": "",
    showClose: true,
    "aria-describedby": "",
    "aria-labelledby": "",
    id: void 0,
    actions: [],
    onClose: () => void 0,
    variant: "default",
    hasNoBodyWrapper: false,
    appendTo: () => document.body,
    ouiaSafe: true,
    position: "default"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Accordion/Accordion.js
  init_tslib_es6();
  var React26 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Accordion/accordion.mjs
  var accordion_default = {
    "accordion": "pf-v5-c-accordion",
    "accordionExpandableContent": "pf-v5-c-accordion__expandable-content",
    "accordionExpandableContentBody": "pf-v5-c-accordion__expandable-content-body",
    "accordionToggle": "pf-v5-c-accordion__toggle",
    "accordionToggleIcon": "pf-v5-c-accordion__toggle-icon",
    "accordionToggleText": "pf-v5-c-accordion__toggle-text",
    "dirRtl": "pf-v5-m-dir-rtl",
    "modifiers": {
      "toggleStart": "pf-m-toggle-start",
      "displayLg": "pf-m-display-lg",
      "bordered": "pf-m-bordered",
      "expanded": "pf-m-expanded",
      "fixed": "pf-m-fixed"
    },
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Accordion/AccordionContext.js
  var React25 = __toESM(require_react());
  var AccordionContext = React25.createContext({});

  // node_modules/@patternfly/react-core/dist/esm/components/Accordion/Accordion.js
  var Accordion = (_a) => {
    var { children = null, className = "", "aria-label": ariaLabel, headingLevel = "h3", asDefinitionList = true, isBordered = false, displaySize = "default", togglePosition = "end" } = _a, props = __rest(_a, ["children", "className", "aria-label", "headingLevel", "asDefinitionList", "isBordered", "displaySize", "togglePosition"]);
    const AccordionList = asDefinitionList ? "dl" : "div";
    return React26.createElement(
      AccordionList,
      Object.assign({ className: css(accordion_default.accordion, isBordered && accordion_default.modifiers.bordered, togglePosition === "start" && accordion_default.modifiers.toggleStart, displaySize === "lg" && accordion_default.modifiers.displayLg, className), "aria-label": ariaLabel }, !asDefinitionList && ariaLabel && { role: "region" }, props),
      React26.createElement(AccordionContext.Provider, { value: {
        ContentContainer: asDefinitionList ? "dd" : "div",
        ToggleContainer: asDefinitionList ? "dt" : headingLevel,
        togglePosition
      } }, children)
    );
  };
  Accordion.displayName = "Accordion";

  // node_modules/@patternfly/react-core/dist/esm/components/Accordion/AccordionContent.js
  init_tslib_es6();
  var React28 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Accordion/AccordionExpandableContentBody.js
  var React27 = __toESM(require_react());
  var AccordionExpandableContentBody = ({ children = null }) => React27.createElement("div", { className: css(accordion_default.accordionExpandableContentBody) }, children);
  AccordionExpandableContentBody.displayName = "AccordionExpandableContentBody";

  // node_modules/@patternfly/react-core/dist/esm/components/Accordion/AccordionContent.js
  var AccordionContent = (_a) => {
    var { className = "", children = null, id = "", isHidden: isHidden3 = false, isFixed = false, isCustomContent = false, "aria-label": ariaLabel = "", "aria-labelledby": ariaLabelledby, component } = _a, props = __rest(_a, ["className", "children", "id", "isHidden", "isFixed", "isCustomContent", "aria-label", "aria-labelledby", "component"]);
    const [hasScrollbar, setHasScrollbar] = React28.useState(false);
    const containerRef = React28.useRef(null);
    React28.useEffect(() => {
      if ((containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) && isFixed && !isHidden3) {
        const { offsetHeight, scrollHeight } = containerRef.current;
        setHasScrollbar(offsetHeight < scrollHeight);
      } else if (!isFixed) {
        setHasScrollbar(false);
      }
    }, [containerRef, isFixed, isHidden3]);
    return React28.createElement(AccordionContext.Consumer, null, ({ ContentContainer }) => {
      const Container = component || ContentContainer;
      return React28.createElement(Container, Object.assign({ ref: containerRef, id, className: css(accordion_default.accordionExpandableContent, isFixed && accordion_default.modifiers.fixed, !isHidden3 && accordion_default.modifiers.expanded, className), hidden: isHidden3 }, ariaLabel && { "aria-label": ariaLabel }, ariaLabelledby && { "aria-labelledby": ariaLabelledby }, hasScrollbar && { tabIndex: 0 }, hasScrollbar && Container === "div" && { role: "region" }, props), isCustomContent ? children : React28.createElement(AccordionExpandableContentBody, null, children));
    });
  };
  AccordionContent.displayName = "AccordionContent";

  // node_modules/@patternfly/react-core/dist/esm/components/Accordion/AccordionItem.js
  var React29 = __toESM(require_react());
  var AccordionItem = ({ children = null }) => React29.createElement(React29.Fragment, null, children);
  AccordionItem.displayName = "AccordionItem";

  // node_modules/@patternfly/react-core/dist/esm/components/Accordion/AccordionToggle.js
  init_tslib_es6();
  var React30 = __toESM(require_react());

  // node_modules/@patternfly/react-icons/dist/esm/icons/angle-right-icon.js
  var AngleRightIconConfig = {
    name: "AngleRightIcon",
    height: 512,
    width: 256,
    svgPath: "M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z",
    yOffset: 0,
    xOffset: 0
  };
  var AngleRightIcon = createIcon(AngleRightIconConfig);
  var angle_right_icon_default = AngleRightIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Accordion/AccordionToggle.js
  var AccordionToggle = (_a) => {
    var { className = "", id, isExpanded = false, children = null, component } = _a, props = __rest(_a, ["className", "id", "isExpanded", "children", "component"]);
    const renderToggleIcon = () => React30.createElement(
      "span",
      { className: css(accordion_default.accordionToggleIcon) },
      React30.createElement(angle_right_icon_default, null)
    );
    return React30.createElement(AccordionContext.Consumer, null, ({ ToggleContainer, togglePosition }) => {
      const Container = component || ToggleContainer;
      const isToggleStartPositioned = togglePosition === "start";
      return React30.createElement(
        Container,
        null,
        React30.createElement(
          "button",
          Object.assign({ id, className: css(accordion_default.accordionToggle, isExpanded && accordion_default.modifiers.expanded, className), "aria-expanded": isExpanded, type: "button" }, props),
          isToggleStartPositioned && renderToggleIcon(),
          React30.createElement("span", { className: css(accordion_default.accordionToggleText) }, children),
          !isToggleStartPositioned && renderToggleIcon()
        )
      );
    });
  };
  AccordionToggle.displayName = "AccordionToggle";

  // node_modules/@patternfly/react-core/dist/esm/components/Alert/Alert.js
  init_tslib_es6();
  var React34 = __toESM(require_react());
  var import_react4 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Alert/alert.mjs
  var alert_default = {
    "alert": "pf-v5-c-alert",
    "alertAction": "pf-v5-c-alert__action",
    "alertActionGroup": "pf-v5-c-alert__action-group",
    "alertDescription": "pf-v5-c-alert__description",
    "alertIcon": "pf-v5-c-alert__icon",
    "alertTitle": "pf-v5-c-alert__title",
    "alertToggle": "pf-v5-c-alert__toggle",
    "alertToggleIcon": "pf-v5-c-alert__toggle-icon",
    "button": "pf-v5-c-button",
    "dirRtl": "pf-v5-m-dir-rtl",
    "modifiers": {
      "custom": "pf-m-custom",
      "success": "pf-m-success",
      "danger": "pf-m-danger",
      "warning": "pf-m-warning",
      "info": "pf-m-info",
      "inline": "pf-m-inline",
      "plain": "pf-m-plain",
      "expandable": "pf-m-expandable",
      "expanded": "pf-m-expanded",
      "truncate": "pf-m-truncate"
    },
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Alert/AlertIcon.js
  init_tslib_es6();
  var React31 = __toESM(require_react());
  var variantIcons = {
    success: check_circle_icon_default,
    danger: exclamation_circle_icon_default,
    warning: exclamation_triangle_icon_default,
    info: info_circle_icon_default,
    custom: bell_icon_default
  };
  var AlertIcon = (_a) => {
    var { variant, customIcon, className = "" } = _a, props = __rest(_a, ["variant", "customIcon", "className"]);
    const Icon2 = variantIcons[variant];
    return Icon2 ? React31.createElement("div", Object.assign({}, props, { className: css(alert_default.alertIcon, className) }), customIcon || React31.createElement(Icon2, null)) : null;
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Alert/AlertContext.js
  var React32 = __toESM(require_react());
  var AlertContext = React32.createContext(null);

  // node_modules/@patternfly/react-tokens/dist/esm/c_alert__title_max_lines.js
  var c_alert__title_max_lines = {
    "name": "--pf-v5-c-alert__title--max-lines",
    "value": "1",
    "var": "var(--pf-v5-c-alert__title--max-lines)"
  };
  var c_alert_title_max_lines_default = c_alert__title_max_lines;

  // node_modules/@patternfly/react-core/dist/esm/components/Alert/AlertToggleExpandButton.js
  init_tslib_es6();
  var React33 = __toESM(require_react());
  var AlertToggleExpandButton = (_a) => {
    var { "aria-label": ariaLabel = "", variantLabel, onToggleExpand, isExpanded = false } = _a, props = __rest(_a, ["aria-label", "variantLabel", "onToggleExpand", "isExpanded"]);
    const { title, variantLabel: alertVariantLabel } = React33.useContext(AlertContext);
    return React33.createElement(
      Button,
      Object.assign({ variant: ButtonVariant.plain, onClick: onToggleExpand, "aria-expanded": isExpanded, "aria-label": ariaLabel === "" ? `Toggle ${variantLabel || alertVariantLabel} alert: ${title}` : ariaLabel }, props),
      React33.createElement(
        "span",
        { className: css(alert_default.alertToggleIcon) },
        React33.createElement(angle_right_icon_default, { "aria-hidden": "true" })
      )
    );
  };
  AlertToggleExpandButton.displayName = "AlertToggleExpandButton";

  // node_modules/@patternfly/react-core/dist/esm/components/Alert/Alert.js
  var AlertVariant;
  (function(AlertVariant2) {
    AlertVariant2["success"] = "success";
    AlertVariant2["danger"] = "danger";
    AlertVariant2["warning"] = "warning";
    AlertVariant2["info"] = "info";
    AlertVariant2["custom"] = "custom";
  })(AlertVariant || (AlertVariant = {}));
  var Alert = (_a) => {
    var { variant = AlertVariant.custom, isInline = false, isPlain = false, isLiveRegion = false, variantLabel = `${capitalize(variant)} alert:`, actionClose, actionLinks, title, component = "h4", children = "", className = "", ouiaId, ouiaSafe = true, timeout: timeout2 = false, timeoutAnimation = 3e3, onTimeout = () => {
    }, truncateTitle = 0, tooltipPosition, customIcon, isExpandable = false, toggleAriaLabel = `${capitalize(variant)} alert details`, onMouseEnter = () => {
    }, onMouseLeave = () => {
    }, id } = _a, props = __rest(_a, ["variant", "isInline", "isPlain", "isLiveRegion", "variantLabel", "actionClose", "actionLinks", "title", "component", "children", "className", "ouiaId", "ouiaSafe", "timeout", "timeoutAnimation", "onTimeout", "truncateTitle", "tooltipPosition", "customIcon", "isExpandable", "toggleAriaLabel", "onMouseEnter", "onMouseLeave", "id"]);
    const ouiaProps = useOUIAProps(Alert.displayName, ouiaId, ouiaSafe, variant);
    const getHeadingContent = React34.createElement(
      React34.Fragment,
      null,
      React34.createElement("span", { className: "pf-v5-screen-reader" }, variantLabel),
      title
    );
    const titleRef = React34.useRef(null);
    const TitleComponent = component;
    const divRef = React34.useRef();
    const [isTooltipVisible, setIsTooltipVisible] = (0, import_react4.useState)(false);
    React34.useEffect(() => {
      if (!titleRef.current || !truncateTitle) {
        return;
      }
      titleRef.current.style.setProperty(c_alert_title_max_lines_default.name, truncateTitle.toString());
      const showTooltip = titleRef.current && titleRef.current.offsetHeight < titleRef.current.scrollHeight;
      if (isTooltipVisible !== showTooltip) {
        setIsTooltipVisible(showTooltip);
      }
    }, [titleRef, truncateTitle, isTooltipVisible]);
    const [timedOut, setTimedOut] = (0, import_react4.useState)(false);
    const [timedOutAnimation, setTimedOutAnimation] = (0, import_react4.useState)(true);
    const [isMouseOver, setIsMouseOver] = (0, import_react4.useState)();
    const [containsFocus, setContainsFocus] = (0, import_react4.useState)();
    const dismissed = timedOut && timedOutAnimation && !isMouseOver && !containsFocus;
    React34.useEffect(() => {
      const calculatedTimeout = timeout2 === true ? 8e3 : Number(timeout2);
      if (calculatedTimeout > 0) {
        const timer2 = setTimeout(() => setTimedOut(true), calculatedTimeout);
        return () => clearTimeout(timer2);
      }
    }, [timeout2]);
    React34.useEffect(() => {
      const onDocumentFocus = () => {
        if (divRef.current) {
          if (divRef.current.contains(document.activeElement)) {
            setContainsFocus(true);
            setTimedOutAnimation(false);
          } else if (containsFocus) {
            setContainsFocus(false);
          }
        }
      };
      document.addEventListener("focus", onDocumentFocus, true);
      return () => document.removeEventListener("focus", onDocumentFocus, true);
    }, [containsFocus]);
    React34.useEffect(() => {
      if (containsFocus === false || isMouseOver === false) {
        const timer2 = setTimeout(() => setTimedOutAnimation(true), timeoutAnimation);
        return () => clearTimeout(timer2);
      }
    }, [containsFocus, isMouseOver, timeoutAnimation]);
    React34.useEffect(() => {
      dismissed && onTimeout();
    }, [dismissed, onTimeout]);
    const [isExpanded, setIsExpanded] = (0, import_react4.useState)(false);
    const onToggleExpand = () => {
      setIsExpanded(!isExpanded);
    };
    const myOnMouseEnter = (ev) => {
      setIsMouseOver(true);
      setTimedOutAnimation(false);
      onMouseEnter(ev);
    };
    const myOnMouseLeave = (ev) => {
      setIsMouseOver(false);
      onMouseLeave(ev);
    };
    if (dismissed) {
      return null;
    }
    const Title2 = React34.createElement(TitleComponent, Object.assign({}, isTooltipVisible && { tabIndex: 0 }, { ref: titleRef, className: css(alert_default.alertTitle, truncateTitle && alert_default.modifiers.truncate) }), getHeadingContent);
    return React34.createElement(
      "div",
      Object.assign({ ref: divRef, className: css(alert_default.alert, isInline && alert_default.modifiers.inline, isPlain && alert_default.modifiers.plain, isExpandable && alert_default.modifiers.expandable, isExpanded && alert_default.modifiers.expanded, alert_default.modifiers[variant], className) }, ouiaProps, isLiveRegion && {
        "aria-live": "polite",
        "aria-atomic": "false"
      }, { onMouseEnter: myOnMouseEnter, onMouseLeave: myOnMouseLeave, id }, props),
      isExpandable && React34.createElement(
        AlertContext.Provider,
        { value: { title, variantLabel } },
        React34.createElement(
          "div",
          { className: css(alert_default.alertToggle) },
          React34.createElement(AlertToggleExpandButton, { isExpanded, onToggleExpand, "aria-label": toggleAriaLabel })
        )
      ),
      React34.createElement(AlertIcon, { variant, customIcon }),
      isTooltipVisible ? React34.createElement(Tooltip, { content: getHeadingContent, position: tooltipPosition }, Title2) : Title2,
      actionClose && React34.createElement(
        AlertContext.Provider,
        { value: { title, variantLabel } },
        React34.createElement("div", { className: css(alert_default.alertAction) }, actionClose)
      ),
      children && (!isExpandable || isExpandable && isExpanded) && React34.createElement("div", { className: css(alert_default.alertDescription) }, children),
      actionLinks && React34.createElement("div", { className: css(alert_default.alertActionGroup) }, actionLinks)
    );
  };
  Alert.displayName = "Alert";

  // node_modules/@patternfly/react-core/dist/esm/components/Alert/AlertActionCloseButton.js
  init_tslib_es6();
  var React35 = __toESM(require_react());
  var AlertActionCloseButton = (_a) => {
    var { className, onClose = () => void 0, "aria-label": ariaLabel = "", variantLabel } = _a, props = __rest(_a, ["className", "onClose", "aria-label", "variantLabel"]);
    return React35.createElement(AlertContext.Consumer, null, ({ title, variantLabel: alertVariantLabel }) => React35.createElement(
      Button,
      Object.assign({ variant: ButtonVariant.plain, onClick: onClose, "aria-label": ariaLabel === "" ? `Close ${variantLabel || alertVariantLabel} alert: ${title}` : ariaLabel, className }, props),
      React35.createElement(times_icon_default, null)
    ));
  };
  AlertActionCloseButton.displayName = "AlertActionCloseButton";

  // node_modules/@patternfly/react-core/dist/esm/components/Alert/AlertGroup.js
  init_tslib_es6();
  var React37 = __toESM(require_react());
  var ReactDOM4 = __toESM(require_react_dom());

  // node_modules/@patternfly/react-core/dist/esm/components/Alert/AlertGroupInline.js
  init_tslib_es6();
  var React36 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Alert/alert-group.mjs
  var alert_group_default = {
    "alertGroup": "pf-v5-c-alert-group",
    "alertGroupOverflowButton": "pf-v5-c-alert-group__overflow-button",
    "modifiers": {
      "toast": "pf-m-toast"
    }
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Alert/AlertGroupInline.js
  var AlertGroupInline = (_a) => {
    var { className, children, isToast, isLiveRegion, onOverflowClick, overflowMessage } = _a, rest = __rest(_a, ["className", "children", "isToast", "isLiveRegion", "onOverflowClick", "overflowMessage"]);
    return React36.createElement(
      "ul",
      Object.assign({ role: "list", "aria-live": isLiveRegion ? "polite" : null, "aria-atomic": isLiveRegion ? false : null, className: css(alert_group_default.alertGroup, className, isToast ? alert_group_default.modifiers.toast : "") }, rest),
      React36.Children.toArray(children).map((alert, index) => {
        var _a2;
        return React36.createElement("li", { key: ((_a2 = alert.props) === null || _a2 === void 0 ? void 0 : _a2.id) || index }, alert);
      }),
      overflowMessage && React36.createElement(
        "li",
        null,
        React36.createElement("button", { onClick: onOverflowClick, className: css(alert_group_default.alertGroupOverflowButton) }, overflowMessage)
      )
    );
  };
  AlertGroupInline.displayName = "AlertGroupInline";

  // node_modules/@patternfly/react-core/dist/esm/components/Alert/AlertGroup.js
  var AlertGroup = class extends React37.Component {
    constructor() {
      super(...arguments);
      this.state = {
        container: void 0
      };
    }
    componentDidMount() {
      const container = document.createElement("div");
      const target = this.getTargetElement();
      this.setState({ container });
      target.appendChild(container);
    }
    componentWillUnmount() {
      const target = this.getTargetElement();
      if (this.state.container) {
        target.removeChild(this.state.container);
      }
    }
    getTargetElement() {
      const appendTo = this.props.appendTo;
      if (typeof appendTo === "function") {
        return appendTo();
      }
      return appendTo || document.body;
    }
    render() {
      const _a = this.props, {
        className,
        children,
        isToast,
        isLiveRegion,
        onOverflowClick,
        overflowMessage,
        "aria-label": ariaLabel,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        appendTo
      } = _a, props = __rest(_a, ["className", "children", "isToast", "isLiveRegion", "onOverflowClick", "overflowMessage", "aria-label", "appendTo"]);
      const alertGroup = React37.createElement(AlertGroupInline, Object.assign({ onOverflowClick, className, isToast, isLiveRegion, overflowMessage, "aria-label": ariaLabel }, props), children);
      if (!this.props.isToast) {
        return alertGroup;
      }
      const container = this.state.container;
      if (!canUseDOM || !container) {
        return null;
      }
      return ReactDOM4.createPortal(alertGroup, container);
    }
  };
  AlertGroup.displayName = "AlertGroup";

  // node_modules/@patternfly/react-icons/dist/esm/icons/angle-up-icon.js
  var AngleUpIconConfig = {
    name: "AngleUpIcon",
    height: 512,
    width: 320,
    svgPath: "M177 159.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 255.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 329.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1z",
    yOffset: 0,
    xOffset: 0
  };
  var AngleUpIcon = createIcon(AngleUpIconConfig);
  var angle_up_icon_default = AngleUpIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Breadcrumb/Breadcrumb.js
  init_tslib_es6();
  var React38 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Breadcrumb/breadcrumb.mjs
  var breadcrumb_default = {
    "breadcrumb": "pf-v5-c-breadcrumb",
    "breadcrumbDropdown": "pf-v5-c-breadcrumb__dropdown",
    "breadcrumbHeading": "pf-v5-c-breadcrumb__heading",
    "breadcrumbItem": "pf-v5-c-breadcrumb__item",
    "breadcrumbItemDivider": "pf-v5-c-breadcrumb__item-divider",
    "breadcrumbLink": "pf-v5-c-breadcrumb__link",
    "breadcrumbList": "pf-v5-c-breadcrumb__list",
    "dirRtl": "pf-v5-m-dir-rtl",
    "dropdownToggle": "pf-v5-c-dropdown__toggle",
    "modifiers": {
      "current": "pf-m-current"
    }
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Breadcrumb/Breadcrumb.js
  var Breadcrumb = (_a) => {
    var { children = null, className = "", "aria-label": ariaLabel = "Breadcrumb", ouiaId, ouiaSafe = true } = _a, props = __rest(_a, ["children", "className", "aria-label", "ouiaId", "ouiaSafe"]);
    const ouiaProps = useOUIAProps(Breadcrumb.displayName, ouiaId, ouiaSafe);
    return React38.createElement(
      "nav",
      Object.assign({}, props, { "aria-label": ariaLabel, className: css(breadcrumb_default.breadcrumb, className) }, ouiaProps),
      React38.createElement("ol", { className: breadcrumb_default.breadcrumbList, role: "list" }, React38.Children.map(children, (child, index) => {
        const showDivider = index > 0;
        if (React38.isValidElement(child)) {
          return React38.cloneElement(child, { showDivider });
        }
        return child;
      }))
    );
  };
  Breadcrumb.displayName = "Breadcrumb";

  // node_modules/@patternfly/react-core/dist/esm/components/Breadcrumb/BreadcrumbItem.js
  init_tslib_es6();
  var React39 = __toESM(require_react());
  var BreadcrumbItem = (_a) => {
    var { children = null, className: classNameProp = "", to = void 0, isActive = false, isDropdown = false, showDivider, target = void 0, component = "a", render = void 0 } = _a, props = __rest(_a, ["children", "className", "to", "isActive", "isDropdown", "showDivider", "target", "component", "render"]);
    const Component40 = component;
    const ariaCurrent = isActive ? "page" : void 0;
    const className = css(breadcrumb_default.breadcrumbLink, isActive && breadcrumb_default.modifiers.current);
    return React39.createElement(
      "li",
      Object.assign({}, props, { className: css(breadcrumb_default.breadcrumbItem, classNameProp) }),
      showDivider && React39.createElement(
        "span",
        { className: breadcrumb_default.breadcrumbItemDivider },
        React39.createElement(angle_right_icon_default, null)
      ),
      component === "button" && React39.createElement("button", { className, "aria-current": ariaCurrent, type: "button" }, children),
      isDropdown && React39.createElement("span", { className: css(breadcrumb_default.breadcrumbDropdown) }, children),
      render && render({ className, ariaCurrent }),
      to && !render && React39.createElement(Component40, { href: to, target, className, "aria-current": ariaCurrent }, children),
      !to && component !== "button" && !isDropdown && children
    );
  };
  BreadcrumbItem.displayName = "BreadcrumbItem";

  // node_modules/@patternfly/react-core/dist/esm/components/CalendarMonth/CalendarMonth.js
  init_tslib_es6();
  var import_react8 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/TextInput/TextInput.js
  init_tslib_es6();
  var React41 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/FormControl/form-control.mjs
  var form_control_default = {
    "formControl": "pf-v5-c-form-control",
    "formControlIcon": "pf-v5-c-form-control__icon",
    "formControlToggleIcon": "pf-v5-c-form-control__toggle-icon",
    "formControlUtilities": "pf-v5-c-form-control__utilities",
    "modifiers": {
      "readonly": "pf-m-readonly",
      "success": "pf-m-success",
      "warning": "pf-m-warning",
      "error": "pf-m-error",
      "plain": "pf-m-plain",
      "expanded": "pf-m-expanded",
      "disabled": "pf-m-disabled",
      "icon": "pf-m-icon",
      "placeholder": "pf-m-placeholder",
      "resizeVertical": "pf-m-resize-vertical",
      "resizeHorizontal": "pf-m-resize-horizontal",
      "resizeBoth": "pf-m-resize-both",
      "status": "pf-m-status"
    },
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/FormControl/FormControlIcon.js
  init_tslib_es6();
  var React40 = __toESM(require_react());
  var statusIcons = {
    success: check_circle_icon_default,
    error: exclamation_circle_icon_default,
    warning: exclamation_triangle_icon_default
  };
  var FormControlIcon = (_a) => {
    var { status, customIcon, className } = _a, props = __rest(_a, ["status", "customIcon", "className"]);
    const StatusIcon = status && statusIcons[status];
    return React40.createElement("span", Object.assign({ className: css(form_control_default.formControlIcon, status && form_control_default.modifiers.status, className) }, props), customIcon || React40.createElement(StatusIcon, null));
  };

  // node_modules/@patternfly/react-core/dist/esm/components/TextInput/TextInput.js
  var TextInputTypes;
  (function(TextInputTypes2) {
    TextInputTypes2["text"] = "text";
    TextInputTypes2["date"] = "date";
    TextInputTypes2["datetimeLocal"] = "datetime-local";
    TextInputTypes2["email"] = "email";
    TextInputTypes2["month"] = "month";
    TextInputTypes2["number"] = "number";
    TextInputTypes2["password"] = "password";
    TextInputTypes2["search"] = "search";
    TextInputTypes2["tel"] = "tel";
    TextInputTypes2["time"] = "time";
    TextInputTypes2["url"] = "url";
  })(TextInputTypes || (TextInputTypes = {}));
  var TextInputReadOnlyVariant;
  (function(TextInputReadOnlyVariant2) {
    TextInputReadOnlyVariant2["default"] = "default";
    TextInputReadOnlyVariant2["plain"] = "plain";
  })(TextInputReadOnlyVariant || (TextInputReadOnlyVariant = {}));
  var TextInputBase = class _TextInputBase extends React41.Component {
    constructor(props) {
      super(props);
      this.inputRef = React41.createRef();
      this.observer = () => {
      };
      this.handleChange = (event) => {
        if (this.props.onChange) {
          this.props.onChange(event, event.currentTarget.value);
        }
      };
      this.handleResize = () => {
        const inputRef = this.props.innerRef || this.inputRef;
        if (inputRef && inputRef.current) {
          trimLeft(inputRef.current, String(this.props.value));
        }
      };
      this.restoreText = () => {
        const inputRef = this.props.innerRef || this.inputRef;
        inputRef.current.value = String(this.props.value);
        inputRef.current.scrollLeft = inputRef.current.scrollWidth;
      };
      this.onFocus = (event) => {
        const { isLeftTruncated, isStartTruncated, onFocus } = this.props;
        if (isLeftTruncated || isStartTruncated) {
          this.restoreText();
        }
        onFocus && onFocus(event);
      };
      this.onBlur = (event) => {
        const { isLeftTruncated, isStartTruncated, onBlur } = this.props;
        if (isLeftTruncated || isStartTruncated) {
          this.handleResize();
        }
        onBlur && onBlur(event);
      };
      this.sanitizeInputValue = (value) => typeof value === "string" ? value.replace(/\n/g, " ") : value;
      if (!props.id && !props["aria-label"] && !props["aria-labelledby"]) {
        console.error("Text input:", "Text input requires either an id or aria-label to be specified");
      }
      this.state = {
        ouiaStateId: getDefaultOUIAId(_TextInputBase.displayName)
      };
    }
    componentDidMount() {
      if (this.props.isLeftTruncated || this.props.isStartTruncated) {
        const inputRef = this.props.innerRef || this.inputRef;
        this.observer = getResizeObserver(inputRef.current, this.handleResize, true);
        this.handleResize();
      }
    }
    componentWillUnmount() {
      if (this.props.isLeftTruncated || this.props.isStartTruncated) {
        this.observer();
      }
    }
    render() {
      const _a = this.props, {
        innerRef,
        className,
        type,
        value,
        placeholder,
        validated,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        onChange,
        onFocus,
        onBlur,
        isLeftTruncated,
        isStartTruncated,
        isExpanded,
        expandedProps,
        readOnly,
        readOnlyVariant,
        isRequired,
        isDisabled,
        customIcon,
        ouiaId,
        ouiaSafe
      } = _a, props = __rest(_a, ["innerRef", "className", "type", "value", "placeholder", "validated", "onChange", "onFocus", "onBlur", "isLeftTruncated", "isStartTruncated", "isExpanded", "expandedProps", "readOnly", "readOnlyVariant", "isRequired", "isDisabled", "customIcon", "ouiaId", "ouiaSafe"]);
      const hasStatusIcon = ["success", "error", "warning"].includes(validated);
      const ariaExpandedProps = expandedProps ? { "aria-expanded": expandedProps === null || expandedProps === void 0 ? void 0 : expandedProps.isExpanded, "aria-controls": expandedProps === null || expandedProps === void 0 ? void 0 : expandedProps.ariaControls, role: "combobox" } : {};
      return React41.createElement(
        "span",
        { className: css(form_control_default.formControl, readOnlyVariant && form_control_default.modifiers.readonly, readOnlyVariant === "plain" && form_control_default.modifiers.plain, isDisabled && form_control_default.modifiers.disabled, (isExpanded || (expandedProps === null || expandedProps === void 0 ? void 0 : expandedProps.isExpanded)) && form_control_default.modifiers.expanded, customIcon && form_control_default.modifiers.icon, hasStatusIcon && form_control_default.modifiers[validated], className) },
        React41.createElement("input", Object.assign({}, props, { onFocus: this.onFocus, onBlur: this.onBlur, onChange: this.handleChange, type, value: this.sanitizeInputValue(value), "aria-invalid": props["aria-invalid"] ? props["aria-invalid"] : validated === ValidatedOptions.error }, ariaExpandedProps, { required: isRequired, disabled: isDisabled, readOnly: !!readOnlyVariant || readOnly, ref: innerRef || this.inputRef, placeholder }, getOUIAProps(TextInput.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe))),
        (customIcon || hasStatusIcon) && React41.createElement(
          "span",
          { className: css(form_control_default.formControlUtilities) },
          customIcon && React41.createElement(FormControlIcon, { customIcon }),
          hasStatusIcon && React41.createElement(FormControlIcon, { status: validated })
        )
      );
    }
  };
  TextInputBase.displayName = "TextInputBase";
  TextInputBase.defaultProps = {
    "aria-label": null,
    isRequired: false,
    validated: "default",
    isDisabled: false,
    isExpanded: false,
    type: TextInputTypes.text,
    isLeftTruncated: false,
    isStartTruncated: false,
    onChange: () => void 0,
    ouiaSafe: true
  };
  var TextInput = React41.forwardRef((props, ref) => React41.createElement(TextInputBase, Object.assign({}, props, { innerRef: ref })));
  TextInput.displayName = "TextInput";

  // node_modules/@patternfly/react-core/dist/esm/components/Select/Select.js
  init_tslib_es6();
  var import_react5 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/Menu.js
  init_tslib_es6();
  var React43 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Menu/menu.mjs
  var menu_default = {
    "breadcrumb": "pf-v5-c-breadcrumb",
    "check": "pf-v5-c-check",
    "dirRtl": "pf-v5-m-dir-rtl",
    "divider": "pf-v5-c-divider",
    "menu": "pf-v5-c-menu",
    "menuBreadcrumb": "pf-v5-c-menu__breadcrumb",
    "menuContent": "pf-v5-c-menu__content",
    "menuFooter": "pf-v5-c-menu__footer",
    "menuGroup": "pf-v5-c-menu__group",
    "menuGroupTitle": "pf-v5-c-menu__group-title",
    "menuHeader": "pf-v5-c-menu__header",
    "menuItem": "pf-v5-c-menu__item",
    "menuItemAction": "pf-v5-c-menu__item-action",
    "menuItemActionIcon": "pf-v5-c-menu__item-action-icon",
    "menuItemCheck": "pf-v5-c-menu__item-check",
    "menuItemDescription": "pf-v5-c-menu__item-description",
    "menuItemExternalIcon": "pf-v5-c-menu__item-external-icon",
    "menuItemIcon": "pf-v5-c-menu__item-icon",
    "menuItemMain": "pf-v5-c-menu__item-main",
    "menuItemSelectIcon": "pf-v5-c-menu__item-select-icon",
    "menuItemText": "pf-v5-c-menu__item-text",
    "menuItemToggleIcon": "pf-v5-c-menu__item-toggle-icon",
    "menuList": "pf-v5-c-menu__list",
    "menuListItem": "pf-v5-c-menu__list-item",
    "menuSearch": "pf-v5-c-menu__search",
    "modifiers": {
      "hidden": "pf-m-hidden",
      "hiddenOnSm": "pf-m-hidden-on-sm",
      "visibleOnSm": "pf-m-visible-on-sm",
      "hiddenOnMd": "pf-m-hidden-on-md",
      "visibleOnMd": "pf-m-visible-on-md",
      "hiddenOnLg": "pf-m-hidden-on-lg",
      "visibleOnLg": "pf-m-visible-on-lg",
      "hiddenOnXl": "pf-m-hidden-on-xl",
      "visibleOnXl": "pf-m-visible-on-xl",
      "hiddenOn_2xl": "pf-m-hidden-on-2xl",
      "visibleOn_2xl": "pf-m-visible-on-2xl",
      "flyout": "pf-m-flyout",
      "top": "pf-m-top",
      "left": "pf-m-left",
      "drilldown": "pf-m-drilldown",
      "drilledIn": "pf-m-drilled-in",
      "currentPath": "pf-m-current-path",
      "static": "pf-m-static",
      "plain": "pf-m-plain",
      "scrollable": "pf-m-scrollable",
      "nav": "pf-m-nav",
      "focus": "pf-m-focus",
      "disabled": "pf-m-disabled",
      "ariaDisabled": "pf-m-aria-disabled",
      "load": "pf-m-load",
      "loading": "pf-m-loading",
      "danger": "pf-m-danger",
      "selected": "pf-m-selected",
      "favorite": "pf-m-favorite",
      "favorited": "pf-m-favorited"
    },
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-styles/css/components/Dropdown/dropdown.mjs
  var dropdown_default = {
    "badge": "pf-v5-c-badge",
    "check": "pf-v5-c-check",
    "divider": "pf-v5-c-divider",
    "dropdown": "pf-v5-c-dropdown",
    "dropdownGroup": "pf-v5-c-dropdown__group",
    "dropdownGroupTitle": "pf-v5-c-dropdown__group-title",
    "dropdownMenu": "pf-v5-c-dropdown__menu",
    "dropdownMenuItem": "pf-v5-c-dropdown__menu-item",
    "dropdownMenuItemDescription": "pf-v5-c-dropdown__menu-item-description",
    "dropdownMenuItemIcon": "pf-v5-c-dropdown__menu-item-icon",
    "dropdownMenuItemMain": "pf-v5-c-dropdown__menu-item-main",
    "dropdownToggle": "pf-v5-c-dropdown__toggle",
    "dropdownToggleButton": "pf-v5-c-dropdown__toggle-button",
    "dropdownToggleCheck": "pf-v5-c-dropdown__toggle-check",
    "dropdownToggleIcon": "pf-v5-c-dropdown__toggle-icon",
    "dropdownToggleImage": "pf-v5-c-dropdown__toggle-image",
    "dropdownToggleProgress": "pf-v5-c-dropdown__toggle-progress",
    "dropdownToggleText": "pf-v5-c-dropdown__toggle-text",
    "menu": "pf-v5-c-menu",
    "modifiers": {
      "fullHeight": "pf-m-full-height",
      "expanded": "pf-m-expanded",
      "action": "pf-m-action",
      "disabled": "pf-m-disabled",
      "plain": "pf-m-plain",
      "text": "pf-m-text",
      "splitButton": "pf-m-split-button",
      "primary": "pf-m-primary",
      "inProgress": "pf-m-in-progress",
      "active": "pf-m-active",
      "secondary": "pf-m-secondary",
      "top": "pf-m-top",
      "static": "pf-m-static",
      "alignRight": "pf-m-align-right",
      "alignLeft": "pf-m-align-left",
      "alignRightOnSm": "pf-m-align-right-on-sm",
      "alignLeftOnSm": "pf-m-align-left-on-sm",
      "alignRightOnMd": "pf-m-align-right-on-md",
      "alignLeftOnMd": "pf-m-align-left-on-md",
      "alignRightOnLg": "pf-m-align-right-on-lg",
      "alignLeftOnLg": "pf-m-align-left-on-lg",
      "alignRightOnXl": "pf-m-align-right-on-xl",
      "alignLeftOnXl": "pf-m-align-left-on-xl",
      "alignRightOn_2xl": "pf-m-align-right-on-2xl",
      "alignLeftOn_2xl": "pf-m-align-left-on-2xl",
      "ariaDisabled": "pf-m-aria-disabled",
      "icon": "pf-m-icon",
      "description": "pf-m-description"
    },
    "spinner": "pf-v5-c-spinner",
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/MenuContext.js
  var React42 = __toESM(require_react());
  var MenuContext = React42.createContext({
    menuId: null,
    parentMenu: null,
    onActionClick: () => null,
    onSelect: () => null,
    activeItemId: null,
    selected: null,
    drilledInMenus: [],
    drilldownItemPath: [],
    onDrillIn: null,
    onDrillOut: null,
    onGetMenuHeight: () => null,
    flyoutRef: null,
    setFlyoutRef: () => null,
    disableHover: false,
    role: "menu"
  });
  var MenuItemContext = React42.createContext({
    itemId: null,
    isDisabled: false
  });

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/Menu.js
  var MenuBase = class extends React43.Component {
    constructor(props) {
      super(props);
      this.menuRef = React43.createRef();
      this.activeMenu = null;
      this.state = {
        ouiaStateId: getDefaultOUIAId(Menu.displayName),
        transitionMoveTarget: null,
        flyoutRef: null,
        disableHover: false,
        currentDrilldownMenuId: this.props.id
      };
      this.handleDrilldownTransition = (event) => {
        const current = this.menuRef.current;
        if (!current || current !== event.target.closest(`.${menu_default.menu}`) && !Array.from(current.getElementsByClassName(menu_default.menu)).includes(event.target.closest(`.${menu_default.menu}`))) {
          return;
        }
        if (this.state.transitionMoveTarget) {
          this.state.transitionMoveTarget.focus();
          this.setState({ transitionMoveTarget: null });
        } else {
          const nextMenu = current.querySelector("#" + this.props.activeMenu) || current || null;
          const nextMenuLists = nextMenu.getElementsByTagName("UL");
          if (nextMenuLists.length === 0) {
            return;
          }
          const nextMenuChildren = Array.from(nextMenuLists[0].children);
          if (!this.state.currentDrilldownMenuId || nextMenu.id !== this.state.currentDrilldownMenuId) {
            this.setState({ currentDrilldownMenuId: nextMenu.id });
          } else {
            return;
          }
          const nextTarget = nextMenuChildren.filter((el) => !(el.classList.contains("pf-m-disabled") || el.classList.contains(menu_default.divider)))[0].firstChild;
          nextTarget.focus();
          nextTarget.tabIndex = 0;
        }
      };
      this.handleExtraKeys = (event) => {
        const isDrilldown = this.props.containsDrilldown;
        const activeElement = document.activeElement;
        if (event.target.closest(`.${menu_default.menu}`) !== this.activeMenu && !event.target.classList.contains(breadcrumb_default.breadcrumbLink)) {
          this.activeMenu = event.target.closest(`.${menu_default.menu}`);
          this.setState({ disableHover: true });
        }
        if (event.target.tagName === "INPUT") {
          return;
        }
        const parentMenu = this.activeMenu;
        const key = event.key;
        const isFromBreadcrumb = activeElement.classList.contains(breadcrumb_default.breadcrumbLink) || activeElement.classList.contains(dropdown_default.dropdownToggle);
        if (key === " " || key === "Enter") {
          event.preventDefault();
          if (isDrilldown && !isFromBreadcrumb) {
            const isDrillingOut = activeElement.closest("li").classList.contains("pf-m-current-path");
            if (isDrillingOut && parentMenu.parentElement.tagName === "LI") {
              activeElement.tabIndex = -1;
              parentMenu.parentElement.firstChild.tabIndex = 0;
              this.setState({ transitionMoveTarget: parentMenu.parentElement.firstChild });
            } else {
              if (activeElement.nextElementSibling && activeElement.nextElementSibling.classList.contains(menu_default.menu)) {
                const childItems = Array.from(activeElement.nextElementSibling.getElementsByTagName("UL")[0].children).filter((el) => !(el.classList.contains("pf-m-disabled") || el.classList.contains(menu_default.divider)));
                activeElement.tabIndex = -1;
                childItems[0].firstChild.tabIndex = 0;
                this.setState({ transitionMoveTarget: childItems[0].firstChild });
              }
            }
          }
          document.activeElement.click();
        }
      };
      this.createNavigableElements = () => {
        const isDrilldown = this.props.containsDrilldown;
        if (isDrilldown) {
          return this.activeMenu ? Array.from(this.activeMenu.getElementsByTagName("UL")[0].children).filter((el) => !(el.classList.contains("pf-m-disabled") || el.classList.contains(menu_default.divider))) : [];
        } else {
          return this.menuRef.current ? Array.from(this.menuRef.current.getElementsByTagName("LI")).filter((el) => !(el.classList.contains("pf-m-disabled") || el.classList.contains(menu_default.divider))) : [];
        }
      };
      if (props.innerRef) {
        this.menuRef = props.innerRef;
      }
    }
    allowTabFirstItem() {
      const current = this.menuRef.current;
      if (current) {
        const first = current.querySelector("ul button:not(:disabled), ul a:not(:disabled)");
        if (first) {
          first.tabIndex = 0;
        }
      }
    }
    componentDidMount() {
      if (this.context) {
        this.setState({ disableHover: this.context.disableHover });
      }
      if (canUseDOM) {
        window.addEventListener("transitionend", this.props.isRootMenu ? this.handleDrilldownTransition : null);
      }
      this.allowTabFirstItem();
    }
    componentWillUnmount() {
      if (canUseDOM) {
        window.removeEventListener("transitionend", this.handleDrilldownTransition);
      }
    }
    componentDidUpdate(prevProps) {
      if (prevProps.children !== this.props.children) {
        this.allowTabFirstItem();
      }
    }
    render() {
      const _a = this.props, {
        id,
        children,
        className,
        onSelect,
        selected = null,
        onActionClick,
        ouiaId,
        ouiaSafe,
        containsFlyout,
        isNavFlyout,
        containsDrilldown,
        isMenuDrilledIn,
        isPlain,
        isScrollable,
        drilldownItemPath,
        drilledInMenus,
        onDrillIn,
        onDrillOut,
        onGetMenuHeight,
        parentMenu = null,
        activeItemId = null,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        innerRef,
        isRootMenu,
        activeMenu,
        role
      } = _a, props = __rest(_a, ["id", "children", "className", "onSelect", "selected", "onActionClick", "ouiaId", "ouiaSafe", "containsFlyout", "isNavFlyout", "containsDrilldown", "isMenuDrilledIn", "isPlain", "isScrollable", "drilldownItemPath", "drilledInMenus", "onDrillIn", "onDrillOut", "onGetMenuHeight", "parentMenu", "activeItemId", "innerRef", "isRootMenu", "activeMenu", "role"]);
      const _isMenuDrilledIn = isMenuDrilledIn || drilledInMenus && drilledInMenus.includes(id) || false;
      return React43.createElement(
        MenuContext.Provider,
        { value: {
          menuId: id,
          parentMenu: parentMenu || id,
          onSelect,
          onActionClick,
          activeItemId,
          selected,
          drilledInMenus,
          drilldownItemPath,
          onDrillIn,
          onDrillOut,
          onGetMenuHeight,
          flyoutRef: this.state.flyoutRef,
          setFlyoutRef: (flyoutRef) => this.setState({ flyoutRef }),
          disableHover: this.state.disableHover,
          role
        } },
        isRootMenu && React43.createElement(KeyboardHandler, { containerRef: this.menuRef || null, additionalKeyHandler: this.handleExtraKeys, createNavigableElements: this.createNavigableElements, isActiveElement: (element) => document.activeElement.closest("li") === element || // if element is a basic MenuItem
        document.activeElement.parentElement === element || document.activeElement.closest(`.${menu_default.menuSearch}`) === element || // if element is a MenuSearch
        document.activeElement.closest("ol") && document.activeElement.closest("ol").firstChild === element, getFocusableElement: (navigableElement) => {
          var _a2, _b;
          return (navigableElement === null || navigableElement === void 0 ? void 0 : navigableElement.tagName) === "DIV" && navigableElement.querySelector("input") || // for MenuSearchInput
          ((_a2 = navigableElement.firstChild) === null || _a2 === void 0 ? void 0 : _a2.tagName) === "LABEL" && navigableElement.querySelector("input") || // for MenuItem checkboxes
          ((_b = navigableElement.firstChild) === null || _b === void 0 ? void 0 : _b.tagName) === "DIV" && navigableElement.querySelector("a, button, input") || // For aria-disabled element that is rendered inside a div with "display: contents" styling
          navigableElement.firstChild;
        }, noHorizontalArrowHandling: document.activeElement && (document.activeElement.classList.contains(breadcrumb_default.breadcrumbLink) || document.activeElement.classList.contains(dropdown_default.dropdownToggle) || document.activeElement.tagName === "INPUT"), noEnterHandling: true, noSpaceHandling: true }),
        React43.createElement("div", Object.assign({ id, className: css(menu_default.menu, isPlain && menu_default.modifiers.plain, isScrollable && menu_default.modifiers.scrollable, containsFlyout && menu_default.modifiers.flyout, isNavFlyout && menu_default.modifiers.nav, containsDrilldown && menu_default.modifiers.drilldown, _isMenuDrilledIn && menu_default.modifiers.drilledIn, className), ref: this.menuRef }, getOUIAProps(Menu.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe), props), children)
      );
    }
  };
  MenuBase.displayName = "Menu";
  MenuBase.contextType = MenuContext;
  MenuBase.defaultProps = {
    ouiaSafe: true,
    isRootMenu: true,
    isPlain: false,
    isScrollable: false,
    role: "menu"
  };
  var Menu = React43.forwardRef((props, ref) => React43.createElement(MenuBase, Object.assign({}, props, { innerRef: ref })));
  Menu.displayName = "Menu";

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/MenuContent.js
  init_tslib_es6();
  var React44 = __toESM(require_react());

  // node_modules/@patternfly/react-tokens/dist/esm/c_menu__content_Height.js
  var c_menu__content_Height = {
    "name": "--pf-v5-c-menu__content--Height",
    "value": "auto",
    "var": "var(--pf-v5-c-menu__content--Height)"
  };
  var c_menu_content_Height_default = c_menu__content_Height;

  // node_modules/@patternfly/react-tokens/dist/esm/c_menu__content_MaxHeight.js
  var c_menu__content_MaxHeight = {
    "name": "--pf-v5-c-menu__content--MaxHeight",
    "value": "18.75rem",
    "var": "var(--pf-v5-c-menu__content--MaxHeight)"
  };
  var c_menu_content_MaxHeight_default = c_menu__content_MaxHeight;

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/MenuContent.js
  var MenuContent = React44.forwardRef((props, ref) => {
    const { getHeight, children, menuHeight, maxMenuHeight } = props, rest = __rest(props, ["getHeight", "children", "menuHeight", "maxMenuHeight"]);
    const menuContentRef = React44.createRef();
    const refCallback = (el, menuId, onGetMenuHeight) => {
      if (el) {
        let clientHeight = el.clientHeight;
        let rootMenuList = null;
        let parentEl = el.closest(`.${menu_default.menuList}`);
        while (parentEl !== null && parentEl.nodeType === 1) {
          if (parentEl.classList.contains(menu_default.menuList)) {
            rootMenuList = parentEl;
          }
          parentEl = parentEl.parentElement;
        }
        if (rootMenuList) {
          const rootMenuListStyles = getComputedStyle(rootMenuList);
          const rootMenuListPaddingOffset = parseFloat(rootMenuListStyles.getPropertyValue("padding-top").replace(/px/g, "")) + parseFloat(rootMenuListStyles.getPropertyValue("padding-bottom").replace(/px/g, "")) + parseFloat(getComputedStyle(rootMenuList.parentElement).getPropertyValue("border-bottom-width").replace(/px/g, ""));
          clientHeight = clientHeight + rootMenuListPaddingOffset;
        }
        onGetMenuHeight && onGetMenuHeight(menuId, clientHeight);
        getHeight && getHeight(clientHeight.toString());
      }
      return ref || menuContentRef;
    };
    return React44.createElement(MenuContext.Consumer, null, ({ menuId, onGetMenuHeight }) => React44.createElement("div", Object.assign({}, rest, { className: css(menu_default.menuContent, props.className), ref: (el) => refCallback(el, menuId, onGetMenuHeight), style: Object.assign(Object.assign({}, menuHeight && { [c_menu_content_Height_default.name]: menuHeight }), maxMenuHeight && { [c_menu_content_MaxHeight_default.name]: maxMenuHeight }) }), children));
  });
  MenuContent.displayName = "MenuContent";

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/MenuItem.js
  init_tslib_es6();
  var React47 = __toESM(require_react());

  // node_modules/@patternfly/react-tokens/dist/esm/c_menu_m_flyout__menu_top_offset.js
  var c_menu_m_flyout__menu_top_offset = {
    "name": "--pf-v5-c-menu--m-flyout__menu--top-offset",
    "value": "0px",
    "var": "var(--pf-v5-c-menu--m-flyout__menu--top-offset)"
  };
  var c_menu_m_flyout_menu_top_offset_default = c_menu_m_flyout__menu_top_offset;

  // node_modules/@patternfly/react-tokens/dist/esm/c_menu_m_flyout__menu_m_left_right_offset.js
  var c_menu_m_flyout__menu_m_left_right_offset = {
    "name": "--pf-v5-c-menu--m-flyout__menu--m-left--right-offset",
    "value": "0px",
    "var": "var(--pf-v5-c-menu--m-flyout__menu--m-left--right-offset)"
  };
  var c_menu_m_flyout_menu_m_left_right_offset_default = c_menu_m_flyout__menu_m_left_right_offset;

  // node_modules/@patternfly/react-tokens/dist/esm/c_menu_m_flyout__menu_left_offset.js
  var c_menu_m_flyout__menu_left_offset = {
    "name": "--pf-v5-c-menu--m-flyout__menu--left-offset",
    "value": "0px",
    "var": "var(--pf-v5-c-menu--m-flyout__menu--left-offset)"
  };
  var c_menu_m_flyout_menu_left_offset_default = c_menu_m_flyout__menu_left_offset;

  // node_modules/@patternfly/react-icons/dist/esm/icons/external-link-alt-icon.js
  var ExternalLinkAltIconConfig = {
    name: "ExternalLinkAltIcon",
    height: 512,
    width: 512,
    svgPath: "M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z",
    yOffset: 0,
    xOffset: 0
  };
  var ExternalLinkAltIcon = createIcon(ExternalLinkAltIconConfig);
  var external_link_alt_icon_default = ExternalLinkAltIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/angle-left-icon.js
  var AngleLeftIconConfig = {
    name: "AngleLeftIcon",
    height: 512,
    width: 256,
    svgPath: "M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z",
    yOffset: 0,
    xOffset: 0
  };
  var AngleLeftIcon = createIcon(AngleLeftIconConfig);
  var angle_left_icon_default = AngleLeftIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/check-icon.js
  var CheckIconConfig = {
    name: "CheckIcon",
    height: 512,
    width: 512,
    svgPath: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z",
    yOffset: 0,
    xOffset: 0
  };
  var CheckIcon = createIcon(CheckIconConfig);
  var check_icon_default = CheckIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Checkbox/Checkbox.js
  init_tslib_es6();
  var React45 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Check/check.mjs
  var check_default = {
    "check": "pf-v5-c-check",
    "checkBody": "pf-v5-c-check__body",
    "checkDescription": "pf-v5-c-check__description",
    "checkInput": "pf-v5-c-check__input",
    "checkLabel": "pf-v5-c-check__label",
    "checkLabelRequired": "pf-v5-c-check__label-required",
    "modifiers": {
      "standalone": "pf-m-standalone",
      "disabled": "pf-m-disabled"
    }
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Checkbox/Checkbox.js
  var defaultOnChange = () => {
  };
  var Checkbox = class _Checkbox extends React45.Component {
    constructor(props) {
      super(props);
      this.handleChange = (event) => {
        this.props.onChange(event, event.currentTarget.checked);
      };
      this.state = {
        ouiaStateId: getDefaultOUIAId(_Checkbox.displayName)
      };
    }
    render() {
      const _a = this.props, { "aria-label": ariaLabel, className, inputClassName, onChange, isLabelWrapped, isLabelBeforeButton, isValid, isDisabled, isRequired, isChecked, label, checked, defaultChecked, description, body, ouiaId, ouiaSafe, component } = _a, props = __rest(_a, ["aria-label", "className", "inputClassName", "onChange", "isLabelWrapped", "isLabelBeforeButton", "isValid", "isDisabled", "isRequired", "isChecked", "label", "checked", "defaultChecked", "description", "body", "ouiaId", "ouiaSafe", "component"]);
      if (!props.id) {
        console.error("Checkbox:", "id is required to make input accessible");
      }
      const checkedProps = {};
      if ([true, false].includes(checked) || isChecked === true) {
        checkedProps.checked = checked || isChecked;
      }
      if (onChange !== defaultOnChange) {
        checkedProps.checked = isChecked;
      }
      if ([false, true].includes(defaultChecked)) {
        checkedProps.defaultChecked = defaultChecked;
      }
      const inputRendered = React45.createElement("input", Object.assign({}, props, { className: css(check_default.checkInput, inputClassName), type: "checkbox", onChange: this.handleChange, "aria-invalid": !isValid, "aria-label": ariaLabel, disabled: isDisabled, required: isRequired, ref: (elem) => elem && (elem.indeterminate = isChecked === null) }, checkedProps, getOUIAProps(_Checkbox.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe)));
      const wrapWithLabel = isLabelWrapped && !component || component === "label";
      const Label2 = wrapWithLabel ? "span" : "label";
      const labelRendered = label ? React45.createElement(
        Label2,
        { className: css(check_default.checkLabel, isDisabled && check_default.modifiers.disabled), htmlFor: !wrapWithLabel ? props.id : void 0 },
        label,
        isRequired && React45.createElement("span", { className: css(check_default.checkLabelRequired), "aria-hidden": "true" }, ASTERISK)
      ) : null;
      const Component40 = component !== null && component !== void 0 ? component : wrapWithLabel ? "label" : "div";
      checkedProps.checked = checkedProps.checked === null ? false : checkedProps.checked;
      return React45.createElement(
        Component40,
        { className: css(check_default.check, !label && check_default.modifiers.standalone, className), htmlFor: wrapWithLabel ? props.id : void 0 },
        isLabelBeforeButton ? React45.createElement(
          React45.Fragment,
          null,
          labelRendered,
          inputRendered
        ) : React45.createElement(
          React45.Fragment,
          null,
          inputRendered,
          labelRendered
        ),
        description && React45.createElement("span", { className: css(check_default.checkDescription) }, description),
        body && React45.createElement("span", { className: css(check_default.checkBody) }, body)
      );
    }
  };
  Checkbox.displayName = "Checkbox";
  Checkbox.defaultProps = {
    className: "",
    isLabelWrapped: false,
    isValid: true,
    isDisabled: false,
    isRequired: false,
    isChecked: false,
    onChange: defaultOnChange,
    ouiaSafe: true
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/MenuItemAction.js
  init_tslib_es6();
  var React46 = __toESM(require_react());

  // node_modules/@patternfly/react-icons/dist/esm/icons/star-icon.js
  var StarIconConfig = {
    name: "StarIcon",
    height: 512,
    width: 576,
    svgPath: "M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z",
    yOffset: 0,
    xOffset: 0
  };
  var StarIcon = createIcon(StarIconConfig);
  var star_icon_default = StarIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/MenuItemAction.js
  var MenuItemActionBase = (_a) => {
    var { className = "", icon, onClick, "aria-label": ariaLabel, isFavorited = null, isDisabled, actionId, innerRef } = _a, props = __rest(_a, ["className", "icon", "onClick", "aria-label", "isFavorited", "isDisabled", "actionId", "innerRef"]);
    return React46.createElement(MenuContext.Consumer, null, ({ onActionClick }) => React46.createElement(MenuItemContext.Consumer, null, ({ itemId, isDisabled: isDisabledContext }) => {
      const onClickButton = (event) => {
        onClick && onClick(event);
        onActionClick && onActionClick(event, itemId, actionId);
      };
      return React46.createElement(
        "button",
        Object.assign({ className: css(menu_default.menuItemAction, isFavorited !== null && menu_default.modifiers.favorite, isFavorited && menu_default.modifiers.favorited, className), "aria-label": ariaLabel, onClick: onClickButton }, (isDisabled === true || isDisabledContext === true) && { disabled: true }, { ref: innerRef, tabIndex: -1 }, props),
        React46.createElement("span", { className: css(menu_default.menuItemActionIcon) }, icon === "favorites" || isFavorited !== null ? React46.createElement(star_icon_default, { "aria-hidden": true }) : icon)
      );
    }));
  };
  var MenuItemAction = React46.forwardRef((props, ref) => React46.createElement(MenuItemActionBase, Object.assign({}, props, { innerRef: ref })));
  MenuItemAction.displayName = "MenuItemAction";

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/MenuItem.js
  var FlyoutContext = React47.createContext({
    direction: "right"
  });
  var MenuItemBase = (_a) => {
    var { children, className, itemId = null, to, hasCheckbox = false, isActive = null, isFavorited = null, isLoadButton = false, isLoading = false, flyoutMenu, direction, description = null, onClick = () => {
    }, component = "button", isDisabled = false, isAriaDisabled = false, isExternalLink = false, isSelected = null, isFocused, isDanger = false, icon, actions, onShowFlyout, drilldownMenu, isOnPath, innerRef, id, "aria-label": ariaLabel, tooltipProps, rel, target, download } = _a, props = __rest(_a, ["children", "className", "itemId", "to", "hasCheckbox", "isActive", "isFavorited", "isLoadButton", "isLoading", "flyoutMenu", "direction", "description", "onClick", "component", "isDisabled", "isAriaDisabled", "isExternalLink", "isSelected", "isFocused", "isDanger", "icon", "actions", "onShowFlyout", "drilldownMenu", "isOnPath", "innerRef", "id", "aria-label", "tooltipProps", "rel", "target", "download"]);
    const { menuId, parentMenu, onSelect, onActionClick, activeItemId, selected, drilldownItemPath, onDrillIn, onDrillOut, flyoutRef, setFlyoutRef, disableHover, role: menuRole } = React47.useContext(MenuContext);
    let Component40 = to ? "a" : component;
    if (hasCheckbox && !to) {
      Component40 = "label";
    }
    const [flyoutTarget, setFlyoutTarget] = React47.useState(null);
    const flyoutContext = React47.useContext(FlyoutContext);
    const [flyoutXDirection, setFlyoutXDirection] = React47.useState(flyoutContext.direction);
    const ref = React47.useRef();
    const flyoutVisible = ref === flyoutRef;
    const hasFlyout = flyoutMenu !== void 0;
    const showFlyout = (show) => {
      if (!flyoutVisible && show) {
        setFlyoutRef(ref);
      } else if (flyoutVisible && !show) {
        setFlyoutRef(null);
      }
      onShowFlyout && show && onShowFlyout();
    };
    useIsomorphicLayoutEffect(() => {
      if (hasFlyout && ref.current && canUseDOM) {
        const flyoutMenu2 = ref.current.lastElementChild;
        if (flyoutMenu2 && flyoutMenu2.classList.contains(menu_default.menu)) {
          const origin = ref.current.getClientRects()[0];
          const rect = flyoutMenu2.getClientRects()[0];
          if (origin && rect) {
            const spaceLeftLeft = origin.x - rect.width;
            const spaceLeftRight = window.innerWidth - origin.x - origin.width - rect.width;
            let xDir = flyoutXDirection;
            if (spaceLeftRight < 0 && xDir !== "left") {
              setFlyoutXDirection("left");
              xDir = "left";
            } else if (spaceLeftLeft < 0 && xDir !== "right") {
              setFlyoutXDirection("right");
              xDir = "right";
            }
            let xOffset = 0;
            if (spaceLeftLeft < 0 && spaceLeftRight < 0) {
              xOffset = xDir === "right" ? -spaceLeftRight : -spaceLeftLeft;
            }
            if (xDir === "left") {
              flyoutMenu2.classList.add(menu_default.modifiers.left);
              flyoutMenu2.style.setProperty(c_menu_m_flyout_menu_m_left_right_offset_default.name, `-${xOffset}px`);
            } else {
              flyoutMenu2.style.setProperty(c_menu_m_flyout_menu_left_offset_default.name, `-${xOffset}px`);
            }
            const spaceLeftBot = window.innerHeight - origin.y - rect.height;
            const spaceLeftTop = window.innerHeight - rect.height;
            if (spaceLeftTop < 0 && spaceLeftBot < 0) {
            } else if (spaceLeftBot < 0) {
              flyoutMenu2.style.setProperty(c_menu_m_flyout_menu_top_offset_default.name, `${spaceLeftBot}px`);
            }
          }
        }
      }
    }, [flyoutVisible, flyoutMenu]);
    React47.useEffect(() => {
      setFlyoutXDirection(flyoutContext.direction);
    }, [flyoutContext]);
    React47.useEffect(() => {
      if (flyoutTarget) {
        if (flyoutVisible) {
          const flyoutMenu2 = flyoutTarget.nextElementSibling;
          const flyoutItems = Array.from(flyoutMenu2.getElementsByTagName("UL")[0].children).filter((el) => !(el.classList.contains("pf-m-disabled") || el.classList.contains(menu_default.divider)));
          flyoutItems[0].firstChild.focus();
        } else {
          flyoutTarget.focus();
        }
      }
    }, [flyoutVisible, flyoutTarget]);
    const handleFlyout = (event) => {
      const key = event.key;
      const target2 = event.target;
      const type = event.type;
      if (key === " " || key === "Enter" || key === "ArrowRight" || type === "click") {
        event.stopPropagation();
        event.preventDefault();
        if (!flyoutVisible) {
          showFlyout(true);
          setFlyoutTarget(target2);
        }
      }
      if (key === "Escape" || key === "ArrowLeft") {
        if (flyoutVisible) {
          event.stopPropagation();
          showFlyout(false);
        }
      }
    };
    const onItemSelect = (event, onSelect2) => {
      if (!isAriaDisabled) {
        onSelect2 && onSelect2(event, itemId);
        onClick && onClick(event);
      }
    };
    const _isOnPath = isOnPath && isOnPath || drilldownItemPath && drilldownItemPath.includes(itemId) || false;
    let drill;
    if (direction) {
      if (direction === "down") {
        drill = (event) => onDrillIn && onDrillIn(event, menuId, typeof drilldownMenu === "function" ? drilldownMenu().props.id : drilldownMenu.props.id, itemId);
      } else {
        drill = (event) => onDrillOut && onDrillOut(event, parentMenu, itemId);
      }
    }
    let additionalProps = {};
    if (Component40 === "a") {
      additionalProps = {
        href: to,
        "aria-disabled": isDisabled || isAriaDisabled ? true : null,
        // prevent invalid 'disabled' attribute on <a> tags
        disabled: null,
        target: isExternalLink ? "_blank" : target,
        rel,
        download
      };
    } else if (Component40 === "button") {
      additionalProps = {
        type: "button",
        "aria-disabled": isAriaDisabled ? true : null
      };
    }
    if (isOnPath) {
      additionalProps["aria-expanded"] = true;
    } else if (hasFlyout) {
      additionalProps["aria-haspopup"] = "menu";
      additionalProps["aria-expanded"] = flyoutVisible;
    }
    const getAriaCurrent = () => {
      if (isActive !== null) {
        if (isActive) {
          return "page";
        } else {
          return null;
        }
      } else if (itemId !== null && activeItemId !== null) {
        return itemId === activeItemId;
      }
      return null;
    };
    const getIsSelected = () => {
      if (isSelected !== null) {
        return isSelected;
      } else if (selected !== null && itemId !== null) {
        return Array.isArray(selected) && selected.includes(itemId) || itemId === selected;
      }
      return false;
    };
    const onMouseOver = () => {
      if (disableHover) {
        return;
      }
      if (hasFlyout) {
        showFlyout(true);
      } else {
        setFlyoutRef(null);
      }
    };
    React47.useEffect(() => {
      if (isFocused && ref.current) {
        const itemEl = ref.current;
        const parentListEl = itemEl.parentElement;
        if (parentListEl) {
          const isAboveTop = itemEl.offsetTop - parentListEl.offsetTop < parentListEl.scrollTop;
          const isBelowBottom = itemEl.offsetTop - parentListEl.offsetTop + itemEl.clientHeight;
          if (isAboveTop || isBelowBottom) {
            itemEl.scrollIntoView({ behavior: "auto", block: "nearest" });
          }
        }
      }
    }, [isFocused]);
    const isSelectMenu = menuRole === "listbox";
    const renderItem = React47.createElement(
      React47.Fragment,
      null,
      React47.createElement(GenerateId, null, (randomId) => React47.createElement(
        Component40,
        Object.assign({ id, tabIndex: -1, className: css(menu_default.menuItem, getIsSelected() && !hasCheckbox && menu_default.modifiers.selected, className), "aria-current": getAriaCurrent() }, !hasCheckbox && { disabled: isDisabled, "aria-label": ariaLabel }, !hasCheckbox && !flyoutMenu && { role: isSelectMenu ? "option" : "menuitem" }, !hasCheckbox && !flyoutMenu && isSelectMenu && { "aria-selected": getIsSelected() }, { ref: innerRef }, !hasCheckbox && {
          onClick: (event) => {
            if (!isAriaDisabled) {
              onItemSelect(event, onSelect);
              drill && drill(event);
              flyoutMenu && handleFlyout(event);
            } else {
              event.preventDefault();
            }
          }
        }, hasCheckbox && { htmlFor: randomId }, additionalProps),
        React47.createElement(
          "span",
          { className: css(menu_default.menuItemMain) },
          direction === "up" && React47.createElement(
            "span",
            { className: css(menu_default.menuItemToggleIcon) },
            React47.createElement(angle_left_icon_default, { "aria-hidden": true })
          ),
          icon && React47.createElement("span", { className: css(menu_default.menuItemIcon) }, icon),
          hasCheckbox && React47.createElement(
            "span",
            { className: css(menu_default.menuItemCheck) },
            React47.createElement(Checkbox, { id: randomId, component: "span", isChecked: isSelected || false, onChange: (event) => onItemSelect(event, onSelect), isDisabled, "aria-disabled": isAriaDisabled })
          ),
          React47.createElement("span", { className: css(menu_default.menuItemText) }, children),
          isExternalLink && React47.createElement(
            "span",
            { className: css(menu_default.menuItemExternalIcon) },
            React47.createElement(external_link_alt_icon_default, { "aria-hidden": true })
          ),
          (flyoutMenu || direction === "down") && React47.createElement(
            "span",
            { className: css(menu_default.menuItemToggleIcon) },
            React47.createElement(angle_right_icon_default, { "aria-hidden": true })
          ),
          getIsSelected() && React47.createElement(
            "span",
            { className: css(menu_default.menuItemSelectIcon) },
            React47.createElement(check_icon_default, { "aria-hidden": true })
          )
        ),
        description && direction !== "up" && React47.createElement(
          "span",
          { className: css(menu_default.menuItemDescription) },
          React47.createElement("span", null, description)
        )
      )),
      flyoutVisible && React47.createElement(
        MenuContext.Provider,
        { value: { disableHover } },
        React47.createElement(FlyoutContext.Provider, { value: { direction: flyoutXDirection } }, flyoutMenu)
      ),
      typeof drilldownMenu === "function" ? drilldownMenu() : drilldownMenu,
      React47.createElement(
        MenuItemContext.Provider,
        { value: { itemId, isDisabled } },
        actions,
        isFavorited !== null && React47.createElement(MenuItemAction, { icon: "favorites", isFavorited, "aria-label": isFavorited ? "starred" : "not starred", onClick: (event) => onActionClick(event, itemId), tabIndex: -1, actionId: "fav" })
      )
    );
    return React47.createElement("li", Object.assign({ className: css(menu_default.menuListItem, isDisabled && menu_default.modifiers.disabled, isAriaDisabled && menu_default.modifiers.ariaDisabled, _isOnPath && menu_default.modifiers.currentPath, isLoadButton && menu_default.modifiers.load, isLoading && menu_default.modifiers.loading, isFocused && menu_default.modifiers.focus, isDanger && menu_default.modifiers.danger, className), onMouseOver: () => {
      if (!isAriaDisabled) {
        onMouseOver();
      }
    } }, flyoutMenu && !isAriaDisabled && { onKeyDown: handleFlyout }, { ref, role: !hasCheckbox ? "none" : "menuitem" }, hasCheckbox && { "aria-label": ariaLabel }, props), tooltipProps ? React47.createElement(Tooltip, Object.assign({}, tooltipProps), renderItem) : renderItem);
  };
  var MenuItem = React47.forwardRef((props, ref) => React47.createElement(MenuItemBase, Object.assign({}, props, { innerRef: ref })));
  MenuItem.displayName = "MenuItem";

  // node_modules/@patternfly/react-core/dist/esm/components/Menu/MenuList.js
  init_tslib_es6();
  var React48 = __toESM(require_react());
  var MenuList = (_a) => {
    var { children = null, className, isAriaMultiselectable = false, "aria-label": ariaLabel } = _a, props = __rest(_a, ["children", "className", "isAriaMultiselectable", "aria-label"]);
    const { role } = React48.useContext(MenuContext);
    return React48.createElement("ul", Object.assign({ role }, role === "listbox" && { "aria-multiselectable": isAriaMultiselectable }, { className: css(menu_default.menuList, className), "aria-label": ariaLabel }, props), children);
  };
  MenuList.displayName = "MenuList";

  // node_modules/@patternfly/react-core/dist/esm/components/Select/Select.js
  var SelectBase = (_a) => {
    var { children, className, onSelect, isOpen, selected, toggle, shouldFocusToggleOnSelect = false, shouldFocusFirstItemOnOpen = true, onOpenChange, onOpenChangeKeys = ["Escape", "Tab"], isPlain, innerRef, zIndex = 9999, role = "listbox", popperProps, menuHeight, maxMenuHeight, isScrollable } = _a, props = __rest(_a, ["children", "className", "onSelect", "isOpen", "selected", "toggle", "shouldFocusToggleOnSelect", "shouldFocusFirstItemOnOpen", "onOpenChange", "onOpenChangeKeys", "isPlain", "innerRef", "zIndex", "role", "popperProps", "menuHeight", "maxMenuHeight", "isScrollable"]);
    const localMenuRef = import_react5.default.useRef();
    const localToggleRef = import_react5.default.useRef();
    const menuRef = innerRef || localMenuRef;
    const toggleRef = typeof toggle === "function" || typeof toggle !== "function" && !toggle.toggleRef ? localToggleRef : toggle === null || toggle === void 0 ? void 0 : toggle.toggleRef;
    import_react5.default.useEffect(() => {
      const handleMenuKeys = (event) => {
        var _a2, _b, _c;
        if (isOpen && onOpenChange && (((_a2 = menuRef.current) === null || _a2 === void 0 ? void 0 : _a2.contains(event.target)) || ((_b = toggleRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target)))) {
          if (onOpenChangeKeys.includes(event.key)) {
            event.preventDefault();
            onOpenChange(false);
            (_c = toggleRef.current) === null || _c === void 0 ? void 0 : _c.focus();
          }
        }
      };
      const handleClick = (event) => {
        var _a2, _b, _c;
        if (isOpen && shouldFocusFirstItemOnOpen && ((_a2 = toggleRef.current) === null || _a2 === void 0 ? void 0 : _a2.contains(event.target))) {
          setTimeout(() => {
            var _a3;
            const firstElement = (_a3 = menuRef === null || menuRef === void 0 ? void 0 : menuRef.current) === null || _a3 === void 0 ? void 0 : _a3.querySelector("li button:not(:disabled),li input:not(:disabled)");
            firstElement && firstElement.focus();
          }, 10);
        }
        if (isOpen && onOpenChange && !((_b = toggleRef === null || toggleRef === void 0 ? void 0 : toggleRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target))) {
          if (isOpen && !((_c = menuRef.current) === null || _c === void 0 ? void 0 : _c.contains(event.target))) {
            onOpenChange(false);
          }
        }
      };
      window.addEventListener("keydown", handleMenuKeys);
      window.addEventListener("click", handleClick);
      return () => {
        window.removeEventListener("keydown", handleMenuKeys);
        window.removeEventListener("click", handleClick);
      };
    }, [isOpen, menuRef, toggleRef, onOpenChange, onOpenChangeKeys]);
    const menu = import_react5.default.createElement(
      Menu,
      Object.assign({ role, className: css(className), ref: menuRef, onSelect: (event, value) => {
        onSelect && onSelect(event, value);
        shouldFocusToggleOnSelect && toggleRef.current.focus();
      }, isPlain, selected, isScrollable: isScrollable !== null && isScrollable !== void 0 ? isScrollable : menuHeight !== void 0 || maxMenuHeight !== void 0 }, getOUIAProps(Select.displayName, props.ouiaId !== void 0 ? props.ouiaId : getDefaultOUIAId(Select.displayName), props.ouiaSafe !== void 0 ? props.ouiaSafe : true), props),
      import_react5.default.createElement(MenuContent, { menuHeight, maxMenuHeight }, children)
    );
    return import_react5.default.createElement(Popper, Object.assign({ trigger: typeof toggle === "function" ? toggle(toggleRef) : toggle.toggleNode, triggerRef: toggleRef, popper: menu, popperRef: menuRef, isVisible: isOpen, zIndex }, popperProps));
  };
  var Select = import_react5.default.forwardRef((props, ref) => import_react5.default.createElement(SelectBase, Object.assign({ innerRef: ref }, props)));
  Select.displayName = "Select";

  // node_modules/@patternfly/react-core/dist/esm/components/Select/SelectList.js
  init_tslib_es6();
  var import_react6 = __toESM(require_react());
  var SelectList = (_a) => {
    var { children, className, isAriaMultiselectable = false } = _a, props = __rest(_a, ["children", "className", "isAriaMultiselectable"]);
    return import_react6.default.createElement(MenuList, Object.assign({ isAriaMultiselectable, className: css(className) }, props), children);
  };
  SelectList.displayName = "SelectList";

  // node_modules/@patternfly/react-core/dist/esm/components/Select/SelectOption.js
  init_tslib_es6();
  var import_react7 = __toESM(require_react());
  var SelectOptionBase = (_a) => {
    var { children, className, innerRef, value } = _a, props = __rest(_a, ["children", "className", "innerRef", "value"]);
    return import_react7.default.createElement(MenuItem, Object.assign({ itemId: value, ref: innerRef, className: css(className) }, props), children);
  };
  var SelectOption = import_react7.default.forwardRef((props, ref) => import_react7.default.createElement(SelectOptionBase, Object.assign({}, props, { innerRef: ref })));
  SelectOption.displayName = "SelectOption";

  // node_modules/@patternfly/react-core/dist/esm/components/MenuToggle/MenuToggle.js
  init_tslib_es6();
  var React52 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/MenuToggle/menu-toggle.mjs
  var menu_toggle_default = {
    "check": "pf-v5-c-check",
    "checkInput": "pf-v5-c-check__input",
    "menuToggle": "pf-v5-c-menu-toggle",
    "menuToggleButton": "pf-v5-c-menu-toggle__button",
    "menuToggleControls": "pf-v5-c-menu-toggle__controls",
    "menuToggleCount": "pf-v5-c-menu-toggle__count",
    "menuToggleIcon": "pf-v5-c-menu-toggle__icon",
    "menuToggleStatusIcon": "pf-v5-c-menu-toggle__status-icon",
    "menuToggleText": "pf-v5-c-menu-toggle__text",
    "menuToggleToggleIcon": "pf-v5-c-menu-toggle__toggle-icon",
    "modifiers": {
      "primary": "pf-m-primary",
      "secondary": "pf-m-secondary",
      "expanded": "pf-m-expanded",
      "plain": "pf-m-plain",
      "text": "pf-m-text",
      "fullHeight": "pf-m-full-height",
      "disabled": "pf-m-disabled",
      "typeahead": "pf-m-typeahead",
      "splitButton": "pf-m-split-button",
      "action": "pf-m-action",
      "active": "pf-m-active",
      "fullWidth": "pf-m-full-width",
      "success": "pf-m-success",
      "warning": "pf-m-warning",
      "danger": "pf-m-danger"
    },
    "textInputGroup": "pf-v5-c-text-input-group",
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-icons/dist/esm/icons/caret-down-icon.js
  var CaretDownIconConfig = {
    name: "CaretDownIcon",
    height: 512,
    width: 320,
    svgPath: "M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z",
    yOffset: 0,
    xOffset: 0
  };
  var CaretDownIcon = createIcon(CaretDownIconConfig);
  var caret_down_icon_default = CaretDownIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/MenuToggle/MenuToggle.js
  var MenuToggleStatus;
  (function(MenuToggleStatus2) {
    MenuToggleStatus2["success"] = "success";
    MenuToggleStatus2["danger"] = "danger";
    MenuToggleStatus2["warning"] = "warning";
  })(MenuToggleStatus || (MenuToggleStatus = {}));
  var MenuToggleBase = class extends React52.Component {
    constructor() {
      super(...arguments);
      this.displayName = "MenuToggleBase";
      this.state = {
        ouiaStateId: getDefaultOUIAId(MenuToggle.displayName, this.props.variant)
      };
    }
    render() {
      const _a = this.props, { children, className, icon, badge, isExpanded, isDisabled, isFullHeight, isFullWidth, splitButtonOptions, variant, status, statusIcon, innerRef, onClick, "aria-label": ariaLabel, ouiaId, ouiaSafe } = _a, otherProps = __rest(_a, ["children", "className", "icon", "badge", "isExpanded", "isDisabled", "isFullHeight", "isFullWidth", "splitButtonOptions", "variant", "status", "statusIcon", "innerRef", "onClick", "aria-label", "ouiaId", "ouiaSafe"]);
      const isPlain = variant === "plain";
      const isPlainText = variant === "plainText";
      const isTypeahead = variant === "typeahead";
      const ouiaProps = getOUIAProps(MenuToggle.displayName, ouiaId !== null && ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe);
      let _statusIcon = statusIcon;
      if (!statusIcon) {
        switch (status) {
          case MenuToggleStatus.success:
            _statusIcon = React52.createElement(check_circle_icon_default, { "aria-hidden": "true" });
            break;
          case MenuToggleStatus.warning:
            _statusIcon = React52.createElement(exclamation_triangle_icon_default, { "aria-hidden": "true" });
            break;
          case MenuToggleStatus.danger:
            _statusIcon = React52.createElement(exclamation_circle_icon_default, { "aria-hidden": "true" });
            break;
        }
      }
      const toggleControls = React52.createElement(
        "span",
        { className: css(menu_toggle_default.menuToggleControls) },
        status !== void 0 && React52.createElement("span", { className: css(menu_toggle_default.menuToggleStatusIcon) }, _statusIcon),
        React52.createElement(
          "span",
          { className: css(menu_toggle_default.menuToggleToggleIcon) },
          React52.createElement(caret_down_icon_default, { "aria-hidden": true })
        )
      );
      const content = React52.createElement(
        React52.Fragment,
        null,
        icon && React52.createElement("span", { className: css(menu_toggle_default.menuToggleIcon) }, icon),
        isTypeahead ? children : React52.createElement("span", { className: css(menu_toggle_default.menuToggleText) }, children),
        React52.isValidElement(badge) && React52.createElement("span", { className: css(menu_toggle_default.menuToggleCount) }, badge),
        isTypeahead ? React52.createElement("button", Object.assign({ type: "button", className: css(menu_toggle_default.menuToggleButton), "aria-expanded": isExpanded, onClick, "aria-label": ariaLabel || "Menu toggle", tabIndex: -1 }, ouiaProps), toggleControls) : toggleControls
      );
      const commonStyles = css(menu_toggle_default.menuToggle, isExpanded && menu_toggle_default.modifiers.expanded, variant === "primary" && menu_toggle_default.modifiers.primary, variant === "secondary" && menu_toggle_default.modifiers.secondary, status && menu_toggle_default.modifiers[status], (isPlain || isPlainText) && menu_toggle_default.modifiers.plain, isPlainText && menu_toggle_default.modifiers.text, isFullHeight && menu_toggle_default.modifiers.fullHeight, isFullWidth && menu_toggle_default.modifiers.fullWidth, isDisabled && menu_toggle_default.modifiers.disabled, className);
      const componentProps = Object.assign(Object.assign({ children: isPlain ? children : content }, isDisabled && { disabled: true }), otherProps);
      if (isTypeahead) {
        return React52.createElement("div", Object.assign({ ref: innerRef, className: css(commonStyles, menu_toggle_default.modifiers.typeahead) }, componentProps));
      }
      if (splitButtonOptions) {
        return React52.createElement(
          "div",
          { ref: innerRef, className: css(commonStyles, menu_toggle_default.modifiers.splitButton, (splitButtonOptions === null || splitButtonOptions === void 0 ? void 0 : splitButtonOptions.variant) === "action" && menu_toggle_default.modifiers.action) },
          splitButtonOptions === null || splitButtonOptions === void 0 ? void 0 : splitButtonOptions.items,
          React52.createElement(
            "button",
            Object.assign({ className: css(menu_toggle_default.menuToggleButton, children && menu_toggle_default.modifiers.text), type: "button", "aria-expanded": isExpanded, "aria-label": ariaLabel, disabled: isDisabled, onClick }, otherProps, ouiaProps),
            children && React52.createElement("span", { className: css(menu_toggle_default.menuToggleText) }, children),
            toggleControls
          )
        );
      }
      return React52.createElement("button", Object.assign({ className: css(commonStyles), type: "button", "aria-label": ariaLabel, "aria-expanded": isExpanded, ref: innerRef, disabled: isDisabled, onClick }, componentProps, ouiaProps));
    }
  };
  MenuToggleBase.defaultProps = {
    className: "",
    isExpanded: false,
    isDisabled: false,
    isFullWidth: false,
    isFullHeight: false,
    ouiaSafe: true
  };
  var MenuToggle = React52.forwardRef((props, ref) => React52.createElement(MenuToggleBase, Object.assign({ innerRef: ref }, props)));
  MenuToggle.displayName = "MenuToggle";

  // node_modules/@patternfly/react-core/dist/esm/components/InputGroup/InputGroup.js
  init_tslib_es6();
  var React53 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/InputGroup/input-group.mjs
  var input_group_default = {
    "inputGroup": "pf-v5-c-input-group",
    "inputGroupItem": "pf-v5-c-input-group__item",
    "inputGroupText": "pf-v5-c-input-group__text",
    "modifiers": {
      "box": "pf-m-box",
      "plain": "pf-m-plain",
      "disabled": "pf-m-disabled",
      "fill": "pf-m-fill"
    },
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/InputGroup/InputGroup.js
  var InputGroupBase = (_a) => {
    var { className, children, innerRef } = _a, props = __rest(_a, ["className", "children", "innerRef"]);
    const ref = React53.useRef(null);
    const inputGroupRef = innerRef || ref;
    return React53.createElement("div", Object.assign({ ref: inputGroupRef, className: css(input_group_default.inputGroup, className) }, props), children);
  };
  InputGroupBase.displayName = "InputGroupBase";
  var InputGroup = React53.forwardRef((props, ref) => React53.createElement(InputGroupBase, Object.assign({ innerRef: ref }, props)));
  InputGroup.displayName = "InputGroup";

  // node_modules/@patternfly/react-core/dist/esm/components/InputGroup/InputGroupItem.js
  init_tslib_es6();
  var React54 = __toESM(require_react());
  var InputGroupItem = (_a) => {
    var { className, children, isFill = false, isBox = false, isPlain, isDisabled } = _a, props = __rest(_a, ["className", "children", "isFill", "isBox", "isPlain", "isDisabled"]);
    return React54.createElement("div", Object.assign({ className: css(input_group_default.inputGroupItem, isFill && input_group_default.modifiers.fill, isBox && input_group_default.modifiers.box, isPlain && input_group_default.modifiers.plain, isDisabled && input_group_default.modifiers.disabled, className) }, props), children);
  };
  InputGroupItem.displayName = "InputGroupItem";

  // node_modules/@patternfly/react-styles/css/components/CalendarMonth/calendar-month.mjs
  var calendar_month_default = {
    "calendarMonth": "pf-v5-c-calendar-month",
    "calendarMonthCalendar": "pf-v5-c-calendar-month__calendar",
    "calendarMonthDate": "pf-v5-c-calendar-month__date",
    "calendarMonthDatesCell": "pf-v5-c-calendar-month__dates-cell",
    "calendarMonthDatesRow": "pf-v5-c-calendar-month__dates-row",
    "calendarMonthDay": "pf-v5-c-calendar-month__day",
    "calendarMonthDays": "pf-v5-c-calendar-month__days",
    "calendarMonthHeader": "pf-v5-c-calendar-month__header",
    "calendarMonthHeaderMonth": "pf-v5-c-calendar-month__header-month",
    "calendarMonthHeaderNavControl": "pf-v5-c-calendar-month__header-nav-control",
    "calendarMonthHeaderYear": "pf-v5-c-calendar-month__header-year",
    "dirRtl": "pf-v5-m-dir-rtl",
    "modifiers": {
      "prevMonth": "pf-m-prev-month",
      "nextMonth": "pf-m-next-month",
      "current": "pf-m-current",
      "inRange": "pf-m-in-range",
      "startRange": "pf-m-start-range",
      "endRange": "pf-m-end-range",
      "adjacentMonth": "pf-m-adjacent-month",
      "selected": "pf-m-selected",
      "disabled": "pf-m-disabled",
      "hover": "pf-m-hover",
      "focus": "pf-m-focus"
    },
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/CalendarMonth/CalendarMonth.js
  var Weekday;
  (function(Weekday2) {
    Weekday2[Weekday2["Sunday"] = 0] = "Sunday";
    Weekday2[Weekday2["Monday"] = 1] = "Monday";
    Weekday2[Weekday2["Tuesday"] = 2] = "Tuesday";
    Weekday2[Weekday2["Wednesday"] = 3] = "Wednesday";
    Weekday2[Weekday2["Thursday"] = 4] = "Thursday";
    Weekday2[Weekday2["Friday"] = 5] = "Friday";
    Weekday2[Weekday2["Saturday"] = 6] = "Saturday";
  })(Weekday || (Weekday = {}));
  var buildCalendar = (year, month, weekStart, validators) => {
    const defaultDate = new Date(year, month);
    const firstDayOfWeek = new Date(defaultDate);
    firstDayOfWeek.setDate(firstDayOfWeek.getDate() - firstDayOfWeek.getDay() + weekStart);
    const calendarWeeks = [];
    if (firstDayOfWeek.getMonth() === defaultDate.getMonth() && firstDayOfWeek.getDate() !== 1) {
      firstDayOfWeek.setDate(firstDayOfWeek.getDate() - 7);
    }
    for (let i = 0; i < 6; i++) {
      const week = [];
      for (let j = 0; j < 7; j++) {
        const date2 = new Date(firstDayOfWeek);
        week.push({
          date: date2,
          isValid: validators.every((validator) => validator(date2))
        });
        firstDayOfWeek.setDate(firstDayOfWeek.getDate() + 1);
      }
      calendarWeeks.push(week);
      if (firstDayOfWeek.getMonth() !== defaultDate.getMonth()) {
        break;
      }
    }
    return calendarWeeks;
  };
  var isSameDate = (d1, d2) => d1.getFullYear() === d2.getFullYear() && d1.getMonth() === d2.getMonth() && d1.getDate() === d2.getDate();
  var today = /* @__PURE__ */ new Date();
  var CalendarMonth = (_a) => {
    var {
      date: dateProp,
      locale: locale3 = void 0,
      monthFormat = (date2) => date2.toLocaleDateString(locale3, { month: "long" }),
      weekdayFormat = (date2) => date2.toLocaleDateString(locale3, { weekday: "narrow" }),
      longWeekdayFormat = (date2) => date2.toLocaleDateString(locale3, { weekday: "long" }),
      dayFormat = (date2) => date2.getDate(),
      weekStart = 0,
      // Use the American Sunday as a default
      onChange = () => {
      },
      validators = [() => true],
      className,
      onSelectToggle = () => {
      },
      onMonthChange = () => {
      },
      rangeStart,
      prevMonthAriaLabel = "Previous month",
      nextMonthAriaLabel = "Next month",
      yearInputAriaLabel = "Select year",
      cellAriaLabel,
      isDateFocused = false,
      inlineProps
    } = _a, props = __rest(_a, ["date", "locale", "monthFormat", "weekdayFormat", "longWeekdayFormat", "dayFormat", "weekStart", "onChange", "validators", "className", "onSelectToggle", "onMonthChange", "rangeStart", "prevMonthAriaLabel", "nextMonthAriaLabel", "yearInputAriaLabel", "cellAriaLabel", "isDateFocused", "inlineProps"]);
    const longMonths = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map((monthNum) => new Date(1990, monthNum)).map(monthFormat);
    const [isSelectOpen, setIsSelectOpen] = import_react8.default.useState(false);
    const getInitialDate = () => {
      if (isValidDate(dateProp)) {
        return dateProp;
      }
      if (isValidDate(rangeStart)) {
        return rangeStart;
      }
      return today;
    };
    const initialDate = getInitialDate();
    const [focusedDate, setFocusedDate] = import_react8.default.useState(initialDate);
    const yearFormat = (date2) => date2.getFullYear();
    const yearFormatted = yearFormat(focusedDate);
    const [yearInput, setYearInput] = import_react8.default.useState(yearFormatted.toString());
    const [hoveredDate, setHoveredDate] = import_react8.default.useState(void 0);
    const focusRef = import_react8.default.useRef();
    const [hiddenMonthId] = import_react8.default.useState(getUniqueId("hidden-month-span"));
    const [shouldFocus, setShouldFocus] = import_react8.default.useState(false);
    const isValidated = (date2) => validators.every((validator) => validator(date2));
    const focusedDateValidated = isValidated(focusedDate);
    (0, import_react8.useEffect)(() => {
      if (isValidDate(dateProp) && !isSameDate(focusedDate, dateProp)) {
        setFocusedDate(dateProp);
      } else if (!dateProp) {
        setFocusedDate(today);
      }
    }, [dateProp]);
    (0, import_react8.useEffect)(() => {
      if ((shouldFocus || isDateFocused) && focusedDateValidated && focusRef.current) {
        focusRef.current.focus();
      }
    }, [focusedDate, isDateFocused, focusedDateValidated, focusRef]);
    const onMonthClick = (ev, newDate2) => {
      setFocusedDate(newDate2);
      setShouldFocus(false);
      onMonthChange(ev, newDate2);
      setYearInput(yearFormat(newDate2).toString());
    };
    const onKeyDown = (ev) => {
      const newDate2 = new Date(focusedDate);
      if (ev.key === "ArrowUp") {
        newDate2.setDate(newDate2.getDate() - 7);
      } else if (ev.key === "ArrowRight") {
        newDate2.setDate(newDate2.getDate() + 1);
      } else if (ev.key === "ArrowDown") {
        newDate2.setDate(newDate2.getDate() + 7);
      } else if (ev.key === "ArrowLeft") {
        newDate2.setDate(newDate2.getDate() - 1);
      }
      if (newDate2.getTime() !== focusedDate.getTime() && isValidated(newDate2)) {
        ev.preventDefault();
        setFocusedDate(newDate2);
        setShouldFocus(true);
      }
    };
    const changeYear = (newYear) => changeMonth(focusedDate.getMonth(), newYear);
    const changeMonth = (newMonth, newYear) => new Date(newYear !== null && newYear !== void 0 ? newYear : focusedDate.getFullYear(), newMonth, 1);
    const MIN_YEAR = 1900;
    const MAX_YEAR = 2100;
    const handleYearInputChange = (event, yearStr) => {
      if (!/^\d{0,4}$/.test(yearStr)) {
        return;
      }
      setYearInput(yearStr);
      if (yearStr.length === 4) {
        const yearNum = Number(yearStr);
        if (yearNum >= MIN_YEAR && yearNum <= MAX_YEAR) {
          const newDate2 = changeYear(yearNum);
          setFocusedDate(newDate2);
          setShouldFocus(false);
          event.target.focus();
          onMonthChange(event, newDate2);
        } else {
          setYearInput(yearFormatted.toString());
        }
      }
    };
    const addMonth = (toAdd) => {
      let newMonth = focusedDate.getMonth() + toAdd;
      let newYear = focusedDate.getFullYear();
      if (newMonth === -1) {
        newMonth = 11;
        newYear--;
      } else if (newMonth === 12) {
        newMonth = 0;
        newYear++;
      }
      return changeMonth(newMonth, newYear);
    };
    const prevMonth = addMonth(-1);
    const nextMonth = addMonth(1);
    const focusedYear = focusedDate.getFullYear();
    const focusedMonth = focusedDate.getMonth();
    const calendar2 = import_react8.default.useMemo(() => buildCalendar(focusedYear, focusedMonth, weekStart, validators), [focusedYear, focusedMonth, weekStart, validators]);
    if (!focusedDateValidated) {
      const toFocus = calendar2.reduce((acc, cur) => [...acc, ...cur], []).filter(({ date: date2, isValid }) => isValid && date2.getMonth() === focusedMonth).map(({ date: date2 }) => ({ date: date2, days: Math.abs(focusedDate.getTime() - date2.getTime()) })).sort((o1, o2) => o1.days - o2.days).map(({ date: date2 }) => date2)[0];
      if (toFocus) {
        setFocusedDate(toFocus);
      }
    }
    const isHoveredDateValid = hoveredDate && isValidated(hoveredDate);
    const monthFormatted = monthFormat(focusedDate);
    const calendarToRender = import_react8.default.createElement(
      "div",
      Object.assign({ className: css(calendar_month_default.calendarMonth, className) }, props),
      import_react8.default.createElement(
        "div",
        { className: calendar_month_default.calendarMonthHeader },
        import_react8.default.createElement(
          "div",
          { className: css(calendar_month_default.calendarMonthHeaderNavControl, calendar_month_default.modifiers.prevMonth) },
          import_react8.default.createElement(
            Button,
            { variant: "plain", "aria-label": prevMonthAriaLabel, onClick: (ev) => onMonthClick(ev, prevMonth) },
            import_react8.default.createElement(angle_left_icon_default, { "aria-hidden": true })
          )
        ),
        import_react8.default.createElement(
          InputGroup,
          null,
          import_react8.default.createElement(
            InputGroupItem,
            { isFill: true },
            import_react8.default.createElement(
              "div",
              { className: calendar_month_default.calendarMonthHeaderMonth },
              import_react8.default.createElement("span", { id: hiddenMonthId, hidden: true }, "Month"),
              import_react8.default.createElement(
                Select,
                { toggle: (toggleRef) => import_react8.default.createElement(MenuToggle, { ref: toggleRef, onClick: () => setIsSelectOpen(!isSelectOpen), isExpanded: isSelectOpen, style: { width: "140px" } }, monthFormatted), "aria-labelledby": hiddenMonthId, isOpen: isSelectOpen, onOpenChange: (isOpen) => {
                  setIsSelectOpen(isOpen);
                  onSelectToggle(isOpen);
                }, onSelect: (ev, monthNum) => {
                  setTimeout(() => {
                    setIsSelectOpen(false);
                    onSelectToggle(false);
                    const newDate2 = changeMonth(Number(monthNum));
                    setFocusedDate(newDate2);
                    setShouldFocus(false);
                    onMonthChange(ev, newDate2);
                  }, 0);
                }, selected: monthFormatted },
                import_react8.default.createElement(SelectList, null, longMonths.map((longMonth, index) => import_react8.default.createElement(SelectOption, { key: index, value: index, isSelected: longMonth === monthFormatted }, longMonth)))
              )
            )
          ),
          import_react8.default.createElement(
            InputGroupItem,
            null,
            import_react8.default.createElement(
              "div",
              { className: calendar_month_default.calendarMonthHeaderYear },
              import_react8.default.createElement(TextInput, { "aria-label": yearInputAriaLabel, type: "number", value: yearInput, onChange: handleYearInputChange })
            )
          )
        ),
        import_react8.default.createElement(
          "div",
          { className: css(calendar_month_default.calendarMonthHeaderNavControl, calendar_month_default.modifiers.nextMonth) },
          import_react8.default.createElement(
            Button,
            { variant: "plain", "aria-label": nextMonthAriaLabel, onClick: (ev) => onMonthClick(ev, nextMonth) },
            import_react8.default.createElement(angle_right_icon_default, { "aria-hidden": true })
          )
        )
      ),
      import_react8.default.createElement(
        "table",
        { className: calendar_month_default.calendarMonthCalendar, onMouseLeave: () => setHoveredDate(void 0) },
        import_react8.default.createElement(
          "thead",
          { className: calendar_month_default.calendarMonthDays },
          import_react8.default.createElement("tr", null, calendar2[0].map(({ date: date2 }, index) => import_react8.default.createElement(
            "th",
            { key: index, className: calendar_month_default.calendarMonthDay, scope: "col" },
            import_react8.default.createElement("span", { className: "pf-v5-screen-reader" }, longWeekdayFormat(date2)),
            import_react8.default.createElement("span", { "aria-hidden": true }, weekdayFormat(date2))
          )))
        ),
        import_react8.default.createElement("tbody", { onKeyDown }, calendar2.map((week, index) => import_react8.default.createElement("tr", { key: index, className: calendar_month_default.calendarMonthDatesRow }, week.map(({ date: date2, isValid }, index2) => {
          const dayFormatted = dayFormat(date2);
          const isToday = isSameDate(date2, today);
          const isSelected = isValidDate(dateProp) && isSameDate(date2, dateProp);
          const isFocused = isSameDate(date2, focusedDate);
          const isAdjacentMonth = date2.getMonth() !== focusedDate.getMonth();
          const isRangeStart = isValidDate(rangeStart) && isSameDate(date2, rangeStart);
          let isInRange = false;
          let isRangeEnd = false;
          if (isValidDate(rangeStart)) {
            let rangeEndDate;
            if (isValidDate(dateProp)) {
              rangeEndDate = dateProp;
            }
            if (isHoveredDateValid && (!isValidDate(dateProp) || hoveredDate > dateProp)) {
              rangeEndDate = hoveredDate;
            }
            if (rangeEndDate) {
              isInRange = date2 >= rangeStart && date2 <= rangeEndDate;
              isRangeEnd = isSameDate(date2, rangeEndDate);
            }
          }
          return import_react8.default.createElement(
            "td",
            { key: index2, className: css(calendar_month_default.calendarMonthDatesCell, isAdjacentMonth && calendar_month_default.modifiers.adjacentMonth, isToday && calendar_month_default.modifiers.current, (isSelected || isRangeStart) && calendar_month_default.modifiers.selected, !isValid && !(isInRange || isRangeStart || isRangeEnd || isSelected) && calendar_month_default.modifiers.disabled, isInRange && calendar_month_default.modifiers.inRange, isRangeStart && calendar_month_default.modifiers.startRange, isRangeEnd && calendar_month_default.modifiers.endRange) },
            import_react8.default.createElement("button", Object.assign({ className: css(calendar_month_default.calendarMonthDate, isRangeEnd && calendar_month_default.modifiers.hover, !isValid && calendar_month_default.modifiers.disabled), type: "button", onClick: (event) => onChange(event, date2), onMouseOver: () => setHoveredDate(date2), tabIndex: isFocused ? 0 : -1, disabled: !isValid, "aria-label": cellAriaLabel ? cellAriaLabel(date2) : `${dayFormat(date2)} ${monthFormat(date2)} ${yearFormat(date2)}` }, isFocused && { ref: focusRef }), dayFormatted)
          );
        }))))
      )
    );
    if (inlineProps !== void 0) {
      const Component40 = inlineProps.component ? inlineProps.component : "article";
      return import_react8.default.createElement(
        Component40,
        Object.assign({}, inlineProps.ariaLabelledby && { "aria-labelledby": inlineProps.ariaLabelledby }),
        inlineProps.title,
        calendarToRender
      );
    }
    return calendarToRender;
  };
  CalendarMonth.displayName = "CalendarMonth";

  // node_modules/@patternfly/react-core/dist/esm/components/Card/Card.js
  init_tslib_es6();
  var React56 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Card/card.mjs
  var card_default = {
    "card": "pf-v5-c-card",
    "cardActions": "pf-v5-c-card__actions",
    "cardBody": "pf-v5-c-card__body",
    "cardExpandableContent": "pf-v5-c-card__expandable-content",
    "cardFooter": "pf-v5-c-card__footer",
    "cardHeader": "pf-v5-c-card__header",
    "cardHeaderMain": "pf-v5-c-card__header-main",
    "cardHeaderToggle": "pf-v5-c-card__header-toggle",
    "cardHeaderToggleIcon": "pf-v5-c-card__header-toggle-icon",
    "cardSelectableActions": "pf-v5-c-card__selectable-actions",
    "cardSrInput": "pf-v5-c-card__sr-input",
    "cardTitle": "pf-v5-c-card__title",
    "cardTitleText": "pf-v5-c-card__title-text",
    "check": "pf-v5-c-check",
    "checkInput": "pf-v5-c-check__input",
    "checkLabel": "pf-v5-c-check__label",
    "dirRtl": "pf-v5-m-dir-rtl",
    "divider": "pf-v5-c-divider",
    "modifiers": {
      "selectable": "pf-m-selectable",
      "clickable": "pf-m-clickable",
      "selected": "pf-m-selected",
      "current": "pf-m-current",
      "disabled": "pf-m-disabled",
      "hoverableRaised": "pf-m-hoverable-raised",
      "selectableRaised": "pf-m-selectable-raised",
      "nonSelectableRaised": "pf-m-non-selectable-raised",
      "selectedRaised": "pf-m-selected-raised",
      "compact": "pf-m-compact",
      "displayLg": "pf-m-display-lg",
      "flat": "pf-m-flat",
      "plain": "pf-m-plain",
      "rounded": "pf-m-rounded",
      "expanded": "pf-m-expanded",
      "fullHeight": "pf-m-full-height",
      "toggleRight": "pf-m-toggle-right",
      "noOffset": "pf-m-no-offset",
      "noFill": "pf-m-no-fill"
    },
    "radio": "pf-v5-c-radio",
    "radioInput": "pf-v5-c-radio__input",
    "radioLabel": "pf-v5-c-radio__label",
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Card/Card.js
  var CardContext = React56.createContext({
    cardId: "",
    registerTitleId: () => {
    },
    isExpanded: false,
    isClickable: false,
    isSelectable: false,
    isSelected: false,
    isClicked: false,
    isDisabled: false
  });
  var Card = (_a) => {
    var { children, id = "", className, component = "div", isCompact = false, isSelectable = false, isClickable = false, isDisabled = false, isSelectableRaised = false, isSelected = false, isClicked = false, isDisabledRaised = false, isFlat = false, isExpanded = false, isRounded = false, isLarge = false, isFullHeight = false, isPlain = false, ouiaId, ouiaSafe = true, hasSelectableInput = false, selectableInputAriaLabel, onSelectableInputChange = () => {
    } } = _a, props = __rest(_a, ["children", "id", "className", "component", "isCompact", "isSelectable", "isClickable", "isDisabled", "isSelectableRaised", "isSelected", "isClicked", "isDisabledRaised", "isFlat", "isExpanded", "isRounded", "isLarge", "isFullHeight", "isPlain", "ouiaId", "ouiaSafe", "hasSelectableInput", "selectableInputAriaLabel", "onSelectableInputChange"]);
    const Component40 = component;
    const ouiaProps = useOUIAProps(Card.displayName, ouiaId, ouiaSafe);
    const [titleId, setTitleId] = React56.useState("");
    const [ariaProps, setAriaProps] = React56.useState();
    if (isCompact && isLarge) {
      console.warn("Card: Cannot use isCompact with isLarge. Defaulting to isCompact");
      isLarge = false;
    }
    const getSelectableModifiers = () => {
      if (isDisabledRaised) {
        return css(card_default.modifiers.nonSelectableRaised);
      }
      if (isSelectableRaised) {
        return css(card_default.modifiers.selectableRaised, isSelected && card_default.modifiers.selectedRaised);
      }
      if (isSelectable && isClickable) {
        return css(card_default.modifiers.selectable, card_default.modifiers.clickable, (isSelected || isClicked) && card_default.modifiers.current);
      }
      if (isSelectable) {
        return css(card_default.modifiers.selectable, isSelected && card_default.modifiers.selected);
      }
      if (isClickable) {
        return css(card_default.modifiers.clickable, isClicked && card_default.modifiers.current);
      }
      return "";
    };
    const containsCardTitleChildRef = React56.useRef(false);
    const registerTitleId = (id2) => {
      setTitleId(id2);
      containsCardTitleChildRef.current = !!id2;
    };
    React56.useEffect(() => {
      if (selectableInputAriaLabel) {
        setAriaProps({ "aria-label": selectableInputAriaLabel });
      } else if (titleId) {
        setAriaProps({ "aria-labelledby": titleId });
      } else if (hasSelectableInput && !containsCardTitleChildRef.current) {
        setAriaProps({});
        console.warn("If no CardTitle component is passed as a child of Card the selectableInputAriaLabel prop must be passed");
      }
    }, [hasSelectableInput, selectableInputAriaLabel, titleId]);
    return React56.createElement(
      CardContext.Provider,
      { value: {
        cardId: id,
        registerTitleId,
        isExpanded,
        isClickable,
        isSelectable,
        isSelected,
        isClicked,
        isDisabled,
        // TODO: Remove hasSelectableInput when deprecated prop is removed
        hasSelectableInput
      } },
      hasSelectableInput && React56.createElement("input", Object.assign({ className: "pf-v5-screen-reader", id: `${id}-input` }, ariaProps, { type: "checkbox", checked: isSelected, onChange: (event) => onSelectableInputChange(event, id), disabled: isDisabledRaised, tabIndex: -1 })),
      React56.createElement(Component40, Object.assign({ id, className: css(card_default.card, isCompact && card_default.modifiers.compact, isExpanded && card_default.modifiers.expanded, isFlat && card_default.modifiers.flat, isRounded && card_default.modifiers.rounded, isLarge && card_default.modifiers.displayLg, isFullHeight && card_default.modifiers.fullHeight, isPlain && card_default.modifiers.plain, getSelectableModifiers(), isDisabled && card_default.modifiers.disabled, className), tabIndex: isSelectableRaised ? "0" : void 0 }, props, ouiaProps), children)
    );
  };
  Card.displayName = "Card";

  // node_modules/@patternfly/react-core/dist/esm/components/Card/CardBody.js
  init_tslib_es6();
  var React57 = __toESM(require_react());
  var CardBody = (_a) => {
    var { children, className, component = "div", isFilled = true } = _a, props = __rest(_a, ["children", "className", "component", "isFilled"]);
    const Component40 = component;
    return React57.createElement(Component40, Object.assign({ className: css(card_default.cardBody, !isFilled && card_default.modifiers.noFill, className) }, props), children);
  };
  CardBody.displayName = "CardBody";

  // node_modules/@patternfly/react-core/dist/esm/components/Card/CardFooter.js
  init_tslib_es6();
  var React58 = __toESM(require_react());
  var CardFooter = (_a) => {
    var { children, className, component = "div" } = _a, props = __rest(_a, ["children", "className", "component"]);
    const Component40 = component;
    return React58.createElement(Component40, Object.assign({ className: css(card_default.cardFooter, className) }, props), children);
  };
  CardFooter.displayName = "CardFooter";

  // node_modules/@patternfly/react-core/dist/esm/components/Card/CardTitle.js
  init_tslib_es6();
  var React59 = __toESM(require_react());
  var CardTitle = (_a) => {
    var { children, className, component = "div" } = _a, props = __rest(_a, ["children", "className", "component"]);
    const { cardId, registerTitleId } = React59.useContext(CardContext);
    const Component40 = component;
    const titleId = cardId ? `${cardId}-title` : "";
    React59.useEffect(() => {
      registerTitleId(titleId);
      return () => registerTitleId("");
    }, [registerTitleId, titleId]);
    return React59.createElement(
      "div",
      { className: css(card_default.cardTitle) },
      React59.createElement(Component40, Object.assign({ className: css(card_default.cardTitleText, className), id: titleId || void 0 }, props), children)
    );
  };
  CardTitle.displayName = "CardTitle";

  // node_modules/@patternfly/react-core/dist/esm/components/Card/CardHeader.js
  init_tslib_es6();
  var React64 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Card/CardHeaderMain.js
  init_tslib_es6();
  var React60 = __toESM(require_react());
  var CardHeaderMain = (_a) => {
    var { children, className } = _a, props = __rest(_a, ["children", "className"]);
    return React60.createElement("div", Object.assign({ className: css(card_default.cardHeaderMain, className) }, props), children);
  };
  CardHeaderMain.displayName = "CardHeaderMain";

  // node_modules/@patternfly/react-core/dist/esm/components/Card/CardActions.js
  init_tslib_es6();
  var React61 = __toESM(require_react());
  var CardActions = (_a) => {
    var { children, className, hasNoOffset = false } = _a, props = __rest(_a, ["children", "className", "hasNoOffset"]);
    return React61.createElement("div", Object.assign({ className: css(card_default.cardActions, hasNoOffset && card_default.modifiers.noOffset, className) }, props), children);
  };
  CardActions.displayName = "CardActions";

  // node_modules/@patternfly/react-core/dist/esm/components/Card/CardSelectableActions.js
  init_tslib_es6();
  var React62 = __toESM(require_react());
  var CardSelectableActions = (_a) => {
    var { children, className } = _a, props = __rest(_a, ["children", "className"]);
    return React62.createElement("div", Object.assign({ className: css(card_default.cardSelectableActions, className) }, props), children);
  };
  CardSelectableActions.displayName = "CardSelectableActions";

  // node_modules/@patternfly/react-core/dist/esm/components/Radio/Radio.js
  init_tslib_es6();
  var React63 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Radio/radio.mjs
  var radio_default = {
    "modifiers": {
      "standalone": "pf-m-standalone",
      "disabled": "pf-m-disabled"
    },
    "radio": "pf-v5-c-radio",
    "radioBody": "pf-v5-c-radio__body",
    "radioDescription": "pf-v5-c-radio__description",
    "radioInput": "pf-v5-c-radio__input",
    "radioLabel": "pf-v5-c-radio__label"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Radio/Radio.js
  var Radio = class _Radio extends React63.Component {
    constructor(props) {
      super(props);
      this.handleChange = (event) => {
        this.props.onChange(event, event.currentTarget.checked);
      };
      if (!props.label && !props["aria-label"]) {
        console.error("Radio:", "Radio requires an aria-label to be specified");
      }
      this.state = {
        ouiaStateId: getDefaultOUIAId(_Radio.displayName)
      };
    }
    render() {
      const _a = this.props, {
        "aria-label": ariaLabel,
        checked,
        className,
        inputClassName,
        defaultChecked,
        isLabelWrapped,
        isLabelBeforeButton,
        isChecked,
        isDisabled,
        isValid,
        label,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        onChange,
        description,
        body,
        ouiaId,
        ouiaSafe = true,
        component
      } = _a, props = __rest(_a, ["aria-label", "checked", "className", "inputClassName", "defaultChecked", "isLabelWrapped", "isLabelBeforeButton", "isChecked", "isDisabled", "isValid", "label", "onChange", "description", "body", "ouiaId", "ouiaSafe", "component"]);
      if (!props.id) {
        console.error("Radio:", "id is required to make input accessible");
      }
      const inputRendered = React63.createElement("input", Object.assign({}, props, { className: css(radio_default.radioInput, inputClassName), type: "radio", onChange: this.handleChange, "aria-invalid": !isValid, disabled: isDisabled, checked: checked || isChecked }, checked === void 0 && { defaultChecked }, !label && { "aria-label": ariaLabel }, getOUIAProps(_Radio.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe)));
      const wrapWithLabel = isLabelWrapped && !component || component === "label";
      const Label2 = wrapWithLabel ? "span" : "label";
      const labelRendered = label ? React63.createElement(Label2, { className: css(radio_default.radioLabel, isDisabled && radio_default.modifiers.disabled), htmlFor: !wrapWithLabel ? props.id : void 0 }, label) : null;
      const Component40 = component !== null && component !== void 0 ? component : wrapWithLabel ? "label" : "div";
      return React63.createElement(
        Component40,
        { className: css(radio_default.radio, !label && radio_default.modifiers.standalone, className), htmlFor: wrapWithLabel ? props.id : void 0 },
        isLabelBeforeButton ? React63.createElement(
          React63.Fragment,
          null,
          labelRendered,
          inputRendered
        ) : React63.createElement(
          React63.Fragment,
          null,
          inputRendered,
          labelRendered
        ),
        description && React63.createElement("span", { className: css(radio_default.radioDescription) }, description),
        body && React63.createElement("span", { className: css(radio_default.radioBody) }, body)
      );
    }
  };
  Radio.displayName = "Radio";
  Radio.defaultProps = {
    className: "",
    isDisabled: false,
    isValid: true,
    onChange: () => {
    }
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Card/CardHeader.js
  var CardHeader = (_a) => {
    var { children, className, actions, selectableActions, id, onExpand, toggleButtonProps, isToggleRightAligned } = _a, props = __rest(_a, ["children", "className", "actions", "selectableActions", "id", "onExpand", "toggleButtonProps", "isToggleRightAligned"]);
    return React64.createElement(CardContext.Consumer, null, ({ cardId, isClickable, isSelectable, isSelected, isClicked, isDisabled: isCardDisabled, hasSelectableInput }) => {
      const cardHeaderToggle = React64.createElement(
        "div",
        { className: css(card_default.cardHeaderToggle) },
        React64.createElement(
          Button,
          Object.assign({ variant: "plain", type: "button", onClick: (evt) => {
            onExpand(evt, cardId);
          } }, toggleButtonProps),
          React64.createElement(
            "span",
            { className: css(card_default.cardHeaderToggleIcon) },
            React64.createElement(angle_right_icon_default, { "aria-hidden": "true" })
          )
        )
      );
      const isClickableOrSelectableOnly = isClickable && !isSelectable || isSelectable && !isClickable;
      const isDeprecatedSelectableCard = hasSelectableInput;
      if ((actions === null || actions === void 0 ? void 0 : actions.actions) && isClickableOrSelectableOnly && !isDeprecatedSelectableCard) {
        console.warn(`${isClickable ? "Clickable" : "Selectable"} only cards should not contain any other actions. If you wish to include additional actions, use a clickable and selectable card.`);
      }
      const handleActionClick = (event) => {
        if (selectableActions === null || selectableActions === void 0 ? void 0 : selectableActions.onClickAction) {
          selectableActions.onClickAction(event);
        } else if (selectableActions === null || selectableActions === void 0 ? void 0 : selectableActions.to) {
          window.open(selectableActions.to, selectableActions.isExternalLink ? "_blank" : "_self");
        }
      };
      const getClickableSelectableProps = () => {
        var _a2;
        const baseProps4 = {
          className: "pf-m-standalone",
          inputClassName: isClickable && !isSelectable && "pf-v5-screen-reader",
          label: React64.createElement(React64.Fragment, null),
          "aria-label": selectableActions.selectableActionAriaLabel,
          "aria-labelledby": selectableActions.selectableActionAriaLabelledby,
          id: selectableActions.selectableActionId,
          name: selectableActions.name,
          isDisabled: isCardDisabled
        };
        const isSelectableInputChecked = (_a2 = selectableActions.isChecked) !== null && _a2 !== void 0 ? _a2 : isSelected;
        if (isClickable && !isSelectable) {
          return Object.assign(Object.assign({}, baseProps4), { onClick: handleActionClick, isChecked: isClicked });
        }
        if (isSelectable) {
          return Object.assign(Object.assign({}, baseProps4), { onChange: selectableActions.onChange, isChecked: isSelectableInputChecked });
        }
        return baseProps4;
      };
      return React64.createElement(
        "div",
        Object.assign({ className: css(card_default.cardHeader, isToggleRightAligned && card_default.modifiers.toggleRight, className), id }, props),
        onExpand && !isToggleRightAligned && cardHeaderToggle,
        (actions || selectableActions && (isClickable || isSelectable)) && React64.createElement(
          CardActions,
          { className: actions === null || actions === void 0 ? void 0 : actions.className, hasNoOffset: (actions === null || actions === void 0 ? void 0 : actions.hasNoOffset) || (selectableActions === null || selectableActions === void 0 ? void 0 : selectableActions.hasNoOffset) },
          actions === null || actions === void 0 ? void 0 : actions.actions,
          selectableActions && (isClickable || isSelectable) && React64.createElement(CardSelectableActions, { className: selectableActions === null || selectableActions === void 0 ? void 0 : selectableActions.className }, (selectableActions === null || selectableActions === void 0 ? void 0 : selectableActions.variant) === "single" || isClickable && !isSelectable ? React64.createElement(Radio, Object.assign({}, getClickableSelectableProps())) : React64.createElement(Checkbox, Object.assign({}, getClickableSelectableProps())))
        ),
        children && React64.createElement(CardHeaderMain, null, children),
        onExpand && isToggleRightAligned && cardHeaderToggle
      );
    });
  };
  CardHeader.displayName = "CardHeader";

  // node_modules/@patternfly/react-core/dist/esm/components/Chip/Chip.js
  init_tslib_es6();
  var React65 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Chip/chip.mjs
  var chip_default = {
    "badge": "pf-v5-c-badge",
    "button": "pf-v5-c-button",
    "chip": "pf-v5-c-chip",
    "chipActions": "pf-v5-c-chip__actions",
    "chipContent": "pf-v5-c-chip__content",
    "chipIcon": "pf-v5-c-chip__icon",
    "chipText": "pf-v5-c-chip__text",
    "modifiers": {
      "overflow": "pf-m-overflow",
      "draggable": "pf-m-draggable"
    },
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-tokens/dist/esm/c_chip__text_MaxWidth.js
  var c_chip__text_MaxWidth = {
    "name": "--pf-v5-c-chip__text--MaxWidth",
    "value": "16ch",
    "var": "var(--pf-v5-c-chip__text--MaxWidth)"
  };
  var c_chip_text_MaxWidth_default = c_chip__text_MaxWidth;

  // node_modules/@patternfly/react-core/dist/esm/components/Chip/Chip.js
  var Chip = class _Chip extends React65.Component {
    constructor(props) {
      super(props);
      this.span = React65.createRef();
      this.setChipStyle = () => ({
        [c_chip_text_MaxWidth_default.name]: this.props.textMaxWidth
      });
      this.renderOverflowChip = () => {
        const _a = this.props, {
          badge,
          children,
          className,
          onClick,
          ouiaId,
          textMaxWidth,
          style,
          component,
          // eslint-disable-next-line @typescript-eslint/no-unused-vars
          tooltipPosition,
          // eslint-disable-next-line @typescript-eslint/no-unused-vars
          isOverflowChip,
          // eslint-disable-next-line @typescript-eslint/no-unused-vars
          closeBtnAriaLabel,
          // eslint-disable-next-line @typescript-eslint/no-unused-vars
          isReadOnly
        } = _a, props2 = __rest(_a, ["badge", "children", "className", "onClick", "ouiaId", "textMaxWidth", "style", "component", "tooltipPosition", "isOverflowChip", "closeBtnAriaLabel", "isReadOnly"]);
        const Component40 = component;
        return React65.createElement(
          Component40,
          Object.assign({ onClick }, textMaxWidth && Object.assign({ style: this.setChipStyle() }, style), { className: css(chip_default.chip, chip_default.modifiers.overflow, className) }, component === "button" ? { type: "button" } : {}, getOUIAProps("OverflowChip", ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId), props2),
          React65.createElement(
            "span",
            { className: css(chip_default.chipContent) },
            React65.createElement("span", { className: css(chip_default.chipText) }, children),
            badge && badge
          )
        );
      };
      this.renderChip = (randomId) => {
        const { children, tooltipPosition } = this.props;
        if (this.state.isTooltipVisible) {
          return React65.createElement(Tooltip, { position: tooltipPosition, content: children }, this.renderInnerChip(randomId));
        }
        return this.renderInnerChip(randomId);
      };
      this.state = {
        isTooltipVisible: false,
        ouiaStateId: getDefaultOUIAId(_Chip.displayName)
      };
    }
    componentDidMount() {
      this.setState({
        isTooltipVisible: Boolean(this.span.current && this.span.current.offsetWidth < this.span.current.scrollWidth)
      });
    }
    componentDidUpdate(_prevProps, prevState) {
      const nextIsTooltipVisible = Boolean(this.span.current && this.span.current.offsetWidth < this.span.current.scrollWidth);
      if (prevState.isTooltipVisible !== nextIsTooltipVisible) {
        this.setState({
          isTooltipVisible: nextIsTooltipVisible
        });
      }
    }
    renderInnerChip(id) {
      const _a = this.props, {
        badge,
        children,
        className,
        onClick,
        closeBtnAriaLabel,
        isReadOnly,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        isOverflowChip,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        tooltipPosition,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        id: idProp,
        component,
        ouiaId,
        textMaxWidth
      } = _a, props = __rest(_a, ["badge", "children", "className", "onClick", "closeBtnAriaLabel", "isReadOnly", "isOverflowChip", "tooltipPosition", "id", "component", "ouiaId", "textMaxWidth"]);
      const Component40 = component;
      return React65.createElement(
        Component40,
        Object.assign({}, textMaxWidth && {
          style: this.setChipStyle()
        }, { className: css(chip_default.chip, className) }, this.state.isTooltipVisible && { tabIndex: 0 }, getOUIAProps(_Chip.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId), props),
        React65.createElement(
          "span",
          { className: css(chip_default.chipContent) },
          React65.createElement("span", { ref: this.span, className: css(chip_default.chipText), id }, children),
          badge && badge
        ),
        !isReadOnly && React65.createElement(
          "span",
          { className: css(chip_default.chipActions) },
          React65.createElement(
            Button,
            { onClick, variant: "plain", "aria-label": closeBtnAriaLabel, id: `remove_${id}`, "aria-labelledby": `remove_${id} ${id}`, ouiaId: ouiaId || closeBtnAriaLabel },
            React65.createElement(times_icon_default, { "aria-hidden": "true" })
          )
        )
      );
    }
    render() {
      const { isOverflowChip } = this.props;
      return React65.createElement(GenerateId, null, (randomId) => isOverflowChip ? this.renderOverflowChip() : this.renderChip(this.props.id || randomId));
    }
  };
  Chip.displayName = "Chip";
  Chip.defaultProps = {
    closeBtnAriaLabel: "close",
    className: "",
    isOverflowChip: false,
    isReadOnly: false,
    tooltipPosition: "top",
    onClick: (_e) => void 0,
    component: "div"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Chip/ChipGroup.js
  init_tslib_es6();
  var React66 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Chip/chip-group.mjs
  var chip_group_default = {
    "chipGroup": "pf-v5-c-chip-group",
    "chipGroupClose": "pf-v5-c-chip-group__close",
    "chipGroupLabel": "pf-v5-c-chip-group__label",
    "chipGroupList": "pf-v5-c-chip-group__list",
    "chipGroupListItem": "pf-v5-c-chip-group__list-item",
    "chipGroupMain": "pf-v5-c-chip-group__main",
    "modifiers": {
      "category": "pf-m-category"
    }
  };

  // node_modules/@patternfly/react-icons/dist/esm/icons/times-circle-icon.js
  var TimesCircleIconConfig = {
    name: "TimesCircleIcon",
    height: 512,
    width: 512,
    svgPath: "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z",
    yOffset: 0,
    xOffset: 0
  };
  var TimesCircleIcon = createIcon(TimesCircleIconConfig);
  var times_circle_icon_default = TimesCircleIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Chip/ChipGroup.js
  var ChipGroup = class _ChipGroup extends React66.Component {
    constructor(props) {
      super(props);
      this.headingRef = React66.createRef();
      this.toggleCollapse = () => {
        this.setState((prevState) => ({
          isOpen: !prevState.isOpen,
          isTooltipVisible: Boolean(this.headingRef.current && this.headingRef.current.offsetWidth < this.headingRef.current.scrollWidth)
        }));
      };
      this.state = {
        isOpen: this.props.defaultIsOpen,
        isTooltipVisible: false
      };
    }
    componentDidMount() {
      this.setState({
        isTooltipVisible: Boolean(this.headingRef.current && this.headingRef.current.offsetWidth < this.headingRef.current.scrollWidth)
      });
    }
    renderLabel(id) {
      const { categoryName, tooltipPosition } = this.props;
      const { isTooltipVisible } = this.state;
      return isTooltipVisible ? React66.createElement(
        Tooltip,
        { position: tooltipPosition, content: categoryName },
        React66.createElement(
          "span",
          { tabIndex: 0, ref: this.headingRef, className: css(chip_group_default.chipGroupLabel) },
          React66.createElement("span", { id }, categoryName)
        )
      ) : React66.createElement("span", { ref: this.headingRef, className: css(chip_group_default.chipGroupLabel), id }, categoryName);
    }
    render() {
      const _a = this.props, {
        categoryName,
        children,
        className,
        isClosable,
        closeBtnAriaLabel,
        "aria-label": ariaLabel,
        onClick,
        onOverflowChipClick,
        numChips,
        expandedText,
        collapsedText,
        ouiaId,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        defaultIsOpen,
        tooltipPosition
      } = _a, rest = __rest(_a, ["categoryName", "children", "className", "isClosable", "closeBtnAriaLabel", "aria-label", "onClick", "onOverflowChipClick", "numChips", "expandedText", "collapsedText", "ouiaId", "defaultIsOpen", "tooltipPosition"]);
      const { isOpen } = this.state;
      const numChildren = React66.Children.count(children);
      const collapsedTextResult = fillTemplate(collapsedText, {
        remaining: React66.Children.count(children) - numChips
      });
      const renderChipGroup = (id) => {
        const chipArray = !isOpen ? React66.Children.toArray(children).slice(0, numChips) : React66.Children.toArray(children);
        return React66.createElement(
          "div",
          Object.assign({ className: css(chip_group_default.chipGroup, className, categoryName && chip_group_default.modifiers.category), role: "group" }, categoryName && { "aria-labelledby": id }, !categoryName && { "aria-label": ariaLabel }, getOUIAProps(_ChipGroup.displayName, ouiaId)),
          React66.createElement(
            "div",
            { className: css(chip_group_default.chipGroupMain) },
            categoryName && this.renderLabel(id),
            React66.createElement(
              "ul",
              Object.assign({ className: css(chip_group_default.chipGroupList) }, categoryName && { "aria-labelledby": id }, !categoryName && { "aria-label": ariaLabel }, { role: "list" }, rest),
              chipArray.map((child, i) => React66.createElement("li", { className: css(chip_group_default.chipGroupListItem), key: i }, child)),
              numChildren > numChips && React66.createElement(
                "li",
                { className: css(chip_group_default.chipGroupListItem) },
                React66.createElement(Chip, { isOverflowChip: true, onClick: (event) => {
                  this.toggleCollapse();
                  onOverflowChipClick(event);
                }, component: "button" }, isOpen ? expandedText : collapsedTextResult)
              )
            )
          ),
          isClosable && React66.createElement(
            "div",
            { className: css(chip_group_default.chipGroupClose) },
            React66.createElement(
              Button,
              { variant: "plain", "aria-label": closeBtnAriaLabel, onClick, id: `remove_group_${id}`, "aria-labelledby": `remove_group_${id} ${id}`, ouiaId: ouiaId || closeBtnAriaLabel },
              React66.createElement(times_circle_icon_default, { "aria-hidden": "true" })
            )
          )
        );
      };
      return numChildren === 0 ? null : React66.createElement(GenerateId, null, (randomId) => renderChipGroup(this.props.id || randomId));
    }
  };
  ChipGroup.displayName = "ChipGroup";
  ChipGroup.defaultProps = {
    expandedText: "Show Less",
    collapsedText: "${remaining} more",
    categoryName: "",
    defaultIsOpen: false,
    numChips: 3,
    isClosable: false,
    onClick: (_e) => void 0,
    onOverflowChipClick: (_e) => void 0,
    closeBtnAriaLabel: "Close chip group",
    tooltipPosition: "top",
    "aria-label": "Chip group category"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/ClipboardCopy/ClipboardCopy.js
  init_tslib_es6();
  var React70 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/ClipboardCopy/clipboard-copy.mjs
  var clipboard_copy_default = {
    "button": "pf-v5-c-button",
    "clipboardCopy": "pf-v5-c-clipboard-copy",
    "clipboardCopyActions": "pf-v5-c-clipboard-copy__actions",
    "clipboardCopyActionsItem": "pf-v5-c-clipboard-copy__actions-item",
    "clipboardCopyExpandableContent": "pf-v5-c-clipboard-copy__expandable-content",
    "clipboardCopyGroup": "pf-v5-c-clipboard-copy__group",
    "clipboardCopyText": "pf-v5-c-clipboard-copy__text",
    "clipboardCopyToggleIcon": "pf-v5-c-clipboard-copy__toggle-icon",
    "dirRtl": "pf-v5-m-dir-rtl",
    "modifiers": {
      "expanded": "pf-m-expanded",
      "inline": "pf-m-inline",
      "block": "pf-m-block",
      "code": "pf-m-code"
    },
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/ClipboardCopy/ClipboardCopyButton.js
  init_tslib_es6();
  var React67 = __toESM(require_react());

  // node_modules/@patternfly/react-icons/dist/esm/icons/copy-icon.js
  var CopyIconConfig = {
    name: "CopyIcon",
    height: 512,
    width: 448,
    svgPath: "M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z",
    yOffset: 0,
    xOffset: 0
  };
  var CopyIcon = createIcon(CopyIconConfig);
  var copy_icon_default = CopyIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/ClipboardCopy/ClipboardCopyButton.js
  var ClipboardCopyButton = (_a) => {
    var { onClick, exitDelay = 0, entryDelay = 300, maxWidth = "100px", position = "top", "aria-label": ariaLabel = "Copyable input", id, textId, children, variant = "control", onTooltipHidden = () => {
    }, className } = _a, props = __rest(_a, ["onClick", "exitDelay", "entryDelay", "maxWidth", "position", "aria-label", "id", "textId", "children", "variant", "onTooltipHidden", "className"]);
    const triggerRef = React67.createRef();
    return React67.createElement(
      Tooltip,
      { trigger: "mouseenter focus click", triggerRef, exitDelay, entryDelay, maxWidth, position, "aria-live": "polite", aria: "none", content: React67.createElement("div", null, children), onTooltipHidden },
      React67.createElement(
        Button,
        Object.assign({ type: "button", variant, onClick, "aria-label": ariaLabel, className, id, "aria-labelledby": `${id} ${textId}` }, props, { ref: triggerRef }),
        React67.createElement(copy_icon_default, null)
      )
    );
  };
  ClipboardCopyButton.displayName = "ClipboardCopyButton";

  // node_modules/@patternfly/react-core/dist/esm/components/ClipboardCopy/ClipboardCopyToggle.js
  init_tslib_es6();
  var React68 = __toESM(require_react());
  var ClipboardCopyToggle = (_a) => {
    var { onClick, id, textId, contentId, isExpanded = false } = _a, props = __rest(_a, ["onClick", "id", "textId", "contentId", "isExpanded"]);
    return React68.createElement(
      Button,
      Object.assign({ type: "button", variant: "control", onClick, id, "aria-labelledby": `${id} ${textId}`, "aria-controls": contentId, "aria-expanded": isExpanded }, props),
      React68.createElement(
        "div",
        { className: css(clipboard_copy_default.clipboardCopyToggleIcon) },
        React68.createElement(angle_right_icon_default, { "aria-hidden": "true" })
      )
    );
  };
  ClipboardCopyToggle.displayName = "ClipboardCopyToggle";

  // node_modules/@patternfly/react-core/dist/esm/components/ClipboardCopy/ClipboardCopyExpanded.js
  init_tslib_es6();
  var React69 = __toESM(require_react());
  var ClipboardCopyExpanded = class extends React69.Component {
    constructor(props) {
      super(props);
    }
    render() {
      const _a = this.props, { className, children, onChange, isReadOnly, isCode } = _a, props = __rest(_a, ["className", "children", "onChange", "isReadOnly", "isCode"]);
      return React69.createElement("div", Object.assign({ suppressContentEditableWarning: true, className: css(clipboard_copy_default.clipboardCopyExpandableContent, className), onInput: (e) => onChange(e, e.target.innerText), contentEditable: !isReadOnly }, props), isCode ? React69.createElement("pre", { dir: "ltr" }, children) : children);
    }
  };
  ClipboardCopyExpanded.displayName = "ClipboardCopyExpanded";
  ClipboardCopyExpanded.defaultProps = {
    onChange: () => void 0,
    className: "",
    isReadOnly: false,
    isCode: false
  };

  // node_modules/@patternfly/react-core/dist/esm/components/ClipboardCopy/ClipboardCopy.js
  var clipboardCopyFunc = (_event, text) => {
    try {
      navigator.clipboard.writeText(text.toString());
    } catch (error) {
      console.warn("Clipboard API not found, this copy function will not work. This is likely because you're using an", "unsupported browser or you're not using HTTPS. \n\nIf you're a developer building an application which needs", "to support copying to the clipboard without the clipboard API, you'll have to create your own copy", "function and pass it to the ClipboardCopy component as the onCopy prop. For more information see", "https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard");
      console.error(error);
    }
  };
  var ClipboardCopyVariant;
  (function(ClipboardCopyVariant2) {
    ClipboardCopyVariant2["inline"] = "inline";
    ClipboardCopyVariant2["expansion"] = "expansion";
    ClipboardCopyVariant2["inlineCompact"] = "inline-compact";
  })(ClipboardCopyVariant || (ClipboardCopyVariant = {}));
  var ClipboardCopy = class _ClipboardCopy extends React70.Component {
    constructor(props) {
      super(props);
      this.timer = null;
      this.componentDidUpdate = (prevProps, prevState) => {
        if (prevProps.children !== this.props.children) {
          const newText = this.props.children;
          this.setState({ text: newText, textWhenExpanded: newText });
        }
      };
      this.componentWillUnmount = () => {
        if (this.timer) {
          window.clearTimeout(this.timer);
        }
      };
      this.expandContent = (_event) => {
        this.setState((prevState) => ({
          expanded: !prevState.expanded
        }));
      };
      this.updateText = (event, text2) => {
        this.setState({ text: text2 });
        this.props.onChange(event, text2);
      };
      this.updateTextWhenExpanded = (event, text2) => {
        this.setState({ textWhenExpanded: text2 });
        this.props.onChange(event, text2);
      };
      this.render = () => {
        const _a = this.props, {
          /* eslint-disable @typescript-eslint/no-unused-vars */
          isExpanded,
          onChange,
          // Don't pass to <div>
          /* eslint-enable @typescript-eslint/no-unused-vars */
          isReadOnly,
          isCode,
          isBlock,
          exitDelay,
          maxWidth,
          entryDelay,
          onCopy,
          hoverTip,
          clickTip,
          textAriaLabel,
          toggleAriaLabel,
          variant,
          position,
          className,
          additionalActions,
          ouiaId,
          ouiaSafe
        } = _a, divProps = __rest(_a, ["isExpanded", "onChange", "isReadOnly", "isCode", "isBlock", "exitDelay", "maxWidth", "entryDelay", "onCopy", "hoverTip", "clickTip", "textAriaLabel", "toggleAriaLabel", "variant", "position", "className", "additionalActions", "ouiaId", "ouiaSafe"]);
        const textIdPrefix = "text-input-";
        const toggleIdPrefix = "toggle-";
        const contentIdPrefix = "content-";
        return React70.createElement(
          "div",
          Object.assign({ className: css(clipboard_copy_default.clipboardCopy, variant === "inline-compact" && clipboard_copy_default.modifiers.inline, isBlock && clipboard_copy_default.modifiers.block, this.state.expanded && clipboard_copy_default.modifiers.expanded, className) }, divProps, getOUIAProps(_ClipboardCopy.displayName, ouiaId, ouiaSafe)),
          variant === "inline-compact" && React70.createElement(GenerateId, { prefix: "" }, (id) => React70.createElement(
            React70.Fragment,
            null,
            !isCode && React70.createElement("span", { className: css(clipboard_copy_default.clipboardCopyText), id: `${textIdPrefix}${id}` }, this.state.text),
            isCode && React70.createElement("code", { className: css(clipboard_copy_default.clipboardCopyText, clipboard_copy_default.modifiers.code), id: `${textIdPrefix}${id}` }, this.state.text),
            React70.createElement(
              "span",
              { className: css(clipboard_copy_default.clipboardCopyActions) },
              React70.createElement(
                "span",
                { className: css(clipboard_copy_default.clipboardCopyActionsItem) },
                React70.createElement(ClipboardCopyButton, { variant: "plain", exitDelay, entryDelay, maxWidth, position, id: `copy-button-${id}`, textId: `text-input-${id}`, "aria-label": hoverTip, onClick: (event) => {
                  onCopy(event, this.state.text);
                  this.setState({ copied: true });
                }, onTooltipHidden: () => this.setState({ copied: false }) }, this.state.copied ? clickTip : hoverTip)
              ),
              additionalActions && additionalActions
            )
          )),
          variant !== "inline-compact" && React70.createElement(GenerateId, { prefix: "" }, (id) => React70.createElement(
            React70.Fragment,
            null,
            React70.createElement(
              "div",
              { className: css(clipboard_copy_default.clipboardCopyGroup) },
              variant === "expansion" && React70.createElement(ClipboardCopyToggle, { isExpanded: this.state.expanded, onClick: (_event) => {
                this.expandContent(_event);
                if (this.state.expanded) {
                  this.setState({ text: this.state.textWhenExpanded });
                } else {
                  this.setState({ textWhenExpanded: this.state.text });
                }
              }, id: `${toggleIdPrefix}${id}`, textId: `${textIdPrefix}${id}`, contentId: `${contentIdPrefix}${id}`, "aria-label": toggleAriaLabel }),
              React70.createElement(TextInput, Object.assign({ readOnlyVariant: isReadOnly || this.state.expanded ? "default" : void 0, onChange: this.updateText, value: this.state.expanded ? this.state.textWhenExpanded : this.state.text, id: `text-input-${id}`, "aria-label": textAriaLabel }, isCode && { dir: "ltr" })),
              React70.createElement(ClipboardCopyButton, { exitDelay, entryDelay, maxWidth, position, id: `copy-button-${id}`, textId: `text-input-${id}`, "aria-label": hoverTip, onClick: (event) => {
                onCopy(event, this.state.expanded ? this.state.textWhenExpanded : this.state.text);
                this.setState({ copied: true });
              }, onTooltipHidden: () => this.setState({ copied: false }) }, this.state.copied ? clickTip : hoverTip)
            ),
            this.state.expanded && React70.createElement(ClipboardCopyExpanded, { isReadOnly, isCode, id: `content-${id}`, onChange: this.updateTextWhenExpanded }, this.state.text)
          ))
        );
      };
      const text = Array.isArray(this.props.children) ? this.props.children.join("") : this.props.children;
      this.state = {
        text,
        expanded: this.props.isExpanded,
        copied: false,
        textWhenExpanded: text
      };
    }
  };
  ClipboardCopy.displayName = "ClipboardCopy";
  ClipboardCopy.defaultProps = {
    hoverTip: "Copy to clipboard",
    clickTip: "Successfully copied to clipboard!",
    isReadOnly: false,
    isExpanded: false,
    isCode: false,
    variant: "inline",
    position: TooltipPosition.top,
    maxWidth: "150px",
    exitDelay: 1500,
    entryDelay: 300,
    onCopy: clipboardCopyFunc,
    onChange: () => void 0,
    textAriaLabel: "Copyable input",
    toggleAriaLabel: "Show content",
    additionalActions: null,
    ouiaSafe: true
  };

  // node_modules/@patternfly/react-core/dist/esm/components/DataList/DataList.js
  init_tslib_es6();
  var React71 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/DataList/data-list.mjs
  var data_list_default = {
    "dataList": "pf-v5-c-data-list",
    "dataListAction": "pf-v5-c-data-list__action",
    "dataListCell": "pf-v5-c-data-list__cell",
    "dataListCheck": "pf-v5-c-data-list__check",
    "dataListExpandableContent": "pf-v5-c-data-list__expandable-content",
    "dataListExpandableContentBody": "pf-v5-c-data-list__expandable-content-body",
    "dataListItem": "pf-v5-c-data-list__item",
    "dataListItemAction": "pf-v5-c-data-list__item-action",
    "dataListItemContent": "pf-v5-c-data-list__item-content",
    "dataListItemControl": "pf-v5-c-data-list__item-control",
    "dataListItemDraggableButton": "pf-v5-c-data-list__item-draggable-button",
    "dataListItemDraggableIcon": "pf-v5-c-data-list__item-draggable-icon",
    "dataListItemRow": "pf-v5-c-data-list__item-row",
    "dataListText": "pf-v5-c-data-list__text",
    "dataListToggle": "pf-v5-c-data-list__toggle",
    "dataListToggleIcon": "pf-v5-c-data-list__toggle-icon",
    "dirRtl": "pf-v5-m-dir-rtl",
    "modifiers": {
      "hidden": "pf-m-hidden",
      "hiddenOnSm": "pf-m-hidden-on-sm",
      "visibleOnSm": "pf-m-visible-on-sm",
      "hiddenOnMd": "pf-m-hidden-on-md",
      "visibleOnMd": "pf-m-visible-on-md",
      "hiddenOnLg": "pf-m-hidden-on-lg",
      "visibleOnLg": "pf-m-visible-on-lg",
      "hiddenOnXl": "pf-m-hidden-on-xl",
      "visibleOnXl": "pf-m-visible-on-xl",
      "hiddenOn_2xl": "pf-m-hidden-on-2xl",
      "visibleOn_2xl": "pf-m-visible-on-2xl",
      "icon": "pf-m-icon",
      "alignRight": "pf-m-align-right",
      "noFill": "pf-m-no-fill",
      "flex_2": "pf-m-flex-2",
      "flex_3": "pf-m-flex-3",
      "flex_4": "pf-m-flex-4",
      "flex_5": "pf-m-flex-5",
      "gridNone": "pf-m-grid-none",
      "gridSm": "pf-m-grid-sm",
      "gridMd": "pf-m-grid-md",
      "gridLg": "pf-m-grid-lg",
      "gridXl": "pf-m-grid-xl",
      "grid_2xl": "pf-m-grid-2xl",
      "compact": "pf-m-compact",
      "dragOver": "pf-m-drag-over",
      "truncate": "pf-m-truncate",
      "breakWord": "pf-m-break-word",
      "nowrap": "pf-m-nowrap",
      "clickable": "pf-m-clickable",
      "selected": "pf-m-selected",
      "ghostRow": "pf-m-ghost-row",
      "expanded": "pf-m-expanded",
      "disabled": "pf-m-disabled",
      "noPadding": "pf-m-no-padding"
    },
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/DataList/DataList.js
  var gridBreakpointClasses = {
    none: data_list_default.modifiers.gridNone,
    always: "pf-m-grid",
    // Placeholder per https://github.com/patternfly/patternfly-react/issues/4965#issuecomment-704984236
    sm: data_list_default.modifiers.gridSm,
    md: data_list_default.modifiers.gridMd,
    lg: data_list_default.modifiers.gridLg,
    xl: data_list_default.modifiers.gridXl,
    "2xl": data_list_default.modifiers.grid_2xl
  };
  var DataListWrapModifier;
  (function(DataListWrapModifier2) {
    DataListWrapModifier2["nowrap"] = "nowrap";
    DataListWrapModifier2["truncate"] = "truncate";
    DataListWrapModifier2["breakWord"] = "breakWord";
  })(DataListWrapModifier || (DataListWrapModifier = {}));
  var DataListContext = React71.createContext({
    isSelectable: false
  });
  var DataListBase = (_a) => {
    var { children = null, className = "", "aria-label": ariaLabel, onSelectDataListItem, selectedDataListItemId = "", isCompact = false, gridBreakpoint = "md", wrapModifier = null, onSelectableRowChange, innerRef } = _a, props = __rest(_a, ["children", "className", "aria-label", "onSelectDataListItem", "selectedDataListItemId", "isCompact", "gridBreakpoint", "wrapModifier", "onSelectableRowChange", "innerRef"]);
    const isSelectable = onSelectDataListItem !== void 0;
    const updateSelectedDataListItem = (event, id) => {
      onSelectDataListItem(event, id);
    };
    return React71.createElement(
      DataListContext.Provider,
      { value: {
        isSelectable,
        selectedDataListItemId,
        updateSelectedDataListItem,
        onSelectableRowChange
      } },
      React71.createElement("ul", Object.assign({ className: css(data_list_default.dataList, isCompact && data_list_default.modifiers.compact, gridBreakpointClasses[gridBreakpoint], wrapModifier && data_list_default.modifiers[wrapModifier], className), style: props.style, role: "list", "aria-label": ariaLabel, ref: innerRef }, props), children)
    );
  };
  DataListBase.displayName = "DataListBase";
  var DataList = React71.forwardRef((props, ref) => React71.createElement(DataListBase, Object.assign({ innerRef: ref }, props)));
  DataList.displayName = "DataList";

  // node_modules/@patternfly/react-core/dist/esm/components/DataList/DataListCell.js
  init_tslib_es6();
  var React72 = __toESM(require_react());
  var DataListCell = (_a) => {
    var { children = null, className = "", width = 1, isFilled = true, alignRight = false, isIcon = false, wrapModifier = null } = _a, props = __rest(_a, ["children", "className", "width", "isFilled", "alignRight", "isIcon", "wrapModifier"]);
    return React72.createElement("div", Object.assign({ className: css(data_list_default.dataListCell, width > 1 && data_list_default.modifiers[`flex_${width}`], !isFilled && data_list_default.modifiers.noFill, alignRight && data_list_default.modifiers.alignRight, isIcon && data_list_default.modifiers.icon, className, wrapModifier && data_list_default.modifiers[wrapModifier]) }, props), children);
  };
  DataListCell.displayName = "DataListCell";

  // node_modules/@patternfly/react-icons/dist/esm/icons/grip-vertical-icon.js
  var GripVerticalIconConfig = {
    name: "GripVerticalIcon",
    height: 512,
    width: 320,
    svgPath: "M96 32H32C14.33 32 0 46.33 0 64v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32V64c0-17.67-14.33-32-32-32zm0 160H32c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zm0 160H32c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zM288 32h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32V64c0-17.67-14.33-32-32-32zm0 160h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32zm0 160h-64c-17.67 0-32 14.33-32 32v64c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32v-64c0-17.67-14.33-32-32-32z",
    yOffset: 0,
    xOffset: 0
  };
  var GripVerticalIcon = createIcon(GripVerticalIconConfig);
  var grip_vertical_icon_default = GripVerticalIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/DataList/DataListItem.js
  init_tslib_es6();
  var React73 = __toESM(require_react());
  var DataListItem = class extends React73.Component {
    render() {
      const _a = this.props, { children, isExpanded, className, id, "aria-labelledby": ariaLabelledBy, selectableInputAriaLabel } = _a, props = __rest(_a, ["children", "isExpanded", "className", "id", "aria-labelledby", "selectableInputAriaLabel"]);
      return React73.createElement(DataListContext.Consumer, null, ({ isSelectable, selectedDataListItemId, updateSelectedDataListItem, onSelectableRowChange }) => {
        const selectDataListItem = (event) => {
          let target = event.target;
          while (event.currentTarget !== target) {
            if ("onclick" in target && target.onclick || target.parentNode.classList.contains(data_list_default.dataListItemAction) || target.parentNode.classList.contains(data_list_default.dataListItemControl)) {
              return;
            } else {
              target = target.parentNode;
            }
          }
          updateSelectedDataListItem(event, id);
        };
        const onKeyDown = (event) => {
          if ([KeyTypes.Enter, KeyTypes.Space].includes(event.key)) {
            event.preventDefault();
            updateSelectedDataListItem(event, id);
          }
        };
        const isSelected = selectedDataListItemId === id;
        const selectableInputAriaProps = selectableInputAriaLabel ? { "aria-label": selectableInputAriaLabel } : { "aria-labelledby": ariaLabelledBy };
        return React73.createElement(
          "li",
          Object.assign({ id, className: css(data_list_default.dataListItem, isExpanded && data_list_default.modifiers.expanded, isSelectable && data_list_default.modifiers.clickable, selectedDataListItemId && isSelected && data_list_default.modifiers.selected, className), "aria-labelledby": ariaLabelledBy }, isSelectable && { tabIndex: 0, onClick: selectDataListItem, onKeyDown }, isSelectable && isSelected && { "aria-selected": true }, props),
          onSelectableRowChange && React73.createElement("input", Object.assign({ className: "pf-v5-screen-reader", type: "radio", checked: isSelected, onChange: (event) => onSelectableRowChange(event, id), tabIndex: -1 }, selectableInputAriaProps)),
          React73.Children.map(children, (child) => React73.isValidElement(child) && React73.cloneElement(child, {
            rowid: ariaLabelledBy
          }))
        );
      });
    }
  };
  DataListItem.displayName = "DataListItem";
  DataListItem.defaultProps = {
    isExpanded: false,
    className: "",
    id: "",
    children: null,
    "aria-labelledby": ""
  };

  // node_modules/@patternfly/react-core/dist/esm/components/DataList/DataListItemCells.js
  init_tslib_es6();
  var React74 = __toESM(require_react());
  var DataListItemCells = (_a) => {
    var {
      className = "",
      dataListCells,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      rowid = ""
    } = _a, props = __rest(_a, ["className", "dataListCells", "rowid"]);
    return React74.createElement("div", Object.assign({ className: css(data_list_default.dataListItemContent, className) }, props), dataListCells);
  };
  DataListItemCells.displayName = "DataListItemCells";

  // node_modules/@patternfly/react-core/dist/esm/components/DataList/DataListItemRow.js
  init_tslib_es6();
  var React75 = __toESM(require_react());
  var DataListItemRow = (_a) => {
    var { children, className = "", rowid = "", wrapModifier = null } = _a, props = __rest(_a, ["children", "className", "rowid", "wrapModifier"]);
    return React75.createElement("div", Object.assign({ className: css(data_list_default.dataListItemRow, className, wrapModifier && data_list_default.modifiers[wrapModifier]) }, props), React75.Children.map(children, (child) => React75.isValidElement(child) && React75.cloneElement(child, {
      rowid
    })));
  };
  DataListItemRow.displayName = "DataListItemRow";

  // node_modules/@patternfly/react-core/dist/esm/components/DatePicker/DatePicker.js
  init_tslib_es6();
  var React88 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/DatePicker/date-picker.mjs
  var date_picker_default = {
    "datePicker": "pf-v5-c-date-picker",
    "datePickerCalendar": "pf-v5-c-date-picker__calendar",
    "datePickerHelperText": "pf-v5-c-date-picker__helper-text",
    "datePickerInput": "pf-v5-c-date-picker__input",
    "formControl": "pf-v5-c-form-control",
    "modifiers": {
      "alignRight": "pf-m-align-right",
      "top": "pf-m-top",
      "static": "pf-m-static"
    },
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/Popover.js
  init_tslib_es6();
  var React85 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Popover/popover.mjs
  var popover_default = {
    "modifiers": {
      "noPadding": "pf-m-no-padding",
      "widthAuto": "pf-m-width-auto",
      "top": "pf-m-top",
      "topLeft": "pf-m-top-left",
      "topRight": "pf-m-top-right",
      "bottom": "pf-m-bottom",
      "bottomLeft": "pf-m-bottom-left",
      "bottomRight": "pf-m-bottom-right",
      "left": "pf-m-left",
      "leftTop": "pf-m-left-top",
      "leftBottom": "pf-m-left-bottom",
      "right": "pf-m-right",
      "rightTop": "pf-m-right-top",
      "rightBottom": "pf-m-right-bottom",
      "danger": "pf-m-danger",
      "warning": "pf-m-warning",
      "success": "pf-m-success",
      "custom": "pf-m-custom",
      "info": "pf-m-info"
    },
    "popover": "pf-v5-c-popover",
    "popoverArrow": "pf-v5-c-popover__arrow",
    "popoverBody": "pf-v5-c-popover__body",
    "popoverClose": "pf-v5-c-popover__close",
    "popoverContent": "pf-v5-c-popover__content",
    "popoverFooter": "pf-v5-c-popover__footer",
    "popoverHeader": "pf-v5-c-popover__header",
    "popoverTitle": "pf-v5-c-popover__title",
    "popoverTitleIcon": "pf-v5-c-popover__title-icon",
    "popoverTitleText": "pf-v5-c-popover__title-text",
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverContext.js
  var React76 = __toESM(require_react());
  var PopoverContext = React76.createContext({});

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverContent.js
  init_tslib_es6();
  var React77 = __toESM(require_react());
  var PopoverContent = (_a) => {
    var { className = null, children } = _a, props = __rest(_a, ["className", "children"]);
    return React77.createElement("div", Object.assign({ className: css(popover_default.popoverContent, className) }, props), children);
  };
  PopoverContent.displayName = "PopoverContent";

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverBody.js
  init_tslib_es6();
  var React78 = __toESM(require_react());
  var PopoverBody = (_a) => {
    var { children, id, className } = _a, props = __rest(_a, ["children", "id", "className"]);
    return React78.createElement("div", Object.assign({ className: css(popover_default.popoverBody, className), id }, props), children);
  };
  PopoverBody.displayName = "PopoverBody";

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverHeader.js
  init_tslib_es6();
  var React81 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverHeaderIcon.js
  init_tslib_es6();
  var React79 = __toESM(require_react());
  var PopoverHeaderIcon = (_a) => {
    var { children, className } = _a, props = __rest(_a, ["children", "className"]);
    return React79.createElement("span", Object.assign({ className: css(popover_default.popoverTitleIcon, className) }, props), children);
  };
  PopoverHeaderIcon.displayName = "PopoverHeaderIcon";

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverHeaderText.js
  init_tslib_es6();
  var React80 = __toESM(require_react());
  var PopoverHeaderText = (_a) => {
    var { children, className, headingLevel } = _a, props = __rest(_a, ["children", "className", "headingLevel"]);
    const HeadingLevel = headingLevel;
    return React80.createElement(HeadingLevel, Object.assign({ className: css(popover_default.popoverTitleText, className) }, props), children);
  };
  PopoverHeaderText.displayName = "PopoverHeaderText";

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverHeader.js
  var PopoverHeader = (_a) => {
    var { children, icon, className, titleHeadingLevel = "h6", alertSeverityVariant, id, alertSeverityScreenReaderText } = _a, props = __rest(_a, ["children", "icon", "className", "titleHeadingLevel", "alertSeverityVariant", "id", "alertSeverityScreenReaderText"]);
    return React81.createElement(
      "header",
      Object.assign({ className: css(popover_default.popoverHeader, className) }, props),
      React81.createElement(
        "div",
        { className: css(popover_default.popoverTitle), id },
        icon && React81.createElement(PopoverHeaderIcon, null, icon),
        React81.createElement(
          PopoverHeaderText,
          { headingLevel: titleHeadingLevel },
          alertSeverityVariant && alertSeverityScreenReaderText && React81.createElement("span", { className: "pf-v5-screen-reader" }, alertSeverityScreenReaderText),
          children
        )
      )
    );
  };
  PopoverHeader.displayName = "PopoverHeader";

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverFooter.js
  init_tslib_es6();
  var React82 = __toESM(require_react());
  var PopoverFooter = (_a) => {
    var { children, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    return React82.createElement("footer", Object.assign({ className: css(popover_default.popoverFooter, className) }, props), children);
  };
  PopoverFooter.displayName = "PopoverFooter";

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverCloseButton.js
  init_tslib_es6();
  var React83 = __toESM(require_react());
  var PopoverCloseButton = (_a) => {
    var { onClose = () => void 0 } = _a, props = __rest(_a, ["onClose"]);
    return React83.createElement(
      "div",
      { className: css(popover_default.popoverClose) },
      React83.createElement(
        Button,
        Object.assign({ onClick: onClose, variant: "plain", "aria-label": true }, props, { style: { pointerEvents: "auto" } }),
        React83.createElement(times_icon_default, null)
      )
    );
  };
  PopoverCloseButton.displayName = "PopoverCloseButton";

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/PopoverArrow.js
  init_tslib_es6();
  var React84 = __toESM(require_react());
  var PopoverArrow = (_a) => {
    var { className = "" } = _a, props = __rest(_a, ["className"]);
    return React84.createElement("div", Object.assign({ className: css(popover_default.popoverArrow, className) }, props));
  };
  PopoverArrow.displayName = "PopoverArrow";

  // node_modules/@patternfly/react-tokens/dist/esm/c_popover_MaxWidth.js
  var c_popover_MaxWidth = {
    "name": "--pf-v5-c-popover--MaxWidth",
    "value": "none",
    "var": "var(--pf-v5-c-popover--MaxWidth)"
  };
  var c_popover_MaxWidth_default = c_popover_MaxWidth;

  // node_modules/@patternfly/react-tokens/dist/esm/c_popover_MinWidth.js
  var c_popover_MinWidth = {
    "name": "--pf-v5-c-popover--MinWidth",
    "value": "auto",
    "var": "var(--pf-v5-c-popover--MinWidth)"
  };
  var c_popover_MinWidth_default = c_popover_MinWidth;

  // node_modules/@patternfly/react-core/dist/esm/components/Popover/Popover.js
  var PopoverPosition;
  (function(PopoverPosition2) {
    PopoverPosition2["auto"] = "auto";
    PopoverPosition2["top"] = "top";
    PopoverPosition2["bottom"] = "bottom";
    PopoverPosition2["left"] = "left";
    PopoverPosition2["right"] = "right";
    PopoverPosition2["topStart"] = "top-start";
    PopoverPosition2["topEnd"] = "top-end";
    PopoverPosition2["bottomStart"] = "bottom-start";
    PopoverPosition2["bottomEnd"] = "bottom-end";
    PopoverPosition2["leftStart"] = "left-start";
    PopoverPosition2["leftEnd"] = "left-end";
    PopoverPosition2["rightStart"] = "right-start";
    PopoverPosition2["rightEnd"] = "right-end";
  })(PopoverPosition || (PopoverPosition = {}));
  var alertStyle = {
    custom: popover_default.modifiers.custom,
    info: popover_default.modifiers.info,
    success: popover_default.modifiers.success,
    warning: popover_default.modifiers.warning,
    danger: popover_default.modifiers.danger
  };
  var Popover = (_a) => {
    var { children, position = "top", enableFlip = true, className = "", isVisible = null, shouldClose = () => null, shouldOpen = () => null, "aria-label": ariaLabel = "", bodyContent, headerContent = null, headerComponent = "h6", headerIcon = null, alertSeverityVariant, alertSeverityScreenReaderText, footerContent = null, appendTo = () => document.body, hideOnOutsideClick = true, onHide = () => null, onHidden = () => null, onShow = () => null, onShown = () => null, onMount = () => null, zIndex = 9999, triggerAction = "click", minWidth = c_popover_MinWidth_default && c_popover_MinWidth_default.value, maxWidth = c_popover_MaxWidth_default && c_popover_MaxWidth_default.value, closeBtnAriaLabel = "Close", showClose = true, distance = 25, flipBehavior = [
      "top",
      "bottom",
      "left",
      "right",
      "top-start",
      "top-end",
      "bottom-start",
      "bottom-end",
      "left-start",
      "left-end",
      "right-start",
      "right-end"
    ], animationDuration = 300, id, withFocusTrap: propWithFocusTrap, triggerRef, hasNoPadding = false, hasAutoWidth = false, elementToFocus } = _a, rest = __rest(_a, ["children", "position", "enableFlip", "className", "isVisible", "shouldClose", "shouldOpen", "aria-label", "bodyContent", "headerContent", "headerComponent", "headerIcon", "alertSeverityVariant", "alertSeverityScreenReaderText", "footerContent", "appendTo", "hideOnOutsideClick", "onHide", "onHidden", "onShow", "onShown", "onMount", "zIndex", "triggerAction", "minWidth", "maxWidth", "closeBtnAriaLabel", "showClose", "distance", "flipBehavior", "animationDuration", "id", "withFocusTrap", "triggerRef", "hasNoPadding", "hasAutoWidth", "elementToFocus"]);
    const uniqueId6 = id || getUniqueId();
    const triggerManually = isVisible !== null;
    const [visible, setVisible] = React85.useState(false);
    const [focusTrapActive, setFocusTrapActive] = React85.useState(Boolean(propWithFocusTrap));
    const popoverRef = React85.useRef(null);
    React85.useEffect(() => {
      onMount();
    }, []);
    React85.useEffect(() => {
      if (triggerManually) {
        if (isVisible) {
          show(void 0, true);
        } else {
          hide2();
        }
      }
    }, [isVisible, triggerManually]);
    const show = (event, withFocusTrap) => {
      event && onShow(event);
      setVisible(true);
      propWithFocusTrap !== false && withFocusTrap && setFocusTrapActive(true);
    };
    const hide2 = (event) => {
      event && onHide(event);
      setVisible(false);
    };
    const positionModifiers = {
      top: popover_default.modifiers.top,
      bottom: popover_default.modifiers.bottom,
      left: popover_default.modifiers.left,
      right: popover_default.modifiers.right,
      "top-start": popover_default.modifiers.topLeft,
      "top-end": popover_default.modifiers.topRight,
      "bottom-start": popover_default.modifiers.bottomLeft,
      "bottom-end": popover_default.modifiers.bottomRight,
      "left-start": popover_default.modifiers.leftTop,
      "left-end": popover_default.modifiers.leftBottom,
      "right-start": popover_default.modifiers.rightTop,
      "right-end": popover_default.modifiers.rightBottom
    };
    const hasCustomMinWidth = minWidth !== c_popover_MinWidth_default.value;
    const hasCustomMaxWidth = maxWidth !== c_popover_MaxWidth_default.value;
    const onDocumentKeyDown = (event) => {
      if (event.key === KeyTypes.Escape && visible) {
        if (triggerManually) {
          shouldClose(event, hide2);
        } else {
          hide2(event);
        }
      }
    };
    const onDocumentClick = (event, triggerElement, popperElement) => {
      if (hideOnOutsideClick && visible) {
        const isFromChild = popperElement && popperElement.contains(event.target);
        const isFromTrigger = triggerElement && triggerElement.contains(event.target);
        if (isFromChild || isFromTrigger) {
          return;
        }
        if (triggerManually) {
          shouldClose(event, hide2);
        } else {
          hide2(event);
        }
      }
    };
    const onTriggerClick = (event) => {
      if (triggerManually) {
        if (visible) {
          shouldClose(event, hide2);
        } else {
          shouldOpen(event, show);
        }
      } else {
        if (visible) {
          hide2(event);
        } else {
          show(event, true);
        }
      }
    };
    const onContentMouseDown = () => {
      if (focusTrapActive) {
        setFocusTrapActive(false);
      }
    };
    const onMouseEnter = (event) => {
      if (triggerManually) {
        shouldOpen(event, show);
      } else {
        show(event, false);
      }
    };
    const onMouseLeave = (event) => {
      if (triggerManually) {
        shouldClose(event, hide2);
      } else {
        hide2(event);
      }
    };
    const onFocus = (event) => {
      if (triggerManually) {
        shouldOpen(event, show);
      } else {
        show(event, false);
      }
    };
    const onBlur = (event) => {
      if (triggerManually) {
        shouldClose(event, hide2);
      } else {
        hide2(event);
      }
    };
    const closePopover = (event) => {
      event.stopPropagation();
      if (triggerManually) {
        shouldClose(event, hide2);
      } else {
        hide2(event);
      }
    };
    const content = React85.createElement(
      FocusTrap,
      Object.assign({ ref: popoverRef, active: focusTrapActive, focusTrapOptions: {
        returnFocusOnDeactivate: propWithFocusTrap !== false,
        clickOutsideDeactivates: true,
        // FocusTrap's initialFocus can accept false as a value to prevent initial focus.
        // We want to prevent this in case false is ever passed in.
        initialFocus: elementToFocus || void 0,
        checkCanFocusTrap: (containers) => new Promise((resolve) => {
          const interval2 = setInterval(() => {
            if (containers.every((container) => getComputedStyle(container).visibility !== "hidden")) {
              resolve();
              clearInterval(interval2);
            }
          }, 10);
        }),
        tabbableOptions: { displayCheck: "none" },
        fallbackFocus: () => {
          let node = null;
          if (document && document.activeElement) {
            node = document.activeElement;
          }
          return node;
        }
      }, preventScrollOnDeactivate: true, className: css(popover_default.popover, alertSeverityVariant && alertStyle[alertSeverityVariant], hasNoPadding && popover_default.modifiers.noPadding, hasAutoWidth && popover_default.modifiers.widthAuto, className), role: "dialog", "aria-modal": "true", "aria-label": headerContent ? void 0 : ariaLabel, "aria-labelledby": headerContent ? `popover-${uniqueId6}-header` : void 0, "aria-describedby": `popover-${uniqueId6}-body`, onMouseDown: onContentMouseDown, style: {
        minWidth: hasCustomMinWidth ? minWidth : null,
        maxWidth: hasCustomMaxWidth ? maxWidth : null
      } }, rest),
      React85.createElement(PopoverArrow, null),
      React85.createElement(
        PopoverContent,
        null,
        showClose && triggerAction === "click" && React85.createElement(PopoverCloseButton, { onClose: closePopover, "aria-label": closeBtnAriaLabel }),
        headerContent && React85.createElement(PopoverHeader, { id: `popover-${uniqueId6}-header`, icon: headerIcon, alertSeverityVariant, alertSeverityScreenReaderText: alertSeverityScreenReaderText || `${alertSeverityVariant} alert:`, titleHeadingLevel: headerComponent }, typeof headerContent === "function" ? headerContent(hide2) : headerContent),
        React85.createElement(PopoverBody, { id: `popover-${uniqueId6}-body` }, typeof bodyContent === "function" ? bodyContent(hide2) : bodyContent),
        footerContent && React85.createElement(PopoverFooter, { id: `popover-${uniqueId6}-footer` }, typeof footerContent === "function" ? footerContent(hide2) : footerContent)
      )
    );
    return React85.createElement(
      PopoverContext.Provider,
      { value: { headerComponent } },
      React85.createElement(Popper, { trigger: children, triggerRef, popper: content, popperRef: popoverRef, minWidth, appendTo, isVisible: visible, onMouseEnter: triggerAction === "hover" && onMouseEnter, onMouseLeave: triggerAction === "hover" && onMouseLeave, onPopperMouseEnter: triggerAction === "hover" && onMouseEnter, onPopperMouseLeave: triggerAction === "hover" && onMouseLeave, onFocus: triggerAction === "hover" && onFocus, onBlur: triggerAction === "hover" && onBlur, positionModifiers, distance, placement: position, onTriggerClick: triggerAction === "click" && onTriggerClick, onDocumentClick, onDocumentKeyDown, enableFlip, zIndex, flipBehavior, animationDuration, onHidden, onShown, onHide: () => setFocusTrapActive(false) })
    );
  };
  Popover.displayName = "Popover";

  // node_modules/@patternfly/react-icons/dist/esm/icons/outlined-calendar-alt-icon.js
  var OutlinedCalendarAltIconConfig = {
    name: "OutlinedCalendarAltIcon",
    height: 512,
    width: 448,
    svgPath: "M148 288h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm108-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 96v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96-260v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h48V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h128V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h48c26.5 0 48 21.5 48 48zm-48 346V160H48v298c0 3.3 2.7 6 6 6h340c3.3 0 6-2.7 6-6z",
    yOffset: 0,
    xOffset: 0
  };
  var OutlinedCalendarAltIcon = createIcon(OutlinedCalendarAltIconConfig);
  var outlined_calendar_alt_icon_default = OutlinedCalendarAltIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/DatePicker/DatePicker.js
  var import_react9 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/HelperText/HelperText.js
  init_tslib_es6();
  var React86 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/HelperText/helper-text.mjs
  var helper_text_default = {
    "helperText": "pf-v5-c-helper-text",
    "helperTextItem": "pf-v5-c-helper-text__item",
    "helperTextItemIcon": "pf-v5-c-helper-text__item-icon",
    "helperTextItemText": "pf-v5-c-helper-text__item-text",
    "modifiers": {
      "hidden": "pf-m-hidden",
      "indeterminate": "pf-m-indeterminate",
      "warning": "pf-m-warning",
      "success": "pf-m-success",
      "error": "pf-m-error",
      "dynamic": "pf-m-dynamic"
    },
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/HelperText/HelperText.js
  var HelperText = (_a) => {
    var { children, className, component = "div", id, isLiveRegion = false, "aria-label": ariaLabel } = _a, props = __rest(_a, ["children", "className", "component", "id", "isLiveRegion", "aria-label"]);
    const Component40 = component;
    return React86.createElement(Component40, Object.assign({ id, className: css(helper_text_default.helperText, className) }, isLiveRegion && { "aria-live": "polite" }, component === "ul" && { role: "list", "aria-label": ariaLabel }, props), children);
  };
  HelperText.displayName = "HelperText";

  // node_modules/@patternfly/react-core/dist/esm/components/HelperText/HelperTextItem.js
  init_tslib_es6();
  var React87 = __toESM(require_react());

  // node_modules/@patternfly/react-icons/dist/esm/icons/minus-icon.js
  var MinusIconConfig = {
    name: "MinusIcon",
    height: 512,
    width: 448,
    svgPath: "M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",
    yOffset: 0,
    xOffset: 0
  };
  var MinusIcon = createIcon(MinusIconConfig);
  var minus_icon_default = MinusIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/HelperText/HelperTextItem.js
  var variantStyle = {
    default: "",
    indeterminate: helper_text_default.modifiers.indeterminate,
    warning: helper_text_default.modifiers.warning,
    success: helper_text_default.modifiers.success,
    error: helper_text_default.modifiers.error
  };
  var HelperTextItem = (_a) => {
    var { children, className, component = "div", variant = "default", icon, isDynamic = false, hasIcon = isDynamic, id, screenReaderText = `${variant} status` } = _a, props = __rest(_a, ["children", "className", "component", "variant", "icon", "isDynamic", "hasIcon", "id", "screenReaderText"]);
    const Component40 = component;
    return React87.createElement(
      Component40,
      Object.assign({ className: css(helper_text_default.helperTextItem, variantStyle[variant], isDynamic && helper_text_default.modifiers.dynamic, className), id }, props),
      icon && React87.createElement("span", { className: css(helper_text_default.helperTextItemIcon), "aria-hidden": true }, icon),
      hasIcon && !icon && React87.createElement(
        "span",
        { className: css(helper_text_default.helperTextItemIcon), "aria-hidden": true },
        (variant === "default" || variant === "indeterminate") && React87.createElement(minus_icon_default, null),
        variant === "warning" && React87.createElement(exclamation_triangle_icon_default, null),
        variant === "success" && React87.createElement(check_circle_icon_default, null),
        variant === "error" && React87.createElement(exclamation_circle_icon_default, null)
      ),
      React87.createElement(
        "span",
        { className: css(helper_text_default.helperTextItemText) },
        children,
        isDynamic && React87.createElement(
          "span",
          { className: "pf-v5-screen-reader" },
          ": ",
          screenReaderText,
          ";"
        )
      )
    );
  };
  HelperTextItem.displayName = "HelperTextItem";

  // node_modules/@patternfly/react-tokens/dist/esm/c_date_picker__input_c_form_control_width_chars.js
  var c_date_picker__input_c_form_control_width_chars = {
    "name": "--pf-v5-c-date-picker__input--c-form-control--width-chars",
    "value": "10",
    "var": "var(--pf-v5-c-date-picker__input--c-form-control--width-chars)"
  };
  var c_date_picker_input_c_form_control_width_chars_default = c_date_picker__input_c_form_control_width_chars;

  // node_modules/@patternfly/react-core/dist/esm/components/DatePicker/DatePicker.js
  var yyyyMMddFormat = (date2) => `${date2.getFullYear()}-${(date2.getMonth() + 1).toString().padStart(2, "0")}-${date2.getDate().toString().padStart(2, "0")}`;
  var DatePickerBase = (_a, ref) => {
    var { className, locale: locale3 = void 0, dateFormat = yyyyMMddFormat, dateParse = (val) => val.split("-").length === 3 ? /* @__PURE__ */ new Date(`${val}T00:00:00`) : /* @__PURE__ */ new Date(void 0), isDisabled = false, placeholder = "YYYY-MM-DD", value: valueProp = "", "aria-label": ariaLabel = "Date picker", buttonAriaLabel = "Toggle date picker", onChange = () => void 0, onBlur = () => void 0, invalidFormatText = "Invalid date", requiredDateOptions, helperText, appendTo = "inline", popoverProps, monthFormat, weekdayFormat, longWeekdayFormat, dayFormat, weekStart, validators = [], rangeStart, style: styleProps = {}, inputProps = {} } = _a, props = __rest(_a, ["className", "locale", "dateFormat", "dateParse", "isDisabled", "placeholder", "value", "aria-label", "buttonAriaLabel", "onChange", "onBlur", "invalidFormatText", "requiredDateOptions", "helperText", "appendTo", "popoverProps", "monthFormat", "weekdayFormat", "longWeekdayFormat", "dayFormat", "weekStart", "validators", "rangeStart", "style", "inputProps"]);
    const [value, setValue] = React88.useState(valueProp);
    const [valueDate, setValueDate] = React88.useState(dateParse(value));
    const [errorText, setErrorText] = React88.useState("");
    const [popoverOpen, setPopoverOpen] = React88.useState(false);
    const [selectOpen, setSelectOpen] = React88.useState(false);
    const [pristine, setPristine] = React88.useState(true);
    const [textInputFocused, setTextInputFocused] = React88.useState(false);
    const widthChars = React88.useMemo(() => Math.max(dateFormat(/* @__PURE__ */ new Date()).length, placeholder.length), [dateFormat]);
    const style = Object.assign({ [c_date_picker_input_c_form_control_width_chars_default.name]: widthChars }, styleProps);
    const buttonRef = React88.useRef();
    const datePickerWrapperRef = React88.useRef();
    const triggerRef = React88.useRef();
    const dateIsRequired = (requiredDateOptions === null || requiredDateOptions === void 0 ? void 0 : requiredDateOptions.isRequired) || false;
    const emptyDateText = (requiredDateOptions === null || requiredDateOptions === void 0 ? void 0 : requiredDateOptions.emptyDateText) || "Date cannot be blank";
    React88.useEffect(() => {
      setValue(valueProp);
      setValueDate(dateParse(valueProp));
    }, [valueProp]);
    React88.useEffect(() => {
      if (isValidDate(valueDate)) {
        applyValidators(valueDate);
      }
    }, [validators]);
    React88.useEffect(() => {
      setPristine(!value);
      const newValueDate = dateParse(value);
      if (errorText && isValidDate(newValueDate)) {
        applyValidators(newValueDate);
      }
      if (value === "" && !pristine && !textInputFocused) {
        dateIsRequired ? setErrorText(emptyDateText) : setErrorText("");
      }
    }, [value]);
    const applyValidators = (date2) => {
      setErrorText(validators.map((validator) => validator(date2)).join("\n") || "");
    };
    const onTextInput = (event, value2) => {
      setValue(value2);
      setErrorText("");
      const newValueDate = dateParse(value2);
      setValueDate(newValueDate);
      if (isValidDate(newValueDate)) {
        onChange(event, value2, new Date(newValueDate));
      } else {
        onChange(event, value2);
      }
    };
    const onInputBlur = (event) => {
      setTextInputFocused(false);
      const newValueDate = dateParse(value);
      const dateIsValid = isValidDate(newValueDate);
      const onBlurDateArg = dateIsValid ? new Date(newValueDate) : void 0;
      onBlur(event, value, onBlurDateArg);
      if (dateIsValid) {
        applyValidators(newValueDate);
      }
      if (!dateIsValid && !pristine) {
        setErrorText(invalidFormatText);
      }
      if (!dateIsValid && pristine && (requiredDateOptions === null || requiredDateOptions === void 0 ? void 0 : requiredDateOptions.isRequired)) {
        setErrorText(emptyDateText);
      }
    };
    const onDateClick = (_event, newValueDate) => {
      const newValue = dateFormat(newValueDate);
      setValue(newValue);
      setValueDate(newValueDate);
      applyValidators(newValueDate);
      setPopoverOpen(false);
      onChange(null, newValue, new Date(newValueDate));
    };
    const onKeyPress = (ev) => {
      if (ev.key === "Enter" && value) {
        if (isValidDate(valueDate)) {
          applyValidators(valueDate);
        } else {
          setErrorText(invalidFormatText);
        }
      }
    };
    (0, import_react9.useImperativeHandle)(ref, () => ({
      setCalendarOpen: (isOpen) => setPopoverOpen(isOpen),
      toggleCalendar: (setOpen) => {
        setPopoverOpen((prev) => setOpen !== void 0 ? setOpen : !prev);
      },
      isCalendarOpen: popoverOpen
    }), [setPopoverOpen, popoverOpen, selectOpen]);
    const createFocusSelectorString = (modifierClass) => `.${calendar_month_default.calendarMonthDatesCell}.${modifierClass} .${calendar_month_default.calendarMonthDate}`;
    const focusSelectorForSelectedDate = createFocusSelectorString(calendar_month_default.modifiers.selected);
    const focusSelectorForSelectedEndRangeDate = createFocusSelectorString(`${calendar_month_default.modifiers.selected}.${calendar_month_default.modifiers.endRange}`);
    const focusSelectorForUnselectedDate = createFocusSelectorString(calendar_month_default.modifiers.current);
    const getElementSelectorToFocus = () => {
      if (isValidDate(valueDate) && isValidDate(rangeStart)) {
        return focusSelectorForSelectedEndRangeDate;
      }
      if (isValidDate(valueDate) || isValidDate(rangeStart)) {
        return focusSelectorForSelectedDate;
      }
      return focusSelectorForUnselectedDate;
    };
    return React88.createElement(
      "div",
      Object.assign({ className: css(date_picker_default.datePicker, className), ref: datePickerWrapperRef, style }, props),
      React88.createElement(
        Popover,
        Object.assign({ elementToFocus: getElementSelectorToFocus(), position: "bottom", bodyContent: React88.createElement(CalendarMonth, {
          date: valueDate,
          onChange: onDateClick,
          locale: locale3,
          // Use truthy values of strings
          validators: validators.map((validator) => (date2) => !validator(date2)),
          onSelectToggle: (open) => setSelectOpen(open),
          monthFormat,
          weekdayFormat,
          longWeekdayFormat,
          dayFormat,
          weekStart,
          rangeStart
        }), showClose: false, isVisible: popoverOpen, shouldClose: (event, hideFunction) => {
          event = event;
          if (event.key === KeyTypes.Escape && selectOpen) {
            event.stopPropagation();
            setSelectOpen(false);
            return false;
          }
          if (buttonRef.current && buttonRef.current.contains(event.target)) {
            return false;
          }
          if (popoverOpen) {
            event.stopPropagation();
            setPopoverOpen(false);
            hideFunction();
            (requiredDateOptions === null || requiredDateOptions === void 0 ? void 0 : requiredDateOptions.isRequired) && !value && setErrorText(emptyDateText);
          }
          if (event.key === KeyTypes.Escape && popoverOpen) {
            event.stopPropagation();
          }
          return true;
        }, withFocusTrap: true, hasNoPadding: true, hasAutoWidth: true, appendTo, triggerRef }, popoverProps),
        React88.createElement(
          "div",
          { className: date_picker_default.datePickerInput, ref: triggerRef },
          React88.createElement(
            InputGroup,
            null,
            React88.createElement(
              InputGroupItem,
              null,
              React88.createElement(TextInput, Object.assign({ isDisabled, isRequired: requiredDateOptions === null || requiredDateOptions === void 0 ? void 0 : requiredDateOptions.isRequired, "aria-label": ariaLabel, placeholder, validated: errorText.trim() ? "error" : "default", value, onChange: onTextInput, onBlur: onInputBlur, onFocus: () => setTextInputFocused(true), onKeyPress }, inputProps))
            ),
            React88.createElement(
              InputGroupItem,
              null,
              React88.createElement(
                "button",
                {
                  ref: buttonRef,
                  // TODO: Removed style follow up work with issue #8457
                  className: css(button_default.button, button_default.modifiers.control),
                  "aria-label": buttonAriaLabel,
                  type: "button",
                  onClick: () => setPopoverOpen(!popoverOpen),
                  disabled: isDisabled
                },
                React88.createElement(outlined_calendar_alt_icon_default, null)
              )
            )
          )
        )
      ),
      (errorText || helperText) && React88.createElement("div", { className: date_picker_default.datePickerHelperText }, errorText ? React88.createElement(
        HelperText,
        null,
        React88.createElement(HelperTextItem, { variant: "error" }, errorText)
      ) : helperText)
    );
  };
  var DatePicker = React88.forwardRef(DatePickerBase);
  DatePicker.displayName = "DatePicker";

  // node_modules/@patternfly/react-core/dist/esm/components/DescriptionList/DescriptionList.js
  init_tslib_es6();
  var React89 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/DescriptionList/description-list.mjs
  var description_list_default = {
    "card": "pf-v5-c-card",
    "descriptionList": "pf-v5-c-description-list",
    "descriptionListDescription": "pf-v5-c-description-list__description",
    "descriptionListGroup": "pf-v5-c-description-list__group",
    "descriptionListTerm": "pf-v5-c-description-list__term",
    "descriptionListTermIcon": "pf-v5-c-description-list__term-icon",
    "descriptionListText": "pf-v5-c-description-list__text",
    "modifiers": {
      "inlineGrid": "pf-m-inline-grid",
      "autoColumnWidths": "pf-m-auto-column-widths",
      "autoFit": "pf-m-auto-fit",
      "compact": "pf-m-compact",
      "fluid": "pf-m-fluid",
      "fillColumns": "pf-m-fill-columns",
      "displayLg": "pf-m-display-lg",
      "display_2xl": "pf-m-display-2xl",
      "helpText": "pf-m-help-text",
      "1Col": "pf-m-1-col",
      "2Col": "pf-m-2-col",
      "3Col": "pf-m-3-col",
      "horizontal": "pf-m-horizontal",
      "vertical": "pf-m-vertical",
      "1ColOnSm": "pf-m-1-col-on-sm",
      "2ColOnSm": "pf-m-2-col-on-sm",
      "3ColOnSm": "pf-m-3-col-on-sm",
      "horizontalOnSm": "pf-m-horizontal-on-sm",
      "verticalOnSm": "pf-m-vertical-on-sm",
      "1ColOnMd": "pf-m-1-col-on-md",
      "2ColOnMd": "pf-m-2-col-on-md",
      "3ColOnMd": "pf-m-3-col-on-md",
      "horizontalOnMd": "pf-m-horizontal-on-md",
      "verticalOnMd": "pf-m-vertical-on-md",
      "1ColOnLg": "pf-m-1-col-on-lg",
      "2ColOnLg": "pf-m-2-col-on-lg",
      "3ColOnLg": "pf-m-3-col-on-lg",
      "horizontalOnLg": "pf-m-horizontal-on-lg",
      "verticalOnLg": "pf-m-vertical-on-lg",
      "1ColOnXl": "pf-m-1-col-on-xl",
      "2ColOnXl": "pf-m-2-col-on-xl",
      "3ColOnXl": "pf-m-3-col-on-xl",
      "horizontalOnXl": "pf-m-horizontal-on-xl",
      "verticalOnXl": "pf-m-vertical-on-xl",
      "1ColOn_2xl": "pf-m-1-col-on-2xl",
      "2ColOn_2xl": "pf-m-2-col-on-2xl",
      "3ColOn_2xl": "pf-m-3-col-on-2xl",
      "horizontalOn_2xl": "pf-m-horizontal-on-2xl",
      "verticalOn_2xl": "pf-m-vertical-on-2xl"
    }
  };

  // node_modules/@patternfly/react-tokens/dist/esm/c_description_list_GridTemplateColumns_min.js
  var c_description_list_GridTemplateColumns_min = {
    "name": "--pf-v5-c-description-list--GridTemplateColumns--min",
    "value": "0",
    "var": "var(--pf-v5-c-description-list--GridTemplateColumns--min)"
  };
  var c_description_list_GridTemplateColumns_min_default = c_description_list_GridTemplateColumns_min;

  // node_modules/@patternfly/react-tokens/dist/esm/c_description_list__term_width.js
  var c_description_list__term_width = {
    "name": "--pf-v5-c-description-list__term--width",
    "value": "12ch",
    "var": "var(--pf-v5-c-description-list__term--width)"
  };
  var c_description_list_term_width_default = c_description_list__term_width;

  // node_modules/@patternfly/react-tokens/dist/esm/c_description_list_m_horizontal__term_width.js
  var c_description_list_m_horizontal__term_width = {
    "name": "--pf-v5-c-description-list--m-horizontal__term--width",
    "value": "fit-content(20ch)",
    "var": "var(--pf-v5-c-description-list--m-horizontal__term--width)"
  };
  var c_description_list_m_horizontal_term_width_default = c_description_list_m_horizontal__term_width;

  // node_modules/@patternfly/react-core/dist/esm/components/DescriptionList/DescriptionList.js
  var setBreakpointModifiers = (prefix, modifiers) => {
    const mods = modifiers;
    return Object.keys(mods || {}).reduce((acc, curr) => curr === "default" ? Object.assign(Object.assign({}, acc), { [prefix]: mods[curr] }) : Object.assign(Object.assign({}, acc), { [`${prefix}-on-${curr}`]: mods[curr] }), {});
  };
  var DescriptionList = (_a) => {
    var { className = "", children = null, isHorizontal: isHorizontal2 = false, isAutoColumnWidths, isAutoFit, isInlineGrid, isCompact, isFluid, isFillColumns, displaySize = "default", columnModifier, autoFitMinModifier, termWidth, horizontalTermWidthModifier, orientation, style } = _a, props = __rest(_a, ["className", "children", "isHorizontal", "isAutoColumnWidths", "isAutoFit", "isInlineGrid", "isCompact", "isFluid", "isFillColumns", "displaySize", "columnModifier", "autoFitMinModifier", "termWidth", "horizontalTermWidthModifier", "orientation", "style"]);
    if (isAutoFit && autoFitMinModifier) {
      style = Object.assign(Object.assign({}, style), setBreakpointModifiers(c_description_list_GridTemplateColumns_min_default.name, autoFitMinModifier));
    }
    if (termWidth) {
      style = Object.assign(Object.assign({}, style), { [c_description_list_term_width_default.name]: termWidth });
    }
    if (isHorizontal2 && horizontalTermWidthModifier) {
      style = Object.assign(Object.assign({}, style), setBreakpointModifiers(c_description_list_m_horizontal_term_width_default.name, horizontalTermWidthModifier));
    }
    return React89.createElement("dl", Object.assign({ className: css(description_list_default.descriptionList, (isHorizontal2 || isFluid) && description_list_default.modifiers.horizontal, isAutoColumnWidths && description_list_default.modifiers.autoColumnWidths, isAutoFit && description_list_default.modifiers.autoFit, formatBreakpointMods(columnModifier, description_list_default), formatBreakpointMods(orientation, description_list_default), isInlineGrid && description_list_default.modifiers.inlineGrid, isCompact && description_list_default.modifiers.compact, isFluid && description_list_default.modifiers.fluid, isFillColumns && description_list_default.modifiers.fillColumns, displaySize === "lg" && description_list_default.modifiers.displayLg, displaySize === "2xl" && description_list_default.modifiers.display_2xl, className), style }, props), children);
  };
  DescriptionList.displayName = "DescriptionList";

  // node_modules/@patternfly/react-core/dist/esm/components/DescriptionList/DescriptionListDescription.js
  init_tslib_es6();
  var React90 = __toESM(require_react());
  var DescriptionListDescription = (_a) => {
    var { children = null, className } = _a, props = __rest(_a, ["children", "className"]);
    return React90.createElement(
      "dd",
      Object.assign({ className: css(description_list_default.descriptionListDescription, className) }, props),
      React90.createElement("div", { className: css(description_list_default.descriptionListText) }, children)
    );
  };
  DescriptionListDescription.displayName = "DescriptionListDescription";

  // node_modules/@patternfly/react-core/dist/esm/components/DescriptionList/DescriptionListGroup.js
  init_tslib_es6();
  var React91 = __toESM(require_react());
  var DescriptionListGroup = (_a) => {
    var { className, children } = _a, props = __rest(_a, ["className", "children"]);
    return React91.createElement("div", Object.assign({ className: css(description_list_default.descriptionListGroup, className) }, props), children);
  };
  DescriptionListGroup.displayName = "DescriptionListGroup";

  // node_modules/@patternfly/react-core/dist/esm/components/DescriptionList/DescriptionListTerm.js
  init_tslib_es6();
  var React92 = __toESM(require_react());
  var DescriptionListTerm = (_a) => {
    var { children, className, icon } = _a, props = __rest(_a, ["children", "className", "icon"]);
    return React92.createElement(
      "dt",
      Object.assign({ className: css(description_list_default.descriptionListTerm, className) }, props),
      icon ? React92.createElement("span", { className: css(description_list_default.descriptionListTermIcon) }, icon) : null,
      React92.createElement("span", { className: css(description_list_default.descriptionListText) }, children)
    );
  };
  DescriptionListTerm.displayName = "DescriptionListTerm";

  // node_modules/@patternfly/react-core/dist/esm/components/Divider/Divider.js
  init_tslib_es6();
  var React93 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Divider/divider.mjs
  var divider_default = {
    "divider": "pf-v5-c-divider",
    "modifiers": {
      "hidden": "pf-m-hidden",
      "hiddenOnSm": "pf-m-hidden-on-sm",
      "visibleOnSm": "pf-m-visible-on-sm",
      "hiddenOnMd": "pf-m-hidden-on-md",
      "visibleOnMd": "pf-m-visible-on-md",
      "hiddenOnLg": "pf-m-hidden-on-lg",
      "visibleOnLg": "pf-m-visible-on-lg",
      "hiddenOnXl": "pf-m-hidden-on-xl",
      "visibleOnXl": "pf-m-visible-on-xl",
      "hiddenOn_2xl": "pf-m-hidden-on-2xl",
      "visibleOn_2xl": "pf-m-visible-on-2xl",
      "vertical": "pf-m-vertical",
      "insetNone": "pf-m-inset-none",
      "insetXs": "pf-m-inset-xs",
      "insetSm": "pf-m-inset-sm",
      "insetMd": "pf-m-inset-md",
      "insetLg": "pf-m-inset-lg",
      "insetXl": "pf-m-inset-xl",
      "inset_2xl": "pf-m-inset-2xl",
      "inset_3xl": "pf-m-inset-3xl",
      "horizontalOnSm": "pf-m-horizontal-on-sm",
      "verticalOnSm": "pf-m-vertical-on-sm",
      "insetNoneOnSm": "pf-m-inset-none-on-sm",
      "insetXsOnSm": "pf-m-inset-xs-on-sm",
      "insetSmOnSm": "pf-m-inset-sm-on-sm",
      "insetMdOnSm": "pf-m-inset-md-on-sm",
      "insetLgOnSm": "pf-m-inset-lg-on-sm",
      "insetXlOnSm": "pf-m-inset-xl-on-sm",
      "inset_2xlOnSm": "pf-m-inset-2xl-on-sm",
      "inset_3xlOnSm": "pf-m-inset-3xl-on-sm",
      "horizontalOnMd": "pf-m-horizontal-on-md",
      "verticalOnMd": "pf-m-vertical-on-md",
      "insetNoneOnMd": "pf-m-inset-none-on-md",
      "insetXsOnMd": "pf-m-inset-xs-on-md",
      "insetSmOnMd": "pf-m-inset-sm-on-md",
      "insetMdOnMd": "pf-m-inset-md-on-md",
      "insetLgOnMd": "pf-m-inset-lg-on-md",
      "insetXlOnMd": "pf-m-inset-xl-on-md",
      "inset_2xlOnMd": "pf-m-inset-2xl-on-md",
      "inset_3xlOnMd": "pf-m-inset-3xl-on-md",
      "horizontalOnLg": "pf-m-horizontal-on-lg",
      "verticalOnLg": "pf-m-vertical-on-lg",
      "insetNoneOnLg": "pf-m-inset-none-on-lg",
      "insetXsOnLg": "pf-m-inset-xs-on-lg",
      "insetSmOnLg": "pf-m-inset-sm-on-lg",
      "insetMdOnLg": "pf-m-inset-md-on-lg",
      "insetLgOnLg": "pf-m-inset-lg-on-lg",
      "insetXlOnLg": "pf-m-inset-xl-on-lg",
      "inset_2xlOnLg": "pf-m-inset-2xl-on-lg",
      "inset_3xlOnLg": "pf-m-inset-3xl-on-lg",
      "horizontalOnXl": "pf-m-horizontal-on-xl",
      "verticalOnXl": "pf-m-vertical-on-xl",
      "insetNoneOnXl": "pf-m-inset-none-on-xl",
      "insetXsOnXl": "pf-m-inset-xs-on-xl",
      "insetSmOnXl": "pf-m-inset-sm-on-xl",
      "insetMdOnXl": "pf-m-inset-md-on-xl",
      "insetLgOnXl": "pf-m-inset-lg-on-xl",
      "insetXlOnXl": "pf-m-inset-xl-on-xl",
      "inset_2xlOnXl": "pf-m-inset-2xl-on-xl",
      "inset_3xlOnXl": "pf-m-inset-3xl-on-xl",
      "horizontalOn_2xl": "pf-m-horizontal-on-2xl",
      "verticalOn_2xl": "pf-m-vertical-on-2xl",
      "insetNoneOn_2xl": "pf-m-inset-none-on-2xl",
      "insetXsOn_2xl": "pf-m-inset-xs-on-2xl",
      "insetSmOn_2xl": "pf-m-inset-sm-on-2xl",
      "insetMdOn_2xl": "pf-m-inset-md-on-2xl",
      "insetLgOn_2xl": "pf-m-inset-lg-on-2xl",
      "insetXlOn_2xl": "pf-m-inset-xl-on-2xl",
      "inset_2xlOn_2xl": "pf-m-inset-2xl-on-2xl",
      "inset_3xlOn_2xl": "pf-m-inset-3xl-on-2xl"
    }
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Divider/Divider.js
  var DividerVariant;
  (function(DividerVariant2) {
    DividerVariant2["hr"] = "hr";
    DividerVariant2["li"] = "li";
    DividerVariant2["div"] = "div";
  })(DividerVariant || (DividerVariant = {}));
  var Divider = (_a) => {
    var { className, component = DividerVariant.hr, inset, orientation } = _a, props = __rest(_a, ["className", "component", "inset", "orientation"]);
    const Component40 = component;
    return React93.createElement(Component40, Object.assign({ className: css(divider_default.divider, formatBreakpointMods(inset, divider_default), formatBreakpointMods(orientation, divider_default), className) }, component !== "hr" && { role: "separator" }, props));
  };
  Divider.displayName = "Divider";

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/Drawer.js
  init_tslib_es6();
  var React94 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Drawer/drawer.mjs
  var drawer_default = {
    "dirRtl": "pf-v5-m-dir-rtl",
    "drawer": "pf-v5-c-drawer",
    "drawerActions": "pf-v5-c-drawer__actions",
    "drawerBody": "pf-v5-c-drawer__body",
    "drawerClose": "pf-v5-c-drawer__close",
    "drawerContent": "pf-v5-c-drawer__content",
    "drawerHead": "pf-v5-c-drawer__head",
    "drawerMain": "pf-v5-c-drawer__main",
    "drawerPanel": "pf-v5-c-drawer__panel",
    "drawerPanelMain": "pf-v5-c-drawer__panel-main",
    "drawerSection": "pf-v5-c-drawer__section",
    "drawerSplitter": "pf-v5-c-drawer__splitter",
    "drawerSplitterHandle": "pf-v5-c-drawer__splitter-handle",
    "modifiers": {
      "panelBottom": "pf-m-panel-bottom",
      "inline": "pf-m-inline",
      "noBorder": "pf-m-no-border",
      "resizable": "pf-m-resizable",
      "static": "pf-m-static",
      "panelLeft": "pf-m-panel-left",
      "expanded": "pf-m-expanded",
      "resizing": "pf-m-resizing",
      "noBackground": "pf-m-no-background",
      "light_200": "pf-m-light-200",
      "noPadding": "pf-m-no-padding",
      "padding": "pf-m-padding",
      "vertical": "pf-m-vertical",
      "width_25": "pf-m-width-25",
      "width_33": "pf-m-width-33",
      "width_50": "pf-m-width-50",
      "width_66": "pf-m-width-66",
      "width_75": "pf-m-width-75",
      "width_100": "pf-m-width-100",
      "width_25OnLg": "pf-m-width-25-on-lg",
      "width_33OnLg": "pf-m-width-33-on-lg",
      "width_50OnLg": "pf-m-width-50-on-lg",
      "width_66OnLg": "pf-m-width-66-on-lg",
      "width_75OnLg": "pf-m-width-75-on-lg",
      "width_100OnLg": "pf-m-width-100-on-lg",
      "width_25OnXl": "pf-m-width-25-on-xl",
      "width_33OnXl": "pf-m-width-33-on-xl",
      "width_50OnXl": "pf-m-width-50-on-xl",
      "width_66OnXl": "pf-m-width-66-on-xl",
      "width_75OnXl": "pf-m-width-75-on-xl",
      "width_100OnXl": "pf-m-width-100-on-xl",
      "width_25On_2xl": "pf-m-width-25-on-2xl",
      "width_33On_2xl": "pf-m-width-33-on-2xl",
      "width_50On_2xl": "pf-m-width-50-on-2xl",
      "width_66On_2xl": "pf-m-width-66-on-2xl",
      "width_75On_2xl": "pf-m-width-75-on-2xl",
      "width_100On_2xl": "pf-m-width-100-on-2xl",
      "inlineOnLg": "pf-m-inline-on-lg",
      "staticOnLg": "pf-m-static-on-lg",
      "inlineOnXl": "pf-m-inline-on-xl",
      "staticOnXl": "pf-m-static-on-xl",
      "inlineOn_2xl": "pf-m-inline-on-2xl",
      "staticOn_2xl": "pf-m-static-on-2xl"
    },
    "pageMain": "pf-v5-c-page__main",
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/Drawer.js
  var DrawerColorVariant;
  (function(DrawerColorVariant2) {
    DrawerColorVariant2["default"] = "default";
    DrawerColorVariant2["light200"] = "light-200";
    DrawerColorVariant2["noBackground"] = "no-background";
  })(DrawerColorVariant || (DrawerColorVariant = {}));
  var DrawerContext = React94.createContext({
    isExpanded: false,
    isStatic: false,
    onExpand: () => {
    },
    position: "end",
    drawerRef: null,
    drawerContentRef: null,
    isInline: false
  });
  var Drawer = (_a) => {
    var { className = "", children, isExpanded = false, isInline = false, isStatic = false, position = "end", onExpand = () => {
    } } = _a, props = __rest(_a, ["className", "children", "isExpanded", "isInline", "isStatic", "position", "onExpand"]);
    const drawerRef = React94.useRef();
    const drawerContentRef = React94.useRef();
    return React94.createElement(
      DrawerContext.Provider,
      { value: { isExpanded, isStatic, onExpand, position, drawerRef, drawerContentRef, isInline } },
      React94.createElement("div", Object.assign({ className: css(drawer_default.drawer, isExpanded && drawer_default.modifiers.expanded, isInline && drawer_default.modifiers.inline, isStatic && drawer_default.modifiers.static, (position === "left" || position === "start") && drawer_default.modifiers.panelLeft, position === "bottom" && drawer_default.modifiers.panelBottom, className), ref: drawerRef }, props), children)
    );
  };
  Drawer.displayName = "Drawer";

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerActions.js
  init_tslib_es6();
  var React95 = __toESM(require_react());
  var DrawerActions = (_a) => {
    var { className = "", children } = _a, props = __rest(_a, ["className", "children"]);
    return React95.createElement("div", Object.assign({ className: css(drawer_default.drawerActions, className) }, props), children);
  };
  DrawerActions.displayName = "DrawerActions";

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerCloseButton.js
  init_tslib_es6();
  var React96 = __toESM(require_react());
  var DrawerCloseButton = (_a) => {
    var { className = "", onClose = () => void 0, "aria-label": ariaLabel = "Close drawer panel" } = _a, props = __rest(_a, ["className", "onClose", "aria-label"]);
    return React96.createElement(
      "div",
      Object.assign({ className: css(drawer_default.drawerClose, className) }, props),
      React96.createElement(
        Button,
        { variant: "plain", onClick: onClose, "aria-label": ariaLabel },
        React96.createElement(times_icon_default, null)
      )
    );
  };
  DrawerCloseButton.displayName = "DrawerCloseButton";

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerContent.js
  init_tslib_es6();
  var React98 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerMain.js
  init_tslib_es6();
  var React97 = __toESM(require_react());
  var DrawerMain = (_a) => {
    var { className = "", children } = _a, props = __rest(_a, ["className", "children"]);
    return React97.createElement("div", Object.assign({ className: css(drawer_default.drawerMain, className) }, props), children);
  };
  DrawerMain.displayName = "DrawerMain";

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerContent.js
  var DrawerContent = (_a) => {
    var { className = "", children, panelContent, colorVariant = DrawerColorVariant.default } = _a, props = __rest(_a, ["className", "children", "panelContent", "colorVariant"]);
    const { drawerContentRef } = React98.useContext(DrawerContext);
    return React98.createElement(
      DrawerMain,
      null,
      React98.createElement("div", Object.assign({ className: css(drawer_default.drawerContent, colorVariant === DrawerColorVariant.light200 && drawer_default.modifiers.light_200, colorVariant === DrawerColorVariant.noBackground && drawer_default.modifiers.noBackground, className), ref: drawerContentRef }, props), children),
      panelContent
    );
  };
  DrawerContent.displayName = "DrawerContent";

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerContentBody.js
  init_tslib_es6();
  var React99 = __toESM(require_react());
  var DrawerContentBody = (_a) => {
    var { className = "", children, hasPadding = false } = _a, props = __rest(_a, ["className", "children", "hasPadding"]);
    return React99.createElement("div", Object.assign({ className: css(drawer_default.drawerBody, hasPadding && drawer_default.modifiers.padding, className) }, props), children);
  };
  DrawerContentBody.displayName = "DrawerContentBody";

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerHead.js
  init_tslib_es6();
  var React101 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerPanelBody.js
  init_tslib_es6();
  var React100 = __toESM(require_react());
  var DrawerPanelBody = (_a) => {
    var { className = "", children, hasNoPadding = false } = _a, props = __rest(_a, ["className", "children", "hasNoPadding"]);
    return React100.createElement("div", Object.assign({ className: css(drawer_default.drawerBody, hasNoPadding && drawer_default.modifiers.noPadding, className) }, props), children);
  };
  DrawerPanelBody.displayName = "DrawerPanelBody";

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerHead.js
  var DrawerHead = (_a) => {
    var { className = "", children, hasNoPadding = false } = _a, props = __rest(_a, ["className", "children", "hasNoPadding"]);
    return React101.createElement(
      DrawerPanelBody,
      { hasNoPadding },
      React101.createElement("div", Object.assign({ className: css(drawer_default.drawerHead, className) }, props), children)
    );
  };
  DrawerHead.displayName = "DrawerHead";

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerPanelContent.js
  init_tslib_es6();
  var React102 = __toESM(require_react());

  // node_modules/@patternfly/react-tokens/dist/esm/c_drawer__panel_md_FlexBasis.js
  var c_drawer__panel_md_FlexBasis = {
    "name": "--pf-v5-c-drawer__panel--md--FlexBasis",
    "value": "50%",
    "var": "var(--pf-v5-c-drawer__panel--md--FlexBasis)"
  };
  var c_drawer_panel_md_FlexBasis_default = c_drawer__panel_md_FlexBasis;

  // node_modules/@patternfly/react-tokens/dist/esm/c_drawer__panel_md_FlexBasis_min.js
  var c_drawer__panel_md_FlexBasis_min = {
    "name": "--pf-v5-c-drawer__panel--md--FlexBasis--min",
    "value": "1.5rem",
    "var": "var(--pf-v5-c-drawer__panel--md--FlexBasis--min)"
  };
  var c_drawer_panel_md_FlexBasis_min_default = c_drawer__panel_md_FlexBasis_min;

  // node_modules/@patternfly/react-tokens/dist/esm/c_drawer__panel_md_FlexBasis_max.js
  var c_drawer__panel_md_FlexBasis_max = {
    "name": "--pf-v5-c-drawer__panel--md--FlexBasis--max",
    "value": "100%",
    "var": "var(--pf-v5-c-drawer__panel--md--FlexBasis--max)"
  };
  var c_drawer_panel_md_FlexBasis_max_default = c_drawer__panel_md_FlexBasis_max;

  // node_modules/@patternfly/react-core/dist/esm/components/Drawer/DrawerPanelContent.js
  var isResizing = null;
  var newSize = 0;
  var DrawerPanelContent = (_a) => {
    var { className = "", id, children, hasNoBorder = false, isResizable = false, onResize, minSize, defaultSize, maxSize, increment = 5, resizeAriaLabel = "Resize", widths, colorVariant = DrawerColorVariant.default, focusTrap } = _a, props = __rest(_a, ["className", "id", "children", "hasNoBorder", "isResizable", "onResize", "minSize", "defaultSize", "maxSize", "increment", "resizeAriaLabel", "widths", "colorVariant", "focusTrap"]);
    const panel = React102.useRef();
    const splitterRef = React102.useRef();
    const [separatorValue, setSeparatorValue] = React102.useState(0);
    const { position, isExpanded, isStatic, onExpand, drawerRef, drawerContentRef, isInline } = React102.useContext(DrawerContext);
    const hidden = isStatic ? false : !isExpanded;
    const [isExpandedInternal, setIsExpandedInternal] = React102.useState(!hidden);
    const [isFocusTrapActive, setIsFocusTrapActive] = React102.useState(false);
    const previouslyFocusedElement = React102.useRef(null);
    let currWidth = 0;
    let panelRect;
    let end2;
    let start2;
    let bottom2;
    let setInitialVals = true;
    if (isStatic && (focusTrap === null || focusTrap === void 0 ? void 0 : focusTrap.enabled)) {
      console.warn(`DrawerPanelContent: The focusTrap.enabled prop cannot be true if the Drawer's isStatic prop is true. This will cause a permanent focus trap.`);
    }
    React102.useEffect(() => {
      if (!isStatic && isExpanded) {
        setIsExpandedInternal(isExpanded);
      }
    }, [isStatic, isExpanded]);
    const calcValueNow = () => {
      let splitterPos;
      let drawerSize;
      const isRTL = getLanguageDirection(panel.current) === "rtl";
      if (isInline && (position === "end" || position === "right")) {
        if (isRTL) {
          splitterPos = panel.current.getBoundingClientRect().left - splitterRef.current.getBoundingClientRect().right;
          drawerSize = drawerRef.current.getBoundingClientRect().left - drawerRef.current.getBoundingClientRect().right;
        } else {
          splitterPos = panel.current.getBoundingClientRect().right - splitterRef.current.getBoundingClientRect().left;
          drawerSize = drawerRef.current.getBoundingClientRect().right - drawerRef.current.getBoundingClientRect().left;
        }
      } else if (isInline && (position === "start" || position === "left")) {
        if (isRTL) {
          splitterPos = splitterRef.current.getBoundingClientRect().left - panel.current.getBoundingClientRect().right;
          drawerSize = drawerRef.current.getBoundingClientRect().left - drawerRef.current.getBoundingClientRect().right;
        } else {
          splitterPos = splitterRef.current.getBoundingClientRect().right - panel.current.getBoundingClientRect().left;
          drawerSize = drawerRef.current.getBoundingClientRect().right - drawerRef.current.getBoundingClientRect().left;
        }
      } else if (position === "end" || position === "right") {
        if (isRTL) {
          splitterPos = drawerContentRef.current.getBoundingClientRect().left - splitterRef.current.getBoundingClientRect().right;
          drawerSize = drawerContentRef.current.getBoundingClientRect().left - drawerContentRef.current.getBoundingClientRect().right;
        } else {
          splitterPos = drawerContentRef.current.getBoundingClientRect().right - splitterRef.current.getBoundingClientRect().left;
          drawerSize = drawerContentRef.current.getBoundingClientRect().right - drawerContentRef.current.getBoundingClientRect().left;
        }
      } else if (position === "start" || position === "left") {
        if (isRTL) {
          splitterPos = splitterRef.current.getBoundingClientRect().left - drawerContentRef.current.getBoundingClientRect().right;
          drawerSize = drawerContentRef.current.getBoundingClientRect().left - drawerContentRef.current.getBoundingClientRect().right;
        } else {
          splitterPos = splitterRef.current.getBoundingClientRect().right - drawerContentRef.current.getBoundingClientRect().left;
          drawerSize = drawerContentRef.current.getBoundingClientRect().right - drawerContentRef.current.getBoundingClientRect().left;
        }
      } else if (position === "bottom") {
        splitterPos = drawerContentRef.current.getBoundingClientRect().bottom - splitterRef.current.getBoundingClientRect().top;
        drawerSize = drawerContentRef.current.getBoundingClientRect().bottom - drawerContentRef.current.getBoundingClientRect().top;
      }
      const newSplitterPos = splitterPos / drawerSize * 100;
      return Math.round((newSplitterPos + Number.EPSILON) * 100) / 100;
    };
    const handleTouchStart = (e) => {
      e.stopPropagation();
      document.addEventListener("touchmove", callbackTouchMove, { passive: false });
      document.addEventListener("touchend", callbackTouchEnd);
      isResizing = true;
    };
    const handleMousedown = (e) => {
      e.stopPropagation();
      e.preventDefault();
      document.addEventListener("mousemove", callbackMouseMove);
      document.addEventListener("mouseup", callbackMouseUp);
      drawerRef.current.classList.add(css(drawer_default.modifiers.resizing));
      isResizing = true;
      setInitialVals = true;
    };
    const handleMouseMove = (e) => {
      const mousePos = position === "bottom" ? e.clientY : e.clientX;
      handleControlMove(e, mousePos);
    };
    const handleTouchMove = (e) => {
      e.preventDefault();
      e.stopImmediatePropagation();
      const touchPos = position === "bottom" ? e.touches[0].clientY : e.touches[0].clientX;
      handleControlMove(e, touchPos);
    };
    const handleControlMove = (e, controlPosition) => {
      const isRTL = getLanguageDirection(panel.current) === "rtl";
      e.stopPropagation();
      if (!isResizing) {
        return;
      }
      if (setInitialVals) {
        panelRect = panel.current.getBoundingClientRect();
        if (isRTL) {
          start2 = panelRect.right;
          end2 = panelRect.left;
        } else {
          end2 = panelRect.right;
          start2 = panelRect.left;
        }
        bottom2 = panelRect.bottom;
        setInitialVals = false;
      }
      const mousePos = controlPosition;
      let newSize2 = 0;
      if (position === "end" || position === "right") {
        newSize2 = isRTL ? mousePos - end2 : end2 - mousePos;
      } else if (position === "start" || position === "left") {
        newSize2 = isRTL ? start2 - mousePos : mousePos - start2;
      } else {
        newSize2 = bottom2 - mousePos;
      }
      if (position === "bottom") {
        panel.current.style.overflowAnchor = "none";
      }
      panel.current.style.setProperty(c_drawer_panel_md_FlexBasis_default.name, newSize2 + "px");
      currWidth = newSize2;
      setSeparatorValue(calcValueNow());
    };
    const handleMouseup = (e) => {
      if (!isResizing) {
        return;
      }
      drawerRef.current.classList.remove(css(drawer_default.modifiers.resizing));
      isResizing = false;
      onResize && onResize(e, currWidth, id);
      setInitialVals = true;
      document.removeEventListener("mousemove", callbackMouseMove);
      document.removeEventListener("mouseup", callbackMouseUp);
    };
    const handleTouchEnd = (e) => {
      e.stopPropagation();
      if (!isResizing) {
        return;
      }
      isResizing = false;
      onResize && onResize(e, currWidth, id);
      document.removeEventListener("touchmove", callbackTouchMove);
      document.removeEventListener("touchend", callbackTouchEnd);
    };
    const callbackMouseMove = React102.useCallback(handleMouseMove, []);
    const callbackTouchEnd = React102.useCallback(handleTouchEnd, []);
    const callbackTouchMove = React102.useCallback(handleTouchMove, []);
    const callbackMouseUp = React102.useCallback(handleMouseup, []);
    const handleKeys = (e) => {
      const isRTL = getLanguageDirection(panel.current) === "rtl";
      const key = e.key;
      if (key !== "Escape" && key !== "Enter" && key !== "ArrowUp" && key !== "ArrowDown" && key !== "ArrowLeft" && key !== "ArrowRight") {
        if (isResizing) {
          e.preventDefault();
        }
        return;
      }
      e.preventDefault();
      if (key === "Escape" || key === "Enter") {
        onResize && onResize(e, currWidth, id);
      }
      const panelRect2 = panel.current.getBoundingClientRect();
      newSize = position === "bottom" ? panelRect2.height : panelRect2.width;
      let delta = 0;
      if (key === "ArrowRight") {
        if (isRTL) {
          delta = position === "left" || position === "start" ? -increment : increment;
        } else {
          delta = position === "left" || position === "start" ? increment : -increment;
        }
      } else if (key === "ArrowLeft") {
        if (isRTL) {
          delta = position === "left" || position === "start" ? increment : -increment;
        } else {
          delta = position === "left" || position === "start" ? -increment : increment;
        }
      } else if (key === "ArrowUp") {
        delta = increment;
      } else if (key === "ArrowDown") {
        delta = -increment;
      }
      newSize = newSize + delta;
      if (position === "bottom") {
        panel.current.style.overflowAnchor = "none";
      }
      panel.current.style.setProperty(c_drawer_panel_md_FlexBasis_default.name, newSize + "px");
      currWidth = newSize;
      setSeparatorValue(calcValueNow());
    };
    const boundaryCssVars = {};
    if (defaultSize) {
      boundaryCssVars[c_drawer_panel_md_FlexBasis_default.name] = defaultSize;
    }
    if (minSize) {
      boundaryCssVars[c_drawer_panel_md_FlexBasis_min_default.name] = minSize;
    }
    if (maxSize) {
      boundaryCssVars[c_drawer_panel_md_FlexBasis_max_default.name] = maxSize;
    }
    const isValidFocusTrap = (focusTrap === null || focusTrap === void 0 ? void 0 : focusTrap.enabled) && !isStatic;
    const Component40 = isValidFocusTrap ? FocusTrap : "div";
    return React102.createElement(GenerateId, { prefix: "pf-drawer-panel-" }, (panelId) => {
      const focusTrapProps = {
        tabIndex: -1,
        "aria-modal": true,
        role: "dialog",
        active: isFocusTrapActive,
        "aria-labelledby": (focusTrap === null || focusTrap === void 0 ? void 0 : focusTrap["aria-labelledby"]) || id || panelId,
        focusTrapOptions: {
          fallbackFocus: () => panel.current,
          onActivate: () => {
            if (previouslyFocusedElement.current !== document.activeElement) {
              previouslyFocusedElement.current = document.activeElement;
            }
          },
          onDeactivate: () => {
            previouslyFocusedElement.current && previouslyFocusedElement.current.focus && previouslyFocusedElement.current.focus();
          },
          clickOutsideDeactivates: true,
          returnFocusOnDeactivate: false,
          // FocusTrap's initialFocus can accept false as a value to prevent initial focus.
          // We want to prevent this in case false is ever passed in.
          initialFocus: (focusTrap === null || focusTrap === void 0 ? void 0 : focusTrap.elementToFocusOnExpand) || void 0,
          escapeDeactivates: false
        }
      };
      return React102.createElement(Component40, Object.assign({}, isValidFocusTrap && focusTrapProps, { id: id || panelId, className: css(drawer_default.drawerPanel, isResizable && drawer_default.modifiers.resizable, hasNoBorder && drawer_default.modifiers.noBorder, formatBreakpointMods(widths, drawer_default), colorVariant === DrawerColorVariant.light200 && drawer_default.modifiers.light_200, colorVariant === DrawerColorVariant.noBackground && drawer_default.modifiers.noBackground, className), onTransitionEnd: (ev) => {
        if (ev.target === panel.current) {
          if (!hidden && ev.nativeEvent.propertyName === "transform") {
            onExpand(ev);
          }
          setIsExpandedInternal(!hidden);
          if (isValidFocusTrap && ev.nativeEvent.propertyName === "transform") {
            setIsFocusTrapActive((prevIsFocusTrapActive) => !prevIsFocusTrapActive);
          }
        }
      }, hidden }, (defaultSize || minSize || maxSize) && {
        style: boundaryCssVars
      }, props, { ref: panel }), isExpandedInternal && React102.createElement(
        React102.Fragment,
        null,
        isResizable && React102.createElement(
          React102.Fragment,
          null,
          React102.createElement(
            "div",
            { className: css(drawer_default.drawerSplitter, position !== "bottom" && drawer_default.modifiers.vertical), role: "separator", tabIndex: 0, "aria-orientation": position === "bottom" ? "horizontal" : "vertical", "aria-label": resizeAriaLabel, "aria-valuenow": separatorValue, "aria-valuemin": 0, "aria-valuemax": 100, "aria-controls": id || panelId, onMouseDown: handleMousedown, onKeyDown: handleKeys, onTouchStart: handleTouchStart, ref: splitterRef },
            React102.createElement("div", { className: css(drawer_default.drawerSplitterHandle), "aria-hidden": true })
          ),
          React102.createElement("div", { className: css(drawer_default.drawerPanelMain) }, children)
        ),
        !isResizable && children
      ));
    });
  };
  DrawerPanelContent.displayName = "DrawerPanelContent";

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/Dropdown.js
  init_tslib_es6();
  var import_react10 = __toESM(require_react());
  var DropdownBase = (_a) => {
    var { children, className, onSelect, isOpen, toggle, shouldFocusToggleOnSelect = false, onOpenChange, isPlain, isScrollable, innerRef, ouiaId, ouiaSafe = true, zIndex = 9999, popperProps, onOpenChangeKeys = ["Escape", "Tab"], menuHeight, maxMenuHeight, shouldFocusFirstItemOnOpen = true } = _a, props = __rest(_a, ["children", "className", "onSelect", "isOpen", "toggle", "shouldFocusToggleOnSelect", "onOpenChange", "isPlain", "isScrollable", "innerRef", "ouiaId", "ouiaSafe", "zIndex", "popperProps", "onOpenChangeKeys", "menuHeight", "maxMenuHeight", "shouldFocusFirstItemOnOpen"]);
    const localMenuRef = import_react10.default.useRef();
    const localToggleRef = import_react10.default.useRef();
    const ouiaProps = useOUIAProps(Dropdown.displayName, ouiaId, ouiaSafe);
    const menuRef = innerRef || localMenuRef;
    const toggleRef = typeof toggle === "function" || typeof toggle !== "function" && !toggle.toggleRef ? localToggleRef : toggle === null || toggle === void 0 ? void 0 : toggle.toggleRef;
    import_react10.default.useEffect(() => {
      const handleMenuKeys = (event) => {
        var _a2, _b, _c;
        if (isOpen && onOpenChange && (((_a2 = menuRef.current) === null || _a2 === void 0 ? void 0 : _a2.contains(event.target)) || ((_b = toggleRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target)))) {
          if (onOpenChangeKeys.includes(event.key)) {
            onOpenChange(false);
            (_c = toggleRef.current) === null || _c === void 0 ? void 0 : _c.focus();
          }
        }
      };
      const handleClick = (event) => {
        var _a2, _b, _c;
        if (isOpen && shouldFocusFirstItemOnOpen && ((_a2 = toggleRef.current) === null || _a2 === void 0 ? void 0 : _a2.contains(event.target))) {
          setTimeout(() => {
            var _a3;
            const firstElement = (_a3 = menuRef === null || menuRef === void 0 ? void 0 : menuRef.current) === null || _a3 === void 0 ? void 0 : _a3.querySelector('li button:not(:disabled),li input:not(:disabled),li a:not([aria-disabled="true"])');
            firstElement && firstElement.focus();
          }, 10);
        }
        if (isOpen && onOpenChange && !((_b = toggleRef === null || toggleRef === void 0 ? void 0 : toggleRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target))) {
          if (isOpen && !((_c = menuRef.current) === null || _c === void 0 ? void 0 : _c.contains(event.target))) {
            onOpenChange(false);
          }
        }
      };
      window.addEventListener("keydown", handleMenuKeys);
      window.addEventListener("click", handleClick);
      return () => {
        window.removeEventListener("keydown", handleMenuKeys);
        window.removeEventListener("click", handleClick);
      };
    }, [isOpen, menuRef, toggleRef, onOpenChange, onOpenChangeKeys]);
    const scrollable = maxMenuHeight !== void 0 || menuHeight !== void 0 || isScrollable;
    const menu = import_react10.default.createElement(
      Menu,
      Object.assign({ className: css(className), ref: menuRef, onSelect: (event, value) => {
        onSelect && onSelect(event, value);
        shouldFocusToggleOnSelect && toggleRef.current.focus();
      }, isPlain, isScrollable: scrollable }, props, ouiaProps),
      import_react10.default.createElement(MenuContent, { menuHeight, maxMenuHeight }, children)
    );
    return import_react10.default.createElement(Popper, Object.assign({ trigger: typeof toggle === "function" ? toggle(toggleRef) : toggle.toggleNode, triggerRef: toggleRef, popper: menu, popperRef: menuRef, isVisible: isOpen, zIndex }, popperProps));
  };
  var Dropdown = import_react10.default.forwardRef((props, ref) => import_react10.default.createElement(DropdownBase, Object.assign({ innerRef: ref }, props)));
  Dropdown.displayName = "Dropdown";

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/DropdownItem.js
  init_tslib_es6();
  var import_react11 = __toESM(require_react());
  var DropdownItemBase = (_a) => {
    var { children, className, description, isDisabled, isAriaDisabled, value, onClick, ouiaId, ouiaSafe, innerRef, tooltipProps } = _a, props = __rest(_a, ["children", "className", "description", "isDisabled", "isAriaDisabled", "value", "onClick", "ouiaId", "ouiaSafe", "innerRef", "tooltipProps"]);
    const ouiaProps = useOUIAProps(DropdownItem.displayName, ouiaId, ouiaSafe);
    return import_react11.default.createElement(MenuItem, Object.assign({ className: css(className), description, isDisabled, isAriaDisabled, itemId: value, onClick, tooltipProps, ref: innerRef }, ouiaProps, props), children);
  };
  var DropdownItem = import_react11.default.forwardRef((props, ref) => import_react11.default.createElement(DropdownItemBase, Object.assign({}, props, { innerRef: ref })));
  DropdownItem.displayName = "DropdownItem";

  // node_modules/@patternfly/react-core/dist/esm/components/Dropdown/DropdownList.js
  init_tslib_es6();
  var import_react12 = __toESM(require_react());
  var DropdownList = (_a) => {
    var { children, className } = _a, props = __rest(_a, ["children", "className"]);
    return import_react12.default.createElement(MenuList, Object.assign({ className: css(className) }, props), children);
  };
  DropdownList.displayName = "DropdownList";

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelector.js
  init_tslib_es6();
  var React129 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/DualListSelector/dual-list-selector.mjs
  var dual_list_selector_default = {
    "badge": "pf-v5-c-badge",
    "button": "pf-v5-c-button",
    "dirRtl": "pf-v5-m-dir-rtl",
    "dualListSelector": "pf-v5-c-dual-list-selector",
    "dualListSelectorControls": "pf-v5-c-dual-list-selector__controls",
    "dualListSelectorControlsItem": "pf-v5-c-dual-list-selector__controls-item",
    "dualListSelectorDraggable": "pf-v5-c-dual-list-selector__draggable",
    "dualListSelectorHeader": "pf-v5-c-dual-list-selector__header",
    "dualListSelectorItem": "pf-v5-c-dual-list-selector__item",
    "dualListSelectorItemCheck": "pf-v5-c-dual-list-selector__item-check",
    "dualListSelectorItemCount": "pf-v5-c-dual-list-selector__item-count",
    "dualListSelectorItemMain": "pf-v5-c-dual-list-selector__item-main",
    "dualListSelectorItemText": "pf-v5-c-dual-list-selector__item-text",
    "dualListSelectorItemToggle": "pf-v5-c-dual-list-selector__item-toggle",
    "dualListSelectorItemToggleIcon": "pf-v5-c-dual-list-selector__item-toggle-icon",
    "dualListSelectorList": "pf-v5-c-dual-list-selector__list",
    "dualListSelectorListItem": "pf-v5-c-dual-list-selector__list-item",
    "dualListSelectorListItemRow": "pf-v5-c-dual-list-selector__list-item-row",
    "dualListSelectorMain": "pf-v5-c-dual-list-selector__main",
    "dualListSelectorMenu": "pf-v5-c-dual-list-selector__menu",
    "dualListSelectorPane": "pf-v5-c-dual-list-selector__pane",
    "dualListSelectorStatus": "pf-v5-c-dual-list-selector__status",
    "dualListSelectorStatusText": "pf-v5-c-dual-list-selector__status-text",
    "dualListSelectorTitleText": "pf-v5-c-dual-list-selector__title-text",
    "dualListSelectorTools": "pf-v5-c-dual-list-selector__tools",
    "dualListSelectorToolsActions": "pf-v5-c-dual-list-selector__tools-actions",
    "dualListSelectorToolsFilter": "pf-v5-c-dual-list-selector__tools-filter",
    "modifiers": {
      "chosen": "pf-m-chosen",
      "dragOver": "pf-m-drag-over",
      "expandable": "pf-m-expandable",
      "expanded": "pf-m-expanded",
      "disabled": "pf-m-disabled",
      "selected": "pf-m-selected",
      "check": "pf-m-check",
      "ghostRow": "pf-m-ghost-row",
      "read": "pf-m-read"
    },
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-icons/dist/esm/icons/angle-double-left-icon.js
  var AngleDoubleLeftIconConfig = {
    name: "AngleDoubleLeftIcon",
    height: 512,
    width: 448,
    svgPath: "M223.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L319.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L393.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34zm-192 34l136 136c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9L127.9 256l96.4-96.4c9.4-9.4 9.4-24.6 0-33.9L201.7 103c-9.4-9.4-24.6-9.4-33.9 0l-136 136c-9.5 9.4-9.5 24.6-.1 34z",
    yOffset: 0,
    xOffset: 0
  };
  var AngleDoubleLeftIcon = createIcon(AngleDoubleLeftIconConfig);
  var angle_double_left_icon_default = AngleDoubleLeftIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/angle-double-right-icon.js
  var AngleDoubleRightIconConfig = {
    name: "AngleDoubleRightIcon",
    height: 512,
    width: 448,
    svgPath: "M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z",
    yOffset: 0,
    xOffset: 0
  };
  var AngleDoubleRightIcon = createIcon(AngleDoubleRightIconConfig);
  var angle_double_right_icon_default = AngleDoubleRightIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorPane.js
  init_tslib_es6();
  var React126 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorTree.js
  init_tslib_es6();
  var React108 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorTreeItem.js
  init_tslib_es6();
  var React107 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/treeUtils.js
  function flattenTree(tree) {
    let result = [];
    tree.forEach((item) => {
      if (item.children) {
        result = result.concat(flattenTree(item.children));
      } else {
        result.push(item.id);
      }
    });
    return result;
  }
  function flattenTreeWithFolders(tree) {
    let result = [];
    tree.forEach((item) => {
      result.push(item.id);
      if (item.children) {
        result = result.concat(flattenTreeWithFolders(item.children));
      }
    });
    return result;
  }
  function filterFolders(tree, inputList) {
    let result = [];
    tree.forEach((item) => {
      if (item.children) {
        result = result.concat(filterFolders(item.children, inputList));
      } else {
        if (inputList.includes(item.id)) {
          result.push(item.id);
        }
      }
    });
    return result;
  }
  function filterTreeItems(item, inputList) {
    if (inputList.includes(item.id)) {
      return true;
    }
    if (item.children) {
      return (item.children = item.children.map((opt) => Object.assign({}, opt)).filter((child) => filterTreeItems(child, inputList))).length > 0;
    }
  }
  function filterTreeItemsWithoutFolders(item, inputList) {
    if (item.children) {
      return (item.children = item.children.map((opt) => Object.assign({}, opt)).filter((child) => child.children ? filterTreeItemsWithoutFolders(child, inputList) : filterTreeItems(child, inputList))).length > 0;
    }
    if (inputList.includes(item.id)) {
      return true;
    }
  }
  function filterRestTreeItems(item, inputList) {
    if (item.children) {
      const child = (item.children = item.children.map((opt) => Object.assign({}, opt)).filter((child2) => filterRestTreeItems(child2, inputList))).length > 0;
      return child;
    }
    if (!inputList.includes(item.id)) {
      return true;
    }
  }

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorContext.js
  var React106 = __toESM(require_react());
  var DualListSelectorContext = React106.createContext({ isTree: false });
  var DualListSelectorListContext = React106.createContext({});
  var DualListSelectorPaneContext = React106.createContext({ isChosen: false });

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorTreeItem.js
  var DualListSelectorTreeItemBase = (_a) => {
    var {
      onOptionCheck,
      children,
      className,
      id,
      text,
      defaultExpanded,
      hasBadge,
      isChecked,
      checkProps,
      badgeProps,
      itemData,
      isDisabled = false,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      useMemo: useMemo7
    } = _a, props = __rest(_a, ["onOptionCheck", "children", "className", "id", "text", "defaultExpanded", "hasBadge", "isChecked", "checkProps", "badgeProps", "itemData", "isDisabled", "useMemo"]);
    const ref = React107.useRef(null);
    const [isExpanded, setIsExpanded] = React107.useState(defaultExpanded || false);
    const { setFocusedOption } = React107.useContext(DualListSelectorListContext);
    React107.useEffect(() => {
      setIsExpanded(defaultExpanded);
    }, [defaultExpanded]);
    return React107.createElement(
      "li",
      Object.assign({ className: css(dual_list_selector_default.dualListSelectorListItem, className, children && dual_list_selector_default.modifiers.expandable, isExpanded && dual_list_selector_default.modifiers.expanded, isDisabled && dual_list_selector_default.modifiers.disabled), id }, props, { "aria-selected": isChecked, role: "treeitem" }, isExpanded && { "aria-expanded": "true" }),
      React107.createElement(
        "div",
        { className: css(dual_list_selector_default.dualListSelectorListItemRow, isChecked && dual_list_selector_default.modifiers.selected, dual_list_selector_default.modifiers.check) },
        React107.createElement(
          "div",
          { className: css(dual_list_selector_default.dualListSelectorItem), ref, tabIndex: -1, onClick: isDisabled ? void 0 : (evt) => {
            onOptionCheck && onOptionCheck(evt, !isChecked, itemData);
            setFocusedOption(id);
          } },
          React107.createElement(
            "span",
            { className: css(dual_list_selector_default.dualListSelectorItemMain) },
            children && React107.createElement(
              "div",
              { className: css(dual_list_selector_default.dualListSelectorItemToggle), onClick: (e) => {
                if (children) {
                  setIsExpanded(!isExpanded);
                }
                e.stopPropagation();
              }, onKeyDown: (e) => {
                if (e.key === " " || e.key === "Enter") {
                  document.activeElement.click();
                  e.preventDefault();
                }
              }, tabIndex: -1 },
              React107.createElement(
                "span",
                { className: css(dual_list_selector_default.dualListSelectorItemToggleIcon) },
                React107.createElement(angle_right_icon_default, { "aria-hidden": true })
              )
            ),
            React107.createElement(
              "span",
              { className: css(dual_list_selector_default.dualListSelectorItemCheck) },
              React107.createElement("input", Object.assign({ type: "checkbox", onChange: (evt) => {
                onOptionCheck && onOptionCheck(evt, !isChecked, itemData);
                setFocusedOption(id);
              }, onClick: (evt) => evt.stopPropagation(), onKeyDown: (e) => {
                if (e.key === " " || e.key === "Enter") {
                  onOptionCheck && onOptionCheck(e, !isChecked, itemData);
                  setFocusedOption(id);
                  e.preventDefault();
                }
              }, ref: (elem) => elem && (elem.indeterminate = isChecked === null), checked: isChecked || false, tabIndex: -1 }, checkProps))
            ),
            React107.createElement("span", { className: css(dual_list_selector_default.dualListSelectorItemText) }, text),
            hasBadge && children && React107.createElement(
              "span",
              { className: css(dual_list_selector_default.dualListSelectorItemCount) },
              React107.createElement(Badge, Object.assign({}, badgeProps), flattenTree(children.props.data).length)
            )
          )
        )
      ),
      isExpanded && children
    );
  };
  var DualListSelectorTreeItem = React107.memo(DualListSelectorTreeItemBase, (prevProps, nextProps) => {
    if (!nextProps.useMemo) {
      return false;
    }
    if (prevProps.className !== nextProps.className || prevProps.text !== nextProps.text || prevProps.id !== nextProps.id || prevProps.defaultExpanded !== nextProps.defaultExpanded || prevProps.checkProps !== nextProps.checkProps || prevProps.hasBadge !== nextProps.hasBadge || prevProps.badgeProps !== nextProps.badgeProps || prevProps.isChecked !== nextProps.isChecked || prevProps.itemData !== nextProps.itemData) {
      return false;
    }
    return true;
  });
  DualListSelectorTreeItem.displayName = "DualListSelectorTreeItem";

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorTree.js
  var DualListSelectorTree = (_a) => {
    var { data, hasBadges = false, isNested = false, defaultAllExpanded = false, onOptionCheck, isDisabled = false } = _a, props = __rest(_a, ["data", "hasBadges", "isNested", "defaultAllExpanded", "onOptionCheck", "isDisabled"]);
    const dataToRender = typeof data === "function" ? data() : data;
    const tree = dataToRender.map((item) => React108.createElement(DualListSelectorTreeItem, Object.assign({ key: item.id, text: item.text, id: item.id, defaultExpanded: item.defaultExpanded !== void 0 ? item.defaultExpanded : defaultAllExpanded, onOptionCheck, isChecked: item.isChecked, checkProps: item.checkProps, hasBadge: item.hasBadge !== void 0 ? item.hasBadge : hasBadges, badgeProps: item.badgeProps, itemData: item, isDisabled, useMemo: true }, item.children && {
      children: React108.createElement(DualListSelectorTree, { isNested: true, data: item.children, hasBadges, defaultAllExpanded, onOptionCheck, isDisabled })
    })));
    return isNested ? React108.createElement("ul", Object.assign({ className: css(dual_list_selector_default.dualListSelectorList), role: "group" }, props), tree) : React108.createElement(React108.Fragment, null, tree);
  };
  DualListSelectorTree.displayName = "DualListSelectorTree";

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorListWrapper.js
  init_tslib_es6();
  var React111 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorList.js
  init_tslib_es6();

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorListItem.js
  init_tslib_es6();
  var React109 = __toESM(require_react());
  var DualListSelectorListItemBase = (_a) => {
    var {
      onOptionSelect,
      orderIndex,
      children,
      className,
      id = getUniqueId("dual-list-selector-list-item"),
      isSelected,
      innerRef,
      isDraggable = false,
      isDisabled,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      draggableButtonAriaLabel = "Reorder option"
    } = _a, props = __rest(_a, ["onOptionSelect", "orderIndex", "children", "className", "id", "isSelected", "innerRef", "isDraggable", "isDisabled", "draggableButtonAriaLabel"]);
    const privateRef = React109.useRef(null);
    const ref = innerRef || privateRef;
    const { setFocusedOption } = React109.useContext(DualListSelectorListContext);
    return React109.createElement(
      "li",
      Object.assign({ className: css(dual_list_selector_default.dualListSelectorListItem, className, isDisabled && dual_list_selector_default.modifiers.disabled), key: orderIndex, onClick: isDisabled ? void 0 : (e) => {
        setFocusedOption(id);
        onOptionSelect(e, id);
      }, onKeyDown: (e) => {
        if (e.key === " " || e.key === "Enter") {
          document.activeElement.click();
          e.preventDefault();
        }
      }, "aria-selected": isSelected, id, ref, role: "option", tabIndex: -1 }, props),
      React109.createElement(
        "div",
        { className: css(dual_list_selector_default.dualListSelectorListItemRow, isSelected && dual_list_selector_default.modifiers.selected) },
        isDraggable && !isDisabled && React109.createElement(
          "div",
          { className: css(dual_list_selector_default.dualListSelectorDraggable) },
          React109.createElement(
            Button,
            { variant: ButtonVariant.plain, component: "span" },
            React109.createElement(grip_vertical_icon_default, { style: { verticalAlign: "-0.3em" } })
          )
        ),
        React109.createElement(
          "span",
          { className: css(dual_list_selector_default.dualListSelectorItem) },
          React109.createElement(
            "span",
            { className: css(dual_list_selector_default.dualListSelectorItemMain) },
            React109.createElement("span", { className: css(dual_list_selector_default.dualListSelectorItemText) }, children)
          )
        )
      )
    );
  };
  DualListSelectorListItemBase.displayName = "DualListSelectorListItemBase";
  var DualListSelectorListItem = React109.forwardRef((props, ref) => React109.createElement(DualListSelectorListItemBase, Object.assign({ innerRef: ref }, props)));
  DualListSelectorListItem.displayName = "DualListSelectorListItem";

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorList.js
  var React110 = __toESM(require_react());
  var DualListSelectorListBase = (_a) => {
    var { children, innerRef } = _a, props = __rest(_a, ["children", "innerRef"]);
    const { setFocusedOption, isTree, ariaLabelledBy, focusedOption, displayOption, selectedOptions, id, onOptionSelect, options: options5, isDisabled } = React110.useContext(DualListSelectorListContext);
    const onOptionClick = (e, index, id2) => {
      setFocusedOption(id2);
      onOptionSelect(e, index, id2);
    };
    const hasOptions = () => options5.length !== 0 || children !== void 0 && children.length !== 0;
    return React110.createElement("ul", Object.assign({ className: css(dual_list_selector_default.dualListSelectorList) }, hasOptions() && {
      role: isTree ? "tree" : "listbox",
      "aria-multiselectable": true,
      "aria-labelledby": ariaLabelledBy,
      "aria-activedescendant": focusedOption
    }, { "aria-disabled": isDisabled ? "true" : void 0, ref: innerRef }, props), options5.length === 0 ? children : options5.map((option, index) => {
      if (displayOption(option)) {
        return React110.createElement(DualListSelectorListItem, { key: index, isSelected: selectedOptions.indexOf(index) !== -1, id: `${id}-option-${index}`, onOptionSelect: (e, id2) => onOptionClick(e, index, id2), orderIndex: index, isDisabled }, option);
      }
      return;
    }));
  };
  DualListSelectorListBase.displayName = "DualListSelectorListBase";
  var DualListSelectorList = React110.forwardRef((props, ref) => React110.createElement(DualListSelectorListBase, Object.assign({ innerRef: ref }, props)));
  DualListSelectorList.displayName = "DualListSelectorList";

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorListWrapper.js
  var DualListSelectorListWrapperBase = (_a) => {
    var { className, children, "aria-labelledby": ariaLabelledBy, innerRef, options: options5 = [], selectedOptions = [], onOptionSelect, displayOption, id = getUniqueId("dual-list-selector-list"), isDisabled = false } = _a, props = __rest(_a, ["className", "children", "aria-labelledby", "innerRef", "options", "selectedOptions", "onOptionSelect", "displayOption", "id", "isDisabled"]);
    const [focusedOption, setFocusedOption] = React111.useState("");
    const ref = React111.useRef(null);
    const menuRef = innerRef || ref;
    const { isTree } = React111.useContext(DualListSelectorContext);
    const handleKeys = (event) => {
      if (!menuRef.current || menuRef.current !== event.target.closest(`.${dual_list_selector_default.dualListSelectorMenu}`) && !Array.from(menuRef.current.getElementsByClassName(dual_list_selector_default.dualListSelectorMenu)).includes(event.target.closest(`.${dual_list_selector_default.dualListSelectorMenu}`))) {
        return;
      }
      event.stopImmediatePropagation();
      const validOptions = isTree ? Array.from(menuRef.current.querySelectorAll(`.${dual_list_selector_default.dualListSelectorItemToggle}, .${dual_list_selector_default.dualListSelectorItemCheck} > input`)) : Array.from(menuRef.current.getElementsByTagName("LI")).filter((el) => !el.classList.contains("pf-m-disabled"));
      const activeElement = document.activeElement;
      handleArrows(event, validOptions, (element) => activeElement.contains(element), (element) => {
        if (element.classList.contains(`.${dual_list_selector_default.dualListSelectorListItem}`)) {
          setFocusedOption(element.id);
        } else {
          setFocusedOption(element.closest(`.${dual_list_selector_default.dualListSelectorListItem}`).id);
        }
        return element;
      }, [`.${dual_list_selector_default.dualListSelectorItemToggle}`, `.${dual_list_selector_default.dualListSelectorItemCheck} > input`], void 0, false, false, false);
    };
    React111.useEffect(() => {
      window.addEventListener("keydown", handleKeys);
      return () => {
        window.removeEventListener("keydown", handleKeys);
      };
    }, [menuRef.current]);
    return React111.createElement(
      "div",
      Object.assign({ className: css(dual_list_selector_default.dualListSelectorMenu, className), ref: menuRef, tabIndex: 0 }, props),
      React111.createElement(DualListSelectorListContext.Provider, { value: {
        setFocusedOption,
        isTree,
        focusedOption,
        ariaLabelledBy,
        displayOption,
        selectedOptions,
        id,
        options: options5,
        onOptionSelect,
        isDisabled
      } }, children ? children : React111.createElement(DualListSelectorList, null))
    );
  };
  DualListSelectorListWrapperBase.displayName = "DualListSelectorListWrapperBase";
  var DualListSelectorListWrapper = React111.forwardRef((props, ref) => React111.createElement(DualListSelectorListWrapperBase, Object.assign({ innerRef: ref }, props)));
  DualListSelectorListWrapper.displayName = "DualListSelectorListWrapper";

  // node_modules/@patternfly/react-core/dist/esm/components/SearchInput/SearchInput.js
  init_tslib_es6();
  var React125 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Icon/Icon.js
  init_tslib_es6();
  var React112 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Icon/icon.mjs
  var icon_default = {
    "icon": "pf-v5-c-icon",
    "iconContent": "pf-v5-c-icon__content",
    "iconProgress": "pf-v5-c-icon__progress",
    "modifiers": {
      "inline": "pf-m-inline",
      "sm": "pf-m-sm",
      "md": "pf-m-md",
      "lg": "pf-m-lg",
      "xl": "pf-m-xl",
      "inProgress": "pf-m-in-progress",
      "danger": "pf-m-danger",
      "warning": "pf-m-warning",
      "success": "pf-m-success",
      "info": "pf-m-info",
      "custom": "pf-m-custom"
    },
    "spinner": "pf-v5-c-spinner"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Icon/Icon.js
  var Icon = (_a) => {
    var { children, className, progressIcon, size, iconSize, progressIconSize, status, isInline = false, isInProgress = false, defaultProgressArialabel = "Loading...", shouldMirrorRTL = false } = _a, props = __rest(_a, ["children", "className", "progressIcon", "size", "iconSize", "progressIconSize", "status", "isInline", "isInProgress", "defaultProgressArialabel", "shouldMirrorRTL"]);
    const _progressIcon = progressIcon !== null && progressIcon !== void 0 ? progressIcon : React112.createElement(Spinner, { diameter: "1em", "aria-label": defaultProgressArialabel });
    return React112.createElement(
      "span",
      Object.assign({ className: css(icon_default.icon, isInline && icon_default.modifiers.inline, isInProgress && icon_default.modifiers.inProgress, icon_default.modifiers[size], className) }, props),
      React112.createElement("span", { className: css(icon_default.iconContent, icon_default.modifiers[iconSize], icon_default.modifiers[status], shouldMirrorRTL && "pf-v5-m-mirror-inline-rtl") }, children),
      isInProgress && React112.createElement("span", { className: css(icon_default.iconProgress, icon_default.modifiers[progressIconSize], className) }, _progressIcon)
    );
  };
  Icon.displayName = "Icon";

  // node_modules/@patternfly/react-icons/dist/esm/icons/angle-down-icon.js
  var AngleDownIconConfig = {
    name: "AngleDownIcon",
    height: 512,
    width: 320,
    svgPath: "M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z",
    yOffset: 0,
    xOffset: 0
  };
  var AngleDownIcon = createIcon(AngleDownIconConfig);
  var angle_down_icon_default = AngleDownIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/search-icon.js
  var SearchIconConfig = {
    name: "SearchIcon",
    height: 512,
    width: 512,
    svgPath: "M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z",
    yOffset: 0,
    xOffset: 0
  };
  var SearchIcon = createIcon(SearchIconConfig);
  var search_icon_default = SearchIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/arrow-right-icon.js
  var ArrowRightIconConfig = {
    name: "ArrowRightIcon",
    height: 512,
    width: 448,
    svgPath: "M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z",
    yOffset: 0,
    xOffset: 0
  };
  var ArrowRightIcon = createIcon(ArrowRightIconConfig);
  var arrow_right_icon_default = ArrowRightIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/SearchInput/AdvancedSearchMenu.js
  var React121 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Form/ActionGroup.js
  init_tslib_es6();
  var React113 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Form/form.mjs
  var form_default = {
    "dirRtl": "pf-v5-m-dir-rtl",
    "form": "pf-v5-c-form",
    "formActions": "pf-v5-c-form__actions",
    "formFieldGroup": "pf-v5-c-form__field-group",
    "formFieldGroupBody": "pf-v5-c-form__field-group-body",
    "formFieldGroupHeader": "pf-v5-c-form__field-group-header",
    "formFieldGroupHeaderActions": "pf-v5-c-form__field-group-header-actions",
    "formFieldGroupHeaderDescription": "pf-v5-c-form__field-group-header-description",
    "formFieldGroupHeaderMain": "pf-v5-c-form__field-group-header-main",
    "formFieldGroupHeaderTitle": "pf-v5-c-form__field-group-header-title",
    "formFieldGroupHeaderTitleText": "pf-v5-c-form__field-group-header-title-text",
    "formFieldGroupToggle": "pf-v5-c-form__field-group-toggle",
    "formFieldGroupToggleButton": "pf-v5-c-form__field-group-toggle-button",
    "formFieldGroupToggleIcon": "pf-v5-c-form__field-group-toggle-icon",
    "formFieldset": "pf-v5-c-form__fieldset",
    "formGroup": "pf-v5-c-form__group",
    "formGroupControl": "pf-v5-c-form__group-control",
    "formGroupLabel": "pf-v5-c-form__group-label",
    "formGroupLabelHelp": "pf-v5-c-form__group-label-help",
    "formGroupLabelInfo": "pf-v5-c-form__group-label-info",
    "formGroupLabelMain": "pf-v5-c-form__group-label-main",
    "formHelperText": "pf-v5-c-form__helper-text",
    "formHelperTextIcon": "pf-v5-c-form__helper-text-icon",
    "formLabel": "pf-v5-c-form__label",
    "formLabelRequired": "pf-v5-c-form__label-required",
    "formLabelText": "pf-v5-c-form__label-text",
    "formSection": "pf-v5-c-form__section",
    "formSectionTitle": "pf-v5-c-form__section-title",
    "modifiers": {
      "horizontal": "pf-m-horizontal",
      "alignRight": "pf-m-align-right",
      "noPaddingTop": "pf-m-no-padding-top",
      "info": "pf-m-info",
      "horizontalOnXs": "pf-m-horizontal-on-xs",
      "horizontalOnSm": "pf-m-horizontal-on-sm",
      "horizontalOnMd": "pf-m-horizontal-on-md",
      "horizontalOnLg": "pf-m-horizontal-on-lg",
      "horizontalOnXl": "pf-m-horizontal-on-xl",
      "horizontalOn_2xl": "pf-m-horizontal-on-2xl",
      "limitWidth": "pf-m-limit-width",
      "action": "pf-m-action",
      "disabled": "pf-m-disabled",
      "inline": "pf-m-inline",
      "stack": "pf-m-stack",
      "error": "pf-m-error",
      "success": "pf-m-success",
      "warning": "pf-m-warning",
      "inactive": "pf-m-inactive",
      "hidden": "pf-m-hidden",
      "expanded": "pf-m-expanded"
    },
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Form/ActionGroup.js
  var ActionGroup = (_a) => {
    var { children = null, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    const customClassName = css(form_default.formGroup, form_default.modifiers.action, className);
    const formActionsComponent = React113.createElement("div", { className: css(form_default.formActions) }, children);
    return React113.createElement(
      "div",
      Object.assign({}, props, { className: customClassName }),
      React113.createElement("div", { className: css(form_default.formGroupControl) }, formActionsComponent)
    );
  };
  ActionGroup.displayName = "ActionGroup";

  // node_modules/@patternfly/react-core/dist/esm/components/Form/Form.js
  init_tslib_es6();
  var React114 = __toESM(require_react());

  // node_modules/@patternfly/react-tokens/dist/esm/c_form_m_limit_width_MaxWidth.js
  var c_form_m_limit_width_MaxWidth = {
    "name": "--pf-v5-c-form--m-limit-width--MaxWidth",
    "value": "55rem",
    "var": "var(--pf-v5-c-form--m-limit-width--MaxWidth)"
  };
  var c_form_m_limit_width_MaxWidth_default = c_form_m_limit_width_MaxWidth;

  // node_modules/@patternfly/react-core/dist/esm/components/Form/Form.js
  var FormBase = (_a) => {
    var { children = null, className = "", isHorizontal: isHorizontal2 = false, isWidthLimited = false, maxWidth = "", innerRef } = _a, props = __rest(_a, ["children", "className", "isHorizontal", "isWidthLimited", "maxWidth", "innerRef"]);
    return React114.createElement("form", Object.assign({ noValidate: true }, maxWidth && {
      style: Object.assign({ [c_form_m_limit_width_MaxWidth_default.name]: maxWidth }, props.style)
    }, props, { className: css(form_default.form, isHorizontal2 && form_default.modifiers.horizontal, (isWidthLimited || maxWidth) && form_default.modifiers.limitWidth, className), ref: innerRef }), children);
  };
  var Form = React114.forwardRef((props, ref) => React114.createElement(FormBase, Object.assign({ innerRef: ref }, props)));
  Form.displayName = "Form";

  // node_modules/@patternfly/react-core/dist/esm/components/Form/FormAlert.js
  init_tslib_es6();
  var React115 = __toESM(require_react());
  var FormAlert = (_a) => {
    var { children = null, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    return (
      // There are currently no associated styles with the pf-v5-c-form_alert class.
      // Therefore, it does not exist in react-styles
      React115.createElement("div", Object.assign({}, props, { className: css(`${form_default.form}__alert`, className) }), children)
    );
  };
  FormAlert.displayName = "FormAlert";

  // node_modules/@patternfly/react-core/dist/esm/components/Form/FormGroup.js
  init_tslib_es6();
  var React116 = __toESM(require_react());
  var FormGroup = (_a) => {
    var { children = null, className = "", label, labelInfo, labelIcon, isRequired = false, isInline = false, hasNoPaddingTop = false, isStack = false, fieldId, role } = _a, props = __rest(_a, ["children", "className", "label", "labelInfo", "labelIcon", "isRequired", "isInline", "hasNoPaddingTop", "isStack", "fieldId", "role"]);
    const isGroupOrRadioGroup = role === "group" || role === "radiogroup";
    const LabelComponent = isGroupOrRadioGroup ? "span" : "label";
    const labelContent = React116.createElement(
      React116.Fragment,
      null,
      React116.createElement(
        LabelComponent,
        Object.assign({ className: css(form_default.formLabel) }, !isGroupOrRadioGroup && { htmlFor: fieldId }),
        React116.createElement("span", { className: css(form_default.formLabelText) }, label),
        isRequired && React116.createElement(
          "span",
          { className: css(form_default.formLabelRequired), "aria-hidden": "true" },
          " ",
          ASTERISK
        )
      ),
      " ",
      React116.isValidElement(labelIcon) && labelIcon
    );
    return React116.createElement(GenerateId, null, (randomId) => React116.createElement(
      "div",
      Object.assign({ className: css(form_default.formGroup, className) }, role && { role }, isGroupOrRadioGroup && { "aria-labelledby": `${fieldId || randomId}-legend` }, props),
      label && React116.createElement(
        "div",
        Object.assign({ className: css(form_default.formGroupLabel, labelInfo && form_default.modifiers.info, hasNoPaddingTop && form_default.modifiers.noPaddingTop) }, isGroupOrRadioGroup && { id: `${fieldId || randomId}-legend` }),
        labelInfo && React116.createElement(
          React116.Fragment,
          null,
          React116.createElement("div", { className: css(form_default.formGroupLabelMain) }, labelContent),
          React116.createElement("div", { className: css(form_default.formGroupLabelInfo) }, labelInfo)
        ),
        !labelInfo && labelContent
      ),
      React116.createElement("div", { className: css(form_default.formGroupControl, isInline && form_default.modifiers.inline, isStack && form_default.modifiers.stack) }, children)
    ));
  };
  FormGroup.displayName = "FormGroup";

  // node_modules/@patternfly/react-core/dist/esm/components/Form/FormHelperText.js
  init_tslib_es6();
  var React117 = __toESM(require_react());
  var FormHelperText = (_a) => {
    var { children = null, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    return React117.createElement("div", Object.assign({ className: css(form_default.formHelperText, className) }, props), children);
  };
  FormHelperText.displayName = "FormHelperText";

  // node_modules/@patternfly/react-core/dist/esm/components/Panel/Panel.js
  init_tslib_es6();
  var React118 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Panel/panel.mjs
  var panel_default = {
    "modifiers": {
      "bordered": "pf-m-bordered",
      "raised": "pf-m-raised",
      "scrollable": "pf-m-scrollable"
    },
    "panel": "pf-v5-c-panel",
    "panelFooter": "pf-v5-c-panel__footer",
    "panelHeader": "pf-v5-c-panel__header",
    "panelMain": "pf-v5-c-panel__main",
    "panelMainBody": "pf-v5-c-panel__main-body",
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Panel/Panel.js
  var PanelBase = (_a) => {
    var { className, children, variant, isScrollable, innerRef } = _a, props = __rest(_a, ["className", "children", "variant", "isScrollable", "innerRef"]);
    return React118.createElement("div", Object.assign({ className: css(panel_default.panel, variant === "raised" && panel_default.modifiers.raised, variant === "bordered" && panel_default.modifiers.bordered, isScrollable && panel_default.modifiers.scrollable, className), ref: innerRef }, props), children);
  };
  var Panel = React118.forwardRef((props, ref) => React118.createElement(PanelBase, Object.assign({ innerRef: ref }, props)));
  Panel.displayName = "Panel";

  // node_modules/@patternfly/react-core/dist/esm/components/Panel/PanelMain.js
  init_tslib_es6();
  var React119 = __toESM(require_react());

  // node_modules/@patternfly/react-tokens/dist/esm/c_panel__main_MaxHeight.js
  var c_panel__main_MaxHeight = {
    "name": "--pf-v5-c-panel__main--MaxHeight",
    "value": "18.75rem",
    "var": "var(--pf-v5-c-panel__main--MaxHeight)"
  };
  var c_panel_main_MaxHeight_default = c_panel__main_MaxHeight;

  // node_modules/@patternfly/react-core/dist/esm/components/Panel/PanelMain.js
  var PanelMain = (_a) => {
    var { className, children, maxHeight } = _a, props = __rest(_a, ["className", "children", "maxHeight"]);
    return React119.createElement("div", Object.assign({ className: css(panel_default.panelMain, className), style: { [c_panel_main_MaxHeight_default.name]: maxHeight } }, props), children);
  };
  PanelMain.displayName = "PanelMain";

  // node_modules/@patternfly/react-core/dist/esm/components/Panel/PanelMainBody.js
  init_tslib_es6();
  var React120 = __toESM(require_react());
  var PanelMainBody = (_a) => {
    var { className, children } = _a, props = __rest(_a, ["className", "children"]);
    return React120.createElement("div", Object.assign({ className: css(panel_default.panelMainBody, className) }, props), children);
  };
  PanelMainBody.displayName = "PanelMainBody";

  // node_modules/@patternfly/react-core/dist/esm/components/SearchInput/AdvancedSearchMenu.js
  var AdvancedSearchMenu = ({ className, parentRef, parentInputRef, value = "", attributes = [], formAdditionalItems, hasWordsAttrLabel = "Has words", advancedSearchDelimiter, getAttrValueMap, onChange, onSearch, onClear, resetButtonLabel = "Reset", submitSearchButtonLabel = "Search", isSearchMenuOpen, onToggleAdvancedMenu }) => {
    const firstAttrRef = React121.useRef(null);
    const [putFocusBackOnInput, setPutFocusBackOnInput] = React121.useState(false);
    React121.useEffect(() => {
      if (attributes.length > 0 && !advancedSearchDelimiter) {
        console.error("AdvancedSearchMenu: An advancedSearchDelimiter prop is required when advanced search attributes are provided using the attributes prop");
      }
    });
    React121.useEffect(() => {
      if (isSearchMenuOpen && firstAttrRef && firstAttrRef.current) {
        firstAttrRef.current.focus();
        setPutFocusBackOnInput(true);
      } else if (!isSearchMenuOpen && putFocusBackOnInput && parentInputRef && parentInputRef.current) {
        parentInputRef.current.focus();
      }
    }, [isSearchMenuOpen]);
    React121.useEffect(() => {
      document.addEventListener("mousedown", onDocClick);
      document.addEventListener("touchstart", onDocClick);
      document.addEventListener("keydown", onEscPress);
      return function cleanup() {
        document.removeEventListener("mousedown", onDocClick);
        document.removeEventListener("touchstart", onDocClick);
        document.removeEventListener("keydown", onEscPress);
      };
    });
    const onDocClick = (event) => {
      const clickedWithinSearchInput = parentRef && parentRef.current.contains(event.target);
      if (isSearchMenuOpen && !clickedWithinSearchInput) {
        onToggleAdvancedMenu(event);
      }
    };
    const onEscPress = (event) => {
      if (isSearchMenuOpen && event.key === KeyTypes.Escape && parentRef && parentRef.current.contains(event.target)) {
        onToggleAdvancedMenu(event);
        if (parentInputRef) {
          parentInputRef.current.focus();
        }
      }
    };
    const onSearchHandler = (event) => {
      event.preventDefault();
      if (onSearch) {
        onSearch(event, value, getAttrValueMap());
      }
      if (isSearchMenuOpen) {
        onToggleAdvancedMenu(event);
      }
    };
    const handleValueChange = (attribute, newValue, event) => {
      const newMap = getAttrValueMap();
      newMap[attribute] = newValue;
      let updatedValue = "";
      Object.entries(newMap).forEach(([k2, v]) => {
        if (v.trim() !== "") {
          const quoteWrappedValue = v.includes(" ") ? `'${v.replace(/(^'|'$)/g, "")}'` : v;
          if (k2 !== "haswords") {
            updatedValue = `${updatedValue} ${k2}${advancedSearchDelimiter}${quoteWrappedValue}`;
          } else {
            updatedValue = `${updatedValue} ${quoteWrappedValue}`;
          }
        }
      });
      if (onChange) {
        onChange(event, updatedValue.replace(/^\s+/g, ""));
      }
    };
    const getValue = (attribute) => {
      const map2 = getAttrValueMap();
      return map2.hasOwnProperty(attribute) ? map2[attribute] : "";
    };
    const buildFormGroups = () => {
      const formGroups = [];
      attributes.forEach((attribute, index) => {
        const display = typeof attribute === "string" ? attribute : attribute.display;
        const queryAttr = typeof attribute === "string" ? attribute : attribute.attr;
        if (index === 0) {
          formGroups.push(React121.createElement(
            FormGroup,
            { label: display, fieldId: `${queryAttr}_${index}`, key: `${attribute}_${index}` },
            React121.createElement(TextInput, { ref: firstAttrRef, type: "text", id: `${queryAttr}_${index}`, value: getValue(queryAttr), onChange: (evt, value2) => handleValueChange(queryAttr, value2, evt) })
          ));
        } else {
          formGroups.push(React121.createElement(
            FormGroup,
            { label: display, fieldId: `${queryAttr}_${index}`, key: `${attribute}_${index}` },
            React121.createElement(TextInput, { type: "text", id: `${queryAttr}_${index}`, value: getValue(queryAttr), onChange: (evt, value2) => handleValueChange(queryAttr, value2, evt) })
          ));
        }
      });
      formGroups.push(React121.createElement(GenerateId, { key: "hasWords" }, (randomId) => React121.createElement(
        FormGroup,
        { label: hasWordsAttrLabel, fieldId: randomId },
        React121.createElement(TextInput, { type: "text", id: randomId, value: getValue("haswords"), onChange: (evt, value2) => handleValueChange("haswords", value2, evt) })
      )));
      return formGroups;
    };
    return isSearchMenuOpen ? React121.createElement(
      Panel,
      { variant: "raised", className: css(className) },
      React121.createElement(
        PanelMain,
        null,
        React121.createElement(
          PanelMainBody,
          null,
          React121.createElement(
            Form,
            null,
            buildFormGroups(),
            formAdditionalItems ? formAdditionalItems : null,
            React121.createElement(
              ActionGroup,
              null,
              React121.createElement(Button, { variant: "primary", type: "submit", onClick: onSearchHandler, isDisabled: !value }, submitSearchButtonLabel),
              !!onClear && React121.createElement(Button, { variant: "link", type: "reset", onClick: onClear }, resetButtonLabel)
            )
          )
        )
      )
    ) : null;
  };
  AdvancedSearchMenu.displayName = "SearchInput";

  // node_modules/@patternfly/react-core/dist/esm/components/TextInputGroup/TextInputGroup.js
  init_tslib_es6();
  var React122 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/TextInputGroup/text-input-group.mjs
  var text_input_group_default = {
    "button": "pf-v5-c-button",
    "chipGroupMain": "pf-v5-c-chip-group__main",
    "modifiers": {
      "disabled": "pf-m-disabled",
      "plain": "pf-m-plain",
      "icon": "pf-m-icon",
      "hint": "pf-m-hint"
    },
    "textInputGroup": "pf-v5-c-text-input-group",
    "textInputGroupGroup": "pf-v5-c-text-input-group__group",
    "textInputGroupIcon": "pf-v5-c-text-input-group__icon",
    "textInputGroupMain": "pf-v5-c-text-input-group__main",
    "textInputGroupText": "pf-v5-c-text-input-group__text",
    "textInputGroupTextInput": "pf-v5-c-text-input-group__text-input",
    "textInputGroupUtilities": "pf-v5-c-text-input-group__utilities",
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/TextInputGroup/TextInputGroup.js
  var TextInputGroupContext = React122.createContext({
    isDisabled: false
  });
  var TextInputGroup = (_a) => {
    var { children, className, isDisabled, isPlain, innerRef } = _a, props = __rest(_a, ["children", "className", "isDisabled", "isPlain", "innerRef"]);
    const ref = React122.useRef(null);
    const textInputGroupRef = innerRef || ref;
    return React122.createElement(
      TextInputGroupContext.Provider,
      { value: { isDisabled } },
      React122.createElement("div", Object.assign({ ref: textInputGroupRef, className: css(text_input_group_default.textInputGroup, isDisabled && text_input_group_default.modifiers.disabled, isPlain && text_input_group_default.modifiers.plain, className) }, props), children)
    );
  };
  TextInputGroup.displayName = "TextInputGroup";

  // node_modules/@patternfly/react-core/dist/esm/components/TextInputGroup/TextInputGroupMain.js
  init_tslib_es6();
  var React123 = __toESM(require_react());
  var TextInputGroupMainBase = (_a) => {
    var { children, className, icon, type = "text", hint, onChange = () => void 0, onFocus, onBlur, "aria-label": ariaLabel = "Type to filter", value: inputValue, placeholder: inputPlaceHolder, innerRef, name: name2, "aria-activedescendant": ariaActivedescendant, role, isExpanded, "aria-controls": ariaControls, inputId } = _a, props = __rest(_a, ["children", "className", "icon", "type", "hint", "onChange", "onFocus", "onBlur", "aria-label", "value", "placeholder", "innerRef", "name", "aria-activedescendant", "role", "isExpanded", "aria-controls", "inputId"]);
    const { isDisabled } = React123.useContext(TextInputGroupContext);
    const ref = React123.useRef(null);
    const textInputGroupInputInputRef = innerRef || ref;
    const handleChange = (event) => {
      onChange(event, event.currentTarget.value);
    };
    return React123.createElement(
      "div",
      Object.assign({ className: css(text_input_group_default.textInputGroupMain, icon && text_input_group_default.modifiers.icon, className) }, props),
      children,
      React123.createElement(
        "span",
        { className: css(text_input_group_default.textInputGroupText) },
        hint && React123.createElement("input", { className: css(text_input_group_default.textInputGroupTextInput, text_input_group_default.modifiers.hint), type: "text", disabled: true, "aria-hidden": "true", value: hint, id: inputId }),
        icon && React123.createElement("span", { className: css(text_input_group_default.textInputGroupIcon) }, icon),
        React123.createElement("input", Object.assign({ ref: textInputGroupInputInputRef, type, className: css(text_input_group_default.textInputGroupTextInput), "aria-label": ariaLabel, disabled: isDisabled, onChange: handleChange, onFocus, onBlur, value: inputValue || "", placeholder: inputPlaceHolder, name: name2, "aria-activedescendant": ariaActivedescendant, id: inputId }, role && { role }, isExpanded !== void 0 && { "aria-expanded": isExpanded }, ariaControls && { "aria-controls": ariaControls }))
      )
    );
  };
  var TextInputGroupMain = React123.forwardRef((props, ref) => React123.createElement(TextInputGroupMainBase, Object.assign({ innerRef: ref }, props)));
  TextInputGroupMain.displayName = "TextInputGroupMain";

  // node_modules/@patternfly/react-core/dist/esm/components/TextInputGroup/TextInputGroupUtilities.js
  init_tslib_es6();
  var React124 = __toESM(require_react());
  var TextInputGroupUtilities = (_a) => {
    var { children, className } = _a, props = __rest(_a, ["children", "className"]);
    return React124.createElement("div", Object.assign({ className: css(text_input_group_default.textInputGroupUtilities, className) }, props), children);
  };
  TextInputGroupUtilities.displayName = "TextInputGroupUtilities";

  // node_modules/@patternfly/react-core/dist/esm/components/SearchInput/SearchInput.js
  var SearchInputBase = (_a) => {
    var { className, searchInputId, value = "", attributes = [], formAdditionalItems, hasWordsAttrLabel = "Has words", advancedSearchDelimiter, placeholder, hint, onChange, onSearch, onClear, onToggleAdvancedSearch, isAdvancedSearchOpen, resultsCount, onNextClick, onPreviousClick, innerRef, expandableInput, "aria-label": ariaLabel = "Search input", resetButtonLabel = "Reset", openMenuButtonAriaLabel = "Open advanced search", previousNavigationButtonAriaLabel = "Previous", isPreviousNavigationButtonDisabled = false, isNextNavigationButtonDisabled = false, nextNavigationButtonAriaLabel = "Next", submitSearchButtonLabel = "Search", isDisabled = false, appendTo, zIndex = 9999, name: name2, areUtilitiesDisplayed } = _a, props = __rest(_a, ["className", "searchInputId", "value", "attributes", "formAdditionalItems", "hasWordsAttrLabel", "advancedSearchDelimiter", "placeholder", "hint", "onChange", "onSearch", "onClear", "onToggleAdvancedSearch", "isAdvancedSearchOpen", "resultsCount", "onNextClick", "onPreviousClick", "innerRef", "expandableInput", "aria-label", "resetButtonLabel", "openMenuButtonAriaLabel", "previousNavigationButtonAriaLabel", "isPreviousNavigationButtonDisabled", "isNextNavigationButtonDisabled", "nextNavigationButtonAriaLabel", "submitSearchButtonLabel", "isDisabled", "appendTo", "zIndex", "name", "areUtilitiesDisplayed"]);
    const [isSearchMenuOpen, setIsSearchMenuOpen] = React125.useState(false);
    const [searchValue, setSearchValue] = React125.useState(value);
    const searchInputRef = React125.useRef(null);
    const ref = React125.useRef(null);
    const searchInputInputRef = innerRef || ref;
    const searchInputExpandableToggleRef = React125.useRef(null);
    const triggerRef = React125.useRef(null);
    const popperRef = React125.useRef(null);
    const [focusAfterExpandChange, setFocusAfterExpandChange] = React125.useState(false);
    const { isExpanded, onToggleExpand, toggleAriaLabel } = expandableInput || {};
    React125.useEffect(() => {
      var _a2, _b;
      if (!focusAfterExpandChange) {
        return;
      } else if (isExpanded) {
        (_a2 = searchInputInputRef === null || searchInputInputRef === void 0 ? void 0 : searchInputInputRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus();
      } else {
        (_b = searchInputExpandableToggleRef === null || searchInputExpandableToggleRef === void 0 ? void 0 : searchInputExpandableToggleRef.current) === null || _b === void 0 ? void 0 : _b.focus();
      }
      setFocusAfterExpandChange(false);
    }, [focusAfterExpandChange, isExpanded, searchInputInputRef, searchInputExpandableToggleRef]);
    React125.useEffect(() => {
      setSearchValue(value);
    }, [value]);
    React125.useEffect(() => {
      if (attributes.length > 0 && !advancedSearchDelimiter) {
        console.error("An advancedSearchDelimiter prop is required when advanced search attributes are provided using the attributes prop");
      }
    });
    React125.useEffect(() => {
      setIsSearchMenuOpen(isAdvancedSearchOpen);
    }, [isAdvancedSearchOpen]);
    const onChangeHandler = (event, value2) => {
      if (onChange) {
        onChange(event, value2);
      }
      setSearchValue(value2);
    };
    const onToggle = (e) => {
      const isOpen = !isSearchMenuOpen;
      setIsSearchMenuOpen(isOpen);
      if (onToggleAdvancedSearch) {
        onToggleAdvancedSearch(e, isOpen);
      }
    };
    const onSearchHandler = (event) => {
      event.preventDefault();
      if (onSearch) {
        onSearch(event, value, getAttrValueMap());
      }
      setIsSearchMenuOpen(false);
    };
    const splitStringExceptInQuotes = (str) => {
      let quoteType;
      return str.match(/\\?.|^$/g).reduce((p, c2) => {
        if (c2 === "'" || c2 === '"') {
          if (!quoteType) {
            quoteType = c2;
          }
          if (c2 === quoteType) {
            p.quote = !p.quote;
          }
        } else if (!p.quote && c2 === " ") {
          p.a.push("");
        } else {
          p.a[p.a.length - 1] += c2.replace(/\\(.)/, "$1");
        }
        return p;
      }, { a: [""] }).a;
    };
    const getAttrValueMap = () => {
      const attrValue = {};
      const pairs = splitStringExceptInQuotes(searchValue);
      pairs.map((pair) => {
        const splitPair = pair.split(advancedSearchDelimiter);
        if (splitPair.length === 2) {
          attrValue[splitPair[0]] = splitPair[1].replace(/(^'|'$)/g, "");
        } else if (splitPair.length === 1) {
          attrValue.haswords = attrValue.hasOwnProperty("haswords") ? `${attrValue.haswords} ${splitPair[0]}` : splitPair[0];
        }
      });
      return attrValue;
    };
    const onEnter = (event) => {
      if (event.key === "Enter") {
        onSearchHandler(event);
      }
    };
    const onClearInput = (e) => {
      if (onClear) {
        onClear(e);
      }
      if (searchInputInputRef && searchInputInputRef.current) {
        searchInputInputRef.current.focus();
      }
    };
    const onExpandHandler = (event) => {
      setSearchValue("");
      onToggleExpand(event, isExpanded);
      setFocusAfterExpandChange(true);
    };
    const renderUtilities = value && (resultsCount || !!onNextClick && !!onPreviousClick || !!onClear && !expandableInput);
    const buildTextInputGroup = (_a2 = {}) => {
      var searchInputProps2 = __rest(_a2, []);
      return React125.createElement(
        TextInputGroup,
        Object.assign({ isDisabled }, searchInputProps2),
        React125.createElement(TextInputGroupMain, { hint, icon: React125.createElement(search_icon_default, null), innerRef: searchInputInputRef, value: searchValue, placeholder, "aria-label": ariaLabel, onKeyDown: onEnter, onChange: onChangeHandler, name: name2, inputId: searchInputId }),
        (renderUtilities || areUtilitiesDisplayed) && React125.createElement(
          TextInputGroupUtilities,
          null,
          resultsCount && React125.createElement(Badge, { isRead: true }, resultsCount),
          !!onNextClick && !!onPreviousClick && React125.createElement(
            "div",
            { className: text_input_group_default.textInputGroupGroup },
            React125.createElement(
              Button,
              { variant: ButtonVariant.plain, "aria-label": previousNavigationButtonAriaLabel, isDisabled: isDisabled || isPreviousNavigationButtonDisabled, onClick: onPreviousClick },
              React125.createElement(angle_up_icon_default, null)
            ),
            React125.createElement(
              Button,
              { variant: ButtonVariant.plain, "aria-label": nextNavigationButtonAriaLabel, isDisabled: isDisabled || isNextNavigationButtonDisabled, onClick: onNextClick },
              React125.createElement(angle_down_icon_default, null)
            )
          ),
          !!onClear && !expandableInput && React125.createElement(
            Button,
            { variant: ButtonVariant.plain, isDisabled, "aria-label": resetButtonLabel, onClick: onClearInput },
            React125.createElement(times_icon_default, null)
          )
        )
      );
    };
    const expandableToggle = React125.createElement(Button, { variant: ButtonVariant.plain, "aria-label": toggleAriaLabel, "aria-expanded": isExpanded, icon: isExpanded ? React125.createElement(times_icon_default, null) : React125.createElement(search_icon_default, null), onClick: onExpandHandler, ref: searchInputExpandableToggleRef });
    const buildExpandableSearchInput = (_a2 = {}) => {
      var searchInputProps2 = __rest(_a2, []);
      return React125.createElement(
        InputGroup,
        Object.assign({}, searchInputProps2),
        React125.createElement(
          InputGroupItem,
          { isFill: true },
          buildTextInputGroup(),
          " "
        ),
        React125.createElement(InputGroupItem, { isPlain: true }, expandableToggle)
      );
    };
    const buildSearchTextInputGroup = (_a2 = {}) => {
      var searchInputProps2 = __rest(_a2, []);
      if (expandableInput) {
        return buildExpandableSearchInput(Object.assign({}, searchInputProps2));
      }
      return buildTextInputGroup(Object.assign({}, searchInputProps2));
    };
    const buildSearchTextInputGroupWithExtraButtons = (_a2 = {}) => {
      var searchInputProps2 = __rest(_a2, []);
      return React125.createElement(
        InputGroup,
        Object.assign({ ref: triggerRef }, searchInputProps2),
        React125.createElement(InputGroupItem, { isFill: true }, buildTextInputGroup()),
        (attributes.length > 0 || onToggleAdvancedSearch) && React125.createElement(
          InputGroupItem,
          { isPlain: true },
          React125.createElement(
            Button,
            { className: isSearchMenuOpen && "pf-m-expanded", variant: ButtonVariant.control, "aria-label": openMenuButtonAriaLabel, onClick: onToggle, isDisabled, "aria-expanded": isSearchMenuOpen },
            React125.createElement(caret_down_icon_default, null)
          )
        ),
        !!onSearch && React125.createElement(
          InputGroupItem,
          null,
          React125.createElement(
            Button,
            { type: "submit", variant: ButtonVariant.control, "aria-label": submitSearchButtonLabel, onClick: onSearchHandler, isDisabled },
            React125.createElement(
              Icon,
              { shouldMirrorRTL: true },
              React125.createElement(arrow_right_icon_default, null)
            )
          )
        ),
        expandableInput && React125.createElement(InputGroupItem, null, expandableToggle)
      );
    };
    const searchInputProps = Object.assign(Object.assign({}, props), { className: className && css(className), innerRef: searchInputRef });
    if (!!expandableInput && !isExpanded) {
      return React125.createElement(
        InputGroup,
        Object.assign({}, searchInputProps),
        React125.createElement(InputGroupItem, null, expandableToggle)
      );
    }
    if (!!onSearch || attributes.length > 0 || !!onToggleAdvancedSearch) {
      if (attributes.length > 0) {
        const AdvancedSearch = React125.createElement(
          "div",
          { ref: popperRef },
          React125.createElement(AdvancedSearchMenu, { value, parentRef: searchInputRef, parentInputRef: searchInputInputRef, onSearch, onClear, onChange, onToggleAdvancedMenu: onToggle, resetButtonLabel, submitSearchButtonLabel, attributes, formAdditionalItems, hasWordsAttrLabel, advancedSearchDelimiter, getAttrValueMap, isSearchMenuOpen })
        );
        const AdvancedSearchWithPopper = React125.createElement(
          "div",
          Object.assign({ className: css(className), ref: searchInputRef }, props),
          React125.createElement(Popper, { trigger: buildSearchTextInputGroupWithExtraButtons(), triggerRef, popper: AdvancedSearch, popperRef, isVisible: isSearchMenuOpen, enableFlip: true, appendTo: () => appendTo || searchInputRef.current, zIndex })
        );
        const AdvancedSearchInline = React125.createElement(
          "div",
          Object.assign({ className: css(className), ref: searchInputRef }, props),
          buildSearchTextInputGroupWithExtraButtons(),
          AdvancedSearch
        );
        return appendTo !== "inline" ? AdvancedSearchWithPopper : AdvancedSearchInline;
      }
      return buildSearchTextInputGroupWithExtraButtons(Object.assign({}, searchInputProps));
    }
    return buildSearchTextInputGroup(searchInputProps);
  };
  SearchInputBase.displayName = "SearchInputBase";
  var SearchInput = React125.forwardRef((props, ref) => React125.createElement(SearchInputBase, Object.assign({}, props, { innerRef: ref })));
  SearchInput.displayName = "SearchInput";

  // node_modules/@patternfly/react-tokens/dist/esm/c_dual_list_selector__menu_MinHeight.js
  var c_dual_list_selector__menu_MinHeight = {
    "name": "--pf-v5-c-dual-list-selector__menu--MinHeight",
    "value": "12.5rem",
    "var": "var(--pf-v5-c-dual-list-selector__menu--MinHeight)"
  };
  var c_dual_list_selector_menu_MinHeight_default = c_dual_list_selector__menu_MinHeight;

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorPane.js
  var DualListSelectorPane = (_a) => {
    var { isChosen = false, className = "", status = "", actions, searchInput, children, onOptionSelect, onOptionCheck, title = "", options: options5 = [], selectedOptions = [], isSearchable = false, searchInputAriaLabel = "", onFilterUpdate, onSearchInputChanged, onSearchInputClear, filterOption, id = getUniqueId("dual-list-selector-pane"), isDisabled = false, listMinHeight } = _a, props = __rest(_a, ["isChosen", "className", "status", "actions", "searchInput", "children", "onOptionSelect", "onOptionCheck", "title", "options", "selectedOptions", "isSearchable", "searchInputAriaLabel", "onFilterUpdate", "onSearchInputChanged", "onSearchInputClear", "filterOption", "id", "isDisabled", "listMinHeight"]);
    const [input, setInput] = React126.useState("");
    const { isTree } = React126.useContext(DualListSelectorContext);
    const onChange = (e, newValue) => {
      let filtered;
      if (isTree) {
        filtered = options5.map((opt) => Object.assign({}, opt)).filter((item) => filterInput(item, newValue));
      } else {
        filtered = options5.filter((option) => {
          if (displayOption(option)) {
            return option;
          }
        });
      }
      onFilterUpdate(filtered, isChosen ? "chosen" : "available", newValue === "");
      if (onSearchInputChanged) {
        onSearchInputChanged(e, newValue);
      }
      setInput(newValue);
    };
    const filterInput = (item, input2) => {
      if (filterOption) {
        return filterOption(item, input2);
      } else {
        if (item.text.toLowerCase().includes(input2.toLowerCase()) || input2 === "") {
          return true;
        }
      }
      if (item.children) {
        return (item.children = item.children.map((opt) => Object.assign({}, opt)).filter((child) => filterInput(child, input2))).length > 0;
      }
    };
    const displayOption = (option) => {
      if (filterOption) {
        return filterOption(option, input);
      } else {
        return option.toString().toLowerCase().includes(input.toLowerCase());
      }
    };
    return React126.createElement(
      "div",
      Object.assign({ className: css(dual_list_selector_default.dualListSelectorPane, isChosen ? dual_list_selector_default.modifiers.chosen : "pf-m-available", className) }, props),
      title && React126.createElement(
        "div",
        { className: css(dual_list_selector_default.dualListSelectorHeader) },
        React126.createElement(
          "div",
          { className: `${dual_list_selector_default.dualListSelector}__title` },
          React126.createElement("div", { className: css(dual_list_selector_default.dualListSelectorTitleText) }, title)
        )
      ),
      (actions || searchInput || isSearchable) && React126.createElement(
        "div",
        { className: css(dual_list_selector_default.dualListSelectorTools) },
        (isSearchable || searchInput) && React126.createElement("div", { className: css(dual_list_selector_default.dualListSelectorToolsFilter) }, searchInput ? searchInput : React126.createElement(SearchInput, { onChange: isDisabled ? void 0 : onChange, onClear: onSearchInputClear ? onSearchInputClear : (e) => onChange(e, ""), isDisabled, "aria-label": searchInputAriaLabel })),
        actions && React126.createElement("div", { className: css(dual_list_selector_default.dualListSelectorToolsActions) }, actions)
      ),
      status && React126.createElement(
        "div",
        { className: css(dual_list_selector_default.dualListSelectorStatus) },
        React126.createElement("div", { className: css(dual_list_selector_default.dualListSelectorStatusText), id: `${id}-status` }, status)
      ),
      React126.createElement(
        DualListSelectorPaneContext.Provider,
        { value: { isChosen } },
        !isTree && React126.createElement(DualListSelectorListWrapper, Object.assign({ "aria-labelledby": `${id}-status`, options: options5, selectedOptions, onOptionSelect: (e, index, id2) => onOptionSelect(e, index, isChosen, id2), displayOption, id: `${id}-list`, isDisabled }, listMinHeight && {
          style: { [c_dual_list_selector_menu_MinHeight_default.name]: listMinHeight }
        }), children),
        isTree && React126.createElement(DualListSelectorListWrapper, Object.assign({ "aria-labelledby": `${id}-status`, id: `${id}-list` }, listMinHeight && {
          style: { [c_dual_list_selector_menu_MinHeight_default.name]: listMinHeight }
        }), options5.length > 0 ? React126.createElement(
          DualListSelectorList,
          null,
          React126.createElement(DualListSelectorTree, { data: isSearchable ? options5.map((opt) => Object.assign({}, opt)).filter((item) => filterInput(item, input)) : options5, onOptionCheck, id: `${id}-tree`, isDisabled })
        ) : children)
      )
    );
  };
  DualListSelectorPane.displayName = "DualListSelectorPane";

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorControlsWrapper.js
  init_tslib_es6();
  var React127 = __toESM(require_react());
  var DualListSelectorControlsWrapperBase = (_a) => {
    var { innerRef, children = null, className, "aria-label": ariaLabel = "Controls for moving options between lists" } = _a, props = __rest(_a, ["innerRef", "children", "className", "aria-label"]);
    const ref = React127.useRef(null);
    const wrapperRef = innerRef || ref;
    const handleKeys = (event) => {
      if (!wrapperRef.current || wrapperRef.current !== event.target.closest(`.${dual_list_selector_default.dualListSelectorControls}`) && !Array.from(wrapperRef.current.getElementsByClassName(dual_list_selector_default.dualListSelectorControls)).includes(event.target.closest(`.${dual_list_selector_default.dualListSelectorControls}`))) {
        return;
      }
      event.stopImmediatePropagation();
      const controls = Array.from(wrapperRef.current.getElementsByTagName("BUTTON")).filter((el) => !el.classList.contains("pf-m-disabled"));
      const activeElement = document.activeElement;
      handleArrows(event, controls, (element) => activeElement.contains(element), (element) => element, void 0, void 0, true, false);
    };
    React127.useEffect(() => {
      window.addEventListener("keydown", handleKeys);
      return () => {
        window.removeEventListener("keydown", handleKeys);
      };
    }, [wrapperRef.current]);
    return React127.createElement("div", Object.assign({ className: css(dual_list_selector_default.dualListSelectorControls, className), tabIndex: 0, ref: wrapperRef, "aria-label": ariaLabel }, props), children);
  };
  DualListSelectorControlsWrapperBase.displayName = "DualListSelectorControlsWrapperBase";
  var DualListSelectorControlsWrapper = React127.forwardRef((props, ref) => React127.createElement(DualListSelectorControlsWrapperBase, Object.assign({ innerRef: ref, role: "group" }, props)));
  DualListSelectorControlsWrapper.displayName = "DualListSelectorControlsWrapper";

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelectorControl.js
  init_tslib_es6();
  var React128 = __toESM(require_react());
  var DualListSelectorControlBase = (_a) => {
    var { innerRef, children = null, className, "aria-label": ariaLabel, isDisabled = true, onClick = () => {
    }, tooltipContent, tooltipProps = {} } = _a, props = __rest(_a, ["innerRef", "children", "className", "aria-label", "isDisabled", "onClick", "tooltipContent", "tooltipProps"]);
    const privateRef = React128.useRef(null);
    const ref = innerRef || privateRef;
    return React128.createElement(
      "div",
      Object.assign({ className: css(dual_list_selector_default.dualListSelectorControlsItem, className) }, props),
      React128.createElement(Button, { isDisabled, "aria-disabled": isDisabled, variant: ButtonVariant.plain, onClick, "aria-label": ariaLabel, tabIndex: -1, ref }, children),
      tooltipContent && React128.createElement(Tooltip, Object.assign({ content: tooltipContent, position: "left", triggerRef: ref }, tooltipProps))
    );
  };
  DualListSelectorControlBase.displayName = "DualListSelectorControlBase";
  var DualListSelectorControl = React128.forwardRef((props, ref) => React128.createElement(DualListSelectorControlBase, Object.assign({ innerRef: ref }, props)));
  DualListSelectorControl.displayName = "DualListSelectorControl";

  // node_modules/@patternfly/react-core/dist/esm/components/DualListSelector/DualListSelector.js
  var DualListSelector = class extends React129.Component {
    // If the DualListSelector uses trees, concat the two initial arrays and merge duplicate folder IDs
    createMergedCopy() {
      const copyOfAvailable = JSON.parse(JSON.stringify(this.props.availableOptions));
      const copyOfChosen = JSON.parse(JSON.stringify(this.props.chosenOptions));
      return this.props.isTree ? Object.values(copyOfAvailable.concat(copyOfChosen).reduce((mapObj, item) => {
        const key = item.id;
        if (mapObj[key]) {
          mapObj[key].children.push(...item.children);
        } else {
          mapObj[key] = Object.assign({}, item);
        }
        return mapObj;
      }, {})) : null;
    }
    constructor(props) {
      super(props);
      this.addAllButtonRef = React129.createRef();
      this.addSelectedButtonRef = React129.createRef();
      this.removeSelectedButtonRef = React129.createRef();
      this.removeAllButtonRef = React129.createRef();
      this.replacer = (key, value) => {
        if (key[0] === "_") {
          return void 0;
        }
        return value;
      };
      this.onFilterUpdate = (newFilteredOptions, paneType, isSearchReset) => {
        const { isTree } = this.props;
        if (paneType === "available") {
          if (isSearchReset) {
            this.setState({
              availableFilteredOptions: null,
              availableTreeFilteredOptions: null
            });
            return;
          }
          if (isTree) {
            this.setState({
              availableTreeFilteredOptions: flattenTreeWithFolders(newFilteredOptions)
            });
          } else {
            this.setState({
              availableFilteredOptions: newFilteredOptions
            });
          }
        } else if (paneType === "chosen") {
          if (isSearchReset) {
            this.setState({
              chosenFilteredOptions: null,
              chosenTreeFilteredOptions: null
            });
            return;
          }
          if (isTree) {
            this.setState({
              chosenTreeFilteredOptions: flattenTreeWithFolders(newFilteredOptions)
            });
          } else {
            this.setState({
              chosenFilteredOptions: newFilteredOptions
            });
          }
        }
      };
      this.addAllVisible = (event) => {
        this.setState((prevState) => {
          const itemsToRemove = [];
          const newAvailable = [];
          const movedOptions = prevState.availableFilteredOptions || prevState.availableOptions;
          prevState.availableOptions.forEach((value) => {
            if (movedOptions.indexOf(value) !== -1) {
              itemsToRemove.push(value);
            } else {
              newAvailable.push(value);
            }
          });
          const newChosen = [...prevState.chosenOptions, ...itemsToRemove];
          this.props.addAll && this.props.addAll(newAvailable, newChosen);
          this.props.onListChange && this.props.onListChange(event, newAvailable, newChosen);
          return {
            chosenOptions: newChosen,
            chosenFilteredOptions: newChosen,
            availableOptions: newAvailable,
            availableFilteredOptions: newAvailable,
            chosenOptionsSelected: [],
            availableOptionsSelected: []
          };
        });
      };
      this.addAllTreeVisible = (event) => {
        this.setState((prevState) => {
          const movedOptions = prevState.availableTreeFilteredOptions || flattenTreeWithFolders(prevState.availableOptions);
          const newAvailable = prevState.availableOptions.map((opt) => Object.assign({}, opt)).filter((item) => filterRestTreeItems(item, movedOptions));
          const currChosen = flattenTree(prevState.chosenOptions);
          const nextChosenOptions = currChosen.concat(movedOptions);
          const newChosen = this.createMergedCopy().map((opt) => Object.assign({}, opt)).filter((item) => filterTreeItemsWithoutFolders(item, nextChosenOptions));
          this.props.addAll && this.props.addAll(newAvailable, newChosen);
          this.props.onListChange && this.props.onListChange(event, newAvailable, newChosen);
          return {
            chosenOptions: newChosen,
            chosenFilteredOptions: newChosen,
            availableOptions: newAvailable,
            availableFilteredOptions: newAvailable,
            availableTreeOptionsChecked: [],
            chosenTreeOptionsChecked: []
          };
        });
      };
      this.addSelected = (event) => {
        this.setState((prevState) => {
          const itemsToRemove = [];
          const newAvailable = [];
          prevState.availableOptions.forEach((value, index) => {
            if (prevState.availableOptionsSelected.indexOf(index) !== -1) {
              itemsToRemove.push(value);
            } else {
              newAvailable.push(value);
            }
          });
          const newChosen = [...prevState.chosenOptions, ...itemsToRemove];
          this.props.addSelected && this.props.addSelected(newAvailable, newChosen);
          this.props.onListChange && this.props.onListChange(event, newAvailable, newChosen);
          return {
            chosenOptionsSelected: [],
            availableOptionsSelected: [],
            chosenOptions: newChosen,
            chosenFilteredOptions: newChosen,
            availableOptions: newAvailable,
            availableFilteredOptions: newAvailable
          };
        });
      };
      this.addTreeSelected = (event) => {
        this.setState((prevState) => {
          const newAvailable = prevState.availableOptions.map((opt) => Object.assign({}, opt)).filter((item) => filterRestTreeItems(item, prevState.availableTreeOptionsChecked));
          const currChosen = flattenTree(prevState.chosenOptions);
          const nextChosenOptions = currChosen.concat(prevState.availableTreeOptionsChecked);
          const newChosen = this.createMergedCopy().map((opt) => Object.assign({}, opt)).filter((item) => filterTreeItemsWithoutFolders(item, nextChosenOptions));
          this.props.addSelected && this.props.addSelected(newAvailable, newChosen);
          this.props.onListChange && this.props.onListChange(event, newAvailable, newChosen);
          return {
            availableTreeOptionsChecked: [],
            chosenTreeOptionsChecked: [],
            availableOptions: newAvailable,
            chosenOptions: newChosen
          };
        });
      };
      this.removeAllVisible = (event) => {
        this.setState((prevState) => {
          const itemsToRemove = [];
          const newChosen = [];
          const movedOptions = prevState.chosenFilteredOptions || prevState.chosenOptions;
          prevState.chosenOptions.forEach((value) => {
            if (movedOptions.indexOf(value) !== -1) {
              itemsToRemove.push(value);
            } else {
              newChosen.push(value);
            }
          });
          const newAvailable = [...prevState.availableOptions, ...itemsToRemove];
          this.props.removeAll && this.props.removeAll(newAvailable, newChosen);
          this.props.onListChange && this.props.onListChange(event, newAvailable, newChosen);
          return {
            chosenOptions: newChosen,
            chosenFilteredOptions: newChosen,
            availableOptions: newAvailable,
            availableFilteredOptions: newAvailable,
            chosenOptionsSelected: [],
            availableOptionsSelected: []
          };
        });
      };
      this.removeAllTreeVisible = (event) => {
        this.setState((prevState) => {
          const movedOptions = prevState.chosenTreeFilteredOptions || flattenTreeWithFolders(prevState.chosenOptions);
          const newChosen = prevState.chosenOptions.map((opt) => Object.assign({}, opt)).filter((item) => filterRestTreeItems(item, movedOptions));
          const currAvailable = flattenTree(prevState.availableOptions);
          const nextAvailableOptions = currAvailable.concat(movedOptions);
          const newAvailable = this.createMergedCopy().map((opt) => Object.assign({}, opt)).filter((item) => filterTreeItemsWithoutFolders(item, nextAvailableOptions));
          this.props.removeAll && this.props.removeAll(newAvailable, newChosen);
          this.props.onListChange && this.props.onListChange(event, newAvailable, newChosen);
          return {
            chosenOptions: newChosen,
            availableOptions: newAvailable,
            availableTreeOptionsChecked: [],
            chosenTreeOptionsChecked: []
          };
        });
      };
      this.removeSelected = (event) => {
        this.setState((prevState) => {
          const itemsToRemove = [];
          const newChosen = [];
          prevState.chosenOptions.forEach((value, index) => {
            if (prevState.chosenOptionsSelected.indexOf(index) !== -1) {
              itemsToRemove.push(value);
            } else {
              newChosen.push(value);
            }
          });
          const newAvailable = [...prevState.availableOptions, ...itemsToRemove];
          this.props.removeSelected && this.props.removeSelected(newAvailable, newChosen);
          this.props.onListChange && this.props.onListChange(event, newAvailable, newChosen);
          return {
            chosenOptionsSelected: [],
            availableOptionsSelected: [],
            chosenOptions: newChosen,
            chosenFilteredOptions: newChosen,
            availableOptions: newAvailable,
            availableFilteredOptions: newAvailable
          };
        });
      };
      this.removeTreeSelected = (event) => {
        this.setState((prevState) => {
          const newChosen = prevState.chosenOptions.map((opt) => Object.assign({}, opt)).filter((item) => filterRestTreeItems(item, prevState.chosenTreeOptionsChecked));
          const currAvailable = flattenTree(prevState.availableOptions);
          const nextAvailableOptions = currAvailable.concat(prevState.chosenTreeOptionsChecked);
          const newAvailable = this.createMergedCopy().map((opt) => Object.assign({}, opt)).filter((item) => filterTreeItemsWithoutFolders(item, nextAvailableOptions));
          this.props.removeSelected && this.props.removeSelected(newAvailable, newChosen);
          this.props.onListChange && this.props.onListChange(event, newAvailable, newChosen);
          return {
            availableTreeOptionsChecked: [],
            chosenTreeOptionsChecked: [],
            availableOptions: newAvailable,
            chosenOptions: newChosen
          };
        });
      };
      this.onOptionSelect = (e, index, isChosen, id, itemData, parentData) => {
        this.setState((prevState) => {
          const originalArray = isChosen ? prevState.chosenOptionsSelected : prevState.availableOptionsSelected;
          let updatedArray = null;
          if (originalArray.indexOf(index) !== -1) {
            updatedArray = originalArray.filter((value) => value !== index);
          } else {
            updatedArray = [...originalArray, index];
          }
          return {
            chosenOptionsSelected: isChosen ? updatedArray : prevState.chosenOptionsSelected,
            availableOptionsSelected: isChosen ? prevState.availableOptionsSelected : updatedArray
          };
        });
        this.props.onOptionSelect && this.props.onOptionSelect(e, index, isChosen, id, itemData, parentData);
      };
      this.isChecked = (treeItem, isChosen) => isChosen ? this.state.chosenTreeOptionsChecked.includes(treeItem.id) : this.state.availableTreeOptionsChecked.includes(treeItem.id);
      this.areAllDescendantsChecked = (treeItem, isChosen) => treeItem.children ? treeItem.children.every((child) => this.areAllDescendantsChecked(child, isChosen)) : this.isChecked(treeItem, isChosen);
      this.areSomeDescendantsChecked = (treeItem, isChosen) => treeItem.children ? treeItem.children.some((child) => this.areSomeDescendantsChecked(child, isChosen)) : this.isChecked(treeItem, isChosen);
      this.mapChecked = (item, isChosen) => {
        const hasCheck = this.areAllDescendantsChecked(item, isChosen);
        item.isChecked = false;
        if (hasCheck) {
          item.isChecked = true;
        } else {
          const hasPartialCheck = this.areSomeDescendantsChecked(item, isChosen);
          if (hasPartialCheck) {
            item.isChecked = null;
          }
        }
        if (item.children) {
          return Object.assign(Object.assign({}, item), { children: item.children.map((child) => this.mapChecked(child, isChosen)) });
        }
        return item;
      };
      this.onTreeOptionCheck = (evt, isChecked, itemData, isChosen) => {
        const { availableOptions, availableTreeFilteredOptions, chosenOptions, chosenTreeFilteredOptions } = this.state;
        let panelOptions;
        if (isChosen) {
          if (chosenTreeFilteredOptions) {
            panelOptions = chosenOptions.map((opt) => Object.assign({}, opt)).filter((item) => filterTreeItemsWithoutFolders(item, chosenTreeFilteredOptions));
          } else {
            panelOptions = chosenOptions;
          }
        } else {
          if (availableTreeFilteredOptions) {
            panelOptions = availableOptions.map((opt) => Object.assign({}, opt)).filter((item) => filterTreeItemsWithoutFolders(item, availableTreeFilteredOptions));
          } else {
            panelOptions = availableOptions;
          }
        }
        const checkedOptionTree = panelOptions.map((opt) => Object.assign({}, opt)).filter((item) => filterTreeItems(item, [itemData.id]));
        const flatTree = flattenTreeWithFolders(checkedOptionTree);
        const prevChecked = isChosen ? this.state.chosenTreeOptionsChecked : this.state.availableTreeOptionsChecked;
        let updatedChecked = [];
        if (isChecked) {
          updatedChecked = prevChecked.concat(flatTree.filter((id) => !prevChecked.includes(id)));
        } else {
          updatedChecked = prevChecked.filter((id) => !flatTree.includes(id));
        }
        this.setState((prevState) => ({
          availableTreeOptionsChecked: isChosen ? prevState.availableTreeOptionsChecked : updatedChecked,
          chosenTreeOptionsChecked: isChosen ? updatedChecked : prevState.chosenTreeOptionsChecked
        }), () => {
          this.props.onOptionCheck && this.props.onOptionCheck(evt, isChecked, itemData.id, updatedChecked);
        });
      };
      this.state = {
        availableOptions: [...this.props.availableOptions],
        availableOptionsSelected: [],
        availableFilteredOptions: null,
        availableTreeFilteredOptions: null,
        chosenOptions: [...this.props.chosenOptions],
        chosenOptionsSelected: [],
        chosenFilteredOptions: null,
        chosenTreeFilteredOptions: null,
        availableTreeOptionsChecked: [],
        chosenTreeOptionsChecked: []
      };
    }
    componentDidUpdate() {
      if (JSON.stringify(this.props.availableOptions, this.replacer) !== JSON.stringify(this.state.availableOptions, this.replacer) || JSON.stringify(this.props.chosenOptions, this.replacer) !== JSON.stringify(this.state.chosenOptions, this.replacer)) {
        this.setState({
          availableOptions: [...this.props.availableOptions],
          chosenOptions: [...this.props.chosenOptions]
        });
      }
    }
    render() {
      const _a = this.props, {
        availableOptionsTitle,
        availableOptionsActions,
        availableOptionsSearchAriaLabel,
        className,
        children,
        chosenOptionsTitle,
        chosenOptionsActions,
        chosenOptionsSearchAriaLabel,
        filterOption,
        isSearchable,
        chosenOptionsStatus,
        availableOptionsStatus,
        controlsAriaLabel,
        addAllAriaLabel,
        addSelectedAriaLabel,
        removeSelectedAriaLabel,
        removeAllAriaLabel,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        availableOptions: consumerPassedAvailableOptions,
        chosenOptions: consumerPassedChosenOptions,
        removeSelected,
        addAll,
        removeAll,
        addSelected,
        onListChange,
        onAvailableOptionsSearchInputChanged,
        onChosenOptionsSearchInputChanged,
        onOptionSelect,
        onOptionCheck,
        id,
        isTree,
        isDisabled,
        addAllTooltip,
        addAllTooltipProps,
        addSelectedTooltip,
        addSelectedTooltipProps,
        removeAllTooltip,
        removeAllTooltipProps,
        removeSelectedTooltip,
        removeSelectedTooltipProps
      } = _a, props = __rest(_a, ["availableOptionsTitle", "availableOptionsActions", "availableOptionsSearchAriaLabel", "className", "children", "chosenOptionsTitle", "chosenOptionsActions", "chosenOptionsSearchAriaLabel", "filterOption", "isSearchable", "chosenOptionsStatus", "availableOptionsStatus", "controlsAriaLabel", "addAllAriaLabel", "addSelectedAriaLabel", "removeSelectedAriaLabel", "removeAllAriaLabel", "availableOptions", "chosenOptions", "removeSelected", "addAll", "removeAll", "addSelected", "onListChange", "onAvailableOptionsSearchInputChanged", "onChosenOptionsSearchInputChanged", "onOptionSelect", "onOptionCheck", "id", "isTree", "isDisabled", "addAllTooltip", "addAllTooltipProps", "addSelectedTooltip", "addSelectedTooltipProps", "removeAllTooltip", "removeAllTooltipProps", "removeSelectedTooltip", "removeSelectedTooltipProps"]);
      const { availableOptions, chosenOptions, chosenOptionsSelected, availableOptionsSelected, chosenTreeOptionsChecked, availableTreeOptionsChecked } = this.state;
      const availableOptionsStatusToDisplay = availableOptionsStatus || (isTree ? `${filterFolders(availableOptions, availableTreeOptionsChecked).length} of ${flattenTree(availableOptions).length} items selected` : `${availableOptionsSelected.length} of ${availableOptions.length} items selected`);
      const chosenOptionsStatusToDisplay = chosenOptionsStatus || (isTree ? `${filterFolders(chosenOptions, chosenTreeOptionsChecked).length} of ${flattenTree(chosenOptions).length} items selected` : `${chosenOptionsSelected.length} of ${chosenOptions.length} items selected`);
      const available = isTree ? availableOptions.map((item) => this.mapChecked(item, false)) : availableOptions;
      const chosen = isTree ? chosenOptions.map((item) => this.mapChecked(item, true)) : chosenOptions;
      return React129.createElement(
        DualListSelectorContext.Provider,
        { value: { isTree } },
        React129.createElement(GenerateId, null, (randomId) => React129.createElement("div", Object.assign({ className: css(dual_list_selector_default.dualListSelector, className), id: id || randomId }, props), children === "" ? React129.createElement(
          React129.Fragment,
          null,
          React129.createElement(DualListSelectorPane, { isSearchable, onFilterUpdate: this.onFilterUpdate, searchInputAriaLabel: availableOptionsSearchAriaLabel, filterOption, onSearchInputChanged: onAvailableOptionsSearchInputChanged, status: availableOptionsStatusToDisplay, title: availableOptionsTitle, options: available, selectedOptions: isTree ? availableTreeOptionsChecked : availableOptionsSelected, onOptionSelect: this.onOptionSelect, onOptionCheck: (e, isChecked, itemData) => this.onTreeOptionCheck(e, isChecked, itemData, false), actions: availableOptionsActions, id: `${id || randomId}-available-pane`, isDisabled }),
          React129.createElement(
            DualListSelectorControlsWrapper,
            { "aria-label": controlsAriaLabel },
            React129.createElement(
              DualListSelectorControl,
              { isDisabled: (isTree ? availableTreeOptionsChecked.length === 0 : availableOptionsSelected.length === 0) || isDisabled, onClick: isTree ? this.addTreeSelected : this.addSelected, ref: this.addSelectedButtonRef, "aria-label": addSelectedAriaLabel, tooltipContent: addSelectedTooltip, tooltipProps: addSelectedTooltipProps },
              React129.createElement(angle_right_icon_default, null)
            ),
            React129.createElement(
              DualListSelectorControl,
              { isDisabled: availableOptions.length === 0 || isDisabled, onClick: isTree ? this.addAllTreeVisible : this.addAllVisible, ref: this.addAllButtonRef, "aria-label": addAllAriaLabel, tooltipContent: addAllTooltip, tooltipProps: addAllTooltipProps },
              React129.createElement(angle_double_right_icon_default, null)
            ),
            React129.createElement(
              DualListSelectorControl,
              { isDisabled: chosenOptions.length === 0 || isDisabled, onClick: isTree ? this.removeAllTreeVisible : this.removeAllVisible, "aria-label": removeAllAriaLabel, ref: this.removeAllButtonRef, tooltipContent: removeAllTooltip, tooltipProps: removeAllTooltipProps },
              React129.createElement(angle_double_left_icon_default, null)
            ),
            React129.createElement(
              DualListSelectorControl,
              { onClick: isTree ? this.removeTreeSelected : this.removeSelected, isDisabled: (isTree ? chosenTreeOptionsChecked.length === 0 : chosenOptionsSelected.length === 0) || isDisabled, ref: this.removeSelectedButtonRef, "aria-label": removeSelectedAriaLabel, tooltipContent: removeSelectedTooltip, tooltipProps: removeSelectedTooltipProps },
              React129.createElement(angle_left_icon_default, null)
            )
          ),
          React129.createElement(DualListSelectorPane, { isChosen: true, isSearchable, onFilterUpdate: this.onFilterUpdate, searchInputAriaLabel: chosenOptionsSearchAriaLabel, filterOption, onSearchInputChanged: onChosenOptionsSearchInputChanged, title: chosenOptionsTitle, status: chosenOptionsStatusToDisplay, options: chosen, selectedOptions: isTree ? chosenTreeOptionsChecked : chosenOptionsSelected, onOptionSelect: this.onOptionSelect, onOptionCheck: (e, isChecked, itemData) => this.onTreeOptionCheck(e, isChecked, itemData, true), actions: chosenOptionsActions, id: `${id || randomId}-chosen-pane`, isDisabled })
        ) : children))
      );
    }
  };
  DualListSelector.displayName = "DualListSelector";
  DualListSelector.defaultProps = {
    children: "",
    availableOptions: [],
    availableOptionsTitle: "Available options",
    availableOptionsSearchAriaLabel: "Available search input",
    chosenOptions: [],
    chosenOptionsTitle: "Chosen options",
    chosenOptionsSearchAriaLabel: "Chosen search input",
    controlsAriaLabel: "Selector controls",
    addAllAriaLabel: "Add all",
    addSelectedAriaLabel: "Add selected",
    removeSelectedAriaLabel: "Remove selected",
    removeAllAriaLabel: "Remove all",
    isTree: false,
    isDisabled: false
  };

  // node_modules/@patternfly/react-core/dist/esm/components/EmptyState/EmptyState.js
  init_tslib_es6();
  var React130 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/EmptyState/empty-state.mjs
  var empty_state_default = {
    "emptyState": "pf-v5-c-empty-state",
    "emptyStateActions": "pf-v5-c-empty-state__actions",
    "emptyStateBody": "pf-v5-c-empty-state__body",
    "emptyStateContent": "pf-v5-c-empty-state__content",
    "emptyStateFooter": "pf-v5-c-empty-state__footer",
    "emptyStateIcon": "pf-v5-c-empty-state__icon",
    "emptyStateTitleText": "pf-v5-c-empty-state__title-text",
    "modifiers": {
      "xs": "pf-m-xs",
      "sm": "pf-m-sm",
      "lg": "pf-m-lg",
      "xl": "pf-m-xl",
      "fullHeight": "pf-m-full-height"
    }
  };

  // node_modules/@patternfly/react-core/dist/esm/components/EmptyState/EmptyState.js
  var EmptyStateVariant;
  (function(EmptyStateVariant2) {
    EmptyStateVariant2["xs"] = "xs";
    EmptyStateVariant2["sm"] = "sm";
    EmptyStateVariant2["lg"] = "lg";
    EmptyStateVariant2["xl"] = "xl";
    EmptyStateVariant2["full"] = "full";
  })(EmptyStateVariant || (EmptyStateVariant = {}));
  var EmptyState = (_a) => {
    var { children, className, variant = EmptyStateVariant.full, isFullHeight } = _a, props = __rest(_a, ["children", "className", "variant", "isFullHeight"]);
    return React130.createElement(
      "div",
      Object.assign({ className: css(empty_state_default.emptyState, variant === "xs" && empty_state_default.modifiers.xs, variant === "sm" && empty_state_default.modifiers.sm, variant === "lg" && empty_state_default.modifiers.lg, variant === "xl" && empty_state_default.modifiers.xl, isFullHeight && empty_state_default.modifiers.fullHeight, className) }, props),
      React130.createElement("div", { className: css(empty_state_default.emptyStateContent) }, children)
    );
  };
  EmptyState.displayName = "EmptyState";

  // node_modules/@patternfly/react-core/dist/esm/components/EmptyState/EmptyStateHeader.js
  init_tslib_es6();
  var React131 = __toESM(require_react());
  var EmptyStateHeader = (_a) => {
    var { children, className, titleClassName, titleText, headingLevel: HeadingLevel = "h1", icon } = _a, props = __rest(_a, ["children", "className", "titleClassName", "titleText", "headingLevel", "icon"]);
    return React131.createElement(
      "div",
      Object.assign({ className: css(`${empty_state_default.emptyState}__header`, className) }, props),
      icon,
      (titleText || children) && React131.createElement(
        "div",
        { className: css(`${empty_state_default.emptyState}__title`) },
        titleText && React131.createElement(HeadingLevel, { className: css(empty_state_default.emptyStateTitleText, titleClassName) }, titleText),
        children
      )
    );
  };
  EmptyStateHeader.displayName = "EmptyStateHeader";

  // node_modules/@patternfly/react-core/dist/esm/components/EmptyState/EmptyStateIcon.js
  init_tslib_es6();
  var React132 = __toESM(require_react());

  // node_modules/@patternfly/react-tokens/dist/esm/c_empty_state__icon_Color.js
  var c_empty_state__icon_Color = {
    "name": "--pf-v5-c-empty-state__icon--Color",
    "value": "#6a6e73",
    "var": "var(--pf-v5-c-empty-state__icon--Color)"
  };
  var c_empty_state_icon_Color_default = c_empty_state__icon_Color;

  // node_modules/@patternfly/react-core/dist/esm/components/EmptyState/EmptyStateIcon.js
  var isSpinner = (icon) => icon.type === Spinner;
  var EmptyStateIcon = (_a) => {
    var { className, icon: IconComponent, color: color2 } = _a, props = __rest(_a, ["className", "icon", "color"]);
    const iconIsSpinner = isSpinner(React132.createElement(IconComponent, null));
    return React132.createElement(
      "div",
      Object.assign({ className: css(empty_state_default.emptyStateIcon) }, color2 && !iconIsSpinner && { style: { [c_empty_state_icon_Color_default.name]: color2 } }),
      React132.createElement(IconComponent, Object.assign({ className, "aria-hidden": !iconIsSpinner }, props))
    );
  };
  EmptyStateIcon.displayName = "EmptyStateIcon";

  // node_modules/@patternfly/react-core/dist/esm/components/EmptyState/EmptyStateBody.js
  init_tslib_es6();
  var React133 = __toESM(require_react());
  var EmptyStateBody = (_a) => {
    var { children, className } = _a, props = __rest(_a, ["children", "className"]);
    return React133.createElement("div", Object.assign({ className: css(empty_state_default.emptyStateBody, className) }, props), children);
  };
  EmptyStateBody.displayName = "EmptyStateBody";

  // node_modules/@patternfly/react-core/dist/esm/components/ExpandableSection/ExpandableSection.js
  init_tslib_es6();
  var React134 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/ExpandableSection/expandable-section.mjs
  var expandable_section_default = {
    "dirRtl": "pf-v5-m-dir-rtl",
    "expandableSection": "pf-v5-c-expandable-section",
    "expandableSectionContent": "pf-v5-c-expandable-section__content",
    "expandableSectionToggle": "pf-v5-c-expandable-section__toggle",
    "expandableSectionToggleIcon": "pf-v5-c-expandable-section__toggle-icon",
    "expandableSectionToggleText": "pf-v5-c-expandable-section__toggle-text",
    "modifiers": {
      "expanded": "pf-m-expanded",
      "detached": "pf-m-detached",
      "truncate": "pf-m-truncate",
      "limitWidth": "pf-m-limit-width",
      "displayLg": "pf-m-display-lg",
      "indented": "pf-m-indented",
      "active": "pf-m-active",
      "expandTop": "pf-m-expand-top"
    }
  };

  // node_modules/@patternfly/react-tokens/dist/esm/c_expandable_section_m_truncate__content_LineClamp.js
  var c_expandable_section_m_truncate__content_LineClamp = {
    "name": "--pf-v5-c-expandable-section--m-truncate__content--LineClamp",
    "value": "3",
    "var": "var(--pf-v5-c-expandable-section--m-truncate__content--LineClamp)"
  };
  var c_expandable_section_m_truncate_content_LineClamp_default = c_expandable_section_m_truncate__content_LineClamp;

  // node_modules/@patternfly/react-core/dist/esm/components/ExpandableSection/ExpandableSection.js
  var ExpandableSectionVariant;
  (function(ExpandableSectionVariant2) {
    ExpandableSectionVariant2["default"] = "default";
    ExpandableSectionVariant2["truncate"] = "truncate";
  })(ExpandableSectionVariant || (ExpandableSectionVariant = {}));
  var setLineClamp = (lines, element) => {
    if (!element || lines < 1) {
      return;
    }
    element.style.setProperty(c_expandable_section_m_truncate_content_LineClamp_default.name, lines.toString());
  };
  var ExpandableSection = class extends React134.Component {
    constructor(props) {
      super(props);
      this.expandableContentRef = React134.createRef();
      this.observer = () => {
      };
      this.checkToggleVisibility = () => {
        var _a;
        if ((_a = this.expandableContentRef) === null || _a === void 0 ? void 0 : _a.current) {
          const maxLines = this.props.truncateMaxLines || parseInt(c_expandable_section_m_truncate_content_LineClamp_default.value);
          const totalLines = this.expandableContentRef.current.scrollHeight / parseInt(getComputedStyle(this.expandableContentRef.current).lineHeight);
          this.setState({
            hasToggle: totalLines > maxLines
          });
        }
      };
      this.resize = () => {
        if (this.expandableContentRef.current) {
          const { offsetWidth } = this.expandableContentRef.current;
          if (this.state.previousWidth !== offsetWidth) {
            this.setState({ previousWidth: offsetWidth });
            this.checkToggleVisibility();
          }
        }
      };
      this.handleResize = debounce(this.resize, 250);
      this.state = {
        isExpanded: props.isExpanded,
        hasToggle: true,
        previousWidth: void 0
      };
    }
    calculateToggleText(toggleText, toggleTextExpanded, toggleTextCollapsed, propOrStateIsExpanded) {
      if (propOrStateIsExpanded && toggleTextExpanded !== "") {
        return toggleTextExpanded;
      }
      if (!propOrStateIsExpanded && toggleTextCollapsed !== "") {
        return toggleTextCollapsed;
      }
      return toggleText;
    }
    componentDidMount() {
      if (this.props.variant === ExpandableSectionVariant.truncate) {
        const expandableContent = this.expandableContentRef.current;
        this.setState({ previousWidth: expandableContent.offsetWidth });
        this.observer = getResizeObserver(expandableContent, this.handleResize, false);
        if (this.props.truncateMaxLines) {
          setLineClamp(this.props.truncateMaxLines, expandableContent);
        }
        this.checkToggleVisibility();
      }
    }
    componentDidUpdate(prevProps) {
      if (this.props.variant === ExpandableSectionVariant.truncate && (prevProps.truncateMaxLines !== this.props.truncateMaxLines || prevProps.children !== this.props.children)) {
        const expandableContent = this.expandableContentRef.current;
        setLineClamp(this.props.truncateMaxLines, expandableContent);
        this.checkToggleVisibility();
      }
    }
    componentWillUnmount() {
      if (this.props.variant === ExpandableSectionVariant.truncate) {
        this.observer();
      }
    }
    render() {
      const _a = this.props, {
        onToggle: onToggleProp,
        isActive,
        className,
        toggleText,
        toggleTextExpanded,
        toggleTextCollapsed,
        toggleContent,
        children,
        isExpanded,
        isDetached,
        displaySize,
        isWidthLimited,
        isIndented,
        contentId,
        toggleId,
        variant,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        truncateMaxLines
      } = _a, props = __rest(_a, ["onToggle", "isActive", "className", "toggleText", "toggleTextExpanded", "toggleTextCollapsed", "toggleContent", "children", "isExpanded", "isDetached", "displaySize", "isWidthLimited", "isIndented", "contentId", "toggleId", "variant", "truncateMaxLines"]);
      if (isDetached && !toggleId) {
        console.warn("ExpandableSection: The toggleId value must be passed in and must match the toggleId of the ExpandableSectionToggle.");
      }
      let onToggle = onToggleProp;
      let propOrStateIsExpanded = isExpanded;
      const uniqueContentId = contentId || getUniqueId("expandable-section-content");
      const uniqueToggleId = toggleId || getUniqueId("expandable-section-toggle");
      if (isExpanded === void 0) {
        propOrStateIsExpanded = this.state.isExpanded;
        onToggle = (event, isOpen) => {
          this.setState({ isExpanded: isOpen }, () => onToggleProp(event, this.state.isExpanded));
        };
      }
      const computedToggleText = this.calculateToggleText(toggleText, toggleTextExpanded, toggleTextCollapsed, propOrStateIsExpanded);
      const expandableToggle = !isDetached && React134.createElement(
        "button",
        { className: css(expandable_section_default.expandableSectionToggle), type: "button", "aria-expanded": propOrStateIsExpanded, "aria-controls": uniqueContentId, id: uniqueToggleId, onClick: (event) => onToggle(event, !propOrStateIsExpanded) },
        variant !== ExpandableSectionVariant.truncate && React134.createElement(
          "span",
          { className: css(expandable_section_default.expandableSectionToggleIcon) },
          React134.createElement(angle_right_icon_default, { "aria-hidden": true })
        ),
        React134.createElement("span", { className: css(expandable_section_default.expandableSectionToggleText) }, toggleContent || computedToggleText)
      );
      return React134.createElement(
        "div",
        Object.assign({ className: css(expandable_section_default.expandableSection, propOrStateIsExpanded && expandable_section_default.modifiers.expanded, isActive && expandable_section_default.modifiers.active, isDetached && expandable_section_default.modifiers.detached, displaySize === "lg" && expandable_section_default.modifiers.displayLg, isWidthLimited && expandable_section_default.modifiers.limitWidth, isIndented && expandable_section_default.modifiers.indented, variant === ExpandableSectionVariant.truncate && expandable_section_default.modifiers.truncate, className) }, props),
        variant === ExpandableSectionVariant.default && expandableToggle,
        React134.createElement("div", { ref: this.expandableContentRef, className: css(expandable_section_default.expandableSectionContent), hidden: variant !== ExpandableSectionVariant.truncate && !propOrStateIsExpanded, id: uniqueContentId, "aria-labelledby": uniqueToggleId, role: "region" }, children),
        variant === ExpandableSectionVariant.truncate && this.state.hasToggle && expandableToggle
      );
    }
  };
  ExpandableSection.displayName = "ExpandableSection";
  ExpandableSection.defaultProps = {
    className: "",
    toggleText: "",
    toggleTextExpanded: "",
    toggleTextCollapsed: "",
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    onToggle: (event, isExpanded) => void 0,
    isActive: false,
    isDetached: false,
    displaySize: "default",
    isWidthLimited: false,
    isIndented: false,
    variant: "default"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/FileUpload/FileUploadField.js
  init_tslib_es6();
  var React136 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/FileUpload/file-upload.mjs
  var file_upload_default = {
    "button": "pf-v5-c-button",
    "fileUpload": "pf-v5-c-file-upload",
    "fileUploadFileDetails": "pf-v5-c-file-upload__file-details",
    "fileUploadFileDetailsSpinner": "pf-v5-c-file-upload__file-details-spinner",
    "fileUploadFileSelect": "pf-v5-c-file-upload__file-select",
    "formControl": "pf-v5-c-form-control",
    "modifiers": {
      "dragHover": "pf-m-drag-hover",
      "loading": "pf-m-loading",
      "control": "pf-m-control"
    }
  };

  // node_modules/@patternfly/react-core/dist/esm/components/TextArea/TextArea.js
  init_tslib_es6();
  var React135 = __toESM(require_react());
  var TextAreResizeOrientation;
  (function(TextAreResizeOrientation2) {
    TextAreResizeOrientation2["horizontal"] = "horizontal";
    TextAreResizeOrientation2["vertical"] = "vertical";
    TextAreResizeOrientation2["both"] = "both";
  })(TextAreResizeOrientation || (TextAreResizeOrientation = {}));
  var TextAreaReadOnlyVariant;
  (function(TextAreaReadOnlyVariant2) {
    TextAreaReadOnlyVariant2["default"] = "default";
    TextAreaReadOnlyVariant2["plain"] = "plain";
  })(TextAreaReadOnlyVariant || (TextAreaReadOnlyVariant = {}));
  var TextAreaBase = class extends React135.Component {
    constructor(props) {
      super(props);
      this.inputRef = React135.createRef();
      this.setAutoHeight = (field) => {
        const parent2 = field.parentElement;
        parent2.style.setProperty("height", "inherit");
        const computed = window.getComputedStyle(field);
        const height = parseInt(computed.getPropertyValue("border-top-width")) + parseInt(computed.getPropertyValue("padding-top")) + field.scrollHeight + parseInt(computed.getPropertyValue("padding-bottom")) + parseInt(computed.getPropertyValue("border-bottom-width"));
        parent2.style.setProperty("height", `${height}px`);
      };
      this.handleChange = (event) => {
        const field = event.currentTarget;
        if (this.props.autoResize && canUseDOM) {
          this.setAutoHeight(field);
        }
        if (this.props.onChange) {
          this.props.onChange(event, field.value);
        }
      };
      if (!props.id && !props["aria-label"]) {
        console.error("TextArea: TextArea requires either an id or aria-label to be specified");
      }
    }
    componentDidMount() {
      const inputRef = this.props.innerRef || this.inputRef;
      if (this.props.autoResize && canUseDOM) {
        const field = inputRef.current;
        this.setAutoHeight(field);
      }
    }
    render() {
      const _a = this.props, {
        className,
        value,
        validated,
        isRequired,
        isDisabled,
        readOnlyVariant,
        resizeOrientation,
        innerRef,
        disabled,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        autoResize,
        onChange,
        /* eslint-enable @typescript-eslint/no-unused-vars */
        onBlur,
        onFocus
      } = _a, props = __rest(_a, ["className", "value", "validated", "isRequired", "isDisabled", "readOnlyVariant", "resizeOrientation", "innerRef", "disabled", "autoResize", "onChange", "onBlur", "onFocus"]);
      const orientation = `resize${capitalize(resizeOrientation)}`;
      const hasStatusIcon = ["success", "error", "warning"].includes(validated);
      return React135.createElement(
        "span",
        { className: css(form_control_default.formControl, readOnlyVariant && form_control_default.modifiers.readonly, readOnlyVariant === "plain" && form_control_default.modifiers.plain, resizeOrientation && form_control_default.modifiers[orientation], isDisabled && form_control_default.modifiers.disabled, hasStatusIcon && form_control_default.modifiers[validated], className) },
        React135.createElement("textarea", Object.assign({ onChange: this.handleChange, onFocus, onBlur }, typeof this.props.defaultValue !== "string" && { value }, { "aria-invalid": validated === ValidatedOptions.error, required: isRequired, disabled: isDisabled || disabled, readOnly: !!readOnlyVariant, ref: innerRef || this.inputRef }, props)),
        hasStatusIcon && React135.createElement(
          "span",
          { className: css(form_control_default.formControlUtilities) },
          React135.createElement(FormControlIcon, { status: validated })
        )
      );
    }
  };
  TextAreaBase.displayName = "TextArea";
  TextAreaBase.defaultProps = {
    innerRef: React135.createRef(),
    className: "",
    isRequired: false,
    isDisabled: false,
    validated: "default",
    resizeOrientation: "both",
    "aria-label": null
  };
  var TextArea = React135.forwardRef((props, ref) => React135.createElement(TextAreaBase, Object.assign({}, props, { innerRef: ref })));
  TextArea.displayName = "TextArea";

  // node_modules/@patternfly/react-core/dist/esm/helpers/fileUtils.js
  var fileReaderType;
  (function(fileReaderType2) {
    fileReaderType2["text"] = "text";
    fileReaderType2["dataURL"] = "dataURL";
  })(fileReaderType || (fileReaderType = {}));
  function readFile(fileHandle, type) {
    return new Promise((resolve, reject) => {
      const reader = new FileReader();
      reader.onload = () => resolve(reader.result);
      reader.onerror = () => reject(reader.error);
      if (type === fileReaderType.text) {
        reader.readAsText(fileHandle);
      } else if (type === fileReaderType.dataURL) {
        reader.readAsDataURL(fileHandle);
      } else {
        reject("unknown type");
      }
    });
  }

  // node_modules/@patternfly/react-core/dist/esm/components/FileUpload/FileUploadField.js
  var FileUploadField = (_a) => {
    var { id, name: name2, type, value = "", filename = "", onBrowseButtonClick = () => {
    }, onClearButtonClick = () => {
    }, onTextAreaClick, onTextChange, onTextAreaBlur, textAreaPlaceholder = "", className = "", isDisabled = false, isReadOnly = false, isLoading = false, spinnerAriaValueText, isRequired = false, isDragActive = false, validated = "default", "aria-label": ariaLabel = "File upload", filenamePlaceholder = "Drag a file here or browse to upload", filenameAriaLabel = filename ? "Read only filename" : filenamePlaceholder, browseButtonText = "Browse...", clearButtonText = "Clear", isClearButtonDisabled = !filename && !value, containerRef = null, allowEditingUploadedText = false, hideDefaultPreview = false, children = null } = _a, props = __rest(_a, ["id", "name", "type", "value", "filename", "onBrowseButtonClick", "onClearButtonClick", "onTextAreaClick", "onTextChange", "onTextAreaBlur", "textAreaPlaceholder", "className", "isDisabled", "isReadOnly", "isLoading", "spinnerAriaValueText", "isRequired", "isDragActive", "validated", "aria-label", "filenamePlaceholder", "filenameAriaLabel", "browseButtonText", "clearButtonText", "isClearButtonDisabled", "containerRef", "allowEditingUploadedText", "hideDefaultPreview", "children"]);
    const onTextAreaChange = (event, newValue) => {
      onTextChange === null || onTextChange === void 0 ? void 0 : onTextChange(event, newValue);
    };
    return React136.createElement(
      "div",
      Object.assign({ className: css(file_upload_default.fileUpload, isDragActive && file_upload_default.modifiers.dragHover, isLoading && file_upload_default.modifiers.loading, className), ref: containerRef }, props),
      React136.createElement(
        "div",
        { className: file_upload_default.fileUploadFileSelect },
        React136.createElement(
          InputGroup,
          null,
          React136.createElement(
            InputGroupItem,
            { isFill: true },
            React136.createElement(TextInput, {
              readOnlyVariant: "default",
              isDisabled,
              id: `${id}-filename`,
              name: name2 || `${id}-filename`,
              "aria-label": filenameAriaLabel,
              placeholder: filenamePlaceholder,
              "aria-describedby": `${id}-browse-button`,
              value: filename
            })
          ),
          React136.createElement(
            InputGroupItem,
            null,
            React136.createElement(Button, { id: `${id}-browse-button`, variant: ButtonVariant.control, onClick: onBrowseButtonClick, isDisabled }, browseButtonText)
          ),
          React136.createElement(
            InputGroupItem,
            null,
            React136.createElement(Button, { variant: ButtonVariant.control, isDisabled: isDisabled || isClearButtonDisabled, onClick: onClearButtonClick }, clearButtonText)
          )
        )
      ),
      React136.createElement(
        "div",
        { className: file_upload_default.fileUploadFileDetails },
        !hideDefaultPreview && type === fileReaderType.text && React136.createElement(TextArea, { readOnly: isReadOnly || !!filename && !allowEditingUploadedText, disabled: isDisabled, isRequired, resizeOrientation: TextAreResizeOrientation.vertical, validated, id, "aria-label": ariaLabel, value, onChange: onTextAreaChange, onClick: onTextAreaClick, onBlur: onTextAreaBlur, placeholder: textAreaPlaceholder }),
        isLoading && React136.createElement(
          "div",
          { className: file_upload_default.fileUploadFileDetailsSpinner },
          React136.createElement(Spinner, { size: spinnerSize.lg, "aria-valuetext": spinnerAriaValueText })
        )
      ),
      children
    );
  };
  FileUploadField.displayName = "FileUploadField";

  // node_modules/@patternfly/react-core/dist/esm/components/FileUpload/FileUpload.js
  init_tslib_es6();
  var React138 = __toESM(require_react());

  // node_modules/react-dropzone/dist/es/index.js
  var import_react13 = __toESM(require_react(), 1);
  var import_prop_types = __toESM(require_prop_types(), 1);

  // node_modules/file-selector/dist/es2015/file-selector.js
  init_tslib_es6();

  // node_modules/file-selector/dist/es2015/file.js
  var COMMON_MIME_TYPES = /* @__PURE__ */ new Map([
    // https://github.com/guzzle/psr7/blob/2d9260799e713f1c475d3c5fdc3d6561ff7441b2/src/MimeType.php
    ["1km", "application/vnd.1000minds.decision-model+xml"],
    ["3dml", "text/vnd.in3d.3dml"],
    ["3ds", "image/x-3ds"],
    ["3g2", "video/3gpp2"],
    ["3gp", "video/3gp"],
    ["3gpp", "video/3gpp"],
    ["3mf", "model/3mf"],
    ["7z", "application/x-7z-compressed"],
    ["7zip", "application/x-7z-compressed"],
    ["123", "application/vnd.lotus-1-2-3"],
    ["aab", "application/x-authorware-bin"],
    ["aac", "audio/x-acc"],
    ["aam", "application/x-authorware-map"],
    ["aas", "application/x-authorware-seg"],
    ["abw", "application/x-abiword"],
    ["ac", "application/vnd.nokia.n-gage.ac+xml"],
    ["ac3", "audio/ac3"],
    ["acc", "application/vnd.americandynamics.acc"],
    ["ace", "application/x-ace-compressed"],
    ["acu", "application/vnd.acucobol"],
    ["acutc", "application/vnd.acucorp"],
    ["adp", "audio/adpcm"],
    ["aep", "application/vnd.audiograph"],
    ["afm", "application/x-font-type1"],
    ["afp", "application/vnd.ibm.modcap"],
    ["ahead", "application/vnd.ahead.space"],
    ["ai", "application/pdf"],
    ["aif", "audio/x-aiff"],
    ["aifc", "audio/x-aiff"],
    ["aiff", "audio/x-aiff"],
    ["air", "application/vnd.adobe.air-application-installer-package+zip"],
    ["ait", "application/vnd.dvb.ait"],
    ["ami", "application/vnd.amiga.ami"],
    ["amr", "audio/amr"],
    ["apk", "application/vnd.android.package-archive"],
    ["apng", "image/apng"],
    ["appcache", "text/cache-manifest"],
    ["application", "application/x-ms-application"],
    ["apr", "application/vnd.lotus-approach"],
    ["arc", "application/x-freearc"],
    ["arj", "application/x-arj"],
    ["asc", "application/pgp-signature"],
    ["asf", "video/x-ms-asf"],
    ["asm", "text/x-asm"],
    ["aso", "application/vnd.accpac.simply.aso"],
    ["asx", "video/x-ms-asf"],
    ["atc", "application/vnd.acucorp"],
    ["atom", "application/atom+xml"],
    ["atomcat", "application/atomcat+xml"],
    ["atomdeleted", "application/atomdeleted+xml"],
    ["atomsvc", "application/atomsvc+xml"],
    ["atx", "application/vnd.antix.game-component"],
    ["au", "audio/x-au"],
    ["avi", "video/x-msvideo"],
    ["avif", "image/avif"],
    ["aw", "application/applixware"],
    ["azf", "application/vnd.airzip.filesecure.azf"],
    ["azs", "application/vnd.airzip.filesecure.azs"],
    ["azv", "image/vnd.airzip.accelerator.azv"],
    ["azw", "application/vnd.amazon.ebook"],
    ["b16", "image/vnd.pco.b16"],
    ["bat", "application/x-msdownload"],
    ["bcpio", "application/x-bcpio"],
    ["bdf", "application/x-font-bdf"],
    ["bdm", "application/vnd.syncml.dm+wbxml"],
    ["bdoc", "application/x-bdoc"],
    ["bed", "application/vnd.realvnc.bed"],
    ["bh2", "application/vnd.fujitsu.oasysprs"],
    ["bin", "application/octet-stream"],
    ["blb", "application/x-blorb"],
    ["blorb", "application/x-blorb"],
    ["bmi", "application/vnd.bmi"],
    ["bmml", "application/vnd.balsamiq.bmml+xml"],
    ["bmp", "image/bmp"],
    ["book", "application/vnd.framemaker"],
    ["box", "application/vnd.previewsystems.box"],
    ["boz", "application/x-bzip2"],
    ["bpk", "application/octet-stream"],
    ["bpmn", "application/octet-stream"],
    ["bsp", "model/vnd.valve.source.compiled-map"],
    ["btif", "image/prs.btif"],
    ["buffer", "application/octet-stream"],
    ["bz", "application/x-bzip"],
    ["bz2", "application/x-bzip2"],
    ["c", "text/x-c"],
    ["c4d", "application/vnd.clonk.c4group"],
    ["c4f", "application/vnd.clonk.c4group"],
    ["c4g", "application/vnd.clonk.c4group"],
    ["c4p", "application/vnd.clonk.c4group"],
    ["c4u", "application/vnd.clonk.c4group"],
    ["c11amc", "application/vnd.cluetrust.cartomobile-config"],
    ["c11amz", "application/vnd.cluetrust.cartomobile-config-pkg"],
    ["cab", "application/vnd.ms-cab-compressed"],
    ["caf", "audio/x-caf"],
    ["cap", "application/vnd.tcpdump.pcap"],
    ["car", "application/vnd.curl.car"],
    ["cat", "application/vnd.ms-pki.seccat"],
    ["cb7", "application/x-cbr"],
    ["cba", "application/x-cbr"],
    ["cbr", "application/x-cbr"],
    ["cbt", "application/x-cbr"],
    ["cbz", "application/x-cbr"],
    ["cc", "text/x-c"],
    ["cco", "application/x-cocoa"],
    ["cct", "application/x-director"],
    ["ccxml", "application/ccxml+xml"],
    ["cdbcmsg", "application/vnd.contact.cmsg"],
    ["cda", "application/x-cdf"],
    ["cdf", "application/x-netcdf"],
    ["cdfx", "application/cdfx+xml"],
    ["cdkey", "application/vnd.mediastation.cdkey"],
    ["cdmia", "application/cdmi-capability"],
    ["cdmic", "application/cdmi-container"],
    ["cdmid", "application/cdmi-domain"],
    ["cdmio", "application/cdmi-object"],
    ["cdmiq", "application/cdmi-queue"],
    ["cdr", "application/cdr"],
    ["cdx", "chemical/x-cdx"],
    ["cdxml", "application/vnd.chemdraw+xml"],
    ["cdy", "application/vnd.cinderella"],
    ["cer", "application/pkix-cert"],
    ["cfs", "application/x-cfs-compressed"],
    ["cgm", "image/cgm"],
    ["chat", "application/x-chat"],
    ["chm", "application/vnd.ms-htmlhelp"],
    ["chrt", "application/vnd.kde.kchart"],
    ["cif", "chemical/x-cif"],
    ["cii", "application/vnd.anser-web-certificate-issue-initiation"],
    ["cil", "application/vnd.ms-artgalry"],
    ["cjs", "application/node"],
    ["cla", "application/vnd.claymore"],
    ["class", "application/octet-stream"],
    ["clkk", "application/vnd.crick.clicker.keyboard"],
    ["clkp", "application/vnd.crick.clicker.palette"],
    ["clkt", "application/vnd.crick.clicker.template"],
    ["clkw", "application/vnd.crick.clicker.wordbank"],
    ["clkx", "application/vnd.crick.clicker"],
    ["clp", "application/x-msclip"],
    ["cmc", "application/vnd.cosmocaller"],
    ["cmdf", "chemical/x-cmdf"],
    ["cml", "chemical/x-cml"],
    ["cmp", "application/vnd.yellowriver-custom-menu"],
    ["cmx", "image/x-cmx"],
    ["cod", "application/vnd.rim.cod"],
    ["coffee", "text/coffeescript"],
    ["com", "application/x-msdownload"],
    ["conf", "text/plain"],
    ["cpio", "application/x-cpio"],
    ["cpp", "text/x-c"],
    ["cpt", "application/mac-compactpro"],
    ["crd", "application/x-mscardfile"],
    ["crl", "application/pkix-crl"],
    ["crt", "application/x-x509-ca-cert"],
    ["crx", "application/x-chrome-extension"],
    ["cryptonote", "application/vnd.rig.cryptonote"],
    ["csh", "application/x-csh"],
    ["csl", "application/vnd.citationstyles.style+xml"],
    ["csml", "chemical/x-csml"],
    ["csp", "application/vnd.commonspace"],
    ["csr", "application/octet-stream"],
    ["css", "text/css"],
    ["cst", "application/x-director"],
    ["csv", "text/csv"],
    ["cu", "application/cu-seeme"],
    ["curl", "text/vnd.curl"],
    ["cww", "application/prs.cww"],
    ["cxt", "application/x-director"],
    ["cxx", "text/x-c"],
    ["dae", "model/vnd.collada+xml"],
    ["daf", "application/vnd.mobius.daf"],
    ["dart", "application/vnd.dart"],
    ["dataless", "application/vnd.fdsn.seed"],
    ["davmount", "application/davmount+xml"],
    ["dbf", "application/vnd.dbf"],
    ["dbk", "application/docbook+xml"],
    ["dcr", "application/x-director"],
    ["dcurl", "text/vnd.curl.dcurl"],
    ["dd2", "application/vnd.oma.dd2+xml"],
    ["ddd", "application/vnd.fujixerox.ddd"],
    ["ddf", "application/vnd.syncml.dmddf+xml"],
    ["dds", "image/vnd.ms-dds"],
    ["deb", "application/x-debian-package"],
    ["def", "text/plain"],
    ["deploy", "application/octet-stream"],
    ["der", "application/x-x509-ca-cert"],
    ["dfac", "application/vnd.dreamfactory"],
    ["dgc", "application/x-dgc-compressed"],
    ["dic", "text/x-c"],
    ["dir", "application/x-director"],
    ["dis", "application/vnd.mobius.dis"],
    ["disposition-notification", "message/disposition-notification"],
    ["dist", "application/octet-stream"],
    ["distz", "application/octet-stream"],
    ["djv", "image/vnd.djvu"],
    ["djvu", "image/vnd.djvu"],
    ["dll", "application/octet-stream"],
    ["dmg", "application/x-apple-diskimage"],
    ["dmn", "application/octet-stream"],
    ["dmp", "application/vnd.tcpdump.pcap"],
    ["dms", "application/octet-stream"],
    ["dna", "application/vnd.dna"],
    ["doc", "application/msword"],
    ["docm", "application/vnd.ms-word.template.macroEnabled.12"],
    ["docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
    ["dot", "application/msword"],
    ["dotm", "application/vnd.ms-word.template.macroEnabled.12"],
    ["dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template"],
    ["dp", "application/vnd.osgi.dp"],
    ["dpg", "application/vnd.dpgraph"],
    ["dra", "audio/vnd.dra"],
    ["drle", "image/dicom-rle"],
    ["dsc", "text/prs.lines.tag"],
    ["dssc", "application/dssc+der"],
    ["dtb", "application/x-dtbook+xml"],
    ["dtd", "application/xml-dtd"],
    ["dts", "audio/vnd.dts"],
    ["dtshd", "audio/vnd.dts.hd"],
    ["dump", "application/octet-stream"],
    ["dvb", "video/vnd.dvb.file"],
    ["dvi", "application/x-dvi"],
    ["dwd", "application/atsc-dwd+xml"],
    ["dwf", "model/vnd.dwf"],
    ["dwg", "image/vnd.dwg"],
    ["dxf", "image/vnd.dxf"],
    ["dxp", "application/vnd.spotfire.dxp"],
    ["dxr", "application/x-director"],
    ["ear", "application/java-archive"],
    ["ecelp4800", "audio/vnd.nuera.ecelp4800"],
    ["ecelp7470", "audio/vnd.nuera.ecelp7470"],
    ["ecelp9600", "audio/vnd.nuera.ecelp9600"],
    ["ecma", "application/ecmascript"],
    ["edm", "application/vnd.novadigm.edm"],
    ["edx", "application/vnd.novadigm.edx"],
    ["efif", "application/vnd.picsel"],
    ["ei6", "application/vnd.pg.osasli"],
    ["elc", "application/octet-stream"],
    ["emf", "image/emf"],
    ["eml", "message/rfc822"],
    ["emma", "application/emma+xml"],
    ["emotionml", "application/emotionml+xml"],
    ["emz", "application/x-msmetafile"],
    ["eol", "audio/vnd.digital-winds"],
    ["eot", "application/vnd.ms-fontobject"],
    ["eps", "application/postscript"],
    ["epub", "application/epub+zip"],
    ["es", "application/ecmascript"],
    ["es3", "application/vnd.eszigno3+xml"],
    ["esa", "application/vnd.osgi.subsystem"],
    ["esf", "application/vnd.epson.esf"],
    ["et3", "application/vnd.eszigno3+xml"],
    ["etx", "text/x-setext"],
    ["eva", "application/x-eva"],
    ["evy", "application/x-envoy"],
    ["exe", "application/octet-stream"],
    ["exi", "application/exi"],
    ["exp", "application/express"],
    ["exr", "image/aces"],
    ["ext", "application/vnd.novadigm.ext"],
    ["ez", "application/andrew-inset"],
    ["ez2", "application/vnd.ezpix-album"],
    ["ez3", "application/vnd.ezpix-package"],
    ["f", "text/x-fortran"],
    ["f4v", "video/mp4"],
    ["f77", "text/x-fortran"],
    ["f90", "text/x-fortran"],
    ["fbs", "image/vnd.fastbidsheet"],
    ["fcdt", "application/vnd.adobe.formscentral.fcdt"],
    ["fcs", "application/vnd.isac.fcs"],
    ["fdf", "application/vnd.fdf"],
    ["fdt", "application/fdt+xml"],
    ["fe_launch", "application/vnd.denovo.fcselayout-link"],
    ["fg5", "application/vnd.fujitsu.oasysgp"],
    ["fgd", "application/x-director"],
    ["fh", "image/x-freehand"],
    ["fh4", "image/x-freehand"],
    ["fh5", "image/x-freehand"],
    ["fh7", "image/x-freehand"],
    ["fhc", "image/x-freehand"],
    ["fig", "application/x-xfig"],
    ["fits", "image/fits"],
    ["flac", "audio/x-flac"],
    ["fli", "video/x-fli"],
    ["flo", "application/vnd.micrografx.flo"],
    ["flv", "video/x-flv"],
    ["flw", "application/vnd.kde.kivio"],
    ["flx", "text/vnd.fmi.flexstor"],
    ["fly", "text/vnd.fly"],
    ["fm", "application/vnd.framemaker"],
    ["fnc", "application/vnd.frogans.fnc"],
    ["fo", "application/vnd.software602.filler.form+xml"],
    ["for", "text/x-fortran"],
    ["fpx", "image/vnd.fpx"],
    ["frame", "application/vnd.framemaker"],
    ["fsc", "application/vnd.fsc.weblaunch"],
    ["fst", "image/vnd.fst"],
    ["ftc", "application/vnd.fluxtime.clip"],
    ["fti", "application/vnd.anser-web-funds-transfer-initiation"],
    ["fvt", "video/vnd.fvt"],
    ["fxp", "application/vnd.adobe.fxp"],
    ["fxpl", "application/vnd.adobe.fxp"],
    ["fzs", "application/vnd.fuzzysheet"],
    ["g2w", "application/vnd.geoplan"],
    ["g3", "image/g3fax"],
    ["g3w", "application/vnd.geospace"],
    ["gac", "application/vnd.groove-account"],
    ["gam", "application/x-tads"],
    ["gbr", "application/rpki-ghostbusters"],
    ["gca", "application/x-gca-compressed"],
    ["gdl", "model/vnd.gdl"],
    ["gdoc", "application/vnd.google-apps.document"],
    ["geo", "application/vnd.dynageo"],
    ["geojson", "application/geo+json"],
    ["gex", "application/vnd.geometry-explorer"],
    ["ggb", "application/vnd.geogebra.file"],
    ["ggt", "application/vnd.geogebra.tool"],
    ["ghf", "application/vnd.groove-help"],
    ["gif", "image/gif"],
    ["gim", "application/vnd.groove-identity-message"],
    ["glb", "model/gltf-binary"],
    ["gltf", "model/gltf+json"],
    ["gml", "application/gml+xml"],
    ["gmx", "application/vnd.gmx"],
    ["gnumeric", "application/x-gnumeric"],
    ["gpg", "application/gpg-keys"],
    ["gph", "application/vnd.flographit"],
    ["gpx", "application/gpx+xml"],
    ["gqf", "application/vnd.grafeq"],
    ["gqs", "application/vnd.grafeq"],
    ["gram", "application/srgs"],
    ["gramps", "application/x-gramps-xml"],
    ["gre", "application/vnd.geometry-explorer"],
    ["grv", "application/vnd.groove-injector"],
    ["grxml", "application/srgs+xml"],
    ["gsf", "application/x-font-ghostscript"],
    ["gsheet", "application/vnd.google-apps.spreadsheet"],
    ["gslides", "application/vnd.google-apps.presentation"],
    ["gtar", "application/x-gtar"],
    ["gtm", "application/vnd.groove-tool-message"],
    ["gtw", "model/vnd.gtw"],
    ["gv", "text/vnd.graphviz"],
    ["gxf", "application/gxf"],
    ["gxt", "application/vnd.geonext"],
    ["gz", "application/gzip"],
    ["gzip", "application/gzip"],
    ["h", "text/x-c"],
    ["h261", "video/h261"],
    ["h263", "video/h263"],
    ["h264", "video/h264"],
    ["hal", "application/vnd.hal+xml"],
    ["hbci", "application/vnd.hbci"],
    ["hbs", "text/x-handlebars-template"],
    ["hdd", "application/x-virtualbox-hdd"],
    ["hdf", "application/x-hdf"],
    ["heic", "image/heic"],
    ["heics", "image/heic-sequence"],
    ["heif", "image/heif"],
    ["heifs", "image/heif-sequence"],
    ["hej2", "image/hej2k"],
    ["held", "application/atsc-held+xml"],
    ["hh", "text/x-c"],
    ["hjson", "application/hjson"],
    ["hlp", "application/winhlp"],
    ["hpgl", "application/vnd.hp-hpgl"],
    ["hpid", "application/vnd.hp-hpid"],
    ["hps", "application/vnd.hp-hps"],
    ["hqx", "application/mac-binhex40"],
    ["hsj2", "image/hsj2"],
    ["htc", "text/x-component"],
    ["htke", "application/vnd.kenameaapp"],
    ["htm", "text/html"],
    ["html", "text/html"],
    ["hvd", "application/vnd.yamaha.hv-dic"],
    ["hvp", "application/vnd.yamaha.hv-voice"],
    ["hvs", "application/vnd.yamaha.hv-script"],
    ["i2g", "application/vnd.intergeo"],
    ["icc", "application/vnd.iccprofile"],
    ["ice", "x-conference/x-cooltalk"],
    ["icm", "application/vnd.iccprofile"],
    ["ico", "image/x-icon"],
    ["ics", "text/calendar"],
    ["ief", "image/ief"],
    ["ifb", "text/calendar"],
    ["ifm", "application/vnd.shana.informed.formdata"],
    ["iges", "model/iges"],
    ["igl", "application/vnd.igloader"],
    ["igm", "application/vnd.insors.igm"],
    ["igs", "model/iges"],
    ["igx", "application/vnd.micrografx.igx"],
    ["iif", "application/vnd.shana.informed.interchange"],
    ["img", "application/octet-stream"],
    ["imp", "application/vnd.accpac.simply.imp"],
    ["ims", "application/vnd.ms-ims"],
    ["in", "text/plain"],
    ["ini", "text/plain"],
    ["ink", "application/inkml+xml"],
    ["inkml", "application/inkml+xml"],
    ["install", "application/x-install-instructions"],
    ["iota", "application/vnd.astraea-software.iota"],
    ["ipfix", "application/ipfix"],
    ["ipk", "application/vnd.shana.informed.package"],
    ["irm", "application/vnd.ibm.rights-management"],
    ["irp", "application/vnd.irepository.package+xml"],
    ["iso", "application/x-iso9660-image"],
    ["itp", "application/vnd.shana.informed.formtemplate"],
    ["its", "application/its+xml"],
    ["ivp", "application/vnd.immervision-ivp"],
    ["ivu", "application/vnd.immervision-ivu"],
    ["jad", "text/vnd.sun.j2me.app-descriptor"],
    ["jade", "text/jade"],
    ["jam", "application/vnd.jam"],
    ["jar", "application/java-archive"],
    ["jardiff", "application/x-java-archive-diff"],
    ["java", "text/x-java-source"],
    ["jhc", "image/jphc"],
    ["jisp", "application/vnd.jisp"],
    ["jls", "image/jls"],
    ["jlt", "application/vnd.hp-jlyt"],
    ["jng", "image/x-jng"],
    ["jnlp", "application/x-java-jnlp-file"],
    ["joda", "application/vnd.joost.joda-archive"],
    ["jp2", "image/jp2"],
    ["jpe", "image/jpeg"],
    ["jpeg", "image/jpeg"],
    ["jpf", "image/jpx"],
    ["jpg", "image/jpeg"],
    ["jpg2", "image/jp2"],
    ["jpgm", "video/jpm"],
    ["jpgv", "video/jpeg"],
    ["jph", "image/jph"],
    ["jpm", "video/jpm"],
    ["jpx", "image/jpx"],
    ["js", "application/javascript"],
    ["json", "application/json"],
    ["json5", "application/json5"],
    ["jsonld", "application/ld+json"],
    // https://jsonlines.org/
    ["jsonl", "application/jsonl"],
    ["jsonml", "application/jsonml+json"],
    ["jsx", "text/jsx"],
    ["jxr", "image/jxr"],
    ["jxra", "image/jxra"],
    ["jxrs", "image/jxrs"],
    ["jxs", "image/jxs"],
    ["jxsc", "image/jxsc"],
    ["jxsi", "image/jxsi"],
    ["jxss", "image/jxss"],
    ["kar", "audio/midi"],
    ["karbon", "application/vnd.kde.karbon"],
    ["kdb", "application/octet-stream"],
    ["kdbx", "application/x-keepass2"],
    ["key", "application/x-iwork-keynote-sffkey"],
    ["kfo", "application/vnd.kde.kformula"],
    ["kia", "application/vnd.kidspiration"],
    ["kml", "application/vnd.google-earth.kml+xml"],
    ["kmz", "application/vnd.google-earth.kmz"],
    ["kne", "application/vnd.kinar"],
    ["knp", "application/vnd.kinar"],
    ["kon", "application/vnd.kde.kontour"],
    ["kpr", "application/vnd.kde.kpresenter"],
    ["kpt", "application/vnd.kde.kpresenter"],
    ["kpxx", "application/vnd.ds-keypoint"],
    ["ksp", "application/vnd.kde.kspread"],
    ["ktr", "application/vnd.kahootz"],
    ["ktx", "image/ktx"],
    ["ktx2", "image/ktx2"],
    ["ktz", "application/vnd.kahootz"],
    ["kwd", "application/vnd.kde.kword"],
    ["kwt", "application/vnd.kde.kword"],
    ["lasxml", "application/vnd.las.las+xml"],
    ["latex", "application/x-latex"],
    ["lbd", "application/vnd.llamagraphics.life-balance.desktop"],
    ["lbe", "application/vnd.llamagraphics.life-balance.exchange+xml"],
    ["les", "application/vnd.hhe.lesson-player"],
    ["less", "text/less"],
    ["lgr", "application/lgr+xml"],
    ["lha", "application/octet-stream"],
    ["link66", "application/vnd.route66.link66+xml"],
    ["list", "text/plain"],
    ["list3820", "application/vnd.ibm.modcap"],
    ["listafp", "application/vnd.ibm.modcap"],
    ["litcoffee", "text/coffeescript"],
    ["lnk", "application/x-ms-shortcut"],
    ["log", "text/plain"],
    ["lostxml", "application/lost+xml"],
    ["lrf", "application/octet-stream"],
    ["lrm", "application/vnd.ms-lrm"],
    ["ltf", "application/vnd.frogans.ltf"],
    ["lua", "text/x-lua"],
    ["luac", "application/x-lua-bytecode"],
    ["lvp", "audio/vnd.lucent.voice"],
    ["lwp", "application/vnd.lotus-wordpro"],
    ["lzh", "application/octet-stream"],
    ["m1v", "video/mpeg"],
    ["m2a", "audio/mpeg"],
    ["m2v", "video/mpeg"],
    ["m3a", "audio/mpeg"],
    ["m3u", "text/plain"],
    ["m3u8", "application/vnd.apple.mpegurl"],
    ["m4a", "audio/x-m4a"],
    ["m4p", "application/mp4"],
    ["m4s", "video/iso.segment"],
    ["m4u", "application/vnd.mpegurl"],
    ["m4v", "video/x-m4v"],
    ["m13", "application/x-msmediaview"],
    ["m14", "application/x-msmediaview"],
    ["m21", "application/mp21"],
    ["ma", "application/mathematica"],
    ["mads", "application/mads+xml"],
    ["maei", "application/mmt-aei+xml"],
    ["mag", "application/vnd.ecowin.chart"],
    ["maker", "application/vnd.framemaker"],
    ["man", "text/troff"],
    ["manifest", "text/cache-manifest"],
    ["map", "application/json"],
    ["mar", "application/octet-stream"],
    ["markdown", "text/markdown"],
    ["mathml", "application/mathml+xml"],
    ["mb", "application/mathematica"],
    ["mbk", "application/vnd.mobius.mbk"],
    ["mbox", "application/mbox"],
    ["mc1", "application/vnd.medcalcdata"],
    ["mcd", "application/vnd.mcd"],
    ["mcurl", "text/vnd.curl.mcurl"],
    ["md", "text/markdown"],
    ["mdb", "application/x-msaccess"],
    ["mdi", "image/vnd.ms-modi"],
    ["mdx", "text/mdx"],
    ["me", "text/troff"],
    ["mesh", "model/mesh"],
    ["meta4", "application/metalink4+xml"],
    ["metalink", "application/metalink+xml"],
    ["mets", "application/mets+xml"],
    ["mfm", "application/vnd.mfmp"],
    ["mft", "application/rpki-manifest"],
    ["mgp", "application/vnd.osgeo.mapguide.package"],
    ["mgz", "application/vnd.proteus.magazine"],
    ["mid", "audio/midi"],
    ["midi", "audio/midi"],
    ["mie", "application/x-mie"],
    ["mif", "application/vnd.mif"],
    ["mime", "message/rfc822"],
    ["mj2", "video/mj2"],
    ["mjp2", "video/mj2"],
    ["mjs", "application/javascript"],
    ["mk3d", "video/x-matroska"],
    ["mka", "audio/x-matroska"],
    ["mkd", "text/x-markdown"],
    ["mks", "video/x-matroska"],
    ["mkv", "video/x-matroska"],
    ["mlp", "application/vnd.dolby.mlp"],
    ["mmd", "application/vnd.chipnuts.karaoke-mmd"],
    ["mmf", "application/vnd.smaf"],
    ["mml", "text/mathml"],
    ["mmr", "image/vnd.fujixerox.edmics-mmr"],
    ["mng", "video/x-mng"],
    ["mny", "application/x-msmoney"],
    ["mobi", "application/x-mobipocket-ebook"],
    ["mods", "application/mods+xml"],
    ["mov", "video/quicktime"],
    ["movie", "video/x-sgi-movie"],
    ["mp2", "audio/mpeg"],
    ["mp2a", "audio/mpeg"],
    ["mp3", "audio/mpeg"],
    ["mp4", "video/mp4"],
    ["mp4a", "audio/mp4"],
    ["mp4s", "application/mp4"],
    ["mp4v", "video/mp4"],
    ["mp21", "application/mp21"],
    ["mpc", "application/vnd.mophun.certificate"],
    ["mpd", "application/dash+xml"],
    ["mpe", "video/mpeg"],
    ["mpeg", "video/mpeg"],
    ["mpg", "video/mpeg"],
    ["mpg4", "video/mp4"],
    ["mpga", "audio/mpeg"],
    ["mpkg", "application/vnd.apple.installer+xml"],
    ["mpm", "application/vnd.blueice.multipass"],
    ["mpn", "application/vnd.mophun.application"],
    ["mpp", "application/vnd.ms-project"],
    ["mpt", "application/vnd.ms-project"],
    ["mpy", "application/vnd.ibm.minipay"],
    ["mqy", "application/vnd.mobius.mqy"],
    ["mrc", "application/marc"],
    ["mrcx", "application/marcxml+xml"],
    ["ms", "text/troff"],
    ["mscml", "application/mediaservercontrol+xml"],
    ["mseed", "application/vnd.fdsn.mseed"],
    ["mseq", "application/vnd.mseq"],
    ["msf", "application/vnd.epson.msf"],
    ["msg", "application/vnd.ms-outlook"],
    ["msh", "model/mesh"],
    ["msi", "application/x-msdownload"],
    ["msl", "application/vnd.mobius.msl"],
    ["msm", "application/octet-stream"],
    ["msp", "application/octet-stream"],
    ["msty", "application/vnd.muvee.style"],
    ["mtl", "model/mtl"],
    ["mts", "model/vnd.mts"],
    ["mus", "application/vnd.musician"],
    ["musd", "application/mmt-usd+xml"],
    ["musicxml", "application/vnd.recordare.musicxml+xml"],
    ["mvb", "application/x-msmediaview"],
    ["mvt", "application/vnd.mapbox-vector-tile"],
    ["mwf", "application/vnd.mfer"],
    ["mxf", "application/mxf"],
    ["mxl", "application/vnd.recordare.musicxml"],
    ["mxmf", "audio/mobile-xmf"],
    ["mxml", "application/xv+xml"],
    ["mxs", "application/vnd.triscape.mxs"],
    ["mxu", "video/vnd.mpegurl"],
    ["n-gage", "application/vnd.nokia.n-gage.symbian.install"],
    ["n3", "text/n3"],
    ["nb", "application/mathematica"],
    ["nbp", "application/vnd.wolfram.player"],
    ["nc", "application/x-netcdf"],
    ["ncx", "application/x-dtbncx+xml"],
    ["nfo", "text/x-nfo"],
    ["ngdat", "application/vnd.nokia.n-gage.data"],
    ["nitf", "application/vnd.nitf"],
    ["nlu", "application/vnd.neurolanguage.nlu"],
    ["nml", "application/vnd.enliven"],
    ["nnd", "application/vnd.noblenet-directory"],
    ["nns", "application/vnd.noblenet-sealer"],
    ["nnw", "application/vnd.noblenet-web"],
    ["npx", "image/vnd.net-fpx"],
    ["nq", "application/n-quads"],
    ["nsc", "application/x-conference"],
    ["nsf", "application/vnd.lotus-notes"],
    ["nt", "application/n-triples"],
    ["ntf", "application/vnd.nitf"],
    ["numbers", "application/x-iwork-numbers-sffnumbers"],
    ["nzb", "application/x-nzb"],
    ["oa2", "application/vnd.fujitsu.oasys2"],
    ["oa3", "application/vnd.fujitsu.oasys3"],
    ["oas", "application/vnd.fujitsu.oasys"],
    ["obd", "application/x-msbinder"],
    ["obgx", "application/vnd.openblox.game+xml"],
    ["obj", "model/obj"],
    ["oda", "application/oda"],
    ["odb", "application/vnd.oasis.opendocument.database"],
    ["odc", "application/vnd.oasis.opendocument.chart"],
    ["odf", "application/vnd.oasis.opendocument.formula"],
    ["odft", "application/vnd.oasis.opendocument.formula-template"],
    ["odg", "application/vnd.oasis.opendocument.graphics"],
    ["odi", "application/vnd.oasis.opendocument.image"],
    ["odm", "application/vnd.oasis.opendocument.text-master"],
    ["odp", "application/vnd.oasis.opendocument.presentation"],
    ["ods", "application/vnd.oasis.opendocument.spreadsheet"],
    ["odt", "application/vnd.oasis.opendocument.text"],
    ["oga", "audio/ogg"],
    ["ogex", "model/vnd.opengex"],
    ["ogg", "audio/ogg"],
    ["ogv", "video/ogg"],
    ["ogx", "application/ogg"],
    ["omdoc", "application/omdoc+xml"],
    ["onepkg", "application/onenote"],
    ["onetmp", "application/onenote"],
    ["onetoc", "application/onenote"],
    ["onetoc2", "application/onenote"],
    ["opf", "application/oebps-package+xml"],
    ["opml", "text/x-opml"],
    ["oprc", "application/vnd.palm"],
    ["opus", "audio/ogg"],
    ["org", "text/x-org"],
    ["osf", "application/vnd.yamaha.openscoreformat"],
    ["osfpvg", "application/vnd.yamaha.openscoreformat.osfpvg+xml"],
    ["osm", "application/vnd.openstreetmap.data+xml"],
    ["otc", "application/vnd.oasis.opendocument.chart-template"],
    ["otf", "font/otf"],
    ["otg", "application/vnd.oasis.opendocument.graphics-template"],
    ["oth", "application/vnd.oasis.opendocument.text-web"],
    ["oti", "application/vnd.oasis.opendocument.image-template"],
    ["otp", "application/vnd.oasis.opendocument.presentation-template"],
    ["ots", "application/vnd.oasis.opendocument.spreadsheet-template"],
    ["ott", "application/vnd.oasis.opendocument.text-template"],
    ["ova", "application/x-virtualbox-ova"],
    ["ovf", "application/x-virtualbox-ovf"],
    ["owl", "application/rdf+xml"],
    ["oxps", "application/oxps"],
    ["oxt", "application/vnd.openofficeorg.extension"],
    ["p", "text/x-pascal"],
    ["p7a", "application/x-pkcs7-signature"],
    ["p7b", "application/x-pkcs7-certificates"],
    ["p7c", "application/pkcs7-mime"],
    ["p7m", "application/pkcs7-mime"],
    ["p7r", "application/x-pkcs7-certreqresp"],
    ["p7s", "application/pkcs7-signature"],
    ["p8", "application/pkcs8"],
    ["p10", "application/x-pkcs10"],
    ["p12", "application/x-pkcs12"],
    ["pac", "application/x-ns-proxy-autoconfig"],
    ["pages", "application/x-iwork-pages-sffpages"],
    ["pas", "text/x-pascal"],
    ["paw", "application/vnd.pawaafile"],
    ["pbd", "application/vnd.powerbuilder6"],
    ["pbm", "image/x-portable-bitmap"],
    ["pcap", "application/vnd.tcpdump.pcap"],
    ["pcf", "application/x-font-pcf"],
    ["pcl", "application/vnd.hp-pcl"],
    ["pclxl", "application/vnd.hp-pclxl"],
    ["pct", "image/x-pict"],
    ["pcurl", "application/vnd.curl.pcurl"],
    ["pcx", "image/x-pcx"],
    ["pdb", "application/x-pilot"],
    ["pde", "text/x-processing"],
    ["pdf", "application/pdf"],
    ["pem", "application/x-x509-user-cert"],
    ["pfa", "application/x-font-type1"],
    ["pfb", "application/x-font-type1"],
    ["pfm", "application/x-font-type1"],
    ["pfr", "application/font-tdpfr"],
    ["pfx", "application/x-pkcs12"],
    ["pgm", "image/x-portable-graymap"],
    ["pgn", "application/x-chess-pgn"],
    ["pgp", "application/pgp"],
    ["php", "application/x-httpd-php"],
    ["php3", "application/x-httpd-php"],
    ["php4", "application/x-httpd-php"],
    ["phps", "application/x-httpd-php-source"],
    ["phtml", "application/x-httpd-php"],
    ["pic", "image/x-pict"],
    ["pkg", "application/octet-stream"],
    ["pki", "application/pkixcmp"],
    ["pkipath", "application/pkix-pkipath"],
    ["pkpass", "application/vnd.apple.pkpass"],
    ["pl", "application/x-perl"],
    ["plb", "application/vnd.3gpp.pic-bw-large"],
    ["plc", "application/vnd.mobius.plc"],
    ["plf", "application/vnd.pocketlearn"],
    ["pls", "application/pls+xml"],
    ["pm", "application/x-perl"],
    ["pml", "application/vnd.ctc-posml"],
    ["png", "image/png"],
    ["pnm", "image/x-portable-anymap"],
    ["portpkg", "application/vnd.macports.portpkg"],
    ["pot", "application/vnd.ms-powerpoint"],
    ["potm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"],
    ["potx", "application/vnd.openxmlformats-officedocument.presentationml.template"],
    ["ppa", "application/vnd.ms-powerpoint"],
    ["ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12"],
    ["ppd", "application/vnd.cups-ppd"],
    ["ppm", "image/x-portable-pixmap"],
    ["pps", "application/vnd.ms-powerpoint"],
    ["ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],
    ["ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow"],
    ["ppt", "application/powerpoint"],
    ["pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"],
    ["pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"],
    ["pqa", "application/vnd.palm"],
    ["prc", "application/x-pilot"],
    ["pre", "application/vnd.lotus-freelance"],
    ["prf", "application/pics-rules"],
    ["provx", "application/provenance+xml"],
    ["ps", "application/postscript"],
    ["psb", "application/vnd.3gpp.pic-bw-small"],
    ["psd", "application/x-photoshop"],
    ["psf", "application/x-font-linux-psf"],
    ["pskcxml", "application/pskc+xml"],
    ["pti", "image/prs.pti"],
    ["ptid", "application/vnd.pvi.ptid1"],
    ["pub", "application/x-mspublisher"],
    ["pvb", "application/vnd.3gpp.pic-bw-var"],
    ["pwn", "application/vnd.3m.post-it-notes"],
    ["pya", "audio/vnd.ms-playready.media.pya"],
    ["pyv", "video/vnd.ms-playready.media.pyv"],
    ["qam", "application/vnd.epson.quickanime"],
    ["qbo", "application/vnd.intu.qbo"],
    ["qfx", "application/vnd.intu.qfx"],
    ["qps", "application/vnd.publishare-delta-tree"],
    ["qt", "video/quicktime"],
    ["qwd", "application/vnd.quark.quarkxpress"],
    ["qwt", "application/vnd.quark.quarkxpress"],
    ["qxb", "application/vnd.quark.quarkxpress"],
    ["qxd", "application/vnd.quark.quarkxpress"],
    ["qxl", "application/vnd.quark.quarkxpress"],
    ["qxt", "application/vnd.quark.quarkxpress"],
    ["ra", "audio/x-realaudio"],
    ["ram", "audio/x-pn-realaudio"],
    ["raml", "application/raml+yaml"],
    ["rapd", "application/route-apd+xml"],
    ["rar", "application/x-rar"],
    ["ras", "image/x-cmu-raster"],
    ["rcprofile", "application/vnd.ipunplugged.rcprofile"],
    ["rdf", "application/rdf+xml"],
    ["rdz", "application/vnd.data-vision.rdz"],
    ["relo", "application/p2p-overlay+xml"],
    ["rep", "application/vnd.businessobjects"],
    ["res", "application/x-dtbresource+xml"],
    ["rgb", "image/x-rgb"],
    ["rif", "application/reginfo+xml"],
    ["rip", "audio/vnd.rip"],
    ["ris", "application/x-research-info-systems"],
    ["rl", "application/resource-lists+xml"],
    ["rlc", "image/vnd.fujixerox.edmics-rlc"],
    ["rld", "application/resource-lists-diff+xml"],
    ["rm", "audio/x-pn-realaudio"],
    ["rmi", "audio/midi"],
    ["rmp", "audio/x-pn-realaudio-plugin"],
    ["rms", "application/vnd.jcp.javame.midlet-rms"],
    ["rmvb", "application/vnd.rn-realmedia-vbr"],
    ["rnc", "application/relax-ng-compact-syntax"],
    ["rng", "application/xml"],
    ["roa", "application/rpki-roa"],
    ["roff", "text/troff"],
    ["rp9", "application/vnd.cloanto.rp9"],
    ["rpm", "audio/x-pn-realaudio-plugin"],
    ["rpss", "application/vnd.nokia.radio-presets"],
    ["rpst", "application/vnd.nokia.radio-preset"],
    ["rq", "application/sparql-query"],
    ["rs", "application/rls-services+xml"],
    ["rsa", "application/x-pkcs7"],
    ["rsat", "application/atsc-rsat+xml"],
    ["rsd", "application/rsd+xml"],
    ["rsheet", "application/urc-ressheet+xml"],
    ["rss", "application/rss+xml"],
    ["rtf", "text/rtf"],
    ["rtx", "text/richtext"],
    ["run", "application/x-makeself"],
    ["rusd", "application/route-usd+xml"],
    ["rv", "video/vnd.rn-realvideo"],
    ["s", "text/x-asm"],
    ["s3m", "audio/s3m"],
    ["saf", "application/vnd.yamaha.smaf-audio"],
    ["sass", "text/x-sass"],
    ["sbml", "application/sbml+xml"],
    ["sc", "application/vnd.ibm.secure-container"],
    ["scd", "application/x-msschedule"],
    ["scm", "application/vnd.lotus-screencam"],
    ["scq", "application/scvp-cv-request"],
    ["scs", "application/scvp-cv-response"],
    ["scss", "text/x-scss"],
    ["scurl", "text/vnd.curl.scurl"],
    ["sda", "application/vnd.stardivision.draw"],
    ["sdc", "application/vnd.stardivision.calc"],
    ["sdd", "application/vnd.stardivision.impress"],
    ["sdkd", "application/vnd.solent.sdkm+xml"],
    ["sdkm", "application/vnd.solent.sdkm+xml"],
    ["sdp", "application/sdp"],
    ["sdw", "application/vnd.stardivision.writer"],
    ["sea", "application/octet-stream"],
    ["see", "application/vnd.seemail"],
    ["seed", "application/vnd.fdsn.seed"],
    ["sema", "application/vnd.sema"],
    ["semd", "application/vnd.semd"],
    ["semf", "application/vnd.semf"],
    ["senmlx", "application/senml+xml"],
    ["sensmlx", "application/sensml+xml"],
    ["ser", "application/java-serialized-object"],
    ["setpay", "application/set-payment-initiation"],
    ["setreg", "application/set-registration-initiation"],
    ["sfd-hdstx", "application/vnd.hydrostatix.sof-data"],
    ["sfs", "application/vnd.spotfire.sfs"],
    ["sfv", "text/x-sfv"],
    ["sgi", "image/sgi"],
    ["sgl", "application/vnd.stardivision.writer-global"],
    ["sgm", "text/sgml"],
    ["sgml", "text/sgml"],
    ["sh", "application/x-sh"],
    ["shar", "application/x-shar"],
    ["shex", "text/shex"],
    ["shf", "application/shf+xml"],
    ["shtml", "text/html"],
    ["sid", "image/x-mrsid-image"],
    ["sieve", "application/sieve"],
    ["sig", "application/pgp-signature"],
    ["sil", "audio/silk"],
    ["silo", "model/mesh"],
    ["sis", "application/vnd.symbian.install"],
    ["sisx", "application/vnd.symbian.install"],
    ["sit", "application/x-stuffit"],
    ["sitx", "application/x-stuffitx"],
    ["siv", "application/sieve"],
    ["skd", "application/vnd.koan"],
    ["skm", "application/vnd.koan"],
    ["skp", "application/vnd.koan"],
    ["skt", "application/vnd.koan"],
    ["sldm", "application/vnd.ms-powerpoint.slide.macroenabled.12"],
    ["sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide"],
    ["slim", "text/slim"],
    ["slm", "text/slim"],
    ["sls", "application/route-s-tsid+xml"],
    ["slt", "application/vnd.epson.salt"],
    ["sm", "application/vnd.stepmania.stepchart"],
    ["smf", "application/vnd.stardivision.math"],
    ["smi", "application/smil"],
    ["smil", "application/smil"],
    ["smv", "video/x-smv"],
    ["smzip", "application/vnd.stepmania.package"],
    ["snd", "audio/basic"],
    ["snf", "application/x-font-snf"],
    ["so", "application/octet-stream"],
    ["spc", "application/x-pkcs7-certificates"],
    ["spdx", "text/spdx"],
    ["spf", "application/vnd.yamaha.smaf-phrase"],
    ["spl", "application/x-futuresplash"],
    ["spot", "text/vnd.in3d.spot"],
    ["spp", "application/scvp-vp-response"],
    ["spq", "application/scvp-vp-request"],
    ["spx", "audio/ogg"],
    ["sql", "application/x-sql"],
    ["src", "application/x-wais-source"],
    ["srt", "application/x-subrip"],
    ["sru", "application/sru+xml"],
    ["srx", "application/sparql-results+xml"],
    ["ssdl", "application/ssdl+xml"],
    ["sse", "application/vnd.kodak-descriptor"],
    ["ssf", "application/vnd.epson.ssf"],
    ["ssml", "application/ssml+xml"],
    ["sst", "application/octet-stream"],
    ["st", "application/vnd.sailingtracker.track"],
    ["stc", "application/vnd.sun.xml.calc.template"],
    ["std", "application/vnd.sun.xml.draw.template"],
    ["stf", "application/vnd.wt.stf"],
    ["sti", "application/vnd.sun.xml.impress.template"],
    ["stk", "application/hyperstudio"],
    ["stl", "model/stl"],
    ["stpx", "model/step+xml"],
    ["stpxz", "model/step-xml+zip"],
    ["stpz", "model/step+zip"],
    ["str", "application/vnd.pg.format"],
    ["stw", "application/vnd.sun.xml.writer.template"],
    ["styl", "text/stylus"],
    ["stylus", "text/stylus"],
    ["sub", "text/vnd.dvb.subtitle"],
    ["sus", "application/vnd.sus-calendar"],
    ["susp", "application/vnd.sus-calendar"],
    ["sv4cpio", "application/x-sv4cpio"],
    ["sv4crc", "application/x-sv4crc"],
    ["svc", "application/vnd.dvb.service"],
    ["svd", "application/vnd.svd"],
    ["svg", "image/svg+xml"],
    ["svgz", "image/svg+xml"],
    ["swa", "application/x-director"],
    ["swf", "application/x-shockwave-flash"],
    ["swi", "application/vnd.aristanetworks.swi"],
    ["swidtag", "application/swid+xml"],
    ["sxc", "application/vnd.sun.xml.calc"],
    ["sxd", "application/vnd.sun.xml.draw"],
    ["sxg", "application/vnd.sun.xml.writer.global"],
    ["sxi", "application/vnd.sun.xml.impress"],
    ["sxm", "application/vnd.sun.xml.math"],
    ["sxw", "application/vnd.sun.xml.writer"],
    ["t", "text/troff"],
    ["t3", "application/x-t3vm-image"],
    ["t38", "image/t38"],
    ["taglet", "application/vnd.mynfc"],
    ["tao", "application/vnd.tao.intent-module-archive"],
    ["tap", "image/vnd.tencent.tap"],
    ["tar", "application/x-tar"],
    ["tcap", "application/vnd.3gpp2.tcap"],
    ["tcl", "application/x-tcl"],
    ["td", "application/urc-targetdesc+xml"],
    ["teacher", "application/vnd.smart.teacher"],
    ["tei", "application/tei+xml"],
    ["teicorpus", "application/tei+xml"],
    ["tex", "application/x-tex"],
    ["texi", "application/x-texinfo"],
    ["texinfo", "application/x-texinfo"],
    ["text", "text/plain"],
    ["tfi", "application/thraud+xml"],
    ["tfm", "application/x-tex-tfm"],
    ["tfx", "image/tiff-fx"],
    ["tga", "image/x-tga"],
    ["tgz", "application/x-tar"],
    ["thmx", "application/vnd.ms-officetheme"],
    ["tif", "image/tiff"],
    ["tiff", "image/tiff"],
    ["tk", "application/x-tcl"],
    ["tmo", "application/vnd.tmobile-livetv"],
    ["toml", "application/toml"],
    ["torrent", "application/x-bittorrent"],
    ["tpl", "application/vnd.groove-tool-template"],
    ["tpt", "application/vnd.trid.tpt"],
    ["tr", "text/troff"],
    ["tra", "application/vnd.trueapp"],
    ["trig", "application/trig"],
    ["trm", "application/x-msterminal"],
    ["ts", "video/mp2t"],
    ["tsd", "application/timestamped-data"],
    ["tsv", "text/tab-separated-values"],
    ["ttc", "font/collection"],
    ["ttf", "font/ttf"],
    ["ttl", "text/turtle"],
    ["ttml", "application/ttml+xml"],
    ["twd", "application/vnd.simtech-mindmapper"],
    ["twds", "application/vnd.simtech-mindmapper"],
    ["txd", "application/vnd.genomatix.tuxedo"],
    ["txf", "application/vnd.mobius.txf"],
    ["txt", "text/plain"],
    ["u8dsn", "message/global-delivery-status"],
    ["u8hdr", "message/global-headers"],
    ["u8mdn", "message/global-disposition-notification"],
    ["u8msg", "message/global"],
    ["u32", "application/x-authorware-bin"],
    ["ubj", "application/ubjson"],
    ["udeb", "application/x-debian-package"],
    ["ufd", "application/vnd.ufdl"],
    ["ufdl", "application/vnd.ufdl"],
    ["ulx", "application/x-glulx"],
    ["umj", "application/vnd.umajin"],
    ["unityweb", "application/vnd.unity"],
    ["uoml", "application/vnd.uoml+xml"],
    ["uri", "text/uri-list"],
    ["uris", "text/uri-list"],
    ["urls", "text/uri-list"],
    ["usdz", "model/vnd.usdz+zip"],
    ["ustar", "application/x-ustar"],
    ["utz", "application/vnd.uiq.theme"],
    ["uu", "text/x-uuencode"],
    ["uva", "audio/vnd.dece.audio"],
    ["uvd", "application/vnd.dece.data"],
    ["uvf", "application/vnd.dece.data"],
    ["uvg", "image/vnd.dece.graphic"],
    ["uvh", "video/vnd.dece.hd"],
    ["uvi", "image/vnd.dece.graphic"],
    ["uvm", "video/vnd.dece.mobile"],
    ["uvp", "video/vnd.dece.pd"],
    ["uvs", "video/vnd.dece.sd"],
    ["uvt", "application/vnd.dece.ttml+xml"],
    ["uvu", "video/vnd.uvvu.mp4"],
    ["uvv", "video/vnd.dece.video"],
    ["uvva", "audio/vnd.dece.audio"],
    ["uvvd", "application/vnd.dece.data"],
    ["uvvf", "application/vnd.dece.data"],
    ["uvvg", "image/vnd.dece.graphic"],
    ["uvvh", "video/vnd.dece.hd"],
    ["uvvi", "image/vnd.dece.graphic"],
    ["uvvm", "video/vnd.dece.mobile"],
    ["uvvp", "video/vnd.dece.pd"],
    ["uvvs", "video/vnd.dece.sd"],
    ["uvvt", "application/vnd.dece.ttml+xml"],
    ["uvvu", "video/vnd.uvvu.mp4"],
    ["uvvv", "video/vnd.dece.video"],
    ["uvvx", "application/vnd.dece.unspecified"],
    ["uvvz", "application/vnd.dece.zip"],
    ["uvx", "application/vnd.dece.unspecified"],
    ["uvz", "application/vnd.dece.zip"],
    ["vbox", "application/x-virtualbox-vbox"],
    ["vbox-extpack", "application/x-virtualbox-vbox-extpack"],
    ["vcard", "text/vcard"],
    ["vcd", "application/x-cdlink"],
    ["vcf", "text/x-vcard"],
    ["vcg", "application/vnd.groove-vcard"],
    ["vcs", "text/x-vcalendar"],
    ["vcx", "application/vnd.vcx"],
    ["vdi", "application/x-virtualbox-vdi"],
    ["vds", "model/vnd.sap.vds"],
    ["vhd", "application/x-virtualbox-vhd"],
    ["vis", "application/vnd.visionary"],
    ["viv", "video/vnd.vivo"],
    ["vlc", "application/videolan"],
    ["vmdk", "application/x-virtualbox-vmdk"],
    ["vob", "video/x-ms-vob"],
    ["vor", "application/vnd.stardivision.writer"],
    ["vox", "application/x-authorware-bin"],
    ["vrml", "model/vrml"],
    ["vsd", "application/vnd.visio"],
    ["vsf", "application/vnd.vsf"],
    ["vss", "application/vnd.visio"],
    ["vst", "application/vnd.visio"],
    ["vsw", "application/vnd.visio"],
    ["vtf", "image/vnd.valve.source.texture"],
    ["vtt", "text/vtt"],
    ["vtu", "model/vnd.vtu"],
    ["vxml", "application/voicexml+xml"],
    ["w3d", "application/x-director"],
    ["wad", "application/x-doom"],
    ["wadl", "application/vnd.sun.wadl+xml"],
    ["war", "application/java-archive"],
    ["wasm", "application/wasm"],
    ["wav", "audio/x-wav"],
    ["wax", "audio/x-ms-wax"],
    ["wbmp", "image/vnd.wap.wbmp"],
    ["wbs", "application/vnd.criticaltools.wbs+xml"],
    ["wbxml", "application/wbxml"],
    ["wcm", "application/vnd.ms-works"],
    ["wdb", "application/vnd.ms-works"],
    ["wdp", "image/vnd.ms-photo"],
    ["weba", "audio/webm"],
    ["webapp", "application/x-web-app-manifest+json"],
    ["webm", "video/webm"],
    ["webmanifest", "application/manifest+json"],
    ["webp", "image/webp"],
    ["wg", "application/vnd.pmi.widget"],
    ["wgt", "application/widget"],
    ["wks", "application/vnd.ms-works"],
    ["wm", "video/x-ms-wm"],
    ["wma", "audio/x-ms-wma"],
    ["wmd", "application/x-ms-wmd"],
    ["wmf", "image/wmf"],
    ["wml", "text/vnd.wap.wml"],
    ["wmlc", "application/wmlc"],
    ["wmls", "text/vnd.wap.wmlscript"],
    ["wmlsc", "application/vnd.wap.wmlscriptc"],
    ["wmv", "video/x-ms-wmv"],
    ["wmx", "video/x-ms-wmx"],
    ["wmz", "application/x-msmetafile"],
    ["woff", "font/woff"],
    ["woff2", "font/woff2"],
    ["word", "application/msword"],
    ["wpd", "application/vnd.wordperfect"],
    ["wpl", "application/vnd.ms-wpl"],
    ["wps", "application/vnd.ms-works"],
    ["wqd", "application/vnd.wqd"],
    ["wri", "application/x-mswrite"],
    ["wrl", "model/vrml"],
    ["wsc", "message/vnd.wfa.wsc"],
    ["wsdl", "application/wsdl+xml"],
    ["wspolicy", "application/wspolicy+xml"],
    ["wtb", "application/vnd.webturbo"],
    ["wvx", "video/x-ms-wvx"],
    ["x3d", "model/x3d+xml"],
    ["x3db", "model/x3d+fastinfoset"],
    ["x3dbz", "model/x3d+binary"],
    ["x3dv", "model/x3d-vrml"],
    ["x3dvz", "model/x3d+vrml"],
    ["x3dz", "model/x3d+xml"],
    ["x32", "application/x-authorware-bin"],
    ["x_b", "model/vnd.parasolid.transmit.binary"],
    ["x_t", "model/vnd.parasolid.transmit.text"],
    ["xaml", "application/xaml+xml"],
    ["xap", "application/x-silverlight-app"],
    ["xar", "application/vnd.xara"],
    ["xav", "application/xcap-att+xml"],
    ["xbap", "application/x-ms-xbap"],
    ["xbd", "application/vnd.fujixerox.docuworks.binder"],
    ["xbm", "image/x-xbitmap"],
    ["xca", "application/xcap-caps+xml"],
    ["xcs", "application/calendar+xml"],
    ["xdf", "application/xcap-diff+xml"],
    ["xdm", "application/vnd.syncml.dm+xml"],
    ["xdp", "application/vnd.adobe.xdp+xml"],
    ["xdssc", "application/dssc+xml"],
    ["xdw", "application/vnd.fujixerox.docuworks"],
    ["xel", "application/xcap-el+xml"],
    ["xenc", "application/xenc+xml"],
    ["xer", "application/patch-ops-error+xml"],
    ["xfdf", "application/vnd.adobe.xfdf"],
    ["xfdl", "application/vnd.xfdl"],
    ["xht", "application/xhtml+xml"],
    ["xhtml", "application/xhtml+xml"],
    ["xhvml", "application/xv+xml"],
    ["xif", "image/vnd.xiff"],
    ["xl", "application/excel"],
    ["xla", "application/vnd.ms-excel"],
    ["xlam", "application/vnd.ms-excel.addin.macroEnabled.12"],
    ["xlc", "application/vnd.ms-excel"],
    ["xlf", "application/xliff+xml"],
    ["xlm", "application/vnd.ms-excel"],
    ["xls", "application/vnd.ms-excel"],
    ["xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12"],
    ["xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12"],
    ["xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
    ["xlt", "application/vnd.ms-excel"],
    ["xltm", "application/vnd.ms-excel.template.macroEnabled.12"],
    ["xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template"],
    ["xlw", "application/vnd.ms-excel"],
    ["xm", "audio/xm"],
    ["xml", "application/xml"],
    ["xns", "application/xcap-ns+xml"],
    ["xo", "application/vnd.olpc-sugar"],
    ["xop", "application/xop+xml"],
    ["xpi", "application/x-xpinstall"],
    ["xpl", "application/xproc+xml"],
    ["xpm", "image/x-xpixmap"],
    ["xpr", "application/vnd.is-xpr"],
    ["xps", "application/vnd.ms-xpsdocument"],
    ["xpw", "application/vnd.intercon.formnet"],
    ["xpx", "application/vnd.intercon.formnet"],
    ["xsd", "application/xml"],
    ["xsl", "application/xml"],
    ["xslt", "application/xslt+xml"],
    ["xsm", "application/vnd.syncml+xml"],
    ["xspf", "application/xspf+xml"],
    ["xul", "application/vnd.mozilla.xul+xml"],
    ["xvm", "application/xv+xml"],
    ["xvml", "application/xv+xml"],
    ["xwd", "image/x-xwindowdump"],
    ["xyz", "chemical/x-xyz"],
    ["xz", "application/x-xz"],
    ["yaml", "text/yaml"],
    ["yang", "application/yang"],
    ["yin", "application/yin+xml"],
    ["yml", "text/yaml"],
    ["ymp", "text/x-suse-ymp"],
    ["z", "application/x-compress"],
    ["z1", "application/x-zmachine"],
    ["z2", "application/x-zmachine"],
    ["z3", "application/x-zmachine"],
    ["z4", "application/x-zmachine"],
    ["z5", "application/x-zmachine"],
    ["z6", "application/x-zmachine"],
    ["z7", "application/x-zmachine"],
    ["z8", "application/x-zmachine"],
    ["zaz", "application/vnd.zzazz.deck+xml"],
    ["zip", "application/zip"],
    ["zir", "application/vnd.zul"],
    ["zirz", "application/vnd.zul"],
    ["zmm", "application/vnd.handheld-entertainment+xml"],
    ["zsh", "text/x-scriptzsh"]
  ]);
  function toFileWithPath(file, path2, h) {
    const f = withMimeType(file);
    const { webkitRelativePath } = file;
    const p = typeof path2 === "string" ? path2 : typeof webkitRelativePath === "string" && webkitRelativePath.length > 0 ? webkitRelativePath : `./${file.name}`;
    if (typeof f.path !== "string") {
      setObjProp(f, "path", p);
    }
    if (h !== void 0) {
      Object.defineProperty(f, "handle", {
        value: h,
        writable: false,
        configurable: false,
        enumerable: true
      });
    }
    setObjProp(f, "relativePath", p);
    return f;
  }
  function withMimeType(file) {
    const { name: name2 } = file;
    const hasExtension = name2 && name2.lastIndexOf(".") !== -1;
    if (hasExtension && !file.type) {
      const ext = name2.split(".").pop().toLowerCase();
      const type = COMMON_MIME_TYPES.get(ext);
      if (type) {
        Object.defineProperty(file, "type", {
          value: type,
          writable: false,
          configurable: false,
          enumerable: true
        });
      }
    }
    return file;
  }
  function setObjProp(f, key, value) {
    Object.defineProperty(f, key, {
      value,
      writable: false,
      configurable: false,
      enumerable: true
    });
  }

  // node_modules/file-selector/dist/es2015/file-selector.js
  var FILES_TO_IGNORE = [
    // Thumbnail cache files for macOS and Windows
    ".DS_Store",
    // macOs
    "Thumbs.db"
    // Windows
  ];
  function fromEvent(evt) {
    return __awaiter(this, void 0, void 0, function* () {
      if (isObject(evt) && isDataTransfer(evt.dataTransfer)) {
        return getDataTransferFiles(evt.dataTransfer, evt.type);
      } else if (isChangeEvt(evt)) {
        return getInputFiles(evt);
      } else if (Array.isArray(evt) && evt.every((item) => "getFile" in item && typeof item.getFile === "function")) {
        return getFsHandleFiles(evt);
      }
      return [];
    });
  }
  function isDataTransfer(value) {
    return isObject(value);
  }
  function isChangeEvt(value) {
    return isObject(value) && isObject(value.target);
  }
  function isObject(v) {
    return typeof v === "object" && v !== null;
  }
  function getInputFiles(evt) {
    return fromList(evt.target.files).map((file) => toFileWithPath(file));
  }
  function getFsHandleFiles(handles) {
    return __awaiter(this, void 0, void 0, function* () {
      const files = yield Promise.all(handles.map((h) => h.getFile()));
      return files.map((file) => toFileWithPath(file));
    });
  }
  function getDataTransferFiles(dt, type) {
    return __awaiter(this, void 0, void 0, function* () {
      if (dt.items) {
        const items = fromList(dt.items).filter((item) => item.kind === "file");
        if (type !== "drop") {
          return items;
        }
        const files = yield Promise.all(items.map(toFilePromises));
        return noIgnoredFiles(flatten(files));
      }
      return noIgnoredFiles(fromList(dt.files).map((file) => toFileWithPath(file)));
    });
  }
  function noIgnoredFiles(files) {
    return files.filter((file) => FILES_TO_IGNORE.indexOf(file.name) === -1);
  }
  function fromList(items) {
    if (items === null) {
      return [];
    }
    const files = [];
    for (let i = 0; i < items.length; i++) {
      const file = items[i];
      files.push(file);
    }
    return files;
  }
  function toFilePromises(item) {
    if (typeof item.webkitGetAsEntry !== "function") {
      return fromDataTransferItem(item);
    }
    const entry = item.webkitGetAsEntry();
    if (entry && entry.isDirectory) {
      return fromDirEntry(entry);
    }
    return fromDataTransferItem(item, entry);
  }
  function flatten(items) {
    return items.reduce((acc, files) => [
      ...acc,
      ...Array.isArray(files) ? flatten(files) : [files]
    ], []);
  }
  function fromDataTransferItem(item, entry) {
    return __awaiter(this, void 0, void 0, function* () {
      var _a;
      if (globalThis.isSecureContext && typeof item.getAsFileSystemHandle === "function") {
        const h = yield item.getAsFileSystemHandle();
        if (h === null) {
          throw new Error(`${item} is not a File`);
        }
        if (h !== void 0) {
          const file2 = yield h.getFile();
          file2.handle = h;
          return toFileWithPath(file2);
        }
      }
      const file = item.getAsFile();
      if (!file) {
        throw new Error(`${item} is not a File`);
      }
      const fwp = toFileWithPath(file, (_a = entry === null || entry === void 0 ? void 0 : entry.fullPath) !== null && _a !== void 0 ? _a : void 0);
      return fwp;
    });
  }
  function fromEntry(entry) {
    return __awaiter(this, void 0, void 0, function* () {
      return entry.isDirectory ? fromDirEntry(entry) : fromFileEntry(entry);
    });
  }
  function fromDirEntry(entry) {
    const reader = entry.createReader();
    return new Promise((resolve, reject) => {
      const entries = [];
      function readEntries() {
        reader.readEntries((batch) => __awaiter(this, void 0, void 0, function* () {
          if (!batch.length) {
            try {
              const files = yield Promise.all(entries);
              resolve(files);
            } catch (err) {
              reject(err);
            }
          } else {
            const items = Promise.all(batch.map(fromEntry));
            entries.push(items);
            readEntries();
          }
        }), (err) => {
          reject(err);
        });
      }
      readEntries();
    });
  }
  function fromFileEntry(entry) {
    return __awaiter(this, void 0, void 0, function* () {
      return new Promise((resolve, reject) => {
        entry.file((file) => {
          const fwp = toFileWithPath(file, entry.fullPath);
          resolve(fwp);
        }, (err) => {
          reject(err);
        });
      });
    });
  }

  // node_modules/react-dropzone/dist/es/utils/index.js
  var import_attr_accept = __toESM(require_es(), 1);
  function _toConsumableArray(arr) {
    return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  }
  function _nonIterableSpread() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _iterableToArray(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  }
  function _arrayWithoutHoles(arr) {
    if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  }
  function ownKeys3(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys3(Object(source), true).forEach(function(key) {
        _defineProperty2(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys3(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty2(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _slicedToArray(arr, i) {
    return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  }
  function _nonIterableRest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _arrayLikeToArray(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  }
  function _arrayLikeToArray(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function _iterableToArrayLimit(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null) return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
      for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
        _arr.push(_s.value);
        if (i && _arr.length === i) break;
      }
    } catch (err) {
      _d = true;
      _e = err;
    } finally {
      try {
        if (!_n && _i["return"] != null) _i["return"]();
      } finally {
        if (_d) throw _e;
      }
    }
    return _arr;
  }
  function _arrayWithHoles(arr) {
    if (Array.isArray(arr)) return arr;
  }
  var accepts = typeof import_attr_accept.default === "function" ? import_attr_accept.default : import_attr_accept.default.default;
  var FILE_INVALID_TYPE = "file-invalid-type";
  var FILE_TOO_LARGE = "file-too-large";
  var FILE_TOO_SMALL = "file-too-small";
  var TOO_MANY_FILES = "too-many-files";
  var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr2() {
    var accept = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
    var acceptArr = accept.split(",");
    var msg = acceptArr.length > 1 ? "one of ".concat(acceptArr.join(", ")) : acceptArr[0];
    return {
      code: FILE_INVALID_TYPE,
      message: "File type must be ".concat(msg)
    };
  };
  var getTooLargeRejectionErr = function getTooLargeRejectionErr2(maxSize) {
    return {
      code: FILE_TOO_LARGE,
      message: "File is larger than ".concat(maxSize, " ").concat(maxSize === 1 ? "byte" : "bytes")
    };
  };
  var getTooSmallRejectionErr = function getTooSmallRejectionErr2(minSize) {
    return {
      code: FILE_TOO_SMALL,
      message: "File is smaller than ".concat(minSize, " ").concat(minSize === 1 ? "byte" : "bytes")
    };
  };
  var TOO_MANY_FILES_REJECTION = {
    code: TOO_MANY_FILES,
    message: "Too many files"
  };
  function isDataTransferItemWithEmptyType(file) {
    return file.type === "" && typeof file.getAsFile === "function";
  }
  function fileAccepted(file, accept) {
    var isAcceptable = file.type === "application/x-moz-file" || accepts(file, accept) || isDataTransferItemWithEmptyType(file);
    return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)];
  }
  function fileMatchSize(file, minSize, maxSize) {
    if (isDefined(file.size)) {
      if (isDefined(minSize) && isDefined(maxSize)) {
        if (file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];
        if (file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];
      } else if (isDefined(minSize) && file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];
      else if (isDefined(maxSize) && file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];
    }
    return [true, null];
  }
  function isDefined(value) {
    return value !== void 0 && value !== null;
  }
  function allFilesAccepted(_ref) {
    var files = _ref.files, accept = _ref.accept, minSize = _ref.minSize, maxSize = _ref.maxSize, multiple = _ref.multiple, maxFiles = _ref.maxFiles, validator = _ref.validator;
    if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) {
      return false;
    }
    return files.every(function(file) {
      var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray(_fileAccepted, 1), accepted = _fileAccepted2[0];
      var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray(_fileMatchSize, 1), sizeMatch = _fileMatchSize2[0];
      var customErrors = validator ? validator(file) : null;
      return accepted && sizeMatch && !customErrors;
    });
  }
  function isPropagationStopped(event) {
    if (typeof event.isPropagationStopped === "function") {
      return event.isPropagationStopped();
    } else if (typeof event.cancelBubble !== "undefined") {
      return event.cancelBubble;
    }
    return false;
  }
  function isEvtWithFiles(event) {
    if (!event.dataTransfer) {
      return !!event.target && !!event.target.files;
    }
    return Array.prototype.some.call(event.dataTransfer.types, function(type) {
      return type === "Files" || type === "application/x-moz-file";
    });
  }
  function onDocumentDragOver(event) {
    event.preventDefault();
  }
  function isIe(userAgent) {
    return userAgent.indexOf("MSIE") !== -1 || userAgent.indexOf("Trident/") !== -1;
  }
  function isEdge(userAgent) {
    return userAgent.indexOf("Edge/") !== -1;
  }
  function isIeOrEdge() {
    var userAgent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.navigator.userAgent;
    return isIe(userAgent) || isEdge(userAgent);
  }
  function composeEventHandlers() {
    for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
      fns[_key] = arguments[_key];
    }
    return function(event) {
      for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
        args[_key2 - 1] = arguments[_key2];
      }
      return fns.some(function(fn) {
        if (!isPropagationStopped(event) && fn) {
          fn.apply(void 0, [event].concat(args));
        }
        return isPropagationStopped(event);
      });
    };
  }
  function canUseFileSystemAccessAPI() {
    return "showOpenFilePicker" in window;
  }
  function pickerOptionsFromAccept(accept) {
    if (isDefined(accept)) {
      var acceptForPicker = Object.entries(accept).filter(function(_ref2) {
        var _ref3 = _slicedToArray(_ref2, 2), mimeType = _ref3[0], ext = _ref3[1];
        var ok = true;
        if (!isMIMEType(mimeType)) {
          console.warn('Skipped "'.concat(mimeType, '" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.'));
          ok = false;
        }
        if (!Array.isArray(ext) || !ext.every(isExt)) {
          console.warn('Skipped "'.concat(mimeType, '" because an invalid file extension was provided.'));
          ok = false;
        }
        return ok;
      }).reduce(function(agg, _ref4) {
        var _ref5 = _slicedToArray(_ref4, 2), mimeType = _ref5[0], ext = _ref5[1];
        return _objectSpread(_objectSpread({}, agg), {}, _defineProperty2({}, mimeType, ext));
      }, {});
      return [{
        // description is required due to https://crbug.com/1264708
        description: "Files",
        accept: acceptForPicker
      }];
    }
    return accept;
  }
  function acceptPropAsAcceptAttr(accept) {
    if (isDefined(accept)) {
      return Object.entries(accept).reduce(function(a2, _ref6) {
        var _ref7 = _slicedToArray(_ref6, 2), mimeType = _ref7[0], ext = _ref7[1];
        return [].concat(_toConsumableArray(a2), [mimeType], _toConsumableArray(ext));
      }, []).filter(function(v) {
        return isMIMEType(v) || isExt(v);
      }).join(",");
    }
    return void 0;
  }
  function isAbort(v) {
    return v instanceof DOMException && (v.name === "AbortError" || v.code === v.ABORT_ERR);
  }
  function isSecurityError(v) {
    return v instanceof DOMException && (v.name === "SecurityError" || v.code === v.SECURITY_ERR);
  }
  function isMIMEType(v) {
    return v === "audio/*" || v === "video/*" || v === "image/*" || v === "text/*" || v === "application/*" || /\w+\/[-+.\w]+/g.test(v);
  }
  function isExt(v) {
    return /^.*\.[\w]+$/.test(v);
  }

  // node_modules/react-dropzone/dist/es/index.js
  var _excluded = ["children"];
  var _excluded2 = ["open"];
  var _excluded3 = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"];
  var _excluded4 = ["refKey", "onChange", "onClick"];
  function _toConsumableArray2(arr) {
    return _arrayWithoutHoles2(arr) || _iterableToArray2(arr) || _unsupportedIterableToArray2(arr) || _nonIterableSpread2();
  }
  function _nonIterableSpread2() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _iterableToArray2(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  }
  function _arrayWithoutHoles2(arr) {
    if (Array.isArray(arr)) return _arrayLikeToArray2(arr);
  }
  function _slicedToArray2(arr, i) {
    return _arrayWithHoles2(arr) || _iterableToArrayLimit2(arr, i) || _unsupportedIterableToArray2(arr, i) || _nonIterableRest2();
  }
  function _nonIterableRest2() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _unsupportedIterableToArray2(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _arrayLikeToArray2(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray2(o, minLen);
  }
  function _arrayLikeToArray2(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i = 0, arr2 = new Array(len); i < len; i++) {
      arr2[i] = arr[i];
    }
    return arr2;
  }
  function _iterableToArrayLimit2(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null) return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
      for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
        _arr.push(_s.value);
        if (i && _arr.length === i) break;
      }
    } catch (err) {
      _d = true;
      _e = err;
    } finally {
      try {
        if (!_n && _i["return"] != null) _i["return"]();
      } finally {
        if (_d) throw _e;
      }
    }
    return _arr;
  }
  function _arrayWithHoles2(arr) {
    if (Array.isArray(arr)) return arr;
  }
  function ownKeys4(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function(sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread3(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys4(Object(source), true).forEach(function(key) {
        _defineProperty3(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys4(Object(source)).forEach(function(key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _defineProperty3(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _objectWithoutProperties(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose(source, excluded);
    var key, i;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i = 0; i < sourceSymbolKeys.length; i++) {
        key = sourceSymbolKeys[i];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  function _objectWithoutPropertiesLoose(source, excluded) {
    if (source == null) return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i;
    for (i = 0; i < sourceKeys.length; i++) {
      key = sourceKeys[i];
      if (excluded.indexOf(key) >= 0) continue;
      target[key] = source[key];
    }
    return target;
  }
  var Dropzone = /* @__PURE__ */ (0, import_react13.forwardRef)(function(_ref, ref) {
    var children = _ref.children, params = _objectWithoutProperties(_ref, _excluded);
    var _useDropzone = useDropzone(params), open = _useDropzone.open, props = _objectWithoutProperties(_useDropzone, _excluded2);
    (0, import_react13.useImperativeHandle)(ref, function() {
      return {
        open
      };
    }, [open]);
    return /* @__PURE__ */ import_react13.default.createElement(import_react13.Fragment, null, children(_objectSpread3(_objectSpread3({}, props), {}, {
      open
    })));
  });
  Dropzone.displayName = "Dropzone";
  var defaultProps = {
    disabled: false,
    getFilesFromEvent: fromEvent,
    maxSize: Infinity,
    minSize: 0,
    multiple: true,
    maxFiles: 0,
    preventDropOnDocument: true,
    noClick: false,
    noKeyboard: false,
    noDrag: false,
    noDragEventsBubbling: false,
    validator: null,
    useFsAccessApi: false,
    autoFocus: false
  };
  Dropzone.defaultProps = defaultProps;
  Dropzone.propTypes = {
    /**
     * Render function that exposes the dropzone state and prop getter fns
     *
     * @param {object} params
     * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render
     * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render
     * @param {Function} params.open Open the native file selection dialog
     * @param {boolean} params.isFocused Dropzone area is in focus
     * @param {boolean} params.isFileDialogActive File dialog is opened
     * @param {boolean} params.isDragActive Active drag is in progress
     * @param {boolean} params.isDragAccept Dragged files are accepted
     * @param {boolean} params.isDragReject Some dragged files are rejected
     * @param {boolean} params.isDragGlobal Files are being dragged anywhere on the document
     * @param {File[]} params.acceptedFiles Accepted files
     * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected
     */
    children: import_prop_types.default.func,
    /**
     * Set accepted file types.
     * Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.
     * Keep in mind that mime type determination is not reliable across platforms. CSV files,
     * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
     * Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).
     */
    accept: import_prop_types.default.objectOf(import_prop_types.default.arrayOf(import_prop_types.default.string)),
    /**
     * Allow drag 'n' drop (or selection from the file dialog) of multiple files
     */
    multiple: import_prop_types.default.bool,
    /**
     * If false, allow dropped items to take over the current browser window
     */
    preventDropOnDocument: import_prop_types.default.bool,
    /**
     * If true, disables click to open the native file selection dialog
     */
    noClick: import_prop_types.default.bool,
    /**
     * If true, disables SPACE/ENTER to open the native file selection dialog.
     * Note that it also stops tracking the focus state.
     */
    noKeyboard: import_prop_types.default.bool,
    /**
     * If true, disables drag 'n' drop
     */
    noDrag: import_prop_types.default.bool,
    /**
     * If true, stops drag event propagation to parents
     */
    noDragEventsBubbling: import_prop_types.default.bool,
    /**
     * Minimum file size (in bytes)
     */
    minSize: import_prop_types.default.number,
    /**
     * Maximum file size (in bytes)
     */
    maxSize: import_prop_types.default.number,
    /**
     * Maximum accepted number of files
     * The default value is 0 which means there is no limitation to how many files are accepted.
     */
    maxFiles: import_prop_types.default.number,
    /**
     * Enable/disable the dropzone
     */
    disabled: import_prop_types.default.bool,
    /**
     * Use this to provide a custom file aggregator
     *
     * @param {(DragEvent|Event|Array<FileSystemFileHandle>)} event A drag event or input change event (if files were selected via the file dialog)
     */
    getFilesFromEvent: import_prop_types.default.func,
    /**
     * Cb for when closing the file dialog with no selection
     */
    onFileDialogCancel: import_prop_types.default.func,
    /**
     * Cb for when opening the file dialog
     */
    onFileDialogOpen: import_prop_types.default.func,
    /**
     * Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
     * to open the file picker instead of using an `<input type="file">` click event.
     */
    useFsAccessApi: import_prop_types.default.bool,
    /**
     * Set to true to focus the root element on render
     */
    autoFocus: import_prop_types.default.bool,
    /**
     * Cb for when the `dragenter` event occurs.
     *
     * @param {DragEvent} event
     */
    onDragEnter: import_prop_types.default.func,
    /**
     * Cb for when the `dragleave` event occurs
     *
     * @param {DragEvent} event
     */
    onDragLeave: import_prop_types.default.func,
    /**
     * Cb for when the `dragover` event occurs
     *
     * @param {DragEvent} event
     */
    onDragOver: import_prop_types.default.func,
    /**
     * Cb for when the `drop` event occurs.
     * Note that this callback is invoked after the `getFilesFromEvent` callback is done.
     *
     * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.
     * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.
     * If `multiple` is set to false and additional files are dropped,
     * all files besides the first will be rejected.
     * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.
     *
     * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.
     * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.
     *
     * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.
     * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:
     *
     * ```js
     * function onDrop(acceptedFiles) {
     *   const req = request.post('/upload')
     *   acceptedFiles.forEach(file => {
     *     req.attach(file.name, file)
     *   })
     *   req.end(callback)
     * }
     * ```
     *
     * @param {File[]} acceptedFiles
     * @param {FileRejection[]} fileRejections
     * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
     */
    onDrop: import_prop_types.default.func,
    /**
     * Cb for when the `drop` event occurs.
     * Note that if no files are accepted, this callback is not invoked.
     *
     * @param {File[]} files
     * @param {(DragEvent|Event)} event
     */
    onDropAccepted: import_prop_types.default.func,
    /**
     * Cb for when the `drop` event occurs.
     * Note that if no files are rejected, this callback is not invoked.
     *
     * @param {FileRejection[]} fileRejections
     * @param {(DragEvent|Event)} event
     */
    onDropRejected: import_prop_types.default.func,
    /**
     * Cb for when there's some error from any of the promises.
     *
     * @param {Error} error
     */
    onError: import_prop_types.default.func,
    /**
     * Custom validation function. It must return null if there's no errors.
     * @param {File} file
     * @returns {FileError|FileError[]|null}
     */
    validator: import_prop_types.default.func
  };
  var initialState = {
    isFocused: false,
    isFileDialogActive: false,
    isDragActive: false,
    isDragAccept: false,
    isDragReject: false,
    isDragGlobal: false,
    acceptedFiles: [],
    fileRejections: []
  };
  function useDropzone() {
    var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    var _defaultProps$props = _objectSpread3(_objectSpread3({}, defaultProps), props), accept = _defaultProps$props.accept, disabled = _defaultProps$props.disabled, getFilesFromEvent = _defaultProps$props.getFilesFromEvent, maxSize = _defaultProps$props.maxSize, minSize = _defaultProps$props.minSize, multiple = _defaultProps$props.multiple, maxFiles = _defaultProps$props.maxFiles, onDragEnter = _defaultProps$props.onDragEnter, onDragLeave = _defaultProps$props.onDragLeave, onDragOver = _defaultProps$props.onDragOver, onDrop = _defaultProps$props.onDrop, onDropAccepted = _defaultProps$props.onDropAccepted, onDropRejected = _defaultProps$props.onDropRejected, onFileDialogCancel = _defaultProps$props.onFileDialogCancel, onFileDialogOpen = _defaultProps$props.onFileDialogOpen, useFsAccessApi = _defaultProps$props.useFsAccessApi, autoFocus = _defaultProps$props.autoFocus, preventDropOnDocument = _defaultProps$props.preventDropOnDocument, noClick = _defaultProps$props.noClick, noKeyboard = _defaultProps$props.noKeyboard, noDrag = _defaultProps$props.noDrag, noDragEventsBubbling = _defaultProps$props.noDragEventsBubbling, onError = _defaultProps$props.onError, validator = _defaultProps$props.validator;
    var acceptAttr = (0, import_react13.useMemo)(function() {
      return acceptPropAsAcceptAttr(accept);
    }, [accept]);
    var pickerTypes = (0, import_react13.useMemo)(function() {
      return pickerOptionsFromAccept(accept);
    }, [accept]);
    var onFileDialogOpenCb = (0, import_react13.useMemo)(function() {
      return typeof onFileDialogOpen === "function" ? onFileDialogOpen : noop;
    }, [onFileDialogOpen]);
    var onFileDialogCancelCb = (0, import_react13.useMemo)(function() {
      return typeof onFileDialogCancel === "function" ? onFileDialogCancel : noop;
    }, [onFileDialogCancel]);
    var rootRef = (0, import_react13.useRef)(null);
    var inputRef = (0, import_react13.useRef)(null);
    var _useReducer = (0, import_react13.useReducer)(reducer, initialState), _useReducer2 = _slicedToArray2(_useReducer, 2), state = _useReducer2[0], dispatch = _useReducer2[1];
    var isFocused = state.isFocused, isFileDialogActive = state.isFileDialogActive;
    var fsAccessApiWorksRef = (0, import_react13.useRef)(typeof window !== "undefined" && window.isSecureContext && useFsAccessApi && canUseFileSystemAccessAPI());
    var onWindowFocus = function onWindowFocus2() {
      if (!fsAccessApiWorksRef.current && isFileDialogActive) {
        setTimeout(function() {
          if (inputRef.current) {
            var files = inputRef.current.files;
            if (!files.length) {
              dispatch({
                type: "closeDialog"
              });
              onFileDialogCancelCb();
            }
          }
        }, 300);
      }
    };
    (0, import_react13.useEffect)(function() {
      window.addEventListener("focus", onWindowFocus, false);
      return function() {
        window.removeEventListener("focus", onWindowFocus, false);
      };
    }, [inputRef, isFileDialogActive, onFileDialogCancelCb, fsAccessApiWorksRef]);
    var dragTargetsRef = (0, import_react13.useRef)([]);
    var globalDragTargetsRef = (0, import_react13.useRef)([]);
    var onDocumentDrop = function onDocumentDrop2(event) {
      if (rootRef.current && rootRef.current.contains(event.target)) {
        return;
      }
      event.preventDefault();
      dragTargetsRef.current = [];
    };
    (0, import_react13.useEffect)(function() {
      if (preventDropOnDocument) {
        document.addEventListener("dragover", onDocumentDragOver, false);
        document.addEventListener("drop", onDocumentDrop, false);
      }
      return function() {
        if (preventDropOnDocument) {
          document.removeEventListener("dragover", onDocumentDragOver);
          document.removeEventListener("drop", onDocumentDrop);
        }
      };
    }, [rootRef, preventDropOnDocument]);
    (0, import_react13.useEffect)(function() {
      var onDocumentDragEnter = function onDocumentDragEnter2(event) {
        globalDragTargetsRef.current = [].concat(_toConsumableArray2(globalDragTargetsRef.current), [event.target]);
        if (isEvtWithFiles(event)) {
          dispatch({
            isDragGlobal: true,
            type: "setDragGlobal"
          });
        }
      };
      var onDocumentDragLeave = function onDocumentDragLeave2(event) {
        globalDragTargetsRef.current = globalDragTargetsRef.current.filter(function(el) {
          return el !== event.target && el !== null;
        });
        if (globalDragTargetsRef.current.length > 0) {
          return;
        }
        dispatch({
          isDragGlobal: false,
          type: "setDragGlobal"
        });
      };
      var onDocumentDragEnd = function onDocumentDragEnd2() {
        globalDragTargetsRef.current = [];
        dispatch({
          isDragGlobal: false,
          type: "setDragGlobal"
        });
      };
      var onDocumentDropGlobal = function onDocumentDropGlobal2() {
        globalDragTargetsRef.current = [];
        dispatch({
          isDragGlobal: false,
          type: "setDragGlobal"
        });
      };
      document.addEventListener("dragenter", onDocumentDragEnter, false);
      document.addEventListener("dragleave", onDocumentDragLeave, false);
      document.addEventListener("dragend", onDocumentDragEnd, false);
      document.addEventListener("drop", onDocumentDropGlobal, false);
      return function() {
        document.removeEventListener("dragenter", onDocumentDragEnter);
        document.removeEventListener("dragleave", onDocumentDragLeave);
        document.removeEventListener("dragend", onDocumentDragEnd);
        document.removeEventListener("drop", onDocumentDropGlobal);
      };
    }, [rootRef]);
    (0, import_react13.useEffect)(function() {
      if (!disabled && autoFocus && rootRef.current) {
        rootRef.current.focus();
      }
      return function() {
      };
    }, [rootRef, autoFocus, disabled]);
    var onErrCb = (0, import_react13.useCallback)(function(e) {
      if (onError) {
        onError(e);
      } else {
        console.error(e);
      }
    }, [onError]);
    var onDragEnterCb = (0, import_react13.useCallback)(function(event) {
      event.preventDefault();
      event.persist();
      stopPropagation(event);
      dragTargetsRef.current = [].concat(_toConsumableArray2(dragTargetsRef.current), [event.target]);
      if (isEvtWithFiles(event)) {
        Promise.resolve(getFilesFromEvent(event)).then(function(files) {
          if (isPropagationStopped(event) && !noDragEventsBubbling) {
            return;
          }
          var fileCount = files.length;
          var isDragAccept = fileCount > 0 && allFilesAccepted({
            files,
            accept: acceptAttr,
            minSize,
            maxSize,
            multiple,
            maxFiles,
            validator
          });
          var isDragReject = fileCount > 0 && !isDragAccept;
          dispatch({
            isDragAccept,
            isDragReject,
            isDragActive: true,
            type: "setDraggedFiles"
          });
          if (onDragEnter) {
            onDragEnter(event);
          }
        }).catch(function(e) {
          return onErrCb(e);
        });
      }
    }, [getFilesFromEvent, onDragEnter, onErrCb, noDragEventsBubbling, acceptAttr, minSize, maxSize, multiple, maxFiles, validator]);
    var onDragOverCb = (0, import_react13.useCallback)(function(event) {
      event.preventDefault();
      event.persist();
      stopPropagation(event);
      var hasFiles = isEvtWithFiles(event);
      if (hasFiles && event.dataTransfer) {
        try {
          event.dataTransfer.dropEffect = "copy";
        } catch (_unused) {
        }
      }
      if (hasFiles && onDragOver) {
        onDragOver(event);
      }
      return false;
    }, [onDragOver, noDragEventsBubbling]);
    var onDragLeaveCb = (0, import_react13.useCallback)(function(event) {
      event.preventDefault();
      event.persist();
      stopPropagation(event);
      var targets = dragTargetsRef.current.filter(function(target) {
        return rootRef.current && rootRef.current.contains(target);
      });
      var targetIdx = targets.indexOf(event.target);
      if (targetIdx !== -1) {
        targets.splice(targetIdx, 1);
      }
      dragTargetsRef.current = targets;
      if (targets.length > 0) {
        return;
      }
      dispatch({
        type: "setDraggedFiles",
        isDragActive: false,
        isDragAccept: false,
        isDragReject: false
      });
      if (isEvtWithFiles(event) && onDragLeave) {
        onDragLeave(event);
      }
    }, [rootRef, onDragLeave, noDragEventsBubbling]);
    var setFiles = (0, import_react13.useCallback)(function(files, event) {
      var acceptedFiles = [];
      var fileRejections = [];
      files.forEach(function(file) {
        var _fileAccepted = fileAccepted(file, acceptAttr), _fileAccepted2 = _slicedToArray2(_fileAccepted, 2), accepted = _fileAccepted2[0], acceptError = _fileAccepted2[1];
        var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray2(_fileMatchSize, 2), sizeMatch = _fileMatchSize2[0], sizeError = _fileMatchSize2[1];
        var customErrors = validator ? validator(file) : null;
        if (accepted && sizeMatch && !customErrors) {
          acceptedFiles.push(file);
        } else {
          var errors = [acceptError, sizeError];
          if (customErrors) {
            errors = errors.concat(customErrors);
          }
          fileRejections.push({
            file,
            errors: errors.filter(function(e) {
              return e;
            })
          });
        }
      });
      if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) {
        acceptedFiles.forEach(function(file) {
          fileRejections.push({
            file,
            errors: [TOO_MANY_FILES_REJECTION]
          });
        });
        acceptedFiles.splice(0);
      }
      dispatch({
        acceptedFiles,
        fileRejections,
        isDragReject: fileRejections.length > 0,
        type: "setFiles"
      });
      if (onDrop) {
        onDrop(acceptedFiles, fileRejections, event);
      }
      if (fileRejections.length > 0 && onDropRejected) {
        onDropRejected(fileRejections, event);
      }
      if (acceptedFiles.length > 0 && onDropAccepted) {
        onDropAccepted(acceptedFiles, event);
      }
    }, [dispatch, multiple, acceptAttr, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator]);
    var onDropCb = (0, import_react13.useCallback)(function(event) {
      event.preventDefault();
      event.persist();
      stopPropagation(event);
      dragTargetsRef.current = [];
      if (isEvtWithFiles(event)) {
        Promise.resolve(getFilesFromEvent(event)).then(function(files) {
          if (isPropagationStopped(event) && !noDragEventsBubbling) {
            return;
          }
          setFiles(files, event);
        }).catch(function(e) {
          return onErrCb(e);
        });
      }
      dispatch({
        type: "reset"
      });
    }, [getFilesFromEvent, setFiles, onErrCb, noDragEventsBubbling]);
    var openFileDialog = (0, import_react13.useCallback)(function() {
      if (fsAccessApiWorksRef.current) {
        dispatch({
          type: "openDialog"
        });
        onFileDialogOpenCb();
        var opts = {
          multiple,
          types: pickerTypes
        };
        window.showOpenFilePicker(opts).then(function(handles) {
          return getFilesFromEvent(handles);
        }).then(function(files) {
          setFiles(files, null);
          dispatch({
            type: "closeDialog"
          });
        }).catch(function(e) {
          if (isAbort(e)) {
            onFileDialogCancelCb(e);
            dispatch({
              type: "closeDialog"
            });
          } else if (isSecurityError(e)) {
            fsAccessApiWorksRef.current = false;
            if (inputRef.current) {
              inputRef.current.value = null;
              inputRef.current.click();
            } else {
              onErrCb(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."));
            }
          } else {
            onErrCb(e);
          }
        });
        return;
      }
      if (inputRef.current) {
        dispatch({
          type: "openDialog"
        });
        onFileDialogOpenCb();
        inputRef.current.value = null;
        inputRef.current.click();
      }
    }, [dispatch, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, onErrCb, pickerTypes, multiple]);
    var onKeyDownCb = (0, import_react13.useCallback)(function(event) {
      if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {
        return;
      }
      if (event.key === " " || event.key === "Enter" || event.keyCode === 32 || event.keyCode === 13) {
        event.preventDefault();
        openFileDialog();
      }
    }, [rootRef, openFileDialog]);
    var onFocusCb = (0, import_react13.useCallback)(function() {
      dispatch({
        type: "focus"
      });
    }, []);
    var onBlurCb = (0, import_react13.useCallback)(function() {
      dispatch({
        type: "blur"
      });
    }, []);
    var onClickCb = (0, import_react13.useCallback)(function() {
      if (noClick) {
        return;
      }
      if (isIeOrEdge()) {
        setTimeout(openFileDialog, 0);
      } else {
        openFileDialog();
      }
    }, [noClick, openFileDialog]);
    var composeHandler = function composeHandler2(fn) {
      return disabled ? null : fn;
    };
    var composeKeyboardHandler = function composeKeyboardHandler2(fn) {
      return noKeyboard ? null : composeHandler(fn);
    };
    var composeDragHandler = function composeDragHandler2(fn) {
      return noDrag ? null : composeHandler(fn);
    };
    var stopPropagation = function stopPropagation2(event) {
      if (noDragEventsBubbling) {
        event.stopPropagation();
      }
    };
    var getRootProps = (0, import_react13.useMemo)(function() {
      return function() {
        var _ref2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref2$refKey = _ref2.refKey, refKey = _ref2$refKey === void 0 ? "ref" : _ref2$refKey, role = _ref2.role, onKeyDown = _ref2.onKeyDown, onFocus = _ref2.onFocus, onBlur = _ref2.onBlur, onClick = _ref2.onClick, onDragEnter2 = _ref2.onDragEnter, onDragOver2 = _ref2.onDragOver, onDragLeave2 = _ref2.onDragLeave, onDrop2 = _ref2.onDrop, rest = _objectWithoutProperties(_ref2, _excluded3);
        return _objectSpread3(_objectSpread3(_defineProperty3({
          onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),
          onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),
          onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),
          onClick: composeHandler(composeEventHandlers(onClick, onClickCb)),
          onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter2, onDragEnterCb)),
          onDragOver: composeDragHandler(composeEventHandlers(onDragOver2, onDragOverCb)),
          onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave2, onDragLeaveCb)),
          onDrop: composeDragHandler(composeEventHandlers(onDrop2, onDropCb)),
          role: typeof role === "string" && role !== "" ? role : "presentation"
        }, refKey, rootRef), !disabled && !noKeyboard ? {
          tabIndex: 0
        } : {}), rest);
      };
    }, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]);
    var onInputElementClick = (0, import_react13.useCallback)(function(event) {
      event.stopPropagation();
    }, []);
    var getInputProps = (0, import_react13.useMemo)(function() {
      return function() {
        var _ref3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref3$refKey = _ref3.refKey, refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey, onChange = _ref3.onChange, onClick = _ref3.onClick, rest = _objectWithoutProperties(_ref3, _excluded4);
        var inputProps = _defineProperty3({
          accept: acceptAttr,
          multiple,
          type: "file",
          style: {
            border: 0,
            clip: "rect(0, 0, 0, 0)",
            clipPath: "inset(50%)",
            height: "1px",
            margin: "0 -1px -1px 0",
            overflow: "hidden",
            padding: 0,
            position: "absolute",
            width: "1px",
            whiteSpace: "nowrap"
          },
          onChange: composeHandler(composeEventHandlers(onChange, onDropCb)),
          onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),
          tabIndex: -1
        }, refKey, inputRef);
        return _objectSpread3(_objectSpread3({}, inputProps), rest);
      };
    }, [inputRef, accept, multiple, onDropCb, disabled]);
    return _objectSpread3(_objectSpread3({}, state), {}, {
      isFocused: isFocused && !disabled,
      getRootProps,
      getInputProps,
      rootRef,
      inputRef,
      open: composeHandler(openFileDialog)
    });
  }
  function reducer(state, action) {
    switch (action.type) {
      case "focus":
        return _objectSpread3(_objectSpread3({}, state), {}, {
          isFocused: true
        });
      case "blur":
        return _objectSpread3(_objectSpread3({}, state), {}, {
          isFocused: false
        });
      case "openDialog":
        return _objectSpread3(_objectSpread3({}, initialState), {}, {
          isFileDialogActive: true
        });
      case "closeDialog":
        return _objectSpread3(_objectSpread3({}, state), {}, {
          isFileDialogActive: false
        });
      case "setDraggedFiles":
        return _objectSpread3(_objectSpread3({}, state), {}, {
          isDragActive: action.isDragActive,
          isDragAccept: action.isDragAccept,
          isDragReject: action.isDragReject
        });
      case "setFiles":
        return _objectSpread3(_objectSpread3({}, state), {}, {
          acceptedFiles: action.acceptedFiles,
          fileRejections: action.fileRejections,
          isDragReject: action.isDragReject
        });
      case "setDragGlobal":
        return _objectSpread3(_objectSpread3({}, state), {}, {
          isDragGlobal: action.isDragGlobal
        });
      case "reset":
        return _objectSpread3({}, initialState);
      default:
        return state;
    }
  }
  function noop() {
  }

  // node_modules/@patternfly/react-core/dist/esm/components/FileUpload/FileUpload.js
  var FileUpload = (_a) => {
    var { id, type, value = type === fileReaderType.text || type === fileReaderType.dataURL ? "" : null, filename = "", children = null, onFileInputChange = null, onReadStarted = () => {
    }, onReadFinished = () => {
    }, onReadFailed = () => {
    }, onClearClick, onClick = (event) => event.preventDefault(), onTextChange, onDataChange, dropzoneProps = {} } = _a, props = __rest(_a, ["id", "type", "value", "filename", "children", "onFileInputChange", "onReadStarted", "onReadFinished", "onReadFailed", "onClearClick", "onClick", "onTextChange", "onDataChange", "dropzoneProps"]);
    const onDropAccepted = (acceptedFiles, event) => {
      if (acceptedFiles.length > 0) {
        const fileHandle = acceptedFiles[0];
        onFileInputChange === null || onFileInputChange === void 0 ? void 0 : onFileInputChange(event, fileHandle);
        if (type === fileReaderType.text || type === fileReaderType.dataURL) {
          onReadStarted(event, fileHandle);
          readFile(fileHandle, type).then((data) => {
            onReadFinished(event, fileHandle);
            onDataChange === null || onDataChange === void 0 ? void 0 : onDataChange(event, data);
          }).catch((error) => {
            onReadFailed(event, error, fileHandle);
            onReadFinished(event, fileHandle);
            onDataChange === null || onDataChange === void 0 ? void 0 : onDataChange(event, "");
          });
        }
      }
      dropzoneProps.onDropAccepted && dropzoneProps.onDropAccepted(acceptedFiles, event);
    };
    const onDropRejected = (rejectedFiles, event) => {
      dropzoneProps.onDropRejected && dropzoneProps.onDropRejected(rejectedFiles, event);
    };
    const onClearButtonClick = (event) => {
      onClearClick === null || onClearClick === void 0 ? void 0 : onClearClick(event);
      setFileValue(null);
    };
    const { getRootProps, getInputProps, isDragActive, open, inputRef } = useDropzone(Object.assign(Object.assign({ noClick: true, multiple: false }, dropzoneProps), {
      onDropAccepted,
      onDropRejected
    }));
    const setFileValue = (filename2) => {
      inputRef.current.value = filename2;
    };
    const oldInputProps = getInputProps();
    const inputProps = Object.assign(Object.assign({}, oldInputProps), { onChange: (e) => __awaiter(void 0, void 0, void 0, function* () {
      var _b;
      (_b = oldInputProps.onChange) === null || _b === void 0 ? void 0 : _b.call(oldInputProps, e);
      const files = yield fromEvent(e.nativeEvent);
      if (files.length === 1) {
        onFileInputChange === null || onFileInputChange === void 0 ? void 0 : onFileInputChange(e, files[0]);
      }
    }) });
    const rootProps = getRootProps(Object.assign(Object.assign({}, props), {
      tabIndex: null,
      // Omit the unwanted tabIndex from react-dropzone's getRootProps
      id,
      type,
      filename,
      value,
      isDragActive,
      onBrowseButtonClick: open,
      onClearButtonClick,
      onTextAreaClick: onClick,
      onTextChange,
      onClick,
      refKey: "containerRef"
    }));
    return React138.createElement(
      FileUploadField,
      Object.assign({}, rootProps),
      React138.createElement("input", Object.assign({}, inputProps)),
      children
    );
  };
  FileUpload.displayName = "FileUpload";

  // node_modules/@patternfly/react-core/dist/esm/components/FormSelect/FormSelect.js
  init_tslib_es6();
  var React139 = __toESM(require_react());
  var FormSelect = class _FormSelect extends React139.Component {
    constructor(props) {
      super(props);
      this.handleChange = (event) => {
        this.props.onChange(event, event.currentTarget.value);
      };
      if (!props.id && !props["aria-label"]) {
        console.error("FormSelect requires either an id or aria-label to be specified");
      }
      this.state = {
        ouiaStateId: getDefaultOUIAId(_FormSelect.displayName, props.validated)
      };
    }
    render() {
      const _a = this.props, { children, className, value, validated, isDisabled, isRequired, ouiaId, ouiaSafe } = _a, props = __rest(_a, ["children", "className", "value", "validated", "isDisabled", "isRequired", "ouiaId", "ouiaSafe"]);
      const selectedOption = React139.Children.toArray(children).find((option) => option.props.value === value);
      const isSelectedPlaceholder = selectedOption && selectedOption.props.isPlaceholder;
      const hasStatusIcon = ["success", "error", "warning"].includes(validated);
      return React139.createElement(
        "span",
        { className: css(form_control_default.formControl, isDisabled && form_control_default.modifiers.disabled, isSelectedPlaceholder && form_control_default.modifiers.placeholder, hasStatusIcon && form_control_default.modifiers[validated], className) },
        React139.createElement("select", Object.assign({}, props, { "aria-invalid": validated === ValidatedOptions.error }, getOUIAProps(_FormSelect.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe), { onChange: this.handleChange, disabled: isDisabled, required: isRequired, value }), children),
        React139.createElement(
          "span",
          { className: css(form_control_default.formControlUtilities) },
          hasStatusIcon && React139.createElement(FormControlIcon, { status: validated }),
          React139.createElement(
            "span",
            { className: css(form_control_default.formControlToggleIcon) },
            React139.createElement(caret_down_icon_default, null)
          )
        )
      );
    }
  };
  FormSelect.displayName = "FormSelect";
  FormSelect.defaultProps = {
    className: "",
    value: "",
    validated: "default",
    isDisabled: false,
    isRequired: false,
    onBlur: () => void 0,
    onFocus: () => void 0,
    onChange: () => void 0,
    ouiaSafe: true
  };

  // node_modules/@patternfly/react-core/dist/esm/components/FormSelect/FormSelectOption.js
  init_tslib_es6();
  var React140 = __toESM(require_react());
  var FormSelectOption = (_a) => {
    var {
      className = "",
      value = "",
      isDisabled = false,
      label,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      isPlaceholder = false
    } = _a, props = __rest(_a, ["className", "value", "isDisabled", "label", "isPlaceholder"]);
    return React140.createElement("option", Object.assign({}, props, { className, value, disabled: isDisabled }), label);
  };
  FormSelectOption.displayName = "FormSelectOption";

  // node_modules/@patternfly/react-core/dist/esm/components/Label/Label.js
  init_tslib_es6();
  var React141 = __toESM(require_react());
  var import_react14 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Label/label.mjs
  var label_default = {
    "button": "pf-v5-c-button",
    "label": "pf-v5-c-label",
    "labelActions": "pf-v5-c-label__actions",
    "labelContent": "pf-v5-c-label__content",
    "labelIcon": "pf-v5-c-label__icon",
    "labelText": "pf-v5-c-label__text",
    "modifiers": {
      "compact": "pf-m-compact",
      "blue": "pf-m-blue",
      "green": "pf-m-green",
      "orange": "pf-m-orange",
      "red": "pf-m-red",
      "purple": "pf-m-purple",
      "cyan": "pf-m-cyan",
      "gold": "pf-m-gold",
      "outline": "pf-m-outline",
      "overflow": "pf-m-overflow",
      "add": "pf-m-add",
      "editable": "pf-m-editable",
      "editableActive": "pf-m-editable-active",
      "disabled": "pf-m-disabled"
    },
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-styles/css/components/Label/label-group.mjs
  var label_group_default = {
    "button": "pf-v5-c-button",
    "labelGroup": "pf-v5-c-label-group",
    "labelGroupClose": "pf-v5-c-label-group__close",
    "labelGroupLabel": "pf-v5-c-label-group__label",
    "labelGroupList": "pf-v5-c-label-group__list",
    "labelGroupListItem": "pf-v5-c-label-group__list-item",
    "labelGroupMain": "pf-v5-c-label-group__main",
    "labelGroupTextarea": "pf-v5-c-label-group__textarea",
    "modifiers": {
      "category": "pf-m-category",
      "vertical": "pf-m-vertical",
      "editable": "pf-m-editable",
      "textarea": "pf-m-textarea"
    }
  };

  // node_modules/@patternfly/react-tokens/dist/esm/c_label__text_MaxWidth.js
  var c_label__text_MaxWidth = {
    "name": "--pf-v5-c-label__text--MaxWidth",
    "value": "100%",
    "var": "var(--pf-v5-c-label__text--MaxWidth)"
  };
  var c_label_text_MaxWidth_default = c_label__text_MaxWidth;

  // node_modules/@patternfly/react-core/dist/esm/components/Label/Label.js
  var colorStyles = {
    blue: label_default.modifiers.blue,
    cyan: label_default.modifiers.cyan,
    green: label_default.modifiers.green,
    orange: label_default.modifiers.orange,
    purple: label_default.modifiers.purple,
    red: label_default.modifiers.red,
    gold: label_default.modifiers.gold,
    grey: ""
  };
  var Label = (_a) => {
    var { children, className = "", color: color2 = "grey", variant = "filled", isCompact = false, isDisabled = false, isEditable = false, editableProps, textMaxWidth, tooltipPosition, icon, onClose, onClick: onLabelClick, onEditCancel, onEditComplete, closeBtn, closeBtnAriaLabel, closeBtnProps, href, isOverflowLabel, render } = _a, props = __rest(_a, ["children", "className", "color", "variant", "isCompact", "isDisabled", "isEditable", "editableProps", "textMaxWidth", "tooltipPosition", "icon", "onClose", "onClick", "onEditCancel", "onEditComplete", "closeBtn", "closeBtnAriaLabel", "closeBtnProps", "href", "isOverflowLabel", "render"]);
    const [isEditableActive, setIsEditableActive] = (0, import_react14.useState)(false);
    const [currValue, setCurrValue] = (0, import_react14.useState)(children);
    const editableButtonRef = React141.useRef();
    const editableInputRef = React141.useRef();
    React141.useEffect(() => {
      document.addEventListener("mousedown", onDocMouseDown);
      document.addEventListener("keydown", onKeyDown);
      return () => {
        document.removeEventListener("mousedown", onDocMouseDown);
        document.removeEventListener("keydown", onKeyDown);
      };
    });
    React141.useEffect(() => {
      if (onLabelClick && href) {
        console.warn("Link labels cannot have onClick passed, this results in invalid HTML. Please remove either the href or onClick prop.");
      } else if (onLabelClick && isEditable) {
        console.warn("Editable labels cannot have onClick passed, clicking starts the label edit process. Please remove either the isEditable or onClick prop.");
      }
    }, [onLabelClick, href, isEditable]);
    const onDocMouseDown = (event) => {
      if (isEditableActive && editableInputRef && editableInputRef.current && !editableInputRef.current.contains(event.target)) {
        if (editableInputRef.current.value) {
          onEditComplete && onEditComplete(event, editableInputRef.current.value);
        }
        setIsEditableActive(false);
      }
    };
    const onKeyDown = (event) => {
      var _a2, _b;
      const key = event.key;
      if (!isEditableActive && (!editableButtonRef || !editableButtonRef.current || !editableButtonRef.current.contains(event.target)) || isEditableActive && (!editableInputRef || !editableInputRef.current || !editableInputRef.current.contains(event.target))) {
        return;
      }
      if (isEditableActive && (key === "Enter" || key === "Tab")) {
        event.preventDefault();
        event.stopImmediatePropagation();
        if (editableInputRef.current.value) {
          onEditComplete && onEditComplete(event, editableInputRef.current.value);
        }
        setIsEditableActive(false);
        (_a2 = editableButtonRef === null || editableButtonRef === void 0 ? void 0 : editableButtonRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus();
      }
      if (isEditableActive && key === "Escape") {
        event.preventDefault();
        event.stopImmediatePropagation();
        if (editableInputRef.current.value) {
          editableInputRef.current.value = children;
          onEditCancel && onEditCancel(event, children);
        }
        setIsEditableActive(false);
        (_b = editableButtonRef === null || editableButtonRef === void 0 ? void 0 : editableButtonRef.current) === null || _b === void 0 ? void 0 : _b.focus();
      }
      if (!isEditableActive && key === "Enter") {
        event.preventDefault();
        event.stopImmediatePropagation();
        setIsEditableActive(true);
        const el = event.target;
        const range4 = document.createRange();
        const sel = window.getSelection();
        range4.selectNodeContents(el);
        range4.collapse(false);
        sel.removeAllRanges();
        sel.addRange(range4);
      }
    };
    const isClickableDisabled = (href || onLabelClick) && isDisabled;
    const defaultCloseButton = React141.createElement(
      Button,
      Object.assign({ type: "button", variant: "plain", onClick: onClose, "aria-label": closeBtnAriaLabel || `Close ${children}` }, isClickableDisabled && { isDisabled: true }, closeBtnProps),
      React141.createElement(times_icon_default, null)
    );
    const closeButton = React141.createElement("span", { className: css(label_default.labelActions) }, closeBtn || defaultCloseButton);
    const textRef = React141.createRef();
    const componentRef = React141.useRef();
    const [isTooltipVisible, setIsTooltipVisible] = React141.useState(false);
    useIsomorphicLayoutEffect(() => {
      const currTextRef = isEditable ? editableButtonRef : textRef;
      if (!isEditableActive) {
        setIsTooltipVisible(currTextRef.current && currTextRef.current.offsetWidth < currTextRef.current.scrollWidth);
      }
    }, [isEditableActive]);
    const content = React141.createElement(
      React141.Fragment,
      null,
      icon && React141.createElement("span", { className: css(label_default.labelIcon) }, icon),
      React141.createElement("span", Object.assign({ ref: textRef, className: css(label_default.labelText) }, textMaxWidth && {
        style: {
          [c_label_text_MaxWidth_default.name]: textMaxWidth
        }
      }), children)
    );
    React141.useEffect(() => {
      if (isEditableActive && editableInputRef) {
        editableInputRef.current && editableInputRef.current.focus();
      }
    }, [editableInputRef, isEditableActive]);
    const updateVal = () => {
      setCurrValue(editableInputRef.current.value);
    };
    let LabelComponentChildElement = "span";
    if (href) {
      LabelComponentChildElement = "a";
    } else if (isEditable || onLabelClick && !isOverflowLabel) {
      LabelComponentChildElement = "button";
    }
    const clickableLabelProps = {
      type: "button",
      onClick: onLabelClick
    };
    const isButton = LabelComponentChildElement === "button";
    const labelComponentChildProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ className: css(label_default.labelContent) }, isTooltipVisible && { tabIndex: 0 }), href && { href }), href && isDisabled && { onClick: (event) => event.preventDefault() }), isButton && clickableLabelProps), isEditable && Object.assign({ ref: editableButtonRef, onClick: (e) => {
      setIsEditableActive(true);
      e.stopPropagation();
    } }, editableProps)), isClickableDisabled && isButton && { disabled: true }), isClickableDisabled && href && { tabIndex: -1, "aria-disabled": true });
    let labelComponentChild = React141.createElement(LabelComponentChildElement, Object.assign({}, labelComponentChildProps), content);
    if (render) {
      labelComponentChild = React141.createElement(
        React141.Fragment,
        null,
        isTooltipVisible && React141.createElement(Tooltip, { triggerRef: componentRef, content: children, position: tooltipPosition }),
        render({
          className: label_default.labelContent,
          content,
          componentRef
        })
      );
    } else if (isTooltipVisible) {
      labelComponentChild = React141.createElement(Tooltip, { content: children, position: tooltipPosition }, labelComponentChild);
    }
    const LabelComponent = isOverflowLabel ? "button" : "span";
    return React141.createElement(
      LabelComponent,
      Object.assign({}, props, { className: css(label_default.label, isClickableDisabled && label_default.modifiers.disabled, colorStyles[color2], variant === "outline" && label_default.modifiers.outline, isOverflowLabel && label_default.modifiers.overflow, isCompact && label_default.modifiers.compact, isEditable && label_group_default.modifiers.editable, isEditableActive && label_default.modifiers.editableActive, className), onClick: isOverflowLabel ? onLabelClick : void 0 }, LabelComponent === "button" && { type: "button" }),
      !isEditableActive && labelComponentChild,
      !isEditableActive && onClose && closeButton,
      isEditableActive && React141.createElement("input", Object.assign({ className: css(label_default.labelContent), type: "text", id: "editable-input", ref: editableInputRef, value: currValue, onChange: updateVal }, editableProps))
    );
  };
  Label.displayName = "Label";

  // node_modules/@patternfly/react-core/dist/esm/components/Label/LabelGroup.js
  init_tslib_es6();
  var React142 = __toESM(require_react());
  var LabelGroup = class extends React142.Component {
    constructor(props) {
      super(props);
      this.headingRef = React142.createRef();
      this.toggleCollapse = () => {
        this.setState((prevState) => ({
          isOpen: !prevState.isOpen,
          isTooltipVisible: Boolean(this.headingRef.current && this.headingRef.current.offsetWidth < this.headingRef.current.scrollWidth)
        }));
      };
      this.state = {
        isOpen: this.props.defaultIsOpen,
        isTooltipVisible: false
      };
    }
    componentDidMount() {
      this.setState({
        isTooltipVisible: Boolean(this.headingRef.current && this.headingRef.current.offsetWidth < this.headingRef.current.scrollWidth)
      });
    }
    renderLabel(id) {
      const { categoryName, tooltipPosition } = this.props;
      const { isTooltipVisible } = this.state;
      return isTooltipVisible ? React142.createElement(
        Tooltip,
        { position: tooltipPosition, content: categoryName },
        React142.createElement(
          "span",
          { tabIndex: 0, ref: this.headingRef, className: css(label_group_default.labelGroupLabel) },
          React142.createElement("span", { "aria-hidden": "true", id }, categoryName)
        )
      ) : React142.createElement("span", { ref: this.headingRef, className: css(label_group_default.labelGroupLabel), "aria-hidden": "true", id }, categoryName);
    }
    render() {
      const _a = this.props, {
        categoryName,
        children,
        className,
        isClosable,
        isCompact,
        closeBtnAriaLabel,
        "aria-label": ariaLabel,
        onClick,
        numLabels,
        expandedText,
        collapsedText,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        defaultIsOpen,
        tooltipPosition,
        isVertical: isVertical2,
        isEditable,
        hasEditableTextArea,
        editableTextAreaProps,
        addLabelControl
      } = _a, rest = __rest(_a, ["categoryName", "children", "className", "isClosable", "isCompact", "closeBtnAriaLabel", "aria-label", "onClick", "numLabels", "expandedText", "collapsedText", "defaultIsOpen", "tooltipPosition", "isVertical", "isEditable", "hasEditableTextArea", "editableTextAreaProps", "addLabelControl"]);
      const { isOpen } = this.state;
      const renderedChildren = React142.Children.toArray(children);
      const numChildren = renderedChildren.length;
      const collapsedTextResult = fillTemplate(collapsedText, {
        remaining: numChildren - numLabels
      });
      const renderLabelGroup = (id) => {
        const labelArray = !isOpen ? renderedChildren.slice(0, numLabels) : renderedChildren;
        const content = React142.createElement(
          React142.Fragment,
          null,
          categoryName && this.renderLabel(id),
          React142.createElement(
            "ul",
            Object.assign({ className: css(label_group_default.labelGroupList) }, categoryName && { "aria-labelledby": id }, !categoryName && { "aria-label": ariaLabel }, { role: "list" }, rest),
            labelArray.map((child, i) => React142.createElement("li", { className: css(label_group_default.labelGroupListItem), key: i }, child)),
            numChildren > numLabels && React142.createElement(
              "li",
              { className: css(label_group_default.labelGroupListItem) },
              React142.createElement(Label, { isOverflowLabel: true, onClick: this.toggleCollapse, className: css(isCompact && label_default.modifiers.compact) }, isOpen ? expandedText : collapsedTextResult)
            ),
            addLabelControl && React142.createElement("li", { className: css(label_group_default.labelGroupListItem) }, addLabelControl),
            isEditable && hasEditableTextArea && React142.createElement(
              "li",
              { className: css(label_group_default.labelGroupListItem, label_group_default.modifiers.textarea) },
              React142.createElement("textarea", Object.assign({ className: css(label_group_default.labelGroupTextarea), rows: 1, tabIndex: 0 }, editableTextAreaProps))
            )
          )
        );
        const close = React142.createElement(
          "div",
          { className: css(label_group_default.labelGroupClose) },
          React142.createElement(
            Button,
            { variant: "plain", "aria-label": closeBtnAriaLabel, onClick, id: `remove_group_${id}`, "aria-labelledby": `remove_group_${id} ${id}` },
            React142.createElement(times_circle_icon_default, { "aria-hidden": "true" })
          )
        );
        return React142.createElement(
          "div",
          { className: css(label_group_default.labelGroup, className, categoryName && label_group_default.modifiers.category, isVertical2 && label_group_default.modifiers.vertical, isEditable && label_group_default.modifiers.editable) },
          React142.createElement("div", { className: css(label_group_default.labelGroupMain) }, content),
          isClosable && close
        );
      };
      return numChildren === 0 && addLabelControl === void 0 ? null : React142.createElement(GenerateId, null, (randomId) => renderLabelGroup(this.props.id || randomId));
    }
  };
  LabelGroup.displayName = "LabelGroup";
  LabelGroup.defaultProps = {
    expandedText: "Show Less",
    collapsedText: "${remaining} more",
    categoryName: "",
    defaultIsOpen: false,
    numLabels: 3,
    isClosable: false,
    isCompact: false,
    onClick: (_e) => void 0,
    closeBtnAriaLabel: "Close label group",
    tooltipPosition: "top",
    "aria-label": "Label group category",
    isVertical: false,
    isEditable: false,
    hasEditableTextArea: false
  };

  // node_modules/@patternfly/react-core/dist/esm/components/List/List.js
  init_tslib_es6();
  var React143 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/List/list.mjs
  var list_default = {
    "list": "pf-v5-c-list",
    "listItem": "pf-v5-c-list__item",
    "listItemIcon": "pf-v5-c-list__item-icon",
    "modifiers": {
      "iconLg": "pf-m-icon-lg",
      "plain": "pf-m-plain",
      "inline": "pf-m-inline",
      "bordered": "pf-m-bordered"
    }
  };

  // node_modules/@patternfly/react-core/dist/esm/components/List/List.js
  var OrderType;
  (function(OrderType2) {
    OrderType2["number"] = "1";
    OrderType2["lowercaseLetter"] = "a";
    OrderType2["uppercaseLetter"] = "A";
    OrderType2["lowercaseRomanNumber"] = "i";
    OrderType2["uppercaseRomanNumber"] = "I";
  })(OrderType || (OrderType = {}));
  var ListVariant;
  (function(ListVariant2) {
    ListVariant2["inline"] = "inline";
  })(ListVariant || (ListVariant = {}));
  var ListComponent;
  (function(ListComponent2) {
    ListComponent2["ol"] = "ol";
    ListComponent2["ul"] = "ul";
  })(ListComponent || (ListComponent = {}));
  var List = (_a) => {
    var { className = "", children = null, variant = null, isBordered = false, isPlain = false, iconSize = "default", type = OrderType.number, ref = null, component = ListComponent.ul } = _a, props = __rest(_a, ["className", "children", "variant", "isBordered", "isPlain", "iconSize", "type", "ref", "component"]);
    return component === ListComponent.ol ? React143.createElement("ol", Object.assign({ ref, type }, isPlain && { role: "list" }, props, { className: css(list_default.list, variant && list_default.modifiers[variant], isBordered && list_default.modifiers.bordered, isPlain && list_default.modifiers.plain, iconSize && iconSize === "large" && list_default.modifiers.iconLg, className) }), children) : React143.createElement("ul", Object.assign({ ref }, isPlain && { role: "list" }, props, { className: css(list_default.list, variant && list_default.modifiers[variant], isBordered && list_default.modifiers.bordered, isPlain && list_default.modifiers.plain, iconSize && iconSize === "large" && list_default.modifiers.iconLg, className) }), children);
  };
  List.displayName = "List";

  // node_modules/@patternfly/react-core/dist/esm/components/List/ListItem.js
  init_tslib_es6();
  var React144 = __toESM(require_react());
  var ListItem = (_a) => {
    var { icon = null, children = null } = _a, props = __rest(_a, ["icon", "children"]);
    return React144.createElement(
      "li",
      Object.assign({ className: css(icon && list_default.listItem) }, props),
      icon && React144.createElement("span", { className: css(list_default.listItemIcon) }, icon),
      children
    );
  };
  ListItem.displayName = "ListItem";

  // node_modules/@patternfly/react-icons/dist/esm/icons/eye-slash-icon.js
  var EyeSlashIconConfig = {
    name: "EyeSlashIcon",
    height: 512,
    width: 640,
    svgPath: "M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z",
    yOffset: 0,
    xOffset: 0
  };
  var EyeSlashIcon = createIcon(EyeSlashIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/eye-icon.js
  var EyeIconConfig = {
    name: "EyeIcon",
    height: 512,
    width: 576,
    svgPath: "M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z",
    yOffset: 0,
    xOffset: 0
  };
  var EyeIcon = createIcon(EyeIconConfig);

  // node_modules/@patternfly/react-core/dist/esm/components/Page/PageContext.js
  var React145 = __toESM(require_react());
  var pageContextDefaults = {
    isManagedSidebar: false,
    isSidebarOpen: false,
    onSidebarToggle: () => null,
    width: null,
    height: null,
    getBreakpoint,
    getVerticalBreakpoint
  };
  var PageContext = React145.createContext(pageContextDefaults);
  var PageContextProvider = PageContext.Provider;
  var PageContextConsumer = PageContext.Consumer;

  // node_modules/@patternfly/react-icons/dist/esm/icons/in-progress-icon.js
  var InProgressIconConfig = {
    name: "InProgressIcon",
    height: 1024,
    width: 1024,
    svgPath: "M513.417211,16.013668 L513.417211,112.013668 C513.406007,120.539653 520.082422,127.576718 528.597211,128.013668 C732.697211,136.513668 896.147211,305.013668 896.147211,511.343668 C896.147211,723.013668 724.007211,895.163668 512.417211,895.163668 C437.186239,895.277345 363.602574,873.135095 300.927211,831.523668 C294.58293,827.2982 286.138663,828.135095 280.747211,833.523668 L211.807211,902.353668 C208.502935,905.676185 206.82123,910.280199 207.20607,914.950237 C207.590911,919.620275 210.00361,923.886884 213.807211,926.623668 C300.709573,989.398037 405.213535,1023.13146 512.417211,1023.01398 C794.537211,1023.01398 1023.91724,793.433668 1023.91724,511.413668 C1024.00721,235.103668 804.007211,9.22366802 529.897211,0.00645736761 C525.571205,-0.116171039 521.377128,1.51204372 518.271915,4.52681369 C515.166702,7.54158367 513.415263,11.6857144 513.417211,16.013668 M97.1272107,212.923668 C64.2190689,258.479443 39.0698895,309.162997 22.6972107,362.923668 C21.2705092,367.756559 22.2039184,372.979173 25.2163356,377.018685 C28.2287528,381.058197 32.9681443,383.442545 38.0072107,383.453683 L139.407211,383.453683 C145.970195,383.46249 151.873012,379.462528 154.297211,373.363668 C164.307669,347.593304 177.068112,322.977652 192.357211,299.943668 C196.579666,293.633658 195.741339,285.216847 190.357211,279.863668 L121.497211,211.013668 C118.186635,207.662531 113.567544,205.940538 108.871166,206.30669 C104.174788,206.672841 99.8783994,209.089927 97.1272107,212.913668 M112.907211,511.433663 L17.0072107,511.433663 C12.679257,511.433663 8.5351263,513.183159 5.52035633,516.288373 C2.50558635,519.393586 0.877371594,523.587662 1.00721065,527.913668 C4.13104542,629.408217 37.6085847,727.635936 97.1172107,809.913668 C99.8539943,813.717268 104.120603,816.129968 108.790642,816.514809 C113.46068,816.899649 118.064693,815.217944 121.387211,811.913668 L190.217211,743.073668 C195.605784,737.682216 196.442679,729.237949 192.217211,722.893668 C153.520825,664.580171 131.611534,596.745437 128.887211,526.813668 C128.553964,518.220138 121.487197,511.427209 112.887211,511.433663",
    yOffset: 0,
    xOffset: 0
  };
  var InProgressIcon = createIcon(InProgressIconConfig);
  var in_progress_icon_default = InProgressIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Progress/Progress.js
  init_tslib_es6();
  var React149 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Progress/progress.mjs
  var progress_default = {
    "modifiers": {
      "sm": "pf-m-sm",
      "lg": "pf-m-lg",
      "inside": "pf-m-inside",
      "outside": "pf-m-outside",
      "staticWidth": "pf-m-static-width",
      "singleline": "pf-m-singleline",
      "success": "pf-m-success",
      "warning": "pf-m-warning",
      "danger": "pf-m-danger",
      "truncate": "pf-m-truncate"
    },
    "progress": "pf-v5-c-progress",
    "progressBar": "pf-v5-c-progress__bar",
    "progressDescription": "pf-v5-c-progress__description",
    "progressHelperText": "pf-v5-c-progress__helper-text",
    "progressIndicator": "pf-v5-c-progress__indicator",
    "progressMeasure": "pf-v5-c-progress__measure",
    "progressStatus": "pf-v5-c-progress__status",
    "progressStatusIcon": "pf-v5-c-progress__status-icon",
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Progress/ProgressContainer.js
  var React148 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Progress/ProgressBar.js
  init_tslib_es6();
  var React146 = __toESM(require_react());
  var ProgressBar = (_a) => {
    var { progressBarAriaProps, className = "", children = null, value } = _a, props = __rest(_a, ["progressBarAriaProps", "className", "children", "value"]);
    return React146.createElement(
      "div",
      Object.assign({}, props, { className: css(progress_default.progressBar, className) }, progressBarAriaProps),
      React146.createElement(
        "div",
        { className: css(progress_default.progressIndicator), style: { width: `${value}%` } },
        React146.createElement("span", { className: css(progress_default.progressMeasure) }, children)
      )
    );
  };
  ProgressBar.displayName = "ProgressBar";

  // node_modules/@patternfly/react-core/dist/esm/components/Progress/ProgressHelperText.js
  init_tslib_es6();
  var React147 = __toESM(require_react());
  var ProgressHelperText = (_a) => {
    var { children } = _a, props = __rest(_a, ["children"]);
    return React147.createElement("div", Object.assign({ className: progress_default.progressHelperText }, props), children);
  };
  ProgressHelperText.displayName = "ProgressHelperText";

  // node_modules/@patternfly/react-core/dist/esm/components/Progress/ProgressContainer.js
  var ProgressMeasureLocation;
  (function(ProgressMeasureLocation2) {
    ProgressMeasureLocation2["outside"] = "outside";
    ProgressMeasureLocation2["inside"] = "inside";
    ProgressMeasureLocation2["top"] = "top";
    ProgressMeasureLocation2["none"] = "none";
  })(ProgressMeasureLocation || (ProgressMeasureLocation = {}));
  var ProgressVariant;
  (function(ProgressVariant2) {
    ProgressVariant2["danger"] = "danger";
    ProgressVariant2["success"] = "success";
    ProgressVariant2["warning"] = "warning";
  })(ProgressVariant || (ProgressVariant = {}));
  var variantToIcon = {
    danger: times_circle_icon_default,
    success: check_circle_icon_default,
    warning: exclamation_triangle_icon_default
  };
  var ProgressContainer = ({ progressBarAriaProps, value, title = "", parentId, label = null, variant = null, measureLocation = ProgressMeasureLocation.top, isTitleTruncated = false, tooltipPosition, helperText }) => {
    const StatusIcon = variantToIcon.hasOwnProperty(variant) && variantToIcon[variant];
    const [tooltip, setTooltip] = React148.useState("");
    const onMouseEnter = (event) => {
      if (event.target.offsetWidth < event.target.scrollWidth) {
        setTooltip(title || event.target.innerHTML);
      } else {
        setTooltip("");
      }
    };
    const Title2 = React148.createElement("div", { className: css(progress_default.progressDescription, isTitleTruncated && typeof title === "string" && progress_default.modifiers.truncate), id: `${parentId}-description`, "aria-hidden": "true", onMouseEnter: isTitleTruncated && typeof title === "string" ? onMouseEnter : null }, title);
    return React148.createElement(
      React148.Fragment,
      null,
      title && (tooltip ? React148.createElement(Tooltip, { position: tooltipPosition, content: tooltip, isVisible: true }, Title2) : Title2),
      (measureLocation !== ProgressMeasureLocation.none || StatusIcon) && React148.createElement(
        "div",
        { className: css(progress_default.progressStatus), "aria-hidden": "true" },
        (measureLocation === ProgressMeasureLocation.top || measureLocation === ProgressMeasureLocation.outside) && React148.createElement("span", { className: css(progress_default.progressMeasure) }, label || `${value}%`),
        StatusIcon && React148.createElement(
          "span",
          { className: css(progress_default.progressStatusIcon) },
          React148.createElement(StatusIcon, null)
        )
      ),
      React148.createElement(ProgressBar, { role: "progressbar", progressBarAriaProps, value }, measureLocation === ProgressMeasureLocation.inside && `${value}%`),
      helperText && React148.createElement(ProgressHelperText, null, helperText)
    );
  };
  ProgressContainer.displayName = "ProgressContainer";

  // node_modules/@patternfly/react-core/dist/esm/components/Progress/Progress.js
  var ProgressSize;
  (function(ProgressSize2) {
    ProgressSize2["sm"] = "sm";
    ProgressSize2["md"] = "md";
    ProgressSize2["lg"] = "lg";
  })(ProgressSize || (ProgressSize = {}));
  var Progress = class extends React149.Component {
    constructor() {
      super(...arguments);
      this.id = this.props.id || getUniqueId();
    }
    render() {
      const _a = this.props, {
        /* eslint-disable @typescript-eslint/no-unused-vars */
        id,
        size,
        /* eslint-enable @typescript-eslint/no-unused-vars */
        className,
        value,
        title,
        label,
        variant,
        measureLocation,
        min: min3,
        max: max3,
        valueText,
        isTitleTruncated,
        tooltipPosition,
        "aria-label": ariaLabel,
        "aria-labelledby": ariaLabelledBy,
        helperText
      } = _a, props = __rest(_a, ["id", "size", "className", "value", "title", "label", "variant", "measureLocation", "min", "max", "valueText", "isTitleTruncated", "tooltipPosition", "aria-label", "aria-labelledby", "helperText"]);
      const progressBarAriaProps = {
        "aria-valuemin": min3,
        "aria-valuenow": value,
        "aria-valuemax": max3
      };
      if (title || ariaLabelledBy) {
        progressBarAriaProps["aria-labelledby"] = title ? `${this.id}-description` : ariaLabelledBy;
      }
      if (ariaLabel) {
        progressBarAriaProps["aria-label"] = ariaLabel;
      }
      if (valueText) {
        progressBarAriaProps["aria-valuetext"] = valueText;
      }
      if (!title && !ariaLabelledBy && !ariaLabel) {
        console.warn("One of aria-label or aria-labelledby properties should be passed when using the progress component without a title.");
      }
      const scaledValue = Math.min(100, Math.max(0, Math.floor((value - min3) / (max3 - min3) * 100))) || 0;
      return React149.createElement(
        "div",
        Object.assign({}, props, { className: css(progress_default.progress, progress_default.modifiers[variant], ["inside", "outside"].includes(measureLocation) && progress_default.modifiers[measureLocation], measureLocation === "inside" ? progress_default.modifiers[ProgressSize.lg] : progress_default.modifiers[size], !title && progress_default.modifiers.singleline, className), id: this.id }),
        React149.createElement(ProgressContainer, { parentId: this.id, value: scaledValue, title, label, variant, measureLocation, progressBarAriaProps, isTitleTruncated, tooltipPosition, helperText })
      );
    }
  };
  Progress.displayName = "Progress";
  Progress.defaultProps = {
    className: "",
    measureLocation: ProgressMeasureLocation.top,
    variant: null,
    id: "",
    title: "",
    min: 0,
    max: 100,
    size: null,
    label: null,
    value: 0,
    valueText: null,
    isTitleTruncated: false,
    tooltipPosition: "top",
    "aria-label": null,
    "aria-labelledby": null
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Nav/Nav.js
  init_tslib_es6();
  var React150 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Nav/nav.mjs
  var nav_default = {
    "dirRtl": "pf-v5-m-dir-rtl",
    "divider": "pf-v5-c-divider",
    "menu": "pf-v5-c-menu",
    "menuContent": "pf-v5-c-menu__content",
    "menuItem": "pf-v5-c-menu__item",
    "menuItemToggleIcon": "pf-v5-c-menu__item-toggle-icon",
    "menuListItem": "pf-v5-c-menu__list-item",
    "modifiers": {
      "flyout": "pf-m-flyout",
      "top": "pf-m-top",
      "left": "pf-m-left",
      "current": "pf-m-current",
      "drillUp": "pf-m-drill-up",
      "horizontal": "pf-m-horizontal",
      "tertiary": "pf-m-tertiary",
      "horizontalSubnav": "pf-m-horizontal-subnav",
      "light": "pf-m-light",
      "scrollable": "pf-m-scrollable",
      "overflowHidden": "pf-m-overflow-hidden",
      "expandable": "pf-m-expandable",
      "expanded": "pf-m-expanded",
      "drilldown": "pf-m-drilldown",
      "hover": "pf-m-hover",
      "start": "pf-m-start"
    },
    "nav": "pf-v5-c-nav",
    "navItem": "pf-v5-c-nav__item",
    "navLink": "pf-v5-c-nav__link",
    "navList": "pf-v5-c-nav__list",
    "navScrollButton": "pf-v5-c-nav__scroll-button",
    "navSection": "pf-v5-c-nav__section",
    "navSectionTitle": "pf-v5-c-nav__section-title",
    "navSubnav": "pf-v5-c-nav__subnav",
    "navToggle": "pf-v5-c-nav__toggle",
    "navToggleIcon": "pf-v5-c-nav__toggle-icon",
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Nav/Nav.js
  var navContextDefaults = {};
  var NavContext = React150.createContext(navContextDefaults);
  var Nav = class _Nav extends React150.Component {
    constructor() {
      super(...arguments);
      this.state = {
        isScrollable: false,
        ouiaStateId: getDefaultOUIAId(_Nav.displayName, this.props.variant),
        flyoutRef: null
      };
      this.navRef = React150.createRef();
    }
    // Callback from NavItem
    onSelect(event, groupId, itemId, to, preventDefault, onClick) {
      if (preventDefault) {
        event.preventDefault();
      }
      this.props.onSelect(event, { groupId, itemId, to });
      if (onClick) {
        onClick(event, itemId, groupId, to);
      }
    }
    // Callback from NavExpandable
    onToggle(event, groupId, toggleValue) {
      this.props.onToggle(event, {
        groupId,
        isExpanded: toggleValue
      });
    }
    render() {
      const _a = this.props, {
        "aria-label": ariaLabel,
        children,
        className,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        onSelect,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        onToggle,
        theme,
        ouiaId,
        ouiaSafe,
        variant
      } = _a, props = __rest(_a, ["aria-label", "children", "className", "onSelect", "onToggle", "theme", "ouiaId", "ouiaSafe", "variant"]);
      const isHorizontal2 = ["horizontal", "tertiary"].includes(variant);
      return React150.createElement(
        NavContext.Provider,
        { value: {
          onSelect: (event, groupId, itemId, to, preventDefault, onClick) => this.onSelect(event, groupId, itemId, to, preventDefault, onClick),
          onToggle: (event, groupId, expanded) => this.onToggle(event, groupId, expanded),
          updateIsScrollable: (isScrollable) => this.setState({ isScrollable }),
          isHorizontal: ["horizontal", "tertiary", "horizontal-subnav"].includes(variant),
          flyoutRef: this.state.flyoutRef,
          setFlyoutRef: (flyoutRef) => this.setState({ flyoutRef }),
          navRef: this.navRef
        } },
        React150.createElement("nav", Object.assign({ className: css(nav_default.nav, theme === "light" && nav_default.modifiers.light, isHorizontal2 && nav_default.modifiers.horizontal, variant === "tertiary" && nav_default.modifiers.tertiary, variant === "horizontal-subnav" && nav_default.modifiers.horizontalSubnav, this.state.isScrollable && nav_default.modifiers.scrollable, className), "aria-label": ariaLabel || (["tertiary", "horizontal-subnav"].includes(variant) ? "Local" : "Global"), ref: this.navRef }, getOUIAProps(_Nav.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe), props), children)
      );
    }
  };
  Nav.displayName = "Nav";
  Nav.defaultProps = {
    onSelect: () => void 0,
    onToggle: () => void 0,
    theme: "dark",
    ouiaSafe: true
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Nav/NavList.js
  init_tslib_es6();
  var React152 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Page/PageSidebar.js
  init_tslib_es6();
  var React151 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Page/page.mjs
  var page_default = {
    "avatar": "pf-v5-c-avatar",
    "brand": "pf-v5-c-brand",
    "button": "pf-v5-c-button",
    "contextSelector": "pf-v5-c-context-selector",
    "dirRtl": "pf-v5-m-dir-rtl",
    "drawer": "pf-v5-c-drawer",
    "masthead": "pf-v5-c-masthead",
    "modifiers": {
      "light": "pf-m-light",
      "menu": "pf-m-menu",
      "hidden": "pf-m-hidden",
      "hiddenOnSm": "pf-m-hidden-on-sm",
      "visibleOnSm": "pf-m-visible-on-sm",
      "hiddenOnMd": "pf-m-hidden-on-md",
      "visibleOnMd": "pf-m-visible-on-md",
      "hiddenOnLg": "pf-m-hidden-on-lg",
      "visibleOnLg": "pf-m-visible-on-lg",
      "hiddenOnXl": "pf-m-hidden-on-xl",
      "visibleOnXl": "pf-m-visible-on-xl",
      "hiddenOn_2xl": "pf-m-hidden-on-2xl",
      "visibleOn_2xl": "pf-m-visible-on-2xl",
      "read": "pf-m-read",
      "selected": "pf-m-selected",
      "unread": "pf-m-unread",
      "attention": "pf-m-attention",
      "expanded": "pf-m-expanded",
      "collapsed": "pf-m-collapsed",
      "pageInsets": "pf-m-page-insets",
      "insetNone": "pf-m-inset-none",
      "fill": "pf-m-fill",
      "noFill": "pf-m-no-fill",
      "limitWidth": "pf-m-limit-width",
      "alignCenter": "pf-m-align-center",
      "overflowScroll": "pf-m-overflow-scroll",
      "shadowBottom": "pf-m-shadow-bottom",
      "shadowTop": "pf-m-shadow-top",
      "stickyTop": "pf-m-sticky-top",
      "stickyBottom": "pf-m-sticky-bottom",
      "stickyTopOnSmHeight": "pf-m-sticky-top-on-sm-height",
      "stickyBottomOnSmHeight": "pf-m-sticky-bottom-on-sm-height",
      "stickyTopOnMdHeight": "pf-m-sticky-top-on-md-height",
      "stickyBottomOnMdHeight": "pf-m-sticky-bottom-on-md-height",
      "stickyTopOnLgHeight": "pf-m-sticky-top-on-lg-height",
      "stickyBottomOnLgHeight": "pf-m-sticky-bottom-on-lg-height",
      "stickyTopOnXlHeight": "pf-m-sticky-top-on-xl-height",
      "stickyBottomOnXlHeight": "pf-m-sticky-bottom-on-xl-height",
      "stickyTopOn_2xlHeight": "pf-m-sticky-top-on-2xl-height",
      "stickyBottomOn_2xlHeight": "pf-m-sticky-bottom-on-2xl-height",
      "light_100": "pf-m-light-100",
      "dark_100": "pf-m-dark-100",
      "dark_200": "pf-m-dark-200",
      "padding": "pf-m-padding",
      "noPadding": "pf-m-no-padding",
      "paddingOnSm": "pf-m-padding-on-sm",
      "noPaddingOnSm": "pf-m-no-padding-on-sm",
      "paddingOnMd": "pf-m-padding-on-md",
      "noPaddingOnMd": "pf-m-no-padding-on-md",
      "paddingOnLg": "pf-m-padding-on-lg",
      "noPaddingOnLg": "pf-m-no-padding-on-lg",
      "paddingOnXl": "pf-m-padding-on-xl",
      "noPaddingOnXl": "pf-m-no-padding-on-xl",
      "paddingOn_2xl": "pf-m-padding-on-2xl",
      "noPaddingOn_2xl": "pf-m-no-padding-on-2xl",
      "light_200": "pf-m-light-200"
    },
    "nav": "pf-v5-c-nav",
    "notificationBadge": "pf-v5-c-notification-badge",
    "page": "pf-v5-c-page",
    "pageDrawer": "pf-v5-c-page__drawer",
    "pageHeader": "pf-v5-c-page__header",
    "pageHeaderBrand": "pf-v5-c-page__header-brand",
    "pageHeaderBrandLink": "pf-v5-c-page__header-brand-link",
    "pageHeaderBrandToggle": "pf-v5-c-page__header-brand-toggle",
    "pageHeaderNav": "pf-v5-c-page__header-nav",
    "pageHeaderTools": "pf-v5-c-page__header-tools",
    "pageHeaderToolsGroup": "pf-v5-c-page__header-tools-group",
    "pageHeaderToolsItem": "pf-v5-c-page__header-tools-item",
    "pageMain": "pf-v5-c-page__main",
    "pageMainBody": "pf-v5-c-page__main-body",
    "pageMainBreadcrumb": "pf-v5-c-page__main-breadcrumb",
    "pageMainDrawer": "pf-v5-c-page__main-drawer",
    "pageMainGroup": "pf-v5-c-page__main-group",
    "pageMainNav": "pf-v5-c-page__main-nav",
    "pageMainSection": "pf-v5-c-page__main-section",
    "pageMainSubnav": "pf-v5-c-page__main-subnav",
    "pageMainTabs": "pf-v5-c-page__main-tabs",
    "pageMainWizard": "pf-v5-c-page__main-wizard",
    "pageSidebar": "pf-v5-c-page__sidebar",
    "pageSidebarBody": "pf-v5-c-page__sidebar-body",
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Page/PageSidebar.js
  var pageSidebarContextDefaults = {
    isSidebarOpen: true
  };
  var PageSidebarContext = React151.createContext(pageSidebarContextDefaults);
  var PageSidebar = (_a) => {
    var { className = "", children, isSidebarOpen = true, theme = "dark", id = "page-sidebar" } = _a, props = __rest(_a, ["className", "children", "isSidebarOpen", "theme", "id"]);
    return React151.createElement(PageContextConsumer, null, ({ isManagedSidebar, isSidebarOpen: managedIsNavOpen }) => {
      const sidebarOpen = isManagedSidebar ? managedIsNavOpen : isSidebarOpen;
      return React151.createElement(
        "div",
        Object.assign({ id, className: css(page_default.pageSidebar, theme === "light" && page_default.modifiers.light, sidebarOpen && page_default.modifiers.expanded, !sidebarOpen && page_default.modifiers.collapsed, className), "aria-hidden": !sidebarOpen }, props),
        React151.createElement(PageSidebarContext.Provider, { value: { isSidebarOpen: sidebarOpen } }, children)
      );
    });
  };
  PageSidebar.displayName = "PageSidebar";

  // node_modules/@patternfly/react-core/dist/esm/components/Nav/NavList.js
  var NavList = class extends React152.Component {
    constructor() {
      super(...arguments);
      this.direction = "ltr";
      this.state = {
        scrollViewAtStart: false,
        scrollViewAtEnd: false
      };
      this.navList = React152.createRef();
      this.observer = () => {
      };
      this.handleScrollButtons = () => {
        const container = this.navList.current;
        if (container) {
          const scrollViewAtStart = isElementInView(container, container.firstChild, false);
          const scrollViewAtEnd = isElementInView(container, container.lastChild, false);
          this.setState({
            scrollViewAtStart,
            scrollViewAtEnd
          });
          this.context.updateIsScrollable(!scrollViewAtStart || !scrollViewAtEnd);
        }
      };
      this.scrollBack = () => {
        const container = this.navList.current;
        if (container) {
          const childrenArr = Array.from(container.children);
          let firstElementInView;
          let lastElementOutOfView;
          for (let i = 0; i < childrenArr.length && !firstElementInView; i++) {
            if (isElementInView(container, childrenArr[i], false)) {
              firstElementInView = childrenArr[i];
              lastElementOutOfView = childrenArr[i - 1];
            }
          }
          if (lastElementOutOfView) {
            if (this.direction === "ltr") {
              container.scrollLeft -= lastElementOutOfView.scrollWidth;
            } else {
              container.scrollLeft += lastElementOutOfView.scrollWidth;
            }
          }
          this.handleScrollButtons();
        }
      };
      this.scrollForward = () => {
        const container = this.navList.current;
        if (container) {
          const childrenArr = Array.from(container.children);
          let lastElementInView;
          let firstElementOutOfView;
          for (let i = childrenArr.length - 1; i >= 0 && !lastElementInView; i--) {
            if (isElementInView(container, childrenArr[i], false)) {
              lastElementInView = childrenArr[i];
              firstElementOutOfView = childrenArr[i + 1];
            }
          }
          if (firstElementOutOfView) {
            if (this.direction === "ltr") {
              container.scrollLeft += firstElementOutOfView.scrollWidth;
            } else {
              container.scrollLeft -= firstElementOutOfView.scrollWidth;
            }
          }
          this.handleScrollButtons();
        }
      };
    }
    componentDidMount() {
      this.observer = getResizeObserver(this.navList.current, this.handleScrollButtons, true);
      this.direction = getLanguageDirection(this.navList.current);
      this.handleScrollButtons();
    }
    componentWillUnmount() {
      this.observer();
    }
    componentDidUpdate() {
      this.direction = getLanguageDirection(this.navList.current);
    }
    render() {
      const _a = this.props, { children, className, ariaLeftScroll, ariaRightScroll, backScrollAriaLabel, forwardScrollAriaLabel } = _a, props = __rest(_a, ["children", "className", "ariaLeftScroll", "ariaRightScroll", "backScrollAriaLabel", "forwardScrollAriaLabel"]);
      const { scrollViewAtStart, scrollViewAtEnd } = this.state;
      return React152.createElement(NavContext.Consumer, null, ({ isHorizontal: isHorizontal2 }) => React152.createElement(PageSidebarContext.Consumer, null, ({ isSidebarOpen }) => React152.createElement(
        React152.Fragment,
        null,
        isHorizontal2 && React152.createElement(
          "button",
          { className: css(nav_default.navScrollButton), "aria-label": backScrollAriaLabel || ariaLeftScroll, onClick: this.scrollBack, disabled: scrollViewAtStart, tabIndex: isSidebarOpen ? null : -1 },
          React152.createElement(angle_left_icon_default, null)
        ),
        React152.createElement("ul", Object.assign({ ref: this.navList, className: css(nav_default.navList, className), onScroll: this.handleScrollButtons, role: "list" }, props), children),
        isHorizontal2 && React152.createElement(
          "button",
          { className: css(nav_default.navScrollButton), "aria-label": forwardScrollAriaLabel || ariaRightScroll, onClick: this.scrollForward, disabled: scrollViewAtEnd, tabIndex: isSidebarOpen ? null : -1 },
          React152.createElement(angle_right_icon_default, null)
        )
      )));
    }
  };
  NavList.displayName = "NavList";
  NavList.contextType = NavContext;
  NavList.defaultProps = {
    ariaLeftScroll: "Scroll left",
    backScrollAriaLabel: "Scroll back",
    ariaRightScroll: "Scroll right",
    forwardScrollAriaLabel: "Scroll foward"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Nav/NavItem.js
  init_tslib_es6();
  var React153 = __toESM(require_react());
  var NavItem = (_a) => {
    var { children, styleChildren = true, className, to, isActive = false, groupId = null, itemId = null, preventDefault = false, onClick, component = "a", flyout, onShowFlyout, ouiaId, ouiaSafe, zIndex = 9999, hasNavLinkWrapper } = _a, props = __rest(_a, ["children", "styleChildren", "className", "to", "isActive", "groupId", "itemId", "preventDefault", "onClick", "component", "flyout", "onShowFlyout", "ouiaId", "ouiaSafe", "zIndex", "hasNavLinkWrapper"]);
    const { flyoutRef, setFlyoutRef, navRef } = React153.useContext(NavContext);
    const { isSidebarOpen } = React153.useContext(PageSidebarContext);
    const [flyoutTarget, setFlyoutTarget] = React153.useState(null);
    const [isHovered, setIsHovered] = React153.useState(false);
    const ref = React153.useRef();
    const flyoutVisible = ref === flyoutRef;
    const popperRef = React153.useRef();
    const hasFlyout = flyout !== void 0;
    const Component40 = hasFlyout ? "button" : component;
    if (to && hasFlyout) {
      console.error('NavItem cannot have both "to" and "flyout" props.');
    }
    const showFlyout = (show, override) => {
      if ((!flyoutVisible || override) && show) {
        setFlyoutRef(ref);
      } else if ((flyoutVisible || override) && !show) {
        setFlyoutRef(null);
      }
      onShowFlyout && show && onShowFlyout();
    };
    const onMouseOver = (event) => {
      const evtContainedInFlyout = event.target.closest(`.${nav_default.navItem}.pf-m-flyout`);
      if (hasFlyout && !flyoutVisible) {
        showFlyout(true);
      } else if (flyoutRef !== null && !evtContainedInFlyout) {
        setFlyoutRef(null);
      }
    };
    const onFlyoutClick = (event) => {
      const target = event.target;
      const closestItem = target.closest(".pf-m-flyout");
      if (!closestItem) {
        if (hasFlyout) {
          showFlyout(false, true);
        } else if (flyoutRef !== null) {
          setFlyoutRef(null);
        }
      }
    };
    const handleFlyout = (event) => {
      var _a2, _b;
      const key = event.key;
      const target = event.target;
      if ((key === " " || key === "Enter" || key === "ArrowRight") && hasFlyout && ((_a2 = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a2 === void 0 ? void 0 : _a2.contains(target))) {
        event.stopPropagation();
        event.preventDefault();
        if (!flyoutVisible) {
          showFlyout(true);
          setFlyoutTarget(target);
        }
      }
      if ((key === "Escape" || key === "ArrowLeft") && ((_b = popperRef === null || popperRef === void 0 ? void 0 : popperRef.current) === null || _b === void 0 ? void 0 : _b.querySelectorAll(`.${nav_default.menu}`).length) === 1) {
        if (flyoutVisible) {
          event.stopPropagation();
          event.preventDefault();
          showFlyout(false);
        }
      }
    };
    React153.useEffect(() => {
      if (hasFlyout) {
        window.addEventListener("click", onFlyoutClick);
      }
      return () => {
        if (hasFlyout) {
          window.removeEventListener("click", onFlyoutClick);
        }
      };
    }, []);
    React153.useEffect(() => {
      if (flyoutTarget) {
        if (flyoutVisible) {
          const flyoutItems = Array.from(popperRef.current.getElementsByTagName("UL")[0].children).filter((el) => !(el.classList.contains("pf-m-disabled") || el.classList.contains(nav_default.divider)));
          flyoutItems[0].firstChild.focus();
        } else {
          flyoutTarget.focus();
        }
      }
    }, [flyoutVisible, flyoutTarget]);
    const flyoutButton = React153.createElement(
      "span",
      { className: css(nav_default.navToggle) },
      React153.createElement(
        "span",
        { className: css(nav_default.navToggleIcon) },
        React153.createElement(angle_right_icon_default, { "aria-hidden": true })
      )
    );
    const ariaFlyoutProps = {
      "aria-haspopup": "menu",
      "aria-expanded": flyoutVisible
    };
    const tabIndex = isSidebarOpen ? null : -1;
    const renderDefaultLink = (context) => {
      const preventLinkDefault = preventDefault || !to;
      return React153.createElement(
        Component40,
        Object.assign({ href: to, onClick: (e) => context.onSelect(e, groupId, itemId, to, preventLinkDefault, onClick), className: css(nav_default.navLink, isActive && nav_default.modifiers.current, isHovered && nav_default.modifiers.hover, className), "aria-current": isActive ? "page" : null, tabIndex }, hasFlyout && Object.assign({}, ariaFlyoutProps), props),
        hasNavLinkWrapper ? React153.createElement("span", { className: css(`${nav_default.nav}__link-text`) }, children) : children,
        flyout && flyoutButton
      );
    };
    const renderClonedChild = (context, child) => React153.cloneElement(child, Object.assign(Object.assign({ onClick: (e) => context.onSelect(e, groupId, itemId, to, preventDefault, onClick), "aria-current": isActive ? "page" : null }, styleChildren && {
      className: css(nav_default.navLink, isActive && nav_default.modifiers.current, child.props && child.props.className)
    }), { tabIndex: child.props.tabIndex || tabIndex, children: hasFlyout ? React153.createElement(
      React153.Fragment,
      null,
      child.props.children,
      flyoutButton
    ) : child.props.children }));
    const ouiaProps = useOUIAProps(NavItem.displayName, ouiaId, ouiaSafe);
    const handleMouseEnter = () => {
      setIsHovered(true);
    };
    const handleMouseLeave = () => {
      setIsHovered(false);
    };
    const flyoutPopper = React153.createElement(Popper, { triggerRef: ref, popper: React153.createElement("div", { ref: popperRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }, flyout), popperRef, placement: "right-start", isVisible: flyoutVisible, onDocumentKeyDown: handleFlyout, zIndex, appendTo: navRef === null || navRef === void 0 ? void 0 : navRef.current });
    const navItem = React153.createElement(
      React153.Fragment,
      null,
      React153.createElement(
        "li",
        Object.assign({ onMouseOver, className: css(nav_default.navItem, hasFlyout && nav_default.modifiers.flyout, className), ref }, ouiaProps),
        React153.createElement(NavContext.Consumer, null, (context) => React153.isValidElement(children) ? renderClonedChild(context, children) : renderDefaultLink(context))
      ),
      flyout && flyoutPopper
    );
    return navItem;
  };
  NavItem.displayName = "NavItem";

  // node_modules/@patternfly/react-core/dist/esm/components/Text/TextContent.js
  init_tslib_es6();
  var React154 = __toESM(require_react());
  var TextContent = (_a) => {
    var { children, className = "", isVisited = false } = _a, props = __rest(_a, ["children", "className", "isVisited"]);
    return React154.createElement("div", Object.assign({}, props, { className: css(content_default.content, isVisited && content_default.modifiers.visited, className) }), children);
  };
  TextContent.displayName = "TextContent";

  // node_modules/@patternfly/react-core/dist/esm/components/Text/Text.js
  init_tslib_es6();
  var React155 = __toESM(require_react());
  var TextVariants;
  (function(TextVariants2) {
    TextVariants2["h1"] = "h1";
    TextVariants2["h2"] = "h2";
    TextVariants2["h3"] = "h3";
    TextVariants2["h4"] = "h4";
    TextVariants2["h5"] = "h5";
    TextVariants2["h6"] = "h6";
    TextVariants2["p"] = "p";
    TextVariants2["a"] = "a";
    TextVariants2["small"] = "small";
    TextVariants2["blockquote"] = "blockquote";
    TextVariants2["pre"] = "pre";
  })(TextVariants || (TextVariants = {}));
  var Text = (_a) => {
    var { children = null, className = "", component = TextVariants.p, isVisitedLink = false, ouiaId, ouiaSafe = true } = _a, props = __rest(_a, ["children", "className", "component", "isVisitedLink", "ouiaId", "ouiaSafe"]);
    const Component40 = component;
    const ouiaProps = useOUIAProps(Text.displayName, ouiaId, ouiaSafe);
    return React155.createElement(Component40, Object.assign({}, ouiaProps, props, { "data-pf-content": true, className: css(isVisitedLink && component === TextVariants.a && content_default.modifiers.visited, className) }), children);
  };
  Text.displayName = "Text";

  // node_modules/@patternfly/react-core/dist/esm/components/Text/TextList.js
  init_tslib_es6();
  var React156 = __toESM(require_react());
  var TextListVariants;
  (function(TextListVariants2) {
    TextListVariants2["ul"] = "ul";
    TextListVariants2["ol"] = "ol";
    TextListVariants2["dl"] = "dl";
  })(TextListVariants || (TextListVariants = {}));
  var TextList = (_a) => {
    var { children = null, className = "", component = TextListVariants.ul, isPlain = false } = _a, props = __rest(_a, ["children", "className", "component", "isPlain"]);
    const Component40 = component;
    return React156.createElement(Component40, Object.assign({}, props, { className: css(isPlain && content_default.modifiers.plain, className) }), children);
  };
  TextList.displayName = "TextList";

  // node_modules/@patternfly/react-core/dist/esm/components/Text/TextListItem.js
  init_tslib_es6();
  var React157 = __toESM(require_react());
  var TextListItemVariants;
  (function(TextListItemVariants2) {
    TextListItemVariants2["li"] = "li";
    TextListItemVariants2["dt"] = "dt";
    TextListItemVariants2["dd"] = "dd";
  })(TextListItemVariants || (TextListItemVariants = {}));
  var TextListItem = (_a) => {
    var { children = null, className = "", component = TextListItemVariants.li } = _a, props = __rest(_a, ["children", "className", "component"]);
    const Component40 = component;
    return React157.createElement(Component40, Object.assign({}, props, { className: css(className) }), children);
  };
  TextListItem.displayName = "TextListItem";

  // node_modules/@patternfly/react-core/dist/esm/components/Page/PageSection.js
  init_tslib_es6();
  var React158 = __toESM(require_react());
  var PageSectionVariants;
  (function(PageSectionVariants2) {
    PageSectionVariants2["default"] = "default";
    PageSectionVariants2["light"] = "light";
    PageSectionVariants2["dark"] = "dark";
    PageSectionVariants2["darker"] = "darker";
  })(PageSectionVariants || (PageSectionVariants = {}));
  var PageSectionTypes;
  (function(PageSectionTypes2) {
    PageSectionTypes2["default"] = "default";
    PageSectionTypes2["nav"] = "nav";
    PageSectionTypes2["subNav"] = "subnav";
    PageSectionTypes2["breadcrumb"] = "breadcrumb";
    PageSectionTypes2["tabs"] = "tabs";
    PageSectionTypes2["wizard"] = "wizard";
  })(PageSectionTypes || (PageSectionTypes = {}));
  var variantType = {
    [PageSectionTypes.default]: page_default.pageMainSection,
    [PageSectionTypes.nav]: page_default.pageMainNav,
    [PageSectionTypes.subNav]: page_default.pageMainSubnav,
    [PageSectionTypes.breadcrumb]: page_default.pageMainBreadcrumb,
    [PageSectionTypes.tabs]: page_default.pageMainTabs,
    [PageSectionTypes.wizard]: page_default.pageMainWizard
  };
  var variantStyle2 = {
    [PageSectionVariants.default]: "",
    [PageSectionVariants.light]: page_default.modifiers.light,
    [PageSectionVariants.dark]: page_default.modifiers.dark_200,
    [PageSectionVariants.darker]: page_default.modifiers.dark_100
  };
  var PageSection = (_a) => {
    var { className = "", children, variant = "default", type = "default", padding: padding3, isFilled, isWidthLimited = false, isCenterAligned = false, stickyOnBreakpoint, hasShadowTop = false, hasShadowBottom = false, hasOverflowScroll = false, "aria-label": ariaLabel, component = "section" } = _a, props = __rest(_a, ["className", "children", "variant", "type", "padding", "isFilled", "isWidthLimited", "isCenterAligned", "stickyOnBreakpoint", "hasShadowTop", "hasShadowBottom", "hasOverflowScroll", "aria-label", "component"]);
    const { height, getVerticalBreakpoint: getVerticalBreakpoint2 } = React158.useContext(PageContext);
    React158.useEffect(() => {
      if (hasOverflowScroll && !ariaLabel) {
        console.warn("PageSection: An accessible aria-label is required when hasOverflowScroll is set to true.");
      }
    }, [hasOverflowScroll, ariaLabel]);
    const Component40 = component;
    return React158.createElement(
      Component40,
      Object.assign({}, props, { className: css(variantType[type], formatBreakpointMods(padding3, page_default), formatBreakpointMods(stickyOnBreakpoint, page_default, "sticky-", getVerticalBreakpoint2(height), true), variantStyle2[variant], isFilled === false && page_default.modifiers.noFill, isFilled === true && page_default.modifiers.fill, isWidthLimited && page_default.modifiers.limitWidth, isWidthLimited && isCenterAligned && type !== PageSectionTypes.subNav && page_default.modifiers.alignCenter, hasShadowTop && page_default.modifiers.shadowTop, hasShadowBottom && page_default.modifiers.shadowBottom, hasOverflowScroll && page_default.modifiers.overflowScroll, className) }, hasOverflowScroll && { tabIndex: 0 }, { "aria-label": ariaLabel }),
      isWidthLimited && React158.createElement("div", { className: css(page_default.pageMainBody) }, children),
      !isWidthLimited && children
    );
  };
  PageSection.displayName = "PageSection";

  // node_modules/@patternfly/react-core/dist/esm/components/Pagination/Pagination.js
  init_tslib_es6();
  var React162 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Pagination/ToggleTemplate.js
  var React159 = __toESM(require_react());
  var ToggleTemplate = ({ firstIndex = 0, lastIndex = 0, itemCount = 0, itemsTitle = "items", ofWord = "of" }) => React159.createElement(
    React159.Fragment,
    null,
    React159.createElement(
      "b",
      null,
      firstIndex,
      " - ",
      lastIndex
    ),
    " ",
    ofWord,
    " ",
    React159.createElement("b", null, itemCount),
    " ",
    itemsTitle
  );
  ToggleTemplate.displayName = "ToggleTemplate";

  // node_modules/@patternfly/react-styles/css/components/Pagination/pagination.mjs
  var pagination_default = {
    "button": "pf-v5-c-button",
    "dirRtl": "pf-v5-m-dir-rtl",
    "formControl": "pf-v5-c-form-control",
    "menuToggle": "pf-v5-c-menu-toggle",
    "modifiers": {
      "bottom": "pf-m-bottom",
      "static": "pf-m-static",
      "first": "pf-m-first",
      "last": "pf-m-last",
      "sticky": "pf-m-sticky",
      "compact": "pf-m-compact",
      "pageInsets": "pf-m-page-insets",
      "displaySummary": "pf-m-display-summary",
      "displayFull": "pf-m-display-full",
      "insetNone": "pf-m-inset-none",
      "insetSm": "pf-m-inset-sm",
      "insetMd": "pf-m-inset-md",
      "insetLg": "pf-m-inset-lg",
      "insetXl": "pf-m-inset-xl",
      "inset_2xl": "pf-m-inset-2xl",
      "displaySummaryOnSm": "pf-m-display-summary-on-sm",
      "displayFullOnSm": "pf-m-display-full-on-sm",
      "insetNoneOnSm": "pf-m-inset-none-on-sm",
      "insetSmOnSm": "pf-m-inset-sm-on-sm",
      "insetMdOnSm": "pf-m-inset-md-on-sm",
      "insetLgOnSm": "pf-m-inset-lg-on-sm",
      "insetXlOnSm": "pf-m-inset-xl-on-sm",
      "inset_2xlOnSm": "pf-m-inset-2xl-on-sm",
      "displaySummaryOnMd": "pf-m-display-summary-on-md",
      "displayFullOnMd": "pf-m-display-full-on-md",
      "insetNoneOnMd": "pf-m-inset-none-on-md",
      "insetSmOnMd": "pf-m-inset-sm-on-md",
      "insetMdOnMd": "pf-m-inset-md-on-md",
      "insetLgOnMd": "pf-m-inset-lg-on-md",
      "insetXlOnMd": "pf-m-inset-xl-on-md",
      "inset_2xlOnMd": "pf-m-inset-2xl-on-md",
      "displaySummaryOnLg": "pf-m-display-summary-on-lg",
      "displayFullOnLg": "pf-m-display-full-on-lg",
      "insetNoneOnLg": "pf-m-inset-none-on-lg",
      "insetSmOnLg": "pf-m-inset-sm-on-lg",
      "insetMdOnLg": "pf-m-inset-md-on-lg",
      "insetLgOnLg": "pf-m-inset-lg-on-lg",
      "insetXlOnLg": "pf-m-inset-xl-on-lg",
      "inset_2xlOnLg": "pf-m-inset-2xl-on-lg",
      "displaySummaryOnXl": "pf-m-display-summary-on-xl",
      "displayFullOnXl": "pf-m-display-full-on-xl",
      "insetNoneOnXl": "pf-m-inset-none-on-xl",
      "insetSmOnXl": "pf-m-inset-sm-on-xl",
      "insetMdOnXl": "pf-m-inset-md-on-xl",
      "insetLgOnXl": "pf-m-inset-lg-on-xl",
      "insetXlOnXl": "pf-m-inset-xl-on-xl",
      "inset_2xlOnXl": "pf-m-inset-2xl-on-xl",
      "displaySummaryOn_2xl": "pf-m-display-summary-on-2xl",
      "displayFullOn_2xl": "pf-m-display-full-on-2xl",
      "insetNoneOn_2xl": "pf-m-inset-none-on-2xl",
      "insetSmOn_2xl": "pf-m-inset-sm-on-2xl",
      "insetMdOn_2xl": "pf-m-inset-md-on-2xl",
      "insetLgOn_2xl": "pf-m-inset-lg-on-2xl",
      "insetXlOn_2xl": "pf-m-inset-xl-on-2xl",
      "inset_2xlOn_2xl": "pf-m-inset-2xl-on-2xl"
    },
    "pagination": "pf-v5-c-pagination",
    "paginationNav": "pf-v5-c-pagination__nav",
    "paginationNavControl": "pf-v5-c-pagination__nav-control",
    "paginationNavPageSelect": "pf-v5-c-pagination__nav-page-select",
    "paginationTotalItems": "pf-v5-c-pagination__total-items",
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Pagination/Navigation.js
  init_tslib_es6();
  var React160 = __toESM(require_react());
  var Navigation = class _Navigation extends React160.Component {
    constructor(props) {
      super(props);
      this.handleNewPage = (_evt, newPage) => {
        const { perPage, onSetPage } = this.props;
        const startIdx = (newPage - 1) * perPage;
        const endIdx = newPage * perPage;
        return onSetPage(_evt, newPage, perPage, startIdx, endIdx);
      };
      this.state = { userInputPage: this.props.page };
    }
    static parseInteger(input, lastPage) {
      let inputPage = Number.parseInt(input, 10);
      if (!Number.isNaN(inputPage)) {
        inputPage = inputPage > lastPage ? lastPage : inputPage;
        inputPage = inputPage < 1 ? 1 : inputPage;
      }
      return inputPage;
    }
    onChange(event, lastPage) {
      const inputPage = _Navigation.parseInteger(event.currentTarget.value, lastPage);
      this.setState({ userInputPage: Number.isNaN(inputPage) ? event.currentTarget.value : inputPage });
    }
    onKeyDown(event, page, lastPage, onPageInput) {
      const allowedKeys = [
        "Tab",
        "Backspace",
        "Delete",
        "ArrowLeft",
        "ArrowRight",
        "Home",
        "End",
        "ArrowUp",
        "ArrowDown"
      ];
      if (event.key === KeyTypes.Enter) {
        const inputPage = _Navigation.parseInteger(this.state.userInputPage, lastPage);
        onPageInput(event, Number.isNaN(inputPage) ? page : inputPage);
        this.handleNewPage(event, Number.isNaN(inputPage) ? page : inputPage);
      } else if (!/^\d*$/.test(event.key) && !allowedKeys.includes(event.key)) {
        event.preventDefault();
      }
    }
    componentDidUpdate(lastState) {
      if (this.props.page !== lastState.page && this.props.page <= this.props.lastPage && this.state.userInputPage !== this.props.page) {
        this.setState({ userInputPage: this.props.page });
      }
    }
    render() {
      const _a = this.props, {
        page,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        perPage,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        onSetPage,
        isDisabled,
        itemCount,
        lastPage,
        firstPage,
        pagesTitle,
        pagesTitlePlural,
        toLastPageAriaLabel,
        toNextPageAriaLabel,
        toFirstPageAriaLabel,
        toPreviousPageAriaLabel,
        currPageAriaLabel,
        paginationAriaLabel,
        ofWord,
        onNextClick,
        onPreviousClick,
        onFirstClick,
        onLastClick,
        onPageInput,
        className,
        isCompact
      } = _a, props = __rest(_a, ["page", "perPage", "onSetPage", "isDisabled", "itemCount", "lastPage", "firstPage", "pagesTitle", "pagesTitlePlural", "toLastPageAriaLabel", "toNextPageAriaLabel", "toFirstPageAriaLabel", "toPreviousPageAriaLabel", "currPageAriaLabel", "paginationAriaLabel", "ofWord", "onNextClick", "onPreviousClick", "onFirstClick", "onLastClick", "onPageInput", "className", "isCompact"]);
      const { userInputPage } = this.state;
      return React160.createElement(
        "nav",
        Object.assign({ className: css(pagination_default.paginationNav, className), "aria-label": paginationAriaLabel }, props),
        !isCompact && React160.createElement(
          "div",
          { className: css(pagination_default.paginationNavControl, pagination_default.modifiers.first) },
          React160.createElement(
            Button,
            { variant: ButtonVariant.plain, isDisabled: isDisabled || page === firstPage || page === 0, "aria-label": toFirstPageAriaLabel, "data-action": "first", onClick: (event) => {
              onFirstClick(event, 1);
              this.handleNewPage(event, 1);
              this.setState({ userInputPage: 1 });
            } },
            React160.createElement(angle_double_left_icon_default, null)
          )
        ),
        React160.createElement(
          "div",
          { className: pagination_default.paginationNavControl },
          React160.createElement(
            Button,
            { variant: ButtonVariant.plain, isDisabled: isDisabled || page === firstPage || page === 0, "data-action": "previous", onClick: (event) => {
              const newPage = page - 1 >= 1 ? page - 1 : 1;
              onPreviousClick(event, newPage);
              this.handleNewPage(event, newPage);
              this.setState({ userInputPage: newPage });
            }, "aria-label": toPreviousPageAriaLabel },
            React160.createElement(angle_left_icon_default, null)
          )
        ),
        !isCompact && React160.createElement(
          "div",
          { className: pagination_default.paginationNavPageSelect },
          React160.createElement(TextInput, { "aria-label": currPageAriaLabel, type: "number", isDisabled: isDisabled || itemCount && page === firstPage && page === lastPage && itemCount >= 0 || page === 0, min: lastPage <= 0 && firstPage <= 0 ? 0 : 1, max: lastPage, value: userInputPage, onKeyDown: (event) => this.onKeyDown(event, page, lastPage, onPageInput), onChange: (event) => this.onChange(event, lastPage) }),
          (itemCount || itemCount === 0) && React160.createElement(
            "span",
            { "aria-hidden": "true" },
            ofWord,
            " ",
            pagesTitle ? pluralize(lastPage, pagesTitle, pagesTitlePlural) : lastPage
          )
        ),
        React160.createElement(
          "div",
          { className: pagination_default.paginationNavControl },
          React160.createElement(
            Button,
            { variant: ButtonVariant.plain, isDisabled: isDisabled || page === lastPage, "aria-label": toNextPageAriaLabel, "data-action": "next", onClick: (event) => {
              const newPage = page + 1 <= lastPage ? page + 1 : lastPage;
              onNextClick(event, newPage);
              this.handleNewPage(event, newPage);
              this.setState({ userInputPage: newPage });
            } },
            React160.createElement(angle_right_icon_default, null)
          )
        ),
        !isCompact && React160.createElement(
          "div",
          { className: css(pagination_default.paginationNavControl, pagination_default.modifiers.last) },
          React160.createElement(
            Button,
            { variant: ButtonVariant.plain, isDisabled: isDisabled || page === lastPage, "aria-label": toLastPageAriaLabel, "data-action": "last", onClick: (event) => {
              onLastClick(event, lastPage);
              this.handleNewPage(event, lastPage);
              this.setState({ userInputPage: lastPage });
            } },
            React160.createElement(angle_double_right_icon_default, null)
          )
        )
      );
    }
  };
  Navigation.displayName = "Navigation";
  Navigation.defaultProps = {
    className: "",
    isDisabled: false,
    isCompact: false,
    lastPage: 0,
    firstPage: 0,
    pagesTitle: "",
    pagesTitlePlural: "",
    toLastPageAriaLabel: "Go to last page",
    toNextPageAriaLabel: "Go to next page",
    toFirstPageAriaLabel: "Go to first page",
    toPreviousPageAriaLabel: "Go to previous page",
    currPageAriaLabel: "Current page",
    paginationAriaLabel: "Pagination",
    ofWord: "of",
    onNextClick: () => void 0,
    onPreviousClick: () => void 0,
    onFirstClick: () => void 0,
    onLastClick: () => void 0,
    onPageInput: () => void 0
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Pagination/PaginationOptionsMenu.js
  var React161 = __toESM(require_react());
  var PaginationOptionsMenu = ({
    className,
    widgetId,
    page: pageProp,
    itemCount,
    isDisabled = false,
    minWidth,
    dropDirection = "down",
    perPageOptions = [],
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    itemsPerPageTitle = "Items per page",
    perPageSuffix = "per page",
    optionsToggleAriaLabel,
    ofWord = "of",
    perPage = 0,
    firstIndex = 0,
    lastIndex = 0,
    isLastFullPageShown = false,
    itemsTitle = "",
    toggleTemplate,
    onPerPageSelect = () => null,
    containerRef,
    appendTo
  }) => {
    const [isOpen, setIsOpen] = React161.useState(false);
    const toggleRef = React161.useRef(null);
    const menuRef = React161.useRef(null);
    const onToggle = () => {
      setIsOpen((prevState) => !prevState);
    };
    const onSelect = () => {
      var _a;
      setIsOpen((prevState) => !prevState);
      (_a = toggleRef.current) === null || _a === void 0 ? void 0 : _a.focus();
    };
    const handleNewPerPage = (_evt, newPerPage) => {
      let newPage = pageProp;
      while (Math.ceil(itemCount / newPerPage) < newPage) {
        newPage--;
      }
      if (isLastFullPageShown) {
        if (itemCount / newPerPage !== newPage) {
          while (newPage > 1 && itemCount - newPerPage * newPage < 0) {
            newPage--;
          }
        }
      }
      const startIdx = (newPage - 1) * newPerPage;
      const endIdx = newPage * newPerPage;
      return onPerPageSelect(_evt, newPerPage, newPage, startIdx, endIdx);
    };
    React161.useEffect(() => {
      const handleMenuKeys = (event) => {
        var _a, _b, _c;
        if (isOpen && ((_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)) || ((_b = toggleRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target))) {
          if (event.key === "Escape" || event.key === "Tab") {
            setIsOpen(false);
            (_c = toggleRef.current) === null || _c === void 0 ? void 0 : _c.focus();
          }
        }
      };
      const handleClick = (event) => {
        var _a, _b, _c;
        if (isOpen && ((_a = toggleRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
          setTimeout(() => {
            var _a2;
            const firstElement = (_a2 = menuRef === null || menuRef === void 0 ? void 0 : menuRef.current) === null || _a2 === void 0 ? void 0 : _a2.querySelector("li button:not(:disabled)");
            firstElement && firstElement.focus();
          }, 0);
        }
        if (isOpen && !((_b = toggleRef === null || toggleRef === void 0 ? void 0 : toggleRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target)) && !((_c = menuRef.current) === null || _c === void 0 ? void 0 : _c.contains(event.target))) {
          setIsOpen(false);
        }
      };
      window.addEventListener("keydown", handleMenuKeys);
      window.addEventListener("click", handleClick);
      return () => {
        window.removeEventListener("keydown", handleMenuKeys);
        window.removeEventListener("click", handleClick);
      };
    }, [isOpen, menuRef]);
    const renderItems = () => perPageOptions.map(({ value, title }) => React161.createElement(
      MenuItem,
      { key: value, "data-action": `per-page-${value}`, isSelected: perPage === value, onClick: (event) => handleNewPerPage(event, value) },
      title,
      ` ${perPageSuffix}`
    ));
    const toggle = React161.createElement(
      MenuToggle,
      Object.assign({ ref: toggleRef, onClick: onToggle }, optionsToggleAriaLabel && { "aria-label": optionsToggleAriaLabel }, { isDisabled: isDisabled || itemCount && itemCount <= 0, isExpanded: isOpen }, widgetId && { id: `${widgetId}-toggle` }, { variant: "plainText", "aria-haspopup": "listbox" }),
      toggleTemplate && typeof toggleTemplate === "string" && fillTemplate(toggleTemplate, { firstIndex, lastIndex, ofWord, itemCount, itemsTitle }),
      toggleTemplate && typeof toggleTemplate !== "string" && toggleTemplate({
        firstIndex,
        lastIndex,
        ofWord,
        itemCount,
        itemsTitle
      }),
      !toggleTemplate && React161.createElement(ToggleTemplate, { firstIndex, lastIndex, ofWord, itemCount, itemsTitle })
    );
    const menu = React161.createElement(
      Menu,
      { className: css(className), onSelect, ref: menuRef },
      React161.createElement(
        MenuContent,
        null,
        React161.createElement(MenuList, null, renderItems())
      )
    );
    const containerToAppendTo = appendTo !== null && appendTo !== void 0 ? appendTo : (containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) || void 0;
    return React161.createElement(Popper, { trigger: toggle, triggerRef: toggleRef, popper: menu, popperRef: menuRef, isVisible: isOpen, direction: dropDirection, appendTo: containerToAppendTo, minWidth: minWidth !== void 0 ? minWidth : "revert" });
  };
  PaginationOptionsMenu.displayName = "PaginationOptionsMenu";

  // node_modules/@patternfly/react-tokens/dist/esm/c_pagination__nav_page_select_c_form_control_width_chars.js
  var c_pagination__nav_page_select_c_form_control_width_chars = {
    "name": "--pf-v5-c-pagination__nav-page-select--c-form-control--width-chars",
    "value": "2",
    "var": "var(--pf-v5-c-pagination__nav-page-select--c-form-control--width-chars)"
  };
  var c_pagination_nav_page_select_c_form_control_width_chars_default = c_pagination__nav_page_select_c_form_control_width_chars;

  // node_modules/@patternfly/react-core/dist/esm/components/Pagination/Pagination.js
  var PaginationVariant;
  (function(PaginationVariant2) {
    PaginationVariant2["bottom"] = "bottom";
    PaginationVariant2["top"] = "top";
  })(PaginationVariant || (PaginationVariant = {}));
  var defaultPerPageOptions = [
    {
      title: "10",
      value: 10
    },
    {
      title: "20",
      value: 20
    },
    {
      title: "50",
      value: 50
    },
    {
      title: "100",
      value: 100
    }
  ];
  var handleInputWidth = (lastPage, node) => {
    if (!node) {
      return;
    }
    const len = String(lastPage).length;
    if (len >= 3) {
      node.style.setProperty(c_pagination_nav_page_select_c_form_control_width_chars_default.name, `${len}`);
    } else {
      node.style.setProperty(c_pagination_nav_page_select_c_form_control_width_chars_default.name, "2");
    }
  };
  var Pagination = (_a) => {
    var { children, className = "", variant = PaginationVariant.top, isDisabled = false, isCompact = false, isSticky = false, isStatic = false, dropDirection: dropDirectionProp, toggleTemplate, perPage = defaultPerPageOptions[0].value, titles = {
      items: "",
      page: "",
      pages: "",
      itemsPerPage: "Items per page",
      perPageSuffix: "per page",
      toFirstPageAriaLabel: "Go to first page",
      toPreviousPageAriaLabel: "Go to previous page",
      toLastPageAriaLabel: "Go to last page",
      toNextPageAriaLabel: "Go to next page",
      optionsToggleAriaLabel: "",
      currPageAriaLabel: "Current page",
      paginationAriaLabel: "Pagination",
      ofWord: "of"
    }, firstPage = 1, page: pageProp = 1, offset: offset2 = null, isLastFullPageShown = false, itemsStart = null, itemsEnd = null, itemCount, perPageOptions = defaultPerPageOptions, widgetId = "options-menu", onSetPage = () => void 0, onPerPageSelect = () => void 0, onFirstClick = () => void 0, onPreviousClick = () => void 0, onNextClick = () => void 0, onPageInput = () => void 0, onLastClick = () => void 0, ouiaId, ouiaSafe = true, usePageInsets, inset, menuAppendTo } = _a, props = __rest(_a, ["children", "className", "variant", "isDisabled", "isCompact", "isSticky", "isStatic", "dropDirection", "toggleTemplate", "perPage", "titles", "firstPage", "page", "offset", "isLastFullPageShown", "itemsStart", "itemsEnd", "itemCount", "perPageOptions", "widgetId", "onSetPage", "onPerPageSelect", "onFirstClick", "onPreviousClick", "onNextClick", "onPageInput", "onLastClick", "ouiaId", "ouiaSafe", "usePageInsets", "inset", "menuAppendTo"]);
    const paginationRef = React162.useRef(null);
    const containerRef = React162.useRef(null);
    const getLastPage = () => (
      // when itemCount is not known let's set lastPage as page+1 as we don't know the total count
      itemCount || itemCount === 0 ? Math.ceil(itemCount / perPage) || 0 : page + 1
    );
    React162.useEffect(() => {
      const node = paginationRef.current;
      handleInputWidth(getLastPage(), node);
    }, [perPage, itemCount]);
    const dropDirection = dropDirectionProp || (variant === "bottom" && !isStatic ? "up" : "down");
    let page = pageProp;
    if (offset2 !== null) {
      itemsStart = offset2 + 1;
      page = Math.max(Math.ceil(itemsStart / perPage), 1);
      itemsEnd = offset2 + perPage;
    }
    const lastPage = getLastPage();
    let firstIndex = (page - 1) * perPage + 1;
    let lastIndex = page * perPage;
    if (itemCount || itemCount === 0) {
      firstIndex = itemCount <= 0 ? 0 : (page - 1) * perPage + 1;
      if (page < firstPage && itemCount > 0) {
        page = firstPage;
      } else if (page > lastPage) {
        page = lastPage;
      }
      if (itemCount >= 0) {
        lastIndex = page === lastPage || itemCount === 0 ? itemCount : page * perPage;
      }
    }
    const PaginationToggleTemplateProps = {
      firstIndex,
      lastIndex,
      itemCount,
      itemsTitle: titles.items,
      ofWord: titles.ofWord
    };
    return React162.createElement(
      "div",
      Object.assign({ ref: paginationRef, className: css(pagination_default.pagination, variant === PaginationVariant.bottom && pagination_default.modifiers.bottom, usePageInsets && pagination_default.modifiers.pageInsets, formatBreakpointMods(inset, pagination_default), isCompact && pagination_default.modifiers.compact, isStatic && pagination_default.modifiers.static, isSticky && pagination_default.modifiers.sticky, className) }, widgetId && { id: `${widgetId}-${variant}-pagination` }, useOUIAProps(Pagination.displayName, ouiaId, ouiaSafe, variant), props),
      variant === PaginationVariant.top && React162.createElement(
        "div",
        { className: css(pagination_default.paginationTotalItems) },
        toggleTemplate && typeof toggleTemplate === "string" && fillTemplate(toggleTemplate, PaginationToggleTemplateProps),
        toggleTemplate && typeof toggleTemplate !== "string" && toggleTemplate(PaginationToggleTemplateProps),
        !toggleTemplate && React162.createElement(ToggleTemplate, { firstIndex, lastIndex, itemCount, itemsTitle: titles.items, ofWord: titles.ofWord })
      ),
      perPageOptions && perPageOptions.length > 0 && React162.createElement(PaginationOptionsMenu, { itemsPerPageTitle: titles.itemsPerPage, perPageSuffix: titles.perPageSuffix, itemsTitle: isCompact ? "" : titles.items, optionsToggleAriaLabel: titles.optionsToggleAriaLabel, perPageOptions, firstIndex: itemsStart !== null ? itemsStart : firstIndex, lastIndex: itemsEnd !== null ? itemsEnd : lastIndex, ofWord: titles.ofWord, isLastFullPageShown, itemCount, page, perPage, lastPage, onPerPageSelect, dropDirection, widgetId: `${widgetId}-${variant}`, toggleTemplate, isDisabled, containerRef, appendTo: menuAppendTo }),
      React162.createElement(Navigation, { pagesTitle: titles.page, pagesTitlePlural: titles.pages, toLastPageAriaLabel: titles.toLastPageAriaLabel, toPreviousPageAriaLabel: titles.toPreviousPageAriaLabel, toNextPageAriaLabel: titles.toNextPageAriaLabel, toFirstPageAriaLabel: titles.toFirstPageAriaLabel, currPageAriaLabel: titles.currPageAriaLabel, paginationAriaLabel: titles.paginationAriaLabel, ofWord: titles.ofWord, page: itemCount && itemCount <= 0 ? 0 : page, perPage, itemCount, firstPage: itemsStart !== null ? itemsStart : 1, lastPage, onSetPage, onFirstClick, onPreviousClick, onNextClick, onLastClick, onPageInput, isDisabled, isCompact }),
      children
    );
  };
  Pagination.displayName = "Pagination";

  // node_modules/@patternfly/react-core/dist/esm/components/ProgressStepper/ProgressStepper.js
  init_tslib_es6();
  var React163 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/ProgressStepper/progress-stepper.mjs
  var progress_stepper_default = {
    "faExclamationTriangle": "fa-exclamation-triangle",
    "modifiers": {
      "center": "pf-m-center",
      "compact": "pf-m-compact",
      "current": "pf-m-current",
      "pending": "pf-m-pending",
      "success": "pf-m-success",
      "danger": "pf-m-danger",
      "warning": "pf-m-warning",
      "info": "pf-m-info",
      "helpText": "pf-m-help-text",
      "horizontal": "pf-m-horizontal",
      "vertical": "pf-m-vertical",
      "horizontalOnSm": "pf-m-horizontal-on-sm",
      "verticalOnSm": "pf-m-vertical-on-sm",
      "horizontalOnMd": "pf-m-horizontal-on-md",
      "verticalOnMd": "pf-m-vertical-on-md",
      "horizontalOnLg": "pf-m-horizontal-on-lg",
      "verticalOnLg": "pf-m-vertical-on-lg",
      "horizontalOnXl": "pf-m-horizontal-on-xl",
      "verticalOnXl": "pf-m-vertical-on-xl",
      "horizontalOn_2xl": "pf-m-horizontal-on-2xl",
      "verticalOn_2xl": "pf-m-vertical-on-2xl"
    },
    "pficon": "pf-v5-pficon",
    "progressStepper": "pf-v5-c-progress-stepper",
    "progressStepperStep": "pf-v5-c-progress-stepper__step",
    "progressStepperStepConnector": "pf-v5-c-progress-stepper__step-connector",
    "progressStepperStepDescription": "pf-v5-c-progress-stepper__step-description",
    "progressStepperStepIcon": "pf-v5-c-progress-stepper__step-icon",
    "progressStepperStepMain": "pf-v5-c-progress-stepper__step-main",
    "progressStepperStepTitle": "pf-v5-c-progress-stepper__step-title"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/ProgressStepper/ProgressStepper.js
  var ProgressStepper = (_a) => {
    var { children, className, isCenterAligned, isVertical: isVertical2, isCompact, "aria-label": ariaLabel } = _a, props = __rest(_a, ["children", "className", "isCenterAligned", "isVertical", "isCompact", "aria-label"]);
    return React163.createElement("ol", Object.assign({ className: css(progress_stepper_default.progressStepper, isCenterAligned && progress_stepper_default.modifiers.center, isVertical2 && progress_stepper_default.modifiers.vertical, isCompact && progress_stepper_default.modifiers.compact, className), role: "list", "aria-label": ariaLabel }, props), children);
  };
  ProgressStepper.displayName = "ProgressStepper";

  // node_modules/@patternfly/react-core/dist/esm/components/ProgressStepper/ProgressStep.js
  init_tslib_es6();
  var React164 = __toESM(require_react());

  // node_modules/@patternfly/react-icons/dist/esm/icons/resources-full-icon.js
  var ResourcesFullIconConfig = {
    name: "ResourcesFullIcon",
    height: 1024,
    width: 1024,
    svgPath: "M512.1,0 C229.7,0 0,229.8 0,512 C0,794.3 229.8,1024 512.1,1024 C794.4,1024 1024,794.3 1024,512 C1024,229.7 794.4,0 512.1,0 Z M512,896 C300.2,896 128,723.9 128,512 C128,300.3 300.2,128 512,128 C723.7,128 896,300.2 896,512 C896,723.8 723.7,896 512,896 Z M512,224 C671.1,224 800,352.9 800,512 C800,671.1 671.1,800 512,800 C352.9,800 224,671.1 224,512 C224,352.9 352.9,224 512,224",
    yOffset: 0,
    xOffset: 0
  };
  var ResourcesFullIcon = createIcon(ResourcesFullIconConfig);
  var resources_full_icon_default = ResourcesFullIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/ProgressStepper/ProgressStep.js
  var ProgressStepVariant;
  (function(ProgressStepVariant2) {
    ProgressStepVariant2["default"] = "default";
    ProgressStepVariant2["pending"] = "pending";
    ProgressStepVariant2["success"] = "success";
    ProgressStepVariant2["info"] = "info";
    ProgressStepVariant2["danger"] = "danger";
    ProgressStepVariant2["warning"] = "warning";
  })(ProgressStepVariant || (ProgressStepVariant = {}));
  var variantIcons2 = {
    default: void 0,
    pending: void 0,
    success: React164.createElement(check_circle_icon_default, null),
    info: React164.createElement(resources_full_icon_default, null),
    warning: React164.createElement(exclamation_triangle_icon_default, null),
    danger: React164.createElement(exclamation_circle_icon_default, null)
  };
  var variantStyle3 = {
    default: "",
    info: progress_stepper_default.modifiers.info,
    success: progress_stepper_default.modifiers.success,
    pending: progress_stepper_default.modifiers.pending,
    warning: progress_stepper_default.modifiers.warning,
    danger: progress_stepper_default.modifiers.danger
  };
  var ProgressStep = (_a) => {
    var { children, className, variant, isCurrent, description, icon, titleId, "aria-label": ariaLabel, popoverRender } = _a, props = __rest(_a, ["children", "className", "variant", "isCurrent", "description", "icon", "titleId", "aria-label", "popoverRender"]);
    const _icon = icon !== void 0 ? icon : variantIcons2[variant];
    const Component40 = popoverRender !== void 0 ? "button" : "div";
    const stepRef = React164.useRef();
    if (props.id === void 0 || titleId === void 0) {
      console.warn("ProgressStep: The titleId and id properties are required to make this component accessible, and one or both of these properties are missing.");
    }
    return React164.createElement(
      "li",
      Object.assign({
        className: css(progress_stepper_default.progressStepperStep, variantStyle3[variant], isCurrent && progress_stepper_default.modifiers.current, className),
        "aria-label": ariaLabel,
        // CSS style `display: contents` gives this li a generic role, we need to override that
        role: "listitem"
      }, isCurrent && { "aria-current": "step" }, props),
      React164.createElement(
        "div",
        { className: css(progress_stepper_default.progressStepperStepConnector) },
        React164.createElement("span", { className: css(progress_stepper_default.progressStepperStepIcon) }, _icon && _icon)
      ),
      React164.createElement(
        "div",
        { className: css(progress_stepper_default.progressStepperStepMain) },
        React164.createElement(
          Component40,
          Object.assign({ className: css(progress_stepper_default.progressStepperStepTitle, popoverRender && progress_stepper_default.modifiers.helpText), id: titleId, ref: stepRef }, popoverRender && { type: "button" }, props.id !== void 0 && titleId !== void 0 && popoverRender && { "aria-labelledby": `${props.id} ${titleId}` }),
          children,
          popoverRender && popoverRender(stepRef)
        ),
        description && React164.createElement("div", { className: css(progress_stepper_default.progressStepperStepDescription) }, description)
      )
    );
  };
  ProgressStep.displayName = "ProgressStep";

  // node_modules/@patternfly/react-core/dist/esm/components/SimpleList/SimpleList.js
  init_tslib_es6();
  var React166 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/SimpleList/simple-list.mjs
  var simple_list_default = {
    "modifiers": {
      "current": "pf-m-current"
    },
    "simpleList": "pf-v5-c-simple-list",
    "simpleListItemLink": "pf-v5-c-simple-list__item-link",
    "simpleListSection": "pf-v5-c-simple-list__section",
    "simpleListTitle": "pf-v5-c-simple-list__title",
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/SimpleList/SimpleListGroup.js
  init_tslib_es6();
  var React165 = __toESM(require_react());
  var SimpleListGroup = (_a) => {
    var { children = null, className = "", title = "", titleClassName = "", id = "" } = _a, props = __rest(_a, ["children", "className", "title", "titleClassName", "id"]);
    return React165.createElement(
      "section",
      Object.assign({ className: css(simple_list_default.simpleListSection) }, props),
      React165.createElement("h2", { id, className: css(simple_list_default.simpleListTitle, titleClassName), "aria-hidden": "true" }, title),
      React165.createElement("ul", { className: css("pf-v5-c-simple-list__list", className), role: "list", "aria-labelledby": id }, children)
    );
  };
  SimpleListGroup.displayName = "SimpleListGroup";

  // node_modules/@patternfly/react-core/dist/esm/components/SimpleList/SimpleList.js
  var SimpleListContext = React166.createContext({});
  var SimpleList = class extends React166.Component {
    constructor() {
      super(...arguments);
      this.state = {
        currentRef: null
      };
      this.handleCurrentUpdate = (newCurrentRef, itemProps) => {
        this.setState({ currentRef: newCurrentRef });
        const { onSelect } = this.props;
        onSelect && onSelect(newCurrentRef, itemProps);
      };
    }
    render() {
      const _a = this.props, { children, className, onSelect, isControlled, "aria-label": ariaLabel } = _a, props = __rest(_a, ["children", "className", "onSelect", "isControlled", "aria-label"]);
      let isGrouped = false;
      if (children) {
        isGrouped = React166.Children.toArray(children)[0].type === SimpleListGroup;
      }
      return React166.createElement(
        SimpleListContext.Provider,
        { value: {
          currentRef: this.state.currentRef,
          updateCurrentRef: this.handleCurrentUpdate,
          isControlled
        } },
        React166.createElement(
          "div",
          Object.assign({ className: css(simple_list_default.simpleList, className) }, props),
          isGrouped && children,
          !isGrouped && React166.createElement("ul", { className: css("pf-v5-c-simple-list__list"), role: "list", "aria-label": ariaLabel }, children)
        )
      );
    }
  };
  SimpleList.displayName = "SimpleList";
  SimpleList.defaultProps = {
    children: null,
    className: "",
    isControlled: true
  };

  // node_modules/@patternfly/react-core/dist/esm/components/SimpleList/SimpleListItem.js
  init_tslib_es6();
  var React167 = __toESM(require_react());
  var SimpleListItem = class extends React167.Component {
    constructor() {
      super(...arguments);
      this.ref = React167.createRef();
    }
    render() {
      const _a = this.props, {
        children,
        isActive,
        className,
        component: Component40,
        componentClassName,
        componentProps,
        onClick,
        type,
        href,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        itemId
      } = _a, props = __rest(_a, ["children", "isActive", "className", "component", "componentClassName", "componentProps", "onClick", "type", "href", "itemId"]);
      return React167.createElement(SimpleListContext.Consumer, null, ({ currentRef, updateCurrentRef, isControlled }) => {
        const isButton = Component40 === "button";
        const isCurrentItem = this.ref && currentRef && isControlled ? currentRef.current === this.ref.current : isActive;
        const additionalComponentProps = isButton ? {
          type
        } : {
          tabIndex: 0,
          href
        };
        return React167.createElement(
          "li",
          Object.assign({ className: css("pf-v5-c-simple-list__item", className) }, props),
          React167.createElement(Component40, Object.assign({ className: css(simple_list_default.simpleListItemLink, isCurrentItem && simple_list_default.modifiers.current, componentClassName), onClick: (evt) => {
            onClick(evt);
            updateCurrentRef(this.ref, this.props);
          }, ref: this.ref }, componentProps, additionalComponentProps), children)
        );
      });
    }
  };
  SimpleListItem.displayName = "SimpleListItem";
  SimpleListItem.defaultProps = {
    children: null,
    className: "",
    isActive: false,
    component: "button",
    componentClassName: "",
    type: "button",
    href: "",
    onClick: () => {
    }
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Switch/Switch.js
  init_tslib_es6();
  var React168 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Switch/switch.mjs
  var switch_default = {
    "dirRtl": "pf-v5-m-dir-rtl",
    "modifiers": {
      "reverse": "pf-m-reverse",
      "off": "pf-m-off",
      "on": "pf-m-on"
    },
    "switch": "pf-v5-c-switch",
    "switchInput": "pf-v5-c-switch__input",
    "switchLabel": "pf-v5-c-switch__label",
    "switchToggle": "pf-v5-c-switch__toggle",
    "switchToggleIcon": "pf-v5-c-switch__toggle-icon",
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Switch/Switch.js
  var Switch = class _Switch extends React168.Component {
    constructor(props) {
      super(props);
      if (!props.label && !props["aria-label"]) {
        console.error("Switch: Switch requires either a label or an aria-label to be specified");
      }
      this.id = props.id || getUniqueId();
      this.state = {
        ouiaStateId: getDefaultOUIAId(_Switch.displayName)
      };
    }
    render() {
      const _a = this.props, {
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        id,
        className,
        label,
        labelOff,
        isChecked,
        defaultChecked,
        hasCheckIcon,
        isDisabled,
        onChange,
        isReversed,
        ouiaId,
        ouiaSafe
      } = _a, props = __rest(_a, ["id", "className", "label", "labelOff", "isChecked", "defaultChecked", "hasCheckIcon", "isDisabled", "onChange", "isReversed", "ouiaId", "ouiaSafe"]);
      const isAriaLabelledBy = props["aria-label"] === "";
      return React168.createElement(
        "label",
        Object.assign({ className: css(switch_default.switch, isReversed && switch_default.modifiers.reverse, className), htmlFor: this.id }, getOUIAProps(_Switch.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe)),
        React168.createElement("input", Object.assign({ id: this.id, className: css(switch_default.switchInput), type: "checkbox", onChange: (event) => onChange(event, event.target.checked) }, defaultChecked !== void 0 ? { defaultChecked } : { checked: isChecked }, { disabled: isDisabled, "aria-labelledby": !isAriaLabelledBy ? null : `${this.id}-${isChecked !== true ? "off" : "on"}` }, props)),
        label !== void 0 ? React168.createElement(
          React168.Fragment,
          null,
          React168.createElement("span", { className: css(switch_default.switchToggle) }, hasCheckIcon && React168.createElement(
            "span",
            { className: css(switch_default.switchToggleIcon), "aria-hidden": "true" },
            React168.createElement(check_icon_default, null)
          )),
          React168.createElement("span", { className: css(switch_default.switchLabel, switch_default.modifiers.on), id: isAriaLabelledBy ? `${this.id}-on` : null, "aria-hidden": "true" }, label),
          React168.createElement("span", { className: css(switch_default.switchLabel, switch_default.modifiers.off), id: isAriaLabelledBy ? `${this.id}-off` : null, "aria-hidden": "true" }, labelOff !== void 0 ? labelOff : label)
        ) : React168.createElement(
          "span",
          { className: css(switch_default.switchToggle) },
          React168.createElement(
            "div",
            { className: css(switch_default.switchToggleIcon), "aria-hidden": "true" },
            React168.createElement(check_icon_default, null)
          )
        )
      );
    }
  };
  Switch.displayName = "Switch";
  Switch.defaultProps = {
    isChecked: true,
    isDisabled: false,
    isReversed: false,
    "aria-label": "",
    onChange: () => void 0
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/Tab.js
  init_tslib_es6();
  var React172 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Tabs/tabs.mjs
  var tabs_default = {
    "button": "pf-v5-c-button",
    "dirRtl": "pf-v5-m-dir-rtl",
    "modifiers": {
      "fill": "pf-m-fill",
      "scrollable": "pf-m-scrollable",
      "noBorderBottom": "pf-m-no-border-bottom",
      "box": "pf-m-box",
      "vertical": "pf-m-vertical",
      "current": "pf-m-current",
      "colorSchemeLight_300": "pf-m-color-scheme--light-300",
      "expandable": "pf-m-expandable",
      "nonExpandable": "pf-m-non-expandable",
      "expandableOnSm": "pf-m-expandable-on-sm",
      "nonExpandableOnSm": "pf-m-non-expandable-on-sm",
      "expandableOnMd": "pf-m-expandable-on-md",
      "nonExpandableOnMd": "pf-m-non-expandable-on-md",
      "expandableOnLg": "pf-m-expandable-on-lg",
      "nonExpandableOnLg": "pf-m-non-expandable-on-lg",
      "expandableOnXl": "pf-m-expandable-on-xl",
      "nonExpandableOnXl": "pf-m-non-expandable-on-xl",
      "expandableOn_2xl": "pf-m-expandable-on-2xl",
      "nonExpandableOn_2xl": "pf-m-non-expandable-on-2xl",
      "expanded": "pf-m-expanded",
      "secondary": "pf-m-secondary",
      "pageInsets": "pf-m-page-insets",
      "overflow": "pf-m-overflow",
      "action": "pf-m-action",
      "active": "pf-m-active",
      "disabled": "pf-m-disabled",
      "ariaDisabled": "pf-m-aria-disabled",
      "insetNone": "pf-m-inset-none",
      "insetSm": "pf-m-inset-sm",
      "insetMd": "pf-m-inset-md",
      "insetLg": "pf-m-inset-lg",
      "insetXl": "pf-m-inset-xl",
      "inset_2xl": "pf-m-inset-2xl",
      "insetNoneOnSm": "pf-m-inset-none-on-sm",
      "insetSmOnSm": "pf-m-inset-sm-on-sm",
      "insetMdOnSm": "pf-m-inset-md-on-sm",
      "insetLgOnSm": "pf-m-inset-lg-on-sm",
      "insetXlOnSm": "pf-m-inset-xl-on-sm",
      "inset_2xlOnSm": "pf-m-inset-2xl-on-sm",
      "insetNoneOnMd": "pf-m-inset-none-on-md",
      "insetSmOnMd": "pf-m-inset-sm-on-md",
      "insetMdOnMd": "pf-m-inset-md-on-md",
      "insetLgOnMd": "pf-m-inset-lg-on-md",
      "insetXlOnMd": "pf-m-inset-xl-on-md",
      "inset_2xlOnMd": "pf-m-inset-2xl-on-md",
      "insetNoneOnLg": "pf-m-inset-none-on-lg",
      "insetSmOnLg": "pf-m-inset-sm-on-lg",
      "insetMdOnLg": "pf-m-inset-md-on-lg",
      "insetLgOnLg": "pf-m-inset-lg-on-lg",
      "insetXlOnLg": "pf-m-inset-xl-on-lg",
      "inset_2xlOnLg": "pf-m-inset-2xl-on-lg",
      "insetNoneOnXl": "pf-m-inset-none-on-xl",
      "insetSmOnXl": "pf-m-inset-sm-on-xl",
      "insetMdOnXl": "pf-m-inset-md-on-xl",
      "insetLgOnXl": "pf-m-inset-lg-on-xl",
      "insetXlOnXl": "pf-m-inset-xl-on-xl",
      "inset_2xlOnXl": "pf-m-inset-2xl-on-xl",
      "insetNoneOn_2xl": "pf-m-inset-none-on-2xl",
      "insetSmOn_2xl": "pf-m-inset-sm-on-2xl",
      "insetMdOn_2xl": "pf-m-inset-md-on-2xl",
      "insetLgOn_2xl": "pf-m-inset-lg-on-2xl",
      "insetXlOn_2xl": "pf-m-inset-xl-on-2xl",
      "inset_2xlOn_2xl": "pf-m-inset-2xl-on-2xl"
    },
    "tabs": "pf-v5-c-tabs",
    "tabsAdd": "pf-v5-c-tabs__add",
    "tabsItem": "pf-v5-c-tabs__item",
    "tabsItemAction": "pf-v5-c-tabs__item-action",
    "tabsItemActionIcon": "pf-v5-c-tabs__item-action-icon",
    "tabsItemIcon": "pf-v5-c-tabs__item-icon",
    "tabsItemText": "pf-v5-c-tabs__item-text",
    "tabsLink": "pf-v5-c-tabs__link",
    "tabsLinkToggleIcon": "pf-v5-c-tabs__link-toggle-icon",
    "tabsList": "pf-v5-c-tabs__list",
    "tabsScrollButton": "pf-v5-c-tabs__scroll-button",
    "tabsToggle": "pf-v5-c-tabs__toggle",
    "tabsToggleButton": "pf-v5-c-tabs__toggle-button",
    "tabsToggleIcon": "pf-v5-c-tabs__toggle-icon",
    "tabsToggleText": "pf-v5-c-tabs__toggle-text",
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/TabButton.js
  init_tslib_es6();
  var React169 = __toESM(require_react());
  var TabButton = (_a) => {
    var {
      children,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      tabContentRef,
      ouiaId,
      parentInnerRef,
      ouiaSafe
    } = _a, props = __rest(_a, ["children", "tabContentRef", "ouiaId", "parentInnerRef", "ouiaSafe"]);
    const Component40 = props.href ? "a" : "button";
    return React169.createElement(Component40, Object.assign({}, !props.href && { type: "button" }, { ref: parentInnerRef }, getOUIAProps(TabButton.displayName, ouiaId, ouiaSafe), props), children);
  };
  TabButton.displayName = "TabButton";

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/TabsContext.js
  var React170 = __toESM(require_react());
  var TabsContext = React170.createContext({
    variant: "default",
    mountOnEnter: false,
    unmountOnExit: false,
    localActiveKey: "",
    uniqueId: "",
    handleTabClick: () => null,
    handleTabClose: void 0
  });
  var TabsContextProvider = TabsContext.Provider;
  var TabsContextConsumer = TabsContext.Consumer;

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/TabAction.js
  init_tslib_es6();
  var React171 = __toESM(require_react());
  var TabActionBase = (_a) => {
    var { children, className, onClick, isDisabled, "aria-label": ariaLabel = "Tab action", innerRef, ouiaId, ouiaSafe } = _a, props = __rest(_a, ["children", "className", "onClick", "isDisabled", "aria-label", "innerRef", "ouiaId", "ouiaSafe"]);
    return React171.createElement(
      "span",
      { className: css(tabs_default.tabsItemAction, className) },
      React171.createElement(
        Button,
        Object.assign({ ref: innerRef, type: "button", variant: "plain", "aria-label": ariaLabel, onClick, isDisabled }, getOUIAProps(TabAction.displayName, ouiaId, ouiaSafe), props),
        React171.createElement("span", { className: css(tabs_default.tabsItemActionIcon) }, children)
      )
    );
  };
  var TabAction = React171.forwardRef((props, ref) => React171.createElement(TabActionBase, Object.assign({}, props, { innerRef: ref })));
  TabAction.displayName = "TabAction";

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/Tab.js
  var TabBase = (_a) => {
    var { title, eventKey, tabContentRef, id: childId, tabContentId, className: childClassName = "", ouiaId: childOuiaId, isDisabled, isAriaDisabled, inoperableEvents = ["onClick", "onKeyPress"], href, innerRef, tooltip, closeButtonAriaLabel, isCloseDisabled = false, actions } = _a, props = __rest(_a, ["title", "eventKey", "tabContentRef", "id", "tabContentId", "className", "ouiaId", "isDisabled", "isAriaDisabled", "inoperableEvents", "href", "innerRef", "tooltip", "closeButtonAriaLabel", "isCloseDisabled", "actions"]);
    const preventedEvents2 = inoperableEvents.reduce((handlers, eventToPrevent) => Object.assign(Object.assign({}, handlers), { [eventToPrevent]: (event) => {
      event.preventDefault();
    } }), {});
    const { mountOnEnter, localActiveKey, unmountOnExit, uniqueId: uniqueId6, handleTabClick, handleTabClose } = React172.useContext(TabsContext);
    let ariaControls = tabContentId ? `${tabContentId}` : `pf-tab-section-${eventKey}-${childId || uniqueId6}`;
    if ((mountOnEnter || unmountOnExit) && eventKey !== localActiveKey) {
      ariaControls = void 0;
    }
    const isButtonElement = Boolean(!href);
    const getDefaultTabIdx = () => {
      if (isDisabled) {
        return isButtonElement ? null : -1;
      } else if (isAriaDisabled) {
        return null;
      }
    };
    const tabButton = React172.createElement(TabButton, Object.assign({ parentInnerRef: innerRef, className: css(tabs_default.tabsLink, isDisabled && href && tabs_default.modifiers.disabled, isAriaDisabled && tabs_default.modifiers.ariaDisabled), disabled: isButtonElement ? isDisabled : null, "aria-disabled": isDisabled || isAriaDisabled, tabIndex: getDefaultTabIdx(), onClick: (event) => handleTabClick(event, eventKey, tabContentRef) }, isAriaDisabled ? preventedEvents2 : null, { id: `pf-tab-${eventKey}-${childId || uniqueId6}`, "aria-controls": ariaControls, tabContentRef, ouiaId: childOuiaId, href, role: "tab", "aria-selected": eventKey === localActiveKey }, props), title);
    return React172.createElement(
      "li",
      { className: css(tabs_default.tabsItem, eventKey === localActiveKey && tabs_default.modifiers.current, (handleTabClose || actions) && tabs_default.modifiers.action, (isDisabled || isAriaDisabled) && tabs_default.modifiers.disabled, childClassName), role: "presentation" },
      tooltip ? React172.createElement(Tooltip, Object.assign({}, tooltip.props), tabButton) : tabButton,
      actions && actions,
      handleTabClose !== void 0 && React172.createElement(
        TabAction,
        { "aria-label": closeButtonAriaLabel || "Close tab", onClick: (event) => handleTabClose(event, eventKey, tabContentRef), isDisabled: isCloseDisabled },
        React172.createElement(times_icon_default, null)
      )
    );
  };
  var Tab = React172.forwardRef((props, ref) => React172.createElement(TabBase, Object.assign({ innerRef: ref }, props)));
  Tab.displayName = "Tab";

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/Tabs.js
  init_tslib_es6();
  var React176 = __toESM(require_react());

  // node_modules/@patternfly/react-icons/dist/esm/icons/plus-icon.js
  var PlusIconConfig = {
    name: "PlusIcon",
    height: 512,
    width: 448,
    svgPath: "M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",
    yOffset: 0,
    xOffset: 0
  };
  var PlusIcon = createIcon(PlusIconConfig);
  var plus_icon_default = PlusIcon;

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/TabContent.js
  init_tslib_es6();
  var React173 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/TabContent/tab-content.mjs
  var tab_content_default = {
    "modifiers": {
      "light_300": "pf-m-light-300",
      "padding": "pf-m-padding"
    },
    "tabContent": "pf-v5-c-tab-content",
    "tabContentBody": "pf-v5-c-tab-content__body"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/TabContent.js
  var variantStyle4 = {
    default: "",
    light300: tab_content_default.modifiers.light_300
  };
  var TabContentBase = (_a) => {
    var {
      id,
      activeKey,
      "aria-label": ariaLabel,
      child,
      children,
      className,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      eventKey,
      innerRef,
      ouiaId,
      ouiaSafe
    } = _a, props = __rest(_a, ["id", "activeKey", "aria-label", "child", "children", "className", "eventKey", "innerRef", "ouiaId", "ouiaSafe"]);
    if (children || child) {
      let labelledBy;
      if (ariaLabel) {
        labelledBy = null;
      } else {
        labelledBy = children ? `${id}` : `pf-tab-${child.props.eventKey}-${id}`;
      }
      return React173.createElement(TabsContextConsumer, null, ({ variant }) => React173.createElement("section", Object.assign({ ref: innerRef, hidden: children ? null : child.props.eventKey !== activeKey, className: children ? css(tab_content_default.tabContent, className, variantStyle4[variant]) : css(tab_content_default.tabContent, child.props.className, variantStyle4[variant]), id: children ? id : `pf-tab-section-${child.props.eventKey}-${id}`, "aria-label": ariaLabel, "aria-labelledby": labelledBy, role: "tabpanel", tabIndex: 0 }, getOUIAProps("TabContent", ouiaId, ouiaSafe), props), children || child.props.children));
    }
    return null;
  };
  var TabContent = React173.forwardRef((props, ref) => React173.createElement(TabContentBase, Object.assign({}, props, { innerRef: ref })));

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/OverflowTab.js
  init_tslib_es6();
  var import_react15 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/TabTitleText.js
  init_tslib_es6();
  var React174 = __toESM(require_react());
  var TabTitleText = (_a) => {
    var { children, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    return React174.createElement("span", Object.assign({ className: css(tabs_default.tabsItemText, className) }, props), children);
  };
  TabTitleText.displayName = "TabTitleText";

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/OverflowTab.js
  var OverflowTab = (_a) => {
    var { className, overflowingTabs = [], showTabCount, defaultTitleText = "More", toggleAriaLabel, zIndex = 9999 } = _a, props = __rest(_a, ["className", "overflowingTabs", "showTabCount", "defaultTitleText", "toggleAriaLabel", "zIndex"]);
    const menuRef = import_react15.default.useRef();
    const overflowTabRef = import_react15.default.useRef();
    const overflowLIRef = import_react15.default.useRef();
    const [isExpanded, setIsExpanded] = import_react15.default.useState(false);
    const { localActiveKey, handleTabClick } = import_react15.default.useContext(TabsContext);
    const closeMenu = () => {
      setIsExpanded(false);
      overflowTabRef.current.focus();
    };
    const handleMenuKeys = (ev) => {
      var _a2;
      const menuContainsEventTarget = (_a2 = menuRef === null || menuRef === void 0 ? void 0 : menuRef.current) === null || _a2 === void 0 ? void 0 : _a2.contains(ev.target);
      if (isExpanded && menuContainsEventTarget && ev.key === "Escape") {
        closeMenu();
      }
    };
    const handleClick = (ev) => {
      var _a2, _b;
      const clickIsOutsideMenu = !((_a2 = menuRef === null || menuRef === void 0 ? void 0 : menuRef.current) === null || _a2 === void 0 ? void 0 : _a2.contains(ev.target));
      const clickIsOutsideOverflowTab = !((_b = overflowTabRef === null || overflowTabRef === void 0 ? void 0 : overflowTabRef.current) === null || _b === void 0 ? void 0 : _b.contains(ev.target));
      if (isExpanded && clickIsOutsideMenu && clickIsOutsideOverflowTab) {
        closeMenu();
      }
    };
    import_react15.default.useEffect(() => {
      window.addEventListener("click", handleClick);
      window.addEventListener("keydown", handleMenuKeys);
      return () => {
        window.removeEventListener("click", handleClick);
        window.removeEventListener("keydown", handleMenuKeys);
      };
    }, [isExpanded, menuRef, overflowTabRef]);
    const selectedTab = overflowingTabs.find((tab) => tab.eventKey === localActiveKey);
    const tabTitle = (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.title) ? selectedTab.title : defaultTitleText;
    const toggleMenu = () => {
      setIsExpanded((prevIsExpanded) => !prevIsExpanded);
      setTimeout(() => {
        if (menuRef === null || menuRef === void 0 ? void 0 : menuRef.current) {
          const firstElement = menuRef.current.querySelector("li > button,input:not(:disabled)");
          firstElement && firstElement.focus();
        }
      }, 0);
    };
    const overflowTab = import_react15.default.createElement(
      "li",
      Object.assign({ className: css(tabs_default.tabsItem, tabs_default.modifiers.overflow, selectedTab && tabs_default.modifiers.current, className), role: "presentation", ref: overflowLIRef }, props),
      import_react15.default.createElement(
        "button",
        { type: "button", className: css(tabs_default.tabsLink, isExpanded && tabs_default.modifiers.expanded), onClick: () => toggleMenu(), "aria-label": toggleAriaLabel, "aria-haspopup": "menu", "aria-expanded": isExpanded, role: "tab", ref: overflowTabRef },
        import_react15.default.createElement(
          TabTitleText,
          null,
          tabTitle,
          showTabCount && tabTitle === defaultTitleText && ` (${overflowingTabs.length})`
        ),
        import_react15.default.createElement(
          "span",
          { className: tabs_default.tabsLinkToggleIcon },
          import_react15.default.createElement(angle_right_icon_default, null)
        )
      )
    );
    const tabs = overflowingTabs.map((tab) => import_react15.default.createElement(MenuItem, { key: tab.eventKey, itemId: tab.eventKey, isSelected: localActiveKey === tab.eventKey }, tab.title));
    const onTabSelect = (event, key) => {
      closeMenu();
      const selectedTabRef = overflowingTabs.find((tab) => tab.eventKey === key).tabContentRef;
      handleTabClick(event, key, selectedTabRef);
    };
    const overflowMenu = import_react15.default.createElement(
      Menu,
      { ref: menuRef, onSelect: (ev, itemId) => onTabSelect(ev, itemId) },
      import_react15.default.createElement(
        MenuContent,
        null,
        import_react15.default.createElement(MenuList, null, tabs)
      )
    );
    return import_react15.default.createElement(
      import_react15.default.Fragment,
      null,
      overflowTab,
      import_react15.default.createElement(Popper, { triggerRef: overflowTabRef, popper: overflowMenu, popperRef: menuRef, isVisible: isExpanded, minWidth: "revert", appendTo: overflowLIRef.current, zIndex })
    );
  };
  OverflowTab.displayName = "OverflowTab";

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/Tabs.js
  var TabsComponent;
  (function(TabsComponent2) {
    TabsComponent2["div"] = "div";
    TabsComponent2["nav"] = "nav";
  })(TabsComponent || (TabsComponent = {}));
  var variantStyle5 = {
    default: "",
    light300: tabs_default.modifiers.colorSchemeLight_300
  };
  var Tabs = class _Tabs extends React176.Component {
    constructor(props) {
      super(props);
      this.tabList = React176.createRef();
      this.leftScrollButtonRef = React176.createRef();
      this.direction = "ltr";
      this.scrollTimeout = null;
      this.countOverflowingElements = (container) => {
        const elements = Array.from(container.children);
        return elements.filter((element) => !isElementInView(container, element, false)).length;
      };
      this.handleScrollButtons = () => {
        const { isOverflowHorizontal } = this.props;
        clearTimeout(this.scrollTimeout);
        this.scrollTimeout = setTimeout(() => {
          const container = this.tabList.current;
          let disableBackScrollButton = true;
          let disableForwardScrollButton = true;
          let enableScrollButtons = false;
          let overflowingTabCount = 0;
          if (container && !this.props.isVertical && !isOverflowHorizontal) {
            const overflowOnLeft = !isElementInView(container, container.firstChild, false);
            const overflowOnRight = !isElementInView(container, container.lastChild, false);
            enableScrollButtons = overflowOnLeft || overflowOnRight;
            disableBackScrollButton = !overflowOnLeft;
            disableForwardScrollButton = !overflowOnRight;
          }
          if (isOverflowHorizontal) {
            overflowingTabCount = this.countOverflowingElements(container);
          }
          this.setState({
            enableScrollButtons,
            disableBackScrollButton,
            disableForwardScrollButton,
            overflowingTabCount
          });
        }, 100);
      };
      this.scrollBack = () => {
        if (this.tabList.current) {
          const container = this.tabList.current;
          const childrenArr = Array.from(container.children);
          let firstElementInView;
          let lastElementOutOfView;
          let i;
          for (i = 0; i < childrenArr.length && !firstElementInView; i++) {
            if (isElementInView(container, childrenArr[i], false)) {
              firstElementInView = childrenArr[i];
              lastElementOutOfView = childrenArr[i - 1];
            }
          }
          if (lastElementOutOfView) {
            if (this.direction === "ltr") {
              container.scrollLeft -= lastElementOutOfView.scrollWidth;
            } else {
              container.scrollLeft += lastElementOutOfView.scrollWidth;
            }
          }
        }
      };
      this.scrollForward = () => {
        if (this.tabList.current) {
          const container = this.tabList.current;
          const childrenArr = Array.from(container.children);
          let lastElementInView;
          let firstElementOutOfView;
          for (let i = childrenArr.length - 1; i >= 0 && !lastElementInView; i--) {
            if (isElementInView(container, childrenArr[i], false)) {
              lastElementInView = childrenArr[i];
              firstElementOutOfView = childrenArr[i + 1];
            }
          }
          if (firstElementOutOfView) {
            if (this.direction === "ltr") {
              container.scrollLeft += firstElementOutOfView.scrollWidth;
            } else {
              container.scrollLeft -= firstElementOutOfView.scrollWidth;
            }
          }
        }
      };
      this.hideScrollButtons = () => {
        const { enableScrollButtons, renderScrollButtons, showScrollButtons } = this.state;
        if (!enableScrollButtons && !showScrollButtons && renderScrollButtons) {
          this.setState({ renderScrollButtons: false });
        }
      };
      this.state = {
        enableScrollButtons: false,
        showScrollButtons: false,
        renderScrollButtons: false,
        disableBackScrollButton: true,
        disableForwardScrollButton: true,
        shownKeys: this.props.defaultActiveKey !== void 0 ? [this.props.defaultActiveKey] : [this.props.activeKey],
        // only for mountOnEnter case
        uncontrolledActiveKey: this.props.defaultActiveKey,
        uncontrolledIsExpandedLocal: this.props.defaultIsExpanded,
        ouiaStateId: getDefaultOUIAId(_Tabs.displayName),
        overflowingTabCount: 0
      };
      if (this.props.isVertical && this.props.expandable !== void 0) {
        if (!this.props.toggleAriaLabel && !this.props.toggleText) {
          console.error("Tabs:", "toggleAriaLabel or the toggleText prop is required to make the toggle button accessible");
        }
      }
    }
    handleTabClick(event, eventKey, tabContentRef) {
      const { shownKeys } = this.state;
      const { onSelect, defaultActiveKey } = this.props;
      if (defaultActiveKey !== void 0) {
        this.setState({
          uncontrolledActiveKey: eventKey
        });
      } else {
        onSelect(event, eventKey);
      }
      if (tabContentRef) {
        React176.Children.toArray(this.props.children).filter((child) => React176.isValidElement(child)).filter(({ props }) => props.tabContentRef && props.tabContentRef.current).forEach((child) => child.props.tabContentRef.current.hidden = true);
        if (tabContentRef.current) {
          tabContentRef.current.hidden = false;
        }
      }
      if (this.props.mountOnEnter) {
        this.setState({
          shownKeys: shownKeys.concat(eventKey)
        });
      }
    }
    componentDidMount() {
      if (!this.props.isVertical) {
        if (canUseDOM) {
          window.addEventListener("resize", this.handleScrollButtons, false);
        }
        this.direction = getLanguageDirection(this.tabList.current);
        this.handleScrollButtons();
      }
    }
    componentWillUnmount() {
      var _a;
      if (!this.props.isVertical) {
        if (canUseDOM) {
          window.removeEventListener("resize", this.handleScrollButtons, false);
        }
      }
      clearTimeout(this.scrollTimeout);
      (_a = this.leftScrollButtonRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener("transitionend", this.hideScrollButtons);
    }
    componentDidUpdate(prevProps, prevState) {
      const { activeKey, mountOnEnter, isOverflowHorizontal, children } = this.props;
      const { shownKeys, overflowingTabCount, enableScrollButtons } = this.state;
      if (prevProps.activeKey !== activeKey && mountOnEnter && shownKeys.indexOf(activeKey) < 0) {
        this.setState({
          shownKeys: shownKeys.concat(activeKey)
        });
      }
      if (prevProps.children && children && React176.Children.toArray(prevProps.children).length !== React176.Children.toArray(children).length) {
        this.handleScrollButtons();
      }
      const currentOverflowingTabCount = this.countOverflowingElements(this.tabList.current);
      if (isOverflowHorizontal && currentOverflowingTabCount) {
        this.setState({ overflowingTabCount: currentOverflowingTabCount + overflowingTabCount });
      }
      if (!prevState.enableScrollButtons && enableScrollButtons) {
        this.setState({ renderScrollButtons: true });
        setTimeout(() => {
          var _a;
          (_a = this.leftScrollButtonRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener("transitionend", this.hideScrollButtons);
          this.setState({ showScrollButtons: true });
        }, 100);
      } else if (prevState.enableScrollButtons && !enableScrollButtons) {
        this.setState({ showScrollButtons: false });
      }
      this.direction = getLanguageDirection(this.tabList.current);
    }
    static getDerivedStateFromProps(nextProps, prevState) {
      if (prevState.uncontrolledActiveKey === void 0) {
        return null;
      }
      const childrenHasTabWithActiveEventKey = React176.Children.toArray(nextProps.children).filter((child) => React176.isValidElement(child)).some(({ props }) => props.eventKey === prevState.uncontrolledActiveKey);
      if (childrenHasTabWithActiveEventKey) {
        return null;
      }
      return {
        uncontrolledActiveKey: nextProps.defaultActiveKey,
        shownKeys: nextProps.defaultActiveKey !== void 0 ? [nextProps.defaultActiveKey] : [nextProps.activeKey]
        // only for mountOnEnter case
      };
    }
    render() {
      const _a = this.props, { className, children, activeKey, defaultActiveKey, id, isFilled, isSecondary, isVertical: isVertical2, isBox, hasNoBorderBottom, leftScrollAriaLabel, rightScrollAriaLabel, backScrollAriaLabel, forwardScrollAriaLabel, "aria-label": ariaLabel, component, ouiaId, ouiaSafe, mountOnEnter, unmountOnExit, usePageInsets, inset, variant, expandable: expandable2, isExpanded, defaultIsExpanded, toggleText, toggleAriaLabel, addButtonAriaLabel, onToggle, onClose, onAdd, isOverflowHorizontal } = _a, props = __rest(_a, ["className", "children", "activeKey", "defaultActiveKey", "id", "isFilled", "isSecondary", "isVertical", "isBox", "hasNoBorderBottom", "leftScrollAriaLabel", "rightScrollAriaLabel", "backScrollAriaLabel", "forwardScrollAriaLabel", "aria-label", "component", "ouiaId", "ouiaSafe", "mountOnEnter", "unmountOnExit", "usePageInsets", "inset", "variant", "expandable", "isExpanded", "defaultIsExpanded", "toggleText", "toggleAriaLabel", "addButtonAriaLabel", "onToggle", "onClose", "onAdd", "isOverflowHorizontal"]);
      const { showScrollButtons, renderScrollButtons, disableBackScrollButton, disableForwardScrollButton, shownKeys, uncontrolledActiveKey, uncontrolledIsExpandedLocal, overflowingTabCount } = this.state;
      const filteredChildren = React176.Children.toArray(children).filter((child) => React176.isValidElement(child)).filter(({ props: props2 }) => !props2.isHidden);
      const filteredChildrenWithoutOverflow = filteredChildren.slice(0, filteredChildren.length - overflowingTabCount);
      const filteredChildrenOverflowing = filteredChildren.slice(filteredChildren.length - overflowingTabCount);
      const overflowingTabProps = filteredChildrenOverflowing.map((child) => child.props);
      const uniqueId6 = id || getUniqueId();
      const Component40 = component === TabsComponent.nav ? "nav" : "div";
      const localActiveKey = defaultActiveKey !== void 0 ? uncontrolledActiveKey : activeKey;
      const isExpandedLocal = defaultIsExpanded !== void 0 ? uncontrolledIsExpandedLocal : isExpanded;
      const toggleTabs = (event, newValue) => {
        if (isExpanded === void 0) {
          this.setState({ uncontrolledIsExpandedLocal: newValue });
        } else {
          onToggle(event, newValue);
        }
      };
      const hasOverflowTab = isOverflowHorizontal && overflowingTabCount > 0;
      const overflowObjectProps = typeof isOverflowHorizontal === "object" ? Object.assign({}, isOverflowHorizontal) : {};
      return React176.createElement(
        TabsContextProvider,
        { value: {
          variant,
          mountOnEnter,
          unmountOnExit,
          localActiveKey,
          uniqueId: uniqueId6,
          handleTabClick: (...args) => this.handleTabClick(...args),
          handleTabClose: onClose
        } },
        React176.createElement(
          Component40,
          Object.assign({ "aria-label": ariaLabel, className: css(tabs_default.tabs, isFilled && tabs_default.modifiers.fill, isSecondary && tabs_default.modifiers.secondary, isVertical2 && tabs_default.modifiers.vertical, isVertical2 && expandable2 && formatBreakpointMods(expandable2, tabs_default), isVertical2 && expandable2 && isExpandedLocal && tabs_default.modifiers.expanded, isBox && tabs_default.modifiers.box, showScrollButtons && tabs_default.modifiers.scrollable, usePageInsets && tabs_default.modifiers.pageInsets, hasNoBorderBottom && tabs_default.modifiers.noBorderBottom, formatBreakpointMods(inset, tabs_default), variantStyle5[variant], hasOverflowTab && tabs_default.modifiers.overflow, className) }, getOUIAProps(_Tabs.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId, ouiaSafe), { id: id && id }, props),
          expandable2 && isVertical2 && React176.createElement(GenerateId, null, (randomId) => React176.createElement(
            "div",
            { className: css(tabs_default.tabsToggle) },
            React176.createElement(
              "div",
              { className: css(tabs_default.tabsToggleButton) },
              React176.createElement(
                Button,
                { onClick: (event) => toggleTabs(event, !isExpandedLocal), variant: "plain", "aria-label": toggleAriaLabel, "aria-expanded": isExpandedLocal, id: `${randomId}-button`, "aria-labelledby": `${randomId}-text ${randomId}-button` },
                React176.createElement(
                  "span",
                  { className: css(tabs_default.tabsToggleIcon) },
                  React176.createElement(angle_right_icon_default, { "arian-hidden": "true" })
                ),
                toggleText && React176.createElement("span", { className: css(tabs_default.tabsToggleText), id: `${randomId}-text` }, toggleText)
              )
            )
          )),
          renderScrollButtons && React176.createElement(
            "button",
            { type: "button", className: css(tabs_default.tabsScrollButton, isSecondary && button_default.modifiers.secondary), "aria-label": backScrollAriaLabel || leftScrollAriaLabel, onClick: this.scrollBack, disabled: disableBackScrollButton, "aria-hidden": disableBackScrollButton, ref: this.leftScrollButtonRef },
            React176.createElement(angle_left_icon_default, null)
          ),
          React176.createElement(
            "ul",
            { className: css(tabs_default.tabsList), ref: this.tabList, onScroll: this.handleScrollButtons, role: "tablist" },
            isOverflowHorizontal ? filteredChildrenWithoutOverflow : filteredChildren,
            hasOverflowTab && React176.createElement(OverflowTab, Object.assign({ overflowingTabs: overflowingTabProps }, overflowObjectProps))
          ),
          renderScrollButtons && React176.createElement(
            "button",
            { type: "button", className: css(tabs_default.tabsScrollButton, isSecondary && button_default.modifiers.secondary), "aria-label": forwardScrollAriaLabel || rightScrollAriaLabel, onClick: this.scrollForward, disabled: disableForwardScrollButton, "aria-hidden": disableForwardScrollButton },
            React176.createElement(angle_right_icon_default, null)
          ),
          onAdd !== void 0 && React176.createElement(
            "span",
            { className: css(tabs_default.tabsAdd) },
            React176.createElement(
              Button,
              { variant: "plain", "aria-label": addButtonAriaLabel || "Add tab", onClick: onAdd },
              React176.createElement(plus_icon_default, null)
            )
          )
        ),
        filteredChildren.filter((child) => child.props.children && !(unmountOnExit && child.props.eventKey !== localActiveKey) && !(mountOnEnter && shownKeys.indexOf(child.props.eventKey) === -1)).map((child) => React176.createElement(TabContent, { key: child.props.eventKey, activeKey: localActiveKey, child, id: child.props.id || uniqueId6, ouiaId: child.props.ouiaId }))
      );
    }
  };
  Tabs.displayName = "Tabs";
  Tabs.defaultProps = {
    activeKey: 0,
    onSelect: () => void 0,
    isFilled: false,
    isSecondary: false,
    isVertical: false,
    isBox: false,
    hasNoBorderBottom: false,
    leftScrollAriaLabel: "Scroll left",
    backScrollAriaLabel: "Scroll back",
    rightScrollAriaLabel: "Scroll right",
    forwardScrollAriaLabel: "Scroll forward",
    component: TabsComponent.div,
    mountOnEnter: false,
    unmountOnExit: false,
    ouiaSafe: true,
    variant: "default",
    onToggle: (_event, _isExpanded) => void 0
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Tabs/TabTitleIcon.js
  init_tslib_es6();
  var React177 = __toESM(require_react());
  var TabTitleIcon = (_a) => {
    var { children, className = "" } = _a, props = __rest(_a, ["children", "className"]);
    return React177.createElement("span", Object.assign({ className: css(tabs_default.tabsItemIcon, className) }, props), children);
  };
  TabTitleIcon.displayName = "TabTitleIcon";

  // node_modules/@patternfly/react-core/dist/esm/components/TimePicker/TimePicker.js
  init_tslib_es6();
  var React178 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/TimePicker/TimePickerUtils.js
  var amSuffix = " AM";
  var pmSuffix = " PM";
  var makeTimeOptions = (stepMinutes, hour12, delimiter, minTime, maxTime, includeSeconds) => {
    const res = [];
    const iter = new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0));
    const iterDay = iter.getDay();
    while (iter.getDay() === iterDay) {
      let hour = iter.getHours();
      let suffix = amSuffix;
      if (hour12) {
        if (hour === 0) {
          hour = 12;
        } else if (hour >= 12) {
          suffix = pmSuffix;
        }
        if (hour > 12) {
          hour %= 12;
        }
      }
      hour = hour12 ? hour.toString() : hour.toString().padStart(2, "0");
      const minutes = iter.getMinutes().toString().padStart(2, "0");
      const timeOption = `${hour}${delimiter}${minutes}${hour12 ? suffix : ""}`;
      if (isWithinMinMax(minTime, maxTime, timeOption, delimiter, includeSeconds)) {
        res.push(timeOption);
      }
      iter.setMinutes(iter.getMinutes() + stepMinutes);
    }
    return res;
  };
  var parseTime = (time2, timeRegex, delimiter, is12Hour, includeSeconds) => {
    const date2 = new Date(time2);
    if (!isNaN(date2.getDate()) && (time2 instanceof Date || time2.includes("T"))) {
      const hours = is12Hour ? `${date2.getHours() > 12 ? date2.getHours() - 12 : date2.getHours()}` : `${date2.getHours()}`.padStart(2, "0");
      const minutes = `${date2.getMinutes()}`.padStart(2, "0");
      const seconds2 = includeSeconds ? `${date2.getSeconds()}`.padStart(2, "0") : "";
      const secondsWithDelimiter = seconds2 ? `${delimiter}${seconds2}` : "";
      let ampm = "";
      if (is12Hour && date2.getHours() > 11) {
        ampm = pmSuffix;
      } else if (is12Hour) {
        ampm = amSuffix;
      }
      return `${hours}${delimiter}${minutes}${secondsWithDelimiter}${ampm}`;
    } else if (typeof time2 === "string") {
      time2 = time2.trim();
      if (time2 !== "" && validateTime(time2, timeRegex, delimiter, is12Hour)) {
        const [, hours, minutes, seconds2, suffix = ""] = timeRegex.exec(time2);
        const secondsWithDelimiter = includeSeconds ? `${delimiter}${seconds2 !== null && seconds2 !== void 0 ? seconds2 : "00"}` : "";
        let ampm = "";
        if (is12Hour) {
          const uppercaseSuffix = suffix.toUpperCase();
          if (uppercaseSuffix === amSuffix.toUpperCase().trim()) {
            ampm = amSuffix;
          } else if (uppercaseSuffix === pmSuffix.toUpperCase().trim()) {
            ampm = pmSuffix;
          } else {
            ampm = (/* @__PURE__ */ new Date()).getHours() > 11 ? pmSuffix : amSuffix;
          }
        }
        return `${hours}${delimiter}${minutes}${secondsWithDelimiter}${ampm}`;
      }
    }
    return time2.toString();
  };
  var validateTime = (time2, timeRegex, delimiter, is12Hour) => {
    const date2 = new Date(time2);
    if (!isNaN(date2.getDate()) && time2.includes("T")) {
      return true;
    }
    const hours = parseInt(time2.split(delimiter)[0]);
    const validHours = hours >= (is12Hour ? 1 : 0) && hours <= (is12Hour ? 12 : 23);
    return time2 === "" || timeRegex.test(time2) && validHours;
  };
  var getHours = (time2, timeRegex) => {
    const parts = time2.match(timeRegex);
    if (parts && parts.length) {
      if (/pm/i.test(parts[4])) {
        return parseInt(parts[1]) === 12 ? parseInt(parts[1]) : parseInt(parts[1]) + 12;
      }
      if (/am/i.test(parts[4])) {
        return parseInt(parts[1]) === 12 ? 0 : parseInt(parts[1]);
      }
      return parseInt(parts[1]);
    }
    return null;
  };
  var getMinutes = (time2, timeRegex) => {
    const parts = time2.match(timeRegex);
    return parts && parts.length ? parseInt(parts[2]) : null;
  };
  var getSeconds = (time2, timeRegex) => {
    var _a;
    const seconds2 = (_a = time2.match(timeRegex)) === null || _a === void 0 ? void 0 : _a[3];
    return seconds2 ? parseInt(seconds2) : null;
  };
  var isWithinMinMax = (minTime, maxTime, time2, delimiter, includeSeconds) => {
    if (time2.trim() === "") {
      return true;
    }
    const min24HourTime = convertTo24Hour(minTime, delimiter, includeSeconds);
    const selected24HourTime = convertTo24Hour(time2, delimiter, includeSeconds);
    const max24HourTime = convertTo24Hour(maxTime, delimiter, includeSeconds);
    return min24HourTime <= selected24HourTime && selected24HourTime <= max24HourTime;
  };
  var convertTo24Hour = (time2, delimiter, includeSeconds) => {
    const timeReg = new RegExp(`^\\s*(\\d\\d?)${delimiter}([0-5]\\d)${delimiter}?([0-5]\\d)?\\s*([AaPp][Mm])?\\s*$`);
    const regMatches = timeReg.exec(time2);
    if (!regMatches || !regMatches.length) {
      return;
    }
    let hours = regMatches[1].padStart(2, "0");
    const minutes = regMatches[2];
    let seconds2 = regMatches[3] ? `${delimiter}${regMatches[3]}` : "";
    if (!seconds2 && includeSeconds) {
      seconds2 = `${delimiter}00`;
    }
    const suffix = regMatches[4] || "";
    if (suffix.toUpperCase() === "PM" && hours !== "12") {
      hours = `${parseInt(hours) + 12}`;
    } else if (suffix.toUpperCase() === "AM" && hours === "12") {
      hours = "00";
    }
    return `${hours}${delimiter}${minutes}${seconds2}`;
  };

  // node_modules/@patternfly/react-icons/dist/esm/icons/outlined-clock-icon.js
  var OutlinedClockIconConfig = {
    name: "OutlinedClockIcon",
    height: 512,
    width: 512,
    svgPath: "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm61.8-104.4l-84.9-61.7c-3.1-2.3-4.9-5.9-4.9-9.7V116c0-6.6 5.4-12 12-12h32c6.6 0 12 5.4 12 12v141.7l66.8 48.6c5.4 3.9 6.5 11.4 2.6 16.8L334.6 349c-3.9 5.3-11.4 6.5-16.8 2.6z",
    yOffset: 0,
    xOffset: 0
  };
  var OutlinedClockIcon = createIcon(OutlinedClockIconConfig);
  var outlined_clock_icon_default = OutlinedClockIcon;

  // node_modules/@patternfly/react-tokens/dist/esm/c_date_picker__input_c_form_control_Width.js
  var c_date_picker__input_c_form_control_Width = {
    "name": "--pf-v5-c-date-picker__input--c-form-control--Width",
    "value": "calc(10 * 1ch + calc(2rem + 0.5rem))",
    "var": "var(--pf-v5-c-date-picker__input--c-form-control--Width)"
  };
  var c_date_picker_input_c_form_control_Width_default = c_date_picker__input_c_form_control_Width;

  // node_modules/@patternfly/react-core/dist/esm/components/TimePicker/TimePicker.js
  var TimePicker = class extends React178.Component {
    constructor(props) {
      super(props);
      this.baseComponentRef = React178.createRef();
      this.toggleRef = React178.createRef();
      this.inputRef = React178.createRef();
      this.menuRef = React178.createRef();
      this.onDocClick = (event) => {
        var _a, _b, _c, _d;
        const clickedOnToggle = (_b = (_a = this.toggleRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.contains(event.target);
        const clickedWithinMenu = (_d = (_c = this.menuRef) === null || _c === void 0 ? void 0 : _c.current) === null || _d === void 0 ? void 0 : _d.contains(event.target);
        if (this.state.isTimeOptionsOpen && !(clickedOnToggle || clickedWithinMenu)) {
          this.onToggle(false);
        }
      };
      this.handleGlobalKeys = (event) => {
        var _a, _b, _c, _d;
        const { isTimeOptionsOpen, focusedIndex, scrollIndex } = this.state;
        if ((_b = (_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.contains(event.target)) {
          if (!isTimeOptionsOpen && event.key !== KeyTypes.Tab && event.key !== KeyTypes.Escape) {
            this.onToggle(true);
          } else if (isTimeOptionsOpen) {
            if (event.key === KeyTypes.Escape || event.key === KeyTypes.Tab) {
              this.onToggle(false);
            } else if (event.key === KeyTypes.Enter) {
              if (focusedIndex !== null) {
                this.focusSelection(focusedIndex);
                event.stopPropagation();
              } else {
                this.onToggle(false);
              }
            } else if (event.key === KeyTypes.ArrowDown || event.key === KeyTypes.ArrowUp) {
              this.focusSelection(scrollIndex);
              this.updateFocusedIndex(0);
              event.preventDefault();
            }
          }
        } else if ((_d = (_c = this.menuRef) === null || _c === void 0 ? void 0 : _c.current) === null || _d === void 0 ? void 0 : _d.contains(event.target)) {
          if (event.key === KeyTypes.ArrowDown) {
            this.updateFocusedIndex(1);
            event.preventDefault();
          } else if (event.key === KeyTypes.ArrowUp) {
            this.updateFocusedIndex(-1);
            event.preventDefault();
          } else if (event.key === KeyTypes.Escape || event.key === KeyTypes.Tab) {
            this.inputRef.current.focus();
            this.onToggle(false);
          }
        }
      };
      this.updateFocusedIndex = (increment) => {
        this.setState((prevState) => {
          const maxIndex = this.getOptions().length - 1;
          let nextIndex = prevState.focusedIndex !== null ? prevState.focusedIndex + increment : prevState.scrollIndex + increment;
          if (nextIndex < 0) {
            nextIndex = maxIndex;
          } else if (nextIndex > maxIndex) {
            nextIndex = 0;
          }
          this.scrollToIndex(nextIndex);
          return {
            focusedIndex: nextIndex
          };
        });
      };
      this.getIndexToScroll = (index) => {
        if (this.props.menuAppendTo === "inline") {
          return index > 0 ? index - 1 : 0;
        }
        return index;
      };
      this.scrollToIndex = (index) => {
        this.getOptions()[index].closest(`.${menu_default.menuContent}`).scrollTop = this.getOptions()[this.getIndexToScroll(index)].offsetTop;
      };
      this.focusSelection = (index) => {
        var _a;
        const indexToFocus = index !== -1 ? index : 0;
        if ((_a = this.menuRef) === null || _a === void 0 ? void 0 : _a.current) {
          this.getOptions()[indexToFocus].querySelector(`.${menu_default.menuItem}`).focus();
        }
      };
      this.scrollToSelection = (time3) => {
        const { delimiter: delimiter2, is24Hour: is24Hour2 } = this.props;
        let splitTime = time3.split(this.props.delimiter);
        let focusedIndex = null;
        if (splitTime.length < 2) {
          time3 = `${time3}${delimiter2}00`;
          splitTime = time3.split(delimiter2);
        } else if (splitTime.length > 2) {
          time3 = parseTime(time3, this.state.timeRegex, delimiter2, !is24Hour2, false);
          splitTime = time3.split(delimiter2);
        }
        if (!is24Hour2 && splitTime.length > 1 && splitTime[1].length < 2) {
          const minutes = splitTime[1].length === 0 ? "00" : splitTime[1] + "0";
          time3 = `${splitTime[0]}${delimiter2}${minutes}${(/* @__PURE__ */ new Date()).getHours() > 11 ? pmSuffix : amSuffix}`;
        } else if (!is24Hour2 && splitTime.length > 1 && splitTime[1].length === 2 && !time3.toUpperCase().includes(amSuffix.toUpperCase().trim()) && !time3.toUpperCase().includes(pmSuffix.toUpperCase().trim())) {
          time3 = `${time3}${(/* @__PURE__ */ new Date()).getHours() > 11 ? pmSuffix : amSuffix}`;
        }
        let scrollIndex = this.getOptions().findIndex((option) => option.textContent === time3);
        if (scrollIndex !== -1) {
          this.scrollToIndex(scrollIndex);
          focusedIndex = scrollIndex;
        } else if (splitTime.length === 2) {
          let amPm = "";
          if (!is24Hour2) {
            if (splitTime[1].toUpperCase().includes("P")) {
              amPm = pmSuffix;
            } else if (splitTime[1].toUpperCase().includes("A")) {
              amPm = amSuffix;
            }
          }
          time3 = `${splitTime[0]}${delimiter2}00${amPm}`;
          scrollIndex = this.getOptions().findIndex((option) => option.textContent === time3);
          if (scrollIndex !== -1) {
            this.scrollToIndex(scrollIndex);
          }
        }
        this.setState({
          focusedIndex,
          scrollIndex
        });
      };
      this.getRegExp = (includeSeconds2 = true) => {
        const { is24Hour: is24Hour2, delimiter: delimiter2 } = this.props;
        let baseRegex = `\\s*(\\d\\d?)${delimiter2}([0-5]\\d)`;
        if (includeSeconds2) {
          baseRegex += `${delimiter2}?([0-5]\\d)?`;
        }
        return new RegExp(`^${baseRegex}${is24Hour2 ? "" : "\\s*([AaPp][Mm])?"}\\s*$`);
      };
      this.getOptions = () => {
        var _a;
        return ((_a = this.menuRef) === null || _a === void 0 ? void 0 : _a.current) ? Array.from(this.menuRef.current.querySelectorAll(`.${menu_default.menuListItem}`)) : [];
      };
      this.isValidFormat = (time3) => {
        if (this.props.validateTime) {
          return this.props.validateTime(time3);
        }
        const { delimiter: delimiter2, is24Hour: is24Hour2, includeSeconds: includeSeconds2 } = this.props;
        return validateTime(time3, this.getRegExp(includeSeconds2), delimiter2, !is24Hour2);
      };
      this.isValidTime = (time3) => {
        const { delimiter: delimiter2, includeSeconds: includeSeconds2 } = this.props;
        const { minTimeState, maxTimeState } = this.state;
        return isWithinMinMax(minTimeState, maxTimeState, time3, delimiter2, includeSeconds2);
      };
      this.isValid = (time3) => this.isValidFormat(time3) && this.isValidTime(time3);
      this.onToggle = (isOpen2) => {
        this.setState((prevState) => {
          const { timeRegex: timeRegex2, isInvalid, timeState } = prevState;
          const { delimiter: delimiter2, is24Hour: is24Hour2, includeSeconds: includeSeconds2, onChange } = this.props;
          const time3 = parseTime(timeState, timeRegex2, delimiter2, !is24Hour2, includeSeconds2);
          if (onChange && !isOpen2 && time3 !== timeState) {
            onChange(null, time3, getHours(time3, timeRegex2), getMinutes(time3, timeRegex2), getSeconds(time3, timeRegex2), this.isValid(time3));
          }
          return {
            isTimeOptionsOpen: isOpen2,
            timeState: time3,
            isInvalid: isOpen2 ? isInvalid : !this.isValid(time3)
          };
        });
        this.props.setIsOpen(isOpen2);
        if (!isOpen2) {
          this.inputRef.current.focus();
        }
      };
      this.onSelect = (e) => {
        const { timeRegex: timeRegex2, timeState } = this.state;
        const { delimiter: delimiter2, is24Hour: is24Hour2, includeSeconds: includeSeconds2, setIsOpen } = this.props;
        const time3 = parseTime(e.target.textContent, timeRegex2, delimiter2, !is24Hour2, includeSeconds2);
        if (time3 !== timeState) {
          this.onInputChange(e, time3);
        }
        this.inputRef.current.focus();
        this.setState({
          isTimeOptionsOpen: false,
          isInvalid: false
        });
        setIsOpen(false);
      };
      this.onInputClick = (e) => {
        if (!this.state.isTimeOptionsOpen) {
          this.onToggle(true);
        }
        e.stopPropagation();
      };
      this.onInputChange = (event, newTime) => {
        const { onChange } = this.props;
        const { timeRegex: timeRegex2 } = this.state;
        if (onChange) {
          onChange(event, newTime, getHours(newTime, timeRegex2), getMinutes(newTime, timeRegex2), getSeconds(newTime, timeRegex2), this.isValid(newTime));
        }
        this.scrollToSelection(newTime);
        this.setState({
          timeState: newTime
        });
      };
      const { is24Hour, delimiter, time: time2, includeSeconds, isOpen } = this.props;
      let { minTime, maxTime } = this.props;
      if (minTime === "") {
        const minSeconds = includeSeconds ? `${delimiter}00` : "";
        minTime = is24Hour ? `00${delimiter}00${minSeconds}` : `12${delimiter}00${minSeconds} AM`;
      }
      if (maxTime === "") {
        const maxSeconds = includeSeconds ? `${delimiter}59` : "";
        maxTime = is24Hour ? `23${delimiter}59${maxSeconds}` : `11${delimiter}59${maxSeconds} PM`;
      }
      const timeRegex = this.getRegExp();
      this.state = {
        isInvalid: false,
        isTimeOptionsOpen: isOpen,
        timeState: parseTime(time2, timeRegex, delimiter, !is24Hour, includeSeconds),
        focusedIndex: null,
        scrollIndex: 0,
        timeRegex,
        minTimeState: parseTime(minTime, timeRegex, delimiter, !is24Hour, includeSeconds),
        maxTimeState: parseTime(maxTime, timeRegex, delimiter, !is24Hour, includeSeconds)
      };
    }
    componentDidMount() {
      document.addEventListener("mousedown", this.onDocClick);
      document.addEventListener("touchstart", this.onDocClick);
      document.addEventListener("keydown", this.handleGlobalKeys);
      this.setState({ isInvalid: !this.isValid(this.state.timeState) });
    }
    componentWillUnmount() {
      document.removeEventListener("mousedown", this.onDocClick);
      document.removeEventListener("touchstart", this.onDocClick);
      document.removeEventListener("keydown", this.handleGlobalKeys);
    }
    componentDidUpdate(prevProps, prevState) {
      const { timeState, isTimeOptionsOpen, isInvalid, timeRegex } = this.state;
      const { time: time2, is24Hour, delimiter, includeSeconds, isOpen, minTime, maxTime } = this.props;
      if (prevProps.isOpen !== isOpen) {
        this.onToggle(isOpen);
      }
      if (isTimeOptionsOpen && !prevState.isTimeOptionsOpen && timeState && !isInvalid) {
        this.scrollToSelection(timeState);
      }
      if (delimiter !== prevProps.delimiter) {
        this.setState({
          timeRegex: this.getRegExp()
        });
      }
      if (time2 !== "" && time2 !== prevProps.time) {
        const parsedTime = parseTime(time2, timeRegex, delimiter, !is24Hour, includeSeconds);
        this.setState({
          timeState: parsedTime,
          isInvalid: !this.isValid(parsedTime)
        });
      }
      if (minTime !== "" && minTime !== prevProps.minTime) {
        this.setState({
          minTimeState: parseTime(minTime, timeRegex, delimiter, !is24Hour, includeSeconds)
        });
      }
      if (maxTime !== "" && maxTime !== prevProps.maxTime) {
        this.setState({
          maxTimeState: parseTime(maxTime, timeRegex, delimiter, !is24Hour, includeSeconds)
        });
      }
    }
    render() {
      const _a = this.props, {
        "aria-label": ariaLabel,
        isDisabled,
        className,
        placeholder,
        id,
        menuAppendTo,
        is24Hour,
        invalidFormatErrorMessage,
        invalidMinMaxErrorMessage,
        stepMinutes,
        width,
        delimiter,
        inputProps,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        onChange,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        setIsOpen,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        isOpen,
        time: time2,
        validateTime: validateTime2,
        minTime,
        maxTime,
        includeSeconds,
        zIndex
      } = _a, props = __rest(_a, ["aria-label", "isDisabled", "className", "placeholder", "id", "menuAppendTo", "is24Hour", "invalidFormatErrorMessage", "invalidMinMaxErrorMessage", "stepMinutes", "width", "delimiter", "inputProps", "onChange", "setIsOpen", "isOpen", "time", "validateTime", "minTime", "maxTime", "includeSeconds", "zIndex"]);
      const { timeState, isTimeOptionsOpen, isInvalid, minTimeState, maxTimeState } = this.state;
      const style = { [c_date_picker_input_c_form_control_Width_default.name]: width };
      const options5 = makeTimeOptions(stepMinutes, !is24Hour, delimiter, minTimeState, maxTimeState, includeSeconds);
      const isValidFormat = this.isValidFormat(timeState);
      const randomId = id || getUniqueId("time-picker");
      const getParentElement = () => {
        if (this.baseComponentRef && this.baseComponentRef.current) {
          return this.baseComponentRef.current.parentElement;
        }
        return null;
      };
      const menuContainer = React178.createElement(
        Menu,
        { ref: this.menuRef, isScrollable: true },
        React178.createElement(
          MenuContent,
          { maxMenuHeight: "200px" },
          React178.createElement(MenuList, { "aria-label": ariaLabel }, options5.map((option, index) => React178.createElement(MenuItem, { onClick: this.onSelect, key: option, id: `${randomId}-option-${index}` }, option)))
        )
      );
      const textInput = React178.createElement(TextInput, Object.assign({ "aria-haspopup": "menu", id: `${randomId}-input`, "aria-label": ariaLabel, validated: isInvalid ? "error" : "default", placeholder, value: timeState || "", type: "text", customIcon: React178.createElement(outlined_clock_icon_default, null), onClick: this.onInputClick, onChange: this.onInputChange, autoComplete: "off", isDisabled, isExpanded: isTimeOptionsOpen, ref: this.inputRef }, inputProps));
      let calculatedAppendTo;
      switch (menuAppendTo) {
        case "inline":
          calculatedAppendTo = () => this.toggleRef.current;
          break;
        case "parent":
          calculatedAppendTo = getParentElement;
          break;
        default:
          calculatedAppendTo = menuAppendTo;
      }
      return React178.createElement(
        "div",
        { ref: this.baseComponentRef, className: css(date_picker_default.datePicker, className) },
        React178.createElement(
          "div",
          Object.assign({ className: css(date_picker_default.datePickerInput), style }, props),
          React178.createElement(
            InputGroup,
            null,
            React178.createElement(
              InputGroupItem,
              null,
              React178.createElement(
                "div",
                { id: randomId },
                React178.createElement(
                  "div",
                  { ref: this.toggleRef, style: { paddingLeft: "0" } },
                  React178.createElement(Popper, { appendTo: calculatedAppendTo, trigger: textInput, triggerRef: this.toggleRef, popper: menuContainer, popperRef: this.menuRef, isVisible: isTimeOptionsOpen, zIndex })
                )
              )
            )
          ),
          isInvalid && React178.createElement(
            "div",
            { className: css(date_picker_default.datePickerHelperText) },
            React178.createElement(
              HelperText,
              null,
              React178.createElement(HelperTextItem, { variant: "error" }, !isValidFormat ? invalidFormatErrorMessage : invalidMinMaxErrorMessage)
            )
          )
        )
      );
    }
  };
  TimePicker.displayName = "TimePicker";
  TimePicker.defaultProps = {
    className: "",
    isDisabled: false,
    time: "",
    is24Hour: false,
    invalidFormatErrorMessage: "Invalid time format",
    invalidMinMaxErrorMessage: "Invalid time entered",
    placeholder: "hh:mm",
    delimiter: ":",
    "aria-label": "Time picker",
    width: "150px",
    menuAppendTo: "inline",
    stepMinutes: 30,
    inputProps: {},
    minTime: "",
    maxTime: "",
    isOpen: false,
    setIsOpen: () => {
    },
    zIndex: 9999
  };

  // node_modules/@patternfly/react-core/dist/esm/components/ToggleGroup/ToggleGroup.js
  init_tslib_es6();
  var React181 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/ToggleGroup/toggle-group.mjs
  var toggle_group_default = {
    "modifiers": {
      "compact": "pf-m-compact",
      "selected": "pf-m-selected",
      "disabled": "pf-m-disabled"
    },
    "themeDark": "pf-v5-theme-dark",
    "toggleGroup": "pf-v5-c-toggle-group",
    "toggleGroupButton": "pf-v5-c-toggle-group__button",
    "toggleGroupIcon": "pf-v5-c-toggle-group__icon",
    "toggleGroupItem": "pf-v5-c-toggle-group__item",
    "toggleGroupText": "pf-v5-c-toggle-group__text"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/ToggleGroup/ToggleGroupItem.js
  init_tslib_es6();
  var React180 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/ToggleGroup/ToggleGroupItemElement.js
  var React179 = __toESM(require_react());
  var ToggleGroupItemVariant;
  (function(ToggleGroupItemVariant2) {
    ToggleGroupItemVariant2["icon"] = "icon";
    ToggleGroupItemVariant2["text"] = "text";
  })(ToggleGroupItemVariant || (ToggleGroupItemVariant = {}));
  var ToggleGroupItemElement = ({ variant, children }) => React179.createElement("span", { className: css(variant === "icon" && toggle_group_default.toggleGroupIcon, variant === "text" && toggle_group_default.toggleGroupText) }, children);
  ToggleGroupItemElement.displayName = "ToggleGroupItemElement";

  // node_modules/@patternfly/react-core/dist/esm/components/ToggleGroup/ToggleGroupItem.js
  var ToggleGroupItem = (_a) => {
    var { text, icon, className, isDisabled = false, isSelected = false, "aria-label": ariaLabel = "", onChange = () => {
    }, buttonId = "" } = _a, props = __rest(_a, ["text", "icon", "className", "isDisabled", "isSelected", "aria-label", "onChange", "buttonId"]);
    const handleChange = (event) => {
      onChange(event, !isSelected);
    };
    if (!ariaLabel && icon && !text) {
      console.warn("An accessible aria-label is required when using the toggle group item icon variant.");
    }
    return React180.createElement(
      "div",
      Object.assign({ className: css(toggle_group_default.toggleGroupItem, className) }, props),
      React180.createElement(
        "button",
        Object.assign({ type: "button", className: css(toggle_group_default.toggleGroupButton, isSelected && toggle_group_default.modifiers.selected), "aria-pressed": isSelected, onClick: handleChange }, ariaLabel && { "aria-label": ariaLabel }, isDisabled && { disabled: true }, buttonId && { id: buttonId }),
        icon ? React180.createElement(ToggleGroupItemElement, { variant: ToggleGroupItemVariant.icon }, icon) : null,
        text ? React180.createElement(ToggleGroupItemElement, { variant: ToggleGroupItemVariant.text }, text) : null
      )
    );
  };
  ToggleGroupItem.displayName = "ToggleGroupItem";

  // node_modules/@patternfly/react-core/dist/esm/components/ToggleGroup/ToggleGroup.js
  var ToggleGroup = (_a) => {
    var { className, children, isCompact = false, areAllGroupsDisabled = false, "aria-label": ariaLabel } = _a, props = __rest(_a, ["className", "children", "isCompact", "areAllGroupsDisabled", "aria-label"]);
    const toggleGroupItemList = React181.Children.map(children, (child) => !(React181.isValidElement(child) && child.type === ToggleGroupItem) ? child : React181.cloneElement(child, areAllGroupsDisabled ? { isDisabled: true } : {}));
    return React181.createElement("div", Object.assign({ className: css(toggle_group_default.toggleGroup, isCompact && toggle_group_default.modifiers.compact, className), role: "group", "aria-label": ariaLabel }, props), toggleGroupItemList);
  };
  ToggleGroup.displayName = "ToggleGroup";

  // node_modules/@patternfly/react-core/dist/esm/components/Toolbar/Toolbar.js
  init_tslib_es6();
  var React186 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Toolbar/toolbar.mjs
  var toolbar_default = {
    "button": "pf-v5-c-button",
    "chipGroup": "pf-v5-c-chip-group",
    "divider": "pf-v5-c-divider",
    "modifiers": {
      "hidden": "pf-m-hidden",
      "hiddenOnSm": "pf-m-hidden-on-sm",
      "visibleOnSm": "pf-m-visible-on-sm",
      "hiddenOnMd": "pf-m-hidden-on-md",
      "visibleOnMd": "pf-m-visible-on-md",
      "hiddenOnLg": "pf-m-hidden-on-lg",
      "visibleOnLg": "pf-m-visible-on-lg",
      "hiddenOnXl": "pf-m-hidden-on-xl",
      "visibleOnXl": "pf-m-visible-on-xl",
      "hiddenOn_2xl": "pf-m-hidden-on-2xl",
      "visibleOn_2xl": "pf-m-visible-on-2xl",
      "pageInsets": "pf-m-page-insets",
      "sticky": "pf-m-sticky",
      "fullHeight": "pf-m-full-height",
      "static": "pf-m-static",
      "vertical": "pf-m-vertical",
      "alignItemsStart": "pf-m-align-items-start",
      "alignItemsCenter": "pf-m-align-items-center",
      "alignItemsBaseline": "pf-m-align-items-baseline",
      "alignSelfStart": "pf-m-align-self-start",
      "alignSelfCenter": "pf-m-align-self-center",
      "alignSelfBaseline": "pf-m-align-self-baseline",
      "buttonGroup": "pf-m-button-group",
      "iconButtonGroup": "pf-m-icon-button-group",
      "filterGroup": "pf-m-filter-group",
      "toggleGroup": "pf-m-toggle-group",
      "overflowMenu": "pf-m-overflow-menu",
      "bulkSelect": "pf-m-bulk-select",
      "expandAll": "pf-m-expand-all",
      "expanded": "pf-m-expanded",
      "searchFilter": "pf-m-search-filter",
      "chipGroup": "pf-m-chip-group",
      "label": "pf-m-label",
      "formElement": "pf-m-form-element",
      "pagination": "pf-m-pagination",
      "overflowContainer": "pf-m-overflow-container",
      "chipContainer": "pf-m-chip-container",
      "plain": "pf-m-plain",
      "show": "pf-m-show",
      "showOnSm": "pf-m-show-on-sm",
      "showOnMd": "pf-m-show-on-md",
      "showOnLg": "pf-m-show-on-lg",
      "showOnXl": "pf-m-show-on-xl",
      "showOn_2xl": "pf-m-show-on-2xl",
      "alignRight": "pf-m-align-right",
      "alignLeft": "pf-m-align-left",
      "nowrap": "pf-m-nowrap",
      "wrap": "pf-m-wrap",
      "alignRightOnSm": "pf-m-align-right-on-sm",
      "alignLeftOnSm": "pf-m-align-left-on-sm",
      "nowrapOnSm": "pf-m-nowrap-on-sm",
      "wrapOnSm": "pf-m-wrap-on-sm",
      "alignRightOnMd": "pf-m-align-right-on-md",
      "alignLeftOnMd": "pf-m-align-left-on-md",
      "nowrapOnMd": "pf-m-nowrap-on-md",
      "wrapOnMd": "pf-m-wrap-on-md",
      "alignRightOnLg": "pf-m-align-right-on-lg",
      "alignLeftOnLg": "pf-m-align-left-on-lg",
      "nowrapOnLg": "pf-m-nowrap-on-lg",
      "wrapOnLg": "pf-m-wrap-on-lg",
      "alignRightOnXl": "pf-m-align-right-on-xl",
      "alignLeftOnXl": "pf-m-align-left-on-xl",
      "nowrapOnXl": "pf-m-nowrap-on-xl",
      "wrapOnXl": "pf-m-wrap-on-xl",
      "alignRightOn_2xl": "pf-m-align-right-on-2xl",
      "alignLeftOn_2xl": "pf-m-align-left-on-2xl",
      "nowrapOn_2xl": "pf-m-nowrap-on-2xl",
      "wrapOn_2xl": "pf-m-wrap-on-2xl",
      "spaceItemsNone": "pf-m-space-items-none",
      "spaceItemsSm": "pf-m-space-items-sm",
      "spaceItemsMd": "pf-m-space-items-md",
      "spaceItemsLg": "pf-m-space-items-lg",
      "spaceItemsNoneOnSm": "pf-m-space-items-none-on-sm",
      "spaceItemsSmOnSm": "pf-m-space-items-sm-on-sm",
      "spaceItemsMdOnSm": "pf-m-space-items-md-on-sm",
      "spaceItemsLgOnSm": "pf-m-space-items-lg-on-sm",
      "spaceItemsNoneOnMd": "pf-m-space-items-none-on-md",
      "spaceItemsSmOnMd": "pf-m-space-items-sm-on-md",
      "spaceItemsMdOnMd": "pf-m-space-items-md-on-md",
      "spaceItemsLgOnMd": "pf-m-space-items-lg-on-md",
      "spaceItemsNoneOnLg": "pf-m-space-items-none-on-lg",
      "spaceItemsSmOnLg": "pf-m-space-items-sm-on-lg",
      "spaceItemsMdOnLg": "pf-m-space-items-md-on-lg",
      "spaceItemsLgOnLg": "pf-m-space-items-lg-on-lg",
      "spaceItemsNoneOnXl": "pf-m-space-items-none-on-xl",
      "spaceItemsSmOnXl": "pf-m-space-items-sm-on-xl",
      "spaceItemsMdOnXl": "pf-m-space-items-md-on-xl",
      "spaceItemsLgOnXl": "pf-m-space-items-lg-on-xl",
      "spaceItemsNoneOn_2xl": "pf-m-space-items-none-on-2xl",
      "spaceItemsSmOn_2xl": "pf-m-space-items-sm-on-2xl",
      "spaceItemsMdOn_2xl": "pf-m-space-items-md-on-2xl",
      "spaceItemsLgOn_2xl": "pf-m-space-items-lg-on-2xl",
      "spacerNone": "pf-m-spacer-none",
      "spacerSm": "pf-m-spacer-sm",
      "spacerMd": "pf-m-spacer-md",
      "spacerLg": "pf-m-spacer-lg",
      "spacerNoneOnSm": "pf-m-spacer-none-on-sm",
      "spacerSmOnSm": "pf-m-spacer-sm-on-sm",
      "spacerMdOnSm": "pf-m-spacer-md-on-sm",
      "spacerLgOnSm": "pf-m-spacer-lg-on-sm",
      "spacerNoneOnMd": "pf-m-spacer-none-on-md",
      "spacerSmOnMd": "pf-m-spacer-sm-on-md",
      "spacerMdOnMd": "pf-m-spacer-md-on-md",
      "spacerLgOnMd": "pf-m-spacer-lg-on-md",
      "spacerNoneOnLg": "pf-m-spacer-none-on-lg",
      "spacerSmOnLg": "pf-m-spacer-sm-on-lg",
      "spacerMdOnLg": "pf-m-spacer-md-on-lg",
      "spacerLgOnLg": "pf-m-spacer-lg-on-lg",
      "spacerNoneOnXl": "pf-m-spacer-none-on-xl",
      "spacerSmOnXl": "pf-m-spacer-sm-on-xl",
      "spacerMdOnXl": "pf-m-spacer-md-on-xl",
      "spacerLgOnXl": "pf-m-spacer-lg-on-xl",
      "spacerNoneOn_2xl": "pf-m-spacer-none-on-2xl",
      "spacerSmOn_2xl": "pf-m-spacer-sm-on-2xl",
      "spacerMdOn_2xl": "pf-m-spacer-md-on-2xl",
      "spacerLgOn_2xl": "pf-m-spacer-lg-on-2xl",
      "insetNone": "pf-m-inset-none",
      "insetSm": "pf-m-inset-sm",
      "insetMd": "pf-m-inset-md",
      "insetLg": "pf-m-inset-lg",
      "insetXl": "pf-m-inset-xl",
      "inset_2xl": "pf-m-inset-2xl",
      "insetNoneOnSm": "pf-m-inset-none-on-sm",
      "insetSmOnSm": "pf-m-inset-sm-on-sm",
      "insetMdOnSm": "pf-m-inset-md-on-sm",
      "insetLgOnSm": "pf-m-inset-lg-on-sm",
      "insetXlOnSm": "pf-m-inset-xl-on-sm",
      "inset_2xlOnSm": "pf-m-inset-2xl-on-sm",
      "insetNoneOnMd": "pf-m-inset-none-on-md",
      "insetSmOnMd": "pf-m-inset-sm-on-md",
      "insetMdOnMd": "pf-m-inset-md-on-md",
      "insetLgOnMd": "pf-m-inset-lg-on-md",
      "insetXlOnMd": "pf-m-inset-xl-on-md",
      "inset_2xlOnMd": "pf-m-inset-2xl-on-md",
      "insetNoneOnLg": "pf-m-inset-none-on-lg",
      "insetSmOnLg": "pf-m-inset-sm-on-lg",
      "insetMdOnLg": "pf-m-inset-md-on-lg",
      "insetLgOnLg": "pf-m-inset-lg-on-lg",
      "insetXlOnLg": "pf-m-inset-xl-on-lg",
      "inset_2xlOnLg": "pf-m-inset-2xl-on-lg",
      "insetNoneOnXl": "pf-m-inset-none-on-xl",
      "insetSmOnXl": "pf-m-inset-sm-on-xl",
      "insetMdOnXl": "pf-m-inset-md-on-xl",
      "insetLgOnXl": "pf-m-inset-lg-on-xl",
      "insetXlOnXl": "pf-m-inset-xl-on-xl",
      "inset_2xlOnXl": "pf-m-inset-2xl-on-xl",
      "insetNoneOn_2xl": "pf-m-inset-none-on-2xl",
      "insetSmOn_2xl": "pf-m-inset-sm-on-2xl",
      "insetMdOn_2xl": "pf-m-inset-md-on-2xl",
      "insetLgOn_2xl": "pf-m-inset-lg-on-2xl",
      "insetXlOn_2xl": "pf-m-inset-xl-on-2xl",
      "inset_2xlOn_2xl": "pf-m-inset-2xl-on-2xl"
    },
    "pagination": "pf-v5-c-pagination",
    "toolbar": "pf-v5-c-toolbar",
    "toolbarContent": "pf-v5-c-toolbar__content",
    "toolbarContentSection": "pf-v5-c-toolbar__content-section",
    "toolbarExpandAllIcon": "pf-v5-c-toolbar__expand-all-icon",
    "toolbarExpandableContent": "pf-v5-c-toolbar__expandable-content",
    "toolbarGroup": "pf-v5-c-toolbar__group",
    "toolbarItem": "pf-v5-c-toolbar__item",
    "toolbarToggle": "pf-v5-c-toolbar__toggle"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Toolbar/ToolbarUtils.js
  var React182 = __toESM(require_react());
  var ToolbarContext = React182.createContext({
    isExpanded: false,
    toggleIsExpanded: () => {
    },
    chipGroupContentRef: null,
    updateNumberFilters: () => {
    },
    numberOfFilters: 0,
    clearAllFilters: () => {
    }
  });
  var ToolbarContentContext = React182.createContext({
    expandableContentRef: null,
    expandableContentId: "",
    chipContainerRef: null,
    clearAllFilters: () => {
    }
  });
  var globalBreakpoints = {
    md: parseInt(global_breakpoint_md_default.value),
    lg: parseInt(global_breakpoint_lg_default.value),
    xl: parseInt(global_breakpoint_xl_default.value),
    "2xl": parseInt(global_breakpoint_2xl_default.value)
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Toolbar/ToolbarChipGroupContent.js
  init_tslib_es6();
  var React185 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/Toolbar/ToolbarItem.js
  init_tslib_es6();
  var React183 = __toESM(require_react());

  // node_modules/@patternfly/react-tokens/dist/esm/c_toolbar__item_Width.js
  var c_toolbar__item_Width = {
    "name": "--pf-v5-c-toolbar__item--Width",
    "value": "auto",
    "var": "var(--pf-v5-c-toolbar__item--Width)"
  };
  var c_toolbar_item_Width_default = c_toolbar__item_Width;

  // node_modules/@patternfly/react-core/dist/esm/components/Toolbar/ToolbarItem.js
  var ToolbarItemVariant;
  (function(ToolbarItemVariant2) {
    ToolbarItemVariant2["separator"] = "separator";
    ToolbarItemVariant2["bulk-select"] = "bulk-select";
    ToolbarItemVariant2["overflow-menu"] = "overflow-menu";
    ToolbarItemVariant2["pagination"] = "pagination";
    ToolbarItemVariant2["search-filter"] = "search-filter";
    ToolbarItemVariant2["label"] = "label";
    ToolbarItemVariant2["chip-group"] = "chip-group";
    ToolbarItemVariant2["expand-all"] = "expand-all";
  })(ToolbarItemVariant || (ToolbarItemVariant = {}));
  var ToolbarItem = (_a) => {
    var { className, variant, visibility, spacer, widths, align, alignSelf, alignItems, id, children, isAllExpanded, isOverflowContainer } = _a, props = __rest(_a, ["className", "variant", "visibility", "spacer", "widths", "align", "alignSelf", "alignItems", "id", "children", "isAllExpanded", "isOverflowContainer"]);
    if (variant === ToolbarItemVariant.separator) {
      return React183.createElement(Divider, Object.assign({ className: css(toolbar_default.modifiers.vertical, className) }, props));
    }
    const widthStyles = {};
    if (widths) {
      Object.entries(widths || {}).map(([breakpoint, value]) => widthStyles[`${c_toolbar_item_Width_default.name}${breakpoint !== "default" ? `-on-${breakpoint}` : ""}`] = value);
    }
    return React183.createElement(PageContext.Consumer, null, ({ width, getBreakpoint: getBreakpoint2 }) => React183.createElement("div", Object.assign({ className: css(toolbar_default.toolbarItem, variant && toolbar_default.modifiers[toCamel(variant)], isAllExpanded && toolbar_default.modifiers.expanded, isOverflowContainer && toolbar_default.modifiers.overflowContainer, formatBreakpointMods(visibility, toolbar_default, "", getBreakpoint2(width)), formatBreakpointMods(align, toolbar_default, "", getBreakpoint2(width)), formatBreakpointMods(spacer, toolbar_default, "", getBreakpoint2(width)), alignItems === "start" && toolbar_default.modifiers.alignItemsStart, alignItems === "center" && toolbar_default.modifiers.alignItemsCenter, alignItems === "baseline" && toolbar_default.modifiers.alignItemsBaseline, alignSelf === "start" && toolbar_default.modifiers.alignSelfStart, alignSelf === "center" && toolbar_default.modifiers.alignSelfCenter, alignSelf === "baseline" && toolbar_default.modifiers.alignSelfBaseline, className) }, variant === "label" && { "aria-hidden": true }, { id }, props, widths && { style: Object.assign(Object.assign({}, widthStyles), props.style) }), children));
  };
  ToolbarItem.displayName = "ToolbarItem";

  // node_modules/@patternfly/react-core/dist/esm/components/Toolbar/ToolbarGroup.js
  init_tslib_es6();
  var React184 = __toESM(require_react());
  var ToolbarGroupVariant;
  (function(ToolbarGroupVariant2) {
    ToolbarGroupVariant2["filter-group"] = "filter-group";
    ToolbarGroupVariant2["icon-button-group"] = "icon-button-group";
    ToolbarGroupVariant2["button-group"] = "button-group";
  })(ToolbarGroupVariant || (ToolbarGroupVariant = {}));
  var ToolbarGroupWithRef = class extends React184.Component {
    render() {
      const _a = this.props, { visibility, align, alignItems, alignSelf, spacer, spaceItems, className, variant, children, isOverflowContainer, innerRef } = _a, props = __rest(_a, ["visibility", "align", "alignItems", "alignSelf", "spacer", "spaceItems", "className", "variant", "children", "isOverflowContainer", "innerRef"]);
      return React184.createElement(PageContext.Consumer, null, ({ width, getBreakpoint: getBreakpoint2 }) => React184.createElement("div", Object.assign({ className: css(toolbar_default.toolbarGroup, variant && toolbar_default.modifiers[toCamel(variant)], formatBreakpointMods(visibility, toolbar_default, "", getBreakpoint2(width)), formatBreakpointMods(align, toolbar_default, "", getBreakpoint2(width)), formatBreakpointMods(spacer, toolbar_default, "", getBreakpoint2(width)), formatBreakpointMods(spaceItems, toolbar_default, "", getBreakpoint2(width)), alignItems === "start" && toolbar_default.modifiers.alignItemsStart, alignItems === "center" && toolbar_default.modifiers.alignItemsCenter, alignItems === "baseline" && toolbar_default.modifiers.alignItemsBaseline, alignSelf === "start" && toolbar_default.modifiers.alignSelfStart, alignSelf === "center" && toolbar_default.modifiers.alignSelfCenter, alignSelf === "baseline" && toolbar_default.modifiers.alignSelfBaseline, isOverflowContainer && toolbar_default.modifiers.overflowContainer, className) }, props, { ref: innerRef }), children));
    }
  };
  var ToolbarGroup = React184.forwardRef((props, ref) => React184.createElement(ToolbarGroupWithRef, Object.assign({}, props, { innerRef: ref })));

  // node_modules/@patternfly/react-core/dist/esm/components/Toolbar/ToolbarChipGroupContent.js
  var ToolbarChipGroupContent = class extends React185.Component {
    render() {
      const _a = this.props, { className, isExpanded, chipGroupContentRef, clearAllFilters, showClearFiltersButton, clearFiltersButtonText, collapseListedFiltersBreakpoint, numberOfFilters, numberOfFiltersText, customChipGroupContent } = _a, props = __rest(_a, ["className", "isExpanded", "chipGroupContentRef", "clearAllFilters", "showClearFiltersButton", "clearFiltersButtonText", "collapseListedFiltersBreakpoint", "numberOfFilters", "numberOfFiltersText", "customChipGroupContent"]);
      const clearChipGroups = () => {
        clearAllFilters();
      };
      let collapseListedFilters = false;
      if (collapseListedFiltersBreakpoint === "all") {
        collapseListedFilters = true;
      } else if (canUseDOM) {
        collapseListedFilters = (canUseDOM ? window.innerWidth : 1200) < globalBreakpoints[collapseListedFiltersBreakpoint];
      }
      const isHidden3 = numberOfFilters === 0 || isExpanded;
      return React185.createElement(
        "div",
        Object.assign({ className: css(toolbar_default.toolbarContent, !isHidden3 && !collapseListedFilters && toolbar_default.modifiers.chipContainer, isHidden3 && toolbar_default.modifiers.hidden, className) }, (numberOfFilters === 0 || isExpanded) && { hidden: true }, { ref: chipGroupContentRef }, props),
        React185.createElement(ToolbarGroup, Object.assign({ className: css(collapseListedFilters && toolbar_default.modifiers.hidden) }, collapseListedFilters && { hidden: true }, collapseListedFilters && { "aria-hidden": true })),
        collapseListedFilters && numberOfFilters > 0 && !isExpanded && React185.createElement(
          ToolbarGroup,
          null,
          React185.createElement(ToolbarItem, null, numberOfFiltersText(numberOfFilters))
        ),
        showClearFiltersButton && !isExpanded && !customChipGroupContent && React185.createElement(
          ToolbarItem,
          null,
          React185.createElement(Button, { variant: "link", onClick: clearChipGroups, isInline: true }, clearFiltersButtonText)
        ),
        customChipGroupContent && customChipGroupContent
      );
    }
  };
  ToolbarChipGroupContent.displayName = "ToolbarChipGroupContent";
  ToolbarChipGroupContent.defaultProps = {
    clearFiltersButtonText: "Clear all filters",
    collapseListedFiltersBreakpoint: "lg",
    numberOfFiltersText: (numberOfFilters) => `${numberOfFilters} filters applied`
  };

  // node_modules/@patternfly/react-core/dist/esm/components/Toolbar/Toolbar.js
  var Toolbar = class _Toolbar extends React186.Component {
    constructor() {
      super(...arguments);
      this.chipGroupContentRef = React186.createRef();
      this.staticFilterInfo = {};
      this.state = {
        isManagedToggleExpanded: false,
        filterInfo: {},
        windowWidth: canUseDOM ? window.innerWidth : 1200,
        ouiaStateId: getDefaultOUIAId(_Toolbar.displayName)
      };
      this.isToggleManaged = () => !(this.props.isExpanded || !!this.props.toggleIsExpanded);
      this.toggleIsExpanded = () => {
        this.setState((prevState) => ({
          isManagedToggleExpanded: !prevState.isManagedToggleExpanded
        }));
      };
      this.closeExpandableContent = (e) => {
        if (e.target.innerWidth !== this.state.windowWidth) {
          this.setState(() => ({
            isManagedToggleExpanded: false,
            windowWidth: e.target.innerWidth
          }));
        }
      };
      this.updateNumberFilters = (categoryName, numberOfFilters) => {
        const filterInfoToUpdate = Object.assign({}, this.staticFilterInfo);
        if (!filterInfoToUpdate.hasOwnProperty(categoryName) || filterInfoToUpdate[categoryName] !== numberOfFilters) {
          filterInfoToUpdate[categoryName] = numberOfFilters;
          this.staticFilterInfo = filterInfoToUpdate;
          this.setState({ filterInfo: filterInfoToUpdate });
        }
      };
      this.getNumberOfFilters = () => Object.values(this.state.filterInfo).reduce((acc, cur) => acc + cur, 0);
      this.renderToolbar = (randomId) => {
        const _a = this.props, { clearAllFilters, clearFiltersButtonText, collapseListedFiltersBreakpoint, isExpanded: isExpandedProp, toggleIsExpanded, className, children, isFullHeight, isStatic, inset, usePageInsets, isSticky, ouiaId, numberOfFiltersText, customChipGroupContent } = _a, props = __rest(_a, ["clearAllFilters", "clearFiltersButtonText", "collapseListedFiltersBreakpoint", "isExpanded", "toggleIsExpanded", "className", "children", "isFullHeight", "isStatic", "inset", "usePageInsets", "isSticky", "ouiaId", "numberOfFiltersText", "customChipGroupContent"]);
        const { isManagedToggleExpanded } = this.state;
        const isToggleManaged = this.isToggleManaged();
        const isExpanded = isToggleManaged ? isManagedToggleExpanded : isExpandedProp;
        const numberOfFilters = this.getNumberOfFilters();
        const showClearFiltersButton = numberOfFilters > 0;
        return React186.createElement(PageContext.Consumer, null, ({ width, getBreakpoint: getBreakpoint2 }) => React186.createElement(
          "div",
          Object.assign({ className: css(toolbar_default.toolbar, isFullHeight && toolbar_default.modifiers.fullHeight, isStatic && toolbar_default.modifiers.static, usePageInsets && toolbar_default.modifiers.pageInsets, isSticky && toolbar_default.modifiers.sticky, formatBreakpointMods(inset, toolbar_default, "", getBreakpoint2(width)), className), id: randomId }, getOUIAProps(_Toolbar.displayName, ouiaId !== void 0 ? ouiaId : this.state.ouiaStateId), props),
          React186.createElement(
            ToolbarContext.Provider,
            { value: {
              isExpanded,
              toggleIsExpanded: isToggleManaged ? this.toggleIsExpanded : toggleIsExpanded,
              chipGroupContentRef: this.chipGroupContentRef,
              updateNumberFilters: this.updateNumberFilters,
              numberOfFilters,
              clearAllFilters,
              clearFiltersButtonText,
              showClearFiltersButton,
              toolbarId: randomId,
              customChipGroupContent
            } },
            children,
            React186.createElement(ToolbarChipGroupContent, { isExpanded, chipGroupContentRef: this.chipGroupContentRef, clearAllFilters, showClearFiltersButton, clearFiltersButtonText, numberOfFilters, numberOfFiltersText, collapseListedFiltersBreakpoint, customChipGroupContent })
          )
        ));
      };
    }
    componentDidMount() {
      if (this.isToggleManaged() && canUseDOM) {
        window.addEventListener("resize", this.closeExpandableContent);
      }
    }
    componentWillUnmount() {
      if (this.isToggleManaged() && canUseDOM) {
        window.removeEventListener("resize", this.closeExpandableContent);
      }
    }
    render() {
      return this.props.id ? this.renderToolbar(this.props.id) : React186.createElement(GenerateId, null, (randomId) => this.renderToolbar(randomId));
    }
  };
  Toolbar.displayName = "Toolbar";

  // node_modules/@patternfly/react-core/dist/esm/components/Toolbar/ToolbarContent.js
  init_tslib_es6();
  var React187 = __toESM(require_react());
  var ToolbarContent = class _ToolbarContent extends React187.Component {
    constructor() {
      super(...arguments);
      this.expandableContentRef = React187.createRef();
      this.chipContainerRef = React187.createRef();
    }
    render() {
      const _a = this.props, { className, children, isExpanded, toolbarId, visibility, alignItems, clearAllFilters, showClearFiltersButton, clearFiltersButtonText, alignSelf } = _a, props = __rest(_a, ["className", "children", "isExpanded", "toolbarId", "visibility", "alignItems", "clearAllFilters", "showClearFiltersButton", "clearFiltersButtonText", "alignSelf"]);
      return React187.createElement(PageContext.Consumer, null, ({ width, getBreakpoint: getBreakpoint2 }) => React187.createElement(
        "div",
        Object.assign({ className: css(toolbar_default.toolbarContent, formatBreakpointMods(visibility, toolbar_default, "", getBreakpoint2(width)), className), ref: this.expandableContentRef }, props),
        React187.createElement(ToolbarContext.Consumer, null, ({ clearAllFilters: clearAllFiltersContext, clearFiltersButtonText: clearFiltersButtonContext, showClearFiltersButton: showClearFiltersButtonContext, isExpanded: isExpandedContext, toolbarId: toolbarIdContext }) => {
          const expandableContentId = `${toolbarId || toolbarIdContext}-expandable-content-${_ToolbarContent.currentId++}`;
          return React187.createElement(
            ToolbarContentContext.Provider,
            { value: {
              expandableContentRef: this.expandableContentRef,
              expandableContentId,
              chipContainerRef: this.chipContainerRef,
              isExpanded: isExpanded || isExpandedContext,
              clearAllFilters: clearAllFilters || clearAllFiltersContext,
              clearFiltersButtonText: clearFiltersButtonText || clearFiltersButtonContext,
              showClearFiltersButton: showClearFiltersButton || showClearFiltersButtonContext
            } },
            React187.createElement("div", { className: css(toolbar_default.toolbarContentSection, alignItems === "center" && toolbar_default.modifiers.alignItemsCenter, alignItems === "start" && toolbar_default.modifiers.alignItemsStart, alignItems === "baseline" && toolbar_default.modifiers.alignItemsBaseline, alignSelf === "center" && toolbar_default.modifiers.alignSelfCenter, alignSelf === "start" && toolbar_default.modifiers.alignSelfStart, alignSelf === "baseline" && toolbar_default.modifiers.alignSelfBaseline) }, children)
          );
        })
      ));
    }
  };
  ToolbarContent.displayName = "ToolbarContent";
  ToolbarContent.currentId = 0;
  ToolbarContent.defaultProps = {
    isExpanded: false,
    showClearFiltersButton: false
  };

  // node_modules/@patternfly/react-core/dist/esm/components/NumberInput/NumberInput.js
  init_tslib_es6();
  var React188 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/NumberInput/number-input.mjs
  var number_input_default = {
    "formControl": "pf-v5-c-form-control",
    "inputGroup": "pf-v5-c-input-group",
    "modifiers": {
      "status": "pf-m-status"
    },
    "numberInput": "pf-v5-c-number-input",
    "numberInputIcon": "pf-v5-c-number-input__icon",
    "numberInputUnit": "pf-v5-c-number-input__unit"
  };

  // node_modules/@patternfly/react-tokens/dist/esm/c_number_input_c_form_control_width_chars.js
  var c_number_input_c_form_control_width_chars = {
    "name": "--pf-v5-c-number-input--c-form-control--width-chars",
    "value": "4",
    "var": "var(--pf-v5-c-number-input--c-form-control--width-chars)"
  };
  var c_number_input_c_form_control_width_chars_default = c_number_input_c_form_control_width_chars;

  // node_modules/@patternfly/react-core/dist/esm/components/NumberInput/NumberInput.js
  var defaultKeyDownHandler = (args) => (event) => {
    if (KeyTypes.ArrowUp === event.key && args.onPlus) {
      event.preventDefault();
      args.onPlus(null, args.inputName);
    }
    if (KeyTypes.ArrowDown === event.key && args.onMinus) {
      event.preventDefault();
      args.onMinus(null, args.inputName);
    }
  };
  var DEFAULT_VALUE = 0;
  var NumberInput = (_a) => {
    var { value = DEFAULT_VALUE, className, widthChars, isDisabled = false, validated = ValidatedOptions.default, onMinus = () => {
    }, onChange, onBlur, onPlus = () => {
    }, unit: unit2, unitPosition = "after", min: min3, max: max3, inputName, inputAriaLabel = "Input", minusBtnAriaLabel = "Minus", plusBtnAriaLabel = "Plus", inputProps, minusBtnProps, plusBtnProps } = _a, props = __rest(_a, ["value", "className", "widthChars", "isDisabled", "validated", "onMinus", "onChange", "onBlur", "onPlus", "unit", "unitPosition", "min", "max", "inputName", "inputAriaLabel", "minusBtnAriaLabel", "plusBtnAriaLabel", "inputProps", "minusBtnProps", "plusBtnProps"]);
    const numberInputUnit = React188.createElement("div", { className: css(number_input_default.numberInputUnit) }, unit2);
    const keyDownHandler = inputProps && inputProps.onKeyDown ? inputProps.onKeyDown : defaultKeyDownHandler({ inputName, onMinus, onPlus });
    const handleBlur = (event) => {
      event.target.value = Number(event.target.value).toString();
      if (onChange) {
        onChange(event);
      }
      if (onBlur) {
        onBlur(event);
      }
    };
    return React188.createElement(
      "div",
      Object.assign({ className: css(number_input_default.numberInput, validated !== "default" && number_input_default.modifiers.status, className) }, widthChars && {
        style: Object.assign({ [c_number_input_c_form_control_width_chars_default.name]: widthChars }, props.style)
      }, props),
      unit2 && unitPosition === "before" && numberInputUnit,
      React188.createElement(
        InputGroup,
        null,
        React188.createElement(
          InputGroupItem,
          null,
          React188.createElement(
            Button,
            Object.assign({ variant: "control", "aria-label": minusBtnAriaLabel, isDisabled: isDisabled || (typeof value === "number" ? value : DEFAULT_VALUE) <= min3, onClick: (evt) => onMinus(evt, inputName) }, minusBtnProps),
            React188.createElement(
              "span",
              { className: css(number_input_default.numberInputIcon) },
              React188.createElement(minus_icon_default, { "aria-hidden": "true" })
            )
          )
        ),
        React188.createElement(
          InputGroupItem,
          null,
          React188.createElement(TextInput, Object.assign({}, inputProps, { type: "number", value, name: inputName, "aria-label": inputAriaLabel }, isDisabled && { isDisabled }, onChange && { onChange: (event, _value) => onChange(event) }, { onBlur: handleBlur }, !onChange && { readOnlyVariant: "default" }, { onKeyDown: keyDownHandler, validated }))
        ),
        React188.createElement(
          InputGroupItem,
          null,
          React188.createElement(
            Button,
            Object.assign({ variant: "control", "aria-label": plusBtnAriaLabel, isDisabled: isDisabled || (typeof value === "number" ? value : DEFAULT_VALUE) >= max3, onClick: (evt) => onPlus(evt, inputName) }, plusBtnProps),
            React188.createElement(
              "span",
              { className: css(number_input_default.numberInputIcon) },
              React188.createElement(plus_icon_default, { "aria-hidden": "true" })
            )
          )
        )
      ),
      unit2 && unitPosition === "after" && numberInputUnit
    );
  };
  NumberInput.displayName = "NumberInput";

  // node_modules/@patternfly/react-core/dist/esm/components/TreeView/TreeView.js
  init_tslib_es6();
  var React192 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/components/TreeView/TreeViewList.js
  init_tslib_es6();
  var React189 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/TreeView/tree-view.mjs
  var tree_view_default = {
    "badge": "pf-v5-c-badge",
    "dirRtl": "pf-v5-m-dir-rtl",
    "modifiers": {
      "compact": "pf-m-compact",
      "guides": "pf-m-guides",
      "expanded": "pf-m-expanded",
      "noBackground": "pf-m-no-background",
      "current": "pf-m-current",
      "read": "pf-m-read",
      "selectable": "pf-m-selectable",
      "truncate": "pf-m-truncate"
    },
    "themeDark": "pf-v5-theme-dark",
    "treeView": "pf-v5-c-tree-view",
    "treeViewAction": "pf-v5-c-tree-view__action",
    "treeViewContent": "pf-v5-c-tree-view__content",
    "treeViewListItem": "pf-v5-c-tree-view__list-item",
    "treeViewNode": "pf-v5-c-tree-view__node",
    "treeViewNodeCheck": "pf-v5-c-tree-view__node-check",
    "treeViewNodeContainer": "pf-v5-c-tree-view__node-container",
    "treeViewNodeContent": "pf-v5-c-tree-view__node-content",
    "treeViewNodeCount": "pf-v5-c-tree-view__node-count",
    "treeViewNodeIcon": "pf-v5-c-tree-view__node-icon",
    "treeViewNodeText": "pf-v5-c-tree-view__node-text",
    "treeViewNodeTitle": "pf-v5-c-tree-view__node-title",
    "treeViewNodeToggle": "pf-v5-c-tree-view__node-toggle",
    "treeViewNodeToggleIcon": "pf-v5-c-tree-view__node-toggle-icon",
    "treeViewSearch": "pf-v5-c-tree-view__search"
  };

  // node_modules/@patternfly/react-core/dist/esm/components/TreeView/TreeViewList.js
  var TreeViewList = (_a) => {
    var { isNested = false, isMultiSelectable = false, toolbar, children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby } = _a, props = __rest(_a, ["isNested", "isMultiSelectable", "toolbar", "children", "aria-label", "aria-labelledby"]);
    return React189.createElement(
      React189.Fragment,
      null,
      toolbar && React189.createElement(
        React189.Fragment,
        null,
        toolbar,
        React189.createElement(Divider, null)
      ),
      React189.createElement("ul", Object.assign({ className: css(`${tree_view_default.treeView}__list`), role: isNested ? "group" : "tree", "aria-multiselectable": isNested ? void 0 : isMultiSelectable, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby }, props), children)
    );
  };
  TreeViewList.displayName = "TreeViewList";

  // node_modules/@patternfly/react-core/dist/esm/components/TreeView/TreeViewListItem.js
  var import_react16 = __toESM(require_react());
  var TreeViewListItemBase = ({
    name: name2,
    title,
    id,
    isExpanded,
    defaultExpanded = false,
    children = null,
    onSelect,
    onExpand,
    onCollapse,
    onCheck,
    hasCheckbox = false,
    checkProps = {
      checked: false
    },
    hasBadge = false,
    customBadgeContent,
    badgeProps = { isRead: true },
    isSelectable = false,
    isCompact,
    activeItems = [],
    itemData,
    parentItem,
    icon,
    expandedIcon,
    action,
    compareItems,
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    useMemo: useMemo7
  }) => {
    const [internalIsExpanded, setIsExpanded] = (0, import_react16.useState)(defaultExpanded);
    (0, import_react16.useEffect)(() => {
      if (isExpanded !== void 0 && isExpanded !== null) {
        setIsExpanded(isExpanded);
      } else if (defaultExpanded !== void 0 && defaultExpanded !== null) {
        setIsExpanded(internalIsExpanded || defaultExpanded);
      }
    }, [isExpanded, defaultExpanded]);
    let Component40 = "button";
    if (hasCheckbox) {
      Component40 = "label";
    } else if (isSelectable) {
      Component40 = "div";
    }
    const ToggleComponent = hasCheckbox || isSelectable ? "button" : "span";
    const renderToggle = (randomId) => import_react16.default.createElement(
      ToggleComponent,
      Object.assign({ className: css(tree_view_default.treeViewNodeToggle), onClick: (evt) => {
        if (isSelectable || hasCheckbox) {
          if (internalIsExpanded) {
            onCollapse && onCollapse(evt, itemData, parentItem);
          } else {
            onExpand && onExpand(evt, itemData, parentItem);
          }
          setIsExpanded(!internalIsExpanded);
        }
        if (isSelectable) {
          evt.stopPropagation();
        }
      } }, (hasCheckbox || isSelectable) && { "aria-labelledby": `label-${randomId}` }, ToggleComponent === "button" && { type: "button" }, { tabIndex: -1 }),
      import_react16.default.createElement(
        "span",
        { className: css(tree_view_default.treeViewNodeToggleIcon) },
        import_react16.default.createElement(angle_right_icon_default, { "aria-hidden": "true" })
      )
    );
    const isCheckboxChecked = checkProps.checked === null ? false : checkProps.checked;
    const renderCheck = (randomId) => import_react16.default.createElement(
      "span",
      { className: css(tree_view_default.treeViewNodeCheck) },
      import_react16.default.createElement("input", Object.assign({ type: "checkbox", onChange: (evt) => onCheck && onCheck(evt, itemData, parentItem), onClick: (evt) => evt.stopPropagation(), ref: (elem) => elem && (elem.indeterminate = checkProps.checked === null) }, checkProps, { checked: isCheckboxChecked, id: randomId, tabIndex: -1 }))
    );
    const iconRendered = import_react16.default.createElement(
      "span",
      { className: css(tree_view_default.treeViewNodeIcon) },
      !internalIsExpanded && icon,
      internalIsExpanded && (expandedIcon || icon)
    );
    const renderNodeContent = () => {
      const content = import_react16.default.createElement(
        import_react16.default.Fragment,
        null,
        isCompact && title && import_react16.default.createElement("span", { className: css(tree_view_default.treeViewNodeTitle) }, title),
        isSelectable ? import_react16.default.createElement("button", { tabIndex: -1, className: css(tree_view_default.treeViewNodeText), type: "button" }, name2) : import_react16.default.createElement("span", { className: css(tree_view_default.treeViewNodeText) }, name2)
      );
      return isCompact ? import_react16.default.createElement("span", { className: css(tree_view_default.treeViewNodeContent) }, content) : content;
    };
    const badgeRendered = import_react16.default.createElement(
      import_react16.default.Fragment,
      null,
      hasBadge && children && import_react16.default.createElement(
        "span",
        { className: css(tree_view_default.treeViewNodeCount) },
        import_react16.default.createElement(Badge, Object.assign({}, badgeProps), customBadgeContent ? customBadgeContent : children.props.data.length)
      ),
      hasBadge && !children && customBadgeContent !== void 0 && import_react16.default.createElement(
        "span",
        { className: css(tree_view_default.treeViewNodeCount) },
        import_react16.default.createElement(Badge, Object.assign({}, badgeProps), customBadgeContent)
      )
    );
    const isSelected = (!children || isSelectable) && activeItems && activeItems.length > 0 && activeItems.some((item) => compareItems && item && compareItems(item, itemData));
    return import_react16.default.createElement(
      "li",
      Object.assign({ id, className: css(tree_view_default.treeViewListItem, internalIsExpanded && tree_view_default.modifiers.expanded), "aria-expanded": internalIsExpanded, role: "treeitem", tabIndex: -1 }, hasCheckbox && { "aria-checked": isCheckboxChecked }, !hasCheckbox && { "aria-selected": isSelected }),
      import_react16.default.createElement(
        "div",
        { className: css(tree_view_default.treeViewContent) },
        import_react16.default.createElement(GenerateId, { prefix: isSelectable ? "selectable-id" : "checkbox-id" }, (randomId) => import_react16.default.createElement(
          Component40,
          Object.assign({ className: css(tree_view_default.treeViewNode, children && (isSelectable || hasCheckbox) && tree_view_default.modifiers.selectable, isSelected && tree_view_default.modifiers.current), onClick: (evt) => {
            if (!hasCheckbox) {
              onSelect && onSelect(evt, itemData, parentItem);
              if (!isSelectable && children && evt.isDefaultPrevented() !== true) {
                if (internalIsExpanded) {
                  onCollapse && onCollapse(evt, itemData, parentItem);
                } else {
                  onExpand && onExpand(evt, itemData, parentItem);
                }
                setIsExpanded(!internalIsExpanded);
              }
            }
          } }, hasCheckbox && { htmlFor: randomId }, (hasCheckbox || isSelectable && children) && { id: `label-${randomId}` }, Component40 === "button" && { type: "button" }),
          import_react16.default.createElement(
            "span",
            { className: css(tree_view_default.treeViewNodeContainer) },
            children && renderToggle(randomId),
            hasCheckbox && renderCheck(randomId),
            icon && iconRendered,
            renderNodeContent(),
            badgeRendered
          )
        )),
        action && import_react16.default.createElement("div", { className: css(tree_view_default.treeViewAction) }, action)
      ),
      internalIsExpanded && children
    );
  };
  var TreeViewListItem = import_react16.default.memo(TreeViewListItemBase, (prevProps, nextProps) => {
    if (!nextProps.useMemo) {
      return false;
    }
    const prevIncludes = prevProps.activeItems && prevProps.activeItems.length > 0 && prevProps.activeItems.some((item) => prevProps.compareItems && item && prevProps.compareItems(item, prevProps.itemData));
    const nextIncludes = nextProps.activeItems && nextProps.activeItems.length > 0 && nextProps.activeItems.some((item) => nextProps.compareItems && item && nextProps.compareItems(item, nextProps.itemData));
    if (prevIncludes || nextIncludes) {
      return false;
    }
    if (prevProps.name !== nextProps.name || prevProps.title !== nextProps.title || prevProps.id !== nextProps.id || prevProps.isExpanded !== nextProps.isExpanded || prevProps.defaultExpanded !== nextProps.defaultExpanded || prevProps.onSelect !== nextProps.onSelect || prevProps.onCheck !== nextProps.onCheck || prevProps.onExpand !== nextProps.onExpand || prevProps.onCollapse !== nextProps.onCollapse || prevProps.hasCheckbox !== nextProps.hasCheckbox || prevProps.checkProps !== nextProps.checkProps || prevProps.hasBadge !== nextProps.hasBadge || prevProps.customBadgeContent !== nextProps.customBadgeContent || prevProps.badgeProps !== nextProps.badgeProps || prevProps.isCompact !== nextProps.isCompact || prevProps.icon !== nextProps.icon || prevProps.expandedIcon !== nextProps.expandedIcon || prevProps.action !== nextProps.action || prevProps.parentItem !== nextProps.parentItem || prevProps.itemData !== nextProps.itemData) {
      return false;
    }
    return true;
  });
  TreeViewListItem.displayName = "TreeViewListItem";

  // node_modules/@patternfly/react-core/dist/esm/components/TreeView/TreeViewRoot.js
  init_tslib_es6();
  var React191 = __toESM(require_react());
  var TreeViewRoot = class extends React191.Component {
    constructor() {
      super(...arguments);
      this.displayName = "TreeViewRoot";
      this.treeRef = React191.createRef();
      this.handleKeys = (event) => {
        var _a, _b, _c, _d, _e, _f, _g;
        if (!this.treeRef.current.contains(event.target) || !event.target.classList.contains(tree_view_default.treeViewNode)) {
          return;
        }
        const activeElement = document.activeElement;
        const key = event.key;
        const treeItems = Array.from((_a = this.treeRef.current) === null || _a === void 0 ? void 0 : _a.getElementsByClassName(tree_view_default.treeViewNode)).filter((el) => !el.classList.contains("pf-m-disabled"));
        if (key === KeyTypes.Space) {
          activeElement.click();
          event.preventDefault();
        }
        handleArrows(event, treeItems, (element) => activeElement === element, void 0, [], void 0, true, true);
        if (["ArrowLeft", "ArrowRight"].includes(key)) {
          const isExpandable = (_c = (_b = activeElement === null || activeElement === void 0 ? void 0 : activeElement.firstElementChild) === null || _b === void 0 ? void 0 : _b.firstElementChild) === null || _c === void 0 ? void 0 : _c.classList.contains(tree_view_default.treeViewNodeToggle);
          const isExpanded = (_d = activeElement === null || activeElement === void 0 ? void 0 : activeElement.closest("li")) === null || _d === void 0 ? void 0 : _d.classList.contains("pf-m-expanded");
          if (key === "ArrowLeft") {
            if (isExpandable && isExpanded) {
              activeElement.click();
            } else {
              const parentList = (_e = activeElement === null || activeElement === void 0 ? void 0 : activeElement.closest("ul")) === null || _e === void 0 ? void 0 : _e.parentElement;
              if ((parentList === null || parentList === void 0 ? void 0 : parentList.tagName) !== "DIV") {
                const parentButton = parentList === null || parentList === void 0 ? void 0 : parentList.querySelector("button");
                activeElement.tabIndex = -1;
                if (parentButton) {
                  parentButton.tabIndex = 0;
                  parentButton.focus();
                }
              }
            }
          } else {
            if (isExpandable && !isExpanded) {
              activeElement.tabIndex = -1;
              activeElement.click();
              const childElement = (_g = (_f = activeElement === null || activeElement === void 0 ? void 0 : activeElement.closest("li")) === null || _f === void 0 ? void 0 : _f.querySelector("ul > li")) === null || _g === void 0 ? void 0 : _g.querySelector("button");
              if (childElement) {
                childElement.tabIndex = 0;
                childElement.focus();
              }
            }
          }
          event.preventDefault();
        }
      };
      this.handleKeysCheckbox = (event) => {
        var _a, _b, _c, _d, _e;
        if (!this.treeRef.current.contains(event.target)) {
          return;
        }
        const activeElement = document.activeElement;
        const key = event.key;
        if (key === KeyTypes.Space) {
          activeElement.click();
          event.preventDefault();
        }
        const treeNodes = Array.from((_a = this.treeRef.current) === null || _a === void 0 ? void 0 : _a.getElementsByClassName(tree_view_default.treeViewNode));
        handleArrows(event, treeNodes, (element) => element.contains(activeElement), (element) => element.querySelector("button,input"), [], void 0, true, true);
        if (["ArrowLeft", "ArrowRight"].includes(key)) {
          if (key === "ArrowLeft") {
            if ((activeElement === null || activeElement === void 0 ? void 0 : activeElement.tagName) === "INPUT") {
              ((_b = activeElement === null || activeElement === void 0 ? void 0 : activeElement.parentElement) === null || _b === void 0 ? void 0 : _b.previousSibling) && activeElement.parentElement.previousSibling.focus();
            } else if (activeElement === null || activeElement === void 0 ? void 0 : activeElement.previousSibling) {
              if (((_c = activeElement.previousElementSibling) === null || _c === void 0 ? void 0 : _c.tagName) === "SPAN") {
                activeElement.previousSibling.firstChild.focus();
              } else {
                activeElement.previousSibling.focus();
              }
            }
          } else {
            if ((activeElement === null || activeElement === void 0 ? void 0 : activeElement.tagName) === "INPUT") {
              ((_d = activeElement.parentElement) === null || _d === void 0 ? void 0 : _d.nextSibling) && activeElement.parentElement.nextSibling.focus();
            } else if (activeElement === null || activeElement === void 0 ? void 0 : activeElement.nextSibling) {
              if (((_e = activeElement.nextElementSibling) === null || _e === void 0 ? void 0 : _e.tagName) === "SPAN") {
                activeElement.nextSibling.firstChild.focus();
              } else {
                activeElement.nextSibling.focus();
              }
            }
          }
          event.preventDefault();
        }
      };
      this.variantStyleModifiers = {
        default: "",
        compact: tree_view_default.modifiers.compact,
        compactNoBackground: [tree_view_default.modifiers.compact, tree_view_default.modifiers.noBackground]
      };
    }
    componentDidMount() {
      var _a;
      if (canUseDOM) {
        window.addEventListener("keydown", this.props.hasCheckboxes || this.props.hasSelectableNodes ? this.handleKeysCheckbox : this.handleKeys);
      }
      if (this.props.hasCheckboxes || this.props.hasSelectableNodes) {
        const firstToggle = this.treeRef.current.getElementsByClassName(tree_view_default.treeViewNodeToggle)[0];
        if (firstToggle) {
          firstToggle.tabIndex = 0;
        }
        if (this.props.hasCheckboxes) {
          const firstInput = this.treeRef.current.getElementsByTagName("INPUT")[0];
          if (firstInput) {
            firstInput.tabIndex = 0;
          }
        }
        if (this.props.hasSelectableNodes) {
          const firstTextButton = this.treeRef.current.getElementsByClassName(tree_view_default.treeViewNodeText)[0];
          if (firstTextButton) {
            firstTextButton.tabIndex = 0;
          }
        }
      } else {
        ((_a = this.treeRef.current) === null || _a === void 0 ? void 0 : _a.getElementsByClassName(tree_view_default.treeViewNode)[0]).tabIndex = 0;
      }
    }
    componentWillUnmount() {
      if (canUseDOM) {
        window.removeEventListener("keydown", this.props.hasCheckboxes || this.props.hasSelectableNodes ? this.handleKeysCheckbox : this.handleKeys);
      }
    }
    render() {
      const _a = this.props, { children, hasCheckboxes, hasGuides, variant, className, hasSelectableNodes } = _a, props = __rest(_a, ["children", "hasCheckboxes", "hasGuides", "variant", "className", "hasSelectableNodes"]);
      return React191.createElement("div", Object.assign({ className: css(tree_view_default.treeView, hasGuides && tree_view_default.modifiers.guides, this.variantStyleModifiers[variant], className), ref: this.treeRef }, props), children);
    }
  };

  // node_modules/@patternfly/react-core/dist/esm/components/TreeView/TreeView.js
  var TreeView = (_a) => {
    var { data, isNested = false, hasCheckboxes = false, hasBadges = false, hasGuides = false, hasSelectableNodes = false, variant = "default", defaultAllExpanded = false, allExpanded, icon, isMultiSelectable = false, expandedIcon, parentItem, onSelect, onCheck, onExpand, onCollapse, toolbar, activeItems, compareItems = (item, itemToCheck) => item.id === itemToCheck.id, className, useMemo: useMemo7, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby } = _a, props = __rest(_a, ["data", "isNested", "hasCheckboxes", "hasBadges", "hasGuides", "hasSelectableNodes", "variant", "defaultAllExpanded", "allExpanded", "icon", "isMultiSelectable", "expandedIcon", "parentItem", "onSelect", "onCheck", "onExpand", "onCollapse", "toolbar", "activeItems", "compareItems", "className", "useMemo", "aria-label", "aria-labelledby"]);
    const treeViewList = React192.createElement(TreeViewList, { isNested, toolbar, isMultiSelectable, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby }, data.map((item) => {
      var _a2, _b;
      return React192.createElement(TreeViewListItem, Object.assign({ key: ((_a2 = item.id) === null || _a2 === void 0 ? void 0 : _a2.toString()) || ((_b = item.name) === null || _b === void 0 ? void 0 : _b.toString()), name: item.name, title: item.title, id: item.id, isExpanded: allExpanded, isSelectable: hasSelectableNodes, defaultExpanded: item.defaultExpanded !== void 0 ? item.defaultExpanded : defaultAllExpanded, onSelect, onCheck, onExpand, onCollapse, hasCheckbox: item.hasCheckbox !== void 0 ? item.hasCheckbox : hasCheckboxes, checkProps: item.checkProps, hasBadge: item.hasBadge !== void 0 ? item.hasBadge : hasBadges, customBadgeContent: item.customBadgeContent, badgeProps: item.badgeProps, activeItems, parentItem, itemData: item, icon: item.icon !== void 0 ? item.icon : icon, expandedIcon: item.expandedIcon !== void 0 ? item.expandedIcon : expandedIcon, action: item.action, compareItems, isCompact: variant === "compact" || variant === "compactNoBackground", useMemo: useMemo7 }, item.children && {
        children: React192.createElement(TreeView, { data: item.children, isNested: true, parentItem: item, hasCheckboxes, hasBadges, hasGuides, hasSelectableNodes, variant, allExpanded, defaultAllExpanded, onSelect, onCheck, onExpand, onCollapse, activeItems, icon, expandedIcon })
      }));
    }));
    return React192.createElement(React192.Fragment, null, parentItem ? treeViewList : React192.createElement(TreeViewRoot, Object.assign({ hasSelectableNodes, hasCheckboxes, hasGuides, variant, className }, props), treeViewList));
  };
  TreeView.displayName = "TreeView";

  // node_modules/@patternfly/react-styles/css/components/Wizard/wizard.mjs
  var wizard_default = {
    "button": "pf-v5-c-button",
    "dirRtl": "pf-v5-m-dir-rtl",
    "drawer": "pf-v5-c-drawer",
    "modalBox": "pf-v5-c-modal-box",
    "modifiers": {
      "finished": "pf-m-finished",
      "expanded": "pf-m-expanded",
      "current": "pf-m-current",
      "expandable": "pf-m-expandable",
      "disabled": "pf-m-disabled",
      "noPadding": "pf-m-no-padding"
    },
    "pageMainWizard": "pf-v5-c-page__main-wizard",
    "themeDark": "pf-v5-theme-dark",
    "wizard": "pf-v5-c-wizard",
    "wizardClose": "pf-v5-c-wizard__close",
    "wizardDescription": "pf-v5-c-wizard__description",
    "wizardFooter": "pf-v5-c-wizard__footer",
    "wizardFooterCancel": "pf-v5-c-wizard__footer-cancel",
    "wizardHeader": "pf-v5-c-wizard__header",
    "wizardInnerWrap": "pf-v5-c-wizard__inner-wrap",
    "wizardMain": "pf-v5-c-wizard__main",
    "wizardMainBody": "pf-v5-c-wizard__main-body",
    "wizardNav": "pf-v5-c-wizard__nav",
    "wizardNavItem": "pf-v5-c-wizard__nav-item",
    "wizardNavLink": "pf-v5-c-wizard__nav-link",
    "wizardNavLinkText": "pf-v5-c-wizard__nav-link-text",
    "wizardNavLinkToggle": "pf-v5-c-wizard__nav-link-toggle",
    "wizardNavLinkToggleIcon": "pf-v5-c-wizard__nav-link-toggle-icon",
    "wizardNavList": "pf-v5-c-wizard__nav-list",
    "wizardOuterWrap": "pf-v5-c-wizard__outer-wrap",
    "wizardTitle": "pf-v5-c-wizard__title",
    "wizardTitleText": "pf-v5-c-wizard__title-text",
    "wizardToggle": "pf-v5-c-wizard__toggle",
    "wizardToggleIcon": "pf-v5-c-wizard__toggle-icon",
    "wizardToggleList": "pf-v5-c-wizard__toggle-list",
    "wizardToggleListItem": "pf-v5-c-wizard__toggle-list-item",
    "wizardToggleNum": "pf-v5-c-wizard__toggle-num",
    "wizardToggleSeparator": "pf-v5-c-wizard__toggle-separator"
  };

  // node_modules/@patternfly/react-core/dist/esm/layouts/Bullseye/Bullseye.js
  init_tslib_es6();
  var React193 = __toESM(require_react());
  var Bullseye = (_a) => {
    var { children = null, className = "", component = "div" } = _a, props = __rest(_a, ["children", "className", "component"]);
    const Component40 = component;
    return React193.createElement(Component40, Object.assign({ className: css(bullseye_default.bullseye, className) }, props), children);
  };
  Bullseye.displayName = "Bullseye";

  // node_modules/@patternfly/react-core/dist/esm/layouts/Grid/Grid.js
  init_tslib_es6();
  var React194 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/layouts/Grid/grid.mjs
  var grid_default = {
    "grid": "pf-v5-l-grid",
    "gridItem": "pf-v5-l-grid__item",
    "modifiers": {
      "all_1Col": "pf-m-all-1-col",
      "all_2Col": "pf-m-all-2-col",
      "all_3Col": "pf-m-all-3-col",
      "all_4Col": "pf-m-all-4-col",
      "all_5Col": "pf-m-all-5-col",
      "all_6Col": "pf-m-all-6-col",
      "all_7Col": "pf-m-all-7-col",
      "all_8Col": "pf-m-all-8-col",
      "all_9Col": "pf-m-all-9-col",
      "all_10Col": "pf-m-all-10-col",
      "all_11Col": "pf-m-all-11-col",
      "all_12Col": "pf-m-all-12-col",
      "all_1ColOnSm": "pf-m-all-1-col-on-sm",
      "all_2ColOnSm": "pf-m-all-2-col-on-sm",
      "all_3ColOnSm": "pf-m-all-3-col-on-sm",
      "all_4ColOnSm": "pf-m-all-4-col-on-sm",
      "all_5ColOnSm": "pf-m-all-5-col-on-sm",
      "all_6ColOnSm": "pf-m-all-6-col-on-sm",
      "all_7ColOnSm": "pf-m-all-7-col-on-sm",
      "all_8ColOnSm": "pf-m-all-8-col-on-sm",
      "all_9ColOnSm": "pf-m-all-9-col-on-sm",
      "all_10ColOnSm": "pf-m-all-10-col-on-sm",
      "all_11ColOnSm": "pf-m-all-11-col-on-sm",
      "all_12ColOnSm": "pf-m-all-12-col-on-sm",
      "all_1ColOnMd": "pf-m-all-1-col-on-md",
      "all_2ColOnMd": "pf-m-all-2-col-on-md",
      "all_3ColOnMd": "pf-m-all-3-col-on-md",
      "all_4ColOnMd": "pf-m-all-4-col-on-md",
      "all_5ColOnMd": "pf-m-all-5-col-on-md",
      "all_6ColOnMd": "pf-m-all-6-col-on-md",
      "all_7ColOnMd": "pf-m-all-7-col-on-md",
      "all_8ColOnMd": "pf-m-all-8-col-on-md",
      "all_9ColOnMd": "pf-m-all-9-col-on-md",
      "all_10ColOnMd": "pf-m-all-10-col-on-md",
      "all_11ColOnMd": "pf-m-all-11-col-on-md",
      "all_12ColOnMd": "pf-m-all-12-col-on-md",
      "all_1ColOnLg": "pf-m-all-1-col-on-lg",
      "all_2ColOnLg": "pf-m-all-2-col-on-lg",
      "all_3ColOnLg": "pf-m-all-3-col-on-lg",
      "all_4ColOnLg": "pf-m-all-4-col-on-lg",
      "all_5ColOnLg": "pf-m-all-5-col-on-lg",
      "all_6ColOnLg": "pf-m-all-6-col-on-lg",
      "all_7ColOnLg": "pf-m-all-7-col-on-lg",
      "all_8ColOnLg": "pf-m-all-8-col-on-lg",
      "all_9ColOnLg": "pf-m-all-9-col-on-lg",
      "all_10ColOnLg": "pf-m-all-10-col-on-lg",
      "all_11ColOnLg": "pf-m-all-11-col-on-lg",
      "all_12ColOnLg": "pf-m-all-12-col-on-lg",
      "all_1ColOnXl": "pf-m-all-1-col-on-xl",
      "all_2ColOnXl": "pf-m-all-2-col-on-xl",
      "all_3ColOnXl": "pf-m-all-3-col-on-xl",
      "all_4ColOnXl": "pf-m-all-4-col-on-xl",
      "all_5ColOnXl": "pf-m-all-5-col-on-xl",
      "all_6ColOnXl": "pf-m-all-6-col-on-xl",
      "all_7ColOnXl": "pf-m-all-7-col-on-xl",
      "all_8ColOnXl": "pf-m-all-8-col-on-xl",
      "all_9ColOnXl": "pf-m-all-9-col-on-xl",
      "all_10ColOnXl": "pf-m-all-10-col-on-xl",
      "all_11ColOnXl": "pf-m-all-11-col-on-xl",
      "all_12ColOnXl": "pf-m-all-12-col-on-xl",
      "all_1ColOn_2xl": "pf-m-all-1-col-on-2xl",
      "all_2ColOn_2xl": "pf-m-all-2-col-on-2xl",
      "all_3ColOn_2xl": "pf-m-all-3-col-on-2xl",
      "all_4ColOn_2xl": "pf-m-all-4-col-on-2xl",
      "all_5ColOn_2xl": "pf-m-all-5-col-on-2xl",
      "all_6ColOn_2xl": "pf-m-all-6-col-on-2xl",
      "all_7ColOn_2xl": "pf-m-all-7-col-on-2xl",
      "all_8ColOn_2xl": "pf-m-all-8-col-on-2xl",
      "all_9ColOn_2xl": "pf-m-all-9-col-on-2xl",
      "all_10ColOn_2xl": "pf-m-all-10-col-on-2xl",
      "all_11ColOn_2xl": "pf-m-all-11-col-on-2xl",
      "all_12ColOn_2xl": "pf-m-all-12-col-on-2xl",
      "1Col": "pf-m-1-col",
      "2Col": "pf-m-2-col",
      "3Col": "pf-m-3-col",
      "4Col": "pf-m-4-col",
      "5Col": "pf-m-5-col",
      "6Col": "pf-m-6-col",
      "7Col": "pf-m-7-col",
      "8Col": "pf-m-8-col",
      "9Col": "pf-m-9-col",
      "10Col": "pf-m-10-col",
      "11Col": "pf-m-11-col",
      "12Col": "pf-m-12-col",
      "offset_1Col": "pf-m-offset-1-col",
      "offset_2Col": "pf-m-offset-2-col",
      "offset_3Col": "pf-m-offset-3-col",
      "offset_4Col": "pf-m-offset-4-col",
      "offset_5Col": "pf-m-offset-5-col",
      "offset_6Col": "pf-m-offset-6-col",
      "offset_7Col": "pf-m-offset-7-col",
      "offset_8Col": "pf-m-offset-8-col",
      "offset_9Col": "pf-m-offset-9-col",
      "offset_10Col": "pf-m-offset-10-col",
      "offset_11Col": "pf-m-offset-11-col",
      "offset_12Col": "pf-m-offset-12-col",
      "1Row": "pf-m-1-row",
      "2Row": "pf-m-2-row",
      "3Row": "pf-m-3-row",
      "4Row": "pf-m-4-row",
      "5Row": "pf-m-5-row",
      "6Row": "pf-m-6-row",
      "7Row": "pf-m-7-row",
      "8Row": "pf-m-8-row",
      "9Row": "pf-m-9-row",
      "10Row": "pf-m-10-row",
      "11Row": "pf-m-11-row",
      "12Row": "pf-m-12-row",
      "1ColOnSm": "pf-m-1-col-on-sm",
      "2ColOnSm": "pf-m-2-col-on-sm",
      "3ColOnSm": "pf-m-3-col-on-sm",
      "4ColOnSm": "pf-m-4-col-on-sm",
      "5ColOnSm": "pf-m-5-col-on-sm",
      "6ColOnSm": "pf-m-6-col-on-sm",
      "7ColOnSm": "pf-m-7-col-on-sm",
      "8ColOnSm": "pf-m-8-col-on-sm",
      "9ColOnSm": "pf-m-9-col-on-sm",
      "10ColOnSm": "pf-m-10-col-on-sm",
      "11ColOnSm": "pf-m-11-col-on-sm",
      "12ColOnSm": "pf-m-12-col-on-sm",
      "offset_1ColOnSm": "pf-m-offset-1-col-on-sm",
      "offset_2ColOnSm": "pf-m-offset-2-col-on-sm",
      "offset_3ColOnSm": "pf-m-offset-3-col-on-sm",
      "offset_4ColOnSm": "pf-m-offset-4-col-on-sm",
      "offset_5ColOnSm": "pf-m-offset-5-col-on-sm",
      "offset_6ColOnSm": "pf-m-offset-6-col-on-sm",
      "offset_7ColOnSm": "pf-m-offset-7-col-on-sm",
      "offset_8ColOnSm": "pf-m-offset-8-col-on-sm",
      "offset_9ColOnSm": "pf-m-offset-9-col-on-sm",
      "offset_10ColOnSm": "pf-m-offset-10-col-on-sm",
      "offset_11ColOnSm": "pf-m-offset-11-col-on-sm",
      "offset_12ColOnSm": "pf-m-offset-12-col-on-sm",
      "1RowOnSm": "pf-m-1-row-on-sm",
      "2RowOnSm": "pf-m-2-row-on-sm",
      "3RowOnSm": "pf-m-3-row-on-sm",
      "4RowOnSm": "pf-m-4-row-on-sm",
      "5RowOnSm": "pf-m-5-row-on-sm",
      "6RowOnSm": "pf-m-6-row-on-sm",
      "7RowOnSm": "pf-m-7-row-on-sm",
      "8RowOnSm": "pf-m-8-row-on-sm",
      "9RowOnSm": "pf-m-9-row-on-sm",
      "10RowOnSm": "pf-m-10-row-on-sm",
      "11RowOnSm": "pf-m-11-row-on-sm",
      "12RowOnSm": "pf-m-12-row-on-sm",
      "1ColOnMd": "pf-m-1-col-on-md",
      "2ColOnMd": "pf-m-2-col-on-md",
      "3ColOnMd": "pf-m-3-col-on-md",
      "4ColOnMd": "pf-m-4-col-on-md",
      "5ColOnMd": "pf-m-5-col-on-md",
      "6ColOnMd": "pf-m-6-col-on-md",
      "7ColOnMd": "pf-m-7-col-on-md",
      "8ColOnMd": "pf-m-8-col-on-md",
      "9ColOnMd": "pf-m-9-col-on-md",
      "10ColOnMd": "pf-m-10-col-on-md",
      "11ColOnMd": "pf-m-11-col-on-md",
      "12ColOnMd": "pf-m-12-col-on-md",
      "offset_1ColOnMd": "pf-m-offset-1-col-on-md",
      "offset_2ColOnMd": "pf-m-offset-2-col-on-md",
      "offset_3ColOnMd": "pf-m-offset-3-col-on-md",
      "offset_4ColOnMd": "pf-m-offset-4-col-on-md",
      "offset_5ColOnMd": "pf-m-offset-5-col-on-md",
      "offset_6ColOnMd": "pf-m-offset-6-col-on-md",
      "offset_7ColOnMd": "pf-m-offset-7-col-on-md",
      "offset_8ColOnMd": "pf-m-offset-8-col-on-md",
      "offset_9ColOnMd": "pf-m-offset-9-col-on-md",
      "offset_10ColOnMd": "pf-m-offset-10-col-on-md",
      "offset_11ColOnMd": "pf-m-offset-11-col-on-md",
      "offset_12ColOnMd": "pf-m-offset-12-col-on-md",
      "1RowOnMd": "pf-m-1-row-on-md",
      "2RowOnMd": "pf-m-2-row-on-md",
      "3RowOnMd": "pf-m-3-row-on-md",
      "4RowOnMd": "pf-m-4-row-on-md",
      "5RowOnMd": "pf-m-5-row-on-md",
      "6RowOnMd": "pf-m-6-row-on-md",
      "7RowOnMd": "pf-m-7-row-on-md",
      "8RowOnMd": "pf-m-8-row-on-md",
      "9RowOnMd": "pf-m-9-row-on-md",
      "10RowOnMd": "pf-m-10-row-on-md",
      "11RowOnMd": "pf-m-11-row-on-md",
      "12RowOnMd": "pf-m-12-row-on-md",
      "1ColOnLg": "pf-m-1-col-on-lg",
      "2ColOnLg": "pf-m-2-col-on-lg",
      "3ColOnLg": "pf-m-3-col-on-lg",
      "4ColOnLg": "pf-m-4-col-on-lg",
      "5ColOnLg": "pf-m-5-col-on-lg",
      "6ColOnLg": "pf-m-6-col-on-lg",
      "7ColOnLg": "pf-m-7-col-on-lg",
      "8ColOnLg": "pf-m-8-col-on-lg",
      "9ColOnLg": "pf-m-9-col-on-lg",
      "10ColOnLg": "pf-m-10-col-on-lg",
      "11ColOnLg": "pf-m-11-col-on-lg",
      "12ColOnLg": "pf-m-12-col-on-lg",
      "offset_1ColOnLg": "pf-m-offset-1-col-on-lg",
      "offset_2ColOnLg": "pf-m-offset-2-col-on-lg",
      "offset_3ColOnLg": "pf-m-offset-3-col-on-lg",
      "offset_4ColOnLg": "pf-m-offset-4-col-on-lg",
      "offset_5ColOnLg": "pf-m-offset-5-col-on-lg",
      "offset_6ColOnLg": "pf-m-offset-6-col-on-lg",
      "offset_7ColOnLg": "pf-m-offset-7-col-on-lg",
      "offset_8ColOnLg": "pf-m-offset-8-col-on-lg",
      "offset_9ColOnLg": "pf-m-offset-9-col-on-lg",
      "offset_10ColOnLg": "pf-m-offset-10-col-on-lg",
      "offset_11ColOnLg": "pf-m-offset-11-col-on-lg",
      "offset_12ColOnLg": "pf-m-offset-12-col-on-lg",
      "1RowOnLg": "pf-m-1-row-on-lg",
      "2RowOnLg": "pf-m-2-row-on-lg",
      "3RowOnLg": "pf-m-3-row-on-lg",
      "4RowOnLg": "pf-m-4-row-on-lg",
      "5RowOnLg": "pf-m-5-row-on-lg",
      "6RowOnLg": "pf-m-6-row-on-lg",
      "7RowOnLg": "pf-m-7-row-on-lg",
      "8RowOnLg": "pf-m-8-row-on-lg",
      "9RowOnLg": "pf-m-9-row-on-lg",
      "10RowOnLg": "pf-m-10-row-on-lg",
      "11RowOnLg": "pf-m-11-row-on-lg",
      "12RowOnLg": "pf-m-12-row-on-lg",
      "1ColOnXl": "pf-m-1-col-on-xl",
      "2ColOnXl": "pf-m-2-col-on-xl",
      "3ColOnXl": "pf-m-3-col-on-xl",
      "4ColOnXl": "pf-m-4-col-on-xl",
      "5ColOnXl": "pf-m-5-col-on-xl",
      "6ColOnXl": "pf-m-6-col-on-xl",
      "7ColOnXl": "pf-m-7-col-on-xl",
      "8ColOnXl": "pf-m-8-col-on-xl",
      "9ColOnXl": "pf-m-9-col-on-xl",
      "10ColOnXl": "pf-m-10-col-on-xl",
      "11ColOnXl": "pf-m-11-col-on-xl",
      "12ColOnXl": "pf-m-12-col-on-xl",
      "offset_1ColOnXl": "pf-m-offset-1-col-on-xl",
      "offset_2ColOnXl": "pf-m-offset-2-col-on-xl",
      "offset_3ColOnXl": "pf-m-offset-3-col-on-xl",
      "offset_4ColOnXl": "pf-m-offset-4-col-on-xl",
      "offset_5ColOnXl": "pf-m-offset-5-col-on-xl",
      "offset_6ColOnXl": "pf-m-offset-6-col-on-xl",
      "offset_7ColOnXl": "pf-m-offset-7-col-on-xl",
      "offset_8ColOnXl": "pf-m-offset-8-col-on-xl",
      "offset_9ColOnXl": "pf-m-offset-9-col-on-xl",
      "offset_10ColOnXl": "pf-m-offset-10-col-on-xl",
      "offset_11ColOnXl": "pf-m-offset-11-col-on-xl",
      "offset_12ColOnXl": "pf-m-offset-12-col-on-xl",
      "1RowOnXl": "pf-m-1-row-on-xl",
      "2RowOnXl": "pf-m-2-row-on-xl",
      "3RowOnXl": "pf-m-3-row-on-xl",
      "4RowOnXl": "pf-m-4-row-on-xl",
      "5RowOnXl": "pf-m-5-row-on-xl",
      "6RowOnXl": "pf-m-6-row-on-xl",
      "7RowOnXl": "pf-m-7-row-on-xl",
      "8RowOnXl": "pf-m-8-row-on-xl",
      "9RowOnXl": "pf-m-9-row-on-xl",
      "10RowOnXl": "pf-m-10-row-on-xl",
      "11RowOnXl": "pf-m-11-row-on-xl",
      "12RowOnXl": "pf-m-12-row-on-xl",
      "1ColOn_2xl": "pf-m-1-col-on-2xl",
      "2ColOn_2xl": "pf-m-2-col-on-2xl",
      "3ColOn_2xl": "pf-m-3-col-on-2xl",
      "4ColOn_2xl": "pf-m-4-col-on-2xl",
      "5ColOn_2xl": "pf-m-5-col-on-2xl",
      "6ColOn_2xl": "pf-m-6-col-on-2xl",
      "7ColOn_2xl": "pf-m-7-col-on-2xl",
      "8ColOn_2xl": "pf-m-8-col-on-2xl",
      "9ColOn_2xl": "pf-m-9-col-on-2xl",
      "10ColOn_2xl": "pf-m-10-col-on-2xl",
      "11ColOn_2xl": "pf-m-11-col-on-2xl",
      "12ColOn_2xl": "pf-m-12-col-on-2xl",
      "offset_1ColOn_2xl": "pf-m-offset-1-col-on-2xl",
      "offset_2ColOn_2xl": "pf-m-offset-2-col-on-2xl",
      "offset_3ColOn_2xl": "pf-m-offset-3-col-on-2xl",
      "offset_4ColOn_2xl": "pf-m-offset-4-col-on-2xl",
      "offset_5ColOn_2xl": "pf-m-offset-5-col-on-2xl",
      "offset_6ColOn_2xl": "pf-m-offset-6-col-on-2xl",
      "offset_7ColOn_2xl": "pf-m-offset-7-col-on-2xl",
      "offset_8ColOn_2xl": "pf-m-offset-8-col-on-2xl",
      "offset_9ColOn_2xl": "pf-m-offset-9-col-on-2xl",
      "offset_10ColOn_2xl": "pf-m-offset-10-col-on-2xl",
      "offset_11ColOn_2xl": "pf-m-offset-11-col-on-2xl",
      "offset_12ColOn_2xl": "pf-m-offset-12-col-on-2xl",
      "1RowOn_2xl": "pf-m-1-row-on-2xl",
      "2RowOn_2xl": "pf-m-2-row-on-2xl",
      "3RowOn_2xl": "pf-m-3-row-on-2xl",
      "4RowOn_2xl": "pf-m-4-row-on-2xl",
      "5RowOn_2xl": "pf-m-5-row-on-2xl",
      "6RowOn_2xl": "pf-m-6-row-on-2xl",
      "7RowOn_2xl": "pf-m-7-row-on-2xl",
      "8RowOn_2xl": "pf-m-8-row-on-2xl",
      "9RowOn_2xl": "pf-m-9-row-on-2xl",
      "10RowOn_2xl": "pf-m-10-row-on-2xl",
      "11RowOn_2xl": "pf-m-11-row-on-2xl",
      "12RowOn_2xl": "pf-m-12-row-on-2xl",
      "gutter": "pf-m-gutter"
    }
  };

  // node_modules/@patternfly/react-core/dist/esm/styles/sizes.js
  var BaseSizes;
  (function(BaseSizes2) {
    BaseSizes2["xs"] = "xs";
    BaseSizes2["sm"] = "sm";
    BaseSizes2["md"] = "md";
    BaseSizes2["lg"] = "lg";
    BaseSizes2["xl"] = "xl";
    BaseSizes2["2xl"] = "2xl";
    BaseSizes2["3xl"] = "3xl";
    BaseSizes2["4xl"] = "4xl";
  })(BaseSizes || (BaseSizes = {}));
  var DeviceSizes;
  (function(DeviceSizes2) {
    DeviceSizes2["sm"] = "Sm";
    DeviceSizes2["md"] = "Md";
    DeviceSizes2["lg"] = "Lg";
    DeviceSizes2["xl"] = "Xl";
    DeviceSizes2["xl2"] = "_2xl";
  })(DeviceSizes || (DeviceSizes = {}));

  // node_modules/@patternfly/react-tokens/dist/esm/l_grid_item_Order.js
  var l_grid_item_Order = {
    "name": "--pf-v5-l-grid--item--Order",
    "value": "0",
    "var": "var(--pf-v5-l-grid--item--Order)"
  };

  // node_modules/@patternfly/react-core/dist/esm/layouts/Grid/Grid.js
  var Grid = (_a) => {
    var { children = null, className = "", component = "div", hasGutter, span = null, order: order2, style } = _a, props = __rest(_a, ["children", "className", "component", "hasGutter", "span", "order", "style"]);
    const classes = [grid_default.grid, span && grid_default.modifiers[`all_${span}Col`]];
    const Component40 = component;
    Object.entries(DeviceSizes).forEach(([propKey, gridSpanModifier]) => {
      const key = propKey;
      const propValue = props[key];
      if (propValue) {
        classes.push(grid_default.modifiers[`all_${propValue}ColOn${gridSpanModifier}`]);
      }
      delete props[key];
    });
    return React194.createElement(Component40, Object.assign({ className: css(...classes, hasGutter && grid_default.modifiers.gutter, className), style: style || order2 ? Object.assign(Object.assign({}, style), setBreakpointCssVars(order2, l_grid_item_Order.name)) : void 0 }, props), children);
  };
  Grid.displayName = "Grid";

  // node_modules/@patternfly/react-core/dist/esm/layouts/Grid/GridItem.js
  init_tslib_es6();
  var React195 = __toESM(require_react());
  var GridItem = (_a) => {
    var { children = null, className = "", component = "div", span = null, rowSpan = null, offset: offset2 = null, order: order2, style } = _a, props = __rest(_a, ["children", "className", "component", "span", "rowSpan", "offset", "order", "style"]);
    const classes = [
      grid_default.gridItem,
      span && grid_default.modifiers[`${span}Col`],
      rowSpan && grid_default.modifiers[`${rowSpan}Row`],
      offset2 && grid_default.modifiers[`offset_${offset2}Col`]
    ];
    const Component40 = component;
    Object.entries(DeviceSizes).forEach(([propKey, classModifier]) => {
      const key = propKey;
      const rowSpanKey = `${key}RowSpan`;
      const offsetKey = `${key}Offset`;
      const spanValue = props[key];
      const rowSpanValue = props[rowSpanKey];
      const offsetValue = props[offsetKey];
      if (spanValue) {
        classes.push(grid_default.modifiers[`${spanValue}ColOn${classModifier}`]);
      }
      if (rowSpanValue) {
        classes.push(grid_default.modifiers[`${rowSpanValue}RowOn${classModifier}`]);
      }
      if (offsetValue) {
        classes.push(grid_default.modifiers[`offset_${offsetValue}ColOn${classModifier}`]);
      }
      delete props[key];
      delete props[rowSpanKey];
      delete props[offsetKey];
    });
    return React195.createElement(Component40, Object.assign({ className: css(...classes, className), style: style || order2 ? Object.assign(Object.assign({}, style), setBreakpointCssVars(order2, l_grid_item_Order.name)) : void 0 }, props), children);
  };
  GridItem.displayName = "GridItem";

  // node_modules/@patternfly/react-core/dist/esm/layouts/Split/Split.js
  init_tslib_es6();
  var React196 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/layouts/Split/split.mjs
  var split_default = {
    "modifiers": {
      "wrap": "pf-m-wrap",
      "fill": "pf-m-fill",
      "gutter": "pf-m-gutter"
    },
    "split": "pf-v5-l-split",
    "splitItem": "pf-v5-l-split__item"
  };

  // node_modules/@patternfly/react-core/dist/esm/layouts/Split/Split.js
  var Split = (_a) => {
    var { hasGutter = false, isWrappable = false, className = "", children = null, component = "div" } = _a, props = __rest(_a, ["hasGutter", "isWrappable", "className", "children", "component"]);
    const Component40 = component;
    return React196.createElement(Component40, Object.assign({}, props, { className: css(split_default.split, hasGutter && split_default.modifiers.gutter, isWrappable && split_default.modifiers.wrap, className) }), children);
  };
  Split.displayName = "Split";

  // node_modules/@patternfly/react-core/dist/esm/layouts/Split/SplitItem.js
  init_tslib_es6();
  var React197 = __toESM(require_react());
  var SplitItem = (_a) => {
    var { isFilled = false, className = "", children = null } = _a, props = __rest(_a, ["isFilled", "className", "children"]);
    return React197.createElement("div", Object.assign({}, props, { className: css(split_default.splitItem, isFilled && split_default.modifiers.fill, className) }), children);
  };
  SplitItem.displayName = "SplitItem";

  // src/lib/notifications.jsx
  var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
  var _2 = cockpit_default.gettext;
  var DoubleConfirmModal = class extends import_react17.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        actionHandler,
        checked,
        spinning,
        item,
        mTitle,
        mMsg,
        mSpinningMsg,
        mBtnName
      } = this.props;
      let saveDisabled = true;
      let btnName = mBtnName;
      const extraPrimaryProps = {};
      if (checked) {
        saveDisabled = false;
      }
      if (spinning) {
        btnName = mSpinningMsg;
        extraPrimaryProps.spinnerAriaValueText = btnName;
      }
      const actions = [];
      if (btnName) {
        actions.push(
          /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
            Button,
            {
              variant: "primary",
              onClick: actionHandler,
              isDisabled: saveDisabled || spinning,
              isLoading: spinning,
              ...extraPrimaryProps,
              children: btnName
            },
            "confirm"
          )
        );
      }
      actions.push(
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, { variant: "link", onClick: closeHandler, children: _2("Close") }, "close")
      );
      return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
        Modal,
        {
          variant: ModalVariant.small,
          title: mTitle,
          titleIconVariant: "warning",
          isOpen: showModal,
          "aria-labelledby": "ds-modal",
          onClose: closeHandler,
          actions,
          children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { className: "ds-margin-top", component: TextVariants.h3, children: mMsg }) }),
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { className: "ds-center ds-margin-top", component: TextVariants.h4, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { children: item }) }) }),
            btnName && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Grid, { className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GridItem, { sm: 12, className: "ds-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
              Checkbox,
              {
                id: "modalChecked",
                isChecked: checked,
                isDisabled: spinning,
                onChange: (e, checked2) => {
                  handleChange(e);
                },
                label: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("b", { children: _2("Yes") }),
                  _2(", I am sure.")
                ] })
              }
            ) }) })
          ] })
        }
      );
    }
  };
  var WarningModal = class extends import_react17.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        mTitle,
        mMsg
      } = this.props;
      return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
        Modal,
        {
          variant: ModalVariant.small,
          title: mTitle,
          titleIconVariant: "warning",
          isOpen: showModal,
          "aria-labelledby": "warning-modal",
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, { variant: "primary", onClick: closeHandler, children: _2("Okay") }, "ok")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Form, { isHorizontal: true, autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { className: "ds-margin-top ds-margin-bottom", component: TextVariants.h3, children: mMsg }) }) })
        }
      );
    }
  };
  WarningModal.propTypes = {
    showModal: import_prop_types2.default.bool,
    closeHandler: import_prop_types2.default.func,
    mTitle: import_prop_types2.default.string,
    mMsg: import_prop_types2.default.string
  };
  WarningModal.defaultProps = {
    showModal: false,
    mTitle: "",
    mMsg: ""
  };
  DoubleConfirmModal.propTypes = {
    showModal: import_prop_types2.default.bool,
    closeHandler: import_prop_types2.default.func,
    handleChange: import_prop_types2.default.func,
    actionHandler: import_prop_types2.default.func,
    spinning: import_prop_types2.default.bool,
    checked: import_prop_types2.default.bool,
    mTitle: import_prop_types2.default.string,
    mMsg: import_prop_types2.default.string,
    mSpinningMsg: import_prop_types2.default.string,
    mBtnName: import_prop_types2.default.string
  };
  DoubleConfirmModal.defaultProps = {
    showModal: false,
    spinning: false,
    item: "",
    checked: false,
    mTitle: "",
    mMsg: "",
    mSpinningMsg: "",
    mBtnName: ""
  };

  // node_modules/@patternfly/react-icons/dist/esm/icons/arrows-alt-v-icon.js
  var ArrowsAltVIconConfig = {
    name: "ArrowsAltVIcon",
    height: 512,
    width: 256,
    svgPath: "M214.059 377.941H168V134.059h46.059c21.382 0 32.09-25.851 16.971-40.971L144.971 7.029c-9.373-9.373-24.568-9.373-33.941 0L24.971 93.088c-15.119 15.119-4.411 40.971 16.971 40.971H88v243.882H41.941c-21.382 0-32.09 25.851-16.971 40.971l86.059 86.059c9.373 9.373 24.568 9.373 33.941 0l86.059-86.059c15.12-15.119 4.412-40.971-16.97-40.971z",
    yOffset: 0,
    xOffset: 0
  };
  var ArrowsAltVIcon = createIcon(ArrowsAltVIconConfig);
  var arrows_alt_v_icon_default = ArrowsAltVIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/ban-icon.js
  var BanIconConfig = {
    name: "BanIcon",
    height: 512,
    width: 512,
    svgPath: "M256 8C119.034 8 8 119.033 8 256s111.034 248 248 248 248-111.034 248-248S392.967 8 256 8zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676zM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676z",
    yOffset: 0,
    xOffset: 0
  };
  var BanIcon = createIcon(BanIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/book-icon.js
  var BookIconConfig = {
    name: "BookIcon",
    height: 512,
    width: 448,
    svgPath: "M448 360V24c0-13.3-10.7-24-24-24H96C43 0 0 43 0 96v320c0 53 43 96 96 96h328c13.3 0 24-10.7 24-24v-16c0-7.5-3.5-14.3-8.9-18.7-4.2-15.4-4.2-59.3 0-74.7 5.4-4.3 8.9-11.1 8.9-18.6zM128 134c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm0 64c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm253.4 250H96c-17.7 0-32-14.3-32-32 0-17.6 14.4-32 32-32h285.4c-1.9 17.1-1.9 46.9 0 64z",
    yOffset: 0,
    xOffset: 0
  };
  var BookIcon = createIcon(BookIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/catalog-icon.js
  var CatalogIconConfig = {
    name: "CatalogIcon",
    height: 1024,
    width: 1088,
    svgPath: "M576,160 C687.3,88.6 874.6,32 960,32 L960,800 C898.8,783.1 738,760.5 576,864 L576,160 Z M1024,96 C1088,96 1088,162.8 1088,162.8 L1088,928 C1088,992 985.7,989.9 985.7,989.9 C863.1,804.7 576,992 576,992 L576,925.4 C863,728.7 1024,928 1024,928 L1024,96 Z M128,800 L128,32 C212.9,32 400.6,88.3 512,160 L512,864 C352,760.5 189.3,783.2 128,800 Z M512,925.4 L512,992 C512,992 227.9,805.8 102.5,989.9 C102.5,989.9 0,992 0,928 L0,162.8 C0,162.8 0,96 64,96 L64,928 C64,927.9 226,728.7 512,925.4 Z",
    yOffset: 0,
    xOffset: 0
  };
  var CatalogIcon = createIcon(CatalogIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/clone-icon.js
  var CloneIconConfig = {
    name: "CloneIcon",
    height: 512,
    width: 512,
    svgPath: "M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z",
    yOffset: 0,
    xOffset: 0
  };
  var CloneIcon = createIcon(CloneIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/cluster-icon.js
  var ClusterIconConfig = {
    name: "ClusterIcon",
    height: 1024,
    width: 1024,
    svgPath: "M1013.1,330.877049 C1005.8,323.577049 997.2,319.977049 987.4,319.977049 L36.6,319.977049 C26.6,319.977049 18.2,323.577049 10.9,330.877049 C3.6,338.177049 0,346.777049 0,356.577049 L0,475.277049 C0,485.277049 3.6,493.677049 10.7,501.077049 C18,508.377049 26.4,511.977049 36.4,511.977049 L987.4,511.977049 C997.4,511.977049 1005.8,508.377049 1013.1,501.077049 C1020.4,493.777049 1024,485.377049 1024,475.377049 L1024,356.577049 C1024,346.577049 1020.4,338.177049 1013.1,330.877049 Z M128,447.977049 L64,447.977049 L64,383.977049 L128,383.977049 L128,447.977049 Z M256,447.977049 L192,447.977049 L192,383.977049 L256,383.977049 L256,447.977049 Z M384,447.977049 L320,447.977049 L320,383.977049 L384,383.977049 L384,447.977049 Z M512,447.977049 L448,447.977049 L448,383.977049 L512,383.977049 L512,447.977049 Z M960,447.977049 L896,447.977049 L896,383.977049 L960,383.977049 L960,447.977049 Z M0,245.177049 C0,235.977049 1.2,234.677049 9.6,226.477049 C9.6,226.477049 151.09,86.2970491 161.6,74.0070491 C172.11,61.7170491 185.5,64.2070491 185.5,64.2070491 L840.62,64.2070491 C840.62,64.2070491 852.42,62.8070491 863.11,74.4070491 C873.61,85.9970491 1013.5,226.407049 1013.5,226.407049 C1021.9,234.807049 1024,236.107049 1024,245.207049 C1024,254.807049 1012.3,256.007049 1000.7,256.007049 L22.1,256.007049 C10.8,256.077049 0,254.377049 0,245.177049 Z M1013.1,842.877049 C1005.8,835.577049 997.2,831.977049 987.4,831.977049 L36.6,831.977049 C26.6,831.977049 18.2,835.577049 10.9,842.877049 C3.6,850.177049 0,858.777049 0,868.577049 L0,987.277049 C0,997.277049 3.6,1005.67705 10.7,1013.07705 C18,1020.37705 26.4,1023.97705 36.4,1023.97705 L987.4,1023.97705 C997.4,1023.97705 1005.8,1020.37705 1013.1,1013.07705 C1020.4,1005.77705 1024,997.377049 1024,987.377049 L1024,868.577049 C1024,858.577049 1020.4,850.177049 1013.1,842.877049 Z M128,959.977049 L64,959.977049 L64,895.977049 L128,895.977049 L128,959.977049 Z M256,959.977049 L192,959.977049 L192,895.977049 L256,895.977049 L256,959.977049 Z M384,959.977049 L320,959.977049 L320,895.977049 L384,895.977049 L384,959.977049 Z M512,959.977049 L448,959.977049 L448,895.977049 L512,895.977049 L512,959.977049 Z M960,959.977049 L896,959.977049 L896,895.977049 L960,895.977049 L960,959.977049 Z M1013.1,586.877049 C1005.8,579.577049 997.2,575.977049 987.4,575.977049 L36.6,575.977049 C26.6,575.977049 18.2,579.577049 10.9,586.877049 C3.6,594.177049 0,602.777049 0,612.577049 L0,731.277049 C0,741.277049 3.6,749.677049 10.7,757.077049 C18,764.377049 26.4,767.977049 36.4,767.977049 L987.4,767.977049 C997.4,767.977049 1005.8,764.377049 1013.1,757.077049 C1020.4,749.777049 1024,741.377049 1024,731.377049 L1024,612.577049 C1024,602.577049 1020.4,594.177049 1013.1,586.877049 Z M128,703.977049 L64,703.977049 L64,639.977049 L128,639.977049 L128,703.977049 Z M256,703.977049 L192,703.977049 L192,639.977049 L256,639.977049 L256,703.977049 Z M384,703.977049 L320,703.977049 L320,639.977049 L384,639.977049 L384,703.977049 Z M512,703.977049 L448,703.977049 L448,639.977049 L512,639.977049 L512,703.977049 Z M960,703.977049 L896,703.977049 L896,639.977049 L960,639.977049 L960,703.977049 Z",
    yOffset: 0,
    xOffset: 0
  };
  var ClusterIcon = createIcon(ClusterIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/cog-icon.js
  var CogIconConfig = {
    name: "CogIcon",
    height: 512,
    width: 512,
    svgPath: "M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z",
    yOffset: 0,
    xOffset: 0
  };
  var CogIcon = createIcon(CogIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/cube-icon.js
  var CubeIconConfig = {
    name: "CubeIcon",
    height: 512,
    width: 512,
    svgPath: "M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z",
    yOffset: 0,
    xOffset: 0
  };
  var CubeIcon = createIcon(CubeIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/database-icon.js
  var DatabaseIconConfig = {
    name: "DatabaseIcon",
    height: 512,
    width: 448,
    svgPath: "M448 73.143v45.714C448 159.143 347.667 192 224 192S0 159.143 0 118.857V73.143C0 32.857 100.333 0 224 0s224 32.857 224 73.143zM448 176v102.857C448 319.143 347.667 352 224 352S0 319.143 0 278.857V176c48.125 33.143 136.208 48.572 224 48.572S399.874 209.143 448 176zm0 160v102.857C448 479.143 347.667 512 224 512S0 479.143 0 438.857V336c48.125 33.143 136.208 48.572 224 48.572S399.874 369.143 448 336z",
    yOffset: 0,
    xOffset: 0
  };
  var DatabaseIcon = createIcon(DatabaseIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/domain-icon.js
  var DomainIconConfig = {
    name: "DomainIcon",
    height: 1024,
    width: 1024,
    svgPath: "M544,511.9 C561.476067,511.948945 575.664266,525.962873 575.994253,543.371439 L576,543.9 L576,991.9 C575.951055,1009.37607 561.937127,1023.56427 544.528561,1023.89425 L544,1023.9 L352,1023.9 C334.523933,1023.85105 320.335734,1009.83713 320.005747,992.428561 L320,991.9 L320,543.9 C320.048945,526.423933 334.062873,512.235734 351.471439,511.905747 L352,511.9 L544,511.9 Z M704,576 L704,960 L640,960 L640,576 L704,576 Z M512,896 L384,896 L384,960 L512,960 L512,896 Z M960,513.1 L960,513.2 C960,665.4 884.1,799.9 768,880.9 L768,880.9 L768,799.4 C773.3,794.6 778.4,789.8 783.5,784.7 C855.624209,712.728348 896.108133,614.991161 896,513.1 L896,513.1 L960,513.1 Z M149.8,385 C100.714385,524.561202 135.973879,679.905126 240.5,784.6 C245.5,789.7 250.7,794.6 256,799.3 L256,799.3 L256,880.8 C139.9,799.8 63.9999013,665.3 63.9999013,513.1 C63.9712238,469.725105 70.236499,426.575548 82.6,385 L82.6,385 Z M512.1,704 L384,704 L384,832 L512.1,832 L512.1,704 Z M512,576 L448,576 L448,640 L512,640 L512,576 Z M864,-1.13686838e-13 C881.496381,-1.13686838e-13 895.713128,14.0417829 895.995713,31.4708215 L896,32 L896,406 C896,423.496381 881.958217,437.713128 864.529179,437.995713 L864,438 L608,438 C590.503619,438 576.286872,423.958217 576.004287,406.529179 L576,406 L576,32 C576,14.5036191 590.041783,0.286872383 607.470821,0.00428708574 L608,-1.13686838e-13 L864,-1.13686838e-13 Z M1024,64 L1024,384 L960,384 L960,64 L1024,64 Z M832,256 L640,256 L640,352 L832,352 L832,256 Z M224,-5.68434189e-14 C241.476067,0.0489452394 255.664266,14.0628726 255.994253,31.4714395 L256,32 L256,288 C255.951055,305.476067 241.937127,319.664266 224.528561,319.994253 L224,320 L32,320 C14.5239331,319.951055 0.335734448,305.937127 0.00574685353,288.528561 L0,288 L0,32 C0.0489452394,14.5239331 14.0628726,0.335734448 31.4714395,0.00574685353 L32,-5.68434189e-14 L224,-5.68434189e-14 Z M192,192 L64,192 L64,256 L192,256 L192,192 Z M512,65 L512,129 C460.642759,128.90985 409.795141,139.181409 362.5,159.2 C347.917219,165.399771 333.724426,172.47947 320,180.4 L320,180.4 L320,108.2 C380.012207,79.7623165 445.590913,65.0071076 512,65 L512,65 Z M832,64 L736,64 L736,160 L832,160 L832,64 Z M192,64 L128,64 L128,128 L192,128 L192,64 Z",
    yOffset: 0,
    xOffset: 0
  };
  var DomainIcon = createIcon(DomainIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/download-icon.js
  var DownloadIconConfig = {
    name: "DownloadIcon",
    height: 512,
    width: 512,
    svgPath: "M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z",
    yOffset: 0,
    xOffset: 0
  };
  var DownloadIcon = createIcon(DownloadIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/ellipsis-h-icon.js
  var EllipsisHIconConfig = {
    name: "EllipsisHIcon",
    height: 512,
    width: 512,
    svgPath: "M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z",
    yOffset: 0,
    xOffset: 0
  };
  var EllipsisHIcon = createIcon(EllipsisHIconConfig);
  var ellipsis_h_icon_default = EllipsisHIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon.js
  var EllipsisVIconConfig = {
    name: "EllipsisVIcon",
    height: 512,
    width: 192,
    svgPath: "M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z",
    yOffset: 0,
    xOffset: 0
  };
  var EllipsisVIcon = createIcon(EllipsisVIconConfig);
  var ellipsis_v_icon_default = EllipsisVIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/folder-close-icon.js
  var FolderCloseIconConfig = {
    name: "FolderCloseIcon",
    height: 1024,
    width: 1088,
    svgPath: "M1088,256 C1088,256 1088,192 1024,192 L502.3,192 L469.6,130.1 C469.6,130.1 439,64 373.7,64 L64,64 C0,64 0,128 0,128 L0,960 L1088,960 L1088,256 Z",
    yOffset: 0,
    xOffset: 0
  };
  var FolderCloseIcon = createIcon(FolderCloseIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/folder-icon.js
  var FolderIconConfig = {
    name: "FolderIcon",
    height: 512,
    width: 512,
    svgPath: "M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z",
    yOffset: 0,
    xOffset: 0
  };
  var FolderIcon = createIcon(FolderIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/folder-open-icon.js
  var FolderOpenIconConfig = {
    name: "FolderOpenIcon",
    height: 512,
    width: 576,
    svgPath: "M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z",
    yOffset: 0,
    xOffset: 0
  };
  var FolderOpenIcon = createIcon(FolderOpenIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/help-icon.js
  var HelpIconConfig = {
    name: "HelpIcon",
    height: 1024,
    width: 1024,
    svgPath: "M521.3,576 C627.5,576 713.7,502 713.7,413.7 C713.7,325.4 627.6,253.6 521.3,253.6 C366,253.6 334.5,337.7 329.2,407.2 C329.2,414.3 335.2,416 343.5,416 L445,416 C450.5,416 458,415.5 460.8,406.5 C460.8,362.6 582.9,357.1 582.9,413.6 C582.9,441.9 556.2,470.9 521.3,473 C486.4,475.1 447.3,479.8 447.3,521.7 L447.3,553.8 C447.3,570.8 456.1,576 472,576 C487.9,576 521.3,576 521.3,576 M575.3,751.3 L575.3,655.3 C575.313862,651.055109 573.620137,646.982962 570.6,644 C567.638831,640.947672 563.552355,639.247987 559.3,639.29884 L463.3,639.29884 C459.055109,639.286138 454.982962,640.979863 452,644 C448.947672,646.961169 447.247987,651.047645 447.29884,655.3 L447.29884,751.3 C447.286138,755.544891 448.979863,759.617038 452,762.6 C454.961169,765.652328 459.047645,767.352013 463.3,767.30116 L559.3,767.30116 C563.544891,767.313862 567.617038,765.620137 570.6,762.6 C573.659349,759.643612 575.360354,755.553963 575.3,751.3 M512,896 C300.2,896 128,723.9 128,512 C128,300.3 300.2,128 512,128 C723.8,128 896,300.2 896,512 C896,723.8 723.7,896 512,896 M512.1,0 C229.7,0 0,229.8 0,512 C0,794.2 229.8,1024 512.1,1024 C794.4,1024 1024,794.3 1024,512 C1024,229.7 794.4,0 512.1,0",
    yOffset: 0,
    xOffset: 0
  };
  var HelpIcon = createIcon(HelpIconConfig);
  var help_icon_default = HelpIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/home-icon.js
  var HomeIconConfig = {
    name: "HomeIcon",
    height: 512,
    width: 576,
    svgPath: "M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z",
    yOffset: 0,
    xOffset: 0
  };
  var HomeIcon = createIcon(HomeIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/info-icon.js
  var InfoIconConfig = {
    name: "InfoIcon",
    height: 512,
    width: 192,
    svgPath: "M20 424.229h20V279.771H20c-11.046 0-20-8.954-20-20V212c0-11.046 8.954-20 20-20h112c11.046 0 20 8.954 20 20v212.229h20c11.046 0 20 8.954 20 20V492c0 11.046-8.954 20-20 20H20c-11.046 0-20-8.954-20-20v-47.771c0-11.046 8.954-20 20-20zM96 0C56.235 0 24 32.235 24 72s32.235 72 72 72 72-32.235 72-72S135.764 0 96 0z",
    yOffset: 0,
    xOffset: 0
  };
  var InfoIcon = createIcon(InfoIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/key-icon.js
  var KeyIconConfig = {
    name: "KeyIcon",
    height: 1024,
    width: 1024,
    svgPath: "M802,320 C748.980664,320 706,277.019336 706,224 C706,170.980664 748.980664,128 802,128 C855.019336,128 898,170.980664 898,224 C898,277.019336 855.019336,320 802,320 M704,0 C527.3,0 384,143.3 384,320 C383.937788,357.490503 390.505571,394.696657 403.4,429.9 L0,824.1 L0,1024 L192,1024 L192,896 L320,896 L320,768 L448,768 L597,622 C596.906403,621.881923 596.838304,621.745723 596.8,621.6 C631.220126,633.811107 667.47802,640.034477 704,640 C880.7,640 1024,496.7 1024,320 C1024,143.3 880.7,0 704,0",
    yOffset: 0,
    xOffset: 0
  };
  var KeyIcon = createIcon(KeyIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/leaf-icon.js
  var LeafIconConfig = {
    name: "LeafIcon",
    height: 512,
    width: 576,
    svgPath: "M546.2 9.7c-5.6-12.5-21.6-13-28.3-1.2C486.9 62.4 431.4 96 368 96h-80C182 96 96 182 96 288c0 7 .8 13.7 1.5 20.5C161.3 262.8 253.4 224 384 224c8.8 0 16 7.2 16 16s-7.2 16-16 16C132.6 256 26 410.1 2.4 468c-6.6 16.3 1.2 34.9 17.5 41.6 16.4 6.8 35-1.1 41.8-17.3 1.5-3.6 20.9-47.9 71.9-90.6 32.4 43.9 94 85.8 174.9 77.2C465.5 467.5 576 326.7 576 154.3c0-50.2-10.8-102.2-29.8-144.6z",
    yOffset: 0,
    xOffset: 0
  };
  var LeafIcon = createIcon(LeafIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/link-icon.js
  var LinkIconConfig = {
    name: "LinkIcon",
    height: 512,
    width: 512,
    svgPath: "M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z",
    yOffset: 0,
    xOffset: 0
  };
  var LinkIcon = createIcon(LinkIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/list-icon.js
  var ListIconConfig = {
    name: "ListIcon",
    height: 512,
    width: 512,
    svgPath: "M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z",
    yOffset: 0,
    xOffset: 0
  };
  var ListIcon = createIcon(ListIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/lock-icon.js
  var LockIconConfig = {
    name: "LockIcon",
    height: 512,
    width: 448,
    svgPath: "M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z",
    yOffset: 0,
    xOffset: 0
  };
  var LockIcon = createIcon(LockIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/long-arrow-alt-down-icon.js
  var LongArrowAltDownIconConfig = {
    name: "LongArrowAltDownIcon",
    height: 512,
    width: 256,
    svgPath: "M168 345.941V44c0-6.627-5.373-12-12-12h-56c-6.627 0-12 5.373-12 12v301.941H41.941c-21.382 0-32.09 25.851-16.971 40.971l86.059 86.059c9.373 9.373 24.569 9.373 33.941 0l86.059-86.059c15.119-15.119 4.411-40.971-16.971-40.971H168z",
    yOffset: 0,
    xOffset: 0
  };
  var LongArrowAltDownIcon = createIcon(LongArrowAltDownIconConfig);
  var long_arrow_alt_down_icon_default = LongArrowAltDownIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/long-arrow-alt-up-icon.js
  var LongArrowAltUpIconConfig = {
    name: "LongArrowAltUpIcon",
    height: 512,
    width: 256,
    svgPath: "M88 166.059V468c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12V166.059h46.059c21.382 0 32.09-25.851 16.971-40.971l-86.059-86.059c-9.373-9.373-24.569-9.373-33.941 0l-86.059 86.059c-15.119 15.119-4.411 40.971 16.971 40.971H88z",
    yOffset: 0,
    xOffset: 0
  };
  var LongArrowAltUpIcon = createIcon(LongArrowAltUpIconConfig);
  var long_arrow_alt_up_icon_default = LongArrowAltUpIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/monitoring-icon.js
  var MonitoringIconConfig = {
    name: "MonitoringIcon",
    height: 1024,
    width: 1088,
    svgPath: "M1088,64 L1088,831.91 L640,831.91 L640,896 L832,896.56 L832,960 L256,960 L256,896.56 L448,896 L448,831.91 L0,831.91 L0,64 L1088,64 Z M960,192 L128,192 L128,704 L960,704 L960,192 Z M848.33,301.46 C869.02,322.16 867.08,350.6 848.33,369.34 L658,559.7 C639.255091,578.443665 608.864909,578.443665 590.12,559.7 L465.65,435.24 L305.94,595 C287.151529,613.484918 256.972593,613.362033 238.33528,594.72472 C219.697967,576.087407 219.575082,545.908471 238.06,527.12 L431.71,333.42 L432.41,332.71 C441.412061,323.705883 453.62271,318.647251 466.355,318.647251 C479.08729,318.647251 491.297939,323.705883 500.3,332.71 L624,457.87 L780.45,301.46 C799.2,282.71 827.64,280.76 848.33,301.46 Z",
    yOffset: 0,
    xOffset: 0
  };
  var MonitoringIcon = createIcon(MonitoringIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/outlined-question-circle-icon.js
  var OutlinedQuestionCircleIconConfig = {
    name: "OutlinedQuestionCircleIcon",
    height: 512,
    width: 512,
    svgPath: "M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 448c-110.532 0-200-89.431-200-200 0-110.495 89.472-200 200-200 110.491 0 200 89.471 200 200 0 110.53-89.431 200-200 200zm107.244-255.2c0 67.052-72.421 68.084-72.421 92.863V300c0 6.627-5.373 12-12 12h-45.647c-6.627 0-12-5.373-12-12v-8.659c0-35.745 27.1-50.034 47.579-61.516 17.561-9.845 28.324-16.541 28.324-29.579 0-17.246-21.999-28.693-39.784-28.693-23.189 0-33.894 10.977-48.942 29.969-4.057 5.12-11.46 6.071-16.666 2.124l-27.824-21.098c-5.107-3.872-6.251-11.066-2.644-16.363C184.846 131.491 214.94 112 261.794 112c49.071 0 101.45 38.304 101.45 88.8zM298 368c0 23.159-18.841 42-42 42s-42-18.841-42-42 18.841-42 42-42 42 18.841 42 42z",
    yOffset: 0,
    xOffset: 0
  };
  var OutlinedQuestionCircleIcon = createIcon(OutlinedQuestionCircleIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/pencil-alt-icon.js
  var PencilAltIconConfig = {
    name: "PencilAltIcon",
    height: 512,
    width: 512,
    svgPath: "M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z",
    yOffset: 0,
    xOffset: 0
  };
  var PencilAltIcon = createIcon(PencilAltIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/pending-icon.js
  var PendingIconConfig = {
    name: "PendingIcon",
    height: 1024,
    width: 1024,
    svgPath: "M512.1,895.9 C300.3,895.9 128.1,723.8 128.1,511.9 C128.1,300.2 300.3,127.9 512.1,127.9 C723.8,127.9 896,300.2 896.1,511.9 C896.1,723.7 723.8,895.9 512.1,895.9 M512.1,0 C229.7,0 0,229.7 0,512 C0,794.3 229.7,1024 512.1,1024 C794.3,1024 1024,794.3 1024,512 C1024,229.7 794.3,0 512.1,0 M704,288 L704,272 C704,263.2 696.8,256 688,256 L336,256 C327.2,256 320,263.2 320,272 L320,288 C320,447 480,449 480,512 C480,575 320,575 320,736 L320,752 C320,760.8 327.2,768 336,768 L688,768 C696.8,768 704,760.8 704,752 L704,736 C704,576 544,577 544,512 C544,447 704,448 704,288 M603.9,704 L420.3,704 C417.3,704 418.2,695 419.4,686.8 C426.8,634.5 480.1,617.4 495.2,612.3 C512.3,606.6 512.3,606.6 528.9,612.3 C544,617.6 597.6,635.4 604.8,687 C605.9,695.2 606.9,704 603.9,704",
    yOffset: 0,
    xOffset: 0
  };
  var PendingIcon = createIcon(PendingIconConfig);
  var pending_icon_default = PendingIcon;

  // node_modules/@patternfly/react-icons/dist/esm/icons/plus-circle-icon.js
  var PlusCircleIconConfig = {
    name: "PlusCircleIcon",
    height: 512,
    width: 512,
    svgPath: "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z",
    yOffset: 0,
    xOffset: 0
  };
  var PlusCircleIcon = createIcon(PlusCircleIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/resources-empty-icon.js
  var ResourcesEmptyIconConfig = {
    name: "ResourcesEmptyIcon",
    height: 1024,
    width: 1024,
    svgPath: "M512,896 C300.2,896 128,723.9 128,512 C128,300.3 300.2,128 512,128 C723.7,128 896,300.2 896,512 C896,723.8 723.7,896 512,896 L512,896 Z M512.1,0 C229.7,0 0,229.8 0,512 C0,794.3 229.8,1024 512.1,1024 C794.4,1024 1024,794.3 1024,512 C1024,229.7 794.4,0 512.1,0 L512.1,0 Z",
    yOffset: 0,
    xOffset: 0
  };
  var ResourcesEmptyIcon = createIcon(ResourcesEmptyIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/route-icon.js
  var RouteIconConfig = {
    name: "RouteIcon",
    height: 512,
    width: 512,
    svgPath: "M416 320h-96c-17.6 0-32-14.4-32-32s14.4-32 32-32h96s96-107 96-160-43-96-96-96-96 43-96 96c0 25.5 22.2 63.4 45.3 96H320c-52.9 0-96 43.1-96 96s43.1 96 96 96h96c17.6 0 32 14.4 32 32s-14.4 32-32 32H185.5c-16 24.8-33.8 47.7-47.3 64H416c52.9 0 96-43.1 96-96s-43.1-96-96-96zm0-256c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zM96 256c-53 0-96 43-96 96s96 160 96 160 96-107 96-160-43-96-96-96zm0 128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z",
    yOffset: 0,
    xOffset: 0
  };
  var RouteIcon = createIcon(RouteIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/server-icon.js
  var ServerIconConfig = {
    name: "ServerIcon",
    height: 512,
    width: 512,
    svgPath: "M480 160H32c-17.673 0-32-14.327-32-32V64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24z",
    yOffset: 0,
    xOffset: 0
  };
  var ServerIcon = createIcon(ServerIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/sync-alt-icon.js
  var SyncAltIconConfig = {
    name: "SyncAltIcon",
    height: 512,
    width: 512,
    svgPath: "M370.72 133.28C339.458 104.008 298.888 87.962 255.848 88c-77.458.068-144.328 53.178-162.791 126.85-1.344 5.363-6.122 9.15-11.651 9.15H24.103c-7.498 0-13.194-6.807-11.807-14.176C33.933 94.924 134.813 8 256 8c66.448 0 126.791 26.136 171.315 68.685L463.03 40.97C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.749zM32 296h134.059c21.382 0 32.09 25.851 16.971 40.971l-41.75 41.75c31.262 29.273 71.835 45.319 114.876 45.28 77.418-.07 144.315-53.144 162.787-126.849 1.344-5.363 6.122-9.15 11.651-9.15h57.304c7.498 0 13.194 6.807 11.807 14.176C478.067 417.076 377.187 504 256 504c-66.448 0-126.791-26.136-171.315-68.685L48.97 471.03C33.851 486.149 8 475.441 8 454.059V320c0-13.255 10.745-24 24-24z",
    yOffset: 0,
    xOffset: 0
  };
  var SyncAltIcon = createIcon(SyncAltIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/tachometer-alt-icon.js
  var TachometerAltIconConfig = {
    name: "TachometerAltIcon",
    height: 512,
    width: 576,
    svgPath: "M288 32C128.94 32 0 160.94 0 320c0 52.8 14.25 102.26 39.06 144.8 5.61 9.62 16.3 15.2 27.44 15.2h443c11.14 0 21.83-5.58 27.44-15.2C561.75 422.26 576 372.8 576 320c0-159.06-128.94-288-288-288zm0 64c14.71 0 26.58 10.13 30.32 23.65-1.11 2.26-2.64 4.23-3.45 6.67l-9.22 27.67c-5.13 3.49-10.97 6.01-17.64 6.01-17.67 0-32-14.33-32-32S270.33 96 288 96zM96 384c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32zm48-160c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32zm246.77-72.41l-61.33 184C343.13 347.33 352 364.54 352 384c0 11.72-3.38 22.55-8.88 32H232.88c-5.5-9.45-8.88-20.28-8.88-32 0-33.94 26.5-61.43 59.9-63.59l61.34-184.01c4.17-12.56 17.73-19.45 30.36-15.17 12.57 4.19 19.35 17.79 15.17 30.36zm14.66 57.2l15.52-46.55c3.47-1.29 7.13-2.23 11.05-2.23 17.67 0 32 14.33 32 32s-14.33 32-32 32c-11.38-.01-20.89-6.28-26.57-15.22zM480 384c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32z",
    yOffset: 0,
    xOffset: 0
  };
  var TachometerAltIcon = createIcon(TachometerAltIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/topology-icon.js
  var TopologyIconConfig = {
    name: "TopologyIcon",
    height: 1024,
    width: 1088,
    svgPath: "M877.8,0 C797.1,0 731.5,65.6 731.5,146.3 C731.5,175.1 739.7,201.8 754.1,224.5 L670,310.5 C626.5,276.4 571.7,256 512,256 C477.8,256 445.1,262.7 415.3,274.9 L388.6,239.6 C375.1,221.3 350.9,216.1 334.9,228.2 C318.7,240.1 316.4,264.8 329.6,283.1 L351.9,312.3 C293.4,359.2 256,431.2 256,512 C256,534.7 259,556.7 264.5,577.7 L239,590.9 C219.8,600.3 210.7,622.9 218.4,641.2 C226.1,659.5 248.3,666.8 267.3,657.7 L292.9,644.4 C329.1,704.2 389.1,748 459.8,762.6 L453.8,835.6 C413.5,847.1 384,884.1 384,928 C384,981 427,1024 480,1024 C533,1024 576,981 576,928 C576,888.3 551.9,854.3 517.6,839.7 L523.5,767.8 C605.3,764.2 677.2,722.1 721.4,659.2 L789.8,705.8 C808.1,718.4 832.1,714.9 842.8,698 C853.5,680.9 847.3,656.9 828.8,644.6 L754.6,594.1 C763.3,568.3 768,540.7 768,512 C768,456.6 750.4,405.3 720.5,363.5 L807.4,274.8 C828.2,286.2 852.2,292.9 877.8,292.9 C958.5,292.9 1024.1,227.3 1024.1,146.6 C1024.1,65.9 958.5,0 877.8,0 Z M528,928 C528,954.5 506.5,976 480,976 C453.5,976 432,954.5 432,928 C432,901.5 453.5,880 480,880 C506.5,880 528,901.5 528,928 Z M512,640 C441.3,640 384,582.7 384,512 C384,441.3 441.3,384 512,384 C582.7,384 640,441.3 640,512 C640,582.7 582.8,640 512,640 Z M877.8,224 C834.8,224 800.1,189.3 800.1,146.3 C800.1,103.3 834.8,68.6 877.8,68.6 C920.8,68.6 955.5,103.3 955.5,146.3 C955.5,189.3 920.8,224 877.8,224 Z M900.8,712.3 C943.6,669.5 1013.1,669.5 1055.9,712.3 C1077.3,733.7 1088,761.8 1088,789.9 C1088,818 1077.3,846 1055.9,867.5 C1013.1,910.3 943.6,910.3 900.8,867.5 C858,824.6 858,755.2 900.8,712.3 M256,2.3 C316.6,2.3 365.7,51.4 365.7,112 C365.7,172.6 316.6,221.7 256,221.7 C195.4,221.7 146.3,172.6 146.3,112 C146.3,51.4 195.4,2.3 256,2.3 M96,608 C149,608 192,651 192,704 C192,757 149,800 96,800 C43,800 0,757 0,704 C0,651 43,608 96,608",
    yOffset: 0,
    xOffset: 0
  };
  var TopologyIcon = createIcon(TopologyIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/trash-icon.js
  var TrashIconConfig = {
    name: "TrashIcon",
    height: 512,
    width: 448,
    svgPath: "M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z",
    yOffset: 0,
    xOffset: 0
  };
  var TrashIcon = createIcon(TrashIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/tree-icon.js
  var TreeIconConfig = {
    name: "TreeIcon",
    height: 512,
    width: 384,
    svgPath: "M378.31 378.49L298.42 288h30.63c9.01 0 16.98-5 20.78-13.06 3.8-8.04 2.55-17.26-3.28-24.05L268.42 160h28.89c9.1 0 17.3-5.35 20.86-13.61 3.52-8.13 1.86-17.59-4.24-24.08L203.66 4.83c-6.03-6.45-17.28-6.45-23.32 0L70.06 122.31c-6.1 6.49-7.75 15.95-4.24 24.08C69.38 154.65 77.59 160 86.69 160h28.89l-78.14 90.91c-5.81 6.78-7.06 15.99-3.27 24.04C37.97 283 45.93 288 54.95 288h30.63L5.69 378.49c-6 6.79-7.36 16.09-3.56 24.26 3.75 8.05 12 13.25 21.01 13.25H160v24.45l-30.29 48.4c-5.32 10.64 2.42 23.16 14.31 23.16h95.96c11.89 0 19.63-12.52 14.31-23.16L224 440.45V416h136.86c9.01 0 17.26-5.2 21.01-13.25 3.8-8.17 2.44-17.47-3.56-24.26z",
    yOffset: 0,
    xOffset: 0
  };
  var TreeIcon = createIcon(TreeIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/user-icon.js
  var UserIconConfig = {
    name: "UserIcon",
    height: 512,
    width: 448,
    svgPath: "M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z",
    yOffset: 0,
    xOffset: 0
  };
  var UserIcon = createIcon(UserIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/users-icon.js
  var UsersIconConfig = {
    name: "UsersIcon",
    height: 512,
    width: 640,
    svgPath: "M96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm448 0c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm32 32h-64c-17.6 0-33.5 7.1-45.1 18.6 40.3 22.1 68.9 62 75.1 109.4h66c17.7 0 32-14.3 32-32v-32c0-35.3-28.7-64-64-64zm-256 0c61.9 0 112-50.1 112-112S381.9 32 320 32 208 82.1 208 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zm-223.7-13.4C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z",
    yOffset: 0,
    xOffset: 0
  };
  var UsersIcon = createIcon(UsersIconConfig);

  // node_modules/@patternfly/react-icons/dist/esm/icons/wrench-icon.js
  var WrenchIconConfig = {
    name: "WrenchIcon",
    height: 512,
    width: 512,
    svgPath: "M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z",
    yOffset: 0,
    xOffset: 0
  };
  var WrenchIcon = createIcon(WrenchIconConfig);

  // src/lib/plugins/pluginTables.jsx
  var import_react18 = __toESM(require_react(), 1);

  // node_modules/@patternfly/react-table/dist/esm/components/Table/ActionsColumn.js
  init_tslib_es6();
  var React199 = __toESM(require_react());
  var ActionsColumnBase = (_a) => {
    var { items, isDisabled, rowData, extraData, actionsToggle, popperProps = {
      position: "end",
      direction: "down"
    }, innerRef, firstActionItemRef, isOnOpenChangeDisabled = false } = _a, props = __rest(_a, ["items", "isDisabled", "rowData", "extraData", "actionsToggle", "popperProps", "innerRef", "firstActionItemRef", "isOnOpenChangeDisabled"]);
    const [isOpen, setIsOpen] = React199.useState(false);
    const onToggle = () => {
      setIsOpen(!isOpen);
    };
    const onActionClick = (event, onClick) => {
      if (onClick) {
        event.preventDefault();
        onClick(event, extraData && extraData.rowIndex, rowData, extraData);
      }
    };
    return React199.createElement(
      React199.Fragment,
      null,
      items.filter((item) => item.isOutsideDropdown).map((_a2, key) => {
        var { title, itemKey, onClick, isOutsideDropdown } = _a2, props2 = __rest(_a2, ["title", "itemKey", "onClick", "isOutsideDropdown"]);
        return typeof title === "string" ? React199.createElement(Button, Object.assign({ onClick: (event) => onActionClick(event, onClick) }, props2, { isDisabled, key: itemKey || `outside_dropdown_${key}`, "data-key": itemKey || `outside_dropdown_${key}` }), title) : React199.cloneElement(title, Object.assign({ onClick, isDisabled }, props2));
      }),
      React199.createElement(
        Dropdown,
        Object.assign({ isOpen, onOpenChange: !isOnOpenChangeDisabled ? (isOpen2) => setIsOpen(isOpen2) : void 0, toggle: (toggleRef) => actionsToggle ? actionsToggle({ onToggle, isOpen, isDisabled, toggleRef }) : React199.createElement(
          MenuToggle,
          { "aria-label": "Kebab toggle", ref: toggleRef, onClick: onToggle, isExpanded: isOpen, isDisabled, variant: "plain" },
          React199.createElement(ellipsis_v_icon_default, null)
        ) }, rowData && rowData.actionProps, { ref: innerRef }, props, { popperProps }),
        React199.createElement(DropdownList, null, items.filter((item) => !item.isOutsideDropdown).map((_a2, index) => {
          var { title, itemKey, onClick, tooltipProps, isSeparator, shouldCloseOnClick = true } = _a2, props2 = __rest(_a2, ["title", "itemKey", "onClick", "tooltipProps", "isSeparator", "shouldCloseOnClick"]);
          if (isSeparator) {
            return React199.createElement(Divider, { key: itemKey || index, "data-key": itemKey || index });
          }
          const item = React199.createElement(DropdownItem, Object.assign({ onClick: (event) => {
            onActionClick(event, onClick);
            shouldCloseOnClick && onToggle();
          } }, props2, { key: itemKey || index, "data-key": itemKey || index, ref: index === 0 ? firstActionItemRef : void 0 }), title);
          if (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.content) {
            return React199.createElement(Tooltip, Object.assign({ key: itemKey || index }, tooltipProps), item);
          } else {
            return item;
          }
        }))
      )
    );
  };
  var ActionsColumn = React199.forwardRef((props, ref) => React199.createElement(ActionsColumnBase, Object.assign({}, props, { innerRef: ref })));
  ActionsColumn.displayName = "ActionsColumn";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/CollapseColumn.js
  init_tslib_es6();
  var React200 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Table/table.mjs
  var table_default = {
    "button": "pf-v5-c-button",
    "check": "pf-v5-c-check",
    "checkInput": "pf-v5-c-check__input",
    "dirRtl": "pf-v5-m-dir-rtl",
    "modifiers": {
      "hidden": "pf-m-hidden",
      "hiddenOnSm": "pf-m-hidden-on-sm",
      "visibleOnSm": "pf-m-visible-on-sm",
      "hiddenOnMd": "pf-m-hidden-on-md",
      "visibleOnMd": "pf-m-visible-on-md",
      "hiddenOnLg": "pf-m-hidden-on-lg",
      "visibleOnLg": "pf-m-visible-on-lg",
      "hiddenOnXl": "pf-m-hidden-on-xl",
      "visibleOnXl": "pf-m-visible-on-xl",
      "hiddenOn_2xl": "pf-m-hidden-on-2xl",
      "visibleOn_2xl": "pf-m-visible-on-2xl",
      "fixed": "pf-m-fixed",
      "stickyHeader": "pf-m-sticky-header",
      "nestedColumnHeader": "pf-m-nested-column-header",
      "borderRow": "pf-m-border-row",
      "striped": "pf-m-striped",
      "expandable": "pf-m-expandable",
      "stripedEven": "pf-m-striped-even",
      "ghostRow": "pf-m-ghost-row",
      "center": "pf-m-center",
      "help": "pf-m-help",
      "favorite": "pf-m-favorite",
      "borderRight": "pf-m-border-right",
      "borderLeft": "pf-m-border-left",
      "expanded": "pf-m-expanded",
      "truncate": "pf-m-truncate",
      "wrap": "pf-m-wrap",
      "nowrap": "pf-m-nowrap",
      "fitContent": "pf-m-fit-content",
      "breakWord": "pf-m-break-word",
      "noBorderRows": "pf-m-no-border-rows",
      "clickable": "pf-m-clickable",
      "selected": "pf-m-selected",
      "firstCellOffsetReset": "pf-m-first-cell-offset-reset",
      "dragOver": "pf-m-drag-over",
      "standalone": "pf-m-standalone",
      "favorited": "pf-m-favorited",
      "noPadding": "pf-m-no-padding",
      "compact": "pf-m-compact",
      "width_10": "pf-m-width-10",
      "width_15": "pf-m-width-15",
      "width_20": "pf-m-width-20",
      "width_25": "pf-m-width-25",
      "width_30": "pf-m-width-30",
      "width_35": "pf-m-width-35",
      "width_40": "pf-m-width-40",
      "width_45": "pf-m-width-45",
      "width_50": "pf-m-width-50",
      "width_60": "pf-m-width-60",
      "width_70": "pf-m-width-70",
      "width_80": "pf-m-width-80",
      "width_90": "pf-m-width-90",
      "width_100": "pf-m-width-100"
    },
    "table": "pf-v5-c-table",
    "tableAction": "pf-v5-c-table__action",
    "tableButton": "pf-v5-c-table__button",
    "tableButtonContent": "pf-v5-c-table__button-content",
    "tableCaption": "pf-v5-c-table__caption",
    "tableCheck": "pf-v5-c-table__check",
    "tableColumnHelp": "pf-v5-c-table__column-help",
    "tableColumnHelpAction": "pf-v5-c-table__column-help-action",
    "tableCompoundExpansionToggle": "pf-v5-c-table__compound-expansion-toggle",
    "tableControlRow": "pf-v5-c-table__control-row",
    "tableDraggable": "pf-v5-c-table__draggable",
    "tableExpandableRow": "pf-v5-c-table__expandable-row",
    "tableExpandableRowContent": "pf-v5-c-table__expandable-row-content",
    "tableFavorite": "pf-v5-c-table__favorite",
    "tableIcon": "pf-v5-c-table__icon",
    "tableIconInline": "pf-v5-c-table__icon-inline",
    "tableInlineEditAction": "pf-v5-c-table__inline-edit-action",
    "tableSort": "pf-v5-c-table__sort",
    "tableSortIndicator": "pf-v5-c-table__sort-indicator",
    "tableSubhead": "pf-v5-c-table__subhead",
    "tableTbody": "pf-v5-c-table__tbody",
    "tableTd": "pf-v5-c-table__td",
    "tableText": "pf-v5-c-table__text",
    "tableTh": "pf-v5-c-table__th",
    "tableThead": "pf-v5-c-table__thead",
    "tableToggle": "pf-v5-c-table__toggle",
    "tableToggleIcon": "pf-v5-c-table__toggle-icon",
    "tableTr": "pf-v5-c-table__tr",
    "themeDark": "pf-v5-theme-dark"
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/CollapseColumn.js
  var CollapseColumn = (_a) => {
    var { className = "", children = null, isOpen, onToggle } = _a, props = __rest(_a, ["className", "children", "isOpen", "onToggle"]);
    return React200.createElement(
      React200.Fragment,
      null,
      isOpen !== void 0 && React200.createElement(
        Button,
        Object.assign({ className: css(className, isOpen && table_default.modifiers.expanded) }, props, { variant: "plain", "aria-label": props["aria-label"] || "Details", onClick: onToggle, "aria-expanded": isOpen }),
        React200.createElement(
          "div",
          { className: css(table_default.tableToggleIcon) },
          React200.createElement(angle_down_icon_default, null)
        )
      ),
      children
    );
  };
  CollapseColumn.displayName = "CollapseColumn";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/DraggableCell.js
  init_tslib_es6();
  var React201 = __toESM(require_react());
  var DraggableCell = (_a) => {
    var { className, onClick, "aria-label": ariaLabel, id } = _a, props = __rest(_a, ["className", "onClick", "aria-label", "id"]);
    return React201.createElement(
      Button,
      Object.assign({ id, variant: "plain", className, type: "button", "aria-label": ariaLabel || `Draggable row draggable button`, onClick }, props),
      React201.createElement(grip_vertical_icon_default, { "aria-hidden": true })
    );
  };
  DraggableCell.displayName = "DraggableCell";

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Dropdown/DropdownSeparator.js
  init_tslib_es6();
  var React204 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Dropdown/dropdownConstants.js
  var React202 = __toESM(require_react());
  var DropdownPosition;
  (function(DropdownPosition2) {
    DropdownPosition2["right"] = "right";
    DropdownPosition2["left"] = "left";
  })(DropdownPosition || (DropdownPosition = {}));
  var DropdownDirection;
  (function(DropdownDirection2) {
    DropdownDirection2["up"] = "up";
    DropdownDirection2["down"] = "down";
  })(DropdownDirection || (DropdownDirection = {}));
  var DropdownContext = React202.createContext({
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    onSelect: (event) => void 0,
    id: "",
    toggleIndicatorClass: "",
    toggleIconClass: "",
    toggleTextClass: "",
    menuClass: "",
    itemClass: "",
    toggleClass: "",
    baseClass: "",
    baseComponent: "div",
    sectionClass: "",
    sectionTitleClass: "",
    sectionComponent: "section",
    disabledClass: "",
    plainTextClass: "",
    menuComponent: "ul"
  });
  var DropdownArrowContext = React202.createContext({
    keyHandler: null,
    sendRef: null
  });

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Dropdown/InternalDropdownItem.js
  init_tslib_es6();
  var React203 = __toESM(require_react());
  var InternalDropdownItem = class extends React203.Component {
    constructor() {
      super(...arguments);
      this.ref = React203.createRef();
      this.additionalRef = React203.createRef();
      this.getInnerNode = (node) => node && node.childNodes && node.childNodes.length ? node.childNodes[0] : node;
      this.onKeyDown = (event) => {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
        const innerIndex = event.target === this.ref.current ? 0 : 1;
        if (!this.props.customChild) {
          event.preventDefault();
        }
        if (event.key === "ArrowUp") {
          (_b = (_a = this.props.context) === null || _a === void 0 ? void 0 : _a.keyHandler) === null || _b === void 0 ? void 0 : _b.call(_a, this.props.index, innerIndex, KEYHANDLER_DIRECTION.UP);
          event.stopPropagation();
        } else if (event.key === "ArrowDown") {
          (_d = (_c = this.props.context) === null || _c === void 0 ? void 0 : _c.keyHandler) === null || _d === void 0 ? void 0 : _d.call(_c, this.props.index, innerIndex, KEYHANDLER_DIRECTION.DOWN);
          event.stopPropagation();
        } else if (event.key === "ArrowRight") {
          (_f = (_e = this.props.context) === null || _e === void 0 ? void 0 : _e.keyHandler) === null || _f === void 0 ? void 0 : _f.call(_e, this.props.index, innerIndex, KEYHANDLER_DIRECTION.RIGHT);
          event.stopPropagation();
        } else if (event.key === "ArrowLeft") {
          (_h = (_g = this.props.context) === null || _g === void 0 ? void 0 : _g.keyHandler) === null || _h === void 0 ? void 0 : _h.call(_g, this.props.index, innerIndex, KEYHANDLER_DIRECTION.LEFT);
          event.stopPropagation();
        } else if (event.key === "Enter" || event.key === " ") {
          event.target.click();
          this.props.enterTriggersArrowDown && ((_k = (_j = this.props.context) === null || _j === void 0 ? void 0 : _j.keyHandler) === null || _k === void 0 ? void 0 : _k.call(_j, this.props.index, innerIndex, KEYHANDLER_DIRECTION.DOWN));
        }
      };
      this.componentRef = (element) => {
        this.ref.current = element;
        const { component } = this.props;
        const ref = component.ref;
        if (ref) {
          if (typeof ref === "function") {
            ref(element);
          } else {
            ref.current = element;
          }
        }
      };
    }
    componentDidMount() {
      var _a;
      const { context, index, isDisabled, role, customChild, autoFocus } = this.props;
      const customRef = customChild ? this.getInnerNode(this.ref.current) : this.ref.current;
      (_a = context === null || context === void 0 ? void 0 : context.sendRef) === null || _a === void 0 ? void 0 : _a.call(context, index, [customRef, customChild ? customRef : this.additionalRef.current], isDisabled, role === "separator");
      autoFocus && setTimeout(() => customRef.focus());
    }
    componentDidUpdate() {
      var _a;
      const { context, index, isDisabled, role, customChild } = this.props;
      const customRef = customChild ? this.getInnerNode(this.ref.current) : this.ref.current;
      (_a = context === null || context === void 0 ? void 0 : context.sendRef) === null || _a === void 0 ? void 0 : _a.call(context, index, [customRef, customChild ? customRef : this.additionalRef.current], isDisabled, role === "separator");
    }
    extendAdditionalChildRef() {
      const { additionalChild } = this.props;
      return React203.cloneElement(additionalChild, {
        ref: this.additionalRef
      });
    }
    render() {
      const _a = this.props, { className, children, context, onClick, component, role, isDisabled, isAriaDisabled, isPlainText, index, href, tooltip, tooltipProps, id, componentID, listItemClassName, additionalChild, customChild, enterTriggersArrowDown, icon, autoFocus, styleChildren, description, inoperableEvents } = _a, additionalProps = __rest(_a, ["className", "children", "context", "onClick", "component", "role", "isDisabled", "isAriaDisabled", "isPlainText", "index", "href", "tooltip", "tooltipProps", "id", "componentID", "listItemClassName", "additionalChild", "customChild", "enterTriggersArrowDown", "icon", "autoFocus", "styleChildren", "description", "inoperableEvents"]);
      let classes = css(icon && dropdown_default.modifiers.icon, isAriaDisabled && dropdown_default.modifiers.ariaDisabled, className);
      if (component === "a") {
        additionalProps["aria-disabled"] = isDisabled || isAriaDisabled;
      } else if (component === "button") {
        additionalProps["aria-disabled"] = isDisabled || isAriaDisabled;
        additionalProps.type = additionalProps.type || "button";
      }
      const renderWithTooltip = (childNode) => tooltip ? React203.createElement(Tooltip, Object.assign({ content: tooltip }, tooltipProps), childNode) : childNode;
      const renderClonedComponent = (element) => React203.cloneElement(element, Object.assign(Object.assign({}, styleChildren && {
        className: css(element.props.className, classes)
      }), this.props.role !== "separator" && { role, ref: this.componentRef }));
      const renderDefaultComponent = (tag) => {
        const Component40 = tag;
        const componentContent = description ? React203.createElement(
          React203.Fragment,
          null,
          React203.createElement(
            "div",
            { className: dropdown_default.dropdownMenuItemMain },
            icon && React203.createElement("span", { className: css(dropdown_default.dropdownMenuItemIcon) }, icon),
            children
          ),
          React203.createElement("div", { className: dropdown_default.dropdownMenuItemDescription }, description)
        ) : React203.createElement(
          React203.Fragment,
          null,
          icon && React203.createElement("span", { className: css(dropdown_default.dropdownMenuItemIcon) }, icon),
          children
        );
        return React203.createElement(Component40, Object.assign({}, additionalProps, isDisabled || isAriaDisabled ? preventedEvents(inoperableEvents) : null, { href, ref: this.ref, className: classes, id: componentID, role }), componentContent);
      };
      return React203.createElement(DropdownContext.Consumer, null, ({ onSelect, itemClass, disabledClass, plainTextClass }) => {
        if (this.props.role !== "separator") {
          classes = css(classes, isDisabled && disabledClass, isPlainText && plainTextClass, itemClass, description && dropdown_default.modifiers.description);
        }
        if (customChild) {
          return React203.cloneElement(customChild, {
            ref: this.ref,
            onKeyDown: this.onKeyDown
          });
        }
        return React203.createElement(
          "li",
          Object.assign({}, listItemClassName && { className: listItemClassName }, { role: "none", onKeyDown: this.onKeyDown, onClick: (event) => {
            if (!isDisabled && !isAriaDisabled) {
              onClick === null || onClick === void 0 ? void 0 : onClick(event);
              onSelect === null || onSelect === void 0 ? void 0 : onSelect(event);
            }
          }, id }),
          renderWithTooltip(React203.isValidElement(component) ? renderClonedComponent(component) : renderDefaultComponent(component)),
          additionalChild && this.extendAdditionalChildRef()
        );
      });
    }
  };
  InternalDropdownItem.displayName = "InternalDropdownItem";
  InternalDropdownItem.defaultProps = {
    className: "",
    component: "a",
    role: "none",
    isDisabled: false,
    isPlainText: false,
    tooltipProps: {},
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    onClick: (event) => void 0,
    index: -1,
    context: {
      keyHandler: () => {
      },
      sendRef: () => {
      }
    },
    enterTriggersArrowDown: false,
    icon: null,
    styleChildren: true,
    description: null,
    inoperableEvents: ["onClick", "onKeyPress"]
  };

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Dropdown/DropdownSeparator.js
  var DropdownSeparator = (_a) => {
    var {
      className = "",
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      ref,
      // Types of Ref are different for React.FunctionComponent vs React.Component
      ouiaId,
      ouiaSafe
    } = _a, props = __rest(_a, ["className", "ref", "ouiaId", "ouiaSafe"]);
    const ouiaProps = useOUIAProps(DropdownSeparator.displayName, ouiaId, ouiaSafe);
    return React204.createElement(DropdownArrowContext.Consumer, null, (context) => React204.createElement(InternalDropdownItem, Object.assign({}, props, { context, component: React204.createElement(Divider, { component: DividerVariant.div }), className, role: "separator" }, ouiaProps)));
  };
  DropdownSeparator.displayName = "DropdownSeparator";

  // node_modules/@patternfly/react-styles/css/components/InlineEdit/inline-edit.mjs
  var inline_edit_default = {
    "button": "pf-v5-c-button",
    "inlineEdit": "pf-v5-c-inline-edit",
    "inlineEditAction": "pf-v5-c-inline-edit__action",
    "inlineEditEditableText": "pf-v5-c-inline-edit__editable-text",
    "inlineEditGroup": "pf-v5-c-inline-edit__group",
    "inlineEditInput": "pf-v5-c-inline-edit__input",
    "inlineEditLabel": "pf-v5-c-inline-edit__label",
    "inlineEditValue": "pf-v5-c-inline-edit__value",
    "modifiers": {
      "iconGroup": "pf-m-icon-group",
      "footer": "pf-m-footer",
      "column": "pf-m-column",
      "valid": "pf-m-valid",
      "plain": "pf-m-plain",
      "actionGroup": "pf-m-action-group",
      "enableEditable": "pf-m-enable-editable",
      "inlineEditable": "pf-m-inline-editable",
      "enable": "pf-m-enable",
      "bold": "pf-m-bold"
    }
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/ExpandableRowContent.js
  init_tslib_es6();
  var React205 = __toESM(require_react());
  var ExpandableRowContent = (_a) => {
    var { children = null } = _a, props = __rest(_a, ["children"]);
    return React205.createElement("div", Object.assign({}, props, { className: css(table_default.tableExpandableRowContent) }), children);
  };
  ExpandableRowContent.displayName = "ExpandableRowContent";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/HeaderCellInfoWrapper.js
  var React207 = __toESM(require_react());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/TableText.js
  init_tslib_es6();
  var React206 = __toESM(require_react());
  var TableTextVariant;
  (function(TableTextVariant2) {
    TableTextVariant2["div"] = "div";
    TableTextVariant2["nav"] = "nav";
  })(TableTextVariant || (TableTextVariant = {}));
  var WrapModifier;
  (function(WrapModifier2) {
    WrapModifier2["wrap"] = "wrap";
    WrapModifier2["nowrap"] = "nowrap";
    WrapModifier2["truncate"] = "truncate";
    WrapModifier2["breakWord"] = "breakWord";
    WrapModifier2["fitContent"] = "fitContent";
  })(WrapModifier || (WrapModifier = {}));
  var TableText = (_a) => {
    var { children = null, className = "", variant = "span", wrapModifier = null, tooltip: tooltipProp = "", tooltipProps = {}, onMouseEnter: onMouseEnterProp = () => {
    }, focused = false, tooltipHasDefaultBehavior = false } = _a, props = __rest(_a, ["children", "className", "variant", "wrapModifier", "tooltip", "tooltipProps", "onMouseEnter", "focused", "tooltipHasDefaultBehavior"]);
    const Component40 = variant;
    const textRef = React206.createRef();
    const [tooltip, setTooltip] = React206.useState(tooltipProp);
    const onMouseEnter = (event) => {
      if (event.target.offsetWidth < event.target.scrollWidth) {
        setTooltip(tooltipProp || event.target.innerText);
      } else {
        setTooltip("");
      }
      onMouseEnterProp(event);
    };
    const onFocus = (element) => {
      if (element.offsetWidth < element.scrollWidth) {
        setTooltip(tooltipProp || element.innerText);
      } else {
        setTooltip("");
      }
    };
    const text = React206.createElement(Component40, Object.assign({ ref: textRef, onMouseEnter: !tooltipHasDefaultBehavior ? onMouseEnter : void 0, className: css(className, wrapModifier && table_default.modifiers[wrapModifier], table_default.tableText) }, props), children);
    React206.useEffect(() => {
      if (!tooltipHasDefaultBehavior) {
        if (focused) {
          onFocus(textRef.current);
        } else {
          setTooltip("");
        }
      }
    }, [focused, tooltipHasDefaultBehavior]);
    return tooltip !== "" ? React206.createElement(Tooltip, Object.assign({ triggerRef: textRef, content: tooltip }, !tooltipHasDefaultBehavior && { isVisible: true }, tooltipProps), text) : text;
  };
  TableText.displayName = "TableText";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/HeaderCellInfoWrapper.js
  var HeaderCellInfoWrapper = ({ children, info: info2, className, variant = "tooltip", popoverProps, tooltipProps, ariaLabel }) => React207.createElement(
    "div",
    { className: css(table_default.tableColumnHelp, className) },
    typeof children === "string" ? React207.createElement(TableText, null, children) : children,
    React207.createElement("span", { className: css(table_default.tableColumnHelpAction) }, variant === "tooltip" ? React207.createElement(
      Tooltip,
      Object.assign({ content: info2 }, tooltipProps),
      React207.createElement(
        Button,
        { variant: "plain", "aria-label": ariaLabel || typeof info2 === "string" && info2 || "More info" },
        React207.createElement(help_icon_default, null)
      )
    ) : React207.createElement(
      Popover,
      Object.assign({ bodyContent: info2 }, popoverProps),
      React207.createElement(
        Button,
        { variant: "plain", "aria-label": ariaLabel || typeof info2 === "string" && info2 || "More info" },
        React207.createElement(help_icon_default, null)
      )
    ))
  );
  HeaderCellInfoWrapper.displayName = "HeaderCellInfoWrapper";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/Tr.js
  init_tslib_es6();
  var React221 = __toESM(require_react());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/Table.js
  init_tslib_es6();
  var React220 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Table/table-grid.mjs
  var table_grid_default = {
    "button": "pf-v5-c-button",
    "modifiers": {
      "grid": "pf-m-grid",
      "compact": "pf-m-compact",
      "expanded": "pf-m-expanded",
      "selected": "pf-m-selected",
      "noPadding": "pf-m-no-padding",
      "hoverable": "pf-m-hoverable",
      "nowrap": "pf-m-nowrap",
      "fitContent": "pf-m-fit-content",
      "truncate": "pf-m-truncate",
      "gridMd": "pf-m-grid-md",
      "gridLg": "pf-m-grid-lg",
      "gridXl": "pf-m-grid-xl",
      "grid_2xl": "pf-m-grid-2xl"
    },
    "table": "pf-v5-c-table",
    "tableAction": "pf-v5-c-table__action",
    "tableButton": "pf-v5-c-table__button",
    "tableCheck": "pf-v5-c-table__check",
    "tableCompoundExpansionToggle": "pf-v5-c-table__compound-expansion-toggle",
    "tableExpandableRow": "pf-v5-c-table__expandable-row",
    "tableExpandableRowContent": "pf-v5-c-table__expandable-row-content",
    "tableFavorite": "pf-v5-c-table__favorite",
    "tableIcon": "pf-v5-c-table__icon",
    "tableInlineEditAction": "pf-v5-c-table__inline-edit-action",
    "tableTbody": "pf-v5-c-table__tbody",
    "tableTd": "pf-v5-c-table__td",
    "tableText": "pf-v5-c-table__text",
    "tableTh": "pf-v5-c-table__th",
    "tableThead": "pf-v5-c-table__thead",
    "tableToggle": "pf-v5-c-table__toggle",
    "tableToggleIcon": "pf-v5-c-table__toggle-icon",
    "tableTr": "pf-v5-c-table__tr"
  };

  // node_modules/@patternfly/react-styles/css/components/Table/table-tree-view.mjs
  var table_tree_view_default = {
    "dirRtl": "pf-v5-m-dir-rtl",
    "dropdown": "pf-v5-c-dropdown",
    "modifiers": {
      "treeView": "pf-m-tree-view",
      "noInset": "pf-m-no-inset",
      "treeViewGrid": "pf-m-tree-view-grid",
      "treeViewDetailsExpanded": "pf-m-tree-view-details-expanded",
      "treeViewGridMd": "pf-m-tree-view-grid-md",
      "treeViewGridLg": "pf-m-tree-view-grid-lg",
      "treeViewGridXl": "pf-m-tree-view-grid-xl",
      "treeViewGrid_2xl": "pf-m-tree-view-grid-2xl"
    },
    "table": "pf-v5-c-table",
    "tableAction": "pf-v5-c-table__action",
    "tableCheck": "pf-v5-c-table__check",
    "tableTbody": "pf-v5-c-table__tbody",
    "tableTd": "pf-v5-c-table__td",
    "tableTh": "pf-v5-c-table__th",
    "tableThead": "pf-v5-c-table__thead",
    "tableToggle": "pf-v5-c-table__toggle",
    "tableToggleIcon": "pf-v5-c-table__toggle-icon",
    "tableTr": "pf-v5-c-table__tr",
    "tableTreeViewDetailsToggle": "pf-v5-c-table__tree-view-details-toggle",
    "tableTreeViewIcon": "pf-v5-c-table__tree-view-icon",
    "tableTreeViewMain": "pf-v5-c-table__tree-view-main",
    "tableTreeViewText": "pf-v5-c-table__tree-view-text",
    "tableTreeViewTitleCell": "pf-v5-c-table__tree-view-title-cell",
    "tableTreeViewTitleHeaderCell": "pf-v5-c-table__tree-view-title-header-cell"
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/selectable.js
  var React209 = __toESM(require_react());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/SelectColumn.js
  init_tslib_es6();
  var React208 = __toESM(require_react());
  var RowSelectVariant;
  (function(RowSelectVariant2) {
    RowSelectVariant2["radio"] = "radio";
    RowSelectVariant2["checkbox"] = "checkbox";
  })(RowSelectVariant || (RowSelectVariant = {}));
  var SelectColumn = (_a) => {
    var {
      children = null,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      className,
      onSelect = null,
      selectVariant,
      tooltip,
      tooltipProps
    } = _a, props = __rest(_a, ["children", "className", "onSelect", "selectVariant", "tooltip", "tooltipProps"]);
    const inputRef = React208.createRef();
    const content = React208.createElement(
      React208.Fragment,
      null,
      React208.createElement(
        "label",
        null,
        React208.createElement("input", Object.assign({}, props, { ref: inputRef, type: selectVariant, onChange: onSelect }))
      ),
      children
    );
    return tooltip ? React208.createElement(Tooltip, Object.assign({ triggerRef: inputRef, content: tooltip }, tooltipProps), content) : content;
  };
  SelectColumn.displayName = "SelectColumn";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/selectable.js
  var selectable = (label, { rowIndex, columnIndex, rowData, column, property: property3, tooltip }) => {
    const { extraParams: { onSelect, selectVariant, allRowsSelected, isHeaderSelectDisabled } } = column;
    const extraData = {
      rowIndex,
      columnIndex,
      column,
      property: property3
    };
    if (rowData && rowData.hasOwnProperty("parent") && !rowData.showSelect && !rowData.fullWidth) {
      return {
        component: "td",
        isVisible: true
      };
    }
    const rowId = rowIndex !== void 0 ? rowIndex : -1;
    function selectClick(event) {
      const selected = rowIndex === void 0 ? event.currentTarget.checked : rowData && !rowData.selected;
      onSelect && onSelect(event, selected, rowId, rowData, extraData);
    }
    const customProps = Object.assign(Object.assign(Object.assign({}, rowId !== -1 ? {
      checked: rowData && !!rowData.selected,
      "aria-label": `Select row ${rowIndex}`
    } : {
      checked: allRowsSelected,
      "aria-label": "Select all rows"
    }), rowData && (rowData.disableCheckbox || rowData.disableSelection) && {
      disabled: true,
      className: check_default.checkInput
    }), !rowData && isHeaderSelectDisabled && { disabled: true });
    let selectName = "check-all";
    if (rowId !== -1 && selectVariant === RowSelectVariant.checkbox) {
      selectName = `checkrow${rowIndex}`;
    } else if (rowId !== -1) {
      selectName = "radioGroup";
    }
    return {
      className: css(table_default.tableCheck),
      component: rowId !== -1 ? "td" : "th",
      isVisible: !rowData || !rowData.fullWidth,
      children: React209.createElement(SelectColumn, Object.assign({}, customProps, { selectVariant, onSelect: selectClick, name: selectName, tooltip }), label)
    };
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/sortable.js
  var React211 = __toESM(require_react());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/SortColumn.js
  init_tslib_es6();
  var React210 = __toESM(require_react());
  var SortByDirection;
  (function(SortByDirection2) {
    SortByDirection2["asc"] = "asc";
    SortByDirection2["desc"] = "desc";
  })(SortByDirection || (SortByDirection = {}));
  var SortColumn = (_a) => {
    var { children = null, className = "", isSortedBy = false, onSort = null, sortDirection = "", type = "button", tooltip, tooltipProps, tooltipHasDefaultBehavior } = _a, props = __rest(_a, ["children", "className", "isSortedBy", "onSort", "sortDirection", "type", "tooltip", "tooltipProps", "tooltipHasDefaultBehavior"]);
    let SortedByIcon;
    const [focused, setFocused] = React210.useState(false);
    if (isSortedBy) {
      SortedByIcon = sortDirection === SortByDirection.asc ? long_arrow_alt_up_icon_default : long_arrow_alt_down_icon_default;
    } else {
      SortedByIcon = arrows_alt_v_icon_default;
    }
    return React210.createElement(
      "button",
      Object.assign({}, props, { type, className: css(className, table_default.tableButton), onClick: (event) => onSort && onSort(event), onFocus: () => setFocused(true), onBlur: () => setFocused(false) }),
      React210.createElement(
        "div",
        { className: css(className, table_default.tableButtonContent) },
        React210.createElement(TableText, { tooltip, tooltipProps, tooltipHasDefaultBehavior, focused }, children),
        React210.createElement(
          "span",
          { className: css(table_default.tableSortIndicator) },
          React210.createElement(SortedByIcon, null)
        )
      )
    );
  };
  SortColumn.displayName = "SortColumn";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/sortable.js
  var sortableFavorites = (sort) => () => sortable(React211.createElement(star_icon_default, { "aria-hidden": true }), {
    columnIndex: sort.columnIndex,
    className: table_default.modifiers.favorite,
    ariaLabel: "Sort favorites",
    column: {
      extraParams: {
        sortBy: sort.sortBy,
        onSort: sort === null || sort === void 0 ? void 0 : sort.onSort
      }
    },
    tooltip: sort.tooltip,
    tooltipProps: sort.tooltipProps,
    tooltipHasDefaultBehavior: true
  });
  var sortable = (label, { columnIndex, column, property: property3, className, ariaLabel, tooltip, tooltipProps, tooltipHasDefaultBehavior }) => {
    const { extraParams: { sortBy, onSort } } = column;
    const extraData = {
      columnIndex,
      column,
      property: property3
    };
    const isSortedBy = sortBy && columnIndex === sortBy.index;
    function sortClicked(event) {
      let reversedDirection;
      if (!isSortedBy) {
        reversedDirection = sortBy.defaultDirection ? sortBy.defaultDirection : SortByDirection.asc;
      } else {
        reversedDirection = sortBy.direction === SortByDirection.asc ? SortByDirection.desc : SortByDirection.asc;
      }
      onSort && onSort(event, columnIndex, reversedDirection, extraData);
    }
    return {
      className: css(table_default.tableSort, isSortedBy && table_default.modifiers.selected, className),
      "aria-sort": isSortedBy ? `${sortBy.direction}ending` : "none",
      children: React211.createElement(SortColumn, { isSortedBy, sortDirection: isSortedBy ? sortBy.direction : "", onSort: sortClicked, "aria-label": ariaLabel, tooltip, tooltipProps, tooltipHasDefaultBehavior }, label)
    };
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/cellActions.js
  var React212 = __toESM(require_react());
  var resolveOrDefault = (resolver, defaultValue, rowData, extraData) => typeof resolver === "function" ? resolver(rowData, extraData) : defaultValue;
  var cellActions = (actions, actionResolver, areActionsDisabled) => (label, { rowData, column, rowIndex, columnIndex, column: { extraParams: { actionsToggle, actionsPopperProps } }, property: property3 }) => {
    const extraData = {
      rowIndex,
      columnIndex,
      column,
      property: property3
    };
    const resolvedActions = resolveOrDefault(actionResolver, actions, rowData, extraData);
    const resolvedIsDisabled = resolveOrDefault(areActionsDisabled, rowData && rowData.disableActions, rowData, extraData);
    const renderProps = resolvedActions && resolvedActions.length > 0 ? {
      children: React212.createElement(ActionsColumn, { items: resolvedActions, isDisabled: resolvedIsDisabled, rowData, extraData, actionsToggle, popperProps: actionsPopperProps }, label)
    } : {};
    return Object.assign({ className: css(table_default.tableAction), style: { paddingRight: 0 }, isVisible: true }, renderProps);
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/utils.js
  var getErrorTextByValidator = (validatorName, validators) => {
    const result = validators.filter((validator) => validator.name === validatorName);
    return result[0].errorText;
  };
  var cancelCellEdits = (row) => {
    row.cells.forEach((cell) => {
      delete cell.props.errorText;
      delete cell.props.editableValue;
      cell.props.isValid = true;
      if (cell.props.selected) {
        cell.props.selected = cell.props.value;
      }
    });
    row.isEditable = !row.isEditable;
    row.isValid = true;
    return row;
  };
  var validateCellEdits = (row, type, validationErrors, missingPropErrorTxt = "Validation requires unique name property for row cells") => {
    row.isValid = Object.keys(validationErrors).length ? false : true;
    row.cells.forEach((cell) => {
      delete cell.props.errorText;
      const hasValue = cell.props.value !== void 0 && cell.props.value !== null;
      const hasEditableValue = cell.props.editableValue !== void 0 && cell.props.editableValue !== null;
      if (cell.props && hasValue && hasEditableValue) {
        if (type === "save") {
          const errorMsg = Object.keys(validationErrors).filter((validatorName) => validationErrors[validatorName].includes(cell.props.name)).map((validatorName) => getErrorTextByValidator(validatorName, row.rowEditValidationRules));
          if (errorMsg.length) {
            cell.props.errorText = cell.props.name ? errorMsg.join(", ") : missingPropErrorTxt;
            if (cell.props.name === void 0) {
              console.warn("Row edit validation reporting requires cell definitions to have a unique name property.");
            }
          } else {
            delete cell.props.errorText;
            cell.props.isValid = true;
          }
        }
      }
    });
    return row;
  };
  var applyCellEdits = (row, type) => {
    row.cells.forEach((cell) => {
      delete cell.props.errorText;
      const hasValue = cell.props.value !== void 0 && cell.props.value !== null;
      const hasEditableValue = cell.props.editableValue !== void 0 && cell.props.editableValue !== null;
      if (hasValue && !hasEditableValue) {
        cell.props.editableValue = cell.props.value;
      }
      if (cell.props && hasValue && hasEditableValue) {
        if (type === "save") {
          cell.props.value = cell.props.editableValue;
          cell.props.isValid = true;
          delete cell.props.errorText;
        }
        delete cell.props.editableValue;
      }
    });
    row.isEditable = !row.isEditable;
    row.isValid = true;
    return row;
  };
  var camelize2 = (s2) => s2.toUpperCase().replace("-", "").replace("_", "");
  var toCamel2 = (s2) => s2.replace(/([-_][a-z])/gi, camelize2);
  function capitalize2(input) {
    return input[0].toUpperCase() + input.substring(1);
  }

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/cellWidth.js
  var cellWidth = (width) => () => ({
    className: css(table_default.modifiers[typeof width === "number" ? `width_${width}` : `width${capitalize2(width)}`])
  });

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/wrappable.js
  var breakWord = () => ({
    className: table_default.modifiers.breakWord
  });

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/collapsible.js
  var React213 = __toESM(require_react());
  var collapsible = (value, { rowIndex, columnIndex, rowData, column, property: property3 }) => {
    const { extraParams: { onCollapse, rowLabeledBy = "simple-node", expandId = "expand-toggle", allRowsExpanded, collapseAllAriaLabel } } = column;
    const extraData = {
      rowIndex,
      columnIndex,
      column,
      property: property3
    };
    const rowId = rowIndex !== void 0 ? rowIndex : -1;
    const customProps = Object.assign({}, rowId !== -1 ? {
      isOpen: rowData === null || rowData === void 0 ? void 0 : rowData.isOpen,
      "aria-labelledby": `${rowLabeledBy}${rowId} ${expandId}${rowId}`
    } : {
      isOpen: allRowsExpanded,
      "aria-label": collapseAllAriaLabel || "Expand all rows"
    });
    function onToggle(event) {
      const open = rowData ? !rowData.isOpen : !allRowsExpanded;
      onCollapse && onCollapse(event, rowIndex, open, rowData, extraData);
    }
    return {
      className: ((rowData === null || rowData === void 0 ? void 0 : rowData.isOpen) !== void 0 || rowId === -1) && css(table_default.tableToggle),
      isVisible: !(rowData === null || rowData === void 0 ? void 0 : rowData.fullWidth),
      children: React213.createElement(CollapseColumn, Object.assign({ "aria-labelledby": `${rowLabeledBy}${rowId} ${expandId}${rowId}`, onToggle, id: expandId + rowId }, customProps), value)
    };
  };
  var expandable = (value, { rowData }) => rowData && rowData.hasOwnProperty("parent") ? React213.createElement(ExpandableRowContent, null, value) : value;

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/compoundExpand.js
  var React214 = __toESM(require_react());
  var compoundExpand = (value, { rowIndex, columnIndex, rowData, column, property: property3 }) => {
    if (!value) {
      return null;
    }
    const { title, props } = value;
    const { extraParams: { onExpand, expandId = "expand-toggle" } } = column;
    const extraData = {
      rowIndex,
      columnIndex,
      column,
      property: property3
    };
    function onToggle(event) {
      onExpand && onExpand(event, rowIndex, columnIndex, props.isOpen, rowData, extraData);
    }
    return {
      className: css(table_default.tableCompoundExpansionToggle, props.isOpen && table_default.modifiers.expanded),
      children: props.isOpen !== void 0 && React214.createElement(
        "button",
        { type: "button", className: css(table_default.tableButton), onClick: onToggle, "aria-expanded": props.isOpen, "aria-controls": props.ariaControls, id: `${expandId}-${rowIndex}-${columnIndex}` },
        React214.createElement(TableText, null, title)
      )
    };
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/headerCol.js
  var React215 = __toESM(require_react());
  var headerCol = (id = "simple-node") => {
    const headerColObj = (value, { rowIndex } = {}) => {
      const result = typeof value === "object" ? value.title : value;
      return {
        component: "th",
        children: React215.createElement("div", { id: `${id}${rowIndex}` }, result)
      };
    };
    return headerColObj;
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/classNames.js
  var visibilityModifiers = [
    "hidden",
    "hiddenOnSm",
    "hiddenOnMd",
    "hiddenOnLg",
    "hiddenOnXl",
    "hiddenOn_2xl",
    "visibleOnSm",
    "visibleOnMd",
    "visibleOnLg",
    "visibleOnXl",
    "visibleOn_2xl"
  ];
  var Visibility = visibilityModifiers.filter((key) => table_default.modifiers[key]).reduce((acc, curr) => {
    const key2 = curr.replace("_2xl", "2Xl");
    acc[key2] = table_default.modifiers[curr];
    return acc;
  }, {});
  var classNames = (...classes) => () => ({
    className: css(...classes)
  });

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/info.js
  var React216 = __toESM(require_react());
  var info = ({ tooltip, tooltipProps, popover, popoverProps, className, ariaLabel }) => {
    const infoObj = (value) => ({
      className: table_default.modifiers.help,
      children: tooltip ? React216.createElement(HeaderCellInfoWrapper, { variant: "tooltip", info: tooltip, tooltipProps, ariaLabel, className }, value) : React216.createElement(HeaderCellInfoWrapper, { variant: "popover", info: popover, popoverProps, ariaLabel, className }, value)
    });
    return infoObj;
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/favoritable.js
  var React218 = __toESM(require_react());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/FavoritesCell.js
  init_tslib_es6();
  var React217 = __toESM(require_react());
  var FavoritesCell = (_a) => {
    var { className = "", onFavorite, isFavorited, rowIndex } = _a, props = __rest(_a, ["className", "onFavorite", "isFavorited", "rowIndex"]);
    const ariaProps = rowIndex === void 0 ? {} : {
      id: `favorites-button-${rowIndex}`,
      "aria-labelledby": `favorites-button-${rowIndex}`
    };
    return React217.createElement(
      Button,
      Object.assign({ variant: "plain", className, type: "button", "aria-label": isFavorited ? "Starred" : "Not starred", onClick: onFavorite }, ariaProps, props),
      React217.createElement(star_icon_default, { "aria-hidden": true })
    );
  };
  FavoritesCell.displayName = "FavoritesCell";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/favoritable.js
  var favoritable = (value, { rowIndex, columnIndex, rowData, column, property: property3 }) => {
    const { extraParams: { onFavorite } } = column;
    const extraData = {
      rowIndex,
      columnIndex,
      column,
      property: property3
    };
    if (rowData && rowData.hasOwnProperty("parent") && !rowData.fullWidth) {
      return {
        component: "td",
        isVisible: true
      };
    }
    function favoritesClick(event) {
      onFavorite && onFavorite(event, rowData && !rowData.favorited, rowIndex, rowData, extraData);
    }
    const additionalProps = rowData.favoritesProps || {};
    return {
      className: css(table_default.tableFavorite, rowData && rowData.favorited && table_default.modifiers.favorited),
      isVisible: !rowData || !rowData.fullWidth,
      children: React218.createElement(FavoritesCell, Object.assign({ rowIndex, onFavorite: favoritesClick, isFavorited: rowData && rowData.favorited }, additionalProps))
    };
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/treeRow.js
  var React219 = __toESM(require_react());
  var treeRow = (onCollapse, onCheckChange, onToggleRowDetails) => (value, { rowIndex, rowData }) => {
    const { isExpanded, isDetailsExpanded, "aria-level": level, "aria-setsize": setsize, toggleAriaLabel, checkAriaLabel, showDetailsAriaLabel, isChecked, checkboxId, icon } = rowData.props;
    const content = value.title || value;
    const text = React219.createElement(
      "div",
      { className: css(table_tree_view_default.tableTreeViewText), key: "tree-view-text" },
      icon && React219.createElement("span", { className: css(table_tree_view_default.tableTreeViewIcon), key: "tree-view-text-icon" }, icon),
      React219.createElement("span", { className: table_default.tableText, key: "table-text" }, content)
    );
    const onChange = (isChecked2, event) => {
      onCheckChange(event, isChecked2, rowIndex, content, rowData);
    };
    return {
      component: "th",
      className: table_tree_view_default.tableTreeViewTitleCell,
      children: level !== void 0 ? React219.createElement(
        "div",
        { className: css(table_tree_view_default.tableTreeViewMain) },
        setsize > 0 && React219.createElement(
          "span",
          { className: css(table_tree_view_default.tableToggle), key: "table-toggle" },
          React219.createElement(
            Button,
            { variant: "plain", onClick: (event) => onCollapse && onCollapse(event, rowIndex, content, rowData), className: css(isExpanded && table_default.modifiers.expanded), "aria-expanded": isExpanded, "aria-label": toggleAriaLabel || `${isExpanded ? "Collapse" : "Expand"} row ${rowIndex}` },
            React219.createElement(
              "div",
              { className: css(table_tree_view_default.tableToggleIcon) },
              React219.createElement(angle_down_icon_default, { "aria-hidden": "true" })
            )
          )
        ),
        !!onCheckChange && React219.createElement(
          "span",
          { className: css(table_tree_view_default.tableCheck), key: "table-check" },
          React219.createElement(
            "label",
            { htmlFor: checkboxId || `checkbox_${rowIndex}` },
            React219.createElement(Checkbox, { id: checkboxId || `checkbox_${rowIndex}`, "aria-label": checkAriaLabel || `Row ${rowIndex} checkbox`, isChecked, onChange: (event, checked) => onChange(checked, event) })
          )
        ),
        text,
        !!onToggleRowDetails && React219.createElement(
          "span",
          { className: css(table_tree_view_default.tableTreeViewDetailsToggle), key: "view-details-toggle" },
          React219.createElement(
            Button,
            { variant: "plain", "aria-expanded": isDetailsExpanded, "aria-label": showDetailsAriaLabel || "Show row details", onClick: (event) => onToggleRowDetails && onToggleRowDetails(event, rowIndex, content, rowData) },
            React219.createElement(
              "span",
              { className: `${table_default.table}__details-toggle-icon` },
              React219.createElement(ellipsis_h_icon_default, { "aria-hidden": true })
            )
          )
        )
      ) : text
    };
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/TableTypes.js
  var TableGridBreakpoint;
  (function(TableGridBreakpoint2) {
    TableGridBreakpoint2["none"] = "";
    TableGridBreakpoint2["grid"] = "grid";
    TableGridBreakpoint2["gridMd"] = "grid-md";
    TableGridBreakpoint2["gridLg"] = "grid-lg";
    TableGridBreakpoint2["gridXl"] = "grid-xl";
    TableGridBreakpoint2["grid2xl"] = "grid-2xl";
  })(TableGridBreakpoint || (TableGridBreakpoint = {}));
  var TableVariant;
  (function(TableVariant2) {
    TableVariant2["compact"] = "compact";
  })(TableVariant || (TableVariant = {}));

  // node_modules/@patternfly/react-table/dist/esm/components/Table/Table.js
  var TableContext = React220.createContext({
    registerSelectableRow: () => {
    }
  });
  var TableBase = (_a) => {
    var _b, _c;
    var {
      children,
      className,
      variant,
      borders = true,
      isStickyHeader = false,
      gridBreakPoint = TableGridBreakpoint.gridMd,
      "aria-label": ariaLabel,
      role = "grid",
      innerRef,
      ouiaId,
      ouiaSafe = true,
      isTreeTable = false,
      isNested = false,
      isStriped = false,
      isExpandable = false,
      hasNoInset = false,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      nestedHeaderColumnSpans,
      selectableRowCaptionText
    } = _a, props = __rest(_a, ["children", "className", "variant", "borders", "isStickyHeader", "gridBreakPoint", "aria-label", "role", "innerRef", "ouiaId", "ouiaSafe", "isTreeTable", "isNested", "isStriped", "isExpandable", "hasNoInset", "nestedHeaderColumnSpans", "selectableRowCaptionText"]);
    const ref = React220.useRef(null);
    const tableRef = innerRef || ref;
    const [hasSelectableRows, setHasSelectableRows] = React220.useState(false);
    const [tableCaption, setTableCaption] = React220.useState();
    React220.useEffect(() => {
      document.addEventListener("keydown", handleKeys);
      if (tableRef && tableRef.current && tableRef.current.classList.contains("pf-m-tree-view")) {
        const tbody = tableRef.current.querySelector("tbody");
        tbody && setTabIndex(Array.from(tbody.querySelectorAll("button, a, input")));
      }
      return function cleanup() {
        document.removeEventListener("keydown", handleKeys);
      };
    }, [tableRef, tableRef.current]);
    React220.useEffect(() => {
      if (selectableRowCaptionText) {
        setTableCaption(React220.createElement(
          "caption",
          null,
          selectableRowCaptionText,
          React220.createElement("div", { className: "pf-v5-screen-reader" }, "This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space or enter.")
        ));
      } else {
        setTableCaption(React220.createElement("caption", { className: "pf-v5-screen-reader" }, "This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space or enter."));
      }
    }, [selectableRowCaptionText]);
    const ouiaProps = useOUIAProps("Table", ouiaId, ouiaSafe);
    const grid = (_b = table_grid_default.modifiers) === null || _b === void 0 ? void 0 : _b[toCamel2(gridBreakPoint || "").replace(/-?2xl/, "_2xl")];
    const breakPointPrefix = `treeView${gridBreakPoint.charAt(0).toUpperCase() + gridBreakPoint.slice(1)}`;
    const treeGrid = (_c = table_tree_view_default.modifiers) === null || _c === void 0 ? void 0 : _c[toCamel2(breakPointPrefix || "").replace(/-?2xl/, "_2xl")];
    const handleKeys = (event) => {
      if (isNested || !(tableRef && tableRef.current && tableRef.current.classList.contains(table_tree_view_default.modifiers.treeView)) || // implements roving tab-index to tree tables only
      tableRef && tableRef.current !== event.target.closest(`.${table_default.table}:not(.pf-m-nested)`)) {
        return;
      }
      const activeElement = document.activeElement;
      const key = event.key;
      const rows = Array.from(tableRef.current.querySelectorAll("tbody tr")).filter((el) => !el.classList.contains("pf-m-disabled") && !el.hidden);
      if (key === "Space" || key === "Enter") {
        activeElement.click();
        event.preventDefault();
      }
      const getFocusableElement = (element) => element.querySelectorAll("button:not(:disabled), input:not(:disabled), a:not(:disabled)")[0];
      handleArrows(event, rows, (element) => element === activeElement.closest("tr"), getFocusableElement, ["button", "input", "a"], void 0, false, true, false);
    };
    const registerSelectableRow = () => {
      !hasSelectableRows && setHasSelectableRows(true);
    };
    return React220.createElement(
      TableContext.Provider,
      { value: { registerSelectableRow } },
      React220.createElement(
        "table",
        Object.assign({ "aria-label": ariaLabel, role, className: css(className, table_default.table, isTreeTable ? treeGrid : grid, table_default.modifiers[variant], !borders && table_default.modifiers.noBorderRows, isStickyHeader && table_default.modifiers.stickyHeader, isTreeTable && table_tree_view_default.modifiers.treeView, isStriped && table_default.modifiers.striped, isExpandable && table_default.modifiers.expandable, hasNoInset && table_tree_view_default.modifiers.noInset, isNested && "pf-m-nested"), ref: tableRef }, isTreeTable && { role: "treegrid" }, ouiaProps, props),
        hasSelectableRows && tableCaption,
        children
      )
    );
  };
  var Table = React220.forwardRef((props, ref) => React220.createElement(TableBase, Object.assign({}, props, { innerRef: ref })));
  Table.displayName = "Table";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/Tr.js
  var TrBase = (_a) => {
    var { children, className, isExpanded, isEditable, isHidden: isHidden3 = false, isClickable = false, isRowSelected = false, isStriped = false, isBorderRow = false, isControlRow = false, innerRef, ouiaId, ouiaSafe = true, resetOffset = false, onRowClick, isSelectable, "aria-label": passedAriaLabel } = _a, props = __rest(_a, ["children", "className", "isExpanded", "isEditable", "isHidden", "isClickable", "isRowSelected", "isStriped", "isBorderRow", "isControlRow", "innerRef", "ouiaId", "ouiaSafe", "resetOffset", "onRowClick", "isSelectable", "aria-label"]);
    const ouiaProps = useOUIAProps("TableRow", ouiaId, ouiaSafe);
    const [computedAriaLabel, setComputedAriaLabel] = React221.useState("");
    let onKeyDown = null;
    if (onRowClick) {
      onKeyDown = (e) => {
        if (e.key === "Enter" || e.key === " ") {
          onRowClick(e);
          e.preventDefault();
        }
      };
    }
    const rowIsHidden = isHidden3 || isExpanded !== void 0 && !isExpanded;
    const { registerSelectableRow } = React221.useContext(TableContext);
    React221.useEffect(() => {
      if (isSelectable && !rowIsHidden) {
        setComputedAriaLabel(`${isRowSelected ? "Row selected" : ""}`);
        registerSelectableRow();
      } else {
        setComputedAriaLabel(void 0);
      }
    }, [isRowSelected, isSelectable, registerSelectableRow, rowIsHidden]);
    const ariaLabel = passedAriaLabel || computedAriaLabel;
    return React221.createElement(
      React221.Fragment,
      null,
      React221.createElement("tr", Object.assign({ className: css(table_default.tableTr, className, isExpanded !== void 0 && table_default.tableExpandableRow, isExpanded && table_default.modifiers.expanded, isEditable && inline_edit_default.modifiers.inlineEditable, isClickable && table_default.modifiers.clickable, isRowSelected && table_default.modifiers.selected, isStriped && table_default.modifiers.striped, isBorderRow && table_default.modifiers.borderRow, isControlRow && table_default.tableControlRow, resetOffset && table_default.modifiers.firstCellOffsetReset), hidden: rowIsHidden }, isClickable && { tabIndex: 0 }, { "aria-label": ariaLabel, ref: innerRef }, onRowClick && { onClick: onRowClick, onKeyDown }, ouiaProps, props), children)
    );
  };
  var Tr = React221.forwardRef((props, ref) => React221.createElement(TrBase, Object.assign({}, props, { innerRef: ref })));
  Tr.displayName = "Tr";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/Thead.js
  init_tslib_es6();
  var React222 = __toESM(require_react());
  var TheadBase = (_a) => {
    var { children, className, noWrap = false, innerRef, hasNestedHeader } = _a, props = __rest(_a, ["children", "className", "noWrap", "innerRef", "hasNestedHeader"]);
    return React222.createElement("thead", Object.assign({ className: css(table_default.tableThead, className, noWrap && table_default.modifiers.nowrap, hasNestedHeader && table_default.modifiers.nestedColumnHeader), ref: innerRef }, props), children);
  };
  var Thead = React222.forwardRef((props, ref) => React222.createElement(TheadBase, Object.assign({}, props, { innerRef: ref })));
  Thead.displayName = "Thead";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/Tbody.js
  init_tslib_es6();
  var React223 = __toESM(require_react());
  var TbodyBase = (_a) => {
    var { children, className, isExpanded, innerRef, isEvenStriped = false, isOddStriped = false } = _a, props = __rest(_a, ["children", "className", "isExpanded", "innerRef", "isEvenStriped", "isOddStriped"]);
    return React223.createElement("tbody", Object.assign({ role: "rowgroup", className: css(table_default.tableTbody, className, isExpanded && table_default.modifiers.expanded, isOddStriped && table_default.modifiers.striped, isEvenStriped && table_default.modifiers.stripedEven), ref: innerRef }, props), children);
  };
  var Tbody = React223.forwardRef((props, ref) => React223.createElement(TbodyBase, Object.assign({}, props, { innerRef: ref })));
  Tbody.displayName = "Tbody";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/Th.js
  init_tslib_es6();
  var React225 = __toESM(require_react());

  // node_modules/@patternfly/react-styles/css/components/Table/table-scrollable.mjs
  var table_scrollable_default = {
    "modifiers": {
      "borderRight": "pf-m-border-right",
      "borderLeft": "pf-m-border-left",
      "right": "pf-m-right",
      "inlineEnd": "pf-m-inline-end",
      "left": "pf-m-left",
      "inlineStart": "pf-m-inline-start"
    },
    "scrollInnerWrapper": "pf-v5-c-scroll-inner-wrapper",
    "scrollOuterWrapper": "pf-v5-c-scroll-outer-wrapper",
    "table": "pf-v5-c-table",
    "tableStickyCell": "pf-v5-c-table__sticky-cell"
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/base/merge-props.js
  var React224 = __toESM(require_react());
  var import_mergeWith = __toESM(require_mergeWith());
  function mergeProps(...props) {
    const firstProps = props[0];
    const restProps = props.slice(1);
    if (!restProps.length) {
      return (0, import_mergeWith.default)({}, firstProps);
    }
    return (0, import_mergeWith.default)((0, import_mergeWith.default)({}, firstProps), ...restProps, (a2, b, key) => {
      if (key === "children") {
        if (a2 && b) {
          return React224.cloneElement(a2, {
            children: b
          });
        }
        return Object.assign(Object.assign({}, b), a2);
      }
      if (key === "className") {
        return css(a2, b);
      }
      return void 0;
    });
  }

  // node_modules/@patternfly/react-tokens/dist/esm/c_table__sticky_cell_MinWidth.js
  var c_table__sticky_cell_MinWidth = {
    "name": "--pf-v5-c-table__sticky-cell--MinWidth",
    "value": "12.5rem",
    "var": "var(--pf-v5-c-table__sticky-cell--MinWidth)"
  };
  var c_table_sticky_cell_MinWidth_default = c_table__sticky_cell_MinWidth;

  // node_modules/@patternfly/react-tokens/dist/esm/c_table__sticky_cell_Left.js
  var c_table__sticky_cell_Left = {
    "name": "--pf-v5-c-table__sticky-cell--Left",
    "value": "0",
    "var": "var(--pf-v5-c-table__sticky-cell--Left)"
  };
  var c_table_sticky_cell_Left_default = c_table__sticky_cell_Left;

  // node_modules/@patternfly/react-tokens/dist/esm/c_table__sticky_cell_Right.js
  var c_table__sticky_cell_Right = {
    "name": "--pf-v5-c-table__sticky-cell--Right",
    "value": "0",
    "var": "var(--pf-v5-c-table__sticky-cell--Right)"
  };
  var c_table_sticky_cell_Right_default = c_table__sticky_cell_Right;

  // node_modules/@patternfly/react-table/dist/esm/components/Table/Th.js
  var ThBase = (_a) => {
    var { children, className, component = "th", dataLabel, scope = "col", textCenter = false, sort = null, modifier, select = null, expand: collapse = null, tooltip = "", tooltipProps, onMouseEnter: onMouseEnterProp = () => {
    }, width, visibility, innerRef, info: infoProps, isStickyColumn = false, hasRightBorder = false, hasLeftBorder = false, stickyMinWidth = "120px", stickyLeftOffset, stickyRightOffset, isSubheader = false, screenReaderText, "aria-label": ariaLabel } = _a, props = __rest(_a, ["children", "className", "component", "dataLabel", "scope", "textCenter", "sort", "modifier", "select", "expand", "tooltip", "tooltipProps", "onMouseEnter", "width", "visibility", "innerRef", "info", "isStickyColumn", "hasRightBorder", "hasLeftBorder", "stickyMinWidth", "stickyLeftOffset", "stickyRightOffset", "isSubheader", "screenReaderText", "aria-label"]);
    if (!children && !screenReaderText && !ariaLabel) {
      console.warn("Th: Table headers must have an accessible name. If the Th is intended to be visually empty, pass in screenReaderText. If the Th contains only non-text, interactive content such as a checkbox or expand toggle, pass in an aria-label.");
    }
    const [showTooltip, setShowTooltip] = React225.useState(false);
    const [truncated, setTruncated] = React225.useState(false);
    const cellRef = innerRef ? innerRef : React225.createRef();
    const onMouseEnter = (event) => {
      if (event.target.offsetWidth < event.target.scrollWidth) {
        !showTooltip && setShowTooltip(true);
      } else {
        showTooltip && setShowTooltip(false);
      }
      onMouseEnterProp(event);
    };
    let sortParams = null;
    if (sort) {
      if (sort.isFavorites) {
        sortParams = sortableFavorites({
          onSort: sort === null || sort === void 0 ? void 0 : sort.onSort,
          columnIndex: sort.columnIndex,
          sortBy: sort.sortBy,
          tooltip,
          tooltipProps
        })();
      } else {
        sortParams = sortable(children, {
          columnIndex: sort.columnIndex,
          column: {
            extraParams: {
              sortBy: sort.sortBy,
              onSort: sort === null || sort === void 0 ? void 0 : sort.onSort
            }
          },
          tooltip,
          tooltipProps
        });
      }
    }
    const selectParams = select ? selectable(children, {
      rowData: {
        selected: select.isSelected,
        disableSelection: select === null || select === void 0 ? void 0 : select.isDisabled,
        props: select === null || select === void 0 ? void 0 : select.props
      },
      column: {
        extraParams: {
          onSelect: select === null || select === void 0 ? void 0 : select.onSelect,
          selectVariant: "checkbox",
          allRowsSelected: select.isSelected,
          isHeaderSelectDisabled: !!select.isHeaderSelectDisabled
        }
      },
      tooltip,
      tooltipProps
    }) : null;
    const collapseParams = collapse ? collapsible(children, {
      column: {
        extraParams: {
          onCollapse: collapse === null || collapse === void 0 ? void 0 : collapse.onToggle,
          allRowsExpanded: !collapse.areAllExpanded,
          collapseAllAriaLabel: ""
        }
      }
    }) : null;
    const widthParams = width ? cellWidth(width)() : null;
    const visibilityParams = visibility ? classNames(...visibility.map((vis) => Visibility[vis]))() : null;
    let transformedChildren = (sortParams === null || sortParams === void 0 ? void 0 : sortParams.children) || (selectParams === null || selectParams === void 0 ? void 0 : selectParams.children) || (collapseParams === null || collapseParams === void 0 ? void 0 : collapseParams.children) || children;
    let infoParams = null;
    if (infoProps) {
      infoParams = info(infoProps)(transformedChildren);
      transformedChildren = infoParams.children;
    }
    const merged = mergeProps(sortParams, selectParams, collapseParams, widthParams, visibilityParams, infoParams);
    const {
      // ignore the merged children since we transform them ourselves so we can wrap it with info
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      children: mergedChildren = null,
      // selectable adds this but we don't want it
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      isVisible = null,
      className: mergedClassName = "",
      component: MergedComponent = component
    } = merged, mergedProps = __rest(merged, ["children", "isVisible", "className", "component"]);
    React225.useEffect(() => {
      setTruncated(cellRef.current.offsetWidth < cellRef.current.scrollWidth);
    }, [cellRef]);
    const cell = React225.createElement(MergedComponent, Object.assign({ tabIndex: sort || select || !truncated ? -1 : 0, onFocus: tooltip !== null ? onMouseEnter : onMouseEnterProp, onBlur: () => setShowTooltip(false), "data-label": dataLabel, onMouseEnter: tooltip !== null ? onMouseEnter : onMouseEnterProp, scope: component === "th" ? scope : null, ref: cellRef, "aria-label": ariaLabel, className: css(table_default.tableTh, className, textCenter && table_default.modifiers.center, isSubheader && table_default.tableSubhead, isStickyColumn && table_scrollable_default.tableStickyCell, hasRightBorder && table_scrollable_default.modifiers.borderRight, hasLeftBorder && table_scrollable_default.modifiers.borderLeft, modifier && table_default.modifiers[modifier], mergedClassName) }, mergedProps, props, isStickyColumn && {
      style: Object.assign({ [c_table_sticky_cell_MinWidth_default.name]: stickyMinWidth ? stickyMinWidth : void 0, [c_table_sticky_cell_Left_default.name]: stickyLeftOffset ? stickyLeftOffset : 0, [c_table_sticky_cell_Right_default.name]: stickyRightOffset ? stickyRightOffset : 0 }, props.style)
    }), transformedChildren || screenReaderText && React225.createElement("span", { className: "pf-v5-screen-reader" }, screenReaderText));
    const canMakeDefaultTooltip = tooltip === "" ? typeof transformedChildren === "string" : true;
    const childControlsTooltip = sortParams || selectParams;
    return tooltip !== null && canMakeDefaultTooltip && !childControlsTooltip && showTooltip ? React225.createElement(
      React225.Fragment,
      null,
      cell,
      React225.createElement(Tooltip, Object.assign({ triggerRef: cellRef, content: tooltip || tooltip === "" && children, isVisible: true }, tooltipProps))
    ) : cell;
  };
  var Th = React225.forwardRef((props, ref) => React225.createElement(ThBase, Object.assign({}, props, { innerRef: ref })));
  Th.displayName = "Th";

  // node_modules/@patternfly/react-table/dist/esm/components/Table/Td.js
  init_tslib_es6();
  var React227 = __toESM(require_react());

  // node_modules/@patternfly/react-table/dist/esm/components/Table/utils/decorators/draggable.js
  var React226 = __toESM(require_react());
  var draggable = (value, { rowData }) => {
    const { id } = rowData;
    return {
      className: "",
      children: React226.createElement(DraggableCell, { id })
    };
  };

  // node_modules/@patternfly/react-table/dist/esm/components/Table/Td.js
  var TdBase = (_a) => {
    var { children, className, isActionCell = false, component = "td", dataLabel, textCenter = false, modifier, select = null, actions = null, expand = null, treeRow: treeRowProp = null, compoundExpand: compoundExpandProp = null, noPadding, width, visibility, innerRef, favorites = null, draggableRow: draggableRowProp = null, tooltip = "", onMouseEnter: onMouseEnterProp = () => {
    }, isStickyColumn = false, hasRightBorder = false, hasLeftBorder = false, stickyMinWidth = "120px", stickyLeftOffset, stickyRightOffset } = _a, props = __rest(_a, ["children", "className", "isActionCell", "component", "dataLabel", "textCenter", "modifier", "select", "actions", "expand", "treeRow", "compoundExpand", "noPadding", "width", "visibility", "innerRef", "favorites", "draggableRow", "tooltip", "onMouseEnter", "isStickyColumn", "hasRightBorder", "hasLeftBorder", "stickyMinWidth", "stickyLeftOffset", "stickyRightOffset"]);
    const [showTooltip, setShowTooltip] = React227.useState(false);
    const [truncated, setTruncated] = React227.useState(false);
    const cellRef = innerRef ? innerRef : React227.createRef();
    const onMouseEnter = (event) => {
      if (event.target.offsetWidth < event.target.scrollWidth) {
        !showTooltip && setShowTooltip(true);
      } else {
        showTooltip && setShowTooltip(false);
      }
      onMouseEnterProp(event);
    };
    const selectParams = select ? selectable(children, {
      rowIndex: select.rowIndex,
      rowData: {
        selected: select.isSelected,
        disableSelection: select === null || select === void 0 ? void 0 : select.isDisabled,
        props: select === null || select === void 0 ? void 0 : select.props
      },
      column: {
        extraParams: {
          onSelect: select === null || select === void 0 ? void 0 : select.onSelect,
          selectVariant: select.variant || "checkbox"
        }
      }
    }) : null;
    const favoriteParams = favorites ? favoritable(null, {
      rowIndex: favorites === null || favorites === void 0 ? void 0 : favorites.rowIndex,
      rowData: {
        favorited: favorites.isFavorited,
        favoritesProps: favorites === null || favorites === void 0 ? void 0 : favorites.props
      },
      column: {
        extraParams: {
          onFavorite: favorites === null || favorites === void 0 ? void 0 : favorites.onFavorite
        }
      }
    }) : null;
    const draggableParams = draggableRowProp !== null ? draggable(null, {
      rowData: {
        id: draggableRowProp.id
      }
    }) : null;
    const actionParamsFunc = actions ? cellActions(actions.items, null, null) : null;
    const actionParams = actionParamsFunc ? actionParamsFunc(null, {
      rowIndex: actions === null || actions === void 0 ? void 0 : actions.rowIndex,
      rowData: {
        disableActions: actions === null || actions === void 0 ? void 0 : actions.isDisabled
      },
      column: {
        extraParams: {
          dropdownPosition: actions === null || actions === void 0 ? void 0 : actions.dropdownPosition,
          dropdownDirection: actions === null || actions === void 0 ? void 0 : actions.dropdownDirection,
          menuAppendTo: actions === null || actions === void 0 ? void 0 : actions.menuAppendTo,
          actionsToggle: actions === null || actions === void 0 ? void 0 : actions.actionsToggle
        }
      }
    }) : null;
    const expandableParams = expand !== null ? collapsible(null, {
      rowIndex: expand.rowIndex,
      columnIndex: expand === null || expand === void 0 ? void 0 : expand.columnIndex,
      rowData: {
        isOpen: expand.isExpanded
      },
      column: {
        extraParams: {
          onCollapse: expand === null || expand === void 0 ? void 0 : expand.onToggle,
          expandId: expand === null || expand === void 0 ? void 0 : expand.expandId
        }
      }
    }) : null;
    const compoundParams = compoundExpandProp !== null ? compoundExpand({
      title: children,
      props: {
        isOpen: compoundExpandProp.isExpanded
      }
    }, {
      rowIndex: compoundExpandProp === null || compoundExpandProp === void 0 ? void 0 : compoundExpandProp.rowIndex,
      columnIndex: compoundExpandProp === null || compoundExpandProp === void 0 ? void 0 : compoundExpandProp.columnIndex,
      column: {
        extraParams: {
          onExpand: compoundExpandProp === null || compoundExpandProp === void 0 ? void 0 : compoundExpandProp.onToggle,
          expandId: compoundExpandProp === null || compoundExpandProp === void 0 ? void 0 : compoundExpandProp.expandId
        }
      }
    }) : null;
    const widthParams = width ? cellWidth(width)() : null;
    const visibilityParams = visibility ? classNames(...visibility.map((vis) => Visibility[vis]))() : null;
    const treeRowParams = treeRowProp !== null ? treeRow(treeRowProp.onCollapse, treeRowProp.onCheckChange, treeRowProp.onToggleRowDetails)({
      title: children
    }, {
      rowIndex: treeRowProp.rowIndex,
      rowData: {
        props: treeRowProp.props
      }
    }) : null;
    const merged = mergeProps(selectParams, actionParams, expandableParams, compoundParams, widthParams, visibilityParams, favoriteParams, treeRowParams, draggableParams);
    const {
      // selectable adds this but we don't want it
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      isVisible = null,
      children: mergedChildren = null,
      className: mergedClassName = "",
      component: MergedComponent = component
    } = merged, mergedProps = __rest(merged, ["isVisible", "children", "className", "component"]);
    const treeTableTitleCell = className && className.includes(table_tree_view_default.tableTreeViewTitleCell) || mergedClassName && mergedClassName.includes(table_tree_view_default.tableTreeViewTitleCell);
    React227.useEffect(() => {
      setTruncated(cellRef.current.offsetWidth < cellRef.current.scrollWidth);
    }, [cellRef]);
    const cell = React227.createElement(MergedComponent, Object.assign({ tabIndex: (select || !truncated) && modifier !== "truncate" ? -1 : 0 }, !treeTableTitleCell && { "data-label": dataLabel }, { onFocus: tooltip !== null ? onMouseEnter : onMouseEnterProp, onBlur: () => setShowTooltip(false), onMouseEnter: tooltip !== null ? onMouseEnter : onMouseEnterProp, className: css(table_default.tableTd, className, isActionCell && table_default.tableAction, textCenter && table_default.modifiers.center, noPadding && table_default.modifiers.noPadding, isStickyColumn && table_scrollable_default.tableStickyCell, hasRightBorder && table_scrollable_default.modifiers.borderRight, hasLeftBorder && table_scrollable_default.modifiers.borderLeft, table_default.modifiers[modifier], draggableParams && table_default.tableDraggable, mergedClassName), ref: cellRef }, mergedProps, props, isStickyColumn && {
      style: Object.assign({ [c_table_sticky_cell_MinWidth_default.name]: stickyMinWidth ? stickyMinWidth : void 0, [c_table_sticky_cell_Left_default.name]: stickyLeftOffset ? stickyLeftOffset : 0, [c_table_sticky_cell_Right_default.name]: stickyRightOffset ? stickyRightOffset : 0 }, props.style)
    }), mergedChildren || children);
    const canMakeDefaultTooltip = tooltip === "" ? typeof children === "string" : true;
    return tooltip !== null && canMakeDefaultTooltip && showTooltip ? React227.createElement(
      React227.Fragment,
      null,
      cell,
      React227.createElement(Tooltip, { triggerRef: cellRef, content: tooltip || tooltip === "" && children, isVisible: true })
    ) : cell;
  };
  var Td = React227.forwardRef((props, ref) => React227.createElement(TdBase, Object.assign({}, props, { innerRef: ref })));
  Td.displayName = "Td";

  // src/lib/plugins/pluginTables.jsx
  var import_prop_types3 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
  var _3 = cockpit_default.gettext;
  var PluginTable = class extends import_react18.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _3("Plugin Name"), sortable: true },
          { title: _3("Plugin Type"), sortable: true },
          { title: _3("Enabled"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    handleCollapse(_event, rowIndex, isExpanding) {
      const rows = [...this.state.rows];
      const index = this.state.perPage * (this.state.page - 1) + rowIndex;
      rows[index].isOpen = isExpanding;
      this.setState({ rows });
    }
    handleSort(_event, columnIndex, direction) {
      const rows = [...this.state.rows];
      rows.sort((a2, b) => a2.cells[columnIndex].content > b.cells[columnIndex].content ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        rows.reverse();
      }
      this.setState({
        sortBy: {
          index: columnIndex,
          direction
        },
        rows,
        page: 1
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      for (const row of this.props.rows) {
        const val = value.toLowerCase();
        if (val !== "" && row.cn[0].toLowerCase().indexOf(val) === -1 && row["nsslapd-pluginType"][0].toLowerCase().indexOf(val) === -1) {
          continue;
        }
        rows.push({
          isOpen: false,
          cells: [
            { content: row.cn[0] },
            { content: row["nsslapd-pluginType"][0] },
            { content: row["nsslapd-pluginEnabled"][0] }
          ],
          originalData: row
        });
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    getExpandedRow(rowData) {
      const dependsType = rowData["nsslapd-plugin-depends-on-type"] === void 0 ? "" : rowData["nsslapd-plugin-depends-on-type"].join(", ");
      const dependsNamed = rowData["nsslapd-plugin-depends-on-named"] === void 0 ? "" : rowData["nsslapd-plugin-depends-on-named"].join(", ");
      const precedence = rowData["nsslapd-pluginprecedence"] === void 0 ? "" : rowData["nsslapd-pluginprecedence"][0];
      const plugin_enabled = rowData["nsslapd-pluginEnabled"][0] === "on";
      const plugin_name = rowData.cn[0];
      const enabled = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { children: _3("Plugin is enabled") });
      const disabled = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { children: _3("Plugin is disabled") });
      return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Grid, { className: "ds-left-indent-xlg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("b", { children: _3("Plugin Description:") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { children: rowData["nsslapd-pluginDescription"][0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("b", { children: _3("Plugin Path:") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { children: rowData["nsslapd-pluginPath"][0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("b", { children: _3("Plugin Init Function:") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { children: rowData["nsslapd-pluginInitfunc"][0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("b", { children: _3("Plugin ID:") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { children: rowData["nsslapd-pluginId"][0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("b", { children: _3("Plugin Vendor:") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { children: rowData["nsslapd-pluginVendor"][0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("b", { children: _3("Plugin Version:") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { children: rowData["nsslapd-pluginVersion"][0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("b", { children: _3("Plugin Depends On Named:") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { children: dependsNamed }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("b", { children: _3("Plugin Depends On Type:") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { children: dependsType }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("b", { children: _3("Plugin Precedence:") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { children: precedence }) }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(GridItem, { span: 12, className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          Switch,
          {
            id: plugin_name,
            label: enabled,
            labelOff: disabled,
            isChecked: plugin_enabled,
            onChange: () => {
              this.props.showConfirmToggle(plugin_name, plugin_enabled);
            }
          },
          plugin_name
        ) })
      ] });
    }
    componentDidMount() {
      const rows = [];
      for (const row of this.props.rows) {
        rows.push({
          isOpen: false,
          cells: [
            { content: row.cn[0] },
            { content: row["nsslapd-pluginType"][0] },
            { content: row["nsslapd-pluginEnabled"][0] }
          ],
          originalData: row
        });
      }
      this.setState({
        rows
      });
    }
    render() {
      const { perPage, page, sortBy, rows, columns } = this.state;
      const startIdx = perPage * page - perPage;
      const tableRows = rows.slice(startIdx, startIdx + perPage);
      return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: this.state.toggleSpinning ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          SearchInput,
          {
            placeholder: _3("Search Plugins"),
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
          Table,
          {
            "aria-label": "all plugins table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Th, { screenReaderText: "Row expansion" }),
                columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy,
                      onSort: this.handleSort,
                      columnIndex
                    } : void 0,
                    children: column.title
                  },
                  columnIndex
                ))
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react18.default.Fragment, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                    Td,
                    {
                      expand: {
                        rowIndex,
                        isExpanded: row.isOpen,
                        onToggle: () => this.handleCollapse(null, rowIndex, !row.isOpen)
                      }
                    }
                  ),
                  row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell.content }, cellIndex))
                ] }),
                row.isOpen && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tr, { isExpanded: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { colSpan: columns.length + 1, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ExpandableRowContent, { children: this.getExpandedRow(row.originalData) }) }) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          Pagination,
          {
            itemCount: rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  PluginTable.propTypes = {
    rows: import_prop_types3.default.array
  };
  PluginTable.defaultProps = {
    rows: []
  };
  var AttrUniqConfigTable = class extends import_react18.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _3("Edit Config"),
          onClick: () => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: _3("Delete Config"),
          onClick: () => this.props.deleteConfig(rowData[0])
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _3("Config Name"), sortable: true },
          { title: _3("Attribute"), sortable: true },
          { title: _3("Enabled"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = this.props.rows.map((row) => [
        row.cn[0],
        row["uniqueness-attribute-name"].join(", "),
        row["nsslapd-pluginenabled"][0]
      ]);
      this.setState({ rows });
    }
    handleSort(_event, index, direction) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      if (val === "") {
        rows = this.props.rows.map((row) => [
          row.cn[0],
          row["uniqueness-attribute-name"].join(", "),
          row["nsslapd-pluginenabled"][0]
        ]);
      } else {
        rows = this.state.rows.filter(
          (row) => row[0].toLowerCase().includes(val) || row[1].toLowerCase().includes(val)
        );
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: _3("Attribute Uniqueness Configurations") }];
        tableRows = [{ cells: [_3("No Configurations")] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          SearchInput,
          {
            placeholder: _3("Search Configurations"),
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "attribute uniqueness config table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy: this.state.sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)) : row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActionsForRow(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage: this.state.perPage,
            page: this.state.page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  AttrUniqConfigTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  AttrUniqConfigTable.defaultProps = {
    rows: []
  };
  var LinkedAttributesTable = class extends import_react18.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _3("Edit Config"),
          onClick: () => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: _3("Delete Config"),
          onClick: () => this.props.deleteConfig(rowData[0])
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _3("Config Name"), sortable: true },
          { title: _3("Link Type"), sortable: true },
          { title: _3("Managed Type"), sortable: true },
          { title: _3("Link Scope"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = this.props.rows.map((row) => [
        row.cn?.[0] || "",
        row.linktype?.[0] || "",
        row.managedtype?.[0] || "",
        row.linkscope?.[0] || ""
      ]);
      this.setState({ rows });
    }
    handleSort(_event, index, direction) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      if (val === "") {
        rows = this.props.rows.map((row) => [
          row.cn?.[0] || "",
          row.linktype?.[0] || "",
          row.managedtype?.[0] || "",
          row.linkscope?.[0] || ""
        ]);
      } else {
        rows = this.state.rows.filter(
          (row) => row.some((cell) => cell.toLowerCase().includes(val))
        );
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: _3("Linked Attributes Configurations") }];
        tableRows = [{ cells: [_3("No Configurations")] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          SearchInput,
          {
            placeholder: _3("Search Configurations"),
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "linked attributes table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy: this.state.sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)) : row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActionsForRow(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage: this.state.perPage,
            page: this.state.page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  LinkedAttributesTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  LinkedAttributesTable.defaultProps = {
    rows: []
  };
  var DNATable = class extends import_react18.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _3("Edit Config"),
          onClick: () => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: _3("Delete Config"),
          onClick: () => this.props.deleteConfig(rowData[0])
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _3("Config Name"), sortable: true },
          { title: _3("Scope"), sortable: true },
          { title: _3("Filter"), sortable: true },
          { title: _3("Next Value"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = this.props.rows.map((row) => [
        row.cn?.[0] || "",
        row.dnascope?.[0] || "",
        row.dnafilter?.[0] || "",
        row.dnanextvalue?.[0] || ""
      ]);
      this.setState({ rows });
    }
    handleSort(_event, index, direction) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      if (val === "") {
        rows = this.props.rows.map((row) => [
          row.cn?.[0] || "",
          row.dnascope?.[0] || "",
          row.dnafilter?.[0] || "",
          row.dnanextvalue?.[0] || ""
        ]);
      } else {
        rows = this.state.rows.filter(
          (row) => row.some((cell) => cell.toLowerCase().includes(val))
        );
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: _3("DNA Configurations") }];
        tableRows = [{ cells: [_3("No Configurations")] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          SearchInput,
          {
            placeholder: _3("Search Configurations"),
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "dna table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy: this.state.sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)) : row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActionsForRow(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage: this.state.perPage,
            page: this.state.page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  DNATable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  DNATable.defaultProps = {
    rows: []
  };
  var DNASharedTable = class extends import_react18.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _3("Edit Config"),
          onClick: () => this.props.editConfig(`${rowData[0]}:${rowData[1]}`)
        },
        {
          isSeparator: true
        },
        {
          title: _3("Delete Config"),
          onClick: () => this.props.deleteConfig(`${rowData[0]}:${rowData[1]}`)
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _3("Hostname"), sortable: true },
          { title: _3("Port"), sortable: true },
          { title: _3("Remaining Values"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = this.props.rows.map((row) => [
        row.dnahostname[0],
        row.dnaportnum[0],
        row.dnaremainingvalues[0]
      ]);
      this.setState({ rows });
    }
    handleSort(_event, index, direction) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      if (val === "") {
        rows = this.props.rows.map((row) => [
          row.dnahostname[0],
          row.dnaportnum[0],
          row.dnaremainingvalues[0]
        ]);
      } else {
        rows = this.state.rows.filter(
          (row) => row.some((cell) => cell.toLowerCase().includes(val))
        );
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: _3("DNA Shared Configurations") }];
        tableRows = [{ cells: [_3("No Configurations")] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          SearchInput,
          {
            placeholder: _3("Search Shared Configurations"),
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "dna shared table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy: this.state.sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)) : row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActionsForRow(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage: this.state.perPage,
            page: this.state.page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  DNASharedTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  DNASharedTable.defaultProps = {
    rows: []
  };
  var AutoMembershipDefinitionTable = class extends import_react18.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _3("Edit Config"),
          onClick: () => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: _3("Delete Config"),
          onClick: () => this.props.deleteConfig(rowData[0])
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _3("Definition Name"), sortable: true },
          { title: _3("Default Group"), sortable: true },
          { title: _3("Scope"), sortable: true },
          { title: _3("Filter"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = this.props.rows.map((row) => [
        row.cn[0],
        "automemberdefaultgroup" in row ? row.automemberdefaultgroup[0] : "",
        row.automemberscope[0],
        row.automemberfilter[0]
      ]);
      this.setState({ rows });
    }
    handleSort(_event, index, direction) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      if (val === "") {
        rows = this.props.rows.map((row) => [
          row.cn[0],
          "automemberdefaultgroup" in row ? row.automemberdefaultgroup[0] : "",
          row.automemberscope[0],
          row.automemberfilter[0]
        ]);
      } else {
        rows = this.state.rows.filter(
          (row) => row.some((cell) => cell.toLowerCase().includes(val))
        );
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: _3("Automembership Definitions") }];
        tableRows = [{ cells: [_3("No Definitions")] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          SearchInput,
          {
            className: "ds-margin-top-lg",
            placeholder: _3("Search Definitions"),
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "automember def table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy: this.state.sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)) : row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActionsForRow(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage: this.state.perPage,
            page: this.state.page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  AutoMembershipDefinitionTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  AutoMembershipDefinitionTable.defaultProps = {
    rows: []
  };
  var AutoMembershipRegexTable = class extends import_react18.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _3("Edit Config"),
          onClick: () => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: _3("Delete Config"),
          onClick: () => this.props.deleteConfig(rowData[0])
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _3("Config Name"), sortable: true },
          { title: _3("Exclusive Regex"), sortable: true },
          { title: _3("Inclusive Regex"), sortable: true },
          { title: _3("Target Group"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = this.props.rows.map((row) => [
        row.cn[0],
        row.automemberexclusiveregex?.join(", ") || "",
        row.automemberinclusiveregex?.join(", ") || "",
        row.automembertargetgroup?.[0] || ""
      ]);
      this.setState({ rows });
    }
    handleSort(_event, index, direction) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      if (val === "") {
        rows = this.props.rows.map((row) => [
          row.cn[0],
          row.automemberexclusiveregex?.join(", ") || "",
          row.automemberinclusiveregex?.join(", ") || "",
          row.automembertargetgroup?.[0] || ""
        ]);
      } else {
        rows = this.state.rows.filter(
          (row) => row.some((cell) => cell.toLowerCase().includes(val))
        );
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: _3("Automembership Regular Expressions") }];
        tableRows = [{ cells: [_3("No regular expressions")] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          SearchInput,
          {
            className: "ds-margin-top-lg",
            placeholder: _3("Search Regular Expressions"),
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "automember regex table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy: this.state.sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)) : row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActionsForRow(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage: this.state.perPage,
            page: this.state.page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  AutoMembershipRegexTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  AutoMembershipRegexTable.defaultProps = {
    rows: []
  };
  var ManagedDefinitionTable = class extends import_react18.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _3("Edit Config"),
          onClick: () => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: _3("Delete Config"),
          onClick: () => this.props.deleteConfig(rowData[0])
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _3("Config Name"), sortable: true },
          { title: _3("Scope"), sortable: true },
          { title: _3("Filter"), sortable: true },
          { title: _3("Managed Base"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = this.props.rows.map((row) => [
        row.cn[0],
        row.originscope?.[0] || "",
        row.originfilter?.[0] || "",
        row.managedbase?.[0] || ""
      ]);
      this.setState({ rows });
    }
    handleSort(_event, index, direction) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      if (val === "") {
        rows = this.props.rows.map((row) => [
          row.cn[0],
          row.originscope?.[0] || "",
          row.originfilter?.[0] || "",
          row.managedbase?.[0] || ""
        ]);
      } else {
        rows = this.state.rows.filter(
          (row) => row.some((cell) => cell.toLowerCase().includes(val))
        );
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: _3("Managed Entry Definitions") }];
        tableRows = [{ cells: [_3("No definitions")] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          SearchInput,
          {
            className: "ds-margin-top-lg",
            placeholder: _3("Search Definitions"),
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "managed def table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy: this.state.sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)) : row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActionsForRow(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage: this.state.perPage,
            page: this.state.page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  ManagedDefinitionTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  ManagedDefinitionTable.defaultProps = {
    rows: []
  };
  var ManagedTemplateTable = class extends import_react18.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _3("Edit Config"),
          onClick: () => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: _3("Delete Config"),
          onClick: () => this.props.deleteConfig(rowData[0])
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _3("Template DN"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = this.props.rows.map((row) => [row.entrydn[0]]);
      this.setState({ rows });
    }
    handleSort(_event, index, direction) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      if (val === "") {
        rows = this.props.rows.map((row) => [row.entrydn[0]]);
      } else {
        rows = this.state.rows.filter(
          (row) => row[0].toLowerCase().includes(val)
        );
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: _3("Managed Entry Templates") }];
        tableRows = [{ cells: [_3("No templates")] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          SearchInput,
          {
            placeholder: _3("Search Templates"),
            className: "ds-margin-top-lg",
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "managed template table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy: this.state.sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)) : row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActionsForRow(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage: this.state.perPage,
            page: this.state.page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  ManagedTemplateTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  ManagedTemplateTable.defaultProps = {
    rows: []
  };
  var PassthroughAuthURLsTable = class extends import_react18.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _3("Edit URL"),
          onClick: () => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: _3("Delete URL"),
          onClick: () => this.props.deleteConfig(rowData[0])
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _3("URL"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = this.props.rows.map((row) => [row.url]);
      this.setState({ rows });
    }
    handleSort(_event, index, direction) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      if (val === "") {
        rows = this.props.rows.map((row) => [row.url]);
      } else {
        rows = this.state.rows.filter(
          (row) => row[0].toLowerCase().includes(val)
        );
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: _3("Pass-Through Authentication URLs") }];
        tableRows = [{ cells: [_3("No URLs")] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          SearchInput,
          {
            placeholder: _3("Search"),
            className: "ds-margin-top-lg",
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "passthru url table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy: this.state.sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)) : row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActionsForRow(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage: this.state.perPage,
            page: this.state.page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  PassthroughAuthURLsTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  PassthroughAuthURLsTable.defaultProps = {
    rows: []
  };
  var PassthroughAuthConfigsTable = class extends import_react18.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _3("Edit Config"),
          onClick: () => this.props.editConfig(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: _3("Delete Config"),
          onClick: () => this.props.deleteConfig(rowData[0])
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _3("Config Name"), sortable: true },
          { title: _3("Attribute"), sortable: true },
          { title: _3("Map Method"), sortable: true },
          { title: _3("Filter"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      const rows = this.props.rows.map((row) => [
        row.cn[0],
        row.pamidattr?.[0] || "",
        row.pamidmapmethod?.[0] || "",
        row.pamfilter?.[0] || ""
      ]);
      this.setState({ rows });
    }
    handleSort(_event, index, direction) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      if (val === "") {
        rows = this.props.rows.map((row) => [
          row.cn[0],
          row.pamidattr?.[0] || "",
          row.pamidmapmethod?.[0] || "",
          row.pamfilter?.[0] || ""
        ]);
      } else {
        rows = this.state.rows.filter(
          (row) => row.some((cell) => cell.toLowerCase().includes(val))
        );
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: _3("PAM Configurations") }];
        tableRows = [{ cells: [_3("No PAM configurations")] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          SearchInput,
          {
            placeholder: _3("Search"),
            className: "ds-margin-top-lg",
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "pass config table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy: this.state.sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)) : row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: cell }, cellIndex)),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActionsForRow(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage: this.state.perPage,
            page: this.state.page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  PassthroughAuthConfigsTable.propTypes = {
    rows: import_prop_types3.default.array,
    editConfig: import_prop_types3.default.func,
    deleteConfig: import_prop_types3.default.func
  };
  PassthroughAuthConfigsTable.defaultProps = {
    rows: []
  };
  var MemberOfTable = class extends import_react18.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _3("Delete"),
          onClick: () => this.props.deleteConfig(rowData[0])
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: this.props.rows,
        columns: [
          { title: _3(this.props.title), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
    }
    componentDidMount() {
      this.setState({ rows: this.props.rows });
    }
    componentDidUpdate(prevProps) {
      if (prevProps.rows !== this.props.rows) {
        this.setState({ rows: this.props.rows });
      }
    }
    handleSort(_event, index, direction) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: this.props.title }];
        tableRows = [_3("No items")];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
          Table,
          {
            className: "ds-margin-top-xlg",
            "aria-label": "memberof table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy: this.state.sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    width: 80,
                    children: column.title
                  },
                  idx
                )),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Tr, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: row }, rowIndex),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Td, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
                  Button,
                  {
                    variant: "secondary",
                    onClick: () => this.props.deleteAttr(row),
                    children: "Delete"
                  },
                  row
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage: this.state.perPage,
            page: this.state.page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect,
            isCompact: true
          }
        )
      ] });
    }
  };
  MemberOfTable.propTypes = {
    title: import_prop_types3.default.string,
    rows: import_prop_types3.default.array,
    deleteAttr: import_prop_types3.default.func
  };
  MemberOfTable.defaultProps = {
    rows: [],
    title: "",
    deleteAttr: () => {
    }
  };

  // src/lib/plugins/accountPolicy.jsx
  var import_react21 = __toESM(require_react(), 1);

  // src/dsBasicComponents.jsx
  var import_react19 = __toESM(require_react(), 1);
  var import_prop_types4 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
  var TypeaheadSelect = ({
    selected,
    onSelect,
    onClear,
    options: options5 = [],
    isMulti = false,
    isCreatable = false,
    onCreateOption,
    validateCreate,
    hasCheckbox = false,
    placeholder = "Select an option...",
    noResultsText = "No results found",
    isDisabled = false,
    validated = "default",
    validationMessage,
    ariaLabel = "Select input",
    className,
    onToggle,
    isOpen: controlledIsOpen,
    allowCustomValues = false,
    openOnClick = true,
    maxOptionsForClickOpen = 20
  }) => {
    const [internalIsOpen, setInternalIsOpen] = (0, import_react19.useState)(false);
    const isOpen = controlledIsOpen !== void 0 ? controlledIsOpen : internalIsOpen;
    const [inputValue, setInputValue] = (0, import_react19.useState)("");
    const [selectOptions, setSelectOptions] = (0, import_react19.useState)([]);
    const [focusedItemIndex, setFocusedItemIndex] = (0, import_react19.useState)(null);
    const [activeItemId, setActiveItemId] = (0, import_react19.useState)(null);
    const textInputRef = (0, import_react19.useRef)();
    const isSelectingRef = (0, import_react19.useRef)(false);
    const CREATE_NEW = "create-new";
    const normalizeOptions = (opts) => {
      if (!Array.isArray(opts)) return [];
      return opts.map((opt) => {
        if (typeof opt === "string") {
          return { value: opt, children: opt };
        }
        return { ...opt, children: opt.label || opt.value };
      });
    };
    const normalizeSelected = (sel) => {
      if (isMulti) {
        if (Array.isArray(sel)) return sel;
        if (sel === null || sel === void 0 || sel === "") return [];
        return [sel];
      } else {
        if (Array.isArray(sel)) return sel.length > 0 ? sel[0] : "";
        return sel || "";
      }
    };
    const validateCreateValue = (0, import_react19.useCallback)((value) => {
      if (!value || !value.trim()) return false;
      if (validateCreate) {
        const result = validateCreate(value);
        return typeof result === "boolean" ? result : result.isValid;
      }
      return true;
    }, [validateCreate]);
    const resetActiveAndFocusedItem = () => {
      setFocusedItemIndex(null);
      setActiveItemId(null);
    };
    const closeMenu = (0, import_react19.useCallback)(() => {
      if (controlledIsOpen === void 0) {
        setInternalIsOpen(false);
      }
      if (onToggle) {
        onToggle(null, false);
      }
      resetActiveAndFocusedItem();
    }, [controlledIsOpen, onToggle]);
    const openMenu = (0, import_react19.useCallback)(() => {
      if (controlledIsOpen === void 0) {
        setInternalIsOpen(true);
      }
      if (onToggle) {
        onToggle(null, true);
      }
    }, [controlledIsOpen, onToggle]);
    (0, import_react19.useEffect)(() => {
      if (isSelectingRef.current) return;
      const normalizedOptions = normalizeOptions(options5);
      const currentSelections2 = normalizeSelected(selected);
      let newSelectOptions = normalizedOptions;
      if (isMulti && Array.isArray(currentSelections2) && currentSelections2.length > 0) {
        const selectedNotInOptions = currentSelections2.filter((selectedValue) => !normalizedOptions.some((opt) => opt.value === selectedValue)).map((selectedValue) => ({ value: selectedValue, children: selectedValue }));
        newSelectOptions = [...normalizedOptions, ...selectedNotInOptions];
      }
      if (inputValue && inputValue.trim()) {
        newSelectOptions = newSelectOptions.filter(
          (option) => String(option.children).toLowerCase().includes(inputValue.toLowerCase())
        );
        if (isCreatable) {
          const isValid = validateCreateValue(inputValue);
          const alreadyExists = normalizedOptions.some((opt) => opt.value === inputValue);
          const alreadySelected = isMulti ? Array.isArray(currentSelections2) && currentSelections2.includes(inputValue) : selected === inputValue;
          if (isValid && !alreadyExists && !alreadySelected) {
            newSelectOptions = [...newSelectOptions, {
              children: `Create "${inputValue}"`,
              value: CREATE_NEW,
              isCreatable: true
            }];
          }
        }
      }
      setSelectOptions(newSelectOptions);
      setFocusedItemIndex(null);
      setActiveItemId(null);
    }, [inputValue, options5, isCreatable, validateCreateValue, selected, isMulti]);
    (0, import_react19.useEffect)(() => {
      if (inputValue && !isOpen) {
        openMenu();
      }
    }, [inputValue, isOpen, openMenu]);
    const createItemId = (value) => `select-typeahead-${value}`.replace(/\s+/g, "-");
    const setActiveAndFocusedItem = (itemIndex) => {
      setFocusedItemIndex(itemIndex);
      const focusedItem = selectOptions[itemIndex];
      if (focusedItem) {
        setActiveItemId(createItemId(focusedItem.value));
      }
    };
    const onInputClick = () => {
      if (!isOpen) {
        if (openOnClick) {
          const normalizedOptions = normalizeOptions(options5);
          if (inputValue || normalizedOptions.length <= maxOptionsForClickOpen) {
            openMenu();
          }
        }
      } else if (!inputValue) {
        closeMenu();
      }
    };
    const handleSelect = (value) => {
      if (!value) return;
      isSelectingRef.current = true;
      if (value === CREATE_NEW) {
        if (isCreatable && inputValue && validateCreateValue(inputValue)) {
          if (onCreateOption) {
            onCreateOption(inputValue);
          }
          if (isMulti) {
            const currentSelections2 = normalizeSelected(selected);
            if (!currentSelections2.includes(inputValue)) {
              onSelect(null, [...currentSelections2, inputValue]);
            }
          } else {
            onSelect(null, inputValue);
          }
          setInputValue("");
          resetActiveAndFocusedItem();
          if (!isMulti) {
            closeMenu();
          }
        }
      } else {
        if (isMulti) {
          const currentSelections2 = normalizeSelected(selected);
          const newSelections = currentSelections2.includes(value) ? currentSelections2.filter((selection) => selection !== value) : [...currentSelections2, value];
          onSelect(null, newSelections);
          setInputValue("");
        } else {
          closeMenu();
          onSelect(null, value);
          setInputValue("");
        }
      }
      resetActiveAndFocusedItem();
      setTimeout(() => {
        isSelectingRef.current = false;
        setSelectOptions(() => {
          const normalizedOptions = normalizeOptions(options5);
          const currentSelections2 = normalizeSelected(selected);
          if (isMulti && Array.isArray(currentSelections2) && currentSelections2.length > 0) {
            const selectedNotInOptions = currentSelections2.filter((selectedValue) => !normalizedOptions.some((opt) => opt.value === selectedValue)).map((selectedValue) => ({ value: selectedValue, children: selectedValue }));
            return [...normalizedOptions, ...selectedNotInOptions];
          }
          return normalizedOptions;
        });
      }, 10);
      textInputRef.current?.focus();
    };
    const onTextInputChange = (_event, value) => {
      setInputValue(value);
      resetActiveAndFocusedItem();
    };
    const handleMenuArrowKeys = (key) => {
      let indexToFocus = 0;
      if (!isOpen) {
        openMenu();
      }
      if (selectOptions.every((option) => option.isDisabled)) {
        return;
      }
      if (key === "ArrowUp") {
        if (focusedItemIndex === null || focusedItemIndex === 0) {
          indexToFocus = selectOptions.length - 1;
        } else {
          indexToFocus = focusedItemIndex - 1;
        }
        while (selectOptions[indexToFocus]?.isDisabled) {
          indexToFocus--;
          if (indexToFocus === -1) {
            indexToFocus = selectOptions.length - 1;
          }
        }
      }
      if (key === "ArrowDown") {
        if (focusedItemIndex === null || focusedItemIndex === selectOptions.length - 1) {
          indexToFocus = 0;
        } else {
          indexToFocus = focusedItemIndex + 1;
        }
        while (selectOptions[indexToFocus]?.isDisabled) {
          indexToFocus++;
          if (indexToFocus === selectOptions.length) {
            indexToFocus = 0;
          }
        }
      }
      setActiveAndFocusedItem(indexToFocus);
    };
    const onInputKeyDown = (event) => {
      const focusedItem = focusedItemIndex !== null ? selectOptions[focusedItemIndex] : null;
      switch (event.key) {
        case "Enter":
          event.preventDefault();
          if (isOpen && focusedItem && !focusedItem.isDisabled) {
            handleSelect(focusedItem.value);
          } else if (isOpen && isCreatable && inputValue && validateCreateValue(inputValue)) {
            handleSelect(CREATE_NEW);
          } else if (!isOpen) {
            openMenu();
          }
          break;
        case "ArrowUp":
        case "ArrowDown":
          event.preventDefault();
          handleMenuArrowKeys(event.key);
          break;
        case "Escape":
          event.preventDefault();
          closeMenu();
          setInputValue("");
          break;
        case "Tab":
          closeMenu();
          break;
      }
    };
    const onToggleClick = () => {
      if (isOpen) {
        closeMenu();
      } else {
        openMenu();
      }
      textInputRef?.current?.focus();
    };
    const onClearButtonClick = () => {
      if (onClear) {
        onClear();
      } else if (isMulti) {
        onSelect(null, []);
      } else {
        onSelect(null, "");
      }
      setInputValue("");
      resetActiveAndFocusedItem();
      textInputRef?.current?.focus();
    };
    const getChildren3 = (value) => {
      const option = normalizeOptions(options5).find((opt) => opt.value === value);
      return option?.children || value;
    };
    const getStatus = () => {
      switch (validated) {
        case "error":
          return "danger";
        case "warning":
          return "warning";
        case "success":
          return "success";
        default:
          return void 0;
      }
    };
    const getCreateValidationMessage = (value) => {
      if (!validateCreate) return null;
      const result = validateCreate(value);
      if (typeof result === "object" && result.message) {
        return result.message;
      }
      return null;
    };
    const currentSelections = normalizeSelected(selected);
    const displayValue = !isMulti && selected && !inputValue ? selected : inputValue;
    const toggle = (toggleRef) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
      MenuToggle,
      {
        variant: "typeahead",
        "aria-label": ariaLabel,
        onClick: onToggleClick,
        innerRef: toggleRef,
        isExpanded: isOpen,
        isFullWidth: true,
        isDisabled,
        status: getStatus(),
        children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(TextInputGroup, { isPlain: true, children: [
          /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
            TextInputGroupMain,
            {
              value: displayValue,
              onClick: onInputClick,
              onChange: onTextInputChange,
              onKeyDown: onInputKeyDown,
              id: "typeahead-select-input",
              autoComplete: "off",
              innerRef: textInputRef,
              placeholder: (isMulti ? Array.isArray(currentSelections) ? currentSelections.length === 0 : true : !currentSelections) ? placeholder : "",
              ...activeItemId && { "aria-activedescendant": activeItemId },
              role: "combobox",
              isExpanded: isOpen,
              "aria-controls": "typeahead-select-listbox",
              children: isMulti && Array.isArray(currentSelections) && currentSelections.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(LabelGroup, { "aria-label": "Current selections", children: currentSelections.map((selection, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
                Label,
                {
                  variant: "outline",
                  onClose: (ev) => {
                    ev.stopPropagation();
                    handleSelect(selection);
                  },
                  textMaxWidth: "32ch",
                  children: getChildren3(selection)
                },
                index
              )) })
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
            TextInputGroupUtilities,
            {
              ...(isMulti ? Array.isArray(currentSelections) ? currentSelections.length === 0 : true : !selected) && !inputValue ? { style: { display: "none" } } : {},
              children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
                Button,
                {
                  variant: "plain",
                  onClick: onClearButtonClick,
                  "aria-label": "Clear input value",
                  icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TimesIcon, {}),
                  isDisabled
                }
              )
            }
          )
        ] })
      }
    );
    return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
      Select,
      {
        id: "typeahead-select",
        isOpen,
        selected: isMulti ? currentSelections : selected,
        onSelect: (_event, selection) => handleSelect(selection),
        onOpenChange: (nextOpen) => {
          if (!nextOpen) {
            closeMenu();
          }
        },
        toggle,
        variant: "typeahead",
        className,
        children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SelectList, { isAriaMultiselectable: isMulti, id: "typeahead-select-listbox", children: selectOptions.length === 0 && !isCreatable ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SelectOption, { isDisabled: true, children: noResultsText }, "no-results") : selectOptions.map((option, index) => {
          const isSelected = isMulti ? Array.isArray(currentSelections) && currentSelections.includes(option.value) : selected === option.value;
          return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
            SelectOption,
            {
              isFocused: focusedItemIndex === index,
              className: option.className,
              id: createItemId(option.value),
              value: option.value,
              isDisabled: option.isDisabled,
              isSelected,
              hasCheckbox: isMulti && hasCheckbox,
              ref: null,
              children: option.children
            },
            option.value
          );
        }) })
      }
    );
  };
  TypeaheadSelect.propTypes = {
    selected: import_prop_types4.default.oneOfType([
      import_prop_types4.default.string,
      import_prop_types4.default.arrayOf(import_prop_types4.default.string)
    ]),
    onSelect: import_prop_types4.default.func.isRequired,
    onClear: import_prop_types4.default.func,
    options: import_prop_types4.default.arrayOf(
      import_prop_types4.default.oneOfType([
        import_prop_types4.default.string,
        import_prop_types4.default.shape({
          value: import_prop_types4.default.string.isRequired,
          label: import_prop_types4.default.string,
          description: import_prop_types4.default.string,
          isDisabled: import_prop_types4.default.bool,
          className: import_prop_types4.default.string
        })
      ])
    ),
    isMulti: import_prop_types4.default.bool,
    isCreatable: import_prop_types4.default.bool,
    onCreateOption: import_prop_types4.default.func,
    validateCreate: import_prop_types4.default.func,
    hasCheckbox: import_prop_types4.default.bool,
    placeholder: import_prop_types4.default.string,
    noResultsText: import_prop_types4.default.string,
    isDisabled: import_prop_types4.default.bool,
    validated: import_prop_types4.default.oneOf(["default", "error", "warning", "success"]),
    validationMessage: import_prop_types4.default.string,
    ariaLabel: import_prop_types4.default.string,
    className: import_prop_types4.default.string,
    onToggle: import_prop_types4.default.func,
    isOpen: import_prop_types4.default.bool,
    allowCustomValues: import_prop_types4.default.bool,
    openOnClick: import_prop_types4.default.bool,
    maxOptionsForClickOpen: import_prop_types4.default.number
  };
  var dsBasicComponents_default = TypeaheadSelect;

  // src/lib/plugins/accountPolicy.jsx
  var import_prop_types6 = __toESM(require_prop_types(), 1);

  // src/lib/plugins/pluginBasicConfig.jsx
  var import_react20 = __toESM(require_react(), 1);
  var import_prop_types5 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
  var _4 = cockpit_default.gettext;
  var PluginBasicConfig = class extends import_react20.default.Component {
    constructor(props) {
      super(props);
      this.updateFields = this.updateFields.bind(this);
      this.updateSwitch = this.updateSwitch.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.state = {
        disableSwitch: false,
        currentPluginEnabled: true,
        currentPluginType: "",
        currentPluginPath: "",
        currentPluginInitfunc: "",
        currentPluginId: "",
        currentPluginVendor: "",
        currentPluginVersion: "",
        currentPluginDescription: "",
        currentPluginDependsOnType: "",
        currentPluginDependsOnNamed: "",
        currentPluginPrecedence: "",
        isExpanded: false
      };
      this.handleToggle = (_event, isExpanded) => {
        this.setState({
          isExpanded
        });
      };
    }
    componentDidMount(prevProps) {
      this.updateFields();
    }
    componentDidUpdate(prevProps) {
      if (this.props.rows !== prevProps.rows) {
        this.updateFields();
      }
    }
    handleFieldChange(e) {
      e.preventDefault();
      this.setState({
        [e.target.id]: e.target.value
      });
    }
    handleSwitchChange() {
      const {
        pluginName,
        cmdName,
        serverId,
        pluginListHandler,
        addNotification,
        toggleLoadingHandler
      } = this.props;
      const new_status = this.state.currentPluginEnabled ? "disable" : "enable";
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
        "plugin",
        cmdName,
        new_status
      ];
      toggleLoadingHandler();
      this.setState({ disableSwitch: true });
      log_cmd("handleSwitchChange", "Switch plugin states from the plugin tab", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        console.info("savePlugin", "Result", content);
        pluginListHandler();
        const successCheckCMD = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
          "config",
          "get",
          "nsslapd-dynamic-plugins"
        ];
        log_cmd("handleSwitchChange", "Get Dynamic Plugins attribute", successCheckCMD);
        cockpit_default.spawn(successCheckCMD, { superuser: true, err: "message" }).done((content2) => {
          const config = JSON.parse(content2);
          let dynamicPluginEnabled;
          if (config.attrs["nsslapd-dynamic-plugins"][0] === "on") {
            dynamicPluginEnabled = true;
          } else if (config.attrs["nsslapd-dynamic-plugins"][0] === "off") {
            dynamicPluginEnabled = false;
          } else {
            console.error(
              "handleSwitchChange failed",
              "wrong nsslapd-dynamic-pluginc attribute value",
              config.attrs["nsslapd-dynamic-plugins"][0]
            );
          }
          addNotification(
            `${!dynamicPluginEnabled ? "warning" : "success"}`,
            cockpit_default.format(
              _4("$0 plugin was successfully $1."),
              pluginName,
              new_status + "d"
            ) + `${!dynamicPluginEnabled ? " " + _4("Please, restart the instance.") : ""}`
          );
          toggleLoadingHandler();
        }).fail(() => {
          console.error(
            "handleSwitchChange failed",
            "Failed to get nsslapd-dynamic-pluginc attribute value"
          );
          addNotification(
            "warning",
            cockpit_default.format(
              _4("$0 plugin was successfully $1. Please, restart the instance."),
              pluginName,
              new_status + "d"
            )
          );
          toggleLoadingHandler();
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        addNotification(
          "error",
          cockpit_default.format(_4("Error during $0 plugin modification - $1"), pluginName, errMsg)
        );
        toggleLoadingHandler();
        this.setState({ disableSwitch: false });
      });
    }
    updateFields() {
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find((row) => row.cn[0] === this.props.cn);
        if (pluginRow) {
          this.setState({
            currentPluginType: pluginRow["nsslapd-pluginType"][0],
            currentPluginPath: pluginRow["nsslapd-pluginPath"][0],
            currentPluginInitfunc: pluginRow["nsslapd-pluginInitfunc"][0],
            currentPluginId: pluginRow["nsslapd-pluginId"][0],
            currentPluginVendor: pluginRow["nsslapd-pluginVendor"][0],
            currentPluginVersion: pluginRow["nsslapd-pluginVersion"][0],
            currentPluginDescription: pluginRow["nsslapd-pluginDescription"][0],
            currentPluginDependsOnType: pluginRow["nsslapd-plugin-depends-on-type"] === void 0 ? "" : pluginRow["nsslapd-plugin-depends-on-type"][0],
            currentPluginDependsOnNamed: pluginRow["nsslapd-plugin-depends-on-named"] === void 0 ? "" : pluginRow["nsslapd-plugin-depends-on-named"][0],
            currentPluginPrecedence: pluginRow["nsslapd-pluginprecedence"] === void 0 ? "" : pluginRow["nsslapd-pluginprecedence"][0]
          });
        }
      }
      this.updateSwitch();
    }
    updateSwitch() {
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find((row) => row.cn[0] === this.props.cn);
        if (pluginRow) {
          let pluginEnabled = false;
          if (pluginRow["nsslapd-pluginEnabled"][0] === "on") {
            pluginEnabled = true;
          } else if (pluginRow["nsslapd-pluginEnabled"][0] === "off") {
            pluginEnabled = false;
          } else {
            console.error(
              "openPluginModal failed",
              "wrong nsslapd-pluginenabled attribute value",
              pluginRow["nsslapd-pluginEnabled"][0]
            );
          }
          this.setState({
            currentPluginEnabled: pluginEnabled,
            disableSwitch: false
          });
        }
      }
    }
    render() {
      const {
        disableSwitch
      } = this.state;
      const enabled = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { children: _4("Plugin is enabled") });
      const disabled = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { children: _4("Plugin is disabled") });
      return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Form, { isHorizontal: true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 9, className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text, { component: TextVariants.h2, children: [
            this.props.pluginName,
            " ",
            _4("Plugin")
          ] }) }) }),
          this.props.removeSwitch || /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 3, className: "ds-float-right ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
            Switch,
            {
              id: "this.props.pluginName",
              label: enabled,
              labelOff: disabled,
              isChecked: this.state.currentPluginEnabled,
              onChange: (event, str) => this.handleSwitchChange(event, str),
              isDisabled: disableSwitch
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("hr", {})
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "ds-indent", children: this.props.children }),
        this.state.currentPluginPath !== "" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
          ExpandableSection,
          {
            className: "ds-margin-top-lg",
            toggleText: this.state.isExpanded ? _4("Hide Plugin Details") : _4("Show Plugin Details"),
            onToggle: (event, isOpen) => this.handleToggle(event, isOpen),
            isExpanded: this.state.isExpanded,
            children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Grid, { className: "ds-margin-left", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Form, { isHorizontal: true, children: [
              /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: _4("Plugin Type") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { children: this.state.currentPluginType }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: _4("Plugin Path") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { children: this.state.currentPluginPath }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: _4("Plugin Initfunc") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { children: this.state.currentPluginInitfunc }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: _4("Plugin Depends On Type") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { children: this.state.currentPluginDependsOnType }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: _4("Plugin Depends On Named") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { children: this.state.currentPluginDependsOnNamed }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: _4("Plugin Vendor") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { children: this.state.currentPluginVendor }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: _4("Plugin Version") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { children: this.state.currentPluginVersion }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: _4("Plugin Description") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { children: this.state.currentPluginDescription }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: _4("Plugin ID") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { children: this.state.currentPluginId }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: _4("Plugin Precedence") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", { children: this.state.currentPluginPrecedence }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("hr", {})
            ] }) }) })
          }
        )
      ] });
    }
  };
  PluginBasicConfig.propTypes = {
    children: import_prop_types5.default.any.isRequired,
    rows: import_prop_types5.default.array,
    serverId: import_prop_types5.default.string,
    cn: import_prop_types5.default.string,
    pluginName: import_prop_types5.default.string,
    cmdName: import_prop_types5.default.string,
    removeSwitch: import_prop_types5.default.bool,
    pluginListHandler: import_prop_types5.default.func,
    addNotification: import_prop_types5.default.func,
    toggleLoadingHandler: import_prop_types5.default.func
  };
  PluginBasicConfig.defaultProps = {
    rows: [],
    serverId: "",
    cn: "",
    pluginName: "",
    cmdName: "",
    removeSwitch: false
  };
  var pluginBasicConfig_default = PluginBasicConfig;

  // src/lib/plugins/accountPolicy.jsx
  var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
  var _5 = cockpit_default.gettext;
  var AccountPolicy = class extends import_react21.default.Component {
    componentDidMount(prevProps) {
      this.updateFields();
    }
    componentDidUpdate(prevProps) {
      if (this.props.rows !== prevProps.rows) {
        this.updateFields();
      }
    }
    constructor(props) {
      super(props);
      this.updateFields = this.updateFields.bind(this);
      this.onChange = this.onChange.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.handleModalChange = this.handleModalChange.bind(this);
      this.handleCheckboxChange = this.handleCheckboxChange.bind(this);
      this.handleOpenModal = this.handleOpenModal.bind(this);
      this.handleCloseModal = this.handleCloseModal.bind(this);
      this.handleAddConfig = this.handleAddConfig.bind(this);
      this.handleEditConfig = this.handleEditConfig.bind(this);
      this.deleteConfig = this.deleteConfig.bind(this);
      this.handleDeleteConfig = this.handleDeleteConfig.bind(this);
      this.closeWarningModal = this.closeWarningModal.bind(this);
      this.handleSaveConfig = this.handleSaveConfig.bind(this);
      this.cmdOperation = this.cmdOperation.bind(this);
      this.handleShowConfirmDelete = this.handleShowConfirmDelete.bind(this);
      this.closeConfirmDelete = this.closeConfirmDelete.bind(this);
      this.sharedConfigExists = this.sharedConfigExists.bind(this);
      this.validateConfig = this.validateConfig.bind(this);
      this.state = {
        attributes: [],
        // Main config
        configArea: "",
        _configArea: "",
        error: [],
        saveBtnDisabled: true,
        saving: false,
        addingModal: false,
        savingModal: false,
        sharedConfigExists: false,
        // Modal Config
        configDN: "",
        altStateAttrName: "",
        alwaysRecordLogin: false,
        alwaysRecordLoginAttr: "",
        limitAttrName: "",
        specAttrName: "",
        stateAttrName: "",
        checkAllStateAttrs: false,
        _configDN: "",
        _altStateAttrName: [],
        _alwaysRecordLogin: false,
        _alwaysRecordLoginAttr: "",
        _limitAttrName: "",
        _specAttrName: "",
        _stateAttrName: "",
        _checkAllStateAttrs: false,
        errorModal: {},
        saveBtnDisabledModal: true,
        modalChecked: false,
        modalSpinning: false,
        configEntryModalShow: false,
        fixupModalShow: false,
        newEntry: false,
        isRecordLoginOpen: false,
        isSpecificAttrOpen: false,
        isStateAttrOpen: false,
        isAltStateAttrOpen: false,
        isLimitAttrOpen: false,
        showConfirmDelete: false,
        showWarningModal: false,
        warningMessage: ""
      };
      this.handleRecordLoginSelect = (event, selection) => {
        if (selection === this.state.alwaysRecordLoginAttr) {
          this.handleRecordLoginClear();
        } else {
          this.setState({
            alwaysRecordLoginAttr: selection,
            isRecordLoginOpen: false
          }, () => {
            this.validateConfig();
          });
        }
      };
      this.handleRecordLoginToggle = (_event, isRecordLoginOpen) => {
        this.setState({
          isRecordLoginOpen
        });
      };
      this.handleRecordLoginClear = () => {
        this.setState({
          alwaysRecordLoginAttr: "",
          isRecordLoginOpen: false
        });
      };
      this.handleSpecificAttrSelect = (event, selection) => {
        if (selection === this.state.specAttrName) {
          this.handleSpecificAttrClear();
        } else {
          this.setState({
            specAttrName: selection,
            isSpecificAttrOpen: false
          }, () => {
            this.validateConfig();
          });
        }
      };
      this.handleSpecificAttrToggle = (_event, isSpecificAttrOpen) => {
        this.setState({
          isSpecificAttrOpen
        });
      };
      this.handleSpecificAttrClear = () => {
        this.setState({
          specAttrName: [],
          isSpecificAttrOpen: false
        });
      };
      this.handleStateAttrSelect = (event, selection) => {
        if (selection === this.state.stateAttrName) {
          this.handleStateAttrClear();
        } else {
          this.setState({
            stateAttrName: selection,
            isStateAttrOpen: false
          }, () => {
            this.validateConfig();
          });
        }
      };
      this.handleStateAttrToggle = (_event, isStateAttrOpen) => {
        this.setState({
          isStateAttrOpen
        });
      };
      this.handleStateAttrClear = () => {
        this.setState({
          stateAttrName: [],
          isStateAttrOpen: false
        });
      };
      this.handleAlternativeStateSelect = (event, selection) => {
        if (selection === this.state.altStateAttrName) {
          this.handleAlternativeStateClear();
        } else {
          this.setState({
            altStateAttrName: selection,
            isAltStateAttrOpen: false
          }, () => {
            this.validateConfig();
          });
        }
      };
      this.handleAlternativeStateToggle = (_event, isAltStateAttrOpen) => {
        this.setState({
          isAltStateAttrOpen
        });
      };
      this.handleAlternativeStateClear = () => {
        this.setState({
          altStateAttrName: [],
          isAltStateAttrOpen: false
        });
      };
      this.handleLimitAttrSelect = (event, selection) => {
        if (selection === this.state.limitAttrName) {
          this.handleLimitAttrClear();
        } else {
          this.setState({
            limitAttrName: selection,
            isLimitAttrOpen: false
          }, () => {
            this.validateConfig();
          });
        }
      };
      this.handleLimitAttrToggle = (_event, isLimitAttrOpen) => {
        this.setState({
          isLimitAttrOpen
        });
      };
      this.handleLimitAttrClear = () => {
        this.setState({
          limitAttrName: [],
          isLimitAttrOpen: false
        });
      };
    }
    handleShowConfirmDelete() {
      this.setState({
        showConfirmDelete: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmDelete() {
      this.setState({
        showConfirmDelete: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    sharedConfigExists() {
      if (this.state.configArea) {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "account-policy",
          "config-entry",
          "show",
          this.state.configArea
        ];
        log_cmd("sharedConfigExists", "Check if Account Policy config entry exists", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          this.setState({
            sharedConfigExists: true
          });
        }).fail(() => {
          this.props.addNotification(
            "warning",
            cockpit_default.format(_5("Warning! Account Policy config entry $0 doesn't exist!"), this.state.configArea)
          );
          this.setState({
            sharedConfigExists: false
          });
        });
      }
    }
    handleOpenModal() {
      if (!this.state.configArea) {
        this.setState({
          configEntryModalShow: true,
          newEntry: true,
          configDN: "",
          altStateAttrName: "createTimestamp",
          alwaysRecordLogin: false,
          alwaysRecordLoginAttr: "lastLoginTime",
          limitAttrName: "accountInactivityLimit",
          specAttrName: "acctPolicySubentry",
          stateAttrName: "lastLoginTime",
          checkAllStateAttrs: false,
          _configDN: "",
          _altStateAttrName: "createTimestamp",
          _alwaysRecordLogin: false,
          _alwaysRecordLoginAttr: "lastLoginTime",
          _limitAttrName: "accountInactivityLimit",
          _specAttrName: "acctPolicySubentry",
          _stateAttrName: "lastLoginTime",
          _checkAllStateAttrs: false,
          savingModal: false,
          saveBtnDisabledModal: true
        });
      } else {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "account-policy",
          "config-entry",
          "show",
          this.state.configArea
        ];
        log_cmd("handleOpenModal", "Fetch the Account Policy Plugin config entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const configEntry = JSON.parse(content).attrs;
          this.setState({
            configEntryModalShow: true,
            newEntry: false,
            savingModal: false,
            saveBtnDisabledModal: true,
            configDN: this.state.configArea,
            altStateAttrName: configEntry.altstateattrname === void 0 ? "createTimestamp" : configEntry.altstateattrname[0],
            alwaysRecordLogin: !(configEntry.alwaysrecordlogin === void 0 || configEntry.alwaysrecordlogin[0] === "no"),
            alwaysRecordLoginAttr: configEntry.alwaysrecordloginattr === void 0 ? "lastLoginTime" : configEntry.alwaysrecordloginattr[0],
            limitAttrName: configEntry.limitattrname === void 0 ? "accountInactivityLimit" : configEntry.limitattrname[0],
            specAttrName: configEntry.specattrname === void 0 ? "acctPolicySubentry" : configEntry.specattrname[0],
            stateAttrName: configEntry.stateattrname === void 0 ? "lastLoginTime" : configEntry.stateattrname[0],
            checkAllStateAttrs: !(configEntry.checkallstateattrs === void 0 || configEntry.checkallstateattrs[0] === "no"),
            // original values
            _altStateAttrName: configEntry.altstateattrname === void 0 ? "createTimestamp" : configEntry.altstateattrname[0],
            _alwaysRecordLogin: !(configEntry.alwaysrecordlogin === void 0 || configEntry.alwaysrecordlogin[0] === "no"),
            _alwaysRecordLoginAttr: configEntry.alwaysrecordloginattr === void 0 ? "lastLoginTime" : configEntry.alwaysrecordloginattr[0],
            _limitAttrName: configEntry.limitattrname === void 0 ? "accountInactivityLimit" : configEntry.limitattrname[0],
            _specAttrName: configEntry.specattrname === void 0 ? "acctPolicySubentry" : configEntry.specattrname[0],
            _stateAttrName: configEntry.stateattrname === void 0 ? "lastLoginTime" : configEntry.stateattrname[0],
            _checkAllStateAttrs: !(configEntry.checkallstateattrs === void 0 || configEntry.checkallstateattrs[0] === "no")
          });
        }).fail((_113) => {
          this.setState({
            configEntryModalShow: true,
            newEntry: true,
            configDN: this.state.configArea,
            _configDN: this.state.configArea,
            altStateAttrName: "createTimestamp",
            alwaysRecordLogin: false,
            alwaysRecordLoginAttr: "lastLoginTime",
            limitAttrName: "accountInactivityLimit",
            specAttrName: "acctPolicySubentry",
            stateAttrName: "lastLoginTime",
            checkAllStateAttrs: false,
            _altStateAttrName: "createTimestamp",
            _alwaysRecordLogin: false,
            _alwaysRecordLoginAttr: "lastLoginTime",
            _limitAttrName: "accountInactivityLimit",
            _specAttrName: "acctPolicySubentry",
            _stateAttrName: "lastLoginTime",
            _checkAllStateAttrs: false,
            saveBtnDisabledModal: false
            // We preset the form so it's ready to save
          });
        });
      }
    }
    handleCloseModal() {
      this.setState({ configEntryModalShow: false });
    }
    cmdOperation(action) {
      const {
        configDN,
        altStateAttrName,
        alwaysRecordLogin,
        alwaysRecordLoginAttr,
        limitAttrName,
        specAttrName,
        stateAttrName,
        checkAllStateAttrs
      } = this.state;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "account-policy",
        "config-entry",
        action,
        configDN,
        "--always-record-login",
        alwaysRecordLogin ? "yes" : "no",
        "--check-all-state-attrs",
        checkAllStateAttrs ? "yes" : "no"
      ];
      cmd = [...cmd, "--alt-state-attr"];
      if (altStateAttrName !== "") {
        cmd = [...cmd, altStateAttrName];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--always-record-login-attr"];
      if (alwaysRecordLoginAttr !== "") {
        cmd = [...cmd, alwaysRecordLoginAttr];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--limit-attr"];
      if (limitAttrName !== "") {
        cmd = [...cmd, limitAttrName];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--spec-attr"];
      if (specAttrName !== "") {
        cmd = [...cmd, specAttrName];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--state-attr"];
      if (stateAttrName !== "") {
        cmd = [...cmd, stateAttrName];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      if (action === "add") {
        this.setState({
          addingModal: true
        });
      } else {
        this.setState({
          savingModal: true
        });
      }
      log_cmd(
        "accountPolicyOperation",
        `Do the ${action} operation on the Account Policy Plugin`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("accountPolicyOperation", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_5("Config entry $0 was successfully $1"), configDN, action === "add" ? "added" : "set")
        );
        this.props.pluginListHandler();
        this.handleCloseModal();
        if (action === "add") {
          this.setState({
            addingModal: false
          });
        } else {
          this.setState({
            savingModal: false
          });
        }
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_5("Error during the config entry $0 operation - $1"), action, errMsg)
        );
        this.props.pluginListHandler();
        this.handleCloseModal();
        if (action === "add") {
          this.setState({
            addingModal: false
          });
        } else {
          this.setState({
            savingModal: false
          });
        }
      });
    }
    handleDeleteConfig() {
      const parentDN = "cn=Account Policy Plugin,cn=plugins,cn=config";
      if (this.state.configDN.toLowerCase().endsWith(parentDN.toLowerCase())) {
        this.setState({
          showWarningModal: true,
          warningMessage: _5("Cannot delete this entry as it is a child of the Account Policy Plugin configuration.")
        });
      } else {
        this.handleShowConfirmDelete();
      }
    }
    closeWarningModal() {
      this.setState({ showWarningModal: false });
    }
    deleteConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "account-policy",
        "config-entry",
        "delete",
        this.state.configDN
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteConfig", "Delete the Account Policy Plugin config entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteConfig", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_5("Config entry $0 was successfully deleted"), this.state.configDN)
        );
        this.props.pluginListHandler();
        this.closeConfirmDelete();
        this.handleCloseModal();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_5("Error during the config entry removal operation - $0"), errMsg)
        );
        this.props.pluginListHandler();
        this.closeConfirmDelete();
        this.handleCloseModal();
      });
    }
    handleAddConfig() {
      this.cmdOperation("add");
      if (!this.state.saveBtnDisabled && !this.state.saving) {
        this.handleSaveConfig();
      }
    }
    handleEditConfig() {
      this.cmdOperation("set");
      if (!this.state.saveBtnDisabled && !this.state.saving) {
        this.handleSaveConfig();
      }
    }
    handleCheckboxChange(e, checked) {
      this.setState({
        [e.target.id]: checked
      }, () => {
        this.validateConfig();
      });
    }
    validateConfig() {
      const errObj = {};
      let all_good = true;
      const dnAttrs = [
        "configDN"
      ];
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          errObj[attr] = true;
          all_good = false;
        }
      }
      if (all_good) {
        all_good = false;
        const attrs = [
          "configDN",
          "altStateAttrName",
          "alwaysRecordLogin",
          "alwaysRecordLoginAttr",
          "limitAttrName",
          "stateAttrName",
          "checkAllStateAttrs"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabledModal: !all_good,
        errorModal: errObj
      });
    }
    handleFieldChange(e) {
      const attr = e.target.id;
      const value = e.target.value;
      let saveBtnDisabled = true;
      const errObj = {};
      errObj[attr] = false;
      if (value !== "") {
        if (!valid_dn(value)) {
          errObj[attr] = true;
        } else if (value !== this.state["_" + attr]) {
          saveBtnDisabled = false;
        }
      } else if (value !== this.state["_" + attr]) {
        saveBtnDisabled = false;
      }
      this.setState({
        [attr]: value,
        error: errObj,
        saveBtnDisabled
      });
    }
    handleModalChange(e) {
      this.setState({
        [e.target.id]: e.target.value
      }, () => {
        this.validateConfig();
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    updateFields() {
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find((row) => row.cn[0] === "Account Policy Plugin");
        this.setState({
          configDN: pluginRow["nsslapd-pluginarg0"] === void 0 ? "" : pluginRow["nsslapd-pluginarg0"][0],
          configArea: pluginRow["nsslapd-pluginarg0"] === void 0 ? "" : pluginRow["nsslapd-pluginarg0"][0],
          _configArea: pluginRow["nsslapd-pluginarg0"] === void 0 ? "" : pluginRow["nsslapd-pluginarg0"][0]
        }, () => {
          this.sharedConfigExists();
        });
      }
    }
    handleSaveConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "account-policy",
        "set",
        "--config-entry",
        this.state.configArea || "delete"
      ];
      this.setState({
        saving: true
      });
      log_cmd(
        "handleSaveConfig",
        `Save Account Policy Plugin`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        this.props.addNotification(
          "success",
          _5("Successfully updated Account Policy Plugin")
        );
        this.setState({
          saving: false,
          saveBtnDisabled: true,
          _configArea: this.state.configArea
        });
        this.props.pluginListHandler();
      }).fail((err) => {
        let errMsg = getApiErrorMessage(err);
        if ("info" in errMsg) {
          errMsg = errMsg + " " + errMsg.info;
        } else {
          errMsg = errMsg;
        }
        this.props.addNotification(
          "error",
          cockpit_default.format(_5("Error during update - $0"), errMsg)
        );
        this.setState({
          saving: false
        });
        this.props.pluginListHandler();
      });
    }
    render() {
      const {
        configArea,
        configDN,
        altStateAttrName,
        alwaysRecordLogin,
        alwaysRecordLoginAttr,
        limitAttrName,
        specAttrName,
        stateAttrName,
        checkAllStateAttrs,
        newEntry,
        configEntryModalShow,
        error,
        errorModal,
        saveBtnDisabled,
        saveBtnDisabledModal,
        saving,
        savingModal,
        addingModal
      } = this.state;
      const extraPrimaryProps = {};
      let saveBtnText = _5("Save Config");
      if (saving) {
        saveBtnText = _5("Saving ...");
      }
      let modalButtons = [];
      if (!newEntry) {
        modalButtons = [
          /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Button, { variant: "primary", onClick: this.handleShowConfirmDelete, children: _5("Delete Config") }, "del"),
          /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
            Button,
            {
              variant: "primary",
              onClick: this.handleEditConfig,
              isDisabled: saveBtnDisabledModal || savingModal,
              isLoading: savingModal,
              spinnerAriaValueText: savingModal ? _5("Saving") : void 0,
              ...extraPrimaryProps,
              children: savingModal ? _5("Saving ...") : _5("Save Config")
            },
            "save"
          ),
          /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Button, { variant: "link", onClick: this.handleCloseModal, children: _5("Cancel") }, "cancel")
        ];
      } else {
        modalButtons = [
          /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
            Button,
            {
              variant: "primary",
              onClick: this.handleAddConfig,
              isDisabled: saveBtnDisabledModal || addingModal,
              isLoading: addingModal,
              spinnerAriaValueText: addingModal ? _5("Saving") : void 0,
              ...extraPrimaryProps,
              children: addingModal ? _5("Adding ...") : _5("Add Config")
            },
            "add"
          ),
          /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Button, { variant: "link", onClick: this.handleCloseModal, children: _5("Cancel") }, "cancel")
        ];
      }
      return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: this.state.saving || this.state.savingModal || this.state.addingModal ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: _5("Manage Account Policy Plugin Shared Config Entry"),
            isOpen: configEntryModalShow,
            "aria-labelledby": "ds-modal",
            onClose: this.handleCloseModal,
            actions: modalButtons,
            children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Form, { isHorizontal: true, autoComplete: "no", children: [
              /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Grid, { title: _5("DN of the config entry"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GridItem, { span: 4, className: "ds-label", children: _5("Config DN") }),
                /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(GridItem, { span: 8, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
                    TextInput,
                    {
                      value: configDN,
                      type: "text",
                      id: "configDN",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "configDN",
                      onChange: (e, str) => {
                        this.handleModalChange(e);
                      },
                      validated: errorModal.configDN ? ValidatedOptions.error : ValidatedOptions.default,
                      isDisabled: !newEntry
                    }
                  ),
                  newEntry && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FormHelperText, { children: _5("Value must be a valid DN") })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Grid, { title: _5("Specifies the attribute to store the time of the last successful login in this attribute in the users directory entry (alwaysRecordLoginAttr)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GridItem, { span: 4, className: "ds-label", children: _5("Always Record Login Attribute") }),
                /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: alwaysRecordLoginAttr,
                    onSelect: this.handleRecordLoginSelect,
                    onClear: this.handleRecordLoginClear,
                    options: this.props.attributes,
                    isOpen: this.state.isRecordLoginOpen,
                    onToggle: this.handleRecordLoginToggle,
                    placeholder: _5("Type an attribute name ..."),
                    noResultsText: _5("There are no matching entries"),
                    ariaLabel: _5("Type an attribute name")
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
                  Checkbox,
                  {
                    id: "alwaysRecordLogin",
                    className: "ds-left-margin",
                    isChecked: alwaysRecordLogin,
                    title: _5("Sets that every entry records its last login time (alwaysRecordLogin)"),
                    onChange: (e, checked) => this.handleCheckboxChange(e, checked),
                    label: _5("Always Record Login")
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Grid, { title: _5("Specifies the attribute to identify which entries are account policy configuration entries (specAttrName)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GridItem, { span: 4, className: "ds-label", children: _5("Specific Attribute") }),
                /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: specAttrName,
                    onSelect: this.handleSpecificAttrSelect,
                    onClear: this.handleSpecificAttrClear,
                    options: this.props.attributes,
                    isOpen: this.state.isSpecificAttrOpen,
                    onToggle: this.handleSpecificAttrToggle,
                    placeholder: _5("Type an attribute name ..."),
                    noResultsText: _5("There are no matching entries"),
                    ariaLabel: _5("Type an attribute name")
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Grid, { title: _5("Specifies the attribute within the policy to use for the account inactivation limit (limitAttrName)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GridItem, { span: 4, className: "ds-label", children: _5("Limit Attribute") }),
                /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: limitAttrName,
                    onSelect: this.handleLimitAttrSelect,
                    onClear: this.handleLimitAttrClear,
                    options: this.props.attributes,
                    isOpen: this.state.isLimitAttrOpen,
                    onToggle: this.handleLimitAttrToggle,
                    placeholder: _5("Type an attribute name ..."),
                    noResultsText: _5("There are no matching entries"),
                    ariaLabel: _5("Type an attribute name")
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Grid, { title: "Specifies the primary time attribute used to evaluate an account policy (stateAttrName)", children: [
                /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GridItem, { span: 4, className: "ds-label", children: _5("State Attribute") }),
                /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: stateAttrName,
                    onSelect: this.handleStateAttrSelect,
                    onClear: this.handleStateAttrClear,
                    options: this.props.attributes,
                    isOpen: this.state.isStateAttrOpen,
                    onToggle: this.handleStateAttrToggle,
                    placeholder: _5("Type an attribute name ..."),
                    noResultsText: _5("There are no matching entries"),
                    ariaLabel: _5("Type an attribute name"),
                    isCreatable: true
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Grid, { title: _5("Provides a backup attribute to evaluate the expiration time if the main state attribute is not present (altStateAttrName)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GridItem, { span: 4, className: "ds-label", children: _5("Alternative State Attribute") }),
                /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: altStateAttrName,
                    onSelect: this.handleAlternativeStateSelect,
                    onClear: this.handleAlternativeStateClear,
                    options: this.props.attributes,
                    isOpen: this.state.isAltStateAttrOpen,
                    onToggle: this.handleAlternativeStateToggle,
                    placeholder: _5("Type an attribute name ..."),
                    noResultsText: _5("There are no matching entries"),
                    ariaLabel: _5("Type an attribute name"),
                    isCreatable: true
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Grid, { title: _5("Check both the 'state attribute', and the 'alternate state attribute' regaredless if the main state attribute is present"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GridItem, { span: 4, className: "ds-label", children: _5("Check All State Attributes") }),
                /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
                  Checkbox,
                  {
                    id: "checkAllStateAttrs",
                    className: "ds-left-margin",
                    isChecked: checkAllStateAttrs,
                    onChange: (e, checked) => this.handleCheckboxChange(e, checked),
                    label: _5("Check Both - State and Alternative State Attributes")
                  }
                ) })
              ] })
            ] })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
          pluginBasicConfig_default,
          {
            rows: this.props.rows,
            serverId: this.props.serverId,
            cn: "Account Policy Plugin",
            pluginName: "Account Policy",
            cmdName: "account-policy",
            savePluginHandler: this.props.savePluginHandler,
            pluginListHandler: this.props.pluginListHandler,
            addNotification: this.props.addNotification,
            toggleLoadingHandler: this.props.toggleLoadingHandler,
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Form, { isHorizontal: true, autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Grid, { title: _5("DN of the shared config entry (nsslapd-pluginarg0)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GridItem, { span: 3, className: "ds-label", children: _5("Shared Config Entry") }),
                configArea !== "" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GridItem, { className: "ds-right-margin", span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
                  TextInput,
                  {
                    value: configArea,
                    type: "text",
                    id: "configArea",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "configArea",
                    readOnlyVariant: "plain"
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
                  Button,
                  {
                    variant: "primary",
                    onClick: this.handleOpenModal,
                    isDisabled: error.configArea || !configArea,
                    children: this.state.sharedConfigExists ? _5("Manage Config") : _5("Create Config")
                  },
                  "manage"
                ) })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
                Button,
                {
                  className: "ds-margin-top-lg",
                  isLoading: saving,
                  spinnerAriaValueText: saving ? _5("Loading") : void 0,
                  variant: "primary",
                  onClick: this.handleSaveConfig,
                  ...extraPrimaryProps,
                  isDisabled: saveBtnDisabled || saving,
                  children: saveBtnText
                },
                "at"
              )
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDelete,
            closeHandler: this.closeConfirmDelete,
            handleChange: this.onChange,
            actionHandler: this.deleteConfig,
            spinning: this.state.modalSpinning,
            item: this.state.configDN,
            checked: this.state.modalChecked,
            mTitle: _5("Delete Account Policy Config Entry"),
            mMsg: _5("Are you sure you want to delete this config entry?"),
            mSpinningMsg: _5("Deleting ..."),
            mBtnName: _5("Delete")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
          WarningModal,
          {
            showModal: this.state.showWarningModal,
            closeHandler: this.closeWarningModal,
            mTitle: _5("Cannot Delete Entry"),
            mMsg: this.state.warningMessage
          }
        )
      ] });
    }
  };
  AccountPolicy.propTypes = {
    rows: import_prop_types6.default.array,
    serverId: import_prop_types6.default.string,
    savePluginHandler: import_prop_types6.default.func,
    pluginListHandler: import_prop_types6.default.func,
    addNotification: import_prop_types6.default.func,
    toggleLoadingHandler: import_prop_types6.default.func
  };
  AccountPolicy.defaultProps = {
    rows: [],
    serverId: ""
  };
  var accountPolicy_default = AccountPolicy;

  // src/lib/plugins/attributeUniqueness.jsx
  var import_react22 = __toESM(require_react(), 1);
  var import_prop_types7 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
  var _6 = cockpit_default.gettext;
  var AttributeUniqueness = class extends import_react22.default.Component {
    componentDidMount() {
      if (this.props.wasActiveList.includes(5)) {
        if (this.state.firstLoad) {
          this.loadConfigs();
        }
      }
    }
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        saving: false,
        loading: true,
        configRows: [],
        modalChecked: false,
        modalSpinning: false,
        tableKey: 0,
        saveBtnDisabled: true,
        error: {},
        configName: "",
        configEnabled: false,
        attrNames: [],
        subtrees: [],
        subtreesOptions: [],
        excludeSubtrees: [],
        excludeSubtreesOptions: [],
        acrossAllSubtrees: false,
        topEntryOc: "",
        subtreeEnriesOc: "",
        _configName: "",
        _configEnabled: false,
        _attrNames: [],
        _subtrees: [],
        _subtreesOptions: [],
        _excludeSubtrees: [],
        _excludeSubtreesOptions: [],
        _acrossAllSubtrees: false,
        _topEntryOc: "",
        _subtreeEnriesOc: "",
        newEntry: false,
        showConfigModal: false,
        showConfirmDelete: false,
        isAttributeNameOpen: false,
        isSubtreesOpen: false,
        isExcludeSubtreesOpen: false
      };
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.onChange = this.onChange.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.handleTypeaheadChange = this.handleTypeaheadChange.bind(this);
      this.loadConfigs = this.loadConfigs.bind(this);
      this.showEditConfigModal = this.showEditConfigModal.bind(this);
      this.handleShowAddConfigModal = this.handleShowAddConfigModal.bind(this);
      this.handleCloseModal = this.handleCloseModal.bind(this);
      this.openModal = this.openModal.bind(this);
      this.cmdOperation = this.cmdOperation.bind(this);
      this.closeConfirmDelete = this.closeConfirmDelete.bind(this);
      this.showConfirmDelete = this.showConfirmDelete.bind(this);
      this.deleteConfig = this.deleteConfig.bind(this);
      this.addConfig = this.addConfig.bind(this);
      this.editConfig = this.editConfig.bind(this);
      this.validateConfig = this.validateConfig.bind(this);
      this.handleAttributeNameSelect = (event, selection) => {
        this.setState({
          attrNames: Array.isArray(selection) ? selection : []
        }, () => {
          this.validateConfig();
        });
      };
      this.handleAttributeNameToggle = (_event, isAttributeNameOpen) => {
        this.setState({
          isAttributeNameOpen
        }, () => {
          this.validateConfig();
        });
      };
      this.handleAttributeNameClear = () => {
        this.setState({
          attrNames: [],
          isAttributeNameOpen: false
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSubtreesSelect = (event, selection) => {
        if (selection === "") {
          this.setState({ isSubtreesOpen: false });
          return;
        }
        this.setState({
          subtrees: Array.isArray(selection) ? selection : []
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSubtreesToggle = (_event, isSubtreesOpen) => {
        this.setState({
          isSubtreesOpen
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSubtreesClear = () => {
        this.setState({
          subtrees: [],
          isSubtreesOpen: false
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSubtreesCreateOption = (newValue) => {
        if (newValue && !this.state.subtreesOptions.includes(newValue)) {
          this.setState({
            subtreesOptions: [...this.state.subtreesOptions, newValue],
            isSubtreesOpen: false
          }, () => {
            this.validateConfig();
          });
        }
      };
      this.handleExcludeSubtreesSelect = (event, selection) => {
        if (selection === "") {
          this.setState({ isExcludeSubtreesOpen: false });
          return;
        }
        this.setState({
          excludeSubtrees: Array.isArray(selection) ? selection : []
        }, () => {
          this.validateConfig();
        });
      };
      this.handleExcludeSubtreesToggle = (_event, isExcludeSubtreesOpen) => {
        this.setState({
          isExcludeSubtreesOpen
        }, () => {
          this.validateConfig();
        });
      };
      this.handleExcludeSubtreesClear = () => {
        this.setState({
          excludeSubtrees: [],
          isExcludeSubtreesOpen: false
        }, () => {
          this.validateConfig();
        });
      };
      this.handleExcludeSubtreesCreateOption = (newValue) => {
        if (newValue && !this.state.excludeSubtreesOptions.includes(newValue)) {
          this.setState({
            excludeSubtreesOptions: [...this.state.excludeSubtreesOptions, newValue],
            isExcludeSubtreesOpen: false
          }, () => {
            this.validateConfig();
          });
        }
      };
    }
    validateConfig() {
      const errObj = {};
      let all_good = true;
      for (const attrList of ["attrNames"]) {
        if (this.state[attrList].length === 0) {
          errObj[attrList] = true;
          all_good = false;
        }
      }
      if (this.state["subtrees"].length === 0 && this.state["subtreeEnriesOc"] === "") {
        errObj["subtrees"] = true;
        errObj["subtreeEnriesOc"] = true;
        all_good = false;
      }
      for (const dn of this.state.subtrees) {
        if (!valid_dn(dn)) {
          errObj.subtrees = true;
          all_good = false;
          break;
        }
      }
      for (const dn of this.state.excludeSubtrees) {
        if (!valid_dn(dn)) {
          errObj.excludeSubtrees = true;
          all_good = false;
          break;
        }
      }
      if (this.state.configName === "") {
        errObj.configName = true;
        all_good = false;
      }
      if (all_good) {
        all_good = false;
        const attrLists = [
          "subtrees",
          "excludeSubtrees",
          "attrNames"
        ];
        for (const check_attr of attrLists) {
          if (!listsEqual(this.state[check_attr], this.state["_" + check_attr])) {
            all_good = true;
            break;
          }
        }
        const configAttrs2 = [
          "acrossAllSubtrees",
          "topEntryOc",
          "subtreeEnriesOc",
          "configEnabled"
        ];
        for (const check_attr of configAttrs2) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabled: !all_good,
        error: errObj
      });
    }
    handleSwitchChange(value) {
      this.setState({
        configEnabled: value
      }, () => {
        this.validateConfig();
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    handleFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validateConfig();
      });
    }
    handleTypeaheadChange(values) {
      const new_values = [];
      for (let val of values) {
        if (val !== "") {
          if (typeof val === "object") {
            val = val.label;
          }
          new_values.push(val);
        }
      }
      this.setState({
        subtrees: new_values
      });
    }
    loadConfigs() {
      this.setState({
        firstLoad: false
      });
      this.props.pluginListHandler();
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "attr-uniq",
        "list"
      ];
      log_cmd("loadConfigs", "Get Attribute Uniqueness Plugin configs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const tableKey = this.state.tableKey + 1;
        this.setState({
          configRows: myObject.items.map((item) => item.attrs),
          tableKey,
          loading: false
        });
      }).fail((err) => {
        if (err !== 0) {
          const errMsg = getApiErrorMessage(err);
          console.log("loadConfigs failed", errMsg);
        }
      });
    }
    showEditConfigModal(name2) {
      this.openModal(name2);
    }
    handleShowAddConfigModal(rowData) {
      this.openModal();
    }
    openModal(name2) {
      if (!name2) {
        this.setState({
          configEntryModalShow: true,
          newEntry: true,
          configEnabled: false,
          configName: "",
          attrNames: [],
          subtrees: [],
          excludeSubtrees: [],
          acrossAllSubtrees: false,
          topEntryOc: "",
          subtreeEnriesOc: "",
          error: {}
        });
      } else {
        let configAttrNamesList = [];
        let configSubtreesList = [];
        let configExcludeSubtreesList = [];
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "attr-uniq",
          "show",
          name2
        ];
        log_cmd("openModal", "Fetch the Attribute Uniqueness Plugin config entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const configEntry = JSON.parse(content).attrs;
          this.setState({
            configEntryModalShow: true,
            saveBtnDisabled: true,
            error: {},
            newEntry: false,
            configName: configEntry.cn === void 0 ? "" : configEntry.cn[0],
            configEnabled: !(configEntry["nsslapd-pluginenabled"] === void 0 || configEntry["nsslapd-pluginenabled"][0] === "off"),
            acrossAllSubtrees: !(configEntry["uniqueness-across-all-subtrees"] === void 0 || configEntry["uniqueness-across-all-subtrees"][0] === "off"),
            topEntryOc: configEntry["uniqueness-top-entry-oc"] === void 0 ? "" : configEntry["uniqueness-top-entry-oc"][0],
            subtreeEnriesOc: configEntry["uniqueness-subtree-entries-oc"] === void 0 ? "" : configEntry["uniqueness-subtree-entries-oc"][0],
            _configEnabled: !(configEntry["nsslapd-pluginenabled"] === void 0 || configEntry["nsslapd-pluginenabled"][0] === "off"),
            _acrossAllSubtrees: !(configEntry["uniqueness-across-all-subtrees"] === void 0 || configEntry["uniqueness-across-all-subtrees"][0] === "off"),
            _topEntryOc: configEntry["uniqueness-top-entry-oc"] === void 0 ? "" : configEntry["uniqueness-top-entry-oc"][0],
            _subtreeEnriesOc: configEntry["uniqueness-subtree-entries-oc"] === void 0 ? "" : configEntry["uniqueness-subtree-entries-oc"][0]
          });
          if (configEntry["uniqueness-attribute-name"] === void 0) {
            this.setState({ attrNames: [], _attrNames: [] });
          } else {
            for (const value of configEntry["uniqueness-attribute-name"]) {
              configAttrNamesList = [...configAttrNamesList, value];
            }
            this.setState({ attrNames: configAttrNamesList, _attrNames: [...configAttrNamesList] });
          }
          if (configEntry["uniqueness-subtrees"] === void 0) {
            this.setState({ subtrees: [], _subtrees: [] });
          } else {
            for (const value of configEntry["uniqueness-subtrees"]) {
              configSubtreesList = [...configSubtreesList, value];
            }
            this.setState({ subtrees: configSubtreesList, _subtrees: [...configSubtreesList] });
          }
          if (configEntry["uniqueness-exclude-subtrees"] === void 0) {
            this.setState({ excludeSubtrees: [], _excludeSubtrees: [] });
          } else {
            for (const value of configEntry["uniqueness-exclude-subtrees"]) {
              configExcludeSubtreesList = [...configExcludeSubtreesList, value];
            }
            this.setState({ excludeSubtrees: configExcludeSubtreesList, _excludeSubtrees: [...configExcludeSubtreesList] });
          }
        }).fail((_113) => {
          this.setState({
            configEntryModalShow: true,
            newEntry: true,
            configName: "",
            attrNames: [],
            subtrees: [],
            excludeSubtrees: [],
            acrossAllSubtrees: false,
            topEntryOc: "",
            subtreeEnriesOc: "",
            configEnabled: false
          });
        });
      }
    }
    handleCloseModal() {
      this.setState({ configEntryModalShow: false });
    }
    cmdOperation(action) {
      const {
        configName,
        configEnabled,
        attrNames,
        subtrees,
        excludeSubtrees,
        acrossAllSubtrees,
        topEntryOc,
        subtreeEnriesOc
      } = this.state;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "attr-uniq",
        action,
        // "add" or "set"
        configName,
        "--enabled",
        configEnabled ? "on" : "off",
        "--across-all-subtrees",
        acrossAllSubtrees ? "on" : "off"
      ];
      if (subtrees.length === 0 && subtreeEnriesOc.length === 0) {
        this.props.addNotification(
          "error",
          _6("There must be at least one Subtree or Subtree Entries OC set")
        );
        return;
      }
      this.setState({
        saving: true
      });
      if (action === "add") {
        cmd = [...cmd, "--attr-name"];
        if (attrNames.length !== 0) {
          for (const value of attrNames) {
            cmd = [...cmd, value];
          }
        }
        if (subtrees.length !== 0) {
          cmd = [...cmd, "--subtree"];
          for (const value of subtrees) {
            cmd = [...cmd, value];
          }
        }
        if (excludeSubtrees.length !== 0) {
          cmd = [...cmd, "--exclude-subtree"];
          for (const value of excludeSubtrees) {
            cmd = [...cmd, value];
          }
        }
        if (topEntryOc.length !== 0) {
          cmd = [...cmd, "--top-entry-oc", topEntryOc];
        }
        if (subtreeEnriesOc.length !== 0) {
          cmd = [...cmd, "--subtree-entries-oc", subtreeEnriesOc];
        }
      } else {
        if (!listsEqual(this.state["attrNames"], this.state["_attrNames"])) {
          cmd = [...cmd, "--attr-name"];
          for (const value of attrNames) {
            cmd = [...cmd, value];
          }
        }
        if (!listsEqual(this.state["subtrees"], this.state["_subtrees"])) {
          cmd = [...cmd, "--subtree"];
          if (subtrees.length === 0) {
            cmd = [...cmd, "delete"];
          } else {
            for (const value of subtrees) {
              cmd = [...cmd, value];
            }
          }
        }
        if (!listsEqual(this.state["excludeSubtrees"], this.state["_excludeSubtrees"])) {
          cmd = [...cmd, "--exclude-subtree"];
          if (excludeSubtrees.length === 0) {
            cmd = [...cmd, "delete"];
          } else {
            for (const value of excludeSubtrees) {
              cmd = [...cmd, value];
            }
          }
        }
        if (this.state["topEntryOc"] !== this.state["_topEntryOc"]) {
          if (topEntryOc.length !== 0) {
            cmd = [...cmd, "--top-entry-oc", topEntryOc];
          } else {
            cmd = [...cmd, "--top-entry-oc", "delete"];
          }
        }
        if (this.state["subtreeEnriesOc"] !== this.state["_subtreeEnriesOc"]) {
          if (subtreeEnriesOc.length !== 0) {
            cmd = [...cmd, "--subtree-entries-oc", subtreeEnriesOc];
          } else {
            cmd = [...cmd, "--subtree-entries-oc", "delete"];
          }
        }
      }
      log_cmd(
        "attrUniqOperation",
        `Do the ${action} operation on the Attribute Uniqueness Plugin`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("attrUniqOperation", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(
            'The $0 operation was successfully done on "$1" entry, please restart the instance for these changes to take effect.',
            action,
            configName
          )
        );
        this.loadConfigs();
        this.handleCloseModal();
        this.setState({
          saving: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_6("Error during the config entry $0 operation - $1"), action, errMsg)
        );
        this.loadConfigs();
        this.handleCloseModal();
        this.setState({
          saving: false
        });
      });
    }
    showConfirmDelete(name2) {
      this.setState({
        showConfirmDelete: true,
        modalChecked: false,
        modalSpinning: false,
        deleteName: name2
      });
    }
    closeConfirmDelete() {
      this.setState({
        showConfirmDelete: false,
        modalChecked: false,
        modalSpinning: false,
        deleteName: ""
      });
    }
    deleteConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "attr-uniq",
        "delete",
        this.state.deleteName
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteConfig", "Delete the Attribute Uniqueness Plugin config entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteConfig", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_6("Config entry $0 was successfully deleted"), this.state.deleteName)
        );
        this.loadConfigs();
        this.handleCloseModal();
        this.closeConfirmDelete();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_6("Error during the config entry removal operation - $0"), errMsg)
        );
        this.loadConfigs();
        this.closeConfirmDelete();
        this.handleCloseModal();
      });
    }
    addConfig() {
      this.cmdOperation("add");
    }
    editConfig() {
      this.cmdOperation("set");
    }
    render() {
      const {
        configEntryModalShow,
        configName,
        attrNames,
        subtrees,
        excludeSubtrees,
        acrossAllSubtrees,
        configEnabled,
        topEntryOc,
        subtreeEnriesOc,
        newEntry
      } = this.state;
      const title = cockpit_default.format(_6("$0 Attribute Uniqueness Plugin Config Entry"), newEntry ? _6("Add") : _6("Edit"));
      let saveBtnName = (newEntry ? _6("Add") : _6("Save")) + _6(" Config");
      const extraPrimaryProps = {};
      if (this.state.saving) {
        if (newEntry) {
          saveBtnName = _6("Adding Config ...");
        } else {
          saveBtnName = _6("Saving Config ...");
        }
        extraPrimaryProps.spinnerAriaValueText = _6("Saving");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: this.state.saving || this.state.modalSpinning ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            title,
            "aria-labelledby": "ds-modal",
            isOpen: configEntryModalShow,
            onClose: this.handleCloseModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
                Button,
                {
                  className: "ds-margin-top",
                  variant: "primary",
                  onClick: newEntry ? this.addConfig : this.editConfig,
                  isDisabled: this.state.saveBtnDisabled || this.state.saving,
                  isLoading: this.state.saving,
                  spinnerAriaValueText: this.state.saving ? _6("Saving") : void 0,
                  ...extraPrimaryProps,
                  children: saveBtnName
                },
                "confirm"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { variant: "link", onClick: this.handleCloseModal, children: _6("Cancel") }, "cancel")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
                Grid,
                {
                  className: "ds-margin-top",
                  title: _6('Sets the name of the plug-in configuration record. (cn) You can use any string, but "attribute_name Attribute Uniqueness" is recommended.'),
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GridItem, { span: 3, className: "ds-label", children: _6("Config Name") }),
                    /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
                      TextInput,
                      {
                        value: configName,
                        type: "text",
                        id: "configName",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "configName",
                        isDisabled: !newEntry,
                        onChange: (e, str) => {
                          this.handleFieldChange(e);
                        },
                        validated: this.state.error.configName || this.state.configName === "" ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Grid, { title: _6("Sets the name of the attribute whose values must be unique. This attribute is multi-valued. (uniqueness-attribute-name)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GridItem, { span: 3, className: "ds-label", children: _6("Attribute Names") }),
                /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: attrNames,
                    onSelect: this.handleAttributeNameSelect,
                    onClear: this.handleAttributeNameClear,
                    options: this.props.attributes,
                    isOpen: this.state.isAttributeNameOpen,
                    onToggle: this.handleAttributeNameToggle,
                    placeholder: _6("Type an attribute name..."),
                    noResultsText: _6("There are no matching attributes"),
                    ariaLabel: "Type an attribute",
                    validated: this.state.error.attrNames ? "error" : "default",
                    isMulti: true
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Grid, { title: _6("Sets the DN under which the plug-in checks for uniqueness of the attributes value. This attribute is multi-valued (uniqueness-subtrees)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GridItem, { span: 3, className: "ds-label", children: _6("Subtrees") }),
                /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
                    dsBasicComponents_default,
                    {
                      selected: subtrees,
                      onSelect: this.handleSubtreesSelect,
                      onClear: this.handleSubtreesClear,
                      options: [""],
                      isOpen: this.state.isSubtreesOpen,
                      onToggle: this.handleSubtreesToggle,
                      placeholder: _6("Type a subtree DN..."),
                      noResultsText: _6("There are no matching entries"),
                      ariaLabel: "Type a subtree DN",
                      validated: this.state.error.subtrees ? "error" : "default",
                      isMulti: true,
                      isCreatable: true,
                      onCreateOption: this.handleSubtreesCreateOption
                    }
                  ),
                  this.state.error.subtrees && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FormHelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HelperTextItem, { variant: "error", children: "You must specify at least one Subtree, or a Subtree Entry Objectclass" }) }) })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Grid, { title: "Sets subtrees that should be excluded from attribute uniqueness. This attribute is multi-valued (uniqueness-exclude-subtrees", children: [
                /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GridItem, { span: 3, className: "ds-label", children: "Excluded Subtrees" }),
                /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: excludeSubtrees,
                    onSelect: this.handleExcludeSubtreesSelect,
                    onClear: this.handleExcludeSubtreesClear,
                    options: [""],
                    isOpen: this.state.isExcludeSubtreesOpen,
                    onToggle: this.handleExcludeSubtreesToggle,
                    placeholder: _6("Type a subtree DN..."),
                    noResultsText: _6("There are no matching entries"),
                    ariaLabel: "Type an exclude subtree DN",
                    validated: this.state.error.excludeSubtrees ? "error" : "default",
                    isMulti: true,
                    isCreatable: true,
                    onCreateOption: this.handleExcludeSubtreesCreateOption
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Grid, { title: _6("Verifies that the value of the attribute set in uniqueness-attribute-name is unique in this subtree (uniqueness-top-entry-oc)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GridItem, { span: 3, className: "ds-label", children: _6("Top Entry OC") }),
                /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
                  FormSelect,
                  {
                    id: "topEntryOc",
                    value: topEntryOc,
                    onChange: (event, value) => {
                      this.handleFieldChange(event);
                    },
                    "aria-label": "FormSelect Input",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FormSelectOption, { value: "", label: "-" }, "no-setting"),
                      this.props.objectClasses.map((attr, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FormSelectOption, { value: attr, label: attr }, attr))
                    ]
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GridItem, { sm: 3, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
                  Checkbox,
                  {
                    id: "acrossAllSubtrees",
                    className: "ds-left-margin",
                    isChecked: acrossAllSubtrees,
                    title: _6("If enabled (on), the plug-in checks that the attribute is unique across all subtrees set. If you set the attribute to off, uniqueness is only enforced within the subtree of the updated entry (uniqueness-across-all-subtrees)"),
                    onChange: (e, checked) => {
                      this.handleFieldChange(e);
                    },
                    label: _6("Across All Subtrees")
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Grid, { title: _6("Verifies if an attribute is unique, if the entry contains the objectclass set in this parameter (uniqueness-subtree-entries-oc)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GridItem, { span: 3, className: "ds-label", children: _6("Subtree Entry's OC") }),
                /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(GridItem, { span: 6, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
                    FormSelect,
                    {
                      id: "subtreeEnriesOc",
                      value: subtreeEnriesOc,
                      onChange: (event, value) => {
                        this.handleFieldChange(event);
                      },
                      "aria-label": "FormSelect Input",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FormSelectOption, { value: "", label: "-" }, "no_setting"),
                        this.props.objectClasses.map((attr, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FormSelectOption, { value: attr, label: attr }, index))
                      ]
                    }
                  ),
                  this.state.error.subtreeEnriesOc && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FormHelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HelperTextItem, { variant: "error", children: "You must specify at least one Subtree, or a Subtree Entry Objectclass" }) }) })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Grid, { className: "ds-margin-bottom", title: _6("Identifies whether or not the config is enabled."), children: [
                /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GridItem, { span: 3, className: "ds-label", children: _6("Enable config") }),
                /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
                  Switch,
                  {
                    id: "configEnabled",
                    label: _6("Configuration is enabled"),
                    labelOff: _6("Configuration is disabled"),
                    isChecked: configEnabled,
                    onChange: (_event, value) => this.handleSwitchChange(value)
                  }
                ) })
              ] })
            ] })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
          pluginBasicConfig_default,
          {
            removeSwitch: true,
            rows: this.props.rows,
            serverId: this.props.serverId,
            cn: "attribute uniqueness",
            pluginName: "Attribute Uniqueness",
            cmdName: "attr-uniq",
            savePluginHandler: this.props.savePluginHandler,
            pluginListHandler: this.props.pluginListHandler,
            addNotification: this.props.addNotification,
            toggleLoadingHandler: this.props.toggleLoadingHandler,
            children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GridItem, { span: 12, children: this.state.loading ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Bullseye, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Spinner, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
                AttrUniqConfigTable,
                {
                  rows: this.state.configRows,
                  editConfig: this.showEditConfigModal,
                  deleteConfig: this.showConfirmDelete
                },
                this.state.tableKey
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(GridItem, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleShowAddConfigModal,
                  className: "ds-margin-top",
                  children: _6("Add Config")
                },
                "add-config"
              ) })
            ] })
          },
          this.state.configRows
        ),
        /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDelete,
            closeHandler: this.closeConfirmDelete,
            handleChange: this.onChange,
            actionHandler: this.deleteConfig,
            spinning: this.state.modalSpinning,
            item: this.state.deleteName,
            checked: this.state.modalChecked,
            mTitle: _6("Delete Attribute Uniqueness Configuration"),
            mMsg: _6("Are you sure you want to delete this configuration?"),
            mSpinningMsg: _6("Deleting attribute uniqueness configuration..."),
            mBtnName: _6("Delete Configuration")
          }
        )
      ] });
    }
  };
  AttributeUniqueness.propTypes = {
    rows: import_prop_types7.default.array,
    serverId: import_prop_types7.default.string,
    savePluginHandler: import_prop_types7.default.func,
    pluginListHandler: import_prop_types7.default.func,
    addNotification: import_prop_types7.default.func,
    toggleLoadingHandler: import_prop_types7.default.func,
    objectClasses: import_prop_types7.default.array
  };
  AttributeUniqueness.defaultProps = {
    rows: [],
    serverId: "",
    objectClasses: []
  };
  var attributeUniqueness_default = AttributeUniqueness;

  // src/lib/plugins/autoMembership.jsx
  var import_react23 = __toESM(require_react(), 1);
  var import_prop_types8 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
  var _7 = cockpit_default.gettext;
  var AutoMembership = class extends import_react23.default.Component {
    componentDidMount() {
      if (this.props.wasActiveList.includes(5)) {
        if (this.state.firstLoad) {
          this.loadDefinitions();
        }
      }
    }
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        definitionRows: [],
        regexRows: [],
        _regexRows: [],
        regexesToDelete: [],
        modalSpinning: false,
        modalChecked: false,
        saving: false,
        savingRegex: false,
        saveBtnDisabled: true,
        saveRegexBtnDisabled: true,
        error: {},
        errorRegex: {},
        // Definition settings
        definitionName: "",
        defaultGroup: "",
        filter: "",
        groupingAttrMember: "",
        groupingAttrEntry: "",
        scope: "",
        _definitionName: "",
        _defaultGroup: "",
        _filter: "",
        _groupingAttrMember: "",
        _groupingAttrEntry: "",
        _scope: "",
        // Regex settings
        regexName: "",
        regexTargetGroup: "",
        regexExclusive: [],
        regexInclusive: [],
        _regexName: "",
        _regexTargetGroup: "",
        _regexExclusive: [],
        _excludeOptions: [],
        _regexInclusive: [],
        isRegexExcludeOpen: false,
        excludeOptions: [],
        isRegexIncludeOpen: false,
        includeOptions: [],
        regexTableKey: 0,
        newDefinitionEntry: false,
        newRegexEntry: false,
        definitionEntryModalShow: false,
        regexEntryModalShow: false,
        showConfirmDelete: false
      };
      const attrs = [...this.props.attributes, "dn"].sort();
      this.attrRows = attrs.map((attr) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FormSelectOption, { value: attr, label: attr }, attr));
      this.handleRegexExcludeSelect = (event, selection) => {
        this.setState({
          regexExclusive: Array.isArray(selection) ? selection : []
        }, () => {
          this.validateRegex();
        });
      };
      this.handleCreateRegexExcludeOption = (newValue) => {
        if (!this.state.excludeOptions.includes(newValue)) {
          this.setState({
            excludeOptions: [...this.state.excludeOptions, newValue],
            isRegexExcludeOpen: false
          });
        }
      };
      this.handleRegexExcludeToggle = (_event, isRegexExcludeOpen) => {
        this.setState({
          isRegexExcludeOpen
        });
      };
      this.handleClearRegexExcludeSelection = () => {
        this.setState({
          regexExclusive: [],
          isRegexExcludeOpen: false
        }, () => {
          this.validateRegex();
        });
      };
      this.handleRegexIncludeSelect = (event, selection) => {
        this.setState({
          regexInclusive: Array.isArray(selection) ? selection : []
        }, () => {
          this.validateRegex();
        });
      };
      this.handleCreateRegexIncludeOption = (newValue) => {
        if (!this.state.includeOptions.includes(newValue)) {
          this.setState({
            includeOptions: [...this.state.includeOptions, newValue],
            isRegexIncludeOpen: false
          });
        }
      };
      this.handleRegexIncludeToggle = (_event, isRegexIncludeOpen) => {
        this.setState({
          isRegexIncludeOpen
        });
      };
      this.handleClearRegexIncludeSelection = () => {
        this.setState({
          regexInclusive: [],
          isRegexIncludeOpen: false
        }, () => {
          this.validateRegex();
        });
      };
      this.validateModal = this.validateModal.bind(this);
      this.validateRegex = this.validateRegex.bind(this);
      this.onChange = this.onChange.bind(this);
      this.handleRegexChange = this.handleRegexChange.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.loadDefinitions = this.loadDefinitions.bind(this);
      this.loadRegexes = this.loadRegexes.bind(this);
      this.openModal = this.openModal.bind(this);
      this.handleCloseModal = this.handleCloseModal.bind(this);
      this.showEditDefinitionModal = this.showEditDefinitionModal.bind(this);
      this.handleShowAddDefinitionModal = this.handleShowAddDefinitionModal.bind(this);
      this.cmdOperation = this.cmdOperation.bind(this);
      this.deleteDefinition = this.deleteDefinition.bind(this);
      this.addDefinition = this.addDefinition.bind(this);
      this.editDefinition = this.editDefinition.bind(this);
      this.openRegexModal = this.openRegexModal.bind(this);
      this.handleCloseRegexModal = this.handleCloseRegexModal.bind(this);
      this.showEditRegexModal = this.showEditRegexModal.bind(this);
      this.handleShowAddRegexModal = this.handleShowAddRegexModal.bind(this);
      this.cmdRegexOperation = this.cmdRegexOperation.bind(this);
      this.deleteRegex = this.deleteRegex.bind(this);
      this.addRegex = this.addRegex.bind(this);
      this.editRegex = this.editRegex.bind(this);
      this.showConfirmDelete = this.showConfirmDelete.bind(this);
      this.closeConfirmDelete = this.closeConfirmDelete.bind(this);
    }
    validateModal() {
      const error = {};
      let all_good = true;
      const dnAttrs = [
        "defaultGroup",
        "scope"
      ];
      const reqAttrs = [
        "definitionName",
        "scope",
        "filter",
        "groupingAttrMember",
        "groupingAttrEntry"
      ];
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          error[attr] = true;
          all_good = false;
        }
      }
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          error[attr] = true;
          all_good = false;
        }
      }
      if (all_good) {
        all_good = false;
        const attrs = [
          "definitionName",
          "defaultGroup",
          "filter",
          "groupingAttrMember",
          "groupingAttrEntry",
          "scope"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
        if (this.state.regexRows.length !== this.state._regexRows.length) {
          all_good = true;
        }
        if (!all_good) {
          for (const row of this.state.regexRows) {
            let found = false;
            for (const orig_row of this.state._regexRows) {
              if (orig_row.cn[0] === row.cn[0]) {
                found = true;
                if (orig_row.automembertargetgroup[0] !== row.automembertargetgroup[0]) {
                  all_good = true;
                  break;
                }
                for (const attr of ["automemberinclusiveregex", "automemberexclusiveregex"]) {
                  if (!listsEqual(orig_row[attr], row[attr])) {
                    all_good = true;
                    break;
                  }
                }
              }
            }
            if (!found) {
              all_good = true;
              break;
            }
          }
          if (!all_good) {
            for (const orig_row of this.state._regexRows) {
              let found = false;
              for (const row of this.state.regexRows) {
                if (orig_row.cn[0] === row.cn[0]) {
                  found = true;
                }
              }
              if (!found) {
                all_good = true;
                break;
              }
            }
          }
        }
      }
      this.setState({
        saveBtnDisabled: !all_good,
        error
      });
    }
    validateRegex() {
      const error = {};
      let all_good = true;
      const dnAttrs = [
        "regexTargetGroup"
      ];
      const reqAttrs = [
        "regexName",
        "regexTargetGroup"
      ];
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          error[attr] = true;
          all_good = false;
        }
      }
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          error[attr] = true;
          all_good = false;
        }
      }
      if (all_good) {
        all_good = false;
        const attrs = [
          "regexTargetGroup"
        ];
        const attrsList = [
          "regexExclusive",
          "regexInclusive"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
        for (const check_attr of attrsList) {
          if (!listsEqual(this.state[check_attr], this.state["_" + check_attr])) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveRegexBtnDisabled: !all_good,
        error
      }, () => {
        this.validateModal();
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    handleFieldChange(e) {
      const value = e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validateModal();
      });
    }
    handleRegexChange(e) {
      const value = e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validateRegex();
      });
    }
    loadDefinitions() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "automember",
        "list",
        "definitions"
      ];
      log_cmd("loadDefinitions", "Get Auto Membership Plugin definitions", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        this.setState({
          definitionRows: myObject.items.map((item) => item.attrs),
          firstLoad: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        if (err !== 0) {
          console.log("loadDefinitions failed", errMsg);
        }
      });
    }
    initRegexRows(rows) {
      for (const row of rows) {
        if (row.automembertargetgroup === void 0) {
          row.automembertargetgroup = "";
        }
        if (row.automemberexclusiveregex === void 0) {
          row.automemberexclusiveregex = [];
        }
        if (row.automemberinclusiveregex === void 0) {
          row.automemberinclusiveregex = [];
        }
      }
    }
    loadRegexes(defName) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "automember",
        "list",
        "regexes",
        defName
      ];
      log_cmd("loadRegexes", "Get Auto Membership Plugin regexes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const regexTableKey = this.state.regexTableKey + 1;
        const rows = myObject.items.map((item) => item.attrs);
        this.initRegexRows(rows);
        this.setState({
          regexRows: rows,
          _regexRows: JSON.parse(JSON.stringify(rows)),
          regexTableKey
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        if (err !== 0) {
          console.log("loadRegexes failed", errMsg);
        }
      });
    }
    showEditDefinitionModal(rowData) {
      this.openModal(rowData);
    }
    handleShowAddDefinitionModal(rowData) {
      this.openModal();
    }
    openModal(name2) {
      if (!name2) {
        this.setState({
          definitionEntryModalShow: true,
          newDefinitionEntry: true,
          regexRows: [],
          definitionName: "",
          defaultGroup: "",
          filter: "",
          groupingAttrMember: "",
          groupingAttrEntry: "",
          scope: "",
          saveBtnDisabled: true
        });
      } else {
        this.loadRegexes(name2);
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "automember",
          "definition",
          name2,
          "show"
        ];
        this.props.toggleLoadingHandler();
        log_cmd("openModal", "Fetch the Auto Membership Plugin definition entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const definitionEntry = JSON.parse(content).attrs;
          this.setState({
            saveBtnDisabled: true,
            definitionEntryModalShow: true,
            newDefinitionEntry: false,
            definitionName: definitionEntry.cn === void 0 ? "" : definitionEntry.cn[0],
            defaultGroup: definitionEntry.automemberdefaultgroup === void 0 ? "" : definitionEntry.automemberdefaultgroup[0],
            filter: definitionEntry.automemberfilter === void 0 ? "" : definitionEntry.automemberfilter[0],
            scope: definitionEntry.automemberscope === void 0 ? "" : definitionEntry.automemberscope[0],
            _definitionName: definitionEntry.cn === void 0 ? "" : definitionEntry.cn[0],
            _defaultGroup: definitionEntry.automemberdefaultgroup === void 0 ? "" : definitionEntry.automemberdefaultgroup[0],
            _filter: definitionEntry.automemberfilter === void 0 ? "" : definitionEntry.automemberfilter[0],
            _scope: definitionEntry.automemberscope === void 0 ? "" : definitionEntry.automemberscope[0]
          });
          if (definitionEntry.automembergroupingattr === void 0) {
            this.setState({
              groupingAttrMember: "",
              groupingAttrEntry: "",
              _groupingAttrMember: "",
              _groupingAttrEntry: ""
            });
          } else {
            const groupingAttr = definitionEntry.automembergroupingattr[0];
            this.setState({
              groupingAttrMember: groupingAttr.split(":")[0],
              groupingAttrEntry: groupingAttr.split(":")[1],
              _groupingAttrMember: groupingAttr.split(":")[0],
              _groupingAttrEntry: groupingAttr.split(":")[1]
            });
          }
          this.props.toggleLoadingHandler();
        }).fail((_113) => {
          this.setState({
            definitionEntryModalShow: true,
            newDefinitionEntry: true,
            regexRows: [],
            definitionName: "",
            defaultGroup: "",
            filter: "",
            groupingAttrMember: "",
            groupingAttrEntry: "",
            scope: "",
            _definitionName: "",
            _defaultGroup: "",
            _filter: "",
            _groupingAttrMember: "",
            _groupingAttrEntry: "",
            _scope: ""
          });
          this.props.toggleLoadingHandler();
        });
      }
    }
    showEditRegexModal(name2) {
      this.openRegexModal(name2);
    }
    handleShowAddRegexModal() {
      this.openRegexModal();
    }
    handleCloseModal() {
      this.setState({
        definitionEntryModalShow: false,
        saving: false
      });
    }
    handleCloseRegexModal() {
      this.setState({ regexEntryModalShow: false });
    }
    cmdOperation(action) {
      const {
        definitionName,
        defaultGroup,
        filter,
        groupingAttrMember,
        groupingAttrEntry,
        scope
      } = this.state;
      if (definitionName === "" || scope === "" || filter === "" || groupingAttrMember === "" || groupingAttrEntry === "") {
        this.props.addNotification(
          "warning",
          _7("Name, Scope, Filter and Grouping Attribute are required.")
        );
      } else {
        let cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "automember",
          "definition",
          definitionName,
          action,
          "--default-group",
          defaultGroup || action === "add" ? defaultGroup : "delete",
          "--filter",
          filter || action === "add" ? filter : "delete",
          "--scope",
          scope || action === "add" ? scope : "delete"
        ];
        cmd = [...cmd, "--grouping-attr"];
        if (groupingAttrMember !== "" && groupingAttrEntry !== "") {
          cmd = [...cmd, `${groupingAttrMember}:${groupingAttrEntry}`];
        } else if (action === "add") {
          cmd = [...cmd, ""];
        } else {
          cmd = [...cmd, "delete"];
        }
        this.setState({
          saving: true
        });
        this.props.toggleLoadingHandler();
        log_cmd(
          "AutoMembershipOperation",
          `Do the ${action} operation on the Auto Membership Plugin`,
          cmd
        );
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          console.info("AutoMembershipOperation", "Result", content);
          this.props.addNotification(
            "success",
            cockpit_default.format(_7('The $0 operation was successfully done on "$1" entry'), action, definitionName)
          );
          this.loadDefinitions();
          this.purgeRegexUpdate();
          this.handleCloseModal();
          this.props.toggleLoadingHandler();
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          if (errMsg.indexOf("nothing to set") === 0) {
            this.props.addNotification(
              "error",
              cockpit_default.format(_7("Error during the definition entry $0 operation - $1"), action, errMsg)
            );
          } else {
            this.purgeRegexUpdate();
          }
          this.loadDefinitions();
          this.handleCloseModal();
          this.props.toggleLoadingHandler();
        });
      }
    }
    purgeRegexUpdate() {
      const { definitionName, regexesToDelete, regexRows } = this.state;
      for (const regexToDelete of regexesToDelete) {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "automember",
          "definition",
          definitionName,
          "regex",
          regexToDelete,
          "delete"
        ];
        log_cmd(
          "AutoMembershipRegexOperation",
          `Do the delete operation on the Auto Membership Plugin Regex Entry`,
          cmd
        );
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          console.info(
            "AutoMembershipRegexOperation",
            "Result",
            `The delete operation was successfully done on "${regexToDelete}" entry`
          );
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.addNotification(
            "error",
            cockpit_default.format(_7('Error during the regex "$0" entry delete operation - $1'), regexToDelete, errMsg)
          );
        });
      }
      for (const row of regexRows) {
        let action = "";
        let regexName = "";
        if (row.needsadd !== void 0) {
          action = "add";
          regexName = row.cn[0];
        } else if (row.needsupdate !== void 0) {
          action = "set";
          regexName = row.cn[0];
        } else {
          continue;
        }
        let cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "automember",
          "definition",
          definitionName,
          "regex",
          regexName,
          action
        ];
        const regexTargetGroup = row.automembertargetgroup[0];
        const regexExclusive = row.automemberexclusiveregex === void 0 ? [] : row.automemberexclusiveregex;
        const regexInclusive = row.automemberinclusiveregex === void 0 ? [] : row.automemberinclusiveregex;
        if (!(action === "add" && regexTargetGroup === 0)) {
          cmd = [...cmd, "--target-group"];
          if (regexTargetGroup) {
            cmd = [...cmd, regexTargetGroup];
          } else if (action === "add") {
            cmd = [...cmd, ""];
          } else {
            cmd = [...cmd, "delete"];
          }
        }
        if (!(action === "add" && regexExclusive.length === 0)) {
          cmd = [...cmd, "--exclusive"];
          if (regexExclusive.length !== 0) {
            for (const regex of regexExclusive) {
              cmd = [...cmd, regex];
            }
          } else if (action === "add") {
            cmd = [...cmd, ""];
          } else {
            cmd = [...cmd, "delete"];
          }
        }
        if (!(action === "add" && regexInclusive.length === 0)) {
          cmd = [...cmd, "--inclusive"];
          if (regexInclusive.length !== 0) {
            for (const regex of regexInclusive) {
              cmd = [...cmd, regex];
            }
          } else if (action === "add") {
            cmd = [...cmd, ""];
          } else {
            cmd = [...cmd, "delete"];
          }
        }
        log_cmd(
          "AutoMembershipRegexOperation",
          `Do the ${action} operation on the Auto Membership Plugin Regex Entry`,
          cmd
        );
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          console.info(
            "AutoMembershipRegexOperation",
            "Result",
            `The ${action} operation was successfully done on "${regexName}" entry`
          );
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.addNotification(
            "error",
            cockpit_default.format(_7('Error during the regex "$0" entry $1 operation - $2'), regexName, action, errMsg)
          );
        });
      }
    }
    showConfirmDelete(definitionName) {
      this.setState({
        showConfirmDelete: true,
        modalChecked: false,
        modalSpinning: false,
        deleteName: definitionName
      });
    }
    closeConfirmDelete() {
      this.setState({
        showConfirmDelete: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    deleteDefinition() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "automember",
        "definition",
        this.state.deleteName,
        "delete"
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteDefinition", "Delete the Auto Membership Plugin definition entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteDefinition", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_7("Definition entry $0 was successfully deleted"), this.state.deleteName)
        );
        this.loadDefinitions();
        this.closeConfirmDelete();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_7("Error during the definition entry removal operation - $0"), errMsg)
        );
        this.loadDefinitions();
        this.closeConfirmDelete();
      });
    }
    addDefinition() {
      this.cmdOperation("add");
    }
    editDefinition() {
      this.cmdOperation("set");
    }
    openRegexModal(name2) {
      if (name2) {
        const regexEntry = this.state.regexRows.filter((row) => row.cn[0] === name2)[0];
        let exclusiveRegexList = [];
        let inclusiveRegexList = [];
        if (regexEntry.automemberexclusiveregex === void 0) {
          this.setState({ regexExclusive: [], _regexExclusive: [] });
        } else {
          for (const value of regexEntry.automemberexclusiveregex) {
            exclusiveRegexList = [...exclusiveRegexList, value];
          }
          this.setState({
            regexExclusive: exclusiveRegexList,
            _regexExclusive: [...exclusiveRegexList]
          });
        }
        if (regexEntry.automemberinclusiveregex === void 0) {
          this.setState({ regexInclusive: [], _regexInclusive: [] });
        } else {
          for (const value of regexEntry.automemberinclusiveregex) {
            inclusiveRegexList = [...inclusiveRegexList, value];
          }
          this.setState({
            regexInclusive: inclusiveRegexList,
            _regexInclusive: [...inclusiveRegexList]
          });
        }
        this.setState({
          regexEntryModalShow: true,
          newRegexEntry: false,
          regexName: regexEntry.cn[0],
          regexTargetGroup: regexEntry.automembertargetgroup === void 0 ? "" : regexEntry.automembertargetgroup[0],
          _regexName: regexEntry.cn[0],
          _regexTargetGroup: regexEntry.automembertargetgroup === void 0 ? "" : regexEntry.automembertargetgroup[0],
          saveRegexBtnDisabled: true
        });
      } else {
        this.setState({
          regexEntryModalShow: true,
          newRegexEntry: true,
          regexName: "",
          regexExclusive: [],
          regexInclusive: [],
          regexTargetGroup: "",
          _regexName: "",
          _regexExclusive: [],
          _regexInclusive: [],
          _regexTargetGroup: "",
          saveRegexBtnDisabled: true
        });
      }
    }
    cmdRegexOperation(action) {
      const {
        regexRows,
        regexName,
        regexExclusive,
        regexInclusive,
        regexTargetGroup
      } = this.state;
      let regexExists = false;
      if (regexRows.some((row) => row.cn[0] === regexName)) {
        regexExists = true;
      }
      if (regexName === "" || regexTargetGroup === "") {
        this.props.addNotification("warning", _7("Name and Target Group are required."));
      } else {
        const regexTableKey = this.state.regexTableKey + 1;
        if (action === "add") {
          if (!regexExists) {
            this.setState((prevState) => ({
              regexRows: [
                ...prevState.regexRows,
                {
                  cn: [regexName],
                  automembertargetgroup: [regexTargetGroup],
                  automemberexclusiveregex: regexExclusive.length !== 0 ? [...regexExclusive] : [],
                  automemberinclusiveregex: regexInclusive.length !== 0 ? [...regexInclusive] : [],
                  needsadd: true
                }
              ],
              regexTableKey
            }), () => {
              this.validateModal();
            });
          } else {
            this.props.addNotification("error", cockpit_default.format(_7('Regex "$0" already exists'), regexName));
          }
        } else if (action === "set") {
          if (regexExists) {
            this.setState({
              regexRows: regexRows.filter((row) => row.cn[0] !== regexName)
            });
            this.setState((prevState) => ({
              regexRows: [
                ...prevState.regexRows,
                {
                  cn: [regexName],
                  automembertargetgroup: [regexTargetGroup],
                  automemberexclusiveregex: regexExclusive.length !== 0 ? [...regexExclusive] : [],
                  automemberinclusiveregex: regexInclusive.length !== 0 ? [...regexInclusive] : [],
                  needsupdate: true
                }
              ],
              regexTableKey
            }), () => {
              this.validateModal();
            });
          } else {
            this.props.addNotification(
              "error",
              cockpit_default.format(_7('Regex "$0" does not exist - "$1" is impossible'), regexName, action)
            );
          }
        }
        this.handleCloseRegexModal();
      }
    }
    deleteRegex(regexName) {
      const { regexRows } = this.state;
      const regexTableKey = this.state.regexTableKey + 1;
      if (regexRows.some((row) => row.cn[0] === regexName)) {
        this.setState({
          regexRows: regexRows.filter((row) => row.cn[0] !== regexName),
          regexTableKey
        });
        this.setState((prevState) => ({
          regexesToDelete: [...prevState.regexesToDelete, regexName]
        }), () => {
          this.validateModal();
        });
      } else {
        this.props.addNotification(
          "error",
          cockpit_default.format(_7('Regex "$0" does not exist - impossible to delete'), regexName)
        );
      }
    }
    addRegex() {
      this.cmdRegexOperation("add");
    }
    editRegex() {
      this.cmdRegexOperation("set");
    }
    render() {
      const {
        regexRows,
        definitionEntryModalShow,
        definitionName,
        defaultGroup,
        scope,
        filter,
        newDefinitionEntry,
        regexEntryModalShow,
        newRegexEntry,
        groupingAttrEntry,
        groupingAttrMember,
        regexName,
        regexExclusive,
        regexInclusive,
        regexTargetGroup,
        saving,
        saveBtnDisabled,
        saveRegexBtnDisabled,
        firstLoad
      } = this.state;
      const title = cockpit_default.format(_7("$0  Auto Membership Plugin Definition Entry"), newDefinitionEntry ? _7("Add") : _7("Edit"));
      const extraPrimaryProps = {};
      let saveBtnText = newDefinitionEntry ? _7("Add Definition") : _7("Save Definition");
      if (saving) {
        saveBtnText = newDefinitionEntry ? _7("Adding ...") : _7("Saving ...");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: saving || firstLoad ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
          Modal,
          {
            variant: ModalVariant.medium,
            title,
            isOpen: definitionEntryModalShow,
            "aria-labelledby": "ds-modal",
            onClose: this.handleCloseModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: newDefinitionEntry ? this.addDefinition : this.editDefinition,
                  isDisabled: saveBtnDisabled || saving,
                  isLoading: saving,
                  spinnerAriaValueText: saving ? _7("Saving") : void 0,
                  ...extraPrimaryProps,
                  children: saveBtnText
                },
                "confirm"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "link", onClick: this.handleCloseModal, children: _7("Cancel") }, "cancel")
            ],
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
                /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Grid, { className: "ds-margin-top", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { className: "ds-label", span: 3, children: _7("Definition Name") }),
                  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
                    TextInput,
                    {
                      value: definitionName,
                      type: "text",
                      id: "definitionName",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "definitionName",
                      onChange: (e, str) => {
                        this.handleFieldChange(e);
                      },
                      isDisabled: !newDefinitionEntry,
                      validated: this.state.error.definitionName || definitionName === "" ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Grid, { title: _7("Sets the subtree DN to search for entries (autoMemberScope)."), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { className: "ds-label", span: 3, children: _7("Subtree Scope") }),
                  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
                    TextInput,
                    {
                      value: scope,
                      type: "text",
                      id: "scope",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "scope",
                      onChange: (e, str) => {
                        this.handleFieldChange(e);
                      },
                      validated: this.state.error.scope || scope === "" ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Grid, { title: _7("Sets a standard LDAP search filter to use to search for matching entries (autoMemberFilter)"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { className: "ds-label", span: 3, children: _7("Entry Filter") }),
                  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
                    TextInput,
                    {
                      value: filter,
                      type: "text",
                      id: "filter",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "filter",
                      onChange: (e, str) => {
                        this.handleFieldChange(e);
                      },
                      validated: this.state.error.filter || filter === "" ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Grid, { title: _7("Specifies the name of the member attribute in the group entry and the attribute in the object entry that supplies the member attribute value, in the format group_member_attr:entry_attr (autoMemberGroupingAttr)"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { className: "ds-label", span: 3, children: _7("Grouping Attribute") }),
                  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
                    FormSelect,
                    {
                      id: "groupingAttrMember",
                      value: groupingAttrMember,
                      onChange: (event, value) => {
                        this.handleFieldChange(event);
                      },
                      "aria-label": "FormSelect Input",
                      validated: groupingAttrMember === "" ? "error" : "default",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FormSelectOption, { value: "", label: "-" }, "no-setting"),
                        this.attrRows
                      ]
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { className: "ds-center", span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ArrowRightIcon, { className: "ds-lower-field-lg" }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
                    FormSelect,
                    {
                      id: "groupingAttrEntry",
                      value: groupingAttrEntry,
                      onChange: (event, value) => {
                        this.handleFieldChange(event);
                      },
                      "aria-label": "FormSelect Input",
                      validated: groupingAttrEntry === "" ? "error" : "default",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FormSelectOption, { value: "", label: "-" }, "no-setting"),
                        this.attrRows
                      ]
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Grid, { title: _7("Sets an optional default or fallback group to add the entry to as a member (autoMemberDefaultGroup)"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { className: "ds-label", span: 3, children: _7("Default Group") }),
                  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
                    TextInput,
                    {
                      value: defaultGroup,
                      type: "text",
                      id: "defaultGroup",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "defaultGroup",
                      onChange: (e, str) => {
                        this.handleFieldChange(e);
                      },
                      validated: this.state.error.defaultGroup ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ) })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("hr", {}),
              /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { className: "ds-center", component: TextVariants.h3, children: _7("Membership Regular Expressions") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
                AutoMembershipRegexTable,
                {
                  rows: regexRows,
                  editConfig: this.showEditRegexModal,
                  deleteConfig: this.deleteRegex
                },
                this.state.regexTableKey
              ) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
                Button,
                {
                  variant: "secondary",
                  onClick: this.handleShowAddRegexModal,
                  className: "ds-margin-top",
                  children: _7("Add Regex")
                }
              ) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("hr", {})
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: _7("Manage Auto Membership Plugin Regex Entry"),
            isOpen: regexEntryModalShow,
            "aria-labelledby": "ds-modal",
            onClose: this.handleCloseRegexModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
                Button,
                {
                  variant: "primary",
                  isDisabled: saveRegexBtnDisabled,
                  onClick: newRegexEntry ? this.addRegex : this.editRegex,
                  children: _7("Save")
                },
                "confirm"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "link", onClick: this.handleCloseRegexModal, children: _7("Cancel") }, "cancel")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { className: "ds-label", span: 3, children: _7("Regex Name") }),
                /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
                  TextInput,
                  {
                    value: regexName,
                    type: "text",
                    id: "regexName",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "regexName",
                    onChange: (e, str) => {
                      this.handleRegexChange(e);
                    },
                    isDisabled: !newRegexEntry,
                    validated: this.state.errorRegex.regexName ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Grid, { title: _7("Sets a single regular expression to use to identify entries to exclude (autoMemberExclusiveRegex)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { className: "ds-label", span: 3, children: _7("Exclusive Regex") }),
                /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: regexExclusive,
                    onSelect: this.handleRegexExcludeSelect,
                    onClear: this.handleClearRegexExcludeSelection,
                    options: [],
                    isOpen: this.state.isRegexExcludeOpen,
                    onToggle: this.handleRegexExcludeToggle,
                    placeholder: _7("Type a regex..."),
                    ariaLabel: "Type a regex",
                    isMulti: true,
                    isCreatable: true,
                    onCreateOption: this.handleCreateRegexExcludeOption
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Grid, { title: _7("Sets a single regular expression to use to identify entries to exclude (autoMemberExclusiveRegex)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { className: "ds-label", span: 3, children: _7("Inclusive Regex") }),
                /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: regexInclusive,
                    onSelect: this.handleRegexIncludeSelect,
                    onClear: this.handleClearRegexIncludeSelection,
                    options: [],
                    isOpen: this.state.isRegexIncludeOpen,
                    onToggle: this.handleRegexIncludeToggle,
                    placeholder: _7("Type a regex..."),
                    ariaLabel: "Type a regex",
                    isMulti: true,
                    isCreatable: true,
                    onCreateOption: this.handleCreateRegexIncludeOption
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Grid, { title: _7("Sets which group to add the entry to as a member, if it meets the regular expression conditions (autoMemberTargetGroup)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { className: "ds-label", span: 3, children: _7("Target Group") }),
                /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
                  TextInput,
                  {
                    value: regexTargetGroup,
                    type: "text",
                    id: "regexTargetGroup",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "regexTargetGroup",
                    onChange: (e, str) => {
                      this.handleRegexChange(e);
                    },
                    validated: this.state.errorRegex.regexTargetGroup ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ) })
              ] })
            ] })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
          pluginBasicConfig_default,
          {
            rows: this.props.rows,
            serverId: this.props.serverId,
            cn: "Auto Membership Plugin",
            pluginName: "Auto Membership",
            cmdName: "automember",
            savePluginHandler: this.props.savePluginHandler,
            pluginListHandler: this.props.pluginListHandler,
            addNotification: this.props.addNotification,
            toggleLoadingHandler: this.props.toggleLoadingHandler,
            children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(GridItem, { span: 12, children: [
              /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
                AutoMembershipDefinitionTable,
                {
                  rows: this.state.definitionRows,
                  editConfig: this.showEditDefinitionModal,
                  deleteConfig: this.showConfirmDelete
                },
                this.state.definitionRows
              ),
              /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleShowAddDefinitionModal,
                  className: "ds-margin-top",
                  children: _7("Add Definition")
                }
              )
            ] }) })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDelete,
            closeHandler: this.closeConfirmDelete,
            handleChange: this.onChange,
            actionHandler: this.deleteDefinition,
            spinning: this.state.modalSpinning,
            item: this.state.deleteName,
            checked: this.state.modalChecked,
            mTitle: _7("Delete Autemebership Configuration"),
            mMsg: _7("Are you sure you want to delete this configuration?"),
            mSpinningMsg: _7("Deleting Configuration..."),
            mBtnName: _7("Delete Configuration")
          }
        )
      ] });
    }
  };
  AutoMembership.propTypes = {
    rows: import_prop_types8.default.array,
    serverId: import_prop_types8.default.string,
    savePluginHandler: import_prop_types8.default.func,
    pluginListHandler: import_prop_types8.default.func,
    addNotification: import_prop_types8.default.func,
    toggleLoadingHandler: import_prop_types8.default.func
  };
  AutoMembership.defaultProps = {
    rows: [],
    serverId: ""
  };
  var autoMembership_default = AutoMembership;

  // src/lib/plugins/dna.jsx
  var import_react24 = __toESM(require_react(), 1);
  var import_prop_types9 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
  var _8 = cockpit_default.gettext;
  var DNAPlugin = class extends import_react24.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        configRows: [],
        sharedConfigRows: [],
        activeTabKey: 1,
        tableKey: 1,
        modalSpinning: false,
        modalChecked: false,
        deleteItem: "",
        loading: true,
        error: {},
        validatedBindMethod: ValidatedOptions.default,
        validatedBindMethodText: "",
        validatedConnProtocol: ValidatedOptions.default,
        validatedConnText: "",
        configName: "",
        prefix: "",
        nextValue: "",
        maxValue: "",
        interval: "",
        magicRegen: "",
        filter: "",
        scope: "",
        remoteBindDN: "",
        remoteBindCred: "",
        sharedConfigEntry: "",
        threshold: "",
        nextRange: "",
        rangeRequestTimeout: "",
        showDeleteConfirm: false,
        saving: false,
        sharedBaseDN: "",
        sharedHostname: "",
        sharedPort: "",
        sharedSecurePort: "",
        sharedRemainingValues: "",
        sharedRemoteBindMethod: "",
        sharedRemoteConnProtocol: "",
        showSharedDeleteConfirm: false,
        savingShared: false,
        newEntry: false,
        configEntryModalShow: false,
        sharedConfigEntryModalShow: false,
        // typeahead
        isOpen: false,
        selected: [],
        saveBtnDisabled: true
      };
      this.handleToggle = (_event, isOpen) => {
        this.setState({
          isOpen
        });
      };
      this.handleClearSelection = () => {
        this.setState({
          selected: [],
          isOpen: false
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSelect = (event, selection) => {
        this.setState({
          selected: Array.isArray(selection) ? selection : []
        }, () => {
          this.validateConfig();
        });
      };
      this.maxValue = 2e7;
      this.onMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateConfig();
        });
      };
      this.onConfigChange = (event, id, min3) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
        }, () => {
          this.validateConfig();
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateConfig();
        });
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.loadConfigs = this.loadConfigs.bind(this);
      this.loadSharedConfigs = this.loadSharedConfigs.bind(this);
      this.validateConfig = this.validateConfig.bind(this);
      this.openModal = this.openModal.bind(this);
      this.handleCloseModal = this.handleCloseModal.bind(this);
      this.showEditConfigModal = this.showEditConfigModal.bind(this);
      this.handleShowAddConfigModal = this.handleShowAddConfigModal.bind(this);
      this.cmdOperation = this.cmdOperation.bind(this);
      this.deleteConfig = this.deleteConfig.bind(this);
      this.addConfig = this.addConfig.bind(this);
      this.editConfig = this.editConfig.bind(this);
      this.openSharedModal = this.openSharedModal.bind(this);
      this.handleCloseSharedModal = this.handleCloseSharedModal.bind(this);
      this.showEditSharedConfigModal = this.showEditSharedConfigModal.bind(this);
      this.deleteSharedConfig = this.deleteSharedConfig.bind(this);
      this.handleEditSharedConfig = this.handleEditSharedConfig.bind(this);
      this.showDeleteConfirm = this.showDeleteConfirm.bind(this);
      this.closeDeleteConfirm = this.closeDeleteConfirm.bind(this);
      this.showSharedDeleteConfirm = this.showSharedDeleteConfirm.bind(this);
      this.closeSharedDeleteConfirm = this.closeSharedDeleteConfirm.bind(this);
      this.onConfirmChange = this.onConfirmChange.bind(this);
    }
    componentDidMount() {
      if (this.props.wasActiveList.includes(5)) {
        if (this.state.firstLoad) {
          this.loadConfigs();
        }
      }
    }
    showDeleteConfirm(item) {
      this.setState({
        deleteItem: item,
        showDeleteConfirm: true,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeDeleteConfirm() {
      this.setState({
        deleteItem: "",
        showDeleteConfirm: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    showSharedDeleteConfirm(item) {
      this.setState({
        deleteItem: item,
        showSharedDeleteConfirm: true,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeSharedDeleteConfirm() {
      this.setState({
        deleteItem: "",
        showSharedDeleteConfirm: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    onConfirmChange(e) {
      this.setState({
        modalChecked: e.target.checked
      });
    }
    handleFieldChange(e, str) {
      this.setState({
        [e.target.id]: e.target.value
      }, () => {
        this.validateConfig();
      });
    }
    loadConfigs() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "dna",
        "list",
        "configs"
      ];
      log_cmd("loadConfigs", "Get DNA Plugin configs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const tableKey = this.state.tableKey + 1;
        this.setState({
          configRows: myObject.items.map((item) => item.attrs),
          tableKey,
          loading: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        if (err !== 0) {
          console.log("loadConfigs failed", errMsg);
        }
        this.setState({
          loading: false
        });
      });
    }
    loadSharedConfigs(basedn) {
      if (basedn === "") {
        this.setState({
          sharedConfigRows: [],
          loading: false
        });
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "dna",
        "list",
        "shared-configs",
        basedn
      ];
      log_cmd("loadSharedConfigs", "Get DNA Plugin shared configs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        this.setState({
          sharedConfigRows: myObject.items.map((item) => item.attrs),
          firstLoad: false,
          loading: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        if (err !== 0) {
          console.log("loadSharedConfigs failed", errMsg);
        }
      });
    }
    showEditConfigModal(rowData) {
      this.openModal(rowData);
    }
    handleShowAddConfigModal() {
      this.openModal();
    }
    openModal(name2) {
      if (!name2) {
        this.setState({
          configEntryModalShow: true,
          activeTabKey: 1,
          newEntry: true,
          configName: "",
          selected: [],
          prefix: "",
          nextValue: 1,
          maxValue: -1,
          interval: 1,
          magicRegen: "",
          filter: "",
          scope: "",
          remoteBindDN: "",
          remoteBindCred: "",
          sharedConfigEntry: "",
          threshold: 1,
          nextRange: "",
          rangeRequestTimeout: 600,
          sharedConfigRows: [],
          saveBtnDisabled: true,
          error: {}
        });
      } else {
        let dnaTypeList = [];
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "dna",
          "config",
          name2,
          "show"
        ];
        log_cmd("openModal", "Fetch the DNA Plugin config entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const configEntry = JSON.parse(content).attrs;
          let sharedCfgDN = "";
          if ("dnasharedcfgdn" in configEntry) {
            sharedCfgDN = configEntry.dnasharedcfgdn[0];
          }
          configEntry.dnaprefix === void 0 ? configEntry.dnaprefix = "" : configEntry.dnaprefix = configEntry.dnaprefix[0];
          configEntry.dnanextvalue === void 0 ? configEntry.dnanextvalue = "" : configEntry.dnanextvalue = configEntry.dnanextvalue[0];
          configEntry.dnamaxvalue === void 0 ? configEntry.dnamaxvalue = "" : configEntry.dnamaxvalue = configEntry.dnamaxvalue[0];
          configEntry.dnainterval === void 0 ? configEntry.dnainterval = "" : configEntry.dnainterval = configEntry.dnainterval[0];
          configEntry.dnamagicregen === void 0 ? configEntry.dnamagicregen = "" : configEntry.dnamagicregen = configEntry.dnamagicregen[0];
          configEntry.dnafilter === void 0 ? configEntry.dnafilter = "" : configEntry.dnafilter = configEntry.dnafilter[0];
          configEntry.dnascope === void 0 ? configEntry.dnascope = "" : configEntry.dnascope = configEntry.dnascope[0];
          configEntry.dnaremotebinddn === void 0 ? configEntry.dnaremotebinddn = "" : configEntry.dnaremotebinddn = configEntry.dnaremotebinddn[0];
          configEntry.dnaremotebindcred === void 0 ? configEntry.dnaremotebindcred = "" : configEntry.dnaremotebindcred = configEntry.dnaremotebindcred[0];
          configEntry.dnasharedcfgdn === void 0 ? configEntry.dnasharedcfgdn = "" : configEntry.dnasharedcfgdn = configEntry.dnasharedcfgdn[0];
          configEntry.dnathreshold === void 0 ? configEntry.dnathreshold = "" : configEntry.dnathreshold = configEntry.dnathreshold[0];
          configEntry.dnanextrange === void 0 ? configEntry.dnanextrange = "" : configEntry.dnanextrange = configEntry.dnanextrange[0];
          configEntry.dnarangerequesttimeout === void 0 ? configEntry.dnarangerequesttimeout = "" : configEntry.dnarangerequesttimeout = configEntry.dnarangerequesttimeout[0];
          this.setState({
            configEntryModalShow: true,
            newEntry: false,
            activeTabKey: 1,
            configName: configEntry.cn[0],
            prefix: configEntry.dnaprefix,
            nextValue: Number(configEntry.dnanextvalue) === 0 ? 1 : Number(configEntry.dnanextvalue),
            maxValue: Number(configEntry.dnamaxvalue) === 0 ? -1 : Number(configEntry.dnamaxvalue),
            interval: Number(configEntry.dnainterval) === 0 ? 1 : Number(configEntry.dnainterval),
            magicRegen: configEntry.dnamagicregen,
            filter: configEntry.dnafilter,
            scope: configEntry.dnascope,
            remoteBindDN: configEntry.dnaremotebinddn,
            remoteBindCred: configEntry.dnaremotebindcred,
            sharedConfigEntry: configEntry.dnasharedcfgdn,
            threshold: Number(configEntry.dnathreshold) === 0 ? 1 : Number(configEntry.dnathreshold),
            nextRange: configEntry.dnanextrange,
            rangeRequestTimeout: Number(configEntry.dnarangerequesttimeout) === 0 ? 600 : Number(configEntry.dnarangerequesttimeout),
            // Preserve original values
            _prefix: configEntry.dnaprefix,
            _nextValue: Number(configEntry.dnanextvalue) === 0 ? 1 : Number(configEntry.dnanextvalue),
            _maxValue: Number(configEntry.dnamaxvalue) === 0 ? -1 : Number(configEntry.dnamaxvalue),
            _interval: Number(configEntry.dnainterval) === 0 ? 1 : Number(configEntry.dnainterval),
            _magicRegen: configEntry.dnamagicregen,
            _filter: configEntry.dnafilter,
            _scope: configEntry.dnascope,
            _remoteBindDN: configEntry.dnaremotebinddn,
            _remoteBindCred: configEntry.dnaremotebindcred,
            _sharedConfigEntry: configEntry.dnasharedcfgdn,
            _threshold: Number(configEntry.dnathreshold) === 0 ? 1 : Number(configEntry.dnathreshold),
            _nextRange: configEntry.dnanextrange,
            _rangeRequestTimeout: Number(configEntry.dnarangerequesttimeout) === 0 ? 600 : Number(configEntry.dnarangerequesttimeout),
            saveBtnDisabled: true,
            error: {}
          }, () => {
            this.loadSharedConfigs(sharedCfgDN);
          });
          if (configEntry.dnatype === void 0) {
            this.setState({ selected: [], _selected: [] });
          } else {
            for (const value of configEntry.dnatype) {
              dnaTypeList = [...dnaTypeList, value];
            }
            this.setState({ selected: dnaTypeList, _selected: [...dnaTypeList] });
          }
        }).fail((_113) => {
          this.setState({
            configEntryModalShow: true,
            newEntry: true,
            configName: "",
            selected: [],
            prefix: "",
            nextValue: "",
            maxValue: "",
            interval: "",
            magicRegen: "",
            filter: "",
            scope: "",
            remoteBindDN: "",
            remoteBindCred: "",
            sharedConfigEntry: "",
            threshold: "",
            nextRange: "",
            rangeRequestTimeout: "",
            saveBtnDisabled: true
          });
        });
      }
    }
    showEditSharedConfigModal(sharedName) {
      this.openSharedModal(sharedName);
    }
    handleCloseModal() {
      this.setState({ configEntryModalShow: false });
    }
    handleCloseSharedModal() {
      this.setState({ sharedConfigEntryModalShow: false });
    }
    cmdOperation(action, muteError) {
      const {
        configName,
        selected,
        prefix,
        nextValue,
        maxValue,
        interval: interval2,
        magicRegen,
        filter,
        scope,
        remoteBindDN,
        remoteBindCred,
        sharedConfigEntry,
        threshold: threshold2,
        nextRange,
        rangeRequestTimeout
      } = this.state;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "dna",
        "config",
        configName,
        action,
        "--prefix",
        prefix || action === "add" ? prefix : "delete",
        "--next-value=" + (nextValue || action === "add" ? nextValue : "delete"),
        "--max-value=" + (maxValue || action === "add" ? maxValue : "delete"),
        "--interval=" + (interval2 || action === "add" ? interval2 : "delete"),
        "--magic-regen",
        magicRegen || action === "add" ? magicRegen : "delete",
        "--filter",
        filter || action === "add" ? filter : "delete",
        "--scope",
        scope || action === "add" ? scope : "delete",
        "--remote-bind-dn",
        remoteBindDN || action === "add" ? remoteBindDN : "delete",
        "--remote-bind-cred",
        remoteBindCred || action === "add" ? remoteBindCred : "delete",
        "--shared-config-entry",
        sharedConfigEntry || action === "add" ? sharedConfigEntry : "delete",
        "--threshold=" + (threshold2 || action === "add" ? threshold2 : "delete"),
        "--next-range",
        nextRange || action === "add" ? nextRange : "delete",
        "--range-request-timeout=" + (rangeRequestTimeout || action === "add" ? rangeRequestTimeout : "delete")
      ];
      if (!(action === "add" && selected.length === 0)) {
        cmd = [...cmd, "--type"];
        if (selected.length !== 0) {
          for (const value of selected) {
            cmd = [...cmd, value];
          }
        } else if (action === "add") {
          cmd = [...cmd, ""];
        } else {
          cmd = [...cmd, "delete"];
        }
      }
      this.setState({
        saving: true
      });
      log_cmd("DNAOperation", `Do the ${action} operation on the DNA Plugin`, cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("DNAOperation", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_8('The $0 operation was successfully done on "$1" entry'), action, configName)
        );
        this.loadConfigs();
        this.handleCloseModal();
        this.setState({
          saving: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        if (muteError !== true) {
          this.props.addNotification(
            "error",
            cockpit_default.format(_8("Error during the config entry $0 operation - $1"), action, errMsg)
          );
        }
        this.loadConfigs();
        this.handleCloseModal();
        this.setState({
          saving: false
        });
      });
    }
    deleteConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "dna",
        "config",
        this.state.deleteItem,
        "delete"
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteConfig", "Delete the DNA Plugin config entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteConfig", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_8("Config entry $0 was successfully deleted"), this.state.deleteItem)
        );
        this.closeDeleteConfirm();
        this.loadConfigs();
        this.handleCloseModal();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_8("Error during the config entry removal operation - $0"), errMsg)
        );
        this.closeDeleteConfirm();
        this.loadConfigs();
        this.handleCloseModal();
      });
    }
    addConfig(muteError) {
      this.cmdOperation("add", muteError);
    }
    editConfig(muteError) {
      this.cmdOperation("set", muteError);
    }
    openSharedModal(sharedName) {
      if (sharedName) {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "dna",
          "config",
          this.state.configName,
          "shared-config-entry",
          sharedName,
          "show"
        ];
        log_cmd("openSharedModal", "Fetch the DNA Plugin shared config entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const configEntry = JSON.parse(content).attrs;
          configEntry.dnahostname === void 0 ? configEntry.dnahostname = "" : configEntry.dnahostname = configEntry.dnahostname[0];
          configEntry.dnaportnum === void 0 ? configEntry.dnaportnum = "" : configEntry.dnaportnum = configEntry.dnaportnum[0];
          configEntry.dnasecureportnum === void 0 ? configEntry.dnasecureportnum = "" : configEntry.dnasecureportnum = configEntry.dnasecureportnum[0];
          configEntry.dnaremainingvalues === void 0 ? configEntry.dnaremainingvalues = "" : configEntry.dnaremainingvalues = configEntry.dnaremainingvalues[0];
          configEntry.dnaremotebindmethod === void 0 ? configEntry.dnaremotebindmethod = "" : configEntry.dnaremotebindmethod = configEntry.dnaremotebindmethod[0];
          configEntry.dnaremoteconnprotocol === void 0 ? configEntry.dnaremoteconnprotocol = "" : configEntry.dnaremoteconnprotocol = configEntry.dnaremoteconnprotocol[0];
          this.setState({
            sharedConfigEntryModalShow: true,
            sharedHostname: configEntry.dnahostname,
            sharedPort: configEntry.dnaportnum,
            sharedSecurePort: configEntry.dnasecureportnum,
            sharedRemainingValues: configEntry.dnaremainingvalues,
            sharedRemoteBindMethod: configEntry.dnaremotebindmethod,
            sharedRemoteConnProtocol: configEntry.dnaremoteconnprotocol,
            // Preserve settings
            _sharedRemoteBindMethod: configEntry.dnaremotebindmethod,
            _sharedRemoteConnProtocol: configEntry.dnaremoteconnprotocol,
            saveBtnDisabled: true
          });
        }).fail((_113) => {
          this.setState({
            sharedConfigEntryModalShow: true,
            sharedBaseDN: "",
            sharedHostname: "",
            sharedPort: "",
            sharedSecurePort: "",
            sharedRemainingValues: "",
            sharedRemoteBindMethod: "",
            sharedRemoteConnProtocol: ""
          });
        });
      } else {
        this.setState({
          sharedConfigEntryModalShow: true,
          sharedBaseDN: "",
          sharedHostname: "",
          sharedPort: "",
          sharedSecurePort: "",
          sharedRemainingValues: "",
          sharedRemoteBindMethod: "",
          sharedRemoteConnProtocol: ""
        });
      }
    }
    handleEditSharedConfig() {
      const {
        configName,
        sharedHostname,
        sharedPort,
        sharedRemoteBindMethod,
        sharedRemoteConnProtocol
      } = this.state;
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "dna",
        "config",
        configName,
        "shared-config-entry",
        sharedHostname + ":" + sharedPort,
        "set",
        "--remote-bind-method",
        sharedRemoteBindMethod || "delete",
        "--remote-conn-protocol",
        sharedRemoteConnProtocol || "delete"
      ];
      this.setState({
        savingShared: true
      });
      log_cmd(
        "handleEditSharedConfig",
        `Do the set operation on the DNA Plugin Shared Entry`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        this.props.addNotification(
          "success",
          cockpit_default.format(_8('The set operation was successfully done on "$0:$1" entry'), sharedHostname, sharedPort)
        );
        this.loadSharedConfigs(this.state.sharedConfigEntry);
        this.handleCloseSharedModal();
        this.setState({
          savingShared: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_8("Error during the config entry set operation - $0"), errMsg)
        );
        this.loadSharedConfigs(this.state.sharedConfigEntry);
        this.handleCloseSharedModal();
        this.setState({
          savingShared: false
        });
      });
    }
    deleteSharedConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "dna",
        "config",
        this.state.configName,
        "shared-config-entry",
        this.state.deleteItem,
        "delete"
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteSharedConfig", "Delete the DNA Plugin Shared config entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteSharedConfig", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_8("Shared config entry $0 was successfully deleted"), this.state.deleteItem)
        );
        this.closeSharedDeleteConfirm();
        this.loadSharedConfigs(this.state.sharedConfigEntry);
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_8("Error during the shared config entry removal operation - $0"), errMsg)
        );
        this.closeSharedDeleteConfirm();
        this.loadSharedConfigs(this.state.sharedConfigEntry);
      });
    }
    validateSharedConfig(adding) {
      let validatedBindMethod = ValidatedOptions.default;
      let validatedBindMethodText = "";
      let validatedConnProtocol = ValidatedOptions.default;
      let validatedConnText = "";
      if (this.state.sharedRemoteBindMethod === "SSL" && this.state.sharedRemoteConnProtocol !== "TLS") {
        validatedBindMethodText = _8("You can not use 'SSL' if the connection protocol is not 'TLS'");
        validatedBindMethod = ValidatedOptions.error;
      } else if (this.state.sharedRemoteBindMethod.startsWith("SASL") && this.state.sharedRemoteConnProtocol === "TLS") {
        validatedBindMethodText = _8("You can not use a 'SASL' method if the connection protocol is 'TLS'");
        validatedBindMethod = ValidatedOptions.error;
      } else if (this.state.sharedRemoteBindMethod === "" && this.state.sharedRemoteConnProtocol !== "" || this.state.sharedRemoteBindMethod !== "" && this.state.sharedRemoteConnProtocol === "") {
        validatedBindMethodText = _8("You must either set, or unset, both preferences");
        validatedBindMethod = ValidatedOptions.error;
      }
      if (this.state.sharedRemoteConnProtocol === "TLS" && this.state.sharedRemoteBindMethod.startsWith("SASL/")) {
        validatedConnText = _8("You can not use the 'TLS' protocol if the BindMethod is a 'SASL' method");
        validatedConnProtocol = ValidatedOptions.error;
      } else if (this.state.sharedRemoteConnProtocol === "LDAP" && this.state.sharedRemoteBindMethod === "SSL") {
        validatedConnText = _8("You can not use the 'LDAP' protocol if the BindMethod is a 'TLS'");
        validatedConnProtocol = ValidatedOptions.error;
      } else if (this.state.sharedRemoteConnProtocol === "" && this.state.sharedRemoteBindMethod !== "" || this.state.sharedRemoteConnProtocol !== "" && this.state.sharedRemoteBindMethod === "") {
        validatedConnText = _8("You must either set, or unset, both preferences");
        validatedConnProtocol = ValidatedOptions.error;
      }
      let saveNotOK = validatedBindMethod !== ValidatedOptions.default || validatedConnProtocol !== ValidatedOptions.default;
      if (!adding && !saveNotOK) {
        if (this.state._sharedRemoteConnProtocol === this.state.sharedRemoteConnProtocol && this.state._sharedRemoteBindMethod === this.state.sharedRemoteBindMethod) {
          saveNotOK = true;
        }
      }
      return {
        validatedBindMethodText,
        validatedBindMethod,
        validatedConnText,
        validatedConnProtocol,
        saveSharedNotOK: saveNotOK
      };
    }
    validateConfig() {
      const error = {};
      let all_good = true;
      const dnAttrs = [
        "sharedConfigEntry",
        "scope"
      ];
      const reqAttrs = [
        "configName",
        "nextValue",
        "filter",
        "scope"
      ];
      if (this.state.selected === "" || this.state.selected.length === 0) {
        all_good = false;
      }
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          error[attr] = true;
          all_good = false;
        }
      }
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          error[attr] = true;
          all_good = false;
        }
      }
      if (all_good) {
        all_good = false;
        const attrs = [
          "maxValue",
          "interval",
          "magicRegen",
          "filter",
          "scope",
          "nextValue",
          "remoteBindDN",
          "remoteBindCred",
          "sharedConfigEntry",
          "threshold",
          "nextRange",
          "rangeRequestTimeout"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
        if (!listsEqual(this.state.selected, this.state._selected)) {
          all_good = true;
        }
      }
      this.setState({
        saveBtnDisabled: !all_good,
        error
      });
    }
    render() {
      const {
        sharedConfigRows,
        configEntryModalShow,
        configName,
        newEntry,
        rangeRequestTimeout,
        sharedConfigEntry,
        sharedConfigEntryModalShow,
        sharedHostname,
        sharedPort,
        sharedSecurePort,
        sharedRemainingValues,
        sharedRemoteBindMethod,
        sharedRemoteConnProtocol,
        magicRegen,
        scope,
        filter,
        selected,
        nextValue,
        maxValue,
        interval: interval2,
        saving,
        savingShared,
        saveBtnDisabled,
        threshold: threshold2,
        error
      } = this.state;
      let sharedResult = {};
      const bindMethodOptions = [
        { value: "", label: "None" },
        { value: "SIMPLE", label: "SIMPLE" },
        { value: "SSL", label: "SSL" },
        { value: "SASL/GSSAPI", label: "SASL/GSSAPI" },
        { value: "SASL/DIGEST-MD5", label: "SASL/DIGEST-MD5" }
      ];
      const connProtocolOptions = [
        { value: "", label: "None" },
        { value: "LDAP", label: "LDAP" },
        { value: "TLS", label: "TLS" }
      ];
      const modalConfigFields = {
        prefix: {
          name: _8("Prefix"),
          value: this.state.prefix,
          id: "prefix",
          type: "text",
          help: _8("Defines a prefix that can be prepended to the generated number values for the attribute (dnaPrefix)")
        },
        remoteBindDN: {
          name: _8("Remote Bind DN"),
          value: this.state.remoteBindDN,
          id: "remoteBindDN",
          type: "text",
          help: _8("Specifies the Replication Manager DN (dnaRemoteBindDN)")
        },
        remoteBindCred: {
          name: _8("Remote Bind Credentials"),
          value: this.state.remoteBindCred,
          id: "remoteBindCred",
          type: "text",
          help: _8("Specifies the Replication Manager's password (dnaRemoteBindCred)")
        },
        nextRange: {
          name: _8("Next Range"),
          value: this.state.nextRange,
          id: "nextRange",
          type: "text",
          help: _8("Defines the next range to use when the current range is exhausted.  Format is '####-####', or '1000-5000' (dnaNextRange).")
        }
      };
      sharedResult = this.validateSharedConfig(newEntry);
      let saveBtnName;
      let saveSharedBtnName = _8("Save Shared Config");
      if (newEntry) {
        saveBtnName = _8("Add Config");
      } else {
        saveBtnName = _8("Save Config");
      }
      const extraPrimaryProps = {};
      if (saving) {
        if (newEntry) {
          saveBtnName = _8("Adding Config ...");
        } else {
          saveBtnName = _8("Saving Config ...");
        }
        saveSharedBtnName = _8("Saving Config ...");
        extraPrimaryProps.spinnerAriaValueText = _8("Saving");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: saving || savingShared ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: newEntry ? _8("Create DNA Config Entry") : _8("Edit DNA Config Entry"),
            isOpen: configEntryModalShow,
            "aria-labelledby": "ds-modal",
            onClose: this.handleCloseModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                Button,
                {
                  isDisabled: saveBtnDisabled || saving,
                  variant: "primary",
                  onClick: newEntry ? this.addConfig : this.editConfig,
                  isLoading: saving,
                  spinnerAriaValueText: saving ? _8("Saving") : void 0,
                  ...extraPrimaryProps,
                  children: saveBtnName
                },
                "saveshared"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { variant: "link", onClick: this.handleCloseModal, children: _8("Cancel") }, "cancel")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TabTitleText, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { children: _8("DNA Configuration") }) }), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Form, { className: "ds-margin-top-xlg", isHorizontal: true, autoComplete: "off", children: [
                /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Grid, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 3, className: "ds-label", children: _8("Config Name") }),
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                    TextInput,
                    {
                      value: configName,
                      type: "text",
                      id: "configName",
                      "aria-describedby": "configName",
                      name: "configName",
                      onChange: (e, str) => this.handleFieldChange(e, str),
                      isDisabled: !newEntry,
                      validated: error.configName ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Grid, { title: _8("Sets which attributes that will have unique numbers generated for them (dnaType)."), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 3, className: "ds-label", children: _8("DNA Managed Attributes") }),
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                    dsBasicComponents_default,
                    {
                      selected,
                      onSelect: this.handleSelect,
                      onClear: this.handleClearSelection,
                      options: this.props.attributes,
                      isOpen: this.state.isOpen,
                      onToggle: this.handleToggle,
                      placeholder: _8("Type an attribute..."),
                      ariaLabel: "Type an attribute",
                      validated: selected.length === 0 ? "error" : "default",
                      isMulti: true
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Grid, { title: _8("Sets an LDAP filter to use to search for and identify the entries to which to apply the distributed numeric assignment range (dnaFilter)"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 3, className: "ds-label", children: _8("Filter") }),
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                    TextInput,
                    {
                      value: filter,
                      type: "text",
                      id: "filter",
                      "aria-describedby": "filter",
                      name: "filter",
                      onChange: (e, str) => this.handleFieldChange(e, str),
                      validated: error.filter ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Grid, { title: _8("Sets the base DN to search for entries to which to apply the distributed numeric assignment (dnaScope)"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 3, className: "ds-label", children: _8("Subtree Scope") }),
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                    TextInput,
                    {
                      value: scope,
                      type: "text",
                      id: "scope",
                      "aria-describedby": "scope",
                      name: "scope",
                      onChange: (e, str) => this.handleFieldChange(e, str),
                      validated: error.scope ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Grid, { title: _8("Gives the next available number which can be assigned (dnaNextValue)"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 3, className: "ds-label", children: _8("Next Value") }),
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                    NumberInput,
                    {
                      value: nextValue,
                      min: 1,
                      max: this.maxValue,
                      onMinus: () => {
                        this.onMinusConfig("nextValue");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nextValue", 1);
                      },
                      onPlus: () => {
                        this.onPlusConfig("nextValue");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 8
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Grid, { title: _8("Sets the maximum value that can be assigned for the range, default is -1 (dnaMaxValue)"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 3, className: "ds-label", children: _8("Max Value") }),
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                    NumberInput,
                    {
                      value: maxValue,
                      min: -1,
                      max: this.maxValue,
                      onMinus: () => {
                        this.onMinusConfig("maxValue");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "maxValue", -1);
                      },
                      onPlus: () => {
                        this.onPlusConfig("maxValue");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 8
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Grid, { title: _8("Sets a user-defined value that instructs the plug-in to assign a new value for the entry (dnaMagicRegen)"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 3, className: "ds-label", children: _8("Magic Regeneration Value") }),
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                    TextInput,
                    {
                      value: magicRegen,
                      type: "text",
                      id: "magicRegen",
                      "aria-describedby": "magicRegen",
                      name: "magicRegen",
                      onChange: (e, str) => this.handleFieldChange(e, str),
                      validated: error.magicRegen ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ) })
                ] }),
                Object.entries(modalConfigFields).map(([id, content]) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Grid, { title: content.help, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { className: "ds-label", span: 3, children: content.name }),
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                    TextInput,
                    {
                      value: content.value,
                      type: content.type,
                      id: content.id,
                      "aria-describedby": content.name,
                      name: content.name,
                      onChange: (e, str) => this.handleFieldChange(e, str),
                      validated: error[content.id] ? ValidatedOptions.error : ValidatedOptions.default
                    },
                    content.name
                  ) })
                ] }, content.name)),
                /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Grid, { title: _8("Sets a threshold of remaining available numbers in the range. When the server hits the threshold, it sends a request for a new range (dnaThreshold)"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 3, className: "ds-label", children: _8("Threshold") }),
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                    NumberInput,
                    {
                      value: threshold2,
                      min: 1,
                      max: this.maxValue,
                      onMinus: () => {
                        this.onMinusConfig("threshold");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "threshold", 1);
                      },
                      onPlus: () => {
                        this.onPlusConfig("threshold");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 8
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Grid, { title: _8("Sets a timeout period, in seconds, for range requests so that the server does not stall waiting on a new range from one server and can request a range from a new server (dnaRangeRequestTimeout)"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 3, className: "ds-label", children: _8("Range Request Timeout") }),
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                    NumberInput,
                    {
                      value: rangeRequestTimeout,
                      min: 1,
                      max: this.maxValue,
                      onMinus: () => {
                        this.onMinusConfig("rangeRequestTimeout");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "rangeRequestTimeout", 1);
                      },
                      onPlus: () => {
                        this.onPlusConfig("rangeRequestTimeout");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 8
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Grid, { title: _8("Sets an interval, or increment, to add to the next DNA assigned number. If the next DNA number is '10', and the 'interval' is '1000', then the assigned value in the entry will be '1010' (dnaInterval)"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 3, className: "ds-label", children: _8("Number Interval") }),
                  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                    NumberInput,
                    {
                      value: interval2,
                      min: 1,
                      max: this.maxValue,
                      onMinus: () => {
                        this.onMinusConfig("interval");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "interval", 1);
                      },
                      onPlus: () => {
                        this.onPlusConfig("interval");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 8
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("hr", {})
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
                Tab,
                {
                  eventKey: 2,
                  title: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TabTitleText, { children: _8("Shared Config Settings") }),
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                      Tooltip,
                      {
                        content: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: _8("The DNA Shared Config Entry is an entry in the database that DNA configurations about remote replicas are stored under.  Think of the Shared Config Entry as a container of DNA remote configurations.  These remote configurations are only used if the database is being replicated, otherwise these settings can be ignored. This entry must already be created prior to setting the <b> Shared Config Entry</b> field.") }),
                        children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("a", { className: "ds-font-size-sm", children: _8("What is a Shared Config Entry?") })
                      }
                    ) }),
                    /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Form, { className: "ds-margin-top-lg", isHorizontal: true, autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Grid, { title: _8("Defines a container entry DN for DNA remote server configuration that the servers can use to transfer ranges between one another (dnaSharedCfgDN)"), children: [
                      /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 3, className: "ds-label", children: _8("Shared Config Entry DN") }),
                      /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                        TextInput,
                        {
                          value: sharedConfigEntry,
                          type: "text",
                          id: "sharedConfigEntry",
                          "aria-describedby": "sharedConfigEntry",
                          name: "sharedConfigEntry",
                          onChange: (e, str) => this.handleFieldChange(e, str),
                          validated: error.sharedConfigEntry ? ValidatedOptions.error : ValidatedOptions.default
                        }
                      ) })
                    ] }) }),
                    /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "ds-margin-top-xlg", children: [
                      /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                        DNASharedTable,
                        {
                          rows: sharedConfigRows,
                          editConfig: this.showEditSharedConfigModal,
                          deleteConfig: this.showSharedDeleteConfirm
                        },
                        sharedConfigRows
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("hr", {})
                    ] })
                  ]
                }
              )
            ] })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: _8("Manage DNA Plugin Shared Config Entry"),
            isOpen: sharedConfigEntryModalShow,
            "aria-labelledby": "ds-modal",
            onClose: this.handleCloseSharedModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                Button,
                {
                  isDisabled: sharedResult.saveSharedNotOK || savingShared,
                  variant: "primary",
                  onClick: this.handleEditSharedConfig,
                  isLoading: savingShared,
                  spinnerAriaValueText: savingShared ? _8("Saving") : void 0,
                  ...extraPrimaryProps,
                  children: saveSharedBtnName
                },
                "confirm"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { variant: "link", onClick: this.handleCloseSharedModal, children: _8("Cancel") }, "cancel")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Form, { isHorizontal: true, autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Grid, { hasGutter: true, className: "ds-margin-top-xlg", children: [
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 3, children: "Hostname:" }),
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { children: sharedHostname }) }),
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 2, children: "Port:" }),
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { children: sharedPort }) }),
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 3, children: "Remaining Values:" }),
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { children: sharedRemainingValues }) }),
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 2, children: "Secure Port:" }),
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { children: sharedSecurePort }) }),
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("hr", {}),
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { className: "ds-center", title: _8("Used with Replication to share ranges between replicas"), component: TextVariants.h3, children: _8("Remote Authentication Preferences") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 3, className: "ds-label", children: _8("Remote Bind Method") }),
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                FormSelect,
                {
                  id: "sharedRemoteBindMethod",
                  value: sharedRemoteBindMethod,
                  onChange: (e, str) => this.handleFieldChange(e, str),
                  "aria-label": "FormSelect Input",
                  validated: sharedResult.validatedBindMethod,
                  children: bindMethodOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FormSelectOption, { value: option.value, label: option.label }, index))
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 3, className: "ds-label", children: "Connection Protocol" }),
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                FormSelect,
                {
                  id: "sharedRemoteConnProtocol",
                  value: sharedRemoteConnProtocol,
                  onChange: (e, str) => this.handleFieldChange(e, str),
                  "aria-label": "FormSelect Input",
                  validated: sharedResult.validatedConnProtocol,
                  children: connProtocolOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FormSelectOption, { value: option.value, label: option.label }, index))
                }
              ) })
            ] }) })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "ds-margin-top-xlg ds-center", hidden: !this.state.loading, children: [
          /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { component: TextVariants.h3, children: _8("Loading DNA configuration") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Spinner, { size: "lg" })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { hidden: this.state.loading, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
          pluginBasicConfig_default,
          {
            rows: this.props.rows,
            serverId: this.props.serverId,
            cn: "Distributed Numeric Assignment Plugin",
            pluginName: _8("Distributed Numeric Assignment"),
            cmdName: "dna",
            savePluginHandler: this.props.savePluginHandler,
            pluginListHandler: this.props.pluginListHandler,
            addNotification: this.props.addNotification,
            toggleLoadingHandler: this.props.toggleLoadingHandler,
            children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { children: [
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                DNATable,
                {
                  rows: this.state.configRows,
                  editConfig: this.showEditConfigModal,
                  deleteConfig: this.showDeleteConfirm
                },
                this.state.tableKey
              ),
              /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
                Button,
                {
                  className: "ds-margin-top",
                  variant: "primary",
                  onClick: this.handleShowAddConfigModal,
                  children: _8("Add Config")
                }
              )
            ] })
          },
          this.state.configRows
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showDeleteConfirm,
            closeHandler: this.closeDeleteConfirm,
            handleChange: this.onConfirmChange,
            actionHandler: this.deleteConfig,
            spinning: this.state.modalSpinning,
            item: this.state.configName,
            checked: this.state.modalChecked,
            mTitle: _8("Delete DNA Configuration"),
            mMsg: _8("Are you really sure you want to delete this DNA configuration?"),
            mSpinningMsg: _8("Deleting config ..."),
            mBtnName: _8("Delete config")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showSharedDeleteConfirm,
            closeHandler: this.closeSharedDeleteConfirm,
            handleChange: this.onConfirmChange,
            actionHandler: this.deleteSharedConfig,
            spinning: this.state.modalSpinning,
            item: this.state.sharedConfigEntry,
            checked: this.state.modalChecked,
            mTitle: _8("Delete Shared Config Entry"),
            mMsg: _8("Are you really sure you want to delete this Shared Config Entry?"),
            mSpinningMsg: _8("Deleting Shared Config ..."),
            mBtnName: _8("Delete Shared Config")
          }
        )
      ] });
    }
  };
  DNAPlugin.propTypes = {
    rows: import_prop_types9.default.array,
    serverId: import_prop_types9.default.string,
    savePluginHandler: import_prop_types9.default.func,
    pluginListHandler: import_prop_types9.default.func,
    addNotification: import_prop_types9.default.func,
    toggleLoadingHandler: import_prop_types9.default.func
  };
  DNAPlugin.defaultProps = {
    rows: [],
    serverId: ""
  };
  var dna_default = DNAPlugin;

  // src/lib/plugins/linkedAttributes.jsx
  var import_react25 = __toESM(require_react(), 1);
  var import_prop_types10 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
  var _9 = cockpit_default.gettext;
  var LinkedAttributes = class extends import_react25.default.Component {
    componentDidMount() {
      if (this.props.wasActiveList.includes(5)) {
        if (this.state.firstLoad) {
          this.loadConfigs();
        }
      }
    }
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        configRows: [],
        tableKey: 1,
        error: {},
        saveBtnDisabled: true,
        configName: "",
        linkType: [],
        managedType: [],
        linkScope: "",
        newEntry: false,
        showConfigModal: false,
        showConfirmDelete: false,
        modalChecked: false,
        modalSpinning: false,
        isLinkTypeOpen: false,
        isManagedTypeOpen: false
      };
      this.handleLinkTypeSelect = (event, selection) => {
        this.setState({
          linkType: selection ? [selection] : []
        }, () => {
          this.validate();
        });
      };
      this.handleLinkTypeToggle = (_event, isLinkTypeOpen) => {
        this.setState({
          isLinkTypeOpen
        });
      };
      this.handleLinkTypeClear = () => {
        this.setState({
          linkType: [],
          isLinkTypeOpen: false
        }, () => {
          this.validate();
        });
      };
      this.handleManagedTypeSelect = (event, selection) => {
        this.setState({
          managedType: selection ? [selection] : []
        }, () => {
          this.validate();
        });
      };
      this.handleManagedTypeToggle = (_event, isManagedTypeOpen) => {
        this.setState({
          isManagedTypeOpen
        });
      };
      this.handleManagedTypeClear = () => {
        this.setState({
          managedType: [],
          isManagedTypeOpen: false
        }, () => {
          this.validate();
        });
      };
      this.onFieldChange = this.onFieldChange.bind(this);
      this.loadConfigs = this.loadConfigs.bind(this);
      this.showEditConfigModal = this.showEditConfigModal.bind(this);
      this.showConfirmDelete = this.showConfirmDelete.bind(this);
      this.handleShowAddConfigModal = this.handleShowAddConfigModal.bind(this);
      this.handleCloseModal = this.handleCloseModal.bind(this);
      this.openModal = this.openModal.bind(this);
      this.cmdOperation = this.cmdOperation.bind(this);
      this.deleteConfig = this.deleteConfig.bind(this);
      this.addConfig = this.addConfig.bind(this);
      this.editConfig = this.editConfig.bind(this);
      this.closeConfirmDelete = this.closeConfirmDelete.bind(this);
    }
    showConfirmDelete(name2) {
      this.setState({
        showConfirmDelete: true,
        modalChecked: false,
        modalSpinning: false,
        deleteName: name2
      });
    }
    closeConfirmDelete() {
      this.setState({
        showConfirmDelete: false,
        modalChecked: false,
        modalSpinning: false,
        deleteName: ""
      });
    }
    validate() {
      const errObj = {};
      let all_good = true;
      if (this.state.configName === "") {
        errObj.configName = true;
        all_good = false;
      }
      if (this.state.linkScope === "" || !valid_dn(this.state.linkScope)) {
        errObj.linkScope = true;
        all_good = false;
      }
      if (all_good) {
        all_good = false;
        const attrs = [
          "linkScope",
          "managedType",
          "linkType",
          "configName"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabled: !all_good,
        error: errObj
      });
    }
    onFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validate();
      });
    }
    loadConfigs() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "linked-attr",
        "list"
      ];
      log_cmd("loadConfigs", "Get Linked Attributes Plugin configs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const tableKey = this.state.tableKey + 1;
        this.setState({
          configRows: myObject.items.map((item) => item.attrs),
          tableKey,
          firstLoad: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        if (err !== 0) {
          console.log("loadConfigs failed", errMsg);
        }
      });
    }
    showEditConfigModal(rowData) {
      this.openModal(rowData);
    }
    handleShowAddConfigModal(rowData) {
      this.openModal();
    }
    openModal(name2) {
      if (!name2) {
        this.setState({
          configEntryModalShow: true,
          newEntry: true,
          configName: "",
          linkType: [],
          managedType: [],
          linkScope: "",
          saveBtnDisabled: true
        });
      } else {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "linked-attr",
          "config",
          name2,
          "show"
        ];
        this.props.toggleLoadingHandler();
        log_cmd("openModal", "Fetch the Linked Attributes Plugin config entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const configEntry = JSON.parse(content).attrs;
          this.setState({
            configEntryModalShow: true,
            saveBtnDisabled: true,
            newEntry: false,
            configName: configEntry.cn === void 0 ? "" : configEntry.cn[0],
            linkType: configEntry.linktype === void 0 ? [] : [configEntry.linktype[0]],
            managedType: configEntry.managedtype === void 0 ? [] : [configEntry.managedtype[0]],
            linkScope: configEntry.linkscope === void 0 ? "" : configEntry.linkscope[0]
          });
          this.props.toggleLoadingHandler();
        }).fail((_113) => {
          this.setState({
            configEntryModalShow: true,
            newEntry: true,
            configName: "",
            linkType: [],
            managedType: [],
            linkScope: "",
            saveBtnDisabled: true
          });
          this.props.toggleLoadingHandler();
        });
      }
    }
    handleCloseModal() {
      this.setState({ configEntryModalShow: false });
    }
    cmdOperation(action) {
      const { configName, linkType, managedType, linkScope } = this.state;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "linked-attr",
        "config",
        configName,
        action,
        "--link-scope",
        linkScope || action === "add" ? linkScope : "delete"
      ];
      cmd = [...cmd, "--link-type"];
      if (linkType.length !== 0) {
        cmd = [...cmd, linkType[0]];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--managed-type"];
      if (managedType.length !== 0) {
        cmd = [...cmd, managedType[0]];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      this.props.toggleLoadingHandler();
      log_cmd(
        "linkedAttributesOperation",
        `Do the ${action} operation on the Linked Attributes Plugin`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("linkedAttributesOperation", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_9('The $0 operation was successfully done on "$1" entry'), action, configName)
        );
        this.loadConfigs();
        this.handleCloseModal();
        this.props.toggleLoadingHandler();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_9("Error during the config entry $0 operation - $1"), action, errMsg)
        );
        this.loadConfigs();
        this.handleCloseModal();
        this.props.toggleLoadingHandler();
      });
    }
    deleteConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "linked-attr",
        "config",
        this.state.deleteName,
        "delete"
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteConfig", "Delete the Linked Attributes Plugin config entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteConfig", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_9("Config entry $0 was successfully deleted"), this.state.deleteName)
        );
        this.loadConfigs();
        this.handleCloseModal();
        this.closeConfirmDelete();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_9("Error during the config entry removal operation - $0"), errMsg)
        );
        this.loadConfigs();
        this.handleCloseModal();
        this.closeConfirmDelete();
      });
    }
    addConfig() {
      this.cmdOperation("add");
    }
    editConfig() {
      this.cmdOperation("set");
    }
    render() {
      const {
        configEntryModalShow,
        configName,
        linkType,
        managedType,
        linkScope,
        newEntry,
        error,
        saveBtnDisabled,
        saving,
        firstLoad
      } = this.state;
      const title = cockpit_default.format(_9("Linked Attributes Plugin Config Entry"), newEntry ? _9("Add") : _9("Edit"));
      let saveBtnName = (newEntry ? _9("Add") : _9("Save")) + _9(" Config");
      const extraPrimaryProps = {};
      if (saving) {
        if (newEntry) {
          saveBtnName = _9("Adding Config ...");
        } else {
          saveBtnName = _9("Saving Config ...");
        }
        extraPrimaryProps.spinnerAriaValueText = _9("Saving");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: saving || firstLoad ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            title,
            isOpen: configEntryModalShow,
            "aria-labelledby": "ds-modal",
            onClose: this.handleCloseModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: newEntry ? this.addConfig : this.editConfig,
                  isDisabled: saveBtnDisabled || saving,
                  isLoading: saving,
                  spinnerAriaValueText: saving ? _9("Saving") : void 0,
                  ...extraPrimaryProps,
                  children: saveBtnName
                },
                "confirm"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button, { variant: "link", onClick: this.handleCloseModal, children: _9("Cancel") }, "cancel")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Grid, { title: _9("The Linked Attributes configuration name"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GridItem, { className: "ds-label", span: 3, children: _9("Config Name") }),
                /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
                  TextInput,
                  {
                    value: configName,
                    type: "text",
                    id: "configName",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "configName",
                    onChange: (e, str) => {
                      this.onFieldChange(e);
                    },
                    validated: error.configName ? ValidatedOptions.error : ValidatedOptions.default,
                    isDisabled: !newEntry
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Grid, { title: _9("Sets the attribute that is managed manually by administrators (linkType)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GridItem, { className: "ds-label", span: 3, children: _9("Link Type") }),
                /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: linkType.length > 0 ? linkType[0] : "",
                    onSelect: this.handleLinkTypeSelect,
                    onClear: this.handleLinkTypeClear,
                    options: this.props.attributes,
                    isOpen: this.state.isLinkTypeOpen,
                    onToggle: this.handleLinkTypeToggle,
                    placeholder: _9("Type an attribute..."),
                    noResultsText: _9("There are no matching entries"),
                    ariaLabel: "Type an attribute name"
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Grid, { title: _9("Sets the attribute that is created dynamically by the plugin (managedType)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GridItem, { className: "ds-label", span: 3, children: _9("Managed Type") }),
                /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: managedType.length > 0 ? managedType[0] : "",
                    onSelect: this.handleManagedTypeSelect,
                    onClear: this.handleManagedTypeClear,
                    options: this.props.attributes,
                    isOpen: this.state.isManagedTypeOpen,
                    onToggle: this.handleManagedTypeToggle,
                    placeholder: _9("Type an attribute..."),
                    noResultsText: _9("There are no matching entries"),
                    ariaLabel: "Type an attribute name"
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Grid, { title: _9("Sets the base DN that restricts the plugin to a specific part of the directory tree (linkScope)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GridItem, { className: "ds-label", span: 3, children: _9("Link Scope") }),
                /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
                  TextInput,
                  {
                    value: linkScope,
                    type: "text",
                    id: "linkScope",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "linkScope",
                    onChange: (e, str) => {
                      this.onFieldChange(e);
                    },
                    validated: error.linkScope ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ) })
              ] })
            ] })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
          pluginBasicConfig_default,
          {
            rows: this.props.rows,
            serverId: this.props.serverId,
            cn: "Linked Attributes",
            pluginName: "Linked Attributes",
            cmdName: "linked-attr",
            savePluginHandler: this.props.savePluginHandler,
            pluginListHandler: this.props.pluginListHandler,
            addNotification: this.props.addNotification,
            toggleLoadingHandler: this.props.toggleLoadingHandler,
            children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(GridItem, { span: 12, children: [
              /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
                LinkedAttributesTable,
                {
                  rows: this.state.configRows,
                  editConfig: this.showEditConfigModal,
                  deleteConfig: this.showConfirmDelete
                },
                this.state.tableKey
              ),
              /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleShowAddConfigModal,
                  children: _9("Add Config")
                },
                "addconf"
              )
            ] }) })
          },
          this.state.configRows
        ),
        /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDelete,
            closeHandler: this.closeConfirmDelete,
            handleChange: this.onFieldChange,
            actionHandler: this.deleteConfig,
            spinning: this.state.modalSpinning,
            item: this.state.deleteName,
            checked: this.state.modalChecked,
            mTitle: _9("Delete Linked Attribute Configuration"),
            mMsg: _9("Are you sure you want to delete this configuration?"),
            mSpinningMsg: _9("Deleting Configuration..."),
            mBtnName: _9("Delete Configuration")
          }
        )
      ] });
    }
  };
  LinkedAttributes.propTypes = {
    rows: import_prop_types10.default.array,
    serverId: import_prop_types10.default.string,
    savePluginHandler: import_prop_types10.default.func,
    pluginListHandler: import_prop_types10.default.func,
    addNotification: import_prop_types10.default.func,
    toggleLoadingHandler: import_prop_types10.default.func
  };
  LinkedAttributes.defaultProps = {
    rows: [],
    serverId: ""
  };
  var linkedAttributes_default = LinkedAttributes;

  // src/lib/plugins/managedEntries.jsx
  var import_react26 = __toESM(require_react(), 1);
  var import_prop_types11 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
  var _10 = cockpit_default.gettext;
  var ManagedEntries = class extends import_react26.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        configArea: "",
        attributes: [],
        activeTabKey: 1,
        tableKey: 1,
        wasActiveList: [],
        saveNotOK: false,
        createNotOK: false,
        loading: false,
        // Templates
        templateRows: [],
        templateOptions: [],
        isRDNOpen: false,
        templateDN: "",
        templateRDNAttr: "",
        templateStaticAttr: [],
        templateMappedAttr: [],
        selectedMappedAttr: "",
        selectedStaticAttr: "",
        staticAttr: "",
        staticValue: "",
        mappedValue: "",
        mappedAttr: "",
        templateAddStaticShow: false,
        templateAddMappedShow: false,
        templateModalShow: false,
        showTempDeleteConfirm: false,
        newTemplateEntry: false,
        showStaticAttrDeleteConfirm: false,
        showMappedAttrDeleteConfirm: false,
        // Definitions
        saveDefOK: false,
        configRows: [],
        configName: "",
        originScope: "",
        originFilter: "",
        managedBase: "",
        managedTemplate: "",
        newDefEntry: false,
        configEntryModalShow: false,
        defCreateDisabled: false,
        showDefDeleteConfirm: false,
        // Validation
        addStaticValueValidated: ValidatedOptions.default,
        addMappedValueValidated: ValidatedOptions.default
      };
      this.handleNavSelect = (event, tabIndex) => {
        const { wasActiveList } = this.state;
        if (!wasActiveList.includes(tabIndex)) {
          const newList = wasActiveList.concat(tabIndex);
          this.setState({
            wasActiveList: newList,
            activeTabKey: tabIndex
          });
        } else {
          this.setState({
            activeTabKey: tabIndex
          });
        }
      };
      this.handleRDNSelect = (event, selection) => {
        this.setState({
          templateRDNAttr: selection,
          isRDNOpen: false
        });
      };
      this.handleRDNToggle = (_event, isRDNOpen) => {
        this.setState({
          isRDNOpen
        });
      };
      this.handleClearRDNSelection = () => {
        this.setState({
          templateRDNAttr: "",
          isRDNOpen: false
        });
      };
      this.handleStaticSelect = (event, selection) => {
        this.setState({
          staticAttr: selection,
          isStaticOpen: false
        });
      };
      this.handleStaticToggle = (_event, isStaticOpen) => {
        this.setState({
          isStaticOpen
        });
      };
      this.toggleLoading = () => {
        this.setState((prevState) => ({
          loading: !prevState.loading
        }));
      };
      this.handleClearStaticSelection = () => {
        this.setState({
          staticAttr: [],
          isStaticOpen: false
        });
      };
      this.handleMappedSelect = (event, selection) => {
        this.setState({
          mappedAttr: selection,
          isMappedOpen: false
        });
      };
      this.handleMappedToggle = (_event, isMappedOpen) => {
        this.setState({
          isMappedOpen
        });
      };
      this.handleClearMappedSelection = () => {
        this.setState({
          mappedAttr: [],
          isMappedOpen: false
        });
      };
      this.handleStaticListSelect = (selectedItem, selectedItemProps) => {
        this.setState({
          selectedStaticAttr: selectedItem.current.textContent
        });
      };
      this.handleMappedListSelect = (selectedItem, selectedItemProps) => {
        this.setState({
          selectedMappedAttr: selectedItem.current.textContent
        });
      };
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.updateFields = this.updateFields.bind(this);
      this.loadConfigs = this.loadConfigs.bind(this);
      this.getAttributes = this.getAttributes.bind(this);
      this.onConfirmChange = this.onConfirmChange.bind(this);
      this.openDefModal = this.openDefModal.bind(this);
      this.handleCloseDefModal = this.handleCloseDefModal.bind(this);
      this.showEditDefModal = this.showEditDefModal.bind(this);
      this.cmdDefOperation = this.cmdDefOperation.bind(this);
      this.showEditDefModal = this.showEditDefModal.bind(this);
      this.handleShowAddDefModal = this.handleShowAddDefModal.bind(this);
      this.deleteDefConfig = this.deleteDefConfig.bind(this);
      this.addDefConfig = this.addDefConfig.bind(this);
      this.editDefConfig = this.editDefConfig.bind(this);
      this.showDefDeleteConfirm = this.showDefDeleteConfirm.bind(this);
      this.closeDefDeleteConfirm = this.closeDefDeleteConfirm.bind(this);
      this.cmdTemplateOperation = this.cmdTemplateOperation.bind(this);
      this.showEditTempModal = this.showEditTempModal.bind(this);
      this.openTempModal = this.openTempModal.bind(this);
      this.handleCloseTempModal = this.handleCloseTempModal.bind(this);
      this.handleShowAddTempModal = this.handleShowAddTempModal.bind(this);
      this.deleteTemplate = this.deleteTemplate.bind(this);
      this.addTemplate = this.addTemplate.bind(this);
      this.editTemplate = this.editTemplate.bind(this);
      this.handleOpenStaticAttrModal = this.handleOpenStaticAttrModal.bind(this);
      this.handleCloseStaticAttrModal = this.handleCloseStaticAttrModal.bind(this);
      this.deleteStaticAttribute = this.deleteStaticAttribute.bind(this);
      this.handleOpenMappedAttrModal = this.handleOpenMappedAttrModal.bind(this);
      this.handleCloseMappedAttrModal = this.handleCloseMappedAttrModal.bind(this);
      this.deleteMappedAttribute = this.deleteMappedAttribute.bind(this);
      this.handleAddStaticAttrToList = this.handleAddStaticAttrToList.bind(this);
      this.handleAddMappedAttrToList = this.handleAddMappedAttrToList.bind(this);
      this.showTempDeleteConfirm = this.showTempDeleteConfirm.bind(this);
      this.closeTempDeleteConfirm = this.closeTempDeleteConfirm.bind(this);
      this.handleShowMappedAttrDeleteConfirm = this.handleShowMappedAttrDeleteConfirm.bind(this);
      this.closeMappedAttrDeleteConfirm = this.closeMappedAttrDeleteConfirm.bind(this);
      this.handleShowStaticAttrDeleteConfirm = this.handleShowStaticAttrDeleteConfirm.bind(this);
      this.closeStaticAttrDeleteConfirm = this.closeStaticAttrDeleteConfirm.bind(this);
    }
    componentDidMount() {
      this.updateFields();
    }
    handleFieldChange(str, e) {
      const value = e.target.value;
      const id = e.target.id;
      this.setState({
        [id]: value
      });
    }
    showTempDeleteConfirm(dn) {
      this.setState({
        templateDN: dn,
        showTempDeleteConfirm: true,
        modalChecked: false
      });
    }
    closeTempDeleteConfirm() {
      this.setState({
        showTempDeleteConfirm: false
      });
    }
    showDefDeleteConfirm(name2) {
      this.setState({
        configName: name2,
        showDefDeleteConfirm: true,
        modalChecked: false
      });
    }
    closeDefDeleteConfirm() {
      this.setState({
        showDefDeleteConfirm: false
      });
    }
    loadConfigs() {
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "managed-entries",
        "list",
        "templates"
      ];
      log_cmd("loadConfigs", "Get Managed Entries templates", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        let defCreateDisabled = false;
        const templateOptions = [];
        if (myObject.items.length === 0) {
          defCreateDisabled = true;
        } else {
          for (const temp of myObject.items) {
            templateOptions.push({
              value: temp.dn,
              label: temp.dn
            });
          }
        }
        this.setState({
          showDefDeleteConfirm: false,
          templateRows: myObject.items.map((item) => item.attrs),
          defCreateDisabled,
          templateOptions,
          managedTemplate: templateOptions.length ? templateOptions[0].value : ""
        });
        cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "managed-entries",
          "list",
          "configs"
        ];
        log_cmd("loadConfigs", "Get Managed Entries Plugin definitions", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content2) => {
          const myObject2 = JSON.parse(content2);
          const tableKey = this.state.tableKey + 1;
          this.setState({
            configRows: myObject2.items.map((item) => item.attrs),
            tableKey,
            loading: false
          });
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          if (err !== 0) {
            console.log("loadConfigs failed getting definitions", errMsg);
          }
          this.setState({
            loading: false
          });
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        if (err !== 0) {
          console.log("loadConfigs failed getting templates", errMsg);
        }
        this.setState({
          loading: false
        });
      });
    }
    showEditTempModal(entrydn) {
      this.openTempModal(entrydn);
    }
    handleShowAddTempModal() {
      this.openTempModal();
    }
    openTempModal(entrydn) {
      this.getAttributes();
      if (entrydn === "" || entrydn === void 0) {
        this.setState({
          newTemplateEntry: true,
          templateDN: "",
          templateRDNAttr: "",
          templateStaticAttr: [],
          templateMappedAttr: [],
          saveTempOK: false,
          templateModalShow: true
        });
      } else {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "managed-entries",
          "template",
          entrydn,
          "show"
        ];
        this.toggleLoading();
        log_cmd("openTempModal", "Fetch the Managed Entries template entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const configEntry = JSON.parse(content).attrs;
          configEntry.meprdnattr === void 0 ? configEntry.meprdnattr = "" : configEntry.meprdnattr = configEntry.meprdnattr[0];
          if (configEntry.mepstaticattr === void 0) {
            configEntry.mepstaticattr = [];
          }
          if (configEntry.mepmappedattr === void 0) {
            configEntry.mepmappedattr = [];
          }
          this.setState({
            newTemplateEntry: false,
            templateModalShow: true,
            saveTempOK: false,
            templateDN: entrydn,
            templateRDNAttr: configEntry.meprdnattr,
            templateStaticAttr: configEntry.mepstaticattr,
            templateMappedAttr: configEntry.mepmappedattr,
            // Preserve original Settings
            _templateDN: entrydn,
            _templateRDNAttr: configEntry.meprdnattr,
            _templateStaticAttr: [...configEntry.mepstaticattr],
            _templateMappedAttr: [...configEntry.mepmappedattr]
          }, this.toggleLoading());
        }).fail((_113) => {
          this.setState({
            newTemplateEntry: true,
            templateDN: "",
            templateRDNAttr: "",
            templateStaticAttr: [],
            templateMappedAttr: []
          }, this.toggleLoading());
        });
      }
    }
    handleAddStaticAttrToList() {
      const value = this.state.staticAttr + ": " + this.state.staticValue;
      const values = this.state.templateStaticAttr;
      values.push(value);
      this.setState({
        templateStaticAttr: values,
        templateAddStaticShow: false
      });
    }
    deleteStaticAttribute() {
      const attrList = this.state.templateStaticAttr;
      for (let i = 0; i < attrList.length; i++) {
        if (attrList[i] === this.state.selectedStaticAttr) {
          attrList.splice(i, 1);
        }
      }
      this.setState({
        selectedStaticAttr: "",
        templateStaticAttr: attrList,
        showStaticAttrDeleteConfirm: false,
        modalChecked: false
      });
    }
    handleAddMappedAttrToList() {
      const values = this.state.templateMappedAttr;
      values.push(this.state.mappedAttr + ": " + this.state.mappedValue);
      this.setState((prevState) => ({
        templateMappedAttr: values,
        templateAddMappedShow: false
      }));
    }
    handleShowMappedAttrDeleteConfirm() {
      if (this.state.selectedMappedAttr !== "") {
        this.setState({
          showMappedAttrDeleteConfirm: true,
          modalChecked: false
        });
      }
    }
    closeMappedAttrDeleteConfirm() {
      this.setState({
        showMappedAttrDeleteConfirm: false
      });
    }
    handleShowStaticAttrDeleteConfirm() {
      if (this.state.selectedStaticAttr !== "") {
        this.setState({
          showStaticAttrDeleteConfirm: true,
          modalChecked: false
        });
      }
    }
    closeStaticAttrDeleteConfirm() {
      this.setState({
        showStaticAttrDeleteConfirm: false
      });
    }
    deleteMappedAttribute() {
      const attrList = this.state.templateMappedAttr;
      for (let i = 0; i < attrList.length; i++) {
        if (attrList[i] === this.state.selectedMappedAttr) {
          attrList.splice(i, 1);
        }
      }
      this.setState({
        selectedMappedAttr: "",
        templateMappedAttr: attrList,
        showMappedAttrDeleteConfirm: false,
        modalChecked: false
      });
    }
    handleCloseTempModal() {
      this.setState({ templateModalShow: false });
    }
    handleOpenMappedAttrModal() {
      this.setState({
        templateAddMappedShow: true,
        modalChecked: false,
        modalSpinning: false,
        mappedValue: "",
        mappedAttr: ""
      });
    }
    handleCloseMappedAttrModal() {
      this.setState({
        templateAddMappedShow: false
      });
    }
    handleOpenStaticAttrModal() {
      this.setState({
        templateAddStaticShow: true,
        modalChecked: false,
        modalSpinning: false,
        staticValue: "",
        staticAttr: ""
      });
    }
    handleCloseStaticAttrModal() {
      this.setState({ templateAddStaticShow: false });
    }
    showEditDefModal(rowData) {
      this.openDefModal(rowData);
    }
    handleShowAddDefModal(rowData) {
      this.openDefModal();
    }
    // Definition modal
    openDefModal(name2) {
      this.getAttributes();
      if (!name2) {
        this.setState({
          configEntryModalShow: true,
          newDefEntry: true,
          configName: "",
          originScope: "",
          originFilter: "",
          managedBase: ""
        });
      } else {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "managed-entries",
          "config",
          name2,
          "show"
        ];
        this.toggleLoading();
        log_cmd("openDefModal", "Fetch the Managed Entries Plugin definition config entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const configEntry = JSON.parse(content).attrs;
          configEntry.originscope === void 0 ? configEntry.originscope = "" : configEntry.originscope = configEntry.originscope[0];
          configEntry.originfilter === void 0 ? configEntry.originfilter = "" : configEntry.originfilter = configEntry.originfilter[0];
          configEntry.managedbase === void 0 ? configEntry.managedbase = "" : configEntry.managedbase = configEntry.managedbase[0];
          configEntry.managedtemplate === void 0 ? configEntry.managedtemplate = "" : configEntry.managedtemplate = configEntry.managedtemplate[0];
          this.setState({
            configEntryModalShow: true,
            newDefEntry: false,
            configName: configEntry.cn[0],
            originScope: configEntry.originscope,
            originFilter: configEntry.originfilter,
            managedBase: configEntry.managedbase,
            managedTemplate: configEntry.managedtemplate,
            // Preserve original settings
            _originScope: configEntry.originscope,
            _originFilter: configEntry.originfilter,
            _managedBase: configEntry.managedbase,
            _managedTemplate: configEntry.managedtemplate
          }, this.toggleLoading());
        }).fail((_113) => {
          this.setState({
            configEntryModalShow: true,
            newDefEntry: true,
            configName: "",
            originScope: "",
            originFilter: "",
            managedBase: ""
          }, this.toggleLoading());
        });
      }
    }
    handleCloseDefModal() {
      this.setState({ configEntryModalShow: false });
    }
    deleteDefConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "managed-entries",
        "config",
        this.state.configName,
        "delete"
      ];
      this.toggleLoading();
      log_cmd("deleteDefConfig", "Delete the Managed Entries Plugin definition entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteDefConfig", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_10("Definition entry $0 was successfully deleted"), this.state.configName)
        );
        this.loadConfigs();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_10("Error during the definition entry removal operation - $0"), errMsg)
        );
        this.loadConfigs();
      });
    }
    addDefConfig() {
      this.cmdDefOperation("add");
    }
    editDefConfig() {
      this.cmdDefOperation("set");
    }
    cmdDefOperation(action) {
      const { configName, originScope, originFilter, managedBase, managedTemplate } = this.state;
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "managed-entries",
        "config",
        configName,
        action,
        "--scope",
        originScope || action === "add" ? originScope : "delete",
        "--filter",
        originFilter || action === "add" ? originFilter : "delete",
        "--managed-base",
        managedBase || action === "add" ? managedBase : "delete",
        "--managed-template",
        managedTemplate || action === "add" ? managedTemplate : "delete"
      ];
      this.toggleLoading();
      log_cmd("cmdDefOperation", `Do the ${action} operation on the Managed Entries Plugin`, cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("cmdDefOperation", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_10('The $0 operation was successfully done on "$1" entry'), action, configName)
        );
        this.loadConfigs();
        this.handleCloseDefModal();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_10("Error during the config entry $0 operation - $1"), action, errMsg)
        );
        this.loadConfigs();
        this.handleCloseDefModal();
      });
    }
    updateFields() {
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find((row) => row.cn[0] === "Managed Entries");
        this.setState({
          loading: true,
          configArea: pluginRow["nsslapd-pluginConfigArea"] === void 0 ? "" : pluginRow["nsslapd-pluginConfigArea"][0]
        }, this.loadConfigs());
      }
    }
    cmdTemplateOperation(action) {
      const { templateDN, templateRDNAttr, templateStaticAttr, templateMappedAttr } = this.state;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "managed-entries",
        "template",
        templateDN,
        action
      ];
      cmd = [...cmd, "--rdn-attr"];
      if (templateRDNAttr !== "") {
        cmd = [...cmd, templateRDNAttr];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      if (templateStaticAttr.length !== 0) {
        cmd = [...cmd, "--static-attr"];
        for (const value of templateStaticAttr) {
          cmd = [...cmd, value];
        }
      } else if (action !== "add") {
        cmd = [...cmd, "--static-attr", "delete"];
      }
      if (templateMappedAttr.length !== 0) {
        cmd = [...cmd, "--mapped-attr"];
        for (const value of templateMappedAttr) {
          cmd = [...cmd, value];
        }
      } else if (action !== "add") {
        cmd = [...cmd, "--mapped-attr", "delete"];
      }
      this.toggleLoading();
      log_cmd(
        "cmdTemplateOperation",
        `Do the ${action} operation on the Managed Entries template`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        this.props.addNotification(
          "success",
          cockpit_default.format(_10("Config entry $0 was successfully $1"), templateDN, action + "ed")
        );
        this.loadConfigs();
        this.handleCloseTempModal();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.handleCloseTempModal();
        this.props.addNotification(
          "error",
          cockpit_default.format(_10("Error during the template entry $0 operation - $1"), action, errMsg)
        );
        this.toggleLoading();
      });
    }
    deleteTemplate() {
      const { templateDN } = this.state;
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "managed-entries",
        "template",
        templateDN,
        "delete"
      ];
      this.toggleLoading();
      log_cmd("deleteTemplate", "Delete the Managed Entries Plugin template entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        this.props.addNotification(
          "success",
          cockpit_default.format(_10("Template entry $0 was successfully deleted"), templateDN)
        );
        this.loadConfigs();
        this.closeTempDeleteConfirm();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_10("Error during the template entry removal operation - $0"), errMsg)
        );
        this.closeTempDeleteConfirm();
        this.toggleLoading();
      });
    }
    addTemplate() {
      this.cmdTemplateOperation("add");
    }
    editTemplate() {
      this.cmdTemplateOperation("set");
    }
    getAttributes() {
      const attr_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "list"
      ];
      log_cmd("getAttributes", "Get attrs", attr_cmd);
      cockpit_default.spawn(attr_cmd, { superuser: true, err: "message" }).done((content) => {
        const attrContent = JSON.parse(content);
        const attrs = [];
        for (const content2 of attrContent.items) {
          attrs.push(content2.name[0]);
        }
        this.setState({
          attributes: attrs
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification("error", cockpit_default.format(_10("Failed to get attributes - $0"), errMsg));
      });
    }
    onConfirmChange(e) {
      this.setState({
        modalChecked: e.target.checked
      });
    }
    validateDef(newDefEntry) {
      let defSaveDisabled = false;
      if (this.state.configName === "" || (this.state.originScope === "" || !valid_dn(this.state.originScope)) || this.state.originFilter === "" || (this.state.managedBase === "" || !valid_dn(this.state.managedBase)) || this.state.managedTemplate === "") {
        defSaveDisabled = true;
      }
      if (!newDefEntry && !defSaveDisabled) {
        if (this.state.originScope === this.state._originScope && this.state.originFilter === this.state._originFilter && this.state.managedBase === this.state._managedBase && this.state.managedTemplate === this.state._managedTemplate) {
          defSaveDisabled = true;
        }
      }
      return defSaveDisabled;
    }
    validateTempRdnToAttrMapping() {
      let mappedMatchesRDN = false;
      for (const mAttr of this.state.templateMappedAttr) {
        if (mAttr.startsWith(this.state.templateRDNAttr + ":")) {
          mappedMatchesRDN = true;
          break;
        }
      }
      return mappedMatchesRDN;
    }
    validateTemp(newTemplateEntry) {
      let tempSaveDisabled = false;
      if (this.state.templateDN === "" || this.state.templateDN !== "" && !valid_dn(this.state.templateDN) || this.state.templateRDNAttr === "") {
        tempSaveDisabled = true;
      }
      if (!this.validateTempRdnToAttrMapping()) {
        tempSaveDisabled = true;
      }
      if (!newTemplateEntry && !tempSaveDisabled) {
        if (this.state.templateDN === this.state._templateDN && this.state.templateRDNAttr === this.state._templateRDNAttr && listsEqual(this.state.templateMappedAttr, this.state._templateMappedAttr) && listsEqual(this.state.templateStaticAttr, this.state._templateStaticAttr)) {
          tempSaveDisabled = true;
        }
      }
      return tempSaveDisabled;
    }
    render() {
      const {
        configArea,
        configRows,
        attributes,
        configName,
        originScope,
        originFilter,
        managedBase,
        managedTemplate,
        templateDN,
        templateRDNAttr,
        templateStaticAttr,
        templateMappedAttr,
        templateOptions,
        newDefEntry,
        configEntryModalShow,
        newTemplateEntry,
        templateAddStaticShow,
        templateAddMappedShow
      } = this.state;
      const isOriginScopeValidated = originScope !== "" && !valid_dn(originScope);
      const isManagedBaseValidated = managedBase !== "" && !valid_dn(managedBase);
      const isConfigAreaValidated = configArea !== "" && !valid_dn(configArea);
      const isTemplateDNValidated = templateDN !== "" && !valid_dn(templateDN);
      const specificPluginCMD = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "managed-entries",
        "set",
        "--config-area",
        configArea || "delete"
      ];
      const templateTitle = cockpit_default.format(_10("$0 Managed Entries Template Entry"), newTemplateEntry ? _10("Add") : _10("Edit"));
      const title = cockpit_default.format(_10("$0 Managed Entries Definition Entry"), newDefEntry ? _10("Add") : _10("Edit"));
      const defSaveDisabled = this.validateDef(newDefEntry);
      const tempSaveDisabled = this.validateTemp(newTemplateEntry);
      const templateRdnMappingOK = this.validateTempRdnToAttrMapping();
      return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            "aria-labelledby": "ds-modal",
            title,
            isOpen: configEntryModalShow,
            onClose: this.handleCloseDefModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                Button,
                {
                  isDisabled: defSaveDisabled,
                  variant: "primary",
                  onClick: newDefEntry ? this.addDefConfig : this.editDefConfig,
                  children: _10("Save Definition")
                },
                "saveshared"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { variant: "link", onClick: this.handleCloseDefModal, children: _10("Cancel") }, "cancel")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Form, { className: "ds-margin-top-xlg", isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                FormGroup,
                {
                  label: _10("Definition Name"),
                  fieldId: "configName",
                  isRequired: true,
                  children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                    TextInput,
                    {
                      value: configName,
                      type: "text",
                      id: "configName",
                      "aria-describedby": "configName",
                      name: "configName",
                      onChange: (e, str) => this.handleFieldChange(str, e),
                      isDisabled: !newDefEntry,
                      isRequired: true
                    }
                  )
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
                FormGroup,
                {
                  label: _10("Subtree Scope"),
                  fieldId: "originScope",
                  title: _10("Sets the search base DN to use to find candidate entries (originScope)"),
                  isRequired: true,
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                      TextInput,
                      {
                        value: originScope,
                        type: "text",
                        id: "originScope",
                        "aria-describedby": "originScope",
                        name: "originScope",
                        onChange: (e, str) => this.handleFieldChange(str, e),
                        validated: isOriginScopeValidated ? ValidatedOptions.error : ValidatedOptions.default,
                        isRequired: true
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormHelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(HelperTextItem, { icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ExclamationCircleIcon, {}), variant: isOriginScopeValidated ? "error" : "default", children: isOriginScopeValidated ? "A valid DN must be provided" : "Enter DN" }) }) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                FormGroup,
                {
                  label: _10("Filter"),
                  fieldId: "originFilter",
                  title: _10("Sets the search filter to use to search for and identify the entries within the subtree which require a managed entry (originFilter)"),
                  isRequired: true,
                  children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                    TextInput,
                    {
                      value: originFilter,
                      type: "text",
                      id: "originFilter",
                      "aria-describedby": "originFilter",
                      name: "originFilter",
                      onChange: (e, str) => this.handleFieldChange(str, e),
                      isRequired: true
                    }
                  )
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
                FormGroup,
                {
                  label: _10("Managed Base"),
                  fieldId: "managedBase",
                  title: _10("Sets the subtree where the managed entries are created (managedBase)"),
                  isRequired: true,
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                      TextInput,
                      {
                        value: managedBase,
                        type: "text",
                        id: "managedBase",
                        "aria-describedby": "managedBase",
                        name: "managedBase",
                        onChange: (e, str) => this.handleFieldChange(str, e),
                        validated: isManagedBaseValidated ? ValidatedOptions.error : ValidatedOptions.default,
                        isRequired: true
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormHelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(HelperTextItem, { icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ExclamationCircleIcon, {}), variant: isManagedBaseValidated ? "error" : "default", children: isManagedBaseValidated ? "A valid DN must be provided" : "Enter DN" }) }) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                FormGroup,
                {
                  label: _10("Template"),
                  fieldId: "managedTemplate",
                  title: _10("Choose which template to use for this definition"),
                  isRequired: true,
                  children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                    FormSelect,
                    {
                      id: "managedTemplate",
                      value: managedTemplate,
                      onChange: (e, str) => this.handleFieldChange(str, e),
                      "aria-label": "FormSelect Input",
                      children: templateOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormSelectOption, { value: option.value, label: option.label }, index))
                    }
                  )
                }
              )
            ] })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
          Modal,
          {
            variant: ModalVariant.medium,
            "aria-labelledby": "ds-modal",
            title: templateTitle,
            isOpen: this.state.templateModalShow,
            onClose: this.handleCloseTempModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: newTemplateEntry ? this.addTemplate : this.editTemplate,
                  isDisabled: tempSaveDisabled,
                  children: _10("Save Template")
                },
                "savetemp"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { variant: "link", onClick: this.handleCloseTempModal, children: _10("Cancel") }, "cancel")
            ],
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Form, { className: "ds-margin-top-xlg", isHorizontal: true, autoComplete: "off", children: [
                /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
                  FormGroup,
                  {
                    label: _10("Template DN"),
                    fieldId: "templateDN",
                    title: _10("DN of the template entry"),
                    isRequired: true,
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                        TextInput,
                        {
                          value: templateDN,
                          type: "text",
                          id: "templateDN",
                          "aria-describedby": "templateDN",
                          name: "templateDN",
                          onChange: (e, str) => this.handleFieldChange(str, e),
                          isDisabled: !newTemplateEntry,
                          validated: isTemplateDNValidated ? ValidatedOptions.error : ValidatedOptions.default
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormHelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(HelperTextItem, { icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ExclamationCircleIcon, {}), variant: isTemplateDNValidated ? "error" : "default", children: isTemplateDNValidated ? "The template DN must be set to a valid DN" : "Enter DN" }) }) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                  FormGroup,
                  {
                    label: _10("RDN Attribute"),
                    fieldId: "templateDN",
                    title: _10("DN of the template entry"),
                    isRequired: true,
                    children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                      dsBasicComponents_default,
                      {
                        selected: templateRDNAttr,
                        onSelect: this.handleRDNSelect,
                        onClear: this.handleClearRDNSelection,
                        options: attributes,
                        isOpen: this.state.isRDNOpen,
                        onToggle: this.handleRDNToggle,
                        placeholder: _10("Type an attribute..."),
                        ariaLabel: "Type an attribute"
                      }
                    )
                  }
                )
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Form, { className: "ds-margin-top-lg", autoComplete: "off", children: [
                /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
                  FormGroup,
                  {
                    label: _10("Mapped Attributes"),
                    fieldId: "templateDN",
                    title: _10("Dynamic attribute mappings"),
                    isRequired: true,
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                        SimpleList,
                        {
                          className: "ds-modal-list",
                          onSelect: this.handleMappedListSelect,
                          "aria-label": "mappedAttrList",
                          children: templateMappedAttr.length ? templateMappedAttr.map((attr) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SimpleListItem, { id: attr, children: attr }, attr)) : ""
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                        "p",
                        {
                          hidden: templateRdnMappingOK,
                          className: "ds-error-msg",
                          children: _10("You must have at least one Mapped Attribute that matches the RDN Attribute")
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "ds-margin-top", children: [
                        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                          Button,
                          {
                            className: "ds-margin-top",
                            variant: "primary",
                            onClick: this.handleOpenMappedAttrModal,
                            children: _10("Add Attribute")
                          },
                          "addstatic"
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                          Button,
                          {
                            className: "ds-left-margin",
                            variant: "primary",
                            isDisabled: this.state.selectedMappedAttr === "",
                            onClick: this.handleShowMappedAttrDeleteConfirm,
                            children: _10("Delete Attribute")
                          },
                          "delstatic"
                        )
                      ] })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
                  FormGroup,
                  {
                    className: "ds-margin-top-lg",
                    label: _10("Static Attributes"),
                    fieldId: "templateDN",
                    title: _10("Static attribute mappings"),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                        SimpleList,
                        {
                          className: "ds-modal-list",
                          onSelect: this.handleStaticListSelect,
                          "aria-label": "Simple List Example",
                          children: templateStaticAttr.length ? templateStaticAttr.map((attr) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SimpleListItem, { id: attr, children: attr }, attr)) : ""
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "ds-margin-top", children: [
                        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                          Button,
                          {
                            variant: "primary",
                            onClick: this.handleOpenStaticAttrModal,
                            children: _10("Add Attribute")
                          },
                          "addstatic"
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                          Button,
                          {
                            className: "ds-left-margin",
                            variant: "primary",
                            isDisabled: this.state.selectedStaticAttr === "",
                            onClick: this.handleShowStaticAttrDeleteConfirm,
                            children: _10("Delete Attribute")
                          },
                          "delstatic"
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("hr", {})
                      ] })
                    ]
                  }
                )
              ] })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
          Modal,
          {
            variant: ModalVariant.small,
            "aria-labelledby": "ds-modal",
            title: _10("Add Static Attribute"),
            isOpen: templateAddStaticShow,
            onClose: this.handleCloseStaticAttrModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleAddStaticAttrToList,
                  isDisabled: !this.state.staticAttr.length || this.state.staticValue === "",
                  children: _10("Add Attribute")
                },
                "saveshared"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { variant: "link", onClick: this.handleCloseStaticAttrModal, children: _10("Cancel") }, "cancel")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Form, { className: "ds-margin-top", autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                FormGroup,
                {
                  label: _10("Static Attribute"),
                  fieldId: "staticAttr",
                  title: _10("The attribute that is set in the managed entry"),
                  children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                    dsBasicComponents_default,
                    {
                      selected: this.state.staticAttr,
                      onSelect: this.handleStaticSelect,
                      onClear: this.handleClearStaticSelection,
                      options: attributes,
                      isOpen: this.state.isStaticOpen,
                      onToggle: this.handleStaticToggle,
                      placeholder: _10("Type an attribute..."),
                      ariaLabel: "Type an attribute"
                    }
                  )
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                FormGroup,
                {
                  className: "ds-margin-top-lg",
                  label: _10("Attribute Value"),
                  fieldId: "staticValue",
                  title: _10("The value set for the static attribute in the entry"),
                  children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                    TextInput,
                    {
                      value: this.state.staticValue,
                      type: "text",
                      id: "staticValue",
                      "aria-describedby": "staticValue",
                      name: "staticValue",
                      onChange: (e, str) => this.handleFieldChange(str, e),
                      isRequired: true
                    }
                  )
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("hr", {})
            ] })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
          Modal,
          {
            variant: ModalVariant.small,
            "aria-labelledby": "ds-modal",
            title: _10("Add Mapped Attribute"),
            isOpen: templateAddMappedShow,
            onClose: this.handleCloseMappedAttrModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleAddMappedAttrToList,
                  isDisabled: !this.state.mappedAttr.length || this.state.mappedValue === "",
                  children: _10("Add Attribute")
                },
                "savemapped"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { variant: "link", onClick: this.handleCloseMappedAttrModal, children: _10("Cancel") }, "cancel")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Form, { className: "ds-margin-top", autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                FormGroup,
                {
                  label: _10("Mapped Attribute"),
                  fieldId: "mappedAttr",
                  title: _10("The attribute that is set in the managed entry"),
                  children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                    dsBasicComponents_default,
                    {
                      selected: this.state.mappedAttr,
                      onSelect: this.handleMappedSelect,
                      onClear: this.handleClearMappedSelection,
                      options: attributes,
                      isOpen: this.state.isMappedOpen,
                      onToggle: this.handleMappedToggle,
                      placeholder: _10("Type an attribute..."),
                      ariaLabel: "Type an attribute"
                    }
                  )
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                FormGroup,
                {
                  label: _10("Mapped Value"),
                  fieldId: "mappedValue",
                  className: "ds-margin-top-lg",
                  title: _10("The value set for the mapped attribute"),
                  children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                    TextInput,
                    {
                      value: this.state.mappedValue,
                      type: "text",
                      id: "mappedValue",
                      "aria-describedby": "mappedValue",
                      name: "mappedValue",
                      onChange: (e, str) => this.handleFieldChange(str, e)
                    }
                  )
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("hr", {})
            ] })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "ds-center ds-margin-top-xlg", hidden: !this.state.loading, children: [
          /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { component: TextVariants.h3, children: _10("Loading Managed Entries Configuration ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Spinner, { className: "ds-margin-top", size: "lg" })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { hidden: this.state.loading, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
          pluginBasicConfig_default,
          {
            rows: this.props.rows,
            serverId: this.props.serverId,
            cn: "Managed Entries",
            pluginName: "Managed Entries",
            cmdName: "managed-entries",
            specificPluginCMD,
            savePluginHandler: this.props.savePluginHandler,
            pluginListHandler: this.props.pluginListHandler,
            addNotification: this.props.addNotification,
            toggleLoadingHandler: this.toggleLoading,
            children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "ds-margin-top-lg", children: [
              /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
                /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
                  Tab,
                  {
                    eventKey: 1,
                    title: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TabTitleText, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: _10("Templates") }) }),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                        Tooltip,
                        {
                          content: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: _10('Templates are used by Definitions to construct the "Managed Entry".  You must have at least one Template before you can create a Definition entry.') }),
                          children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("a", { className: "ds-font-size-sm", children: _10("What is a Template?") })
                        }
                      ) }),
                      /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                        ManagedTemplateTable,
                        {
                          rows: this.state.templateRows,
                          editConfig: this.showEditTempModal,
                          deleteConfig: this.showTempDeleteConfirm
                        },
                        this.state.templateRows
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                        Button,
                        {
                          className: "ds-margin-top",
                          variant: "primary",
                          onClick: this.handleShowAddTempModal,
                          children: _10("Create Template")
                        }
                      )
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
                  Tab,
                  {
                    eventKey: 2,
                    title: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TabTitleText, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: _10("Definitions") }) }),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                        Tooltip,
                        {
                          content: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: _10('Definitions describe the criteria that entries must meet in order for its "managed entry" to be created.  The Managed entry will be created using the Template specified in its configuration.  You can not create a Definition until there is at least one Template.') }),
                          children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("a", { className: "ds-font-size-sm", children: _10("What is a Definition?") })
                        }
                      ) }),
                      /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                        ManagedDefinitionTable,
                        {
                          rows: configRows,
                          editConfig: this.showEditDefModal,
                          deleteConfig: this.showDefDeleteConfirm
                        },
                        this.state.tableKey
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                        Button,
                        {
                          className: "ds-margin-top",
                          variant: "primary",
                          onClick: this.handleShowAddDefModal,
                          isDisabled: this.state.defCreateDisabled,
                          children: _10("Add Definition")
                        }
                      )
                    ]
                  }
                )
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "ds-margin-top-xlg" }),
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("hr", {}),
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Form, { className: "ds-margin-top-xlg", isHorizontal: true, autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
                FormGroup,
                {
                  label: _10("Shared Config Area"),
                  fieldId: "configArea",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                      TextInput,
                      {
                        value: configArea,
                        type: "text",
                        id: "configArea",
                        "aria-describedby": "configArea",
                        name: "configArea",
                        onChange: (e, str) => this.handleFieldChange(str, e),
                        validated: isConfigAreaValidated ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormHelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(HelperTextItem, { icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ExclamationCircleIcon, {}), variant: isManagedBaseValidated ? "error" : "default", children: isConfigAreaValidated ? "The DN for the shared conifig area is invalid" : "Enter DN" }) }) })
                  ]
                }
              ) })
            ] })
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showTempDeleteConfirm,
            closeHandler: this.closeTempDeleteConfirm,
            handleChange: this.onConfirmChange,
            actionHandler: this.deleteTemplate,
            spinning: this.state.modalSpinning,
            item: this.state.templateDN,
            checked: this.state.modalChecked,
            mTitle: _10("Delete Template Entry"),
            mMsg: _10("Are you really sure you want to delete this template entry?"),
            mSpinningMsg: _10("Deleting template ..."),
            mBtnName: _10("Delete Template")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showDefDeleteConfirm,
            closeHandler: this.closeDefDeleteConfirm,
            handleChange: this.onConfirmChange,
            actionHandler: this.deleteDefConfig,
            spinning: this.state.modalSpinning,
            item: this.state.configName,
            checked: this.state.modalChecked,
            mTitle: _10("Delete Definition Entry"),
            mMsg: _10("Are you really sure you want to delete this definition entry?"),
            mSpinningMsg: _10("Deleting definition ..."),
            mBtnName: _10("Delete Definition")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showMappedAttrDeleteConfirm,
            closeHandler: this.closeMappedAttrDeleteConfirm,
            handleChange: this.onConfirmChange,
            actionHandler: this.deleteMappedAttribute,
            spinning: this.state.modalSpinning,
            item: this.state.selectedMappedAttr,
            checked: this.state.modalChecked,
            mTitle: _10("Delete Mapped Attribute From Template"),
            mMsg: _10("Are you really sure you want to delete this mapped attribute?"),
            mSpinningMsg: _10("Deleting mapped attribute ..."),
            mBtnName: _10("Delete Attribute")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showStaticAttrDeleteConfirm,
            closeHandler: this.closeStaticAttrDeleteConfirm,
            handleChange: this.onConfirmChange,
            actionHandler: this.deleteStaticAttribute,
            spinning: this.state.modalSpinning,
            item: this.state.selectedStaticAttr,
            checked: this.state.modalChecked,
            mTitle: _10("Delete Static Attribute From Template"),
            mMsg: _10("Are you really sure you want to delete this static attribute?"),
            mSpinningMsg: _10("Deleting static attribute ..."),
            mBtnName: _10("Delete Attribute")
          }
        )
      ] });
    }
  };
  ManagedEntries.propTypes = {
    rows: import_prop_types11.default.array,
    serverId: import_prop_types11.default.string,
    savePluginHandler: import_prop_types11.default.func,
    pluginListHandler: import_prop_types11.default.func,
    addNotification: import_prop_types11.default.func
  };
  ManagedEntries.defaultProps = {
    rows: [],
    serverId: ""
  };
  var managedEntries_default = ManagedEntries;

  // src/lib/plugins/memberOf.jsx
  var import_react28 = __toESM(require_react(), 1);
  var import_prop_types13 = __toESM(require_prop_types(), 1);

  // src/lib/plugins/memberOfModals.jsx
  var import_react27 = __toESM(require_react(), 1);
  var import_prop_types12 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
  var _11 = cockpit_default.gettext;
  var MemberOfFixupTaskModal = class extends import_react27.default.Component {
    render() {
      const {
        fixupModalShow,
        handleToggleFixupModal,
        handleRunFixup,
        fixupDN,
        fixupFilter,
        handleFieldChange
      } = this.props;
      return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
        Modal,
        {
          variant: ModalVariant.small,
          "aria-labelledby": "ds-modal",
          title: _11("MemberOf Plugin FixupTask"),
          isOpen: fixupModalShow,
          onClose: handleToggleFixupModal,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
              Button,
              {
                variant: "primary",
                onClick: handleRunFixup,
                isDisabled: !valid_dn(fixupDN),
                children: _11("Run")
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { variant: "link", onClick: handleToggleFixupModal, children: _11("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { className: "ds-margin-top", component: TextVariants.h4, children: _11("This task only needs to be run after enabling the plugin for the first time, or if the plugin configuration has changed in a way that will impact the group memberships.") }) }),
            /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Grid, { className: "ds-margin-top", title: _11("Base DN that contains entries to fix up."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { className: "ds-label", span: 3, children: _11("Subtree DN") }),
              /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(GridItem, { span: 9, children: [
                /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                  TextInput,
                  {
                    value: fixupDN,
                    type: "text",
                    id: "fixupDN",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "fixupDN",
                    onChange: (e, str) => {
                      handleFieldChange(e);
                    },
                    validated: !valid_dn(fixupDN) ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FormHelperText, { children: _11("Value must be a valid DN") })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Grid, { className: "ds-margin-bottom", title: _11("Optional. Filter for finding entries to fix up. For example:  (uid=*).  If omitted, all entries with objectclass 'inetuser', 'inetadmin', or 'nsmemberof' under the specified subtree DN will have their memberOf attribute regenerated."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { span: 3, className: "ds-label", children: _11("Search Filter") }),
              /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                TextInput,
                {
                  value: fixupFilter,
                  type: "text",
                  id: "fixupFilter",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "fixupFilter",
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  }
                }
              ) })
            ] })
          ] }) }) })
        }
      );
    }
  };
  var MemberOfConfigEntryModal = class extends import_react27.default.Component {
    render() {
      const {
        configEntryModalShow,
        activeTabModalKey,
        handleModalChange,
        objectClasses,
        newEntry,
        settings,
        errorModal,
        handlers,
        openers,
        saveBtnDisabledModal,
        savingModal,
        extraPrimaryProps,
        validateModalFilterCreate,
        openSpecificExcludeGroupAddModal
      } = this.props;
      let modalButtons = [];
      if (!newEntry) {
        modalButtons = [
          /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { variant: "primary", onClick: this.handleShowConfirmDelete, children: _11("Delete Config") }, "del"),
          /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
            Button,
            {
              variant: "primary",
              onClick: handlers.handleEditConfig,
              isDisabled: saveBtnDisabledModal || savingModal,
              isLoading: savingModal,
              spinnerAriaValueText: savingModal ? _11("Saving") : void 0,
              ...extraPrimaryProps,
              children: savingModal ? _11("Saving ...") : _11("Save Config")
            },
            "save"
          ),
          /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { variant: "link", onClick: handlers.handleCloseModal, children: _11("Cancel") }, "cancel")
        ];
      } else {
        modalButtons = [
          /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
            Button,
            {
              variant: "primary",
              onClick: handlers.handleAddConfig,
              isDisabled: saveBtnDisabledModal || savingModal,
              isLoading: savingModal,
              spinnerAriaValueText: savingModal ? _11("Saving") : void 0,
              ...extraPrimaryProps,
              children: savingModal ? _11("Adding ...") : _11("Add Config")
            },
            "add"
          ),
          /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { variant: "link", onClick: handlers.handleCloseModal, children: _11("Cancel") }, "cancel")
        ];
      }
      return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title: _11("Manage MemberOf Plugin Shared Config Entry"),
          isOpen: configEntryModalShow,
          onClose: handlers.handleCloseModal,
          actions: modalButtons,
          children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Tabs, { isFilled: true, activeKey: activeTabModalKey, onSelect: handlers.handleNavSelectModal, children: [
            /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TabTitleText, { children: _11("Plugin Settings") }), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Grid, { className: "ds-margin-top-lg", title: _11("The config entry full DN"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { className: "ds-label", span: 3, children: _11("Config DN") }),
                /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                    TextInput,
                    {
                      value: settings.configDN,
                      type: "text",
                      id: "configDN",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "configDN",
                      onChange: (e, str) => {
                        handlers.handleModalChange(e);
                      },
                      validated: errorModal.configDN ? ValidatedOptions.error : ValidatedOptions.default,
                      isDisabled: !newEntry
                    }
                  ),
                  newEntry && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FormHelperText, { children: _11("Value must be a valid DN") })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Grid, { title: _11("Specifies the attribute in the user entry for the Directory Server to manage to reflect group membership (memberOfAttr)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { className: "ds-label", span: 3, children: _11("Membership Attribute") }),
                /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: settings.configAttr,
                    onSelect: handlers.handleConfigAttrSelect,
                    onClear: handlers.handleConfigAttrClear,
                    options: ["memberOf"],
                    placeholder: _11("Type a member attribute..."),
                    noResultsText: _11("There are no matching entries"),
                    validated: errorModal.configAttr ? "error" : "default",
                    ariaLabel: "Type a member attribute"
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Grid, { className: "ds-margin-top", title: _11("Specifies the attribute in the group entry to use to identify the DNs of group members (memberOfGroupAttr)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { className: "ds-label", span: 3, children: _11("Group Attribute") }),
                /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                  dsBasicComponents_default,
                  {
                    isMulti: true,
                    hasCheckbox: true,
                    selected: settings.configGroupAttr,
                    onSelect: handlers.handleConfigGroupAttrSelect,
                    onClear: handlers.handleConfigGroupAttrClear,
                    options: ["member", "memberCertificate", "uniqueMember"],
                    placeholder: _11("Type a member group attribute..."),
                    noResultsText: _11("There are no matching entries"),
                    validated: errorModal.configGroupAttr ? "error" : "default",
                    ariaLabel: "Type a member group attribute"
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Grid, { title: _11("If an entry does not have an object class that allows the memberOf attribute then the memberOf plugin will automatically add the object class listed in the memberOfAutoAddOC parameter"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { className: "ds-label", span: 3, children: _11("Auto Add OC") }),
                /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
                  FormSelect,
                  {
                    id: "configAutoAddOC",
                    value: settings.configAutoAddOC,
                    onChange: (event, value) => {
                      handlers.handleModalChange(event);
                    },
                    "aria-label": "FormSelect Input",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FormSelectOption, { value: "", label: "-" }, "no_setting2"),
                      objectClasses.map((attr, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FormSelectOption, { value: attr, label: attr }, attr))
                    ]
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { className: "ds-left-margin", span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                Checkbox,
                {
                  id: "configSkipNested",
                  isChecked: settings.configSkipNested,
                  onChange: (e, checked) => {
                    handleModalChange(e);
                  },
                  title: _11("Specifies wherher to skip nested groups or not (memberOfSkipNested)"),
                  label: _11("Skip Nested")
                }
              ) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Grid, { title: _11("Specifies whether to search the local suffix for user entries on all available suffixes (memberOfAllBackends)"), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { className: "ds-left-margin", span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                Checkbox,
                {
                  id: "configAllBackends",
                  isChecked: settings.configAllBackends,
                  onChange: (e, checked) => {
                    handlers.handleModalChange(e);
                  },
                  label: _11("All Backends")
                }
              ) }) })
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TabTitleText, { children: _11("Subtree Scopes") }), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Grid, { className: "ds-margin-top", title: _11("Specifies backends or multiple-nested suffixes for the MemberOf plug-in to work on (memberOfEntryScope)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { className: "ds-label", span: 3, children: _11("Subtree Scope") }),
                /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                    dsBasicComponents_default,
                    {
                      isMulti: true,
                      selected: settings.configEntryScope,
                      onSelect: handlers.handleConfigScopeSelect,
                      onClear: handlers.handleConfigScopeClear,
                      options: settings.configEntryScopeOptions,
                      isCreatable: true,
                      onCreateOption: handlers.handleConfigCreateOption,
                      validateCreate: (value) => valid_dn(value),
                      placeholder: _11("Type a subtree DN..."),
                      noResultsText: _11("There are no matching entries"),
                      validated: errorModal.configEntryScope ? "error" : "default",
                      onToggle: handlers.handleConfigScopeToggle,
                      isOpen: openers.isConfigSubtreeScopeOpen,
                      ariaLabel: "Type a subtree DN"
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FormHelperText, { children: _11("Values must be valid DN's") })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Grid, { title: _11("Specifies backends or multiple-nested suffixes for the MemberOf plug-in to exclude (memberOfEntryScopeExcludeSubtree)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { className: "ds-label", span: 3, children: _11("Exclude Subtree") }),
                /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                    dsBasicComponents_default,
                    {
                      isMulti: true,
                      selected: settings.configEntryScopeExcludeSubtreeScope,
                      onSelect: handlers.handleConfigExcludeScopeSelect,
                      onClear: handlers.handleConfigExcludeScopeClear,
                      options: settings.configEntryScopeExcludeOptions,
                      isCreatable: true,
                      onCreateOption: handlers.handleConfigExcludeCreateOption,
                      validateCreate: (value) => valid_dn(value),
                      placeholder: _11("Type a subtree DN..."),
                      noResultsText: _11("There are no matching entries"),
                      validated: errorModal.configEntryScopeExcludeSubtreeScope ? "error" : "default",
                      ariaLabel: "Type a subtree DN",
                      onToggle: handlers.handleConfigExcludeScopeToggle,
                      isOpen: openers.isConfigExcludeScopeOpen
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FormHelperText, { children: _11("Values must be valid DN's") })
                ] })
              ] })
            ] }) }),
            !newEntry && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TabTitleText, { children: _11("Group Scopes") }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                MemberOfTable,
                {
                  title: "Specific Group Filters",
                  rows: settings.configSpecificGroup,
                  addAttr: handlers.openSpecificGroupAddModal,
                  deleteAttr: handlers.openDeleteFilterConfirmation
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                Button,
                {
                  id: "specific-group-filter",
                  className: "ds-margin-top",
                  variant: "secondary",
                  onClick: handlers.openSpecificGroupAddModal,
                  children: "Add filter"
                },
                "specific-group-filter"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                MemberOfTable,
                {
                  title: "Specific Group Exclude Filters",
                  rows: settings.configExcludeSpecificGroup,
                  addAttr: handlers.openSpecificExcludeGroupAddModal,
                  deleteAttr: handlers.openDeleteExcludeFilterConfirmation
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                Button,
                {
                  id: "specific-group-exclude-filter",
                  className: "ds-margin-top",
                  variant: "secondary",
                  onClick: openSpecificExcludeGroupAddModal,
                  children: "Add exclude filter"
                },
                "specific-group-exclude-filter"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
                Grid,
                {
                  className: "ds-margin-top-lg",
                  title: _11("Specifies the objectclasses for the specific groups to include/exclude (memberOfSpecificGroupOC)"),
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { className: "ds-label", span: 3, children: _11("Specific Group OC") }),
                    /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                      dsBasicComponents_default,
                      {
                        isMulti: true,
                        selected: settings.configSpecificGroupOC,
                        onSelect: handlers.handleConfigSpecificGroupOCSelect,
                        onClear: handlers.handleConfigSpecificGroupOCClear,
                        options: objectClasses,
                        placeholder: _11("Type a objectclass..."),
                        noResultsText: "There are no matching objectclasses",
                        ariaLabel: "Type a objectclass",
                        onToggle: handlers.handleConfigSpecificGroupOCToggle,
                        isOpen: openers.isConfigSpecificGroupOCOpen
                      }
                    ) })
                  ]
                }
              )
            ] }),
            newEntry && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TabTitleText, { children: _11("Specific Group Filters") }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
                Grid,
                {
                  className: "ds-margin-top-lg",
                  title: "Specifies a filter for specific groups to include, example: (cn=group). (memberOfSpecificGroupFilter)",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { className: "ds-label", span: 3, children: "Specific Group Filter" }),
                    /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(GridItem, { span: 9, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                        dsBasicComponents_default,
                        {
                          isMulti: true,
                          selected: settings.configSpecificGroup,
                          onSelect: handlers.handleConfigSpecificGroupSelect,
                          onClear: handlers.handleConfigSpecificGroupClear,
                          options: settings.configSpecificGroupOptions,
                          isCreatable: true,
                          onCreateOption: handlers.handleConfigSpecificGroupCreateOption,
                          validateCreate: (value) => validateModalFilterCreate(value, "configSpecificGroup"),
                          placeholder: _11("Type a search filter..."),
                          validated: errorModal.configSpecificGroup ? "error" : "default",
                          ariaLabel: "Type a search filter",
                          onToggle: handlers.handleConfigSpecificGroupToggle,
                          isOpen: openers.isConfigSpecificGroupOpen
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FormHelperText, { children: _11("Values must be valid search filters") })
                    ] })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
                Grid,
                {
                  className: "ds-margin-top-lg",
                  title: "Specifies a filter for specific groups to exclude, example: (cn=group). (memberOfExcludeSpecificGroupFilter)",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { className: "ds-label", span: 3, children: "Exclude Specific Group Filter" }),
                    /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(GridItem, { span: 9, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                        dsBasicComponents_default,
                        {
                          isMulti: true,
                          selected: settings.configExcludeSpecificGroup,
                          onSelect: handlers.handleConfigExcludeSpecificGroupSelect,
                          onClear: handlers.handleConfigExcludeSpecificGroupClear,
                          options: settings.configExcludeSpecificGroupOptions,
                          isCreatable: true,
                          onCreateOption: handlers.handleConfigExcludeSpecificGroupCreateOption,
                          validateCreate: (value) => validateModalFilterCreate(value, "configExcludeSpecificGroup"),
                          placeholder: _11("Type a search filter..."),
                          validated: errorModal.configExcludeSpecificGroup ? "error" : "default",
                          ariaLabel: "Type a search filter",
                          onToggle: handlers.handleConfigExcludeSpecificGroupToggle,
                          isOpen: openers.isConfigExcludeSpecificGroupOpen
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FormHelperText, { children: "Values must be valid search filters" })
                    ] })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
                Grid,
                {
                  title: _11("Specifies the objectclasses for the specific groups to include/exclude (memberOfSpecificGroupOC)"),
                  className: "ds-margin-top-lg",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { className: "ds-label", span: 3, children: _11("Specific Group OC") }),
                    /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(GridItem, { span: 9, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                        dsBasicComponents_default,
                        {
                          isMulti: true,
                          selected: settings.configSpecificGroupOC,
                          onSelect: handlers.handleConfigSpecificGroupOCSelect,
                          onClear: handlers.handleConfigSpecificGroupOCClear,
                          options: objectClasses,
                          placeholder: _11("Type a objectclass..."),
                          noResultsText: "There are no matching objectclasses",
                          ariaLabel: "Type a objectclass",
                          onToggle: handlers.handleConfigSpecificGroupOCToggle,
                          isOpen: openers.isConfigSpecificGroupOCOpen
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FormHelperText, { children: _11("Values must be valid objectclasses") })
                    ] })
                  ]
                }
              )
            ] })
          ] })
        }
      );
    }
  };
  MemberOfConfigEntryModal.propTypes = {
    handlers: import_prop_types12.default.object,
    openers: import_prop_types12.default.object,
    settings: import_prop_types12.default.object,
    errorModal: import_prop_types12.default.object,
    activeTabModalKey: import_prop_types12.default.number,
    objectClasses: import_prop_types12.default.array,
    newEntry: import_prop_types12.default.bool,
    configEntryModalShow: import_prop_types12.default.bool,
    saveBtnDisabledModal: import_prop_types12.default.bool,
    savingModal: import_prop_types12.default.bool,
    extraPrimaryProps: import_prop_types12.default.object,
    validateModalFilterCreate: import_prop_types12.default.func
  };
  MemberOfConfigEntryModal.defaultProps = {
    handlers: {},
    openers: {},
    settings: {},
    errorModal: {},
    activeTabModalKey: 0,
    objectClasses: [],
    newEntry: false,
    configEntryModalShow: false,
    saveBtnDisabledModal: false,
    savingModal: false,
    extraPrimaryProps: {},
    validateModalFilterCreate: () => {
    }
  };
  var MemberOfSpecificGroupFilterModal = class extends import_react27.default.Component {
    render() {
      const {
        isSpecificGroupModalOpen,
        closeSpecificGroupAddModal,
        handleAddDelSpecificGroupFilter,
        groupFilter,
        groupFilterType,
        handleFieldChange,
        modalSpinning,
        validFilterChange
      } = this.props;
      return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
        Modal,
        {
          variant: ModalVariant.small,
          "aria-labelledby": "ds-modal",
          title: groupFilterType === "include" ? _11("Add Specific Group Filter") : _11("Add Specific Group Exclude Filter"),
          isOpen: isSpecificGroupModalOpen,
          onClose: closeSpecificGroupAddModal,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
              Button,
              {
                variant: "primary",
                onClick: () => handleAddDelSpecificGroupFilter("add", groupFilter),
                isDisabled: !validFilterChange(groupFilter),
                children: modalSpinning ? _11("Adding ...") : _11("Add Filter")
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { variant: "link", onClick: closeSpecificGroupAddModal, children: _11("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { className: "ds-margin-top", component: TextVariants.h4, children: _11("Enter an LDAP search filter, example: (cn=group)") }) }),
            /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GridItem, { className: "ds-label", span: 3, children: _11(groupFilterType === "include" ? "Specific Group Filter" : "Specific Group Exclude Filter") }),
              /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(GridItem, { span: 9, children: [
                /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
                  TextInput,
                  {
                    value: groupFilter,
                    type: "text",
                    id: "groupFilter",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "groupFilter",
                    onChange: (e, str) => {
                      handleFieldChange(e);
                    },
                    validated: groupFilter !== "" && !validFilterChange(groupFilter) ? ValidatedOptions.error : ValidatedOptions.default,
                    isDisabled: modalSpinning
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FormHelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(HelperTextItem, { variant: groupFilter !== "" && !validFilterChange(groupFilter) ? "error" : "default", ...groupFilter !== "" && !validFilterChange(groupFilter) && { icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(exclamation_circle_icon_default, {}) }, children: _11("Value must be a valid LDAP filter, and it must be unique.") }) }) })
              ] })
            ] })
          ] })
        }
      );
    }
  };

  // src/lib/plugins/memberOf.jsx
  var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
  var _12 = cockpit_default.gettext;
  var MemberOf = class extends import_react28.default.Component {
    componentDidMount(prevProps) {
      if (this.props.wasActiveList.includes(5)) {
        if (this.state.firstLoad) {
          this.updateFields();
        }
      }
    }
    componentDidUpdate(prevProps) {
      if (this.props.rows !== prevProps.rows) {
        this.updateFields();
      }
    }
    constructor(props) {
      super(props);
      this.updateFields = this.updateFields.bind(this);
      this.onChange = this.onChange.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.handleModalChange = this.handleModalChange.bind(this);
      this.handleOpenModal = this.handleOpenModal.bind(this);
      this.handleCloseModal = this.handleCloseModal.bind(this);
      this.handleAddConfig = this.handleAddConfig.bind(this);
      this.handleEditConfig = this.handleEditConfig.bind(this);
      this.deleteConfig = this.deleteConfig.bind(this);
      this.cmdOperation = this.cmdOperation.bind(this);
      this.handleRunFixup = this.handleRunFixup.bind(this);
      this.handleToggleFixupModal = this.handleToggleFixupModal.bind(this);
      this.handleSaveConfig = this.handleSaveConfig.bind(this);
      this.handleShowConfirmDelete = this.handleShowConfirmDelete.bind(this);
      this.closeConfirmDelete = this.closeConfirmDelete.bind(this);
      this.validateConfig = this.validateConfig.bind(this);
      this.validateModal = this.validateModal.bind(this);
      this.validateFilterCreate = this.validateFilterCreate.bind(this);
      this.validateModalFilterCreate = this.validateModalFilterCreate.bind(this);
      this.handleNavSelect = this.handleNavSelect.bind(this);
      this.handleNavSelectModal = this.handleNavSelectModal.bind(this);
      this.openSpecificGroupAddModal = this.openSpecificGroupAddModal.bind(this);
      this.openSpecificExcludeGroupAddModal = this.openSpecificExcludeGroupAddModal.bind(this);
      this.closeSpecificGroupAddModal = this.closeSpecificGroupAddModal.bind(this);
      this.handleAddDelSpecificGroupFilter = this.handleAddDelSpecificGroupFilter.bind(this);
      this.handleExcludeSpecificGroupAdd = this.handleExcludeSpecificGroupAdd.bind(this);
      this.handleExcludeSpecificGroupDelete = this.handleExcludeSpecificGroupDelete.bind(this);
      this.openDeleteFilterConfirmation = this.openDeleteFilterConfirmation.bind(this);
      this.closeDeleteFilterConfirmation = this.closeDeleteFilterConfirmation.bind(this);
      this.openDeleteExcludeFilterConfirmation = this.openDeleteExcludeFilterConfirmation.bind(this);
      this.closeDeleteExcludeFilterConfirmation = this.closeDeleteExcludeFilterConfirmation.bind(this);
      this.validFilterChange = this.validFilterChange.bind(this);
      this.state = {
        activeTabKey: 0,
        activeTabModalKey: 0,
        firstLoad: true,
        error: {},
        errorModal: {},
        saveBtnDisabled: true,
        saveBtnDisabledModal: true,
        showConfirmDelete: false,
        modalChecked: false,
        modalSpinning: false,
        newEntry: true,
        fixupDN: "",
        fixupFilter: "",
        // Main settings
        memberOfAttr: "",
        memberOfGroupAttr: [],
        memberOfEntryScope: [],
        memberOfEntryScopeOptions: [],
        memberOfEntryScopeExcludeSubtree: [],
        memberOfEntryScopeExcludeOptions: [],
        memberOfSpecificGroup: [],
        memberOfSpecificGroupOptions: [],
        memberOfExcludeSpecificGroup: [],
        memberOfExcludeSpecificGroupOptions: [],
        memberOfSpecificGroupOC: [],
        memberOfSpecificGroupOCOptions: [],
        memberOfAutoAddOC: "",
        memberOfAllBackends: false,
        memberOfSkipNested: false,
        memberOfConfigEntry: "",
        configEntryModalShow: false,
        fixupModalShow: false,
        isSubtreeScopeOpen: false,
        isExcludeScopeOpen: false,
        isSpecificGroupOpen: false,
        isExcludeSpecificGroupOpen: false,
        isSpecificGroupOCOpen: false,
        isMemberOfAttrOpen: false,
        isMemberOfGroupAttrOpen: false,
        isMemberOfAutoAddOCOpen: false,
        // Modal settings
        configDN: "",
        configAttr: "",
        configGroupAttr: [],
        configEntryScope: [],
        configEntryScopeOptions: [],
        configEntryScopeExcludeSubtreeScope: [],
        configEntryScopeExcludeOptions: [],
        configSpecificGroupOptions: [],
        configExcludeSpecificGroupOptions: [],
        configAutoAddOC: "",
        configAllBackends: false,
        configSkipNested: false,
        configSpecificGroup: [],
        configExcludeSpecificGroup: [],
        configSpecificGroupOC: [],
        isConfigSubtreeScopeOpen: false,
        isConfigExcludeScopeOpen: false,
        isConfigSpecificGroupOCOpen: false,
        isConfigSpecificGroupOpen: false,
        isConfigExcludeSpecificGroupOpen: false,
        isConfigAttrOpen: false,
        isConfigGroupAttrOpen: false,
        isConfigAutoAddOCOpen: false,
        isSpecificGroupModalOpen: false,
        groupFilter: "",
        groupFilterType: "include",
        showDeleteFilterConfirmation: false,
        showDeleteExcludeFilterConfirmation: false
      };
      this.handleConfigAttrSelect = (event, selection) => {
        if (selection === this.state.configAttr) {
          this.handleConfigAttrClear();
        } else {
          this.setState({
            configAttr: selection,
            isConfigAttrOpen: false
          }, () => {
            this.validateModal();
          });
        }
      };
      this.handleConfigAttrToggle = (_event, isConfigAttrOpen) => {
        this.setState({
          isConfigAttrOpen
        });
      };
      this.handleConfigAttrClear = () => {
        this.setState({
          configAttr: "",
          isConfigAttrOpen: false
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigGroupAttrSelect = (event, selection) => {
        this.setState({
          configGroupAttr: Array.isArray(selection) ? selection : []
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigGroupAttrToggle = (_event, isConfigGroupAttrOpen) => {
        this.setState({
          isConfigGroupAttrOpen
        });
      };
      this.handleConfigGroupAttrClear = () => {
        this.setState({
          configGroupAttr: [],
          isConfigGroupAttrOpen: false
        }, () => {
          this.validateModal();
        });
      };
      this.handleMemberOfAttrSelect = (event, selection) => {
        this.setState({
          memberOfAttr: selection || ""
        }, () => {
          this.validateConfig();
        });
      };
      this.handleMemberOfAttrToggle = (_event, isMemberOfAttrOpen) => {
        this.setState({
          isMemberOfAttrOpen
        });
      };
      this.handleMemberOfAttrClear = () => {
        this.setState({
          memberOfAttr: ""
        }, () => {
          this.validateConfig();
        });
      };
      this.handleMemberOfGroupAttrSelect = (event, selection) => {
        this.setState({
          memberOfGroupAttr: Array.isArray(selection) ? selection : []
        }, () => {
          this.validateConfig();
        });
      };
      this.handleMemberOfGroupAttrToggle = (_event, isMemberOfGroupAttrOpen) => {
        this.setState({
          isMemberOfGroupAttrOpen
        });
      };
      this.handleMemberOfGroupAttrClear = () => {
        this.setState({
          memberOfGroupAttr: []
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSubtreeScopeSelect = (event, selection) => {
        this.setState({
          memberOfEntryScope: Array.isArray(selection) ? selection : []
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSubtreeScopeToggle = (_event, isSubtreeScopeOpen) => {
        this.setState({
          isSubtreeScopeOpen
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSubtreeScopeClear = () => {
        this.setState({
          memberOfEntryScope: []
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSubtreeScopeCreateOption = (newValue) => {
        if (newValue.trim() && valid_dn(newValue) && !this.state.memberOfEntryScopeOptions.includes(newValue)) {
          this.setState({
            memberOfEntryScopeOptions: [...this.state.memberOfEntryScopeOptions, newValue],
            isSubtreeScopeOpen: false
          }, () => {
            this.validateConfig();
          });
        }
      };
      this.handleExcludeScopeSelect = (event, selection) => {
        this.setState({
          memberOfEntryScopeExcludeSubtree: Array.isArray(selection) ? selection : []
        }, () => {
          this.validateConfig();
        });
      };
      this.handleExcludeScopeToggle = (_event, isExcludeScopeOpen) => {
        this.setState({
          isExcludeScopeOpen
        }, () => {
          this.validateConfig();
        });
      };
      this.handleExcludeScopeClear = () => {
        this.setState({
          memberOfEntryScopeExcludeSubtree: []
        }, () => {
          this.validateConfig();
        });
      };
      this.handleExcludeCreateOption = (newValue) => {
        if (newValue.trim() && valid_dn(newValue) && !this.state.memberOfEntryScopeExcludeOptions.includes(newValue)) {
          this.setState({
            memberOfEntryScopeExcludeOptions: [...this.state.memberOfEntryScopeExcludeOptions, newValue],
            isExcludeScopeOpen: false
          }, () => {
            this.validateConfig();
          });
        }
      };
      this.handleConfigScopeSelect = (event, selection) => {
        this.setState({
          configEntryScope: Array.isArray(selection) ? selection : [],
          configEntryScopeOptions: []
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigScopeToggle = (_event, isConfigSubtreeScopeOpen) => {
        this.setState({
          isConfigSubtreeScopeOpen
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigScopeClear = () => {
        this.setState({
          configEntryScope: [],
          configEntryScopeOptions: []
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigCreateOption = (newValue) => {
        if (newValue.trim() && valid_dn(newValue) && !this.state.configEntryScopeOptions.includes(newValue)) {
          this.setState({
            configEntryScopeOptions: [...this.state.configEntryScopeOptions, newValue],
            isConfigSubtreeScopeOpen: false
          }, () => {
            this.validateModal();
          });
        }
      };
      this.handleConfigExcludeScopeSelect = (event, selection) => {
        this.setState({
          configEntryScopeExcludeSubtreeScope: Array.isArray(selection) ? selection : []
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigExcludeScopeToggle = (_event, isConfigExcludeScopeOpen) => {
        this.setState({
          isConfigExcludeScopeOpen
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigExcludeScopeClear = () => {
        this.setState({
          configEntryScopeExcludeSubtreeScope: [],
          configEntryScopeExcludeOptions: []
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigExcludeCreateOption = (newValue) => {
        if (newValue.trim() && valid_dn(newValue) && !this.state.configEntryScopeExcludeOptions.includes(newValue)) {
          this.setState({
            configEntryScopeExcludeOptions: [...this.state.configEntryScopeExcludeOptions, newValue],
            isConfigExcludeScopeOpen: false
          }, () => {
            this.validateModal();
          });
        }
      };
      this.handleConfigSpecificGroupSelect = (event, selection) => {
        this.setState({
          configSpecificGroup: Array.isArray(selection) ? selection : []
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigSpecificGroupToggle = (_event, isConfigSpecificGroupOpen) => {
        this.setState({
          isConfigSpecificGroupOpen
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigSpecificGroupClear = () => {
        this.setState({
          configSpecificGroup: []
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigSpecificGroupCreateOption = (newValue) => {
        if (newValue.trim() && valid_filter(newValue) && !this.state.configSpecificGroupOptions.includes(newValue)) {
          this.setState({
            configSpecificGroupOptions: [...this.state.configSpecificGroupOptions, newValue],
            isConfigSpecificGroupOpen: false
          }, () => {
            this.validateModal();
          });
        }
      };
      this.handleConfigExcludeSpecificGroupSelect = (event, selection) => {
        this.setState({
          configExcludeSpecificGroup: Array.isArray(selection) ? selection : []
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigExcludeSpecificGroupToggle = (_event, isConfigExcludeSpecificGroupOpen) => {
        this.setState({
          isConfigExcludeSpecificGroupOpen
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigExcludeSpecificGroupClear = () => {
        this.setState({
          configExcludeSpecificGroup: [],
          configExcludeSpecificGroupOptions: []
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigExcludeSpecificGroupCreateOption = (newValue) => {
        if (newValue.trim() && valid_filter(newValue) && !this.state.configExcludeSpecificGroupOptions.includes(newValue)) {
          this.setState({
            configExcludeSpecificGroupOptions: [...this.state.configExcludeSpecificGroupOptions, newValue],
            isConfigExcludeSpecificGroupOpen: false
          }, () => {
            this.validateModal();
          });
        }
      };
      this.handleConfigSpecificGroupOCSelect = (event, selection) => {
        this.setState({
          configSpecificGroupOC: Array.isArray(selection) ? selection : [],
          isConfigSpecificGroupOCOpen: false
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigSpecificGroupOCClear = () => {
        this.setState({
          configSpecificGroupOC: []
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigSpecificGroupOCToggle = (_event, isConfigSpecificGroupOCOpen) => {
        this.setState({
          isConfigSpecificGroupOCOpen
        }, () => {
          this.validateModal();
        });
      };
      this.handleSpecificGroupOCSelect = (event, selection) => {
        this.setState({
          memberOfSpecificGroupOC: Array.isArray(selection) ? selection : [],
          isSpecificGroupOCOpen: false
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSpecificGroupOCClear = () => {
        this.setState({
          memberOfSpecificGroupOC: []
        }, () => {
          this.validateConfig();
        });
      };
      this.handleSpecificGroupOCToggle = (_event, isSpecificGroupOCOpen) => {
        this.setState({
          isSpecificGroupOCOpen
        }, () => {
          this.validateConfig();
        });
      };
    }
    handleNavSelect(event, key) {
      this.setState({ activeTabKey: key });
    }
    handleNavSelectModal(event, key) {
      this.setState({ activeTabModalKey: key });
    }
    handleToggleFixupModal() {
      this.setState((prevState) => ({
        fixupModalShow: !prevState.fixupModalShow,
        fixupDN: "",
        fixupFilter: "",
        savingModal: false
      }));
    }
    validateFilterCreate(value, attr) {
      let result = valid_filter(value);
      let errObj = this.state.error;
      if (!result) {
        errObj[attr] = true;
      } else {
        errObj[attr] = false;
      }
      this.setState({
        error: errObj
      });
      return result;
    }
    validateModalFilterCreate(value, attr) {
      let result = valid_filter(value);
      let errObj = this.state.errorModal;
      if (!result) {
        errObj[attr] = true;
      } else {
        errObj[attr] = false;
      }
      this.setState({
        errorModal: errObj
      });
      return result;
    }
    validateConfig() {
      const errObj = {};
      let all_good = true;
      const reqAttrs = [
        "memberOfAttr"
      ];
      const reqLists = [
        "memberOfGroupAttr"
      ];
      const dnAttrs = [
        "memberOfConfigEntry"
      ];
      const dnLists = [
        "memberOfEntryScopeExcludeSubtree",
        "memberOfEntryScope"
      ];
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          all_good = false;
          errObj[attr] = true;
        }
      }
      for (const attr of reqLists) {
        if (this.state[attr].length === 0) {
          all_good = false;
          errObj[attr] = true;
        }
      }
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          errObj[attr] = true;
          all_good = false;
        }
      }
      for (const dn_list of dnLists) {
        for (const dn of this.state[dn_list]) {
          if (!valid_dn(dn)) {
            errObj[dn_list] = true;
            all_good = false;
          }
        }
      }
      if (all_good) {
        all_good = false;
        const attrLists = [
          "memberOfEntryScope",
          "memberOfEntryScopeExcludeSubtree",
          "memberOfGroupAttr",
          "memberOfSpecificGroupOC"
        ];
        for (const check_attr of attrLists) {
          if (!listsEqual(this.state[check_attr], this.state["_" + check_attr])) {
            all_good = true;
            break;
          }
        }
        const configAttrs2 = [
          "memberOfAllBackends",
          "memberOfSkipNested",
          "memberOfConfigEntry",
          "memberOfAttr",
          "memberOfAutoAddOC"
        ];
        for (const check_attr of configAttrs2) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabled: !all_good,
        error: errObj
      });
    }
    validateModal() {
      const errObj = {};
      let all_good = true;
      const reqAttrs = [
        "configDN",
        "configAttr"
      ];
      const reqLists = [
        "configGroupAttr"
      ];
      const dnAttrs = [
        "configDN"
      ];
      const dnLists = [
        "configEntryScope",
        "configEntryScopeExcludeSubtreeScope"
      ];
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          all_good = false;
          errObj[attr] = true;
        }
      }
      for (const attr of reqLists) {
        if (this.state[attr].length === 0) {
          all_good = false;
          errObj[attr] = true;
        }
      }
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          errObj[attr] = true;
          all_good = false;
          break;
        }
      }
      for (const dn_list of dnLists) {
        for (const dn of this.state[dn_list]) {
          if (!valid_dn(dn)) {
            errObj[dn_list] = true;
            all_good = false;
          }
        }
      }
      if (all_good) {
        all_good = false;
        const attrLists = [
          "configEntryScope",
          "configEntryScopeExcludeSubtreeScope",
          "configGroupAttr",
          "configSpecificGroupOC"
        ];
        for (const check_attr of attrLists) {
          if (!listsEqual(this.state[check_attr], this.state["_" + check_attr])) {
            all_good = true;
            break;
          }
        }
        const configAttrs2 = [
          "configDN",
          "configAttr",
          "configAutoAddOC",
          "configAllBackends",
          "configSkipNested"
        ];
        for (const check_attr of configAttrs2) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabledModal: !all_good,
        errorModal: errObj
      });
    }
    handleFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validateConfig();
      });
    }
    handleModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validateModal();
      });
    }
    validFilterChange(value) {
      if (value.trim() && valid_filter(value) && !this.state.configSpecificGroupOptions.includes(value) && !this.state.configExcludeSpecificGroupOptions.includes(value)) {
        return true;
      }
      return false;
    }
    handleShowConfirmDelete() {
      this.setState({
        showConfirmDelete: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmDelete() {
      this.setState({
        showConfirmDelete: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    toggleFixupModal() {
      this.setState((prevState) => ({
        fixupModalShow: !prevState.fixupModalShow,
        fixupDN: "",
        fixupFilter: ""
      }));
    }
    handleRunFixup() {
      if (!this.state.fixupDN) {
        this.props.addNotification("warning", _12("Fixup DN is required."));
      } else {
        let cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "memberof",
          "fixup",
          this.state.fixupDN
        ];
        if (this.state.fixupFilter) {
          cmd = [...cmd, "--filter", this.state.fixupFilter];
        }
        this.props.toggleLoadingHandler();
        log_cmd("handleRunFixup", "Run fixup MemberOf Plugin ", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          this.props.addNotification(
            "success",
            cockpit_default.format(_12("Fixup task for $0 was successful"), this.state.fixupDN)
          );
          this.props.toggleLoadingHandler();
          this.setState({
            fixupModalShow: false
          });
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.addNotification(
            "error",
            cockpit_default.format(_12("Fixup task for $0 has failed $1"), this.state.fixupDN, errMsg)
          );
          this.props.toggleLoadingHandler();
          this.setState({
            fixupModalShow: false
          });
        });
      }
    }
    handleOpenModal() {
      if (!this.state.memberOfConfigEntry) {
        this.setState({
          activeTabModalKey: 0,
          configEntryModalShow: true,
          newEntry: true,
          configDN: "",
          configAttr: "",
          configGroupAttr: [],
          configEntryScope: [],
          configEntryScopeExcludeSubtreeScope: [],
          configSpecificGroup: [],
          configExcludeSpecificGroup: [],
          configSpecificGroupOC: [],
          configAutoAddOC: "",
          configAllBackends: false,
          configSkipNested: false,
          saveBtnDisabledModal: true
        });
      } else {
        let configScopeList = [];
        let configExcludeScopeList = [];
        let configGroupAttrObjectList = [];
        let configSpecificGroupList = [];
        let configExcludeSpecificGroupList = [];
        let configSpecificGroupOCList = [];
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "memberof",
          "config-entry",
          "show",
          this.state.memberOfConfigEntry
        ];
        this.props.toggleLoadingHandler();
        log_cmd("openMemberOfModal", "Fetch the MemberOf Plugin config entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const configEntry = JSON.parse(content).attrs;
          this.setState({
            activeTabModalKey: 0,
            configEntryModalShow: true,
            newEntry: false,
            saveBtnDisabledModal: true,
            configDN: this.state.memberOfConfigEntry,
            _configDN: this.state.memberOfConfigEntry,
            configAttr: configEntry.memberofattr === void 0 ? "" : configEntry.memberofattr[0],
            _configAttr: configEntry.memberofattr === void 0 ? "" : configEntry.memberofattr[0],
            configAutoAddOC: configEntry.memberofautoaddoc === void 0 ? "" : configEntry.memberofautoaddoc[0],
            _configAutoAddOC: configEntry.memberofautoaddoc === void 0 ? "" : configEntry.memberofautoaddoc[0],
            configAllBackends: !(configEntry.memberofallbackends === void 0 || configEntry.memberofallbackends[0] === "off"),
            _configAllBackends: !(configEntry.memberofallbackends === void 0 || configEntry.memberofallbackends[0] === "off"),
            configSkipNested: !(configEntry.memberofskipnested === void 0 || configEntry.memberofskipnested[0] === "off"),
            _configSkipNested: !(configEntry.memberofskipnested === void 0 || configEntry.memberofskipnested[0] === "off"),
            configConfigEntry: configEntry["nsslapd-pluginConfigArea"] === void 0 ? "" : configEntry["nsslapd-pluginConfigArea"][0],
            _configConfigEntry: configEntry["nsslapd-pluginConfigArea"] === void 0 ? "" : configEntry["nsslapd-pluginConfigArea"][0]
          });
          if (configEntry.memberofgroupattr === void 0) {
            this.setState({ configGroupAttr: [], _configGroupAttr: [] });
          } else {
            for (const value of configEntry.memberofgroupattr) {
              configGroupAttrObjectList = [...configGroupAttrObjectList, value];
            }
            this.setState({
              configGroupAttr: configGroupAttrObjectList,
              _configGroupAttr: [...configGroupAttrObjectList]
            });
          }
          if (configEntry.memberofentryscope === void 0) {
            this.setState({ configEntryScope: [], _configEntryScope: [] });
          } else {
            for (const value of configEntry.memberofentryscope) {
              configScopeList = [...configScopeList, value];
            }
            this.setState({
              configEntryScope: configScopeList,
              _configEntryScope: [...configScopeList]
            });
          }
          if (configEntry.memberofentryscopeexcludesubtree === void 0) {
            this.setState({ configEntryScopeExcludeSubtreeScope: [], _configEntryScopeExcludeSubtreeScope: [] });
          } else {
            for (const value of configEntry.memberofentryscopeexcludesubtree) {
              configExcludeScopeList = [...configExcludeScopeList, value];
            }
            this.setState({
              configEntryScopeExcludeSubtreeScope: configExcludeScopeList,
              _configEntryScopeExcludeSubtreeScope: [...configExcludeScopeList]
            });
          }
          if (configEntry.memberofspecificgroupfilter === void 0) {
            this.setState({ configSpecificGroup: [], _configSpecificGroup: [] });
          } else {
            for (const value of configEntry.memberofspecificgroupfilter) {
              configSpecificGroupList = [...configSpecificGroupList, value];
            }
            this.setState({
              configSpecificGroup: configSpecificGroupList,
              _configSpecificGroup: [...configSpecificGroupList]
            });
          }
          if (configEntry.memberofexcludespecificgroupfilter === void 0) {
            this.setState({ configExcludeSpecificGroup: [], _configExcludeSpecificGroup: [] });
          } else {
            for (const value of configEntry.memberofexcludespecificgroupfilter) {
              configExcludeSpecificGroupList = [...configExcludeSpecificGroupList, value];
            }
            this.setState({
              configExcludeSpecificGroup: configExcludeSpecificGroupList,
              _configExcludeSpecificGroup: [...configExcludeSpecificGroupList]
            });
          }
          if (configEntry.memberofspecificgroupoc === void 0) {
            this.setState({ configSpecificGroupOC: [], _configSpecificGroupOC: [] });
          } else {
            for (const value of configEntry.memberofspecificgroupoc) {
              configSpecificGroupOCList = [...configSpecificGroupOCList, value];
            }
            this.setState({
              configSpecificGroupOC: configSpecificGroupOCList,
              _configSpecificGroupOC: [...configSpecificGroupOCList]
            });
          }
          this.props.toggleLoadingHandler();
        }).fail((_113) => {
          this.setState({
            configEntryModalShow: true,
            newEntry: true,
            configDN: this.state.memberOfConfigEntry,
            configAttr: [],
            configGroupAttr: [],
            configEntryScope: [],
            configEntryScopeExcludeSubtreeScope: [],
            configSpecificGroup: [],
            configExcludeSpecificGroup: [],
            configSpecificGroupOC: [],
            configAutoAddOC: "",
            configAllBackends: false,
            configSkipNested: false,
            _configDN: this.state.memberOfConfigEntry,
            _configAttr: "",
            _configAutoAddOC: "",
            _configAllBackends: false,
            _configSkipNested: false,
            _configConfigEntry: "",
            _configGroupAttr: [],
            _configEntryScope: [],
            _configEntryScopeExcludeSubtreeScope: [],
            _configSpecificGroup: [],
            _configExcludeSpecificGroup: [],
            _configSpecificGroupOC: []
          });
          this.props.toggleLoadingHandler();
        });
      }
    }
    handleCloseModal() {
      this.setState({ configEntryModalShow: false });
    }
    // Modal config entry update
    cmdOperation(action) {
      const {
        configDN,
        configAttr,
        configGroupAttr,
        configEntryScope,
        configEntryScopeExcludeSubtreeScope,
        configAutoAddOC,
        configAllBackends,
        configSkipNested,
        configSpecificGroup,
        configExcludeSpecificGroup,
        configSpecificGroupOC
      } = this.state;
      if (configAttr.length === 0 || configGroupAttr.length === 0) {
        this.props.addNotification(
          "warning",
          _12("Config Attribute and Group Attribute are required.")
        );
      } else {
        let cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "memberof",
          "config-entry",
          action,
          configDN,
          "--attr",
          configAttr || action === "add" ? configAttr : "delete",
          "--allbackends",
          configAllBackends ? "on" : "off",
          "--skipnested",
          configSkipNested ? "on" : "off"
        ];
        if (configEntryScope.length !== 0) {
          cmd = [...cmd, "--scope"];
          for (const value of configEntryScope) {
            cmd = [...cmd, value];
          }
        } else if (action !== "add") {
          cmd = [...cmd, "--scope", "delete"];
        }
        if (configAutoAddOC !== "") {
          cmd = [...cmd, "--autoaddoc", configAutoAddOC];
        } else if (action !== "add") {
          cmd = [...cmd, "--autoaddoc", "delete"];
        }
        if (configEntryScopeExcludeSubtreeScope.length !== 0) {
          cmd = [...cmd, "--exclude"];
          for (const value of configEntryScopeExcludeSubtreeScope) {
            cmd = [...cmd, value];
          }
        } else if (action !== "add") {
          cmd = [...cmd, "--exclude", "delete"];
        }
        if (configSpecificGroup.length !== 0) {
          cmd = [...cmd, "--specific-group-filter"];
          for (const value of configSpecificGroup) {
            cmd = [...cmd, value];
          }
        } else if (action !== "add") {
          cmd = [...cmd, "--specific-group", "delete"];
        }
        if (configExcludeSpecificGroup.length !== 0) {
          cmd = [...cmd, "--exclude-specific-group-filter"];
          for (const value of configExcludeSpecificGroup) {
            cmd = [...cmd, value];
          }
        } else if (action !== "add") {
          cmd = [...cmd, "--exclude-specific-group", "delete"];
        }
        if (configSpecificGroupOC.length !== 0) {
          cmd = [...cmd, "--specific-group-oc"];
          for (const value of configSpecificGroupOC) {
            cmd = [...cmd, value];
          }
        } else if (action !== "add") {
          cmd = [...cmd, "--specific-group-oc", "delete"];
        }
        if (configGroupAttr.length !== 0) {
          cmd = [...cmd, "--groupattr"];
          for (const value of configGroupAttr) {
            cmd = [...cmd, value];
          }
        } else if (action !== "add") {
          cmd = [...cmd, "--groupattr", "delete"];
        }
        this.setState({
          savingModal: true
        });
        log_cmd("memberOfOperation", `Do the ${action} operation on the MemberOf Plugin`, cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          console.info("memberOfOperation", "Result", content);
          const value = action === "set" ? "edit" : "add";
          this.props.addNotification(
            "success",
            cockpit_default.format(_12("Config entry $0 was successfully $1"), configDN, value + "ed")
          );
          this.props.pluginListHandler();
          this.handleCloseModal();
          this.setState({
            savingModal: false
          });
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.addNotification(
            "error",
            cockpit_default.format(_12("Error during the config entry $0 operation - $1"), action, errMsg)
          );
          this.props.pluginListHandler();
          this.handleCloseModal();
          this.setState({
            savingModal: false
          });
        });
      }
    }
    deleteConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "memberof",
        "config-entry",
        "delete",
        this.state.configDN
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteConfig", "Delete the MemberOf Plugin config entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteConfig", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_12("Config entry $0 was successfully deleted"), this.state.configDN)
        );
        this.props.pluginListHandler();
        this.handleCloseModal();
        this.closeConfirmDelete();
        this.setState({
          modalSpinning: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_12("Error during the config entry removal operation - $0"), errMsg)
        );
        this.props.pluginListHandler();
        this.handleCloseModal();
        this.closeConfirmDelete();
        this.setState({
          modalSpinning: false
        });
      });
    }
    async handleAddConfig() {
      const params = {
        serverId: this.props.serverId,
        configDN: this.state.configDN
      };
      try {
        const exists2 = await parentExists(params);
        if (exists2) {
          this.cmdOperation("add");
        } else {
          this.props.addNotification(
            "error",
            cockpit_default.format(
              _12('Config DN "$0" does not exist, it must be a full DN!'),
              params.configDN
            )
          );
        }
      } catch (err) {
        console.error("Error checking DN:", err);
        this.props.addNotification("error", cockpit_default.format(_12("Error checking DN")));
      }
    }
    handleEditConfig() {
      this.cmdOperation("set");
    }
    updateFields() {
      let memberOfGroupAttrObjectList = [];
      let memberOfEntryScopeList = [];
      let getSchemamemberOfExcludeScopeList = [];
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find((row) => row.cn[0] === "MemberOf Plugin");
        this.setState({
          memberOfAttr: pluginRow.memberofattr === void 0 ? "" : pluginRow.memberofattr[0],
          memberOfAutoAddOC: pluginRow.memberofautoaddoc === void 0 ? "" : pluginRow.memberofautoaddoc[0],
          memberOfAllBackends: !(pluginRow.memberofallbackends === void 0 || pluginRow.memberofallbackends[0] === "off"),
          memberOfSkipNested: !(pluginRow.memberofskipnested === void 0 || pluginRow.memberofskipnested[0] === "off"),
          memberOfConfigEntry: pluginRow["nsslapd-pluginConfigArea"] === void 0 ? "" : pluginRow["nsslapd-pluginConfigArea"][0],
          memberOfSpecificGroup: pluginRow.memberofspecificgroupfilter === void 0 ? [] : pluginRow.memberofspecificgroupfilter,
          memberOfExcludeSpecificGroup: pluginRow.memberofexcludespecificgroupfilter === void 0 ? [] : pluginRow.memberofexcludespecificgroupfilter,
          memberOfSpecificGroupOC: pluginRow.memberofspecificgroupoc === void 0 ? [] : pluginRow.memberofspecificgroupoc,
          _memberOfAttr: pluginRow.memberofattr === void 0 ? "" : pluginRow.memberofattr[0],
          _memberOfAutoAddOC: pluginRow.memberofautoaddoc === void 0 ? "" : pluginRow.memberofautoaddoc[0],
          _memberOfAllBackends: !(pluginRow.memberofallbackends === void 0 || pluginRow.memberofallbackends[0] === "off"),
          _memberOfSkipNested: !(pluginRow.memberofskipnested === void 0 || pluginRow.memberofskipnested[0] === "off"),
          _memberOfConfigEntry: pluginRow["nsslapd-pluginConfigArea"] === void 0 ? "" : pluginRow["nsslapd-pluginConfigArea"][0],
          _memberOfSpecificGroup: pluginRow.memberofspecificgroup === void 0 ? [] : [...pluginRow.memberofspecificgroup],
          _memberOfExcludeSpecificGroup: pluginRow.memberofexcludespecificgroup === void 0 ? [] : [...pluginRow.memberofexcludespecificgroup],
          _memberOfSpecificGroupOC: pluginRow.memberofspecificgroupoc === void 0 ? [] : [...pluginRow.memberofspecificgroupoc],
          _memberOfSpecificGroupOpen: false,
          _memberOfExcludeSpecificGroupOpen: false,
          _memberOfSpecificGroupOCOpen: false
        });
        if (pluginRow.memberofgroupattr === void 0) {
          this.setState({ memberOfGroupAttr: [], _memberOfGroupAttr: [] });
        } else {
          for (const value of pluginRow.memberofgroupattr) {
            memberOfGroupAttrObjectList = [...memberOfGroupAttrObjectList, value];
          }
          this.setState({
            memberOfGroupAttr: memberOfGroupAttrObjectList,
            _memberOfGroupAttr: [...memberOfGroupAttrObjectList]
          });
        }
        if (pluginRow.memberofentryscope === void 0) {
          this.setState({ memberOfEntryScope: [], _memberOfEntryScope: [] });
        } else {
          for (const value of pluginRow.memberofentryscope) {
            memberOfEntryScopeList = [...memberOfEntryScopeList, value];
          }
          this.setState({
            memberOfEntryScope: memberOfEntryScopeList,
            _memberOfEntryScope: [...memberOfEntryScopeList]
          });
        }
        if (pluginRow.memberofentryscopeexcludesubtree === void 0) {
          this.setState({ memberOfEntryScopeExcludeSubtree: [], _memberOfEntryScopeExcludeSubtree: [] });
        } else {
          for (const value of pluginRow.memberofentryscopeexcludesubtree) {
            getSchemamemberOfExcludeScopeList = [...getSchemamemberOfExcludeScopeList, value];
          }
          this.setState({
            memberOfEntryScopeExcludeSubtree: getSchemamemberOfExcludeScopeList,
            _memberOfEntryScopeExcludeSubtree: [...getSchemamemberOfExcludeScopeList]
          });
        }
      }
      this.setState({
        firstLoad: false
      });
    }
    handleSaveConfig() {
      const {
        memberOfAttr,
        memberOfGroupAttr,
        memberOfEntryScope,
        memberOfEntryScopeExcludeSubtree,
        memberOfAutoAddOC,
        memberOfAllBackends,
        memberOfSkipNested,
        memberOfConfigEntry,
        memberOfSpecificGroup,
        memberOfExcludeSpecificGroup,
        memberOfSpecificGroupOC
      } = this.state;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "memberof",
        "set",
        "--attr",
        memberOfAttr || "delete",
        "--config-entry",
        memberOfConfigEntry || "delete",
        "--allbackends",
        memberOfAllBackends ? "on" : "off",
        "--skipnested",
        memberOfSkipNested ? "on" : "off",
        "--autoaddoc",
        memberOfAutoAddOC || "delete"
      ];
      cmd = [...cmd, "--scope"];
      if (memberOfEntryScope.length !== 0) {
        for (const value of memberOfEntryScope) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--exclude"];
      if (memberOfEntryScopeExcludeSubtree.length !== 0) {
        for (const value of memberOfEntryScopeExcludeSubtree) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--specific-group-filter"];
      if (memberOfSpecificGroup.length !== 0) {
        for (const value of memberOfSpecificGroup) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--exclude-specific-group-filter"];
      if (memberOfExcludeSpecificGroup.length !== 0) {
        for (const value of memberOfExcludeSpecificGroup) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--specific-group-oc"];
      if (memberOfSpecificGroupOC.length !== 0) {
        for (const value of memberOfSpecificGroupOC) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--groupattr"];
      if (memberOfGroupAttr.length !== 0) {
        for (const value of memberOfGroupAttr) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      this.setState({
        saving: true
      });
      log_cmd("handleSaveConfig", `Save MemberOf Plugin`, cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        this.props.addNotification(
          "success",
          _12("Successfully updated MemberOf Plugin")
        );
        this.setState({
          saving: false,
          saveBtnDisabled: true
        });
        this.props.pluginListHandler();
      }).fail((err) => {
        let errMsg = getApiErrorMessage(err);
        if ("info" in errMsg) {
          errMsg = errMsg + " " + errMsg.info;
        } else {
          errMsg = errMsg;
        }
        this.props.addNotification(
          "error",
          cockpit_default.format(_12("Error during update - $0"), errMsg)
        );
        this.setState({
          saving: false
        });
        this.props.pluginListHandler();
      });
    }
    openSpecificGroupAddModal() {
      this.setState({
        isSpecificGroupModalOpen: true,
        groupFilter: "",
        groupFilterType: "include"
      });
    }
    openSpecificExcludeGroupAddModal() {
      this.setState({
        isSpecificGroupModalOpen: true,
        groupFilter: "",
        groupFilterType: "exclude"
      });
    }
    closeSpecificGroupAddModal() {
      this.setState({
        isSpecificGroupModalOpen: false,
        groupFilter: "",
        groupFilterType: "include"
      });
    }
    openDeleteFilterConfirmation(filter) {
      this.setState({
        showDeleteFilterConfirmation: true,
        groupFilterType: "include",
        groupFilter: filter,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeDeleteFilterConfirmation() {
      this.setState({
        showDeleteFilterConfirmation: false,
        groupFilterType: "",
        groupFilter: ""
      });
    }
    openDeleteExcludeFilterConfirmation(filter) {
      this.setState({
        showDeleteExcludeFilterConfirmation: true,
        groupFilterType: "exclude",
        groupFilter: filter,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeDeleteExcludeFilterConfirmation() {
      this.setState({
        showDeleteExcludeFilterConfirmation: false,
        groupFilterType: "",
        groupFilter: ""
      });
    }
    handleAddDelSpecificGroupFilter(op, filter) {
      this.setState({
        modalSpinning: true
      });
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "memberof"
      ];
      if (this.state.configEntryModalShow) {
        cmd = [...cmd, "config-entry"];
        cmd = [...cmd, op === "add" ? "add-attr" : "del-attr", this.state.configDN];
      } else {
        cmd = [...cmd, op === "add" ? "add-attr" : "del-attr"];
      }
      cmd = [...cmd, this.state.groupFilterType === "include" ? "--specific-group-filter" : "--exclude-specific-group-filter", filter];
      log_cmd("handleAddDelSpecificGroupFilter", op, cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        this.props.pluginListHandler();
        this.props.addNotification(
          "success",
          _12("Successfully updated MemberOf Plugin")
        );
        this.setState({
          modalSpinning: false,
          showDeleteFilterConfirmation: false,
          showDeleteExcludeFilterConfirmation: false,
          isSpecificGroupModalOpen: false,
          isExcludeSpecificGroupModalOpen: false
        });
        if (this.state.configEntryModalShow) {
          this.handleOpenModal();
        }
      }).fail((err) => {
        let errMsg = getApiErrorMessage(err);
        if ("info" in errMsg) {
          errMsg = errMsg + " " + errMsg.info;
        } else {
          errMsg = errMsg;
        }
        this.props.addNotification(
          "error",
          cockpit_default.format(_12("Error during update - $0"), errMsg)
        );
        this.setState({
          modalSpinning: false,
          showDeleteFilterConfirmation: false,
          showDeleteExcludeFilterConfirmation: false,
          isSpecificGroupModalOpen: false,
          isExcludeSpecificGroupModalOpen: false
        });
        this.props.pluginListHandler();
        if (this.state.configEntryModalShow) {
          this.handleOpenModal();
        }
      });
    }
    handleExcludeSpecificGroupAdd() {
      this.setState({
        memberOfExcludeSpecificGroup: [...this.state.memberOfExcludeSpecificGroup, ""],
        isExcludeSpecificGroupOpen: true
      });
    }
    handleExcludeSpecificGroupDelete(index) {
      this.setState({
        memberOfExcludeSpecificGroup: this.state.memberOfExcludeSpecificGroup.filter((_113, i) => i !== index)
      });
    }
    render() {
      const {
        memberOfAttr,
        memberOfGroupAttr,
        memberOfEntryScope,
        memberOfEntryScopeExcludeSubtree,
        memberOfAutoAddOC,
        memberOfAllBackends,
        memberOfSkipNested,
        memberOfConfigEntry,
        memberOfSpecificGroup,
        memberOfExcludeSpecificGroup,
        memberOfSpecificGroupOC,
        isSpecificGroupOCOpen,
        fixupModalShow,
        fixupDN,
        fixupFilter,
        error,
        saving,
        saveBtnDisabled,
        isSubtreeScopeOpen,
        isExcludeScopeOpen,
        // Filter modal
        isSpecificGroupModalOpen,
        groupFilter,
        groupFilterType
      } = this.state;
      const configModalHandlers = {
        handleEditConfig: this.handleEditConfig,
        handleAddConfig: this.handleAddConfig,
        handleCloseModal: this.handleCloseModal,
        handleNavSelectModal: this.handleNavSelectModal,
        handleModalChange: this.handleModalChange,
        handleFieldChange: this.handleFieldChange,
        handleConfigAttrSelect: this.handleConfigAttrSelect,
        handleConfigAttrClear: this.handleConfigAttrClear,
        handleConfigGroupAttrSelect: this.handleConfigGroupAttrSelect,
        handleConfigGroupAttrClear: this.handleConfigGroupAttrClear,
        handleConfigScopeSelect: this.handleConfigScopeSelect,
        handleConfigScopeClear: this.handleConfigScopeClear,
        handleConfigCreateOption: this.handleConfigCreateOption,
        handleConfigSpecificGroupSelect: this.handleConfigSpecificGroupSelect,
        handleConfigSpecificGroupClear: this.handleConfigSpecificGroupClear,
        handleConfigSpecificGroupCreateOption: this.handleConfigSpecificGroupCreateOption,
        handleConfigExcludeSpecificGroupSelect: this.handleConfigExcludeSpecificGroupSelect,
        handleConfigExcludeSpecificGroupClear: this.handleConfigExcludeSpecificGroupClear,
        handleConfigExcludeSpecificGroupCreateOption: this.handleConfigExcludeSpecificGroupCreateOption,
        handleConfigSpecificGroupOCToggle: this.handleConfigSpecificGroupOCToggle,
        handleConfigScopeToggle: this.handleConfigScopeToggle,
        handleConfigExcludeScopeToggle: this.handleConfigExcludeScopeToggle,
        handleConfigSpecificGroupOCSelect: this.handleConfigSpecificGroupOCSelect,
        handleConfigSpecificGroupOCClear: this.handleConfigSpecificGroupOCClear,
        handleConfigExcludeScopeSelect: this.handleConfigExcludeScopeSelect,
        handleConfigExcludeScopeClear: this.handleConfigExcludeScopeClear,
        handleConfigExcludeCreateOption: this.handleConfigExcludeCreateOption,
        handleConfigSpecificGroupToggle: this.handleConfigSpecificGroupToggle,
        openSpecificGroupAddModal: this.openSpecificGroupAddModal,
        openSpecificExcludeGroupAddModal: this.openSpecificExcludeGroupAddModal,
        openDeleteFilterConfirmation: this.openDeleteFilterConfirmation,
        openDeleteExcludeFilterConfirmation: this.openDeleteExcludeFilterConfirmation,
        validateModalFilterCreate: this.validateModalFilterCreate
      };
      const configModalOpeners = {
        isConfigSubtreeScopeOpen: this.state.isConfigSubtreeScopeOpen,
        isConfigExcludeScopeOpen: this.state.isConfigExcludeScopeOpen,
        isConfigSpecificGroupOpen: this.state.isConfigSpecificGroupOpen,
        isConfigExcludeSpecificGroupOpen: this.state.isConfigExcludeSpecificGroupOpen,
        isConfigSpecificGroupOCOpen: this.state.isConfigSpecificGroupOCOpen
      };
      const configModalSettings = {
        configDN: this.state.configDN,
        configAttr: this.state.configAttr,
        configGroupAttr: this.state.configGroupAttr,
        configEntryScope: this.state.configEntryScope,
        configEntryScopeExcludeSubtreeScope: this.state.configEntryScopeExcludeSubtreeScope,
        configAutoAddOC: this.state.configAutoAddOC,
        configAllBackends: this.state.configAllBackends,
        configSkipNested: this.state.configSkipNested,
        configSpecificGroupOC: this.state.configSpecificGroupOC,
        configExcludeSpecificGroup: this.state.configExcludeSpecificGroup,
        configSpecificGroup: this.state.configSpecificGroup,
        configEntryScopeOptions: this.state.configEntryScopeOptions,
        configEntryScopeExcludeOptions: this.state.configEntryScopeExcludeOptions,
        configSpecificGroupOptions: this.state.configSpecificGroupOptions,
        configExcludeSpecificGroupOptions: this.state.configExcludeSpecificGroupOptions
      };
      let saveBtnName = _12("Save Config");
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = _12("Saving Config ...");
        extraPrimaryProps.spinnerAriaValueText = _12("Saving");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
          MemberOfFixupTaskModal,
          {
            fixupModalShow,
            handleToggleFixupModal: this.handleToggleFixupModal,
            handleRunFixup: this.handleRunFixup,
            fixupDN,
            fixupFilter,
            handleFieldChange: this.handleFieldChange
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
          pluginBasicConfig_default,
          {
            rows: this.props.rows,
            serverId: this.props.serverId,
            cn: "MemberOf Plugin",
            pluginName: "MemberOf",
            cmdName: "memberof",
            pluginListHandler: this.props.pluginListHandler,
            addNotification: this.props.addNotification,
            toggleLoadingHandler: this.props.toggleLoadingHandler,
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Tabs, { isFilled: true, className: "ds-margin-top-lgZZZ", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
                /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TabTitleText, { children: _12("Plugin Settings") }), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Form, { isHorizontal: true, autoComplete: "off", className: "ds-margin-top-xlg", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Grid, { title: _12("Specifies the attribute in the user entry for the Directory Server to manage to reflect group membership (memberOfAttr)"), children: [
                    /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GridItem, { className: "ds-label", span: 3, children: _12("Membership Attribute") }),
                    /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
                      dsBasicComponents_default,
                      {
                        selected: memberOfAttr,
                        onSelect: this.handleMemberOfAttrSelect,
                        onClear: this.handleMemberOfAttrClear,
                        options: ["memberOf"],
                        placeholder: _12("Type a member attribute..."),
                        noResultsText: _12("There are no matching entries"),
                        validated: error.memberOfAttr ? "error" : "default",
                        ariaLabel: "Type a member attribute"
                      }
                    ) })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Grid, { className: "ds-margin-top", title: _12("Specifies the attribute in the group entry to use to identify the DNs of group members (memberOfGroupAttr)"), children: [
                    /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GridItem, { className: "ds-label", span: 3, children: _12("Group Attribute") }),
                    /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
                      dsBasicComponents_default,
                      {
                        isMulti: true,
                        hasCheckbox: true,
                        selected: memberOfGroupAttr,
                        onSelect: this.handleMemberOfGroupAttrSelect,
                        onClear: this.handleMemberOfGroupAttrClear,
                        options: ["member", "memberCertificate", "uniqueMember"],
                        placeholder: _12("Type a member group attribute..."),
                        noResultsText: _12("There are no matching entries"),
                        validated: error.memberOfGroupAttr ? "error" : "default",
                        ariaLabel: "Type a member group attribute"
                      }
                    ) })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Grid, { title: _12("If an entry does not have an object class that allows the memberOf attribute then the memberOf plugin will automatically add the object class listed in the memberOfAutoAddOC parameter"), children: [
                    /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GridItem, { className: "ds-label", span: 3, children: _12("Auto Add OC") }),
                    /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
                      FormSelect,
                      {
                        id: "memberOfAutoAddOC",
                        value: memberOfAutoAddOC,
                        onChange: (event, value) => {
                          this.handleFieldChange(event);
                        },
                        "aria-label": "FormSelect Input",
                        children: [
                          /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FormSelectOption, { value: "", label: "-" }, "no_setting"),
                          this.props.objectClasses.map((attr) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FormSelectOption, { value: attr.toLowerCase(), label: attr }, attr))
                        ]
                      }
                    ) })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Grid, { title: _12("Specifies whether to skip nested groups or not (memberOfSkipNested)"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GridItem, { className: "ds-left-margin", span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
                    Checkbox,
                    {
                      id: "memberOfSkipNested",
                      isChecked: memberOfSkipNested,
                      onChange: (e, checked) => {
                        this.handleFieldChange(e);
                      },
                      title: _12("Specifies wherher to skip nested groups or not (memberOfSkipNested)"),
                      label: _12("Skip Nested Groups")
                    }
                  ) }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Grid, { title: _12("Specifies whether to search the local suffix for user entries on all available suffixes (memberOfAllBackends)"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GridItem, { className: "ds-left-margin", span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
                    Checkbox,
                    {
                      id: "memberOfAllBackends",
                      isChecked: memberOfAllBackends,
                      onChange: (e, checked) => {
                        this.handleFieldChange(e);
                      },
                      label: _12("All Backends")
                    }
                  ) }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Grid, { title: _12("The value to set as nsslapd-pluginConfigArea"), children: [
                    /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GridItem, { className: "ds-label", span: 3, children: _12("Shared Config Entry") }),
                    /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(GridItem, { className: "ds-right-margin", span: 9, children: [
                      memberOfConfigEntry !== "" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
                        TextInput,
                        {
                          value: memberOfConfigEntry,
                          type: "text",
                          id: "memberOfConfigEntry",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "memberOfConfigEntry",
                          readOnlyVariant: "plain"
                        }
                      ),
                      memberOfConfigEntry === "" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
                        Button,
                        {
                          variant: "primary",
                          onClick: this.handleOpenModal,
                          children: _12("Create Config")
                        }
                      )
                    ] })
                  ] }),
                  memberOfConfigEntry !== "" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GridItem, { offset: 3, span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
                    Button,
                    {
                      variant: "primary",
                      onClick: this.handleOpenModal,
                      children: memberOfConfigEntry === "" ? _12("Create Config") : _12("Manage Config")
                    }
                  ) }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Grid, { title: _12("The fixup task will add the memberOf attribute to entries that are missing it.  This is typically only run once after enabling or changing the plugin."), children: [
                    /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(GridItem, { className: "ds-label ds-margin-top", span: 3, children: [
                      _12("MemberOf Fixup Task"),
                      /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(WrenchIcon, { className: "ds-left-margin" })
                    ] }),
                    /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Button, { className: "ds-margin-top", variant: "secondary", onClick: this.handleToggleFixupModal, children: _12("Run Task") }) })
                  ] })
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TabTitleText, { children: _12("Subtree Scope") }), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Form, { isHorizontal: true, autoComplete: "off", className: "ds-margin-top-xlg", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Grid, { className: "ds-margin-top", title: _12("Specifies backends or multiple-nested suffixes for the MemberOf plug-in to work on (memberOfEntryScope)"), children: [
                    /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GridItem, { className: "ds-label", span: 3, children: _12("Subtree Scope") }),
                    /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(GridItem, { span: 9, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
                        dsBasicComponents_default,
                        {
                          isMulti: true,
                          selected: memberOfEntryScope,
                          onSelect: this.handleSubtreeScopeSelect,
                          onClear: this.handleSubtreeScopeClear,
                          options: this.state.memberOfEntryScopeOptions,
                          isCreatable: true,
                          onCreateOption: this.handleSubtreeScopeCreateOption,
                          validateCreate: (value) => valid_dn(value),
                          placeholder: _12("Type a subtree DN..."),
                          noResultsText: _12("There are no matching entries"),
                          validated: error.memberOfEntryScope ? "error" : "default",
                          onToggle: this.handleSubtreeScopeToggle,
                          isOpen: isSubtreeScopeOpen,
                          ariaLabel: "Type a subtree DN"
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FormHelperText, { children: "Values must be valid DN's" })
                    ] })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Grid, { title: _12("Specifies backends or multiple-nested suffixes for the MemberOf plug-in to exclude (memberOfEntryScopeExcludeSubtree)"), children: [
                    /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GridItem, { className: "ds-label", span: 3, children: _12("Exclude Subtree") }),
                    /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(GridItem, { span: 9, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
                        dsBasicComponents_default,
                        {
                          isMulti: true,
                          selected: memberOfEntryScopeExcludeSubtree,
                          onSelect: this.handleExcludeScopeSelect,
                          onClear: this.handleExcludeScopeClear,
                          options: this.state.memberOfEntryScopeExcludeOptions,
                          isCreatable: true,
                          onCreateOption: this.handleExcludeCreateOption,
                          validateCreate: (value) => valid_dn(value),
                          placeholder: _12("Type a subtree DN..."),
                          noResultsText: _12("There are no matching entries"),
                          validated: error.memberOfEntryScopeExcludeSubtree ? "error" : "default",
                          onToggle: this.handleExcludeScopeToggle,
                          isOpen: isExcludeScopeOpen,
                          ariaLabel: "Type a subtree DN"
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FormHelperText, { children: _12("Values must be valid DN's") })
                    ] })
                  ] })
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TabTitleText, { children: _12("Specific Group Scope") }), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
                    MemberOfTable,
                    {
                      title: "Specific Group Filters",
                      rows: memberOfSpecificGroup,
                      deleteAttr: this.openDeleteFilterConfirmation
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
                    Button,
                    {
                      id: "specific-group-filter",
                      className: "ds-margin-top",
                      variant: "secondary",
                      onClick: this.openSpecificGroupAddModal,
                      children: "Add filter"
                    },
                    "specific-group-filter"
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
                    MemberOfTable,
                    {
                      title: "Specific Group Exclude Filters",
                      rows: memberOfExcludeSpecificGroup,
                      deleteAttr: this.openDeleteExcludeFilterConfirmation
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
                    Button,
                    {
                      id: "specific-group-exclude-filter",
                      className: "ds-margin-top",
                      variant: "secondary",
                      onClick: this.openSpecificExcludeGroupAddModal,
                      children: "Add exclude filter"
                    },
                    "specific-group-exclude-filter"
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Form, { isHorizontal: true, autoComplete: "off", className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Grid, { title: _12("Specifies the objectclasses for the specific groups to include/exclude (memberOfSpecificGroupOC)"), children: [
                    /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GridItem, { className: "ds-label", span: 3, children: "Specific Group OC" }),
                    /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
                      dsBasicComponents_default,
                      {
                        isMulti: true,
                        selected: memberOfSpecificGroupOC,
                        onSelect: this.handleSpecificGroupOCSelect,
                        onClear: this.handleSpecificGroupOCClear,
                        options: this.props.objectClasses,
                        placeholder: _12("Type a objectclass..."),
                        noResultsText: "There are no matching objectclasses",
                        ariaLabel: "Type a objectclass",
                        onToggle: this.handleSpecificGroupOCToggle,
                        isOpen: isSpecificGroupOCOpen
                      }
                    ) })
                  ] }) })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
                Button,
                {
                  className: "ds-margin-top-lg",
                  isLoading: saving,
                  spinnerAriaValueText: saving ? _12("Loading") : void 0,
                  variant: "primary",
                  onClick: this.handleSaveConfig,
                  ...extraPrimaryProps,
                  isDisabled: saveBtnDisabled || saving,
                  children: saveBtnName
                },
                "at"
              )
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
          MemberOfConfigEntryModal,
          {
            handlers: configModalHandlers,
            openers: configModalOpeners,
            settings: configModalSettings,
            activeTabModalKey: this.state.activeTabModalKey,
            objectClasses: this.props.objectClasses,
            newEntry: this.state.newEntry,
            errorModal: this.state.errorModal,
            configEntryModalShow: this.state.configEntryModalShow,
            saveBtnDisabledModal: this.state.saveBtnDisabledModal,
            savingModal: this.state.savingModal,
            extraPrimaryProps: this.state.extraPrimaryProps,
            validateModalFilterCreate: this.validateModalFilterCreate
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
          MemberOfSpecificGroupFilterModal,
          {
            isSpecificGroupModalOpen,
            closeSpecificGroupAddModal: this.closeSpecificGroupAddModal,
            handleAddDelSpecificGroupFilter: this.handleAddDelSpecificGroupFilter,
            groupFilter,
            groupFilterType,
            handleFieldChange: this.handleFieldChange,
            modalSpinning: this.state.modalSpinning,
            validFilterChange: this.validFilterChange
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDelete,
            closeHandler: this.closeConfirmDelete,
            handleChange: this.onChange,
            actionHandler: this.deleteConfig,
            spinning: this.state.modalSpinning,
            item: this.state.configDN,
            checked: this.state.modalChecked,
            mTitle: _12("Delete MemberOf Config Entry"),
            mMsg: _12("Are you sure you want to delete this config entry?"),
            mSpinningMsg: _12("Deleting ..."),
            mBtnName: _12("Delete")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showDeleteFilterConfirmation,
            closeHandler: this.closeDeleteFilterConfirmation,
            handleChange: this.onChange,
            actionHandler: () => this.handleAddDelSpecificGroupFilter("delete", this.state.groupFilter),
            spinning: this.state.modalSpinning,
            item: this.state.groupFilter,
            checked: this.state.modalChecked,
            mTitle: _12("Delete Specific Group Filter"),
            mMsg: _12("Are you sure you want to delete this filter?"),
            mSpinningMsg: _12("Deleting ..."),
            mBtnName: _12("Delete")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showDeleteExcludeFilterConfirmation,
            closeHandler: this.closeDeleteExcludeFilterConfirmation,
            handleChange: this.onChange,
            actionHandler: () => this.handleAddDelSpecificGroupFilter("delete", this.state.groupFilter),
            spinning: this.state.modalSpinning,
            item: this.state.groupFilter,
            checked: this.state.modalChecked,
            mTitle: _12("Delete Exclude Specific Group Filter"),
            mMsg: _12("Are you sure you want to delete this filter?"),
            mSpinningMsg: _12("Deleting ..."),
            mBtnName: _12("Delete")
          }
        )
      ] });
    }
  };
  MemberOf.propTypes = {
    rows: import_prop_types13.default.array,
    serverId: import_prop_types13.default.string,
    pluginListHandler: import_prop_types13.default.func,
    addNotification: import_prop_types13.default.func,
    objectClasses: import_prop_types13.default.array,
    toggleLoadingHandler: import_prop_types13.default.func
  };
  MemberOf.defaultProps = {
    rows: [],
    serverId: "",
    objectClasses: []
  };
  var memberOf_default = MemberOf;

  // src/lib/plugins/passthroughAuthentication.jsx
  var import_react29 = __toESM(require_react(), 1);
  var import_prop_types14 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
  var _13 = cockpit_default.gettext;
  var PassthroughAuthentication = class extends import_react29.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        urlRows: [],
        tableKey: 1,
        error: {},
        modalSpinning: false,
        modalChecked: false,
        oldURL: "",
        urlConnType: "ldaps",
        urlAuthDS: "",
        urlSubtree: "",
        urlMaxConns: 3,
        urlMaxOps: 5,
        urlTimeout: 300,
        urlLDVer: "3",
        urlConnLifeTime: 300,
        urlStartTLS: false,
        _urlConnType: "ldaps",
        _urlAuthDS: "",
        _urlSubtree: "",
        _urlMaxConns: 3,
        _urlMaxOps: 5,
        _urlTimeout: 300,
        _urlLDVer: "3",
        _urlConnLifeTime: 300,
        _urlStartTLS: false,
        showConfirmDeleteURL: false,
        saveBtnDisabledPassthru: true,
        savingPassthru: false,
        newURLEntry: false,
        urlEntryModalShow: false
      };
      this.maxValue = 2e7;
      this.onMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validatePassthru();
        });
      };
      this.onConfigChange = (event, id, min3) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
        }, () => {
          this.validatePassthru();
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validatePassthru();
        });
      };
      this.attrRows = this.props.attributes.map((attr) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormSelectOption, { value: attr, label: attr }, attr));
      this.handlePassthruChange = this.handlePassthruChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.validatePassthru = this.validatePassthru.bind(this);
      this.loadURLs = this.loadURLs.bind(this);
      this.openURLModal = this.openURLModal.bind(this);
      this.handleCloseURLModal = this.handleCloseURLModal.bind(this);
      this.showEditURLModal = this.showEditURLModal.bind(this);
      this.handleShowAddURLModal = this.handleShowAddURLModal.bind(this);
      this.cmdURLOperation = this.cmdURLOperation.bind(this);
      this.deleteURL = this.deleteURL.bind(this);
      this.addURL = this.addURL.bind(this);
      this.editURL = this.editURL.bind(this);
      this.showConfirmDeleteURL = this.showConfirmDeleteURL.bind(this);
      this.closeConfirmDeleteURL = this.closeConfirmDeleteURL.bind(this);
    }
    componentDidMount() {
      this.loadURLs();
    }
    validatePassthru() {
      const errObj = {};
      let all_good = true;
      const reqAttrs = ["urlAuthDS", "urlSubtree"];
      const dnAttrs = ["urlSubtree"];
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          errObj[attr] = true;
          all_good = false;
          break;
        }
      }
      for (const attr of dnAttrs) {
        if (!valid_dn(this.state[attr])) {
          errObj[attr] = true;
          all_good = false;
          break;
        }
      }
      if (all_good) {
        all_good = false;
        const configAttrs2 = [
          "urlSubtree",
          "urlConnType",
          "urlAuthDS",
          "urlMaxConns",
          "urlMaxOps",
          "urlTimeout",
          "urlLDVer",
          "urlConnLifeTime",
          "urlStartTLS"
        ];
        for (const check_attr of configAttrs2) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabledPassthru: !all_good,
        error: errObj
      });
    }
    handlePassthruChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validatePassthru();
      });
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    showConfirmDeleteConfig(name2) {
      this.setState({
        showConfirmDeleteConfig: true,
        modalChecked: false,
        modalSpinning: false,
        deleteName: name2
      });
    }
    closeConfirmDeleteConfig() {
      this.setState({
        showConfirmDeleteConfig: false,
        modalChecked: false,
        modalSpinning: false,
        deleteName: ""
      });
    }
    showConfirmDeleteURL(name2) {
      this.setState({
        showConfirmDeleteURL: true,
        modalChecked: false,
        modalSpinning: false,
        deleteName: name2
      });
    }
    closeConfirmDeleteURL() {
      this.setState({
        showConfirmDeleteURL: false,
        modalChecked: false,
        modalSpinning: false,
        deleteName: ""
      });
    }
    loadURLs() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "ldap-pass-through-auth",
        "list"
      ];
      this.props.toggleLoadingHandler();
      log_cmd("loadURLs", "Get Passthrough Authentication Plugin Configs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const tableKey = this.state.tableKey + 1;
        this.setState({
          urlRows: myObject.items,
          tableKey
        });
        this.props.toggleLoadingHandler();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        if (err !== 0) {
          console.log("loadURLs failed", errMsg);
        }
        this.props.toggleLoadingHandler();
      });
    }
    showEditURLModal(rowData) {
      this.openURLModal(rowData);
    }
    handleShowAddURLModal() {
      this.openURLModal();
    }
    openURLModal(url) {
      if (!url) {
        this.setState({
          urlEntryModalShow: true,
          newURLEntry: true,
          oldURL: "",
          urlConnType: "ldap",
          urlAuthDS: "",
          urlSubtree: "",
          urlMaxConns: "3",
          urlMaxOps: "5",
          urlTimeout: "300",
          urlLDVer: "3",
          urlConnLifeTime: "300",
          urlStartTLS: false,
          saveBtnDisabledPassthru: true
        });
      } else {
        const link2 = url.split(" ")[0];
        const params = url.split(" ")[1];
        this.setState({
          urlEntryModalShow: true,
          oldURL: url,
          newURLEntry: false,
          urlConnType: link2.split(":")[0],
          urlAuthDS: link2.split("/")[2],
          urlSubtree: link2.split("/")[3],
          urlMaxConns: params.split(",")[0],
          urlMaxOps: params.split(",")[1],
          urlTimeout: params.split(",")[2],
          urlLDVer: params.split(",")[3],
          urlConnLifeTime: params.split(",")[4],
          urlStartTLS: !(params.split(",")[5] === "0"),
          saveBtnDisabledPassthru: true
        });
      }
    }
    handleCloseURLModal() {
      this.setState({
        urlEntryModalShow: false,
        savingPassthru: false
      });
    }
    deleteURL() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "ldap-pass-through-auth",
        "delete",
        this.state.deleteName
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteURL", "Delete the Passthrough Authentication Plugin URL entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteURL", "Result", content);
        this.props.addNotification("success", cockpit_default.format(_13("URL $0 was successfully deleted"), this.state.deleteName));
        this.loadURLs();
        this.closeConfirmDeleteURL();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_13("Error during the URL removal operation - $0"), errMsg)
        );
        this.loadURLs();
        this.closeConfirmDeleteURL();
      });
    }
    addURL() {
      this.cmdURLOperation("add");
    }
    editURL() {
      this.cmdURLOperation("modify");
    }
    cmdURLOperation(action) {
      const {
        oldURL,
        urlConnType,
        urlAuthDS,
        urlSubtree,
        urlMaxConns,
        urlMaxOps,
        urlTimeout,
        urlLDVer,
        urlConnLifeTime,
        urlStartTLS
      } = this.state;
      const constructedURL = `${urlConnType}://${urlAuthDS}/${urlSubtree} ${urlMaxConns},${urlMaxOps},${urlTimeout},${urlLDVer},${urlConnLifeTime},${urlStartTLS ? "1" : "0"}`;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "ldap-pass-through-auth",
        action
      ];
      if (oldURL !== "" && action === "modify") {
        cmd = [...cmd, oldURL, constructedURL];
      } else {
        cmd = [...cmd, constructedURL];
      }
      this.setState({
        savingPassthru: true
      });
      log_cmd(
        "PassthroughAuthOperation",
        `Do the ${action} operation on the Passthrough Authentication Plugin`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("PassthroughAuthOperation", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_13('The $0 operation was successfully done on "$1" entry'), action, constructedURL)
        );
        this.loadURLs();
        this.handleCloseURLModal();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_13("Error during the URL $0 operation - $1"), action, errMsg)
        );
        this.loadURLs();
        this.handleCloseURLModal();
      });
    }
    render() {
      const {
        urlRows,
        urlConnType,
        urlLDVer,
        urlAuthDS,
        urlSubtree,
        urlMaxConns,
        urlMaxOps,
        urlTimeout,
        urlConnLifeTime,
        urlStartTLS,
        newURLEntry,
        urlEntryModalShow,
        error,
        savingPassthru
      } = this.state;
      const modalURLFields = {
        urlAuthDS: {
          name: _13("Authentication Hostname"),
          id: "urlAuthDS",
          value: urlAuthDS,
          help: _13("The authenticating directory host name. The port number of the Directory Server can be given by adding a colon and then the port number. For example, dirserver.example.com:389. If the port number is not specified, the PTA server attempts to connect using either of the standard ports: Port 389 if ldap:// is specified in the URL. Port 636 if ldaps:// is specified in the URL.")
        },
        urlSubtree: {
          name: _13("Subtree"),
          id: "urlSubtree",
          value: urlSubtree,
          help: _13("The pass-through subtree. The PTA Directory Server passes through bind requests to the authenticating Directory Server from all clients whose DN is in this subtree.")
        }
      };
      const modalURLNumberFields = {
        urlMaxConns: {
          name: _13("Maximum Number of Connections"),
          value: urlMaxConns,
          id: "urlMaxConns",
          help: _13("The maximum number of connections the PTA directory can simultaneously open to the authenticating directory.")
        },
        urlMaxOps: {
          name: _13("Maximum Number of Simultaneous Operations"),
          value: urlMaxOps,
          id: "urlMaxOps",
          help: _13("The maximum number of simultaneous operations (usually bind requests) the PTA directory can send to the authenticating directory within a single connection.")
        },
        urlTimeout: {
          name: _13("Timeout"),
          value: urlTimeout,
          id: "urlTimeout",
          help: _13("The time limit, in seconds, that the PTA directory waits for a response from the authenticating Directory Server. If this timeout is exceeded, the server returns an error to the client. The default is 300 seconds (five minutes). Specify zero (0) to indicate no time limit should be enforced.")
        },
        urlConnLifeTime: {
          name: _13("Connection Life Time"),
          value: urlConnLifeTime,
          id: "urlConnLifeTime",
          help: _13("The time limit, in seconds, within which a connection may be used.")
        }
      };
      let saveBtnName = _13("Save Config");
      const extraPrimaryProps = {};
      if (this.state.savingPassthru) {
        saveBtnName = _13("Saving Config ...");
        extraPrimaryProps.spinnerAriaValueText = _13("Saving");
      }
      const title_url = cockpit_default.format(_13("$0 Pass-Though Authentication URL"), newURLEntry ? _13("Add") : _13("Edit"));
      return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: savingPassthru ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: title_url,
            isOpen: urlEntryModalShow,
            onClose: this.handleCloseURLModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: newURLEntry ? this.addURL : this.editURL,
                  isDisabled: this.state.saveBtnDisabledPassthru || this.state.savingPassthru,
                  isLoading: this.state.savingPassthru,
                  spinnerAriaValueText: this.state.savingPassthru ? _13("Saving") : void 0,
                  ...extraPrimaryProps,
                  children: saveBtnName
                },
                "confirm"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Button, { variant: "link", onClick: this.handleCloseURLModal, children: _13("Cancel") }, "cancel")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
                  GridItem,
                  {
                    className: "ds-label",
                    span: 5,
                    title: _13("Defines whether TLS is used for communication between the two Directory Servers."),
                    children: _13("Connection Type")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
                  FormSelect,
                  {
                    id: "urlConnType",
                    value: urlConnType,
                    onChange: (event, value) => {
                      this.handlePassthruChange(event);
                    },
                    "aria-label": "FormSelect Input",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormSelectOption, { value: "ldaps", label: "ldaps" }, "urlldaps"),
                      /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormSelectOption, { value: "ldap", label: "ldap" }, "urlldap")
                    ]
                  }
                ) })
              ] }),
              Object.entries(modalURLFields).map(([id, content]) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GridItem, { className: "ds-label", span: 5, title: content.help, children: content.name }),
                /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
                  TextInput,
                  {
                    value: content.value,
                    type: "text",
                    id: content.id,
                    "aria-describedby": "horizontal-form-name-helper",
                    name: content.name,
                    onChange: (e, str) => {
                      this.handlePassthruChange(e);
                    },
                    validated: error[content.id] ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ) })
              ] }, id)),
              Object.entries(modalURLNumberFields).map(([id, content]) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GridItem, { className: "ds-label", span: 5, title: content.help, children: content.name }),
                /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
                  NumberInput,
                  {
                    value: content.value,
                    min: -1,
                    max: this.maxValue,
                    onMinus: () => {
                      this.onMinusConfig(content.id);
                    },
                    onChange: (e) => {
                      this.onConfigChange(e, content.id, -1);
                    },
                    onPlus: () => {
                      this.onPlusConfig(content.id);
                    },
                    inputName: "input",
                    inputAriaLabel: "number input",
                    minusBtnAriaLabel: "minus",
                    plusBtnAriaLabel: "plus",
                    widthChars: 8
                  }
                ) })
              ] }, id)),
              /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
                  GridItem,
                  {
                    className: "ds-label",
                    span: 5,
                    title: _13("The version of the LDAP protocol used to connect to the authenticating directory. Directory Server supports LDAP version 2 and 3. The default is version 3, and Red Hat strongly recommends against using LDAPv2, which is old and will be deprecated."),
                    children: _13("Version")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
                  FormSelect,
                  {
                    id: "urlLDVer",
                    value: urlLDVer,
                    onChange: (event, value) => {
                      this.handlePassthruChange(event);
                    },
                    "aria-label": "FormSelect Input",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormSelectOption, { value: "3", label: "LDAPv3" }, "LDAPv3"),
                      /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormSelectOption, { value: "2", label: "LDAPv2" }, "LDAPv2")
                    ]
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GridItem, { className: "ds-label", span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
                Checkbox,
                {
                  id: "urlStartTLS",
                  isChecked: urlStartTLS,
                  onChange: (e, checked) => {
                    this.handlePassthruChange(e);
                  },
                  title: _13("A flag of whether to use Start TLS for the connection to the authenticating directory. Start TLS establishes a secure connection over the standard port, so it is useful for connecting using LDAP instead of LDAPS. The TLS server and CA certificates need to be available on both of the servers. To use Start TLS, the LDAP URL must use ldap:, not ldaps:."),
                  label: _13("Enable StartTLS")
                }
              ) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("hr", {}),
              /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Grid, { title: _13("The URL that will be added or modified after you click 'Save'"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GridItem, { className: "ds-label", span: 5, children: _13("Result URL") }),
                /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("b", { children: [
                  urlConnType,
                  "://",
                  urlAuthDS,
                  "/",
                  urlSubtree,
                  " ",
                  urlMaxConns,
                  ",",
                  urlMaxOps,
                  ",",
                  urlTimeout,
                  ",",
                  urlLDVer,
                  ",",
                  urlConnLifeTime,
                  ",",
                  urlStartTLS ? "1" : "0"
                ] }) })
              ] })
            ] })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
          pluginBasicConfig_default,
          {
            rows: this.props.rows,
            serverId: this.props.serverId,
            cn: "Pass Through Authentication",
            pluginName: "Pass Through Authentication",
            cmdName: "ldap-pass-through-auth",
            savePluginHandler: this.props.savePluginHandler,
            pluginListHandler: this.props.pluginListHandler,
            addNotification: this.props.addNotification,
            toggleLoadingHandler: this.props.toggleLoadingHandler,
            children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ds-indent", children: [
              /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
                PassthroughAuthURLsTable,
                {
                  rows: urlRows,
                  editConfig: this.showEditURLModal,
                  deleteConfig: this.showConfirmDeleteURL
                },
                this.state.tableKey
              ),
              /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleShowAddURLModal,
                  className: "ds-margin-top",
                  children: _13("Add URL")
                }
              )
            ] })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDeleteURL,
            closeHandler: this.closeConfirmDeleteURL,
            handleChange: this.onModalChange,
            actionHandler: this.deleteURL,
            spinning: this.state.modalSpinning,
            item: this.state.deleteName,
            checked: this.state.modalChecked,
            mTitle: _13("Delete Passthru Authentication URL"),
            mMsg: _13("Are you sure you want to delete this URL?"),
            mSpinningMsg: _13("Deleting URL..."),
            mBtnName: _13("Delete URL")
          }
        )
      ] });
    }
  };
  PassthroughAuthentication.propTypes = {
    rows: import_prop_types14.default.array,
    serverId: import_prop_types14.default.string,
    savePluginHandler: import_prop_types14.default.func,
    pluginListHandler: import_prop_types14.default.func,
    addNotification: import_prop_types14.default.func,
    toggleLoadingHandler: import_prop_types14.default.func
  };
  PassthroughAuthentication.defaultProps = {
    rows: [],
    serverId: ""
  };
  var passthroughAuthentication_default = PassthroughAuthentication;

  // src/lib/plugins/pamPassThru.jsx
  var import_react30 = __toESM(require_react(), 1);
  var import_prop_types15 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
  var _14 = cockpit_default.gettext;
  var PAMPassthroughAuthentication = class extends import_react30.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        pamConfigRows: [],
        tableKey: 1,
        error: {},
        modalSpinning: false,
        modalChecked: false,
        pamConfigName: "",
        pamExcludeSuffix: [],
        pamIncludeSuffix: [],
        pamMissingSuffix: "",
        pamFilter: "",
        pamIDAttr: "",
        pamIDMapMethod: "RDN",
        pamFallback: false,
        pamSecure: false,
        pamService: "ldapserver",
        _pamConfigName: "",
        _pamExcludeSuffix: [],
        _pamIncludeSuffix: [],
        _pamMissingSuffix: "",
        _pamFilter: "",
        _pamIDAttr: "",
        _pamIDMapMethod: "RDN",
        _pamFallback: false,
        _pamSecure: false,
        _pamService: "ldapserver",
        isExcludeOpen: false,
        excludeOptions: [],
        isIncludeOpen: false,
        includeOptions: [],
        showConfirmDeleteConfig: false,
        saveBtnDisabledPAM: true,
        savingPAM: false,
        newPAMConfigEntry: false,
        pamConfigEntryModalShow: false
      };
      this.handleExcludeToggle = (_event, isExcludeOpen) => {
        this.setState({
          isExcludeOpen
        });
      };
      this.handleClearExcludeSelection = () => {
        this.setState({
          pamExcludeSuffix: [],
          isExcludeOpen: false
        }, () => {
          this.validatePAM();
        });
      };
      this.handleExcludeSelect = (event, selection) => {
        this.setState({
          pamExcludeSuffix: Array.isArray(selection) ? selection : []
        }, () => {
          this.validatePAM();
        });
      };
      this.handleCreateExcludeOption = (newValue) => {
        if (!this.state.excludeOptions.includes(newValue)) {
          this.setState({
            excludeOptions: [...this.state.excludeOptions, newValue],
            isExcludeOpen: false
          }, () => {
            this.validatePAM();
          });
        }
      };
      this.handleIncludeToggle = (_event, isIncludeOpen) => {
        this.setState({
          isIncludeOpen
        });
      };
      this.handleClearIncludeSelection = () => {
        this.setState({
          pamIncludeSuffix: [],
          isIncludeOpen: false
        }, () => {
          this.validatePAM();
        });
      };
      this.handleIncludeSelect = (event, selection) => {
        this.setState({
          pamIncludeSuffix: Array.isArray(selection) ? selection : []
        });
      };
      this.handleCreateIncludeOption = (newValue) => {
        if (!this.state.includeOptions.includes(newValue)) {
          this.setState({
            includeOptions: [...this.state.includeOptions, newValue],
            isIncludeOpen: false
          });
        }
      };
      this.maxValue = 2e7;
      this.onMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validatePassthru();
        });
      };
      this.onConfigChange = (event, id, min3) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
        }, () => {
          this.validatePassthru();
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validatePassthru();
        });
      };
      this.attrRows = this.props.attributes.map((attr) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormSelectOption, { value: attr, label: attr }, attr));
      this.handlePAMChange = this.handlePAMChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.validatePAM = this.validatePAM.bind(this);
      this.loadPAMConfigs = this.loadPAMConfigs.bind(this);
      this.openPAMModal = this.openPAMModal.bind(this);
      this.handleClosePAMModal = this.handleClosePAMModal.bind(this);
      this.showEditPAMConfigModal = this.showEditPAMConfigModal.bind(this);
      this.handleShowAddPAMConfigModal = this.handleShowAddPAMConfigModal.bind(this);
      this.cmdPAMOperation = this.cmdPAMOperation.bind(this);
      this.deletePAMConfig = this.deletePAMConfig.bind(this);
      this.handleAddPAMConfig = this.handleAddPAMConfig.bind(this);
      this.handleEditPAMConfig = this.handleEditPAMConfig.bind(this);
      this.showConfirmDeleteConfig = this.showConfirmDeleteConfig.bind(this);
      this.closeConfirmDeleteConfig = this.closeConfirmDeleteConfig.bind(this);
    }
    componentDidMount() {
      this.loadPAMConfigs();
    }
    validatePAM() {
      const errObj = {};
      let all_good = true;
      const reqAttrs = ["pamConfigName", "pamIDAttr"];
      const dnAttrLists = ["pamExcludeSuffix", "pamExcludeSuffix"];
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          errObj[attr] = true;
          all_good = false;
          break;
        }
      }
      for (const attrList of dnAttrLists) {
        for (const dn of this.state[attrList]) {
          if (!valid_dn(dn)) {
            errObj[attrList] = true;
            all_good = false;
            break;
          }
        }
      }
      if (all_good) {
        all_good = false;
        const attrLists = ["pamExcludeSuffix", "pamIncludeSuffix"];
        for (const check_attr of attrLists) {
          if (!listsEqual(this.state[check_attr], this.state["_" + check_attr])) {
            all_good = true;
            break;
          }
        }
        const configAttrs2 = [
          "pamConfigName",
          "pamFilter",
          "pamMissingSuffix",
          "pamIDMapMethod",
          "pamIDAttr",
          "pamFallback",
          "pamSecure",
          "pamService"
        ];
        for (const check_attr of configAttrs2) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabledPAM: !all_good,
        error: errObj
      });
    }
    handlePAMChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validatePAM();
      });
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    showConfirmDeleteConfig(name2) {
      this.setState({
        showConfirmDeleteConfig: true,
        modalChecked: false,
        modalSpinning: false,
        deleteName: name2
      });
    }
    closeConfirmDeleteConfig() {
      this.setState({
        showConfirmDeleteConfig: false,
        modalChecked: false,
        modalSpinning: false,
        deleteName: ""
      });
    }
    loadPAMConfigs() {
      this.setState({
        firstLoad: false
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "pam-pass-through-auth",
        "list"
      ];
      this.props.toggleLoadingHandler();
      log_cmd("loadPAMConfigs", "Get PAM Passthrough Authentication Plugin Configs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const tableKey = this.state.tableKey + 1;
        this.setState({
          pamConfigRows: myObject.items.map((item) => item.attrs),
          tableKey
        });
        this.props.toggleLoadingHandler();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        if (err !== 0) {
          console.log("loadPAMConfigs failed", errMsg);
        }
        this.props.toggleLoadingHandler();
      });
    }
    showEditPAMConfigModal(rowData) {
      this.openPAMModal(rowData);
    }
    handleShowAddPAMConfigModal() {
      this.openPAMModal();
    }
    openPAMModal(name2) {
      if (!name2) {
        this.setState({
          pamConfigEntryModalShow: true,
          newPAMConfigEntry: true,
          pamConfigName: "",
          pamExcludeSuffix: [],
          pamIncludeSuffix: [],
          pamMissingSuffix: "",
          pamFilter: "",
          pamIDAttr: "",
          pamIDMapMethod: "RDN",
          pamFallback: false,
          pamSecure: false,
          pamService: "ldapserver",
          saveBtnDisabledPAM: true
        });
      } else {
        let pamExcludeSuffixList = [];
        let pamIncludeSuffixList = [];
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "pam-pass-through-auth",
          "config",
          name2,
          "show"
        ];
        this.props.toggleLoadingHandler();
        log_cmd(
          "openModal",
          "Fetch the PAM Passthrough Authentication Plugin pamConfig entry",
          cmd
        );
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const pamConfigEntry = JSON.parse(content).attrs;
          const tableKey = this.state.tableKey + 1;
          if (pamConfigEntry.pamexcludesuffix !== void 0) {
            for (const value of pamConfigEntry.pamexcludesuffix) {
              pamExcludeSuffixList = [...pamExcludeSuffixList, value];
            }
          }
          if (pamConfigEntry.pamincludesuffix !== void 0) {
            for (const value of pamConfigEntry.pamincludesuffix) {
              pamIncludeSuffixList = [...pamIncludeSuffixList, value];
            }
          }
          this.setState({
            tableKey,
            saveBtnDisabledPAM: true,
            pamConfigEntryModalShow: true,
            newPAMConfigEntry: false,
            pamExcludeSuffix: pamExcludeSuffixList,
            pamIncludeSuffix: pamIncludeSuffixList,
            pamIDAttr: pamConfigEntry.pamidattr[0],
            pamConfigName: pamConfigEntry.cn === void 0 ? "" : pamConfigEntry.cn[0],
            pamMissingSuffix: pamConfigEntry.pammissingsuffix === void 0 ? "" : pamConfigEntry.pammissingsuffix[0],
            pamFilter: pamConfigEntry.pamfilter === void 0 ? "" : pamConfigEntry.pamfilter[0],
            pamIDMapMethod: pamConfigEntry.pamidmapmethod === void 0 ? "RDN" : pamConfigEntry.pamidmapmethod[0],
            pamFallback: !(pamConfigEntry.pamfallback === void 0 || pamConfigEntry.pamfallback[0] === "FALSE"),
            pamSecure: !(pamConfigEntry.pamsecure === void 0 || pamConfigEntry.pamsecure[0] === "FALSE"),
            pamService: pamConfigEntry.pamservice === void 0 ? "ldapserver" : pamConfigEntry.pamservice[0],
            // Backup values
            _pamExcludeSuffix: [...pamExcludeSuffixList],
            _pamIncludeSuffix: [...pamIncludeSuffixList],
            _pamIDAttr: pamConfigEntry.pamidattr[0],
            _pamConfigName: pamConfigEntry.cn === void 0 ? "" : pamConfigEntry.cn[0],
            _pamMissingSuffix: pamConfigEntry.pammissingsuffix === void 0 ? "" : pamConfigEntry.pammissingsuffix[0],
            _pamFilter: pamConfigEntry.pamfilter === void 0 ? "" : pamConfigEntry.pamfilter[0],
            _pamIDMapMethod: pamConfigEntry.pamidmapmethod === void 0 ? "ldapserver" : pamConfigEntry.pamidmapmethod[0],
            _pamFallback: !(pamConfigEntry.pamfallback === void 0 || pamConfigEntry.pamfallback[0] === "FALSE"),
            _pamSecure: !(pamConfigEntry.pamsecure === void 0 || pamConfigEntry.pamsecure[0] === "FALSE"),
            _pamService: pamConfigEntry.pamservice === void 0 ? "ldapserver" : pamConfigEntry.pamservice[0]
          });
          this.props.toggleLoadingHandler();
        }).fail((_113) => {
          this.setState({
            pamConfigEntryModalShow: true,
            newPAMConfigEntry: true,
            pamConfigName: "",
            pamExcludeSuffix: [],
            pamIncludeSuffix: [],
            pamMissingSuffix: "",
            pamFilter: "",
            pamIDAttr: "",
            pamIDMapMethod: "",
            pamFallback: false,
            pamSecure: false,
            pamService: "",
            saveBtnDisabledPAM: true
          });
          this.props.toggleLoadingHandler();
        });
      }
    }
    handleClosePAMModal() {
      this.setState({
        pamConfigEntryModalShow: false,
        savingPAM: false
      });
    }
    deletePAMConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "pam-pass-through-auth",
        "config",
        this.state.deleteName,
        "delete"
      ];
      this.setState({
        modalSpinning: true
      });
      this.props.toggleLoadingHandler();
      log_cmd(
        "deletePAMConfig",
        "Delete the PAM Passthrough Authentication Plugin pamConfig entry",
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deletePAMConfig", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_14("PAMConfig entry $0 was successfully deleted"), this.state.deleteName)
        );
        this.loadPAMConfigs();
        this.closeConfirmDeleteConfig();
        this.props.toggleLoadingHandler();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_14("Error during the pamConfig entry removal operation - $0"), errMsg)
        );
        this.loadPAMConfigs();
        this.closeConfirmDeleteConfig();
        this.props.toggleLoadingHandler();
      });
    }
    handleAddPAMConfig() {
      this.cmdPAMOperation("add");
    }
    handleEditPAMConfig() {
      this.cmdPAMOperation("set");
    }
    cmdPAMOperation(action) {
      const {
        pamConfigName,
        pamExcludeSuffix,
        pamIncludeSuffix,
        pamMissingSuffix,
        pamFilter,
        pamIDAttr,
        pamIDMapMethod,
        pamFallback,
        pamSecure,
        pamService
      } = this.state;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "pam-pass-through-auth",
        "config",
        pamConfigName,
        action,
        "--missing-suffix",
        pamMissingSuffix || action === "add" ? pamMissingSuffix : "delete",
        "--filter",
        pamFilter || action === "add" ? pamFilter : "delete",
        "--id_map_method",
        pamIDMapMethod || action === "add" ? pamIDMapMethod : "delete",
        "--fallback",
        pamFallback ? "TRUE" : "FALSE",
        "--secure",
        pamSecure ? "TRUE" : "FALSE",
        "--service",
        pamService || action === "add" ? pamService : "delete"
      ];
      cmd = [...cmd, "--exclude-suffix"];
      if (pamExcludeSuffix.length !== 0) {
        for (const value of pamExcludeSuffix) {
          cmd = [...cmd, value];
        }
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--include-suffix"];
      if (pamIncludeSuffix.length !== 0) {
        for (const value of pamIncludeSuffix) {
          cmd = [...cmd, value];
        }
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--id-attr"];
      if (pamIDAttr !== "") {
        cmd = [...cmd, pamIDAttr];
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      this.setState({
        savingPAM: true
      });
      log_cmd(
        "pamPassthroughAuthOperation",
        `Do the ${action} operation on the PAM Passthrough Authentication Plugin`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("pamPassthroughAuthOperation", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_14('The $0 operation was successfully done on "$1" entry'), action, pamConfigName)
        );
        this.loadPAMConfigs();
        this.handleClosePAMModal();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_14("Error during the pamConfig entry $0 operation - $1"), action, errMsg)
        );
        this.loadPAMConfigs();
        this.handleClosePAMModal();
      });
    }
    render() {
      const {
        pamConfigRows,
        pamConfigName,
        pamMissingSuffix,
        pamExcludeSuffix,
        pamIncludeSuffix,
        pamFilter,
        pamIDAttr,
        pamIDMapMethod,
        pamFallback,
        pamSecure,
        pamService,
        newPAMConfigEntry,
        pamConfigEntryModalShow,
        error,
        savingPAM
      } = this.state;
      let saveBtnName = _14("Save Config");
      const extraPrimaryProps = {};
      if (this.state.savingPAM) {
        saveBtnName = _14("Saving Config ...");
        extraPrimaryProps.spinnerAriaValueText = _14("Saving");
      }
      const title = cockpit_default.format(_14("$0 PAM Passthrough Auth Config Entry"), newPAMConfigEntry ? _14("Add") : _14("Edit"));
      return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: savingPAM ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            "aria-labelledby": "ds-modal",
            title,
            isOpen: pamConfigEntryModalShow,
            onClose: this.handleClosePAMModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: newPAMConfigEntry ? this.handleAddPAMConfig : this.handleEditPAMConfig,
                  isDisabled: this.state.saveBtnDisabledPAM || this.state.savingPAM,
                  isLoading: this.state.savingPAM,
                  spinnerAriaValueText: this.state.savingPAM ? _14("Saving") : void 0,
                  ...extraPrimaryProps,
                  children: saveBtnName
                },
                "confirm"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Button, { variant: "link", onClick: this.handleClosePAMModal, children: _14("Cancel") }, "cancel")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { className: "ds-label", span: 3, children: _14("Config Name") }),
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
                  TextInput,
                  {
                    value: pamConfigName,
                    type: "text",
                    id: "pamConfigName",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "pamConfigName",
                    onChange: (e, str) => {
                      this.handlePAMChange(e);
                    },
                    isDisabled: !newPAMConfigEntry,
                    validated: error.pamConfigName ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
                  GridItem,
                  {
                    className: "ds-label",
                    span: 3,
                    title: _14("Specifies a suffix to exclude from PAM authentication (pamExcludeSuffix)"),
                    children: _14("Exclude Suffix")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: pamExcludeSuffix,
                    onSelect: this.handleExcludeSelect,
                    onClear: this.handleClearExcludeSelection,
                    options: this.state.excludeOptions,
                    isOpen: this.state.isExcludeOpen,
                    onToggle: this.handleExcludeToggle,
                    placeholder: _14("Type a suffix DN ..."),
                    ariaLabel: "Add a suffix",
                    isMulti: true,
                    isCreatable: true,
                    onCreateOption: this.handleCreateExcludeOption
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
                  GridItem,
                  {
                    className: "ds-label",
                    span: 3,
                    title: _14("Sets a suffix to include for PAM authentication (pamIncludeSuffix)"),
                    children: _14("Include Suffix")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: pamIncludeSuffix,
                    onSelect: this.handleIncludeSelect,
                    onClear: this.handleClearIncludeSelection,
                    options: this.state.includeOptions,
                    isOpen: this.state.isIncludeOpen,
                    onToggle: this.handleIncludeToggle,
                    placeholder: _14("Type a suffix DN ..."),
                    ariaLabel: "Add an include suffix",
                    isMulti: true,
                    isCreatable: true,
                    onCreateOption: this.handleCreateIncludeOption
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { className: "ds-label", span: 3, title: _14("Contains the attribute name which is used to hold the PAM user ID (pamIDAttr)"), children: _14("ID Attribute") }),
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
                  FormSelect,
                  {
                    id: "pamIDAttr",
                    value: pamIDAttr,
                    onChange: (event, value) => {
                      this.handlePAMChange(event);
                    },
                    "aria-label": "FormSelect Input",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormSelectOption, { value: "", label: _14("Choose an attribute...") }, "no_setting2"),
                      this.attrRows
                    ]
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Grid, { title: _14("Identifies how to handle missing include or exclude suffixes (pamMissingSuffix)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { className: "ds-label", span: 3, children: _14("Missing Suffix") }),
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
                  FormSelect,
                  {
                    id: "pamMissingSuffix",
                    value: pamMissingSuffix,
                    onChange: (event, value) => {
                      this.handlePAMChange(event);
                    },
                    "aria-label": "FormSelect Input",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormSelectOption, { value: "ERROR", label: "ERROR" }, "ERROR"),
                      /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormSelectOption, { value: "ALLOW", label: "ALLOW" }, "ALLOW"),
                      /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormSelectOption, { value: "IGNORE", label: "IGNORE" }, "IGNORE")
                    ]
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Grid, { title: _14("Sets an LDAP filter to use to identify specific entries within the included suffixes for which to use PAM pass-through authentication (pamFilter)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { className: "ds-label", span: 3, children: _14("Filter") }),
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
                  TextInput,
                  {
                    value: pamFilter,
                    type: "text",
                    id: "pamFilter",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "pamFilter",
                    onChange: (e, str) => {
                      this.handlePAMChange(e);
                    },
                    validated: error.pamFilter ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Grid, { title: _14("Gives the method to use to map the LDAP bind DN to a PAM identity (pamIDMapMethod)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { className: "ds-label", span: 3, children: _14("Map Method") }),
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
                  FormSelect,
                  {
                    id: "pamIDMapMethod",
                    value: pamIDMapMethod,
                    onChange: (event, value) => {
                      this.handlePAMChange(event);
                    },
                    "aria-label": "FormSelect Input",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormSelectOption, { value: "RDN", label: "RDN" }, "RDN"),
                      /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormSelectOption, { value: "DN", label: "DN" }, "DN"),
                      /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormSelectOption, { value: "ENTRY", label: "ENTRY" }, "ENTRY")
                    ]
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Grid, { title: _14("Contains the service name to pass to PAM (pamService)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { className: "ds-label", span: 3, children: _14("Service") }),
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
                  FormSelect,
                  {
                    id: "pamService",
                    value: pamService,
                    onChange: (event, value) => {
                      this.handlePAMChange(event);
                    },
                    "aria-label": "FormSelect Input",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormSelectOption, { value: "ldapserver", label: "ldapserver" }, "ldapserver"),
                      /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormSelectOption, { value: "system-auth", label: "system-auth (For AD)" }, "system-auth")
                    ]
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { span: 3, className: "ds-label", children: _14("Fallback Auth Enabled") }),
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
                  Checkbox,
                  {
                    id: "pamFallback",
                    isChecked: pamFallback,
                    onChange: (e, checked) => {
                      this.handlePAMChange(e);
                    },
                    title: _14("Sets whether to fallback to regular LDAP authentication if PAM authentication fails (pamFallback)")
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { span: 3, className: "ds-label", children: _14("Require Secure Connection") }),
                /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
                  Checkbox,
                  {
                    id: "pamSecure",
                    isChecked: pamSecure,
                    onChange: (e, checked) => {
                      this.handlePAMChange(e);
                    },
                    title: _14("Requires secure TLS connection for PAM authentication (pamSecure)")
                  }
                ) })
              ] })
            ] })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
          pluginBasicConfig_default,
          {
            rows: this.props.rows,
            serverId: this.props.serverId,
            cn: "PAM Pass Through Auth",
            pluginName: "PAM Pass Through Auth",
            cmdName: "pam-pass-through-auth",
            savePluginHandler: this.props.savePluginHandler,
            pluginListHandler: this.props.pluginListHandler,
            addNotification: this.props.addNotification,
            toggleLoadingHandler: this.props.toggleLoadingHandler,
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
                PassthroughAuthConfigsTable,
                {
                  rows: pamConfigRows,
                  editConfig: this.showEditPAMConfigModal,
                  deleteConfig: this.showConfirmDeleteConfig
                },
                this.state.tableKey
              ),
              /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleShowAddPAMConfigModal,
                  className: "ds-margin-top",
                  children: _14("Add Config")
                }
              )
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDeleteConfig,
            closeHandler: this.closeConfirmDelete,
            handleChange: this.onModalChange,
            actionHandler: this.deletePAMConfig,
            spinning: this.state.modalSpinning,
            item: this.state.deleteName,
            checked: this.state.modalChecked,
            mTitle: _14("Delete PAM Passthrough Configuration"),
            mMsg: _14("Are you sure you want to delete this configuration?"),
            mSpinningMsg: _14("Deleting Configuration..."),
            mBtnName: _14("Delete Configuration")
          }
        )
      ] });
    }
  };
  PAMPassthroughAuthentication.propTypes = {
    rows: import_prop_types15.default.array,
    serverId: import_prop_types15.default.string,
    savePluginHandler: import_prop_types15.default.func,
    pluginListHandler: import_prop_types15.default.func,
    addNotification: import_prop_types15.default.func,
    toggleLoadingHandler: import_prop_types15.default.func
  };
  PAMPassthroughAuthentication.defaultProps = {
    rows: [],
    serverId: ""
  };
  var pamPassThru_default = PAMPassthroughAuthentication;

  // src/lib/plugins/referentialIntegrity.jsx
  var import_react31 = __toESM(require_react(), 1);
  var import_prop_types16 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
  var _15 = cockpit_default.gettext;
  var ReferentialIntegrity = class extends import_react31.default.Component {
    componentDidMount(prevProps) {
      if (this.props.wasActiveList.includes(5)) {
        if (this.state.firstLoad) {
          this.updateFields();
        }
      }
    }
    componentDidUpdate(prevProps) {
      if (this.props.rows !== prevProps.rows) {
        this.updateFields();
      }
    }
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        newEntry: true,
        isConfigMembershipAttrOpen: false,
        isMembershipAttrOpen: false,
        configEntryModalShow: false,
        saveBtnDisabled: true,
        saveBtnDisabledModal: true,
        saving: false,
        savingModal: false,
        modalSpinning: false,
        modalChecked: false,
        error: {},
        errorModal: {},
        showConfirmDelete: false,
        addSpinning: false,
        // Main settings
        updateDelay: "",
        membershipAttr: [],
        entryScope: "",
        excludeEntryScope: "",
        containerScope: "",
        logFile: "",
        referintConfigEntry: "",
        _updateDelay: "",
        _membershipAttr: [],
        _entryScope: "",
        _excludeEntryScope: "",
        _containerScope: "",
        _logFile: "",
        _referintConfigEntry: "",
        // Shared Config settings
        configDN: "",
        configUpdateDelay: "",
        configMembershipAttr: [],
        configEntryScope: "",
        configExcludeEntryScope: "",
        configContainerScope: "",
        configLogFile: "",
        _configDN: "",
        _configUpdateDelay: "",
        _configMembershipAttr: [],
        _configEntryScope: "",
        _configExcludeEntryScope: "",
        _configContainerScope: "",
        _configLogFile: ""
      };
      this.handleConfigMembershipAttrSelect = (event, selection) => {
        this.setState({
          configMembershipAttr: Array.isArray(selection) ? selection : []
        }, () => {
          this.validateModal();
        });
      };
      this.handleConfigMembershipAttrToggle = (_event, isConfigMembershipAttrOpen) => {
        this.setState({
          isConfigMembershipAttrOpen
        });
      };
      this.handleConfigMembershipAttrClear = () => {
        this.setState({
          configMembershipAttr: [],
          isConfigMembershipAttrOpen: false
        });
      };
      this.handleMembershipAttrSelect = (event, selection) => {
        this.setState({
          membershipAttr: Array.isArray(selection) ? selection : []
        }, () => {
          this.validateConfig();
        });
      };
      this.handleMembershipAttrToggle = (_event, isMembershipAttrOpen) => {
        this.setState({
          isMembershipAttrOpen
        });
      };
      this.handleMembershipAttrClear = () => {
        this.setState({
          membershipAttr: [],
          isMembershipAttrOpen: false
        });
      };
      this.maxValue = 2e7;
      this.onMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateConfig();
        });
      };
      this.onConfigChange = (event, id, min3) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
        }, () => {
          id.startsWith("config") ? this.validateModal() : this.validateConfig();
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateConfig();
        });
      };
      this.updateFields = this.updateFields.bind(this);
      this.onChange = this.onChange.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.handleModalChange = this.handleModalChange.bind(this);
      this.handleOpenModal = this.handleOpenModal.bind(this);
      this.handleCloseModal = this.handleCloseModal.bind(this);
      this.handleAddConfig = this.handleAddConfig.bind(this);
      this.handleEditConfig = this.handleEditConfig.bind(this);
      this.deleteConfig = this.deleteConfig.bind(this);
      this.cmdConfigOperation = this.cmdConfigOperation.bind(this);
      this.validateConfig = this.validateConfig.bind(this);
      this.validateModal = this.validateModal.bind(this);
      this.handleSaveConfig = this.handleSaveConfig.bind(this);
      this.handleShowConfirmDelete = this.handleShowConfirmDelete.bind(this);
      this.closeConfirmDelete = this.closeConfirmDelete.bind(this);
    }
    handleShowConfirmDelete() {
      this.setState({
        showConfirmDelete: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmDelete() {
      this.setState({
        showConfirmDelete: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    validateConfig() {
      const errObj = {};
      let all_good = true;
      const dnAttrs = [
        "entryScope",
        "excludeEntryScope",
        "containerScope",
        "referintConfigEntry"
      ];
      const reqAttrs = ["logFile"];
      for (const attr of dnAttrs) {
        errObj[attr] = false;
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          errObj[attr] = true;
          all_good = false;
        }
      }
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          errObj[attr] = true;
          all_good = false;
        }
      }
      if (!file_is_path(this.state.logFile)) {
        errObj.logFile = true;
        all_good = false;
      }
      errObj.membershipAttr = false;
      if (this.state.membershipAttr.length === 0) {
        errObj.membershipAttr = true;
        all_good = false;
      }
      if (all_good) {
        all_good = false;
        const attrs = [
          "entryScope",
          "excludeEntryScope",
          "containerScope",
          "referintConfigEntry",
          "updateDelay",
          "logFile"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
        if (!listsEqual(this.state.membershipAttr, this.state._membershipAttr)) {
          all_good = true;
        }
      }
      this.setState({
        saveBtnDisabled: !all_good,
        error: errObj
      });
      return all_good;
    }
    validateModal() {
      const errObj = {};
      let all_good = true;
      const dnAttrs = [
        "configDN",
        "configEntryScope",
        "configExcludeEntryScope",
        "configContainerScope"
      ];
      const reqAttrs = ["configDN", "configLogFile"];
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          errObj[attr] = true;
          all_good = false;
        }
      }
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          errObj[attr] = true;
          all_good = false;
        }
      }
      if (!file_is_path(this.state.configLogFile)) {
        errObj.configLogFile = true;
        all_good = false;
      }
      errObj.configMembershipAttr = false;
      if (this.state.configMembershipAttr.length === 0) {
        errObj.configMembershipAttr = true;
        all_good = false;
      }
      if (all_good) {
        all_good = false;
        const attrs = [
          "configDN",
          "configEntryScope",
          "configExcludeEntryScope",
          "configContainerScope",
          "configUpdateDelay"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
        if (!listsEqual(this.state.configMembershipAttr, this.state._configMembershipAttr)) {
          all_good = true;
        }
      }
      this.setState({
        saveBtnDisabledModal: !all_good,
        errorModal: errObj
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    handleFieldChange(e) {
      this.setState({
        [e.target.id]: e.target.value
      }, () => {
        this.validateConfig();
      });
    }
    handleModalChange(e) {
      this.setState({
        [e.target.id]: e.target.value
      }, () => {
        this.validateModal();
      });
    }
    handleSaveConfig() {
      const {
        membershipAttr,
        entryScope,
        excludeEntryScope,
        containerScope,
        logFile,
        referintConfigEntry
      } = this.state;
      const updateDelay = this.state.updateDelay.toString();
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "referential-integrity",
        "set",
        "--update-delay",
        updateDelay || "delete",
        "--entry-scope",
        entryScope || "delete",
        "--exclude-entry-scope",
        excludeEntryScope || "delete",
        "--container-scope",
        containerScope || "delete",
        "--config-entry",
        referintConfigEntry || "delete",
        "--log-file",
        logFile || "delete"
      ];
      cmd = [...cmd, "--membership-attr"];
      if (membershipAttr.length !== 0) {
        for (const value of membershipAttr) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      this.setState({
        saving: true
      });
      log_cmd(
        "handleSaveConfig",
        `Save Referential Integrity Plugin`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("referintOperation", "Result", content);
        this.props.addNotification(
          "success",
          _15("Successfully updated Referential Integrity Plugin")
        );
        this.setState({
          saving: false
        });
        this.props.pluginListHandler();
      }).fail((err) => {
        let errMsg = getApiErrorMessage(err);
        if ("info" in errMsg) {
          errMsg = errMsg + " " + errMsg.info;
        } else {
          errMsg = errMsg;
        }
        this.props.addNotification(
          "error",
          cockpit_default.format(_15("Error during update - $0"), errMsg)
        );
        this.setState({
          saving: false
        });
        this.props.pluginListHandler();
      });
    }
    handleOpenModal() {
      if (!this.state.referintConfigEntry) {
        this.setState({
          configEntryModalShow: true,
          newEntry: true,
          configDN: "",
          configUpdateDelay: "0",
          configMembershipAttr: [],
          configEntryScope: "",
          configExcludeEntryScope: "",
          configContainerScope: "",
          configLogFile: "",
          _configDN: "",
          _configUpdateDelay: "",
          _configMembershipAttr: [],
          _configEntryScope: "",
          _configExcludeEntryScope: "",
          _configContainerScope: "",
          _configLogFile: "",
          addSpinning: false,
          savingModal: false
        });
      } else {
        let membershipAttrList = [];
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "referential-integrity",
          "config-entry",
          "show",
          this.state.referintConfigEntry
        ];
        log_cmd("handleOpenModal", "Fetch the Referential Integrity Plugin config entry", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const pluginRow = JSON.parse(content).attrs;
          this.setState({
            configEntryModalShow: true,
            newEntry: false,
            configDN: this.state.referintConfigEntry,
            configUpdateDelay: pluginRow["referint-update-delay"] === void 0 ? "" : pluginRow["referint-update-delay"][0],
            configEntryScope: pluginRow["nsslapd-pluginentryscope"] === void 0 ? "" : pluginRow["nsslapd-pluginentryscope"][0],
            configExcludeEntryScope: pluginRow["nsslapd-pluginexcludeentryscope"] === void 0 ? "" : pluginRow["nsslapd-pluginexcludeentryscope"][0],
            configContainerScope: pluginRow["nsslapd-plugincontainerscope"] === void 0 ? "" : pluginRow["nsslapd-plugincontainerscope"][0],
            configLogFile: pluginRow["referint-logfile"] === void 0 ? "" : pluginRow["referint-logfile"][0],
            _configUpdateDelay: pluginRow["referint-update-delay"] === void 0 ? "" : pluginRow["referint-update-delay"][0],
            _configEntryScope: pluginRow["nsslapd-pluginentryscope"] === void 0 ? "" : pluginRow["nsslapd-pluginentryscope"][0],
            _configExcludeEntryScope: pluginRow["nsslapd-pluginexcludeentryscope"] === void 0 ? "" : pluginRow["nsslapd-pluginexcludeentryscope"][0],
            _configContainerScope: pluginRow["nsslapd-plugincontainerscope"] === void 0 ? "" : pluginRow["nsslapd-plugincontainerscope"][0],
            _configLogFile: pluginRow["referint-logfile"] === void 0 ? "" : pluginRow["referint-logfile"][0]
          });
          if (pluginRow["referint-membership-attr"] === void 0) {
            this.setState({
              configMembershipAttr: [],
              _configMembershipAttr: []
            });
          } else {
            for (const value of pluginRow["referint-membership-attr"]) {
              membershipAttrList = [...membershipAttrList, value];
            }
            this.setState({
              configMembershipAttr: membershipAttrList,
              _configMembershipAttr: [...membershipAttrList]
            });
          }
        }).fail((_113) => {
          this.setState({
            configEntryModalShow: true,
            newEntry: true,
            configDN: this.state.referintConfigEntry,
            configUpdateDelay: "0",
            configMembershipAttr: [],
            configEntryScope: "",
            configExcludeEntryScope: "",
            configContainerScope: "",
            configLogFile: "",
            _configDN: this.state.referintConfigEntry,
            _configUpdateDelay: "",
            _configMembershipAttr: [],
            _configEntryScope: "",
            _configExcludeEntryScope: "",
            _configContainerScope: "",
            _configLogFile: "",
            savingModal: false
          });
        });
      }
    }
    handleCloseModal() {
      this.setState({
        configEntryModalShow: false,
        savingModal: false,
        addSpinning: false,
        modalSpinning: false
      });
    }
    cmdConfigOperation(action) {
      const {
        configDN,
        configUpdateDelay,
        configMembershipAttr,
        configEntryScope,
        configExcludeEntryScope,
        configContainerScope,
        configLogFile
      } = this.state;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "referential-integrity",
        "config-entry",
        action,
        configDN,
        "--update-delay",
        configUpdateDelay || action === "add" ? configUpdateDelay : "delete",
        "--entry-scope",
        configEntryScope || action === "add" ? configEntryScope : "delete",
        "--exclude-entry-scope",
        configExcludeEntryScope || action === "add" ? configExcludeEntryScope : "delete",
        "--container-scope",
        configContainerScope || action === "add" ? configContainerScope : "delete",
        "--log-file",
        configLogFile || action === "add" ? configLogFile : "delete"
      ];
      cmd = [...cmd, "--membership-attr"];
      if (configMembershipAttr.length !== 0) {
        for (const value of configMembershipAttr) {
          cmd = [...cmd, value];
        }
      } else if (action === "add") {
        cmd = [...cmd, ""];
      } else {
        cmd = [...cmd, "delete"];
      }
      let spinning = "savingModal";
      if (action === "add") {
        spinning = "addSpinning";
      }
      this.setState({
        [spinning]: true
      });
      log_cmd(
        "referintOperation",
        `Do the ${action} operation on the Referential Integrity Plugin`,
        cmd
      );
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("referintOperation", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_15("Config entry $0 was successfully $1"), configDN, action + "ed")
        );
        this.props.pluginListHandler();
        this.handleCloseModal();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_15("Error during the config entry $0 operation - $1"), action, errMsg)
        );
        this.props.pluginListHandler();
        this.handleCloseModal();
      });
    }
    deleteConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "referential-integrity",
        "config-entry",
        "delete",
        this.state.configDN
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteConfig", "Delete the Referential Integrity Plugin config entry", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteConfig", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_15("Config entry $0 was successfully deleted"), this.state.configDN)
        );
        this.props.pluginListHandler();
        this.closeConfirmDelete();
        this.handleCloseModal();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_15("Error during the config entry removal operation - $0"), errMsg)
        );
        this.props.pluginListHandler();
        this.closeConfirmDelete();
        this.handleCloseModal();
      });
    }
    handleAddConfig() {
      this.cmdConfigOperation("add");
    }
    handleEditConfig() {
      this.cmdConfigOperation("set");
    }
    updateFields() {
      let membershipAttrList = [];
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find(
          (row) => row.cn[0] === "referential integrity postoperation"
        );
        this.setState({
          updateDelay: pluginRow["referint-update-delay"] === void 0 ? "0" : pluginRow["referint-update-delay"][0],
          _updateDelay: pluginRow["referint-update-delay"] === void 0 ? "0" : pluginRow["referint-update-delay"][0],
          entryScope: pluginRow["nsslapd-pluginentryscope"] === void 0 ? "" : pluginRow["nsslapd-pluginentryscope"][0],
          _entryScope: pluginRow["nsslapd-pluginentryscope"] === void 0 ? "" : pluginRow["nsslapd-pluginentryscope"][0],
          excludeEntryScope: pluginRow["nsslapd-pluginexcludeentryscope"] === void 0 ? "" : pluginRow["nsslapd-pluginexcludeentryscope"][0],
          _excludeEntryScope: pluginRow["nsslapd-pluginexcludeentryscope"] === void 0 ? "" : pluginRow["nsslapd-pluginexcludeentryscope"][0],
          containerScope: pluginRow["nsslapd-plugincontainerscope"] === void 0 ? "" : pluginRow["nsslapd-plugincontainerscope"][0],
          _containerScope: pluginRow["nsslapd-plugincontainerscope"] === void 0 ? "" : pluginRow["nsslapd-plugincontainerscope"][0],
          referintConfigEntry: pluginRow["nsslapd-pluginConfigArea"] === void 0 ? "" : pluginRow["nsslapd-pluginConfigArea"][0],
          _referintConfigEntry: pluginRow["nsslapd-pluginConfigArea"] === void 0 ? "" : pluginRow["nsslapd-pluginConfigArea"][0],
          logFile: pluginRow["referint-logfile"] === void 0 ? "" : pluginRow["referint-logfile"][0],
          _logFile: pluginRow["referint-logfile"] === void 0 ? "" : pluginRow["referint-logfile"][0]
        });
        if (pluginRow["referint-membership-attr"] === void 0) {
          this.setState({
            membershipAttr: [],
            _membershipAttr: []
          });
        } else {
          for (const value of pluginRow["referint-membership-attr"]) {
            membershipAttrList = [...membershipAttrList, value];
          }
          this.setState({
            membershipAttr: membershipAttrList,
            _membershipAttr: [...membershipAttrList]
          });
        }
      }
    }
    render() {
      const {
        updateDelay,
        membershipAttr,
        entryScope,
        excludeEntryScope,
        containerScope,
        logFile,
        referintConfigEntry,
        configDN,
        configUpdateDelay,
        configMembershipAttr,
        configEntryScope,
        configExcludeEntryScope,
        configContainerScope,
        configEntryModalShow,
        configLogFile,
        newEntry,
        saveBtnDisabled,
        saveBtnDisabledModal,
        saving,
        savingModal,
        addSpinning,
        modalSpinning,
        error,
        errorModal
      } = this.state;
      let saveBtnText = _15("Save Config");
      let addBtnText = _15("Add Config");
      const extraPrimaryProps = {};
      if (savingModal) {
        saveBtnText = _15("Saving ...");
        addBtnText = _15("Adding ...");
        extraPrimaryProps.spinnerAriaValueText = _15("Loading");
      }
      let modalButtons = [];
      if (!newEntry) {
        modalButtons = [
          /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
            Button,
            {
              variant: "primary",
              onClick: this.handleShowConfirmDelete,
              children: _15("Delete Config")
            },
            "del"
          ),
          /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
            Button,
            {
              variant: "primary",
              onClick: this.handleEditConfig,
              isDisabled: saveBtnDisabledModal || savingModal,
              isLoading: savingModal,
              spinnerAriaValueText: savingModal ? _15("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveBtnText
            },
            "save"
          ),
          /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Button, { variant: "link", onClick: this.handleCloseModal, children: _15("Cancel") }, "cancel")
        ];
      } else {
        modalButtons = [
          /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
            Button,
            {
              variant: "primary",
              onClick: this.handleAddConfig,
              isDisabled: saveBtnDisabledModal || addSpinning,
              isLoading: addSpinning,
              spinnerAriaValueText: addSpinning ? _15("Saving") : void 0,
              ...extraPrimaryProps,
              children: addBtnText
            },
            "add"
          ),
          /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Button, { variant: "link", onClick: this.handleCloseModal, children: _15("Cancel") }, "cancel")
        ];
      }
      return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: saving || savingModal || addSpinning || modalSpinning ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: _15("Manage Referential Integrity Plugin Shared Config Entry"),
            isOpen: configEntryModalShow,
            "aria-labelledby": "ds-modal",
            onClose: this.handleCloseModal,
            actions: modalButtons,
            children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Grid, { className: "ds-margin-top", title: _15("The config entry full DN"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { span: 3, className: "ds-label", children: _15("Config DN") }),
                /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
                    TextInput,
                    {
                      value: configDN,
                      type: "text",
                      id: "configDN",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "configDN",
                      onChange: (e, str) => {
                        this.handleModalChange(e);
                      },
                      validated: errorModal.configDN ? ValidatedOptions.error : ValidatedOptions.default,
                      isDisabled: !newEntry
                    }
                  ),
                  newEntry && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormHelperText, { children: _15("Value must be a valid DN") })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Grid, { title: _15("Specifies attributes to check for and update (referint-membership-attr)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { className: "ds-label", span: 3, children: _15("Membership Attribute") }),
                /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
                    dsBasicComponents_default,
                    {
                      selected: configMembershipAttr,
                      onSelect: this.handleConfigMembershipAttrSelect,
                      onClear: this.handleConfigMembershipAttrClear,
                      options: this.props.attributes,
                      isOpen: this.state.isConfigMembershipAttrOpen,
                      onToggle: this.handleConfigMembershipAttrToggle,
                      placeholder: _15("Type an attribute..."),
                      noResultsText: _15("There are no matching entries"),
                      ariaLabel: "Type an attribute",
                      validated: errorModal.configMembershipAttr ? "error" : "default",
                      isMulti: true
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormHelperText, { children: _15("At least one attribute must be specified") })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Grid, { title: _15("Defines the subtree in which the plug-in looks for the delete or rename operations of a user entry (nsslapd-pluginEntryScope)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { className: "ds-label", span: 3, children: _15("Entry Scope") }),
                /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
                  TextInput,
                  {
                    value: configEntryScope,
                    type: "text",
                    id: "configEntryScope",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "configEntryScope",
                    onChange: (e, str) => {
                      this.handleModalChange(e);
                    },
                    validated: errorModal.configEntryScope ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormHelperText, { children: _15("Value must be a valid DN") })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Grid, { title: _15("Defines the subtree in which the plug-in ignores any operations for deleting or renaming a user (nsslapd-pluginExcludeEntryScope)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { className: "ds-label", span: 3, children: _15("Exclude Entry Scope") }),
                /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
                    TextInput,
                    {
                      value: configExcludeEntryScope,
                      type: "text",
                      id: "configExcludeEntryScope",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "configExcludeEntryScope",
                      onChange: (e, str) => {
                        this.handleModalChange(e);
                      },
                      validated: errorModal.configExcludeEntryScope ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormHelperText, { children: _15("Value must be a valid DN") })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Grid, { title: _15("Specifies which branch the plug-in searches for the groups to which the user belongs. It only updates groups that are under the specified container branch, and leaves all other groups not updated (nsslapd-pluginContainerScope)."), children: [
                /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { className: "ds-label", span: 3, children: _15("Container Scope") }),
                /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
                    TextInput,
                    {
                      value: configContainerScope,
                      type: "text",
                      id: "configContainerScope",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "configContainerScope",
                      onChange: (e, str) => {
                        this.handleModalChange(e);
                      },
                      validated: errorModal.configContainerScope ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormHelperText, { children: _15("Value must be a valid DN") })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
                Grid,
                {
                  title: `Specifies a path to the Referential integrity logfile. For example: /var/log/dirsrv/slapd-${this.props.serverId}/referint`,
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { className: "ds-label", span: 3, children: _15("Logfile") }),
                    /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(GridItem, { span: 9, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
                        TextInput,
                        {
                          value: configLogFile,
                          type: "text",
                          id: "configLogFile",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "configLogFile",
                          onChange: (e, str) => {
                            this.handleModalChange(e);
                          },
                          validated: errorModal.configLogFile ? ValidatedOptions.error : ValidatedOptions.default
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormHelperText, { children: _15("Invalid log file name") })
                    ] })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Grid, { title: _15("Sets the update interval in seconds. Special values: 0 - The check is performed immediately, -1 - No check is performed. (referint-update-delay)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { span: 3, className: "ds-label", children: _15("Update Delay") }),
                /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
                  NumberInput,
                  {
                    value: configUpdateDelay,
                    min: -1,
                    max: this.maxValue,
                    onMinus: () => {
                      this.onMinusConfig("configUpdateDelay");
                    },
                    onChange: (e) => {
                      this.onConfigChange(e, "configUpdateDelay", -1);
                    },
                    onPlus: () => {
                      this.onPlusConfig("configUpdateDelay");
                    },
                    inputName: "input",
                    inputAriaLabel: "number input",
                    minusBtnAriaLabel: "minus",
                    plusBtnAriaLabel: "plus",
                    widthChars: 8
                  }
                ) })
              ] })
            ] })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
          pluginBasicConfig_default,
          {
            rows: this.props.rows,
            serverId: this.props.serverId,
            cn: "referential integrity postoperation",
            pluginName: "Referential Integrity",
            cmdName: "referential-integrity",
            savePluginHandler: this.props.savePluginHandler,
            pluginListHandler: this.props.pluginListHandler,
            addNotification: this.props.addNotification,
            toggleLoadingHandler: this.props.toggleLoadingHandler,
            saveBtnDisabled: this.state.saveBtnDisabled,
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
                /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Grid, { title: _15("Specifies attributes to check for and update (referint-membership-attr)."), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { className: "ds-label", span: 3, children: _15("Membership Attribute") }),
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(GridItem, { span: 8, children: [
                    /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
                      dsBasicComponents_default,
                      {
                        selected: membershipAttr,
                        onSelect: this.handleMembershipAttrSelect,
                        onClear: this.handleMembershipAttrClear,
                        options: this.props.attributes,
                        isOpen: this.state.isMembershipAttrOpen,
                        onToggle: this.handleMembershipAttrToggle,
                        placeholder: _15("Type an attribute..."),
                        noResultsText: _15("There are no matching entries"),
                        ariaLabel: "Type an attribute",
                        validated: error.membershipAttr ? "error" : "default",
                        isMulti: true
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormHelperText, { children: _15("At least one attribute needs to be specified") })
                  ] })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Grid, { title: _15("Defines the subtree in which the plug-in looks for the delete or rename operations of a user entry (nsslapd-pluginEntryScope)"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { className: "ds-label", span: 3, children: _15("Entry Scope") }),
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(GridItem, { span: 8, children: [
                    /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
                      TextInput,
                      {
                        value: entryScope,
                        type: "text",
                        id: "entryScope",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "entryScope",
                        onChange: (e, str) => {
                          this.handleFieldChange(e);
                        },
                        validated: error.entryScope ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormHelperText, { children: _15("The value must be a valid DN") })
                  ] })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Grid, { title: _15("Defines the subtree in which the plug-in ignores any operations for deleting or renaming a user (nsslapd-pluginExcludeEntryScope)"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { className: "ds-label", span: 3, children: _15("Exclude Entry Scope") }),
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(GridItem, { span: 8, children: [
                    /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
                      TextInput,
                      {
                        value: excludeEntryScope,
                        type: "text",
                        id: "excludeEntryScope",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "excludeEntryScope",
                        onChange: (e, str) => {
                          this.handleFieldChange(e);
                        },
                        validated: error.excludeEntryScope ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormHelperText, { children: _15("The value must be a valid DN") })
                  ] })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Grid, { title: _15("Specifies which branch the plug-in searches for the groups to which the user belongs. It only updates groups that are under the specified container branch, and leaves all other groups not updated (nsslapd-pluginContainerScope)."), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { className: "ds-label", span: 3, children: _15("Container Scope") }),
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(GridItem, { span: 8, children: [
                    /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
                      TextInput,
                      {
                        value: containerScope,
                        type: "text",
                        id: "containerScope",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "containerScope",
                        onChange: (e, str) => {
                          this.handleFieldChange(e);
                        },
                        validated: error.containerScope ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormHelperText, { children: _15("The value must be a valid DN") })
                  ] })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
                  Grid,
                  {
                    title: _15("Specifies a path to the Referential integrity logfile. For example: /var/log/dirsrv/slapd-") + `${this.props.serverId}/referint`,
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { className: "ds-label", span: 3, children: _15("Logfile") }),
                      /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(GridItem, { span: 8, children: [
                        /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
                          TextInput,
                          {
                            value: logFile,
                            type: "text",
                            id: "logFile",
                            "aria-describedby": "horizontal-form-name-helper",
                            name: "logFile",
                            onChange: (e, str) => {
                              this.handleFieldChange(e);
                            },
                            validated: error.logFile ? ValidatedOptions.error : ValidatedOptions.default
                          }
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormHelperText, { children: _15("Invalid log name") })
                      ] })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Grid, { title: _15("Sets the update interval. Special values: 0 - The check is performed immediately, -1 - No check is performed (referint-update-delay)"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { className: "ds-label", span: 3, children: _15("Update Delay") }),
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
                    NumberInput,
                    {
                      value: updateDelay,
                      min: -1,
                      max: this.maxValue,
                      onMinus: () => {
                        this.onMinusConfig("updateDelay");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "updateDelay", 0);
                      },
                      onPlus: () => {
                        this.onPlusConfig("updateDelay");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 8,
                      unit: "Seconds"
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Grid, { title: _15("The value to set as nsslapd-pluginConfigArea"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { className: "ds-label", span: 3, children: _15("Shared Config Entry") }),
                  this.state.referintConfigEntry !== "" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { className: "ds-right-margin", span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
                    TextInput,
                    {
                      value: referintConfigEntry,
                      type: "text",
                      id: "referintConfigEntry",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "referintConfigEntry",
                      readOnlyVariant: "plain"
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
                    Button,
                    {
                      variant: "primary",
                      onClick: this.handleOpenModal,
                      children: this.state.referintConfigEntry !== "" ? _15("Manage Config") : _15("Create Config")
                    }
                  ) })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
                Button,
                {
                  className: "ds-margin-top-lg",
                  isLoading: saving,
                  spinnerAriaValueText: saving ? _15("Loading") : void 0,
                  variant: "primary",
                  onClick: this.handleSaveConfig,
                  ...extraPrimaryProps,
                  isDisabled: saveBtnDisabled || saving,
                  children: saveBtnText
                },
                "at"
              )
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDelete,
            closeHandler: this.closeConfirmDelete,
            handleChange: this.onChange,
            actionHandler: this.deleteConfig,
            spinning: this.state.modalSpinning,
            item: this.state.configDN,
            checked: this.state.modalChecked,
            mTitle: _15("Delete RI Plugin Config Entry"),
            mMsg: _15("Are you sure you want to delete this config entry?"),
            mSpinningMsg: _15("Deleting ..."),
            mBtnName: _15("Delete")
          }
        )
      ] });
    }
  };
  ReferentialIntegrity.propTypes = {
    rows: import_prop_types16.default.array,
    serverId: import_prop_types16.default.string,
    savePluginHandler: import_prop_types16.default.func,
    pluginListHandler: import_prop_types16.default.func,
    addNotification: import_prop_types16.default.func,
    toggleLoadingHandler: import_prop_types16.default.func
  };
  ReferentialIntegrity.defaultProps = {
    rows: [],
    serverId: ""
  };
  var referentialIntegrity_default = ReferentialIntegrity;

  // src/lib/plugins/retroChangelog.jsx
  var import_react32 = __toESM(require_react(), 1);
  var import_prop_types17 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
  var _16 = cockpit_default.gettext;
  var RetroChangelog = class extends import_react32.default.Component {
    componentDidMount(prevProps) {
      if (this.state.firstLoad) {
        this.updateFields();
      }
    }
    componentDidUpdate(prevProps) {
      if (this.props.rows !== prevProps.rows) {
        this.updateFields();
      }
    }
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        saveBtnDisabled: true,
        saving: false,
        error: {},
        // Config settings
        isReplicated: false,
        maxAge: 0,
        maxAgeUnit: "w",
        trimInterval: 300,
        excludeSuffix: [],
        excludeSuffixOptions: [],
        excludeAttrs: [],
        // original values
        _isReplicated: false,
        _maxAge: 0,
        _maxAgeUnit: "w",
        _trimInterval: 300,
        _excludeSuffix: [],
        _excludeAttrs: [],
        isExcludeAttrOpen: false,
        isExcludeSuffixOpen: false
      };
      this.maxValue = 2e7;
      this.minValue = 0;
      this.handleMinusConfig = () => {
        if (this.state.maxAge === this.minValue) {
          return;
        }
        this.setState({
          maxAge: Number(this.state.maxAge) - 1
        }, () => {
          this.validate();
        });
      };
      this.handleMaxAgeChange = (event) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          maxAge: newValue > this.maxValue ? this.maxValue : newValue < this.minValue ? this.minValue : newValue
        }, () => {
          this.validate();
        });
      };
      this.handlePlusConfig = () => {
        if (this.state.maxAge === this.maxValue) {
          return;
        }
        this.setState({
          maxAge: Number(this.state.maxAge) + 1
        }, () => {
          this.validate();
        });
      };
      this.handleMinusTrim = () => {
        this.setState({
          trimInterval: Number(this.state.trimInterval) - 1
        }, () => {
          this.validate();
        });
      };
      this.handleTrimChange = (event) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          trimInterval: newValue > this.maxValue ? this.maxValue : newValue < this.minValue ? this.minValue : newValue
        }, () => {
          this.validate();
        });
      };
      this.handlePlusTrim = () => {
        this.setState({
          trimInterval: Number(this.state.trimInterval) + 1
        }, () => {
          this.validate();
        });
      };
      this.handleExcludeAttrSelect = (event, selection) => {
        this.setState({
          excludeAttrs: Array.isArray(selection) ? selection : []
        }, () => {
          this.validate();
        });
      };
      this.handleExcludeAttrToggle = (_event, isExcludeAttrOpen) => {
        this.setState({
          isExcludeAttrOpen
        });
      };
      this.handleExcludeAttrClear = () => {
        this.setState({
          excludeAttrs: [],
          isExcludeAttrOpen: false
        }, () => {
          this.validate();
        });
      };
      this.handleExcludeSuffixSelect = (event, selection) => {
        this.setState({
          excludeSuffix: Array.isArray(selection) ? selection : []
        }, () => {
          this.validate();
        });
      };
      this.handleExcludeSuffixToggle = (_event, isExcludeSuffixOpen) => {
        this.setState({
          isExcludeSuffixOpen
        }, () => {
          this.validate();
        });
      };
      this.handleExcludeSuffixClear = () => {
        this.setState({
          excludeSuffix: [],
          isExcludeSuffixOpen: false
        }, () => {
          this.validate();
        });
      };
      this.handleOnExcludeSuffixCreateOption = (newValue) => {
        if (!this.state.excludeSuffixOptions.includes(newValue)) {
          this.setState({
            excludeSuffixOptions: [...this.state.excludeSuffixOptions, newValue],
            isExcludeSuffixOpen: false
          }, () => {
            this.validate();
          });
        }
      };
      this.updateFields = this.updateFields.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.validate = this.validate.bind(this);
      this.handleSavePlugin = this.handleSavePlugin.bind(this);
    }
    validate() {
      const errObj = {};
      let all_good = true;
      const dnAttrs = [
        "excludeSuffix"
      ];
      for (const attr of dnAttrs) {
        for (const dnAttr of this.state[attr]) {
          if (!valid_dn(dnAttr)) {
            errObj[attr] = true;
            all_good = false;
          }
        }
      }
      if (all_good) {
        all_good = false;
        const attrs = [
          "isReplicated",
          "maxAge",
          "maxAgeUnit",
          "trimInterval"
        ];
        const attrLists = [
          "excludeSuffix",
          "excludeAttrs"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
          }
        }
        for (const check_list of attrLists) {
          if (!listsEqual(this.state[check_list], this.state["_" + check_list])) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabled: !all_good,
        error: errObj
      });
    }
    handleFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validate();
      });
    }
    updateFields() {
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find((row) => row.cn[0] === "Retro Changelog Plugin");
        let maxAge = "";
        let maxAgeUnit = "w";
        if (pluginRow["nsslapd-changelogmaxage"] !== void 0) {
          let val = pluginRow["nsslapd-changelogmaxage"][0];
          if (val !== "0") {
            const unit2 = val[val.length - 1];
            if (unit2 >= "0" && unit2 <= "9") {
              val = val + "s";
            }
            maxAge = Number(val.slice(0, -1)) === 0 ? 0 : Number(val.slice(0, -1));
            maxAgeUnit = val.slice(-1).toLowerCase();
          } else {
            maxAge = 0;
            maxAgeUnit = "s";
          }
        }
        this.setState({
          isReplicated: !(pluginRow.isReplicated === void 0 || pluginRow.isReplicated[0] === "FALSE"),
          excludeSuffix: pluginRow["nsslapd-exclude-suffix"] === void 0 ? [] : pluginRow["nsslapd-exclude-suffix"],
          excludeAttrs: pluginRow["nsslapd-exclude-attrs"] === void 0 ? [] : pluginRow["nsslapd-exclude-attrs"],
          maxAge,
          maxAgeUnit,
          trimInterval: pluginRow["nsslapd-changelog-trim-interval"] === void 0 ? 300 : pluginRow["nsslapd-changelog-trim-interval"][0],
          _isReplicated: !(pluginRow.isReplicated === void 0 || pluginRow.isReplicated[0] === "FALSE"),
          _excludeSuffix: pluginRow["nsslapd-exclude-suffix"] === void 0 ? [] : pluginRow["nsslapd-exclude-suffix"],
          _excludeAttrs: pluginRow["nsslapd-exclude-attrs"] === void 0 ? [] : pluginRow["nsslapd-exclude-attrs"],
          _maxAge: maxAge,
          _maxAgeUnit: maxAgeUnit,
          _trimInterval: pluginRow["nsslapd-changelog-trim-interval"] === void 0 ? 300 : pluginRow["nsslapd-changelog-trim-interval"][0]
        });
      }
    }
    handleSavePlugin() {
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "retro-changelog",
        "set",
        "--is-replicated",
        this.state.isReplicated ? "TRUE" : "FALSE",
        "--trim-interval",
        this.state.trimInterval.toString() || "300"
      ];
      const maxAge = this.state.maxAge.toString();
      if (maxAge === "0") {
        cmd = [...cmd, "--max-age=0"];
      } else {
        cmd = [...cmd, "--max-age", maxAge + this.state.maxAgeUnit];
      }
      if (this.state._excludeSuffix !== this.state.excludeSuffix) {
        cmd = [...cmd, "--exclude-suffix"];
        if (this.state.excludeSuffix.length !== 0) {
          for (const value of this.state.excludeSuffix) {
            cmd = [...cmd, value];
          }
        } else {
          cmd = [...cmd, "delete"];
        }
      }
      if (this.state._excludeAttrs !== this.state.excludeAttrs) {
        cmd = [...cmd, "--exclude-attrs"];
        if (this.state.excludeAttrs.length !== 0) {
          for (const value of this.state.excludeAttrs) {
            cmd = [...cmd, value];
          }
        } else {
          cmd = [...cmd, "delete"];
        }
      }
      this.setState({
        saving: true
      });
      log_cmd("handleSavePlugin", "update retrocl", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          _16("Successfully updated the Retro Changelog")
        );
        this.props.pluginListHandler();
        this.setState({
          saving: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_16("Failed to update Retro Changelog Plugin - $0"), errMsg)
        );
        this.props.pluginListHandler();
        this.setState({
          saving: false
        });
      });
    }
    render() {
      const {
        isReplicated,
        maxAge,
        maxAgeUnit,
        excludeSuffix,
        excludeAttrs,
        trimInterval,
        saving,
        error
      } = this.state;
      let saveBtnName = _16("Save");
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = _16("Saving ...");
        extraPrimaryProps.spinnerAriaValueText = _16("Saving");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: saving ? "ds-disabled" : "", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
        pluginBasicConfig_default,
        {
          rows: this.props.rows,
          serverId: this.props.serverId,
          cn: "Retro Changelog Plugin",
          pluginName: "Retro Changelog",
          cmdName: "retro-changelog",
          savePluginHandler: this.props.savePluginHandler,
          pluginListHandler: this.props.pluginListHandler,
          addNotification: this.props.addNotification,
          toggleLoadingHandler: this.props.toggleLoadingHandler,
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Grid, { title: _16("This attribute specifies the suffix which will be excluded from the scope of the plugin (nsslapd-exclude-suffix)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GridItem, { className: "ds-label", span: 2, children: _16("Exclude Suffix") }),
                /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(GridItem, { span: 5, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
                    dsBasicComponents_default,
                    {
                      selected: excludeSuffix,
                      onSelect: this.handleExcludeSuffixSelect,
                      onClear: this.handleExcludeSuffixClear,
                      options: [""],
                      isOpen: this.state.isExcludeSuffixOpen,
                      onToggle: this.handleExcludeSuffixToggle,
                      placeholder: _16("Type a suffix..."),
                      noResultsText: _16("There are no matching entries"),
                      ariaLabel: "Type a suffix",
                      validated: error.excludeSuffix ? "error" : "default",
                      isMulti: true,
                      isCreatable: true,
                      onCreateOption: this.handleOnExcludeSuffixCreateOption
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FormHelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(HelperTextItem, { variant: error.excludeSuffix ? "error" : "default", ...error.excludeSuffix && { icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ExclamationCircleIcon, {}) }, children: error.excludeSuffix ? _16("Values must be valid DN's") : "" }) }) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GridItem, { className: "ds-left-margin", span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
                  Checkbox,
                  {
                    id: "isReplicated",
                    isChecked: isReplicated,
                    onChange: (e, checked) => {
                      this.handleFieldChange(e);
                    },
                    title: _16("Sets a flag to indicate on a change in the changelog whether the change is newly made on that server or whether it was replicated over from another server (isReplicated)"),
                    label: _16("Is Replicated")
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Grid, { title: _16("This specifies attribute which will be excluded from the scope of the plugin (nsslapd-exclude-attrs)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GridItem, { className: "ds-label", span: 2, children: _16("Exclude attribute") }),
                /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: excludeAttrs,
                    onSelect: this.handleExcludeAttrSelect,
                    onClear: this.handleExcludeAttrClear,
                    options: this.props.attributes,
                    isOpen: this.state.isExcludeAttrOpen,
                    onToggle: this.handleExcludeAttrToggle,
                    placeholder: _16("Type an attribute..."),
                    noResultsText: _16("There are no matching entries"),
                    ariaLabel: "Type an attribute",
                    validated: error.excludeAttrs ? "error" : "default",
                    isMulti: true
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Grid, { title: _16("Specifies the maximum age of any entry in the changelog before it is trimmed from the database (nsslapd-changelogmaxage)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GridItem, { className: "ds-label", span: 2, children: _16("Max Age") }),
                /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
                  NumberInput,
                  {
                    value: maxAge,
                    min: this.minValue,
                    max: this.maxValue,
                    onMinus: this.handleMinusConfig,
                    onChange: this.handleMaxAgeChange,
                    onPlus: this.handlePlusConfig,
                    inputName: "input",
                    inputAriaLabel: "number input",
                    minusBtnAriaLabel: "minus",
                    plusBtnAriaLabel: "plus",
                    widthChars: 8
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GridItem, { offset: 5, span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
                  FormSelect,
                  {
                    id: "maxAgeUnit",
                    value: maxAgeUnit,
                    onChange: (event, value) => {
                      this.handleFieldChange(event);
                    },
                    "aria-label": "FormSelect Input",
                    isDisabled: maxAge === 0,
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FormSelectOption, { value: "w", label: _16("Weeks") }, "1"),
                      /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FormSelectOption, { value: "d", label: _16("Days") }, "2"),
                      /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FormSelectOption, { value: "h", label: _16("Hours") }, "3"),
                      /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FormSelectOption, { value: "m", label: _16("Minutes") }, "4"),
                      /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FormSelectOption, { value: "s", label: _16("Seconds") }, "5")
                    ]
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Grid, { className: "ds-margin-top", title: _16("Sets in seconds how often the plugin checks if changes can be trimmed from the database based on the entry's max age (nsslapd-changelog-trim-interval)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GridItem, { className: "ds-label", span: 2, children: _16("Trimming Interval") }),
                /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
                  NumberInput,
                  {
                    value: trimInterval,
                    min: 0,
                    max: this.maxValue,
                    onMinus: this.handleMinusTrim,
                    onChange: this.handleTrimChange,
                    onPlus: this.handlePlusTrim,
                    inputName: "input",
                    inputAriaLabel: "number input",
                    minusBtnAriaLabel: "minus",
                    plusBtnAriaLabel: "plus",
                    widthChars: 8
                  }
                ) })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
              Button,
              {
                className: "ds-margin-top-xlg",
                variant: "primary",
                onClick: this.handleSavePlugin,
                isDisabled: this.state.saveBtnDisabled || this.state.saving,
                isLoading: this.state.saving,
                spinnerAriaValueText: this.state.saving ? _16("Saving") : void 0,
                ...extraPrimaryProps,
                children: saveBtnName
              }
            )
          ]
        }
      ) });
    }
  };
  RetroChangelog.propTypes = {
    rows: import_prop_types17.default.array,
    serverId: import_prop_types17.default.string,
    savePluginHandler: import_prop_types17.default.func,
    pluginListHandler: import_prop_types17.default.func,
    addNotification: import_prop_types17.default.func,
    toggleLoadingHandler: import_prop_types17.default.func
  };
  RetroChangelog.defaultProps = {
    rows: [],
    serverId: ""
  };
  var retroChangelog_default = RetroChangelog;

  // src/lib/plugins/rootDNAccessControl.jsx
  var import_react33 = __toESM(require_react(), 1);
  var import_prop_types18 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
  var _17 = cockpit_default.gettext;
  var RootDNAccessControl = class extends import_react33.default.Component {
    componentDidMount(prevProps) {
      this.updateFields();
    }
    componentDidUpdate(prevProps) {
      if (this.props.rows !== prevProps.rows) {
        this.updateFields();
      }
    }
    constructor(props) {
      super(props);
      this.state = {
        saving: false,
        saveBtnDisabled: true,
        error: {},
        // Settings
        allowHost: [],
        allowHostOptions: [],
        denyHost: [],
        denyHostOptions: [],
        allowIP: [],
        allowIPOptions: [],
        denyIP: [],
        denyIPOptions: [],
        openTime: "0000",
        closeTime: "1159",
        daysAllowed: "",
        allowMon: false,
        allowTue: false,
        allowWed: false,
        allowThu: false,
        allowFri: false,
        allowSat: false,
        allowSun: false,
        // original values
        _allowHost: [],
        _denyHost: [],
        _allowIP: [],
        _denyIP: [],
        _openTime: "00:00",
        _closeTime: "23:59",
        _daysAllowed: "",
        _allowMon: false,
        _allowTue: false,
        _allowWed: false,
        _allowThu: false,
        _allowFri: false,
        _allowSat: false,
        _allowSun: false,
        // Typeahead state
        isAllowHostOpen: false,
        isDenyHostOpen: false,
        isAllowIPOpen: false,
        isDenyIPOpen: false
      };
      this.handleAllowHostSelect = (event, selection) => {
        this.setState({
          allowHost: Array.isArray(selection) ? selection : []
        });
      };
      this.handleAllowHostToggle = (_event, isAllowHostOpen) => {
        this.setState({
          isAllowHostOpen
        });
      };
      this.handleAllowHostClear = () => {
        this.setState({
          allowHost: [],
          isAllowHostOpen: false
        });
      };
      this.handleAllowHostCreateOption = (newValue) => {
        if (!this.state.allowHostOptions.includes(newValue)) {
          this.setState({
            allowHostOptions: [...this.state.allowHostOptions, newValue],
            isAllowHostOpen: false
          });
        }
      };
      this.handleDenyHostSelect = (event, selection) => {
        this.setState({
          denyHost: Array.isArray(selection) ? selection : []
        });
      };
      this.handleDenyHostToggle = (_event, isDenyHostOpen) => {
        this.setState({
          isDenyHostOpen
        });
      };
      this.handleDenyHostClear = () => {
        this.setState({
          denyHost: [],
          isDenyHostOpen: false
        });
      };
      this.handleDenyHostCreateOption = (newValue) => {
        if (!this.state.denyHostOptions.includes(newValue)) {
          this.setState({
            denyHostOptions: [...this.state.denyHostOptions, newValue],
            isDenyHostOpen: false
          });
        }
      };
      this.handleAllowIPSelect = (event, selection) => {
        this.setState({
          allowIP: Array.isArray(selection) ? selection : []
        });
      };
      this.handleAllowIPToggle = (_event, isAllowIPOpen) => {
        this.setState({
          isAllowIPOpen
        });
      };
      this.handleAllowIPClear = () => {
        this.setState({
          allowIP: [],
          isAllowIPOpen: false
        });
      };
      this.handleAllowIPCreateOption = (newValue) => {
        if (!this.state.allowIPOptions.includes(newValue)) {
          this.setState({
            allowIPOptions: [...this.state.allowIPOptions, newValue],
            isAllowIPOpen: false
          });
        }
      };
      this.handleDenyIPSelect = (event, selection) => {
        this.setState({
          denyIP: Array.isArray(selection) ? selection : []
        });
      };
      this.handleDenyIPToggle = (_event, isDenyIPOpen) => {
        this.setState({
          isDenyIPOpen
        });
      };
      this.handleDenyIPClear = () => {
        this.setState({
          denyIP: [],
          isDenyIPOpen: false
        });
      };
      this.handleDenyIPCreateOption = (newValue) => {
        if (!this.state.denyIPOptions.includes(newValue)) {
          this.setState({
            denyIPOptions: [...this.state.denyIPOptions, newValue],
            isDenyIPOpen: false
          });
        }
      };
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.handleTimeChange = this.handleTimeChange.bind(this);
      this.handleSavePlugin = this.handleSavePlugin.bind(this);
      this.updateFields = this.updateFields.bind(this);
      this.validate = this.validate.bind(this);
    }
    validate() {
      const errObj = {};
      let all_good = false;
      const dayAttrs = [
        "allowMon",
        "allowTue",
        "allowWed",
        "allowThu",
        "allowFri",
        "allowSat",
        "allowSun"
      ];
      for (const check_attr of dayAttrs) {
        if (this.state[check_attr]) {
          all_good = true;
          break;
        }
      }
      if (!all_good) {
        errObj.daysAllowed = true;
      } else {
        all_good = false;
        const attrLists = [
          "allowHost",
          "denyHost",
          "allowIP",
          "denyIP"
        ];
        for (const check_attr of attrLists) {
          if (!listsEqual(this.state[check_attr], this.state["_" + check_attr])) {
            all_good = true;
            break;
          }
        }
        const attrs = [
          "openTime",
          "closeTime",
          "allowMon",
          "allowTue",
          "allowWed",
          "allowThu",
          "allowFri",
          "allowSat",
          "allowSun"
        ];
        for (const check_attr of attrs) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            all_good = true;
            break;
          }
        }
      }
      this.setState({
        saveBtnDisabled: !all_good,
        error: errObj
      });
    }
    handleFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validate();
      });
    }
    handleTimeChange(id, time_str) {
      const time_val = time_str.replace(":", "");
      this.setState({
        [id]: time_val
      }, () => {
        this.validate();
      });
    }
    updateFields() {
      let allowHostList = [];
      let denyHostList = [];
      let allowIPList = [];
      let denyIPList = [];
      const daysAllowed = {};
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find((row) => row.cn[0] === "RootDN Access Control");
        if (pluginRow["rootdn-allow-host"] !== void 0) {
          for (const value of pluginRow["rootdn-allow-host"]) {
            allowHostList = [...allowHostList, value];
          }
        }
        if (pluginRow["rootdn-deny-host"] !== void 0) {
          for (const value of pluginRow["rootdn-deny-host"]) {
            denyHostList = [...denyHostList, value];
          }
        }
        if (pluginRow["rootdn-allow-ip"] !== void 0) {
          for (const value of pluginRow["rootdn-allow-ip"]) {
            allowIPList = [...allowIPList, value];
          }
        }
        if (pluginRow["rootdn-deny-ip"] !== void 0) {
          for (const value of pluginRow["rootdn-deny-ip"]) {
            denyIPList = [...denyIPList, value];
          }
        }
        if (pluginRow["rootdn-days-allowed"] !== void 0) {
          const daysStr = pluginRow["rootdn-days-allowed"][0].toLowerCase();
          for (const day of ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]) {
            if (daysStr.includes(day.toLowerCase())) {
              daysAllowed["allow" + day] = true;
              daysAllowed["_allow" + day] = true;
            }
          }
        }
        let openTime = "00:00";
        if (pluginRow["rootdn-open-time"] !== void 0) {
          const openHour = pluginRow["rootdn-open-time"][0].substring(0, 2);
          const openMin = pluginRow["rootdn-open-time"][0].substring(2, 4);
          openTime = openHour + ":" + openMin;
        }
        let closeTime = "11:59";
        if (pluginRow["rootdn-close-time"] !== void 0) {
          const closeHour = pluginRow["rootdn-close-time"][0].substring(0, 2);
          const closeMin = pluginRow["rootdn-close-time"][0].substring(2, 4);
          closeTime = closeHour + ":" + closeMin;
        }
        this.setState({
          openTime,
          closeTime,
          daysAllowed,
          denyIP: denyIPList,
          allowIP: allowIPList,
          denyHost: denyHostList,
          allowHost: allowHostList,
          ...daysAllowed,
          _openTime: pluginRow["rootdn-open-time"] === void 0 ? "" : pluginRow["rootdn-open-time"][0],
          _closeTime: pluginRow["rootdn-close-time"] === void 0 ? "" : pluginRow["rootdn-close-time"][0],
          _daysAllowed: daysAllowed,
          _denyIP: denyIPList,
          _allowIP: allowIPList,
          _denyHost: denyHostList,
          _allowHost: allowHostList
        });
      }
    }
    handleSavePlugin() {
      let daysAllowed = "";
      for (const day of ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]) {
        if (this.state["allow" + day]) {
          daysAllowed += day + ",";
        }
      }
      daysAllowed = daysAllowed.substring(0, daysAllowed.length - 1);
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "root-dn",
        "set",
        "--open-time",
        this.state.openTime.replace(":", "") || "delete",
        "--close-time",
        this.state.closeTime.replace(":", "") || "delete",
        "--days-allowed",
        daysAllowed || "delete"
      ];
      cmd = [...cmd, "--allow-host"];
      if (this.state.allowHost.length !== 0) {
        for (const value of this.state.allowHost) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--deny-host"];
      if (this.state.denyHost.length !== 0) {
        for (const value of this.state.denyHost) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--allow-ip"];
      if (this.state.allowIP.length !== 0) {
        for (const value of this.state.allowIP) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      cmd = [...cmd, "--allow-host"];
      if (this.state.allowHost.length !== 0) {
        for (const value of this.state.allowHost) {
          cmd = [...cmd, value];
        }
      } else {
        cmd = [...cmd, "delete"];
      }
      this.setState({
        saving: true
      });
      log_cmd("handleSavePlugin", "Update Root DN access control", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          _17("Successfully updated the RootDN Access Control")
        );
        this.props.pluginListHandler();
        this.setState({
          saving: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_17("Failed to update RootDN Access Control Plugin - $0"), errMsg)
        );
        this.props.pluginListHandler();
        this.setState({
          saving: false
        });
      });
    }
    render() {
      const {
        allowHost,
        denyHost,
        allowIP,
        denyIP,
        openTime,
        closeTime,
        allowMon,
        allowTue,
        allowWed,
        allowThu,
        allowFri,
        allowSat,
        allowSun,
        error,
        saveBtnDisabled,
        saving
      } = this.state;
      let saveBtnName = _17("Save");
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = _17("Saving ...");
        extraPrimaryProps.spinnerAriaValueText = _17("Saving");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: saving ? "ds-disabled" : "", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
        pluginBasicConfig_default,
        {
          rows: this.props.rows,
          serverId: this.props.serverId,
          cn: "RootDN Access Control",
          pluginName: "RootDN Access Control",
          cmdName: "root-dn",
          savePluginHandler: this.props.savePluginHandler,
          pluginListHandler: this.props.pluginListHandler,
          addNotification: this.props.addNotification,
          toggleLoadingHandler: this.props.toggleLoadingHandler,
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Grid, { title: _17("Sets what hosts, by fully-qualified domain name, the root user is allowed to use to access the Directory Server. Wildcards are accepted. Any hosts not listed are implicitly denied (rootdn-allow-host)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { className: "ds-label", span: 2, children: _17("Allow Host") }),
                /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: allowHost,
                    onSelect: this.handleAllowHostSelect,
                    onClear: this.handleAllowHostClear,
                    options: this.state.allowHostOptions,
                    isOpen: this.state.isAllowHostOpen,
                    onToggle: this.handleAllowHostToggle,
                    placeholder: _17("Type a hostname ..."),
                    noResultsText: _17("There are no matching entries"),
                    ariaLabel: "Type a hostname ",
                    isMulti: true,
                    isCreatable: true,
                    onCreateOption: this.handleAllowHostCreateOption
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Grid, { title: _17("Sets what hosts, by fully-qualified domain name, the root user is not allowed to use to access the Directory Server.  Wildcards are accepted.  Any hosts not listed are implicitly allowed (rootdn-deny-host). If a host address is listed in both the rootdn-allow-host and rootdn-deny-host attributes, it is denied access."), children: [
                /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { className: "ds-label", span: 2, children: _17("Deny Host") }),
                /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: denyHost,
                    onSelect: this.handleDenyHostSelect,
                    onClear: this.handleDenyHostClear,
                    options: this.state.denyHostOptions,
                    isOpen: this.state.isDenyHostOpen,
                    onToggle: this.handleDenyHostToggle,
                    placeholder: _17("Type a hostname ..."),
                    noResultsText: _17("There are no matching entries"),
                    ariaLabel: "Type a hostname ",
                    isMulti: true,
                    isCreatable: true,
                    onCreateOption: this.handleDenyHostCreateOption
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Grid, { title: _17("Sets what IP addresses, either IPv4 or IPv6, for machines the root user is allowed to use to access the Directory Server. Wildcards are accepted.  Any IP addresses not listed are implicitly denied (rootdn-allow-ip)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { className: "ds-label", span: 2, children: _17("Allow IP address") }),
                /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: allowIP,
                    onSelect: this.handleAllowIPSelect,
                    onClear: this.handleAllowIPClear,
                    options: this.state.allowIPOptions,
                    isOpen: this.state.isAllowIPOpen,
                    onToggle: this.handleAllowIPToggle,
                    placeholder: _17("Type an IP address ..."),
                    noResultsText: _17("There are no matching entries"),
                    ariaLabel: "Type an IP address",
                    isMulti: true,
                    isCreatable: true,
                    onCreateOption: this.handleAllowIPCreateOption
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Grid, { title: _17("Sets what IP addresses, either IPv4 or IPv6, for machines the root user is not allowed to use to access the Directory Server. Wildcards are accepted. Any IP addresses not listed are implicitly allowed (rootdn-deny-ip) If an IP address is listed in both the rootdn-allow-ip and rootdn-deny-ip attributes, it is denied access."), children: [
                /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { className: "ds-label", span: 2, children: _17("Deny IP address") }),
                /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: denyIP,
                    onSelect: this.handleDenyIPSelect,
                    onClear: this.handleDenyIPClear,
                    options: this.state.denyIPOptions,
                    isOpen: this.state.isDenyIPOpen,
                    onToggle: this.handleDenyIPToggle,
                    placeholder: _17("Type an IP address ..."),
                    noResultsText: _17("There are no matching entries"),
                    ariaLabel: "Type an IP address",
                    isMulti: true,
                    isCreatable: true,
                    onCreateOption: this.handleDenyIPCreateOption
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Grid, { title: _17("Sets part of a time period or range when the root user is allowed to access the Directory Server. This sets when the time-based access begins (rootdn-open-time)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { className: "ds-label", span: 2, children: _17("Open Time") }),
                /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
                  TimePicker,
                  {
                    time: openTime,
                    onChange: (_event, time2, hour, min3, seconds2, isValid) => {
                      this.handleTimeChange("openTime", time2);
                    },
                    is24Hour: true
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Grid, { title: _17("Sets part of a time period or range when the root user is allowed to access the Directory Server. This sets when the time-based access ends (rootdn-close-time)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { className: "ds-label", span: 2, children: _17("Close Time") }),
                /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
                  TimePicker,
                  {
                    time: closeTime,
                    onChange: (_event, time2, hour, min3, seconds2, isValid) => {
                      this.handleTimeChange("closeTime", time2);
                    },
                    is24Hour: true
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Grid, { title: _17("Gives a comma-separated list of what days the root user is allowed to use to access the Directory Server. Any days listed are implicitly denied (rootdn-days-allowed)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { span: 12, className: "ds-label", children: _17("Days To Allow Access") }),
                /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(GridItem, { className: "ds-margin-left", span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
                      Checkbox,
                      {
                        id: "allowMon",
                        onChange: (e, checked) => {
                          this.handleFieldChange(e);
                        },
                        name,
                        isChecked: allowMon,
                        label: _17("Monday")
                      }
                    ) }),
                    /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
                      Checkbox,
                      {
                        id: "allowFri",
                        onChange: (e, checked) => {
                          this.handleFieldChange(e);
                        },
                        name,
                        isChecked: allowFri,
                        label: _17("Friday")
                      }
                    ) })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Grid, { className: "ds-margin-top", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
                      Checkbox,
                      {
                        id: "allowTue",
                        onChange: (e, checked) => {
                          this.handleFieldChange(e);
                        },
                        name,
                        isChecked: allowTue,
                        label: _17("Tuesday")
                      }
                    ) }),
                    /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
                      Checkbox,
                      {
                        id: "allowSat",
                        onChange: (e, checked) => {
                          this.handleFieldChange(e);
                        },
                        name,
                        isChecked: allowSat,
                        label: _17("Saturday")
                      }
                    ) })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Grid, { className: "ds-margin-top", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
                      Checkbox,
                      {
                        id: "allowWed",
                        onChange: (e, checked) => {
                          this.handleFieldChange(e);
                        },
                        name,
                        isChecked: allowWed,
                        label: _17("Wednesday")
                      }
                    ) }),
                    /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
                      Checkbox,
                      {
                        id: "allowSun",
                        onChange: (e, checked) => {
                          this.handleFieldChange(e);
                        },
                        name,
                        isChecked: allowSun,
                        label: _17("Sunday")
                      }
                    ) })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
                    Checkbox,
                    {
                      id: "allowThu",
                      onChange: (e, checked) => {
                        this.handleFieldChange(e);
                      },
                      name,
                      isChecked: allowThu,
                      label: _17("Thursday")
                    }
                  ) }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormHelperText, { children: _17("You must set at least one day") })
                ] })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
              Button,
              {
                className: "ds-margin-top-lg",
                variant: "primary",
                onClick: this.handleSavePlugin,
                isDisabled: saveBtnDisabled || saving,
                isLoading: saving,
                spinnerAriaValueText: saving ? _17("Saving") : void 0,
                ...extraPrimaryProps,
                children: saveBtnName
              }
            )
          ]
        }
      ) });
    }
  };
  RootDNAccessControl.propTypes = {
    rows: import_prop_types18.default.array,
    serverId: import_prop_types18.default.string,
    savePluginHandler: import_prop_types18.default.func,
    pluginListHandler: import_prop_types18.default.func,
    addNotification: import_prop_types18.default.func,
    toggleLoadingHandler: import_prop_types18.default.func
  };
  RootDNAccessControl.defaultProps = {
    rows: [],
    serverId: ""
  };
  var rootDNAccessControl_default = RootDNAccessControl;

  // src/lib/plugins/usn.jsx
  var import_react34 = __toESM(require_react(), 1);
  var import_prop_types19 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
  var _18 = cockpit_default.gettext;
  var USNPlugin = class extends import_react34.default.Component {
    componentDidMount() {
      if (this.props.wasActiveList.includes(5)) {
        if (this.state.firstLoad) {
          this.loadSuffixList();
          this.updateSwitch();
        }
      }
    }
    constructor(props) {
      super(props);
      this.handleRunCleanup = this.handleRunCleanup.bind(this);
      this.handleToggleCleanupModal = this.handleToggleCleanupModal.bind(this);
      this.updateSwitch = this.updateSwitch.bind(this);
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.loadSuffixList = this.loadSuffixList.bind(this);
      this.state = {
        firstLoad: true,
        globalMode: false,
        disableSwitch: false,
        cleanupModalShow: false,
        cleanupSuffix: "",
        cleanupMaxUSN: 0,
        suffixList: [],
        pluginEnabled: false
      };
      this.minValue = 0;
      this.maxValue = 2e7;
      this.handleMinusConfig = () => {
        this.setState({
          cleanupMaxUSN: Number(this.state.cleanupMaxUSN) - 1
        });
      };
      this.handleConfigChange = (event) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          cleanupMaxUSN: newValue > this.maxValue ? this.maxValue : newValue < this.minValue ? this.minValue : newValue
        });
      };
      this.handlePlusConfig = (id) => {
        this.setState({
          cleanupMaxUSN: Number(this.state.cleanupMaxUSN) + 1
        });
      };
    }
    loadSuffixList() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "suffix",
        "list",
        "--suffix"
      ];
      log_cmd("loadSuffixList", "Get a list of all the suffixes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const suffixList = JSON.parse(content);
        this.setState({
          suffixList: suffixList.items,
          cleanupSuffix: suffixList.items[0]
        });
      });
    }
    handleFieldChange(e) {
      this.setState({
        [e.target.id]: e.target.value
      });
    }
    handleSwitchChange(value) {
      const { serverId, addNotification, toggleLoadingHandler } = this.props;
      const new_status = this.state.globalMode ? "off" : "on";
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
        "plugin",
        "usn",
        "global",
        new_status
      ];
      toggleLoadingHandler();
      this.setState({ disableSwitch: true });
      log_cmd("handleSwitchChange", "Switch global USN mode from the USN plugin tab", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        console.info("savePlugin", "Result", content);
        this.updateSwitch();
        addNotification(
          "success",
          cockpit_default.format(_18("Global USN mode was successfully set to $0."), new_status)
        );
        toggleLoadingHandler();
        this.setState({ disableSwitch: false });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        addNotification(
          "error",
          cockpit_default.format(_18("Error during global USN mode modification - $0"), errMsg)
        );
        toggleLoadingHandler();
        this.setState({ disableSwitch: false });
      });
    }
    updateSwitch() {
      this.setState({
        firstLoad: false,
        disableSwitch: true
      });
      const pluginRow = this.props.rows.find((row) => row.cn[0] === "USN");
      let pluginEnabled = false;
      if (pluginRow["nsslapd-pluginEnabled"][0] === "on") {
        pluginEnabled = true;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get",
        "nsslapd-entryusn-global"
      ];
      this.props.toggleLoadingHandler();
      log_cmd("updateSwitch", "Get global USN status", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const usnGlobalAttr = myObject.attrs["nsslapd-entryusn-global"][0];
        this.setState({
          globalMode: !(usnGlobalAttr === "off"),
          pluginEnabled,
          disableSwitch: false
        });
        this.props.toggleLoadingHandler();
      }).fail((err) => {
        if (err !== 0) {
          const errMsg = getApiErrorMessage(err);
          console.log("Get global USN failed", errMsg);
        }
        this.setState({
          disableSwitch: false
        });
        this.props.toggleLoadingHandler();
      });
    }
    handleToggleCleanupModal() {
      this.setState((prevState) => ({
        cleanupModalShow: !prevState.cleanupModalShow,
        cleanupSuffix: prevState.suffixList[0],
        cleanupMaxUSN: 0
      }));
    }
    handleRunCleanup() {
      if (!this.state.cleanupSuffix) {
        this.props.addNotification("warning", _18("Suffix is required."));
      } else {
        let cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "plugin",
          "usn",
          "cleanup"
        ];
        if (this.state.cleanupSuffix) {
          cmd = [...cmd, "--suffix=" + this.state.cleanupSuffix];
        }
        if (this.state.cleanupMaxUSN > 0) {
          cmd = [...cmd, "--max-usn=" + this.state.cleanupMaxUSN];
        }
        this.props.toggleLoadingHandler();
        log_cmd("handleRunCleanup", "Run cleanup USN tombstones", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          this.props.addNotification(
            "success",
            _18("Cleanup USN Tombstones task was successful")
          );
          this.props.toggleLoadingHandler();
          this.setState({
            cleanupModalShow: false
          });
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.addNotification(
            "error",
            cockpit_default.format(_18("Cleanup USN Tombstones task has failed $0"), errMsg)
          );
          this.props.toggleLoadingHandler();
          this.setState({
            cleanupModalShow: false
          });
        });
      }
    }
    render() {
      const {
        globalMode,
        disableSwitch,
        cleanupModalShow,
        cleanupSuffix,
        cleanupMaxUSN,
        suffixList
      } = this.state;
      return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
          Modal,
          {
            variant: ModalVariant.small,
            title: _18("USN Tombstone Cleanup Task"),
            "aria-labelledby": "ds-modal",
            isOpen: cleanupModalShow,
            onClose: this.handleToggleCleanupModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { variant: "primary", onClick: this.handleRunCleanup, children: _18("Run") }, "confirm"),
              /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { variant: "link", onClick: this.handleToggleCleanupModal, children: _18("Cancel") }, "cancel")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Grid, { title: _18("Gives the suffix in the Directory Server to run the cleanup operation against"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(GridItem, { span: 4, children: _18("Cleanup Suffix") }),
                /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
                  FormSelect,
                  {
                    id: "configAutoAddOC",
                    value: cleanupSuffix,
                    onChange: (event, value) => {
                      this.handleFieldChange(event);
                    },
                    "aria-label": "FormSelect Input",
                    children: suffixList.map((attr) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FormSelectOption, { value: attr, label: attr }, attr))
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Grid, { title: _18("Gives the highest USN value to delete when removing tombstone entries. All tombstone entries up to and including that number are deleted. Tombstone entries with higher USN values (that means more recent entries) are not deleted"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(GridItem, { span: 4, children: _18("Cleanup Max USN") }),
                /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
                  NumberInput,
                  {
                    value: cleanupMaxUSN,
                    min: this.minValue,
                    max: this.maxValue,
                    onMinus: this.handleMinusConfig,
                    onChange: this.handleConfigChange,
                    onPlus: this.handlePlusConfig,
                    inputName: "input",
                    inputAriaLabel: "number input",
                    minusBtnAriaLabel: "minus",
                    plusBtnAriaLabel: "plus",
                    widthChars: 10
                  }
                ) })
              ] })
            ] })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
          pluginBasicConfig_default,
          {
            rows: this.props.rows,
            serverId: this.props.serverId,
            cn: "USN",
            pluginName: "Update Sequence Numbers",
            cmdName: "usn",
            savePluginHandler: this.props.savePluginHandler,
            pluginListHandler: this.props.pluginListHandler,
            addNotification: this.props.addNotification,
            toggleLoadingHandler: this.props.toggleLoadingHandler,
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
                Tooltip,
                {
                  maxWidth: 500,
                  content: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
                    _18("The USN Plug-in enables LDAP clients and servers to identify if entries have been changed. When the USN Plug-in is enabled, update sequence numbers (USNs) are sequential numbers that are assigned to an entry whenever a write operation is performed against the entry. (Write operations include add, modify, modrdn, and delete operations. Internal database operations, like export operations, are not counted in the update sequence.) A USN counter keeps track of the most recently assigned USN."),
                    /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("br", {}),
                    /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("br", {}),
                    _18("The USN plug-in also moves entries to tombstone entries when the entry is deleted. If replication is enabled, then separate tombstone entries are kept by both the USN and Replication plug-in. Note that both tombstone entries are deleted by the replication process.")
                  ] }),
                  children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("a", { className: "ds-font-size-sm", children: _18("What is the USN Plugin?") })
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Form, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Grid, { className: "ds-margin-top-xlg", title: _18("Enable entryUSN assignment across all backends, instead of per backend."), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(GridItem, { span: 3, className: "ds-label", children: _18("USN Global") }),
                  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
                    Switch,
                    {
                      id: "globalMode",
                      label: _18("Configuration is enabled"),
                      labelOff: _18("Configuration is disabled"),
                      isChecked: globalMode,
                      onChange: () => this.handleSwitchChange(globalMode),
                      isDisabled: disableSwitch
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Grid, { title: _18("This task deletes the tombstone entries maintained by the USN plugin.  This task should not run against a suffix that is being replicated"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(GridItem, { className: "ds-label ds-margin-top", span: 3, children: [
                    _18("Tombstone Cleanup Task"),
                    /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(WrenchIcon, { className: "ds-left-margin" })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { className: "ds-margin-top", variant: "primary", isDisabled: !this.state.pluginEnabled, onClick: this.handleToggleCleanupModal, children: _18("Run Task") }) })
                ] })
              ] })
            ]
          }
        )
      ] });
    }
  };
  USNPlugin.propTypes = {
    rows: import_prop_types19.default.array,
    serverId: import_prop_types19.default.string,
    savePluginHandler: import_prop_types19.default.func,
    pluginListHandler: import_prop_types19.default.func,
    addNotification: import_prop_types19.default.func,
    toggleLoadingHandler: import_prop_types19.default.func
  };
  USNPlugin.defaultProps = {
    rows: [],
    serverId: ""
  };
  var usn_default = USNPlugin;

  // src/lib/plugins/winsync.jsx
  var import_react35 = __toESM(require_react(), 1);
  var import_prop_types20 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
  var _19 = cockpit_default.gettext;
  var WinSync = class extends import_react35.default.Component {
    componentDidMount(prevProps) {
      this.updateFields();
    }
    componentDidUpdate(prevProps) {
      if (this.props.rows !== prevProps.rows) {
        this.updateFields();
      }
    }
    constructor(props) {
      super(props);
      this.state = {
        fixupModalShow: false,
        fixupDN: "",
        fixupFilter: "",
        saveBtnDisabled: true,
        saveBtnDisabledModal: true,
        saving: false,
        savingModal: false,
        error: {},
        // Settings
        posixWinsyncCreateMemberOfTask: false,
        posixWinsyncLowerCaseUID: false,
        posixWinsyncMapMemberUID: false,
        posixWinsyncMapNestedGrouping: false,
        posixWinsyncMsSFUSchema: false,
        // Original values
        _posixWinsyncCreateMemberOfTask: false,
        _posixWinsyncLowerCaseUID: false,
        _posixWinsyncMapMemberUID: false,
        _posixWinsyncMapNestedGrouping: false,
        _posixWinsyncMsSFUSchema: false
      };
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.handleModalChange = this.handleModalChange.bind(this);
      this.updateFields = this.updateFields.bind(this);
      this.handleRunFixup = this.handleRunFixup.bind(this);
      this.handleToggleFixupModal = this.handleToggleFixupModal.bind(this);
      this.validateConfig = this.validateConfig.bind(this);
      this.validateModal = this.validateModal.bind(this);
      this.handleSavePlugin = this.handleSavePlugin.bind(this);
    }
    handleToggleFixupModal() {
      this.setState((prevState) => ({
        fixupModalShow: !prevState.fixupModalShow,
        fixupDN: "",
        fixupFilter: "",
        savingModal: false
      }));
    }
    handleRunFixup() {
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "posix-winsync",
        "fixup",
        this.state.fixupDN
      ];
      if (this.state.fixupFilter) {
        cmd = [...cmd, "--filter", this.state.fixupFilter];
      }
      this.setState({
        savingModal: true
      });
      log_cmd("handleRunFixup", "Run Member UID task", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        this.props.addNotification(
          "success",
          cockpit_default.format(_19("Fixup task for $0 was successfully started"), this.state.fixupDN)
        );
        this.setState({
          fixupModalShow: false,
          savingModal: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_19("Fixup task for $0 has failed $1"), this.state.fixupDN, errMsg)
        );
        this.setState({
          fixupModalShow: false,
          savingModal: false
        });
      });
    }
    validateConfig() {
      let all_good = false;
      const attrs = [
        "posixWinsyncCreateMemberOfTask",
        "posixWinsyncLowerCaseUID",
        "posixWinsyncMapMemberUID",
        "posixWinsyncMapNestedGrouping",
        "posixWinsyncMsSFUSchema"
      ];
      for (const check_attr of attrs) {
        if (this.state[check_attr] !== this.state["_" + check_attr]) {
          all_good = true;
          break;
        }
      }
      this.setState({
        saveBtnDisabled: !all_good
      });
    }
    validateModal() {
      const errObj = {};
      let all_good = true;
      if (!valid_dn(this.state.fixupDN)) {
        all_good = false;
        errObj.fixupDN = true;
      }
      if (this.state.fixupFilter === "") {
        all_good = false;
        errObj.fixupFilter = true;
      }
      this.setState({
        saveBtnDisabledModal: !all_good,
        error: errObj
      });
    }
    handleFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validateConfig();
      });
    }
    handleModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validateModal();
      });
    }
    updateFields() {
      if (this.props.rows.length > 0) {
        const pluginRow = this.props.rows.find((row) => row.cn[0] === "Posix Winsync API");
        this.setState({
          posixWinsyncCreateMemberOfTask: !(pluginRow.posixwinsynccreatememberoftask === void 0 || pluginRow.posixwinsynccreatememberoftask[0] === "false"),
          posixWinsyncLowerCaseUID: !(pluginRow.posixwinsynclowercaseuid === void 0 || pluginRow.posixwinsynclowercaseuid[0] === "false"),
          posixWinsyncMapMemberUID: !(pluginRow.posixwinsyncmapmemberuid === void 0 || pluginRow.posixwinsyncmapmemberuid[0] === "false"),
          posixWinsyncMapNestedGrouping: !(pluginRow.posixwinsyncmapnestedgrouping === void 0 || pluginRow.posixwinsyncmapnestedgrouping[0] === "false"),
          posixWinsyncMsSFUSchema: !(pluginRow.posixwinsyncmssfuschema === void 0 || pluginRow.posixwinsyncmssfuschema[0] === "false"),
          _posixWinsyncCreateMemberOfTask: !(pluginRow.posixwinsynccreatememberoftask === void 0 || pluginRow.posixwinsynccreatememberoftask[0] === "false"),
          _posixWinsyncLowerCaseUID: !(pluginRow.posixwinsynclowercaseuid === void 0 || pluginRow.posixwinsynclowercaseuid[0] === "false"),
          _posixWinsyncMapMemberUID: !(pluginRow.posixwinsyncmapmemberuid === void 0 || pluginRow.posixwinsyncmapmemberuid[0] === "false"),
          _posixWinsyncMapNestedGrouping: !(pluginRow.posixwinsyncmapnestedgrouping === void 0 || pluginRow.posixwinsyncmapnestedgrouping[0] === "false"),
          _posixWinsyncMsSFUSchema: !(pluginRow.posixwinsyncmssfuschema === void 0 || pluginRow.posixwinsyncmssfuschema[0] === "false")
        });
      }
    }
    handleSavePlugin() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "posix-winsync",
        "set",
        "--create-memberof-task",
        this.state.posixWinsyncCreateMemberOfTask ? "true" : "false",
        "--lower-case-uid",
        this.state.posixWinsyncLowerCaseUID ? "true" : "false",
        "--map-member-uid",
        this.state.posixWinsyncMapMemberUID ? "true" : "false",
        "--map-nested-grouping",
        this.state.posixWinsyncMapNestedGrouping ? "true" : "false",
        "--ms-sfu-schema",
        this.state.posixWinsyncMsSFUSchema ? "true" : "false"
      ];
      this.setState({
        saving: true
      });
      log_cmd("handleSavePlugin", "Update Posix winsync plugin", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          _19("Successfully updated Posix winsync plugin")
        );
        this.props.pluginListHandler();
        this.setState({
          saving: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_19("Failed to update Posix winsync plugin - $0"), errMsg)
        );
        this.props.pluginListHandler();
        this.setState({
          saving: false
        });
      });
    }
    render() {
      const {
        posixWinsyncCreateMemberOfTask,
        posixWinsyncLowerCaseUID,
        posixWinsyncMapMemberUID,
        posixWinsyncMapNestedGrouping,
        posixWinsyncMsSFUSchema,
        fixupModalShow,
        fixupDN,
        fixupFilter,
        saving,
        savingModal,
        saveBtnDisabled,
        saveBtnDisabledModal,
        error
      } = this.state;
      let saveBtnName = _19("Save");
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = _19("Saving ...");
        extraPrimaryProps.spinnerAriaValueText = _19("Saving");
      }
      const saveBtnNameModal = _19("Run Task");
      if (savingModal) {
        saveBtnName = _19("Task running ...");
        extraPrimaryProps.spinnerAriaValueText = _19("Saving");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: saving || savingModal ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
          Modal,
          {
            variant: ModalVariant.small,
            title: _19("MemberOf Task"),
            isOpen: fixupModalShow,
            "aria-labelledby": "ds-modal",
            onClose: this.handleToggleFixupModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleRunFixup,
                  isDisabled: saveBtnDisabledModal || savingModal,
                  isLoading: savingModal,
                  spinnerAriaValueText: savingModal ? _19("Saving") : void 0,
                  ...extraPrimaryProps,
                  children: saveBtnNameModal
                },
                "task"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { variant: "link", onClick: this.handleToggleFixupModal, children: _19("Cancel") }, "cancel")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Grid, { title: _19("Base DN that contains entries to fix up"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(GridItem, { className: "ds-label", span: 3, children: _19("Base DN") }),
                /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
                    TextInput,
                    {
                      value: fixupDN,
                      type: "text",
                      id: "fixupDN",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "fixupDN",
                      onChange: (e, str) => {
                        this.handleModalChange(e);
                      },
                      validated: error.fixupDN ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FormHelperText, { children: _19("Value must be a valid DN") })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Grid, { className: "ds-margin-top", title: _19("Filter for entries to fix up. If omitted, all entries with objectclass inetuser/inetadmin/nsmemberof under the specified base will have their memberOf attribute regenerated."), children: [
                /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(GridItem, { className: "ds-label", span: 3, children: _19("Filter DN") }),
                /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
                    TextInput,
                    {
                      value: fixupFilter,
                      type: "text",
                      id: "fixupFilter",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "fixupFilter",
                      onChange: (e, str) => {
                        this.handleModalChange(e);
                      },
                      validated: error.fixupFilter ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FormHelperText, { children: _19("Enter an LDAP search filter") })
                ] })
              ] })
            ] })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
          pluginBasicConfig_default,
          {
            rows: this.props.rows,
            serverId: this.props.serverId,
            cn: "Posix Winsync API",
            pluginName: "Posix Winsync API",
            cmdName: "posix-winsync",
            savePluginHandler: this.props.savePluginHandler,
            pluginListHandler: this.props.pluginListHandler,
            addNotification: this.props.addNotification,
            toggleLoadingHandler: this.props.toggleLoadingHandler,
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
                /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Grid, { title: _19("Sets whether to run the memberOf fix-up task immediately after a sync run in order to update group memberships for synced users"), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
                  Checkbox,
                  {
                    id: "posixWinsyncCreateMemberOfTask",
                    isChecked: posixWinsyncCreateMemberOfTask,
                    onChange: (e, checked) => {
                      this.handleFieldChange(e);
                    },
                    label: _19("Create MemberOf Task")
                  }
                ) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Grid, { title: _19("Sets whether to store (and, if necessary, convert) the UID value in the memberUID attribute in lower case"), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
                  Checkbox,
                  {
                    id: "posixWinsyncLowerCaseUID",
                    isChecked: posixWinsyncLowerCaseUID,
                    onChange: (e, checked) => {
                      this.handleFieldChange(e);
                    },
                    label: _19("Lower Case UID")
                  }
                ) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Grid, { title: _19("Sets whether to map the memberUID attribute in an Active Directory group to the uniqueMember attribute in a Directory Server group"), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
                  Checkbox,
                  {
                    id: "posixWinsyncMapMemberUID",
                    isChecked: posixWinsyncMapMemberUID,
                    onChange: (e, checked) => {
                      this.handleFieldChange(e);
                    },
                    label: _19("Map Member UID")
                  }
                ) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Grid, { title: _19("Manages if nested groups are updated when memberUID attributes in an Active Directory POSIX group change"), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
                  Checkbox,
                  {
                    id: "posixWinsyncMapNestedGrouping",
                    isChecked: posixWinsyncMapNestedGrouping,
                    onChange: (e, checked) => {
                      this.handleFieldChange(e);
                    },
                    label: _19("Map Nested Grouping")
                  }
                ) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Grid, { title: _19("Sets whether to the older Microsoft System Services  for Unix 3.0 (msSFU30) schema when syncing Posix attributes from Active Directory"), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
                  Checkbox,
                  {
                    id: "posixWinsyncMsSFUSchema",
                    isChecked: posixWinsyncMsSFUSchema,
                    onChange: (e, checked) => {
                      this.handleFieldChange(e);
                    },
                    label: _19("Microsoft System Services for Unix 3.0 (msSFU30) schema")
                  }
                ) }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
                Button,
                {
                  className: "ds-margin-top-lg",
                  variant: "primary",
                  onClick: this.handleToggleFixupModal,
                  title: _19("Corrects mismatched member and uniquemember values"),
                  children: _19("Run MemberOf Task")
                }
              )
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
          Button,
          {
            className: "ds-margin-top-lg",
            variant: "primary",
            onClick: this.handleSavePlugin,
            isDisabled: saveBtnDisabled || saving,
            isLoading: saving,
            spinnerAriaValueText: saving ? _19("Saving") : void 0,
            ...extraPrimaryProps,
            children: saveBtnName
          }
        )
      ] });
    }
  };
  WinSync.propTypes = {
    rows: import_prop_types20.default.array,
    serverId: import_prop_types20.default.string,
    savePluginHandler: import_prop_types20.default.func,
    pluginListHandler: import_prop_types20.default.func,
    addNotification: import_prop_types20.default.func,
    toggleLoadingHandler: import_prop_types20.default.func
  };
  WinSync.defaultProps = {
    rows: [],
    serverId: ""
  };
  var winsync_default = WinSync;

  // src/plugins.jsx
  var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
  var _20 = cockpit_default.gettext;
  var Plugins = class extends import_react36.default.Component {
    componentDidUpdate(prevProps) {
      if (this.props.wasActiveList.includes(5)) {
        if (this.state.firstLoad) {
          this.pluginList();
        } else {
          if (this.props.serverId !== prevProps.serverId) {
            this.pluginList();
          }
        }
      }
    }
    componentDidMount() {
      this.getSchema();
    }
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        loading: false,
        showPluginModal: false,
        currentPluginTab: "",
        activePlugin: "All Plugins",
        togglePluginName: "",
        togglePluginEnabled: false,
        showConfirmToggle: false,
        toggleSpinning: false,
        modalChecked: false,
        modalSpinning: false,
        rows: [],
        pluginTableKey: 0,
        attributes: [],
        objectclasses: [],
        // Plugin attributes
        currentPluginName: "",
        currentPluginType: "",
        currentPluginEnabled: false,
        currentPluginPath: "",
        currentPluginInitfunc: "",
        currentPluginId: "",
        currentPluginVendor: "",
        currentPluginVersion: "",
        currentPluginDescription: "",
        currentPluginDependsOnType: "",
        currentPluginDependsOnNamed: "",
        currentPluginPrecedence: ""
      };
      this.handleSelect = (_event, item) => {
        this.setState({
          activePlugin: item.itemId
        });
      };
      this.onFieldChange = this.onFieldChange.bind(this);
      this.pluginList = this.pluginList.bind(this);
      this.onChangeTab = this.onChangeTab.bind(this);
      this.savePlugin = this.savePlugin.bind(this);
      this.toggleLoading = this.toggleLoading.bind(this);
      this.getIconAndName = this.getIconAndName.bind(this);
      this.togglePlugin = this.togglePlugin.bind(this);
      this.showConfirmToggle = this.showConfirmToggle.bind(this);
      this.closeConfirmToggle = this.closeConfirmToggle.bind(this);
      this.getSchema = this.getSchema.bind(this);
    }
    getSchema() {
      const attr_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "list"
      ];
      log_cmd("getSchema", "Plugins Get attrs", attr_cmd);
      cockpit_default.spawn(attr_cmd, { superuser: true, err: "message" }).done((content) => {
        const attrContent = JSON.parse(content);
        const attrs = [];
        for (const content2 of attrContent.items) {
          attrs.push(content2.name[0]);
        }
        const oc_cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "schema",
          "objectclasses",
          "list"
        ];
        log_cmd("getSchema", "Get objectClasses", oc_cmd);
        cockpit_default.spawn(oc_cmd, { superuser: true, err: "message" }).done((content2) => {
          const ocContent = JSON.parse(content2);
          const ocs = [];
          for (const content3 of ocContent.items) {
            ocs.push(content3.name[0]);
          }
          this.setState({
            objectClasses: ocs,
            attributes: attrs
          });
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.addNotification("error", cockpit_default.format(_20("Failed to get objectClasses - $0"), errMsg));
        });
      });
    }
    onChangeTab(event) {
      this.setState({ currentPluginTab: event.target.value });
    }
    onFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    toggleLoading() {
      this.setState((prevState) => ({
        loading: !prevState.loading
      }));
    }
    pluginList() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "list"
      ];
      log_cmd("pluginList", "Get plugins for table rows", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const pluginTableKey = this.state.pluginTableKey + 1;
        if (this.state.firstLoad) {
          this.setState((prevState) => ({
            pluginTabs: {
              ...prevState.pluginTabs,
              basicConfig: true
            },
            rows: myObject.items,
            firstLoad: false,
            pluginTableKey
          }));
        } else {
          this.setState({
            rows: myObject.items,
            pluginTableKey
          });
        }
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_20("$0 error during plugin loading"), errMsg)
        );
      });
    }
    savePlugin(data) {
      let nothingToSetErr = false;
      let basicPluginSuccess = false;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "set",
        data.name,
        "--type",
        data.type || "delete",
        "--path",
        data.path || "delete",
        "--initfunc",
        data.initfunc || "delete",
        "--id",
        data.id || "delete",
        "--vendor",
        data.vendor || "delete",
        "--version",
        data.version || "delete",
        "--description",
        data.description || "delete",
        "--depends-on-type",
        data.dependsOnType || "delete",
        "--depends-on-named",
        data.dependsOnNamed || "delete",
        "--precedence",
        data.precedence || "delete"
      ];
      if ("enabled" in data) {
        cmd = [...cmd, "--enabled", data.enabled ? "on" : "off"];
      }
      this.toggleLoading();
      log_cmd("savePlugin", "Edit the plugin", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        console.info("savePlugin", "Result", content);
        basicPluginSuccess = true;
        this.props.addNotification(
          "success",
          cockpit_default.format(_20("Plugin $0 was successfully modified"), data.name)
        );
        this.pluginList();
        this.closePluginModal();
        this.toggleLoading();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        if (errMsg.indexOf("nothing to set") >= 0) {
          nothingToSetErr = true;
        } else {
          this.props.addNotification(
            "error",
            cockpit_default.format(_20("$0 error during $1 modification"), errMsg, data.name)
          );
        }
        this.closePluginModal();
        this.toggleLoading();
      }).always(() => {
        if ("specificPluginCMD" in data && data.specificPluginCMD.length !== 0) {
          this.toggleLoading();
          log_cmd(
            "savePlugin",
            "Edit the plugin from the plugin config tab",
            data.specificPluginCMD
          );
          cockpit_default.spawn(data.specificPluginCMD, {
            superuser: true,
            err: "message"
          }).done((content) => {
            if (!basicPluginSuccess) {
              this.props.addNotification(
                "success",
                cockpit_default.format(_20("Plugin $0 was successfully modified"), data.name)
              );
            }
            this.pluginList();
            this.toggleLoading();
            console.info("savePlugin", "Result", content);
          }).fail((err) => {
            const errMsg = getApiErrorMessage(err);
            if (errMsg.indexOf("nothing to set") >= 0 && nothingToSetErr || errMsg.indexOf("nothing to set") < 0) {
              if (basicPluginSuccess) {
                this.props.addNotification(
                  "success",
                  cockpit_default.format(_20("Plugin $0 was successfully modified"), data.name)
                );
                this.pluginList();
              }
              this.props.addNotification(
                "error",
                cockpit_default.format(_20("$0 error during $1 modification"), errMsg, data.name)
              );
            }
            this.toggleLoading();
          });
        } else {
          this.pluginList();
        }
      });
    }
    showConfirmToggle(plugin_name, enabled) {
      this.setState({
        showConfirmToggle: true,
        togglePluginName: plugin_name,
        togglePluginEnabled: enabled,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmToggle() {
      this.setState({
        showConfirmToggle: false,
        togglePluginName: "",
        togglePluginEnabled: ""
      });
    }
    togglePlugin() {
      const new_status = this.state.togglePluginEnabled ? "off" : "on";
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "set",
        "--enabled=" + new_status,
        this.state.togglePluginName
      ];
      this.setState({ modalSpinning: true });
      log_cmd("togglePlugin", "Switch plugin states from the plugin tab", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        console.info("savePlugin", "Result", content);
        this.pluginList();
        this.props.addNotification(
          "warning",
          cockpit_default.format(_20("$0 plugin was successfully set to $1. Please, restart the instance."), this.state.togglePluginName, new_status)
        );
        this.setState({
          modalSpinning: false,
          showConfirmToggle: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_20("Error during $0 plugin modification - $1"), this.state.togglePluginName, errMsg)
        );
        this.setState({
          modalSpinning: false,
          showConfirmToggle: false
        });
      });
    }
    getIconAndName(name2, plugin_name) {
      const pluginRow = this.state.rows.find((row) => row.cn[0] === plugin_name);
      if (pluginRow) {
        if (pluginRow["nsslapd-pluginEnabled"][0] === "on") {
          return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "ds-ok-icon", children: [
            /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CheckCircleIcon, { title: _20("Plugin is enabled"), className: "ds-icon-sm" }),
            name2
          ] });
        } else {
          return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "ds-disabled-icon", children: [
            /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(BanIcon, { title: _20("Plugin is disabled"), className: "ds-icon-sm" }),
            name2
          ] });
        }
      } else {
        const otherRows = this.state.rows.filter((row) => row["nsslapd-pluginId"][0] === "NSUniqueAttr");
        if (otherRows.length > 0) {
          for (const plugin of otherRows) {
            if (plugin["nsslapd-pluginEnabled"][0] === "on") {
              return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "ds-ok-icon", children: [
                /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CheckCircleIcon, { title: _20("Plugin is enabled"), className: "ds-icon-sm" }),
                name2
              ] });
            }
          }
          return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "ds-disabled-icon", children: [
            /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(BanIcon, { title: _20("Plugin is disabled"), className: "ds-icon-sm" }),
            name2
          ] });
        } else {
          return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "ds-disabled-icon", children: [
            /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ResourcesEmptyIcon, { title: _20("Plugin is not configured"), className: "ds-icon-sm" }),
            name2
          ] });
        }
      }
    }
    render() {
      const selectPlugins = {
        allPlugins: {
          name: "All Plugins",
          icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
            /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ListIcon, { className: "ds-icon-sm" }),
            _20("All Plugins")
          ] }),
          component: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
            PluginTable,
            {
              rows: this.state.rows,
              showConfirmToggle: this.showConfirmToggle,
              spinning: this.state.modalSpinning
            },
            this.state.pluginTableKey
          )
        },
        accountPolicy: {
          name: "Account Policy",
          icon: this.getIconAndName("Account Policy", "Account Policy Plugin"),
          component: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
            accountPolicy_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              attributes: this.state.attributes
            },
            this.state.rows
          )
        },
        attributeUniqueness: {
          name: "Attribute Uniqueness",
          icon: this.getIconAndName("Attribute Uniqueness", "attribute uniqueness"),
          component: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
            attributeUniqueness_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes,
              objectClasses: this.state.objectClasses
            },
            this.state.rows
          )
        },
        autoMembership: {
          name: "Auto Membership",
          icon: this.getIconAndName("Auto Membership", "Auto Membership Plugin"),
          component: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
            autoMembership_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes
            },
            this.props.wasActiveList
          )
        },
        dna: {
          name: "DNA",
          icon: this.getIconAndName("DNA", "Distributed Numeric Assignment Plugin"),
          component: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
            dna_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes
            },
            this.props.wasActiveList
          )
        },
        linkedAttributes: {
          name: "Linked Attributes",
          icon: this.getIconAndName("Linked Attributes", "Linked Attributes"),
          component: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
            linkedAttributes_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes
            },
            this.props.wasActiveList
          )
        },
        managedEntries: {
          name: "Managed Entries",
          icon: this.getIconAndName("Managed Entries", "Managed Entries"),
          component: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
            managedEntries_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              attributes: this.state.attributes,
              addNotification: this.props.addNotification
            },
            this.state.rows
          )
        },
        memberOf: {
          name: "MemberOf",
          icon: this.getIconAndName("MemberOf", "MemberOf Plugin"),
          component: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
            memberOf_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              objectClasses: this.state.objectClasses
            },
            this.props.wasActiveList
          )
        },
        passthroughAuthentication: {
          name: "LDAP Pass Through Auth",
          icon: this.getIconAndName("LDAP Pass Through Auth", "Pass Through Authentication"),
          component: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
            passthroughAuthentication_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes
            },
            this.props.wasActiveList
          )
        },
        pamPassthroughAuthentication: {
          name: "PAM Pass Through Auth",
          icon: this.getIconAndName("PAM Pass Through Auth", "PAM Pass Through Auth"),
          component: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
            pamPassThru_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes
            },
            this.props.wasActiveList
          )
        },
        winsync: {
          name: "Posix Winsync",
          icon: this.getIconAndName("Posix Winsync", "Posix Winsync API"),
          component: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
            winsync_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              attributes: this.state.attributes,
              toggleLoadingHandler: this.toggleLoading
            },
            this.state.rows
          )
        },
        referentialIntegrity: {
          name: "Referential Integrity",
          icon: this.getIconAndName("Referential Integrity", "referential integrity postoperation"),
          component: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
            referentialIntegrity_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes
            },
            this.props.wasActiveList
          )
        },
        retroChangelog: {
          name: "Retro Changelog",
          icon: this.getIconAndName("Retro Changelog", "Retro Changelog Plugin"),
          component: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
            retroChangelog_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes
            },
            this.props.wasActiveList
          )
        },
        rootDnaAccessControl: {
          name: "RootDN Access Control",
          icon: this.getIconAndName("RootDN Access Control", "RootDN Access Control"),
          component: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
            rootDNAccessControl_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              wasActiveList: this.props.wasActiveList,
              attributes: this.state.attributes,
              toggleLoadingHandler: this.toggleLoading
            }
          )
        },
        usn: {
          name: "USN",
          icon: this.getIconAndName("USN", "USN"),
          component: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
            usn_default,
            {
              rows: this.state.rows,
              serverId: this.props.serverId,
              savePluginHandler: this.savePlugin,
              pluginListHandler: this.pluginList,
              addNotification: this.props.addNotification,
              toggleLoadingHandler: this.toggleLoading,
              wasActiveList: this.props.wasActiveList
            },
            this.props.wasActiveList
          )
        }
      };
      return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "container-fluid", children: [
        /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "ds-margin-top-xlg ds-center", hidden: !this.state.firstLoad, children: [
          /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { component: TextVariants.h3, children: _20("Loading Plugins ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { hidden: this.state.firstLoad, className: this.state.loading ? "ds-disabled" : "", children: [
          /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Grid, { className: "ds-margin-top-xlg", hasGutter: true, children: [
            /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(GridItem, { span: 3, className: "ds-vert-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Nav, { theme: "light", onSelect: (event, item) => this.handleSelect(event, item), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(NavList, { children: Object.entries(selectPlugins).map(([id, item]) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(NavItem, { itemId: item.name, ouiaId: id, isActive: this.state.activePlugin === item.name, children: item.icon }, item.name)) }) }, this.state.pluginTableKey) }),
            /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(GridItem, { className: "ds-indent-md", span: 9, children: Object.entries(selectPlugins).filter((plugin) => plugin[1].name === this.state.activePlugin).map((filteredPlugin) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "ds-margin-top", children: filteredPlugin[1].component }, filteredPlugin[1].name)) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
            DoubleConfirmModal,
            {
              showModal: this.state.showConfirmToggle,
              closeHandler: this.closeConfirmToggle,
              handleChange: this.onFieldChange,
              actionHandler: this.togglePlugin,
              spinning: this.state.modalSpinning,
              item: this.state.togglePluginName,
              checked: this.state.modalChecked,
              mTitle: this.state.togglePluginEnabled ? _20("Disable Plugin") : _20("Enable Plugin"),
              mMsg: this.state.togglePluginEnabled ? _20("Are you really sure you want to disable this plugin?  Disabling some plugins can cause the server to not start, please use caution.") : _20("Are you sure you want to enable this plugin?"),
              mSpinningMsg: this.state.togglePluginEnabled ? _20("Disabling plugin ...") : _20("Enabling plugin ..."),
              mBtnName: this.state.togglePluginEnabled ? _20("Disable Plugin") : _20("Enable Plugin")
            }
          )
        ] })
      ] });
    }
  };
  Plugins.propTypes = {
    addNotification: import_prop_types21.default.func,
    serverId: import_prop_types21.default.string
  };
  Plugins.defaultProps = {
    serverId: ""
  };

  // src/database.jsx
  var import_react57 = __toESM(require_react(), 1);

  // src/lib/database/chaining.jsx
  var import_react37 = __toESM(require_react(), 1);
  var import_prop_types22 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
  var _21 = cockpit_default.gettext;
  var ChainingDatabaseConfig = class extends import_react37.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: this.props.activeKey,
        oids: this.props.data.oids,
        oidList: this.props.data.oidList,
        availableOids: this.props.data.availableOids,
        comps: this.props.data.comps,
        compList: this.props.data.compList,
        availableComps: this.props.data.availableComps,
        selectedOid: "",
        selectedComp: "",
        removeOid: "",
        removeComp: "",
        showConfirmCompDelete: false,
        showConfirmOidDelete: false,
        showOidModal: false,
        showCompsModal: false,
        isExpanded: false,
        saveBtnDisabled: true,
        isOpen: false,
        isModalSelectOpen: false,
        modalChecked: false,
        modalSpinning: false,
        // Chaining config settings
        defSearchCheck: this.props.data.defSearchCheck[0],
        defBindConnLimit: this.props.data.defBindConnLimit[0],
        defBindTimeout: this.props.data.defBindTimeout[0],
        defBindRetryLimit: this.props.data.defBindRetryLimit[0],
        defConcurLimit: this.props.data.defConcurLimit[0],
        defConcurOpLimit: this.props.data.defConcurOpLimit[0],
        defConnLife: this.props.data.defConnLife[0],
        defHopLimit: this.props.data.defHopLimit[0],
        defDelay: this.props.data.defDelay[0],
        defTestDelay: this.props.data.defTestDelay[0],
        defOpConnLimit: this.props.data.defOpConnLimit[0],
        defSizeLimit: this.props.data.defSizeLimit[0],
        defTimeLimit: this.props.data.defTimeLimit[0],
        defProxy: this.props.data.defProxy,
        defRefOnScoped: this.props.data.defRefOnScoped,
        defCheckAci: this.props.data.defCheckAci,
        defUseStartTLS: this.props.data.defUseStartTLS,
        // Original values used for saving config
        _defSearchCheck: this.props.data.defSearchCheck[0],
        _defBindConnLimit: this.props.data.defBindConnLimit[0],
        _defBindTimeout: this.props.data.defBindTimeout[0],
        _defBindRetryLimit: this.props.data.defBindRetryLimit[0],
        _defConcurLimit: this.props.data.defConcurLimit[0],
        _defConcurOpLimit: this.props.data.defConcurOpLimit[0],
        _defConnLife: this.props.data.defConnLife[0],
        _defHopLimit: this.props.data.defHopLimit[0],
        _defDelay: this.props.data.defDelay[0],
        _defTestDelay: this.props.data.defTestDelay[0],
        _defOpConnLimit: this.props.data.defOpConnLimit[0],
        _defSizeLimit: this.props.data.defSizeLimit[0],
        _defTimeLimit: this.props.data.defTimeLimit[0],
        _defProxy: this.props.data.defProxy,
        _defRefOnScoped: this.props.data.defRefOnScoped,
        _defCheckAci: this.props.data.defCheckAci,
        _defUseStartTLS: this.props.data.defUseStartTLS
      };
      this.handleToggle = (_event, isExpanded) => {
        this.setState({
          isExpanded
        });
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.onModalToggle = (isModalSelectOpen) => {
        this.setState({
          isModalSelectOpen
        });
      };
      this.handleChange = this.handleChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.handleSaveChainingConfig = this.handleSaveChainingConfig.bind(this);
      this.handleShowOidModal = this.handleShowOidModal.bind(this);
      this.closeOidModal = this.closeOidModal.bind(this);
      this.onOIDChange = this.onOIDChange.bind(this);
      this.saveOids = this.saveOids.bind(this);
      this.deleteOids = this.deleteOids.bind(this);
      this.handleSelectOids = this.handleSelectOids.bind(this);
      this.handleShowCompsModal = this.handleShowCompsModal.bind(this);
      this.closeCompsModal = this.closeCompsModal.bind(this);
      this.onCompsChange = this.onCompsChange.bind(this);
      this.saveComps = this.saveComps.bind(this);
      this.deleteComps = this.deleteComps.bind(this);
      this.handleSelectComps = this.handleSelectComps.bind(this);
      this.showConfirmDelete = this.showConfirmDelete.bind(this);
      this.closeConfirmOidDelete = this.closeConfirmOidDelete.bind(this);
      this.closeConfirmCompDelete = this.closeConfirmCompDelete.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    handleChange(e) {
      let saveBtnDisabled = true;
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      const check_attrs = [
        "defSearchCheck",
        "defBindConnLimit",
        "defBindTimeout",
        "defBindRetryLimit",
        "defConcurLimit",
        "defConcurOpLimit",
        "defConnLife",
        "defHopLimit",
        "defDelay",
        "defTestDelay",
        "defOpConnLimit",
        "defSizeLimit",
        "defTimeLimit",
        "defProxy",
        "defRefOnScoped",
        "defCheckAci",
        "defUseStartTLS"
      ];
      for (const check_attr of check_attrs) {
        if (attr !== check_attr) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            saveBtnDisabled = false;
          }
        } else if (value !== this.state["_" + check_attr]) {
          saveBtnDisabled = false;
        }
      }
      this.setState({
        [attr]: value,
        saveBtnDisabled
      });
    }
    handleSaveChainingConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "config-set-def"
      ];
      let val = "";
      if (this.state._defUseStartTLS !== this.state.defUseStartTLS) {
        val = "off";
        if (this.state.defUseStartTLS) {
          val = "on";
        }
        cmd.push("--use-starttls=" + val);
      }
      if (this.state._defCheckAci !== this.state.defCheckAci) {
        val = "off";
        if (this.state.defCheckAci) {
          val = "on";
        }
        cmd.push("--check-aci=" + val);
      }
      if (this.state._defRefOnScoped !== this.state.defRefOnScoped) {
        val = "off";
        if (this.state.defRefOnScoped) {
          val = "on";
        }
        cmd.push("--return-ref=" + val);
      }
      if (this.state._defProxy !== this.state.defProxy) {
        val = "off";
        if (this.state.defProxy) {
          val = "on";
        }
        cmd.push("--proxied-auth=" + val);
      }
      if (this.state._defTestDelay !== this.state.defTestDelay) {
        cmd.push("--test-response-delay=" + this.state.defTestDelay);
      }
      if (this.state._defOpConnLimit !== this.state.defOpConnLimit) {
        cmd.push("--conn-op-limit=" + this.state.defOpConnLimit);
      }
      if (this.state._defSizeLimit !== this.state.defSizeLimit) {
        cmd.push("--size-limit=" + this.state.defSizeLimit);
      }
      if (this.state._defTimeLimit !== this.state.defTimeLimit) {
        cmd.push("--time-limit=" + this.state.defTimeLimit);
      }
      if (this.state._defSearchCheck !== this.state.defSearchCheck) {
        cmd.push("--abandon-check-interval=" + this.state.defSearchCheck);
      }
      if (this.state._defBindTimeout !== this.state.defBindTimeout) {
        cmd.push("--bind-timeout=" + this.state.defBindTimeout);
      }
      if (this.state._defBindRetryLimit !== this.state.defBindRetryLimit) {
        cmd.push("--bind-attempts=" + this.state.defBindRetryLimit);
      }
      if (this.state._defConcurLimit !== this.state.defConcurLimit) {
        cmd.push("--bind-limit=" + this.state.defConcurLimit);
      }
      if (this.state._defConcurOpLimit !== this.state.defConcurOpLimit) {
        cmd.push("--op-limit=" + this.state.defConcurOpLimit);
      }
      if (this.state._defConnLife !== this.state.defConnLife) {
        cmd.push("--conn-lifetime=" + this.state.defConnLife);
      }
      if (this.state._defHopLimit !== this.state.defHopLimit) {
        cmd.push("--hop-limit=" + this.state.defHopLimit);
      }
      if (this.state._defDelay !== this.state.defDelay) {
        cmd.push("--response-delay=" + this.state.defDelay);
      }
      if (this.state._defBindConnLimit !== this.state.defBindConnLimit) {
        cmd.push("--conn-bind-limit=" + this.state.defBindConnLimit);
      }
      if (cmd.length > 5) {
        this.setState({
          saving: true
        });
        log_cmd("handleSaveChainingConfig", "Applying default chaining config change", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.props.reload();
          this.props.addNotification(
            "success",
            _21("Successfully updated chaining configuration")
          );
          this.setState({
            saving: false
          });
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.reload();
          this.props.addNotification(
            "error",
            cockpit_default.format(_21("Error updating chaining configuration - $0"), errMsg)
          );
          this.setState({
            saving: false
          });
        });
      }
    }
    //
    // Chaining OID modal functions
    //
    handleShowOidModal() {
      this.setState({
        showOidModal: true,
        selectedOid: ""
      });
    }
    closeOidModal() {
      this.setState({
        showOidModal: false
      });
    }
    onOIDChange(selectedItem, selectedItemProps) {
      const oid = selectedItemProps.children;
      if (oid !== this.state.selectedOid) {
        this.setState({
          selectedOid: oid
        });
      }
    }
    saveOids() {
      if (this.state.selectedOid === "") {
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "config-set",
        "--add-control=" + this.state.selectedOid
      ];
      this.setState({
        selectedOid: "",
        modalSpinning: true
      });
      log_cmd("saveOids", "Save new chaining OID controls", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.closeOidModal();
        this.props.reload(1);
        this.setState({
          modalSpinning: false
        });
        this.props.addNotification(
          "success",
          _21("Successfully updated chaining controls")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.setState({
          modalSpinning: false
        });
        this.closeOidModal();
        this.props.reload(1);
        this.props.addNotification(
          "error",
          cockpit_default.format(_21("Error updating chaining controls - $0,"), errMsg)
        );
      });
    }
    handleSelectOids(selectedItem, selectedItemProps) {
      const oid = selectedItemProps.children;
      if (oid !== this.state.removeOid) {
        this.setState({
          removeOid: oid
        });
      }
    }
    deleteOids(props) {
      if (this.state.removeOid === "") {
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "config-set",
        "--del-control=" + this.state.removeOid
      ];
      this.setState({
        removeOid: ""
      });
      log_cmd("deleteOids", "Delete chaining control oid", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(1);
        this.props.addNotification(
          "success",
          _21("Successfully removed chaining controls")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reload();
        this.props.addNotification(
          "error",
          cockpit_default.format(_21("Error removing chaining controls - $0"), errMsg)
        );
      });
    }
    //
    // Chaining Component modal functions
    //
    handleShowCompsModal() {
      this.setState({
        showCompsModal: true,
        selectedComp: ""
      });
    }
    closeCompsModal() {
      this.setState({
        showCompsModal: false
      });
    }
    onCompsChange(selectedItem, selectedItemProps) {
      const comp = selectedItemProps.children;
      if (comp !== this.state.selectedComp) {
        this.setState({
          selectedComp: comp
        });
      }
    }
    handleSelectComps(selectedItem, selectedItemProps) {
      const comp = selectedItemProps.children;
      if (comp !== this.state.removeComp) {
        this.setState({
          removeComp: comp
        });
      }
    }
    saveComps() {
      if (this.state.selectedComp === "") {
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "config-set",
        "--add-comp=" + this.state.selectedComp
      ];
      this.setState({
        modalSpinning: true,
        selectedComp: ""
      });
      log_cmd("saveComps", "Save new chaining components", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.closeCompsModal();
        this.props.reload(1);
        this.setState({
          modalSpinnming: false
        });
        this.props.addNotification(
          "success",
          _21("Successfully updated chaining components")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.closeCompsModal();
        this.props.reload();
        this.setState({
          modalSpinnming: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_21("Error updating chaining components - $0"), errMsg)
        );
      });
    }
    deleteComps(props) {
      if (this.state.removeComp === "") {
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "config-set",
        "--del-comp=" + this.state.removeComp
      ];
      this.setState({
        removeComp: ""
      });
      log_cmd("deleteComps", "Delete chaining components", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(1);
        this.props.addNotification(
          "success",
          _21("Successfully removed chaining components")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reload();
        this.props.addNotification(
          "error",
          cockpit_default.format(_21("Error removing chaining components - $0"), errMsg)
        );
      });
    }
    //
    // Confirm deletion functions
    //
    showConfirmDelete(item) {
      if (item === "oid") {
        if (this.state.removeOid.length) {
          this.setState({
            showConfirmOidDelete: true
          });
        }
      } else if (item === "comp") {
        if (this.state.removeComp.length) {
          this.setState({
            showConfirmCompDelete: true
          });
        }
      }
    }
    closeConfirmOidDelete() {
      this.setState({
        showConfirmOidDelete: false
      });
    }
    closeConfirmCompDelete() {
      this.setState({
        showConfirmCompDelete: false
      });
    }
    render() {
      let oids = this.state.oidList.map(
        (oid) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SimpleListItem, { children: oid }, oid)
      );
      if (oids.length === 0) {
        oids = "";
      }
      let comps = this.state.compList.map(
        (comps2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SimpleListItem, { children: comps2 }, comps2)
      );
      if (comps.length === 0) {
        comps = "";
      }
      let saveBtnName = _21("Save Settings");
      const extraPrimaryProps = {};
      if (this.props.refreshing) {
        saveBtnName = _21("Saving settings ...");
        extraPrimaryProps.spinnerAriaValueText = _21("Saving");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { id: "chaining-page", className: this.state.saving ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { component: TextVariants.h2, children: _21("Database Chaining Settings") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tabs, { className: "ds-margin-top-lg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
          /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TabTitleText, { children: _21("Default Creation Settings") }), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "ds-indent ds-margin-bottom-md", children: [
            /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Grid, { className: "ds-margin-top-xlg", children: [
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 2, title: _21("The size limit of entries returned over a database link (nsslapd-sizelimit)."), children: _21("Size Limit") }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                TextInput,
                {
                  value: this.state.defSizeLimit,
                  type: "number",
                  id: "defSizeLimit",
                  "aria-describedby": "defSizeLimit",
                  name: "defSizeLimit",
                  onChange: (e, str) => {
                    this.handleChange(e);
                  }
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", offset: 4, span: 2, title: _21("The maximum number of operations per connections. (nsconcurrentoperationslimit)."), children: _21("Max Operations Per Conn") }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                TextInput,
                {
                  value: this.state.defConcurOpLimit,
                  type: "number",
                  id: "defConcurOpLimit",
                  "aria-describedby": "defConcurOpLimit",
                  name: "defConcurOpLimit",
                  onChange: (e, str) => {
                    this.handleChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 2, title: _21("The time limit of an operation over a database link (nsslapd-timelimit)."), children: _21("Time Limit") }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                TextInput,
                {
                  value: this.state.defTimeLimit,
                  type: "number",
                  id: "defTimeLimit",
                  "aria-describedby": "defTimeLimit",
                  name: "defTimeLimit",
                  onChange: (e, str) => {
                    this.handleChange(e);
                  }
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", offset: 4, span: 2, title: _21("The maximum number of operations per connections. (nsconcurrentoperationslimit)."), children: _21("Connection Lifetime") }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                TextInput,
                {
                  value: this.state.defConnLife,
                  type: "number",
                  id: "defConnLife",
                  "aria-describedby": "defConnLife",
                  name: "defConnLife",
                  onChange: (e, str) => {
                    this.handleChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 2, title: _21("The maximum number of TCP connections the database link establishes with the remote server.  (nsbindconnectionslimit)."), children: _21("Max TCP Connections") }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                TextInput,
                {
                  value: this.state.defBindConnLimit,
                  type: "number",
                  id: "defBindConnLimit",
                  "aria-describedby": "defBindConnLimit",
                  name: "defBindConnLimit",
                  onChange: (e, str) => {
                    this.handleChange(e);
                  }
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", offset: 4, span: 2, title: _21("The maximum number of connections allowed over the database link.  (nsoperationconnectionslimit)."), children: _21("Max LDAP Connections") }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                TextInput,
                {
                  value: this.state.defOpConnLimit,
                  type: "number",
                  id: "defOpConnLimit",
                  "aria-describedby": "defOpConnLimit",
                  name: "defOpConnLimit",
                  onChange: (e, str) => {
                    this.handleChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 2, title: _21("The number of seconds that pass before the server checks for abandoned operations.  (nsabandonedsearchcheckinterval)."), children: _21("Abandoned Op Check Interval") }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                TextInput,
                {
                  value: this.state.defSearchCheck,
                  type: "number",
                  id: "defSearchCheck",
                  "aria-describedby": "defSearchCheck",
                  name: "defSearchCheck",
                  onChange: (e, str) => {
                    this.handleChange(e);
                  }
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", offset: 4, span: 2, title: _21("The maximum number of connections allowed over the database link.  (nsoperationconnectionslimit)."), children: _21("Max Binds Per Connection") }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                TextInput,
                {
                  value: this.state.defConcurLimit,
                  type: "number",
                  id: "defConcurLimit",
                  "aria-describedby": "defConcurLimit",
                  name: "defConcurLimit",
                  onChange: (e, str) => {
                    this.handleChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 2, title: _21("The maximum number of times a request can be forwarded from one database link to another.  (nshoplimit)."), children: _21("Database Link Hop Limit") }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                TextInput,
                {
                  value: this.state.defHopLimit,
                  type: "number",
                  id: "defHopLimit",
                  "aria-describedby": "defHopLimit",
                  name: "defHopLimit",
                  onChange: (e, str) => {
                    this.handleChange(e);
                  }
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", offset: 4, span: 2, title: _21("The amount of time before the bind attempt times out. (nsbindtimeout)."), children: _21("Bind Timeout") }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                TextInput,
                {
                  value: this.state.defBindTimeout,
                  type: "number",
                  id: "defBindTimeout",
                  "aria-describedby": "defBindTimeout",
                  name: "defBindTimeout",
                  onChange: (e, str) => {
                    this.handleChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 2, title: _21("The number of times the database link tries to bind with the remote server after a connection failure. (nsbindretrylimit)."), children: _21("Bind Retry Limit") }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                TextInput,
                {
                  value: this.state.defBindRetryLimit,
                  type: "number",
                  id: "defBindRetryLimit",
                  "aria-describedby": "defBindRetryLimit",
                  name: "defBindRetryLimit",
                  onChange: (e, str) => {
                    this.handleChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
              Grid,
              {
                title: _21("Sets whether ACIs are evaluated on the database link as well as the remote data server (nschecklocalaci)."),
                className: "ds-margin-top",
                children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                  Checkbox,
                  {
                    label: _21("Check Local ACIs"),
                    id: "defCheckAci",
                    isChecked: this.state.defCheckAci,
                    onChange: (e, str) => {
                      this.handleChange(e);
                    },
                    "aria-label": "check aci"
                  }
                ) })
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
              Grid,
              {
                title: _21("Sets whether referrals are returned by scoped searches (meaning 'one-level' or 'subtree' scoped searches). (nsreferralonscopedsearch)."),
                className: "ds-margin-top",
                children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                  Checkbox,
                  {
                    label: _21("Send Referral On Scoped Search"),
                    id: "defRefOnScoped",
                    isChecked: this.state.defRefOnScoped,
                    onChange: (e, str) => {
                      this.handleChange(e);
                    },
                    "aria-label": "send ref"
                  }
                ) })
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
              Grid,
              {
                title: _21("Sets whether proxied authentication is allowed. (nsproxiedauthorization)."),
                className: "ds-margin-top",
                children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                  Checkbox,
                  {
                    label: _21("Allow Proxied Authentication"),
                    id: "defProxy",
                    isChecked: this.state.defProxy,
                    onChange: (e, str) => {
                      this.handleChange(e);
                    },
                    "aria-label": "prox auth"
                  }
                ) })
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
              Grid,
              {
                title: _21("Use StartTLS for connections to remote server. (nsusestarttls)."),
                className: "ds-margin-top",
                children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                  Checkbox,
                  {
                    label: _21("Use StartTLS"),
                    id: "defUseStartTLS",
                    isChecked: this.state.defUseStartTLS,
                    onChange: (e, str) => {
                      this.handleChange(e);
                    },
                    "aria-label": "startTLS"
                  }
                ) })
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
              Button,
              {
                className: "ds-margin-top-xlg",
                variant: "primary",
                onClick: this.handleSaveChainingConfig,
                isDisabled: this.state.saveBtnDisabled || this.state.saving,
                isLoading: this.state.saving,
                spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
                ...extraPrimaryProps,
                children: saveBtnName
              }
            )
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TabTitleText, { children: _21("Controls & Components") }), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "ds-indent", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Grid, { className: "ds-margin-top-xlg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
              GridItem,
              {
                span: 4,
                title: _21("A list of LDAP control OIDs to be forwarded through chaining."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { component: TextVariants.h4, children: _21("Forwarded LDAP Controls") }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "ds-box ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SimpleList, { onSelect: this.handleSelectOids, "aria-label": "forward ctrls", children: oids }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "ds-margin-bottom-md ds-container", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "ds-panel-left", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                      Button,
                      {
                        variant: "primary",
                        onClick: this.handleShowOidModal,
                        className: "ds-button-left",
                        children: _21("Add")
                      }
                    ) }),
                    /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "ds-panel-right", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                      Button,
                      {
                        variant: "primary",
                        onClick: (e) => this.showConfirmDelete("oid"),
                        className: "ds-button-right",
                        isDisabled: this.state.removeOid === "",
                        children: _21("Delete")
                      }
                    ) })
                  ] })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 1 }),
            /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(GridItem, { span: 4, title: _21("A list of components to go through chaining"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { component: TextVariants.h4, children: _21("Components to Chain") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "ds-box ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SimpleList, { onSelect: this.handleSelectComps, "aria-label": "comps", children: comps }) }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "ds-margin-bottom-md ds-container", children: [
                /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "ds-panel-left", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                  Button,
                  {
                    variant: "primary",
                    onClick: this.handleShowCompsModal,
                    className: "ds-button-left",
                    children: _21("Add")
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "ds-panel-right", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                  Button,
                  {
                    variant: "primary",
                    onClick: (e) => this.showConfirmDelete("comp"),
                    className: "ds-button-right",
                    isDisabled: this.state.removeComp === "",
                    children: _21("Delete")
                  }
                ) })
              ] })
            ] })
          ] }) }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
          ChainControlsModal,
          {
            showModal: this.state.showOidModal,
            closeHandler: this.closeOidModal,
            handleChange: this.onOIDChange,
            saveHandler: this.saveOids,
            oidList: this.state.availableOids,
            spinning: this.state.modalSpinning
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
          ChainCompsModal,
          {
            showModal: this.state.showCompsModal,
            closeHandler: this.closeCompsModal,
            handleChange: this.onCompsChange,
            saveHandler: this.saveComps,
            compList: this.state.availableComps,
            spinning: this.state.modalSpinning
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmOidDelete,
            closeHandler: this.closeConfirmOidDelete,
            handleChange: this.onModalChange,
            actionHandler: this.deleteOids,
            spinning: this.state.modalSpinning,
            item: this.state.removeOid,
            checked: this.state.modalChecked,
            mTitle: _21("Remove Chaining OID"),
            mMsg: _21("Are you sure you want to delete this OID?"),
            mSpinningMsg: _21("Deleting ..."),
            mBtnName: _21("Delete")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmCompDelete,
            closeHandler: this.closeConfirmCompDelete,
            handleChange: this.onModalChange,
            actionHandler: this.deleteComps,
            spinning: this.state.modalSpinning,
            item: this.state.removeComp,
            checked: this.state.modalChecked,
            mTitle: _21("Remove Chaining Component"),
            mMsg: _21("Are you sure you want to delete this component?"),
            mSpinningMsg: _21("Deleting ..."),
            mBtnName: _21("Delete")
          }
        )
      ] });
    }
  };
  var ChainingConfig = class extends import_react37.default.Component {
    constructor(props) {
      super(props);
      if (this.props.data) {
        this.state = {
          errObj: {},
          showDeleteConfirm: false,
          linkPwdMatch: true,
          modalSpinning: false,
          modalChecked: false,
          saving: false,
          saveBtnDisabled: true,
          isOpen: false,
          // Settings
          nsfarmserverurl: this.props.data.nsfarmserverurl,
          nsmultiplexorbinddn: this.props.data.nsmultiplexorbinddn,
          nsmultiplexorcredentials: this.props.data.nsmultiplexorcredentials,
          nsmultiplexorcredentials_confirm: this.props.data.nsmultiplexorcredentials,
          sizelimit: this.props.data.sizelimit,
          timelimit: this.props.data.timelimit,
          bindconnlimit: this.props.data.bindconnlimit,
          opconnlimit: this.props.data.opconnlimit,
          concurrbindlimit: this.props.data.concurrbindlimit,
          bindtimeout: this.props.data.bindtimeout,
          bindretrylimit: this.props.data.bindretrylimit,
          concurroplimit: this.props.data.concurroplimit,
          connlifetime: this.props.data.connlifetime,
          searchcheckinterval: this.props.data.searchcheckinterval,
          hoplimit: this.props.data.hoplimit,
          nsbindmechanism: this.props.data.nsbindmechanism,
          nsusestarttls: this.props.data.nsusestarttls,
          nsreferralonscopedsearch: this.props.data.nsreferralonscopedsearch,
          nsproxiedauthorization: this.props.data.nsproxiedauthorization,
          nschecklocalaci: this.props.data.nschecklocalaci,
          // Original settings
          _nsfarmserverurl: this.props.data.nsfarmserverurl,
          _nsmultiplexorbinddn: this.props.data.nsmultiplexorbinddn,
          _nsmultiplexorcredentials: this.props.data.nsmultiplexorcredentials,
          _nsmultiplexorcredentials_confirm: this.props.data.nsmultiplexorcredentials,
          _sizelimit: this.props.data.sizelimit,
          _timelimit: this.props.data.timelimit,
          _bindconnlimit: this.props.data.bindconnlimit,
          _opconnlimit: this.props.data.opconnlimit,
          _concurrbindlimit: this.props.data.concurrbindlimit,
          _bindtimeout: this.props.data.bindtimeout,
          _bindretrylimit: this.props.data.bindretrylimit,
          _concurroplimit: this.props.data.concurroplimit,
          _connlifetime: this.props.data.connlifetime,
          _searchcheckinterval: this.props.data.searchcheckinterval,
          _hoplimit: this.props.data.hoplimit,
          _nsbindmechanism: this.props.data.nsbindmechanism,
          _nsusestarttls: this.props.data.nsusestarttls,
          _nsreferralonscopedsearch: this.props.data.nsreferralonscopedsearch,
          _nsproxiedauthorization: this.props.data.nsproxiedauthorization,
          _nschecklocalaci: this.props.data.nschecklocalaci
        };
      } else {
        this.state = {
          errObj: {},
          showDeleteConfirm: false,
          linkPwdMatch: true
        };
      }
      this.handleSelectToggle = (_event, isOpen) => {
        this.setState({
          isOpen
        });
      };
      this.handleSelect = (event, selection, isPlaceholder) => {
        let saveBtnDisabled = true;
        const check_attrs = [
          "nsfarmserverurl",
          "nsmultiplexorbinddn",
          "nsmultiplexorcredentials",
          "nsmultiplexorcredentials_confirm",
          "sizelimit",
          "timelimit",
          "bindconnlimit",
          "opconnlimit",
          "concurrbindlimit",
          "bindtimeout",
          "bindretrylimit",
          "concurroplimit",
          "connlifetime",
          "searchcheckinterval",
          "hoplimit",
          "nsbindmechanism",
          "nsusestarttls",
          "nsusestarttls",
          "nsreferralonscopedsearch",
          "nsproxiedauthorization",
          "nschecklocalaci"
        ];
        for (const check_attr of check_attrs) {
          if (check_attr !== "nsbindmechanism" && this.state[check_attr] !== this.state["_" + check_attr]) {
            saveBtnDisabled = false;
          }
        }
        if (selection !== this.state._nsbindmechanism) {
          saveBtnDisabled = false;
        }
        this.setState({
          nsbindmechanism: selection,
          saveBtnDisabled,
          isOpen: false
        });
      };
      this.onChange = this.onChange.bind(this);
      this.handleSaveLink = this.handleSaveLink.bind(this);
      this.deleteLink = this.deleteLink.bind(this);
      this.handleShowDeleteConfirm = this.handleShowDeleteConfirm.bind(this);
      this.closeDeleteConfirm = this.closeDeleteConfirm.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    handleShowDeleteConfirm() {
      this.setState({
        showDeleteConfirm: true,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeDeleteConfirm() {
      this.setState({
        showDeleteConfirm: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    checkPasswords() {
      let pwdMatch = false;
      if (this.state.nsmultiplexorcredentials === this.state.nsmultiplexorcredentials_confirm) {
        pwdMatch = true;
      }
      this.setState({
        linkPwdMatch: pwdMatch
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const attr = e.target.id;
      const errObj = this.state.errObj;
      let saveBtnDisabled = true;
      const check_attrs = [
        "nsfarmserverurl",
        "nsmultiplexorbinddn",
        "nsmultiplexorcredentials",
        "nsmultiplexorcredentials_confirm",
        "sizelimit",
        "timelimit",
        "bindconnlimit",
        "opconnlimit",
        "concurrbindlimit",
        "bindtimeout",
        "bindretrylimit",
        "concurroplimit",
        "connlifetime",
        "searchcheckinterval",
        "hoplimit",
        "nsbindmechanism",
        "nsusestarttls",
        "nsusestarttls",
        "nsreferralonscopedsearch",
        "nsproxiedauthorization",
        "nschecklocalaci"
      ];
      for (const check_attr of check_attrs) {
        if (attr !== check_attr) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            saveBtnDisabled = false;
          }
        } else if (value !== this.state["_" + check_attr]) {
          saveBtnDisabled = false;
        }
      }
      if (value === "") {
        valueErr = true;
      }
      errObj[attr] = valueErr;
      this.setState({
        [attr]: value,
        errObj,
        saveBtnDisabled
      }, this.checkPasswords);
    }
    handleSaveLink() {
      const missingArgs = {};
      let bind_pw = "";
      let errors = false;
      if (this.state.nsfarmserverurl === "") {
        this.props.addNotification(
          "warning",
          _21("Missing Remote Server LDAP URL")
        );
        missingArgs.nsfarmserverurl = true;
        errors = true;
      }
      if (this.state.nsmultiplexorbinddn === "") {
        this.props.addNotification(
          "warning",
          _21("Missing Remote Bind DN")
        );
        missingArgs.nsmultiplexorbinddn = true;
        errors = true;
      }
      if (this.state.nsmultiplexorcredentials === "") {
        this.props.addNotification(
          "warning",
          _21("Missing Remote Bind DN Password")
        );
        missingArgs.nsmultiplexorcredentials = true;
        errors = true;
      }
      if (this.state.nsmultiplexorcredentials_confirm === "") {
        this.props.addNotification(
          "warning",
          _21("Missing Remote Bind DN Password Confirmation")
        );
        missingArgs.nsmultiplexorcredentials_confirm = true;
        errors = true;
      }
      if (this.state.nsmultiplexorcredentials !== this.state.nsmultiplexorcredentials_confirm) {
        this.props.addNotification(
          "warning",
          _21("Remote Bind DN Password Do Not Match")
        );
        missingArgs.nsmultiplexorcredentials = true;
        missingArgs.nsmultiplexorcredentials_confirm = true;
        errors = true;
      }
      if (errors) {
        this.setState({
          errObj: missingArgs
        });
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "link-set",
        this.props.suffix
      ];
      if (this.state.nsfarmserverurl !== this.state._nsfarmserverurl) {
        cmd.push("--server-url=" + this.state.nsfarmserverurl);
      }
      if (this.state.nsmultiplexorbinddn !== this.state._nsmultiplexorbinddn) {
        cmd.push("--bind-dn=" + this.state.nsmultiplexorbinddn);
      }
      if (this.state.nsmultiplexorcredentials !== this.state._nsmultiplexorcredentials) {
        bind_pw = this.state.nsmultiplexorcredentials;
      }
      if (this.state.timelimit !== this.state._timelimit) {
        cmd.push("--time-limit=" + this.state.timelimit);
      }
      if (this.state.sizelimit !== this.state._sizelimit) {
        cmd.push("--size-limit=" + this.state.sizelimit);
      }
      if (this.state.bindconnlimit !== this.state._bindconnlimit) {
        cmd.push("--conn-bind-limit=" + this.state.bindconnlimit);
      }
      if (this.state.opconnlimit !== this.state._opconnlimit) {
        cmd.push("--conn-op-limit=" + this.state.opconnlimit);
      }
      if (this.state.concurrbindlimit !== this.state._concurrbindlimit) {
        cmd.push("--bind-limit=" + this.state.concurrbindlimit);
      }
      if (this.state.bindtimeout !== this.state._bindtimeout) {
        cmd.push("--bind-timeout=" + this.state.bindtimeout);
      }
      if (this.state.bindretrylimit !== this.state._bindretrylimit) {
        cmd.push("--bind-attempts=" + this.state.bindretrylimit);
      }
      if (this.state.concurroplimit !== this.state._concurroplimit) {
        cmd.push("--op-limit=" + this.state.concurroplimit);
      }
      if (this.state.connlifetime !== this.state._connlifetime) {
        cmd.push("--conn-lifetime=" + this.state.connlifetime);
      }
      if (this.state.searchcheckinterval !== this.state._searchcheckinterval) {
        cmd.push("--abandon-check-interval=" + this.state.searchcheckinterval);
      }
      if (this.state.hoplimit !== this.state._hoplimit) {
        cmd.push("--hop-limit=" + this.state.hoplimit);
      }
      if (this.state.nsbindmechanism !== this.state._nsbindmechanism) {
        cmd.push("--bind-mech=" + this.state.nsbindmechanism);
      }
      if (this.state.nsusestarttls !== this.state._nsusestarttls) {
        if (this.state.nsusestarttls) {
          cmd.push("--use-starttls=on");
        } else {
          cmd.push("--use-starttls=off");
        }
      }
      if (this.state.nsreferralonscopedsearch !== this.state._nsreferralonscopedsearch) {
        if (this.state.nsreferralonscopedsearch) {
          cmd.push("--return-ref=on");
        } else {
          cmd.push("--return-ref=off");
        }
      }
      if (this.state.nsproxiedauthorization !== this.state._nsproxiedauthorization) {
        if (this.state.nsproxiedauthorization) {
          cmd.push("--proxied-auth=on");
        } else {
          cmd.push("--proxied-auth=off");
        }
      }
      if (this.state.nschecklocalaci !== this.state._nschecklocalaci) {
        if (this.state.nschecklocalaci) {
          cmd.push("--check-aci=on");
        } else {
          cmd.push("--check-aci=off");
        }
      }
      if (cmd.length > 6) {
        this.setState({
          saving: true
        });
        const config = {
          cmd,
          promptArg: "--bind-pw-prompt",
          passwd: bind_pw,
          addNotification: this.props.addNotification,
          success_msg: _21("Successfully Updated Link Configuration"),
          error_msg: _21("Failed to update link configuration"),
          state_callback: () => {
            this.setState({ saving: false });
          },
          reload_func: this.props.reload,
          reload_arg: this.props.suffix,
          funcName: "handleSaveLink",
          funcDesc: _21("Save chaining link config")
        };
        callCmdStreamPassword(config);
      }
    }
    deleteLink() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "link-delete",
        this.props.suffix
      ];
      log_cmd("deleteLink", "Delete database chaining link", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.loadSuffixTree(true);
        this.props.addNotification(
          "success",
          _21("Successfully Deleted Database Link")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.loadSuffixTree(true);
        this.props.addNotification(
          "error",
          cockpit_default.format(_21("Failed to delete database link - $0"), errMsg)
        );
      });
    }
    render() {
      const error = this.state.errObj;
      const extraPrimaryProps = {};
      let saveBtnName = _21("Save Settings");
      if (this.state.loading) {
        saveBtnName = _21("Saving settings ...");
        extraPrimaryProps.spinnerAriaValueText = _21("Loading");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: this.state.saving ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 10, className: "ds-word-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { className: "ds-suffix-header", component: TextVariants.h3, children: [
            /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(LinkIcon, {}),
            "\xA0\xA0",
            this.props.suffix,
            " (",
            /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("i", { children: this.props.bename }),
            ")",
            /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
              Button,
              {
                variant: "plain",
                "aria-label": _21("Refresh database link"),
                onClick: () => this.props.reload(this.props.suffix),
                children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SyncAltIcon, {})
              }
            )
          ] }) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
            Button,
            {
              className: "ds-float-right",
              variant: "danger",
              onClick: this.handleShowDeleteConfirm,
              children: _21("Delete Link")
            }
          ) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
          Grid,
          {
            title: _21("The LDAP URL for the remote server.  Add additional failure server URLs by separating them with a space. (nsfarmserverurl)."),
            className: "ds-margin-top-lg",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 3, children: _21("Remote Server LDAP URL") }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                TextInput,
                {
                  value: this.state.nsfarmserverurl,
                  type: "text",
                  id: "nsfarmserverurl",
                  "aria-describedby": "nsfarmserverurl",
                  name: "nsfarmserverurl",
                  onChange: (e, str) => {
                    this.onChange(e);
                  }
                }
              ) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
          Grid,
          {
            title: _21("The distinguished name (DN) of the entry to authenticate to the remote server. (nsmultiplexorbinddn)."),
            className: "ds-margin-top",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 3, children: _21("Remote Server Bind DN") }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                TextInput,
                {
                  value: this.state.nsmultiplexorbinddn,
                  type: "text",
                  id: "nsmultiplexorbinddn",
                  "aria-describedby": "nsmultiplexorbinddn",
                  name: "nsmultiplexorbinddn",
                  onChange: (e, str) => {
                    this.onChange(e);
                  }
                }
              ) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
          Grid,
          {
            title: _21("The password for the authenticating entry. (nsmultiplexorcredentials)."),
            className: "ds-margin-top",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 3, children: _21("Bind DN Password") }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                TextInput,
                {
                  value: this.state.nsmultiplexorcredentials,
                  type: "password",
                  id: "nsmultiplexorcredentials",
                  "aria-describedby": "nsmultiplexorcredentials",
                  name: "nsmultiplexorcredentials",
                  onChange: (e, str) => {
                    this.onChange(e);
                  },
                  validated: error.nsmultiplexorcredentials || !this.state.linkPwdMatch ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
          Grid,
          {
            title: _21("Confirm the password for the authenticating entry. (nsmultiplexorcredentials)."),
            className: "ds-margin-top",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 3, children: _21("Confirm Password") }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                TextInput,
                {
                  value: this.state.nsmultiplexorcredentials_confirm,
                  type: "password",
                  id: "nsmultiplexorcredentials_confirm",
                  "aria-describedby": "nsmultiplexorcredentials_confirm",
                  name: "nsmultiplexorcredentials_confirm",
                  onChange: (e, str) => {
                    this.onChange(e);
                  },
                  validated: error.nsmultiplexorcredentials_confirm || !this.state.linkPwdMatch ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
          Grid,
          {
            title: _21("The authentication mechanism.  Simple (user name and password), SASL/DIGEST-MD5, or SASL>GSSAPI. (nsbindmechanism)."),
            className: "ds-margin-top",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 3, children: _21("Bind Method") }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                dsBasicComponents_default,
                {
                  selected: this.state.nsbindmechanism,
                  onSelect: this.handleSelect,
                  options: ["Simple", "SASL/DIGEST-MD5", "SASL/GSSAPI"],
                  isOpen: this.state.isOpen,
                  onToggle: this.handleSelectToggle,
                  ariaLabel: "Select Input"
                }
              ) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
          Grid,
          {
            title: _21("Use StartTLS for connections to the remote server. (nsusestarttls)."),
            className: "ds-margin-top",
            children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
              Checkbox,
              {
                label: _21("Use StartTLS"),
                id: "nsusestarttls",
                isChecked: this.state.nsusestarttls,
                onChange: (e, str) => {
                  this.onChange(e);
                },
                "aria-label": "check startTLS"
              }
            ) })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
          ExpandableSection,
          {
            className: "ds-margin-top-xlg",
            toggleText: this.state.isExpanded ? _21("Hide Advanced Settings") : _21("Show Advanced Settings"),
            onToggle: (event, isOpen) => this.handleToggle(event, isOpen),
            isExpanded: this.state.isExpanded,
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "ds-margin-top ds-margin-left", children: [
                /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
                  Grid,
                  {
                    title: _21("The size limit of entries returned over a database link (nsslapd-sizelimit)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 3, children: _21("Size Limit") }),
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                        TextInput,
                        {
                          value: this.state.sizelimit,
                          type: "number",
                          id: "sizelimit",
                          "aria-describedby": "sizelimit",
                          name: "sizelimit",
                          onChange: (e, str) => {
                            this.onChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
                  Grid,
                  {
                    title: _21("The time limit of an operation over a database link (nsslapd-timelimit)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 3, children: _21("Time Limit") }),
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                        TextInput,
                        {
                          value: this.state.sizelimit,
                          type: "number",
                          id: "timelimit",
                          "aria-describedby": "timelimit",
                          name: "timelimit",
                          onChange: (e, str) => {
                            this.onChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
                  Grid,
                  {
                    title: _21("The maximum number of TCP connections the database link establishes with the remote server.  (nsbindconnectionslimit)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 3, children: _21("Max TCP Connections") }),
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                        TextInput,
                        {
                          value: this.state.bindconnlimit,
                          type: "number",
                          id: "bindconnlimit",
                          "aria-describedby": "bindconnlimit",
                          name: "bindconnlimit",
                          onChange: (e, str) => {
                            this.onChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
                  Grid,
                  {
                    title: _21("The maximum number of connections allowed over the database link.  (nsoperationconnectionslimit)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 3, children: _21("Max LDAP Connections") }),
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                        TextInput,
                        {
                          value: this.state.opconnlimit,
                          type: "number",
                          id: "opconnlimit",
                          "aria-describedby": "opconnlimit",
                          name: "opconnlimit",
                          onChange: (e, str) => {
                            this.onChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
                  Grid,
                  {
                    title: _21("The maximum number of concurrent bind operations per TCP connection. (nsconcurrentbindlimit)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 3, children: _21("Max Binds Per Connection") }),
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                        TextInput,
                        {
                          value: this.state.concurrbindlimit,
                          type: "number",
                          id: "concurrbindlimit",
                          "aria-describedby": "concurrbindlimit",
                          name: "concurrbindlimit",
                          onChange: (e, str) => {
                            this.onChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
                  Grid,
                  {
                    title: _21("The amount of time before the bind attempt times out. (nsbindtimeout)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 3, children: _21("Bind Timeout") }),
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                        TextInput,
                        {
                          value: this.state.bindtimeout,
                          type: "number",
                          id: "bindtimeout",
                          "aria-describedby": "bindtimeout",
                          name: "bindtimeout",
                          onChange: (e, str) => {
                            this.onChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
                  Grid,
                  {
                    title: _21("The number of times the database link tries to bind with the remote server after a connection failure. (nsbindretrylimit)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 3, children: _21("Bind Retry Limit") }),
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                        TextInput,
                        {
                          value: this.state.bindtimeout,
                          type: "number",
                          id: "bindretrylimit",
                          "aria-describedby": "bindretrylimit",
                          name: "bindretrylimit",
                          onChange: (e, str) => {
                            this.onChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
                  Grid,
                  {
                    title: _21("The maximum number of operations per connections. (nsconcurrentoperationslimit)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 3, children: _21("Max Operations Per Connection") }),
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                        TextInput,
                        {
                          value: this.state.concurroplimit,
                          type: "number",
                          id: "concurroplimit",
                          "aria-describedby": "concurroplimit",
                          name: "concurroplimit",
                          onChange: (e, str) => {
                            this.onChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
                  Grid,
                  {
                    title: _21("The life of a database link connection to the remote server in seconds.  0 is unlimited  (nsconnectionlife)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 3, children: _21("Connection Lifetime") }),
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                        TextInput,
                        {
                          value: this.state.connlifetime,
                          type: "number",
                          id: "connlifetime",
                          "aria-describedby": "connlifetime",
                          name: "connlifetime",
                          onChange: (e, str) => {
                            this.onChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
                  Grid,
                  {
                    title: _21("The number of seconds that pass before the server checks for abandoned operations.  (nsabandonedsearchcheckinterval)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 3, children: _21("Abandoned Op Check Interval") }),
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                        TextInput,
                        {
                          value: this.state.searchcheckinterval,
                          type: "number",
                          id: "searchcheckinterval",
                          "aria-describedby": "searchcheckinterval",
                          name: "searchcheckinterval",
                          onChange: (e, str) => {
                            this.onChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
                  Grid,
                  {
                    title: _21("The maximum number of times a request can be forwarded from one database link to another.  (nshoplimit)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 3, children: _21("Hop Limit") }),
                      /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                        TextInput,
                        {
                          value: this.state.hoplimit,
                          type: "number",
                          id: "hoplimit",
                          "aria-describedby": "hoplimit",
                          name: "hoplimit",
                          onChange: (e, str) => {
                            this.onChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                  Grid,
                  {
                    title: _21("Allow proxied authentication to the remote server. (nsproxiedauthorization)."),
                    className: "ds-margin-top",
                    children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                      Checkbox,
                      {
                        label: _21("Allow Proxied Authentication"),
                        id: "nsproxiedauthorization",
                        isChecked: this.state.nsproxiedauthorization,
                        onChange: (e, str) => {
                          this.onChange(e);
                        },
                        "aria-label": "send ref"
                      }
                    ) })
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                  Grid,
                  {
                    title: _21("Sets whether ACIs are evaluated on the database link as well as the remote data server (nschecklocalaci)."),
                    className: "ds-margin-top",
                    children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                      Checkbox,
                      {
                        label: _21("Check Local ACIs"),
                        id: "nschecklocalaci",
                        isChecked: this.state.nschecklocalaci,
                        onChange: (e, str) => {
                          this.onChange(e);
                        },
                        "aria-label": "send ref"
                      }
                    ) })
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                  Grid,
                  {
                    title: _21("Sets whether referrals are returned by scoped searches (meaning 'one-level' or 'subtree' scoped searches). (nsreferralonscopedsearch)."),
                    className: "ds-margin-top",
                    children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GridItem, { className: "ds-label", span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
                      Checkbox,
                      {
                        label: _21("Send Referral On Scoped Search"),
                        id: "nsreferralonscopedsearch",
                        isChecked: this.state.nsreferralonscopedsearch,
                        onChange: (e, str) => {
                          this.onChange(e);
                        },
                        "aria-label": "send ref"
                      }
                    ) })
                  }
                )
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("hr", {})
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
          Button,
          {
            className: "ds-margin-top-lg",
            onClick: this.handleSaveLink,
            variant: "primary",
            isLoading: this.state.saving,
            spinnerAriaValueText: this.state.saving ? _21("Saving") : void 0,
            ...extraPrimaryProps,
            isDisabled: this.state.saveBtnDisabled || this.state.saving,
            children: saveBtnName
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showDeleteConfirm,
            closeHandler: this.closeDeleteConfirm,
            handleChange: this.onChange,
            actionHandler: this.deleteLink,
            spinning: this.state.modalSpinning,
            item: this.props.suffix,
            checked: this.state.modalChecked,
            mTitle: _21("Delete Database Link"),
            mMsg: _21("Are you really sure you want to delete this database link?"),
            mSpinningMsg: _21("Deleting Database Link..."),
            mBtnName: _21("Delete Database Link")
          }
        )
      ] });
    }
  };
  var ChainControlsModal = class extends import_react37.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        oidList,
        spinning
      } = this.props;
      const oids = oidList.map(
        (oid) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SimpleListItem, { children: oid }, oid)
      );
      let btnName = _21("Add New Controls");
      const extraPrimaryProps = {};
      if (spinning) {
        btnName = _21("Saving Controls ...");
        extraPrimaryProps.spinnerAriaValueText = _21("Saving");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title: _21("Chaining LDAP Controls"),
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
              Button,
              {
                variant: "primary",
                onClick: saveHandler,
                isLoading: spinning,
                isDisabled: spinning,
                spinnerAriaValueText: spinning ? _21("Loading") : void 0,
                ...extraPrimaryProps,
                children: btnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { variant: "link", onClick: closeHandler, children: _21("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Form, { isHorizontal: true, children: [
            /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TextContent, { title: _21("A list of LDAP control OIDs to be forwarded through chaining"), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { component: TextVariants.h3, children: _21("Available LDAP Controls") }) }),
            /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "ds-box ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SimpleList, { onSelect: handleChange, "aria-label": "comps", children: oids }) })
          ] })
        }
      );
    }
  };
  var ChainCompsModal = class extends import_react37.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        compList,
        spinning
      } = this.props;
      const comps = compList.map(
        (comp) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SimpleListItem, { children: comp }, comp)
      );
      let btnName = _21("Add New Components");
      const extraPrimaryProps = {};
      if (spinning) {
        btnName = _21("Saving Components ...");
        extraPrimaryProps.spinnerAriaValueText = _21("Saving");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title: _21("Chaining Components"),
          isOpen: showModal,
          onClose: closeHandler,
          "aria-labelledby": "ds-modal",
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
              Button,
              {
                variant: "primary",
                onClick: saveHandler,
                isLoading: spinning,
                isDisabled: spinning,
                spinnerAriaValueText: spinning ? _21("Loading") : void 0,
                ...extraPrimaryProps,
                children: btnName
              },
              "comps"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button, { variant: "link", onClick: closeHandler, children: _21("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Form, { isHorizontal: true, children: [
            /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TextContent, { title: _21("A list of LDAP control components"), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { component: TextVariants.h3, children: _21("Available Components") }) }),
            _21("Available LDAP Controls"),
            /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "ds-box ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SimpleList, { onSelect: handleChange, "aria-label": "comps", children: comps }) })
          ] })
        }
      );
    }
  };
  ChainCompsModal.propTypes = {
    showModal: import_prop_types22.default.bool,
    closeHandler: import_prop_types22.default.func,
    handleChange: import_prop_types22.default.func,
    saveHandler: import_prop_types22.default.func,
    compList: import_prop_types22.default.array
  };
  ChainCompsModal.defaultProps = {
    showModal: false,
    compList: []
  };
  ChainControlsModal.propTypes = {
    showModal: import_prop_types22.default.bool,
    closeHandler: import_prop_types22.default.func,
    handleChange: import_prop_types22.default.func,
    saveHandler: import_prop_types22.default.func,
    oidList: import_prop_types22.default.array
  };
  ChainControlsModal.defaultProps = {
    showModal: false,
    oidList: []
  };
  ChainingDatabaseConfig.propTypes = {
    serverId: import_prop_types22.default.string,
    addNotification: import_prop_types22.default.func,
    reload: import_prop_types22.default.func,
    data: import_prop_types22.default.object,
    enableTree: import_prop_types22.default.func
  };
  ChainingDatabaseConfig.defaultProps = {
    serverId: "",
    data: {}
  };
  ChainingConfig.propTypes = {
    serverId: import_prop_types22.default.string,
    suffix: import_prop_types22.default.string,
    bename: import_prop_types22.default.string,
    loadSuffixTree: import_prop_types22.default.func,
    addNotification: import_prop_types22.default.func,
    data: import_prop_types22.default.object,
    reload: import_prop_types22.default.func,
    enableTree: import_prop_types22.default.func
  };
  ChainingConfig.defaultProps = {
    serverId: "",
    suffix: "",
    bename: "",
    data: {}
  };

  // src/lib/database/databaseConfig.jsx
  var import_react38 = __toESM(require_react(), 1);
  var import_prop_types23 = __toESM(require_prop_types(), 1);
  var import_outlined_question_circle_icon2 = __toESM(require_outlined_question_circle_icon(), 1);
  var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
  var _22 = cockpit_default.gettext;
  var DynamicLists = class extends import_react38.default.Component {
    constructor(props) {
      super(props);
    }
    render() {
      return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "ds-margin-left", children: [
        /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
          Grid,
          {
            className: "ds-margin-top-xlg",
            title: _22("Enable or disable Dynamic Lists feature (nsslapd-dynamic-lists-enabled)."),
            children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "ds-container", children: [
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                Switch,
                {
                  id: "dynamiclistsenabled",
                  label: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
                    "Dynamic Lists ",
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("i", { children: "enabled" })
                  ] }),
                  labelOff: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
                    "Dynamic Lists ",
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("i", { children: "disabled" })
                  ] }),
                  isChecked: this.props.dynamiclistsenabled,
                  onChange: this.props.handleChange,
                  ouiaId: "dynamic switch"
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                Tooltip,
                {
                  id: "dynamic_lists",
                  position: "top",
                  content: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { children: _22("Dynamic Lists is a feature that allows the server to dynamically add content to database entries during searches. This is most useful for creating dynamic groups. The content is controlled by using LDAP URI's to define the scope and content. See the official documentation for more information.") }),
                  children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                    import_outlined_question_circle_icon2.OutlinedQuestionCircleIcon,
                    {
                      className: "ds-left-margin ds-margin-top-sm"
                    }
                  )
                }
              )
            ] }) })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
          Grid,
          {
            className: "ds-margin-top-lg",
            title: _22("Objectclass that identifies entries as 'dynamic' (nsslapd-dynamic-lists-oc)."),
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 3, children: _22("Dynamic List Objectclass") }),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                FormSelect,
                {
                  id: "dynamicoc",
                  value: this.props.dynamicoc.toLowerCase(),
                  onChange: this.props.handleChange,
                  "aria-label": "Dynamic List Objectclass",
                  ouiaId: "DynamicListObjectclassSelect",
                  isDisabled: !this.props.dynamiclistsenabled,
                  children: this.props.objectClasses.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormSelectOption, { value: option.toLowerCase(), label: option }, index))
                }
              ) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
          Grid,
          {
            className: "ds-margin-top-lg",
            title: _22("Attribute that contains the LDAP URL for the dynamic list (nsslapd-dynamic-lists-url-attr)."),
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 3, children: _22("Dynamic List URL Attribute") }),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                FormSelect,
                {
                  id: "dynamicurlattr",
                  value: this.props.dynamicurlattr.toLowerCase(),
                  onChange: this.props.handleChange,
                  "aria-label": "Dynamic List URL Attribute",
                  ouiaId: "DynamicListURL Attr Select AttributeSelect",
                  isDisabled: !this.props.dynamiclistsenabled,
                  children: this.props.urlAttrs.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormSelectOption, { value: option.name[0].toLowerCase(), label: option.name[0] }, index))
                }
              ) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
          Grid,
          {
            className: "ds-margin-top-lg",
            title: _22("Attribute that contains the dynamic list content. This attribute must have a DN syntax (nsslapd-dynamic-lists-attr)."),
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 3, children: _22("Dynamic List Attribute") }),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                FormSelect,
                {
                  id: "dynamiclistattr",
                  value: this.props.dynamiclistattr.toLowerCase(),
                  onChange: this.props.handleChange,
                  "aria-label": "Dynamic List Attribute",
                  ouiaId: "DynamicListAttributeSelect",
                  isDisabled: !this.props.dynamiclistsenabled,
                  children: this.props.dnAttrs.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FormSelectOption, { value: option.name[0].toLowerCase(), label: option.name[0] }, index))
                }
              ) })
            ]
          }
        )
      ] });
    }
  };
  var GlobalDatabaseConfig = class extends import_react38.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleTimeChange", (_event, time2, hour, min3, seconds2, isValid) => {
        this.setState({
          compacttime: time2
        }, () => {
          this.validateSaveBtn();
        });
      });
      this.state = {
        saving: false,
        saveBtnDisabled: true,
        error: {},
        activeTabKey: this.props.data.activeTab,
        db_cache_auto: this.props.data.db_cache_auto,
        import_cache_auto: this.props.data.import_cache_auto,
        looklimit: parseInt(this.props.data.looklimit),
        idscanlimit: parseInt(this.props.data.idscanlimit),
        pagelooklimit: parseInt(this.props.data.pagelooklimit),
        pagescanlimit: parseInt(this.props.data.pagescanlimit),
        rangelooklimit: parseInt(this.props.data.rangelooklimit),
        autosize: this.props.data.autosize,
        autosizesplit: parseInt(this.props.data.autosizesplit),
        dbcachesize: parseInt(this.props.data.dbcachesize),
        txnlogdir: this.props.data.txnlogdir,
        dbhomedir: this.props.data.dbhomedir,
        dblocks: parseInt(this.props.data.dblocks),
        dblocksMonitoring: this.props.data.dblocksMonitoring,
        dblocksMonitoringThreshold: parseInt(this.props.data.dblocksMonitoringThreshold),
        dblocksMonitoringPause: parseInt(this.props.data.dblocksMonitoringPause),
        chxpoint: parseInt(this.props.data.chxpoint),
        compactinterval: parseInt(this.props.data.compactinterval),
        compacttime: this.props.data.compacttime,
        importcachesize: parseInt(this.props.data.importcachesize),
        importcacheauto: parseInt(this.props.data.importcacheauto),
        ndncachemaxsize: parseInt(this.props.data.ndncachemaxsize),
        dynamiclistsenabled: this.props.data.dynamiclistsenabled,
        dynamiclistattr: this.props.data.dynamiclistattr,
        dynamicoc: this.props.data.dynamicoc,
        dynamicurlattr: this.props.data.dynamicurlattr,
        // These variables store the original value (used for saving config)
        _looklimit: parseInt(this.props.data.looklimit),
        _idscanlimit: parseInt(this.props.data.idscanlimit),
        _pagelooklimit: parseInt(this.props.data.pagelooklimit),
        _pagescanlimit: parseInt(this.props.data.pagescanlimit),
        _rangelooklimit: parseInt(this.props.data.rangelooklimit),
        _autosize: this.props.data.autosize,
        _autosizesplit: parseInt(this.props.data.autosizesplit),
        _dbcachesize: parseInt(this.props.data.dbcachesize),
        _txnlogdir: this.props.data.txnlogdir,
        _dbhomedir: this.props.data.dbhomedir,
        _dblocks: parseInt(this.props.data.dblocks),
        _dblocksMonitoring: this.props.data.dblocksMonitoring,
        _dblocksMonitoringThreshold: parseInt(this.props.data.dblocksMonitoringThreshold),
        _dblocksMonitoringPause: parseInt(this.props.data.dblocksMonitoringPause),
        _chxpoint: parseInt(this.props.data.chxpoint),
        _compactinterval: parseInt(this.props.data.compactinterval),
        _compacttime: this.props.data.compacttime,
        _importcachesize: parseInt(this.props.data.importcachesize),
        _importcacheauto: parseInt(this.props.data.importcacheauto),
        _db_cache_auto: this.props.data.db_cache_auto,
        _import_cache_auto: this.props.data.import_cache_auto,
        _ndncachemaxsize: parseInt(this.props.data.ndncachemaxsize),
        _dynamiclistsenabled: this.props.data.dynamiclistsenabled,
        _dynamiclistattr: this.props.data.dynamiclistattr,
        _dynamicoc: this.props.data.dynamicoc,
        _dynamicurlattr: this.props.data.dynamicurlattr
      };
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
      this.handleChange = this.handleChange.bind(this);
      this.handleTimeChange = this.handleTimeChange.bind(this);
      this.handleSelectDBLocksMonitoring = this.handleSelectDBLocksMonitoring.bind(this);
      this.handleSaveDBConfig = this.handleSaveDBConfig.bind(this);
      this.dn_syntax_oids = [
        "1.3.6.1.4.1.1466.115.121.1.34",
        "1.3.6.1.4.1.1466.115.121.1.12"
      ];
      this.maxValue = 2147483647;
      this.onMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.onConfigChange = (event, id, min3, max3) => {
        let error = this.state.error;
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        let badValue = false;
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        if (newValue > maxValue || newValue < min3) {
          badValue = true;
        }
        error[id] = badValue;
        this.setState({
          [id]: newValue,
          error
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
    }
    componentDidMount() {
      this.props.enableTree();
    }
    handleSelectDBLocksMonitoring(e, val) {
      this.setState({
        dblocksMonitoring: !this.state.dblocksMonitoring
      }, this.handleChange(e, val));
    }
    validateSaveBtn() {
      let saveBtnDisabled = true;
      const check_attrs = [
        "db_cache_auto",
        "import_cache_auto",
        "looklimit",
        "idscanlimit",
        "pagelooklimit",
        "pagescanlimit",
        "rangelooklimit",
        "autosize",
        "autosizesplit",
        "dbcachesize",
        "txnlogdir",
        "dbhomedir",
        "dblocks",
        "dblocksMonitoring",
        "dblocksMonitoringThreshold",
        "dblocksMonitoringPause",
        "chxpoint",
        "compactinterval",
        "compacttime",
        "importcachesize",
        "importcacheauto",
        "ndncachemaxsize",
        "dynamiclistsenabled",
        "dynamiclistattr",
        "dynamicoc",
        "dynamicurlattr"
      ];
      for (const config_attr of check_attrs) {
        if (this.state[config_attr] !== this.state["_" + config_attr]) {
          saveBtnDisabled = false;
          break;
        }
      }
      for (const config_attr of check_attrs) {
        if (config_attr in this.state.error && this.state.error[config_attr]) {
          saveBtnDisabled = true;
          break;
        }
      }
      this.setState({
        saveBtnDisabled
      });
    }
    handleChange(e, str) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      if (attr === "import_cache_auto" && value) {
        if (this.state.importcacheauto === "0") {
          this.setState({ importcacheauto: "-1" });
        }
      }
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn();
      });
    }
    save_ndn_cache(requireRestart) {
      const msg = "Successfully updated database configuration";
      if (this.state._ndncachemaxsize !== this.state.ndncachemaxsize) {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "config",
          "replace",
          "nsslapd-ndn-cache-max-size=" + this.state.ndncachemaxsize
        ];
        log_cmd("save_ndn_cache", "Applying config change", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.props.reload(this.state.activeTabKey);
          this.setState({
            saving: false
          });
          if (requireRestart) {
            this.props.addNotification(
              "warning",
              cockpit_default.format(_22("$0. You must restart the Directory Server for these changes to take effect."), msg)
            );
          } else {
            this.props.addNotification(
              "success",
              msg
            );
          }
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.reload(this.state.activeTabKey);
          this.setState({
            saving: false
          });
          this.props.addNotification(
            "error",
            cockpit_default.format(_22("Error updating configuration - $0"), errMsg)
          );
        });
      } else {
        this.props.reload(this.state.activeTabKey);
        this.setState({
          saving: false
        });
        if (requireRestart) {
          this.props.addNotification(
            "warning",
            cockpit_default.format(_22("$0. You must restart the Directory Server for these changes to take effect."), msg)
          );
        } else {
          this.props.addNotification(
            "success",
            msg
          );
        }
      }
    }
    handleSaveDBConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "config",
        "set"
      ];
      let requireRestart = false;
      if (this.state._looklimit !== this.state.looklimit) {
        cmd.push("--lookthroughlimit=" + this.state.looklimit);
      }
      if (this.state._idscanlimit !== this.state.idscanlimit) {
        cmd.push("--idlistscanlimit=" + this.state.idscanlimit);
      }
      if (this.state._pagelooklimit !== this.state.pagelooklimit) {
        cmd.push("--pagedlookthroughlimit=" + this.state.pagelooklimit);
      }
      if (this.state._pagescanlimit !== this.state.pagescanlimit) {
        cmd.push("--pagedidlistscanlimit=" + this.state.pagescanlimit);
      }
      if (this.state._rangelooklimit !== this.state.rangelooklimit) {
        cmd.push("--rangelookthroughlimit=" + this.state.rangelooklimit);
      }
      if (this.state._dynamiclistsenabled !== this.state.dynamiclistsenabled) {
        if (this.state.dynamiclistsenabled) {
          cmd.push("--enable-dynamic-lists");
        } else {
          cmd.push("--disable-dynamic-lists");
        }
      }
      if (this.state._dynamiclistattr !== this.state.dynamiclistattr) {
        cmd.push("--dynamic-list-attr=" + this.state.dynamiclistattr);
      }
      if (this.state._dynamicoc !== this.state.dynamicoc) {
        cmd.push("--dynamic-oc=" + this.state.dynamicoc);
      }
      if (this.state._dynamicurlattr !== this.state.dynamicurlattr) {
        cmd.push("--dynamic-url-attr=" + this.state.dynamicurlattr);
      }
      if (this.state.db_cache_auto) {
        if (this.state._db_cache_auto !== this.state.db_cache_auto) {
          if (this.state.autosize === "0") {
            cmd.push("--cache-autosize=25");
          } else {
            cmd.push("--cache-autosize=" + this.state.autosize);
          }
          requireRestart = true;
        } else if (this.state._autosize !== this.state.autosize) {
          cmd.push("--cache-autosize=" + this.state.autosize);
          requireRestart = true;
        }
      } else {
        if (this.state._db_cache_auto !== this.state.db_cache_auto) {
          cmd.push("--cache-autosize=0");
          requireRestart = true;
        }
      }
      if (this.state._autosizesplit !== this.state.autosizesplit) {
        cmd.push("--cache-autosize-split=" + this.state.autosizesplit);
        requireRestart = true;
      }
      if (this.state._dbcachesize !== this.state.dbcachesize) {
        cmd.push("--dbcachesize=" + this.state.dbcachesize);
        requireRestart = true;
      }
      if (this.state._txnlogdir !== this.state.txnlogdir) {
        cmd.push("--logdirectory=" + this.state.txnlogdir);
        requireRestart = true;
      }
      if (this.state._dbhomedir !== this.state.dbhomedir) {
        cmd.push("--db-home-directory=" + this.state.dbhomedir);
        requireRestart = true;
      }
      if (this.state._dblocks !== this.state.dblocks) {
        cmd.push("--locks=" + this.state.dblocks);
        requireRestart = true;
      }
      if (this.state._dblocksMonitoring !== this.state.dblocksMonitoring) {
        if (this.state.dblocksMonitoring) {
          cmd.push("--locks-monitoring-enabled=on");
        } else {
          cmd.push("--locks-monitoring-enabled=off");
        }
        requireRestart = true;
      }
      if (this.state._dblocksMonitoringThreshold !== this.state.dblocksMonitoringThreshold) {
        cmd.push("--locks-monitoring-threshold=" + this.state.dblocksMonitoringThreshold);
        requireRestart = true;
      }
      if (this.state._dblocksMonitoringPause !== this.state.dblocksMonitoringPause) {
        cmd.push("--locks-monitoring-pause=" + this.state.dblocksMonitoringPause);
      }
      if (this.state._chxpoint !== this.state.chxpoint) {
        cmd.push("--checkpoint-interval=" + this.state.chxpoint);
        requireRestart = true;
      }
      if (this.state._compactinterval !== this.state.compactinterval) {
        cmd.push("--compactdb-interval=" + this.state.compactinterval);
        requireRestart = true;
      }
      if (this.state._compacttime !== this.state.compacttime) {
        cmd.push("--compactdb-time=" + this.state.compacttime);
        requireRestart = true;
      }
      if (this.state.import_cache_auto) {
        if (this.state._import_cache_auto !== this.state.import_cache_auto) {
          if (this.state.importcachesize === "0") {
            cmd.push("--import-cache-autosize=-1");
          } else {
            cmd.push("--import-cache-autosize=" + this.state.importcacheauto);
          }
        } else if (this.state._importcacheauto !== this.state.importcacheauto) {
          cmd.push("--import-cache-autosize=" + this.state.importcacheauto);
        }
      } else {
        if (this.state._import_cache_auto !== this.state.import_cache_auto) {
          cmd.push("--import-cache-autosize=0");
        }
      }
      if (this.state._importcachesize !== this.state.importcachesize) {
        cmd.push("--import-cachesize=" + this.state.importcachesize);
      }
      if (cmd.length > 6) {
        this.setState({
          saving: true
        });
        log_cmd("handleSaveDBConfig", "Applying config change", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.save_ndn_cache(requireRestart);
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.reload(this.state.activeTabKey);
          this.setState({
            saving: false
          });
          this.props.addNotification(
            "error",
            cockpit_default.format(_22("Error updating configuration - $0"), errMsg)
          );
        });
      } else {
        this.setState({
          saving: true
        }, () => {
          this.save_ndn_cache(requireRestart);
        });
      }
    }
    render() {
      let db_cache_form;
      let mdb_cache_form;
      let import_cache_form;
      let db_auto_checked = false;
      let import_auto_checked = false;
      let dblocksMonitor = "";
      const dblocksThreshold = this.state.dblocksMonitoringThreshold;
      const dblocksPause = this.state.dblocksMonitoringPause;
      if (this.state.dblocksMonitoring) {
        dblocksMonitor = /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "ds-margin-left ds-margin-top", children: [
          /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
            Grid,
            {
              title: _22("Sets the DB lock exhaustion value in percentage (valid range is 70-95). If too many locks are acquired, the server will abort the searches while the number of locks are not decreased. It helps to avoid DB corruption and long recovery. (nsslapd-db-locks-monitoring-threshold)."),
              className: "ds-margin-top",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 3, children: _22("DB Locks Threshold Percentage") }),
                /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                  NumberInput,
                  {
                    value: dblocksThreshold,
                    min: 70,
                    max: 95,
                    onMinus: () => {
                      this.onMinusConfig("dblocksMonitoringThreshold");
                    },
                    onChange: (e) => {
                      this.onConfigChange(e, "dblocksMonitoringThreshold", 70, 95);
                    },
                    onPlus: () => {
                      this.onPlusConfig("dblocksMonitoringThreshold");
                    },
                    inputName: "input",
                    inputAriaLabel: "number input",
                    minusBtnAriaLabel: "minus",
                    plusBtnAriaLabel: "plus",
                    widthChars: 10,
                    unit: "%",
                    validated: "dblocksMonitoringThreshold" in this.state.error && this.state.error["dblocksMonitoringThreshold"] ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ) })
              ]
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
            Grid,
            {
              title: _22("Sets the amount of time (milliseconds) that the monitoring thread spends waiting between checks. (nsslapd-db-locks-monitoring-pause)."),
              className: "ds-margin-top",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 3, children: _22("DB Locks Pause Milliseconds") }),
                /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                  NumberInput,
                  {
                    value: dblocksPause,
                    min: 0,
                    max: this.maxValue,
                    onMinus: () => {
                      this.onMinusConfig("dblocksMonitoringPause");
                    },
                    onChange: (e) => {
                      this.onConfigChange(e, "dblocksMonitoringPause", 0, 0);
                    },
                    onPlus: () => {
                      this.onPlusConfig("dblocksMonitoringPause");
                    },
                    inputName: "input",
                    inputAriaLabel: "number input",
                    minusBtnAriaLabel: "minus",
                    plusBtnAriaLabel: "plus",
                    widthChars: 10,
                    validated: "dblocksMonitoringPause" in this.state.error && this.state.error["dblocksMonitoringPause"] ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ) })
              ]
            }
          )
        ] });
      }
      if (this.state.db_cache_auto) {
        db_cache_form = /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "ds-margin-left", children: [
          /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
            Grid,
            {
              title: _22("Enable database and entry cache auto-tuning using a percentage of the system's current resources (nsslapd-cache-autosize). If 0 is set, the default value is used instead."),
              className: "ds-margin-top",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 3, children: _22("Memory Percentage") }),
                /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                    NumberInput,
                    {
                      value: this.state.autosize,
                      min: 0,
                      max: 100,
                      onMinus: () => {
                        this.onMinusConfig("autosize");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "autosize", 0, 100);
                      },
                      onPlus: () => {
                        this.onPlusConfig("autosize");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 4,
                      unit: "%",
                      validated: "autosize" in this.state.error && this.state.error["autosize"] ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(HelperTextItem, { variant: "indeterminate", children: "Set the percentage to zero to manually tune the DB and entry cache" }) })
                ] })
              ]
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
            Grid,
            {
              title: _22("Sets the percentage of memory that is used for the database cache. The remaining percentage is used for the entry cache (nsslapd-cache-autosize-split). If 0 is set, the default value is used instead."),
              className: "ds-margin-top",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 3, children: _22("DB Cache Percentage") }),
                /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                  NumberInput,
                  {
                    value: this.state.autosizesplit,
                    min: 1,
                    max: 99,
                    onMinus: () => {
                      this.onMinusConfig("autosizesplit");
                    },
                    onChange: (e) => {
                      this.onConfigChange(e, "autosizesplit", 1, 99);
                    },
                    onPlus: () => {
                      this.onPlusConfig("autosizesplit");
                    },
                    inputName: "input",
                    inputAriaLabel: "number input",
                    minusBtnAriaLabel: "minus",
                    plusBtnAriaLabel: "plus",
                    widthChars: 4,
                    unit: "%",
                    validated: "autosizesplit" in this.state.error && this.state.error["autosizesplit"] ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ) })
              ]
            }
          )
        ] });
        db_auto_checked = true;
      } else {
        const dbcache_pretty = displayBytes(this.state.dbcachesize);
        db_cache_form = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "ds-margin-left", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
          Grid,
          {
            title: _22("Specifies the database index cache size in bytes (nsslapd-dbcachesize)."),
            className: "ds-margin-top",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 3, children: _22("Database Cache Size") }),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 9, title: dbcache_pretty, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                NumberInput,
                {
                  value: this.state.dbcachesize,
                  min: 512e3,
                  max: this.maxValue,
                  onMinus: () => {
                    this.onMinusConfig("dbcachesize");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "dbcachesize", 512e3, 0);
                  },
                  onPlus: () => {
                    this.onPlusConfig("dbcachesize");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 10,
                  validated: "dbcachesize" in this.state.error && this.state.error["dbcachesize"] ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ]
          }
        ) });
        db_auto_checked = false;
      }
      if (this.state.import_cache_auto) {
        import_cache_form = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { id: "auto-import-cache-form", className: "ds-margin-left", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
          Grid,
          {
            title: _22("Enter '-1' to use 50% of available memory, '0' to disable autotuning, or enter the percentage of available memory to use.  Value range -1 through 100, default is '-1' (nsslapd-import-cache-autosize)."),
            className: "ds-margin-top",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 3, children: _22("Import Cache Autosize") }),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                NumberInput,
                {
                  value: this.state.importcacheauto,
                  min: -1,
                  max: 100,
                  onMinus: () => {
                    this.onMinusConfig("importcacheauto");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "importcacheauto", -1, 100);
                  },
                  onPlus: () => {
                    this.onPlusConfig("importcacheauto");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 4,
                  unit: this.state.importcacheauto > 0 ? "%" : "",
                  validated: "importcacheauto" in this.state.error && this.state.error["importcacheauto"] ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ]
          }
        ) });
        import_auto_checked = true;
      } else {
        const import_pretty = displayBytes(this.state.importcachesize);
        import_cache_form = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "ds-margin-left", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
          Grid,
          {
            title: _22("The size of the database cache in bytes used in the bulk import process. (nsslapd-import-cachesize)."),
            className: "ds-margin-top",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 3, children: _22("Import Cache Size") }),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 9, title: import_pretty, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                NumberInput,
                {
                  value: this.state.importcachesize,
                  min: 512e3,
                  max: this.maxValue,
                  onMinus: () => {
                    this.onMinusConfig("importcachesize");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "importcachesize", 512e3, 0);
                  },
                  onPlus: () => {
                    this.onPlusConfig("importcachesize");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 10,
                  validated: "importcachesize" in this.state.error && this.state.error["importcachesize"] ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ]
          }
        ) });
        import_auto_checked = false;
      }
      let spinner = "";
      if (this.props.loading) {
        spinner = /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "ds-loading-spinner ds-margin-top-xlg ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { component: TextVariants.h3, children: "Loading global database configuration ..." }) }),
          /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Spinner, { className: "ds-margin-top", size: "md" })
        ] });
      }
      let saveBtnName = _22("Save Config");
      const extraPrimaryProps = {};
      if (this.props.refreshing) {
        saveBtnName = _22("Saving config ...");
        extraPrimaryProps.spinnerAriaValueText = _22("Saving");
      }
      const dnAttrs = this.props.attributes.filter(
        (attr) => (attr.syntax && attr.syntax[0] === this.dn_syntax_oids[0] || attr.syntax && attr.syntax[0] === this.dn_syntax_oids[1]) && attr.name !== void 0 && attr.name[0].toLowerCase() !== this.state.dynamicurlattr.toLowerCase()
      );
      const urlAttrs = this.props.attributes.filter(
        (attr) => attr.name !== void 0 && attr.name[0].toLowerCase() !== this.state.dynamiclistattr.toLowerCase()
      );
      return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: this.state.saving ? "ds-disabled ds-margin-bottom-md" : "ds-margin-bottom-md", id: "db-global-page", children: [
        spinner,
        /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: this.props.loading ? "ds-fadeout" : "ds-fadein", children: [
          /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { component: TextVariants.h2, children: [
            _22("Global Database Configuration"),
            /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
              Button,
              {
                variant: "plain",
                "aria-label": _22("Refresh config settings"),
                onClick: () => {
                  this.props.reload(this.state.activeTabKey);
                },
                children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SyncAltIcon, {})
              }
            )
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Tabs, { isFilled: true, activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
            /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabTitleText, { children: _22("Limits") }), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "ds-margin-left", children: [
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("The maximum number of entries that the Directory Server will check when examining candidate entries in response to a search request (nsslapd-lookthrough-limit)."),
                  className: "ds-margin-top-xlg",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Database Look Through Limit") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      NumberInput,
                      {
                        value: this.state.looklimit,
                        min: -1,
                        max: this.maxValue,
                        onMinus: () => {
                          this.onMinusConfig("looklimit");
                        },
                        onChange: (e) => {
                          this.onConfigChange(e, "looklimit", -1, 0);
                        },
                        onPlus: () => {
                          this.onPlusConfig("looklimit");
                        },
                        inputName: "input",
                        inputAriaLabel: "number input",
                        minusBtnAriaLabel: "minus",
                        plusBtnAriaLabel: "plus",
                        widthChars: 10,
                        validated: "looklimit" in this.state.error && this.state.error["looklimit"] ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("The number of entry IDs that are searched during a search operation (nsslapd-idlistscanlimit)."),
                  className: "ds-margin-top",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("ID List Scan Limit") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      NumberInput,
                      {
                        value: this.state.idscanlimit,
                        min: 100,
                        max: this.maxValue,
                        onMinus: () => {
                          this.onMinusConfig("idscanlimit");
                        },
                        onChange: (e) => {
                          this.onConfigChange(e, "idscanlimit", 100, 0);
                        },
                        onPlus: () => {
                          this.onPlusConfig("idscanlimit");
                        },
                        inputName: "input",
                        inputAriaLabel: "number input",
                        minusBtnAriaLabel: "minus",
                        plusBtnAriaLabel: "plus",
                        widthChars: 10,
                        validated: "idscanlimit" in this.state.error && this.state.error["idscanlimit"] ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("The maximum number of entries that the Directory Server will check when examining candidate entries for a search which uses the simple paged results control (nsslapd-pagedlookthroughlimit)."),
                  className: "ds-margin-top",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Paged Search Look Through Limit") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      NumberInput,
                      {
                        value: this.state.pagelooklimit,
                        min: -1,
                        max: this.maxValue,
                        onMinus: () => {
                          this.onMinusConfig("pagelooklimit");
                        },
                        onChange: (e) => {
                          this.onConfigChange(e, "pagelooklimit", -1, 0);
                        },
                        onPlus: () => {
                          this.onPlusConfig("pagelooklimit");
                        },
                        inputName: "input",
                        inputAriaLabel: "number input",
                        minusBtnAriaLabel: "minus",
                        plusBtnAriaLabel: "plus",
                        widthChars: 10,
                        validated: "pagelooklimit" in this.state.error && this.state.error["pagelooklimit"] ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("The number of entry IDs that are searched, specifically, for a search operation using the simple paged results control (nsslapd-pagedidlistscanlimit)."),
                  className: "ds-margin-top",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Paged Search ID List Scan Limit") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      NumberInput,
                      {
                        value: this.state.pagescanlimit,
                        min: -1,
                        max: this.maxValue,
                        onMinus: () => {
                          this.onMinusConfig("pagescanlimit");
                        },
                        onChange: (e) => {
                          this.onConfigChange(e, "pagescanlimit", -1, 0);
                        },
                        onPlus: () => {
                          this.onPlusConfig("pagescanlimit");
                        },
                        inputName: "input",
                        inputAriaLabel: "number input",
                        minusBtnAriaLabel: "minus",
                        plusBtnAriaLabel: "plus",
                        widthChars: 10,
                        validated: "pagescanlimit" in this.state.error && this.state.error["pagescanlimit"] ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("The maximum number of entries that the Directory Server will check when examining candidate entries in response to a range search request (nsslapd-rangelookthroughlimit)."),
                  className: "ds-margin-top",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Range Search Look Through Limit") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      NumberInput,
                      {
                        value: this.state.rangelooklimit,
                        min: -1,
                        max: this.maxValue,
                        onMinus: () => {
                          this.onMinusConfig("rangelooklimit");
                        },
                        onChange: (e) => {
                          this.onConfigChange(e, "rangelooklimit", -1, 0);
                        },
                        onPlus: () => {
                          this.onPlusConfig("rangelooklimit");
                        },
                        inputName: "input",
                        inputAriaLabel: "number input",
                        minusBtnAriaLabel: "minus",
                        plusBtnAriaLabel: "plus",
                        widthChars: 10,
                        validated: "rangelooklimit" in this.state.error && this.state.error["rangelooklimit"] ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              )
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabTitleText, { children: _22("Database Cache") }), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "ds-margin-left", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Grid, { className: "ds-margin-top-xlg", children: [
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                Checkbox,
                {
                  label: _22("Automatic Cache Tuning"),
                  onChange: (e, str) => this.handleChange(e, str),
                  isChecked: db_auto_checked,
                  "aria-label": "uncontrolled checkbox example",
                  id: "db_cache_auto"
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 12, children: db_cache_form })
            ] }) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabTitleText, { children: _22("Import Cache") }), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "ds-margin-left", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Grid, { className: "ds-margin-top-xlg", children: [
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                Checkbox,
                {
                  label: _22("Automatic Import Cache Tuning"),
                  title: _22("Set import cache to be set automatically"),
                  onChange: (e, str) => this.handleChange(e, str),
                  isChecked: import_auto_checked,
                  "aria-label": "uncontrolled checkbox example",
                  id: "import_cache_auto"
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 12, children: import_cache_form })
            ] }) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Tab, { eventKey: 3, title: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabTitleText, { children: _22("NDN Cache") }), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "ds-margin-left", children: [
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                Grid,
                {
                  title: _22("Warning: Normalized DN Cache is disabled"),
                  className: "ds-margin-top-xlg",
                  children: this.props.data.ndn_cache_enabled === false && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                    Alert,
                    {
                      variant: "warning",
                      isInline: true,
                      title: _22("Normalized DN Cache is disabled"),
                      className: "ds-margin-bottom",
                      children: _22("The Normalized DN Cache is currently disabled. To enable it, go to Server Settings \u2192 Tuning & Limits and enable 'Normalized DN Cache', then restart the server for the changes to take effect.")
                    }
                  ) })
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("Set the maximum size in bytes for the Normalized DN Cache (nsslapd-ndn-cache-max-size)."),
                  className: "ds-margin-top-xlg",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Normalized DN Cache Max Size") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      NumberInput,
                      {
                        value: this.state.ndncachemaxsize,
                        min: 1e6,
                        max: this.maxValue,
                        onMinus: () => {
                          this.onMinusConfig("ndncachemaxsize");
                        },
                        onChange: (e) => {
                          this.onConfigChange(e, "ndncachemaxsize", 1e6, 0);
                        },
                        onPlus: () => {
                          this.onPlusConfig("ndncachemaxsize");
                        },
                        inputName: "input",
                        inputAriaLabel: "number input",
                        minusBtnAriaLabel: "minus",
                        plusBtnAriaLabel: "plus",
                        widthChars: 10,
                        validated: "ndncachemaxsize" in this.state.error && this.state.error["ndncachemaxsize"] ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              )
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Tab, { eventKey: 4, title: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabTitleText, { children: _22("Database Locks") }), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "ds-margin-left", children: [
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("The number of database locks (nsslapd-db-locks)."),
                  className: "ds-margin-top-xlg",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 2, children: _22("Database Locks") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      NumberInput,
                      {
                        value: this.state.dblocks,
                        min: 1e4,
                        max: this.maxValue,
                        onMinus: () => {
                          this.onMinusConfig("dblocks");
                        },
                        onChange: (e) => {
                          this.onConfigChange(e, "dblocks", 1e4, 0);
                        },
                        onPlus: () => {
                          this.onPlusConfig("dblocks");
                        },
                        inputName: "input",
                        inputAriaLabel: "number input",
                        minusBtnAriaLabel: "minus",
                        plusBtnAriaLabel: "plus",
                        widthChars: 10,
                        validated: "dblocks" in this.state.error && this.state.error["dblocks"] ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Grid, { className: "ds-margin-top-xlg", children: [
                /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(GridItem, { span: 12, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "ds-inline", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                    Checkbox,
                    {
                      label: _22("Enable DB Lock Monitoring"),
                      id: "dblocksMonitoring",
                      isChecked: this.state.dblocksMonitoring,
                      onChange: (e, val) => this.handleSelectDBLocksMonitoring(e, val),
                      "aria-label": "uncontrolled checkbox example"
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "ds-inline", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                    Tooltip,
                    {
                      id: "dblockmonitor",
                      position: "bottom",
                      content: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { children: _22("Database lock monitoring checks if the database locks are about to be exhausted, and if they are the server will abort all the current searches in order to prevent database corruption.") }),
                      children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                        import_outlined_question_circle_icon2.OutlinedQuestionCircleIcon,
                        {
                          className: "ds-left-margin"
                        }
                      )
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 12, children: dblocksMonitor })
              ] })
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Tab, { eventKey: 5, title: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabTitleText, { children: _22("Dynamic Lists") }), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
              DynamicLists,
              {
                dynamiclistsenabled: this.state.dynamiclistsenabled,
                handleChange: this.handleChange,
                objectClasses: this.props.objectClasses,
                dynamicoc: this.state.dynamicoc,
                dynamicurlattr: this.state.dynamicurlattr,
                dynamiclistattr: this.state.dynamiclistattr,
                dnAttrs,
                urlAttrs
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Tab, { eventKey: 6, title: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabTitleText, { children: _22("Advanced Settings") }), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "ds-margin-left", children: [
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("Database Transaction Log Location (nsslapd-db-logdirectory)."),
                  className: "ds-margin-top-xlg",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Transaction Logs Directory") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      TextInput,
                      {
                        value: this.state.txnlogdir,
                        type: "text",
                        id: "txnlogdir",
                        "aria-describedby": "txnlogdir",
                        name: "txnlogdir",
                        onChange: (e, str) => this.handleChange(e, str)
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("Location for database memory mapped files.  You must specify a subdirectory of a tempfs type filesystem (nsslapd-db-home-directory)."),
                  className: "ds-margin-top",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Database Home Directory") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      TextInput,
                      {
                        value: this.state.dbhomedir,
                        type: "text",
                        id: "dbhomedir",
                        "aria-describedby": "dbhomedir",
                        name: "dbhomedir",
                        onChange: (e, str) => this.handleChange(e, str)
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("The Time Of Day to perform the database compaction after the compact interval has been met.  Uses the format: 'HH:MM' and defaults to '23:59'. (nsslapd-db-compactdb-time)"),
                  className: "ds-margin-top",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Database Compaction Time") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      TimePicker,
                      {
                        time: this.state.compacttime,
                        onChange: this.handleTimeChange,
                        is24Hour: true
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("The interval in seconds when the database is compacted (nsslapd-db-compactdb-interval). The default is 30 days at midnight. 0 is no compaction."),
                  className: "ds-margin-top",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Database Compaction Interval") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      NumberInput,
                      {
                        value: this.state.compactinterval,
                        min: 0,
                        max: this.maxValue,
                        onMinus: () => {
                          this.onMinusConfig("compactinterval");
                        },
                        onChange: (e) => {
                          this.onConfigChange(e, "compactinterval", 0, 0);
                        },
                        onPlus: () => {
                          this.onPlusConfig("compactinterval");
                        },
                        inputName: "input",
                        inputAriaLabel: "number input",
                        minusBtnAriaLabel: "minus",
                        plusBtnAriaLabel: "plus",
                        widthChars: 10,
                        validated: "compactinterval" in this.state.error && this.state.error["compactinterval"] ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("Amount of time in seconds after which the Directory Server sends a checkpoint entry to the database transaction log (nsslapd-db-checkpoint-interval)."),
                  className: "ds-margin-top",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Database Checkpoint Interval") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      NumberInput,
                      {
                        value: this.state.chxpoint,
                        min: 10,
                        max: 300,
                        onMinus: () => {
                          this.onMinusConfig("chxpoint");
                        },
                        onChange: (e) => {
                          this.onConfigChange(e, "chxpoint", 10, 0);
                        },
                        onPlus: () => {
                          this.onPlusConfig("chxpoint");
                        },
                        inputName: "input",
                        inputAriaLabel: "number input",
                        minusBtnAriaLabel: "minus",
                        plusBtnAriaLabel: "plus",
                        widthChars: 10,
                        validated: "chxpoint" in this.state.error && this.state.error["chxpoint"] ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              )
            ] }) })
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
            Button,
            {
              className: "ds-margin-top-lg ds-margin-left",
              onClick: this.handleSaveDBConfig,
              variant: "primary",
              isLoading: this.state.saving,
              spinnerAriaValueText: this.state.saving ? _22("Saving") : void 0,
              ...extraPrimaryProps,
              isDisabled: this.state.saveBtnDisabled || this.state.saving,
              children: saveBtnName
            }
          )
        ] })
      ] });
    }
  };
  GlobalDatabaseConfig.propTypes = {
    serverId: import_prop_types23.default.string,
    addNotification: import_prop_types23.default.func,
    data: import_prop_types23.default.object,
    reload: import_prop_types23.default.func,
    enableTree: import_prop_types23.default.func
  };
  GlobalDatabaseConfig.defaultProps = {
    serverId: "",
    data: {}
  };
  var GlobalDatabaseConfigMDB = class extends import_react38.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "ismounted", false);
      this.state = {
        saving: false,
        saveBtnDisabled: true,
        availDbSizeBytes: 0,
        error: {},
        activeTabKey: this.props.data.activeTab,
        urlAttrs: [],
        dnAttrs: [],
        autosize: parseInt(this.props.data.autosize),
        looklimit: parseInt(this.props.data.looklimit),
        idscanlimit: parseInt(this.props.data.idscanlimit),
        pagelooklimit: parseInt(this.props.data.pagelooklimit),
        pagescanlimit: parseInt(this.props.data.pagescanlimit),
        rangelooklimit: parseInt(this.props.data.rangelooklimit),
        dbhomedir: this.props.data.dbhomedir,
        mdbmaxsize: parseInt(this.props.data.mdbmaxsize),
        mdbmaxreaders: parseInt(this.props.data.mdbmaxreaders),
        mdbmaxdbs: parseInt(this.props.data.mdbmaxdbs),
        ndncachemaxsize: parseInt(this.props.data.ndncachemaxsize),
        dynamiclistsenabled: this.props.data.dynamiclistsenabled,
        dynamiclistattr: this.props.data.dynamiclistattr,
        dynamicoc: this.props.data.dynamicoc,
        dynamicurlattr: this.props.data.dynamicurlattr,
        // These variables store the original value (used for saving config)
        _autosize: parseInt(this.props.data.autosize),
        _looklimit: parseInt(this.props.data.looklimit),
        _idscanlimit: parseInt(this.props.data.idscanlimit),
        _pagelooklimit: parseInt(this.props.data.pagelooklimit),
        _pagescanlimit: parseInt(this.props.data.pagescanlimit),
        _rangelooklimit: parseInt(this.props.data.rangelooklimit),
        _dbhomedir: this.props.data.dbhomedir,
        _mdbmaxsize: parseInt(this.props.data.mdbmaxsize),
        _mdbmaxreaders: parseInt(this.props.data.mdbmaxreaders),
        _mdbmaxdbs: parseInt(this.props.data.mdbmaxdbs),
        _ndncachemaxsize: parseInt(this.props.data.ndncachemaxsize),
        _dynamiclistsenabled: this.props.data.dynamiclistsenabled,
        _dynamiclistattr: this.props.data.dynamiclistattr,
        _dynamicoc: this.props.data.dynamicoc,
        _dynamicurlattr: this.props.data.dynamicurlattr
      };
      this.isFieldValid = this.isFieldValid.bind(this);
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
      this.handleChange = this.handleChange.bind(this);
      this.handleSaveDBConfig = this.handleSaveDBConfig.bind(this);
      this.loadAvailableDiskSpace = this.loadAvailableDiskSpace.bind(this);
      this.dn_syntax_oids = [
        "1.3.6.1.4.1.1466.115.121.1.34",
        "1.3.6.1.4.1.1466.115.121.1.12"
      ];
      this.validationFields = [
        "looklimit",
        "idscanlimit",
        "pagelooklimit",
        "pagescanlimit",
        "rangelooklimit",
        "ndncachemaxsize",
        "mdbmaxsize",
        "mdbmaxreaders",
        "mdbmaxdbs",
        "autosize",
        "dynamiclistsenabled",
        "dynamiclistattr",
        "dynamicoc",
        "dynamicurlattr"
      ];
      this.fieldValidationRules = (fieldId) => {
        switch (fieldId) {
          case "mdbmaxsize":
            return {
              min: 100,
              max: Math.floor(this.state.availDbSizeBytes / (1024 * 1024)),
              special: null
            };
          case "mdbmaxreaders":
            return { min: 26, max: 200, special: 0 };
          // 0 = auto-tune
          case "mdbmaxdbs":
            return { min: 131, max: 5e3, special: 0 };
          // 0 = auto-tune
          case "autosize":
            return { min: 1, max: 100, special: 0 };
          // 0 = auto-tune
          case "looklimit":
            return { min: 0, max: this.maxValue, special: -1 };
          // -1 = unlimited
          case "ndncachemaxsize":
            return { min: 1024e3, max: this.maxValue, special: null };
          case "idscanlimit":
            return { min: 100, max: this.maxValue, special: null };
          case "pagelooklimit":
            return { min: 0, max: this.maxValue, special: -1 };
          // -1 = unlimited
          case "pagescanlimit":
            return { min: 100, max: this.maxValue, special: 0 };
          case "rangelooklimit":
            return { min: 0, max: this.maxValue, special: -1 };
          // -1 = unlimited
          default:
            return { min: 0, max: this.maxValue, special: null };
        }
      };
      this.onConfigMinus = (id) => {
        let value = isNaN(this.state[id]) ? 0 : Number(this.state[id]);
        let error = { ...this.state.error };
        const rules = this.fieldValidationRules(id);
        const { min: min3, special } = rules;
        if (special !== null && value === special) {
          return;
        } else if (value === min3 && special !== null && special < min3) {
          value = special;
        } else if (value <= min3) {
          return;
        } else {
          value -= 1;
        }
        error[id] = !this.isFieldValid(id, value);
        this.setState({
          [id]: value,
          error
        }, () => {
          this.validateSaveBtn(id);
        });
      };
      this.onConfigChange = (event, id) => {
        const value = isNaN(event.target.value) ? 0 : Number(event.target.value);
        let error = { ...this.state.error };
        error[id] = !this.isFieldValid(id, value);
        this.setState({
          [id]: value,
          error
        }, () => {
          this.validateSaveBtn(id);
        });
      };
      this.onConfigChangeBlur = (id) => {
        let value = isNaN(this.state[id]) ? 0 : Number(this.state[id]);
        let error = { ...this.state.error };
        const rules = this.fieldValidationRules(id);
        const { min: min3, max: max3, special } = rules;
        if (special !== null && value === special) {
        } else if (value < min3) {
          value = min3;
        } else if (value > max3) {
          value = max3;
        }
        error[id] = !this.isFieldValid(id, value);
        this.setState({
          [id]: value,
          error
        }, () => {
          this.validateSaveBtn(id);
        });
      };
      this.onConfigPlus = (id) => {
        let value = isNaN(this.state[id]) ? 0 : Number(this.state[id]);
        let error = { ...this.state.error };
        const rules = this.fieldValidationRules(id);
        const { min: min3, max: max3, special } = rules;
        if (special !== null && value === special) {
          value = min3;
        } else if (value >= max3) {
          return;
        } else {
          value += 1;
        }
        error[id] = !this.isFieldValid(id, value);
        this.setState({
          [id]: value,
          error
        }, () => {
          this.validateSaveBtn(id);
        });
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
    }
    // Helper method to determine if a field has specific validation rules (NumberInput) or uses defaults (text field)
    hasValidationRules(fieldId) {
      const rules = this.fieldValidationRules(fieldId);
      return !(rules.min === 0 && rules.max === this.maxValue && rules.special === null);
    }
    isFieldValid(fieldId, value) {
      const rules = this.fieldValidationRules(fieldId);
      const numValue = Number(value);
      if (rules.special !== null && rules.special === numValue) {
        return true;
      }
      const { min: min3, max: max3 } = rules;
      return numValue >= min3 && numValue <= max3;
    }
    getFieldMinValue(fieldId) {
      const rules = this.fieldValidationRules(fieldId);
      const { min: min3, special } = rules;
      if (special !== null && special < min3) {
        return special;
      }
      return min3;
    }
    getFieldMaxValue(fieldId) {
      const rules = this.fieldValidationRules(fieldId);
      return rules.max;
    }
    // int32 max
    get maxValue() {
      return 2147483647;
    }
    componentDidMount() {
      this.ismounted = true;
      this.props.enableTree();
      this.loadAvailableDiskSpace();
    }
    componentWillUnmount() {
      this.ismounted = false;
    }
    validateSaveBtn(fieldId) {
      let hasChanges = false;
      let hasErrors = false;
      let hasValidationErrors = false;
      for (const fieldName of this.validationFields) {
        if (!hasChanges && this.state[fieldName].toString() !== this.state["_" + fieldName].toString()) {
          hasChanges = true;
        }
        if (!hasErrors && this.state.error[fieldName]) {
          hasErrors = true;
        }
        if (!hasValidationErrors && hasChanges && !hasErrors) {
          if (this.hasValidationRules(fieldName) && !this.isFieldValid(fieldName, this.state[fieldName])) {
            hasValidationErrors = true;
          }
        }
        if (hasErrors || hasChanges && hasValidationErrors) {
          break;
        }
      }
      const saveBtnDisabled = !hasChanges || hasErrors || hasValidationErrors;
      this.setState({ saveBtnDisabled });
    }
    handleChange(e, str) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      const error = { ...this.state.error };
      error[attr] = this.hasValidationRules(attr) ? !this.isFieldValid(attr, value) : false;
      this.setState({
        [attr]: value,
        error
      }, () => {
        this.validateSaveBtn(attr);
      });
    }
    save_ndn_cache(requireRestart) {
      const msg = "Successfully updated database configuration";
      if (this.state._ndncachemaxsize !== this.state.ndncachemaxsize) {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "config",
          "replace",
          "nsslapd-ndn-cache-max-size=" + this.state.ndncachemaxsize
        ];
        log_cmd("save_ndn_cache", "Applying config change", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.props.reload(this.state.activeTabKey);
          this.setState({
            saving: false
          });
          if (requireRestart) {
            this.props.addNotification(
              "warning",
              cockpit_default.format(_22("$0. You must restart the Directory Server for these changes to take effect."), msg)
            );
          } else {
            this.props.addNotification(
              "success",
              msg
            );
          }
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.reload(this.state.activeTabKey);
          this.setState({
            saving: false
          });
          this.props.addNotification(
            "error",
            cockpit_default.format(_22("Error updating configuration - $0"), errMsg)
          );
        });
      } else {
        this.props.reload(this.state.activeTabKey);
        this.setState({
          saving: false
        });
        if (requireRestart) {
          this.props.addNotification(
            "warning",
            cockpit_default.format(_22("$0. You must restart the Directory Server for these changes to take effect."), msg)
          );
        } else {
          this.props.addNotification(
            "success",
            msg
          );
        }
      }
    }
    handleSaveDBConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "config",
        "set"
      ];
      let requireRestart = false;
      if (this.state._looklimit !== this.state.looklimit) {
        cmd.push("--lookthroughlimit=" + this.state.looklimit);
      }
      if (this.state._idscanlimit !== this.state.idscanlimit) {
        cmd.push("--idlistscanlimit=" + this.state.idscanlimit);
      }
      if (this.state._pagelooklimit !== this.state.pagelooklimit) {
        cmd.push("--pagedlookthroughlimit=" + this.state.pagelooklimit);
      }
      if (this.state._pagescanlimit !== this.state.pagescanlimit) {
        cmd.push("--pagedidlistscanlimit=" + this.state.pagescanlimit);
      }
      if (this.state._rangelooklimit !== this.state.rangelooklimit) {
        cmd.push("--rangelookthroughlimit=" + this.state.rangelooklimit);
      }
      if (this.state._mdbmaxsize !== this.state.mdbmaxsize) {
        const mdbmaxsizeMB = this.state.mdbmaxsize * 1024 * 1024;
        cmd.push("--mdb-max-size=" + mdbmaxsizeMB);
        requireRestart = true;
      }
      if (this.state._mdbmaxreaders !== this.state.mdbmaxreaders) {
        cmd.push("--mdb-max-readers=" + this.state.mdbmaxreaders);
        requireRestart = true;
      }
      if (this.state._mdbmaxdbs !== this.state.mdbmaxdbs) {
        cmd.push("--mdb-max-dbs=" + this.state.mdbmaxdbs);
        requireRestart = true;
      }
      if (this.state._autosize !== this.state.autosize) {
        cmd.push("--cache-autosize=" + this.state.autosize);
        requireRestart = true;
      }
      if (this.state._dynamiclistsenabled !== this.state.dynamiclistsenabled) {
        if (this.state.dynamiclistsenabled) {
          cmd.push("--enable-dynamic-lists");
        } else {
          cmd.push("--disable-dynamic-lists");
        }
      }
      if (this.state._dynamiclistattr !== this.state.dynamiclistattr) {
        cmd.push("--dynamic-list-attr=" + this.state.dynamiclistattr);
      }
      if (this.state._dynamicoc !== this.state.dynamicoc) {
        cmd.push("--dynamic-oc=" + this.state.dynamicoc);
      }
      if (this.state._dynamicurlattr !== this.state.dynamicurlattr) {
        cmd.push("--dynamic-url-attr=" + this.state.dynamicurlattr);
      }
      if (cmd.length > 6) {
        this.setState({
          saving: true
        });
        log_cmd("handleSaveDBConfig", "Applying config change", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.save_ndn_cache(requireRestart);
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.reload(this.state.activeTabKey);
          this.setState({
            saving: false
          });
          this.props.addNotification(
            "error",
            cockpit_default.format(_22("Error updating configuration - $0"), errMsg)
          );
        });
      } else {
        this.setState({
          saving: true
        }, () => {
          this.save_ndn_cache(requireRestart);
        });
      }
    }
    loadAvailableDiskSpace() {
      let available = 0;
      const cmd = "df -B1 " + this.state.dbhomedir + " | awk '{print $4}'";
      cockpit_default.script(cmd, [], { superuser: true, err: "message" }).done((output) => {
        available = output.split(/\s+/)[1];
        if (this.ismounted) {
          this.setState({
            availDbSizeBytes: available
          });
        }
      }).fail(() => {
        this.setState({
          availDbSizeBytes: available
        });
      });
    }
    render() {
      let spinner = "";
      let db_cache_form;
      let db_auto_checked = false;
      if (this.props.loading) {
        spinner = /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "ds-loading-spinner ds-margin-top-xlg ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { component: TextVariants.h3, children: "Loading global database configuration ..." }) }),
          /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Spinner, { className: "ds-margin-top", size: "md" })
        ] });
      }
      let saveBtnName = _22("Save Config");
      const extraPrimaryProps = {};
      if (this.props.refreshing) {
        saveBtnName = _22("Saving config ...");
        extraPrimaryProps.spinnerAriaValueText = _22("Saving");
      }
      if (this.state.db_cache_auto) {
        db_cache_form = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "ds-margin-left", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
          Grid,
          {
            title: _22("Enable entry cache auto-tuning using a percentage of the system's current resources (nsslapd-cache-autosize). If 0 is set, the default value is used instead."),
            className: "ds-margin-top",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 3, children: _22("Memory Percentage") }),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                NumberInput,
                {
                  value: Number(this.state.autosize),
                  min: this.getFieldMinValue("autosize"),
                  max: this.getFieldMaxValue("autosize"),
                  onMinus: () => {
                    this.onConfigMinus("autosize");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "autosize");
                  },
                  onBlur: () => {
                    this.onConfigChangeBlur("autosize");
                  },
                  onPlus: () => {
                    this.onConfigPlus("autosize");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 4,
                  unit: "%",
                  validated: "autosize" in this.state.error && this.state.error["autosize"] ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ]
          }
        ) });
        db_auto_checked = true;
      }
      const dnAttrs = this.props.attributes.filter(
        (attr) => (attr.syntax && attr.syntax[0] === this.dn_syntax_oids[0] || attr.syntax && attr.syntax[0] === this.dn_syntax_oids[1]) && attr.name !== void 0 && attr.name[0].toLowerCase() !== this.state.dynamicurlattr.toLowerCase()
      );
      const urlAttrs = this.props.attributes.filter(
        (attr) => attr.name !== void 0 && attr.name[0].toLowerCase() !== this.state.dynamiclistattr.toLowerCase()
      );
      const mdbmaxsizeMB = Math.floor(this.state.availDbSizeBytes / (1024 * 1024));
      return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: this.state.saving ? "ds-disabled ds-margin-bottom-md" : "ds-margin-bottom-md", id: "db-global-page", children: [
        spinner,
        /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: this.props.loading ? "ds-fadeout" : "ds-fadein", children: [
          /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { component: TextVariants.h2, children: [
            _22("Global Database Configuration"),
            /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
              Button,
              {
                variant: "plain",
                "aria-label": _22("Refresh config settings"),
                onClick: () => {
                  this.props.reload(this.state.activeTabKey);
                },
                children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SyncAltIcon, {})
              }
            )
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Tabs, { isFilled: true, activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
            /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabTitleText, { children: _22("Database Size") }), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "ds-margin-left", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
              Grid,
              {
                title: _22("Database maximum size in megabytes. The practical maximum size of an LMDB database is limited by the system's addressable memory (nsslapd-mdb-max-size)."),
                className: "ds-margin-top-xlg",
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Database Maximum Size") }),
                  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                    NumberInput,
                    {
                      value: Number(this.state.mdbmaxsize),
                      min: this.getFieldMinValue("mdbmaxsize"),
                      max: this.getFieldMaxValue("mdbmaxsize"),
                      onMinus: () => {
                        this.onConfigMinus("mdbmaxsize");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "mdbmaxsize");
                      },
                      onBlur: () => {
                        this.onConfigChangeBlur("mdbmaxsize");
                      },
                      onPlus: () => {
                        this.onConfigPlus("mdbmaxsize");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      unit: "MB",
                      widthChars: 10,
                      validated: "mdbmaxsize" in this.state.error && this.state.error["mdbmaxsize"] ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ) })
                ]
              }
            ) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabTitleText, { children: _22("Limits") }), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "ds-margin-left", children: [
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("The maximum number of entries that the Directory Server will check when examining candidate entries in response to a search request (nsslapd-lookthrough-limit)."),
                  className: "ds-margin-top-xlg",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Database Look Through Limit") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      NumberInput,
                      {
                        value: Number(this.state.looklimit),
                        min: this.getFieldMinValue("looklimit"),
                        max: this.getFieldMaxValue("looklimit"),
                        onMinus: () => {
                          this.onConfigMinus("looklimit");
                        },
                        onChange: (e) => {
                          this.onConfigChange(e, "looklimit");
                        },
                        onBlur: () => {
                          this.onConfigChangeBlur("looklimit");
                        },
                        onPlus: () => {
                          this.onConfigPlus("looklimit");
                        },
                        inputName: "input",
                        inputAriaLabel: "number input",
                        minusBtnAriaLabel: "minus",
                        plusBtnAriaLabel: "plus",
                        widthChars: 10,
                        validated: "looklimit" in this.state.error && this.state.error["looklimit"] ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("The number of entry IDs that are searched during a search operation (nsslapd-idlistscanlimit)."),
                  className: "ds-margin-top-xlg",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("ID List Scan Limit") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      NumberInput,
                      {
                        value: Number(this.state.idscanlimit),
                        min: this.getFieldMinValue("idscanlimit"),
                        max: this.getFieldMaxValue("idscanlimit"),
                        onMinus: () => {
                          this.onConfigMinus("idscanlimit");
                        },
                        onChange: (e) => {
                          this.onConfigChange(e, "idscanlimit");
                        },
                        onBlur: () => {
                          this.onConfigChangeBlur("idscanlimit");
                        },
                        onPlus: () => {
                          this.onConfigPlus("idscanlimit");
                        },
                        inputName: "input",
                        inputAriaLabel: "number input",
                        minusBtnAriaLabel: "minus",
                        plusBtnAriaLabel: "plus",
                        widthChars: 10,
                        validated: "idscanlimit" in this.state.error && this.state.error["idscanlimit"] ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("The maximum number of entries that the Directory Server will check when examining candidate entries for a search which uses the simple paged results control (nsslapd-pagedlookthroughlimit)."),
                  className: "ds-margin-top-xlg",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Paged Search Look Through Limit") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      NumberInput,
                      {
                        value: Number(this.state.pagelooklimit),
                        min: this.getFieldMinValue("pagelooklimit"),
                        max: this.getFieldMaxValue("pagelooklimit"),
                        onMinus: () => {
                          this.onConfigMinus("pagelooklimit");
                        },
                        onChange: (e) => {
                          this.onConfigChange(e, "pagelooklimit");
                        },
                        onBlur: () => {
                          this.onConfigChangeBlur("pagelooklimit");
                        },
                        onPlus: () => {
                          this.onConfigPlus("pagelooklimit");
                        },
                        inputName: "input",
                        inputAriaLabel: "number input",
                        minusBtnAriaLabel: "minus",
                        plusBtnAriaLabel: "plus",
                        widthChars: 10,
                        validated: "pagelooklimit" in this.state.error && this.state.error["pagelooklimit"] ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("The number of entry IDs that are searched, specifically, for a search operation using the simple paged results control (nsslapd-pagedidlistscanlimit)."),
                  className: "ds-margin-top-xlg",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Paged Search ID List Scan Limit") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      NumberInput,
                      {
                        value: Number(this.state.pagescanlimit),
                        min: this.getFieldMinValue("pagescanlimit"),
                        max: this.getFieldMaxValue("pagescanlimit"),
                        onMinus: () => {
                          this.onConfigMinus("pagescanlimit");
                        },
                        onChange: (e) => {
                          this.onConfigChange(e, "pagescanlimit");
                        },
                        onBlur: () => {
                          this.onConfigChangeBlur("pagescanlimit");
                        },
                        onPlus: () => {
                          this.onConfigPlus("pagescanlimit");
                        },
                        inputName: "input",
                        inputAriaLabel: "number input",
                        minusBtnAriaLabel: "minus",
                        plusBtnAriaLabel: "plus",
                        widthChars: 10,
                        validated: "pagescanlimit" in this.state.error && this.state.error["pagescanlimit"] ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("The maximum number of entries that the Directory Server will check when examining candidate entries in response to a range search request (nsslapd-rangelookthroughlimit)."),
                  className: "ds-margin-top-xlg",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Range Search Look Through Limit") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      NumberInput,
                      {
                        value: Number(this.state.rangelooklimit),
                        min: this.getFieldMinValue("rangelooklimit"),
                        max: this.getFieldMaxValue("rangelooklimit"),
                        onMinus: () => {
                          this.onConfigMinus("rangelooklimit");
                        },
                        onChange: (e) => {
                          this.onConfigChange(e, "rangelooklimit");
                        },
                        onBlur: () => {
                          this.onConfigChangeBlur("rangelooklimit");
                        },
                        onPlus: () => {
                          this.onConfigPlus("rangelooklimit");
                        },
                        inputName: "input",
                        inputAriaLabel: "number input",
                        minusBtnAriaLabel: "minus",
                        plusBtnAriaLabel: "plus",
                        widthChars: 10,
                        validated: "rangelooklimit" in this.state.error && this.state.error["rangelooklimit"] ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              )
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabTitleText, { children: _22("NDN Cache") }), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "ds-margin-left", children: [
              /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                Grid,
                {
                  title: _22("Warning: Normalized DN Cache is disabled"),
                  className: "ds-margin-top-xlg",
                  children: this.props.data.ndn_cache_enabled === false && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                    Alert,
                    {
                      variant: "warning",
                      isInline: true,
                      title: _22("Normalized DN Cache is disabled"),
                      className: "ds-margin-bottom",
                      children: _22("The Normalized DN Cache is currently disabled. To enable it, go to Server Settings \u2192 Tuning & Limits and enable 'Normalized DN Cache', then restart the server for the changes to take effect.")
                    }
                  ) })
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("Set the maximum size in bytes for the Normalized DN Cache (nsslapd-ndn-cache-max-size)."),
                  className: "ds-margin-top-xlg",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Normalized DN Cache Max Size") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      NumberInput,
                      {
                        value: Number(this.state.ndncachemaxsize),
                        min: this.getFieldMinValue("ndncachemaxsize"),
                        max: this.getFieldMaxValue("ndncachemaxsize"),
                        onMinus: () => {
                          this.onConfigMinus("ndncachemaxsize");
                        },
                        onChange: (e) => {
                          this.onConfigChange(e, "ndncachemaxsize");
                        },
                        onBlur: () => {
                          this.onConfigChangeBlur("ndncachemaxsize");
                        },
                        onPlus: () => {
                          this.onConfigPlus("ndncachemaxsize");
                        },
                        inputName: "input",
                        inputAriaLabel: "number input",
                        minusBtnAriaLabel: "minus",
                        plusBtnAriaLabel: "plus",
                        widthChars: 10,
                        validated: "ndncachemaxsize" in this.state.error && this.state.error["ndncachemaxsize"] ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              )
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Tab, { eventKey: 3, title: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabTitleText, { children: _22("Dynamic Lists") }), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
              DynamicLists,
              {
                dynamiclistsenabled: this.state.dynamiclistsenabled,
                handleChange: this.handleChange,
                objectClasses: this.props.objectClasses,
                dynamicoc: this.state.dynamicoc,
                dynamicurlattr: this.state.dynamicurlattr,
                dynamiclistattr: this.state.dynamiclistattr,
                dnAttrs,
                urlAttrs
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Tab, { eventKey: 4, title: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabTitleText, { children: _22("Advanced Settings") }), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "ds-margin-left", children: [
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("Location for database memory mapped files, this element is read only."),
                  className: "ds-margin-top-xlg",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Database Home Directory") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      TextInput,
                      {
                        value: this.state.dbhomedir,
                        type: "text",
                        readOnlyVariant: "plain",
                        id: "dbhomedir",
                        "aria-describedby": "dbhomedir",
                        name: "dbhomedir read only"
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("The maximum number of read transactions that can be opened simultaneously. A value of 0 means this value is computed by the server (nsslapd-mdb-max-readers)."),
                  className: "ds-margin-top-xlg",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Database Max Readers") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      NumberInput,
                      {
                        value: Number(this.state.mdbmaxreaders),
                        min: this.getFieldMinValue("mdbmaxreaders"),
                        max: this.getFieldMaxValue("mdbmaxreaders"),
                        onMinus: () => {
                          this.onConfigMinus("mdbmaxreaders");
                        },
                        onChange: (e) => {
                          this.onConfigChange(e, "mdbmaxreaders");
                        },
                        onBlur: () => {
                          this.onConfigChangeBlur("mdbmaxreaders");
                        },
                        onPlus: () => {
                          this.onConfigPlus("mdbmaxreaders");
                        },
                        inputName: "input",
                        inputAriaLabel: "number input",
                        minusBtnAriaLabel: "minus",
                        plusBtnAriaLabel: "plus",
                        widthChars: 10,
                        validated: "mdbmaxreaders" in this.state.error && this.state.error["mdbmaxreaders"] ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("The maximum number of named database instances that can be included within the memory mapped database file. A value of 0 means this value is computed by the server (nsslapd-mdb-max-dbs)."),
                  className: "ds-margin-top-xlg",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { className: "ds-label", span: 4, children: _22("Database Max DBs") }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                      NumberInput,
                      {
                        value: Number(this.state.mdbmaxdbs),
                        min: this.getFieldMinValue("mdbmaxdbs"),
                        max: this.getFieldMaxValue("mdbmaxdbs"),
                        onMinus: () => {
                          this.onConfigMinus("mdbmaxdbs");
                        },
                        onChange: (e) => {
                          this.onConfigChange(e, "mdbmaxdbs");
                        },
                        onBlur: () => {
                          this.onConfigChangeBlur("mdbmaxdbs");
                        },
                        onPlus: () => {
                          this.onConfigPlus("mdbmaxdbs");
                        },
                        inputName: "input",
                        inputAriaLabel: "number input",
                        minusBtnAriaLabel: "minus",
                        plusBtnAriaLabel: "plus",
                        widthChars: 10,
                        validated: "mdbmaxdbs" in this.state.error && this.state.error["mdbmaxdbs"] ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
                Grid,
                {
                  title: _22("Enable entry cache auto-tuning using a percentage of the system's current resources (nsslapd-cache-autosize). If 0 is set, the default value is used instead."),
                  className: "ds-margin-top-xlg",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(GridItem, { className: "ds-label", span: 4, children: [
                      "Cache ",
                      _22("Memory Percentage")
                    ] }),
                    /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(GridItem, { span: 8, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
                        NumberInput,
                        {
                          value: Number(this.state.autosize),
                          min: this.getFieldMinValue("autosize"),
                          max: this.getFieldMaxValue("autosize"),
                          onMinus: () => {
                            this.onConfigMinus("autosize");
                          },
                          onChange: (e) => {
                            this.onConfigChange(e, "autosize");
                          },
                          onBlur: () => {
                            this.onConfigChangeBlur("autosize");
                          },
                          onPlus: () => {
                            this.onConfigPlus("autosize");
                          },
                          inputName: "input",
                          inputAriaLabel: "number input",
                          minusBtnAriaLabel: "minus",
                          plusBtnAriaLabel: "plus",
                          widthChars: 10,
                          unit: "%",
                          validated: "autosize" in this.state.error && this.state.error["autosize"] ? ValidatedOptions.error : ValidatedOptions.default
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(HelperTextItem, { variant: "indeterminate", children: "Set the percentage to zero to manually tune entry cache" }) })
                    ] })
                  ]
                }
              )
            ] }) })
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
            Button,
            {
              className: "ds-margin-top-lg ds-margin-left",
              onClick: this.handleSaveDBConfig,
              variant: "primary",
              isLoading: this.state.saving,
              spinnerAriaValueText: this.state.saving ? _22("Saving") : void 0,
              ...extraPrimaryProps,
              isDisabled: this.state.saveBtnDisabled || this.state.saving,
              children: saveBtnName
            }
          )
        ] })
      ] });
    }
  };
  GlobalDatabaseConfigMDB.propTypes = {
    serverId: import_prop_types23.default.string,
    addNotification: import_prop_types23.default.func,
    data: import_prop_types23.default.object,
    reload: import_prop_types23.default.func,
    enableTree: import_prop_types23.default.func,
    attributes: import_prop_types23.default.array,
    objectClasses: import_prop_types23.default.array
  };
  GlobalDatabaseConfigMDB.defaultProps = {
    serverId: "",
    data: {},
    attributes: [],
    objectClasses: []
  };

  // src/lib/database/suffix.jsx
  var import_react51 = __toESM(require_react(), 1);

  // node_modules/@patternfly/react-log-viewer/dist/esm/LogViewer/LogViewer.js
  init_tslib_es6();
  var import_react42 = __toESM(require_react());

  // node_modules/@patternfly/react-log-viewer/dist/esm/LogViewer/LogViewerContext.js
  var import_react39 = __toESM(require_react());
  var LogViewerContext = (0, import_react39.createContext)(null);
  var LogViewerToolbarContext = (0, import_react39.createContext)(null);

  // node_modules/@patternfly/react-log-viewer/dist/esm/LogViewer/LogViewerRow.js
  var import_react40 = __toESM(require_react());

  // node_modules/@patternfly/react-log-viewer/dist/esm/LogViewer/utils/constants.js
  var LOGGER_LINE_NUMBER_INDEX_DELTA = 1;
  var NUMBER_INDEX_DELTA = 1;
  var DEFAULT_INDEX = 0;
  var DEFAULT_MATCH = 0;
  var DEFAULT_FOCUS = -1;
  var DEFAULT_SEARCH_INDEX = 0;

  // node_modules/@patternfly/react-log-viewer/dist/esm/LogViewer/LogViewerRow.js
  var import_log_viewer = __toESM(require_log_viewer2());

  // node_modules/@patternfly/react-log-viewer/dist/esm/LogViewer/utils/utils.js
  var searchForKeyword = (searchedInput, parsedData, itemCount) => {
    const searchResults = [];
    const regex = new RegExp(searchedInput, "ig");
    parsedData.map((row, index) => {
      const rawRow = stripAnsi(row);
      if (regex.test(rawRow) && index < itemCount) {
        const numMatches = rawRow.match(regex).length;
        for (let i = 1; i <= numMatches; i++) {
          searchResults.push({ rowIndex: index, matchIndex: i });
        }
      }
    });
    if (searchResults.length > 0) {
      return [...searchResults];
    } else if (searchResults.length <= 0) {
      return [{ rowIndex: -1, matchIndex: 0 }];
    }
  };
  var parseConsoleOutput = (data) => {
    const stringToSplitWith = "\n";
    const parsedData = Array.isArray(data) ? data.join(stringToSplitWith) : data;
    const stringSplitting = parsedData.toString();
    const cleanString = stringSplitting.split(stringToSplitWith);
    return cleanString;
  };
  var escapeString = (inputString) => inputString.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
  var ansiRegexString = `[\x1B\x9B][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]`;
  var ansiRegex = new RegExp(ansiRegexString, "g");
  var isAnsi = (inputString) => inputString.match(ansiRegex);
  var stripAnsi = (inputString) => inputString.replace(ansiRegex, "");
  var splitAnsi = (inputString) => inputString.split(new RegExp(`(${ansiRegexString})`, "g"));
  var escapeTextForHtml = (inputString) => inputString.replace(/[&<>"']/gm, (str) => {
    if (str === "&") {
      return "&amp;";
    }
    if (str === "<") {
      return "&lt;";
    }
    if (str === ">") {
      return "&gt;";
    }
    if (str === '"') {
      return "&quot;";
    }
    if (str === "'") {
      return "&#x27;";
    }
  });

  // node_modules/@patternfly/react-log-viewer/dist/esm/LogViewer/LogViewerRow.js
  var LogViewerRow = (0, import_react40.memo)(({ index, style, data, ansiUp }) => {
    const { parsedData, searchedWordIndexes, rowInFocus } = data;
    const context = (0, import_react40.useContext)(LogViewerContext);
    const getData3 = (index2) => parsedData ? parsedData[index2] : null;
    const getRowIndex = (index2) => index2 + LOGGER_LINE_NUMBER_INDEX_DELTA;
    const handleHighlight = (matchCounter) => {
      const searchedWordResult = searchedWordIndexes.filter((searchedWord) => searchedWord.rowIndex === index);
      if (searchedWordResult.length !== 0) {
        if (rowInFocus.rowIndex === index && rowInFocus.matchIndex === matchCounter) {
          return import_log_viewer.default.modifiers.current;
        }
        return import_log_viewer.default.modifiers.match;
      }
      return "";
    };
    const getFormattedData = () => {
      const rowText = getData3(index);
      let matchCounter = 0;
      if (context.searchedInput) {
        const splitAnsiString = splitAnsi(rowText);
        const regEx = new RegExp(`(${escapeString(context.searchedInput)})`, "ig");
        const composedString = [];
        splitAnsiString.forEach((str) => {
          matchCounter = 0;
          if (isAnsi(str)) {
            composedString.push(str);
          } else {
            const splitString = str.split(regEx);
            splitString.forEach((substr) => {
              if (substr.match(regEx)) {
                matchCounter += 1;
                composedString.push(`<span class="${css(import_log_viewer.default.logViewerString, handleHighlight(matchCounter))}">${substr}</span>`);
              } else {
                composedString.push(escapeTextForHtml(substr));
              }
            });
          }
        });
        return composedString.join("");
      }
      return escapeTextForHtml(rowText);
    };
    return import_react40.default.createElement(
      "div",
      { style, className: css(import_log_viewer.default.logViewerListItem) },
      import_react40.default.createElement("span", { className: css(import_log_viewer.default.logViewerIndex) }, getRowIndex(index)),
      import_react40.default.createElement("span", { className: css(import_log_viewer.default.logViewerText), style: { width: "fit-content" }, dangerouslySetInnerHTML: { __html: ansiUp.ansi_to_html(getFormattedData()) } })
    );
  });
  LogViewerRow.displayName = "LogViewerRow";

  // node_modules/@patternfly/react-log-viewer/dist/esm/react-window/areEqual.js
  init_tslib_es6();

  // node_modules/@patternfly/react-log-viewer/dist/esm/react-window/shallowDiffers.js
  function shallowDiffers(prev, next) {
    for (const attribute in prev) {
      if (!(attribute in next)) {
        return true;
      }
    }
    for (const attribute in next) {
      if (prev[attribute] !== next[attribute]) {
        return true;
      }
    }
    return false;
  }

  // node_modules/@patternfly/react-log-viewer/dist/esm/react-window/areEqual.js
  function areEqual(prevProps, nextProps) {
    const { style: prevStyle } = prevProps, prevRest = __rest(prevProps, ["style"]);
    const { style: nextStyle } = nextProps, nextRest = __rest(nextProps, ["style"]);
    return !shallowDiffers(prevStyle, nextStyle) && !shallowDiffers(prevRest, nextRest);
  }

  // node_modules/memoize-one/dist/memoize-one.esm.js
  var safeIsNaN = Number.isNaN || function ponyfill(value) {
    return typeof value === "number" && value !== value;
  };
  function isEqual2(first, second2) {
    if (first === second2) {
      return true;
    }
    if (safeIsNaN(first) && safeIsNaN(second2)) {
      return true;
    }
    return false;
  }
  function areInputsEqual(newInputs, lastInputs) {
    if (newInputs.length !== lastInputs.length) {
      return false;
    }
    for (var i = 0; i < newInputs.length; i++) {
      if (!isEqual2(newInputs[i], lastInputs[i])) {
        return false;
      }
    }
    return true;
  }
  function memoizeOne(resultFn, isEqual12) {
    if (isEqual12 === void 0) {
      isEqual12 = areInputsEqual;
    }
    var lastThis;
    var lastArgs = [];
    var lastResult;
    var calledOnce = false;
    function memoized() {
      var newArgs = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        newArgs[_i] = arguments[_i];
      }
      if (calledOnce && lastThis === this && isEqual12(newArgs, lastArgs)) {
        return lastResult;
      }
      lastResult = resultFn.apply(this, newArgs);
      calledOnce = true;
      lastThis = this;
      lastArgs = newArgs;
      return lastResult;
    }
    return memoized;
  }
  var memoize_one_esm_default = memoizeOne;

  // node_modules/@patternfly/react-log-viewer/dist/esm/react-window/createListComponent.js
  var import_react41 = __toESM(require_react());

  // node_modules/@patternfly/react-log-viewer/dist/esm/react-window/timer.js
  var hasNativePerformanceNow = typeof performance === "object" && typeof performance.now === "function";
  var now = hasNativePerformanceNow ? () => performance.now() : () => Date.now();
  function cancelTimeout(timeoutID) {
    cancelAnimationFrame(timeoutID.id);
  }
  function requestTimeout(callback, delay3) {
    const start2 = now();
    function tick() {
      if (now() - start2 >= delay3) {
        callback.call(null);
      } else {
        timeoutID.id = requestAnimationFrame(tick);
      }
    }
    const timeoutID = {
      id: requestAnimationFrame(tick)
    };
    return timeoutID;
  }

  // node_modules/@patternfly/react-log-viewer/dist/esm/react-window/createListComponent.js
  var IS_SCROLLING_DEBOUNCE_INTERVAL = 150;
  var defaultItemKey = (index, _data) => index;
  var devWarningsTagName = null;
  if (true) {
    if (typeof window !== "undefined" && typeof window.WeakSet !== "undefined") {
      devWarningsTagName = /* @__PURE__ */ new WeakSet();
    }
  }
  function createListComponent({ getItemOffset, getEstimatedTotalSize: getEstimatedTotalSize2, getItemSize, getOffsetForIndexAndAlignment, getStartIndexForOffset, getStopIndexForStartIndex, initInstanceProps, shouldResetStyleCacheOnItemSizeChange, validateProps }) {
    var _a;
    return _a = class List extends import_react41.PureComponent {
      // Always use explicit constructor for React components.
      // It produces less code after transpilation. (#26)
      // eslint-disable-next-line no-useless-constructor
      constructor(props) {
        super(props);
        this._instanceProps = initInstanceProps(this.props, this);
        this._resetIsScrollingTimeoutId = null;
        this.state = {
          instance: this,
          isScrolling: false,
          scrollDirection: "forward",
          scrollOffset: typeof this.props.initialScrollOffset === "number" ? this.props.initialScrollOffset : 0,
          scrollOffsetToBottom: -1,
          scrollUpdateWasRequested: false
        };
        this._callOnItemsRendered = memoize_one_esm_default((overscanStartIndex, overscanStopIndex, visibleStartIndex, visibleStopIndex) => this.props.onItemsRendered({
          overscanStartIndex,
          overscanStopIndex,
          visibleStartIndex,
          visibleStopIndex
        }));
        this._callOnScroll = memoize_one_esm_default((scrollDirection, scrollOffset, scrollOffsetToBottom, scrollUpdateWasRequested) => this.props.onScroll({
          scrollDirection,
          scrollOffset,
          scrollOffsetToBottom,
          scrollUpdateWasRequested
        }));
        this._getItemStyle = (index) => {
          const { itemSize } = this.props;
          const itemStyleCache = this._getItemStyleCache(shouldResetStyleCacheOnItemSizeChange && itemSize);
          let style;
          if (itemStyleCache.hasOwnProperty(index)) {
            style = itemStyleCache[index];
          } else {
            const offset2 = getItemOffset(this.props, index, this._instanceProps);
            const size = getItemSize(this.props, index, this._instanceProps);
            itemStyleCache[index] = style = {
              position: "absolute",
              top: offset2,
              height: size
            };
          }
          return style;
        };
        this._getItemStyleCache = memoize_one_esm_default(() => ({}));
        this._onScrollVertical = (event) => {
          const { clientHeight, scrollHeight, scrollTop } = event.currentTarget;
          this.setState((prevState) => {
            if (prevState.scrollOffset === scrollTop) {
              return null;
            }
            const scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
            const scrollOffsetToBottom = scrollHeight - scrollTop - clientHeight;
            return {
              isScrolling: true,
              scrollDirection: prevState.scrollOffset < scrollOffset ? "forward" : "backward",
              scrollOffset,
              scrollOffsetToBottom,
              scrollUpdateWasRequested: false
            };
          }, this._resetIsScrollingDebounced);
        };
        this._outerRefSetter = (ref) => {
          const { outerRef } = this.props;
          this._outerRef = ref;
          if (typeof outerRef === "function") {
            outerRef(ref);
          } else if (outerRef != null && typeof outerRef === "object" && outerRef.hasOwnProperty("current")) {
            outerRef.current = ref;
          }
        };
        this._resetIsScrollingDebounced = () => {
          if (this._resetIsScrollingTimeoutId !== null) {
            cancelTimeout(this._resetIsScrollingTimeoutId);
          }
          this._resetIsScrollingTimeoutId = requestTimeout(this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL);
        };
        this._resetIsScrolling = () => {
          this._resetIsScrollingTimeoutId = null;
          this.setState({ isScrolling: false }, () => {
            this._getItemStyleCache(-1);
          });
        };
      }
      static getDerivedStateFromProps(nextProps, prevState) {
        validateSharedProps(nextProps, prevState);
        validateProps(nextProps);
        return null;
      }
      scrollTo(scrollOffset) {
        scrollOffset = Math.max(0, scrollOffset);
        this.setState((prevState) => {
          if (prevState.scrollOffset === scrollOffset) {
            return null;
          }
          return {
            scrollDirection: prevState.scrollOffset < scrollOffset ? "forward" : "backward",
            scrollOffset,
            scrollUpdateWasRequested: true
          };
        }, this._resetIsScrollingDebounced);
      }
      scrollToItem(index, align = "auto") {
        const { itemCount } = this.props;
        const { scrollOffset } = this.state;
        index = Math.max(0, Math.min(index, itemCount - 1));
        this.scrollTo(getOffsetForIndexAndAlignment(this.props, index, align, scrollOffset, this._instanceProps));
      }
      scrollToBottom() {
        const outerRef = this._outerRef;
        const { scrollHeight, clientHeight } = outerRef;
        this.scrollTo(scrollHeight - clientHeight);
      }
      onTextSelectionStart() {
        if (this._outerRef) {
          this._outerRef.style.overflowY = "hidden";
        }
      }
      onTextSelectionStop() {
        if (this._outerRef) {
          this._outerRef.style.overflowY = "auto";
        }
      }
      componentDidMount() {
        const { initialScrollOffset } = this.props;
        if (typeof initialScrollOffset === "number" && this._outerRef != null) {
          const outerRef = this._outerRef;
          outerRef.scrollTop = initialScrollOffset;
        }
        const innerRef = this._outerRef.firstChild;
        ["mousedown", "touchstart"].forEach((event) => {
          innerRef.addEventListener(event, this.onTextSelectionStart.bind(this));
        });
        ["mouseup", "touchend"].forEach((event) => {
          document.addEventListener(event, this.onTextSelectionStop.bind(this));
        });
        this._callPropsCallbacks();
      }
      componentDidUpdate() {
        const { scrollOffset, scrollUpdateWasRequested } = this.state;
        if (scrollUpdateWasRequested && this._outerRef != null) {
          const outerRef = this._outerRef;
          outerRef.scrollTop = scrollOffset;
        }
        this._callPropsCallbacks();
      }
      componentWillUnmount() {
        if (this._resetIsScrollingTimeoutId !== null) {
          cancelTimeout(this._resetIsScrollingTimeoutId);
        }
        const innerRef = this._outerRef.firstChild;
        ["mousedown", "touchstart"].forEach((event) => {
          innerRef.removeEventListener(event, this.onTextSelectionStart.bind(this));
        });
        ["mouseup", "touchend"].forEach((event) => {
          document.removeEventListener(event, this.onTextSelectionStop.bind(this));
        });
      }
      render() {
        const { children, outerClassName, innerClassName, height, innerRef, innerElementType, innerTagName, itemCount, itemData, itemKey = defaultItemKey, outerElementType, outerTagName, style, useIsScrolling, width, isTextWrapped, hasLineNumbers, indexWidth, ansiUp } = this.props;
        const { isScrolling } = this.state;
        const onScroll = this._onScrollVertical;
        const [startIndex, stopIndex] = this._getRangeToRender();
        const items = [];
        if (itemCount > 0) {
          for (let index = startIndex; index <= stopIndex; index++) {
            items.push((0, import_react41.createElement)(children, {
              data: itemData,
              key: itemKey(index, itemData),
              index,
              isScrolling: useIsScrolling ? isScrolling : void 0,
              style: this._getItemStyle(index),
              ansiUp
            }));
          }
        }
        const estimatedTotalSize = getEstimatedTotalSize2(this.props, this._instanceProps);
        return (0, import_react41.createElement)(outerElementType || outerTagName || "div", {
          className: outerClassName,
          onScroll,
          ref: this._outerRefSetter,
          tabIndex: 0,
          style: Object.assign({ height, paddingTop: 0, paddingBottom: 0, WebkitOverflowScrolling: "touch", overflowX: isTextWrapped ? "hidden" : "auto" }, style)
        }, (0, import_react41.createElement)(innerElementType || innerTagName || "div", {
          className: innerClassName,
          ref: innerRef,
          style: {
            height: estimatedTotalSize > height ? estimatedTotalSize : height,
            /* eslint-disable-next-line no-nested-ternary */
            width: isTextWrapped ? hasLineNumbers ? width - indexWidth : width : "auto",
            pointerEvents: isScrolling ? "none" : void 0
          }
        }, items));
      }
      _callPropsCallbacks() {
        if (typeof this.props.onItemsRendered === "function") {
          const { itemCount } = this.props;
          if (itemCount > 0) {
            const [overscanStartIndex, overscanStopIndex, visibleStartIndex, visibleStopIndex] = this._getRangeToRender();
            this._callOnItemsRendered(overscanStartIndex, overscanStopIndex, visibleStartIndex, visibleStopIndex);
          }
        }
        if (typeof this.props.onScroll === "function") {
          const { scrollDirection, scrollOffset, scrollOffsetToBottom, scrollUpdateWasRequested } = this.state;
          this._callOnScroll(scrollDirection, scrollOffset, scrollOffsetToBottom, scrollUpdateWasRequested);
        }
      }
      _getRangeToRender() {
        const { itemCount, overscanCount } = this.props;
        const { isScrolling, scrollDirection, scrollOffset } = this.state;
        if (itemCount === 0) {
          return [0, 0, 0, 0];
        }
        const startIndex = getStartIndexForOffset(this.props, scrollOffset, this._instanceProps);
        const stopIndex = getStopIndexForStartIndex(this.props, startIndex, scrollOffset, this._instanceProps);
        const overscanBackward = !isScrolling || scrollDirection === "backward" ? Math.max(1, overscanCount) : 1;
        const overscanForward = !isScrolling || scrollDirection === "forward" ? Math.max(1, overscanCount) : 1;
        return [
          Math.max(0, startIndex - overscanBackward),
          Math.max(0, Math.min(itemCount - 1, stopIndex + overscanForward)),
          startIndex,
          stopIndex
        ];
      }
    }, _a.defaultProps = {
      itemData: void 0,
      overscanCount: 2,
      useIsScrolling: false
    }, _a;
  }
  var validateSharedProps = ({ children, innerTagName, outerTagName }, { instance }) => {
    if (true) {
      if (innerTagName != null || outerTagName != null) {
        if (devWarningsTagName && !devWarningsTagName.has(instance)) {
          devWarningsTagName.add(instance);
          console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.");
        }
      }
      if (children == null) {
        throw Error(`An invalid "children" prop has been specified. Value should be a React component. "${children === null ? "null" : typeof children}" was specified.`);
      }
    }
  };

  // node_modules/@patternfly/react-log-viewer/dist/esm/react-window/VariableSizeList.js
  var DEFAULT_ESTIMATED_ITEM_SIZE = 50;
  var getItemMetadata = (props, index, instanceProps) => {
    const { itemSize } = props;
    const { itemMetadataMap, lastMeasuredIndex } = instanceProps;
    if (index > lastMeasuredIndex) {
      let offset2 = 0;
      if (lastMeasuredIndex >= 0) {
        const itemMetadata = itemMetadataMap[lastMeasuredIndex];
        offset2 = itemMetadata.offset + itemMetadata.size;
      }
      for (let i = lastMeasuredIndex + 1; i <= index; i++) {
        const size = typeof itemSize === "number" ? itemSize : itemSize(i);
        itemMetadataMap[i] = {
          offset: offset2,
          size
        };
        offset2 += size;
      }
      instanceProps.lastMeasuredIndex = index;
    }
    return itemMetadataMap[index];
  };
  var findNearestItem = (props, instanceProps, offset2) => {
    const { itemMetadataMap, lastMeasuredIndex } = instanceProps;
    const lastMeasuredItemOffset = lastMeasuredIndex > 0 ? itemMetadataMap[lastMeasuredIndex].offset : 0;
    if (lastMeasuredItemOffset >= offset2) {
      return findNearestItemBinarySearch(props, instanceProps, lastMeasuredIndex, 0, offset2);
    } else {
      return findNearestItemExponentialSearch(props, instanceProps, Math.max(0, lastMeasuredIndex), offset2);
    }
  };
  var findNearestItemBinarySearch = (props, instanceProps, high, low, offset2) => {
    while (low <= high) {
      const middle = low + Math.floor((high - low) / 2);
      const currentOffset = getItemMetadata(props, middle, instanceProps).offset;
      if (currentOffset === offset2) {
        return middle;
      } else if (currentOffset < offset2) {
        low = middle + 1;
      } else if (currentOffset > offset2) {
        high = middle - 1;
      }
    }
    if (low > 0) {
      return low - 1;
    } else {
      return 0;
    }
  };
  var findNearestItemExponentialSearch = (props, instanceProps, index, offset2) => {
    const { itemCount } = props;
    let interval2 = 1;
    while (index < itemCount && getItemMetadata(props, index, instanceProps).offset < offset2) {
      index += interval2;
      interval2 *= 2;
    }
    return findNearestItemBinarySearch(props, instanceProps, Math.min(index, itemCount - 1), Math.floor(index / 2), offset2);
  };
  var getEstimatedTotalSize = ({ itemCount }, { itemMetadataMap, estimatedItemSize, lastMeasuredIndex }) => {
    let totalSizeOfMeasuredItems = 0;
    if (lastMeasuredIndex >= itemCount) {
      lastMeasuredIndex = itemCount - 1;
    }
    if (lastMeasuredIndex >= 0) {
      const itemMetadata = itemMetadataMap[lastMeasuredIndex];
      totalSizeOfMeasuredItems = itemMetadata.offset + itemMetadata.size;
    }
    const numUnmeasuredItems = itemCount - lastMeasuredIndex - 1;
    const totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedItemSize;
    return totalSizeOfMeasuredItems + totalSizeOfUnmeasuredItems;
  };
  var VariableSizeList = createListComponent({
    getItemOffset: (props, index, instanceProps) => getItemMetadata(props, index, instanceProps).offset,
    getItemSize: (props, index, instanceProps) => instanceProps.itemMetadataMap[index].size,
    getEstimatedTotalSize,
    getOffsetForIndexAndAlignment: (props, index, align, scrollOffset, instanceProps) => {
      const { height } = props;
      const size = height;
      const itemMetadata = getItemMetadata(props, index, instanceProps);
      const estimatedTotalSize = getEstimatedTotalSize(props, instanceProps);
      const maxOffset = Math.max(0, Math.min(estimatedTotalSize - size, itemMetadata.offset));
      const minOffset = Math.max(0, itemMetadata.offset - size + itemMetadata.size);
      if (align === "smart") {
        if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
          align = "auto";
        } else {
          align = "center";
        }
      }
      switch (align) {
        case "start":
          return maxOffset;
        case "end":
          return minOffset;
        case "center":
          return Math.round(minOffset + (maxOffset - minOffset) / 2);
        case "auto":
        default:
          if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
            return scrollOffset;
          } else if (scrollOffset < minOffset) {
            return minOffset;
          } else {
            return maxOffset;
          }
      }
    },
    getStartIndexForOffset: (props, offset2, instanceProps) => findNearestItem(props, instanceProps, offset2),
    getStopIndexForStartIndex: (props, startIndex, scrollOffset, instanceProps) => {
      const { height, itemCount } = props;
      const size = height;
      const itemMetadata = getItemMetadata(props, startIndex, instanceProps);
      const maxOffset = scrollOffset + size;
      let offset2 = itemMetadata.offset + itemMetadata.size;
      let stopIndex = startIndex;
      while (stopIndex < itemCount - 1 && offset2 < maxOffset) {
        stopIndex++;
        offset2 += getItemMetadata(props, stopIndex, instanceProps).size;
      }
      return stopIndex;
    },
    initInstanceProps(props, instance) {
      const { estimatedItemSize } = props;
      const instanceProps = {
        itemMetadataMap: {},
        estimatedItemSize: estimatedItemSize || DEFAULT_ESTIMATED_ITEM_SIZE,
        lastMeasuredIndex: -1
      };
      instance.resetAfterIndex = (index, shouldForceUpdate = true) => {
        instanceProps.lastMeasuredIndex = Math.min(instanceProps.lastMeasuredIndex, index - 1);
        instance._getItemStyleCache(-1);
        if (shouldForceUpdate) {
          instance.forceUpdate();
        }
      };
      return instanceProps;
    },
    shouldResetStyleCacheOnItemSizeChange: false,
    validateProps: ({ itemSize }) => {
      if (true) {
        if (typeof itemSize !== "function") {
          throw Error(`An invalid "itemSize" prop has been specified. Value should be a function. "${itemSize === null ? "null" : typeof itemSize}" was specified.`);
        }
      }
    }
  });

  // node_modules/@patternfly/react-log-viewer/dist/esm/LogViewer/LogViewer.js
  var import_log_viewer2 = __toESM(require_log_viewer2());

  // node_modules/@patternfly/react-log-viewer/dist/esm/ansi_up/ansi_up.js
  var PacketKind;
  (function(PacketKind2) {
    PacketKind2[PacketKind2["EOS"] = 0] = "EOS";
    PacketKind2[PacketKind2["Text"] = 1] = "Text";
    PacketKind2[PacketKind2["Incomplete"] = 2] = "Incomplete";
    PacketKind2[PacketKind2["ESC"] = 3] = "ESC";
    PacketKind2[PacketKind2["Unknown"] = 4] = "Unknown";
    PacketKind2[PacketKind2["SGR"] = 5] = "SGR";
    PacketKind2[PacketKind2["OSCURL"] = 6] = "OSCURL";
  })(PacketKind || (PacketKind = {}));
  var AnsiUp = class {
    constructor() {
      this.VERSION = "6.0.2";
      this._url_allowlist = {};
      this.setup_palettes();
      this.resetStyles();
      this._use_classes = false;
    }
    set use_classes(arg) {
      this._use_classes = arg;
    }
    get use_classes() {
      return this._use_classes;
    }
    set url_allowlist(arg) {
      this._url_allowlist = arg;
    }
    get url_allowlist() {
      return this._url_allowlist;
    }
    set escape_html(arg) {
      this._escape_html = arg;
    }
    get escape_html() {
      return this._escape_html;
    }
    set boldStyle(arg) {
      this._boldStyle = arg;
    }
    get boldStyle() {
      return this._boldStyle;
    }
    set faintStyle(arg) {
      this._faintStyle = arg;
    }
    get faintStyle() {
      return this._faintStyle;
    }
    set italicStyle(arg) {
      this._italicStyle = arg;
    }
    get italicStyle() {
      return this._italicStyle;
    }
    set underlineStyle(arg) {
      this._underlineStyle = arg;
    }
    get underlineStyle() {
      return this._underlineStyle;
    }
    setup_palettes() {
      this.ansi_colors = [
        // Normal colors
        [
          { rgb: [0, 0, 0], class_name: "ansi-black" },
          { rgb: [187, 0, 0], class_name: "ansi-red" },
          { rgb: [0, 187, 0], class_name: "ansi-green" },
          { rgb: [187, 187, 0], class_name: "ansi-yellow" },
          { rgb: [0, 0, 187], class_name: "ansi-blue" },
          { rgb: [187, 0, 187], class_name: "ansi-magenta" },
          { rgb: [0, 187, 187], class_name: "ansi-cyan" },
          { rgb: [255, 255, 255], class_name: "ansi-white" }
        ],
        // Bright colors
        [
          { rgb: [85, 85, 85], class_name: "ansi-bright-black" },
          { rgb: [255, 85, 85], class_name: "ansi-bright-red" },
          { rgb: [0, 255, 0], class_name: "ansi-bright-green" },
          { rgb: [255, 255, 85], class_name: "ansi-bright-yellow" },
          { rgb: [85, 85, 255], class_name: "ansi-bright-blue" },
          { rgb: [255, 85, 255], class_name: "ansi-bright-magenta" },
          { rgb: [85, 255, 255], class_name: "ansi-bright-cyan" },
          { rgb: [255, 255, 255], class_name: "ansi-bright-white" }
        ]
      ];
      this.palette_256 = [];
      this.ansi_colors.forEach((palette) => {
        palette.forEach((rec) => {
          this.palette_256.push(rec);
        });
      });
      const levels = [0, 95, 135, 175, 215, 255];
      for (let r = 0; r < 6; ++r) {
        for (let g = 0; g < 6; ++g) {
          for (let b = 0; b < 6; ++b) {
            const col = { rgb: [levels[r], levels[g], levels[b]], class_name: "truecolor" };
            this.palette_256.push(col);
          }
        }
      }
      let grey_level = 8;
      for (let i = 0; i < 24; ++i, grey_level += 10) {
        const gry = { rgb: [grey_level, grey_level, grey_level], class_name: "truecolor" };
        this.palette_256.push(gry);
      }
    }
    escape_txt_for_html(txt) {
      if (!this._escape_html) {
        return txt;
      }
      return txt.replace(/[&<>"']/gm, (str) => {
        if (str === "&") {
          return "&amp;";
        }
        if (str === "<") {
          return "&lt;";
        }
        if (str === ">") {
          return "&gt;";
        }
        if (str === '"') {
          return "&quot;";
        }
        if (str === "'") {
          return "&#x27;";
        }
      });
    }
    append_buffer(txt) {
      const str = this._buffer + txt;
      this._buffer = str;
    }
    get_next_packet() {
      const pkt = {
        kind: PacketKind.EOS,
        text: "",
        url: ""
      };
      const len = this._buffer.length;
      if (len == 0) {
        return pkt;
      }
      const pos = this._buffer.indexOf("\x1B");
      if (pos == -1) {
        pkt.kind = PacketKind.Text;
        pkt.text = this._buffer;
        this._buffer = "";
        return pkt;
      }
      if (pos > 0) {
        pkt.kind = PacketKind.Text;
        pkt.text = this._buffer.slice(0, pos);
        this._buffer = this._buffer.slice(pos);
        return pkt;
      }
      if (pos == 0) {
        if (len < 3) {
          pkt.kind = PacketKind.Incomplete;
          return pkt;
        }
        const next_char = this._buffer.charAt(1);
        if (next_char != "[" && next_char != "]" && next_char != "(") {
          pkt.kind = PacketKind.ESC;
          pkt.text = this._buffer.slice(0, 1);
          this._buffer = this._buffer.slice(1);
          return pkt;
        }
        if (next_char == "[") {
          if (!this._csi_regex) {
            this._csi_regex = rgx`
                        ^                           # beginning of line
                                                    #
                                                    # First attempt
                        (?:                         # legal sequence
                          \x1b\[                      # CSI
                          ([\x3c-\x3f]?)              # private-mode char
                          ([\d;]*)                    # any digits or semicolons
                          ([\x20-\x2f]?               # an intermediate modifier
                          [\x40-\x7e])                # the command
                        )
                        |                           # alternate (second attempt)
                        (?:                         # illegal sequence
                          \x1b\[                      # CSI
                          [\x20-\x7e]*                # anything legal
                          ([\x00-\x1f:])              # anything illegal
                        )
                    `;
          }
          const match = this._buffer.match(this._csi_regex);
          if (match === null) {
            pkt.kind = PacketKind.Incomplete;
            return pkt;
          }
          if (match[4]) {
            pkt.kind = PacketKind.ESC;
            pkt.text = this._buffer.slice(0, 1);
            this._buffer = this._buffer.slice(1);
            return pkt;
          }
          if (match[1] != "" || match[3] != "m") {
            pkt.kind = PacketKind.Unknown;
          } else {
            pkt.kind = PacketKind.SGR;
          }
          pkt.text = match[2];
          var rpos = match[0].length;
          this._buffer = this._buffer.slice(rpos);
          return pkt;
        } else if (next_char == "]") {
          if (len < 4) {
            pkt.kind = PacketKind.Incomplete;
            return pkt;
          }
          if (this._buffer.charAt(2) != "8" || this._buffer.charAt(3) != ";") {
            pkt.kind = PacketKind.ESC;
            pkt.text = this._buffer.slice(0, 1);
            this._buffer = this._buffer.slice(1);
            return pkt;
          }
          if (!this._osc_st) {
            this._osc_st = rgxG`
                        (?:                         # legal sequence
                          (\x1b\\)                    # ESC \
                          |                           # alternate
                          (\x07)                      # BEL (what xterm did)
                        )
                        |                           # alternate (second attempt)
                        (                           # illegal sequence
                          [\x00-\x06]                 # anything illegal
                          |                           # alternate
                          [\x08-\x1a]                 # anything illegal
                          |                           # alternate
                          [\x1c-\x1f]                 # anything illegal
                        )
                    `;
          }
          this._osc_st.lastIndex = 0;
          {
            const match2 = this._osc_st.exec(this._buffer);
            if (match2 === null) {
              pkt.kind = PacketKind.Incomplete;
              return pkt;
            }
            if (match2[3]) {
              pkt.kind = PacketKind.ESC;
              pkt.text = this._buffer.slice(0, 1);
              this._buffer = this._buffer.slice(1);
              return pkt;
            }
          }
          {
            const match2 = this._osc_st.exec(this._buffer);
            if (match2 === null) {
              pkt.kind = PacketKind.Incomplete;
              return pkt;
            }
            if (match2[3]) {
              pkt.kind = PacketKind.ESC;
              pkt.text = this._buffer.slice(0, 1);
              this._buffer = this._buffer.slice(1);
              return pkt;
            }
          }
          if (!this._osc_regex) {
            this._osc_regex = rgx`
                        ^                           # beginning of line
                                                    #
                        \x1b\]8;                    # OSC Hyperlink
                        [\x20-\x3a\x3c-\x7e]*       # params (excluding ;)
                        ;                           # end of params
                        ([\x21-\x7e]{0,512})        # URL capture
                        (?:                         # ST
                          (?:\x1b\\)                  # ESC \
                          |                           # alternate
                          (?:\x07)                    # BEL (what xterm did)
                        )
                        ([\x20-\x7e]+)              # TEXT capture
                        \x1b\]8;;                   # OSC Hyperlink End
                        (?:                         # ST
                          (?:\x1b\\)                  # ESC \
                          |                           # alternate
                          (?:\x07)                    # BEL (what xterm did)
                        )
                    `;
          }
          const match = this._buffer.match(this._osc_regex);
          if (match === null) {
            pkt.kind = PacketKind.ESC;
            pkt.text = this._buffer.slice(0, 1);
            this._buffer = this._buffer.slice(1);
            return pkt;
          }
          pkt.kind = PacketKind.OSCURL;
          pkt.url = match[1];
          pkt.text = match[2];
          var rpos = match[0].length;
          this._buffer = this._buffer.slice(rpos);
          return pkt;
        } else if (next_char == "(") {
          pkt.kind = PacketKind.Unknown;
          this._buffer = this._buffer.slice(3);
          return pkt;
        }
      }
    }
    ansi_to_html(txt) {
      this.append_buffer(txt);
      const blocks = [];
      while (true) {
        const packet = this.get_next_packet();
        if (packet.kind == PacketKind.EOS || packet.kind == PacketKind.Incomplete) {
          break;
        }
        if (packet.kind == PacketKind.ESC || packet.kind == PacketKind.Unknown) {
          continue;
        }
        if (packet.kind == PacketKind.Text) {
          blocks.push(this.transform_to_html(this.with_state(packet)));
        } else if (packet.kind == PacketKind.SGR) {
          this.process_ansi(packet);
        } else if (packet.kind == PacketKind.OSCURL) {
          blocks.push(this.process_hyperlink(packet));
        }
      }
      return blocks.join("");
    }
    resetStyles() {
      this.bold = false;
      this.faint = false;
      this.italic = false;
      this.underline = false;
      this.fg = this.bg = null;
      this._buffer = "";
      this._url_allowlist = { http: 1, https: 1 };
      this.boldStyle = "font-weight:bold";
      this.faintStyle = "opacity:0.7";
      this.italicStyle = "font-style:italic";
      this.underlineStyle = "text-decoration:underline";
    }
    with_state(pkt) {
      return {
        bold: this.bold,
        faint: this.faint,
        italic: this.italic,
        underline: this.underline,
        fg: this.fg,
        bg: this.bg,
        text: pkt.text
      };
    }
    process_ansi(pkt) {
      const sgr_cmds = pkt.text.split(";");
      while (sgr_cmds.length > 0) {
        const sgr_cmd_str = sgr_cmds.shift();
        const num = parseInt(sgr_cmd_str, 10);
        if (isNaN(num) || num === 0) {
          this.fg = null;
          this.bg = null;
          this.bold = false;
          this.faint = false;
          this.italic = false;
          this.underline = false;
        } else if (num === 1) {
          this.bold = true;
        } else if (num === 2) {
          this.faint = true;
        } else if (num === 3) {
          this.italic = true;
        } else if (num === 4) {
          this.underline = true;
        } else if (num === 21) {
          this.bold = false;
        } else if (num === 22) {
          this.faint = false;
          this.bold = false;
        } else if (num === 23) {
          this.italic = false;
        } else if (num === 24) {
          this.underline = false;
        } else if (num === 39) {
          this.fg = null;
        } else if (num === 49) {
          this.bg = null;
        } else if (num >= 30 && num < 38) {
          this.fg = this.ansi_colors[0][num - 30];
        } else if (num >= 40 && num < 48) {
          this.bg = this.ansi_colors[0][num - 40];
        } else if (num >= 90 && num < 98) {
          this.fg = this.ansi_colors[1][num - 90];
        } else if (num >= 100 && num < 108) {
          this.bg = this.ansi_colors[1][num - 100];
        } else if (num === 38 || num === 48) {
          if (sgr_cmds.length > 0) {
            const is_foreground = num === 38;
            const mode_cmd = sgr_cmds.shift();
            if (mode_cmd === "5" && sgr_cmds.length > 0) {
              const palette_index = parseInt(sgr_cmds.shift(), 10);
              if (palette_index >= 0 && palette_index <= 255) {
                if (is_foreground) {
                  this.fg = this.palette_256[palette_index];
                } else {
                  this.bg = this.palette_256[palette_index];
                }
              }
            }
            if (mode_cmd === "2" && sgr_cmds.length > 2) {
              const r = parseInt(sgr_cmds.shift(), 10);
              const g = parseInt(sgr_cmds.shift(), 10);
              const b = parseInt(sgr_cmds.shift(), 10);
              if (r >= 0 && r <= 255 && g >= 0 && g <= 255 && b >= 0 && b <= 255) {
                const c2 = { rgb: [r, g, b], class_name: "truecolor" };
                if (is_foreground) {
                  this.fg = c2;
                } else {
                  this.bg = c2;
                }
              }
            }
          }
        }
      }
    }
    transform_to_html(fragment) {
      let txt = fragment.text;
      if (txt.length === 0) {
        return txt;
      }
      txt = this.escape_txt_for_html(txt);
      if (!fragment.bold && !fragment.italic && !fragment.underline && fragment.fg === null && fragment.bg === null) {
        return txt;
      }
      const styles3 = [];
      const classes = [];
      const fg = fragment.fg;
      const bg = fragment.bg;
      if (!this._use_classes) {
        if (fragment.bold) {
          styles3.push(this._boldStyle);
        }
        if (fragment.faint) {
          styles3.push(this._faintStyle);
        }
        if (fragment.italic) {
          styles3.push(this._italicStyle);
        }
        if (fragment.underline) {
          styles3.push(this._underlineStyle);
        }
        if (fg) {
          styles3.push(`color:rgb(${fg.rgb.join(",")})`);
        }
        if (bg) {
          styles3.push(`background-color:rgb(${bg.rgb})`);
        }
      } else {
        if (fragment.bold) {
          classes.push("ansi-bold");
        }
        if (fragment.faint) {
          classes.push("ansi-faint");
        }
        if (fragment.italic) {
          classes.push("ansi-italic");
        }
        if (fragment.underline) {
          classes.push("ansi-underline");
        }
        if (fg) {
          if (fg.class_name !== "truecolor") {
            classes.push(`${fg.class_name}-fg`);
          } else {
            styles3.push(`color:rgb(${fg.rgb.join(",")})`);
          }
        }
        if (bg) {
          if (bg.class_name !== "truecolor") {
            classes.push(`${bg.class_name}-bg`);
          } else {
            styles3.push(`background-color:rgb(${bg.rgb.join(",")})`);
          }
        }
      }
      let class_string = "";
      let style_string = "";
      if (classes.length) {
        class_string = ` class="${classes.join(" ")}"`;
      }
      if (styles3.length) {
        style_string = ` style="${styles3.join(";")}"`;
      }
      return `<span${style_string}${class_string}>${txt}</span>`;
    }
    process_hyperlink(pkt) {
      const parts = pkt.url.split(":");
      if (parts.length < 1) {
        return "";
      }
      if (!this._url_allowlist[parts[0]]) {
        return "";
      }
      const result = `<a href="${this.escape_txt_for_html(pkt.url)}">${this.escape_txt_for_html(pkt.text)}</a>`;
      return result;
    }
  };
  function rgx(tmplObj, ...subst) {
    const regexText = tmplObj.raw[0];
    const wsrgx = /^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm;
    const txt2 = regexText.replace(wsrgx, "");
    return new RegExp(txt2);
  }
  function rgxG(tmplObj, ...subst) {
    const regexText = tmplObj.raw[0];
    const wsrgx = /^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm;
    const txt2 = regexText.replace(wsrgx, "");
    return new RegExp(txt2, "g");
  }

  // node_modules/@patternfly/react-log-viewer/dist/esm/LogViewer/LogViewer.js
  var canvas;
  var getCharNums = (windowWidth, font) => {
    canvas = canvas || document.createElement("canvas");
    const context = canvas.getContext("2d");
    context.font = font;
    const oneChar = context.measureText("a");
    return Math.floor(windowWidth / oneChar.width);
  };
  var LogViewerBase = (0, import_react42.memo)((_a) => {
    var { data = "", hasLineNumbers = true, height = 600, overScanCount = 10, loadingContent = "", toolbar, width, theme = "light", scrollToRow = 0, itemCount = void 0, header, footer, onScroll, innerRef, isTextWrapped = true, initialIndexWidth, useAnsiClasses, fastRowHeightEstimationLimit = 5e3 } = _a, props = __rest(_a, ["data", "hasLineNumbers", "height", "overScanCount", "loadingContent", "toolbar", "width", "theme", "scrollToRow", "itemCount", "header", "footer", "onScroll", "innerRef", "isTextWrapped", "initialIndexWidth", "useAnsiClasses", "fastRowHeightEstimationLimit"]);
    const [searchedInput, setSearchedInput] = (0, import_react42.useState)("");
    const [rowInFocus, setRowInFocus] = (0, import_react42.useState)({ rowIndex: scrollToRow, matchIndex: 0 });
    const [searchedWordIndexes, setSearchedWordIndexes] = (0, import_react42.useState)([]);
    const [currentSearchedItemCount, setCurrentSearchedItemCount] = (0, import_react42.useState)(0);
    const [lineHeight, setLineHeight] = (0, import_react42.useState)(0);
    const [charNumsPerLine, setCharNumsPerLine] = (0, import_react42.useState)(0);
    const [indexWidth, setIndexWidth] = (0, import_react42.useState)(0);
    const [resizing, setResizing] = (0, import_react42.useState)(false);
    const [loading, setLoading] = (0, import_react42.useState)(true);
    const [listKey, setListKey] = (0, import_react42.useState)(1);
    const parsedData = import_react42.default.useMemo(() => parseConsoleOutput(data), [data]);
    const isChrome = import_react42.default.useMemo(() => navigator.userAgent.indexOf("Chrome") !== -1, []);
    const ansiUp = new AnsiUp();
    ansiUp.escape_html = false;
    ansiUp.use_classes = useAnsiClasses;
    const ref = import_react42.default.useRef();
    const logViewerRef = innerRef || ref;
    const containerRef = import_react42.default.useRef();
    let resizeTimer = null;
    (0, import_react42.useEffect)(() => {
      if (containerRef && containerRef.current) {
        window.addEventListener("resize", callbackResize);
        setLoading(false);
        createDummyElements();
        ansiUp.resetStyles();
      }
      return () => window.removeEventListener("resize", callbackResize);
    }, [containerRef.current]);
    const callbackResize = () => {
      if (!resizing) {
        setResizing(true);
      }
      if (resizeTimer) {
        clearTimeout(resizeTimer);
      }
      resizeTimer = setTimeout(() => {
        setResizing(false);
        createDummyElements();
      }, 100);
    };
    (0, import_react42.useEffect)(() => {
      setLoading(resizing);
    }, [resizing]);
    const dataToRender = import_react42.default.useMemo(() => ({
      parsedData,
      logViewerRef,
      rowInFocus,
      searchedWordIndexes
    }), [parsedData, logViewerRef, rowInFocus, searchedWordIndexes]);
    (0, import_react42.useEffect)(() => {
      if (logViewerRef && logViewerRef.current) {
        logViewerRef.current.resetAfterIndex(0);
      }
    }, [parsedData]);
    (0, import_react42.useEffect)(() => {
      if (scrollToRow && parsedData.length) {
        setRowInFocus({ rowIndex: scrollToRow, matchIndex: 0 });
        setTimeout(() => {
          if (logViewerRef && logViewerRef.current) {
            logViewerRef.current.scrollToItem(scrollToRow, "center");
          }
        }, 1);
      }
    }, [parsedData, scrollToRow]);
    const createDummyElements = () => {
      const dummyIndex = document.createElement("span");
      dummyIndex.className = css(import_log_viewer2.default.logViewerIndex);
      const dummyText = document.createElement("span");
      dummyText.className = css(import_log_viewer2.default.logViewerText);
      const dummyListItem = document.createElement("div");
      dummyListItem.className = css(import_log_viewer2.default.logViewerListItem);
      const dummyList = document.createElement("div");
      dummyList.className = css(import_log_viewer2.default.logViewerList);
      dummyListItem.appendChild(dummyIndex);
      dummyListItem.appendChild(dummyText);
      dummyList.appendChild(dummyListItem);
      containerRef.current.appendChild(dummyList);
      const dummyIndexStyles = getComputedStyle(dummyIndex);
      const dummyTextStyles = getComputedStyle(dummyText);
      setLineHeight(parseFloat(dummyTextStyles.lineHeight));
      const lineWidth = hasLineNumbers ? containerRef.current.clientWidth - (parseFloat(dummyTextStyles.paddingLeft) + parseFloat(dummyTextStyles.paddingRight) + parseFloat(dummyIndexStyles.width)) : containerRef.current.clientWidth - (parseFloat(dummyTextStyles.paddingLeft) + parseFloat(dummyTextStyles.paddingRight));
      const charNumsPerLine2 = getCharNums(lineWidth, `${dummyTextStyles.fontWeight} ${dummyTextStyles.fontSize} ${dummyTextStyles.fontFamily}`);
      setCharNumsPerLine(charNumsPerLine2);
      setIndexWidth(parseFloat(dummyIndexStyles.width));
      containerRef.current.removeChild(dummyList);
      setListKey((listKey2) => listKey2 + 1);
    };
    const scrollToRowInFocus = (searchedRowIndex) => {
      setRowInFocus(searchedRowIndex);
      logViewerRef.current.scrollToItem(searchedRowIndex.rowIndex, "center");
      if (!isTextWrapped) {
        setTimeout(() => {
          const element = containerRef.current.querySelector(".pf-v5-c-log-viewer__string.pf-m-current");
          element && element.scrollIntoView({ block: "nearest", inline: "center" });
        }, 1);
      }
    };
    (0, import_react42.useEffect)(() => {
      setListKey((listKey2) => listKey2 + 1);
    }, [isTextWrapped]);
    const computeRowHeight = (rowText, estimatedHeight) => {
      const logViewerList = containerRef.current.firstChild.firstChild;
      if (!logViewerList) {
        return estimatedHeight;
      }
      const dummyText = document.createElement("span");
      dummyText.className = css(import_log_viewer2.default.logViewerText);
      dummyText.innerHTML = rowText;
      logViewerList.appendChild(dummyText);
      const computedHeight = dummyText.clientHeight;
      logViewerList.removeChild(dummyText);
      return computedHeight;
    };
    const guessRowHeight = (rowIndex) => {
      if (!isTextWrapped) {
        return lineHeight;
      }
      const rowText = stripAnsi(parsedData[rowIndex]);
      const numRows = Math.ceil(rowText.length / charNumsPerLine);
      const heightGuess = lineHeight * (numRows || 1);
      if (rowText.length > fastRowHeightEstimationLimit && isChrome && isTextWrapped) {
        return computeRowHeight(rowText, heightGuess);
      }
      return heightGuess;
    };
    const createList = (parsedData2) => import_react42.default.createElement(VariableSizeList, { key: listKey, outerClassName: css(import_log_viewer2.default.logViewerScrollContainer), innerClassName: css(import_log_viewer2.default.logViewerList), height: containerRef.current.clientHeight, width: containerRef.current.clientWidth, itemSize: guessRowHeight, itemCount: typeof itemCount === "undefined" ? parsedData2.length : itemCount, itemData: dataToRender, ref: logViewerRef, overscanCount: overScanCount, onScroll, isTextWrapped, hasLineNumbers, indexWidth, ansiUp }, LogViewerRow);
    return import_react42.default.createElement(
      LogViewerContext.Provider,
      { value: {
        parsedData,
        searchedInput
      } },
      import_react42.default.createElement(
        "div",
        Object.assign({ className: css(import_log_viewer2.default.logViewer, hasLineNumbers && import_log_viewer2.default.modifiers.lineNumbers, !isTextWrapped && import_log_viewer2.default.modifiers.nowrap, initialIndexWidth && import_log_viewer2.default.modifiers.lineNumberChars, theme === "dark" && import_log_viewer2.default.modifiers.dark) }, initialIndexWidth && {
          style: {
            "--pf-v5-c-log-viewer--line-number-chars": initialIndexWidth + 1
          }
        }, props),
        toolbar && import_react42.default.createElement(
          LogViewerToolbarContext.Provider,
          { value: {
            itemCount,
            searchedInput,
            rowInFocus,
            searchedWordIndexes,
            currentSearchedItemCount,
            scrollToRow: scrollToRowInFocus,
            setRowInFocus,
            setSearchedInput,
            setSearchedWordIndexes,
            setCurrentSearchedItemCount
          } },
          import_react42.default.createElement("div", { className: css(import_log_viewer2.default.logViewerHeader) }, toolbar)
        ),
        header,
        import_react42.default.createElement("div", { className: css(import_log_viewer2.default.logViewerMain), style: { height, width }, ref: containerRef }, loading ? import_react42.default.createElement("div", null, loadingContent) : createList(parsedData)),
        footer
      )
    );
  }, areEqual);
  var LogViewer = import_react42.default.forwardRef((props, ref) => import_react42.default.createElement(LogViewerBase, Object.assign({ innerRef: ref }, props)));
  LogViewer.displayName = "LogViewer";

  // node_modules/@patternfly/react-log-viewer/dist/esm/LogViewer/LogViewerSearch.js
  init_tslib_es6();
  var import_react43 = __toESM(require_react());
  var LogViewerSearch = (_a) => {
    var _b;
    var { placeholder = "Search", minSearchChars = 1 } = _a, props = __rest(_a, ["placeholder", "minSearchChars"]);
    const [indexAdjuster, setIndexAdjuster] = (0, import_react43.useState)(0);
    const { searchedWordIndexes, scrollToRow, setSearchedInput, setCurrentSearchedItemCount, setRowInFocus, setSearchedWordIndexes, currentSearchedItemCount, searchedInput, itemCount } = (0, import_react43.useContext)(LogViewerToolbarContext);
    const { parsedData } = (0, import_react43.useContext)(LogViewerContext);
    const defaultRowInFocus = { rowIndex: DEFAULT_FOCUS, matchIndex: DEFAULT_MATCH };
    (0, import_react43.useEffect)(() => {
      if (hasFoundResults) {
        setIndexAdjuster(1);
      } else {
        setIndexAdjuster(0);
      }
    }, [searchedWordIndexes]);
    (0, import_react43.useEffect)(() => {
      let foundKeywordIndexes = [];
      const adjustedSearchedInput = escapeString(searchedInput);
      if (adjustedSearchedInput !== "" && adjustedSearchedInput.length >= minSearchChars) {
        foundKeywordIndexes = searchForKeyword(adjustedSearchedInput, parsedData, itemCount || parsedData.length);
        if (foundKeywordIndexes.length !== 0) {
          setSearchedWordIndexes(foundKeywordIndexes);
          scrollToRow(foundKeywordIndexes[DEFAULT_SEARCH_INDEX]);
          setCurrentSearchedItemCount(DEFAULT_INDEX);
        }
      }
      if (!adjustedSearchedInput) {
        setRowInFocus(defaultRowInFocus);
      }
    }, [searchedInput]);
    const hasFoundResults = searchedWordIndexes.length > 0 && ((_b = searchedWordIndexes[0]) === null || _b === void 0 ? void 0 : _b.rowIndex) !== -1;
    const handleClear = () => {
      setSearchedInput("");
      setCurrentSearchedItemCount(DEFAULT_INDEX);
      setSearchedWordIndexes([]);
      setRowInFocus(defaultRowInFocus);
    };
    const handleNextSearchItem = () => {
      const adjustedSearchedItemCount = (currentSearchedItemCount + NUMBER_INDEX_DELTA) % searchedWordIndexes.length;
      setCurrentSearchedItemCount(adjustedSearchedItemCount);
      scrollToRow(searchedWordIndexes[adjustedSearchedItemCount]);
    };
    const handlePrevSearchItem = () => {
      let adjustedSearchedItemCount = currentSearchedItemCount - NUMBER_INDEX_DELTA;
      if (adjustedSearchedItemCount < DEFAULT_INDEX) {
        adjustedSearchedItemCount += searchedWordIndexes.length;
      }
      setCurrentSearchedItemCount(adjustedSearchedItemCount);
      scrollToRow(searchedWordIndexes[adjustedSearchedItemCount]);
    };
    return import_react43.default.createElement(SearchInput, Object.assign({ placeholder, value: searchedInput, resultsCount: `${currentSearchedItemCount + indexAdjuster} / ${hasFoundResults ? searchedWordIndexes.length : 0}` }, props, { onChange: (event, input) => {
      props.onChange && props.onChange(event, input);
      setSearchedInput(input);
    }, onNextClick: (event) => {
      props.onNextClick && props.onNextClick(event);
      handleNextSearchItem();
    }, onPreviousClick: (event) => {
      props.onPreviousClick && props.onPreviousClick(event);
      handlePrevSearchItem();
    }, onClear: (event) => {
      props.onClear && props.onClear(event);
      handleClear();
    } }));
  };
  LogViewerSearch.displayName = "LogViewerSearch";

  // src/lib/database/attrEncryption.jsx
  var import_react45 = __toESM(require_react(), 1);

  // src/lib/database/databaseTables.jsx
  var import_react44 = __toESM(require_react(), 1);
  var import_trash_alt_icon = __toESM(require_trash_alt_icon(), 1);
  var import_arrow_right_icon3 = __toESM(require_arrow_right_icon(), 1);
  var import_prop_types24 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
  var _23 = cockpit_default.gettext;
  var ReferralTable = class extends import_react44.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _23("Referral"), sortable: true },
          { title: _23("Delete Referral") }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.getDeleteButton = this.getDeleteButton.bind(this);
    }
    getDeleteButton(name2) {
      return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("a", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
        import_trash_alt_icon.TrashAltIcon,
        {
          className: "ds-center",
          onClick: () => {
            this.props.deleteRef(name2);
          },
          title: _23("Delete this referral")
        }
      ) });
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const refRow of this.props.rows) {
        rows.push([refRow, this.getDeleteButton(refRow)]);
      }
      if (rows.length === 0) {
        rows = [[_23("No Referrals")]];
        columns = [{ title: _23("Referrals") }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const sortedRefs = [...this.props.rows];
      sortedRefs.sort();
      if (direction !== "asc") {
        sortedRefs.reverse();
      }
      const rows = sortedRefs.map((refRow) => [
        refRow,
        this.getDeleteButton(refRow)
      ]);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const startIdx = perPage * page - perPage;
      const displayRows = rows.slice(startIdx, startIdx + perPage);
      return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "ds-margin-top-lg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
          Table,
          {
            "aria-label": "referral table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tr, { children: columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
                Th,
                {
                  sort: column.sortable ? {
                    sortBy,
                    onSort: this.handleSort,
                    columnIndex: idx
                  } : void 0,
                  textCenter: idx === 1,
                  children: column.title
                },
                idx
              )) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tbody, { children: displayRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tr, { children: row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
                Td,
                {
                  textCenter: cellIndex === 1,
                  children: cell
                },
                cellIndex
              )) }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var IndexTable = class extends import_react44.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _23("Attribute"), sortable: true },
          { title: _23("Indexing Types"), sortable: true },
          { title: _23("Matching Rules"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      this.setState({ rows: [...this.props.rows] });
    }
    handleSort(_event, index, direction) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    handleSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      if (val === "") {
        rows = [...this.props.rows];
      } else {
        for (const row of this.props.rows) {
          const mr_row = row[2].length > 0 ? row[2] : "";
          if (row[0].toLowerCase().includes(val) || row[1].toLowerCase().includes(val) || mr_row.toLowerCase().includes(val)) {
            rows.push([row[0], row[1], row[2]]);
          }
        }
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const rows = JSON.parse(JSON.stringify(this.state.rows));
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      const getActionsForRow = (rowData) => [
        {
          title: _23("Edit Index"),
          onClick: () => this.props.editIndex(rowData)
        },
        {
          title: _23("Reindex"),
          onClick: () => this.props.reindexIndex(rowData[0])
        },
        {
          isSeparator: true
        },
        {
          title: _23("Delete Index"),
          onClick: () => this.props.deleteIndex(rowData[0], rowData)
        }
      ];
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: _23("Indexes") }];
        tableRows = [{ cells: [_23("No Indexes")] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "ds-margin-top-xlg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
          SearchInput,
          {
            className: "ds-margin-top-xlg",
            placeholder: _23("Search indexes"),
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
          Table,
          {
            "aria-label": "index table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy: this.state.sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                has_rows && this.props.editable && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tr, { children: [
                Array.isArray(row) ? (
                  // Handle array-type rows
                  row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, { children: Array.isArray(cell) && cell.length === 0 ? "" : (
                    // Handle empty arrays
                    String(cell)
                  ) }, cellIndex))
                ) : (
                  // Handle object-type rows (for the "No Indexes" case)
                  row.cells && row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, { children: cell }, cellIndex))
                ),
                has_rows && this.props.editable && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
                  ActionsColumn,
                  {
                    items: getActionsForRow(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage: this.state.perPage,
            page: this.state.page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var EncryptedAttrTable = class extends import_react44.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _23("Encrypted Attribute"), sortable: true },
          { title: _23("Delete Attribute") }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.getDeleteButton = this.getDeleteButton.bind(this);
    }
    getDeleteButton(name2) {
      return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("a", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
        import_trash_alt_icon.TrashAltIcon,
        {
          className: "ds-center",
          onClick: () => {
            this.props.deleteAttr(name2);
          },
          title: _23("Delete this attribute")
        }
      ) });
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const attrRow of this.props.rows) {
        rows.push([attrRow, this.getDeleteButton(attrRow)]);
      }
      if (rows.length === 0) {
        rows = [[_23("No Attributes")]];
        columns = [{ title: _23("Encrypted Attribute") }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const sortedAttrs = [...this.props.rows];
      sortedAttrs.sort();
      if (direction !== "asc") {
        sortedAttrs.reverse();
      }
      const rows = sortedAttrs.map((attrRow) => [
        attrRow,
        this.getDeleteButton(attrRow)
      ]);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const startIdx = perPage * page - perPage;
      const displayRows = rows.slice(startIdx, startIdx + perPage);
      return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "ds-margin-top-lg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
          Table,
          {
            "aria-label": "encrypted attributes table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tr, { children: columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
                Th,
                {
                  sort: column.sortable ? {
                    sortBy,
                    onSort: this.handleSort,
                    columnIndex: idx
                  } : void 0,
                  textCenter: idx === 1,
                  children: column.title
                },
                idx
              )) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tbody, { children: displayRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tr, { children: row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
                Td,
                {
                  textCenter: cellIndex === 1,
                  children: cell
                },
                cellIndex
              )) }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var LDIFTable = class extends import_react44.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _23("LDIF File"), sortable: true },
          { title: _23("Creation Date"), sortable: true },
          { title: _23("File Size"), sortable: true },
          { title: _23("Suffix"), sortable: true },
          { title: "", screenReaderText: _23("Import the LDIF file") }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.getImportButton = this.getImportButton.bind(this);
    }
    getImportButton(name2) {
      return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
        Button,
        {
          variant: "primary",
          onClick: () => {
            this.props.confirmImport(name2);
          },
          title: _23("Initialize the database with this LDIF file"),
          size: "sm",
          children: _23("Import")
        }
      );
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const ldifRow of this.props.rows) {
        rows.push(ldifRow);
      }
      if (rows.length === 0) {
        rows = [[_23("No LDIF files")]];
        columns = [{ title: _23("LDIF File") }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === "asc" ? sortedRows : sortedRows.reverse(),
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const startIdx = perPage * page - perPage;
      const tableRows = rows.slice(startIdx, startIdx + perPage);
      const hasRows = this.props.rows.length > 0;
      return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "ds-margin-top-lg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
          Table,
          {
            "aria-label": "ldif table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tr, { children: columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
                Th,
                {
                  sort: hasRows && column.sortable ? {
                    sortBy,
                    onSort: this.handleSort,
                    columnIndex: idx
                  } : void 0,
                  screenReaderText: column.screenReaderText,
                  children: column.title
                },
                idx
              )) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, { children: cell }, cellIndex)) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, { children: row }),
                hasRows && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, { isActionCell: true, children: this.getImportButton(row[0]) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
          Pagination,
          {
            itemCount: rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var LDIFManageTable = class extends import_react44.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _23("LDIF File"), sortable: true },
          { title: _23("Suffix"), sortable: true },
          { title: _23("Creation Date"), sortable: true },
          { title: _23("File Size"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const ldifRow of this.props.rows) {
        rows.push([ldifRow[0], ldifRow[3], ldifRow[1], ldifRow[2]]);
      }
      if (rows.length === 0) {
        rows = [{ cells: [_23("No LDIF files")] }];
        columns = [{ title: _23("LDIF File") }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const sortedLDIF = [...this.state.rows];
      sortedLDIF.sort((a2, b) => {
        const aValue = Array.isArray(a2) ? a2[index] : a2.cells[index];
        const bValue = Array.isArray(b) ? b[index] : b.cells[index];
        return aValue < bValue ? -1 : aValue > bValue ? 1 : 0;
      });
      if (direction !== SortByDirection.asc) {
        sortedLDIF.reverse();
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: sortedLDIF,
        page: 1
      });
    }
    getActions(rowData) {
      return [
        {
          title: _23("Import LDIF"),
          onClick: () => this.props.confirmImport(rowData[0], rowData[1])
        },
        {
          title: _23("Delete LDIF"),
          onClick: () => this.props.confirmDelete(rowData[0])
        }
      ];
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const hasRows = this.props.rows.length > 0;
      const startIdx = perPage * page - perPage;
      const tableRows = [...rows].splice(startIdx, perPage);
      return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "ds-margin-top-lg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "manage ldif table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                hasRows && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, { children: cell }, cellIndex)) : row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, { children: cell }, cellIndex)),
                hasRows && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActions(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var BackupTable = class extends import_react44.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _23("Backup"), sortable: true },
          { title: _23("Creation Date"), sortable: true },
          { title: _23("Size"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const bakRow of this.props.rows) {
        rows.push([bakRow[0], bakRow[1], bakRow[2]]);
      }
      if (rows.length === 0) {
        rows = [[_23("No Backups")]];
        columns = [{ title: _23("Backups") }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const sortedBaks = [...this.state.rows];
      sortedBaks.sort((a2, b) => {
        const aValue = Array.isArray(a2) ? a2[index] : a2[0];
        const bValue = Array.isArray(b) ? b[index] : b[0];
        return aValue < bValue ? -1 : aValue > bValue ? 1 : 0;
      });
      if (direction !== "asc") {
        sortedBaks.reverse();
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: sortedBaks,
        page: 1
      });
    }
    getActions(rowData) {
      return [
        {
          title: _23("Restore Backup"),
          onClick: () => this.props.confirmRestore(rowData[0])
        },
        {
          title: _23("Delete Backup"),
          onClick: () => this.props.confirmDelete(rowData[0])
        }
      ];
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const hasRows = this.props.rows.length > 0;
      const startIdx = perPage * page - perPage;
      const tableRows = [...rows].splice(startIdx, perPage);
      return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "ds-margin-top-lg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "backup table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                hasRows && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, { children: cell }, cellIndex)) : row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, { children: cell }, cellIndex)),
                hasRows && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActions(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var PwpTable = class extends import_react44.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _23("Target DN"), sortable: true },
          { title: _23("Policy Type"), sortable: true },
          { title: _23("Database Suffix"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const pwpRow of this.props.rows) {
        rows.push([pwpRow[0], pwpRow[1], pwpRow[2]]);
      }
      if (rows.length === 0) {
        rows = [{ cells: [_23("No Local Policies")] }];
        columns = [{ title: _23("Local Password Policies") }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const sortedPwp = [...this.state.rows];
      sortedPwp.sort((a2, b) => {
        const aValue = Array.isArray(a2) ? a2[index] : a2.cells[index];
        const bValue = Array.isArray(b) ? b[index] : b.cells[index];
        return aValue < bValue ? -1 : aValue > bValue ? 1 : 0;
      });
      if (direction !== SortByDirection.asc) {
        sortedPwp.reverse();
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: sortedPwp,
        page: 1
      });
    }
    getActions(rowData) {
      return [
        {
          title: _23("Edit Policy"),
          onClick: () => this.props.editPolicy(rowData[0])
        },
        {
          title: _23("Delete policy"),
          onClick: () => this.props.deletePolicy(rowData[0])
        }
      ];
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const hasRows = this.props.rows.length > 0;
      const startIdx = perPage * page - perPage;
      const tableRows = [...rows].splice(startIdx, perPage);
      return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "ds-margin-top-lg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "pwp table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                hasRows && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, { children: cell }, cellIndex)) : row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, { children: cell }, cellIndex)),
                hasRows && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
                  ActionsColumn,
                  {
                    isDisabled: row[1] === "Unknown policy type",
                    items: this.getActions(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var VLVTable = class extends import_react44.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        noRows: true,
        columns: [
          {
            title: _23("Name"),
            sortable: true
          },
          {
            title: _23("Search Base"),
            sortable: true
          }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
    }
    handleSort(_event, index, direction) {
      const sorted_rows = [];
      const rows = [];
      let count = 0;
      for (let idx = 0; idx < this.state.rows.length; idx += 2) {
        sorted_rows.push({
          expandedRow: this.state.rows[idx + 1],
          1: this.state.rows[idx].cells[0],
          2: this.state.rows[idx].cells[1]
        });
      }
      sorted_rows.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_rows.reverse();
      }
      for (const srow of sorted_rows) {
        rows.push({
          isOpen: false,
          cells: [
            srow[1],
            srow[2]
          ]
        });
        srow.expandedRow.parent = count;
        rows.push(srow.expandedRow);
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    getScopeKey(scope) {
      const mapping = {
        2: "subtree",
        1: "one",
        0: "base"
      };
      return mapping[scope];
    }
    getExpandedRow(row) {
      const sort_indexes = row.sorts.map((sort) => {
        let indexState;
        if (sort.attrs.vlvenabled[0] === "0") {
          indexState = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("font", { size: "2", color: "#d01c8b", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("b", { children: _23("Disabled") }) });
        } else {
          indexState = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("font", { size: "2", color: "#4dac26", children: [
            /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("b", { children: _23("Uses: ") }),
            sort.attrs.vlvuses[0]
          ] });
        }
        return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(GridItem, { className: "ds-container", children: [
          /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "ds-lower-field-md", children: [
            /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_arrow_right_icon3.ArrowRightIcon, {}),
            " ",
            sort.attrs.vlvsort[0],
            " (",
            indexState,
            ")"
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
            Button,
            {
              className: "ds-left-margin",
              onClick: () => {
                this.props.deleteSortFunc(row.attrs.cn[0], sort.attrs.vlvsort[0]);
              },
              id: row.attrs.cn[0],
              icon: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_trash_alt_icon.TrashAltIcon, {}),
              variant: "link",
              size: "sm",
              children: _23("Delete")
            }
          ) })
        ] }, sort.attrs.vlvsort[0]);
      });
      return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Grid, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(GridItem, { className: "ds-label", span: 2, children: _23("Search Base:") }),
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(GridItem, { span: 10, children: row.attrs.vlvbase[0] }),
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(GridItem, { className: "ds-label", span: 2, children: _23("Search Filter:") }),
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(GridItem, { span: 10, children: row.attrs.vlvfilter[0] }),
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(GridItem, { className: "ds-label", span: 2, children: _23("Scope:") }),
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(GridItem, { span: 10, children: this.getScopeKey(row.attrs.vlvscope[0]) }),
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(GridItem, { className: "ds-label", span: 12, children: _23("Sort Indexes:") }),
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "ds-margin-top ds-indent", children: sort_indexes }),
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(GridItem, { className: "ds-label", span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
          Button,
          {
            className: "ds-indent ds-margin-bottom",
            onClick: () => {
              this.props.addSortFunc(row.attrs.cn[0]);
            },
            variant: "secondary",
            size: "sm",
            children: _23("Add Sort Index")
          }
        ) })
      ] });
    }
    componentDidMount() {
      let rows = [];
      let noRows = true;
      for (const row of this.props.rows) {
        rows.push({
          isOpen: false,
          cells: [row.attrs.cn[0], row.attrs.vlvbase[0]],
          originalData: row
          // Store original data for expanded content
        });
      }
      if (rows.length === 0) {
        rows = [{ cells: [_23("No VLV Indexes")] }];
        this.setState({
          columns: [{ title: _23("VLV Indexes") }]
        });
      } else {
        noRows = false;
      }
      this.setState({
        rows,
        noRows
      });
    }
    handleCollapse(_event, rowIndex, isExpanding) {
      const rows = [...this.state.rows];
      rows[rowIndex].isOpen = isExpanding;
      this.setState({ rows });
    }
    getActions(rowData) {
      return [
        {
          title: _23("Reindex VLV"),
          onClick: () => this.props.reindexFunc(rowData.cells[0])
        },
        {
          title: _23("Delete VLV"),
          onClick: () => this.props.deleteFunc(rowData.cells[0])
        }
      ];
    }
    render() {
      const { perPage, page, sortBy, rows, columns, noRows } = this.state;
      const startIdx = perPage * page - perPage;
      const tableRows = rows.slice(startIdx, perPage);
      return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: this.props.saving || this.props.updating ? "ds-margin-top-lg ds-disabled" : "ds-margin-top-lg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
          Table,
          {
            "aria-label": "vlv table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tr, { children: [
                !noRows && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Th, { screenReaderText: "Row expansion" }),
                columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy,
                      onSort: this.handleSort,
                      columnIndex
                    } : void 0,
                    children: column.title
                  },
                  columnIndex
                )),
                !noRows && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react44.default.Fragment, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tr, { children: [
                  !noRows && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
                    Td,
                    {
                      expand: {
                        rowIndex,
                        isExpanded: row.isOpen,
                        onToggle: () => this.handleCollapse(null, rowIndex, !row.isOpen)
                      }
                    }
                  ),
                  row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, { children: cell }, cellIndex)),
                  !noRows && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
                    ActionsColumn,
                    {
                      items: this.getActions(row)
                    }
                  ) })
                ] }),
                row.isOpen && row.originalData && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tr, { isExpanded: true, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Td, {}),
                  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
                    Td,
                    {
                      colSpan: columns.length + 1,
                      noPadding: true,
                      children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ExpandableRowContent, { children: this.getExpandedRow(row.originalData) })
                    }
                  )
                ] })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
          Pagination,
          {
            itemCount: rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  VLVTable.propTypes = {
    rows: import_prop_types24.default.array,
    deleteFunc: import_prop_types24.default.func,
    reindexFunc: import_prop_types24.default.func
  };
  VLVTable.defaultProps = {
    rows: []
  };
  PwpTable.propTypes = {
    rows: import_prop_types24.default.array,
    editPolicy: import_prop_types24.default.func,
    deletePolicy: import_prop_types24.default.func
  };
  PwpTable.defaultProps = {
    rows: []
  };
  BackupTable.propTypes = {
    rows: import_prop_types24.default.array,
    confirmRestore: import_prop_types24.default.func,
    confirmDelete: import_prop_types24.default.func
  };
  BackupTable.defaultProps = {
    rows: []
  };
  LDIFTable.propTypes = {
    rows: import_prop_types24.default.array,
    confirmImport: import_prop_types24.default.func
  };
  LDIFTable.defaultProps = {
    rows: []
  };
  LDIFManageTable.propTypes = {
    rows: import_prop_types24.default.array,
    confirmImport: import_prop_types24.default.func,
    confirmDelete: import_prop_types24.default.func
  };
  LDIFManageTable.defaultProps = {
    rows: []
  };
  ReferralTable.propTypes = {
    rows: import_prop_types24.default.array,
    deleteRef: import_prop_types24.default.func
  };
  ReferralTable.defaultProps = {
    rows: []
  };
  IndexTable.propTypes = {
    editable: import_prop_types24.default.bool,
    rows: import_prop_types24.default.array,
    editIndex: import_prop_types24.default.func,
    reindexIndex: import_prop_types24.default.func,
    deleteIndex: import_prop_types24.default.func
  };
  IndexTable.defaultProps = {
    editable: false,
    rows: []
  };
  EncryptedAttrTable.propTypes = {
    deleteAttr: import_prop_types24.default.func,
    rows: import_prop_types24.default.array
  };
  EncryptedAttrTable.defaultProps = {
    rows: []
  };

  // src/lib/database/attrEncryption.jsx
  var import_prop_types25 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
  var _24 = cockpit_default.gettext;
  var AttrEncryption = class extends import_react45.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleSelect", (event, selection) => {
        this.setState({
          addAttr: selection
        });
      });
      __publicField(this, "handleSelectClear", () => {
        this.setState({
          addAttr: ""
        });
      });
      this.state = {
        showConfirmAttrDelete: false,
        addAttr: "",
        delAttr: "",
        modalSpinning: false,
        modalChecked: false,
        saving: false
      };
      this.showConfirmAttrDelete = this.showConfirmAttrDelete.bind(this);
      this.closeConfirmAttrDelete = this.closeConfirmAttrDelete.bind(this);
      this.handleAddEncryptedAttr = this.handleAddEncryptedAttr.bind(this);
      this.delEncryptedAttr = this.delEncryptedAttr.bind(this);
      this.onHandleModalChange = this.onHandleModalChange.bind(this);
      this.handleSelect = this.handleSelect.bind(this);
      this.handleSelectClear = this.handleSelectClear.bind(this);
    }
    onHandleModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    showConfirmAttrDelete(name2) {
      this.setState({
        showConfirmAttrDelete: true,
        delAttr: name2,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmAttrDelete() {
      this.setState({
        showConfirmAttrDelete: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    handleAddEncryptedAttr() {
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "attr-encrypt",
        "--add-attr=" + this.state.addAttr,
        this.props.suffix
      ];
      log_cmd("handleAddEncryptedAttr", "Delete suffix referral", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          _24("Successfully added encrypted attribute")
        );
        this.setState({
          saving: false,
          addAttr: ""
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "error",
          cockpit_default.format(_24("Failed to add encrypted attribute - $0"), errMsg)
        );
        this.setState({
          saving: false,
          addAttr: ""
        });
      });
    }
    delEncryptedAttr() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "attr-encrypt",
        "--del-attr=" + this.state.delAttr,
        this.props.suffix
      ];
      log_cmd("delEncryptedAttr", "Delete encrypted attribute", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          _24("Encrypted attribute successfully deleted")
        );
        this.closeConfirmAttrDelete();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "error",
          cockpit_default.format(_24("Failure deleting encrypted attribute - $0"), errMsg)
        );
        this.closeConfirmAttrDelete();
      });
    }
    render() {
      const {
        addAttr,
        saving,
        modalSpinning
      } = this.state;
      const fullList = [];
      const attrs = [];
      for (const attrName of this.props.rows) {
        fullList.push(attrName);
      }
      for (const attr of this.props.attrs) {
        if (fullList.indexOf(attr) === -1) {
          attrs.push(attr);
        }
      }
      let saveBtnName = _24("Add Attribute");
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = _24("Adding Attribute ...");
        extraPrimaryProps.spinnerAriaValueText = _24("Saving");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: saving || modalSpinning ? "ds-margin-top-lg ds-left-margin ds-disabled" : "ds-margin-top-lg ds-left-margin", children: [
        /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
          EncryptedAttrTable,
          {
            rows: this.props.rows,
            deleteAttr: this.showConfirmAttrDelete
          },
          this.props.rows
        ),
        /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Grid, { className: "ds-margin-top", children: [
          /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
            dsBasicComponents_default,
            {
              selected: addAttr,
              onSelect: this.handleSelect,
              onClear: this.handleSelectClear,
              options: attrs,
              placeholder: _24("Type attribute name to be encrypted"),
              noResultsText: _24("There are no matching entries"),
              ariaLabel: "Type attribute name to be encrypted",
              openOnClick: false
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(GridItem, { span: 3, className: "ds-no-padding", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
            Button,
            {
              className: "ds-left-margin",
              variant: "primary",
              onClick: this.handleAddEncryptedAttr,
              isLoading: saving,
              isDisabled: addAttr === "" || saving,
              spinnerAriaValueText: this.state.saving ? _24("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveBtnName
            }
          ) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmAttrDelete,
            closeHandler: this.closeConfirmAttrDelete,
            handleChange: this.onHandleModalChange,
            actionHandler: this.delEncryptedAttr,
            spinning: this.state.modalSpinning,
            item: this.state.delAttr,
            checked: this.state.modalChecked,
            mTitle: _24("Remove Attribute Encryption"),
            mMsg: _24("Are you sure you want to remove this encrypted attribute?"),
            mSpinningMsg: _24("Deleting ..."),
            mBtnName: _24("Delete")
          }
        )
      ] });
    }
  };
  AttrEncryption.propTypes = {
    rows: import_prop_types25.default.array,
    suffix: import_prop_types25.default.string,
    serverId: import_prop_types25.default.string,
    addNotification: import_prop_types25.default.func,
    attrs: import_prop_types25.default.array,
    reload: import_prop_types25.default.func
  };
  AttrEncryption.defaultProps = {
    rows: [],
    suffix: "",
    serverId: "",
    attrs: []
  };

  // src/lib/database/suffixConfig.jsx
  var import_react46 = __toESM(require_react(), 1);
  var import_prop_types26 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
  var _25 = cockpit_default.gettext;
  var SuffixConfig = class extends import_react46.default.Component {
    render() {
      const ec_size_pretty = displayBytes(this.props.cachememsize);
      const dn_size_pretty = displayBytes(this.props.dncachememsize);
      let cacheInputs;
      if (this.props.autoTuning) {
        const cacheValue = this.props.cachesize + "  (auto-sized)";
        const cachememValue = displayBytes(this.props.cachememsize) + "  (auto-sized)";
        cacheInputs = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
          /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Grid, { title: _25("The entry cache size in bytes setting is being auto-sized and is read-only - see Global Database Configuration"), children: [
            /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GridItem, { className: "ds-label", span: 3, children: _25("Entry Cache Size") }),
            /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
              TextInput,
              {
                value: cachememValue,
                type: "text",
                id: "cachememsize",
                "aria-describedby": "cachememsize",
                name: "cachememsize",
                isDisabled: true
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Grid, { title: _25("The entry cache max entries setting is being auto-sized and is read-only - see Global Database Configuration"), children: [
            /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GridItem, { className: "ds-label", span: 3, children: _25("Entry Cache Max Entries") }),
            /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
              TextInput,
              {
                value: cacheValue,
                type: "text",
                id: "cachesize",
                "aria-describedby": "cachesize",
                name: "cachesize",
                isDisabled: true
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Grid, { title: _25("The available memory space in bytes for the DN cache. The DN cache is similar to the entry cache for a database, only its table stores only the entry ID and the entry DN (nsslapd-dncachememsize)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GridItem, { className: "ds-label", span: 3, children: _25("DN Cache Size") }),
            /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GridItem, { span: 3, title: dn_size_pretty, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
              TextInput,
              {
                value: this.props.dncachememsize,
                type: "number",
                id: "dncachememsize",
                "aria-describedby": "dncachememsize",
                name: "dncachememsize",
                onChange: (e, str) => {
                  this.props.handleChange(e);
                }
              }
            ) })
          ] })
        ] });
      } else {
        cacheInputs = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
          /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Grid, { title: _25("The size for the available memory space in bytes for the entry cache (nsslapd-cachememsize)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GridItem, { className: "ds-label", span: 3, children: _25("Entry Cache Size") }),
            /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GridItem, { span: 3, title: ec_size_pretty, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
              TextInput,
              {
                value: this.props.cachememsize,
                type: "number",
                id: "cachememsize",
                "aria-describedby": "cachememsize",
                name: "cachememsize",
                onChange: (e, str) => {
                  this.props.handleChange(e);
                }
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Grid, { title: _25("The number of entries to keep in the entry cache, use'-1' for unlimited (nsslapd-cachesize)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GridItem, { className: "ds-label", span: 3, children: _25("Entry Cache Max Entries") }),
            /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
              TextInput,
              {
                value: this.props.cachesize,
                type: "number",
                id: "cachesize",
                "aria-describedby": "cachesize",
                name: "cachesize",
                onChange: (e, str) => {
                  this.props.handleChange(e);
                }
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Grid, { title: _25("the available memory space in bytes for the DN cache. The DN cache is similar to the entry cache for a database, only its table stores only the entry ID and the entry DN (nsslapd-dncachememsize)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GridItem, { className: "ds-label", span: 3, children: _25("DN Cache Size") }),
            /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GridItem, { span: 3, title: dn_size_pretty, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
              TextInput,
              {
                value: this.props.dncachememsize,
                type: "number",
                id: "dncachememsize",
                "aria-describedby": "dncachememsize",
                name: "dncachememsize",
                onChange: (e, str) => {
                  this.props.handleChange(e);
                }
              }
            ) })
          ] })
        ] });
      }
      let saveBtnName = _25("Save Configuration");
      const extraPrimaryProps = {};
      if (this.props.saving) {
        saveBtnName = _25("Saving ...");
        extraPrimaryProps.spinnerAriaValueText = _25("saving");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "ds-margin-top-lg ds-left-margin", children: [
        cacheInputs,
        /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
          /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
            Grid,
            {
              className: "ds-margin-top-lg",
              title: _25("Set the backend type.  Warning, changing this setting could lead to unexpected database behavior."),
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GridItem, { className: "ds-label", span: 3, children: _25("Backend State") }),
                /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
                  FormSelect,
                  {
                    id: "dbstate",
                    value: this.props.dbstate,
                    onChange: (e, str) => {
                      this.props.handleChange(e);
                    },
                    "aria-label": "FormSelect Input",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(FormSelectOption, { value: "backend", label: _25("Backend") }),
                      /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(FormSelectOption, { value: "disabled", label: _25("Disabled") }),
                      /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(FormSelectOption, { value: "referral", label: _25("Referral") }),
                      /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(FormSelectOption, { value: "referral on update", label: _25("Referral On Update") })
                    ]
                  }
                ) })
              ]
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Grid, { title: _25("Put database in Read-Only mode (nsslapd-readonly)."), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
            Checkbox,
            {
              label: _25("Database Read-Only Mode"),
              id: "readOnly",
              isChecked: this.props.readOnly,
              onChange: (e, checked) => {
                this.props.handleChange(e);
              },
              "aria-label": "send ref"
            }
          ) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Grid, { title: _25("Block unindexed searches on this suffix (nsslapd-require-index)."), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
            Checkbox,
            {
              label: _25("Block Unindexed Searches"),
              id: "requireIndex",
              isChecked: this.props.requireIndex,
              onChange: (e, checked) => {
                this.props.handleChange(e);
              },
              "aria-label": "requireIndex"
            }
          ) }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
          Button,
          {
            className: "ds-margin-top-lg",
            onClick: this.props.handleSave,
            variant: "primary",
            isLoading: this.props.saving,
            spinnerAriaValueText: this.props.saving ? _25("Saving") : void 0,
            ...extraPrimaryProps,
            isDisabled: this.props.saveBtnDisabled || this.props.saving,
            children: saveBtnName
          }
        ) })
      ] });
    }
  };
  SuffixConfig.propTypes = {
    cachememsize: import_prop_types26.default.string,
    cachesize: import_prop_types26.default.string,
    dncachememsize: import_prop_types26.default.string,
    readOnly: import_prop_types26.default.bool,
    requireIndex: import_prop_types26.default.bool,
    autoTuning: import_prop_types26.default.bool,
    handleChange: import_prop_types26.default.func,
    saveHandler: import_prop_types26.default.func
  };
  SuffixConfig.defaultProps = {
    cachememsize: "",
    cachesize: "",
    dncachememsize: "",
    readOnly: false,
    requireIndex: false,
    autoTuning: false
  };

  // src/lib/database/referrals.jsx
  var import_react47 = __toESM(require_react(), 1);
  var import_prop_types27 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
  var _26 = cockpit_default.gettext;
  var SuffixReferrals = class extends import_react47.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        showConfirmRefDelete: false,
        showRefModal: false,
        removeRef: "",
        refProtocol: "ldap://",
        refHost: "",
        refPort: "",
        refSuffix: "",
        refFilter: "",
        refScope: "sub",
        refAttrs: "",
        refValue: "",
        errObj: {},
        saving: false,
        saveBtnDisabled: true,
        modalSpinning: false,
        modalChecked: false
      };
      this.showConfirmRefDelete = this.showConfirmRefDelete.bind(this);
      this.closeConfirmRefDelete = this.closeConfirmRefDelete.bind(this);
      this.deleteRef = this.deleteRef.bind(this);
      this.saveRef = this.saveRef.bind(this);
      this.handleShowRefModal = this.handleShowRefModal.bind(this);
      this.closeRefModal = this.closeRefModal.bind(this);
      this.onRefChange = this.onRefChange.bind(this);
      this.buildRef = this.buildRef.bind(this);
      this.onChange = this.onChange.bind(this);
      this.onScopeChange = this.onScopeChange.bind(this);
      this.onLdapChange = this.onLdapChange.bind(this);
    }
    onScopeChange(event, value) {
      this.setState({
        refScope: value
      });
    }
    onLdapChange(event, value) {
      this.setState({
        refProtocol: value
      });
    }
    showConfirmRefDelete(item) {
      this.setState({
        removeRef: item,
        showConfirmRefDelete: true,
        modalSpinning: false,
        modalChecked: false
      });
    }
    handleShowRefModal() {
      this.setState({
        showRefModal: true,
        errObj: {},
        refValue: ""
      });
    }
    closeConfirmRefDelete() {
      this.setState({
        showConfirmRefDelete: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeRefModal() {
      this.setState({
        showRefModal: false
      });
    }
    deleteRef() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "suffix",
        "set",
        "--del-referral=" + this.state.removeRef,
        this.props.suffix
      ];
      log_cmd("deleteRef", "Delete suffix referral", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          _26("Referral successfully deleted")
        );
        this.setState({
          modalSpinning: false,
          showConfirmRefDelete: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "error",
          cockpit_default.format(_26("Failure deleting referral - $0"), errMsg)
        );
        this.setState({
          modalSpinning: false,
          showConfirmRefDelete: false
        });
      });
    }
    // Create referral
    saveRef() {
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "suffix",
        "set",
        "--add-referral=" + this.state.refValue,
        this.props.suffix
      ];
      log_cmd("saveRef", "Add referral", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.closeRefModal();
        this.props.addNotification(
          "success",
          _26("Referral successfully created")
        );
        this.setState({
          saving: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reload(this.props.suffix);
        this.closeRefModal();
        this.props.addNotification(
          "error",
          cockpit_default.format(_26("Failure creating referral - $0"), errMsg)
        );
        this.setState({
          saving: false
        });
      });
    }
    buildRef() {
      let previewRef = this.state.refProtocol + this.state.refHost;
      const ref_port = this.state.refPort;
      const ref_suffix = this.state.refSuffix;
      const ref_attrs = this.state.refAttrs;
      const ref_filter = this.state.refFilter;
      const ref_scope = this.state.refScope;
      if (ref_port !== "") {
        previewRef += ":" + ref_port;
      }
      if (ref_suffix !== "" || ref_attrs !== "" || ref_filter !== "" || ref_scope !== "") {
        previewRef += "/" + encodeURIComponent(ref_suffix);
        if (ref_attrs !== "") {
          previewRef += "?" + encodeURIComponent(ref_attrs);
        } else if (ref_filter !== "" || ref_scope !== "") {
          previewRef += "?";
        }
        if (ref_scope !== "") {
          previewRef += "?" + encodeURIComponent(ref_scope);
        } else if (ref_filter !== "") {
          previewRef += "?";
        }
        if (ref_filter !== "") {
          previewRef += "?" + encodeURIComponent(ref_filter);
        }
      }
      this.setState({
        refValue: previewRef
      });
    }
    onRefChange(e) {
      const value = e.target.value;
      const attr = e.target.id;
      const errObj = this.state.errObj;
      let valueErr = false;
      let saveBtnDisabled = false;
      const check_attrs = ["refHost", "refPort"];
      for (const check_attr of check_attrs) {
        if (attr !== check_attr) {
          if (this.state[check_attr] === "") {
            saveBtnDisabled = true;
          }
        }
      }
      if (attr === "refHost" && value === "") {
        saveBtnDisabled = true;
        valueErr = true;
      }
      if (attr === "refPort" && (value === "" || !valid_port(value))) {
        saveBtnDisabled = true;
        valueErr = true;
      }
      if (attr === "refSuffix" && (value !== "" && !valid_dn(value))) {
        saveBtnDisabled = true;
        valueErr = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj,
        saveBtnDisabled
      }, this.buildRef);
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    render() {
      return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "ds-sub-header ds-left-margin ds-margin-bottom-md", children: [
        /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
          ReferralTable,
          {
            rows: this.props.rows,
            deleteRef: this.showConfirmRefDelete
          },
          this.props.rows
        ),
        /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
          Button,
          {
            variant: "primary",
            onClick: this.handleShowRefModal,
            className: "ds-margin-top",
            children: _26("Create Referral")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmRefDelete,
            closeHandler: this.closeConfirmRefDelete,
            handleChange: this.onChange,
            actionHandler: this.deleteRef,
            spinning: this.state.modalSpinning,
            item: this.state.removeRef,
            checked: this.state.modalChecked,
            mTitle: _26("Delete Referral"),
            mMsg: _26("Are you sure you want to delete this referral?"),
            mSpinningMsg: _26("Deleting ..."),
            mBtnName: _26("Delete")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
          AddReferralModal,
          {
            showModal: this.state.showRefModal,
            closeHandler: this.closeRefModal,
            handleChange: this.onRefChange,
            handleScopeChange: this.onScopeChange,
            handleLdapChange: this.onLdapChange,
            saveHandler: this.saveRef,
            previewValue: this.state.refValue,
            refProtocol: this.state.refProtocol,
            refScope: this.state.refScope,
            error: this.state.errObj,
            saving: this.state.saving,
            saveBtnDisabled: this.state.saveBtnDisabled
          }
        )
      ] });
    }
  };
  var AddReferralModal = class extends import_react47.default.Component {
    render() {
      let {
        showModal,
        closeHandler,
        handleChange,
        handleScopeChange,
        handleLdapChange,
        saveHandler,
        previewValue,
        error,
        saving,
        saveBtnDisabled,
        refProtocol,
        refScope
      } = this.props;
      if (previewValue === "") {
        previewValue = "ldap://";
      }
      let saveBtnName = _26("Create Referral");
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = _26("Creating ...");
        extraPrimaryProps.spinnerAriaValueText = _26("Creating");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title: _26("Add Database Referral"),
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
              Button,
              {
                variant: "primary",
                onClick: saveHandler,
                isDisabled: saveBtnDisabled || saving,
                isLoading: saving,
                spinnerAriaValueText: saving ? _26("Saving") : void 0,
                ...extraPrimaryProps,
                children: saveBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Button, { variant: "link", onClick: closeHandler, children: _26("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Form, { className: "ds-margin-top", isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GridItem, { className: "ds-label", span: 3, children: _26("Protocol") }),
              /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(FormSelect, { id: "refProtocol", value: refProtocol, onChange: handleLdapChange, "aria-label": "FormSelect Input", children: [
                /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FormSelectOption, { value: "ldap://", label: "ldap://" }, 1),
                /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FormSelectOption, { value: "ldaps://", label: "ldaps://" }, 2)
              ] }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GridItem, { className: "ds-label", span: 3, children: _26("Host Name") }),
              /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
                TextInput,
                {
                  type: "text",
                  id: "refHost",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "refHost",
                  onChange: (e, checked) => {
                    handleChange(e);
                  },
                  validated: error.refHost ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GridItem, { className: "ds-label", span: 3, children: _26("Port Number") }),
              /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
                TextInput,
                {
                  type: "number",
                  id: "refPort",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "refPort",
                  onChange: (e, checked) => {
                    handleChange(e);
                  },
                  validated: error.refPort ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GridItem, { className: "ds-label", span: 3, children: _26("Suffix") }),
              /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
                TextInput,
                {
                  type: "text",
                  id: "refSuffix",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "refSuffix",
                  onChange: (e, checked) => {
                    handleChange(e);
                  },
                  validated: error.refSuffix ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Grid, { title: _26("Comma separated list of attributes to return"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GridItem, { className: "ds-label", span: 3, children: _26("Attributes") }),
              /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
                TextInput,
                {
                  type: "text",
                  id: "refAttrs",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "refAttrs",
                  onChange: (e, checked) => {
                    handleChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GridItem, { className: "ds-label", span: 3, children: _26("Filter") }),
              /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
                TextInput,
                {
                  type: "text",
                  id: "refFilter",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "refFilter",
                  onChange: (e, checked) => {
                    handleChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GridItem, { className: "ds-label", span: 3, children: _26("Scope") }),
              /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(FormSelect, { id: "refScope", value: refScope, onChange: handleScopeChange, "aria-label": "FormSelect Input", children: [
                /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FormSelectOption, { value: "sub", label: "sub" }, 1),
                /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FormSelectOption, { value: "one", label: "one" }, 2),
                /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FormSelectOption, { value: "base", label: "base" }, 3)
              ] }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("hr", {}),
            /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GridItem, { span: 3, children: _26("Computed Referral") }),
              /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("b", { children: previewValue }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("hr", {})
          ] })
        }
      );
    }
  };
  SuffixReferrals.propTypes = {
    rows: import_prop_types27.default.array,
    suffix: import_prop_types27.default.string,
    reload: import_prop_types27.default.func,
    addNotification: import_prop_types27.default.func,
    serverId: import_prop_types27.default.string
  };
  SuffixReferrals.defaultProps = {
    rows: [],
    suffix: "",
    serverId: ""
  };
  AddReferralModal.propTypes = {
    showModal: import_prop_types27.default.bool,
    closeHandler: import_prop_types27.default.func,
    handleChange: import_prop_types27.default.func,
    saveHandler: import_prop_types27.default.func,
    previewValue: import_prop_types27.default.string,
    error: import_prop_types27.default.object
  };
  AddReferralModal.defaultProps = {
    showModal: false,
    previewValue: "",
    error: {}
  };

  // src/lib/database/indexes.jsx
  var import_react48 = __toESM(require_react(), 1);
  var import_prop_types28 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
  var _27 = cockpit_default.gettext;
  var SuffixIndexes = class extends import_react48.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "onSelectToggle", (_event, isExpanded, toggleId) => {
        this.setState({
          [toggleId]: isExpanded
        });
      });
      __publicField(this, "onSelectClear", (item) => (event) => {
        switch (item) {
          case "addIndexAttributes":
            this.setState({
              indexName: [],
              isAddIndexSelectOpen: false
            });
            break;
          case "addMatchingRules":
            this.setState({
              mrs: [],
              isAddMrsSelectOpen: false
            });
            break;
          case "matchingRulesEdit":
            this.setState({
              mrs: [],
              isEditIndexSelectOpen: false
            });
            break;
          default:
            break;
        }
      });
      this.state = {
        // indexes
        showIndexModal: false,
        showEditIndexModal: false,
        activeTabKey: 0,
        modalChecked: false,
        modalSpinning: false,
        types: "",
        attributes: [],
        matchingRules: [],
        mrs: [],
        _mrs: [],
        showConfirmReindex: false,
        reindexAttrName: "",
        showConfirmDeleteIndex: false,
        deleteAttrName: "",
        saving: false,
        saveBtnDisabled: true,
        // Add indexes
        indexName: [],
        indexTypeEq: false,
        indexTypePres: false,
        indexTypeSub: false,
        indexTypeApprox: false,
        reindexOnAdd: false,
        // Edit indexes
        errObj: {},
        _isMounted: true,
        // Select Typeahead
        isAttributeOpen: false,
        isMatchingruleOpen: false
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleAttributeSelect = (event, selection) => {
        this.setState({
          indexName: Array.isArray(selection) ? selection : [selection]
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.handleAttributeToggle = (_event, isAttributeOpen) => {
        this.setState({
          isAttributeOpen
        });
      };
      this.handleAttributeClear = () => {
        this.setState({
          indexName: [],
          isAttributeOpen: false
        });
      };
      this.handleMatchingruleAddToggle = (_event, isMatchingruleOpen) => {
        this.setState({
          isMatchingruleOpen
        });
      };
      this.handleMatchingruleAddClear = () => {
        this.setState({
          mrs: [],
          isMatchingruleOpen: false
        });
      };
      this.handleMatchingruleEditToggle = (_event, isMatchingruleOpen) => {
        this.setState({
          isMatchingruleOpen
        });
      };
      this.handleMatchingruleEditClear = () => {
        this.setState({
          mrs: [],
          isMatchingruleOpen: false
        });
      };
      this.loadIndexes = this.loadIndexes.bind(this);
      this.handleShowIndexModal = this.handleShowIndexModal.bind(this);
      this.closeIndexModal = this.closeIndexModal.bind(this);
      this.onChange = this.onChange.bind(this);
      this.onSelectToggle = this.onSelectToggle.bind(this);
      this.onSelectClear = this.onSelectClear.bind(this);
      this.saveIndex = this.saveIndex.bind(this);
      this.saveEditIndex = this.saveEditIndex.bind(this);
      this.reindexIndex = this.reindexIndex.bind(this);
      this.deleteIndex = this.deleteIndex.bind(this);
      this.showEditIndexModal = this.showEditIndexModal.bind(this);
      this.closeEditIndexModal = this.closeEditIndexModal.bind(this);
      this.showConfirmReindex = this.showConfirmReindex.bind(this);
      this.closeConfirmReindex = this.closeConfirmReindex.bind(this);
      this.showConfirmDeleteIndex = this.showConfirmDeleteIndex.bind(this);
      this.closeConfirmDeleteIndex = this.closeConfirmDeleteIndex.bind(this);
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
      this.handleMatchingruleSelect = this.handleMatchingruleSelect.bind(this);
    }
    componentDidMount() {
      this.loadIndexes();
    }
    componentWillUnmount() {
      this.setState({
        _isMounted: false
      });
    }
    loadIndexes() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "matchingrules",
        "list"
      ];
      log_cmd("loadIndexes (suffix config)", "Get matching rules", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const mrContent = JSON.parse(content);
        const mrs = [];
        for (let i = 0; i < mrContent.items.length; i++) {
          if (mrContent.items[i].name[0] !== "") {
            mrs.push(mrContent.items[i].name[0]);
          }
        }
        const idx_cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "backend",
          "index",
          "list",
          "--just-names",
          this.props.suffix
        ];
        log_cmd("loadIndexes (suffix config)", "Get current index list", idx_cmd);
        cockpit_default.spawn(idx_cmd, { superuser: true, err: "message" }).done((content2) => {
          const idxContent = JSON.parse(content2);
          const indexList = idxContent.items;
          const attr_cmd = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "schema",
            "attributetypes",
            "list"
          ];
          log_cmd("loadIndexes (suffix config)", "Get attrs", attr_cmd);
          cockpit_default.spawn(attr_cmd, { superuser: true, err: "message" }).done((content3) => {
            const attrContent = JSON.parse(content3);
            const attrs = [];
            for (const content4 of attrContent.items) {
              if (indexList.indexOf(content4.name[0]) === -1) {
                attrs.push(content4.name[0]);
              }
            }
            if (this.state._isMounted) {
              this.setState({
                matchingRules: mrs,
                attributes: attrs,
                saveBtnDisabled: true
              });
            }
          }).fail((err) => {
            const errMsg = getApiErrorMessage(err);
            this.props.addNotification(
              "error",
              cockpit_default.format(_27("Failed to get attributes - $0"), errMsg)
            );
          });
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_27("Failed to get matching rules - $0"), errMsg)
        );
      });
    }
    //
    // Index Modal functions
    //
    handleShowIndexModal() {
      this.setState({
        showIndexModal: true,
        errObj: {},
        mrs: [],
        indexName: [],
        indexTypeEq: false,
        indexTypeSub: false,
        indexTypePres: false,
        indexTypeApprox: false,
        reindexOnAdd: false,
        modalChecked: false,
        modalSpinning: false,
        saveBtnDisabled: true
      });
    }
    closeIndexModal() {
      this.setState({
        showIndexModal: false
      });
      if (this.state.isMatchingruleOpen) {
        this.setState({
          isMatchingruleOpen: false
        });
      }
    }
    validateSaveBtn() {
      let saveBtnDisabled = true;
      const check_attrs = [
        "indexTypeEq",
        "indexTypeSub",
        "indexTypePres",
        "indexTypeApprox"
      ];
      for (const config_attr of check_attrs) {
        if (this.state[config_attr] !== this.state["_" + config_attr]) {
          saveBtnDisabled = false;
          break;
        }
      }
      if (JSON.stringify(this.state._mrs) !== JSON.stringify(this.state.mrs)) {
        saveBtnDisabled = false;
      }
      if (!this.state.indexTypeEq && !this.state.indexTypeSub && !this.state.indexTypePres && !this.state.indexTypeApprox || this.state.indexName.length === 0 || this.state.indexName[0] === "") {
        saveBtnDisabled = true;
      }
      this.setState({
        saveBtnDisabled
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validateSaveBtn();
      });
    }
    // Edit Matching Rules
    handleMatchingruleSelect(event, selection) {
      this.setState({
        mrs: Array.isArray(selection) ? selection : []
      }, () => {
        this.validateSaveBtn();
      });
    }
    saveIndex() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "index",
        "add",
        "--attr=" + this.state.indexName[0],
        this.props.suffix
      ];
      if (this.state.indexTypeEq) {
        cmd.push("--index-type=eq");
      }
      if (this.state.indexTypePres) {
        cmd.push("--index-type=pres");
      }
      if (this.state.indexTypeSub) {
        cmd.push("--index-type=sub");
      }
      if (this.state.indexTypeApprox) {
        cmd.push("--index-type=approx");
      }
      for (let i = 0; i < this.state.mrs.length; i++) {
        cmd.push("--matching-rule=" + this.state.mrs[i]);
      }
      if (this.state.reindexOnAdd) {
        cmd.push("--reindex");
      }
      this.setState({
        saving: true
      });
      log_cmd("saveIndex", "Create new index", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.closeIndexModal();
        if (this.state.reindexOnAdd) {
          this.reindexAttr(this.state.indexName[0]);
        }
        this.props.addNotification(
          "success",
          _27("Successfully created new index")
        );
        this.setState({
          saving: false,
          saveBtnDisabled: true
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reload(this.props.suffix);
        this.closeIndexModal();
        this.props.addNotification(
          "error",
          cockpit_default.format(_27("Error creating index - $0"), errMsg)
        );
        this.setState({
          saving: false,
          saveBtnDisabled: true
        });
      });
    }
    showEditIndexModal(item) {
      const currentMRS = [];
      if (item[2] !== void 0 && item[2].length > 0) {
        const parts = item[2].split(",").map((item2) => item2.trim());
        for (const part of parts) {
          currentMRS.push(part);
        }
      }
      this.setState({
        indexName: [item[0]],
        types: item[1],
        mrs: currentMRS,
        _mrs: currentMRS,
        showEditIndexModal: true,
        errObj: {},
        reindexOnAdd: false,
        indexTypeEq: item[1].includes("eq"),
        indexTypeSub: item[1].includes("sub"),
        indexTypePres: item[1].includes("pres"),
        indexTypeApprox: item[1].includes("approx"),
        _indexTypeEq: item[1].includes("eq"),
        _indexTypeSub: item[1].includes("sub"),
        _indexTypePres: item[1].includes("pres"),
        _indexTypeApprox: item[1].includes("approx"),
        modalChecked: false,
        modalSpinning: false,
        saveBtnDisabled: true
      });
    }
    closeEditIndexModal() {
      this.setState({
        showEditIndexModal: false
      });
      if (this.state.isMatchingruleOpen) {
        this.setState({
          isMatchingruleOpen: false
        });
      }
    }
    reindexAttr(attr) {
      const reindex_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "index",
        "reindex",
        "--wait",
        "--attr=" + attr,
        this.props.suffix
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("reindexAttr", "index attribute", reindex_cmd);
      cockpit_default.spawn(reindex_cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          "Attribute (" + attr + ") has successfully been reindexed"
        );
        this.setState({
          saving: false,
          modalSpinning: false,
          showConfirmReindex: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_27("Error indexing attribute $0 - $1"), attr, errMsg)
        );
        this.setState({
          saving: false,
          modalSpinning: false,
          showConfirmReindex: false
        });
      });
    }
    saveEditIndex() {
      const origMRS = this.state._mrs;
      const newMRS = this.state.mrs;
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "index",
        "set",
        "--attr=" + this.state.indexName,
        this.props.suffix
      ];
      for (const newMR of newMRS) {
        let found = false;
        for (const origMR of origMRS) {
          if (origMR === newMR) {
            found = true;
            break;
          }
        }
        if (!found) {
          cmd.push("--add-mr=" + newMR);
        }
      }
      for (const origMR of origMRS) {
        let found = false;
        for (const newMR of newMRS) {
          if (newMR === origMR) {
            found = true;
            break;
          }
        }
        if (!found) {
          cmd.push("--del-mr=" + origMR);
        }
      }
      if (this.state.indexTypeEq && !this.state._indexTypeEq) {
        cmd.push("--add-type=eq");
      } else if (!this.state.indexTypeEq && this.state._indexTypeEq) {
        cmd.push("--del-type=eq");
      }
      if (this.state.indexTypeSub && !this.state._indexTypeSub) {
        cmd.push("--add-type=sub");
      } else if (!this.state.indexTypeSub && this.state._indexTypeSub) {
        cmd.push("--del-type=sub");
      }
      if (this.state.indexTypePres && !this.state._indexTypePres) {
        cmd.push("--add-type=pres");
      } else if (!this.state.indexTypePres && this.state._indexTypePres) {
        cmd.push("--del-type=pres");
      }
      if (this.state.indexTypeApprox && !this.state._indexTypeApprox) {
        cmd.push("--add-type=approx");
      } else if (!this.state.indexTypeApprox && this.state._indexTypeApprox) {
        cmd.push("--del-type=approx");
      }
      if (cmd.length > 8) {
        this.setState({
          saving: true
        });
        log_cmd("saveEditIndex", "Edit index", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.props.reload(this.props.suffix);
          this.closeEditIndexModal();
          this.props.addNotification(
            "success",
            _27("Successfully edited index")
          );
          if (this.state.reindexOnAdd) {
            this.reindexAttr(this.state.indexName);
          } else {
            this.setState({
              saving: false
            });
          }
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.reload(this.props.suffix);
          this.closeEditIndexModal();
          this.props.addNotification(
            "error",
            cockpit_default.format(_27("Error editing index - $0"), errMsg)
          );
          this.setState({
            saving: false
          });
        });
      }
    }
    showConfirmReindex(item) {
      this.setState({
        reindexAttrName: item,
        showConfirmReindex: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmReindex(item) {
      this.setState({
        reindexAttrName: "",
        showConfirmReindex: false
      });
    }
    showConfirmDeleteIndex(item) {
      this.setState({
        deleteAttrName: item,
        showConfirmDeleteIndex: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmDeleteIndex() {
      this.setState({
        deleteAttrName: "",
        showConfirmDeleteIndex: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    reindexIndex() {
      this.reindexAttr(this.state.reindexAttrName);
    }
    deleteIndex() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "index",
        "delete",
        "--attr=" + this.state.deleteAttrName,
        this.props.suffix
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteIndex", "deleteEdit index", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          "Successfully deleted index: " + this.state.deleteAttrName
        );
        this.props.reload(this.props.suffix);
        this.closeConfirmDeleteIndex();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "error",
          cockpit_default.format(_27("Error deleting index - $0"), errMsg)
        );
        this.closeConfirmDeleteIndex();
      });
    }
    render() {
      return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "ds-margin-top-xlg ds-left-indent", children: [
        /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Tabs, { isSecondary: true, isBox: true, activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
          /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(TabTitleText, { children: [
            _27("Database Indexes "),
            /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("font", { size: "2", children: [
              "(",
              this.props.indexRows.length,
              ")"
            ] })
          ] }), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "ds-left-indent ds-margin-bottom-md", children: [
            /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
              IndexTable,
              {
                editable: true,
                rows: this.props.indexRows,
                editIndex: this.showEditIndexModal,
                reindexIndex: this.showConfirmReindex,
                deleteIndex: this.showConfirmDeleteIndex
              },
              this.props.indexRows
            ),
            /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
              Button,
              {
                variant: "primary",
                type: "button",
                onClick: this.handleShowIndexModal,
                className: "ds-margin-top",
                children: _27("Add Index")
              }
            )
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(TabTitleText, { children: [
            _27("System Indexes "),
            /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("font", { size: "2", children: [
              "(",
              this.props.systemIndexRows.length,
              ")"
            ] })
          ] }), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "ds-left-indent", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
            IndexTable,
            {
              rows: this.props.systemIndexRows
            }
          ) }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
          AddIndexModal,
          {
            showModal: this.state.showIndexModal,
            closeHandler: this.closeIndexModal,
            handleChange: this.onChange,
            saveHandler: this.saveIndex,
            matchingRules: this.state.matchingRules,
            attributes: this.state.attributes,
            mrs: this.state.mrs,
            attributeName: this.state.indexName,
            indexTypeEq: this.state.indexTypeEq,
            indexTypePres: this.state.indexTypePres,
            indexTypeSub: this.state.indexTypeSub,
            indexTypeApprox: this.state.indexTypeApprox,
            reindexOnAdd: this.state.reindexOnAdd,
            onAttributeSelect: this.handleAttributeSelect,
            onAttributeToggle: this.handleAttributeToggle,
            onAttributeClear: this.handleAttributeClear,
            isAttributeOpen: this.state.isAttributeOpen,
            onMatchingruleSelect: this.handleMatchingruleSelect,
            onMatchingruleAddToggle: this.handleMatchingruleAddToggle,
            onMatchingruleAddClear: this.handleMatchingruleAddClear,
            isMatchingruleOpen: this.state.isMatchingruleOpen,
            saving: this.state.saving,
            saveBtnDisabled: this.state.saveBtnDisabled
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
          EditIndexModal,
          {
            showModal: this.state.showEditIndexModal,
            closeHandler: this.closeEditIndexModal,
            handleChange: this.onChange,
            saveHandler: this.saveEditIndex,
            types: this.state.types,
            mrs: this.state.mrs,
            matchingRules: this.state.matchingRules,
            indexName: this.state.indexName,
            indexTypeEq: this.state.indexTypeEq,
            indexTypePres: this.state.indexTypePres,
            indexTypeSub: this.state.indexTypeSub,
            indexTypeApprox: this.state.indexTypeApprox,
            reindexOnAdd: this.state.reindexOnAdd,
            onMatchingruleSelect: this.handleMatchingruleSelect,
            onMatchingruleEditToggle: this.handleMatchingruleEditToggle,
            onMatchingruleEditClear: this.handleMatchingruleEditClear,
            isMatchingruleOpen: this.state.isMatchingruleOpen,
            saving: this.state.saving,
            saveBtnDisabled: this.state.saveBtnDisabled
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmReindex,
            closeHandler: this.closeConfirmReindex,
            handleChange: this.onChange,
            actionHandler: this.reindexIndex,
            spinning: this.state.modalSpinning,
            item: this.state.reindexAttrName,
            checked: this.state.modalChecked,
            mTitle: _27("Reindex Attribute"),
            mMsg: _27("Are you sure you want to reindex this attribute?"),
            mSpinningMsg: _27("Reindexing ..."),
            mBtnName: _27("Reindex")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDeleteIndex,
            closeHandler: this.closeConfirmDeleteIndex,
            handleChange: this.onChange,
            actionHandler: this.deleteIndex,
            spinning: this.state.modalSpinning,
            item: this.state.deleteAttrName,
            checked: this.state.modalChecked,
            mTitle: _27("Delete Index"),
            mMsg: _27("Are you sure you want to delete this index?"),
            mSpinningMsg: _27("Deleting ..."),
            mBtnName: _27("Delete")
          }
        )
      ] });
    }
  };
  var AddIndexModal = class extends import_react48.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        matchingRules,
        attributes,
        mrs,
        attributeName,
        onAttributeToggle,
        onAttributeClear,
        onAttributeSelect,
        isAttributeOpen,
        onMatchingruleAddToggle,
        onMatchingruleAddClear,
        onMatchingruleSelect,
        isMatchingruleOpen,
        saving,
        saveBtnDisabled
      } = this.props;
      const availMR = [];
      for (const mr of matchingRules) {
        availMR.push(mr);
      }
      const availAttrs = [];
      for (const attr of attributes) {
        availAttrs.push(attr);
      }
      let saveBtnName = _27("Create Index");
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = _27("Creating ...");
        extraPrimaryProps.spinnerAriaValueText = _27("Creating");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title: _27("Add Database Index"),
          isOpen: showModal,
          onClose: closeHandler,
          "aria-labelledby": "ds-modal",
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
              Button,
              {
                variant: "primary",
                onClick: saveHandler,
                isLoading: saving,
                spinnerAriaValueText: saving ? _27("Creating") : void 0,
                ...extraPrimaryProps,
                isDisabled: saveBtnDisabled || saving,
                children: saveBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { variant: "link", onClick: closeHandler, children: _27("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TextContent, { title: _27("Select an attribute to index"), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { component: TextVariants.h4, children: _27("Select An Attribute") }) }),
            /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
              dsBasicComponents_default,
              {
                selected: attributeName,
                onSelect: onAttributeSelect,
                onClear: onAttributeClear,
                options: availAttrs,
                isOpen: isAttributeOpen,
                onToggle: onAttributeToggle,
                placeholder: _27("Type a attribute name to index.."),
                noResultsText: _27("There are no matching entries"),
                ariaLabel: _27("Type a attribute name to index"),
                validated: attributeName.length === 0 || attributeName[0] === "" ? "error" : "default"
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TextContent, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { component: TextVariants.h4, children: _27("Index Types") }) }),
            /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "ds-indent", children: [
              /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(GridItem, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
                Checkbox,
                {
                  id: "indexTypeEq",
                  isChecked: this.props.indexTypeEq,
                  onChange: (e, checked) => {
                    handleChange(e);
                  },
                  label: _27("Equality Indexing")
                }
              ) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(GridItem, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
                Checkbox,
                {
                  id: "indexTypePres",
                  isChecked: this.props.indexTypePres,
                  onChange: (e, checked) => {
                    handleChange(e);
                  },
                  label: _27("Presence Indexing")
                }
              ) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(GridItem, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
                Checkbox,
                {
                  id: "indexTypeSub",
                  isChecked: this.props.indexTypeSub,
                  onChange: (e, checked) => {
                    handleChange(e);
                  },
                  label: _27("Substring Indexing")
                }
              ) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(GridItem, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
                Checkbox,
                {
                  id: "indexTypeApprox",
                  isChecked: this.props.indexTypeApprox,
                  onChange: (e, checked) => {
                    handleChange(e);
                  },
                  label: _27("Approximate Indexing")
                }
              ) }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Grid, { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(GridItem, { span: 12, title: _27("List of matching rules separated by a 'space'"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { component: TextVariants.h4, children: _27("Matching Rules") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "ds-indent ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
                dsBasicComponents_default,
                {
                  selected: mrs,
                  onSelect: onMatchingruleSelect,
                  onClear: onMatchingruleAddClear,
                  options: availMR,
                  isOpen: isMatchingruleOpen,
                  onToggle: onMatchingruleAddToggle,
                  placeholder: _27("Type a matching rule name..."),
                  noResultsText: _27("There are no matching entries"),
                  ariaLabel: "Type a matching rule name",
                  isMulti: true
                }
              ) })
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(GridItem, { className: "ds-margin-top", span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
              Checkbox,
              {
                id: "reindexOnAdd",
                isChecked: this.props.reindexOnAdd,
                onChange: (e, checked) => {
                  handleChange(e);
                },
                label: _27("Index attribute after creation")
              }
            ) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("hr", {})
          ] })
        }
      );
    }
  };
  var EditIndexModal = class extends import_react48.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        mrs: []
      };
    }
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        indexName,
        types,
        mrs,
        matchingRules,
        onMatchingruleEditToggle,
        onMatchingruleEditClear,
        onMatchingruleSelect,
        isMatchingruleOpen,
        saving,
        saveBtnDisabled
      } = this.props;
      let saveBtnName = _27("Save Index");
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = _27("Saving index ...");
        extraPrimaryProps.spinnerAriaValueText = _27("Saving");
      }
      let attrTypes = "";
      if (types !== "" && types.length > 0) {
        attrTypes = types.split(",").map((item) => item.trim());
      }
      const currentMrs = mrs;
      const availMR = matchingRules;
      let eq = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
        Checkbox,
        {
          id: "indexTypeEq",
          isChecked: this.props.indexTypeEq,
          onChange: (e, checked) => {
            handleChange(e);
          },
          label: _27("Equality Indexing")
        }
      ) });
      let pres = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
        Checkbox,
        {
          id: "indexTypePres",
          isChecked: this.props.indexTypePres,
          onChange: (e, checked) => {
            handleChange(e);
          },
          label: _27("Presence Indexing")
        }
      ) });
      let sub = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
        Checkbox,
        {
          id: "indexTypeSub",
          isChecked: this.props.indexTypeSub,
          onChange: (e, checked) => {
            handleChange(e);
          },
          label: _27("Substring Indexing")
        }
      ) });
      let approx = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
        Checkbox,
        {
          id: "indexTypeApprox",
          isChecked: this.props.indexTypeApprox,
          onChange: (e, checked) => {
            handleChange(e);
          },
          label: _27("Approximate Indexing")
        }
      ) });
      if (attrTypes.includes("eq")) {
        eq = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
          Checkbox,
          {
            id: "indexTypeEq",
            isChecked: this.props.indexTypeEq,
            onChange: (e, checked) => {
              handleChange(e);
            },
            label: _27("Equality Indexing")
          }
        ) });
      }
      if (attrTypes.includes("pres")) {
        pres = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
          Checkbox,
          {
            id: "indexTypePres",
            isChecked: this.props.indexTypePres,
            onChange: (e, checked) => {
              handleChange(e);
            },
            label: _27("Presence Indexing")
          }
        ) });
      }
      if (attrTypes.includes("sub")) {
        sub = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
          Checkbox,
          {
            id: "indexTypeSub",
            isChecked: this.props.indexTypeSub,
            onChange: (e, checked) => {
              handleChange(e);
            },
            label: _27("Substring Indexing")
          }
        ) });
      }
      if (attrTypes.includes("approx")) {
        approx = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
          Checkbox,
          {
            id: "indexTypeApprox",
            isChecked: this.props.indexTypeApprox,
            onChange: (e, checked) => {
              handleChange(e);
            },
            label: _27("Approximate Indexing")
          }
        ) });
      }
      const title = /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { children: [
        _27("Edit Database Index ("),
        /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("b", { children: indexName[0] }),
        ")"
      ] });
      return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          isOpen: showModal,
          "aria-labelledby": "ds-modal",
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
              Button,
              {
                variant: "primary",
                onClick: saveHandler,
                isLoading: saving,
                spinnerAriaValueText: saving ? _27("Saving") : void 0,
                ...extraPrimaryProps,
                isDisabled: saveBtnDisabled || saving,
                children: saveBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { variant: "link", onClick: closeHandler, children: _27("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { className: "ds-margin-top", component: TextVariants.h4, children: _27("Index Types") }) }),
            /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "ds-indent", children: [
              /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(GridItem, { span: 9, children: eq }) }),
              /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(GridItem, { span: 9, children: pres }) }),
              /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(GridItem, { span: 9, children: sub }) }),
              /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(GridItem, { span: 9, children: approx }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Grid, { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(GridItem, { span: 12, children: [
              /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { component: TextVariants.h4, children: _27("Matching Rules") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "ds-indent ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
                dsBasicComponents_default,
                {
                  selected: currentMrs,
                  onSelect: onMatchingruleSelect,
                  onClear: onMatchingruleEditClear,
                  options: availMR,
                  isOpen: isMatchingruleOpen,
                  onToggle: onMatchingruleEditToggle,
                  placeholder: _27("Type a matching rule name..."),
                  noResultsText: _27("There are no matching entries"),
                  ariaLabel: "Type a matching rule name",
                  isMulti: true
                }
              ) })
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
              Checkbox,
              {
                id: "reindexOnAdd",
                isChecked: this.props.reindexOnAdd,
                onChange: (e, checked) => {
                  handleChange(e);
                },
                label: _27("Reindex Attribute After Saving")
              }
            ) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("hr", {})
          ] })
        }
      );
    }
  };
  SuffixIndexes.propTypes = {
    systemIndexRows: import_prop_types28.default.array,
    indexRows: import_prop_types28.default.array,
    serverId: import_prop_types28.default.string,
    suffix: import_prop_types28.default.string,
    addNotification: import_prop_types28.default.func,
    reload: import_prop_types28.default.func
  };
  SuffixIndexes.defaultProps = {
    systemIndexRows: [],
    indexRows: [],
    serverId: "",
    suffix: ""
  };
  AddIndexModal.propTypes = {
    showModal: import_prop_types28.default.bool,
    closeHandler: import_prop_types28.default.func,
    handleChange: import_prop_types28.default.func,
    saveHandler: import_prop_types28.default.func,
    matchingRules: import_prop_types28.default.array,
    attributes: import_prop_types28.default.array,
    mrs: import_prop_types28.default.array,
    attributeName: import_prop_types28.default.array,
    indexTypeEq: import_prop_types28.default.bool,
    indexTypePres: import_prop_types28.default.bool,
    indexTypeSub: import_prop_types28.default.bool,
    indexTypeApprox: import_prop_types28.default.bool,
    reindexOnAdd: import_prop_types28.default.bool
  };
  AddIndexModal.defaultProps = {
    showModal: false,
    matchingRules: [],
    attributes: [],
    mrs: [],
    attributeName: [],
    indexTypeEq: false,
    indexTypePres: false,
    indexTypeSub: false,
    indexTypeApprox: false,
    reindexOnAdd: false
  };
  EditIndexModal.propTypes = {
    showModal: import_prop_types28.default.bool,
    closeHandler: import_prop_types28.default.func,
    handleChange: import_prop_types28.default.func,
    saveHandler: import_prop_types28.default.func,
    matchingRules: import_prop_types28.default.array,
    types: import_prop_types28.default.string,
    mrs: import_prop_types28.default.array,
    indexName: import_prop_types28.default.array,
    indexTypeEq: import_prop_types28.default.bool,
    indexTypePres: import_prop_types28.default.bool,
    indexTypeSub: import_prop_types28.default.bool,
    indexTypeApprox: import_prop_types28.default.bool,
    reindexOnAdd: import_prop_types28.default.bool
  };
  EditIndexModal.defaultProps = {
    showModal: false,
    matchingRules: [],
    types: "",
    mrs: [],
    indexName: [],
    indexTypeEq: false,
    indexTypePres: false,
    indexTypeSub: false,
    indexTypeApprox: false,
    reindexOnAdd: false
  };

  // src/lib/database/vlvIndexes.jsx
  var import_react49 = __toESM(require_react(), 1);
  var import_prop_types29 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
  var _28 = cockpit_default.gettext;
  var VLVIndexes = class extends import_react49.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleSelectToggle", (_event, isExpanded, toggleId) => {
        this.setState({
          [toggleId]: isExpanded
        });
      });
      __publicField(this, "handleSelectClear", (item) => (event) => {
        this.setState({
          sortValue: [],
          isVlvSortIndexSelectOpen: false
        });
      });
      this.state = {
        vlvItems: [],
        showVLVModal: false,
        showDeleteConfirm: false,
        showReindexConfirm: false,
        isVlvSortIndexSelectOpen: false,
        saving: false,
        saveBtnDisabled: true,
        updating: false,
        modalSpinning: false,
        modalChecked: false,
        showCreateSortIndex: false,
        showDeleteSortIndexConfirm: false,
        createIndexParent: "",
        deleteIndexParent: "",
        deleteIndexName: "",
        deleteVLVName: "",
        errObj: {},
        vlvName: "",
        vlvBase: "",
        vlvScope: "subtree",
        vlvFilter: "",
        vlvSortList: [],
        _vlvName: "",
        _vlvBase: "",
        _vlvScope: "",
        _vlvFilter: "",
        _vlvSortList: []
      };
      this.handleShowVLVModal = this.handleShowVLVModal.bind(this);
      this.closeVLVModal = this.closeVLVModal.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.onVLVChange = this.onVLVChange.bind(this);
      this.saveVLV = this.saveVLV.bind(this);
      this.deleteVLV = this.deleteVLV.bind(this);
      this.reindexVLV = this.reindexVLV.bind(this);
      this.showDeleteConfirm = this.showDeleteConfirm.bind(this);
      this.closeDeleteConfirm = this.closeDeleteConfirm.bind(this);
      this.showReindexConfirm = this.showReindexConfirm.bind(this);
      this.closeReindexConfirm = this.closeReindexConfirm.bind(this);
      this.handleSelectToggle = this.handleSelectToggle.bind(this);
      this.handleSelectClear = this.handleSelectClear.bind(this);
      this.deleteSortIndex = this.deleteSortIndex.bind(this);
      this.createSortIndex = this.createSortIndex.bind(this);
      this.showCreateSortIndex = this.showCreateSortIndex.bind(this);
      this.closeCreateSortIndex = this.closeCreateSortIndex.bind(this);
      this.showDeleteSortIndexConfirm = this.showDeleteSortIndexConfirm.bind(this);
      this.closeDeleteSortIndexConfirm = this.closeDeleteSortIndexConfirm.bind(this);
    }
    //
    // VLV index functions
    //
    handleShowVLVModal() {
      this.setState({
        showVLVModal: true,
        errObj: {},
        vlvName: "",
        vlvBase: "",
        vlvScope: "subtree",
        vlvFilter: "",
        vlvSortList: [],
        saving: false
      });
    }
    closeVLVModal() {
      this.setState({
        showVLVModal: false
      });
    }
    onVLVChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      const attr = e.target.id;
      let saveBtnDisabled = false;
      const vlvCreateAttrs = ["vlvName", "vlvBase", "vlvFilter"];
      for (const createAttr of vlvCreateAttrs) {
        if (attr !== createAttr && this.state[createAttr] === "") {
          saveBtnDisabled = true;
        }
      }
      if (value === "") {
        valueErr = true;
        saveBtnDisabled = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj,
        saveBtnDisabled
      });
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    getScopeVal(scope) {
      const mapping = {
        subtree: "2",
        one: "1",
        base: "0"
      };
      return mapping[scope];
    }
    showCreateSortIndex(parent2) {
      this.setState({
        showCreateSortIndex: true,
        createIndexParent: parent2
      });
    }
    closeCreateSortIndex() {
      this.setState({
        showCreateSortIndex: false,
        createIndexParent: ""
      });
    }
    createSortIndex(index) {
      const index_value = index.join(" ");
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "vlv-index",
        "add-index",
        "--parent-name=" + this.state.createIndexParent,
        "--index-name=" + this.state.createIndexParent + " - " + index_value,
        "--sort=" + index_value,
        this.props.suffix
      ];
      if (this.state.reindexVLV) {
        cmd.push("--index-it");
      }
      this.setState({
        updating: true
      });
      log_cmd("createSortIndex", "Add index", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.closeCreateSortIndex();
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          _28("Successfully added VLV sort index")
        );
        this.setState({
          updating: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.closeCreateSortIndex();
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "error",
          cockpit_default.format(_28("Failed to add VLV index entry - $0"), errMsg)
        );
        this.setState({
          updating: false
        });
      });
    }
    showDeleteSortIndexConfirm(parent2, name2) {
      this.setState({
        showDeleteSortIndexConfirm: true,
        deleteIndexParent: parent2,
        deleteIndexName: name2
      });
    }
    closeDeleteSortIndexConfirm() {
      this.setState({
        showDeleteSortIndexConfirm: false,
        deleteIndexParent: "",
        deleteIndexName: ""
      });
    }
    deleteSortIndex() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "vlv-index",
        "del-index",
        "--parent-name=" + this.state.deleteIndexParent,
        "--sort=" + this.state.deleteIndexName,
        this.props.suffix
      ];
      this.setState({
        updating: true,
        modalSpinning: true
      });
      log_cmd("deleteSortIndex", "delete index", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.closeDeleteSortIndexConfirm();
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          _28("Successfully removed VLV sort index")
        );
        this.setState({
          updating: false,
          modalSpinning: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.closeDeleteSortIndexConfirm();
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "error",
          cockpit_default.format(_28("Failed to delete VLV sort index - $0"), errMsg)
        );
        this.setState({
          updating: false,
          modalSpinning: false
        });
      });
    }
    saveVLV() {
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "vlv-index",
        "add-search",
        "--name=" + this.state.vlvName,
        "--search-base=" + this.state.vlvBase,
        "--search-filter=" + this.state.vlvFilter,
        "--search-scope=" + this.getScopeVal(this.state.vlvScope),
        this.props.suffix
      ];
      log_cmd("saveVLV", "Add vlv search", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.closeVLVModal();
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          _28("Successfully added VLV search: ") + this.state.vlvName
        );
        this.setState({
          saving: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.closeVLVModal();
        this.props.addNotification(
          "error",
          cockpit_default.format(_28("Failed create VLV search entry - $0"), errMsg)
        );
        this.setState({
          saving: false
        });
      });
    }
    showDeleteConfirm(name2) {
      this.setState({
        showDeleteConfirm: true,
        deleteVLVName: name2
      });
    }
    closeDeleteConfirm() {
      this.setState({
        showDeleteConfirm: false
      });
    }
    deleteVLV() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "vlv-index",
        "del-search",
        "--name=" + this.state.deleteVLVName,
        this.props.suffix
      ];
      log_cmd("deleteVLV", "delete LV search and indexes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          _28("Successfully deleted VLV index")
        );
        this.setState({
          modalSpinning: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "error",
          cockpit_default.format(_28("Failed to deletre VLV index - $0"), errMsg)
        );
        this.setState({
          modalSpinning: false
        });
      });
    }
    showReindexConfirm(name2) {
      this.setState({
        showReindexConfirm: true,
        reindexVLVName: name2
      });
    }
    closeReindexConfirm() {
      this.setState({
        showReindexConfirm: false
      });
    }
    reindexVLV() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "vlv-index",
        "reindex",
        "--parent-name=" + this.state.reindexVLVName,
        this.props.suffix
      ];
      log_cmd("reindexVLV", "reindex VLV indexes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          _28("Successfully completed VLV indexing")
        );
        this.setState({
          modalSpinning: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "error",
          cockpit_default.format(_28("Failed to index VLV index - $0"), errMsg)
        );
        this.setState({
          modalSpinning: false
        });
      });
    }
    render() {
      return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "ds-tab-table ds-margin-bottom-md ds-left-margin", children: [
        /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
          VLVTable,
          {
            rows: this.props.vlvItems,
            deleteFunc: this.showDeleteConfirm,
            reindexFunc: this.showReindexConfirm,
            deleteSortFunc: this.showDeleteSortIndexConfirm,
            addSortFunc: this.showCreateSortIndex,
            updating: this.state.updating
          },
          this.props.vlvItems
        ),
        /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
          Button,
          {
            variant: "primary",
            onClick: this.handleShowVLVModal,
            className: "ds-margin-top",
            children: _28("Create VLV Index")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
          AddVLVIndexModal,
          {
            showModal: this.state.showCreateSortIndex,
            handleClose: this.closeCreateSortIndex,
            handleChange: this.onModalChange,
            saveHandler: this.createSortIndex,
            onSelectToggle: this.handleSelectToggle,
            onSelectClear: this.handleSelectClear,
            handleTypeaheadChange: this.onTypeaheadChange,
            attrs: this.props.attrs,
            reindexVLV: this.state.reindexVLV,
            vlvSortList: this.state.vlvSortList,
            saving: this.state.saving || this.state.updating,
            saveBtnDisabled: this.state.saveBtnDisabled
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
          AddVLVModal,
          {
            showModal: this.state.showVLVModal,
            closeHandler: this.closeVLVModal,
            handleChange: this.onVLVChange,
            saveHandler: this.saveVLV,
            error: this.state.errObj,
            vlvName: this.state.vlvName,
            vlvBase: this.state.vlvBase,
            vlvScope: this.state.vlvScope,
            vlvFilter: this.state.vlvFilter,
            saving: this.state.saving,
            saveBtnDisabled: this.state.saveBtnDisabled
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showDeleteConfirm,
            closeHandler: this.closeDeleteConfirm,
            handleChange: this.onModalChange,
            actionHandler: this.deleteVLV,
            spinning: this.state.modalSpinning,
            item: this.state.deleteVLVName,
            checked: this.state.modalChecked,
            mTitle: _28("Delete VLV Index"),
            mMsg: _28("Are you sure you want to delete this VLV index??"),
            mSpinningMsg: _28("Deleting Index ..."),
            mBtnName: _28("Delete Index")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showReindexConfirm,
            closeHandler: this.closeReindexConfirm,
            handleChange: this.onModalChange,
            actionHandler: this.reindexVLV,
            spinning: this.state.modalSpinning,
            item: this.state.reindexVLVName,
            checked: this.state.modalChecked,
            mTitle: _28("Reindex VLV Index"),
            mMsg: _28("Are you sure you want to reindex this VLV index??"),
            mSpinningMsg: _28("Reindex ..."),
            mBtnName: _28("Reindex")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showDeleteSortIndexConfirm,
            closeHandler: this.closeDeleteSortIndexConfirm,
            handleChange: this.onModalChange,
            actionHandler: this.deleteSortIndex,
            spinning: this.state.modalSpinning,
            item: this.state.deleteIndexName,
            checked: this.state.modalChecked,
            mTitle: _28("Delete VLV Sort Index"),
            mMsg: _28("Are you really sure you want to delete this sorting index?"),
            mSpinningMsg: _28("Deleting Index ..."),
            mBtnName: _28("Delete Index")
          }
        )
      ] });
    }
  };
  var AddVLVIndexModal = class extends import_react49.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        sortValue: [],
        isVLVSortOpen: false
      };
      this.handleVLVSortToggle = (_event, isVLVSortOpen) => {
        this.setState({
          isVLVSortOpen
        });
      };
      this.handleVLVSortClear = () => {
        this.setState({
          sortValue: [],
          isVLVSortOpen: false
        });
      };
      this.onTypeaheadChange = this.onTypeaheadChange.bind(this);
    }
    onTypeaheadChange(e, selection) {
      this.setState({
        sortValue: Array.isArray(selection) ? selection : [],
        isVLVSortOpen: false
      });
    }
    render() {
      const {
        showModal,
        handleChange,
        attrs,
        saving,
        saveHandler
      } = this.props;
      let saveBtnName = _28("Create Sort Index");
      const extraPrimaryProps = {};
      if (this.props.saving) {
        saveBtnName = _28("Creating Index ...");
        extraPrimaryProps.spinnerAriaValueText = _28("Saving");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title: _28("Create VLV Sort Index"),
          isOpen: showModal,
          onClose: this.props.handleClose,
          className: this.state.isVLVSortOpen ? "ds-modal-select-tall" : "ds-modal-select",
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
              Button,
              {
                variant: "primary",
                onClick: () => {
                  saveHandler(this.state.sortValue);
                },
                isLoading: saving,
                spinnerAriaValueText: saving ? _28("Saving") : void 0,
                ...extraPrimaryProps,
                isDisabled: this.state.sortValue.length === 0 || saving,
                children: saveBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { variant: "link", onClick: this.props.handleClose, children: _28("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Form, { isHorizontal: true, autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GridItem, { className: "ds-label", span: 12, children: _28('Build a list of attributes to form the "Sort" index') }),
            /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GridItem, { className: "ds-margin-top", span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
              dsBasicComponents_default,
              {
                selected: this.state.sortValue,
                onSelect: this.onTypeaheadChange,
                onClear: this.handleVLVSortClear,
                options: attrs,
                isOpen: this.state.isVLVSortOpen,
                onToggle: this.handleVLVSortToggle,
                placeholder: _28("Type an attribute name ..."),
                noResultsText: _28("There are no matching entries"),
                ariaLabel: _28("Type an attribute names to create a sort index"),
                isMulti: true
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GridItem, { className: "ds-margin-top-xlg", span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
              Checkbox,
              {
                id: "reindexVLV",
                isChecked: this.props.reindexVLV,
                onChange: (e, checked) => {
                  handleChange(e);
                },
                label: _28("Reindex After Saving")
              }
            ) })
          ] }) })
        }
      );
    }
  };
  var AddVLVModal = class extends import_react49.default.Component {
    render() {
      const {
        showModal,
        handleChange,
        saveHandler,
        closeHandler,
        error,
        saving
      } = this.props;
      let saveBtnName = _28("Save VLV Index");
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = _28("Saving Index ...");
        extraPrimaryProps.spinnerAriaValueText = _28("Saving");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title: _28("Create VLV Search Index"),
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
              Button,
              {
                variant: "primary",
                onClick: saveHandler,
                isLoading: saving,
                spinnerAriaValueText: saving ? _28("Saving") : void 0,
                ...extraPrimaryProps,
                isDisabled: this.props.saveBtnDisabled || saving,
                children: saveBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { variant: "link", onClick: closeHandler, children: _28("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Form, { isHorizontal: true, children: [
            /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GridItem, { className: "ds-label", span: 2, children: _28("VLV Index Name") }),
              /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
                TextInput,
                {
                  value: this.props.vlvName,
                  type: "text",
                  id: "vlvName",
                  "aria-describedby": "vlvName",
                  name: "vlvName",
                  onChange: (e, str) => {
                    handleChange(e);
                  },
                  validated: error.vlvName ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GridItem, { className: "ds-label", span: 2, children: _28("Search Base") }),
              /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
                TextInput,
                {
                  value: this.props.vlvBase,
                  type: "text",
                  id: "vlvBase",
                  "aria-describedby": "vlvBase",
                  name: "vlvBase",
                  onChange: (e, str) => {
                    handleChange(e);
                  },
                  validated: error.vlvBase ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GridItem, { className: "ds-label", span: 2, children: _28("Search Filter") }),
              /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
                TextInput,
                {
                  type: "text",
                  id: "vlvFilter",
                  "aria-describedby": "vlvFilter",
                  name: "vlvFilter",
                  onChange: (e, str) => {
                    handleChange(e);
                  },
                  value: this.props.filter,
                  validated: error.vlvFilter ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GridItem, { className: "ds-label", span: 2, children: _28("Search Scope") }),
              /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
                FormSelect,
                {
                  value: this.props.vlvScope,
                  onChange: (event, value) => {
                    handleChange(event);
                  },
                  id: "vlvScope",
                  "aria-label": "FormSelect Input",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FormSelectOption, { value: "subtree", label: "subtree" }, "0"),
                    /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FormSelectOption, { value: "one", label: "one" }, "1"),
                    /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FormSelectOption, { value: "base", label: "base" }, "2")
                  ]
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GridItem, { offset: 1, className: "ds-margin-top-lg ds-margin-bottom", span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { component: TextVariants.h4, children: _28("After creating this VLV Search entry you can go to the table and add VLV Sort Indexes to this VLV Search.  After adding the Sort Indexes you will need to reindex the VLV Index to make it active.") }) }) }) })
          ] })
        }
      );
    }
  };
  VLVIndexes.propTypes = {
    suffix: import_prop_types29.default.string,
    serverId: import_prop_types29.default.string,
    vlvItems: import_prop_types29.default.array,
    addNotification: import_prop_types29.default.func,
    attrs: import_prop_types29.default.array,
    reload: import_prop_types29.default.func
  };
  VLVIndexes.defaultProps = {
    suffix: "",
    serverId: "",
    vlvItems: [],
    attrs: []
  };
  AddVLVModal.propTypes = {
    showModal: import_prop_types29.default.bool,
    closeHandler: import_prop_types29.default.func,
    handleChange: import_prop_types29.default.func,
    handleSortChange: import_prop_types29.default.func,
    saveHandler: import_prop_types29.default.func,
    error: import_prop_types29.default.object,
    attrs: import_prop_types29.default.array,
    vlvName: import_prop_types29.default.string,
    vlvBase: import_prop_types29.default.string,
    vlvScope: import_prop_types29.default.string,
    vlvFilter: import_prop_types29.default.string,
    vlvSortList: import_prop_types29.default.array
  };
  AddVLVModal.defaultProps = {
    showModal: false,
    error: {},
    attrs: [],
    vlvName: "",
    vlvBase: "",
    vlvScope: "",
    vlvFilter: "",
    vlvSortList: []
  };

  // src/lib/database/databaseModal.jsx
  var import_react50 = __toESM(require_react(), 1);
  var import_prop_types30 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
  var _29 = cockpit_default.gettext;
  var CreateLinkModal = class extends import_react50.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        suffix,
        error,
        saving,
        handleSelectChange,
        starttls_checked,
        bindMech
      } = this.props;
      let saveBtnName = _29("Create Database Link");
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = _29("Creating Link ...");
        extraPrimaryProps.spinnerAriaValueText = _29("Creating");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title: _29("Create Database Link"),
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
              Button,
              {
                variant: "primary",
                onClick: saveHandler,
                isLoading: saving,
                spinnerAriaValueText: saving ? _29("Creating Link") : void 0,
                ...extraPrimaryProps,
                isDisabled: this.props.saveBtnDisabled || saving,
                children: saveBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { variant: "link", onClick: closeHandler, children: _29("Close") }, "close")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Grid, { className: "ds-margin-top", title: _29("The RDN of the link suffix."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { className: "ds-label", span: 3, children: _29("Link Sub-Suffix") }),
              /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(GridItem, { span: 9, children: [
                /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "ds-container", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
                    TextInput,
                    {
                      type: "text",
                      className: "ds-right-align",
                      id: "createLinkSuffix",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "createLinkSuffix",
                      onChange: (e, checked) => {
                        handleChange(e);
                      },
                      validated: error.createLinkSuffix ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "ds-left-margin ds-lower-field-md", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("b", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("font", { color: "blue", children: [
                    ",",
                    suffix
                  ] }) }) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormHelperText, { children: _29("Required field") })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Grid, { title: _29("A name for the backend chaining database link."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { className: "ds-label", span: 3, children: _29("Link Database Name") }),
              /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(GridItem, { span: 9, children: [
                /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
                  TextInput,
                  {
                    type: "text",
                    id: "createLinkName",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "createLinkName",
                    onChange: (e, checked) => {
                      handleChange(e);
                    },
                    validated: error.createLinkName ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormHelperText, { children: _29("Required field") })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Grid, { title: _29("The LDAP URL for the remote server.  Add additional failover LDAP URLs separated by a space. (nsfarmserverurl)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { className: "ds-label", span: 3, children: _29("Remote Server URL(s)") }),
              /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(GridItem, { span: 9, children: [
                /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
                  TextInput,
                  {
                    type: "text",
                    id: "createNsfarmserverurl",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "createNsfarmserverurl",
                    onChange: (e, checked) => {
                      handleChange(e);
                    },
                    validated: error.createNsfarmserverurl ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormHelperText, { children: _29("Required field") })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Grid, { title: _29("The DN of the entry to authenticate with on the remote server."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { className: "ds-label", span: 3, children: _29("Remote Server Bind DN") }),
              /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(GridItem, { span: 9, children: [
                /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
                  TextInput,
                  {
                    type: "text",
                    id: "createNsmultiplexorbinddn",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "createNsmultiplexorbinddn",
                    onChange: (e, checked) => {
                      handleChange(e);
                    },
                    validated: error.createNsmultiplexorbinddn ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormHelperText, { children: _29("Required field") })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Grid, { title: _29("The credentials for the bind DN (nsmultiplexorcredentials)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { className: "ds-label", span: 3, children: _29("Bind DN Credentials") }),
              /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(GridItem, { span: 9, children: [
                /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
                  TextInput,
                  {
                    type: "password",
                    id: "createNsmultiplexorcredentials",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "createNsmultiplexorcredentials",
                    onChange: (e, checked) => {
                      handleChange(e);
                    },
                    validated: error.createNsmultiplexorcredentials ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormHelperText, { children: _29("Password does not match") })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Grid, { title: _29("Confirm credentials for the bind DN (nsmultiplexorcredentials)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { className: "ds-label", span: 3, children: _29("Confirm Password") }),
              /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(GridItem, { span: 9, children: [
                /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
                  TextInput,
                  {
                    type: "password",
                    id: "createNsmultiplexorcredentialsConfirm",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "createNsmultiplexorcredentialsConfirm",
                    onChange: (e, checked) => {
                      handleChange(e);
                    },
                    validated: error.createNsmultiplexorcredentialsConfirm ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormHelperText, { children: _29("Password does not match") })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
              Grid,
              {
                title: _29("The bind method for contacting the remote server  (nsbindmechanism)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { className: "ds-label", span: 3, children: _29("Bind Method") }),
                  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(FormSelect, { value: bindMech, onChange: (event, value) => handleSelectChange(value), "aria-label": "FormSelect Input", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormSelectOption, { value: "SIMPLE", label: "SIMPLE" }, 1),
                    /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormSelectOption, { value: "SASL/DIGEST-MD5", label: "SASL/DIGEST-MD5" }, 2),
                    /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormSelectOption, { value: "SASL/GSSAPI", label: "SASL/GSSAPI" }, 3)
                  ] }) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Grid, { className: "ds-margin-top", title: _29("Use StartTLS for the remote server LDAP URL."), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
              Checkbox,
              {
                id: "createUseStartTLS",
                onChange: (e, checked) => {
                  handleChange(e);
                },
                isChecked: starttls_checked,
                label: _29("Use StartTLS")
              }
            ) }) })
          ] })
        }
      );
    }
  };
  var CreateSubSuffixModal = class extends import_react50.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        isOpen: false
      };
      this.onToggle = (isOpen) => {
        this.setState({
          isOpen
        });
      };
    }
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        handleSelectChange,
        saveHandler,
        suffix,
        error,
        saving,
        initOption
      } = this.props;
      let saveBtnName = _29("Create Sub-Suffix");
      const extraPrimaryProps = {};
      if (saving) {
        saveBtnName = _29("Creating suffix ...");
        extraPrimaryProps.spinnerAriaValueText = _29("Creating");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title: _29("Create Sub Suffix"),
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
              Button,
              {
                variant: "primary",
                onClick: saveHandler,
                isLoading: saving,
                spinnerAriaValueText: saving ? _29("Creating Suffix") : void 0,
                ...extraPrimaryProps,
                isDisabled: this.props.saveBtnDisabled || saving,
                children: saveBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { variant: "link", onClick: closeHandler, children: _29("Close") }, "close")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Grid, { className: "ds-margin-top", title: _29("Database suffix, like 'dc=example,dc=com'.  The suffix must be a valid LDAP Distinguished Name (DN)"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { className: "ds-label", span: 3, children: _29("Sub-Suffix DN") }),
              /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(GridItem, { span: 9, children: [
                /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "ds-container", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
                    TextInput,
                    {
                      type: "text",
                      className: "ds-right-align",
                      id: "subSuffixValue",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "subSuffixValue",
                      onChange: (e, val) => {
                        handleChange(e);
                      },
                      validated: error.subSuffixValue ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "ds-left-margin ds-lower-field-md", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("b", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("font", { color: "blue", children: [
                    ",",
                    suffix
                  ] }) }) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormHelperText, { children: _29("Required field") })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Grid, { title: _29("The name for the backend database, like 'userroot'.  The name can be a combination of alphanumeric characters, dashes (-), and underscores (_). No other characters are allowed, and the name must be unique across all backends."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { className: "ds-label", span: 3, children: _29("Database Name") }),
              /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(GridItem, { span: 9, children: [
                /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
                  TextInput,
                  {
                    type: "text",
                    id: "subSuffixBeName",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "subSuffixBeName",
                    onChange: (e, val) => {
                      handleChange(e);
                    },
                    validated: error.subSuffixBeName ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormHelperText, { children: _29("Required field") })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
              Grid,
              {
                title: _29("Database initialization options"),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { className: "ds-label", span: 3, children: _29("Initialization Option") }),
                  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(FormSelect, { value: initOption, onChange: (event, value) => handleSelectChange(value), "aria-label": "FormSelect Input", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormSelectOption, { value: "noInit", label: _29("Do Not Initialize Database") }, 1),
                    /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormSelectOption, { value: "addSuffix", label: _29("Create The Top Sub-Suffix Entry") }, 2),
                    /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormSelectOption, { value: "addSample", label: _29("Add Sample Entries") }, 3)
                  ] }) })
                ]
              }
            )
          ] })
        }
      );
    }
  };
  var ExportModal = class extends import_react50.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        includeReplData,
        saveHandler,
        spinning,
        item,
        error,
        exportCompleted
      } = this.props;
      let saveBtnName = _29("Export Database");
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = _29("Exporting ...");
        extraPrimaryProps.spinnerAriaValueText = _29("Exporting");
      }
      const actions = [];
      if (!exportCompleted) {
        actions.push(
          /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
            Button,
            {
              variant: "primary",
              onClick: saveHandler,
              isDisabled: this.props.saveBtnDisabled || spinning,
              isLoading: spinning,
              spinnerAriaValueText: spinning ? _29("Exporting ...") : void 0,
              ...extraPrimaryProps,
              children: saveBtnName
            },
            "confirm"
          )
        );
      }
      actions.push(
        /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { variant: "link", onClick: closeHandler, children: _29("Close") }, "close")
      );
      return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title: _29("Export Database To LDIF File"),
          isOpen: showModal,
          onClose: closeHandler,
          actions,
          children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Grid, { title: _29("Name of exported LDIF file."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { className: "ds-label", span: 3, children: _29("LDIF File Name") }),
              /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
                TextInput,
                {
                  type: "text",
                  id: "ldifLocation",
                  "aria-describedby": "horizontal-form-name-helper",
                  isDisabled: spinning || exportCompleted,
                  name: "ldifLocation",
                  onChange: (e, val) => {
                    handleChange(e);
                  },
                  validated: error.ldifLocation ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Grid, { title: _29("Include the replication metadata needed to restore or initialize another replica."), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
              Checkbox,
              {
                id: "includeReplData",
                onChange: (e, checked) => {
                  handleChange(e);
                },
                isChecked: includeReplData,
                isDisabled: spinning || exportCompleted,
                label: _29("Include Replication Data")
              }
            ) }) }),
            item
          ] })
        }
      );
    }
  };
  var ImportModal = class extends import_react50.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        rows,
        suffix
      } = this.props;
      const suffixRows = [];
      for (const row of rows) {
        if (row[3] === suffix) {
          suffixRows.push(row);
        }
      }
      return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
        Modal,
        {
          variant: ModalVariant.medium,
          title: _29("Initialize Database via LDIF File"),
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { variant: "link", onClick: closeHandler, children: _29("Close") }, "close")
          ],
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
              LDIFTable,
              {
                rows: suffixRows,
                confirmImport: this.props.showConfirmImport
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("hr", {}),
            /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Form, { isHorizontal: true, autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Grid, { title: _29("The full path to the LDIF file.  The server must have permissions to read it."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { className: "ds-label", span: 4, children: _29("Or, enter LDIF location") }),
              /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
                TextInput,
                {
                  type: "text",
                  id: "ldifLocation",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "ldifLocation",
                  onChange: (e, val) => {
                    handleChange(e);
                  }
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
                Button,
                {
                  className: "ds-left-margin",
                  variant: "primary",
                  onClick: saveHandler,
                  isDisabled: this.props.saveBtnDisabled,
                  children: _29("Import")
                },
                "import"
              ) })
            ] }) })
          ]
        }
      );
    }
  };
  var ShadowFixupModal = class extends import_react50.default.Component {
    constructor() {
      super(...arguments);
      __publicField(this, "handleSelectChange", (value) => {
        this.props.handleChange(value);
      });
    }
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        spinning,
        item,
        force,
        suffix,
        fixupCompleted,
        suffixes
      } = this.props;
      let saveBtnName = _29("Run Fix-Up task");
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = _29("Fixing ...");
        extraPrimaryProps.spinnerAriaValueText = _29("Fixing");
      }
      const actions = [];
      if (!fixupCompleted) {
        actions.push(
          /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
            Button,
            {
              variant: "primary",
              onClick: saveHandler,
              isLoading: spinning,
              spinnerAriaValueText: spinning ? _29("Fixing ...") : void 0,
              isDisabled: suffix === "" || !valid_dn(suffix) || spinning || fixupCompleted,
              ...extraPrimaryProps,
              children: saveBtnName
            },
            "confirm"
          )
        );
      }
      actions.push(
        /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { variant: "link", onClick: closeHandler, children: _29("Close") }, "close")
      );
      const placeHolder = "Choose a base suffix";
      let suffixList = [placeHolder];
      suffixList.push.apply(suffixList, suffixes);
      return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
        Modal,
        {
          variant: ModalVariant.small,
          title: _29("Run Shadow Account Fixup Task"),
          isOpen: showModal,
          onClose: closeHandler,
          actions,
          children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Grid, { className: "ds-margin-top-lg", title: _29("Suffix to run the fix-up task on."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { className: "ds-label", span: 1, children: _29("Suffix") }),
              /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { offset: 2, span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
                FormSelect,
                {
                  id: "fixupShadowSuffix",
                  name: "fixupShadowSuffix",
                  value: suffix,
                  onChange: (event, value) => handleChange(event),
                  "aria-label": "FormSelect Input",
                  isDisabled: spinning || fixupCompleted,
                  children: suffixList.map((suffixOption) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
                    FormSelectOption,
                    {
                      value: suffixOption === placeHolder ? "" : suffixOption,
                      label: suffixOption,
                      isDisabled: suffixOption === placeHolder,
                      isPlaceholder: suffixOption === placeHolder
                    },
                    suffixOption
                  ))
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Grid, { title: _29("Branch to run the fix-up task on."), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(GridItem, { offset: 2, span: 10, children: [
              /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
                TextInput,
                {
                  type: "text",
                  id: "fixupShadowSuffixInput",
                  "aria-describedby": "horizontal-form-name-helper",
                  isDisabled: spinning || fixupCompleted,
                  name: "fixupShadowSuffix",
                  value: suffix,
                  onChange: (e, val) => {
                    handleChange(e);
                  },
                  validated: !valid_dn(suffix) ? ValidatedOptions.error : ValidatedOptions.default
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormHelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
                HelperTextItem,
                {
                  icon: suffix !== "" && !valid_dn(suffix) ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(exclamation_circle_icon_default, {}) : void 0,
                  variant: suffix !== "" && !valid_dn(suffix) ? ValidatedOptions.error : ValidatedOptions.default,
                  children: suffix !== "" && !valid_dn(suffix) ? _29("Invalid DN syntax") : _29("Required field")
                }
              ) }) })
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Grid, { title: _29("Update all Shadow Account users regardless if they have ShadowLastChange attribute present"), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
              Checkbox,
              {
                id: "fixupShadowForce",
                name: "fixupShadowForce",
                onChange: (e, checked) => {
                  handleChange(e);
                },
                isChecked: force,
                isDisabled: spinning || fixupCompleted,
                label: _29("Force update of all users")
              }
            ) }) }),
            item
          ] })
        }
      );
    }
  };
  CreateLinkModal.propTypes = {
    showModal: import_prop_types30.default.bool,
    closeHandler: import_prop_types30.default.func,
    handleChange: import_prop_types30.default.func,
    saveHandler: import_prop_types30.default.func,
    suffix: import_prop_types30.default.string,
    error: import_prop_types30.default.object
  };
  CreateLinkModal.defaultProps = {
    showModal: false,
    suffix: "",
    error: {}
  };
  CreateSubSuffixModal.propTypes = {
    showModal: import_prop_types30.default.bool,
    closeHandler: import_prop_types30.default.func,
    handleChange: import_prop_types30.default.func,
    saveHandler: import_prop_types30.default.func,
    suffix: import_prop_types30.default.string,
    error: import_prop_types30.default.object
  };
  CreateSubSuffixModal.defaultProps = {
    showModal: false,
    suffix: "",
    error: {}
  };
  ExportModal.propTypes = {
    showModal: import_prop_types30.default.bool,
    closeHandler: import_prop_types30.default.func,
    handleChange: import_prop_types30.default.func,
    saveHandler: import_prop_types30.default.func,
    error: import_prop_types30.default.object,
    spinning: import_prop_types30.default.bool,
    item: import_prop_types30.default.node
  };
  ExportModal.defaultProps = {
    showModal: false,
    error: {},
    spinning: false,
    item: null
  };
  ImportModal.propTypes = {
    showModal: import_prop_types30.default.bool,
    closeHandler: import_prop_types30.default.func,
    handleChange: import_prop_types30.default.func,
    saveHandler: import_prop_types30.default.func,
    showConfirmImport: import_prop_types30.default.func,
    rows: import_prop_types30.default.array,
    suffix: import_prop_types30.default.string
  };
  ImportModal.defaultProps = {
    showModal: false,
    rows: [],
    suffix: ""
  };
  ShadowFixupModal.propTypes = {
    showModal: import_prop_types30.default.bool,
    closeHandler: import_prop_types30.default.func,
    handleChange: import_prop_types30.default.func,
    saveHandler: import_prop_types30.default.func,
    spinning: import_prop_types30.default.bool,
    item: import_prop_types30.default.node,
    force: import_prop_types30.default.bool,
    suffix: import_prop_types30.default.string,
    fixupCompleted: import_prop_types30.default.bool,
    suffixes: import_prop_types30.default.array
  };
  ShadowFixupModal.defaultProps = {
    showModal: false,
    error: {},
    spinning: false,
    item: null,
    force: false,
    suffix: "",
    fixupCompleted: false,
    suffixes: []
  };

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Dropdown/Dropdown.js
  init_tslib_es6();
  var React261 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Dropdown/DropdownWithContext.js
  init_tslib_es6();
  var React260 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Dropdown/DropdownMenu.js
  init_tslib_es6();
  var React259 = __toESM(require_react());
  var ReactDOM5 = __toESM(require_react_dom());
  var DropdownMenu = class _DropdownMenu extends React259.Component {
    constructor() {
      super(...arguments);
      this.refsCollection = [];
      this.componentWillUnmount = () => {
        document.removeEventListener("keydown", this.onKeyDown);
      };
      this.onKeyDown = (event) => {
        if (!this.props.isOpen || !Array.from(document.activeElement.classList).find((className) => _DropdownMenu.validToggleClasses.concat(this.context.toggleClass).includes(className))) {
          return;
        }
        const refs = this.refsCollection;
        if (event.key === "ArrowDown") {
          const firstFocusTargetCollection = refs.find((ref) => ref && ref[0] && !ref[0].hasAttribute("disabled"));
          _DropdownMenu.focusFirstRef(firstFocusTargetCollection);
          event.stopPropagation();
        } else if (event.key === "ArrowUp") {
          const collectionLength = refs.length;
          const lastFocusTargetCollection = refs.slice(collectionLength - 1, collectionLength);
          const lastFocusTarget = lastFocusTargetCollection && lastFocusTargetCollection[0];
          _DropdownMenu.focusFirstRef(lastFocusTarget);
          event.stopPropagation();
        }
      };
      this.childKeyHandler = (index, innerIndex, position, custom17 = false) => {
        keyHandler(index, innerIndex, position, this.refsCollection, this.props.isGrouped ? this.refsCollection : React259.Children.toArray(this.props.children), custom17);
      };
      this.sendRef = (index, nodes, isDisabled, isSeparator) => {
        this.refsCollection[index] = [];
        nodes.map((node, innerIndex) => {
          if (!node) {
            this.refsCollection[index][innerIndex] = null;
          } else if (!node.getAttribute) {
            this.refsCollection[index][innerIndex] = ReactDOM5.findDOMNode(node);
          } else if (isSeparator) {
            this.refsCollection[index][innerIndex] = null;
          } else {
            this.refsCollection[index][innerIndex] = node;
          }
        });
      };
    }
    componentDidMount() {
      document.addEventListener("keydown", this.onKeyDown);
      const { autoFocus } = this.props;
      if (autoFocus) {
        const focusTargetCollection = this.refsCollection.find((ref) => ref && ref[0] && !ref[0].hasAttribute("disabled"));
        const focusTarget = focusTargetCollection && focusTargetCollection[0];
        if (focusTarget && focusTarget.focus) {
          setTimeout(() => focusTarget.focus());
        }
      }
    }
    shouldComponentUpdate() {
      this.refsCollection = [];
      return true;
    }
    extendChildren() {
      const { children, isGrouped } = this.props;
      if (isGrouped) {
        let index = 0;
        return React259.Children.map(children, (groupedChildren) => {
          const group = groupedChildren;
          const props = {};
          if (group.props && group.props.children) {
            if (Array.isArray(group.props.children)) {
              props.children = React259.Children.map(group.props.children, (option) => React259.cloneElement(option, {
                index: index++
              }));
            } else {
              props.children = React259.cloneElement(group.props.children, {
                index: index++
              });
            }
          }
          return React259.cloneElement(group, props);
        });
      }
      return React259.Children.map(children, (child, index) => React259.cloneElement(child, {
        index
      }));
    }
    render() {
      const _a = this.props, { className, isOpen, position, children, component, isGrouped, setMenuComponentRef, alignments } = _a, props = __rest(_a, ["className", "isOpen", "position", "children", "component", "isGrouped", "setMenuComponentRef", "alignments"]);
      return React259.createElement(DropdownArrowContext.Provider, { value: {
        keyHandler: this.childKeyHandler,
        sendRef: this.sendRef
      } }, component === "div" ? React259.createElement(DropdownContext.Consumer, null, ({ onSelect, menuClass }) => React259.createElement("div", { className: css(menuClass, position === DropdownPosition.right && dropdown_default.modifiers.alignRight, formatBreakpointMods(alignments, dropdown_default, "align-"), className), hidden: !isOpen, onClick: (event) => onSelect && onSelect(event), ref: setMenuComponentRef }, children)) : isGrouped && React259.createElement(DropdownContext.Consumer, null, ({ menuClass, menuComponent }) => {
        const MenuComponent = menuComponent || "div";
        return React259.createElement(MenuComponent, Object.assign({}, props, { className: css(menuClass, position === DropdownPosition.right && dropdown_default.modifiers.alignRight, formatBreakpointMods(alignments, dropdown_default, "align-"), className), hidden: !isOpen, role: "menu", ref: setMenuComponentRef }), this.extendChildren());
      }) || React259.createElement(DropdownContext.Consumer, null, ({ menuClass, menuComponent }) => {
        const MenuComponent = menuComponent || component;
        return React259.createElement(MenuComponent, Object.assign({}, props, { className: css(menuClass, position === DropdownPosition.right && dropdown_default.modifiers.alignRight, formatBreakpointMods(alignments, dropdown_default, "align-"), className), hidden: !isOpen, role: "menu", ref: setMenuComponentRef }), this.extendChildren());
      }));
    }
  };
  DropdownMenu.displayName = "DropdownMenu";
  DropdownMenu.defaultProps = {
    className: "",
    isOpen: true,
    autoFocus: true,
    position: DropdownPosition.left,
    component: "ul",
    isGrouped: false,
    setMenuComponentRef: null
  };
  DropdownMenu.validToggleClasses = [dropdown_default.dropdownToggle, dropdown_default.dropdownToggleButton];
  DropdownMenu.focusFirstRef = (refCollection) => {
    if (refCollection && refCollection[0] && refCollection[0].focus) {
      setTimeout(() => refCollection[0].focus());
    }
  };
  DropdownMenu.contextType = DropdownContext;

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Dropdown/DropdownWithContext.js
  var DropdownWithContext = class _DropdownWithContext extends React260.Component {
    constructor(props) {
      super(props);
      this.openedOnEnter = false;
      this.baseComponentRef = React260.createRef();
      this.menuComponentRef = React260.createRef();
      this.onEnter = () => {
        this.openedOnEnter = true;
      };
      this.setMenuComponentRef = (element) => {
        this.menuComponentRef = element;
      };
      this.getMenuComponentRef = () => this.menuComponentRef;
      if (props.dropdownItems && props.dropdownItems.length > 0 && props.children) {
        console.error("Children and dropdownItems props have been provided. Only the dropdownItems prop items will be rendered");
      }
    }
    componentDidUpdate() {
      if (!this.props.isOpen) {
        this.openedOnEnter = false;
      }
    }
    render() {
      const _a = this.props, {
        children,
        className,
        direction,
        dropdownItems,
        isOpen,
        isPlain,
        isText,
        isGrouped,
        isFullHeight,
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        onSelect,
        position,
        toggle,
        autoFocus,
        minWidth,
        menuAppendTo,
        isFlipEnabled,
        zIndex
      } = _a, props = __rest(_a, ["children", "className", "direction", "dropdownItems", "isOpen", "isPlain", "isText", "isGrouped", "isFullHeight", "onSelect", "position", "toggle", "autoFocus", "minWidth", "menuAppendTo", "isFlipEnabled", "zIndex"]);
      const id = toggle.props.id || `pf-dropdown-toggle-id-${_DropdownWithContext.currentId++}`;
      let component;
      let renderedContent;
      let ariaHasPopup = false;
      if (dropdownItems && dropdownItems.length > 0) {
        component = "ul";
        renderedContent = dropdownItems;
        ariaHasPopup = true;
      } else {
        component = "div";
        renderedContent = React260.Children.toArray(children);
      }
      const popperRef = React260.createRef();
      const openedOnEnter = this.openedOnEnter;
      const isStatic = isFlipEnabled && menuAppendTo !== "inline";
      return React260.createElement(DropdownContext.Consumer, null, ({ baseClass, baseComponent, id: contextId, ouiaId, ouiaComponentType, ouiaSafe, alignments }) => {
        const BaseComponent = baseComponent;
        const menuContainer = React260.createElement(DropdownMenu, { className: css(isStatic && dropdown_default.modifiers.static), setMenuComponentRef: this.setMenuComponentRef, component, isOpen, position, "aria-labelledby": contextId ? `${contextId}-toggle` : id, isGrouped, autoFocus: openedOnEnter && autoFocus, alignments }, renderedContent);
        const popperContainer = React260.createElement("div", { className: css(baseClass, direction === DropdownDirection.up && dropdown_default.modifiers.top, position === DropdownPosition.right && dropdown_default.modifiers.alignRight, isOpen && dropdown_default.modifiers.expanded, className), ref: popperRef }, isOpen && menuContainer);
        const mainContainer = React260.createElement(
          BaseComponent,
          Object.assign({}, props, { className: css(baseClass, direction === DropdownDirection.up && dropdown_default.modifiers.top, position === DropdownPosition.right && dropdown_default.modifiers.alignRight, isOpen && dropdown_default.modifiers.expanded, isFullHeight && dropdown_default.modifiers.fullHeight, className), ref: this.baseComponentRef }, getOUIAProps(ouiaComponentType, ouiaId, ouiaSafe)),
          React260.Children.map(toggle, (oneToggle) => React260.cloneElement(oneToggle, {
            parentRef: this.baseComponentRef,
            getMenuRef: this.getMenuComponentRef,
            isOpen,
            id,
            isPlain,
            isText,
            "aria-haspopup": ariaHasPopup,
            onEnter: () => {
              this.onEnter();
              oneToggle.props.onEnter && oneToggle.props.onEnter();
            }
          })),
          menuAppendTo === "inline" && isOpen && menuContainer
        );
        const getParentElement = () => {
          if (this.baseComponentRef && this.baseComponentRef.current) {
            return this.baseComponentRef.current.parentElement;
          }
          return null;
        };
        return menuAppendTo === "inline" ? mainContainer : React260.createElement(Popper, { trigger: mainContainer, triggerRef: this.baseComponentRef, popper: popperContainer, popperRef, direction, position, appendTo: menuAppendTo === "parent" ? getParentElement() : menuAppendTo, isVisible: isOpen, zIndex, minWidth: minWidth !== void 0 ? minWidth : "revert" });
      });
    }
  };
  DropdownWithContext.displayName = "DropdownWithContext";
  DropdownWithContext.currentId = 0;
  DropdownWithContext.defaultProps = {
    className: "",
    dropdownItems: [],
    isOpen: false,
    isPlain: false,
    isText: false,
    isGrouped: false,
    position: DropdownPosition.left,
    direction: DropdownDirection.down,
    onSelect: () => void 0,
    autoFocus: true,
    menuAppendTo: "inline",
    isFlipEnabled: true
  };

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Dropdown/Dropdown.js
  var Dropdown2 = (_a) => {
    var {
      onSelect,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      ref,
      // Types of Ref are different for React.FunctionComponent vs React.Component
      ouiaId,
      ouiaSafe,
      alignments,
      contextProps,
      minWidth,
      menuAppendTo = "inline",
      isFlipEnabled = true,
      zIndex = 9999
    } = _a, props = __rest(_a, ["onSelect", "ref", "ouiaId", "ouiaSafe", "alignments", "contextProps", "minWidth", "menuAppendTo", "isFlipEnabled", "zIndex"]);
    return React261.createElement(
      DropdownContext.Provider,
      { value: Object.assign({ onSelect: (event) => onSelect && onSelect(event), toggleTextClass: dropdown_default.dropdownToggleText, toggleIconClass: dropdown_default.dropdownToggleImage, toggleIndicatorClass: dropdown_default.dropdownToggleIcon, menuClass: dropdown_default.dropdownMenu, itemClass: dropdown_default.dropdownMenuItem, toggleClass: dropdown_default.dropdownToggle, baseClass: dropdown_default.dropdown, baseComponent: "div", sectionClass: dropdown_default.dropdownGroup, sectionTitleClass: dropdown_default.dropdownGroupTitle, sectionComponent: "section", disabledClass: dropdown_default.modifiers.disabled, plainTextClass: dropdown_default.modifiers.text, ouiaId: useOUIAId(Dropdown2.displayName, ouiaId), ouiaSafe, ouiaComponentType: Dropdown2.displayName, alignments }, contextProps) },
      React261.createElement(DropdownWithContext, Object.assign({ menuAppendTo, isFlipEnabled, zIndex, minWidth }, props))
    );
  };
  Dropdown2.displayName = "Dropdown";

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Dropdown/DropdownItem.js
  init_tslib_es6();
  var React262 = __toESM(require_react());
  var DropdownItem2 = (_a) => {
    var {
      children,
      className,
      component = "a",
      isDisabled = false,
      isAriaDisabled = false,
      isPlainText = false,
      href,
      tooltip,
      tooltipProps = {},
      listItemClassName,
      onClick,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      ref,
      // Types of Ref are different for React.FunctionComponent vs React.Component
      additionalChild,
      customChild,
      tabIndex = -1,
      icon = null,
      autoFocus,
      description = null,
      styleChildren,
      ouiaId,
      ouiaSafe
    } = _a, props = __rest(_a, ["children", "className", "component", "isDisabled", "isAriaDisabled", "isPlainText", "href", "tooltip", "tooltipProps", "listItemClassName", "onClick", "ref", "additionalChild", "customChild", "tabIndex", "icon", "autoFocus", "description", "styleChildren", "ouiaId", "ouiaSafe"]);
    const ouiaProps = useOUIAProps(DropdownItem2.displayName, ouiaId, ouiaSafe);
    return React262.createElement(DropdownArrowContext.Consumer, null, (context) => React262.createElement(InternalDropdownItem, Object.assign({ context, role: "menuitem", tabIndex, className, component, isDisabled, isAriaDisabled, isPlainText, href, tooltip, tooltipProps, listItemClassName, onClick, additionalChild, customChild, icon, autoFocus, styleChildren, description }, ouiaProps, props), children));
  };
  DropdownItem2.displayName = "DropdownItem";

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Dropdown/BadgeToggle.js
  init_tslib_es6();
  var React264 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Dropdown/Toggle.js
  init_tslib_es6();
  var React263 = __toESM(require_react());
  var buttonVariantStyles = {
    default: "",
    primary: dropdown_default.modifiers.primary,
    secondary: dropdown_default.modifiers.secondary
  };
  var Toggle = class extends React263.Component {
    constructor() {
      super(...arguments);
      this.buttonRef = React263.createRef();
      this.componentDidMount = () => {
        document.addEventListener("click", this.onDocClick);
        document.addEventListener("touchstart", this.onDocClick);
        document.addEventListener("keydown", this.onEscPress);
      };
      this.componentWillUnmount = () => {
        document.removeEventListener("click", this.onDocClick);
        document.removeEventListener("touchstart", this.onDocClick);
        document.removeEventListener("keydown", this.onEscPress);
      };
      this.onDocClick = (event) => {
        const { isOpen, parentRef, onToggle, getMenuRef } = this.props;
        const menuRef = getMenuRef && getMenuRef();
        const clickedOnToggle = parentRef && parentRef.current && parentRef.current.contains(event.target);
        const clickedWithinMenu = menuRef && menuRef.contains && menuRef.contains(event.target);
        if (isOpen && !(clickedOnToggle || clickedWithinMenu)) {
          onToggle === null || onToggle === void 0 ? void 0 : onToggle(event, false);
        }
      };
      this.onEscPress = (event) => {
        var _a, _b, _c;
        const { parentRef, getMenuRef } = this.props;
        const menuRef = getMenuRef && getMenuRef();
        const escFromToggle = parentRef && parentRef.current && parentRef.current.contains(event.target);
        const escFromWithinMenu = menuRef && menuRef.contains && menuRef.contains(event.target);
        if (this.props.isOpen && (event.key === KeyTypes.Escape || event.key === "Tab") && (escFromToggle || escFromWithinMenu)) {
          (_b = (_a = this.props).onToggle) === null || _b === void 0 ? void 0 : _b.call(_a, event, false);
          (_c = this.buttonRef.current) === null || _c === void 0 ? void 0 : _c.focus();
        }
      };
      this.onKeyDown = (event) => {
        var _a, _b, _c, _d, _e, _f;
        if (event.key === "Tab" && !this.props.isOpen) {
          return;
        }
        if ((event.key === "Tab" || event.key === "Enter" || event.key === " ") && this.props.isOpen) {
          if (!this.props.bubbleEvent) {
            event.stopPropagation();
          }
          event.preventDefault();
          (_b = (_a = this.props).onToggle) === null || _b === void 0 ? void 0 : _b.call(_a, event, !this.props.isOpen);
        } else if ((event.key === "Enter" || event.key === " ") && !this.props.isOpen) {
          if (!this.props.bubbleEvent) {
            event.stopPropagation();
          }
          event.preventDefault();
          (_d = (_c = this.props).onToggle) === null || _d === void 0 ? void 0 : _d.call(_c, event, !this.props.isOpen);
          (_f = (_e = this.props).onEnter) === null || _f === void 0 ? void 0 : _f.call(_e);
        }
      };
    }
    render() {
      const _a = this.props, {
        className,
        children,
        isOpen,
        isDisabled,
        isPlain,
        isText,
        isSplitButton,
        toggleVariant,
        onToggle,
        "aria-haspopup": ariaHasPopup,
        /* eslint-disable @typescript-eslint/no-unused-vars */
        isActive,
        bubbleEvent,
        onEnter,
        parentRef,
        getMenuRef,
        /* eslint-enable @typescript-eslint/no-unused-vars */
        id,
        type
      } = _a, props = __rest(_a, ["className", "children", "isOpen", "isDisabled", "isPlain", "isText", "isSplitButton", "toggleVariant", "onToggle", "aria-haspopup", "isActive", "bubbleEvent", "onEnter", "parentRef", "getMenuRef", "id", "type"]);
      return React263.createElement(DropdownContext.Consumer, null, ({ toggleClass }) => React263.createElement("button", Object.assign({}, props, { id, ref: this.buttonRef, className: css(isSplitButton ? dropdown_default.dropdownToggleButton : toggleClass || dropdown_default.dropdownToggle, isActive && dropdown_default.modifiers.active, isPlain && dropdown_default.modifiers.plain, isText && dropdown_default.modifiers.text, toggleVariant && buttonVariantStyles[toggleVariant], className), type: type || "button", onClick: (event) => onToggle === null || onToggle === void 0 ? void 0 : onToggle(event, !isOpen), "aria-expanded": isOpen, "aria-haspopup": ariaHasPopup, onKeyDown: (event) => this.onKeyDown(event), disabled: isDisabled }), children));
    }
  };
  Toggle.displayName = "Toggle";
  Toggle.defaultProps = {
    className: "",
    isOpen: false,
    isActive: false,
    isDisabled: false,
    isPlain: false,
    isText: false,
    isSplitButton: false,
    onToggle: () => {
    },
    onEnter: () => {
    },
    bubbleEvent: false
  };

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Dropdown/BadgeToggle.js
  var BadgeToggle = (_a) => {
    var {
      id = "",
      children = null,
      badgeProps = { isRead: true },
      className = "",
      isOpen = false,
      "aria-label": ariaLabel = "Actions",
      parentRef = null,
      getMenuRef = null,
      isActive = false,
      isPlain = null,
      isDisabled = false,
      bubbleEvent = false,
      onToggle = () => void 0,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      ref
    } = _a, props = __rest(_a, ["id", "children", "badgeProps", "className", "isOpen", "aria-label", "parentRef", "getMenuRef", "isActive", "isPlain", "isDisabled", "bubbleEvent", "onToggle", "ref"]);
    return React264.createElement(
      Toggle,
      Object.assign({ id, className, isOpen, "aria-label": ariaLabel, parentRef, getMenuRef, isActive, isPlain: isPlain || true, isDisabled, onToggle, bubbleEvent }, props),
      React264.createElement(
        Badge,
        Object.assign({}, badgeProps),
        children,
        React264.createElement(
          "span",
          { className: css(dropdown_default.dropdownToggleIcon) },
          React264.createElement(caret_down_icon_default, null)
        )
      )
    );
  };
  BadgeToggle.displayName = "BadgeToggle";

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Dropdown/KebabToggle.js
  init_tslib_es6();
  var React265 = __toESM(require_react());
  var KebabToggle = (_a) => {
    var {
      id = "",
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      children = null,
      className = "",
      isOpen = false,
      "aria-label": ariaLabel = "Actions",
      parentRef = null,
      getMenuRef = null,
      isActive = false,
      isPlain = false,
      isDisabled = false,
      bubbleEvent = false,
      onToggle = () => void 0,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      ref
    } = _a, props = __rest(_a, ["id", "children", "className", "isOpen", "aria-label", "parentRef", "getMenuRef", "isActive", "isPlain", "isDisabled", "bubbleEvent", "onToggle", "ref"]);
    return React265.createElement(
      Toggle,
      Object.assign({ id, className, isOpen, "aria-label": ariaLabel, parentRef, getMenuRef, isActive, isPlain, isDisabled, onToggle, bubbleEvent }, props),
      React265.createElement(ellipsis_v_icon_default, null)
    );
  };
  KebabToggle.displayName = "KebabToggle";

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Dropdown/DropdownToggle.js
  init_tslib_es6();
  var React266 = __toESM(require_react());
  var DropdownToggle = (_a) => {
    var {
      id = "",
      children = null,
      className = "",
      isOpen = false,
      parentRef = null,
      getMenuRef = null,
      isDisabled = false,
      isPlain = false,
      isText = false,
      toggleVariant = "default",
      isActive = false,
      onToggle = (_evt, _isOpen) => void 0,
      icon = null,
      toggleIndicator: ToggleIndicator = caret_down_icon_default,
      splitButtonItems,
      splitButtonVariant = "checkbox",
      "aria-haspopup": ariaHasPopup,
      ouiaId,
      ouiaSafe,
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      ref
    } = _a, props = __rest(_a, ["id", "children", "className", "isOpen", "parentRef", "getMenuRef", "isDisabled", "isPlain", "isText", "toggleVariant", "isActive", "onToggle", "icon", "toggleIndicator", "splitButtonItems", "splitButtonVariant", "aria-haspopup", "ouiaId", "ouiaSafe", "ref"]);
    const ouiaProps = useOUIAProps(DropdownToggle.displayName, ouiaId, ouiaSafe);
    const toggle = React266.createElement(DropdownContext.Consumer, null, ({ toggleTextClass, toggleIndicatorClass, toggleIconClass }) => React266.createElement(
      Toggle,
      Object.assign({}, props, { id, className, isOpen, parentRef, getMenuRef, isActive, isDisabled, isPlain, isText, toggleVariant, onToggle, "aria-haspopup": ariaHasPopup }, ouiaProps, splitButtonItems && { isSplitButton: true, "aria-label": props["aria-label"] || "Select" }),
      icon && React266.createElement("span", { className: css(toggleIconClass) }, icon),
      children && React266.createElement("span", { className: ToggleIndicator && css(toggleTextClass) }, children),
      ToggleIndicator && React266.createElement(
        "span",
        { className: css(!splitButtonItems && toggleIndicatorClass) },
        React266.createElement(ToggleIndicator, null)
      )
    ));
    if (splitButtonItems) {
      return React266.createElement(
        "div",
        { className: css(dropdown_default.dropdownToggle, dropdown_default.modifiers.splitButton, splitButtonVariant === "action" && dropdown_default.modifiers.action, toggleVariant === "primary" && splitButtonVariant === "action" && dropdown_default.modifiers.primary, toggleVariant === "secondary" && splitButtonVariant === "action" && dropdown_default.modifiers.secondary, isDisabled && dropdown_default.modifiers.disabled) },
        splitButtonItems,
        toggle
      );
    }
    return toggle;
  };
  DropdownToggle.displayName = "DropdownToggle";

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Wizard/Wizard.js
  init_tslib_es6();
  var React274 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Wizard/WizardFooterInternal.js
  var React267 = __toESM(require_react());
  var WizardFooterInternal = ({ onNext, onBack, onClose, isValid, firstStep, activeStep, nextButtonText, backButtonText, cancelButtonText }) => React267.createElement(
    "footer",
    { className: css(wizard_default.wizardFooter) },
    !activeStep.hideBackButton && React267.createElement(Button, { variant: ButtonVariant.secondary, onClick: onBack, isDisabled: firstStep }, backButtonText),
    React267.createElement(Button, { variant: ButtonVariant.primary, type: "submit", onClick: onNext, isDisabled: !isValid }, nextButtonText),
    !activeStep.hideCancelButton && React267.createElement(
      "div",
      { className: wizard_default.wizardFooterCancel },
      React267.createElement(Button, { variant: ButtonVariant.link, onClick: onClose }, cancelButtonText)
    )
  );
  WizardFooterInternal.displayName = "WizardFooterInternal";

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Wizard/WizardToggle.js
  var React269 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Wizard/WizardBody.js
  var React268 = __toESM(require_react());

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Wizard/WizardDrawerWrapper.js
  var WizardDrawerWrapper = ({ hasDrawer, wrapper, children }) => hasDrawer ? wrapper(children) : children;
  WizardDrawerWrapper.displayName = "WizardDrawerWrapper";

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Wizard/WizardBody.js
  var WizardBody = ({ children, hasNoBodyPadding = false, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, mainComponent = "div", hasDrawer, isDrawerExpanded, onExpandDrawer, activeStep }) => {
    const MainComponent = mainComponent;
    const [hasScrollbar, setHasScrollbar] = React268.useState(false);
    const [previousWidth, setPreviousWidth] = React268.useState(void 0);
    const wizardBodyRef = React268.useRef(null);
    React268.useEffect(() => {
      const resize = () => {
        if (wizardBodyRef === null || wizardBodyRef === void 0 ? void 0 : wizardBodyRef.current) {
          const { offsetWidth, offsetHeight, scrollHeight } = wizardBodyRef.current;
          if (previousWidth !== offsetWidth) {
            setPreviousWidth(offsetWidth);
            setHasScrollbar(offsetHeight < scrollHeight);
          }
        }
      };
      const handleResizeWithDelay = debounce(resize, 250);
      let observer = () => {
      };
      if (wizardBodyRef === null || wizardBodyRef === void 0 ? void 0 : wizardBodyRef.current) {
        observer = getResizeObserver(wizardBodyRef.current, handleResizeWithDelay);
        const { offsetHeight, scrollHeight } = wizardBodyRef.current;
        setHasScrollbar(offsetHeight < scrollHeight);
        setPreviousWidth(wizardBodyRef.current.offsetWidth);
      }
      return () => {
        observer();
      };
    }, []);
    return React268.createElement(
      MainComponent,
      Object.assign({}, mainComponent === "div" && hasScrollbar && { role: "region" }, hasScrollbar && { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, tabIndex: 0 }, { ref: wizardBodyRef, className: css(wizard_default.wizardMain) }),
      React268.createElement(
        WizardDrawerWrapper,
        { hasDrawer: hasDrawer && activeStep.drawerPanelContent, wrapper: (children2) => React268.createElement(
          Drawer,
          { isInline: true, isExpanded: isDrawerExpanded, onExpand: onExpandDrawer },
          React268.createElement(DrawerContent, { panelContent: activeStep.drawerPanelContent }, children2)
        ) },
        React268.createElement("div", { className: css(wizard_default.wizardMainBody, hasNoBodyPadding && wizard_default.modifiers.noPadding) }, children)
      )
    );
  };
  WizardBody.displayName = "WizardBody";

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Wizard/WizardToggle.js
  var WizardToggle = ({ isNavOpen, onNavToggle, nav, steps, activeStep, children, hasNoBodyPadding = false, "aria-label": ariaLabel = "Wizard Toggle", mainAriaLabelledBy = null, mainAriaLabel = null, isInPage = true, hasDrawer, isDrawerExpanded, onExpandDrawer }) => {
    let activeStepIndex;
    let activeStepName;
    let activeStepSubName;
    for (let i = 0; i < steps.length; i++) {
      if (activeStep.id && steps[i].id === activeStep.id || steps[i].name === activeStep.name) {
        activeStepIndex = i + 1;
        activeStepName = steps[i].name;
        break;
      } else if (steps[i].steps) {
        for (const step of steps[i].steps) {
          if (activeStep.id && step.id === activeStep.id || step.name === activeStep.name) {
            activeStepIndex = i + 1;
            activeStepName = steps[i].name;
            activeStepSubName = step.name;
            break;
          }
        }
      }
    }
    return React269.createElement(
      React269.Fragment,
      null,
      React269.createElement(
        "button",
        { onClick: () => onNavToggle(!isNavOpen), className: css(wizard_default.wizardToggle, isNavOpen && "pf-m-expanded"), "aria-label": ariaLabel, "aria-expanded": isNavOpen },
        React269.createElement(
          "span",
          { className: css(wizard_default.wizardToggleList) },
          React269.createElement(
            "span",
            { className: css(wizard_default.wizardToggleListItem) },
            React269.createElement("span", { className: css(wizard_default.wizardToggleNum) }, activeStepIndex),
            " ",
            activeStepName,
            activeStepSubName && React269.createElement(angle_right_icon_default, { className: css(wizard_default.wizardToggleSeparator), "aria-hidden": "true" })
          ),
          activeStepSubName && React269.createElement("span", { className: css(wizard_default.wizardToggleListItem) }, activeStepSubName)
        ),
        React269.createElement(
          "span",
          { className: css(wizard_default.wizardToggleIcon) },
          React269.createElement(caret_down_icon_default, { "aria-hidden": "true" })
        )
      ),
      React269.createElement(
        "div",
        { className: css(wizard_default.wizardOuterWrap) },
        React269.createElement(
          "div",
          { className: css(wizard_default.wizardInnerWrap) },
          nav(isNavOpen),
          React269.createElement(
            WizardBody,
            { mainComponent: isInPage ? "div" : "main", "aria-label": mainAriaLabel, "aria-labelledby": mainAriaLabelledBy, hasNoBodyPadding, activeStep, isDrawerExpanded, onExpandDrawer, hasDrawer },
            hasDrawer && !isDrawerExpanded && activeStep.drawerToggleButton,
            activeStep.component
          )
        ),
        children
      )
    );
  };
  WizardToggle.displayName = "WizardToggle";

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Wizard/WizardNav.js
  var React270 = __toESM(require_react());
  var WizardNav = ({ children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, isOpen = false, returnList = false, ouiaId, ouiaSafe = true }) => {
    const ouiaProps = useOUIAProps(WizardNav.displayName, ouiaId, ouiaSafe);
    const innerList = React270.createElement("ol", { className: css(wizard_default.wizardNavList), role: "list" }, children);
    if (returnList) {
      return innerList;
    }
    return React270.createElement(
      "nav",
      Object.assign({ className: css(wizard_default.wizardNav, isOpen && wizard_default.modifiers.expanded), "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy }, ouiaProps),
      React270.createElement("ol", { className: css(wizard_default.wizardNavList), role: "list" }, children)
    );
  };
  WizardNav.displayName = "WizardNav";

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Wizard/WizardNavItem.js
  init_tslib_es6();
  var React271 = __toESM(require_react());
  var WizardNavItem = (_a) => {
    var { children = null, content = "", isCurrent = false, isDisabled = false, step, onNavItemClick = () => void 0, navItemComponent = "button", href = null, isExpandable = false, id, ouiaId, ouiaSafe = true } = _a, rest = __rest(_a, ["children", "content", "isCurrent", "isDisabled", "step", "onNavItemClick", "navItemComponent", "href", "isExpandable", "id", "ouiaId", "ouiaSafe"]);
    const ouiaProps = useOUIAProps(WizardNavItem.displayName, ouiaId, ouiaSafe);
    const NavItemComponent = navItemComponent;
    const [isExpanded, setIsExpanded] = React271.useState(false);
    React271.useEffect(() => {
      setIsExpanded(isCurrent);
    }, [isCurrent]);
    if (navItemComponent === "a" && !href && true) {
      console.error("WizardNavItem: When using an anchor, please provide an href");
    }
    const btnProps = {
      disabled: isDisabled,
      type: "button"
    };
    const linkProps = {
      tabIndex: isDisabled ? -1 : void 0,
      href
    };
    return React271.createElement(
      "li",
      { className: css(wizard_default.wizardNavItem, isExpandable && wizard_default.modifiers.expandable, isExpandable && isExpanded && wizard_default.modifiers.expanded) },
      React271.createElement(NavItemComponent, Object.assign({}, rest, navItemComponent === "a" ? Object.assign({}, linkProps) : Object.assign({}, btnProps), id && { id: id.toString() }, { onClick: () => isExpandable ? setIsExpanded(!isExpanded || isCurrent) : onNavItemClick(step), className: css(wizard_default.wizardNavLink, isCurrent && wizard_default.modifiers.current, isDisabled && wizard_default.modifiers.disabled), "aria-disabled": isDisabled ? true : null, "aria-current": isCurrent && !children ? "step" : false }, isExpandable && { "aria-expanded": isExpanded }, ouiaProps), isExpandable ? React271.createElement(
        React271.Fragment,
        null,
        React271.createElement("span", { className: css(wizard_default.wizardNavLinkText) }, content),
        React271.createElement(
          "span",
          { className: css(wizard_default.wizardNavLinkToggle) },
          React271.createElement(
            "span",
            { className: css(wizard_default.wizardNavLinkToggleIcon) },
            React271.createElement(angle_right_icon_default, null)
          )
        )
      ) : content),
      children
    );
  };
  WizardNavItem.displayName = "WizardNavItem";

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Wizard/WizardContext.js
  var React272 = __toESM(require_react());
  var WizardContext = React272.createContext({
    goToStepById: () => null,
    goToStepByName: () => null,
    onNext: () => null,
    onBack: () => null,
    onClose: () => null,
    activeStep: { name: null }
  });
  var WizardContextProvider = WizardContext.Provider;
  var WizardContextConsumer = WizardContext.Consumer;

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Wizard/WizardHeader.js
  var React273 = __toESM(require_react());
  var WizardHeader = ({ onClose = () => void 0, title, description, hideClose, closeButtonAriaLabel, titleId, descriptionComponent: Component40 = "div", descriptionId }) => React273.createElement(
    "div",
    { className: css(wizard_default.wizardHeader) },
    !hideClose && React273.createElement(
      "div",
      { className: css(wizard_default.wizardClose) },
      React273.createElement(
        Button,
        { variant: "plain", "aria-label": closeButtonAriaLabel, onClick: onClose },
        React273.createElement(times_icon_default, { "aria-hidden": "true" })
      )
    ),
    React273.createElement(
      "div",
      { className: css(wizard_default.wizardTitle) },
      React273.createElement("h2", { className: css(wizard_default.wizardTitleText), id: titleId }, title || React273.createElement(React273.Fragment, null, "\xA0"))
    ),
    description && React273.createElement(Component40, { className: css(wizard_default.wizardDescription), id: descriptionId }, description)
  );
  WizardHeader.displayName = "WizardHeader";

  // node_modules/@patternfly/react-core/dist/esm/deprecated/components/Wizard/Wizard.js
  var Wizard = class _Wizard extends React274.Component {
    constructor(props) {
      super(props);
      this.handleKeyClicks = (event) => {
        if (event.key === KeyTypes.Escape) {
          if (this.state.isNavOpen) {
            this.setState({ isNavOpen: !this.state.isNavOpen });
          } else if (this.props.isOpen) {
            this.props.onClose();
          }
        }
      };
      this.onNext = () => {
        const { onNext, onClose, onSave } = this.props;
        const { currentStep } = this.state;
        const flattenedSteps = this.getFlattenedSteps();
        const maxSteps = flattenedSteps.length;
        if (currentStep >= maxSteps) {
          if (onSave) {
            return onSave();
          }
          return onClose();
        } else {
          let newStep = currentStep;
          for (let nextStep = currentStep; nextStep <= maxSteps; nextStep++) {
            if (!flattenedSteps[nextStep]) {
              return;
            }
            if (!flattenedSteps[nextStep].isDisabled) {
              newStep = nextStep + 1;
              break;
            }
          }
          this.setCurrentStep(newStep, flattenedSteps[newStep - 1]);
          const { id: prevId, name: prevName } = flattenedSteps[currentStep - 1];
          const { id, name: name2 } = flattenedSteps[newStep - 1];
          return onNext && onNext({ id, name: name2 }, { prevId, prevName });
        }
      };
      this.onBack = () => {
        const { onBack } = this.props;
        const { currentStep } = this.state;
        const flattenedSteps = this.getFlattenedSteps();
        if (flattenedSteps.length < currentStep) {
          const adjustedStep = flattenedSteps.length;
          this.setCurrentStep(adjustedStep, flattenedSteps[adjustedStep - 1]);
        } else {
          let newStep = currentStep;
          for (let prevStep = currentStep; prevStep >= 0; prevStep--) {
            if (!flattenedSteps[prevStep - 2]) {
              return;
            }
            if (!flattenedSteps[prevStep - 2].isDisabled) {
              newStep = prevStep - 1 <= 1 ? 1 : prevStep - 1;
              break;
            }
          }
          this.setCurrentStep(newStep, flattenedSteps[newStep - 1]);
          const { id: prevId, name: prevName } = flattenedSteps[newStep];
          const { id, name: name2 } = flattenedSteps[newStep - 1];
          return onBack && onBack({ id, name: name2 }, { prevId, prevName });
        }
      };
      this.goToStep = (step) => {
        const flattenedSteps = this.getFlattenedSteps();
        if (flattenedSteps[step - 1].isDisabled) {
          return;
        }
        const { onGoToStep } = this.props;
        const { currentStep } = this.state;
        const maxSteps = flattenedSteps.length;
        if (step < 1) {
          step = 1;
        } else if (step > maxSteps) {
          step = maxSteps;
        }
        this.setCurrentStep(step, flattenedSteps[step - 1]);
        this.setState({ isNavOpen: false });
        const { id: prevId, name: prevName } = flattenedSteps[currentStep - 1];
        const { id, name: name2 } = flattenedSteps[step - 1];
        return onGoToStep && onGoToStep({ id, name: name2 }, { prevId, prevName });
      };
      this.goToStepById = (stepId) => {
        const flattenedSteps = this.getFlattenedSteps();
        let step;
        for (let i = 0; i < flattenedSteps.length; i++) {
          if (flattenedSteps[i].id === stepId) {
            step = i + 1;
            break;
          }
        }
        if (step) {
          this.setCurrentStep(step, flattenedSteps[step - 1]);
        }
      };
      this.goToStepByName = (stepName) => {
        const flattenedSteps = this.getFlattenedSteps();
        let step;
        for (let i = 0; i < flattenedSteps.length; i++) {
          if (flattenedSteps[i].name === stepName) {
            step = i + 1;
            break;
          }
        }
        if (step) {
          this.setCurrentStep(step, flattenedSteps[step - 1]);
        }
      };
      this.getFlattenedSteps = () => {
        const { steps } = this.props;
        const flattenedSteps = [];
        for (const step of steps) {
          if (step.steps) {
            for (const childStep of step.steps) {
              flattenedSteps.push(childStep);
            }
          } else {
            flattenedSteps.push(step);
          }
        }
        return flattenedSteps;
      };
      this.getFlattenedStepsIndex = (flattenedSteps, stepName) => {
        for (let i = 0; i < flattenedSteps.length; i++) {
          if (flattenedSteps[i].name === stepName) {
            return i + 1;
          }
        }
        return 0;
      };
      this.initSteps = (steps) => {
        for (let i = 0; i < steps.length; i++) {
          if (steps[i].steps) {
            for (let j = 0; j < steps[i].steps.length; j++) {
              steps[i].steps[j] = Object.assign({ canJumpTo: true }, steps[i].steps[j]);
            }
          }
          steps[i] = Object.assign({ canJumpTo: true }, steps[i]);
        }
        return steps;
      };
      this.getElement = (appendTo) => {
        if (typeof appendTo === "function") {
          return appendTo();
        }
        return appendTo || document.body;
      };
      const newId = _Wizard.currentId++;
      this.titleId = props.titleId || `pf-wizard-title-${newId}`;
      this.descriptionId = props.descriptionId || `pf-wizard-description-${newId}`;
      this.state = {
        currentStep: this.props.startAtStep && Number.isInteger(this.props.startAtStep) ? this.props.startAtStep : 1,
        isNavOpen: false
      };
      if (props.onCurrentStepChanged) {
        const flattenedSteps = this.getFlattenedSteps();
        if (flattenedSteps.length >= this.state.currentStep) {
          const currentStep = flattenedSteps[this.state.currentStep - 1];
          props.onCurrentStepChanged(currentStep);
        }
      }
      this.drawerRef = React274.createRef();
    }
    setCurrentStep(currentStep, currentStepObject) {
      this.setState({
        currentStep
      });
      if (this.props.onCurrentStepChanged) {
        this.props.onCurrentStepChanged(currentStepObject);
      }
    }
    componentDidMount() {
      const target = typeof document !== "undefined" ? document.body : null;
      if (target) {
        target.addEventListener("keydown", this.handleKeyClicks, false);
      }
    }
    componentWillUnmount() {
      const target = typeof document !== "undefined" && document.body || null;
      if (target) {
        target.removeEventListener("keydown", this.handleKeyClicks, false);
      }
    }
    componentDidUpdate(prevProps) {
      if (prevProps.startAtStep !== this.props.startAtStep) {
        this.setState({ currentStep: this.props.startAtStep });
      }
    }
    render() {
      const _a = this.props, {
        /* eslint-disable @typescript-eslint/no-unused-vars */
        width,
        height,
        title,
        description,
        descriptionComponent,
        onClose,
        onSave,
        onBack,
        onNext,
        onGoToStep,
        className,
        steps,
        startAtStep,
        nextButtonText = "Next",
        backButtonText = "Back",
        cancelButtonText = "Cancel",
        hideClose,
        closeButtonAriaLabel = "Close",
        navAriaLabel,
        navAriaLabelledBy,
        mainAriaLabel,
        mainAriaLabelledBy,
        hasNoBodyPadding,
        footer,
        appendTo,
        isOpen,
        titleId,
        descriptionId,
        isNavExpandable,
        onCurrentStepChanged,
        hasDrawer,
        isDrawerExpanded,
        onExpandDrawer
      } = _a, rest = __rest(_a, ["width", "height", "title", "description", "descriptionComponent", "onClose", "onSave", "onBack", "onNext", "onGoToStep", "className", "steps", "startAtStep", "nextButtonText", "backButtonText", "cancelButtonText", "hideClose", "closeButtonAriaLabel", "navAriaLabel", "navAriaLabelledBy", "mainAriaLabel", "mainAriaLabelledBy", "hasNoBodyPadding", "footer", "appendTo", "isOpen", "titleId", "descriptionId", "isNavExpandable", "onCurrentStepChanged", "hasDrawer", "isDrawerExpanded", "onExpandDrawer"]);
      const { currentStep } = this.state;
      const flattenedSteps = this.getFlattenedSteps();
      const adjustedStep = flattenedSteps.length < currentStep ? flattenedSteps.length : currentStep;
      const activeStep = flattenedSteps[adjustedStep - 1];
      const computedSteps = this.initSteps(steps);
      const firstStep = activeStep === flattenedSteps[0];
      const isValid = activeStep && activeStep.enableNext !== void 0 ? activeStep.enableNext : true;
      const nav = (isWizardNavOpen) => {
        const wizNavAProps = {
          isOpen: isWizardNavOpen,
          "aria-label": navAriaLabel,
          "aria-labelledby": (title || navAriaLabelledBy) && (navAriaLabelledBy || this.titleId)
        };
        return React274.createElement(WizardNav, Object.assign({}, wizNavAProps), computedSteps.map((step, index) => {
          if (step.isFinishedStep) {
            return;
          }
          let enabled;
          let navItemStep;
          if (step.steps) {
            let hasActiveChild = false;
            let canJumpToParent = false;
            for (const subStep of step.steps) {
              if (activeStep.name === subStep.name) {
                hasActiveChild = true;
              }
              if (subStep.canJumpTo) {
                canJumpToParent = true;
              }
            }
            navItemStep = this.getFlattenedStepsIndex(flattenedSteps, step.steps[0].name);
            return React274.createElement(
              WizardNavItem,
              { key: index, id: step.id, content: step.name, isExpandable: isNavExpandable, isCurrent: hasActiveChild, isDisabled: !canJumpToParent, step: navItemStep, onNavItemClick: this.goToStep },
              React274.createElement(WizardNav, Object.assign({}, wizNavAProps, { returnList: true }), step.steps.map((childStep, indexChild) => {
                if (childStep.isFinishedStep) {
                  return;
                }
                navItemStep = this.getFlattenedStepsIndex(flattenedSteps, childStep.name);
                enabled = childStep.canJumpTo && !childStep.isDisabled;
                return React274.createElement(WizardNavItem, { key: `child_${indexChild}`, id: childStep.id, content: childStep.name, isCurrent: activeStep.name === childStep.name, isDisabled: !enabled, step: navItemStep, onNavItemClick: this.goToStep });
              }))
            );
          }
          navItemStep = this.getFlattenedStepsIndex(flattenedSteps, step.name);
          enabled = step.canJumpTo && !step.isDisabled;
          return React274.createElement(WizardNavItem, Object.assign({}, step.stepNavItemProps, { key: index, id: step.id, content: step.name, isCurrent: activeStep.name === step.name, isDisabled: !enabled, step: navItemStep, onNavItemClick: this.goToStep }));
        }));
      };
      const context = {
        goToStepById: this.goToStepById,
        goToStepByName: this.goToStepByName,
        onNext: this.onNext,
        onBack: this.onBack,
        onClose,
        activeStep
      };
      const divStyles = Object.assign(Object.assign({}, height ? { height } : {}), width ? { width } : {});
      const wizard = React274.createElement(
        WizardContextProvider,
        { value: context },
        React274.createElement(
          "div",
          Object.assign({}, rest, { className: css(wizard_default.wizard, activeStep && activeStep.isFinishedStep && "pf-m-finished", className), style: Object.keys(divStyles).length ? divStyles : void 0 }),
          title && React274.createElement(WizardHeader, { titleId: this.titleId, descriptionId: this.descriptionId, onClose, title, description, descriptionComponent, closeButtonAriaLabel, hideClose }),
          React274.createElement(WizardToggle, { hasDrawer, isDrawerExpanded, onExpandDrawer, mainAriaLabel, isInPage: isOpen === void 0, mainAriaLabelledBy: (title || mainAriaLabelledBy) && (mainAriaLabelledBy || this.titleId), isNavOpen: this.state.isNavOpen, onNavToggle: (isNavOpen) => this.setState({ isNavOpen }), nav, steps, activeStep, hasNoBodyPadding }, footer || React274.createElement(WizardFooterInternal, { onNext: this.onNext, onBack: this.onBack, onClose, isValid, firstStep, activeStep, nextButtonText: activeStep && activeStep.nextButtonText || nextButtonText, backButtonText, cancelButtonText }))
        )
      );
      if (isOpen !== void 0) {
        return React274.createElement(Modal, { width: width !== null ? width : void 0, isOpen, variant: ModalVariant.large, "aria-labelledby": this.titleId, "aria-describedby": this.descriptionId, showClose: false, hasNoBodyWrapper: true }, wizard);
      }
      return wizard;
    }
  };
  Wizard.displayName = "Wizard";
  Wizard.currentId = 0;
  Wizard.defaultProps = {
    title: null,
    description: "",
    descriptionComponent: "p",
    className: "",
    startAtStep: 1,
    nextButtonText: "Next",
    backButtonText: "Back",
    cancelButtonText: "Cancel",
    hideClose: false,
    closeButtonAriaLabel: "Close",
    navAriaLabel: null,
    navAriaLabelledBy: null,
    mainAriaLabel: null,
    mainAriaLabelledBy: null,
    hasNoBodyPadding: false,
    onBack: null,
    onNext: null,
    onGoToStep: null,
    width: null,
    height: null,
    footer: null,
    onClose: () => void 0,
    appendTo: null,
    isOpen: void 0,
    isNavExpandable: false,
    hasDrawer: false,
    isDrawerExpanded: false,
    onExpandDrawer: () => void 0
  };

  // src/lib/database/suffix.jsx
  var import_prop_types31 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
  var _30 = cockpit_default.gettext;
  var Suffix = class extends import_react51.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: false,
        activeTabKey: 0,
        notifications: [],
        errObj: {},
        refRows: this.props.data.refRows,
        encAttrsRows: this.props.data.encAttrsRows,
        vlvItems: this.props.data.vlvItems,
        autoTuning: this.props.data.autoTuning,
        dropdownIsOpen: false,
        // Suffix configuration
        cachememsize: this.props.data.cachememsize,
        cachesize: this.props.data.cachesize,
        dncachememsize: this.props.data.dncachememsize,
        readOnly: this.props.data.readOnly,
        requireIndex: this.props.data.requireIndex,
        dbstate: this.props.data.dbstate,
        _cachememsize: this.props.data.cachememsize,
        _cachesize: this.props.data.cachesize,
        _dncachememsize: this.props.data.dncachememsize,
        _readOnly: this.props.data.readOnly,
        _requireIndex: this.props.data.requireIndex,
        _dbstate: this.props.data.dbstate,
        savingConfig: false,
        saveBtnDisabled: true,
        // Import/Export modals
        showImportModal: false,
        showExportModal: false,
        ldifLocation: "",
        attrEncryption: false,
        showConfirmLDIFImport: false,
        importLDIFName: "",
        deleleLDIFName: "",
        modalChecked: false,
        modalSpinning: false,
        includeReplData: false,
        importBuffer: "",
        exportBuffer: "",
        reindexBuffer: "",
        importCompleted: false,
        exportCompleted: false,
        reindexCompleted: false,
        // Reindex all
        showReindexConfirm: false,
        // Create Sub Suffix
        showSubSuffixModal: false,
        subSuffixValue: "",
        subSuffixBeName: "",
        createSuffixEntry: false,
        noSuffixInit: true,
        createSampleEntries: false,
        saveSubSuffixBtnDisabled: true,
        subSuffixSaving: false,
        initOption: "noInit",
        // Create Link
        showLinkModal: false,
        createLinkSuffix: "",
        createLinkName: "",
        createNsfarmserverurl: "",
        createNsmultiplexorbinddn: "",
        createNsmultiplexorcredentials: "",
        createNsmultiplexorcredentialsConfirm: "",
        createUseStartTLS: false,
        createNsbindmechanism: "SIMPLE",
        linkSaving: false,
        linkSaveBtnDisabled: true,
        // Delete
        showDeleteConfirm: false
      };
      this.handleToggle = (_event, dropdownIsOpen) => {
        this.setState({
          dropdownIsOpen
        });
      };
      this.handleSelect = (event) => {
        this.setState({
          dropdownIsOpen: !this.state.dropdownIsOpen
        });
        this.onFocus();
      };
      this.onFocus = () => {
        const element = document.getElementById("suffix-dropdown");
        element.focus();
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleShowImportModal = this.handleShowImportModal.bind(this);
      this.closeImportModal = this.closeImportModal.bind(this);
      this.onChange = this.onChange.bind(this);
      this.doImport = this.doImport.bind(this);
      this.importLDIF = this.importLDIF.bind(this);
      this.showConfirmLDIFImport = this.showConfirmLDIFImport.bind(this);
      this.closeConfirmLDIFImport = this.closeConfirmLDIFImport.bind(this);
      this.handleShowExportModal = this.handleShowExportModal.bind(this);
      this.closeExportModal = this.closeExportModal.bind(this);
      this.doExport = this.doExport.bind(this);
      this.onExportChange = this.onExportChange.bind(this);
      this.handleShowReindexConfirm = this.handleShowReindexConfirm.bind(this);
      this.closeReindexConfirm = this.closeReindexConfirm.bind(this);
      this.doReindex = this.doReindex.bind(this);
      this.handleShowSubSuffixModal = this.handleShowSubSuffixModal.bind(this);
      this.closeSubSuffixModal = this.closeSubSuffixModal.bind(this);
      this.createSubSuffix = this.createSubSuffix.bind(this);
      this.onSubSuffixOnSelect = this.onSubSuffixOnSelect.bind(this);
      this.onSubSuffixChange = this.onSubSuffixChange.bind(this);
      this.handleShowLinkModal = this.handleShowLinkModal.bind(this);
      this.closeLinkModal = this.closeLinkModal.bind(this);
      this.createLink = this.createLink.bind(this);
      this.onLinkChange = this.onLinkChange.bind(this);
      this.onLinkOnSelect = this.onLinkOnSelect.bind(this);
      this.saveSuffixConfig = this.saveSuffixConfig.bind(this);
      this.handleShowDeleteConfirm = this.handleShowDeleteConfirm.bind(this);
      this.closeDeleteConfirm = this.closeDeleteConfirm.bind(this);
      this.onConfigChange = this.onConfigChange.bind(this);
      this.doDelete = this.doDelete.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    //
    // Import Modal
    //
    handleShowImportModal() {
      this.setState({
        ldifLocation: "",
        attrEncryption: false,
        showImportModal: true,
        errObj: {},
        importCompleted: false
      });
    }
    closeImportModal() {
      this.setState({
        showImportModal: false,
        importBuffer: "",
        importCompleted: false
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj
      });
    }
    onConfigChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let saveBtnDisabled = true;
      const configAttrs2 = [
        "cachememsize",
        "cachesize",
        "dncachememsize",
        "readOnly",
        "requireIndex",
        "dbstate"
      ];
      for (const check_attr of configAttrs2) {
        if (attr !== check_attr) {
          if (this.state[check_attr] !== this.state["_" + check_attr]) {
            saveBtnDisabled = false;
          }
        } else if (value !== this.state["_" + check_attr]) {
          saveBtnDisabled = false;
        }
      }
      this.setState({
        [attr]: value,
        saveBtnDisabled
      });
    }
    showConfirmLDIFImport(name2) {
      this.setState({
        showConfirmLDIFImport: true,
        importLDIFName: name2,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmLDIFImport() {
      this.setState({
        showConfirmLDIFImport: false,
        modalChecked: false,
        modalSpinning: false,
        importBuffer: "",
        importCompleted: false
      });
    }
    importLDIF() {
      const import_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "import",
        this.props.suffix,
        this.state.importLDIFName,
        "--encrypted",
        "--watch"
      ];
      this.setState({
        modalSpinning: true,
        importBuffer: ""
      });
      let buffer = "";
      log_cmd("doImport", "Do online import", import_cmd);
      cockpit_default.spawn(import_cmd, { pty: true, superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          _30("Import successfully initiated")
        );
        this.setState({
          modalSpinning: false,
          showImportModal: false,
          importCompleted: true
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_30("Error importing LDIF file - $0"), errMsg)
        );
        this.setState({
          modalSpinning: false,
          importCompleted: true
        });
      }).stream((line) => {
        buffer += line;
        this.setState({
          importBuffer: buffer
        });
      });
    }
    doImport() {
      if (this.state.ldifLocation !== "") {
        this.setState({
          showConfirmLDIFImport: true,
          importLDIFName: this.state.ldifLocation
        });
      }
    }
    //
    // Export modal
    //
    handleShowExportModal() {
      this.setState({
        ldifLocation: "",
        attrEncryption: false,
        showExportModal: true,
        modalSpinning: false,
        includeReplData: false,
        errObj: {},
        exportCompleted: false
      });
    }
    closeExportModal() {
      this.setState({
        showExportModal: false,
        modalSpinning: false,
        exportBuffer: "",
        exportCompleted: false
      });
    }
    doExport() {
      const missingArgs = { ldifLocation: false };
      if (this.state.ldifLocation === "") {
        this.props.addNotification(
          "warning",
          _30("LDIF name is empty")
        );
        missingArgs.ldifLocation = true;
        this.setState({
          errObj: missingArgs
        });
        return;
      }
      if (bad_file_name(this.state.ldifLocation)) {
        this.props.addNotification(
          "warning",
          _30("LDIF name should not be a path.  All export files are stored in the server's LDIF directory")
        );
        missingArgs.ldifLocation = true;
        this.setState({
          errObj: missingArgs
        });
        return;
      }
      const export_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "export",
        this.props.suffix,
        "--ldif=" + this.state.ldifLocation,
        "--watch"
      ];
      if (this.state.attrEncryption) {
        export_cmd.push("--encrypted");
      }
      if (this.state.includeReplData) {
        export_cmd.push("--replication");
      }
      this.setState({
        modalSpinning: true,
        exportBuffer: ""
      });
      let buffer = "";
      log_cmd("doExport", "Do online export", export_cmd);
      cockpit_default.spawn(export_cmd, { pty: true, superuser: true, err: "message" }).done((content) => {
        this.props.reloadLDIFs();
        this.setState({
          modalSpinning: false,
          exportCompleted: true
        });
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "config",
          "get",
          "nsslapd-ldifdir"
        ];
        log_cmd("doExport", "Get the ldif directory", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content2) => {
          const config = JSON.parse(content2);
          const attrs = config.attrs;
          this.props.addNotification(
            "success",
            cockpit_default.format(_30("Database export complete. You can find the LDIF file in $0 directory on the server machine."), attrs["nsslapd-ldifdir"][0])
          );
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.addNotification(
            "success",
            _30("Database export complete.")
          );
          this.props.addNotification(
            "error",
            cockpit_default.format(_30("Error while trying to get the server's LDIF directory- $0"), errMsg)
          );
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reloadLDIFs();
        this.props.addNotification(
          "error",
          cockpit_default.format(_30("Error exporting database - $0"), errMsg)
        );
        this.setState({
          modalSpinning: false,
          exportCompleted: true
        });
      }).stream((line) => {
        buffer += line;
        this.setState({
          exportBuffer: buffer
        });
      });
    }
    //
    // Reindex entire database
    //
    handleShowReindexConfirm() {
      this.setState({
        showReindexConfirm: true,
        modalChecked: false,
        modalSpinning: false,
        reindexCompleted: false
      });
    }
    closeReindexConfirm() {
      this.setState({
        showReindexConfirm: false,
        modalChecked: false,
        modalSpinning: false,
        reindexCompleted: false
      });
    }
    doReindex() {
      this.setState({
        modalSpinning: true,
        reindexBuffer: ""
      });
      let buffer = "";
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "index",
        "reindex",
        "--watch",
        this.props.suffix
      ];
      log_cmd("doReindex", "Reindex all attributes", cmd);
      cockpit_default.spawn(cmd, { pty: true, superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          _30("Database has successfully been reindexed")
        );
        this.setState({
          modalSpinning: false,
          reindexCompleted: true
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_30("Failed to reindex database - $0"), errMsg)
        );
        this.setState({
          modalSpinning: false,
          reindexCompleted: true
        });
      }).stream((line) => {
        buffer += line;
        this.setState({
          reindexBuffer: buffer
        });
      });
    }
    //
    // Create sub suffix
    //
    handleShowSubSuffixModal() {
      this.setState({
        showSubSuffixModal: true,
        errObj: {}
      });
    }
    closeSubSuffixModal() {
      this.setState({
        showSubSuffixModal: false
      });
    }
    createSubSuffix() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "create",
        "--be-name",
        this.state.subSuffixBeName,
        "--suffix=" + this.state.subSuffixValue + "," + this.props.suffix,
        "--parent-suffix=" + this.props.suffix
      ];
      if (this.state.createSampleEntries) {
        cmd.push("--create-entries");
      }
      if (this.state.createSuffixEntry) {
        cmd.push("--create-suffix");
      }
      this.setState({
        subSuffixSaving: true
      });
      log_cmd("createSubSuffix", "Create a sub suffix", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.loadSuffixTree(false);
        this.closeSubSuffixModal();
        this.props.addNotification(
          "success",
          _30("Successfully created new sub-suffix")
        );
        this.setState({
          subSuffixSaving: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.loadSuffixTree(false);
        this.closeSubSuffixModal();
        this.props.addNotification(
          "error",
          cockpit_default.format(_30("Error creating sub-suffix - $0"), errMsg)
        );
        this.setState({
          subSuffixSaving: false
        });
      });
    }
    //
    // Create Chaining Link
    //
    handleShowLinkModal() {
      this.setState({
        showLinkModal: true,
        errObj: {}
      });
    }
    closeLinkModal() {
      this.setState({
        showLinkModal: false
      });
    }
    createLink() {
      this.setState({
        linkSaving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "link-create",
        "--suffix=" + this.state.createLinkSuffix + "," + this.props.suffix,
        "--server-url=" + this.state.createNsfarmserverurl,
        "--bind-mech=" + this.state.createNsbindmechanism,
        "--bind-dn=" + this.state.createNsmultiplexorbinddn,
        "--bind-pw=" + this.state.createNsmultiplexorcredentials,
        this.state.createLinkName
      ];
      if (this.state.createUseStartTLS) {
        cmd.push("--use-starttls=on");
      }
      log_cmd("createLink", "Create database link", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.loadSuffixTree(false);
        this.closeLinkModal();
        this.props.addNotification(
          "success",
          _30("Successfully created database link")
        );
        this.setState({
          linkSaving: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.loadSuffixTree(false);
        this.closeLinkModal();
        this.props.addNotification(
          "error",
          cockpit_default.format(_30("Error creating database link - $0"), errMsg)
        );
        this.setState({
          linkSaving: false
        });
      });
    }
    onLinkOnSelect(value) {
      this.setState({
        createNsbindmechanism: value
      });
    }
    onLinkChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let valueErr = false;
      let saveBtnDisabled = false;
      const errObj = this.state.errObj;
      const check_attrs = [
        "createLinkSuffix",
        "createLinkName",
        "createNsfarmserverurl",
        "createNsmultiplexorbinddn",
        "createNsmultiplexorcredentials",
        "createNsmultiplexorcredentialsConfirm",
        "createNsbindmechanism"
      ];
      for (const check_attr of check_attrs) {
        if (attr !== check_attr && this.state[check_attr] === "") {
          saveBtnDisabled = true;
        }
      }
      if (attr !== "createNsmultiplexorcredentials" && attr !== "createNsmultiplexorcredentialsConfirm") {
        if (this.state.createNsmultiplexorcredentials !== this.state.createNsmultiplexorcredentialsConfirm) {
          saveBtnDisabled = true;
        }
      } else {
        if (attr === "createNsmultiplexorcredentials") {
          if (value !== this.state.createNsmultiplexorcredentialsConfirm) {
            errObj.createNsmultiplexorcredentials = true;
            errObj.createNsmultiplexorcredentialsConfirm = true;
            saveBtnDisabled = true;
          } else {
            errObj.createNsmultiplexorcredentials = false;
            errObj.createNsmultiplexorcredentialsConfirm = false;
          }
        } else if (attr === "createNsmultiplexorcredentialsConfirm") {
          if (value !== this.state.createNsmultiplexorcredentials) {
            errObj.createNsmultiplexorcredentials = true;
            errObj.createNsmultiplexorcredentialsConfirm = true;
            saveBtnDisabled = true;
          } else {
            errObj.createNsmultiplexorcredentials = false;
            errObj.createNsmultiplexorcredentialsConfirm = false;
          }
        }
      }
      if (value === "") {
        valueErr = true;
        saveBtnDisabled = true;
      }
      errObj[attr] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj,
        linkSaveBtnDisabled: saveBtnDisabled
      });
    }
    onSubSuffixOnSelect(value) {
      let noInit = false;
      let addSuffix = false;
      let addSample = false;
      if (value === "noInit") {
        noInit = true;
      } else if (value === "addSuffix") {
        addSuffix = true;
      } else {
        addSample = true;
      }
      this.setState({
        initOption: value,
        noSuffixInit: noInit,
        createSuffixEntry: addSuffix,
        createSampleEntries: addSample
      });
    }
    onSubSuffixChange(e) {
      const value = e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      let saveBtnDisabled = false;
      const check_attrs = ["subSuffixBeName", "subSuffixValue"];
      for (const check_attr of check_attrs) {
        if (this.state[check_attr] === "") {
          saveBtnDisabled = true;
        }
      }
      if (value === "") {
        valueErr = true;
        saveBtnDisabled = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj,
        saveSubSuffixBtnDisabled: saveBtnDisabled
      });
    }
    onExportChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      let saveBtnDisabled = false;
      if (e.target.id !== "ldifLocation" && this.state.ldifLocation === 0) {
        saveBtnDisabled = true;
      }
      if (value === "") {
        valueErr = true;
        saveBtnDisabled = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj,
        saveExportBtnDisabled: saveBtnDisabled
      });
    }
    //
    // Delete suffix
    //
    handleShowDeleteConfirm(item) {
      this.setState({
        showDeleteConfirm: true,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeDeleteConfirm() {
      this.setState({
        showDeleteConfirm: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    doDelete() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "delete",
        this.props.suffix,
        "--do-it"
      ];
      log_cmd("doDelete", "Delete database", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.loadSuffixTree(true);
        this.closeDeleteConfirm();
        this.props.addNotification(
          "success",
          _30("Successfully deleted database")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.loadSuffixTree(true);
        this.closeDeleteConfirm();
        this.props.addNotification(
          "error",
          cockpit_default.format(_30("Error deleting database - $0"), errMsg)
        );
      });
    }
    // Save config
    saveSuffixConfig() {
      console.log("Save suffix config: ", this.props.suffix);
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "suffix",
        "set",
        this.props.suffix
      ];
      let requireRestart = false;
      if (this.state._readOnly !== this.state.readOnly) {
        if (this.state.readOnly) {
          cmd.push("--enable-readonly");
        } else {
          cmd.push("--disable-readonly");
        }
      }
      if (this.state._requireIndex !== this.state.requireIndex) {
        if (this.state.requireIndex) {
          cmd.push("--require-index");
        } else {
          cmd.push("--ignore-index");
        }
      }
      if (this.state._cachememsize !== this.state.cachememsize) {
        cmd.push("--cache-memsize=" + this.state.cachememsize);
        requireRestart = true;
      }
      if (this.state._cachesize !== this.state.cachesize) {
        cmd.push("--cache-size=" + this.state.cachesize);
        requireRestart = true;
      }
      if (this.state._dncachememsize !== this.state.dncachememsize) {
        cmd.push("--dncache-memsize=" + this.state.dncachememsize);
        requireRestart = true;
      }
      if (this.state._dbstate !== this.state.dbstate) {
        cmd.push("--state=" + this.state.dbstate);
        requireRestart = true;
      }
      if (cmd.length > 7) {
        this.setState({
          savingConfig: true
        });
        log_cmd("saveSuffixConfig", "Save suffix config", cmd);
        const msg = "Successfully updated suffix configuration.";
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.props.reload(this.props.suffix);
          if (requireRestart) {
            this.props.addNotification(
              "warning",
              msg + _30(" You must restart the Directory Server for these changes to take effect.")
            );
          }
          this.setState({
            savingConfig: false
          });
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.reload(this.props.suffix);
          let msg2 = errMsg;
          if ("info" in errMsg) {
            msg2 = errMsg + " - " + errMsg.info;
          }
          this.props.addNotification(
            "error",
            cockpit_default.format(_30("Error updating suffix configuration - $0"), msg2)
          );
          this.setState({
            savingConfig: false
          });
        });
      }
    }
    //
    // Render the component
    //
    render() {
      let SuffixIcon = FolderIcon;
      if (this.props.dbtype === "subsuffix") {
        SuffixIcon = LeafIcon;
      }
      const { dropdownIsOpen, activeTabKey } = this.state;
      const dropdownItems = [
        /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DropdownItem2, { component: "button", onClick: this.handleShowImportModal, title: _30("Import an LDIF file to initialize the database"), children: _30("Initialize Suffix") }, "import"),
        /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DropdownItem2, { component: "button", onClick: this.handleShowExportModal, title: _30("Export the database to an LDIF file"), children: _30("Export Suffix") }, "export"),
        /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DropdownItem2, { component: "button", onClick: this.handleShowReindexConfirm, title: _30("Reindex the entire database"), children: _30("Reindex Suffix") }, "reindex"),
        /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DropdownItem2, { component: "button", onClick: this.handleShowSubSuffixModal, title: _30("Create a sub-suffix under this suffix"), children: _30("Create Sub-Suffix") }, "subSuffix"),
        /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DropdownItem2, { component: "button", onClick: this.handleShowLinkModal, title: _30("Create a database chaining link subtree"), children: _30("Create Database Link") }, "dbLink"),
        /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DropdownSeparator, {}, "separator"),
        /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DropdownItem2, { component: "button", onClick: this.handleShowDeleteConfirm, title: _30("This will permanently delete the database"), children: _30("Delete Suffix") }, "deleteSuffix")
      ];
      let confirmImportItem = this.state.importLDIFName;
      if (this.state.importBuffer !== "") {
        confirmImportItem = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
          LogViewer,
          {
            data: this.state.importBuffer,
            isTextWrapped: false,
            hasLineNumbers: false,
            scrollToRow: this.state.importBuffer.length,
            height: "200px"
          }
        );
      }
      let exportItem = null;
      if (this.state.exportBuffer !== "") {
        exportItem = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
          LogViewer,
          {
            data: this.state.exportBuffer,
            isTextWrapped: false,
            hasLineNumbers: false,
            scrollToRow: this.state.exportBuffer.length,
            height: "200px"
          }
        );
      }
      let reindexItem = null;
      if (this.state.reindexBuffer !== "") {
        reindexItem = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
          LogViewer,
          {
            data: this.state.reindexBuffer,
            isTextWrapped: false,
            hasLineNumbers: false,
            scrollToRow: this.state.reindexBuffer.length,
            height: "200px"
          }
        );
      }
      return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { id: "suffix-page", children: [
        /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(GridItem, { className: "ds-suffix-header", span: 9, children: [
            /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SuffixIcon, {}),
            "\xA0\xA0",
            this.props.suffix,
            " (",
            /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("i", { children: this.props.bename }),
            ")",
            /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
              Button,
              {
                variant: "plain",
                "aria-label": _30("Refresh suffix"),
                onClick: () => this.props.reload(this.props.suffix),
                children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SyncAltIcon, {})
              }
            )
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
            Dropdown2,
            {
              className: "ds-float-right",
              position: DropdownPosition.right,
              onSelect: this.handleSelect,
              toggle: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DropdownToggle, { id: "suffix-dropdown", onToggle: (event, isOpen) => this.handleToggle(event, isOpen), children: _30("Suffix Tasks") }),
              isOpen: dropdownIsOpen,
              dropdownItems
            }
          ) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "ds-sub-header", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Tabs, { isFilled: true, activeKey: activeTabKey, onSelect: this.handleNavSelect, children: [
          /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TabTitleText, { children: _30("Settings") }), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
            SuffixConfig,
            {
              cachememsize: this.state.cachememsize,
              cachesize: this.state.cachesize,
              dncachememsize: this.state.dncachememsize,
              dbstate: this.state.dbstate,
              readOnly: this.state.readOnly,
              requireIndex: this.state.requireIndex,
              autoTuning: this.state.autoTuning,
              handleChange: this.onConfigChange,
              handleSave: this.saveSuffixConfig,
              saving: this.state.savingConfig,
              saveBtnDisabled: this.state.saveBtnDisabled
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TabTitleText, { children: _30("Referrals") }), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
            SuffixReferrals,
            {
              rows: this.props.data.refRows,
              suffix: this.props.suffix,
              reload: this.props.reloadRefs,
              addNotification: this.props.addNotification,
              serverId: this.props.serverId
            },
            this.state.refRows
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TabTitleText, { children: _30("Indexes") }), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
            SuffixIndexes,
            {
              systemIndexRows: this.props.data.systemIndexRows,
              indexRows: this.props.data.indexRows,
              suffix: this.props.suffix,
              serverId: this.props.serverId,
              addNotification: this.props.addNotification,
              reload: this.props.reloadIndexes
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Tab, { eventKey: 3, title: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TabTitleText, { children: _30("VLV Indexes") }), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
            VLVIndexes,
            {
              suffix: this.props.suffix,
              serverId: this.props.serverId,
              vlvItems: this.props.data.vlvItems,
              addNotification: this.props.addNotification,
              attrs: this.props.attrs,
              reload: this.props.reloadVLV
            },
            this.props.vlvTableKey
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Tab, { eventKey: 4, title: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TabTitleText, { children: _30("Encrypted Attributes") }), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
            AttrEncryption,
            {
              rows: this.props.data.encAttrsRows,
              suffix: this.props.suffix,
              serverId: this.props.serverId,
              addNotification: this.props.addNotification,
              attrs: this.props.attrs,
              reload: this.props.reloadAttrEnc
            }
          ) })
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showDeleteConfirm,
            closeHandler: this.closeDeleteConfirm,
            handleChange: this.onChange,
            actionHandler: this.doDelete,
            spinning: this.state.modalSpinning,
            item: this.props.suffix,
            checked: this.state.modalChecked,
            mTitle: _30("Delete Suffix"),
            mMsg: _30("Are you really sure you want to delete this suffix?"),
            mSpinningMsg: _30("Deleting suffix ..."),
            mBtnName: _30("Delete Suffix")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
          CreateLinkModal,
          {
            showModal: this.state.showLinkModal,
            closeHandler: this.closeLinkModal,
            handleChange: this.onLinkChange,
            handleSelectChange: this.onLinkOnSelect,
            saveHandler: this.createLink,
            suffix: this.props.suffix,
            starttls_checked: this.state.createUseStartTLS,
            error: this.state.errObj,
            saving: this.state.linkSaving,
            saveBtnDisabled: this.state.linkSaveBtnDisabled,
            bindMech: this.state.createNsbindmechanism
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
          CreateSubSuffixModal,
          {
            showModal: this.state.showSubSuffixModal,
            closeHandler: this.closeSubSuffixModal,
            handleChange: this.onSubSuffixChange,
            handleSelectChange: this.onSubSuffixOnSelect,
            saveHandler: this.createSubSuffix,
            suffix: this.props.suffix,
            error: this.state.errObj,
            saving: this.state.subSuffixSaving,
            saveBtnDisabled: this.state.saveSubSuffixBtnDisabled,
            initOption: this.state.initOption
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
          ImportModal,
          {
            showModal: this.state.showImportModal,
            closeHandler: this.closeImportModal,
            handleChange: this.onChange,
            saveHandler: this.doImport,
            showConfirmImport: this.showConfirmLDIFImport,
            rows: this.props.LDIFRows,
            suffix: this.props.suffix,
            saveBtnDisabled: this.state.ldifLocation === ""
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmLDIFImport,
            closeHandler: this.closeConfirmLDIFImport,
            handleChange: this.onChange,
            actionHandler: this.importLDIF,
            spinning: this.state.modalSpinning,
            item: confirmImportItem,
            checked: this.state.modalChecked,
            mTitle: _30("Initialize Database From LDIF"),
            mMsg: _30("Are you sure you want to initialize the database (it will permanently overwrite the current database)?"),
            mSpinningMsg: _30("Initializing Database ..."),
            mBtnName: this.state.importCompleted ? null : _30("Initialize Database")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
          ExportModal,
          {
            showModal: this.state.showExportModal,
            closeHandler: this.closeExportModal,
            handleChange: this.onExportChange,
            saveHandler: this.doExport,
            spinning: this.state.modalSpinning,
            item: exportItem,
            error: this.state.errObj,
            includeReplData: this.state.includeReplData,
            saveBtnDisabled: this.state.ldifLocation === "",
            exportCompleted: this.state.exportCompleted
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showReindexConfirm,
            closeHandler: this.closeReindexConfirm,
            handleChange: this.onChange,
            actionHandler: this.doReindex,
            spinning: this.state.modalSpinning,
            item: reindexItem,
            checked: this.state.modalChecked,
            mTitle: _30("Reindex All Attributes"),
            mMsg: _30("Are you sure you want to reindex all the attribute indexes?"),
            mSpinningMsg: _30("Reindexing Database ..."),
            mBtnName: this.state.reindexCompleted ? null : _30("Reindex")
          }
        )
      ] });
    }
  };
  Suffix.propTypes = {
    serverId: import_prop_types31.default.string,
    suffix: import_prop_types31.default.string,
    bename: import_prop_types31.default.string,
    loadSuffixTree: import_prop_types31.default.func,
    reload: import_prop_types31.default.func,
    reloadRefs: import_prop_types31.default.func,
    reloadIndexes: import_prop_types31.default.func,
    reloadVLV: import_prop_types31.default.func,
    reloadAttrEnc: import_prop_types31.default.func,
    reloadLDIFs: import_prop_types31.default.func,
    addNotification: import_prop_types31.default.func,
    dbtype: import_prop_types31.default.string,
    data: import_prop_types31.default.object,
    attrs: import_prop_types31.default.array,
    LDIFRows: import_prop_types31.default.array,
    enableTree: import_prop_types31.default.func
  };
  Suffix.defaultProps = {
    serverId: "",
    suffix: "",
    bename: "",
    dbtype: "",
    data: {},
    attrs: [],
    LDIFRows: []
  };

  // src/lib/database/backups.jsx
  var import_react52 = __toESM(require_react(), 1);
  var import_prop_types32 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
  var _31 = cockpit_default.gettext;
  var Backups = class extends import_react52.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: 0,
        showConfirmBackupDelete: false,
        showConfirmBackup: false,
        showConfirmRestoreReplace: false,
        showConfirmLDIFReplace: false,
        showBackupModal: false,
        backupSpinning: false,
        backupName: "",
        deleteBackup: "",
        backupBuffer: "",
        importBuffer: "",
        exportBuffer: "",
        restoreBuffer: "",
        backupCompleted: false,
        restoreCompleted: false,
        exportCompleted: false,
        importCompleted: false,
        // LDIF
        showConfirmLDIFDelete: false,
        showConfirmLDIFImport: false,
        showConfirmRestore: false,
        showExportModal: false,
        exportSpinner: false,
        includeReplData: false,
        ldifName: "",
        ldifSuffix: "",
        errObj: {},
        modalSpinning: false,
        modalChecked: false
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.onChange = this.onChange.bind(this);
      this.onConfirmChange = this.onConfirmChange.bind(this);
      this.doBackup = this.doBackup.bind(this);
      this.deleteBackup = this.deleteBackup.bind(this);
      this.restoreBackup = this.restoreBackup.bind(this);
      this.showConfirmRestore = this.showConfirmRestore.bind(this);
      this.closeConfirmRestore = this.closeConfirmRestore.bind(this);
      this.showConfirmBackup = this.showConfirmBackup.bind(this);
      this.closeConfirmBackup = this.closeConfirmBackup.bind(this);
      this.showConfirmBackupDelete = this.showConfirmBackupDelete.bind(this);
      this.closeConfirmBackupDelete = this.closeConfirmBackupDelete.bind(this);
      this.handleShowBackupModal = this.handleShowBackupModal.bind(this);
      this.closeBackupModal = this.closeBackupModal.bind(this);
      this.validateBackup = this.validateBackup.bind(this);
      this.closeConfirmRestoreReplace = this.closeConfirmRestoreReplace.bind(this);
      this.importLDIF = this.importLDIF.bind(this);
      this.deleteLDIF = this.deleteLDIF.bind(this);
      this.showConfirmLDIFImport = this.showConfirmLDIFImport.bind(this);
      this.closeConfirmLDIFImport = this.closeConfirmLDIFImport.bind(this);
      this.showConfirmLDIFDelete = this.showConfirmLDIFDelete.bind(this);
      this.closeConfirmLDIFDelete = this.closeConfirmLDIFDelete.bind(this);
      this.doExport = this.doExport.bind(this);
      this.handleShowExportModal = this.handleShowExportModal.bind(this);
      this.closeExportModal = this.closeExportModal.bind(this);
      this.validateLDIF = this.validateLDIF.bind(this);
      this.closeConfirmLDIFReplace = this.closeConfirmLDIFReplace.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    handleShowExportModal() {
      this.setState({
        showExportModal: true,
        exportSpinner: false,
        ldifName: "",
        ldifSuffix: this.props.suffixes[0],
        includeReplData: false,
        exportBuffer: "",
        exportCompleted: false
      });
    }
    closeExportModal() {
      this.setState({
        showExportModal: false,
        exportBuffer: "",
        exportCompleted: false
      });
    }
    closeConfirmLDIFReplace() {
      this.setState({
        showConfirmLDIFReplace: false,
        exportCompleted: false
      });
    }
    handleShowBackupModal() {
      this.setState({
        showBackupModal: true,
        backupSpinning: false,
        backupName: "",
        backupCompleted: false
      });
    }
    closeBackupModal() {
      this.setState({
        showBackupModal: false,
        backupBuffer: "",
        backupCompleted: false
      });
    }
    showConfirmLDIFImport(name2, suffix) {
      this.setState({
        showConfirmLDIFImport: true,
        ldifName: name2,
        ldifSuffix: suffix,
        modalSpinning: false,
        modalChecked: false,
        importBuffer: "",
        importCompleted: false
      });
    }
    closeConfirmLDIFImport() {
      this.setState({
        showConfirmLDIFImport: false,
        modalSpinning: false,
        modalChecked: false,
        importBuffer: "",
        importCompleted: false
      });
    }
    showConfirmLDIFDelete(name2) {
      this.setState({
        showConfirmLDIFDelete: true,
        ldifName: name2,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeConfirmLDIFDelete() {
      this.setState({
        showConfirmLDIFDelete: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    showConfirmBackup(name2) {
      this.setState({
        showConfirmBackup: true,
        backupName: name2,
        modalSpinning: false,
        modalChecked: false,
        backupBuffer: "",
        backupCompleted: false
      });
    }
    closeConfirmBackup() {
      this.setState({
        showConfirmBackup: false,
        modalSpinning: false,
        modalChecked: false,
        backupBuffer: "",
        backupCompleted: false
      });
    }
    showConfirmRestore(name2) {
      this.setState({
        showConfirmRestore: true,
        backupName: name2,
        modalSpinning: false,
        modalChecked: false,
        restoreBuffer: "",
        restoreCompleted: false
      });
    }
    closeConfirmRestore() {
      this.setState({
        showConfirmRestore: false,
        modalSpinning: false,
        modalChecked: false,
        restoreBuffer: "",
        restoreCompleted: false
      });
    }
    showConfirmBackupDelete(name2) {
      this.setState({
        showConfirmBackupDelete: true,
        backupName: name2,
        modalSpinning: false,
        modalChecked: false,
        backupCompleted: false
      });
    }
    closeConfirmBackupDelete() {
      this.setState({
        showConfirmBackupDelete: false,
        modalSpinning: false,
        modalChecked: false,
        backupCompleted: false
      });
    }
    closeConfirmRestoreReplace() {
      this.setState({
        showConfirmRestoreReplace: false,
        modalSpinning: false,
        modalChecked: false,
        backupBuffer: "",
        restoreCompleted: false
      });
    }
    onConfirmChange(e) {
      this.setState({
        modalChecked: e.target.checked
      });
    }
    importLDIF() {
      this.setState({
        modalSpinning: true,
        importBuffer: ""
      });
      let importBuffer = "";
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "import",
        this.state.ldifSuffix,
        this.state.ldifName,
        "--encrypted",
        "--watch"
      ];
      log_cmd("importLDIF", "Importing LDIF", cmd);
      cockpit_default.spawn(cmd, { pty: true, superuser: true, err: "message" }).done((content) => {
        this.setState({
          modalSpinning: false,
          importCompleted: true
        });
        this.props.addNotification(
          "success",
          _31("LDIF was successfully imported")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.setState({
          modalSpinning: false,
          importCompleted: true
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_31("Failure importing LDIF - $0"), errMsg)
        );
      }).stream((data) => {
        importBuffer += data;
        this.setState({
          importBuffer
        });
      });
    }
    deleteLDIF(e) {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsctl",
        this.props.serverId,
        "ldifs",
        "--delete",
        this.state.ldifName
      ];
      log_cmd("deleteLDIF", "Deleting LDIF", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.handleReload();
        this.closeConfirmLDIFDelete();
        this.props.addNotification(
          "success",
          _31("LDIF file was successfully deleted")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.handleReload();
        this.closeConfirmLDIFDelete();
        this.props.addNotification(
          "error",
          cockpit_default.format(_31("Failure deleting LDIF file - $0"), errMsg)
        );
      });
    }
    validateBackup() {
      for (let i = 0; i < this.props.backups.length; i++) {
        if (this.state.backupName === this.props.backups[i].name) {
          this.setState({
            showConfirmRestoreReplace: true
          });
          return;
        }
      }
      this.doBackup();
    }
    doBackup() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backup",
        "create"
      ];
      if (this.state.backupName !== "") {
        if (bad_file_name(this.state.backupName)) {
          this.props.addNotification(
            "warning",
            _31("Backup name should not be a path.  All backups are stored in the server's backup directory")
          );
          return;
        }
        cmd.push(this.state.backupName);
      }
      cmd.push("--watch");
      let backupBuffer = "";
      this.setState({
        modalSpinning: true,
        backupBuffer: ""
      });
      log_cmd("doBackup", "Add backup task", cmd);
      cockpit_default.spawn(cmd, { pty: true, superuser: true, err: "message" }).done((content) => {
        this.props.handleReload();
        this.setState({
          modalSpinning: false,
          backupCompleted: true
        });
        const cmd2 = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "config",
          "get",
          "nsslapd-bakdir"
        ];
        log_cmd("doBackup", "Get the backup directory", cmd2);
        cockpit_default.spawn(cmd2, { superuser: true, err: "message" }).done((content2) => {
          const config = JSON.parse(content2);
          const attrs = config.attrs;
          this.props.addNotification(
            "success",
            cockpit_default.format(_31("Server has been backed up. You can find the backup in $0 directory on the server machine."), attrs["nsslapd-bakdir"][0])
          );
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.addNotification(
            "success",
            _31("Server has been backed up.")
          );
          this.props.addNotification(
            "error",
            cockpit_default.format(_31("Error while trying to get the server's backup directory- $0"), errMsg)
          );
        });
      }).stream((data) => {
        backupBuffer += data;
        this.setState({
          backupBuffer
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.handleReload();
        this.setState({
          modalSpinning: false,
          backupCompleted: true
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_31("Failure backing up server - $0"), errMsg)
        );
      });
    }
    restoreBackup() {
      if (this.props.suffixes.length === 0) {
        this.props.addNotification(
          "error",
          _31("There are no databases defined to restore")
        );
        return;
      }
      this.setState({
        modalSpinning: true,
        restoreBuffer: ""
      });
      let restoreBuffer = "";
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backup",
        "restore",
        this.state.backupName,
        "--watch"
      ];
      log_cmd("restoreBackup", "Restoring server", cmd);
      cockpit_default.spawn(cmd, { pty: true, superuser: true, err: "message" }).done((content) => {
        this.setState({
          modalSpinning: false,
          restoreCompleted: true
        });
        this.props.addNotification(
          "success",
          _31("Server has been restored")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.setState({
          modalSpinning: false,
          restoreCompleted: true
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_31("Failure restoring up server - $0"), errMsg)
        );
      }).stream((data) => {
        restoreBuffer += data;
        this.setState({
          restoreBuffer
        });
      });
    }
    deleteBackup(e) {
      this.setState({ modalSpinning: true });
      const cmd = [
        "dsctl",
        this.props.serverId,
        "backups",
        "--delete",
        this.state.backupName
      ];
      log_cmd("deleteBackup", "Deleting backup", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.handleReload();
        this.closeConfirmBackupDelete();
        this.props.addNotification(
          "success",
          _31("Backup was successfully deleted")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.handleReload();
        this.closeConfirmBackupDelete();
        this.props.addNotification(
          "error",
          cockpit_default.format(_31("Failure deleting backup - $0"), errMsg)
        );
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj
      });
    }
    validateLDIF() {
      let ldifname = this.state.ldifName;
      if (!ldifname.endsWith(".ldif")) {
        ldifname = ldifname + ".ldif";
      }
      for (let i = 0; i < this.props.ldifs.length; i++) {
        if (ldifname === this.props.ldifs[i].name) {
          this.setState({
            showConfirmLDIFReplace: true
          });
          return;
        }
      }
      this.doExport();
    }
    doExport() {
      const missingArgs = { ldifName: false };
      if (this.state.ldifName === "") {
        this.props.addNotification(
          "warning",
          _31("LDIF name is empty")
        );
        missingArgs.ldifName = true;
        this.setState({
          errObj: missingArgs
        });
        return;
      }
      if (bad_file_name(this.state.ldifName)) {
        this.props.addNotification(
          "warning",
          _31("LDIF name should not be a path.  All export files are stored in the server's LDIF directory")
        );
        missingArgs.ldifLocation = true;
        this.setState({
          errObj: missingArgs
        });
        return;
      }
      const export_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "export",
        this.state.ldifSuffix,
        "--encrypted",
        "--ldif=" + this.state.ldifName,
        "--watch"
      ];
      if (this.state.includeReplData) {
        export_cmd.push("--replication");
      }
      this.setState({
        exportSpinner: true,
        exportBuffer: ""
      });
      let exportBuffer = "";
      log_cmd("doExport", "Do online export", export_cmd);
      cockpit_default.spawn(export_cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.handleReload();
        this.setState({
          exportSpinner: false,
          exportCompleted: true
        });
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "config",
          "get",
          "nsslapd-ldifdir"
        ];
        log_cmd("doExport", "Get the backup directory", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content2) => {
          const config = JSON.parse(content2);
          const attrs = config.attrs;
          this.props.addNotification(
            "success",
            cockpit_default.format(_31("Database export complete. You can find the LDIF file in $0 directory on the server machine."), attrs["nsslapd-ldifdir"][0])
          );
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.addNotification(
            "success",
            _31("Database export complete.")
          );
          this.props.addNotification(
            "error",
            cockpit_default.format(_31("Error while trying to get the server's LDIF directory- $0"), errMsg)
          );
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.handleReload();
        this.setState({
          exportSpinner: false,
          exportCompleted: true
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_31("Error exporting database - $0"), errMsg)
        );
      }).stream((data) => {
        exportBuffer += data;
        this.setState({
          exportBuffer
        });
      });
    }
    render() {
      let refreshBtnName = _31("Refresh");
      const extraPrimaryProps = {};
      if (this.props.refreshing) {
        refreshBtnName = _31("Refreshing ...");
        extraPrimaryProps.spinnerAriaValueText = _31("Refreshing");
      }
      let restoreBufferItem = null;
      if (this.state.restoreBuffer !== "") {
        restoreBufferItem = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
          LogViewer,
          {
            data: this.state.restoreBuffer,
            isTextWrapped: false,
            hasLineNumbers: false,
            scrollToRow: this.state.restoreBuffer.length,
            height: "200px"
          }
        );
      }
      let exportBufferItem = null;
      if (this.state.exportBuffer !== "") {
        exportBufferItem = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
          LogViewer,
          {
            data: this.state.exportBuffer,
            isTextWrapped: false,
            hasLineNumbers: false,
            scrollToRow: this.state.exportBuffer.length,
            height: "200px"
          }
        );
      }
      let importBufferItem = null;
      if (this.state.importBuffer !== "") {
        importBufferItem = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
          LogViewer,
          {
            data: this.state.importBuffer,
            isTextWrapped: false,
            hasLineNumbers: false,
            scrollToRow: this.state.importBuffer.length,
            height: "200px"
          }
        );
      }
      let backupBufferItem = null;
      if (this.state.backupBuffer !== "") {
        backupBufferItem = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
          LogViewer,
          {
            data: this.state.backupBuffer,
            isTextWrapped: false,
            hasLineNumbers: false,
            scrollToRow: this.state.backupBuffer.length,
            height: "200px"
          }
        );
      }
      return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Text, { component: TextVariants.h2, children: _31("Database Backups & LDIFs") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Tabs, { className: "ds-margin-top-lg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
          /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(TabTitleText, { children: [
            _31("Backups "),
            /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("font", { size: "2", children: [
              "(",
              this.props.backups.length,
              ")"
            ] })
          ] }), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "ds-indent", children: [
            /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
              BackupTable,
              {
                rows: this.props.backups,
                confirmRestore: this.showConfirmRestore,
                confirmDelete: this.showConfirmBackupDelete
              },
              this.props.backups
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "ds-inline", children: [
              /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleShowBackupModal,
                  className: "ds-margin-top",
                  children: _31("Create Backup")
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
                Button,
                {
                  variant: "secondary",
                  onClick: () => {
                    this.props.handleReload(1);
                  },
                  className: "ds-left-margin ds-margin-top",
                  isLoading: this.props.refreshing,
                  spinnerAriaValueText: this.props.refreshing ? _31("Refreshing") : void 0,
                  ...extraPrimaryProps,
                  children: refreshBtnName
                }
              )
            ] })
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(TabTitleText, { children: [
            _31("LDIFs "),
            /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("font", { size: "2", children: [
              "(",
              this.props.ldifs.length,
              ")"
            ] })
          ] }), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "ds-indent", children: [
            /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
              LDIFManageTable,
              {
                rows: this.props.ldifs,
                confirmImport: this.showConfirmLDIFImport,
                confirmDelete: this.showConfirmLDIFDelete
              },
              this.props.ldifs
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "ds-inline", children: [
              /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleShowExportModal,
                  className: "ds-margin-top",
                  children: _31("Create LDIF")
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
                Button,
                {
                  variant: "secondary",
                  onClick: this.props.handleLDIFReload,
                  className: "ds-left-margin ds-margin-top",
                  isLoading: this.props.refreshing,
                  spinnerAriaValueText: this.props.refreshing ? _31("Refreshing") : void 0,
                  ...extraPrimaryProps,
                  children: refreshBtnName
                }
              )
            ] })
          ] }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
          ExportModal2,
          {
            showModal: this.state.showExportModal,
            closeHandler: this.closeExportModal,
            handleChange: this.onChange,
            saveHandler: this.validateLDIF,
            spinning: this.state.exportSpinner,
            error: this.state.errObj,
            suffixes: this.props.suffixes,
            includeReplData: this.state.includeReplData,
            ldifSuffix: this.state.ldifSuffix,
            ldifName: this.state.ldifName,
            watchBuffer: exportBufferItem,
            exportCompleted: this.state.exportCompleted
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
          BackupModal,
          {
            showModal: this.state.showBackupModal,
            closeHandler: this.closeBackupModal,
            handleChange: this.onChange,
            saveHandler: this.validateBackup,
            spinning: this.state.backupSpinning,
            watchBuffer: backupBufferItem,
            error: this.state.errObj,
            backupCompleted: this.state.backupCompleted
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmLDIFDelete,
            closeHandler: this.closeConfirmLDIFDelete,
            handleChange: this.onConfirmChange,
            actionHandler: this.deleteLDIF,
            spinning: this.state.modalSpinning,
            item: this.state.ldifName,
            checked: this.state.modalChecked,
            mTitle: _31("Delete LDIF File"),
            mMsg: _31("Are you sure you want to delete this LDIF?"),
            mSpinningMsg: _31("Deleting LDIF ..."),
            mBtnName: _31("Delete LDIF")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmLDIFImport,
            closeHandler: this.closeConfirmLDIFImport,
            handleChange: this.onConfirmChange,
            actionHandler: this.importLDIF,
            spinning: this.state.modalSpinning,
            item: importBufferItem ? importBufferItem : this.state.ldifName,
            checked: this.state.modalChecked,
            mTitle: _31("Import LDIF File"),
            mMsg: _31("Are you sure you want to import this LDIF?"),
            mSpinningMsg: _31("Importing LDIF ..."),
            mBtnName: this.state.importCompleted ? null : _31("Import LDIF")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmRestore,
            closeHandler: this.closeConfirmRestore,
            handleChange: this.onConfirmChange,
            actionHandler: this.restoreBackup,
            spinning: this.state.modalSpinning,
            item: restoreBufferItem ? restoreBufferItem : this.state.backupName,
            checked: this.state.modalChecked,
            mTitle: _31("Restore Database"),
            mMsg: _31("Are you sure you want to restore from this backup?"),
            mSpinningMsg: _31("Restoring ..."),
            mBtnName: this.state.restoreCompleted ? null : _31("Restore")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmBackupDelete,
            closeHandler: this.closeConfirmBackupDelete,
            handleChange: this.onConfirmChange,
            actionHandler: this.deleteBackup,
            spinning: this.state.modalSpinning,
            item: this.state.backupName,
            checked: this.state.modalChecked,
            mTitle: _31("Delete Backup"),
            mMsg: _31("Are you sure you want to delete this backup?"),
            mSpinningMsg: _31("Deleting backup ..."),
            mBtnName: _31("Delete Backup")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmRestoreReplace,
            closeHandler: this.closeConfirmRestoreReplace,
            handleChange: this.onConfirmChange,
            actionHandler: this.doBackup,
            spinning: this.state.modalSpinning,
            item: this.state.backupName,
            checked: this.state.modalChecked,
            mTitle: _31("Replace Existing Backup"),
            mMsg: _31("A backup already eixsts with the same name, do you want to replace it?"),
            mSpinningMsg: _31("Replacing backup ..."),
            mBtnName: _31("Replace Backup")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmLDIFReplace,
            closeHandler: this.closeConfirmLDIFReplace,
            handleChange: this.onConfirmChange,
            actionHandler: this.doExport,
            spinning: this.state.modalSpinning,
            item: exportBufferItem ? exportBufferItem : this.state.ldifName,
            checked: this.state.modalChecked,
            mTitle: _31("Replace Existing LDIF File"),
            mMsg: _31("A LDIF file already exists with the same name, do you want to replace it?"),
            mSpinningMsg: _31("Replacing LDIF ..."),
            mBtnName: _31("Replace LDIF")
          }
        )
      ] });
    }
  };
  var ExportModal2 = class extends import_react52.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        suffixes,
        spinning,
        error,
        ldifSuffix,
        ldifName,
        includeReplData,
        watchBuffer,
        exportCompleted
      } = this.props;
      let createBtnName = _31("Create LDIF");
      const extraPrimaryProps = {};
      let exportMsg = "";
      if (spinning) {
        createBtnName = _31("Creating LDIF ...");
        extraPrimaryProps.spinnerAriaValueText = _31("Creating LDIF");
      }
      if (spinning) {
        exportMsg = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("font", { size: "2", children: _31("(You can safely close this window)") }) });
      }
      const suffixList = suffixes.map((suffix) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(FormSelectOption, { value: suffix, label: suffix }, suffix));
      const actions = [];
      if (!exportCompleted) {
        actions.push(
          /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
            Button,
            {
              variant: "primary",
              onClick: saveHandler,
              isLoading: spinning,
              isDisabled: spinning || ldifName === "",
              ...extraPrimaryProps,
              children: createBtnName
            },
            "confirm"
          )
        );
      }
      actions.push(
        /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Button, { variant: "link", onClick: closeHandler, children: _31("Close") }, "close")
      );
      return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title: _31("Export Database To LDIF File"),
          isOpen: showModal,
          "aria-labelledby": "ds-modal",
          onClose: closeHandler,
          actions,
          children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GridItem, { className: "ds-label", span: 3, children: _31("Select Suffix") }),
              /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(FormSelect, { id: "ldifSuffix", value: ldifSuffix, onChange: (event, value) => {
                handleChange(event);
              }, "aria-label": "FormSelect Input", children: suffixList }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
              Grid,
              {
                title: _31("Name of exported LDIF file, if left blank the data and time will be used as the file name"),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GridItem, { className: "ds-label", span: 3, children: _31("LDIF File Name") }),
                  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
                    TextInput,
                    {
                      type: "text",
                      id: "ldifName",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "ldifName",
                      value: ldifName,
                      onChange: (event, value) => {
                        handleChange(event);
                      },
                      validated: error.ldifName ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
              Grid,
              {
                title: _31("Name of exported LDIF file, if left blank the data and time will be used as the file name"),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
                    Checkbox,
                    {
                      id: "includeReplData",
                      className: "ds-indent ds-margin-top",
                      isChecked: includeReplData,
                      onChange: (e, checked) => {
                        handleChange(e);
                      },
                      title: _31("Include the replication metadata needed to restore or initialize another replica."),
                      label: _31("Include Replication Data")
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GridItem, { span: 12, className: "ds-margin-top-lg", children: watchBuffer })
                ]
              }
            ),
            exportMsg
          ] })
        }
      );
    }
  };
  var BackupModal = class extends import_react52.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        spinning,
        watchBuffer,
        error,
        backupCompleted
      } = this.props;
      let createBtnName = _31("Create Backup");
      const extraPrimaryProps = {};
      let exportMsg = "";
      if (spinning) {
        createBtnName = _31("Backing up ...");
        extraPrimaryProps.spinnerAriaValueText = _31("Backing up");
      }
      if (spinning) {
        exportMsg = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("font", { size: "2", children: _31("(You can safely close this window)") }) });
      }
      const actions = [];
      if (!backupCompleted) {
        actions.push(
          /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
            Button,
            {
              variant: "primary",
              onClick: saveHandler,
              isLoading: spinning,
              isDisabled: spinning,
              ...extraPrimaryProps,
              children: createBtnName
            },
            "confirm"
          )
        );
      }
      actions.push(
        /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Button, { variant: "link", onClick: closeHandler, children: _31("Close") }, "close")
      );
      return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title: _31("Backup The Server"),
          isOpen: showModal,
          "aria-labelledby": "ds-modal",
          onClose: closeHandler,
          actions,
          children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
              Grid,
              {
                title: _31("Backup name, if left blank the date and time will be used as the name"),
                className: "ds-margin-top",
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GridItem, { className: "ds-label", span: 3, children: _31("Backup Name") }),
                  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
                    TextInput,
                    {
                      type: "text",
                      id: "backupName",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "backupName",
                      onChange: (event, value) => {
                        handleChange(event);
                      },
                      validated: error.backupName ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GridItem, { span: 12, className: "ds-margin-top-lg", children: watchBuffer })
                ]
              }
            ),
            exportMsg
          ] })
        }
      );
    }
  };
  ExportModal2.propTypes = {
    showModal: import_prop_types32.default.bool,
    closeHandler: import_prop_types32.default.func,
    handleChange: import_prop_types32.default.func,
    saveHandler: import_prop_types32.default.func,
    spinning: import_prop_types32.default.bool,
    error: import_prop_types32.default.object,
    suffixes: import_prop_types32.default.array,
    includeReplData: import_prop_types32.default.bool,
    ldifSuffix: import_prop_types32.default.string,
    ldifName: import_prop_types32.default.string,
    watchBuffer: import_prop_types32.default.node,
    exportCompleted: import_prop_types32.default.bool
  };
  BackupModal.propTypes = {
    showModal: import_prop_types32.default.bool,
    closeHandler: import_prop_types32.default.func,
    handleChange: import_prop_types32.default.func,
    saveHandler: import_prop_types32.default.func,
    spinning: import_prop_types32.default.bool,
    error: import_prop_types32.default.object,
    watchBuffer: import_prop_types32.default.node,
    backupCompleted: import_prop_types32.default.bool
  };
  Backups.propTypes = {
    backups: import_prop_types32.default.array,
    ldifs: import_prop_types32.default.array,
    reload: import_prop_types32.default.func,
    enableTree: import_prop_types32.default.func
  };
  Backups.defaultProps = {
    backups: [],
    ldifs: []
  };

  // src/lib/database/globalPwp.jsx
  var import_react54 = __toESM(require_react(), 1);
  var import_prop_types33 = __toESM(require_prop_types(), 1);

  // src/lib/database/pwpValidation.jsx
  var import_react53 = __toESM(require_react(), 1);
  var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
  var _32 = cockpit_default.gettext;
  var FIELD_RANGES = {
    passwordinhistory: { min: 0, max: 24 },
    passwordminlength: { min: 2, max: 512 },
    passwordmindigits: { min: 0, max: 64 },
    passwordminalphas: { min: 0, max: 64 },
    passwordminuppers: { min: 0, max: 64 },
    passwordminlowers: { min: 0, max: 64 },
    passwordminspecials: { min: 0, max: 64 },
    passwordmin8bit: { min: 0, max: 64 },
    passwordmaxrepeats: { min: 0, max: 64 },
    passwordmincategories: { min: 0, max: 5 },
    passwordmintokenlength: { min: 1, max: 64 },
    passwordmaxfailure: { min: 1, max: 32767 },
    passwordmaxsequence: { min: 0 },
    passwordmaxseqsets: { min: 0 },
    passwordmaxclasschars: { min: 0 },
    passwordresetfailurecount: { min: 0 },
    passwordlockoutduration: { min: 0 },
    passwordminage: { min: 0 },
    passwordmaxage: { min: 0 },
    passwordgracelimit: { min: 0 },
    passwordwarning: { min: 0 }
  };
  var baseFieldName = (attr) => {
    return attr.startsWith("create_") ? attr.substring(7) : attr;
  };
  var validateField = (attr, value) => {
    const range4 = FIELD_RANGES[baseFieldName(attr)];
    if (!range4) return false;
    const num = Number(value);
    if (value === "" || isNaN(num) || !Number.isInteger(num) || num < range4.min) {
      return true;
    }
    if (range4.max !== void 0 && num > range4.max) {
      return true;
    }
    return false;
  };
  var updateFieldValidation = (invalidFields, attr, value) => {
    const newInvalidFields = { ...invalidFields };
    if (FIELD_RANGES[baseFieldName(attr)]) {
      if (validateField(attr, value)) {
        newInvalidFields[attr] = true;
      } else {
        delete newInvalidFields[attr];
      }
    }
    return newInvalidFields;
  };
  var getValidationProps = (fieldName, invalidFields) => {
    const range4 = FIELD_RANGES[baseFieldName(fieldName)];
    if (!range4) return {};
    const props = { min: range4.min };
    if (range4.max !== void 0) {
      props.max = range4.max;
    }
    props.validated = invalidFields[fieldName] ? ValidatedOptions.error : ValidatedOptions.default;
    return props;
  };
  var renderValidationError = (fieldName, invalidFields) => {
    const range4 = FIELD_RANGES[baseFieldName(fieldName)];
    if (!range4 || !invalidFields[fieldName]) return null;
    const msg = range4.max !== void 0 ? cockpit_default.format(
      _32("Value must be a number from $0 to $1"),
      range4.min,
      range4.max
    ) : _32("Value must be a non-negative integer");
    return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(FormHelperText, { className: "ds-left-margin", isError: true, isHidden: false, children: msg }) });
  };
  var hasInvalidField = (attrs, invalidFields) => {
    return attrs.some((a2) => invalidFields[a2]);
  };

  // src/lib/database/globalPwp.jsx
  var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
  var _33 = cockpit_default.gettext;
  var general_attrs = [
    "nsslapd-pwpolicy-local",
    "passwordstoragescheme",
    "passwordadmindn",
    "passwordadminskipinfoupdate",
    "passwordtrackupdatetime",
    "nsslapd-allow-hashed-passwords",
    "nsslapd-pwpolicy-inherit-global",
    "passwordisglobalpolicy",
    "passwordchange",
    "passwordmustchange",
    "passwordhistory",
    "passwordinhistory",
    "passwordminage"
  ];
  var exp_attrs = [
    "passwordexp",
    "passwordgracelimit",
    "passwordsendexpiringtime",
    "passwordmaxage",
    "passwordwarning"
  ];
  var lockout_attrs = [
    "passwordlockout",
    "passwordunlock",
    "passwordlockoutduration",
    "passwordmaxfailure",
    "passwordresetfailurecount"
  ];
  var syntax_attrs = [
    "passwordchecksyntax",
    "passwordminlength",
    "passwordmindigits",
    "passwordminalphas",
    "passwordminuppers",
    "passwordminlowers",
    "passwordminspecials",
    "passwordmin8bit",
    "passwordmaxrepeats",
    "passwordpalindrome",
    "passwordmaxsequence",
    "passwordmaxseqsets",
    "passwordmaxclasschars",
    "passwordmincategories",
    "passwordmintokenlength",
    "passwordbadwords",
    "passworduserattributes",
    "passworddictcheck"
  ];
  var tpr_attrs = [
    "passwordtprmaxuse",
    "passwordtprdelayexpireat",
    "passwordtprdelayvalidfrom"
  ];
  var password_storage_attrs = [
    "nsslapd-pwdpbkdf2numiterations"
  ];
  var PBKDF2_SCHEMES = ["pbkdf2", "pbkdf2-sha1", "pbkdf2-sha256", "pbkdf2-sha512"];
  var isPBKDF2Scheme = (scheme) => {
    return PBKDF2_SCHEMES.includes(scheme.toLowerCase());
  };
  var GlobalPwPolicy = class extends import_react54.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleSyntaxChange", (e, selection, isPlaceholder) => {
        let attr;
        let value;
        if (selection) {
          attr = "passworduserattributes";
          value = selection;
        } else {
          value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
          attr = e.target.id;
        }
        let disableSaveBtn = true;
        for (const syntax_attr of syntax_attrs) {
          if (syntax_attr === "passworduserattributes" && attr === "passworduserattributes") {
            const orig_val = this.state["_" + syntax_attr].join(" ");
            if (orig_val !== value) {
              value = selection;
              disableSaveBtn = false;
              break;
            }
            value = selection;
          } else if (attr === syntax_attr && this.state["_" + syntax_attr] !== value) {
            disableSaveBtn = false;
            break;
          }
        }
        for (const syntax_attr of syntax_attrs) {
          if (syntax_attr === "passworduserattributes" && attr !== "passworduserattributes") {
            const orig_val = this.state["_" + syntax_attr].join(" ");
            const new_val = this.state[syntax_attr].join(" ");
            if (orig_val !== new_val) {
              disableSaveBtn = false;
              break;
            }
          } else if (attr !== syntax_attr && this.state["_" + syntax_attr] !== this.state[syntax_attr]) {
            disableSaveBtn = false;
            break;
          }
        }
        if (selection) {
          this.setState({
            [attr]: Array.isArray(selection) ? selection : [],
            saveSyntaxDisabled: disableSaveBtn,
            invalidFields: updateFieldValidation(this.state.invalidFields, attr, value),
            isSelectOpen: false
          });
        } else {
          this.setState({
            [attr]: value,
            saveSyntaxDisabled: disableSaveBtn,
            invalidFields: updateFieldValidation(this.state.invalidFields, attr, value),
            isSelectOpen: false
          });
        }
      });
      __publicField(this, "handleSelectToggle", (_event, isSelectOpen) => {
        this.setState({
          isSelectOpen
        });
      });
      __publicField(this, "handleSelectClear", () => {
        this.setState({
          passworduserattributes: [],
          isSelectOpen: false
        });
      });
      this.state = {
        loading: true,
        loaded: false,
        saving: false,
        activeKey: 1,
        // Lists of all the attributes for each tab/section.
        // We use the exact attribute name for the ID of
        // each field, so we can loop over them to efficently
        // check for changes, and updating/saving the config.
        saveGeneralDisabled: true,
        savePasswordStorageDisabled: true,
        saveExpDisabled: true,
        saveLockoutDisabled: true,
        saveSyntaxDisabled: true,
        saveTPRDisabled: true,
        isSelectOpen: false,
        invalidFields: {}
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleGeneralChange = this.handleGeneralChange.bind(this);
      this.handleSaveGeneral = this.handleSaveGeneral.bind(this);
      this.handlePasswordStorageChange = this.handlePasswordStorageChange.bind(this);
      this.handleSavePasswordStorage = this.handleSavePasswordStorage.bind(this);
      this.handleExpChange = this.handleExpChange.bind(this);
      this.handleSaveExp = this.handleSaveExp.bind(this);
      this.handleLockoutChange = this.handleLockoutChange.bind(this);
      this.handleSaveLockout = this.handleSaveLockout.bind(this);
      this.handleSyntaxChange = this.handleSyntaxChange.bind(this);
      this.handleSaveSyntax = this.handleSaveSyntax.bind(this);
      this.handleTPRChange = this.handleTPRChange.bind(this);
      this.handleSaveTPR = this.handleSaveTPR.bind(this);
      this.handleLoadGlobal = this.handleLoadGlobal.bind(this);
      this.handleLoadPasswordStorage = this.handleLoadPasswordStorage.bind(this);
      this.handleSelectToggle = this.handleSelectToggle.bind(this);
      this.handleSelectClear = this.handleSelectClear.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.handleLoadGlobal();
      } else {
        this.props.enableTree();
      }
    }
    handleNavSelect(key) {
      this.setState({ activeKey: key });
    }
    handlePasswordStorageChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id.toLowerCase();
      let disableSaveBtn = true;
      for (const password_storage_attr of password_storage_attrs) {
        const storageAttr = password_storage_attr.toLowerCase();
        const oldValue = String(this.state["_" + storageAttr] || "");
        const newValue = String(value || "");
        if (attr === storageAttr && oldValue !== newValue) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value || "",
        savePasswordStorageDisabled: disableSaveBtn
      });
    }
    handleSavePasswordStorage() {
      if (!isPBKDF2Scheme(this.state.passwordstoragescheme)) {
        return;
      }
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "pwstorage-scheme",
        this.state.passwordstoragescheme.toLowerCase(),
        "set-num-iterations",
        this.state[password_storage_attrs[0]]
      ];
      log_cmd("handleSavePasswordStorage", "Saving password storage settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "success",
          _33("Successfully updated number of iterations for password storage scheme")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_33("Error updating number of iterations for password storage scheme - $0"), errMsg)
        );
      });
    }
    handleGeneralChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const general_attr of general_attrs) {
        if (attr === general_attr && this.state["_" + general_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const general_attr of general_attrs) {
        if (attr !== general_attr && this.state["_" + general_attr] !== this.state[general_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      const stateUpdate = {
        [attr]: value,
        saveGeneralDisabled: disableSaveBtn,
        invalidFields: updateFieldValidation(this.state.invalidFields, attr, value)
      };
      this.setState(stateUpdate, () => {
        if (attr === "passwordstoragescheme" && isPBKDF2Scheme(value)) {
          this.handleLoadPasswordStorage(true);
        }
      });
    }
    handleSaveGeneral() {
      this.setState({
        saving: true
      });
      if (!this.state.savePasswordStorageDisabled) {
        this.handleSavePasswordStorage();
      }
      if (this.state.saveGeneralDisabled) {
        this.setState({
          saving: false
        });
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of general_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      log_cmd("handleSaveGeneral", "Saving general pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "success",
          _33("Successfully updated password policy configuration")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_33("Error updating password policy configuration - $0"), errMsg)
        );
      });
    }
    handleUserChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const user_attr of this.state.user_attrs) {
        if (attr === user_attr && this.state["_" + user_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const user_attr of this.state.user_attrs) {
        if (attr !== user_attr && this.state["_" + user_attr] !== this.state[user_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        saveUserDisabled: disableSaveBtn
      });
    }
    handleExpChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const exp_attr of exp_attrs) {
        if (attr === exp_attr && this.state["_" + exp_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const exp_attr of exp_attrs) {
        if (attr !== exp_attr && this.state["_" + exp_attr] !== this.state[exp_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        saveExpDisabled: disableSaveBtn,
        invalidFields: updateFieldValidation(this.state.invalidFields, attr, value)
      });
    }
    handleSaveExp() {
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of exp_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      log_cmd("handleSaveExp", "Saving Expiration pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "success",
          _33("Successfully updated password policy configuration")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_33("Error updating password policy configuration - $0"), errMsg)
        );
      });
    }
    handleLockoutChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const lockout_attr of lockout_attrs) {
        if (attr === lockout_attr && this.state["_" + lockout_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const lockout_attr of lockout_attrs) {
        if (attr !== lockout_attr && this.state["_" + lockout_attr] !== this.state[lockout_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        saveLockoutDisabled: disableSaveBtn,
        invalidFields: updateFieldValidation(this.state.invalidFields, attr, value)
      });
    }
    handleSaveLockout() {
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of lockout_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      log_cmd("handleSaveLockout", "Saving lockout pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "success",
          _33("Successfully updated password policy configuration")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_33("Error updating password policy configuration - $0"), errMsg)
        );
      });
    }
    handleSaveSyntax() {
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of syntax_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      log_cmd("handleSaveSyntax", "Saving syntax checking pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "success",
          _33("Successfully updated password policy configuration")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_33("Error updating password policy configuration - $0"), errMsg)
        );
      });
    }
    handleTPRChange(e) {
      const value = e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const tpr_attr of tpr_attrs) {
        if (attr === tpr_attr && this.state["_" + tpr_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const tpr_attr of tpr_attrs) {
        if (attr !== tpr_attr && this.state["_" + tpr_attr] !== this.state[tpr_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        saveTPRDisabled: disableSaveBtn
      });
    }
    handleSaveTPR() {
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of tpr_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          const val = this.state[attr];
          cmd.push(attr + "=" + val);
        }
      }
      log_cmd("handleSaveTPR", "Saving TPR settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "success",
          _33("Successfully updated password policy configuration")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.handleLoadGlobal();
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_33("Error updating password policy configuration - $0"), errMsg)
        );
      });
    }
    handleLoadPasswordStorage(skipLoading = false) {
      if (!skipLoading) {
        this.setState({
          loading: true
        });
      }
      if (!isPBKDF2Scheme(this.state.passwordstoragescheme)) {
        this.setState({
          loading: false,
          "nsslapd-pwdpbkdf2numiterations": "",
          "_nsslapd-pwdpbkdf2numiterations": ""
        });
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "plugin",
        "pwstorage-scheme",
        this.state.passwordstoragescheme.toLowerCase(),
        "get-num-iterations"
      ];
      log_cmd("handleLoadPasswordStorage", "Load password storage settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        const stateUpdates = {
          "nsslapd-pwdpbkdf2numiterations": "",
          "_nsslapd-pwdpbkdf2numiterations": ""
        };
        if (!skipLoading) {
          stateUpdates["loading"] = false;
        }
        password_storage_attrs.forEach((attr) => {
          const attrLower = attr.toLowerCase();
          const attrValue = attrs[attr] || attrs[attrLower];
          if (attrValue && attrValue[0]) {
            stateUpdates[attrLower] = attrValue[0];
            stateUpdates["_" + attrLower] = attrValue[0];
          }
        });
        this.setState(stateUpdates);
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.setState({
          loading: false,
          "nsslapd-pwdpbkdf2numiterations": "",
          "_nsslapd-pwdpbkdf2numiterations": ""
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_33("Error loading password storage settings - $0"), errMsg)
        );
      });
    }
    handleLoadGlobal() {
      this.setState({
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("handleLoadGlobal", "Load global password policy", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        let pwpLocal = false;
        let pwIsGlobal = false;
        let pwChange = false;
        let pwMustChange = false;
        let pwHistory = false;
        let pwTrackUpdate = false;
        let pwExpire = false;
        let pwSendExpire = false;
        let pwLockout = false;
        let pwUnlock = false;
        let pwCheckSyntax = false;
        let pwPalindrome = false;
        let pwDictCheck = false;
        let pwAllowHashed = false;
        let pwInheritGlobal = false;
        let pwAdminSkipUpdates = false;
        let pwUserAttrs = [];
        if (attrs["nsslapd-pwpolicy-local"][0] === "on") {
          pwpLocal = true;
        }
        if (attrs.passwordchange[0] === "on") {
          pwChange = true;
        }
        if (attrs.passwordmustchange[0] === "on") {
          pwMustChange = true;
        }
        if (attrs.passwordhistory[0] === "on") {
          pwHistory = true;
        }
        if (attrs.passwordtrackupdatetime[0] === "on") {
          pwTrackUpdate = true;
        }
        if (attrs.passwordisglobalpolicy[0] === "on") {
          pwIsGlobal = true;
        }
        if (attrs.passwordsendexpiringtime[0] === "on") {
          pwSendExpire = true;
        }
        if (attrs.passwordlockout[0] === "on") {
          pwLockout = true;
        }
        if (attrs.passwordunlock[0] === "on") {
          pwUnlock = true;
        }
        if (attrs.passwordexp[0] === "on") {
          pwExpire = true;
        }
        if (attrs.passwordchecksyntax[0] === "on") {
          pwCheckSyntax = true;
        }
        if (attrs.passwordpalindrome[0] === "on") {
          pwPalindrome = true;
        }
        if (attrs.passworddictcheck[0] === "on") {
          pwDictCheck = true;
        }
        if (attrs["nsslapd-allow-hashed-passwords"][0] === "on") {
          pwAllowHashed = true;
        }
        if (attrs["nsslapd-pwpolicy-inherit-global"][0] === "on") {
          pwInheritGlobal = true;
        }
        if (attrs.passwordadminskipinfoupdate[0] === "on") {
          pwAdminSkipUpdates = true;
        }
        if (attrs.passwordbadwords[0] !== "") {
          if (attrs.passwordbadwords.length > 1) {
            attrs.passwordbadwords[0] = attrs.passwordbadwords.join(" ");
          }
        }
        if (attrs.passworduserattributes[0] !== "") {
          if (attrs.passworduserattributes.length > 1) {
            attrs.passworduserattributes[0] = attrs.passworduserattributes.join(" ");
          }
          if (attrs.passworduserattributes[0].indexOf(",") > -1) {
            pwUserAttrs = attrs.passworduserattributes[0].trim();
            pwUserAttrs = pwUserAttrs.split(",");
          } else {
            pwUserAttrs = attrs.passworduserattributes[0].split(" ");
          }
        }
        this.setState(() => ({
          loaded: true,
          loading: false,
          invalidFields: {},
          saveGeneralDisabled: true,
          savePasswordStorageDisabled: true,
          saveUserDisabled: true,
          saveExpDisabled: true,
          saveLockoutDisabled: true,
          saveSyntaxDisabled: true,
          saveTPRDisabled: true,
          // Settings
          "nsslapd-pwpolicy-local": pwpLocal,
          passwordisglobalpolicy: pwIsGlobal,
          passwordchange: pwChange,
          passwordmustchange: pwMustChange,
          passwordhistory: pwHistory,
          passwordtrackupdatetime: pwTrackUpdate,
          passwordexp: pwExpire,
          passwordsendexpiringtime: pwSendExpire,
          passwordlockout: pwLockout,
          passwordunlock: pwUnlock,
          passwordchecksyntax: pwCheckSyntax,
          passwordpalindrome: pwPalindrome,
          passworddictcheck: pwDictCheck,
          "nsslapd-allow-hashed-passwords": pwAllowHashed,
          "nsslapd-pwpolicy-inherit-global": pwInheritGlobal,
          passwordstoragescheme: attrs.passwordstoragescheme[0],
          passwordinhistory: attrs.passwordinhistory[0],
          passwordwarning: attrs.passwordwarning[0],
          passwordmaxage: attrs.passwordmaxage[0],
          passwordminage: attrs.passwordminage[0],
          passwordgracelimit: attrs.passwordgracelimit[0],
          passwordlockoutduration: attrs.passwordlockoutduration[0],
          passwordmaxfailure: attrs.passwordmaxfailure[0],
          passwordresetfailurecount: attrs.passwordresetfailurecount[0],
          passwordminlength: attrs.passwordminlength[0],
          passwordmindigits: attrs.passwordmindigits[0],
          passwordminalphas: attrs.passwordminalphas[0],
          passwordminuppers: attrs.passwordminuppers[0],
          passwordminlowers: attrs.passwordminlowers[0],
          passwordminspecials: attrs.passwordminspecials[0],
          passwordmin8bit: attrs.passwordmin8bit[0],
          passwordmaxrepeats: attrs.passwordmaxrepeats[0],
          passwordmaxsequence: attrs.passwordmaxsequence[0],
          passwordmaxseqsets: attrs.passwordmaxseqsets[0],
          passwordmaxclasschars: attrs.passwordmaxclasschars[0],
          passwordmincategories: attrs.passwordmincategories[0],
          passwordmintokenlength: attrs.passwordmintokenlength[0],
          passwordbadwords: attrs.passwordbadwords[0],
          passworduserattributes: pwUserAttrs,
          passwordadmindn: attrs.passwordadmindn[0],
          passwordadminskipinfoupdate: pwAdminSkipUpdates,
          passwordtprmaxuse: attrs.passwordtprmaxuse[0],
          passwordtprdelayexpireat: attrs.passwordtprdelayexpireat[0],
          passwordtprdelayvalidfrom: attrs.passwordtprdelayvalidfrom[0],
          // Record original values
          "_nsslapd-pwpolicy-local": pwpLocal,
          _passwordisglobalpolicy: pwIsGlobal,
          _passwordchange: pwChange,
          _passwordmustchange: pwMustChange,
          _passwordhistory: pwHistory,
          _passwordtrackupdatetime: pwTrackUpdate,
          _passwordexp: pwExpire,
          _passwordsendexpiringtime: pwSendExpire,
          _passwordlockout: pwLockout,
          _passwordunlock: pwUnlock,
          _passwordchecksyntax: pwCheckSyntax,
          _passwordpalindrome: pwPalindrome,
          _passworddictcheck: pwDictCheck,
          "_nsslapd-allow-hashed-passwords": pwAllowHashed,
          "_nsslapd-pwpolicy-inherit-global": pwInheritGlobal,
          _passwordstoragescheme: attrs.passwordstoragescheme[0],
          _passwordinhistory: attrs.passwordinhistory[0],
          _passwordwarning: attrs.passwordwarning[0],
          _passwordmaxage: attrs.passwordmaxage[0],
          _passwordminage: attrs.passwordminage[0],
          _passwordgracelimit: attrs.passwordgracelimit[0],
          _passwordlockoutduration: attrs.passwordlockoutduration[0],
          _passwordmaxfailure: attrs.passwordmaxfailure[0],
          _passwordresetfailurecount: attrs.passwordresetfailurecount[0],
          _passwordminlength: attrs.passwordminlength[0],
          _passwordmindigits: attrs.passwordmindigits[0],
          _passwordminalphas: attrs.passwordminalphas[0],
          _passwordminuppers: attrs.passwordminuppers[0],
          _passwordminlowers: attrs.passwordminlowers[0],
          _passwordminspecials: attrs.passwordminspecials[0],
          _passwordmin8bit: attrs.passwordmin8bit[0],
          _passwordmaxrepeats: attrs.passwordmaxrepeats[0],
          _passwordmaxsequence: attrs.passwordmaxsequence[0],
          _passwordmaxseqsets: attrs.passwordmaxseqsets[0],
          _passwordmaxclasschars: attrs.passwordmaxclasschars[0],
          _passwordmincategories: attrs.passwordmincategories[0],
          _passwordmintokenlength: attrs.passwordmintokenlength[0],
          _passwordbadwords: attrs.passwordbadwords[0],
          _passworduserattributes: pwUserAttrs,
          _passwordadmindn: attrs.passwordadmindn[0],
          _passwordadminskipinfoupdate: pwAdminSkipUpdates,
          _passwordtprmaxuse: attrs.passwordtprmaxuse[0],
          _passwordtprdelayexpireat: attrs.passwordtprdelayexpireat[0],
          _passwordtprdelayvalidfrom: attrs.passwordtprdelayvalidfrom[0]
        }), () => {
          this.props.enableTree();
          this.handleLoadPasswordStorage();
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.setState({
          loaded: true,
          loading: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_33("Error loading global password policy - $0"), errMsg)
        );
      });
    }
    render() {
      let pwp_element = "";
      let pwExpirationRows = "";
      let pwLockoutRows = "";
      let pwSyntaxRows = "";
      let saveBtnName = _33("Save");
      const extraPrimaryProps = {};
      if (this.state.saving) {
        saveBtnName = _33("Saving ...");
        extraPrimaryProps.spinnerAriaValueText = _33("Saving");
      }
      if (this.state.passwordchecksyntax) {
        pwSyntaxRows = /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "ds-margin-left", children: [
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 3, children: _33("Minimum Length") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                TextInput,
                {
                  title: _33("The minimum number of characters in the password (passwordMinLength)."),
                  value: this.state.passwordminlength,
                  type: "number",
                  id: "passwordminlength",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "passwordminlength",
                  ...getValidationProps("passwordminlength", this.state.invalidFields),
                  onChange: (e, checked) => {
                    this.handleSyntaxChange(e);
                  }
                }
              ),
              renderValidationError("passwordminlength", this.state.invalidFields)
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", offset: 6, span: 3, children: _33("Max Repeated Chars") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                TextInput,
                {
                  type: "number",
                  title: _33("The maximum number of times the same character can sequentially appear in a password (passwordMaxRepeats)."),
                  value: this.state.passwordmaxrepeats,
                  id: "passwordmaxrepeats",
                  "aria-describedby": "passwordmaxrepeats",
                  name: "passwordmaxrepeats",
                  onChange: (e, str) => {
                    this.handleSyntaxChange(e);
                  },
                  ...getValidationProps("passwordmaxrepeats", this.state.invalidFields)
                }
              ),
              renderValidationError("passwordmaxrepeats", this.state.invalidFields)
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 3, children: _33("Prohibited Words") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
              TextInput,
              {
                title: _33("A space-separated list of words that are not allowed to be contained in the new password (passwordBadWords)."),
                value: this.state.passwordbadwords,
                type: "text",
                id: "passwordbadwords",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordbadwords",
                onChange: (e, checked) => {
                  this.handleSyntaxChange(e);
                }
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 3, title: _33("Check the password against the system's CrackLib dictionary (passwordDictCheck)."), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
            Checkbox,
            {
              id: "passworddictcheck",
              isChecked: this.state.passworddictcheck,
              onChange: (e, checked) => {
                this.handleSyntaxChange(e);
              },
              label: _33("Dictionary Check")
            }
          ) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 3, title: _33("Check if the password is a palindrome (passwordPalindrome)."), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
            Checkbox,
            {
              id: "passwordpalindrome",
              isChecked: this.state.passwordpalindrome,
              className: "ds-label",
              onChange: (e, checked) => {
                this.handleSyntaxChange(e);
              },
              label: _33("Reject Palindromes")
            }
          ) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("hr", {}) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 3, children: _33("Minimum Alpha's") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                TextInput,
                {
                  title: _33("Reject passwords with fewer than this many alpha characters (passwordMinAlphas)."),
                  value: this.state.passwordminalphas,
                  type: "number",
                  id: "passwordminalphas",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "passwordminalphas",
                  ...getValidationProps("passwordminalphas", this.state.invalidFields),
                  onChange: (e, checked) => {
                    this.handleSyntaxChange(e);
                  }
                }
              ),
              renderValidationError("passwordminalphas", this.state.invalidFields)
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", offset: 6, span: 3, children: _33("Minimum Digits") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                TextInput,
                {
                  title: _33("Reject passwords with fewer than this many digit characters (0-9) (passwordMinDigits)."),
                  value: this.state.passwordmindigits,
                  type: "number",
                  id: "passwordmindigits",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "passwordmindigits",
                  ...getValidationProps("passwordmindigits", this.state.invalidFields),
                  onChange: (e, checked) => {
                    this.handleSyntaxChange(e);
                  }
                }
              ),
              renderValidationError("passwordmindigits", this.state.invalidFields)
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 3, children: _33("Minimum Uppercase") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                TextInput,
                {
                  title: _33("Reject passwords with fewer than this many uppercase characters (passwordMinUppers)."),
                  value: this.state.passwordminuppers,
                  type: "number",
                  id: "passwordminuppers",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "passwordminuppers",
                  ...getValidationProps("passwordminuppers", this.state.invalidFields),
                  onChange: (e, checked) => {
                    this.handleSyntaxChange(e);
                  }
                }
              ),
              renderValidationError("passwordminuppers", this.state.invalidFields)
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", offset: 6, span: 3, children: _33("Minimum Lowercase") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                TextInput,
                {
                  title: _33("Reject passwords with fewer than this many lowercase characters (passwordMinLowers)."),
                  value: this.state.passwordminlowers,
                  type: "number",
                  id: "passwordminlowers",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "passwordminlowers",
                  ...getValidationProps("passwordminlowers", this.state.invalidFields),
                  onChange: (e, checked) => {
                    this.handleSyntaxChange(e);
                  }
                }
              ),
              renderValidationError("passwordminlowers", this.state.invalidFields)
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 3, children: _33("Minimum Special") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                TextInput,
                {
                  title: _33("Reject passwords with fewer than this many special non-alphanumeric characters (passwordMinSpecials)."),
                  value: this.state.passwordminspecials,
                  type: "number",
                  id: "passwordminspecials",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "passwordminspecials",
                  ...getValidationProps("passwordminspecials", this.state.invalidFields),
                  onChange: (e, checked) => {
                    this.handleSyntaxChange(e);
                  }
                }
              ),
              renderValidationError("passwordminspecials", this.state.invalidFields)
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", offset: 6, span: 3, children: _33("Minimum 8-bit") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                TextInput,
                {
                  title: _33("Reject passwords with fewer than this many 8-bit or multi-byte characters (passwordMin8Bit)."),
                  value: this.state.passwordmin8bit,
                  type: "number",
                  id: "passwordmin8bit",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "passwordmin8bit",
                  ...getValidationProps("passwordmin8bit", this.state.invalidFields),
                  onChange: (e, checked) => {
                    this.handleSyntaxChange(e);
                  }
                }
              ),
              renderValidationError("passwordmin8bit", this.state.invalidFields)
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 3, children: _33("Minimum Categories") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                TextInput,
                {
                  title: _33("The minimum number of character categories that a password must contain (categories are upper, lower, digit, special, and 8-bit) (passwordMinCategories)."),
                  value: this.state.passwordmincategories,
                  type: "number",
                  id: "passwordmincategories",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "passwordmincategories",
                  ...getValidationProps("passwordmincategories", this.state.invalidFields),
                  onChange: (e, checked) => {
                    this.handleSyntaxChange(e);
                  }
                }
              ),
              renderValidationError("passwordmincategories", this.state.invalidFields)
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("hr", {}) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 3, children: _33("Maximum Sequences") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
              TextInput,
              {
                title: _33("The maximum number of allowed monotonic characters sequences (passwordMaxSequence)."),
                value: this.state.passwordmaxsequence,
                type: "number",
                id: "passwordmaxsequence",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordmaxsequence",
                ...getValidationProps("passwordmaxsequence", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleSyntaxChange(e);
                }
              }
            ) }),
            renderValidationError("passwordmaxsequence", this.state.invalidFields),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", offset: 6, span: 3, children: _33("Max Sequence Sets") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
              TextInput,
              {
                title: _33("The maximum number of allowed monotonic characters sequences that can appear more than once (passwordMaxSeqSets)."),
                value: this.state.passwordmaxseqsets,
                type: "number",
                id: "passwordmaxseqsets",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordmaxseqsets",
                ...getValidationProps("passwordmaxseqsets", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleSyntaxChange(e);
                }
              }
            ) }),
            renderValidationError("passwordmaxseqsets", this.state.invalidFields)
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 3, children: _33("Max Seq Per Class") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
              TextInput,
              {
                title: _33("The maximum number of consecutive characters from the same character class/category (passwordMaxClassChars)."),
                value: this.state.passwordmaxclasschars,
                type: "number",
                id: "passwordmaxclasschars",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordmaxclasschars",
                ...getValidationProps("passwordmaxclasschars", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleSyntaxChange(e);
                }
              }
            ) }),
            renderValidationError("passwordmaxclasschars", this.state.invalidFields)
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("hr", {}) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { title: _33("A list of entry attributes to compare to the new password (passwordUserAttributes)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 3, children: _33("Check User Attributes") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
              dsBasicComponents_default,
              {
                selected: this.state.passworduserattributes,
                onSelect: this.handleSyntaxChange,
                onClear: this.handleSelectClear,
                options: this.props.attrs,
                isOpen: this.state.isSelectOpen,
                onToggle: this.handleSelectToggle,
                placeholder: _33("Type attributes to check..."),
                noResultsText: "There are no matching entries",
                ariaLabel: "Type an attribute to check",
                isMulti: true
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { className: "ds-margin-top", title: _33("The smallest attribute value used when checking if the password contains any of the user's attributes that are set via passwordUserAttributes (passwordMinTokenLength)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 3, children: _33("Minimum Token Length") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
              TextInput,
              {
                type: "number",
                value: this.state.passwordmintokenlength,
                id: "passwordmintokenlength",
                "aria-describedby": "passwordmintokenlength",
                name: "passwordmintokenlength",
                onChange: (e, str) => {
                  this.handleSyntaxChange(e);
                },
                ...getValidationProps("passwordmintokenlength", this.state.invalidFields)
              }
            ) }),
            renderValidationError("passwordmintokenlength", this.state.invalidFields)
          ] })
        ] });
      }
      if (this.state.passwordlockout) {
        pwLockoutRows = /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "ds-margin-left", children: [
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { className: "ds-margin-top", title: _33("The maximum number of failed logins before account gets locked (passwordMaxFailure)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 5, children: _33("Number of Failed Logins That Locks out Account") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
              TextInput,
              {
                value: this.state.passwordmaxfailure,
                type: "number",
                id: "passwordmaxfailure",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordmaxfailure",
                ...getValidationProps("passwordmaxfailure", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleLockoutChange(e);
                }
              }
            ) }),
            renderValidationError("passwordmaxfailure", this.state.invalidFields)
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { className: "ds-margin-top", title: _33("The number of seconds until an accounts failure count is reset (passwordResetFailureCount)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 5, children: _33("Time Until <i>Failure Count</i> Resets") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
              TextInput,
              {
                value: this.state.passwordresetfailurecount,
                type: "number",
                id: "passwordresetfailurecount",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordresetfailurecount",
                ...getValidationProps("passwordresetfailurecount", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleLockoutChange(e);
                }
              }
            ) }),
            renderValidationError("passwordresetfailurecount", this.state.invalidFields)
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { className: "ds-margin-top", title: _33("The number of seconds, duration, before the account gets unlocked (passwordLockoutDuration)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 5, children: _33("Time Until Account Unlocked") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
              TextInput,
              {
                value: this.state.passwordlockoutduration,
                type: "number",
                id: "passwordlockoutduration",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordlockoutduration",
                ...getValidationProps("passwordlockoutduration", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleLockoutChange(e);
                }
              }
            ) }),
            renderValidationError("passwordlockoutduration", this.state.invalidFields)
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Grid, { className: "ds-margin-top", title: _33("Do not lockout the user account forever, instead the account will unlock based on the lockout duration (passwordUnlock)."), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
            Checkbox,
            {
              id: "passwordunlock",
              isChecked: this.state.passwordunlock,
              onChange: (e, checked) => {
                this.handleLockoutChange(e);
              },
              label: _33("Do Not Lockout Account Forever")
            }
          ) }) })
        ] });
      }
      if (this.state.passwordexp) {
        pwExpirationRows = /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "ds-margin-left", children: [
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { className: "ds-margin-top", title: _33("The maximum age of a password in seconds before it expires (passwordMaxAge)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 5, children: _33("Password Expiration Time") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
              TextInput,
              {
                value: this.state.passwordmaxage,
                type: "number",
                id: "passwordmaxage",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordmaxage",
                ...getValidationProps("passwordmaxage", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleExpChange(e);
                }
              }
            ) }),
            renderValidationError("passwordmaxage", this.state.invalidFields)
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { className: "ds-margin-top", title: _33("The number of logins that are allowed after the password has expired (passwordGraceLimit)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 5, children: _33("Allowed Logins After Password Expires") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
              TextInput,
              {
                value: this.state.passwordgracelimit,
                type: "number",
                id: "passwordgracelimit",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordgracelimit",
                ...getValidationProps("passwordgracelimit", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleExpChange(e);
                }
              }
            ) }),
            renderValidationError("passwordgracelimit", this.state.invalidFields)
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { className: "ds-margin-top", title: _33("Set the time (in seconds), before a password is about to expire, to send a warning. (passwordWarning)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 5, children: _33("Send Password Expiring Warning") }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
              TextInput,
              {
                value: this.state.passwordwarning,
                type: "number",
                id: "passwordwarning",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordwarning",
                ...getValidationProps("passwordwarning", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleExpChange(e);
                }
              }
            ) }),
            renderValidationError("passwordwarning", this.state.invalidFields)
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Grid, { className: "ds-margin-top", title: _33("Always return a password expiring control when requested (passwordSendExpiringTime)."), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
            Checkbox,
            {
              id: "passwordsendexpiringtime",
              isChecked: this.state.passwordsendexpiringtime,
              onChange: (e, checked) => {
                this.handleExpChange(e);
              },
              label: _33("Always send Password Expiring Control")
            }
          ) }) })
        ] });
      }
      if (this.state.loading || !this.state.loaded) {
        pwp_element = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "ds-margin-top-xlg ds-center", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Spinner, { size: "xl" }) });
      } else {
        pwp_element = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: this.state.loading ? "ds-fadeout ds-margin-bottom-md" : "ds-fadein ds-left-margin ds-margin-bottom-md", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Tabs, { isFilled: true, className: "ds-margin-top-lg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabTitleText, { children: _33("General Settings") }), children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Form, { className: "ds-margin-left-sm", isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { className: "ds-margin-top-xlg", children: [
                /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 6, title: _33("Allow subtree/user defined local password policies (nsslapd-pwpolicy-local)."), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                  Checkbox,
                  {
                    id: "nsslapd-pwpolicy-local",
                    isChecked: this.state["nsslapd-pwpolicy-local"],
                    onChange: (e, checked) => {
                      this.handleGeneralChange(e);
                    },
                    label: _33("Allow Local Password Policies")
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 6, title: _33("If a local password policy does not defined any syntax rules then inherit the local policy syntax (nsslapd-pwpolicy-inherit-global)."), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                  Checkbox,
                  {
                    id: "nsslapd-pwpolicy-inherit-global",
                    isChecked: this.state["nsslapd-pwpolicy-inherit-global"],
                    onChange: (e, checked) => {
                      this.handleGeneralChange(e);
                    },
                    label: _33("Local Policies Inherit Global Policy")
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 6, title: _33("Allow anyone to add a prehashed password (nsslapd-allow-hashed-passwords)."), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                  Checkbox,
                  {
                    id: "nsslapd-allow-hashed-passwords",
                    isChecked: this.state["nsslapd-allow-hashed-passwords"],
                    onChange: (e, checked) => {
                      this.handleGeneralChange(e);
                    },
                    label: _33("Allow Adding Pre-Hashed Passwords")
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 6, title: _33("Allow password policy state attributes to replicate (passwordIsGlobalPolicy)."), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                  Checkbox,
                  {
                    id: "passwordisglobalpolicy",
                    isChecked: this.state.passwordisglobalpolicy,
                    onChange: (e, checked) => {
                      this.handleGeneralChange(e);
                    },
                    label: _33("Replicate Password Policy State Attributes")
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 6, title: _33("Record a separate timestamp specifically for the last time that the password for an entry was changed. If this is enabled, then it adds the pwdUpdateTime operational attribute to the user account entry (passwordTrackUpdateTime)."), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                  Checkbox,
                  {
                    id: "passwordtrackupdatetime",
                    isChecked: this.state.passwordtrackupdatetime,
                    onChange: (e, checked) => {
                      this.handleGeneralChange(e);
                    },
                    label: _33("Track Password Update Time")
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 6, title: _33("Allow user's to change their passwords (passwordChange)."), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                  Checkbox,
                  {
                    id: "passwordchange",
                    isChecked: this.state.passwordchange,
                    onChange: (e, checked) => {
                      this.handleGeneralChange(e);
                    },
                    label: _33("Allow Users To Change Their Passwords")
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { title: _33("User must change its password after its been reset by an administrator (passwordMustChange)."), children: [
                /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                  Checkbox,
                  {
                    id: "passwordmustchange",
                    isChecked: this.state.passwordmustchange,
                    onChange: (e, checked) => {
                      this.handleGeneralChange(e);
                    },
                    label: _33("User Must Change Password After Reset")
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(GridItem, { span: 6, title: _33("Maintain a password history for each user (passwordHistory)."), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "ds-inline", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                    Checkbox,
                    {
                      id: "passwordhistory",
                      isChecked: this.state.passwordhistory,
                      onChange: (e, checked) => {
                        this.handleGeneralChange(e);
                      },
                      label: _33("Keep Password History")
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "ds-inline ds-left-margin ds-raise-field-md ds-width-sm", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                      TextInput,
                      {
                        value: this.state.passwordinhistory,
                        type: "number",
                        id: "passwordinhistory",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "passwordinhistory",
                        ...getValidationProps("passwordinhistory", this.state.invalidFields),
                        onChange: (e, checked) => {
                          this.handleGeneralChange(e);
                        }
                      }
                    ),
                    renderValidationError("passwordinhistory", this.state.invalidFields)
                  ] })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
                Grid,
                {
                  title: _33("Indicates the number of seconds that must pass before a user can change their password again. (passwordMinAge)."),
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 2, children: _33("Password Minimum Age") }),
                    /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                      TextInput,
                      {
                        value: this.state.passwordminage,
                        type: "number",
                        id: "passwordminage",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "passwordminage",
                        ...getValidationProps("passwordminage", this.state.invalidFields),
                        onChange: (e, checked) => {
                          this.handleGeneralChange(e);
                        }
                      }
                    ) }),
                    renderValidationError("passwordminage", this.state.invalidFields)
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { title: _33("Set the password storage scheme (passwordstoragescheme)."), children: [
                /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 2, className: "ds-label", children: _33("Password Storage Scheme") }),
                /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                  FormSelect,
                  {
                    id: "passwordstoragescheme",
                    value: this.state.passwordstoragescheme,
                    onChange: (event, value) => {
                      this.handleGeneralChange(event);
                    },
                    "aria-label": "FormSelect Input",
                    children: this.props.pwdStorageSchemes.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                      FormSelectOption,
                      {
                        value: option,
                        label: option
                      },
                      index
                    ))
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
                  GridItem,
                  {
                    span: 5,
                    className: !isPBKDF2Scheme(this.state.passwordstoragescheme) ? "ds-hidden" : "ds-margin-left",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "ds-inline", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                        TextInput,
                        {
                          value: this.state[password_storage_attrs[0]] || "",
                          type: "number",
                          id: password_storage_attrs[0],
                          "aria-describedby": "horizontal-form-name-helper",
                          name: password_storage_attrs[0],
                          onChange: (e, checked) => {
                            this.handlePasswordStorageChange(e);
                          }
                        }
                      ) }),
                      /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "ds-inline ds-left-margin ds-lower-field", children: _33("Iterations") })
                    ]
                  }
                )
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 2, title: _33("The DN for a password administrator or administrator group (passwordAdminDN)."), children: _33("Password Administrator") }),
                /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                  TextInput,
                  {
                    value: this.state.passwordadmindn,
                    type: "text",
                    id: "passwordadmindn",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "passwordadmindn",
                    onChange: (e, checked) => {
                      this.handleGeneralChange(e);
                    }
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Grid, { title: _33("Disable updating password state attributes like passwordExpirationtime, passwordHistory, etc, when setting a user's password as a Password Administrator (passwordAdminSkipInfoUpdate)."), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { offset: 2, span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                Checkbox,
                {
                  id: "passwordadminskipinfoupdate",
                  isChecked: this.state.passwordadminskipinfoupdate,
                  onChange: (e, checked) => {
                    this.handleGeneralChange(e);
                  },
                  label: _33("Do not update target password state attributes")
                }
              ) }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
              Button,
              {
                isDisabled: this.state.saveGeneralDisabled && this.state.savePasswordStorageDisabled || this.state.saving || hasInvalidField(general_attrs, this.state.invalidFields),
                variant: "primary",
                className: "ds-margin-top-xlg ds-margin-left-sm",
                onClick: this.handleSaveGeneral,
                isLoading: this.state.saving,
                spinnerAriaValueText: this.state.saving ? _33("Saving") : void 0,
                ...extraPrimaryProps,
                children: saveBtnName
              }
            )
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabTitleText, { children: _33("Expiration") }), children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Form, { className: "ds-margin-top-xlg ds-margin-left", isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Grid, { title: _33("Enable a password expiration policy (passwordExp)."), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                Checkbox,
                {
                  id: "passwordexp",
                  isChecked: this.state.passwordexp,
                  onChange: (e, checked) => {
                    this.handleExpChange(e);
                  },
                  label: _33("Enforce Password Expiration")
                }
              ) }) }),
              pwExpirationRows
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
              Button,
              {
                isDisabled: this.state.saveExpDisabled || this.state.saving || hasInvalidField(exp_attrs, this.state.invalidFields),
                variant: "primary",
                className: "ds-margin-top-xlg ds-margin-left",
                onClick: this.handleSaveExp,
                isLoading: this.state.saving,
                spinnerAriaValueText: this.state.saving ? _33("Saving") : void 0,
                ...extraPrimaryProps,
                children: saveBtnName
              }
            )
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabTitleText, { children: _33("Account Lockout") }), children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Form, { className: "ds-margin-top-xlg ds-margin-left", isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Grid, { title: _33("Enable account lockout (passwordLockout)."), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                Checkbox,
                {
                  id: "passwordlockout",
                  isChecked: this.state.passwordlockout,
                  onChange: (e, checked) => {
                    this.handleLockoutChange(e);
                  },
                  label: _33("Enable Account Lockout")
                }
              ) }) }),
              pwLockoutRows
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
              Button,
              {
                isDisabled: this.state.saveLockoutDisabled || this.state.saving || hasInvalidField(lockout_attrs, this.state.invalidFields),
                variant: "primary",
                className: "ds-margin-top-xlg ds-margin-left",
                onClick: this.handleSaveLockout,
                isLoading: this.state.saving,
                spinnerAriaValueText: this.state.saving ? _33("Saving") : void 0,
                ...extraPrimaryProps,
                children: saveBtnName
              }
            )
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Tab, { eventKey: 3, title: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabTitleText, { children: _33("Syntax Checking") }), children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Form, { className: "ds-margin-top-xlg ds-margin-left", isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Grid, { title: _33("Enable password syntax checking (passwordCheckSyntax)."), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                Checkbox,
                {
                  id: "passwordchecksyntax",
                  isChecked: this.state.passwordchecksyntax,
                  onChange: (e, checked) => {
                    this.handleSyntaxChange(e);
                  },
                  label: _33("Enable Password Syntax Checking")
                }
              ) }) }),
              pwSyntaxRows
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
              Button,
              {
                isDisabled: this.state.saveSyntaxDisabled || this.state.saving || hasInvalidField(syntax_attrs, this.state.invalidFields),
                variant: "primary",
                className: "ds-margin-top-xlg ds-margin-left",
                onClick: this.handleSaveSyntax,
                isLoading: this.state.saving,
                spinnerAriaValueText: this.state.saving ? _33("Saving") : void 0,
                ...extraPrimaryProps,
                children: saveBtnName
              }
            )
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Tab, { eventKey: 4, title: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TabTitleText, { children: _33("Temporary Password Rules") }), children: [
            /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Form, { className: "ds-margin-top ds-margin-left", isHorizontal: true, autoComplete: "off", children: [
              this.state.passwordmustchange === false && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FormAlert, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                Alert,
                {
                  variant: "info",
                  title: _33('"User Must Change Password After Reset" must be enabled in General Settings to activate TPR.'),
                  "aria-live": "polite",
                  isInline: true
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
                Grid,
                {
                  title: _33("Number of times the temporary password can be used to authenticate (passwordTPRMaxUse)."),
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 3, children: _33("Password Max Use") }),
                    /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                      TextInput,
                      {
                        value: this.state.passwordtprmaxuse,
                        type: "number",
                        id: "passwordtprmaxuse",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "passwordtprmaxuse",
                        isDisabled: !this.state.passwordmustchange,
                        onChange: (e, checked) => {
                          this.handleTPRChange(e);
                        }
                      }
                    ) })
                  ]
                }
              )
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Form, { className: "ds-margin-top ds-margin-left", isHorizontal: true, autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
              Grid,
              {
                title: _33("Number of seconds before the temporary password expires (passwordTPRDelayExpireAt)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 3, children: _33("Password Expires In") }),
                  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                    TextInput,
                    {
                      value: this.state.passwordtprdelayexpireat,
                      type: "number",
                      id: "passwordtprdelayexpireat",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "passwordtprdelayexpireat",
                      isDisabled: !this.state.passwordmustchange,
                      onChange: (e, checked) => {
                        this.handleTPRChange(e);
                      }
                    }
                  ) })
                ]
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Form, { className: "ds-margin-top ds-margin-left", isHorizontal: true, autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
              Grid,
              {
                title: _33("Number of seconds after which temporary password starts to be valid for authentication (passwordTPRDelayValidFrom)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { className: "ds-label", span: 3, children: _33("Password Valid From") }),
                  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
                    TextInput,
                    {
                      value: this.state.passwordtprdelayvalidfrom,
                      type: "number",
                      id: "passwordtprdelayvalidfrom",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "passwordtprdelayvalidfrom",
                      isDisabled: !this.state.passwordmustchange,
                      onChange: (e, checked) => {
                        this.handleTPRChange(e);
                      }
                    }
                  ) })
                ]
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
              Button,
              {
                isDisabled: this.state.saveTPRDisabled || this.state.saving,
                variant: "primary",
                className: "ds-margin-top-xlg ds-margin-left",
                onClick: this.handleSaveTPR,
                isLoading: this.state.saving,
                spinnerAriaValueText: this.state.saving ? _33("Saving") : void 0,
                ...extraPrimaryProps,
                children: saveBtnName
              }
            )
          ] })
        ] }) });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: this.state.saving ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Text, { component: TextVariants.h2, children: [
          _33("Global Password Policy"),
          /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _33("Refresh global password policy settings"),
              onClick: this.handleLoadGlobal,
              children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }) }) }),
        pwp_element
      ] });
    }
  };
  GlobalPwPolicy.propTypes = {
    attrs: import_prop_types33.default.array,
    pwdStorageSchemes: import_prop_types33.default.array
  };
  GlobalPwPolicy.defaultProps = {
    attrs: [],
    pwdStorageSchemes: []
  };

  // src/lib/database/localPwp.jsx
  var import_react55 = __toESM(require_react(), 1);
  var import_prop_types34 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
  var _34 = cockpit_default.gettext;
  var general_attrs2 = [
    "passwordstoragescheme",
    "passwordtrackupdatetime",
    "passwordchange",
    "passwordmustchange",
    "passwordhistory",
    "passwordinhistory",
    "passwordminage",
    "passwordadmindn",
    "passwordadminskipinfoupdate"
  ];
  var exp_attrs2 = [
    "passwordexp",
    "passwordgracelimit",
    "passwordsendexpiringtime",
    "passwordmaxage",
    "passwordwarning"
  ];
  var lockout_attrs2 = [
    "passwordlockout",
    "passwordunlock",
    "passwordlockoutduration",
    "passwordmaxfailure",
    "passwordresetfailurecount"
  ];
  var syntax_attrs2 = [
    "passwordchecksyntax",
    "passwordminlength",
    "passwordmindigits",
    "passwordminalphas",
    "passwordminuppers",
    "passwordminlowers",
    "passwordminspecials",
    "passwordmin8bit",
    "passwordmaxrepeats",
    "passwordpalindrome",
    "passwordmaxsequence",
    "passwordmaxseqsets",
    "passwordmaxclasschars",
    "passwordmincategories",
    "passwordmintokenlength",
    "passwordbadwords",
    "passworduserattributes",
    "passworddictcheck"
  ];
  var tpr_attrs2 = [
    "passwordtprmaxuse",
    "passwordtprdelayexpireat",
    "passwordtprdelayvalidfrom"
  ];
  var CreatePolicy = class extends import_react55.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        isExpiredExpanded: false,
        isGeneralExpanded: false,
        isLockoutExpanded: false,
        isSyntaxExpanded: false,
        isTPRExpanded: false
      };
      this.handleGeneralToggle = (_event, isGeneralExpanded) => {
        this.setState({
          isGeneralExpanded
        });
      };
      this.handleLockoutToggle = (_event, isLockoutExpanded) => {
        this.setState({
          isLockoutExpanded
        });
      };
      this.handleExpiredToggle = (_event, isExpiredExpanded) => {
        this.setState({
          isExpiredExpanded
        });
      };
      this.handleSyntaxToggle = (_event, isSyntaxExpanded) => {
        this.setState({
          isSyntaxExpanded
        });
      };
      this.handleTPRToggle = (_event, isTPRExpanded) => {
        this.setState({
          isTPRExpanded
        });
      };
    }
    render() {
      let helper_text = _34("Required field");
      if (this.props.invalid_dn) {
        helper_text = _34("Invalid DN");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ds-margin-bottom-md", children: [
        /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Form, { className: "ds-margin-left ds-margin-top-xlg", isHorizontal: true, autoComplete: "off", children: [
          /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { className: "ds-center", component: TextVariants.h3, children: _34("Create A New Local Password Policy") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Password Policy Type") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(FormSelect, { value: this.props.createPolicyType, onChange: this.props.handleSelectChange, id: "createPolicyType", "aria-label": _34("FormSelect Input"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FormSelectOption, { value: "Subtree Policy", label: _34("Subtree Policy") }, 1),
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FormSelectOption, { value: "User Policy", label: _34("User Policy") }, 2)
            ] }) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { title: _34("The DN of the entry to apply this password policy to."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Target DN") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 9, children: [
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                TextInput,
                {
                  type: "text",
                  id: "policyDN",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "policyDN",
                  value: this.props.policyDN,
                  onChange: (e, str) => {
                    this.props.handleChange(e);
                  },
                  validated: this.props.invalid_dn ? ValidatedOptions.error : ValidatedOptions.default
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FormHelperText, { children: helper_text })
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
            ExpandableSection,
            {
              className: "ds-margin-top-lg",
              toggleText: this.state.isGeneralExpanded ? _34("Hide General Settings") : _34("Show General Settings"),
              onToggle: (event, isOpen) => this.handleGeneralToggle(event, isOpen),
              isExpanded: this.state.isGeneralExpanded,
              children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ds-margin-left", children: [
                /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", title: _34("Set the password storage scheme (passwordstoragescheme)."), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Password Storage Scheme") }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                    FormSelect,
                    {
                      id: "create_passwordstoragescheme",
                      value: this.props.create_passwordstoragescheme,
                      onChange: (event, value) => {
                        this.props.handleChange(event);
                      },
                      "aria-label": "FormSelect Input",
                      children: this.props.pwdStorageSchemes.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        FormSelectOption,
                        {
                          value: option,
                          label: option
                        },
                        index
                      ))
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
                  Grid,
                  {
                    title: _34("Indicates the number of seconds that must pass before a user can change their password again. (passwordMinAge)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Password Minimum Age") }),
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          type: "number",
                          id: "create_passwordminage",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "create_passwordminage",
                          value: this.props.create_passwordminage,
                          ...getValidationProps("create_passwordminage", this.props.invalidCreateFields),
                          onChange: (e, checked) => {
                            this.props.handleChange(e);
                          }
                        }
                      ) }),
                      renderValidationError("create_passwordminage", this.props.invalidCreateFields)
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
                  Grid,
                  {
                    className: "ds-margin-top",
                    title: _34("The DN for a password administrator or administrator group (passwordAdminDN)."),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Password Administrator") }),
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          value: this.props.create_passwordadmindn,
                          type: "text",
                          id: "create_passwordadmindn",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "create_passwordadmindn",
                          onChange: (e, checked) => {
                            this.props.handleChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                  Grid,
                  {
                    className: "ds-margin-top",
                    title: _34("Disable updating password state attributes like passwordExpirationtime, passwordHistory, etc, when setting a user's password as a Password Administrator (passwordAdminSkipInfoUpdate)."),
                    children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { offset: 3, span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                      Checkbox,
                      {
                        id: "create_passwordadminskipinfoupdate",
                        isChecked: this.props.create_passwordadminskipinfoupdate,
                        onChange: (e, checked) => {
                          this.props.handleChange(e);
                        },
                        label: _34("Do not update target entry's password state attributes")
                      }
                    ) })
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { className: "ds-margin-top", title: _34("Record a separate timestamp specifically for the last time that the password for an entry was changed. If this is enabled, then it adds the pwdUpdateTime operational attribute to the user account entry (passwordTrackUpdateTime)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                  Checkbox,
                  {
                    id: "create_passwordtrackupdatetime",
                    isChecked: this.props.create_passwordtrackupdatetime,
                    onChange: (e, checked) => {
                      this.props.handleChange(e);
                    },
                    label: _34("Track Password Update Time")
                  }
                ) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { className: "ds-margin-top", title: _34("Allow user's to change their passwords (passwordChange)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                  Checkbox,
                  {
                    id: "create_passwordchange",
                    isChecked: this.props.create_passwordchange,
                    onChange: (e, checked) => {
                      this.props.handleChange(e);
                    },
                    label: _34("Allow Users To Change Their Passwords")
                  }
                ) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { className: "ds-margin-top", title: _34("User must change its password after its been reset by an administrator (passwordMustChange)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                  Checkbox,
                  {
                    id: "create_passwordmustchange",
                    isChecked: this.props.create_passwordmustchange,
                    onChange: (e, checked) => {
                      this.props.handleChange(e);
                    },
                    label: _34("User Must Change Password After Reset")
                  }
                ) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { className: "ds-margin-top", title: _34("Maintain a password history for each user (passwordHistory)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 12, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "ds-inline", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                    Checkbox,
                    {
                      id: "create_passwordhistory",
                      isChecked: this.props.create_passwordhistory,
                      onChange: (e, checked) => {
                        this.props.handleChange(e);
                      },
                      label: _34("Keep Password History")
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ds-inline ds-left-margin ds-raise-field-md ds-width-sm", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                      TextInput,
                      {
                        value: this.props.create_passwordinhistory,
                        type: "number",
                        id: "create_passwordinhistory",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "create_passwordinhistory",
                        ...getValidationProps("create_passwordinhistory", this.props.invalidCreateFields),
                        onChange: (e, checked) => {
                          this.props.handleChange(e);
                        }
                      }
                    ),
                    renderValidationError("create_passwordinhistory", this.props.invalidCreateFields)
                  ] })
                ] }) })
              ] })
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
            ExpandableSection,
            {
              className: "ds-margin-top-lg",
              toggleText: this.state.isExpiredExpanded ? _34("Hide Expiration Settings") : _34("Show Expiration Settings"),
              onToggle: (event, isOpen) => this.handleExpiredToggle(event, isOpen),
              isExpanded: this.state.isExpiredExpanded,
              children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ds-margin-left", children: [
                /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { className: "ds-margin-top", title: _34("Enable a password expiration policy (passwordExp)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                  Checkbox,
                  {
                    id: "create_passwordexp",
                    isChecked: this.props.create_passwordexp,
                    onChange: (e, checked) => {
                      this.props.handleChange(e);
                    },
                    label: _34("Enforce Password Expiration")
                  }
                ) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ds-left-indent", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
                    Grid,
                    {
                      title: _34("The maximum age of a password in seconds before it expires (passwordMaxAge)."),
                      className: "ds-margin-top",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 4, children: _34("Password Expiration Time") }),
                        /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                          TextInput,
                          {
                            type: "number",
                            id: "create_passwordmaxage",
                            "aria-describedby": "create_passwordmaxage",
                            name: "create_passwordmaxage",
                            value: this.props.create_passwordmaxage,
                            ...getValidationProps("create_passwordmaxage", this.props.invalidCreateFields),
                            onChange: (e, str) => {
                              this.props.handleChange(e);
                            },
                            isDisabled: !this.props.passwordexp
                          }
                        ) }),
                        renderValidationError("create_passwordmaxage", this.props.invalidCreateFields)
                      ]
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", title: _34("The number of logins that are allowed after the password has expired (passwordGraceLimit)."), children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 4, children: _34("Allowed Logins After Password Expires") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                      TextInput,
                      {
                        type: "number",
                        id: "create_passwordgracelimit",
                        "aria-describedby": "create_passwordgracelimit",
                        name: "create_passwordgracelimit",
                        value: this.props.create_passwordgracelimit,
                        ...getValidationProps("create_passwordgracelimit", this.props.invalidCreateFields),
                        onChange: (e, str) => {
                          this.props.handleChange(e);
                        },
                        isDisabled: !this.props.passwordexp
                      }
                    ) }),
                    renderValidationError("create_passwordgracelimit", this.props.invalidCreateFields)
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", title: _34("Set the time (in seconds), before a password is about to expire, to send a warning. (passwordWarning)."), children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 4, children: _34("Send Password Expiring Warning") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                      TextInput,
                      {
                        type: "number",
                        id: "create_passwordwarning",
                        "aria-describedby": "create_passwordwarning",
                        name: "create_passwordwarning",
                        value: this.props.create_passwordwarning,
                        ...getValidationProps("create_passwordwarning", this.props.invalidCreateFields),
                        onChange: (e, str) => {
                          this.props.handleChange(e);
                        },
                        isDisabled: !this.props.passwordexp
                      }
                    ) }),
                    renderValidationError("create_passwordwarning", this.props.invalidCreateFields)
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { className: "ds-margin-top", title: _34("Always return a password expiring control when requested (passwordSendExpiringTime)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                    Checkbox,
                    {
                      id: "create_passwordsendexpiringtime",
                      isChecked: this.props.create_passwordsendexpiringtime,
                      onChange: (e, checked) => {
                        this.props.handleChange(e);
                      },
                      isDisabled: !this.props.passwordexp,
                      label: _34("Always send Password Expiring Control"),
                      className: "ds-lower-field"
                    }
                  ) }) })
                ] })
              ] })
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
            ExpandableSection,
            {
              className: "ds-margin-top-lg",
              toggleText: this.state.isLockoutExpanded ? _34("Hide Lockout Settings") : _34("Show Lockout Settings"),
              onToggle: (event, isOpen) => this.handleLockoutToggle(event, isOpen),
              isExpanded: this.state.isLockoutExpanded,
              children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ds-margin-left", children: [
                /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { className: "ds-margin-top", title: _34("Enable account lockout (passwordLockout)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                  Checkbox,
                  {
                    id: "create_passwordlockout",
                    isChecked: this.props.create_passwordlockout,
                    onChange: (e, checked) => {
                      this.props.handleChange(e);
                    },
                    label: _34("Enable Account Lockout")
                  }
                ) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ds-left-indent", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", title: _34("The maximum number of failed logins before account gets locked (passwordMaxFailure)."), children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 4, children: _34("Number of Failed Logins That Locks out Account") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                      TextInput,
                      {
                        type: "number",
                        id: "create_passwordmaxfailure",
                        "aria-describedby": "create_passwordmaxfailure",
                        name: "create_passwordmaxfailure",
                        value: this.props.create_passwordmaxfailure,
                        ...getValidationProps("create_passwordmaxfailure", this.props.invalidCreateFields),
                        onChange: (e, str) => {
                          this.props.handleChange(e);
                        },
                        isDisabled: !this.props.passwordlockout
                      }
                    ) }),
                    renderValidationError("create_passwordmaxfailure", this.props.invalidCreateFields)
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", title: _34("The number of seconds until an accounts failure count is reset (passwordResetFailureCount)."), children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 4, children: _34("Time Until Failure Count Resets") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                      TextInput,
                      {
                        type: "number",
                        id: "create_passwordresetfailurecount",
                        "aria-describedby": "create_passwordresetfailurecount",
                        name: "create_passwordresetfailurecount",
                        value: this.props.create_passwordresetfailurecount,
                        ...getValidationProps("create_passwordresetfailurecount", this.props.invalidCreateFields),
                        onChange: (e, str) => {
                          this.props.handleChange(e);
                        },
                        isDisabled: !this.props.passwordlockout
                      }
                    ) }),
                    renderValidationError("create_passwordresetfailurecount", this.props.invalidCreateFields)
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", title: _34("The number of seconds, duration, before the account gets unlocked (passwordLockoutDuration)."), children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 4, children: _34("Time Until Account Unlocked") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                      TextInput,
                      {
                        type: "number",
                        id: "create_passwordlockoutduration",
                        "aria-describedby": "create_passwordlockoutduration",
                        name: "create_passwordlockoutduration",
                        value: this.props.create_passwordlockoutduration,
                        ...getValidationProps("create_passwordlockoutduration", this.props.invalidCreateFields),
                        onChange: (e, str) => {
                          this.props.handleChange(e);
                        },
                        isDisabled: !this.props.passwordlockout
                      }
                    ) }),
                    renderValidationError("create_passwordlockoutduration", this.props.invalidCreateFields)
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { className: "ds-margin-top", title: _34("Do not lockout the user account forever, instead the account will unlock based on the lockout duration (passwordUnlock)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                    Checkbox,
                    {
                      id: "create_passwordunlock",
                      isChecked: this.props.create_passwordunlock,
                      onChange: (e, checked) => {
                        this.props.handleChange(e);
                      },
                      isDisabled: !this.props.passwordlockout,
                      label: _34("Do Not Lockout Account Forever")
                    }
                  ) }) })
                ] })
              ] })
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
            ExpandableSection,
            {
              className: "ds-margin-top-lg",
              toggleText: this.state.isSyntaxExpanded ? _34("Hide Syntax Settings") : _34("Show Syntax Settings"),
              onToggle: (event, isOpen) => this.handleSyntaxToggle(event, isOpen),
              isExpanded: this.state.isSyntaxExpanded,
              children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ds-margin-left", children: [
                /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { title: _34("Enable password syntax checking (passwordCheckSyntax)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                  Checkbox,
                  {
                    id: "create_passwordchecksyntax",
                    isChecked: this.props.create_passwordchecksyntax,
                    onChange: (e, checked) => {
                      this.props.handleChange(e);
                    },
                    label: _34("Enable Password Syntax Checking")
                  }
                ) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ds-left-indent", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Minimum Length") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          title: _34("The minimum number of characters in the password (passwordMinLength)."),
                          type: "number",
                          id: "create_passwordminlength",
                          "aria-describedby": "create_passwordminlength",
                          name: "create_passwordminlength",
                          value: this.props.create_passwordminlength,
                          onChange: (e, str) => {
                            this.props.handleChange(e);
                          },
                          ...getValidationProps("create_passwordminlength", this.props.invalidCreateFields),
                          isDisabled: !this.props.passwordchecksyntax
                        }
                      ),
                      renderValidationError("create_passwordminlength", this.props.invalidCreateFields)
                    ] }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", offset: 6, span: 3, children: _34("Max Repeated Chars") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          title: _34("The maximum number of times the same character can sequentially appear in a password (passwordMaxRepeats)."),
                          type: "number",
                          id: "create_passwordmaxrepeats",
                          "aria-describedby": "create_passwordmaxrepeats",
                          name: "create_passwordmaxrepeats",
                          value: this.props.create_passwordmaxrepeats,
                          onChange: (e, str) => {
                            this.props.handleChange(e);
                          },
                          ...getValidationProps("create_passwordmaxrepeats", this.props.invalidCreateFields),
                          isDisabled: !this.props.passwordchecksyntax
                        }
                      ),
                      renderValidationError("create_passwordmaxrepeats", this.props.invalidCreateFields)
                    ] })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Prohibited Words") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                      TextInput,
                      {
                        title: _34("A space-separated list of words that are not allowed to be contained in the new password (passwordBadWords)."),
                        type: "text",
                        id: "create_passwordbadwords",
                        "aria-describedby": "create_passwordbadwords",
                        name: "create_passwordbadwords",
                        value: this.props.create_passwordbadwords,
                        onChange: (e, str) => {
                          this.props.handleChange(e);
                        },
                        isDisabled: !this.props.passwordchecksyntax
                      }
                    ) })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 3, title: _34("Check the password against the system's CrackLib dictionary (passwordDictCheck)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                    Checkbox,
                    {
                      id: "create_passworddictcheck",
                      isChecked: this.props.create_passworddictcheck,
                      onChange: (e, checked) => {
                        this.props.handleChange(e);
                      },
                      isDisabled: !this.props.passwordchecksyntax,
                      label: _34("Dictionary Check")
                    }
                  ) }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 3, title: _34("Check if the password is a palindrome (passwordPalindrome)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                    Checkbox,
                    {
                      id: "create_passwordpalindrome",
                      isChecked: this.props.create_passwordpalindrome,
                      className: "ds-label",
                      onChange: (e, checked) => {
                        this.props.handleChange(e);
                      },
                      isDisabled: !this.props.passwordchecksyntax,
                      label: _34("Reject Palindromes")
                    }
                  ) }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("hr", {}) }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Minimum Alpha's") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          title: _34("Reject passwords with fewer than this many alpha characters (passwordMinAlphas)."),
                          type: "number",
                          id: "create_passwordminalphas",
                          "aria-describedby": "create_passwordminalphas",
                          name: "create_passwordminalphas",
                          value: this.props.create_passwordminalphas,
                          onChange: (e, str) => {
                            this.props.handleChange(e);
                          },
                          ...getValidationProps("create_passwordminalphas", this.props.invalidCreateFields),
                          isDisabled: !this.props.passwordchecksyntax
                        }
                      ),
                      renderValidationError("create_passwordminalphas", this.props.invalidCreateFields)
                    ] }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", offset: 6, span: 3, children: _34("Minimum Digits") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          title: _34("Reject passwords with fewer than this many digit characters (0-9) (passwordMinDigits)."),
                          type: "number",
                          id: "create_passwordmindigits",
                          "aria-describedby": "create_passwordmindigits",
                          name: "create_passwordmindigits",
                          value: this.props.create_passwordmindigits,
                          onChange: (e, str) => {
                            this.props.handleChange(e);
                          },
                          ...getValidationProps("create_passwordmindigits", this.props.invalidCreateFields),
                          isDisabled: !this.props.passwordchecksyntax
                        }
                      ),
                      renderValidationError("create_passwordmindigits", this.props.invalidCreateFields)
                    ] })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Minimum Uppercase") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          title: _34("Reject passwords with fewer than this many uppercase characters (passwordMinUppers)."),
                          type: "number",
                          id: "create_passwordminuppers",
                          "aria-describedby": "create_passwordminuppers",
                          name: "create_passwordminuppers",
                          value: this.props.create_passwordminuppers,
                          onChange: (e, str) => {
                            this.props.handleChange(e);
                          },
                          ...getValidationProps("create_passwordminuppers", this.props.invalidCreateFields),
                          isDisabled: !this.props.passwordchecksyntax
                        }
                      ),
                      renderValidationError("create_passwordminuppers", this.props.invalidCreateFields)
                    ] }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", offset: 6, span: 3, children: _34("Minimum Lowercase") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          title: _34("Reject passwords with fewer than this many lowercase characters (passwordMinLowers)."),
                          type: "number",
                          id: "create_passwordminlowers",
                          "aria-describedby": "create_passwordminlowers",
                          name: "create_passwordminlowers",
                          value: this.props.create_passwordminlowers,
                          onChange: (e, str) => {
                            this.props.handleChange(e);
                          },
                          ...getValidationProps("create_passwordminlowers", this.props.invalidCreateFields),
                          isDisabled: !this.props.passwordchecksyntax
                        }
                      ),
                      renderValidationError("create_passwordminlowers", this.props.invalidCreateFields)
                    ] })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Minimum Special") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          title: _34("Reject passwords with fewer than this many special non-alphanumeric characters (passwordMinSpecials)."),
                          type: "number",
                          id: "create_passwordminspecials",
                          "aria-describedby": "create_passwordminspecials",
                          name: "create_passwordminspecials",
                          value: this.props.create_passwordminspecials,
                          onChange: (e, str) => {
                            this.props.handleChange(e);
                          },
                          ...getValidationProps("create_passwordminspecials", this.props.invalidCreateFields),
                          isDisabled: !this.props.passwordchecksyntax
                        }
                      ),
                      renderValidationError("create_passwordminspecials", this.props.invalidCreateFields)
                    ] }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", offset: 6, span: 3, children: _34("Minimum 8-bit") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          title: _34("Reject passwords with fewer than this many 8-bit or multi-byte characters (passwordMin8Bit)."),
                          type: "number",
                          id: "create_passwordmin8bit",
                          "aria-describedby": "create_passwordmin8bit",
                          name: "create_passwordmin8bit",
                          value: this.props.create_passwordmin8bit,
                          onChange: (e, str) => {
                            this.props.handleChange(e);
                          },
                          ...getValidationProps("create_passwordmin8bit", this.props.invalidCreateFields),
                          isDisabled: !this.props.passwordchecksyntax
                        }
                      ),
                      renderValidationError("create_passwordmin8bit", this.props.invalidCreateFields)
                    ] })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Minimum Categories") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          title: _34("The minimum number of character categories that a password must contain (categories are upper, lower, digit, special, and 8-bit) (passwordMinCategories)."),
                          type: "number",
                          id: "create_passwordmincategories",
                          "aria-describedby": "create_passwordmincategories",
                          name: "create_passwordmincategories",
                          value: this.props.create_passwordmincategories,
                          onChange: (e, str) => {
                            this.props.handleChange(e);
                          },
                          ...getValidationProps("create_passwordmincategories", this.props.invalidCreateFields),
                          isDisabled: !this.props.passwordchecksyntax
                        }
                      ),
                      renderValidationError("create_passwordmincategories", this.props.invalidCreateFields)
                    ] })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("hr", {}) }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Maximum Sequences") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          title: _34("The maximum number of allowed monotonic characters sequences (passwordMaxSequence)."),
                          type: "number",
                          id: "create_passwordmaxsequence",
                          "aria-describedby": "create_passwordmaxsequence",
                          name: "create_passwordmaxsequence",
                          value: this.props.create_passwordmaxsequence,
                          ...getValidationProps("create_passwordmaxsequence", this.props.invalidCreateFields),
                          onChange: (e, str) => {
                            this.props.handleChange(e);
                          },
                          isDisabled: !this.props.passwordchecksyntax
                        }
                      ),
                      renderValidationError("create_passwordmaxsequence", this.props.invalidCreateFields)
                    ] }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", offset: 6, span: 3, children: _34("Max Sequence Sets") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          title: _34("The maximum number of allowed monotonic characters sequences that can appear more than once (passwordMaxSeqSets)."),
                          type: "number",
                          id: "create_passwordmaxseqsets",
                          "aria-describedby": "create_passwordmaxseqsets",
                          name: "create_passwordmaxseqsets",
                          value: this.props.create_passwordmaxseqsets,
                          ...getValidationProps("create_passwordmaxseqsets", this.props.invalidCreateFields),
                          onChange: (e, str) => {
                            this.props.handleChange(e);
                          },
                          isDisabled: !this.props.passwordchecksyntax
                        }
                      ),
                      renderValidationError("create_passwordmaxseqsets", this.props.invalidCreateFields)
                    ] })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Max Seq Per Class") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          title: _34("The maximum number of consecutive characters from the same character class/category (passwordMaxClassChars)."),
                          type: "number",
                          id: "create_passwordmaxclasschars",
                          "aria-describedby": "create_passwordmaxclasschars",
                          name: "create_passwordmaxclasschars",
                          value: this.props.create_passwordmaxclasschars,
                          ...getValidationProps("create_passwordmaxclasschars", this.props.invalidCreateFields),
                          onChange: (e, str) => {
                            this.props.handleChange(e);
                          },
                          isDisabled: !this.props.passwordchecksyntax
                        }
                      ),
                      renderValidationError("create_passwordmaxclasschars", this.props.invalidCreateFields)
                    ] })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("hr", {}) }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { title: _34("A list of entry attributes to compare to the new password (passwordUserAttributes)."), children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Check User Attributes") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                      dsBasicComponents_default,
                      {
                        selected: this.props.passworduserattributes,
                        onSelect: this.props.handleChange,
                        onClear: this.props.onUserAttrsCreateClear,
                        options: this.props.attrs,
                        isOpen: this.props.isUserAttrsCreateOpen,
                        onToggle: this.props.onUserAttrsCreateToggle,
                        placeholder: _34("Type attributes to check..."),
                        noResultsText: _34("There are no matching entries"),
                        ariaLabel: "Type an attribute to check",
                        isMulti: true,
                        isDisabled: !this.props.passwordchecksyntax
                      }
                    ) })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", title: _34("The smallest attribute value used when checking if the password contains any of the user's attributes that are set via passwordUserAttributes (passwordMinTokenLength)."), children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Minimum Token Length") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          type: "number",
                          id: "create_passwordmintokenlength",
                          "aria-describedby": "create_passwordmintokenlength",
                          name: "create_passwordmintokenlength",
                          value: this.props.create_passwordmintokenlength,
                          onChange: (e, str) => {
                            this.props.handleChange(e);
                          },
                          ...getValidationProps("create_passwordmintokenlength", this.props.invalidCreateFields),
                          isDisabled: !this.props.passwordchecksyntax
                        }
                      ),
                      renderValidationError("create_passwordmintokenlength", this.props.invalidCreateFields)
                    ] })
                  ] })
                ] })
              ] })
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
            ExpandableSection,
            {
              className: "ds-margin-top-lg",
              toggleText: this.state.isTPRExpanded ? _34("Hide Temporary Password Settings") : _34("Show Temporary Password Settings"),
              onToggle: (event, isOpen) => this.handleTPRToggle(event, isOpen),
              isExpanded: this.state.isTPRExpanded,
              children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ds-margin-left", children: [
                this.props.create_passwordmustchange === false && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FormAlert, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                  Alert,
                  {
                    variant: "info",
                    title: _34('"User Must Change Password After Reset" must be enabled in General Settings to activate TPR.'),
                    "aria-live": "polite",
                    isInline: true
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
                  Grid,
                  {
                    title: _34("Number of times the temporary password can be used to authenticate (passwordTPRMaxUse)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Password Max Use") }),
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          type: "number",
                          id: "create_passwordtprmaxuse",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "create_passwordtprmaxuse",
                          value: this.props.create_passwordtprmaxuse,
                          isDisabled: !this.props.create_passwordmustchange,
                          onChange: (e, checked) => {
                            this.props.handleChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
                  Grid,
                  {
                    title: _34("Number of seconds before the temporary password expires (passwordTPRDelayExpireAt)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Password Expires In") }),
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          type: "number",
                          id: "create_passwordtprdelayexpireat",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "create_passwordtprdelayexpireat",
                          value: this.props.create_passwordtprdelayexpireat,
                          isDisabled: !this.props.create_passwordmustchange,
                          onChange: (e, checked) => {
                            this.props.handleChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
                  Grid,
                  {
                    title: _34("Number of seconds after which temporary password starts to be valid for authentication (passwordTPRDelayValidFrom)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Password Valid From") }),
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          type: "number",
                          id: "create_passwordtprdelayvalidfrom",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "create_passwordtprdelayvalidfrom",
                          value: this.props.create_passwordtprdelayvalidfrom,
                          isDisabled: !this.props.create_passwordmustchange,
                          onChange: (e, checked) => {
                            this.props.handleChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                )
              ] })
            }
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
          Button,
          {
            isDisabled: this.props.createDisabled,
            variant: "primary",
            className: "ds-margin-top-lg ds-margin-left",
            onClick: this.props.handleCreatePolicy,
            children: _34("Create New Policy")
          }
        )
      ] });
    }
  };
  var LocalPwPolicy = class extends import_react55.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: true,
        loaded: false,
        activeTabKey: 0,
        localActiveTabKey: 0,
        modalChecked: false,
        editPolicy: false,
        tableLoading: false,
        // Create policy
        policyType: "",
        policyDN: "",
        policyName: "",
        deleteName: "",
        createDisabled: true,
        createPolicyType: "Subtree Policy",
        // Lists of all the attributes for each tab/section.
        // We use the exact attribute name for the ID of
        // each field, so we can loop over them to efficently
        // check for changes, and updating/saving the config.
        rows: [],
        saveGeneralDisabled: true,
        saveUserDisabled: true,
        saveExpDisabled: true,
        saveLockoutDisabled: true,
        saveSyntaxDisabled: true,
        saveTPRDisabled: true,
        showDeletePolicy: false,
        // Edit policy
        passwordchange: false,
        passwordmustchange: false,
        passwordhistory: false,
        passwordtrackupdatetime: false,
        passwordexp: false,
        passwordsendexpiringtime: false,
        passwordlockout: false,
        passwordunlock: "0",
        passwordchecksyntax: false,
        passwordpalindrome: false,
        passworddictcheck: false,
        passwordstoragescheme: "",
        passwordinhistory: "0",
        passwordwarning: "0",
        passwordmaxage: "0",
        passwordminage: "0",
        passwordgracelimit: "0",
        passwordlockoutduration: "0",
        passwordmaxfailure: "0",
        passwordresetfailurecount: "0",
        passwordminlength: "0",
        passwordmindigits: "0",
        passwordminalphas: "0",
        passwordminuppers: "0",
        passwordminlowers: "0",
        passwordminspecials: "0",
        passwordmin8bit: "0",
        passwordmaxrepeats: "0",
        passwordmaxsequence: "0",
        passwordmaxseqsets: "0",
        passwordmaxclasschars: "0",
        passwordmincategories: "0",
        passwordmintokenlength: "0",
        passwordbadwords: "",
        passworduserattributes: [],
        passwordtprmaxuse: "-1",
        passwordtprdelayexpireat: "-1",
        passwordtprdelayvalidfrom: "-1",
        passwordadmindn: "",
        passwordadminskipinfoupdate: false,
        _passwordchange: false,
        _passwordmustchange: false,
        _passwordhistory: false,
        _passwordtrackupdatetime: false,
        _passwordexp: false,
        _passwordsendexpiringtime: false,
        _passwordlockout: false,
        _passwordunlock: "0",
        _passwordchecksyntax: false,
        _passwordpalindrome: false,
        _passworddictcheck: false,
        _passwordstoragescheme: "",
        _passwordinhistory: "0",
        _passwordwarning: "0",
        _passwordmaxage: "0",
        _passwordminage: "0",
        _passwordgracelimit: "0",
        _passwordlockoutduration: "0",
        _passwordmaxfailure: "0",
        _passwordresetfailurecount: "0",
        _passwordminlength: "0",
        _passwordmindigits: "0",
        _passwordminalphas: "0",
        _passwordminuppers: "0",
        _passwordminlowers: "0",
        _passwordminspecials: "0",
        _passwordmin8bit: "0",
        _passwordmaxrepeats: "0",
        _passwordmaxsequence: "0",
        _passwordmaxseqsets: "0",
        _passwordmaxclasschars: "0",
        _passwordmincategories: "0",
        _passwordmintokenlength: "0",
        _passwordbadwords: "",
        _passworduserattributes: [],
        _passwordtprmaxuse: "-1",
        _passwordtprdelayexpireat: "-1",
        _passwordtprdelayvalidfrom: "-1",
        _passwordadmindn: "",
        _passwordadminskipinfoupdate: false,
        // Create policy
        create_passwordchange: false,
        create_passwordmustchange: false,
        create_passwordhistory: false,
        create_passwordtrackupdatetime: false,
        create_passwordexp: false,
        create_passwordsendexpiringtime: false,
        create_passwordlockout: false,
        create_passwordunlock: false,
        create_passwordchecksyntax: false,
        create_passwordpalindrome: false,
        create_passworddictcheck: false,
        create_passwordstoragescheme: "",
        create_passwordinhistory: "0",
        create_passwordwarning: "0",
        create_passwordmaxage: "0",
        create_passwordminage: "0",
        create_passwordgracelimit: "0",
        create_passwordlockoutduration: "0",
        create_passwordmaxfailure: "0",
        create_passwordresetfailurecount: "0",
        create_passwordminlength: "0",
        create_passwordmindigits: "0",
        create_passwordminalphas: "0",
        create_passwordminuppers: "0",
        create_passwordminlowers: "0",
        create_passwordminspecials: "0",
        create_passwordmin8bit: "0",
        create_passwordmaxrepeats: "0",
        create_passwordmaxsequence: "0",
        create_passwordmaxseqsets: "0",
        create_passwordmaxclasschars: "0",
        create_passwordmincategories: "0",
        create_passwordmintokenlength: "0",
        create_passwordbadwords: "",
        create_passworduserattributes: [],
        create_passwordtprmaxuse: "-1",
        create_passwordtprdelayexpireat: "-1",
        create_passwordtprdelayvalidfrom: "-1",
        create_passwordadmindn: "",
        create_passwordadminskipinfoupdate: false,
        _create_passwordchange: false,
        _create_passwordmustchange: false,
        _create_passwordhistory: false,
        _create_passwordtrackupdatetime: false,
        _create_passwordexp: false,
        _create_passwordsendexpiringtime: false,
        _create_passwordlockout: false,
        _create_passwordunlock: false,
        _create_passwordchecksyntax: false,
        _create_passwordpalindrome: false,
        _create_passworddictcheck: false,
        _create_passwordstoragescheme: "",
        _create_passwordinhistory: "0",
        _create_passwordwarning: "0",
        _create_passwordmaxage: "0",
        _create_passwordminage: "0",
        _create_passwordgracelimit: "0",
        _create_passwordlockoutduration: "0",
        _create_passwordmaxfailure: "0",
        _create_passwordresetfailurecount: "0",
        _create_passwordminlength: "0",
        _create_passwordmindigits: "0",
        _create_passwordminalphas: "0",
        _create_passwordminuppers: "0",
        _create_passwordminlowers: "0",
        _create_passwordminspecials: "0",
        _create_passwordmin8bit: "0",
        _create_passwordmaxrepeats: "0",
        _create_passwordmaxsequence: "0",
        _create_passwordmaxseqsets: "0",
        _create_passwordmaxclasschars: "0",
        _create_passwordmincategories: "0",
        _create_passwordmintokenlength: "0",
        _create_passwordbadwords: "",
        _create_passworduserattributes: [],
        _create_passwordtprmaxuse: "-1",
        _create_passwordtprdelayexpireat: "-1",
        _create_passwordtprdelayvalidfrom: "-1",
        _create_passwordadmindn: "",
        _create_passwordadminskipinfoupdate: false,
        // Validation
        invalidFields: {},
        invalidCreateFields: {},
        // Select typeahead
        isUserAttrsCreateOpen: false,
        isUserAttrsEditOpen: false,
        attrMap: {
          passwordstoragescheme: "--pwdscheme",
          passwordtrackupdatetime: "--pwdtrack",
          passwordchange: "--pwdchange",
          passwordmustchange: "--pwdmustchange",
          passwordhistory: "--pwdhistory",
          passwordinhistory: "--pwdhistorycount",
          passwordminage: "--pwdminage",
          passwordexp: "--pwdexpire",
          passwordgracelimit: "--pwdgracelimit",
          passwordsendexpiringtime: "--pwdsendexpiring",
          passwordmaxage: "--pwdmaxage",
          passwordwarning: "--pwdwarning",
          passwordlockout: "--pwdlockout",
          passwordunlock: "--pwdunlock",
          passwordlockoutduration: "--pwdlockoutduration",
          passwordmaxfailure: "--pwdmaxfailures",
          passwordresetfailurecount: "--pwdresetfailcount",
          passwordchecksyntax: "--pwdchecksyntax",
          passwordminlength: "--pwdminlen",
          passwordmindigits: "--pwdmindigits",
          passwordminalphas: "--pwdminalphas",
          passwordminuppers: "--pwdminuppers",
          passwordminlowers: "--pwdminlowers",
          passwordminspecials: "--pwdminspecials",
          passwordmin8bit: "--pwdmin8bits",
          passwordmaxrepeats: "--pwdmaxrepeats",
          passwordpalindrome: "--pwdpalindrome",
          passwordmaxsequence: "--pwdmaxseq",
          passwordmaxseqsets: "--pwdmaxseqsets",
          passwordmaxclasschars: "--pwdmaxclasschars",
          passwordmincategories: "--pwdmincatagories",
          passwordmintokenlength: "--pwdmintokenlen",
          passwordbadwords: "--pwdbadwords",
          passworduserattributes: "--pwduserattrs",
          passworddictcheck: "--pwddictcheck",
          passwordadmindn: "--pwdadmin",
          passwordadminskipinfoupdate: "--pwdadminskipupdates",
          passwordtprmaxuse: "--pwptprmaxuse",
          passwordtprdelayexpireat: "--pwptprdelayexpireat",
          passwordtprdelayvalidfrom: "--pwptprdelayvalidfrom"
        }
      };
      this.unknownPolicyType = "Unknown policy type";
      this.handleUserAttrsCreateToggle = (_event, isUserAttrsCreateOpen) => {
        this.setState({
          isUserAttrsCreateOpen
        });
      };
      this.handleUserAttrsCreateClear = () => {
        this.setState({
          create_passworduserattributes: [],
          isUserAttrsCreateOpen: false
        });
      };
      this.onUserAttrsEditToggle = (isUserAttrsEditOpen) => {
        this.setState({
          isUserAttrsEditOpen
        });
      };
      this.onUserAttrsEditClear = () => {
        this.setState({
          passworduserattributes: [],
          isUserAttrsEditOpen: false
        });
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleLocalNavSelect = (event, tabIndex) => {
        this.setState({
          localActiveTabKey: tabIndex
        });
      };
      this.handleSelectToggle = (_event, isSelectOpen) => {
        this.setState({
          isSelectOpen
        });
      };
      this.handleSelectClear = () => {
        this.setState({
          passworduserattributes: []
        });
      };
      this.createPolicy = this.createPolicy.bind(this);
      this.closeDeletePolicy = this.closeDeletePolicy.bind(this);
      this.deletePolicy = this.deletePolicy.bind(this);
      this.onCreateChange = this.onCreateChange.bind(this);
      this.onCreateSelectChange = this.onCreateSelectChange.bind(this);
      this.handleExpChange = this.handleExpChange.bind(this);
      this.handleGeneralChange = this.handleGeneralChange.bind(this);
      this.handleLockoutChange = this.handleLockoutChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.handleSyntaxChange = this.handleSyntaxChange.bind(this);
      this.handleTPRChange = this.handleTPRChange.bind(this);
      this.loadLocal = this.loadLocal.bind(this);
      this.handleLoadPolicies = this.handleLoadPolicies.bind(this);
      this.handleResetTab = this.handleResetTab.bind(this);
      this.handleSaveExp = this.handleSaveExp.bind(this);
      this.handleSaveGeneral = this.handleSaveGeneral.bind(this);
      this.handleSaveLockout = this.handleSaveLockout.bind(this);
      this.handleSaveSyntax = this.handleSaveSyntax.bind(this);
      this.handleSaveTPR = this.handleSaveTPR.bind(this);
      this.showDeletePolicy = this.showDeletePolicy.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.handleLoadPolicies();
      } else {
        this.props.enableTree();
      }
    }
    showDeletePolicy(name2) {
      this.setState({
        showDeletePolicy: true,
        modalChecked: false,
        deleteName: name2
      });
    }
    closeDeletePolicy() {
      this.setState({
        showDeletePolicy: false,
        deleteName: ""
      });
    }
    handleResetTab() {
      this.setState({ localActiveTabKey: 0 });
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      });
    }
    onCreateSelectChange(_event, value) {
      this.setState({
        createPolicyType: value
      });
    }
    onCreateChange(e, selection) {
      let attr;
      let value;
      let disableSaveBtn = true;
      let invalid_dn = false;
      const all_attrs = general_attrs2.concat(exp_attrs2, lockout_attrs2, syntax_attrs2, tpr_attrs2);
      if (selection) {
        attr = "create_passworduserattributes";
        value = selection;
      } else {
        value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
        attr = e.target.id;
      }
      for (const all_attr of all_attrs) {
        if (all_attr === "passworduserattributes" && attr === "create_passworduserattributes") {
          const orig_val = this.state["_" + all_attr].join(" ");
          if (orig_val !== value) {
            value = selection;
            disableSaveBtn = false;
            break;
          }
          value = selection;
        } else if (attr === "create_" + all_attr && this.state["_create_" + all_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const all_attr of all_attrs) {
        if (all_attr === "passworduserattributes" && attr !== "create_passworduserattributes") {
          const orig_val = this.state["_" + all_attr].join(" ");
          const new_val = this.state[all_attr].join(" ");
          if (orig_val !== new_val) {
            disableSaveBtn = false;
            break;
          }
        } else if (attr !== "create_" + all_attr && this.state["_create_" + all_attr] !== this.state["create_" + all_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      if (attr === "policyDN") {
        if (valid_dn(value)) {
          disableSaveBtn = false;
        } else {
          if (value !== "") {
            invalid_dn = true;
          }
          disableSaveBtn = true;
        }
      } else {
        if (this.state.policyDN === "") {
          disableSaveBtn = true;
        } else {
          disableSaveBtn = false;
        }
      }
      const newInvalidCreateFields = updateFieldValidation(this.state.invalidCreateFields, attr, value);
      if (newInvalidCreateFields[attr]) {
        disableSaveBtn = true;
      }
      if (selection) {
        this.setState({
          [attr]: Array.isArray(selection) ? selection : [],
          createDisabled: disableSaveBtn,
          invalid_dn,
          invalidCreateFields: newInvalidCreateFields,
          isUserAttrsCreateOpen: false
        });
      } else {
        this.setState({
          [attr]: value,
          createDisabled: disableSaveBtn,
          invalid_dn,
          invalidCreateFields: newInvalidCreateFields
        });
      }
    }
    createPolicy() {
      const all_attrs = general_attrs2.concat(exp_attrs2, lockout_attrs2, syntax_attrs2, tpr_attrs2);
      let action = "adduser";
      this.setState({
        loading: true
      });
      if (this.state.createPolicyType === "Subtree Policy") {
        action = "addsubtree";
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        action,
        this.state.policyDN
      ];
      for (const attr of all_attrs) {
        let old_val = this.state["_create_" + attr];
        let new_val = this.state["create_" + attr];
        if (new_val !== old_val) {
          if (typeof new_val === "boolean") {
            if (new_val) {
              new_val = "on";
            } else {
              new_val = "off";
            }
          } else if (attr === "passworduserattributes") {
            old_val = this.state._create_passworduserattributes.join(" ");
            new_val = this.state.create_passworduserattributes.join(" ");
            if (old_val === new_val) {
              continue;
            }
          }
          cmd.push(this.state.attrMap[attr] + "=" + new_val);
        }
      }
      log_cmd("createPolicy", "Create a local password policy", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadPolicies();
        this.setState({
          loading: false
        });
        let message;
        let type = "success";
        const response = JSON.parse(content);
        if (response) {
          switch (response.ensure_status) {
            case "UNCHANGED":
              message = _34("Password policy is already up to date");
              break;
            case "UPDATED":
              message = _34("Successfully updated password policy");
              break;
            case "ADDED":
              message = _34("Successfully created new password policy");
              break;
            default:
              message = _34("Unknown password policy operation");
              type = "error";
              break;
          }
        }
        this.props.addNotification(type, message);
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.handleLoadPolicies();
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_34("Error creating password policy - $0"), errMsg)
        );
      });
    }
    handleGeneralChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const general_attr of general_attrs2) {
        if (attr === general_attr && this.state["_" + general_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const general_attr of general_attrs2) {
        if (attr !== general_attr && this.state["_" + general_attr] !== this.state[general_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        saveGeneralDisabled: disableSaveBtn,
        invalidFields: updateFieldValidation(this.state.invalidFields, attr, value)
      });
    }
    handleSaveGeneral() {
      this.setState({
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        "set",
        this.state.policyName
      ];
      for (const attr of general_attrs2) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(this.state.attrMap[attr] + "=" + val);
        }
      }
      log_cmd("handleSaveGeneral", "Saving general pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.loadLocal(this.state.policyName);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "success",
          _34("Successfully updated password policy configuration")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.loadLocal(this.state.policyName);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_34("Error updating password policy configuration - $0"), errMsg)
        );
      });
    }
    handleExpChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const exp_attr of exp_attrs2) {
        if (attr === exp_attr && this.state["_" + exp_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const exp_attr of exp_attrs2) {
        if (attr !== exp_attr && this.state["_" + exp_attr] !== this.state[exp_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        saveExpDisabled: disableSaveBtn,
        invalidFields: updateFieldValidation(this.state.invalidFields, attr, value)
      });
    }
    handleSaveExp() {
      this.setState({
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        "set",
        this.state.policyName
      ];
      for (const attr of exp_attrs2) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(this.state.attrMap[attr] + "=" + val);
        }
      }
      log_cmd("handleSaveExp", "Saving Expiration pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.loadLocal(this.state.policyName);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "success",
          _34("Successfully updated password policy configuration")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.loadLocal(this.state.policyName);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_34("Error updating password policy configuration - $0"), errMsg)
        );
      });
    }
    handleLockoutChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const lockout_attr of lockout_attrs2) {
        if (attr === lockout_attr && this.state["_" + lockout_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const lockout_attr of lockout_attrs2) {
        if (attr !== lockout_attr && this.state["_" + lockout_attr] !== this.state[lockout_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        saveLockoutDisabled: disableSaveBtn,
        invalidFields: updateFieldValidation(this.state.invalidFields, attr, value)
      });
    }
    handleSaveLockout() {
      this.setState({
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        "set",
        this.state.policyName
      ];
      for (const attr of lockout_attrs2) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(this.state.attrMap[attr] + "=" + val);
        }
      }
      log_cmd("handleSaveLockout", "Saving lockout pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.loadLocal(this.state.policyName);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "success",
          _34("Successfully updated password policy configuration")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.loadLocal(this.state.policyName);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_34("Error updating password policy configuration - $0"), errMsg)
        );
      });
    }
    handleSyntaxChange(e, selection) {
      let attr;
      let value;
      if (selection) {
        attr = "passworduserattributes";
        value = selection;
      } else {
        value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
        attr = e.target.id;
      }
      let disableSaveBtn = true;
      for (const syntax_attr of syntax_attrs2) {
        if (syntax_attr === "passworduserattributes" && attr === "passworduserattributes") {
          const orig_val = this.state["_" + syntax_attr].join(" ");
          if (orig_val !== value) {
            value = selection;
            disableSaveBtn = false;
            break;
          }
          value = selection;
        } else if (attr === syntax_attr && this.state["_" + syntax_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const syntax_attr of syntax_attrs2) {
        if (syntax_attr === "passworduserattributes" && attr !== "passworduserattributes") {
          const orig_val = this.state["_" + syntax_attr].join(" ");
          const new_val = this.state[syntax_attr].join(" ");
          if (orig_val !== new_val) {
            disableSaveBtn = false;
            break;
          }
        } else if (attr !== syntax_attr && this.state["_" + syntax_attr] !== this.state[syntax_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      if (selection) {
        this.setState({
          [attr]: Array.isArray(selection) ? selection : [],
          saveSyntaxDisabled: disableSaveBtn,
          invalidFields: updateFieldValidation(this.state.invalidFields, attr, value),
          isUserAttrsEditOpen: false
        });
      } else {
        this.setState({
          [attr]: value,
          saveSyntaxDisabled: disableSaveBtn,
          invalidFields: updateFieldValidation(this.state.invalidFields, attr, value),
          isUserAttrsEditOpen: false
        });
      }
    }
    handleSaveSyntax() {
      this.setState({
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        "set",
        this.state.policyName
      ];
      for (const attr of syntax_attrs2) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(this.state.attrMap[attr] + "=" + val);
        }
      }
      log_cmd("handleSaveSyntax", "Saving syntax checking pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.loadLocal(this.state.policyName);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "success",
          _34("Successfully updated password policy configuration")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.loadLocal(this.state.policyName);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_34("Error updating password policy configuration - $0"), errMsg)
        );
      });
    }
    handleTPRChange(e) {
      const value = e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const tpr_attr of tpr_attrs2) {
        if (attr === tpr_attr && this.state["_" + tpr_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const tpr_attr of tpr_attrs2) {
        if (attr !== tpr_attr && this.state["_" + tpr_attr] !== this.state[tpr_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        saveTPRDisabled: disableSaveBtn
      });
    }
    handleSaveTPR() {
      this.setState({
        saving: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        "set",
        this.state.policyName
      ];
      for (const attr of tpr_attrs2) {
        if (this.state["_" + attr] !== this.state[attr]) {
          const val = this.state[attr];
          cmd.push(this.state.attrMap[attr] + "=" + val);
        }
      }
      log_cmd("handleSaveTPR", "Saving TPR pwpolicy settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.loadLocal(this.state.policyName);
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "success",
          _34("Successfully updated password policy configuration")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.loadLocal(this.state.policyName);
        this.setState({
          saving: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_34("Error updating password policy configuration - $0"), errMsg)
        );
      });
    }
    deletePolicy() {
      this.setState({
        loading: true,
        editPolicy: false
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        "remove",
        this.state.deleteName
      ];
      log_cmd("deletePolicy", "delete policy", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadPolicies();
        this.props.addNotification(
          "success",
          "Successfully deleted password policy"
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.handleLoadPolicies();
        this.props.addNotification(
          "error",
          cockpit_default.format(_34("Error deleting local password policy - $0"), errMsg)
        );
      });
    }
    handleLoadPolicies() {
      this.setState({
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        "list"
      ];
      log_cmd("handleLoadPolicies", "Load all the local password policies for the table", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const policy_obj = JSON.parse(content);
        const pwpRows = [];
        for (const row of policy_obj.items) {
          let { basedn } = row;
          if (row.pwp_type === this.unknownPolicyType) {
            basedn = row.dn;
          }
          pwpRows.push([row.targetdn, row.pwp_type, basedn]);
        }
        this.setState({
          localActiveTabKey: 0,
          activeKey: 0,
          rows: pwpRows,
          loaded: true,
          loading: false,
          editPolicy: false,
          policyDN: "",
          createPolicyType: "Subtree Policy",
          policyName: "",
          deleteName: "",
          showDeletePolicy: false,
          invalidFields: {},
          invalidCreateFields: {},
          // Reset edit and create tab
          saveGeneralDisabled: true,
          saveUserDisabled: true,
          saveExpDisabled: true,
          saveLockoutDisabled: true,
          saveSyntaxDisabled: true,
          // Edit policy
          passwordchange: false,
          passwordmustchange: false,
          passwordhistory: false,
          passwordtrackupdatetime: false,
          passwordexp: false,
          passwordsendexpiringtime: false,
          passwordlockout: false,
          passwordunlock: "0",
          passwordchecksyntax: false,
          passwordpalindrome: false,
          passworddictcheck: false,
          passwordstoragescheme: "",
          passwordinhistory: "0",
          passwordwarning: "0",
          passwordmaxage: "0",
          passwordminage: "0",
          passwordgracelimit: "0",
          passwordlockoutduration: "0",
          passwordmaxfailure: "0",
          passwordresetfailurecount: "0",
          passwordminlength: "0",
          passwordmindigits: "0",
          passwordminalphas: "0",
          passwordminuppers: "0",
          passwordminlowers: "0",
          passwordminspecials: "0",
          passwordmin8bit: "0",
          passwordmaxrepeats: "0",
          passwordmaxsequence: "0",
          passwordmaxseqsets: "0",
          passwordmaxclasschars: "0",
          passwordmincategories: "0",
          passwordmintokenlength: "0",
          passwordbadwords: "",
          passworduserattributes: [],
          passwordadmindn: "",
          passwordadminskipinfoupdate: false,
          _passwordchange: false,
          _passwordmustchange: false,
          _passwordhistory: false,
          _passwordtrackupdatetime: false,
          _passwordexp: false,
          _passwordsendexpiringtime: false,
          _passwordlockout: false,
          _passwordunlock: "0",
          _passwordchecksyntax: false,
          _passwordpalindrome: false,
          _passworddictcheck: false,
          _passwordstoragescheme: "",
          _passwordinhistory: "0",
          _passwordwarning: "0",
          _passwordmaxage: "0",
          _passwordminage: "0",
          _passwordgracelimit: "0",
          _passwordlockoutduration: "0",
          _passwordmaxfailure: "0",
          _passwordresetfailurecount: "0",
          _passwordminlength: "0",
          _passwordmindigits: "0",
          _passwordminalphas: "0",
          _passwordminuppers: "0",
          _passwordminlowers: "0",
          _passwordminspecials: "0",
          _passwordmin8bit: "0",
          _passwordmaxrepeats: "0",
          _passwordmaxsequence: "0",
          _passwordmaxseqsets: "0",
          _passwordmaxclasschars: "0",
          _passwordmincategories: "0",
          _passwordmintokenlength: "0",
          _passwordbadwords: "",
          _passworduserattributes: [],
          _passwordadmindn: "",
          _passwordadminskipinfoupdate: false,
          // Create policy
          create_passwordchange: false,
          create_passwordmustchange: false,
          create_passwordhistory: false,
          create_passwordtrackupdatetime: false,
          create_passwordexp: false,
          create_passwordsendexpiringtime: false,
          create_passwordlockout: false,
          create_passwordunlock: false,
          create_passwordchecksyntax: false,
          create_passwordpalindrome: false,
          create_passworddictcheck: false,
          create_passwordstoragescheme: "",
          create_passwordinhistory: "0",
          create_passwordwarning: "0",
          create_passwordmaxage: "0",
          create_passwordminage: "0",
          create_passwordgracelimit: "0",
          create_passwordlockoutduration: "0",
          create_passwordmaxfailure: "0",
          create_passwordresetfailurecount: "0",
          create_passwordminlength: "0",
          create_passwordmindigits: "0",
          create_passwordminalphas: "0",
          create_passwordminuppers: "0",
          create_passwordminlowers: "0",
          create_passwordminspecials: "0",
          create_passwordmin8bit: "0",
          create_passwordmaxrepeats: "0",
          create_passwordmaxsequence: "0",
          create_passwordmaxseqsets: "0",
          create_passwordmaxclasschars: "0",
          create_passwordmincategories: "0",
          create_passwordmintokenlength: "0",
          create_passwordbadwords: "",
          create_passworduserattributes: [],
          create_passwordadmindn: "",
          create_passwordadminskipinfoupdate: false,
          _create_passwordchange: false,
          _create_passwordmustchange: false,
          _create_passwordhistory: false,
          _create_passwordtrackupdatetime: false,
          _create_passwordexp: false,
          _create_passwordsendexpiringtime: false,
          _create_passwordlockout: false,
          _create_passwordunlock: false,
          _create_passwordchecksyntax: false,
          _create_passwordpalindrome: false,
          _create_passworddictcheck: false,
          _create_passwordstoragescheme: "",
          _create_passwordinhistory: "0",
          _create_passwordwarning: "0",
          _create_passwordmaxage: "0",
          _create_passwordminage: "0",
          _create_passwordgracelimit: "0",
          _create_passwordlockoutduration: "0",
          _create_passwordmaxfailure: "0",
          _create_passwordresetfailurecount: "0",
          _create_passwordminlength: "0",
          _create_passwordmindigits: "0",
          _create_passwordminalphas: "0",
          _create_passwordminuppers: "0",
          _create_passwordminlowers: "0",
          _create_passwordminspecials: "0",
          _create_passwordmin8bit: "0",
          _create_passwordmaxrepeats: "0",
          _create_passwordmaxsequence: "0",
          _create_passwordmaxseqsets: "0",
          _create_passwordmaxclasschars: "0",
          _create_passwordmincategories: "0",
          _create_passwordmintokenlength: "0",
          _create_passwordbadwords: "",
          _create_passworduserattributes: [],
          _create_passwordadmindn: "",
          _create_passwordadminskipinfoupdate: false
        }, () => {
          const gcmd = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "config",
            "get",
            "passwordstoragescheme"
          ];
          log_cmd("handleLoadPolicies", "Load global password policy password scheme", gcmd);
          cockpit_default.spawn(gcmd, { superuser: true, err: "message" }).done((content2) => {
            const config = JSON.parse(content2);
            const attrs = config.attrs;
            const defaultStorageScheme = attrs.passwordstoragescheme[0];
            this.setState({
              create_passwordstoragescheme: defaultStorageScheme,
              _create_passwordstoragescheme: defaultStorageScheme
            }, this.props.enableTree);
          }).fail((err) => {
            const errMsg = getApiErrorMessage(err);
            this.setState({
              loaded: true,
              loading: false
            });
            this.props.addNotification(
              "error",
              cockpit_default.format(_34("Error loading global password storage scheme - $0"), errMsg)
            );
          });
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.setState({
          loaded: true,
          loading: false
        }, this.props.enableTree);
        console.log(
          `Error loading local password policies - ${errMsg}`
        );
      });
    }
    loadLocal(name2) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "localpwp",
        "get",
        name2
      ];
      log_cmd("loadLocal", "Load a local password policy", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        let pwChange = false;
        let pwMustChange = false;
        let pwHistory = false;
        let pwTrackUpdate = false;
        let pwExpire = false;
        let pwSendExpire = false;
        let pwLockout = false;
        let pwUnlock = false;
        let pwCheckSyntax = false;
        let pwPalindrome = false;
        let pwDictCheck = false;
        let pwUserAttrs = [];
        let pwInHistory = "0";
        let pwBadWords = "";
        let pwScheme = this.state.create_passwordstoragescheme;
        let pwWarning = "0";
        let pwMaxAge = "0";
        let pwMinAge = "0";
        let pwGraceLimit = "0";
        let pwLockoutDur = "0";
        let pwMaxFailure = "0";
        let pwFailCount = "0";
        let pwMinLen = "0";
        let pwMinDigits = "0";
        let pwMinAlphas = "0";
        let pwMinUppers = "0";
        let pwMinLowers = "0";
        let pwMinSpecials = "0";
        let pwMin8bit = "0";
        let pwMaxRepeats = "0";
        let pwMaxSeq = "0";
        let pwMaxSeqSets = "0";
        let pwMaxClassChars = "0";
        let pwMinCat = "0";
        let pwMinTokenLen = "0";
        let pwTPRMaxUse = "-1";
        let pwTPRDelayExpireAt = "-1";
        let pwTPRDelayValidFrom = "-1";
        let pwAdminDN = "";
        let pwAdminSkipUpdates = false;
        if ("passwordmintokenlength" in attrs) {
          pwMinTokenLen = attrs.passwordmintokenlength[0];
        }
        if ("passwordmincategories" in attrs) {
          pwMinCat = attrs.passwordmincategories[0];
        }
        if ("passwordmaxclasschars" in attrs) {
          pwMaxClassChars = attrs.passwordmaxclasschars[0];
        }
        if ("passwordmaxseqsets" in attrs) {
          pwMaxSeqSets = attrs.passwordmaxseqsets[0];
        }
        if ("passwordmaxsequence" in attrs) {
          pwMaxSeq = attrs.passwordmaxsequence[0];
        }
        if ("passwordmaxrepeats" in attrs) {
          pwMaxRepeats = attrs.passwordmaxrepeats[0];
        }
        if ("passwordmin8bit" in attrs) {
          pwMin8bit = attrs.passwordmin8bit[0];
        }
        if ("passwordminspecials" in attrs) {
          pwMinSpecials = attrs.passwordminspecials[0];
        }
        if ("passwordminlowers" in attrs) {
          pwMinLowers = attrs.passwordminlowers[0];
        }
        if ("passwordminuppers" in attrs) {
          pwMinUppers = attrs.passwordminuppers[0];
        }
        if ("passwordminalphas" in attrs) {
          pwMinAlphas = attrs.passwordminalphas[0];
        }
        if ("passwordmindigits" in attrs) {
          pwMinDigits = attrs.passwordmindigits[0];
        }
        if ("passwordminlength" in attrs) {
          pwMinLen = attrs.passwordminlength[0];
        }
        if ("passwordresetfailurecount" in attrs) {
          pwFailCount = attrs.passwordresetfailurecount[0];
        }
        if ("passwordmaxfailure" in attrs) {
          pwMaxFailure = attrs.passwordmaxfailure[0];
        }
        if ("passwordlockoutduration" in attrs) {
          pwLockoutDur = attrs.passwordlockoutduration[0];
        }
        if ("passwordgracelimit" in attrs) {
          pwGraceLimit = attrs.passwordgracelimit[0];
        }
        if ("passwordmaxage" in attrs) {
          pwMaxAge = attrs.passwordmaxage[0];
        }
        if ("passwordminage" in attrs) {
          pwMinAge = attrs.passwordminage[0];
        }
        if ("passwordwarning" in attrs) {
          pwWarning = attrs.passwordwarning[0];
        }
        if ("passwordstoragescheme" in attrs) {
          pwScheme = attrs.passwordstoragescheme[0];
        }
        if ("passwordinhistory" in attrs) {
          pwInHistory = attrs.passwordinhistory[0];
        }
        if ("passwordchange" in attrs && attrs.passwordchange[0] === "on") {
          pwChange = true;
        }
        if ("passwordmustchange" in attrs && attrs.passwordmustchange[0] === "on") {
          pwMustChange = true;
        }
        if ("passwordhistory" in attrs && attrs.passwordhistory[0] === "on") {
          pwHistory = true;
        }
        if ("passwordtrackupdatetime" in attrs && attrs.passwordtrackupdatetime[0] === "on") {
          pwTrackUpdate = true;
        }
        if ("passwordsendexpiringtime" in attrs && attrs.passwordsendexpiringtime[0] === "on") {
          pwSendExpire = true;
        }
        if ("passwordlockout" in attrs && attrs.passwordlockout[0] === "on") {
          pwLockout = true;
        }
        if ("passwordunlock" in attrs && attrs.passwordunlock[0] === "on") {
          pwUnlock = true;
        }
        if ("passwordexp" in attrs && attrs.passwordexp[0] === "on") {
          pwExpire = true;
        }
        if ("passwordchecksyntax" in attrs && attrs.passwordchecksyntax[0] === "on") {
          pwCheckSyntax = true;
        }
        if ("passwordpalindrome" in attrs && attrs.passwordpalindrome[0] === "on") {
          pwPalindrome = true;
        }
        if ("passworddictcheck" in attrs && attrs.passworddictcheck[0] === "on") {
          pwDictCheck = true;
        }
        if ("passwordbadwords" in attrs && attrs.passwordbadwords[0] !== "") {
          if (attrs.passwordbadwords.length > 1) {
            pwBadWords = attrs.passwordbadwords.join(" ");
          } else {
            pwBadWords = attrs.passwordbadwords[0];
          }
        }
        if ("passworduserattributes" in attrs && attrs.passworduserattributes[0] !== "") {
          if (attrs.passworduserattributes.length > 1) {
            attrs.passworduserattributes[0] = attrs.passworduserattributes.join(" ");
          }
          if (attrs.passworduserattributes[0].indexOf(",") > -1) {
            pwUserAttrs = attrs.passworduserattributes[0].trim();
            pwUserAttrs = pwUserAttrs.split(",");
          } else {
            pwUserAttrs = attrs.passworduserattributes[0].split(" ");
          }
        }
        if ("passwordTPRMaxUse" in attrs) {
          pwTPRMaxUse = attrs.passwordTPRMaxUse[0];
        }
        if ("passwordTPRDelayExpireAt" in attrs) {
          pwTPRDelayExpireAt = attrs.passwordTPRDelayExpireAt[0];
        }
        if ("passwordTPRDelayValidFrom" in attrs) {
          pwTPRDelayValidFrom = attrs.passwordTPRDelayValidFrom[0];
        }
        if ("passwordadmindn" in attrs) {
          pwAdminDN = attrs.passwordadmindn[0];
        }
        if ("passwordadminskipinfoupdate" in attrs && attrs.passwordadminskipinfoupdate[0] === "on") {
          pwAdminSkipUpdates = true;
        }
        this.setState({
          editPolicy: true,
          loading: false,
          localActiveTabKey: 1,
          activeKey: 0,
          policyName: name2,
          policyType: config.pwp_type,
          saveGeneralDisabled: true,
          saveUserDisabled: true,
          saveExpDisabled: true,
          saveLockoutDisabled: true,
          saveSyntaxDisabled: true,
          // Settings
          passwordchange: pwChange,
          passwordmustchange: pwMustChange,
          passwordhistory: pwHistory,
          passwordtrackupdatetime: pwTrackUpdate,
          passwordexp: pwExpire,
          passwordsendexpiringtime: pwSendExpire,
          passwordlockout: pwLockout,
          passwordunlock: pwUnlock,
          passwordchecksyntax: pwCheckSyntax,
          passwordpalindrome: pwPalindrome,
          passworddictcheck: pwDictCheck,
          passwordstoragescheme: pwScheme,
          passwordinhistory: pwInHistory,
          passwordwarning: pwWarning,
          passwordmaxage: pwMaxAge,
          passwordminage: pwMinAge,
          passwordgracelimit: pwGraceLimit,
          passwordlockoutduration: pwLockoutDur,
          passwordmaxfailure: pwMaxFailure,
          passwordresetfailurecount: pwFailCount,
          passwordminlength: pwMinLen,
          passwordmindigits: pwMinDigits,
          passwordminalphas: pwMinAlphas,
          passwordminuppers: pwMinUppers,
          passwordminlowers: pwMinLowers,
          passwordminspecials: pwMinSpecials,
          passwordmin8bit: pwMin8bit,
          passwordmaxrepeats: pwMaxRepeats,
          passwordmaxsequence: pwMaxSeq,
          passwordmaxseqsets: pwMaxSeqSets,
          passwordmaxclasschars: pwMaxClassChars,
          passwordmincategories: pwMinCat,
          passwordmintokenlength: pwMinTokenLen,
          passwordbadwords: pwBadWords,
          passworduserattributes: pwUserAttrs,
          passwordtprmaxuse: pwTPRMaxUse,
          passwordtprdelayexpireat: pwTPRDelayExpireAt,
          passwordtprdelayvalidfrom: pwTPRDelayValidFrom,
          passwordadmindn: pwAdminDN,
          passwordadminskipinfoupdate: pwAdminSkipUpdates,
          // Record original values
          _passwordchange: pwChange,
          _passwordmustchange: pwMustChange,
          _passwordhistory: pwHistory,
          _passwordtrackupdatetime: pwTrackUpdate,
          _passwordexp: pwExpire,
          _passwordsendexpiringtime: pwSendExpire,
          _passwordlockout: pwLockout,
          _passwordunlock: pwUnlock,
          _passwordchecksyntax: pwCheckSyntax,
          _passwordpalindrome: pwPalindrome,
          _passworddictcheck: pwDictCheck,
          _passwordstoragescheme: pwScheme,
          _passwordinhistory: pwInHistory,
          _passwordwarning: pwWarning,
          _passwordmaxage: pwMaxAge,
          _passwordminage: pwMinAge,
          _passwordgracelimit: pwGraceLimit,
          _passwordlockoutduration: pwLockoutDur,
          _passwordmaxfailure: pwMaxFailure,
          _passwordresetfailurecount: pwFailCount,
          _passwordminlength: pwMinLen,
          _passwordmindigits: pwMinDigits,
          _passwordminalphas: pwMinAlphas,
          _passwordminuppers: pwMinUppers,
          _passwordminlowers: pwMinLowers,
          _passwordminspecials: pwMinSpecials,
          _passwordmin8bit: pwMin8bit,
          _passwordmaxrepeats: pwMaxRepeats,
          _passwordmaxsequence: pwMaxSeq,
          _passwordmaxseqsets: pwMaxSeqSets,
          _passwordmaxclasschars: pwMaxClassChars,
          _passwordmincategories: pwMinCat,
          _passwordmintokenlength: pwMinTokenLen,
          _passwordbadwords: pwBadWords,
          _passworduserattributes: pwUserAttrs,
          _passwordtprmaxuse: pwTPRMaxUse,
          _passwordtprdelayexpireat: pwTPRDelayExpireAt,
          _passwordtprdelayvalidfrom: pwTPRDelayValidFrom,
          _passwordadmindn: pwAdminDN,
          _passwordadminskipinfoupdate: pwAdminSkipUpdates
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.setState({
          loaded: true,
          loading: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_34("Error loading local password policy - $0"), errMsg)
        );
      });
    }
    render() {
      let edit_tab = "";
      let pwExpirationRows = "";
      let pwLockoutRows = "";
      let pwSyntaxRows = "";
      let saveBtnName = _34("Save");
      const extraPrimaryProps = {};
      if (this.state.saving) {
        saveBtnName = _34("Saving ...");
        extraPrimaryProps.spinnerAriaValueText = _34("Saving");
      }
      if (this.state.passwordchecksyntax) {
        pwSyntaxRows = /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ds-margin-left", children: [
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Minimum Length") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                TextInput,
                {
                  title: _34("The minimum number of characters in the password (passwordMinLength)."),
                  value: this.state.passwordminlength,
                  type: "number",
                  id: "passwordminlength",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "passwordminlength",
                  ...getValidationProps("passwordminlength", this.state.invalidFields),
                  onChange: (e, checked) => {
                    this.handleSyntaxChange(e);
                  }
                }
              ),
              renderValidationError("passwordminlength", this.state.invalidFields)
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", offset: 6, span: 3, children: _34("Max Repeated Chars") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                TextInput,
                {
                  type: "number",
                  title: _34("The maximum number of times the same character can sequentially appear in a password (passwordMaxRepeats)."),
                  value: this.state.passwordmaxrepeats,
                  id: "passwordmaxrepeats",
                  "aria-describedby": "passwordmaxrepeats",
                  name: "passwordmaxrepeats",
                  onChange: (e, str) => {
                    this.handleSyntaxChange(e);
                  },
                  ...getValidationProps("passwordmaxrepeats", this.state.invalidFields)
                }
              ),
              renderValidationError("passwordmaxrepeats", this.state.invalidFields)
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Prohibited Words") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
              TextInput,
              {
                title: _34("A space-separated list of words that are not allowed to be contained in the new password (passwordBadWords)."),
                value: this.state.passwordbadwords,
                type: "text",
                id: "passwordbadwords",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordbadwords",
                onChange: (e, checked) => {
                  this.handleSyntaxChange(e);
                }
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 3, title: _34("Check the password against the system's CrackLib dictionary (passwordDictCheck)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
            Checkbox,
            {
              id: "passworddictcheck",
              isChecked: this.state.passworddictcheck,
              onChange: (e, checked) => {
                this.handleSyntaxChange(e);
              },
              label: _34("Dictionary Check")
            }
          ) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 3, title: _34("Check if the password is a palindrome (passwordPalindrome)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
            Checkbox,
            {
              id: "passwordpalindrome",
              isChecked: this.state.passwordpalindrome,
              className: "ds-label",
              onChange: (e, checked) => {
                this.handleSyntaxChange(e);
              },
              label: _34("Reject Palindromes")
            }
          ) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("hr", {}) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Minimum Alpha's") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                TextInput,
                {
                  title: _34("Reject passwords with fewer than this many alpha characters (passwordMinAlphas)."),
                  value: this.state.passwordminalphas,
                  type: "number",
                  id: "passwordminalphas",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "passwordminalphas",
                  ...getValidationProps("passwordminalphas", this.state.invalidFields),
                  onChange: (e, checked) => {
                    this.handleSyntaxChange(e);
                  }
                }
              ),
              renderValidationError("passwordminalphas", this.state.invalidFields)
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", offset: 6, span: 3, children: _34("Minimum Digits") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                TextInput,
                {
                  title: _34("Reject passwords with fewer than this many digit characters (0-9) (passwordMinDigits)."),
                  value: this.state.passwordmindigits,
                  type: "number",
                  id: "passwordmindigits",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "passwordmindigits",
                  ...getValidationProps("passwordmindigits", this.state.invalidFields),
                  onChange: (e, checked) => {
                    this.handleSyntaxChange(e);
                  }
                }
              ),
              renderValidationError("passwordmindigits", this.state.invalidFields)
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Minimum Uppercase") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                TextInput,
                {
                  title: _34("Reject passwords with fewer than this many uppercase characters (passwordMinUppers)."),
                  value: this.state.passwordminuppers,
                  type: "number",
                  id: "passwordminuppers",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "passwordminuppers",
                  ...getValidationProps("passwordminuppers", this.state.invalidFields),
                  onChange: (e, checked) => {
                    this.handleSyntaxChange(e);
                  }
                }
              ),
              renderValidationError("passwordminuppers", this.state.invalidFields)
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", offset: 6, span: 3, children: _34("Minimum Lowercase") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                TextInput,
                {
                  title: _34("Reject passwords with fewer than this many lowercase characters (passwordMinLowers)."),
                  value: this.state.passwordminlowers,
                  type: "number",
                  id: "passwordminlowers",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "passwordminlowers",
                  ...getValidationProps("passwordminlowers", this.state.invalidFields),
                  onChange: (e, checked) => {
                    this.handleSyntaxChange(e);
                  }
                }
              ),
              renderValidationError("passwordminlowers", this.state.invalidFields)
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Minimum Special") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                TextInput,
                {
                  title: _34("Reject passwords with fewer than this many special non-alphanumeric characters (passwordMinSpecials)."),
                  value: this.state.passwordminspecials,
                  type: "number",
                  id: "passwordminspecials",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "passwordminspecials",
                  ...getValidationProps("passwordminspecials", this.state.invalidFields),
                  onChange: (e, checked) => {
                    this.handleSyntaxChange(e);
                  }
                }
              ),
              renderValidationError("passwordminspecials", this.state.invalidFields)
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", offset: 6, span: 3, children: _34("Minimum 8-bit") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                TextInput,
                {
                  title: _34("Reject passwords with fewer than this many 8-bit or multi-byte characters (passwordMin8Bit)."),
                  value: this.state.passwordmin8bit,
                  type: "number",
                  id: "passwordmin8bit",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "passwordmin8bit",
                  ...getValidationProps("passwordmin8bit", this.state.invalidFields),
                  onChange: (e, checked) => {
                    this.handleSyntaxChange(e);
                  }
                }
              ),
              renderValidationError("passwordmin8bit", this.state.invalidFields)
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Minimum Categories") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 1, children: [
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                TextInput,
                {
                  title: _34("The minimum number of character categories that a password must contain (categories are upper, lower, digit, special, and 8-bit) (passwordMinCategories)."),
                  value: this.state.passwordmincategories,
                  type: "number",
                  id: "passwordmincategories",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "passwordmincategories",
                  ...getValidationProps("passwordmincategories", this.state.invalidFields),
                  onChange: (e, checked) => {
                    this.handleSyntaxChange(e);
                  }
                }
              ),
              renderValidationError("passwordmincategories", this.state.invalidFields)
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("hr", {}) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Maximum Sequences") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
              TextInput,
              {
                title: _34("The maximum number of allowed monotonic characters sequences (passwordMaxSequence)."),
                value: this.state.passwordmaxsequence,
                type: "number",
                id: "passwordmaxsequence",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordmaxsequence",
                ...getValidationProps("passwordmaxsequence", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleSyntaxChange(e);
                }
              }
            ) }),
            renderValidationError("passwordmaxsequence", this.state.invalidFields),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", offset: 6, span: 3, children: _34("Max Sequence Sets") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
              TextInput,
              {
                title: _34("The maximum number of allowed monotonic characters sequences that can appear more than once (passwordMaxSeqSets)."),
                value: this.state.passwordmaxseqsets,
                type: "number",
                id: "passwordmaxseqsets",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordmaxseqsets",
                ...getValidationProps("passwordmaxseqsets", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleSyntaxChange(e);
                }
              }
            ) }),
            renderValidationError("passwordmaxseqsets", this.state.invalidFields)
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Max Seq Per Class") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
              TextInput,
              {
                title: _34("The maximum number of consecutive characters from the same character class/category (passwordMaxClassChars)."),
                value: this.state.passwordmaxclasschars,
                type: "number",
                id: "passwordmaxclasschars",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordmaxclasschars",
                ...getValidationProps("passwordmaxclasschars", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleSyntaxChange(e);
                }
              }
            ) }),
            renderValidationError("passwordmaxclasschars", this.state.invalidFields)
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("hr", {}) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { title: _34("A list of entry attributes to compare to the new password (passwordUserAttributes)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Check User Attributes") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
              dsBasicComponents_default,
              {
                selected: this.state.passworduserattributes,
                onSelect: this.handleSyntaxChange,
                onClear: this.handleSelectClear,
                options: this.props.attrs,
                isOpen: this.state.isSelectOpen,
                onToggle: this.handleSelectToggle,
                placeholder: _34("Type attributes to check..."),
                noResultsText: _34("There are no matching entries"),
                ariaLabel: "Type an attribute to check",
                isMulti: true
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", title: _34("The smallest attribute value used when checking if the password contains any of the user's attributes that are set via passwordUserAttributes (passwordMinTokenLength)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Minimum Token Length") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
              TextInput,
              {
                type: "number",
                value: this.state.passwordmintokenlength,
                id: "passwordmintokenlength",
                "aria-describedby": "passwordmintokenlength",
                name: "passwordmintokenlength",
                onChange: (e, str) => {
                  this.handleSyntaxChange(e);
                },
                ...getValidationProps("passwordmintokenlength", this.state.invalidFields)
              }
            ) }),
            renderValidationError("passwordmintokenlength", this.state.invalidFields)
          ] })
        ] });
      }
      if (this.state.passwordlockout) {
        pwLockoutRows = /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ds-margin-left", children: [
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", title: _34("The maximum number of failed logins before account gets locked (passwordMaxFailure)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 5, children: _34("Number of Failed Logins That Locks out Account") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
              TextInput,
              {
                value: this.state.passwordmaxfailure,
                type: "number",
                id: "passwordmaxfailure",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordmaxfailure",
                ...getValidationProps("passwordmaxfailure", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleLockoutChange(e);
                }
              }
            ) }),
            renderValidationError("passwordmaxfailure", this.state.invalidFields)
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", title: _34("The number of seconds until an accounts failure count is reset (passwordResetFailureCount)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 5, children: _34("Time Until <i>Failure Count</i> Resets") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
              TextInput,
              {
                value: this.state.passwordresetfailurecount,
                type: "number",
                id: "passwordresetfailurecount",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordresetfailurecount",
                ...getValidationProps("passwordresetfailurecount", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleLockoutChange(e);
                }
              }
            ) }),
            renderValidationError("passwordresetfailurecount", this.state.invalidFields)
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", title: _34("The number of seconds, duration, before the account gets unlocked (passwordLockoutDuration)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 5, children: _34("Time Until Account Unlocked") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
              TextInput,
              {
                value: this.state.passwordlockoutduration,
                type: "number",
                id: "passwordlockoutduration",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordlockoutduration",
                ...getValidationProps("passwordlockoutduration", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleLockoutChange(e);
                }
              }
            ) }),
            renderValidationError("passwordlockoutduration", this.state.invalidFields)
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { className: "ds-margin-top", title: _34("Do not lockout the user account forever, instead the account will unlock based on the lockout duration (passwordUnlock)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
            Checkbox,
            {
              id: "passwordunlock",
              isChecked: this.state.passwordunlock,
              onChange: (e, checked) => {
                this.handleLockoutChange(e);
              },
              label: _34("Do Not Lockout Account Forever")
            }
          ) }) })
        ] });
      }
      if (this.state.passwordexp) {
        pwExpirationRows = /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ds-margin-left", children: [
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", title: _34("The maximum age of a password in seconds before it expires (passwordMaxAge)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 5, children: _34("Password Expiration Time") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
              TextInput,
              {
                value: this.state.passwordmaxage,
                type: "number",
                id: "passwordmaxage",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordmaxage",
                ...getValidationProps("passwordmaxage", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleExpChange(e);
                }
              }
            ) }),
            renderValidationError("passwordmaxage", this.state.invalidFields)
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", title: _34("The number of logins that are allowed after the password has expired (passwordGraceLimit)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 5, children: _34("Allowed Logins After Password Expires") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
              TextInput,
              {
                value: this.state.passwordgracelimit,
                type: "number",
                id: "passwordgracelimit",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordgracelimit",
                ...getValidationProps("passwordgracelimit", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleExpChange(e);
                }
              }
            ) }),
            renderValidationError("passwordgracelimit", this.state.invalidFields)
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", title: _34("Set the time (in seconds), before a password is about to expire, to send a warning. (passwordWarning)."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 5, children: _34("Send Password Expiring Warning") }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
              TextInput,
              {
                value: this.state.passwordwarning,
                type: "number",
                id: "passwordwarning",
                "aria-describedby": "horizontal-form-name-helper",
                name: "passwordwarning",
                ...getValidationProps("passwordwarning", this.state.invalidFields),
                onChange: (e, checked) => {
                  this.handleExpChange(e);
                }
              }
            ) }),
            renderValidationError("passwordwarning", this.state.invalidFields)
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { className: "ds-margin-top", title: _34("Always return a password expiring control when requested (passwordSendExpiringTime)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
            Checkbox,
            {
              id: "passwordsendexpiringtime",
              isChecked: this.state.passwordsendexpiringtime,
              onChange: (e, checked) => {
                this.handleExpChange(e);
              },
              label: _34("Always send Password Expiring Control")
            }
          ) }) })
        ] });
      }
      if (!this.state.editPolicy) {
        edit_tab = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "ds-margin-top-xlg ds-center", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { className: "ds-center", component: TextVariants.h3, children: [
          _34("Please choose a policy from the "),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("a", { onClick: this.handleResetTab, children: _34("Local Policy Table") }),
          "."
        ] }) }) });
      } else {
        edit_tab = /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: this.state.loading ? "ds-fadeout ds-left-margin" : "ds-fadein ds-left-margin", children: [
          /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { className: "ds-margin-top-xlg", component: TextVariants.h4, children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("b", { children: this.state.policyName }),
            " ",
            /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("font", { size: "2", children: [
              "(",
              this.state.policyType,
              ")"
            ] })
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Tabs, { className: "ds-margin-top-lg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
            /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TabTitleText, { children: _34("General Settings") }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Form, { className: "ds-margin-left-sm ds-margin-top-lg", isHorizontal: true, autoComplete: "off", children: [
                /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { title: _34("Record a separate timestamp specifically for the last time that the password for an entry was changed. If this is enabled, then it adds the pwdUpdateTime operational attribute to the user account entry (passwordTrackUpdateTime)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                  Checkbox,
                  {
                    id: "passwordtrackupdatetime",
                    isChecked: this.state.passwordtrackupdatetime,
                    onChange: (e, checked) => {
                      this.handleGeneralChange(e);
                    },
                    label: _34("Track Password Update Time")
                  }
                ) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { title: _34("Allow user's to change their passwords (passwordChange)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                  Checkbox,
                  {
                    id: "passwordchange",
                    isChecked: this.state.passwordchange,
                    onChange: (e, checked) => {
                      this.handleGeneralChange(e);
                    },
                    label: _34("Allow Users To Change Their Passwords")
                  }
                ) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { title: _34("User must change its password after its been reset by an administrator (passwordMustChange)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                  Checkbox,
                  {
                    id: "passwordmustchange",
                    isChecked: this.state.passwordmustchange,
                    onChange: (e, checked) => {
                      this.handleGeneralChange(e);
                    },
                    label: _34("User Must Change Password After Reset")
                  }
                ) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { title: _34("Maintain a password history for each user (passwordHistory)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(GridItem, { span: 12, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "ds-inline", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                    Checkbox,
                    {
                      id: "passwordhistory",
                      isChecked: this.state.passwordhistory,
                      onChange: (e, checked) => {
                        this.handleGeneralChange(e);
                      },
                      label: _34("Keep Password History")
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ds-inline ds-left-margin ds-raise-field-md ds-width-sm", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                      TextInput,
                      {
                        value: this.state.passwordinhistory,
                        type: "number",
                        id: "passwordinhistory",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "passwordinhistory",
                        ...getValidationProps("passwordinhistory", this.state.invalidFields),
                        onChange: (e, checked) => {
                          this.handleGeneralChange(e);
                        }
                      }
                    ),
                    renderValidationError("passwordinhistory", this.state.invalidFields)
                  ] })
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Grid, { className: "ds-margin-top", title: _34("Set the password storage scheme (passwordstoragescheme)."), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 3, className: "ds-label", children: _34("Password Storage Scheme") }),
                  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                    FormSelect,
                    {
                      id: "passwordstoragescheme",
                      value: this.state.passwordstoragescheme,
                      onChange: (event, value) => {
                        this.handleGeneralChange(event);
                      },
                      "aria-label": "FormSelect Input",
                      children: this.props.pwdStorageSchemes.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        FormSelectOption,
                        {
                          value: option,
                          label: option
                        },
                        index
                      ))
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
                  Grid,
                  {
                    title: _34("Indicates the number of seconds that must pass before a user can change their password again. (passwordMinAge)."),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Password Minimum Age") }),
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          value: this.state.passwordminage,
                          type: "number",
                          id: "passwordminage",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "passwordminage",
                          ...getValidationProps("passwordminage", this.state.invalidFields),
                          onChange: (e, checked) => {
                            this.handleGeneralChange(e);
                          }
                        }
                      ) }),
                      renderValidationError("passwordminage", this.state.invalidFields)
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
                  Grid,
                  {
                    title: _34("The DN for a password administrator or administrator group (passwordAdminDN)."),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Password Administrator") }),
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          value: this.state.passwordadmindn,
                          type: "text",
                          id: "passwordadmindn",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "passwordadmindn",
                          onChange: (e, checked) => {
                            this.handleGeneralChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                  Grid,
                  {
                    title: _34("Disable updating password state attributes like passwordExpirationtime, passwordHistory, etc, when setting a user's password as a Password Administrator (passwordAdminSkipInfoUpdate)."),
                    children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { offset: 3, span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                      Checkbox,
                      {
                        id: "passwordadminskipinfoupdate",
                        isChecked: this.state.passwordadminskipinfoupdate,
                        onChange: (e, checked) => {
                          this.handleGeneralChange(e);
                        },
                        label: "Do not update target entry's password state attributes"
                      }
                    ) })
                  }
                )
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                Button,
                {
                  isDisabled: this.state.saveGeneralDisabled || this.state.saving || hasInvalidField(general_attrs2, this.state.invalidFields),
                  variant: "primary",
                  className: "ds-margin-top-xlg ds-margin-left-sm ds-margin-bottom-md",
                  onClick: this.handleSaveGeneral,
                  isLoading: this.state.saving,
                  spinnerAriaValueText: this.state.saving ? _34("Saving") : void 0,
                  ...extraPrimaryProps,
                  children: saveBtnName
                }
              )
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TabTitleText, { children: _34("Expiration") }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Form, { className: "ds-margin-top-xlg ds-margin-left", isHorizontal: true, autoComplete: "off", children: [
                /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { title: _34("Enable a password expiration policy (passwordExp)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                  Checkbox,
                  {
                    id: "passwordexp",
                    isChecked: this.state.passwordexp,
                    onChange: (e, checked) => {
                      this.handleExpChange(e);
                    },
                    label: _34("Enforce Password Expiration")
                  }
                ) }) }),
                pwExpirationRows
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                Button,
                {
                  isDisabled: this.state.saveExpDisabled || this.state.saving || hasInvalidField(exp_attrs2, this.state.invalidFields),
                  variant: "primary",
                  className: "ds-margin-top-lg ds-margin-left",
                  onClick: this.handleSaveExp,
                  isLoading: this.state.saving,
                  spinnerAriaValueText: this.state.saving ? _34("Saving") : void 0,
                  ...extraPrimaryProps,
                  children: saveBtnName
                }
              )
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TabTitleText, { children: _34("Account Lockout") }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Form, { className: "ds-margin-top-xlg ds-margin-left", isHorizontal: true, autoComplete: "off", children: [
                /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { title: _34("Enable account lockout (passwordLockout)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                  Checkbox,
                  {
                    id: "passwordlockout",
                    isChecked: this.state.passwordlockout,
                    onChange: (e, checked) => {
                      this.handleLockoutChange(e);
                    },
                    label: _34("Enable Account Lockout")
                  }
                ) }) }),
                pwLockoutRows
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                Button,
                {
                  isDisabled: this.state.saveLockoutDisabled || this.state.saving || hasInvalidField(lockout_attrs2, this.state.invalidFields),
                  variant: "primary",
                  className: "ds-margin-top-lg ds-margin-left",
                  onClick: this.handleSaveLockout,
                  isLoading: this.state.saving,
                  spinnerAriaValueText: this.state.saving ? _34("Saving") : void 0,
                  ...extraPrimaryProps,
                  children: saveBtnName
                }
              )
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Tab, { eventKey: 3, title: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TabTitleText, { children: _34("Syntax Checking") }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Form, { className: "ds-margin-top-xlg ds-margin-left", isHorizontal: true, autoComplete: "off", children: [
                /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { title: _34("Enable password syntax checking (passwordCheckSyntax)."), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                  Checkbox,
                  {
                    id: "passwordchecksyntax",
                    isChecked: this.state.passwordchecksyntax,
                    onChange: (e, checked) => {
                      this.handleSyntaxChange(e);
                    },
                    label: _34("Enable Password Syntax Checking")
                  }
                ) }) }),
                pwSyntaxRows
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                Button,
                {
                  isDisabled: this.state.saveSyntaxDisabled || this.state.saving || hasInvalidField(syntax_attrs2, this.state.invalidFields),
                  variant: "primary",
                  className: "ds-margin-top-xlg ds-margin-left ds-margin-bottom-md",
                  onClick: this.handleSaveSyntax,
                  isLoading: this.state.saving,
                  spinnerAriaValueText: this.state.saving ? _34("Saving") : void 0,
                  ...extraPrimaryProps,
                  children: saveBtnName
                }
              )
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Tab, { eventKey: 4, title: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TabTitleText, { children: _34("Temporary Password Rules") }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Form, { className: "ds-margin-top ds-margin-left", isHorizontal: true, autoComplete: "off", children: [
                this.state.passwordmustchange === false && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FormAlert, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                  Alert,
                  {
                    variant: "info",
                    title: _34('"User Must Change Password After Reset" must be enabled in General Settings to activate TPR.'),
                    "aria-live": "polite",
                    isInline: true
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
                  Grid,
                  {
                    title: _34("Number of times the temporary password can be used to authenticate (passwordTPRMaxUse)."),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: "Password Max Use" }),
                      /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                        TextInput,
                        {
                          value: this.state.passwordtprmaxuse,
                          type: "number",
                          id: "passwordtprmaxuse",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "passwordtprmaxuse",
                          isDisabled: !this.state.passwordmustchange,
                          onChange: (e, checked) => {
                            this.handleTPRChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                )
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Form, { className: "ds-margin-top ds-margin-left", isHorizontal: true, autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
                Grid,
                {
                  title: _34("Number of seconds before the temporary password expires (passwordTPRDelayExpireAt)."),
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Password Expires In") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                      TextInput,
                      {
                        value: this.state.passwordtprdelayexpireat,
                        type: "number",
                        id: "passwordtprdelayexpireat",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "passwordtprdelayexpireat",
                        isDisabled: !this.state.passwordmustchange,
                        onChange: (e, checked) => {
                          this.handleTPRChange(e);
                        }
                      }
                    ) })
                  ]
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Form, { className: "ds-margin-top ds-margin-left", isHorizontal: true, autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
                Grid,
                {
                  title: _34("Number of seconds after which temporary password starts to be valid for authentication (passwordTPRDelayValidFrom)."),
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { className: "ds-label", span: 3, children: _34("Password Valid From") }),
                    /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                      TextInput,
                      {
                        value: this.state.passwordtprdelayvalidfrom,
                        type: "number",
                        id: "passwordtprdelayvalidfrom",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "passwordtprdelayvalidfrom",
                        isDisabled: !this.state.passwordmustchange,
                        onChange: (e, checked) => {
                          this.handleTPRChange(e);
                        }
                      }
                    ) })
                  ]
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
                Button,
                {
                  isDisabled: this.state.saveTPRDisabled || this.state.saving,
                  variant: "primary",
                  className: "ds-margin-top-xlg ds-margin-left ds-margin-bottom-md",
                  onClick: this.handleSaveTPR,
                  isLoading: this.state.saving,
                  spinnerAriaValueText: this.state.saving ? _34("Saving") : void 0,
                  ...extraPrimaryProps,
                  children: saveBtnName
                }
              )
            ] })
          ] })
        ] });
      }
      let body = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Tabs, { activeKey: this.state.localActiveTabKey, onSelect: this.handleLocalNavSelect, children: [
        /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TabTitleText, { children: _34("Local Policy Table") }), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
          PwpTable,
          {
            rows: this.state.rows,
            editPolicy: this.loadLocal,
            deletePolicy: this.showDeletePolicy
          },
          this.state.rows
        ) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TabTitleText, { children: _34("Edit Policy") }), children: edit_tab }),
        /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TabTitleText, { children: _34("Create A Policy") }), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
          CreatePolicy,
          {
            handleChange: this.onCreateChange,
            handleSelectChange: this.onCreateSelectChange,
            attrs: this.props.attrs,
            passwordexp: this.state.create_passwordexp,
            passwordchecksyntax: this.state.create_passwordchecksyntax,
            passwordlockout: this.state.create_passwordlockout,
            createDisabled: this.state.createDisabled,
            passworduserattributes: this.state.create_passworduserattributes,
            handleCreatePolicy: this.createPolicy,
            invalid_dn: this.state.invalid_dn,
            policyDN: this.state.policyDN,
            createPolicyType: this.state.createPolicyType,
            create_passwordtrackupdatetime: this.state.create_passwordtrackupdatetime,
            create_passwordchange: this.state.create_passwordchange,
            create_passwordmustchange: this.state.create_passwordmustchange,
            create_passwordhistory: this.state.create_passwordhistory,
            create_passwordexp: this.state.create_passwordexp,
            create_passwordsendexpiringtime: this.state.create_passwordsendexpiringtime,
            create_passwordlockout: this.state.create_passwordlockout,
            create_passwordunlock: this.state.create_passwordunlock,
            create_passwordchecksyntax: this.state.create_passwordchecksyntax,
            create_passworddictcheck: this.state.create_passworddictcheck,
            create_passwordpalindrome: this.state.create_passwordpalindrome,
            create_passwordstoragescheme: this.state.create_passwordstoragescheme,
            create_passwordadmindn: this.state.create_passwordadmindn,
            create_passwordadminskipinfoupdate: this.state.create_passwordadminskipinfoupdate,
            invalidCreateFields: this.state.invalidCreateFields,
            onUserAttrsCreateToggle: this.handleUserAttrsCreateToggle,
            onUserAttrsCreateClear: this.handleUserAttrsCreateClear,
            isUserAttrsCreateOpen: this.state.isUserAttrsCreateOpen,
            pwdStorageSchemes: this.props.pwdStorageSchemes
          },
          this.state.rows
        ) })
      ] }) });
      if (this.state.loading || !this.state.loaded) {
        body = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "ds-margin-top-xlg ds-center", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Spinner, { size: "xl" }) });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: this.state.saving ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Text, { component: TextVariants.h2, children: [
          _34("Local Password Policies"),
          /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _34("Refresh the local password policies"),
              onClick: this.handleLoadPolicies,
              children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }) }) }),
        body,
        /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showDeletePolicy,
            closeHandler: this.closeDeletePolicy,
            handleChange: this.onModalChange,
            actionHandler: this.deletePolicy,
            item: this.state.deleteName,
            checked: this.state.modalChecked,
            spinning: this.state.tableLoading,
            mTitle: _34("Delete Local Password Policy"),
            mMsg: _34("Are you sure you want to delete this local password policy?"),
            mSpinningMsg: _34("Deleting local password policy ..."),
            mBtnName: _34("Delete Policy")
          }
        )
      ] });
    }
  };
  LocalPwPolicy.propTypes = {
    attrs: import_prop_types34.default.array,
    pwdStorageSchemes: import_prop_types34.default.array
  };
  LocalPwPolicy.defaultProps = {
    attrs: [],
    pwdStorageSchemes: []
  };

  // src/lib/database/pwpFixupTasks.tsx
  var import_react56 = __toESM(require_react(), 1);
  var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
  var _35 = cockpit_default.gettext;
  var ShadowFixupModal2 = ShadowFixupModal;
  var PwpFixupTasks = ({ serverId, addNotification, suffixes }) => {
    const [modalSpinning, setModalSpinning] = (0, import_react56.useState)(false);
    const [fixupShadowModalOpen, setFixupShadowModalOpen] = (0, import_react56.useState)(false);
    const [fixupShadowSuffix, setFixupShadowSuffix] = (0, import_react56.useState)("");
    const [fixupShadowForce, setFixupShadowForce] = (0, import_react56.useState)(false);
    const [fixupCompleted, setFixupCompleted] = (0, import_react56.useState)(false);
    const [fixupBuffer, setFixupBuffer] = (0, import_react56.useState)("");
    const openFixUpModal = () => {
      setFixupShadowModalOpen(true);
      setFixupShadowSuffix("");
      setFixupShadowForce(false);
      setFixupCompleted(false);
      setFixupBuffer("");
    };
    const closeFixUpModal = () => {
      setFixupShadowModalOpen(false);
    };
    const handleFixUpChange = (e) => {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.name;
      if (attr === "fixupShadowForce") {
        setFixupShadowForce(value);
      } else {
        setFixupShadowSuffix(value);
      }
    };
    const doShadowFixup = () => {
      const fixup_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
        "pwpolicy",
        "fixup-shadow",
        fixupShadowSuffix,
        "--watch"
      ];
      if (fixupShadowForce) {
        fixup_cmd.push("--force");
      }
      setModalSpinning(true);
      setFixupBuffer("");
      let buffer = "";
      log_cmd("doShadowFixup", "Do shadow account fixup task", fixup_cmd);
      const proc = cockpit_default.spawn(fixup_cmd, {
        pty: true,
        superuser: "require",
        err: "message"
      });
      proc.stream((line) => {
        buffer += line;
        setFixupBuffer(buffer);
      });
      proc.done(() => {
        setModalSpinning(false);
        setFixupCompleted(true);
        addNotification(
          "success",
          _35("Successfully ran shadow account fixup task")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        addNotification(
          "error",
          cockpit_default.format(_35("Error running fixup task - $0"), errMsg)
        );
        setModalSpinning(false);
      });
    };
    let fixupItem = null;
    if (fixupBuffer !== "") {
      fixupItem = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
        LogViewer,
        {
          data: fixupBuffer,
          isTextWrapped: false,
          hasLineNumbers: false,
          scrollToRow: fixupBuffer.length,
          height: "200px"
        }
      );
    }
    return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { component: TextVariants.h2, children: _35("Password Policy Fix-up Tasks") }) }),
      /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("hr", {}),
      /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(TextContent, { className: "ds-margin-top-xlg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { component: TextVariants.h3, children: _35("Shadow Account Fix-up Task") }),
        /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { className: "ds-margin-top-lg ds-margin-left", children: 'Run a fix-up task to update users with the ShadowAccount objectclass. The task will add "ShadowLastChange" attribute to users that do not have that attribute.' })
      ] }),
      /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
        Button,
        {
          variant: "primary",
          className: "ds-margin-top-lg ds-margin-left",
          onClick: openFixUpModal,
          children: _35("Run Shadow Fix-Up Task")
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
        ShadowFixupModal2,
        {
          showModal: fixupShadowModalOpen,
          closeHandler: closeFixUpModal,
          handleChange: handleFixUpChange,
          saveHandler: doShadowFixup,
          spinning: modalSpinning,
          item: fixupItem,
          force: fixupShadowForce,
          suffix: fixupShadowSuffix,
          fixupCompleted,
          suffixes
        }
      )
    ] });
  };

  // src/database.jsx
  var import_prop_types35 = __toESM(require_prop_types(), 1);
  var import_exclamation_circle_icon10 = __toESM(require_exclamation_circle_icon(), 1);
  var import_plus_icon3 = __toESM(require_plus_icon(), 1);
  var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
  var DB_CONFIG = "dbconfig";
  var CHAINING_CONFIG = "chaining-config";
  var BACKUP_CONFIG = "backups";
  var PWP_CONFIG = "pwpolicy";
  var LOCAL_PWP_CONFIG = "localpwpolicy";
  var PWP_FIXUP_TASK = "pwp-fixup";
  var BE_IMPL_BDB = "bdb";
  var BE_IMPL_MDB = "mdb";
  var _36 = cockpit_default.gettext;
  var Database = class extends import_react57.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        errObj: {},
        nodes: [],
        node_name: "",
        node_text: "",
        dbtype: "",
        activeItems: [
          {
            name: _36("Global Database Configuration"),
            icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CogIcon, {}),
            id: "dbconfig"
          }
        ],
        showSuffixModal: false,
        createSuffix: "",
        createBeName: "",
        createNotOK: true,
        createSuffixEntry: false,
        createSampleEntries: false,
        noSuffixInit: true,
        disableTree: false,
        createInitOption: "noInit",
        // DB config
        globalDBConfig: {
          activeTab: 0
        },
        backendImplement: BE_IMPL_MDB,
        configUpdated: 0,
        // Chaining Config
        chainingConfig: {},
        chainingUpdated: 0,
        chainingActiveKey: 0,
        // Chaining Link
        chainingLoading: false,
        // Suffix
        suffixLoading: false,
        suffixConfigLoaded: false,
        suffixConfigLoading: false,
        suffixVlvLoaded: false,
        suffixVlvLoading: false,
        suffixAttrEncLoaded: false,
        suffixAttrEncLoading: false,
        suffixIndexesLoaded: false,
        suffixIndexesLoading: false,
        modalSpinning: false,
        attributes: [],
        objectClasses: [],
        attributesFullData: [],
        // Loaded suffix configurations
        suffix: {},
        // Other
        vlvTableKey: 0,
        LDIFRows: [],
        BackupRows: [],
        backupRefreshing: false,
        suffixList: [],
        pwdStorageSchemes: [],
        loaded: false,
        globalConfigLoaded: false,
        globalConfigLoading: false,
        chainingConfigLoaded: false,
        chainingConfigLoading: false,
        ldifsLoaded: false,
        ldifsLoading: false,
        backupsLoaded: false,
        backupsLoading: false,
        pwdSchemesLoaded: false,
        pwdSchemesLoading: false,
        suffixListLoaded: false,
        suffixListLoading: false,
        suffixTreeLoaded: false,
        suffixTreeLoading: false
      };
      this.handleTreeClick = this.handleTreeClick.bind(this);
      this.onHandleChange = this.onHandleChange.bind(this);
      this.onHandleSelectChange = this.onHandleSelectChange.bind(this);
      this.loadGlobalConfig = this.loadGlobalConfig.bind(this);
      this.loadLDIFs = this.loadLDIFs.bind(this);
      this.loadBackups = this.loadBackups.bind(this);
      this.loadSuffixList = this.loadSuffixList.bind(this);
      this.loadPwdStorageSchemes = this.loadPwdStorageSchemes.bind(this);
      this.handleShowSuffixModal = this.handleShowSuffixModal.bind(this);
      this.closeSuffixModal = this.closeSuffixModal.bind(this);
      this.createSuffix = this.createSuffix.bind(this);
      this.loadSuffix = this.loadSuffix.bind(this);
      this.loadIndexes = this.loadIndexes.bind(this);
      this.loadVLV = this.loadVLV.bind(this);
      this.loadAttrEncrypt = this.loadAttrEncrypt.bind(this);
      this.loadReferrals = this.loadReferrals.bind(this);
      this.getAutoTuning = this.getAutoTuning.bind(this);
      this.loadSchema = this.loadSchema.bind(this);
      this.loadChainingLink = this.loadChainingLink.bind(this);
      this.loadChainingConfig = this.loadChainingConfig.bind(this);
      this.loadAvailableControls = this.loadAvailableControls.bind(this);
      this.loadDefaultConfig = this.loadDefaultConfig.bind(this);
      this.loadSuffixTree = this.loadSuffixTree.bind(this);
      this.enableTree = this.enableTree.bind(this);
      this.resetLoadProgress = this.resetLoadProgress.bind(this);
    }
    resetLoadProgress() {
      this.setState({
        loaded: false,
        globalConfigLoaded: false,
        globalConfigLoading: false,
        chainingConfigLoaded: false,
        chainingConfigLoading: false,
        ldifsLoaded: false,
        ldifsLoading: false,
        backupsLoaded: false,
        backupsLoading: false,
        pwdSchemesLoaded: false,
        pwdSchemesLoading: false,
        suffixListLoaded: false,
        suffixListLoading: false,
        suffixTreeLoaded: false,
        suffixTreeLoading: false
      });
    }
    componentDidUpdate(prevProps) {
      if (this.props.wasActiveList.includes(2)) {
        if (this.state.firstLoad) {
          if (!this.state.loaded) {
            this.resetLoadProgress();
            this.loadGlobalConfig();
          } else {
            this.loadSuffixTree(false);
          }
        } else {
          if (this.props.serverId !== prevProps.serverId) {
            this.resetLoadProgress();
            this.loadGlobalConfig();
          }
        }
      }
    }
    loadSuffixList(reloading = false) {
      this.setState({ suffixListLoading: true });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "suffix",
        "list",
        "--suffix"
      ];
      log_cmd("loadSuffixList", "Get a list of all the suffixes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const suffixList = JSON.parse(content);
        this.setState(() => ({
          suffixList: suffixList.items,
          suffixListLoaded: true,
          suffixListLoading: false
        }), () => {
          if (!reloading) {
            this.loadSuffixTree(false);
          }
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_36("Error loading suffix list - $0"), errMsg)
        );
        this.setState({
          suffixListLoaded: true,
          suffixListLoading: false
        }, () => {
          if (!reloading) {
            this.loadSuffixTree(false);
          }
        });
      });
    }
    loadPwdStorageSchemes(reloading = false) {
      this.setState({ pwdSchemesLoading: true });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "pwpolicy",
        "list-schemes"
      ];
      log_cmd("loadPwdStorageSchemes", "Get a list of all the password storage sehemes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const schemes = JSON.parse(content);
        this.setState(() => ({
          pwdStorageSchemes: schemes.items,
          pwdSchemesLoaded: true,
          pwdSchemesLoading: false
        }), () => {
          if (!reloading) {
            this.loadSuffixList();
          }
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_36("Error loading password storage schemes - $0"), errMsg)
        );
        this.setState({
          pwdSchemesLoaded: true,
          pwdSchemesLoading: false
        }, () => {
          if (!reloading) {
            this.loadSuffixList();
          }
        });
      });
    }
    loadNDN(reloading = false) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get",
        "nsslapd-ndn-cache-max-size",
        "nsslapd-ndn-cache-enabled"
      ];
      log_cmd("loadNDN", "Load NDN cache size", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        const ndn_cache_enabled = attrs["nsslapd-ndn-cache-enabled"][0] === "on";
        this.setState((prevState) => ({
          globalDBConfig: {
            ...prevState.globalDBConfig,
            ndncachemaxsize: attrs["nsslapd-ndn-cache-max-size"][0],
            ndn_cache_enabled
          },
          globalConfigLoaded: true,
          globalConfigLoading: false,
          configUpdated: 0
        }), () => {
          if (!reloading) {
            this.loadChainingConfig();
          }
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_36("Error loading server configuration for database- $0"), errMsg)
        );
        this.setState({
          globalConfigLoaded: true,
          globalConfigLoading: false
        }, () => {
          if (!reloading) {
            this.loadChainingConfig();
          }
        });
      });
    }
    loadGlobalConfig(activeTab, reloading = false) {
      if (this.state.firstLoad) {
        this.setState({ firstLoad: false });
      }
      this.setState({ globalConfigLoading: true });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "config",
        "get"
      ];
      log_cmd("loadGlobalConfig", "Load the database global configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(
        (content) => {
          const config = JSON.parse(content);
          const attrs = config.attrs;
          let dbhome = "";
          let dbimplement = "";
          let db_cache_auto = false;
          if ("nsslapd-backend-implement" in attrs) {
            dbimplement = attrs["nsslapd-backend-implement"][0];
            this.setState({ backendImplement: dbimplement });
          }
          if (dbimplement === BE_IMPL_BDB) {
            let import_cache_auto = false;
            let dblocksMonitoring = false;
            if ("nsslapd-db-home-directory" in attrs) {
              dbhome = attrs["nsslapd-db-home-directory"][0];
            }
            if (attrs["nsslapd-cache-autosize"][0] !== "0") {
              db_cache_auto = true;
            }
            if (attrs["nsslapd-import-cache-autosize"][0] !== "0") {
              import_cache_auto = true;
            }
            if (attrs["nsslapd-db-locks-monitoring-enabled"][0] === "on") {
              dblocksMonitoring = true;
            }
            this.setState(() => ({
              globalDBConfig: {
                loading: false,
                activeTab,
                db_cache_auto,
                import_cache_auto,
                looklimit: attrs["nsslapd-lookthroughlimit"][0],
                idscanlimit: attrs["nsslapd-idlistscanlimit"][0],
                pagelooklimit: attrs["nsslapd-pagedlookthroughlimit"][0],
                pagescanlimit: attrs["nsslapd-pagedidlistscanlimit"][0],
                rangelooklimit: attrs["nsslapd-rangelookthroughlimit"][0],
                autosize: attrs["nsslapd-cache-autosize"][0],
                autosizesplit: attrs["nsslapd-cache-autosize-split"][0],
                dbcachesize: attrs["nsslapd-dbcachesize"][0],
                txnlogdir: attrs["nsslapd-db-logdirectory"][0],
                dbhomedir: dbhome,
                dblocks: attrs["nsslapd-db-locks"][0],
                dblocksMonitoring,
                dblocksMonitoringThreshold: attrs["nsslapd-db-locks-monitoring-threshold"][0],
                dblocksMonitoringPause: attrs["nsslapd-db-locks-monitoring-pause"][0],
                chxpoint: attrs["nsslapd-db-checkpoint-interval"][0],
                compactinterval: attrs["nsslapd-db-compactdb-interval"][0],
                compacttime: attrs["nsslapd-db-compactdb-time"][0],
                importcacheauto: attrs["nsslapd-import-cache-autosize"][0],
                importcachesize: attrs["nsslapd-import-cachesize"][0],
                dynamiclistsenabled: attrs["nsslapd-dynamic-lists-enabled"][0] == "on" ? true : false,
                dynamiclistattr: attrs["nsslapd-dynamic-lists-attr"][0],
                dynamicoc: attrs["nsslapd-dynamic-lists-oc"][0],
                dynamicurlattr: attrs["nsslapd-dynamic-lists-url-attr"][0]
              },
              configUpdated: 1
            }), () => {
              this.loadNDN(reloading);
            });
          } else if (dbimplement === BE_IMPL_MDB) {
            let db_cache_auto2 = false;
            if ("nsslapd-directory" in attrs) {
              dbhome = attrs["nsslapd-directory"][0];
            }
            if (attrs["nsslapd-cache-autosize"][0] !== "-1") {
              db_cache_auto2 = true;
            }
            this.setState(() => ({
              globalDBConfig: {
                loading: false,
                activeTab,
                looklimit: attrs["nsslapd-lookthroughlimit"][0],
                idscanlimit: attrs["nsslapd-idlistscanlimit"][0],
                pagelooklimit: attrs["nsslapd-pagedlookthroughlimit"][0],
                pagescanlimit: attrs["nsslapd-pagedidlistscanlimit"][0],
                rangelooklimit: attrs["nsslapd-rangelookthroughlimit"][0],
                mdbmaxsize: Math.floor(attrs["nsslapd-mdb-max-size"][0] / (1024 * 1024)),
                mdbmaxreaders: attrs["nsslapd-mdb-max-readers"][0],
                mdbmaxdbs: attrs["nsslapd-mdb-max-dbs"][0],
                dbhomedir: dbhome,
                autosize: attrs["nsslapd-cache-autosize"][0],
                dynamiclistsenabled: attrs["nsslapd-dynamic-lists-enabled"][0] == "on" ? true : false,
                dynamiclistattr: attrs["nsslapd-dynamic-lists-attr"][0],
                dynamicoc: attrs["nsslapd-dynamic-lists-oc"][0],
                dynamicurlattr: attrs["nsslapd-dynamic-lists-url-attr"][0]
              },
              configUpdated: 1
            }), () => {
              this.loadNDN(reloading);
            });
          }
        }
      ).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_36("Error loading database configuration - $0"), errMsg)
        );
        this.loadNDN(reloading);
      });
    }
    loadAvailableControls() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "config-get",
        "--avail-controls"
      ];
      log_cmd("loadAvailableControls", "Get available controls", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const availableOids = config.items.filter((el) => !this.state.chainingConfig.oidList.includes(el));
        this.setState(
          (prevState) => ({
            chainingConfig: {
              ...this.state.chainingConfig,
              availableOids
            },
            chainingUpdated: 1
          }),
          this.setState({ chainingUpdated: 0 })
        );
      });
    }
    loadDefaultConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "config-get-def"
      ];
      log_cmd("loadDefaultConfig", "Load chaining default configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attr = config.attrs;
        let checkAci = false;
        let proxy = false;
        let refOnScope = false;
        let useStartTLS = false;
        if (attr.nschecklocalaci === "on") {
          checkAci = true;
        }
        if (attr.nsproxiedauthorization === "on") {
          proxy = true;
        }
        if (attr.nsreferralonscopedsearch === "on") {
          refOnScope = true;
        }
        if (attr.nsusestarttls === "on") {
          useStartTLS = true;
        }
        this.setState(() => ({
          chainingConfig: {
            ...this.state.chainingConfig,
            defSearchCheck: attr.nsabandonedsearchcheckinterval,
            defBindConnLimit: attr.nsbindconnectionslimit,
            defBindTimeout: attr.nsbindtimeout,
            defBindRetryLimit: attr.nsbindretrylimit,
            defConcurLimit: attr.nsconcurrentbindlimit,
            defConcurOpLimit: attr.nsconcurrentoperationslimit,
            defConnLife: attr.nsconnectionlife,
            defHopLimit: attr.nshoplimit,
            defDelay: attr.nsmaxresponsedelay,
            defTestDelay: attr.nsmaxtestresponsedelay,
            defOpConnLimit: attr.nsoperationconnectionslimit,
            defSizeLimit: attr["nsslapd-sizelimit"],
            defTimeLimit: attr["nsslapd-timelimit"],
            defProxy: proxy,
            defRefOnScoped: refOnScope,
            defCheckAci: checkAci,
            defUseStartTLS: useStartTLS
          }
        }), this.loadAvailableControls());
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_36("Error loading default chaining configuration - $0"), errMsg)
        );
        this.setState({
          loading: false
        });
      });
    }
    loadChainingConfig(tabIdx, reloading = false) {
      this.setState({ chainingConfigLoading: true });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "config-get"
      ];
      log_cmd("loadChainingConfig", "Load chaining OIDs and Controls", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        let availableComps = config.attrs.nspossiblechainingcomponents;
        let compList = [];
        let oidList = [];
        let activeKey = 0;
        if ("nsactivechainingcomponents" in config.attrs) {
          availableComps = config.attrs.nspossiblechainingcomponents.filter((el) => !config.attrs.nsactivechainingcomponents.includes(el));
          compList = config.attrs.nsactivechainingcomponents;
        }
        if ("nstransmittedcontrols" in config.attrs) {
          oidList = config.attrs.nstransmittedcontrols;
        }
        if (tabIdx) {
          activeKey = tabIdx;
        }
        this.setState(() => ({
          chainingConfig: {
            ...this.state.chainingConfig,
            oidList,
            compList,
            availableComps
          },
          chainingActiveKey: activeKey,
          chainingConfigLoaded: true,
          chainingConfigLoading: false
        }), () => {
          this.loadDefaultConfig();
          if (!reloading) {
            this.loadLDIFs();
          }
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_36("Error loading chaining configuration - $0"), errMsg)
        );
        this.setState({
          chainingConfigLoading: false,
          chainingConfigLoaded: true
        });
        if (!reloading) {
          this.loadLDIFs();
        }
      });
    }
    processTree(suffixData) {
      for (const suffix of suffixData) {
        if (suffix.type === "suffix") {
          suffix.icon = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TreeIcon, { size: "sm" });
        } else if (suffix.type === "subsuffix") {
          suffix.icon = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(LeafIcon, { size: "sm" });
        } else {
          suffix.icon = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(LinkIcon, { size: "sm" });
        }
        if (suffix.children.length === 0) {
          delete suffix.children;
        } else {
          this.processTree(suffix.children);
        }
      }
    }
    loadSuffixTree(fullReset, reloading = false) {
      this.setState({ suffixTreeLoading: true });
      const treeData = [
        {
          name: _36("Global Database Configuration"),
          icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CogIcon, {}),
          id: "dbconfig"
        },
        {
          name: _36("Chaining Configuration"),
          icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ExternalLinkAltIcon, {}),
          id: "chaining-config"
        },
        {
          name: _36("Backups & LDIFs"),
          icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CopyIcon, {}),
          id: "backups"
        },
        {
          name: _36("Password Policies"),
          id: "pwp",
          icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(KeyIcon, {}),
          children: [
            {
              name: _36("Global Policy"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(HomeIcon, {}),
              id: "pwpolicy"
            },
            {
              name: _36("Local Policies"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(UsersIcon, {}),
              id: "localpwpolicy"
            },
            {
              name: _36("Fix-up Tasks"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(WrenchIcon, {}),
              id: "pwp-fixup"
            }
          ],
          defaultExpanded: true
        },
        {
          name: _36("Suffixes"),
          icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CatalogIcon, {}),
          id: "suffixes-tree",
          children: [],
          defaultExpanded: true,
          action: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
            Button,
            {
              onClick: this.handleShowSuffixModal,
              variant: "plain",
              "aria-label": "Create new suffix",
              title: _36("Create new suffix"),
              children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_plus_icon3.PlusIcon, {})
            }
          )
        }
      ];
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "get-tree"
      ];
      log_cmd("loadSuffixTree", "Start building the suffix tree", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        let suffixData = [];
        if (content !== "") {
          suffixData = JSON.parse(content);
          this.processTree(suffixData);
        }
        let current_node = this.state.node_name;
        if (fullReset) {
          current_node = DB_CONFIG;
        }
        treeData[4].children = suffixData;
        this.setState(() => ({
          nodes: treeData,
          node_name: current_node,
          suffixTreeLoaded: true,
          suffixTreeLoading: false
        }), this.loadSchema);
      }).fail((err) => {
        let current_node = this.state.node_name;
        if (fullReset) {
          current_node = DB_CONFIG;
        }
        this.setState(() => ({
          nodes: treeData,
          node_name: current_node,
          suffixTreeLoaded: true,
          suffixTreeLoading: false
        }), this.loadSchema);
      });
    }
    loadChainingLink(suffix) {
      this.setState({
        chainingLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "chaining",
        "link-get",
        suffix
      ];
      log_cmd("loadChainingLink", "Load chaining link configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        let bindmech = "SIMPLE";
        let usestarttls = false;
        let refOnScope = false;
        let proxiedAuth = false;
        let checkLocalAci = false;
        if (config.attrs.nsreferralonscopedsearch[0] === "on") {
          refOnScope = true;
        }
        if (config.attrs.nsproxiedauthorization[0] === "on") {
          proxiedAuth = true;
        }
        if (config.attrs.nschecklocalaci[0] === "on") {
          checkLocalAci = true;
        }
        if (config.attrs.nsusestarttls[0] === "on") {
          usestarttls = true;
        }
        if (config.attrs.nsbindmechanism !== void 0) {
          bindmech = config.attrs.nsbindmechanism[0];
        }
        this.setState({
          [suffix]: {
            nsfarmserverurl: attrs.nsfarmserverurl[0],
            nsmultiplexorbinddn: attrs.nsmultiplexorbinddn[0],
            nsmultiplexorcredentials: attrs.nsmultiplexorcredentials[0],
            nsmultiplexorcredentials_confirm: attrs.nsmultiplexorcredentials[0],
            sizelimit: attrs["nsslapd-sizelimit"][0],
            timelimit: attrs["nsslapd-timelimit"][0],
            bindconnlimit: attrs.nsbindconnectionslimit[0],
            opconnlimit: attrs.nsoperationconnectionslimit[0],
            concurrbindlimit: attrs.nsconcurrentbindlimit[0],
            bindtimeout: attrs.nsbindtimeout[0],
            bindretrylimit: attrs.nsbindretrylimit[0],
            concurroplimit: attrs.nsconcurrentoperationslimit[0],
            connlifetime: attrs.nsconnectionlife[0],
            searchcheckinterval: attrs.nsabandonedsearchcheckinterval[0],
            hoplimit: attrs.nshoplimit[0],
            nsbindmechanism: bindmech,
            nsusestarttls: usestarttls,
            nsreferralonscopedsearch: refOnScope,
            nsproxiedauthorization: proxiedAuth,
            nschecklocalaci: checkLocalAci
          },
          chainingLoading: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_36("Error getting chaining link configuration - $0"), errMsg)
        );
      });
    }
    handleTreeClick(evt, treeViewItem, parentItem) {
      if (this.state.activeItems.length === 0 || treeViewItem === this.state.activeItems[0]) {
        this.setState({
          activeItems: [treeViewItem]
        });
        return;
      }
      if (treeViewItem.id === "dbconfig" || treeViewItem.id === "chaining-config" || treeViewItem.id === "pwpolicy" || treeViewItem.id === "localpwpolicy" || treeViewItem.id === "pwp-fixup" || treeViewItem.id === "backups") {
        this.setState((prevState) => {
          return {
            node_name: treeViewItem.id,
            node_text: treeViewItem.name,
            dbtype: treeViewItem.type,
            bename: "",
            activeItems: [treeViewItem, parentItem]
          };
        });
      } else if (treeViewItem.id !== "pwp" && treeViewItem.id !== "suffixes-tree") {
        if (treeViewItem.id in this.state) {
          this.setState((prevState) => {
            return {
              node_name: treeViewItem.id,
              node_text: treeViewItem.name,
              dbtype: treeViewItem.type,
              bename: treeViewItem.be,
              activeItems: [treeViewItem, parentItem]
            };
          });
        } else {
          this.setState({
            disableTree: true
            // Disable the tree to allow node to be fully loaded
          });
          if (treeViewItem.type === "dblink") {
            this.loadChainingLink(treeViewItem.id);
          } else {
            this.loadSuffix(treeViewItem.id);
          }
          this.setState((prevState) => {
            return {
              node_name: treeViewItem.id,
              node_text: treeViewItem.name,
              dbtype: treeViewItem.type,
              bename: treeViewItem.be,
              activeItems: [treeViewItem, parentItem]
            };
          });
        }
      }
    }
    update_tree_nodes() {
      this.setState({
        disableTree: false,
        loaded: true
      }, () => {
        const className = "pf-c-tree-view__list-item";
        const element = document.getElementById("suffixes-tree");
        if (element) {
          const elements = element.getElementsByClassName(className);
          for (const el of elements) {
            el.setAttribute("title", el.innerText);
          }
        }
      });
    }
    handleShowSuffixModal() {
      this.setState({
        showSuffixModal: true,
        createSuffixEntry: false,
        createSampleEntries: false,
        noSuffixInit: true,
        createInitOption: "noInit",
        errObj: {}
      });
    }
    onHandleSelectChange(_event, value) {
      let noInit = false;
      let addSuffix = false;
      let addSample = false;
      if (value === "noInit") {
        noInit = true;
      } else if (value === "addSuffix") {
        addSuffix = true;
      } else {
        addSample = true;
      }
      this.setState({
        createInitOption: value,
        noSuffixInit: noInit,
        createSuffixEntry: addSuffix,
        createSampleEntries: addSample
      });
    }
    onHandleChange(e, str) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      let createNotOK = false;
      if (value === "") {
        valueErr = true;
        createNotOK = true;
      } else if (e.target.id === "createSuffix" && !valid_dn(str)) {
        valueErr = true;
        createNotOK = true;
      } else if (e.target.id === "createBeName" && !valid_db_name(str)) {
        valueErr = true;
        createNotOK = true;
      }
      if (e.target.id !== "createSuffix") {
        if (!valid_dn(this.state.createSuffix)) {
          errObj.createSuffix = true;
          createNotOK = true;
        }
      }
      if (e.target.id !== "createBeName") {
        if (this.state.createBeName === "" || !valid_db_name(this.state.createBeName)) {
          errObj.createBeName = true;
          createNotOK = true;
        }
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj,
        createNotOK
      });
    }
    closeSuffixModal() {
      this.setState({
        showSuffixModal: false,
        createNotOK: true
      });
    }
    createSuffix() {
      let errors = false;
      const missingArgs = {
        createSuffix: false,
        createBeName: false
      };
      if (this.state.createSuffix === "") {
        this.props.addNotification(
          "warning",
          _36("Missing the suffix DN")
        );
        missingArgs.createSuffix = true;
        errors = true;
      }
      if (this.state.createBeName === "") {
        this.props.addNotification(
          "warning",
          _36("Missing the suffix backend name")
        );
        missingArgs.createBeName = true;
        errors = true;
      }
      if (errors) {
        this.setState({
          errObj: missingArgs
        });
        return;
      }
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "create",
        "--be-name",
        this.state.createBeName,
        "--suffix",
        this.state.createSuffix
      ];
      if (this.state.createSampleEntries) {
        cmd.push("--create-entries");
      }
      if (this.state.createSuffixEntry) {
        cmd.push("--create-suffix");
      }
      log_cmd("createSuffix", "Create a new backend", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.closeSuffixModal();
        this.props.addNotification(
          "success",
          _36("Successfully create new suffix")
        );
        this.loadSuffixTree(false);
        this.loadSuffixList(true);
        this.setState({
          modalSpinning: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_36("Error creating suffix - $0"), errMsg)
        );
        this.closeSuffixModal();
        this.setState({
          modalSpinning: false
        });
      });
    }
    getAutoTuning(suffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "config",
        "get"
      ];
      log_cmd("getAutoTuning", "Check cache auto tuning", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        if ("nsslapd-cache-autosize" in config.attrs && config.attrs["nsslapd-cache-autosize"][0] !== "0") {
          this.setState({
            [suffix]: {
              ...this.state[suffix],
              autoTuning: true
            }
          });
        }
      });
    }
    loadVLV(suffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "vlv-index",
        "list",
        suffix
      ];
      const tableKey = this.state.vlvTableKey + 1;
      log_cmd("loadVLV", "Load VLV indexes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            vlvItems: config.items
          },
          vlvTableKey: tableKey
        });
      });
    }
    loadAttrEncrypt(suffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "attr-encrypt",
        "--list",
        "--just-names",
        suffix
      ];
      log_cmd("loadAttrEncrypt", "Load encrypted attrs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const rows = [];
        for (const row of config.items) {
          rows.push(row);
        }
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            encAttrsRows: rows
          }
        });
      });
    }
    loadIndexes(suffix) {
      const index_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "index",
        "list",
        suffix
      ];
      log_cmd("loadIndexes", "Load backend indexes", index_cmd);
      cockpit_default.spawn(index_cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const rows = [];
        const systemRows = [];
        for (const item of config.items) {
          const index = item.attrs;
          let types = [];
          let mrs = "";
          if (index.nsindextype.length > 1) {
            types = index.nsindextype.join(", ");
          } else {
            types = index.nsindextype[0];
          }
          if ("nsmatchingrule" in index) {
            if (index.nsmatchingrule.length > 1) {
              mrs = index.nsmatchingrule.join(", ");
            } else {
              mrs = index.nsmatchingrule[0];
            }
          }
          if (index.nssystemindex[0] === "true") {
            systemRows.push([index.cn[0], types, mrs]);
          } else {
            rows.push([index.cn[0], types, mrs]);
          }
        }
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            indexRows: rows,
            systemIndexRows: systemRows
          }
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_36("Error loading indexes for $0 - $1"), suffix, errMsg)
        );
      });
    }
    loadReferrals(suffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "suffix",
        "get",
        suffix
      ];
      log_cmd("loadReferrals", "get referrals", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        let refs = [];
        if ("nsslapd-referral" in config.attrs) {
          refs = config.attrs["nsslapd-referral"];
        }
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            refRows: refs
          }
        });
      });
    }
    loadSuffix(suffix) {
      this.setState({
        activeKey: 1,
        suffixLoading: true,
        suffixConfigLoaded: false,
        suffixConfigLoading: true,
        suffixVlvLoaded: false,
        suffixVlvLoading: false,
        suffixAttrEncLoaded: false,
        suffixAttrEncLoading: false,
        suffixIndexesLoaded: false,
        suffixIndexesLoading: false
      }, this.loadSchema());
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "suffix",
        "get",
        suffix
      ];
      log_cmd("loadSuffix", "Load suffix config", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        let refs = [];
        let readonly = false;
        let requireindex = false;
        if ("nsslapd-referral" in config.attrs) {
          refs = config.attrs["nsslapd-referral"];
        }
        if ("nsslapd-readonly" in config.attrs) {
          if (config.attrs["nsslapd-readonly"][0] === "on") {
            readonly = true;
          }
        }
        if ("nsslapd-require-index" in config.attrs) {
          if (config.attrs["nsslapd-require-index"][0] === "on") {
            requireindex = true;
          }
        }
        this.setState({
          [suffix]: {
            refRows: refs,
            cachememsize: config.attrs["nsslapd-cachememsize"][0],
            cachesize: config.attrs["nsslapd-cachesize"][0],
            dncachememsize: config.attrs["nsslapd-dncachememsize"][0],
            dbstate: config.attrs["nsslapd-state"][0],
            readOnly: readonly,
            requireIndex: requireindex
          },
          suffixConfigLoaded: true,
          suffixConfigLoading: false,
          suffixVlvLoading: true
        }, this.getAutoTuning(suffix));
        const cmd2 = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "backend",
          "vlv-index",
          "list",
          suffix
        ];
        log_cmd("loadSuffix", "Load VLV indexes", cmd2);
        cockpit_default.spawn(cmd2, { superuser: true, err: "message" }).done((content2) => {
          const config2 = JSON.parse(content2);
          this.setState({
            [suffix]: {
              ...this.state[suffix],
              vlvItems: config2.items
            }
          }, () => {
            this.setState({
              suffixVlvLoaded: true,
              suffixVlvLoading: false,
              suffixAttrEncLoading: true
            });
          });
          const cmd3 = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "backend",
            "attr-encrypt",
            "--list",
            "--just-names",
            suffix
          ];
          log_cmd("loadAttrEncrypt", "Load encrypted attrs", cmd3);
          cockpit_default.spawn(cmd3, { superuser: true, err: "message" }).done((content3) => {
            const config3 = JSON.parse(content3);
            const rows = [];
            for (const row of config3.items) {
              rows.push(row);
            }
            this.setState({
              [suffix]: {
                ...this.state[suffix],
                encAttrsRows: rows
              }
            }, () => {
              this.setState({
                suffixAttrEncLoaded: true,
                suffixAttrEncLoading: false,
                suffixIndexesLoading: true
              });
            });
            const index_cmd = [
              "dsconf",
              "-j",
              "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
              "backend",
              "index",
              "list",
              suffix
            ];
            log_cmd("loadIndexes", "Load backend indexes", index_cmd);
            cockpit_default.spawn(index_cmd, { superuser: true, err: "message" }).done((content4) => {
              const config4 = JSON.parse(content4);
              const rows2 = [];
              const systemRows = [];
              for (const item of config4.items) {
                const index = item.attrs;
                let types = [];
                let mrs = [];
                if (index.nsindextype.length > 1) {
                  types = index.nsindextype.join(", ");
                } else {
                  types = index.nsindextype[0];
                }
                if ("nsmatchingrule" in index) {
                  if (index.nsmatchingrule.length > 1) {
                    mrs = index.nsmatchingrule.join(", ");
                  } else {
                    mrs = index.nsmatchingrule[0];
                  }
                }
                if (index.nssystemindex[0] === "true") {
                  systemRows.push([index.cn[0], types, mrs]);
                } else {
                  rows2.push([index.cn[0], types, mrs]);
                }
              }
              this.setState({
                [suffix]: {
                  ...this.state[suffix],
                  indexRows: rows2,
                  systemIndexRows: systemRows
                },
                suffixIndexesLoaded: true,
                suffixIndexesLoading: false,
                suffixLoading: false
              });
            }).fail((err) => {
              const errMsg = getApiErrorMessage(err);
              this.props.addNotification(
                "error",
                cockpit_default.format(_36("Error loading indexes for $0 - $1"), suffix, errMsg)
              );
              this.setState({
                suffixIndexesLoading: false,
                suffixLoading: false
              });
            });
          }).fail((err) => {
            const errMsg = getApiErrorMessage(err);
            this.props.addNotification(
              "error",
              cockpit_default.format(_36("Error attribute encryption for $0 - $1"), suffix, errMsg)
            );
            this.setState({
              suffixAttrEncLoading: false,
              suffixLoading: false
            });
          });
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.addNotification(
            "error",
            cockpit_default.format(_36("Error loading VLV indexes for $0 - $1"), suffix, errMsg)
          );
          this.setState({
            suffixVlvLoading: false,
            suffixLoading: false
          });
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_36("Error loading config for $0 - $1"), suffix, errMsg)
        );
        this.setState({
          suffixConfigLoading: false,
          suffixLoading: false
        });
      });
    }
    loadLDIFs(reloading = false) {
      this.setState({ ldifsLoading: true });
      const cmd = [
        "dsctl",
        "-j",
        this.props.serverId,
        "ldifs"
      ];
      log_cmd("loadLDIFs", "Load LDIF Files", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const rows = [];
        for (const row of config.items) {
          rows.push([row[0], row[1], row[2], row[3]]);
        }
        this.setState({
          LDIFRows: rows,
          backupRefreshing: false,
          ldifsLoaded: true,
          ldifsLoading: false
        }, () => {
          if (!reloading) {
            this.loadBackups();
          }
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_36("Error loading LDIF files - $0"), errMsg)
        );
        this.setState({
          ldifsLoading: false,
          ldifsLoaded: true
        });
        if (!reloading) {
          this.loadBackups();
        }
      });
    }
    loadBackups(refreshing, reloading = false) {
      if (refreshing) {
        this.setState({
          backupRefreshing: true
        });
      }
      this.setState({ backupsLoading: true });
      const cmd = [
        "dsctl",
        "-j",
        this.props.serverId,
        "backups"
      ];
      log_cmd("loadBackupsDatabase", "Load Backups", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const rows = [];
        for (const row of config.items) {
          rows.push([row[0], row[1], row[2]]);
        }
        this.setState({
          BackupRows: rows,
          backupsLoaded: true,
          backupsLoading: false,
          backupRefreshing: false
        }, () => {
          if (!reloading && !refreshing) {
            this.loadPwdStorageSchemes();
          }
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_36("Error loading backups - $0"), errMsg)
        );
        this.setState({
          backupsLoading: false,
          backupRefreshing: false,
          backupsLoaded: true
        });
        if (!reloading && !refreshing) {
          this.loadPwdStorageSchemes();
        }
      });
    }
    loadSchema() {
      const attr_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "list"
      ];
      log_cmd("loadSchema", "Plugins Get attrs", attr_cmd);
      cockpit_default.spawn(attr_cmd, { superuser: true, err: "message" }).done((content) => {
        const attrContent = JSON.parse(content);
        const attrs = [];
        for (const content2 of attrContent.items) {
          attrs.push(content2.name[0]);
        }
        const oc_cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "schema",
          "objectclasses",
          "list"
        ];
        log_cmd("loadSchema", "Get objectClasses", oc_cmd);
        cockpit_default.spawn(oc_cmd, { superuser: true, err: "message" }).done((content2) => {
          const ocContent = JSON.parse(content2);
          const ocs = [];
          for (const content3 of ocContent.items) {
            ocs.push(content3.name[0]);
          }
          this.setState({
            attributes: attrs,
            objectClasses: ocs,
            attributesFullData: attrContent.items
          }, this.update_tree_nodes);
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_36("Error loading schema - $0"), errMsg)
        );
        this.update_tree_nodes();
      });
    }
    enableTree() {
      this.setState({
        disableTree: false
      });
    }
    render() {
      let db_element = "";
      let body = "";
      let disabled = "tree-view-container";
      if (this.state.disableTree) {
        disabled = "tree-view-container ds-disabled";
      }
      if (this.state.loaded) {
        if (this.state.node_name === DB_CONFIG || this.state.node_name === "") {
          if (this.state.backendImplement === BE_IMPL_BDB) {
            db_element = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
              GlobalDatabaseConfig,
              {
                serverId: this.props.serverId,
                addNotification: this.props.addNotification,
                reload: (activeTab) => this.loadGlobalConfig(activeTab, true),
                data: this.state.globalDBConfig,
                enableTree: this.enableTree,
                objectClasses: this.state.objectClasses,
                attributes: this.state.attributesFullData,
                loading: this.state.globalConfigLoading
              },
              this.state.configUpdated
            );
          } else if (this.state.backendImplement === BE_IMPL_MDB) {
            db_element = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
              GlobalDatabaseConfigMDB,
              {
                serverId: this.props.serverId,
                addNotification: this.props.addNotification,
                reload: (activeTab) => this.loadGlobalConfig(activeTab, true),
                data: this.state.globalDBConfig,
                enableTree: this.enableTree,
                attributes: this.state.attributesFullData,
                objectClasses: this.state.objectClasses,
                loading: this.state.globalConfigLoading
              },
              this.state.configUpdated
            );
          }
        } else if (this.state.node_name === CHAINING_CONFIG) {
          db_element = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
            ChainingDatabaseConfig,
            {
              serverId: this.props.serverId,
              addNotification: this.props.addNotification,
              reload: (tabIdx) => this.loadChainingConfig(tabIdx, true),
              data: this.state.chainingConfig,
              enableTree: this.enableTree,
              activeKey: this.state.chainingActiveKey
            },
            this.state.chainingUpdated
          );
        } else if (this.state.node_name === PWP_CONFIG) {
          db_element = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
            GlobalPwPolicy,
            {
              serverId: this.props.serverId,
              addNotification: this.props.addNotification,
              attrs: this.state.attributes,
              pwdStorageSchemes: this.state.pwdStorageSchemes,
              enableTree: this.enableTree
            }
          );
        } else if (this.state.node_name === LOCAL_PWP_CONFIG) {
          db_element = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
            LocalPwPolicy,
            {
              serverId: this.props.serverId,
              addNotification: this.props.addNotification,
              attrs: this.state.attributes,
              pwdStorageSchemes: this.state.pwdStorageSchemes,
              enableTree: this.enableTree
            }
          );
        } else if (this.state.node_name === PWP_FIXUP_TASK) {
          db_element = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
            PwpFixupTasks,
            {
              serverId: this.props.serverId,
              addNotification: this.props.addNotification,
              suffixes: this.state.suffixList
            }
          );
        } else if (this.state.node_name === BACKUP_CONFIG) {
          db_element = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
            Backups,
            {
              serverId: this.props.serverId,
              addNotification: this.props.addNotification,
              backups: this.state.BackupRows,
              suffixes: this.state.suffixList,
              ldifs: this.state.LDIFRows,
              enableTree: this.enableTree,
              handleReload: (refreshing) => this.loadBackups(refreshing, true),
              handleLDIFReload: (refreshing) => this.loadLDIFs(refreshing, true),
              refreshing: this.state.backupRefreshing
            }
          );
        } else if (this.state.node_name !== "") {
          if (this.state.dbtype === "suffix" || this.state.dbtype === "subsuffix") {
            if (this.state.suffixLoading) {
              db_element = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "ds-margin-top-xlg ds-loading-spinner ds-center", children: [
                /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { className: "ds-margin-top-xlg", component: TextVariants.h3, children: [
                  _36("Loading suffix configuration for "),
                  /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("b", { children: [
                    this.state.node_text,
                    " ..."
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Spinner, { isInline: true, className: "ds-left-margin", size: "lg" })
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
                  ProgressStepper,
                  {
                    className: "ds-margin-top-xlg",
                    "aria-label": "Progress stepper for suffix loading stages",
                    isCenterAligned: true,
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
                        ProgressStep,
                        {
                          isCurrent: this.state.suffixConfigLoading,
                          variant: this.state.suffixConfigLoaded ? "success" : "pending",
                          icon: !this.state.suffixConfigLoaded ? this.state.suffixConfigLoading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(check_circle_icon_default, {}),
                          id: "suffixConfigLoading",
                          titleId: "load suffix configuration",
                          "aria-label": "Loading suffix configuration step",
                          children: !this.state.suffixConfigLoaded ? _36("Loading Suffix Config") : _36("Suffix Config Loaded")
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
                        ProgressStep,
                        {
                          isCurrent: this.state.suffixVlvLoading,
                          variant: this.state.suffixVlvLoaded ? "success" : "pending",
                          icon: !this.state.suffixVlvLoaded ? this.state.suffixVlvLoading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(check_circle_icon_default, {}),
                          id: "suffixVlvLoading",
                          titleId: "load suffix vlv indexes",
                          "aria-label": "Loading suffix vlv indexes step",
                          children: !this.state.suffixVlvLoaded ? _36("Loading VLV Indexes") : _36("VLV Indexes Loaded")
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
                        ProgressStep,
                        {
                          isCurrent: this.state.suffixAttrEncLoading,
                          variant: this.state.suffixAttrEncLoaded ? "success" : "pending",
                          icon: !this.state.suffixAttrEncLoaded ? this.state.suffixAttrEncLoading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(check_circle_icon_default, {}),
                          id: "suffixAttrEncLoading",
                          titleId: "load suffix attribute encryption",
                          "aria-label": "Loading suffix attribute encryption step",
                          children: !this.state.suffixAttrEncLoaded ? _36("Loading Attribute Encryption") : _36("Attribute Encryption Loaded")
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
                        ProgressStep,
                        {
                          isCurrent: this.state.suffixIndexesLoading,
                          variant: this.state.suffixIndexesLoaded ? "success" : "pending",
                          icon: !this.state.suffixIndexesLoaded ? this.state.suffixIndexesLoading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(check_circle_icon_default, {}),
                          id: "suffixIndexesLoading",
                          titleId: "load suffix indexes",
                          "aria-label": "Loading suffix indexes step",
                          children: !this.state.suffixIndexesLoaded ? _36("Loading Indexes") : _36("Indexes Loaded")
                        }
                      )
                    ]
                  }
                )
              ] });
            } else {
              db_element = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
                Suffix,
                {
                  serverId: this.props.serverId,
                  suffix: this.state.node_text,
                  bename: this.state.bename,
                  loadSuffixTree: this.loadSuffixTree,
                  reload: this.loadSuffix,
                  reloadRefs: this.loadReferrals,
                  reloadIndexes: this.loadIndexes,
                  reloadVLV: this.loadVLV,
                  vlvTableKey: this.state.vlvTableKey,
                  reloadAttrEnc: this.loadAttrEncrypt,
                  addNotification: this.props.addNotification,
                  reloadLDIFs: () => this.loadLDIFs(true),
                  LDIFRows: this.state.LDIFRows,
                  dbtype: this.state.dbtype,
                  data: this.state[this.state.node_text],
                  attrs: this.state.attributes,
                  enableTree: this.enableTree
                },
                this.state.node_text
              );
            }
          } else {
            if (this.state.chainingLoading) {
              db_element = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "ds-margin-top ds-loading-spinner ds-center", children: [
                /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { className: "ds-margin-top-xlg", component: TextVariants.h2, children: [
                  _36("Loading Chaining configuration for "),
                  /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("b", { children: [
                    this.state.node_text,
                    " ..."
                  ] })
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
              ] });
            } else {
              db_element = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
                ChainingConfig,
                {
                  serverId: this.props.serverId,
                  suffix: this.state.node_text,
                  bename: this.state.bename,
                  loadSuffixTree: this.loadSuffixTree,
                  addNotification: this.props.addNotification,
                  data: this.state[this.state.node_text],
                  enableTree: this.enableTree,
                  reload: this.loadChainingLink
                }
              );
            }
          }
        }
        body = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "ds-container", children: [
          /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Card, { className: "ds-tree", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: disabled, id: "db-tree", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
            TreeView,
            {
              hasSelectableNodes: true,
              data: this.state.nodes,
              activeItems: this.state.activeItems,
              onSelect: this.handleTreeClick
            }
          ) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "ds-tree-content", children: db_element })
        ] });
      } else {
        body = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text, { className: "ds-margin-top-xlg", component: TextVariants.h3, children: [
            _36("Loading Database Configuration ..."),
            /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Spinner, { isInline: true, className: "ds-left-margin", size: "lg" })
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
            ProgressStepper,
            {
              className: "ds-margin-top-xlg",
              "aria-label": "Progress stepper for database loading stages",
              isCenterAligned: true,
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.globalConfigLoading,
                    variant: this.state.globalConfigLoaded ? "success" : "pending",
                    icon: !this.state.globalConfigLoaded ? this.state.globalConfigLoading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(check_circle_icon_default, {}),
                    id: "globalConfigLoading",
                    titleId: "load database global configuration",
                    "aria-label": "Loading database global configuration step",
                    children: !this.state.globalConfigLoaded ? _36("Loading Global Config") : _36("Global Config Loaded")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.chainingConfigLoading,
                    variant: this.state.chainingConfigLoaded ? "success" : "pending",
                    icon: !this.state.chainingConfigLoaded ? this.state.chainingConfigLoading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(check_circle_icon_default, {}),
                    id: "chainingConfigLoading",
                    titleId: "load database chaining configuration",
                    "aria-label": "Loading database chaining configuration step",
                    children: !this.state.chainingConfigLoaded ? _36("Loading Chaining Config") : _36("Chaining Config Loaded")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.ldifsLoading,
                    variant: this.state.ldifsLoaded ? "success" : "pending",
                    icon: !this.state.ldifsLoaded ? this.state.ldifsLoading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(check_circle_icon_default, {}),
                    id: "ldifLoading",
                    titleId: "load ldif files",
                    "aria-label": "Loading ldif files step",
                    children: !this.state.ldifsLoaded ? _36("Loading LDIFs") : _36("LDIFs Loaded")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.backupsLoading,
                    variant: this.state.backupsLoaded ? "success" : "pending",
                    icon: !this.state.backupsLoaded ? this.state.backupsLoading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(check_circle_icon_default, {}),
                    id: "backupLoading",
                    titleId: "load backup files",
                    "aria-label": "Loading backup files step",
                    children: !this.state.backupsLoaded ? _36("Loading Backups") : _36("Backups Loaded")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.pwdSchemesLoading,
                    variant: this.state.pwdSchemesLoaded ? "success" : "pending",
                    icon: !this.state.pwdSchemesLoaded ? this.state.pwdSchemesLoading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(check_circle_icon_default, {}),
                    id: "pwdSchemesLoading",
                    titleId: "load password storage schemes",
                    "aria-label": "Loading password storage schemes step",
                    children: !this.state.pwdSchemesLoaded ? _36("Loading Password Schemes") : _36("Password Schemes Loaded")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.suffixListLoading,
                    variant: this.state.suffixListLoaded ? "success" : "pending",
                    icon: !this.state.suffixListLoaded ? this.state.suffixListLoading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(check_circle_icon_default, {}),
                    id: "suffixListLoading",
                    titleId: "load suffix list",
                    "aria-label": "Loading suffix list step",
                    children: !this.state.suffixListLoaded ? _36("Loading Suffix List") : _36("Suffix List Loaded")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.suffixTreeLoading,
                    variant: this.state.suffixTreeLoaded ? "success" : "pending",
                    icon: !this.state.suffixTreeLoaded ? this.state.suffixTreeLoading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(check_circle_icon_default, {}),
                    id: "suffixTreeLoading",
                    titleId: "load suffix tree",
                    "aria-label": "Loading suffix tree step",
                    children: !this.state.suffixTreeLoaded ? _36("Loading Suffix Tree") : _36("Suffix Tree Loaded")
                  }
                )
              ]
            }
          )
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "container-fluid", children: [
        body,
        /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
          CreateSuffixModal,
          {
            showModal: this.state.showSuffixModal,
            closeHandler: this.closeSuffixModal,
            handleChange: this.onHandleChange,
            handleSelectChange: this.onHandleSelectChange,
            saveHandler: this.createSuffix,
            initOption: this.state.createInitOption,
            createNotOK: this.state.createNotOK,
            modalSpinning: this.state.modalSpinning,
            error: this.state.errObj
          }
        )
      ] });
    }
  };
  var CreateSuffixModal = class extends import_react57.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        handleSelectChange,
        saveHandler,
        createNotOK,
        initOption,
        modalSpinning,
        error
      } = this.props;
      let saveBtnName = _36("Create Suffix");
      const extraPrimaryProps = {};
      if (modalSpinning) {
        saveBtnName = _36("Creating ...");
        extraPrimaryProps.spinnerAriaValueText = _36("Creating");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title: _36("Create New Suffix"),
          isOpen: showModal,
          "aria-labelledby": "ds-modal",
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
              Button,
              {
                variant: "primary",
                onClick: saveHandler,
                isDisabled: createNotOK || modalSpinning,
                isLoading: modalSpinning,
                spinnerAriaValueText: modalSpinning ? _36("Creating Suffix") : void 0,
                ...extraPrimaryProps,
                children: saveBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Button, { variant: "link", onClick: closeHandler, children: _36("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
              FormGroup,
              {
                label: _36("Suffix DN"),
                fieldId: "createSuffix",
                title: _36("Database suffix, like 'dc=example,dc=com'.  The suffix must be a valid LDAP Distinguished Name (DN)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
                    TextInput,
                    {
                      isRequired: true,
                      type: "text",
                      id: "createSuffix",
                      "aria-describedby": "createSuffix",
                      name: "createSuffix",
                      onChange: handleChange,
                      validated: error.createSuffix ? "error" : "noval"
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormHelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(HelperTextItem, { icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_exclamation_circle_icon10.ExclamationCircleIcon, {}), variant: error.createSuffix ? "error" : "default", children: error.createBeName ? "The DN of the suffix is invalid" : "Required field" }) }) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
              FormGroup,
              {
                label: _36("Database Name"),
                fieldId: "suffixName",
                title: _36("The name for the backend database, like 'userroot'.  The name can be a combination of alphanumeric characters, dashes (-), and underscores (_). No other characters are allowed, and the name must be unique across all backends."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
                    TextInput,
                    {
                      isRequired: true,
                      type: "text",
                      id: "createBeName",
                      "aria-describedby": "createBeName",
                      name: "suffixName",
                      onChange: handleChange,
                      validated: error.createBeName ? "error" : "noval"
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormHelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(HelperTextItem, { icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_exclamation_circle_icon10.ExclamationCircleIcon, {}), variant: error.createBeName ? "error" : "default", children: error.createBeName ? "You must enter a name for the database" : "Required field" }) }) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
              FormGroup,
              {
                label: _36("Initialization Option"),
                fieldId: "initOptions",
                children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(FormSelect, { value: initOption, onChange: handleSelectChange, "aria-label": "FormSelect Input", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormSelectOption, { value: "noInit", label: _36("Do Not Initialize Database") }, 1),
                  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormSelectOption, { value: "addSuffix", label: _36("Create The Top Suffix Entry") }, 2),
                  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormSelectOption, { value: "addSample", label: _36("Add Sample Entries") }, 3)
                ] })
              }
            )
          ] })
        }
      );
    }
  };
  Database.propTypes = {
    addNotification: import_prop_types35.PropTypes.func,
    serverId: import_prop_types35.PropTypes.string
  };
  Database.defaultProps = {
    serverId: ""
  };
  CreateSuffixModal.propTypes = {
    showModal: import_prop_types35.PropTypes.bool,
    closeHandler: import_prop_types35.PropTypes.func,
    handleChange: import_prop_types35.PropTypes.func,
    handleSelectChange: import_prop_types35.PropTypes.func,
    saveHandler: import_prop_types35.PropTypes.func,
    modalSpinning: import_prop_types35.PropTypes.bool,
    error: import_prop_types35.PropTypes.object
  };
  CreateSuffixModal.defaultProps = {
    showModal: false,
    modalSpinning: false,
    error: {}
  };

  // src/monitor.jsx
  var import_react124 = __toESM(require_react(), 1);
  var import_prop_types53 = __toESM(require_prop_types(), 1);

  // src/lib/monitor/serverMonitor.jsx
  var import_react109 = __toESM(require_react(), 1);
  var import_prop_types38 = __toESM(require_prop_types(), 1);

  // src/lib/monitor/monitorTables.jsx
  var import_react108 = __toESM(require_react(), 1);
  var import_exclamation_triangle_icon9 = __toESM(require_exclamation_triangle_icon(), 1);
  var import_prop_types37 = __toESM(require_prop_types(), 1);

  // src/lib/monitor/monitorModals.jsx
  var import_react107 = __toESM(require_react(), 1);
  var import_prop_types36 = __toESM(require_prop_types(), 1);

  // node_modules/@patternfly/react-charts/dist/esm/components/Chart/Chart.js
  init_tslib_es6();
  var React325 = __toESM(require_react());
  var import_hoist_non_react_statics4 = __toESM(require_hoist_non_react_statics_cjs());

  // node_modules/@patternfly/react-tokens/dist/esm/chart_legend_Margin.js
  var chart_legend_Margin = {
    "name": "--pf-v5-chart-legend--Margin",
    "value": 16,
    "var": "var(--pf-v5-chart-legend--Margin, 16)"
  };
  var chart_legend_Margin_default = chart_legend_Margin;

  // node_modules/victory-chart/es/victory-chart.js
  var import_react93 = __toESM(require_react());
  var import_defaults22 = __toESM(require_defaults());
  var import_isEmpty8 = __toESM(require_isEmpty());

  // node_modules/victory-core/es/victory-animation/victory-animation.js
  var import_react59 = __toESM(require_react());

  // node_modules/victory-vendor/es/d3-ease.js
  var d3_ease_exports = {};
  __export(d3_ease_exports, {
    easeBack: () => backInOut,
    easeBackIn: () => backIn,
    easeBackInOut: () => backInOut,
    easeBackOut: () => backOut,
    easeBounce: () => bounceOut,
    easeBounceIn: () => bounceIn,
    easeBounceInOut: () => bounceInOut,
    easeBounceOut: () => bounceOut,
    easeCircle: () => circleInOut,
    easeCircleIn: () => circleIn,
    easeCircleInOut: () => circleInOut,
    easeCircleOut: () => circleOut,
    easeCubic: () => cubicInOut,
    easeCubicIn: () => cubicIn,
    easeCubicInOut: () => cubicInOut,
    easeCubicOut: () => cubicOut,
    easeElastic: () => elasticOut,
    easeElasticIn: () => elasticIn,
    easeElasticInOut: () => elasticInOut,
    easeElasticOut: () => elasticOut,
    easeExp: () => expInOut,
    easeExpIn: () => expIn,
    easeExpInOut: () => expInOut,
    easeExpOut: () => expOut,
    easeLinear: () => linear,
    easePoly: () => polyInOut,
    easePolyIn: () => polyIn,
    easePolyInOut: () => polyInOut,
    easePolyOut: () => polyOut,
    easeQuad: () => quadInOut,
    easeQuadIn: () => quadIn,
    easeQuadInOut: () => quadInOut,
    easeQuadOut: () => quadOut,
    easeSin: () => sinInOut,
    easeSinIn: () => sinIn,
    easeSinInOut: () => sinInOut,
    easeSinOut: () => sinOut
  });

  // node_modules/d3-ease/src/linear.js
  var linear = (t) => +t;

  // node_modules/d3-ease/src/quad.js
  function quadIn(t) {
    return t * t;
  }
  function quadOut(t) {
    return t * (2 - t);
  }
  function quadInOut(t) {
    return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2;
  }

  // node_modules/d3-ease/src/cubic.js
  function cubicIn(t) {
    return t * t * t;
  }
  function cubicOut(t) {
    return --t * t * t + 1;
  }
  function cubicInOut(t) {
    return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
  }

  // node_modules/d3-ease/src/poly.js
  var exponent = 3;
  var polyIn = function custom(e) {
    e = +e;
    function polyIn2(t) {
      return Math.pow(t, e);
    }
    polyIn2.exponent = custom;
    return polyIn2;
  }(exponent);
  var polyOut = function custom2(e) {
    e = +e;
    function polyOut2(t) {
      return 1 - Math.pow(1 - t, e);
    }
    polyOut2.exponent = custom2;
    return polyOut2;
  }(exponent);
  var polyInOut = function custom3(e) {
    e = +e;
    function polyInOut2(t) {
      return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;
    }
    polyInOut2.exponent = custom3;
    return polyInOut2;
  }(exponent);

  // node_modules/d3-ease/src/sin.js
  var pi = Math.PI;
  var halfPi = pi / 2;
  function sinIn(t) {
    return +t === 1 ? 1 : 1 - Math.cos(t * halfPi);
  }
  function sinOut(t) {
    return Math.sin(t * halfPi);
  }
  function sinInOut(t) {
    return (1 - Math.cos(pi * t)) / 2;
  }

  // node_modules/d3-ease/src/math.js
  function tpmt(x2) {
    return (Math.pow(2, -10 * x2) - 9765625e-10) * 1.0009775171065494;
  }

  // node_modules/d3-ease/src/exp.js
  function expIn(t) {
    return tpmt(1 - +t);
  }
  function expOut(t) {
    return 1 - tpmt(t);
  }
  function expInOut(t) {
    return ((t *= 2) <= 1 ? tpmt(1 - t) : 2 - tpmt(t - 1)) / 2;
  }

  // node_modules/d3-ease/src/circle.js
  function circleIn(t) {
    return 1 - Math.sqrt(1 - t * t);
  }
  function circleOut(t) {
    return Math.sqrt(1 - --t * t);
  }
  function circleInOut(t) {
    return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;
  }

  // node_modules/d3-ease/src/bounce.js
  var b1 = 4 / 11;
  var b2 = 6 / 11;
  var b3 = 8 / 11;
  var b4 = 3 / 4;
  var b5 = 9 / 11;
  var b6 = 10 / 11;
  var b7 = 15 / 16;
  var b8 = 21 / 22;
  var b9 = 63 / 64;
  var b0 = 1 / b1 / b1;
  function bounceIn(t) {
    return 1 - bounceOut(1 - t);
  }
  function bounceOut(t) {
    return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;
  }
  function bounceInOut(t) {
    return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;
  }

  // node_modules/d3-ease/src/back.js
  var overshoot = 1.70158;
  var backIn = function custom4(s2) {
    s2 = +s2;
    function backIn2(t) {
      return (t = +t) * t * (s2 * (t - 1) + t);
    }
    backIn2.overshoot = custom4;
    return backIn2;
  }(overshoot);
  var backOut = function custom5(s2) {
    s2 = +s2;
    function backOut2(t) {
      return --t * t * ((t + 1) * s2 + t) + 1;
    }
    backOut2.overshoot = custom5;
    return backOut2;
  }(overshoot);
  var backInOut = function custom6(s2) {
    s2 = +s2;
    function backInOut2(t) {
      return ((t *= 2) < 1 ? t * t * ((s2 + 1) * t - s2) : (t -= 2) * t * ((s2 + 1) * t + s2) + 2) / 2;
    }
    backInOut2.overshoot = custom6;
    return backInOut2;
  }(overshoot);

  // node_modules/d3-ease/src/elastic.js
  var tau = 2 * Math.PI;
  var amplitude = 1;
  var period = 0.3;
  var elasticIn = function custom7(a2, p) {
    var s2 = Math.asin(1 / (a2 = Math.max(1, a2))) * (p /= tau);
    function elasticIn2(t) {
      return a2 * tpmt(- --t) * Math.sin((s2 - t) / p);
    }
    elasticIn2.amplitude = function(a3) {
      return custom7(a3, p * tau);
    };
    elasticIn2.period = function(p2) {
      return custom7(a2, p2);
    };
    return elasticIn2;
  }(amplitude, period);
  var elasticOut = function custom8(a2, p) {
    var s2 = Math.asin(1 / (a2 = Math.max(1, a2))) * (p /= tau);
    function elasticOut2(t) {
      return 1 - a2 * tpmt(t = +t) * Math.sin((t + s2) / p);
    }
    elasticOut2.amplitude = function(a3) {
      return custom8(a3, p * tau);
    };
    elasticOut2.period = function(p2) {
      return custom8(a2, p2);
    };
    return elasticOut2;
  }(amplitude, period);
  var elasticInOut = function custom9(a2, p) {
    var s2 = Math.asin(1 / (a2 = Math.max(1, a2))) * (p /= tau);
    function elasticInOut2(t) {
      return ((t = t * 2 - 1) < 0 ? a2 * tpmt(-t) * Math.sin((s2 - t) / p) : 2 - a2 * tpmt(t) * Math.sin((s2 + t) / p)) / 2;
    }
    elasticInOut2.amplitude = function(a3) {
      return custom9(a3, p * tau);
    };
    elasticInOut2.period = function(p2) {
      return custom9(a2, p2);
    };
    return elasticInOut2;
  }(amplitude, period);

  // node_modules/victory-core/es/victory-animation/util.js
  var import_isPlainObject = __toESM(require_isPlainObject());
  var import_orderBy = __toESM(require_orderBy());

  // node_modules/d3-color/src/define.js
  function define_default(constructor, factory2, prototype) {
    constructor.prototype = factory2.prototype = prototype;
    prototype.constructor = constructor;
  }
  function extend(parent2, definition) {
    var prototype = Object.create(parent2.prototype);
    for (var key in definition) prototype[key] = definition[key];
    return prototype;
  }

  // node_modules/d3-color/src/color.js
  function Color() {
  }
  var darker = 0.7;
  var brighter = 1 / darker;
  var reI = "\\s*([+-]?\\d+)\\s*";
  var reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*";
  var reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*";
  var reHex = /^#([0-9a-f]{3,8})$/;
  var reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`);
  var reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`);
  var reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`);
  var reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`);
  var reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`);
  var reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
  var named = {
    aliceblue: 15792383,
    antiquewhite: 16444375,
    aqua: 65535,
    aquamarine: 8388564,
    azure: 15794175,
    beige: 16119260,
    bisque: 16770244,
    black: 0,
    blanchedalmond: 16772045,
    blue: 255,
    blueviolet: 9055202,
    brown: 10824234,
    burlywood: 14596231,
    cadetblue: 6266528,
    chartreuse: 8388352,
    chocolate: 13789470,
    coral: 16744272,
    cornflowerblue: 6591981,
    cornsilk: 16775388,
    crimson: 14423100,
    cyan: 65535,
    darkblue: 139,
    darkcyan: 35723,
    darkgoldenrod: 12092939,
    darkgray: 11119017,
    darkgreen: 25600,
    darkgrey: 11119017,
    darkkhaki: 12433259,
    darkmagenta: 9109643,
    darkolivegreen: 5597999,
    darkorange: 16747520,
    darkorchid: 10040012,
    darkred: 9109504,
    darksalmon: 15308410,
    darkseagreen: 9419919,
    darkslateblue: 4734347,
    darkslategray: 3100495,
    darkslategrey: 3100495,
    darkturquoise: 52945,
    darkviolet: 9699539,
    deeppink: 16716947,
    deepskyblue: 49151,
    dimgray: 6908265,
    dimgrey: 6908265,
    dodgerblue: 2003199,
    firebrick: 11674146,
    floralwhite: 16775920,
    forestgreen: 2263842,
    fuchsia: 16711935,
    gainsboro: 14474460,
    ghostwhite: 16316671,
    gold: 16766720,
    goldenrod: 14329120,
    gray: 8421504,
    green: 32768,
    greenyellow: 11403055,
    grey: 8421504,
    honeydew: 15794160,
    hotpink: 16738740,
    indianred: 13458524,
    indigo: 4915330,
    ivory: 16777200,
    khaki: 15787660,
    lavender: 15132410,
    lavenderblush: 16773365,
    lawngreen: 8190976,
    lemonchiffon: 16775885,
    lightblue: 11393254,
    lightcoral: 15761536,
    lightcyan: 14745599,
    lightgoldenrodyellow: 16448210,
    lightgray: 13882323,
    lightgreen: 9498256,
    lightgrey: 13882323,
    lightpink: 16758465,
    lightsalmon: 16752762,
    lightseagreen: 2142890,
    lightskyblue: 8900346,
    lightslategray: 7833753,
    lightslategrey: 7833753,
    lightsteelblue: 11584734,
    lightyellow: 16777184,
    lime: 65280,
    limegreen: 3329330,
    linen: 16445670,
    magenta: 16711935,
    maroon: 8388608,
    mediumaquamarine: 6737322,
    mediumblue: 205,
    mediumorchid: 12211667,
    mediumpurple: 9662683,
    mediumseagreen: 3978097,
    mediumslateblue: 8087790,
    mediumspringgreen: 64154,
    mediumturquoise: 4772300,
    mediumvioletred: 13047173,
    midnightblue: 1644912,
    mintcream: 16121850,
    mistyrose: 16770273,
    moccasin: 16770229,
    navajowhite: 16768685,
    navy: 128,
    oldlace: 16643558,
    olive: 8421376,
    olivedrab: 7048739,
    orange: 16753920,
    orangered: 16729344,
    orchid: 14315734,
    palegoldenrod: 15657130,
    palegreen: 10025880,
    paleturquoise: 11529966,
    palevioletred: 14381203,
    papayawhip: 16773077,
    peachpuff: 16767673,
    peru: 13468991,
    pink: 16761035,
    plum: 14524637,
    powderblue: 11591910,
    purple: 8388736,
    rebeccapurple: 6697881,
    red: 16711680,
    rosybrown: 12357519,
    royalblue: 4286945,
    saddlebrown: 9127187,
    salmon: 16416882,
    sandybrown: 16032864,
    seagreen: 3050327,
    seashell: 16774638,
    sienna: 10506797,
    silver: 12632256,
    skyblue: 8900331,
    slateblue: 6970061,
    slategray: 7372944,
    slategrey: 7372944,
    snow: 16775930,
    springgreen: 65407,
    steelblue: 4620980,
    tan: 13808780,
    teal: 32896,
    thistle: 14204888,
    tomato: 16737095,
    turquoise: 4251856,
    violet: 15631086,
    wheat: 16113331,
    white: 16777215,
    whitesmoke: 16119285,
    yellow: 16776960,
    yellowgreen: 10145074
  };
  define_default(Color, color, {
    copy(channels) {
      return Object.assign(new this.constructor(), this, channels);
    },
    displayable() {
      return this.rgb().displayable();
    },
    hex: color_formatHex,
    // Deprecated! Use color.formatHex.
    formatHex: color_formatHex,
    formatHex8: color_formatHex8,
    formatHsl: color_formatHsl,
    formatRgb: color_formatRgb,
    toString: color_formatRgb
  });
  function color_formatHex() {
    return this.rgb().formatHex();
  }
  function color_formatHex8() {
    return this.rgb().formatHex8();
  }
  function color_formatHsl() {
    return hslConvert(this).formatHsl();
  }
  function color_formatRgb() {
    return this.rgb().formatRgb();
  }
  function color(format2) {
    var m, l;
    format2 = (format2 + "").trim().toLowerCase();
    return (m = reHex.exec(format2)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) : l === 3 ? new Rgb(m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, (m & 15) << 4 | m & 15, 1) : l === 8 ? rgba(m >> 24 & 255, m >> 16 & 255, m >> 8 & 255, (m & 255) / 255) : l === 4 ? rgba(m >> 12 & 15 | m >> 8 & 240, m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, ((m & 15) << 4 | m & 15) / 255) : null) : (m = reRgbInteger.exec(format2)) ? new Rgb(m[1], m[2], m[3], 1) : (m = reRgbPercent.exec(format2)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) : (m = reRgbaInteger.exec(format2)) ? rgba(m[1], m[2], m[3], m[4]) : (m = reRgbaPercent.exec(format2)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) : (m = reHslPercent.exec(format2)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) : (m = reHslaPercent.exec(format2)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) : named.hasOwnProperty(format2) ? rgbn(named[format2]) : format2 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
  }
  function rgbn(n) {
    return new Rgb(n >> 16 & 255, n >> 8 & 255, n & 255, 1);
  }
  function rgba(r, g, b, a2) {
    if (a2 <= 0) r = g = b = NaN;
    return new Rgb(r, g, b, a2);
  }
  function rgbConvert(o) {
    if (!(o instanceof Color)) o = color(o);
    if (!o) return new Rgb();
    o = o.rgb();
    return new Rgb(o.r, o.g, o.b, o.opacity);
  }
  function rgb(r, g, b, opacity) {
    return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
  }
  function Rgb(r, g, b, opacity) {
    this.r = +r;
    this.g = +g;
    this.b = +b;
    this.opacity = +opacity;
  }
  define_default(Rgb, rgb, extend(Color, {
    brighter(k2) {
      k2 = k2 == null ? brighter : Math.pow(brighter, k2);
      return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity);
    },
    darker(k2) {
      k2 = k2 == null ? darker : Math.pow(darker, k2);
      return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity);
    },
    rgb() {
      return this;
    },
    clamp() {
      return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
    },
    displayable() {
      return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1);
    },
    hex: rgb_formatHex,
    // Deprecated! Use color.formatHex.
    formatHex: rgb_formatHex,
    formatHex8: rgb_formatHex8,
    formatRgb: rgb_formatRgb,
    toString: rgb_formatRgb
  }));
  function rgb_formatHex() {
    return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
  }
  function rgb_formatHex8() {
    return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
  }
  function rgb_formatRgb() {
    const a2 = clampa(this.opacity);
    return `${a2 === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a2 === 1 ? ")" : `, ${a2})`}`;
  }
  function clampa(opacity) {
    return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
  }
  function clampi(value) {
    return Math.max(0, Math.min(255, Math.round(value) || 0));
  }
  function hex(value) {
    value = clampi(value);
    return (value < 16 ? "0" : "") + value.toString(16);
  }
  function hsla(h, s2, l, a2) {
    if (a2 <= 0) h = s2 = l = NaN;
    else if (l <= 0 || l >= 1) h = s2 = NaN;
    else if (s2 <= 0) h = NaN;
    return new Hsl(h, s2, l, a2);
  }
  function hslConvert(o) {
    if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
    if (!(o instanceof Color)) o = color(o);
    if (!o) return new Hsl();
    if (o instanceof Hsl) return o;
    o = o.rgb();
    var r = o.r / 255, g = o.g / 255, b = o.b / 255, min3 = Math.min(r, g, b), max3 = Math.max(r, g, b), h = NaN, s2 = max3 - min3, l = (max3 + min3) / 2;
    if (s2) {
      if (r === max3) h = (g - b) / s2 + (g < b) * 6;
      else if (g === max3) h = (b - r) / s2 + 2;
      else h = (r - g) / s2 + 4;
      s2 /= l < 0.5 ? max3 + min3 : 2 - max3 - min3;
      h *= 60;
    } else {
      s2 = l > 0 && l < 1 ? 0 : h;
    }
    return new Hsl(h, s2, l, o.opacity);
  }
  function hsl(h, s2, l, opacity) {
    return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s2, l, opacity == null ? 1 : opacity);
  }
  function Hsl(h, s2, l, opacity) {
    this.h = +h;
    this.s = +s2;
    this.l = +l;
    this.opacity = +opacity;
  }
  define_default(Hsl, hsl, extend(Color, {
    brighter(k2) {
      k2 = k2 == null ? brighter : Math.pow(brighter, k2);
      return new Hsl(this.h, this.s, this.l * k2, this.opacity);
    },
    darker(k2) {
      k2 = k2 == null ? darker : Math.pow(darker, k2);
      return new Hsl(this.h, this.s, this.l * k2, this.opacity);
    },
    rgb() {
      var h = this.h % 360 + (this.h < 0) * 360, s2 = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s2, m1 = 2 * l - m2;
      return new Rgb(
        hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
        hsl2rgb(h, m1, m2),
        hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
        this.opacity
      );
    },
    clamp() {
      return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
    },
    displayable() {
      return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1);
    },
    formatHsl() {
      const a2 = clampa(this.opacity);
      return `${a2 === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a2 === 1 ? ")" : `, ${a2})`}`;
    }
  }));
  function clamph(value) {
    value = (value || 0) % 360;
    return value < 0 ? value + 360 : value;
  }
  function clampt(value) {
    return Math.max(0, Math.min(1, value || 0));
  }
  function hsl2rgb(h, m1, m2) {
    return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
  }

  // node_modules/d3-interpolate/src/basis.js
  function basis(t12, v0, v1, v2, v3) {
    var t2 = t12 * t12, t3 = t2 * t12;
    return ((1 - 3 * t12 + 3 * t2 - t3) * v0 + (4 - 6 * t2 + 3 * t3) * v1 + (1 + 3 * t12 + 3 * t2 - 3 * t3) * v2 + t3 * v3) / 6;
  }
  function basis_default(values) {
    var n = values.length - 1;
    return function(t) {
      var i = t <= 0 ? t = 0 : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n), v1 = values[i], v2 = values[i + 1], v0 = i > 0 ? values[i - 1] : 2 * v1 - v2, v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;
      return basis((t - i / n) * n, v0, v1, v2, v3);
    };
  }

  // node_modules/d3-interpolate/src/basisClosed.js
  function basisClosed_default(values) {
    var n = values.length;
    return function(t) {
      var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n), v0 = values[(i + n - 1) % n], v1 = values[i % n], v2 = values[(i + 1) % n], v3 = values[(i + 2) % n];
      return basis((t - i / n) * n, v0, v1, v2, v3);
    };
  }

  // node_modules/d3-interpolate/src/constant.js
  var constant_default = (x2) => () => x2;

  // node_modules/d3-interpolate/src/color.js
  function linear2(a2, d) {
    return function(t) {
      return a2 + t * d;
    };
  }
  function exponential(a2, b, y2) {
    return a2 = Math.pow(a2, y2), b = Math.pow(b, y2) - a2, y2 = 1 / y2, function(t) {
      return Math.pow(a2 + t * b, y2);
    };
  }
  function gamma(y2) {
    return (y2 = +y2) === 1 ? nogamma : function(a2, b) {
      return b - a2 ? exponential(a2, b, y2) : constant_default(isNaN(a2) ? b : a2);
    };
  }
  function nogamma(a2, b) {
    var d = b - a2;
    return d ? linear2(a2, d) : constant_default(isNaN(a2) ? b : a2);
  }

  // node_modules/d3-interpolate/src/rgb.js
  var rgb_default = function rgbGamma(y2) {
    var color2 = gamma(y2);
    function rgb2(start2, end2) {
      var r = color2((start2 = rgb(start2)).r, (end2 = rgb(end2)).r), g = color2(start2.g, end2.g), b = color2(start2.b, end2.b), opacity = nogamma(start2.opacity, end2.opacity);
      return function(t) {
        start2.r = r(t);
        start2.g = g(t);
        start2.b = b(t);
        start2.opacity = opacity(t);
        return start2 + "";
      };
    }
    rgb2.gamma = rgbGamma;
    return rgb2;
  }(1);
  function rgbSpline(spline) {
    return function(colors4) {
      var n = colors4.length, r = new Array(n), g = new Array(n), b = new Array(n), i, color2;
      for (i = 0; i < n; ++i) {
        color2 = rgb(colors4[i]);
        r[i] = color2.r || 0;
        g[i] = color2.g || 0;
        b[i] = color2.b || 0;
      }
      r = spline(r);
      g = spline(g);
      b = spline(b);
      color2.opacity = 1;
      return function(t) {
        color2.r = r(t);
        color2.g = g(t);
        color2.b = b(t);
        return color2 + "";
      };
    };
  }
  var rgbBasis = rgbSpline(basis_default);
  var rgbBasisClosed = rgbSpline(basisClosed_default);

  // node_modules/d3-interpolate/src/numberArray.js
  function numberArray_default(a2, b) {
    if (!b) b = [];
    var n = a2 ? Math.min(b.length, a2.length) : 0, c2 = b.slice(), i;
    return function(t) {
      for (i = 0; i < n; ++i) c2[i] = a2[i] * (1 - t) + b[i] * t;
      return c2;
    };
  }
  function isNumberArray(x2) {
    return ArrayBuffer.isView(x2) && !(x2 instanceof DataView);
  }

  // node_modules/d3-interpolate/src/array.js
  function genericArray(a2, b) {
    var nb = b ? b.length : 0, na = a2 ? Math.min(nb, a2.length) : 0, x2 = new Array(na), c2 = new Array(nb), i;
    for (i = 0; i < na; ++i) x2[i] = value_default(a2[i], b[i]);
    for (; i < nb; ++i) c2[i] = b[i];
    return function(t) {
      for (i = 0; i < na; ++i) c2[i] = x2[i](t);
      return c2;
    };
  }

  // node_modules/d3-interpolate/src/date.js
  function date_default(a2, b) {
    var d = /* @__PURE__ */ new Date();
    return a2 = +a2, b = +b, function(t) {
      return d.setTime(a2 * (1 - t) + b * t), d;
    };
  }

  // node_modules/d3-interpolate/src/number.js
  function number_default(a2, b) {
    return a2 = +a2, b = +b, function(t) {
      return a2 * (1 - t) + b * t;
    };
  }

  // node_modules/d3-interpolate/src/object.js
  function object_default(a2, b) {
    var i = {}, c2 = {}, k2;
    if (a2 === null || typeof a2 !== "object") a2 = {};
    if (b === null || typeof b !== "object") b = {};
    for (k2 in b) {
      if (k2 in a2) {
        i[k2] = value_default(a2[k2], b[k2]);
      } else {
        c2[k2] = b[k2];
      }
    }
    return function(t) {
      for (k2 in i) c2[k2] = i[k2](t);
      return c2;
    };
  }

  // node_modules/d3-interpolate/src/string.js
  var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;
  var reB = new RegExp(reA.source, "g");
  function zero(b) {
    return function() {
      return b;
    };
  }
  function one(b) {
    return function(t) {
      return b(t) + "";
    };
  }
  function string_default(a2, b) {
    var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i = -1, s2 = [], q = [];
    a2 = a2 + "", b = b + "";
    while ((am = reA.exec(a2)) && (bm = reB.exec(b))) {
      if ((bs = bm.index) > bi) {
        bs = b.slice(bi, bs);
        if (s2[i]) s2[i] += bs;
        else s2[++i] = bs;
      }
      if ((am = am[0]) === (bm = bm[0])) {
        if (s2[i]) s2[i] += bm;
        else s2[++i] = bm;
      } else {
        s2[++i] = null;
        q.push({ i, x: number_default(am, bm) });
      }
      bi = reB.lastIndex;
    }
    if (bi < b.length) {
      bs = b.slice(bi);
      if (s2[i]) s2[i] += bs;
      else s2[++i] = bs;
    }
    return s2.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function(t) {
      for (var i2 = 0, o; i2 < b; ++i2) s2[(o = q[i2]).i] = o.x(t);
      return s2.join("");
    });
  }

  // node_modules/d3-interpolate/src/value.js
  function value_default(a2, b) {
    var t = typeof b, c2;
    return b == null || t === "boolean" ? constant_default(b) : (t === "number" ? number_default : t === "string" ? (c2 = color(b)) ? (b = c2, rgb_default) : string_default : b instanceof color ? rgb_default : b instanceof Date ? date_default : isNumberArray(b) ? numberArray_default : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object_default : number_default)(a2, b);
  }

  // node_modules/d3-interpolate/src/round.js
  function round_default(a2, b) {
    return a2 = +a2, b = +b, function(t) {
      return Math.round(a2 * (1 - t) + b * t);
    };
  }

  // node_modules/d3-interpolate/src/piecewise.js
  function piecewise(interpolate, values) {
    if (values === void 0) values = interpolate, interpolate = value_default;
    var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);
    while (i < n) I[i] = interpolate(v, v = values[++i]);
    return function(t) {
      var i2 = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));
      return I[i2](t - i2);
    };
  }

  // node_modules/victory-core/es/victory-animation/util.js
  var isInterpolatable = function(obj) {
    if (obj !== null) {
      switch (typeof obj) {
        case "undefined":
          return false;
        case "number":
          return !isNaN(obj) && obj !== Number.POSITIVE_INFINITY && obj !== Number.NEGATIVE_INFINITY;
        case "string":
          return true;
        case "boolean":
          return false;
        case "object":
          return obj instanceof Date || Array.isArray(obj) || (0, import_isPlainObject.default)(obj);
        case "function":
          return true;
      }
    }
    return false;
  };
  var interpolateImmediate = function(a2, b, when) {
    if (when === void 0) {
      when = 0;
    }
    return function(t) {
      return t < when ? a2 : b;
    };
  };
  var interpolateFunction = function(a2, b) {
    return function(t) {
      if (t >= 1) {
        return b;
      }
      return function() {
        const aval = typeof a2 === "function" ? a2.apply(this, arguments) : a2;
        const bval = typeof b === "function" ? b.apply(this, arguments) : b;
        return value_default(aval, bval)(t);
      };
    };
  };
  var interpolateObject = function(startValue, endValue) {
    const interpolateTypes = (x2, y2) => {
      if (x2 === y2 || !isInterpolatable(x2) || !isInterpolatable(y2)) {
        return interpolateImmediate(x2, y2);
      }
      if (typeof x2 === "function" || typeof y2 === "function") {
        return interpolateFunction(x2, y2);
      }
      if (typeof x2 === "object" && (0, import_isPlainObject.default)(x2) || typeof y2 === "object" && (0, import_isPlainObject.default)(y2)) {
        return interpolateObject(x2, y2);
      }
      return value_default(x2, y2);
    };
    const keyData = (val) => {
      return Array.isArray(val) ? (0, import_orderBy.default)(val, "key") : val;
    };
    const i = {};
    const c2 = {};
    let a2 = startValue;
    let b = endValue;
    let k2;
    if (a2 === null || typeof a2 !== "object") {
      a2 = {};
    }
    if (b === null || typeof b !== "object") {
      b = {};
    }
    for (k2 in b) {
      if (k2 in a2) {
        i[k2] = interpolateTypes(keyData(a2[k2]), keyData(b[k2]));
      } else {
        c2[k2] = b[k2];
      }
    }
    return function(t) {
      for (k2 in i) {
        c2[k2] = i[k2](t);
      }
      return c2;
    };
  };
  var interpolateString = function(a2, b) {
    const format2 = (val) => {
      return typeof val === "string" ? val.replace(/,/g, "") : val;
    };
    return value_default(format2(a2), format2(b));
  };
  var victoryInterpolator = function(a2, b) {
    if (a2 === b || !isInterpolatable(a2) || !isInterpolatable(b)) {
      return interpolateImmediate(a2, b);
    }
    if (typeof a2 === "function" || typeof b === "function") {
      return interpolateFunction(a2, b);
    }
    if ((0, import_isPlainObject.default)(a2) || (0, import_isPlainObject.default)(b)) {
      return interpolateObject(a2, b);
    }
    if (typeof a2 === "string" || typeof b === "string") {
      return interpolateString(a2, b);
    }
    return value_default(a2, b);
  };

  // node_modules/victory-core/es/victory-util/timer-context.js
  var import_react58 = __toESM(require_react());

  // node_modules/d3-timer/src/timer.js
  var frame = 0;
  var timeout = 0;
  var interval = 0;
  var pokeDelay = 1e3;
  var taskHead;
  var taskTail;
  var clockLast = 0;
  var clockNow = 0;
  var clockSkew = 0;
  var clock = typeof performance === "object" && performance.now ? performance : Date;
  var setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) {
    setTimeout(f, 17);
  };
  function now2() {
    return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
  }
  function clearNow() {
    clockNow = 0;
  }
  function Timer() {
    this._call = this._time = this._next = null;
  }
  Timer.prototype = timer.prototype = {
    constructor: Timer,
    restart: function(callback, delay3, time2) {
      if (typeof callback !== "function") throw new TypeError("callback is not a function");
      time2 = (time2 == null ? now2() : +time2) + (delay3 == null ? 0 : +delay3);
      if (!this._next && taskTail !== this) {
        if (taskTail) taskTail._next = this;
        else taskHead = this;
        taskTail = this;
      }
      this._call = callback;
      this._time = time2;
      sleep();
    },
    stop: function() {
      if (this._call) {
        this._call = null;
        this._time = Infinity;
        sleep();
      }
    }
  };
  function timer(callback, delay3, time2) {
    var t = new Timer();
    t.restart(callback, delay3, time2);
    return t;
  }
  function timerFlush() {
    now2();
    ++frame;
    var t = taskHead, e;
    while (t) {
      if ((e = clockNow - t._time) >= 0) t._call.call(void 0, e);
      t = t._next;
    }
    --frame;
  }
  function wake() {
    clockNow = (clockLast = clock.now()) + clockSkew;
    frame = timeout = 0;
    try {
      timerFlush();
    } finally {
      frame = 0;
      nap();
      clockNow = 0;
    }
  }
  function poke() {
    var now3 = clock.now(), delay3 = now3 - clockLast;
    if (delay3 > pokeDelay) clockSkew -= delay3, clockLast = now3;
  }
  function nap() {
    var t02, t12 = taskHead, t2, time2 = Infinity;
    while (t12) {
      if (t12._call) {
        if (time2 > t12._time) time2 = t12._time;
        t02 = t12, t12 = t12._next;
      } else {
        t2 = t12._next, t12._next = null;
        t12 = t02 ? t02._next = t2 : taskHead = t2;
      }
    }
    taskTail = t02;
    sleep(time2);
  }
  function sleep(time2) {
    if (frame) return;
    if (timeout) timeout = clearTimeout(timeout);
    var delay3 = time2 - clockNow;
    if (delay3 > 24) {
      if (time2 < Infinity) timeout = setTimeout(wake, time2 - clock.now() - clockSkew);
      if (interval) interval = clearInterval(interval);
    } else {
      if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
      frame = 1, setFrame(wake);
    }
  }

  // node_modules/victory-core/es/victory-util/timer.js
  var Timer2 = class {
    constructor() {
      __publicField(this, "loop", () => {
        this.subscribers.forEach((s2) => {
          s2.callback(now2() - s2.startTime, s2.duration);
        });
      });
      this.shouldAnimate = true;
      this.subscribers = [];
      this.timer = null;
      this.activeSubscriptions = 0;
    }
    bypassAnimation() {
      this.shouldAnimate = false;
    }
    resumeAnimation() {
      this.shouldAnimate = true;
    }
    start() {
      if (!this.timer) {
        this.timer = timer(this.loop);
      }
    }
    stop() {
      if (this.timer) {
        this.timer.stop();
        this.timer = null;
      }
    }
    subscribe(callback, duration) {
      const subscriptionID = this.subscribers.push({
        startTime: now2(),
        callback,
        duration: this.shouldAnimate ? duration : 0
      });
      this.activeSubscriptions++;
      this.start();
      return subscriptionID;
    }
    unsubscribe(id) {
      if (id !== null && this.subscribers[id - 1]) {
        delete this.subscribers[id - 1];
        this.activeSubscriptions--;
      }
      if (this.activeSubscriptions === 0) {
        this.stop();
      }
    }
  };

  // node_modules/victory-core/es/victory-util/timer-context.js
  var TimerContext = /* @__PURE__ */ import_react58.default.createContext({
    transitionTimer: new Timer2(),
    animationTimer: new Timer2()
  });
  TimerContext.displayName = "TimerContext";
  var timer_context_default = TimerContext;

  // node_modules/victory-core/es/victory-animation/victory-animation.js
  var formatAnimationName = (name2) => {
    const capitalizedName = name2.charAt(0).toUpperCase() + name2.slice(1);
    return `ease${capitalizedName}`;
  };
  var DEFAULT_DURATION = 1e3;
  var VictoryAnimation = (_ref) => {
    let {
      duration = DEFAULT_DURATION,
      easing = "quadInOut",
      delay: delay3 = 0,
      data,
      children,
      onEnd
    } = _ref;
    const [state, setState] = import_react59.default.useState({
      data: Array.isArray(data) ? data[0] : data,
      animationInfo: {
        progress: 0,
        animating: false
      }
    });
    const timer2 = import_react59.default.useContext(timer_context_default).animationTimer;
    const queue = import_react59.default.useRef(Array.isArray(data) ? data.slice(1) : []);
    const interpolator = import_react59.default.useRef(null);
    const loopID = import_react59.default.useRef(void 0);
    const ease = d3_ease_exports[formatAnimationName(easing)];
    import_react59.default.useEffect(() => {
      if (queue.current.length) {
        traverseQueue();
      }
      return () => {
        if (loopID.current) {
          timer2.unsubscribe(loopID.current);
        } else {
          timer2.stop();
        }
      };
    }, []);
    import_react59.default.useEffect(() => {
      if (interpolator.current && state.animationInfo && state.animationInfo.progress < 1) {
        setState({
          data: interpolator.current(1),
          animationInfo: {
            progress: 1,
            animating: false,
            terminating: true
          }
        });
      } else {
        timer2.unsubscribe(loopID.current);
        queue.current = Array.isArray(data) ? data : [data];
        traverseQueue();
      }
    }, [data]);
    const traverseQueue = () => {
      if (queue.current.length) {
        const nextData = queue.current[0];
        interpolator.current = victoryInterpolator(state.data, nextData);
        if (delay3) {
          setTimeout(() => {
            loopID.current = timer2.subscribe(functionToBeRunEachFrame, duration);
          }, delay3);
        } else {
          loopID.current = timer2.subscribe(functionToBeRunEachFrame, duration);
        }
      } else if (onEnd) {
        onEnd();
      }
    };
    const functionToBeRunEachFrame = (elapsed) => {
      if (!interpolator.current) return;
      const step = duration ? elapsed / duration : 1;
      if (step >= 1) {
        setState({
          data: interpolator.current(1),
          animationInfo: {
            progress: 1,
            animating: false,
            terminating: true
          }
        });
        if (loopID.current) {
          timer2.unsubscribe(loopID.current);
        }
        queue.current.shift();
        traverseQueue();
        return;
      }
      setState({
        data: interpolator.current(ease(step)),
        animationInfo: {
          progress: step,
          animating: step < 1
        }
      });
    };
    return children(state.data, state.animationInfo);
  };

  // node_modules/victory-core/es/victory-container/victory-container.js
  var import_react73 = __toESM(require_react());
  var import_uniqueId = __toESM(require_uniqueId());

  // node_modules/victory-core/es/victory-portal/portal.js
  var import_react60 = __toESM(require_react());
  function _extends() {
    _extends = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends.apply(this, arguments);
  }
  var Portal = /* @__PURE__ */ import_react60.default.forwardRef((props, ref) => {
    return /* @__PURE__ */ import_react60.default.createElement("svg", _extends({
      ref
    }, props));
  });

  // node_modules/victory-core/es/victory-util/user-props.js
  var user_props_exports = {};
  __export(user_props_exports, {
    assert: () => assert,
    getSafeUserProps: () => getSafeUserProps,
    withSafeUserProps: () => withSafeUserProps
  });
  var React285 = __toESM(require_react());

  // node_modules/victory-core/es/victory-util/helpers.js
  var helpers_exports = {};
  __export(helpers_exports, {
    createAccessor: () => createAccessor,
    degreesToRadians: () => degreesToRadians,
    evaluateProp: () => evaluateProp,
    evaluateStyle: () => evaluateStyle,
    getCurrentAxis: () => getCurrentAxis,
    getDefaultStyles: () => getDefaultStyles,
    getPadding: () => getPadding,
    getPoint: () => getPoint,
    getPolarOrigin: () => getPolarOrigin,
    getRadius: () => getRadius,
    getRange: () => getRange,
    getStyles: () => getStyles,
    invert: () => invert,
    isFunction: () => isFunction,
    isHorizontal: () => isHorizontal,
    isNil: () => isNil,
    isTooltip: () => isTooltip,
    mapValues: () => mapValues,
    modifyProps: () => modifyProps,
    omit: () => omit,
    radiansToDegrees: () => radiansToDegrees,
    range: () => range,
    reduceChildren: () => reduceChildren,
    scalePoint: () => scalePoint
  });
  var import_react61 = __toESM(require_react());
  var import_defaults = __toESM(require_defaults());
  var import_property = __toESM(require_property());
  var import_pick = __toESM(require_pick());
  function getCartesianRange(options5) {
    const vertical = options5.axis !== "x";
    if (vertical) {
      return [options5.height - options5.padding.bottom, options5.padding.top];
    }
    return [options5.padding.left, options5.width - options5.padding.right];
  }
  function getPolarRange(options5) {
    if (options5.axis === "x") {
      const startAngle = degreesToRadians(options5.startAngle || 0);
      const endAngle = degreesToRadians(options5.endAngle || 360);
      return [startAngle, endAngle];
    }
    return [options5.innerRadius || 0, getRadius({
      height: options5.height,
      width: options5.width,
      padding: options5.padding
    })];
  }
  function invert(original) {
    return Object.entries(original).reduce((acc, current) => {
      acc[current[1]] = current[0];
      return acc;
    }, {});
  }
  function omit(originalObject, ks) {
    if (ks === void 0) {
      ks = [];
    }
    const newObject = {};
    for (const key in originalObject) {
      if (ks.indexOf(key) >= 0) {
        continue;
      }
      if (!Object.prototype.hasOwnProperty.call(originalObject, key)) {
        continue;
      }
      newObject[key] = originalObject[key];
    }
    return newObject;
  }
  function getPoint(datum) {
    const {
      _x,
      _x1,
      _x0,
      _voronoiX,
      _y,
      _y1,
      _y0,
      _voronoiY
    } = datum;
    const defaultX = _x1 ?? _x;
    const defaultY = _y1 ?? _y;
    const point6 = {
      x: _voronoiX ?? defaultX,
      x0: _x0 ?? _x,
      y: _voronoiY ?? defaultY,
      y0: _y0 ?? _y
    };
    return (0, import_defaults.default)({}, point6, datum);
  }
  function scalePoint(props, datum) {
    const {
      scale,
      polar,
      horizontal
    } = props;
    const d = getPoint(datum);
    const origin = props.origin || {
      x: 0,
      y: 0
    };
    const x2 = horizontal ? scale.y(d.y) : scale.x(d.x);
    const x0 = horizontal ? scale.y(d.y0) : scale.x(d.x0);
    const y2 = horizontal ? scale.x(d.x) : scale.y(d.y);
    const y0 = horizontal ? scale.x(d.x0) : scale.y(d.y0);
    return {
      x: polar ? y2 * Math.cos(x2) + origin.x : x2,
      x0: polar ? y0 * Math.cos(x0) + origin.x : x0,
      y: polar ? -y2 * Math.sin(x2) + origin.y : y2,
      y0: polar ? -y0 * Math.sin(x0) + origin.x : y0
    };
  }
  function getPadding(padding3) {
    const paddingVal = typeof padding3 === "number" ? padding3 : 0;
    const paddingObj = typeof padding3 === "object" ? padding3 : {};
    return {
      top: paddingObj.top || paddingVal,
      bottom: paddingObj.bottom || paddingVal,
      left: paddingObj.left || paddingVal,
      right: paddingObj.right || paddingVal
    };
  }
  function isTooltip(component) {
    const labelRole = component && component.type && component.type.role;
    return labelRole === "tooltip";
  }
  function getDefaultStyles(props, role) {
    const {
      theme = {},
      labelComponent
    } = props;
    const defaultStyles2 = theme[role] && theme[role].style || {};
    if (!isTooltip(labelComponent)) {
      return defaultStyles2;
    }
    const tooltipStyle = theme.tooltip && theme.tooltip.style || {};
    const labelStyle = (0, import_defaults.default)({}, tooltipStyle, defaultStyles2.labels);
    return (0, import_defaults.default)({}, {
      labels: labelStyle
    }, defaultStyles2);
  }
  function getStyles(style, defaultStyles2) {
    const width = "100%";
    const height = "100%";
    if (!style) {
      return (0, import_defaults.default)({
        parent: {
          height,
          width
        }
      }, defaultStyles2);
    }
    const {
      data,
      labels,
      parent: parent2
    } = style;
    const defaultParent = defaultStyles2 && defaultStyles2.parent || {};
    const defaultLabels = defaultStyles2 && defaultStyles2.labels || {};
    const defaultData = defaultStyles2 && defaultStyles2.data || {};
    return {
      parent: (0, import_defaults.default)({}, parent2, defaultParent, {
        width,
        height
      }),
      labels: (0, import_defaults.default)({}, labels, defaultLabels),
      data: (0, import_defaults.default)({}, data, defaultData)
    };
  }
  function evaluateProp(prop, props) {
    return isFunction(prop) ? prop(props) : prop;
  }
  function evaluateStyle(style, props) {
    if (props.disableInlineStyles) {
      return {};
    }
    if (!style || !Object.keys(style).some((value) => isFunction(style[value]))) {
      return style;
    }
    return Object.keys(style).reduce((prev, curr) => {
      prev[curr] = evaluateProp(style[curr], props);
      return prev;
    }, {});
  }
  function degreesToRadians(degrees) {
    return typeof degrees === "number" ? degrees * (Math.PI / 180) : degrees;
  }
  function radiansToDegrees(radians) {
    return typeof radians === "number" ? radians / (Math.PI / 180) : radians;
  }
  function getRadius(options5) {
    const {
      width,
      height,
      padding: padding3
    } = options5;
    const {
      left: left2,
      right: right2,
      top: top2,
      bottom: bottom2
    } = padding3;
    return Math.min(width - left2 - right2, height - top2 - bottom2) / 2;
  }
  function getPolarOrigin(props) {
    const {
      width,
      height
    } = props;
    const {
      top: top2,
      bottom: bottom2,
      left: left2,
      right: right2
    } = getPadding(props.padding);
    const radius = Math.min(width - left2 - right2, height - top2 - bottom2) / 2;
    const offsetWidth = width / 2 + left2 - right2;
    const offsetHeight = height / 2 + top2 - bottom2;
    return {
      x: offsetWidth + radius > width ? radius + left2 - right2 : offsetWidth,
      y: offsetHeight + radius > height ? radius + top2 - bottom2 : offsetHeight
    };
  }
  function getRange(props, axis) {
    if (props.range && props.range[axis]) {
      return props.range[axis];
    } else if (props.range && Array.isArray(props.range)) {
      return props.range;
    }
    return props.polar ? getPolarRange({
      axis,
      innerRadius: props.innerRadius,
      startAngle: props.startAngle,
      endAngle: props.endAngle,
      height: props.height,
      width: props.width,
      padding: getPadding(props.padding)
    }) : getCartesianRange({
      axis,
      height: props.height,
      width: props.width,
      padding: getPadding(props.padding)
    });
  }
  function isNil(value) {
    return value == null;
  }
  function isFunction(value) {
    return typeof value === "function";
  }
  function createAccessor(key) {
    if (isFunction(key)) {
      return key;
    } else if (key === null || key === void 0) {
      return (x2) => x2;
    }
    return (0, import_property.default)(key);
  }
  function modifyProps(props, fallbackProps12, role) {
    const theme = props.theme && props.theme[role] ? props.theme[role] : {};
    const themeProps = omit(theme, ["style"]);
    const horizontal = isHorizontal(props);
    const defaultObject = horizontal === void 0 ? {} : {
      horizontal
    };
    return (0, import_defaults.default)(defaultObject, props, themeProps, fallbackProps12);
  }
  function getCurrentAxis(axis, horizontal) {
    const otherAxis = axis === "x" ? "y" : "x";
    return horizontal ? otherAxis : axis;
  }
  function mapValues(values, fn) {
    if (values) {
      return Object.keys(values).reduce((acc, key) => {
        acc[key] = fn(values[key]);
        return acc;
      }, {});
    }
  }
  function range(start2, end2, increment) {
    const startIndex = end2 ? start2 : 0;
    let endIndex = end2 ? end2 : start2;
    if (!endIndex) endIndex = 0;
    const k2 = endIndex - startIndex;
    const length = Math.abs(k2);
    const sign2 = k2 / length || 1;
    const inc = increment || 1;
    const arrayLength = Math.max(Math.ceil(length / inc), 0);
    return Array.from(Array(arrayLength), (_113, i) => startIndex + i * sign2 * inc);
  }
  function reduceChildren(children, iteratee, parentProps, initialMemo, combine) {
    if (parentProps === void 0) {
      parentProps = {};
    }
    if (initialMemo === void 0) {
      initialMemo = [];
    }
    if (combine === void 0) {
      combine = (memo4, item) => (
        // @ts-expect-error These defaults are hard to type
        memo4.concat(item)
      );
    }
    const sharedProps = ["data", "domain", "categories", "polar", "startAngle", "endAngle", "minDomain", "maxDomain", "horizontal"];
    const traverseChildren = (childArray, names, parent2) => {
      return childArray.reduce((memo4, child, index) => {
        let newMemo = memo4;
        const childRole = child.type && child.type.role;
        const childName = child.props.name || `${childRole}-${names[index]}`;
        if (child.props && child.props.children) {
          const childProps = Object.assign({}, child.props, (0, import_pick.default)(parentProps, sharedProps));
          const nestedChildren = child.type && child.type.role === "stack" && isFunction(child.type.getChildren) ? child.type.getChildren(childProps) : import_react61.default.Children.toArray(child.props.children).map((c2) => {
            const nestedChildProps = Object.assign({}, c2.props, (0, import_pick.default)(childProps, sharedProps));
            return /* @__PURE__ */ import_react61.default.cloneElement(c2, nestedChildProps);
          });
          const childNames2 = nestedChildren.map((c2, i) => `${childName}-${i}`);
          const nestedResults = traverseChildren(nestedChildren, childNames2, child);
          newMemo = combine(newMemo, nestedResults);
        } else {
          const result = iteratee(child, childName, parent2);
          if (result) {
            newMemo = combine(newMemo, result);
          }
        }
        return newMemo;
      }, initialMemo);
    };
    const validChildren = children.filter(import_react61.isValidElement);
    const childNames = validChildren.map((c2, i) => i);
    return traverseChildren(validChildren, childNames);
  }
  function isHorizontal(props) {
    if (props.horizontal !== void 0 || !props.children) {
      return props.horizontal;
    }
    const traverseChildren = (childArray) => {
      return childArray.reduce((memo4, child) => {
        const childProps = child.props || {};
        if (memo4 || childProps.horizontal || !childProps.children) {
          return memo4 || childProps.horizontal;
        }
        return traverseChildren(import_react61.default.Children.toArray(childProps.children));
      }, false);
    };
    return traverseChildren(import_react61.default.Children.toArray(props.children));
  }

  // node_modules/victory-core/es/victory-util/user-props.js
  var USER_PROPS_SAFELIST = {
    startsWith: ["data-", "aria-"],
    exactMatch: []
  };
  var doesPropStartWith = (key) => {
    let startsWith = false;
    USER_PROPS_SAFELIST.startsWith.forEach((starterString) => {
      const regex = new RegExp(`\\b(${starterString})(\\w|-)+`, "g");
      if (regex.test(key)) startsWith = true;
    });
    return startsWith;
  };
  var isExactMatch = (key) => USER_PROPS_SAFELIST.exactMatch.includes(key);
  var testIfSafeProp = (key) => {
    if (doesPropStartWith(key) || isExactMatch(key)) return true;
    return false;
  };
  function assert(value, message) {
    if (value === void 0 || value === null) {
      throw new Error(message);
    }
  }
  var getSafeUserProps = (props) => {
    const propsToFilter = {
      ...props
    };
    return Object.fromEntries(Object.entries(propsToFilter).filter((_ref) => {
      let [key] = _ref;
      return testIfSafeProp(key);
    }).map((_ref2) => {
      let [key, value] = _ref2;
      return [key, evaluateProp(value, props)];
    }));
  };
  var withSafeUserProps = (component, props) => {
    return /* @__PURE__ */ React285.cloneElement(component, getSafeUserProps(props));
  };

  // node_modules/victory-core/es/victory-util/add-events.js
  var import_react64 = __toESM(require_react());
  var import_defaults4 = __toESM(require_defaults());
  var import_isEmpty2 = __toESM(require_isEmpty());
  var import_pick3 = __toESM(require_pick());
  var import_react_fast_compare2 = __toESM(require_react_fast_compare());

  // node_modules/victory-core/es/victory-transition/victory-transition.js
  var import_react63 = __toESM(require_react());
  var import_defaults3 = __toESM(require_defaults());
  var import_pick2 = __toESM(require_pick());
  var import_react_fast_compare = __toESM(require_react_fast_compare());

  // node_modules/victory-core/es/victory-util/collection.js
  var collection_exports = {};
  __export(collection_exports, {
    containsDates: () => containsDates,
    containsNumbers: () => containsNumbers,
    containsOnlyStrings: () => containsOnlyStrings,
    containsStrings: () => containsStrings,
    difference: () => difference,
    getMaxValue: () => getMaxValue,
    getMinValue: () => getMinValue,
    isArrayOfArrays: () => isArrayOfArrays,
    removeUndefined: () => removeUndefined
  });
  function isNonEmptyArray(collection) {
    return Array.isArray(collection) && collection.length > 0;
  }
  function containsStrings(collection) {
    return Array.isArray(collection) && collection.some((value) => typeof value === "string");
  }
  function containsDates(collection) {
    return Array.isArray(collection) && collection.some((value) => value instanceof Date);
  }
  function containsNumbers(collection) {
    return Array.isArray(collection) && collection.some((value) => typeof value === "number");
  }
  function containsOnlyStrings(collection) {
    return isNonEmptyArray(collection) && collection.every((value) => typeof value === "string");
  }
  function difference(a2, b) {
    if (a2 && b) {
      return a2.filter((value) => !b.includes(value));
    }
    return [];
  }
  function isArrayOfArrays(collection) {
    return isNonEmptyArray(collection) && collection.every(Array.isArray);
  }
  function removeUndefined(arr) {
    return arr.filter((el) => el !== void 0);
  }
  function getMaxValue(arr) {
    for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      values[_key - 1] = arguments[_key];
    }
    const array = arr.concat(values);
    return containsDates(array) ? new Date(Math.max(...array)) : Math.max(...array);
  }
  function getMinValue(arr) {
    for (var _len2 = arguments.length, values = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
      values[_key2 - 1] = arguments[_key2];
    }
    const array = arr.concat(values);
    return containsDates(array) ? new Date(Math.min(...array)) : Math.min(...array);
  }

  // node_modules/victory-core/es/victory-util/transitions.js
  var import_react62 = __toESM(require_react());
  var import_defaults2 = __toESM(require_defaults());
  var import_identity = __toESM(require_identity());
  function getDatumKey(datum, idx) {
    return (datum.key || idx).toString();
  }
  function getKeyedData(data) {
    return data.reduce((keyedData, datum, idx) => {
      const key = getDatumKey(datum, idx);
      keyedData[key] = datum;
      return keyedData;
    }, {});
  }
  function getKeyedDataDifference(a2, b) {
    let hasDifference = false;
    const difference2 = Object.keys(a2).reduce((_difference, key) => {
      if (!(key in b)) {
        hasDifference = true;
        _difference[key] = true;
      }
      return _difference;
    }, {});
    return hasDifference && difference2;
  }
  function getNodeTransitions(oldData, nextData) {
    const oldDataKeyed = oldData && getKeyedData(oldData);
    const nextDataKeyed = nextData && getKeyedData(nextData);
    return {
      entering: oldDataKeyed && getKeyedDataDifference(nextDataKeyed, oldDataKeyed),
      exiting: nextDataKeyed && getKeyedDataDifference(oldDataKeyed, nextDataKeyed)
    };
  }
  function getChildData(child) {
    if (child.type && child.type.getData) {
      return child.type.getData(child.props);
    }
    return child.props && child.props.data || false;
  }
  function getInitialTransitionState(oldChildren, nextChildren) {
    let nodesWillExit = false;
    let nodesWillEnter = false;
    const getTransition = (oldChild, newChild) => {
      if (!newChild || oldChild.type !== newChild.type) {
        return {};
      }
      const {
        entering,
        exiting
      } = getNodeTransitions(getChildData(oldChild), getChildData(newChild)) || {};
      nodesWillExit = nodesWillExit || !!exiting;
      nodesWillEnter = nodesWillEnter || !!entering;
      return {
        entering: entering || false,
        exiting: exiting || false
      };
    };
    const getTransitionsFromChildren = (old, next) => {
      return old.map((child, idx) => {
        if (child && child.props && child.props.children && next[idx]) {
          return getTransitionsFromChildren(import_react62.default.Children.toArray(old[idx].props.children), import_react62.default.Children.toArray(next[idx].props.children));
        }
        return getTransition(child, next[idx]);
      });
    };
    const childrenTransitions = getTransitionsFromChildren(import_react62.default.Children.toArray(oldChildren), import_react62.default.Children.toArray(nextChildren));
    return {
      nodesWillExit,
      nodesWillEnter,
      childrenTransitions,
      // TODO: This may need to be refactored for the following situation.
      //       The component receives new props, and the data provided
      //       is a perfect match for the previous data and domain except
      //       for new nodes. In this case, we wouldn't want a delay before
      //       the new nodes appear.
      nodesShouldEnter: false
    };
  }
  function getInitialChildProps(animate, data) {
    const after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : import_identity.default;
    return {
      data: data.map((datum, idx) => Object.assign({}, datum, after(datum, idx, data)))
    };
  }
  function getChildBeforeLoad(animate, child, data, cb) {
    const newAnimate = Object.assign({}, animate, {
      onEnd: cb
    });
    if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
      return {
        animate: newAnimate,
        data
      };
    }
    const before = newAnimate.onLoad && newAnimate.onLoad.before ? newAnimate.onLoad.before : import_identity.default;
    const newData = data.map((datum, idx) => {
      return Object.assign({}, datum, before(datum, idx, data));
    });
    return {
      animate: newAnimate,
      data: newData,
      clipWidth: 0
    };
  }
  function getChildOnLoad(animate, data, cb) {
    const newAnimate = Object.assign({}, animate, {
      onEnd: cb
    });
    let newData = data;
    if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
      return {
        animate,
        data
      };
    }
    const after = animate.onLoad && animate.onLoad.after ? animate.onLoad.after : import_identity.default;
    newData = data.map((datum, idx) => {
      return Object.assign({}, datum, after(datum, idx, data));
    });
    return {
      animate: newAnimate,
      data: newData
    };
  }
  function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
    const onExit = animate && animate.onExit;
    const newAnimate = Object.assign({}, animate, onExit);
    let newData = data;
    if (exitingNodes) {
      animate.onEnd = cb;
      const before = animate.onExit && animate.onExit.before ? animate.onExit.before : import_identity.default;
      newData = data.map((datum, idx) => {
        const key = (datum.key || idx).toString();
        return exitingNodes[key] ? Object.assign({}, datum, before(datum, idx, data)) : datum;
      });
    }
    return {
      animate: newAnimate,
      data: newData
    };
  }
  function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
    let newAnimate = animate;
    let newData = data;
    if (enteringNodes) {
      newAnimate = Object.assign({}, animate, {
        onEnd: cb
      });
      const before = animate.onEnter && animate.onEnter.before ? animate.onEnter.before : import_identity.default;
      newData = data.map((datum, idx) => {
        const key = (datum.key || idx).toString();
        return enteringNodes[key] ? Object.assign({}, datum, before(datum, idx, data)) : datum;
      });
    }
    return {
      animate: newAnimate,
      data: newData
    };
  }
  function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
    const onEnter = animate && animate.onEnter;
    const newAnimate = Object.assign({}, animate, onEnter);
    let newData = data;
    if (enteringNodes) {
      newAnimate.onEnd = cb;
      const after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : import_identity.default;
      newData = data.map((datum, idx) => {
        const key = getDatumKey(datum, idx);
        return enteringNodes[key] ? Object.assign({}, datum, after(datum, idx, data)) : datum;
      });
    }
    return {
      animate: newAnimate,
      data: newData
    };
  }
  function getTransitionPropsFactory(props, state, setState) {
    const nodesWillExit = state && state.nodesWillExit;
    const nodesWillEnter = state && state.nodesWillEnter;
    const nodesShouldEnter = state && state.nodesShouldEnter;
    const nodesShouldLoad = state && state.nodesShouldLoad;
    const nodesDoneLoad = state && state.nodesDoneLoad;
    const childrenTransitions = state && state.childrenTransitions || [];
    const transitionDurations = {
      enter: props.animate && props.animate.onEnter && props.animate.onEnter.duration,
      exit: props.animate && props.animate.onExit && props.animate.onExit.duration,
      load: props.animate && props.animate.onLoad && props.animate.onLoad.duration,
      move: props.animate && props.animate.duration
    };
    const onLoad = (child, data, animate) => {
      if (nodesShouldLoad) {
        return getChildOnLoad(animate, data, () => {
          setState({
            nodesShouldLoad: false,
            nodesDoneLoad: true
          });
        });
      }
      return getChildBeforeLoad(animate, child, data, () => {
        setState({
          nodesDoneLoad: true
        });
      });
    };
    const onExit = (nodes, child, data, animate) => {
      return getChildPropsOnExit(animate, child, data, nodes, () => {
        setState({
          nodesWillExit: false
        });
      });
    };
    const onEnter = (nodes, child, data, animate) => {
      if (nodesShouldEnter) {
        return getChildPropsOnEnter(animate, data, nodes, () => {
          setState({
            nodesWillEnter: false
          });
        });
      }
      return getChildPropsBeforeEnter(animate, child, data, nodes, () => {
        setState({
          nodesShouldEnter: true
        });
      });
    };
    const getChildTransitionDuration = function(child, type) {
      const animate = child.props.animate;
      if (!child.type) {
        return {};
      }
      const defaultTransitions = child.props && child.props.polar ? child.type.defaultPolarTransitions || child.type.defaultTransitions : child.type.defaultTransitions;
      if (defaultTransitions) {
        const animationDuration = animate[type] && animate[type].duration;
        return animationDuration !== void 0 ? animationDuration : defaultTransitions[type] && defaultTransitions[type].duration;
      }
      return {};
    };
    return function getTransitionProps(child, index) {
      const data = getChildData(child) || [];
      const animate = (0, import_defaults2.default)({}, props.animate, child.props.animate);
      const defaultTransitions = child.props.polar ? child.type.defaultPolarTransitions || child.type.defaultTransitions : child.type.defaultTransitions;
      animate.onExit = (0, import_defaults2.default)({}, animate.onExit, defaultTransitions && defaultTransitions.onExit);
      animate.onEnter = (0, import_defaults2.default)({}, animate.onEnter, defaultTransitions && defaultTransitions.onEnter);
      animate.onLoad = (0, import_defaults2.default)({}, animate.onLoad, defaultTransitions && defaultTransitions.onLoad);
      const childTransitions = childrenTransitions[index] || childrenTransitions[0];
      if (!nodesDoneLoad) {
        const load = transitionDurations.load !== void 0 ? transitionDurations.load : getChildTransitionDuration(child, "onLoad");
        const animation = {
          duration: load
        };
        return onLoad(child, data, Object.assign({}, animate, animation));
      } else if (nodesWillExit) {
        const exitingNodes = childTransitions && childTransitions.exiting;
        const exit = transitionDurations.exit !== void 0 ? transitionDurations.exit : getChildTransitionDuration(child, "onExit");
        const animation = exitingNodes ? {
          duration: exit
        } : {
          delay: exit
        };
        return onExit(exitingNodes, child, data, Object.assign({}, animate, animation));
      } else if (nodesWillEnter) {
        const enteringNodes = childTransitions && childTransitions.entering;
        const enter = transitionDurations.enter !== void 0 ? transitionDurations.enter : getChildTransitionDuration(child, "onEnter");
        const move = transitionDurations.move !== void 0 ? transitionDurations.move : child.props.animate && child.props.animate.duration;
        const animation = {
          duration: nodesShouldEnter && enteringNodes ? enter : move
        };
        return onEnter(enteringNodes, child, data, Object.assign({}, animate, animation));
      } else if (!state && animate && animate.onExit) {
        return getInitialChildProps(animate, data);
      }
      return {
        animate,
        data
      };
    };
  }

  // node_modules/victory-core/es/victory-transition/victory-transition.js
  function _extends2() {
    _extends2 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends2.apply(this, arguments);
  }
  var VictoryTransition = class extends import_react63.default.Component {
    constructor(props, context) {
      super(props, context);
      this.state = {
        nodesShouldLoad: false,
        nodesDoneLoad: false
      };
      const child = this.props.children;
      const polar = child.props.polar;
      this.continuous = !polar && child.type && child.type.continuous === true;
      this.timer = this.context.transitionTimer;
    }
    componentDidMount() {
      this.setState({
        nodesShouldLoad: true
      });
    }
    shouldComponentUpdate(nextProps) {
      if (!(0, import_react_fast_compare.default)(this.props, nextProps)) {
        this.timer.bypassAnimation();
        this.setState(this.getTransitionState(this.props, nextProps), () => this.timer.resumeAnimation());
      }
      return true;
    }
    componentWillUnmount() {
      this.timer.stop();
    }
    getTransitionState(props, nextProps) {
      const {
        animate
      } = props;
      if (!animate) {
        return {};
      } else if (animate.parentState) {
        const state = animate.parentState;
        const oldProps = state.nodesWillExit ? props : null;
        return {
          oldProps,
          nextProps
        };
      }
      const oldChildren = import_react63.default.Children.toArray(props.children);
      const nextChildren = import_react63.default.Children.toArray(nextProps.children);
      const {
        nodesWillExit,
        nodesWillEnter,
        childrenTransitions,
        nodesShouldEnter
      } = getInitialTransitionState(oldChildren, nextChildren);
      return {
        nodesWillExit,
        nodesWillEnter,
        childrenTransitions,
        nodesShouldEnter,
        oldProps: nodesWillExit ? props : null,
        nextProps
      };
    }
    getDomainFromChildren(props, axis) {
      const getChildDomains = (children) => {
        return children.reduce((memo4, child2) => {
          if (child2.type && isFunction(child2.type.getDomain)) {
            const childDomain = child2.props && child2.type.getDomain(child2.props, axis);
            return childDomain ? memo4.concat(childDomain) : memo4;
          } else if (child2.props && child2.props.children) {
            return memo4.concat(getChildDomains(import_react63.default.Children.toArray(child2.props.children)));
          }
          return memo4;
        }, []);
      };
      const child = import_react63.default.Children.toArray(props.children)[0];
      const childProps = child.props || {};
      const domain = Array.isArray(childProps.domain) ? childProps.domain : childProps.domain && childProps.domain[axis];
      if (!childProps.children && domain) {
        return domain;
      }
      const childDomains = getChildDomains([child]);
      return childDomains.length === 0 ? [0, 1] : [getMinValue(childDomains), getMaxValue(childDomains)];
    }
    pickProps() {
      if (!this.state) {
        return this.props;
      }
      return this.state.nodesWillExit ? this.state.oldProps || this.props : this.props;
    }
    pickDomainProps(props) {
      const parentState = props.animate?.parentState;
      if (parentState && parentState.nodesWillExit) {
        return this.continuous || parentState.continuous ? parentState.nextProps || this.state.nextProps || props : props;
      }
      return this.continuous && this.state.nodesWillExit ? this.state.nextProps || props : props;
    }
    getClipWidth(props, child) {
      const getDefaultClipWidth = () => {
        const range4 = getRange(child.props, "x");
        return range4 ? Math.abs(range4[1] - range4[0]) : props.width;
      };
      const clipWidth = this.transitionProps ? this.transitionProps.clipWidth : void 0;
      return clipWidth !== void 0 ? clipWidth : getDefaultClipWidth();
    }
    render() {
      const props = this.pickProps();
      const getTransitionProps = this.props.animate?.getTransitions ? this.props.animate.getTransitions : getTransitionPropsFactory(props, this.state, (newState) => this.setState(newState));
      const child = import_react63.default.Children.toArray(props.children)[0];
      const transitionProps = getTransitionProps(child);
      this.transitionProps = transitionProps;
      const domain = {
        x: this.getDomainFromChildren(this.pickDomainProps(props), "x"),
        y: this.getDomainFromChildren(props, "y")
      };
      const clipWidth = this.getClipWidth(props, child);
      const combinedProps = (0, import_defaults3.default)({
        domain,
        clipWidth
      }, transitionProps, child.props);
      const animationWhitelist = props.animationWhitelist || [];
      const whitelist = animationWhitelist.concat(["clipWidth"]);
      const propsToAnimate = whitelist.length ? (0, import_pick2.default)(combinedProps, whitelist) : combinedProps;
      return /* @__PURE__ */ import_react63.default.createElement(VictoryAnimation, _extends2({}, combinedProps.animate, {
        data: propsToAnimate
      }), (newProps) => {
        if (child.props.groupComponent) {
          const groupComponent = this.continuous ? /* @__PURE__ */ import_react63.default.cloneElement(child.props.groupComponent, {
            clipWidth: newProps.clipWidth || 0
          }) : child.props.groupComponent;
          return /* @__PURE__ */ import_react63.default.cloneElement(child, (0, import_defaults3.default)({
            animate: null,
            animating: true,
            groupComponent
          }, newProps, combinedProps));
        }
        return /* @__PURE__ */ import_react63.default.cloneElement(child, (0, import_defaults3.default)({
          animate: null,
          animating: true
        }, newProps, combinedProps));
      });
    }
  };
  __publicField(VictoryTransition, "displayName", "VictoryTransition");
  __publicField(VictoryTransition, "contextType", timer_context_default);

  // node_modules/victory-core/es/victory-util/events.js
  var events_exports = {};
  __export(events_exports, {
    emulateReactEvent: () => emulateReactEvent,
    getComponentEvents: () => getComponentEvents,
    getEventState: () => getEventState,
    getEvents: () => getEvents,
    getExternalMutation: () => getExternalMutation,
    getExternalMutations: () => getExternalMutations,
    getExternalMutationsWithChildren: () => getExternalMutationsWithChildren,
    getGlobalEventNameFromKey: () => getGlobalEventNameFromKey,
    getGlobalEvents: () => getGlobalEvents,
    getPartialEvents: () => getPartialEvents,
    getScopedEvents: () => getScopedEvents,
    omitGlobalEvents: () => omitGlobalEvents
  });
  var import_isEmpty = __toESM(require_isEmpty());
  var import_pickBy = __toESM(require_pickBy());
  var import_omitBy = __toESM(require_omitBy());
  var import_uniq = __toESM(require_uniq());
  var GLOBAL_EVENT_REGEX = /^onGlobal(.*)$/;
  function getEvents(props, target, eventKey, getScopedEvents2) {
    const getEventsByTarget = (events) => {
      const getSelectedEvents = () => {
        const targetEvents = events.reduce((memo4, event) => {
          if (event.target !== void 0) {
            const matchesTarget = Array.isArray(event.target) ? event.target.includes(target) : `${event.target}` === `${target}`;
            return matchesTarget ? memo4.concat(event) : memo4;
          }
          return memo4.concat(event);
        }, []);
        if (eventKey !== void 0 && target !== "parent") {
          return targetEvents.filter((obj) => {
            const targetKeys = obj.eventKey;
            const useKey = (key) => key ? `${key}` === `${eventKey}` : true;
            return Array.isArray(targetKeys) ? targetKeys.some((k2) => useKey(k2)) : useKey(targetKeys);
          });
        }
        return targetEvents;
      };
      const selectedEvents = getSelectedEvents();
      return Array.isArray(selectedEvents) && selectedEvents.reduce((memo4, event) => {
        return event ? Object.assign(memo4, event.eventHandlers) : memo4;
      }, {});
    };
    const getAllEvents2 = () => {
      if (Array.isArray(this.componentEvents)) {
        return Array.isArray(props.events) ? this.componentEvents.concat(...props.events) : this.componentEvents;
      }
      return props.events;
    };
    const allEvents = getAllEvents2();
    const ownEvents = allEvents && isFunction(getScopedEvents2) ? getScopedEvents2(getEventsByTarget(allEvents), target) : void 0;
    if (!props.sharedEvents) {
      return ownEvents;
    }
    const getSharedEvents = props.sharedEvents.getEvents;
    const sharedEvents = props.sharedEvents.events && getSharedEvents(getEventsByTarget(props.sharedEvents.events), target);
    return Object.assign({}, sharedEvents, ownEvents);
  }
  function getScopedEvents(events, namespace, childType, baseProps4) {
    if ((0, import_isEmpty.default)(events)) {
      return {};
    }
    const newBaseProps = baseProps4 || this.baseProps;
    const getTargetProps = (identifier, type) => {
      const {
        childName,
        target,
        key
      } = identifier;
      const baseType = type === "props" ? newBaseProps : this.state || {};
      const base = childName === void 0 || childName === null || !baseType[childName] ? baseType : baseType[childName];
      return key === "parent" ? base.parent : base[key] && base[key][target];
    };
    const parseEvent = (eventReturn, eventKey) => {
      const childNames = namespace === "parent" ? eventReturn.childName : eventReturn.childName || childType;
      const target = eventReturn.target || namespace;
      const getKeys = (childName) => {
        if (target === "parent") {
          return "parent";
        }
        if (eventReturn.eventKey === "all") {
          return newBaseProps[childName] ? Object.keys(newBaseProps[childName]).filter((value) => value !== "parent") : Object.keys(newBaseProps).filter((value) => value !== "parent");
        } else if (eventReturn.eventKey === void 0 && eventKey === "parent") {
          return newBaseProps[childName] ? Object.keys(newBaseProps[childName]) : Object.keys(newBaseProps);
        }
        return eventReturn.eventKey !== void 0 ? eventReturn.eventKey : eventKey;
      };
      const getMutationObject = (key, childName) => {
        const baseState = this.state || {};
        if (!isFunction(eventReturn.mutation)) {
          return baseState;
        }
        const mutationTargetProps = getTargetProps({
          childName,
          key,
          target
        }, "props");
        const mutationTargetState = getTargetProps({
          childName,
          key,
          target
        }, "state");
        const mutatedProps = eventReturn.mutation(Object.assign({}, mutationTargetProps, mutationTargetState), newBaseProps);
        const childState = baseState[childName] || {};
        const filterState = (state) => {
          if (state[key] && state[key][target]) {
            delete state[key][target];
          }
          if (state[key] && !Object.keys(state[key]).length) {
            delete state[key];
          }
          return state;
        };
        const extendState = (state) => {
          return target === "parent" ? Object.assign(state, {
            [key]: Object.assign(state[key] || {}, mutatedProps)
          }) : Object.assign(state, {
            [key]: Object.assign(state[key] || {}, {
              [target]: mutatedProps
            })
          });
        };
        const updateState = (state) => {
          return mutatedProps ? extendState(state) : filterState(state);
        };
        return childName !== void 0 && childName !== null ? Object.assign(baseState, {
          [childName]: updateState(childState)
        }) : updateState(baseState);
      };
      const getReturnByChild = (childName) => {
        const mutationKeys = getKeys(childName);
        return Array.isArray(mutationKeys) ? mutationKeys.reduce((memo4, key) => {
          return Object.assign(memo4, getMutationObject(key, childName));
        }, {}) : getMutationObject(mutationKeys, childName);
      };
      const allChildNames = childNames === "all" ? Object.keys(newBaseProps).filter((value) => value !== "parent") : childNames;
      return Array.isArray(allChildNames) ? allChildNames.reduce((memo4, childName) => {
        return Object.assign(memo4, getReturnByChild(childName));
      }, {}) : getReturnByChild(allChildNames);
    };
    const parseEventReturn = (eventReturn, eventKey) => {
      return Array.isArray(eventReturn) ? eventReturn.reduce((memo4, props) => Object.assign({}, memo4, parseEvent(props, eventKey)), {}) : parseEvent(eventReturn, eventKey);
    };
    const compileCallbacks = (eventReturn) => {
      const getCallback = (obj) => isFunction(obj.callback) && obj.callback;
      const callbacks = Array.isArray(eventReturn) ? eventReturn.map((evtObj) => getCallback(evtObj)) : [getCallback(eventReturn)];
      const callbackArray = callbacks.filter((callback) => callback !== false);
      return callbackArray.length ? () => callbackArray.forEach((callback) => callback()) : void 0;
    };
    const onEvent = (evt, childProps, eventKey, eventName) => {
      const eventReturn = events[eventName](evt, childProps, eventKey, this);
      if (!(0, import_isEmpty.default)(eventReturn)) {
        const callbacks = compileCallbacks(eventReturn);
        this.setState(parseEventReturn(eventReturn, eventKey), callbacks);
      }
    };
    return Object.keys(events).reduce((memo4, event) => {
      memo4[event] = onEvent;
      return memo4;
    }, {});
  }
  function getPartialEvents(events, eventKey, childProps) {
    if (!events) return {};
    return Object.keys(events).reduce((memo4, eventName) => {
      const appliedEvent = (evt) => events[eventName](evt, childProps, eventKey, eventName);
      memo4[eventName] = appliedEvent;
      return memo4;
    }, {});
  }
  function getEventState(eventKey, namespace, childType) {
    const state = this.state || {};
    if (!childType) {
      return eventKey === "parent" ? state[eventKey] && state[eventKey][namespace] || state[eventKey] : state[eventKey] && state[eventKey][namespace];
    }
    return state[childType] && state[childType][eventKey] && state[childType][eventKey][namespace];
  }
  function getExternalMutationsWithChildren(mutations, baseProps4, baseState, childNames) {
    if (baseProps4 === void 0) {
      baseProps4 = {};
    }
    if (baseState === void 0) {
      baseState = {};
    }
    return childNames.reduce((memo4, childName) => {
      const childState = baseState[childName];
      const mutation = getExternalMutations(mutations, baseProps4[childName], baseState[childName], childName);
      memo4[childName] = mutation ? mutation : childState;
      return (0, import_pickBy.default)(memo4, (v) => !(0, import_isEmpty.default)(v));
    }, {});
  }
  function getExternalMutations(mutations, baseProps4, baseState, childName) {
    if (baseProps4 === void 0) {
      baseProps4 = {};
    }
    if (baseState === void 0) {
      baseState = {};
    }
    const eventKeys = Object.keys(baseProps4);
    return eventKeys.reduce((memo4, eventKey) => {
      const keyState = baseState[eventKey] || {};
      const keyProps = baseProps4[eventKey] || {};
      if (eventKey === "parent") {
        const identifier = {
          eventKey,
          target: "parent"
        };
        const mutation = getExternalMutation(mutations, keyProps, keyState, identifier);
        memo4[eventKey] = mutation !== void 0 ? Object.assign({}, keyState, mutation) : keyState;
      } else {
        const targets = (0, import_uniq.default)(Object.keys(keyProps).concat(Object.keys(keyState)));
        memo4[eventKey] = targets.reduce((m, target) => {
          const identifier = {
            eventKey,
            target,
            childName
          };
          const mutation = getExternalMutation(mutations, keyProps[target], keyState[target], identifier);
          m[target] = mutation !== void 0 ? Object.assign({}, keyState[target], mutation) : keyState[target];
          return (0, import_pickBy.default)(m, (v) => !(0, import_isEmpty.default)(v));
        }, {});
      }
      return (0, import_pickBy.default)(memo4, (v) => !(0, import_isEmpty.default)(v));
    }, {});
  }
  function getExternalMutation(mutations, baseProps4, baseState, identifier) {
    const filterMutations = (mutation, type) => {
      if (typeof mutation[type] === "string") {
        return mutation[type] === "all" || mutation[type] === identifier[type];
      } else if (Array.isArray(mutation[type])) {
        const stringArray = mutation[type].map((m) => `${m}`);
        return stringArray.includes(identifier[type]);
      }
      return false;
    };
    let scopedMutations = Array.isArray(mutations) ? mutations : [mutations];
    if (identifier.childName) {
      scopedMutations = mutations.filter((m) => filterMutations(m, "childName"));
    }
    const targetMutations = scopedMutations.filter((m) => filterMutations(m, "target"));
    if ((0, import_isEmpty.default)(targetMutations)) {
      return void 0;
    }
    const keyMutations = targetMutations.filter((m) => filterMutations(m, "eventKey"));
    if ((0, import_isEmpty.default)(keyMutations)) {
      return void 0;
    }
    return keyMutations.reduce((memo4, curr) => {
      const mutationFunction = curr && isFunction(curr.mutation) ? curr.mutation : () => void 0;
      const currentMutation = mutationFunction(Object.assign({}, baseProps4, baseState));
      return Object.assign({}, memo4, currentMutation);
    }, {});
  }
  function getComponentEvents(props, components) {
    const events = Array.isArray(components) && components.reduce((memo4, componentName) => {
      const component = props[componentName];
      const defaultEvents = component && component.type && component.type.defaultEvents;
      const componentEvents = isFunction(defaultEvents) ? defaultEvents(component.props) : defaultEvents;
      return Array.isArray(componentEvents) ? memo4.concat(...componentEvents) : memo4;
    }, []);
    return events && events.length ? events : void 0;
  }
  function getGlobalEventNameFromKey(key) {
    const match = key.match(GLOBAL_EVENT_REGEX);
    return match && match[1] && match[1].toLowerCase();
  }
  var getGlobalEvents = (events) => (0, import_pickBy.default)(events, (_113, key) => GLOBAL_EVENT_REGEX.test(key));
  var omitGlobalEvents = (events) => (0, import_omitBy.default)(events, (_113, key) => GLOBAL_EVENT_REGEX.test(key));
  var emulateReactEvent = (event) => Object.assign(event, {
    nativeEvent: event
  });

  // node_modules/victory-core/es/victory-util/add-events.js
  var datumHasXandY = (datum) => {
    return !isNil(datum._x) && !isNil(datum._y);
  };
  var defaultComponents = [{
    name: "parent",
    index: "parent"
  }, {
    name: "data"
  }, {
    name: "labels"
  }];
  function addEvents(WrappedComponent, options5) {
    if (options5 === void 0) {
      options5 = {};
    }
    class AddEventsMixin extends WrappedComponent {
      constructor(props) {
        super(props);
        __publicField(this, "state", {});
        __publicField(this, "getEventState", getEventState.bind(this));
        __publicField(this, "getScopedEvents", getScopedEvents.bind(this));
        __publicField(this, "getEvents", (p, target, eventKey) => {
          return getEvents.call(this, p, target, eventKey, this.getScopedEvents);
        });
        __publicField(this, "externalMutations", this.getExternalMutations(this.props));
        __publicField(this, "calculatedState", this.getStateChanges(this.props));
        __publicField(this, "globalEvents", {});
        __publicField(this, "prevGlobalEventKeys", []);
        __publicField(this, "boundGlobalEvents", {});
        this.cacheValues(this.getCalculatedValues(props));
      }
      shouldComponentUpdate(nextProps) {
        const externalMutations = this.getExternalMutations(nextProps);
        const animating = this.props.animating || this.props.animate;
        const newMutation = !(0, import_react_fast_compare2.default)(externalMutations, this.externalMutations);
        if (animating || newMutation) {
          this.cacheValues(this.getCalculatedValues(nextProps));
          this.externalMutations = externalMutations;
          this.applyExternalMutations(nextProps, externalMutations);
          return true;
        }
        const calculatedState = this.getStateChanges(nextProps);
        if (!(0, import_react_fast_compare2.default)(this.calculatedState, calculatedState)) {
          this.cacheValues(this.getCalculatedValues(nextProps));
          return true;
        }
        if (!(0, import_react_fast_compare2.default)(this.props, nextProps)) {
          this.cacheValues(this.getCalculatedValues(nextProps));
          return true;
        }
        return false;
      }
      componentDidMount() {
        const globalEventKeys = Object.keys(this.globalEvents);
        globalEventKeys.forEach((key) => this.addGlobalListener(key));
        this.prevGlobalEventKeys = globalEventKeys;
      }
      componentDidUpdate(prevProps) {
        const calculatedState = this.getStateChanges(prevProps);
        this.calculatedState = calculatedState;
        const globalEventKeys = Object.keys(this.globalEvents);
        const removedGlobalEventKeys = difference(this.prevGlobalEventKeys, globalEventKeys);
        removedGlobalEventKeys.forEach((key) => this.removeGlobalListener(key));
        const addedGlobalEventKeys = difference(globalEventKeys, this.prevGlobalEventKeys);
        addedGlobalEventKeys.forEach((key) => this.addGlobalListener(key));
        this.prevGlobalEventKeys = globalEventKeys;
      }
      componentWillUnmount() {
        this.prevGlobalEventKeys.forEach((key) => this.removeGlobalListener(key));
      }
      addGlobalListener(key) {
        const boundListener = (event) => {
          const listener = this.globalEvents[key];
          return listener && listener(emulateReactEvent(event));
        };
        this.boundGlobalEvents[key] = boundListener;
        window.addEventListener(getGlobalEventNameFromKey(key), boundListener);
      }
      removeGlobalListener(key) {
        window.removeEventListener(getGlobalEventNameFromKey(key), this.boundGlobalEvents[key]);
      }
      // compile all state changes from own and parent state. Order doesn't matter, as any state
      // state change should trigger a re-render
      getStateChanges(props) {
        if (!this.hasEvents) {
          return {};
        }
        const getState = (key, type) => {
          const result = (0, import_defaults4.default)({}, this.getEventState(key, type), this.getSharedEventState(key, type));
          return (0, import_isEmpty2.default)(result) ? void 0 : result;
        };
        const components = options5.components || defaultComponents;
        const stateChanges = components.map((component) => {
          if (!props.standalone && component.name === "parent") {
            return void 0;
          }
          return component.index !== void 0 ? getState(component.index, component.name) : this.dataKeys.map((key) => getState(key, component.name)).filter(Boolean);
        }).filter(Boolean);
        return stateChanges;
      }
      applyExternalMutations(props, externalMutations) {
        if (!(0, import_isEmpty2.default)(externalMutations)) {
          const callbacks = props.externalEventMutations.reduce((memo4, mutation) => isFunction(mutation.callback) ? memo4.concat(mutation.callback) : memo4, []);
          const compiledCallbacks = callbacks.length ? () => {
            callbacks.forEach((c2) => c2());
          } : void 0;
          this.setState(externalMutations, compiledCallbacks);
        }
      }
      getCalculatedValues(props) {
        const {
          sharedEvents
        } = props;
        const components = WrappedComponent.expectedComponents;
        const componentEvents = getComponentEvents(props, components);
        const getSharedEventState = sharedEvents && isFunction(sharedEvents.getEventState) ? sharedEvents.getEventState : () => void 0;
        const baseProps4 = this.getBaseProps(props, getSharedEventState);
        const dataKeys = Object.keys(baseProps4).filter((key) => key !== "parent");
        const hasEvents = props.events || props.sharedEvents || componentEvents;
        const events = this.getAllEvents(props);
        return {
          componentEvents,
          getSharedEventState,
          baseProps: baseProps4,
          dataKeys,
          hasEvents,
          events
        };
      }
      getExternalMutations(props) {
        const {
          sharedEvents,
          externalEventMutations
        } = props;
        return (0, import_isEmpty2.default)(externalEventMutations) || sharedEvents ? void 0 : getExternalMutations(externalEventMutations, this.baseProps, this.state);
      }
      cacheValues(obj) {
        Object.keys(obj).forEach((key) => {
          this[key] = obj[key];
        });
      }
      getBaseProps(props, getSharedEventState) {
        const getSharedEventStateFunction = getSharedEventState || this.getSharedEventState.bind(this);
        const sharedParentState = getSharedEventStateFunction("parent", "parent");
        const parentState = this.getEventState("parent", "parent");
        const baseParentProps = (0, import_defaults4.default)({}, parentState, sharedParentState);
        const parentPropsList = baseParentProps.parentControlledProps;
        const parentProps = parentPropsList ? (0, import_pick3.default)(baseParentProps, parentPropsList) : {};
        const modifiedProps = (0, import_defaults4.default)({}, parentProps, props);
        return typeof WrappedComponent.getBaseProps === "function" ? WrappedComponent.getBaseProps(modifiedProps) : {};
      }
      getAllEvents(props) {
        if (Array.isArray(this.componentEvents)) {
          return Array.isArray(props.events) ? this.componentEvents.concat(...props.events) : this.componentEvents;
        }
        return props.events;
      }
      getComponentProps(component, type, index) {
        const name2 = this.props.name || WrappedComponent.role;
        const key = this.dataKeys && this.dataKeys[index] || index;
        const id = `${name2}-${type}-${key}`;
        const baseProps4 = this.baseProps[key] && this.baseProps[key][type] || this.baseProps[key];
        if (!baseProps4 && !this.hasEvents) {
          return void 0;
        }
        const currentProps = component && typeof component === "object" && "props" in component ? component.props : void 0;
        if (this.hasEvents) {
          const baseEvents = this.getEvents(this.props, type, key);
          const componentProps = (0, import_defaults4.default)({
            index,
            key: id
          }, this.getEventState(key, type), this.getSharedEventState(key, type), currentProps, baseProps4, {
            id
          });
          const events = (0, import_defaults4.default)({}, getPartialEvents(baseEvents, key, componentProps), componentProps.events);
          return Object.assign({}, componentProps, {
            events
          });
        }
        return (0, import_defaults4.default)({
          index,
          key: id
        }, currentProps, baseProps4, {
          id
        });
      }
      renderContainer(component, children) {
        const isContainer = component.type && component.type.role === "container";
        const parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {};
        if (parentProps.events) {
          this.globalEvents = getGlobalEvents(parentProps.events);
          parentProps.events = omitGlobalEvents(parentProps.events);
        }
        return /* @__PURE__ */ import_react64.default.cloneElement(component, parentProps, children);
      }
      animateComponent(props, defaultAnimationWhitelist) {
        const animationWhitelist = typeof props.animate === "object" && props.animate?.animationWhitelist || defaultAnimationWhitelist;
        const Comp = this.constructor;
        return /* @__PURE__ */ import_react64.default.createElement(VictoryTransition, {
          animate: props.animate,
          animationWhitelist
        }, /* @__PURE__ */ import_react64.default.createElement(Comp, props));
      }
      // Used by `VictoryLine` and `VictoryArea`
      renderContinuousData(props) {
        const {
          dataComponent,
          labelComponent,
          groupComponent
        } = props;
        const dataKeys = this.dataKeys.filter((value) => value !== "all");
        const labelComponents = dataKeys.reduce((memo4, key) => {
          let newMemo = memo4;
          const labelProps = this.getComponentProps(labelComponent, "labels", key);
          if (labelProps && labelProps.text !== void 0 && labelProps.text !== null) {
            newMemo = newMemo.concat(/* @__PURE__ */ import_react64.default.cloneElement(labelComponent, labelProps));
          }
          return newMemo;
        }, []);
        const dataProps = this.getComponentProps(dataComponent, "data", "all");
        const children = [/* @__PURE__ */ import_react64.default.cloneElement(dataComponent, dataProps), ...labelComponents];
        return this.renderContainer(groupComponent, children);
      }
      renderData(props, shouldRenderDatum) {
        if (shouldRenderDatum === void 0) {
          shouldRenderDatum = datumHasXandY;
        }
        const {
          dataComponent,
          labelComponent,
          groupComponent
        } = props;
        const dataComponents = this.dataKeys.reduce((validDataComponents, _dataKey, index) => {
          const dataProps = this.getComponentProps(dataComponent, "data", index);
          if (shouldRenderDatum(dataProps.datum)) {
            validDataComponents.push(/* @__PURE__ */ import_react64.default.cloneElement(dataComponent, dataProps));
          }
          return validDataComponents;
        }, []);
        const labelComponents = this.dataKeys.map((_dataKey, index) => {
          const labelProps = this.getComponentProps(labelComponent, "labels", index);
          if (labelProps.text !== void 0 && labelProps.text !== null) {
            return /* @__PURE__ */ import_react64.default.cloneElement(labelComponent, labelProps);
          }
          return void 0;
        }).filter(Boolean);
        const children = [...dataComponents, ...labelComponents];
        return this.renderContainer(groupComponent, children);
      }
    }
    return AddEventsMixin;
  }

  // node_modules/victory-core/es/victory-util/merge-refs.js
  function mergeRefs(refs) {
    return (value) => {
      refs.forEach((ref) => {
        if (isFunction(ref)) {
          ref(value);
        } else if (ref !== null && ref !== void 0) {
          ref.current = value;
        }
      });
    };
  }

  // node_modules/victory-core/es/victory-util/axis.js
  var axis_exports = {};
  __export(axis_exports, {
    findAxisComponents: () => findAxisComponents,
    getAxis: () => getAxis,
    getAxisComponent: () => getAxisComponent,
    getAxisComponentsWithParent: () => getAxisComponentsWithParent,
    getAxisValue: () => getAxisValue,
    getDomain: () => getDomain2,
    getOrigin: () => getOrigin,
    getOriginSign: () => getOriginSign,
    getTickFormat: () => getTickFormat,
    getTicks: () => getTicks,
    isVertical: () => isVertical,
    modifyProps: () => modifyProps2,
    stringTicks: () => stringTicks
  });
  var import_react67 = __toESM(require_react());
  var import_defaults5 = __toESM(require_defaults());
  var import_isObject = __toESM(require_isObject());
  var import_uniq3 = __toESM(require_uniq());
  var import_orderBy3 = __toESM(require_orderBy());

  // node_modules/victory-core/es/victory-util/domain.js
  var domain_exports = {};
  __export(domain_exports, {
    createDomainFunction: () => createDomainFunction,
    formatDomain: () => formatDomain,
    getDomain: () => getDomain,
    getDomainFromCategories: () => getDomainFromCategories,
    getDomainFromData: () => getDomainFromData,
    getDomainFromMinMax: () => getDomainFromMinMax,
    getDomainFromProps: () => getDomainFromProps,
    getDomainWithZero: () => getDomainWithZero,
    getMaxFromProps: () => getMaxFromProps,
    getMinFromProps: () => getMinFromProps,
    getSymmetricDomain: () => getSymmetricDomain,
    isDomainComponent: () => isDomainComponent
  });
  var import_react66 = __toESM(require_react());
  var import_isDate = __toESM(require_isDate());
  var import_isPlainObject4 = __toESM(require_isPlainObject());
  var import_sortedUniq = __toESM(require_sortedUniq());

  // node_modules/victory-core/es/victory-util/data.js
  var data_exports = {};
  __export(data_exports, {
    createStringMap: () => createStringMap,
    downsample: () => downsample,
    formatData: () => formatData,
    formatDataFromDomain: () => formatDataFromDomain,
    generateData: () => generateData,
    getCategories: () => getCategories,
    getData: () => getData,
    getStringsFromAxes: () => getStringsFromAxes,
    getStringsFromCategories: () => getStringsFromCategories,
    getStringsFromData: () => getStringsFromData,
    isDataComponent: () => isDataComponent
  });
  var import_react65 = __toESM(require_react());
  var import_isEmpty3 = __toESM(require_isEmpty());
  var import_isEqual = __toESM(require_isEqual());
  var import_isPlainObject3 = __toESM(require_isPlainObject());
  var import_isUndefined = __toESM(require_isUndefined());
  var import_omitBy2 = __toESM(require_omitBy());
  var import_orderBy2 = __toESM(require_orderBy());
  var import_property2 = __toESM(require_property());
  var import_uniq2 = __toESM(require_uniq());

  // node_modules/victory-core/es/victory-util/scale.js
  var scale_exports = {};
  __export(scale_exports, {
    getBaseScale: () => getBaseScale,
    getDefaultScale: () => getDefaultScale,
    getScaleFromName: () => getScaleFromName,
    getScaleFromProps: () => getScaleFromProps,
    getScaleType: () => getScaleType,
    getType: () => getType,
    validScale: () => validScale
  });
  var import_isPlainObject2 = __toESM(require_isPlainObject());

  // node_modules/victory-vendor/es/d3-scale.js
  var d3_scale_exports = {};
  __export(d3_scale_exports, {
    scaleBand: () => band,
    scaleDiverging: () => diverging,
    scaleDivergingLog: () => divergingLog,
    scaleDivergingPow: () => divergingPow,
    scaleDivergingSqrt: () => divergingSqrt,
    scaleDivergingSymlog: () => divergingSymlog,
    scaleIdentity: () => identity3,
    scaleImplicit: () => implicit,
    scaleLinear: () => linear3,
    scaleLog: () => log,
    scaleOrdinal: () => ordinal,
    scalePoint: () => point,
    scalePow: () => pow,
    scaleQuantile: () => quantile2,
    scaleQuantize: () => quantize,
    scaleRadial: () => radial,
    scaleSequential: () => sequential,
    scaleSequentialLog: () => sequentialLog,
    scaleSequentialPow: () => sequentialPow,
    scaleSequentialQuantile: () => sequentialQuantile,
    scaleSequentialSqrt: () => sequentialSqrt,
    scaleSequentialSymlog: () => sequentialSymlog,
    scaleSqrt: () => sqrt,
    scaleSymlog: () => symlog,
    scaleThreshold: () => threshold,
    scaleTime: () => time,
    scaleUtc: () => utcTime,
    tickFormat: () => tickFormat
  });

  // node_modules/d3-array/src/ascending.js
  function ascending(a2, b) {
    return a2 == null || b == null ? NaN : a2 < b ? -1 : a2 > b ? 1 : a2 >= b ? 0 : NaN;
  }

  // node_modules/d3-array/src/descending.js
  function descending(a2, b) {
    return a2 == null || b == null ? NaN : b < a2 ? -1 : b > a2 ? 1 : b >= a2 ? 0 : NaN;
  }

  // node_modules/d3-array/src/bisector.js
  function bisector(f) {
    let compare1, compare2, delta;
    if (f.length !== 2) {
      compare1 = ascending;
      compare2 = (d, x2) => ascending(f(d), x2);
      delta = (d, x2) => f(d) - x2;
    } else {
      compare1 = f === ascending || f === descending ? f : zero2;
      compare2 = f;
      delta = f;
    }
    function left2(a2, x2, lo = 0, hi = a2.length) {
      if (lo < hi) {
        if (compare1(x2, x2) !== 0) return hi;
        do {
          const mid = lo + hi >>> 1;
          if (compare2(a2[mid], x2) < 0) lo = mid + 1;
          else hi = mid;
        } while (lo < hi);
      }
      return lo;
    }
    function right2(a2, x2, lo = 0, hi = a2.length) {
      if (lo < hi) {
        if (compare1(x2, x2) !== 0) return hi;
        do {
          const mid = lo + hi >>> 1;
          if (compare2(a2[mid], x2) <= 0) lo = mid + 1;
          else hi = mid;
        } while (lo < hi);
      }
      return lo;
    }
    function center(a2, x2, lo = 0, hi = a2.length) {
      const i = left2(a2, x2, lo, hi - 1);
      return i > lo && delta(a2[i - 1], x2) > -delta(a2[i], x2) ? i - 1 : i;
    }
    return { left: left2, center, right: right2 };
  }
  function zero2() {
    return 0;
  }

  // node_modules/d3-array/src/number.js
  function number(x2) {
    return x2 === null ? NaN : +x2;
  }
  function* numbers(values, valueof) {
    if (valueof === void 0) {
      for (let value of values) {
        if (value != null && (value = +value) >= value) {
          yield value;
        }
      }
    } else {
      let index = -1;
      for (let value of values) {
        if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {
          yield value;
        }
      }
    }
  }

  // node_modules/d3-array/src/bisect.js
  var ascendingBisect = bisector(ascending);
  var bisectRight = ascendingBisect.right;
  var bisectLeft = ascendingBisect.left;
  var bisectCenter = bisector(number).center;
  var bisect_default = bisectRight;

  // node_modules/internmap/src/index.js
  var InternMap = class extends Map {
    constructor(entries, key = keyof) {
      super();
      Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key } });
      if (entries != null) for (const [key2, value] of entries) this.set(key2, value);
    }
    get(key) {
      return super.get(intern_get(this, key));
    }
    has(key) {
      return super.has(intern_get(this, key));
    }
    set(key, value) {
      return super.set(intern_set(this, key), value);
    }
    delete(key) {
      return super.delete(intern_delete(this, key));
    }
  };
  function intern_get({ _intern, _key }, value) {
    const key = _key(value);
    return _intern.has(key) ? _intern.get(key) : value;
  }
  function intern_set({ _intern, _key }, value) {
    const key = _key(value);
    if (_intern.has(key)) return _intern.get(key);
    _intern.set(key, value);
    return value;
  }
  function intern_delete({ _intern, _key }, value) {
    const key = _key(value);
    if (_intern.has(key)) {
      value = _intern.get(key);
      _intern.delete(key);
    }
    return value;
  }
  function keyof(value) {
    return value !== null && typeof value === "object" ? value.valueOf() : value;
  }

  // node_modules/d3-array/src/sort.js
  function compareDefined(compare = ascending) {
    if (compare === ascending) return ascendingDefined;
    if (typeof compare !== "function") throw new TypeError("compare is not a function");
    return (a2, b) => {
      const x2 = compare(a2, b);
      if (x2 || x2 === 0) return x2;
      return (compare(b, b) === 0) - (compare(a2, a2) === 0);
    };
  }
  function ascendingDefined(a2, b) {
    return (a2 == null || !(a2 >= a2)) - (b == null || !(b >= b)) || (a2 < b ? -1 : a2 > b ? 1 : 0);
  }

  // node_modules/d3-array/src/ticks.js
  var e10 = Math.sqrt(50);
  var e5 = Math.sqrt(10);
  var e2 = Math.sqrt(2);
  function tickSpec(start2, stop, count) {
    const step = (stop - start2) / Math.max(0, count), power = Math.floor(Math.log10(step)), error = step / Math.pow(10, power), factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;
    let i1, i2, inc;
    if (power < 0) {
      inc = Math.pow(10, -power) / factor;
      i1 = Math.round(start2 * inc);
      i2 = Math.round(stop * inc);
      if (i1 / inc < start2) ++i1;
      if (i2 / inc > stop) --i2;
      inc = -inc;
    } else {
      inc = Math.pow(10, power) * factor;
      i1 = Math.round(start2 / inc);
      i2 = Math.round(stop / inc);
      if (i1 * inc < start2) ++i1;
      if (i2 * inc > stop) --i2;
    }
    if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start2, stop, count * 2);
    return [i1, i2, inc];
  }
  function ticks(start2, stop, count) {
    stop = +stop, start2 = +start2, count = +count;
    if (!(count > 0)) return [];
    if (start2 === stop) return [start2];
    const reverse = stop < start2, [i1, i2, inc] = reverse ? tickSpec(stop, start2, count) : tickSpec(start2, stop, count);
    if (!(i2 >= i1)) return [];
    const n = i2 - i1 + 1, ticks2 = new Array(n);
    if (reverse) {
      if (inc < 0) for (let i = 0; i < n; ++i) ticks2[i] = (i2 - i) / -inc;
      else for (let i = 0; i < n; ++i) ticks2[i] = (i2 - i) * inc;
    } else {
      if (inc < 0) for (let i = 0; i < n; ++i) ticks2[i] = (i1 + i) / -inc;
      else for (let i = 0; i < n; ++i) ticks2[i] = (i1 + i) * inc;
    }
    return ticks2;
  }
  function tickIncrement(start2, stop, count) {
    stop = +stop, start2 = +start2, count = +count;
    return tickSpec(start2, stop, count)[2];
  }
  function tickStep(start2, stop, count) {
    stop = +stop, start2 = +start2, count = +count;
    const reverse = stop < start2, inc = reverse ? tickIncrement(stop, start2, count) : tickIncrement(start2, stop, count);
    return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
  }

  // node_modules/d3-array/src/max.js
  function max(values, valueof) {
    let max3;
    if (valueof === void 0) {
      for (const value of values) {
        if (value != null && (max3 < value || max3 === void 0 && value >= value)) {
          max3 = value;
        }
      }
    } else {
      let index = -1;
      for (let value of values) {
        if ((value = valueof(value, ++index, values)) != null && (max3 < value || max3 === void 0 && value >= value)) {
          max3 = value;
        }
      }
    }
    return max3;
  }

  // node_modules/d3-array/src/min.js
  function min(values, valueof) {
    let min3;
    if (valueof === void 0) {
      for (const value of values) {
        if (value != null && (min3 > value || min3 === void 0 && value >= value)) {
          min3 = value;
        }
      }
    } else {
      let index = -1;
      for (let value of values) {
        if ((value = valueof(value, ++index, values)) != null && (min3 > value || min3 === void 0 && value >= value)) {
          min3 = value;
        }
      }
    }
    return min3;
  }

  // node_modules/d3-array/src/quickselect.js
  function quickselect(array, k2, left2 = 0, right2 = Infinity, compare) {
    k2 = Math.floor(k2);
    left2 = Math.floor(Math.max(0, left2));
    right2 = Math.floor(Math.min(array.length - 1, right2));
    if (!(left2 <= k2 && k2 <= right2)) return array;
    compare = compare === void 0 ? ascendingDefined : compareDefined(compare);
    while (right2 > left2) {
      if (right2 - left2 > 600) {
        const n = right2 - left2 + 1;
        const m = k2 - left2 + 1;
        const z = Math.log(n);
        const s2 = 0.5 * Math.exp(2 * z / 3);
        const sd = 0.5 * Math.sqrt(z * s2 * (n - s2) / n) * (m - n / 2 < 0 ? -1 : 1);
        const newLeft = Math.max(left2, Math.floor(k2 - m * s2 / n + sd));
        const newRight = Math.min(right2, Math.floor(k2 + (n - m) * s2 / n + sd));
        quickselect(array, k2, newLeft, newRight, compare);
      }
      const t = array[k2];
      let i = left2;
      let j = right2;
      swap(array, left2, k2);
      if (compare(array[right2], t) > 0) swap(array, left2, right2);
      while (i < j) {
        swap(array, i, j), ++i, --j;
        while (compare(array[i], t) < 0) ++i;
        while (compare(array[j], t) > 0) --j;
      }
      if (compare(array[left2], t) === 0) swap(array, left2, j);
      else ++j, swap(array, j, right2);
      if (j <= k2) left2 = j + 1;
      if (k2 <= j) right2 = j - 1;
    }
    return array;
  }
  function swap(array, i, j) {
    const t = array[i];
    array[i] = array[j];
    array[j] = t;
  }

  // node_modules/d3-array/src/quantile.js
  function quantile(values, p, valueof) {
    values = Float64Array.from(numbers(values, valueof));
    if (!(n = values.length) || isNaN(p = +p)) return;
    if (p <= 0 || n < 2) return min(values);
    if (p >= 1) return max(values);
    var n, i = (n - 1) * p, i0 = Math.floor(i), value0 = max(quickselect(values, i0).subarray(0, i0 + 1)), value1 = min(values.subarray(i0 + 1));
    return value0 + (value1 - value0) * (i - i0);
  }
  function quantileSorted(values, p, valueof = number) {
    if (!(n = values.length) || isNaN(p = +p)) return;
    if (p <= 0 || n < 2) return +valueof(values[0], 0, values);
    if (p >= 1) return +valueof(values[n - 1], n - 1, values);
    var n, i = (n - 1) * p, i0 = Math.floor(i), value0 = +valueof(values[i0], i0, values), value1 = +valueof(values[i0 + 1], i0 + 1, values);
    return value0 + (value1 - value0) * (i - i0);
  }

  // node_modules/d3-array/src/range.js
  function range2(start2, stop, step) {
    start2 = +start2, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start2, start2 = 0, 1) : n < 3 ? 1 : +step;
    var i = -1, n = Math.max(0, Math.ceil((stop - start2) / step)) | 0, range4 = new Array(n);
    while (++i < n) {
      range4[i] = start2 + i * step;
    }
    return range4;
  }

  // node_modules/d3-scale/src/init.js
  function initRange(domain, range4) {
    switch (arguments.length) {
      case 0:
        break;
      case 1:
        this.range(domain);
        break;
      default:
        this.range(range4).domain(domain);
        break;
    }
    return this;
  }
  function initInterpolator(domain, interpolator) {
    switch (arguments.length) {
      case 0:
        break;
      case 1: {
        if (typeof domain === "function") this.interpolator(domain);
        else this.range(domain);
        break;
      }
      default: {
        this.domain(domain);
        if (typeof interpolator === "function") this.interpolator(interpolator);
        else this.range(interpolator);
        break;
      }
    }
    return this;
  }

  // node_modules/d3-scale/src/ordinal.js
  var implicit = Symbol("implicit");
  function ordinal() {
    var index = new InternMap(), domain = [], range4 = [], unknown = implicit;
    function scale(d) {
      let i = index.get(d);
      if (i === void 0) {
        if (unknown !== implicit) return unknown;
        index.set(d, i = domain.push(d) - 1);
      }
      return range4[i % range4.length];
    }
    scale.domain = function(_113) {
      if (!arguments.length) return domain.slice();
      domain = [], index = new InternMap();
      for (const value of _113) {
        if (index.has(value)) continue;
        index.set(value, domain.push(value) - 1);
      }
      return scale;
    };
    scale.range = function(_113) {
      return arguments.length ? (range4 = Array.from(_113), scale) : range4.slice();
    };
    scale.unknown = function(_113) {
      return arguments.length ? (unknown = _113, scale) : unknown;
    };
    scale.copy = function() {
      return ordinal(domain, range4).unknown(unknown);
    };
    initRange.apply(scale, arguments);
    return scale;
  }

  // node_modules/d3-scale/src/band.js
  function band() {
    var scale = ordinal().unknown(void 0), domain = scale.domain, ordinalRange = scale.range, r0 = 0, r1 = 1, step, bandwidth, round = false, paddingInner = 0, paddingOuter = 0, align = 0.5;
    delete scale.unknown;
    function rescale() {
      var n = domain().length, reverse = r1 < r0, start2 = reverse ? r1 : r0, stop = reverse ? r0 : r1;
      step = (stop - start2) / Math.max(1, n - paddingInner + paddingOuter * 2);
      if (round) step = Math.floor(step);
      start2 += (stop - start2 - step * (n - paddingInner)) * align;
      bandwidth = step * (1 - paddingInner);
      if (round) start2 = Math.round(start2), bandwidth = Math.round(bandwidth);
      var values = range2(n).map(function(i) {
        return start2 + step * i;
      });
      return ordinalRange(reverse ? values.reverse() : values);
    }
    scale.domain = function(_113) {
      return arguments.length ? (domain(_113), rescale()) : domain();
    };
    scale.range = function(_113) {
      return arguments.length ? ([r0, r1] = _113, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];
    };
    scale.rangeRound = function(_113) {
      return [r0, r1] = _113, r0 = +r0, r1 = +r1, round = true, rescale();
    };
    scale.bandwidth = function() {
      return bandwidth;
    };
    scale.step = function() {
      return step;
    };
    scale.round = function(_113) {
      return arguments.length ? (round = !!_113, rescale()) : round;
    };
    scale.padding = function(_113) {
      return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_113), rescale()) : paddingInner;
    };
    scale.paddingInner = function(_113) {
      return arguments.length ? (paddingInner = Math.min(1, _113), rescale()) : paddingInner;
    };
    scale.paddingOuter = function(_113) {
      return arguments.length ? (paddingOuter = +_113, rescale()) : paddingOuter;
    };
    scale.align = function(_113) {
      return arguments.length ? (align = Math.max(0, Math.min(1, _113)), rescale()) : align;
    };
    scale.copy = function() {
      return band(domain(), [r0, r1]).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);
    };
    return initRange.apply(rescale(), arguments);
  }
  function pointish(scale) {
    var copy3 = scale.copy;
    scale.padding = scale.paddingOuter;
    delete scale.paddingInner;
    delete scale.paddingOuter;
    scale.copy = function() {
      return pointish(copy3());
    };
    return scale;
  }
  function point() {
    return pointish(band.apply(null, arguments).paddingInner(1));
  }

  // node_modules/d3-scale/src/constant.js
  function constants(x2) {
    return function() {
      return x2;
    };
  }

  // node_modules/d3-scale/src/number.js
  function number2(x2) {
    return +x2;
  }

  // node_modules/d3-scale/src/continuous.js
  var unit = [0, 1];
  function identity2(x2) {
    return x2;
  }
  function normalize(a2, b) {
    return (b -= a2 = +a2) ? function(x2) {
      return (x2 - a2) / b;
    } : constants(isNaN(b) ? NaN : 0.5);
  }
  function clamper(a2, b) {
    var t;
    if (a2 > b) t = a2, a2 = b, b = t;
    return function(x2) {
      return Math.max(a2, Math.min(b, x2));
    };
  }
  function bimap(domain, range4, interpolate) {
    var d0 = domain[0], d1 = domain[1], r0 = range4[0], r1 = range4[1];
    if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
    else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
    return function(x2) {
      return r0(d0(x2));
    };
  }
  function polymap(domain, range4, interpolate) {
    var j = Math.min(domain.length, range4.length) - 1, d = new Array(j), r = new Array(j), i = -1;
    if (domain[j] < domain[0]) {
      domain = domain.slice().reverse();
      range4 = range4.slice().reverse();
    }
    while (++i < j) {
      d[i] = normalize(domain[i], domain[i + 1]);
      r[i] = interpolate(range4[i], range4[i + 1]);
    }
    return function(x2) {
      var i2 = bisect_default(domain, x2, 1, j) - 1;
      return r[i2](d[i2](x2));
    };
  }
  function copy(source, target) {
    return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
  }
  function transformer() {
    var domain = unit, range4 = unit, interpolate = value_default, transform, untransform, unknown, clamp = identity2, piecewise2, output, input;
    function rescale() {
      var n = Math.min(domain.length, range4.length);
      if (clamp !== identity2) clamp = clamper(domain[0], domain[n - 1]);
      piecewise2 = n > 2 ? polymap : bimap;
      output = input = null;
      return scale;
    }
    function scale(x2) {
      return x2 == null || isNaN(x2 = +x2) ? unknown : (output || (output = piecewise2(domain.map(transform), range4, interpolate)))(transform(clamp(x2)));
    }
    scale.invert = function(y2) {
      return clamp(untransform((input || (input = piecewise2(range4, domain.map(transform), number_default)))(y2)));
    };
    scale.domain = function(_113) {
      return arguments.length ? (domain = Array.from(_113, number2), rescale()) : domain.slice();
    };
    scale.range = function(_113) {
      return arguments.length ? (range4 = Array.from(_113), rescale()) : range4.slice();
    };
    scale.rangeRound = function(_113) {
      return range4 = Array.from(_113), interpolate = round_default, rescale();
    };
    scale.clamp = function(_113) {
      return arguments.length ? (clamp = _113 ? true : identity2, rescale()) : clamp !== identity2;
    };
    scale.interpolate = function(_113) {
      return arguments.length ? (interpolate = _113, rescale()) : interpolate;
    };
    scale.unknown = function(_113) {
      return arguments.length ? (unknown = _113, scale) : unknown;
    };
    return function(t, u) {
      transform = t, untransform = u;
      return rescale();
    };
  }
  function continuous() {
    return transformer()(identity2, identity2);
  }

  // node_modules/d3-format/src/formatDecimal.js
  function formatDecimal_default(x2) {
    return Math.abs(x2 = Math.round(x2)) >= 1e21 ? x2.toLocaleString("en").replace(/,/g, "") : x2.toString(10);
  }
  function formatDecimalParts(x2, p) {
    if (!isFinite(x2) || x2 === 0) return null;
    var i = (x2 = p ? x2.toExponential(p - 1) : x2.toExponential()).indexOf("e"), coefficient = x2.slice(0, i);
    return [
      coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
      +x2.slice(i + 1)
    ];
  }

  // node_modules/d3-format/src/exponent.js
  function exponent_default(x2) {
    return x2 = formatDecimalParts(Math.abs(x2)), x2 ? x2[1] : NaN;
  }

  // node_modules/d3-format/src/formatGroup.js
  function formatGroup_default(grouping, thousands) {
    return function(value, width) {
      var i = value.length, t = [], j = 0, g = grouping[0], length = 0;
      while (i > 0 && g > 0) {
        if (length + g + 1 > width) g = Math.max(1, width - length);
        t.push(value.substring(i -= g, i + g));
        if ((length += g + 1) > width) break;
        g = grouping[j = (j + 1) % grouping.length];
      }
      return t.reverse().join(thousands);
    };
  }

  // node_modules/d3-format/src/formatNumerals.js
  function formatNumerals_default(numerals) {
    return function(value) {
      return value.replace(/[0-9]/g, function(i) {
        return numerals[+i];
      });
    };
  }

  // node_modules/d3-format/src/formatSpecifier.js
  var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
  function formatSpecifier(specifier) {
    if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
    var match;
    return new FormatSpecifier({
      fill: match[1],
      align: match[2],
      sign: match[3],
      symbol: match[4],
      zero: match[5],
      width: match[6],
      comma: match[7],
      precision: match[8] && match[8].slice(1),
      trim: match[9],
      type: match[10]
    });
  }
  formatSpecifier.prototype = FormatSpecifier.prototype;
  function FormatSpecifier(specifier) {
    this.fill = specifier.fill === void 0 ? " " : specifier.fill + "";
    this.align = specifier.align === void 0 ? ">" : specifier.align + "";
    this.sign = specifier.sign === void 0 ? "-" : specifier.sign + "";
    this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + "";
    this.zero = !!specifier.zero;
    this.width = specifier.width === void 0 ? void 0 : +specifier.width;
    this.comma = !!specifier.comma;
    this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision;
    this.trim = !!specifier.trim;
    this.type = specifier.type === void 0 ? "" : specifier.type + "";
  }
  FormatSpecifier.prototype.toString = function() {
    return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
  };

  // node_modules/d3-format/src/formatTrim.js
  function formatTrim_default(s2) {
    out: for (var n = s2.length, i = 1, i0 = -1, i1; i < n; ++i) {
      switch (s2[i]) {
        case ".":
          i0 = i1 = i;
          break;
        case "0":
          if (i0 === 0) i0 = i;
          i1 = i;
          break;
        default:
          if (!+s2[i]) break out;
          if (i0 > 0) i0 = 0;
          break;
      }
    }
    return i0 > 0 ? s2.slice(0, i0) + s2.slice(i1 + 1) : s2;
  }

  // node_modules/d3-format/src/formatPrefixAuto.js
  var prefixExponent;
  function formatPrefixAuto_default(x2, p) {
    var d = formatDecimalParts(x2, p);
    if (!d) return prefixExponent = void 0, x2.toPrecision(p);
    var coefficient = d[0], exponent2 = d[1], i = exponent2 - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent2 / 3))) * 3) + 1, n = coefficient.length;
    return i === n ? coefficient : i > n ? coefficient + new Array(i - n + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + new Array(1 - i).join("0") + formatDecimalParts(x2, Math.max(0, p + i - 1))[0];
  }

  // node_modules/d3-format/src/formatRounded.js
  function formatRounded_default(x2, p) {
    var d = formatDecimalParts(x2, p);
    if (!d) return x2 + "";
    var coefficient = d[0], exponent2 = d[1];
    return exponent2 < 0 ? "0." + new Array(-exponent2).join("0") + coefficient : coefficient.length > exponent2 + 1 ? coefficient.slice(0, exponent2 + 1) + "." + coefficient.slice(exponent2 + 1) : coefficient + new Array(exponent2 - coefficient.length + 2).join("0");
  }

  // node_modules/d3-format/src/formatTypes.js
  var formatTypes_default = {
    "%": (x2, p) => (x2 * 100).toFixed(p),
    "b": (x2) => Math.round(x2).toString(2),
    "c": (x2) => x2 + "",
    "d": formatDecimal_default,
    "e": (x2, p) => x2.toExponential(p),
    "f": (x2, p) => x2.toFixed(p),
    "g": (x2, p) => x2.toPrecision(p),
    "o": (x2) => Math.round(x2).toString(8),
    "p": (x2, p) => formatRounded_default(x2 * 100, p),
    "r": formatRounded_default,
    "s": formatPrefixAuto_default,
    "X": (x2) => Math.round(x2).toString(16).toUpperCase(),
    "x": (x2) => Math.round(x2).toString(16)
  };

  // node_modules/d3-format/src/identity.js
  function identity_default(x2) {
    return x2;
  }

  // node_modules/d3-format/src/locale.js
  var map = Array.prototype.map;
  var prefixes = ["y", "z", "a", "f", "p", "n", "\xB5", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
  function locale_default(locale3) {
    var group = locale3.grouping === void 0 || locale3.thousands === void 0 ? identity_default : formatGroup_default(map.call(locale3.grouping, Number), locale3.thousands + ""), currencyPrefix = locale3.currency === void 0 ? "" : locale3.currency[0] + "", currencySuffix = locale3.currency === void 0 ? "" : locale3.currency[1] + "", decimal = locale3.decimal === void 0 ? "." : locale3.decimal + "", numerals = locale3.numerals === void 0 ? identity_default : formatNumerals_default(map.call(locale3.numerals, String)), percent = locale3.percent === void 0 ? "%" : locale3.percent + "", minus2 = locale3.minus === void 0 ? "\u2212" : locale3.minus + "", nan = locale3.nan === void 0 ? "NaN" : locale3.nan + "";
    function newFormat(specifier, options5) {
      specifier = formatSpecifier(specifier);
      var fill = specifier.fill, align = specifier.align, sign2 = specifier.sign, symbol = specifier.symbol, zero3 = specifier.zero, width = specifier.width, comma = specifier.comma, precision = specifier.precision, trim = specifier.trim, type = specifier.type;
      if (type === "n") comma = true, type = "g";
      else if (!formatTypes_default[type]) precision === void 0 && (precision = 12), trim = true, type = "g";
      if (zero3 || fill === "0" && align === "=") zero3 = true, fill = "0", align = "=";
      var prefix = (options5 && options5.prefix !== void 0 ? options5.prefix : "") + (symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : ""), suffix = (symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "") + (options5 && options5.suffix !== void 0 ? options5.suffix : "");
      var formatType = formatTypes_default[type], maybeSuffix = /[defgprs%]/.test(type);
      precision = precision === void 0 ? 6 : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision));
      function format2(value) {
        var valuePrefix = prefix, valueSuffix = suffix, i, n, c2;
        if (type === "c") {
          valueSuffix = formatType(value) + valueSuffix;
          value = "";
        } else {
          value = +value;
          var valueNegative = value < 0 || 1 / value < 0;
          value = isNaN(value) ? nan : formatType(Math.abs(value), precision);
          if (trim) value = formatTrim_default(value);
          if (valueNegative && +value === 0 && sign2 !== "+") valueNegative = false;
          valuePrefix = (valueNegative ? sign2 === "(" ? sign2 : minus2 : sign2 === "-" || sign2 === "(" ? "" : sign2) + valuePrefix;
          valueSuffix = (type === "s" && !isNaN(value) && prefixExponent !== void 0 ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign2 === "(" ? ")" : "");
          if (maybeSuffix) {
            i = -1, n = value.length;
            while (++i < n) {
              if (c2 = value.charCodeAt(i), 48 > c2 || c2 > 57) {
                valueSuffix = (c2 === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
                value = value.slice(0, i);
                break;
              }
            }
          }
        }
        if (comma && !zero3) value = group(value, Infinity);
        var length = valuePrefix.length + value.length + valueSuffix.length, padding3 = length < width ? new Array(width - length + 1).join(fill) : "";
        if (comma && zero3) value = group(padding3 + value, padding3.length ? width - valueSuffix.length : Infinity), padding3 = "";
        switch (align) {
          case "<":
            value = valuePrefix + value + valueSuffix + padding3;
            break;
          case "=":
            value = valuePrefix + padding3 + value + valueSuffix;
            break;
          case "^":
            value = padding3.slice(0, length = padding3.length >> 1) + valuePrefix + value + valueSuffix + padding3.slice(length);
            break;
          default:
            value = padding3 + valuePrefix + value + valueSuffix;
            break;
        }
        return numerals(value);
      }
      format2.toString = function() {
        return specifier + "";
      };
      return format2;
    }
    function formatPrefix2(specifier, value) {
      var e = Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3, k2 = Math.pow(10, -e), f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier), { suffix: prefixes[8 + e / 3] });
      return function(value2) {
        return f(k2 * value2);
      };
    }
    return {
      format: newFormat,
      formatPrefix: formatPrefix2
    };
  }

  // node_modules/d3-format/src/defaultLocale.js
  var locale;
  var format;
  var formatPrefix;
  defaultLocale({
    thousands: ",",
    grouping: [3],
    currency: ["$", ""]
  });
  function defaultLocale(definition) {
    locale = locale_default(definition);
    format = locale.format;
    formatPrefix = locale.formatPrefix;
    return locale;
  }

  // node_modules/d3-format/src/precisionFixed.js
  function precisionFixed_default(step) {
    return Math.max(0, -exponent_default(Math.abs(step)));
  }

  // node_modules/d3-format/src/precisionPrefix.js
  function precisionPrefix_default(step, value) {
    return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3 - exponent_default(Math.abs(step)));
  }

  // node_modules/d3-format/src/precisionRound.js
  function precisionRound_default(step, max3) {
    step = Math.abs(step), max3 = Math.abs(max3) - step;
    return Math.max(0, exponent_default(max3) - exponent_default(step)) + 1;
  }

  // node_modules/d3-scale/src/tickFormat.js
  function tickFormat(start2, stop, count, specifier) {
    var step = tickStep(start2, stop, count), precision;
    specifier = formatSpecifier(specifier == null ? ",f" : specifier);
    switch (specifier.type) {
      case "s": {
        var value = Math.max(Math.abs(start2), Math.abs(stop));
        if (specifier.precision == null && !isNaN(precision = precisionPrefix_default(step, value))) specifier.precision = precision;
        return formatPrefix(specifier, value);
      }
      case "":
      case "e":
      case "g":
      case "p":
      case "r": {
        if (specifier.precision == null && !isNaN(precision = precisionRound_default(step, Math.max(Math.abs(start2), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
        break;
      }
      case "f":
      case "%": {
        if (specifier.precision == null && !isNaN(precision = precisionFixed_default(step))) specifier.precision = precision - (specifier.type === "%") * 2;
        break;
      }
    }
    return format(specifier);
  }

  // node_modules/d3-scale/src/linear.js
  function linearish(scale) {
    var domain = scale.domain;
    scale.ticks = function(count) {
      var d = domain();
      return ticks(d[0], d[d.length - 1], count == null ? 10 : count);
    };
    scale.tickFormat = function(count, specifier) {
      var d = domain();
      return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);
    };
    scale.nice = function(count) {
      if (count == null) count = 10;
      var d = domain();
      var i0 = 0;
      var i1 = d.length - 1;
      var start2 = d[i0];
      var stop = d[i1];
      var prestep;
      var step;
      var maxIter = 10;
      if (stop < start2) {
        step = start2, start2 = stop, stop = step;
        step = i0, i0 = i1, i1 = step;
      }
      while (maxIter-- > 0) {
        step = tickIncrement(start2, stop, count);
        if (step === prestep) {
          d[i0] = start2;
          d[i1] = stop;
          return domain(d);
        } else if (step > 0) {
          start2 = Math.floor(start2 / step) * step;
          stop = Math.ceil(stop / step) * step;
        } else if (step < 0) {
          start2 = Math.ceil(start2 * step) / step;
          stop = Math.floor(stop * step) / step;
        } else {
          break;
        }
        prestep = step;
      }
      return scale;
    };
    return scale;
  }
  function linear3() {
    var scale = continuous();
    scale.copy = function() {
      return copy(scale, linear3());
    };
    initRange.apply(scale, arguments);
    return linearish(scale);
  }

  // node_modules/d3-scale/src/identity.js
  function identity3(domain) {
    var unknown;
    function scale(x2) {
      return x2 == null || isNaN(x2 = +x2) ? unknown : x2;
    }
    scale.invert = scale;
    scale.domain = scale.range = function(_113) {
      return arguments.length ? (domain = Array.from(_113, number2), scale) : domain.slice();
    };
    scale.unknown = function(_113) {
      return arguments.length ? (unknown = _113, scale) : unknown;
    };
    scale.copy = function() {
      return identity3(domain).unknown(unknown);
    };
    domain = arguments.length ? Array.from(domain, number2) : [0, 1];
    return linearish(scale);
  }

  // node_modules/d3-scale/src/nice.js
  function nice(domain, interval2) {
    domain = domain.slice();
    var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], t;
    if (x1 < x0) {
      t = i0, i0 = i1, i1 = t;
      t = x0, x0 = x1, x1 = t;
    }
    domain[i0] = interval2.floor(x0);
    domain[i1] = interval2.ceil(x1);
    return domain;
  }

  // node_modules/d3-scale/src/log.js
  function transformLog(x2) {
    return Math.log(x2);
  }
  function transformExp(x2) {
    return Math.exp(x2);
  }
  function transformLogn(x2) {
    return -Math.log(-x2);
  }
  function transformExpn(x2) {
    return -Math.exp(-x2);
  }
  function pow10(x2) {
    return isFinite(x2) ? +("1e" + x2) : x2 < 0 ? 0 : x2;
  }
  function powp(base) {
    return base === 10 ? pow10 : base === Math.E ? Math.exp : (x2) => Math.pow(base, x2);
  }
  function logp(base) {
    return base === Math.E ? Math.log : base === 10 && Math.log10 || base === 2 && Math.log2 || (base = Math.log(base), (x2) => Math.log(x2) / base);
  }
  function reflect(f) {
    return (x2, k2) => -f(-x2, k2);
  }
  function loggish(transform) {
    const scale = transform(transformLog, transformExp);
    const domain = scale.domain;
    let base = 10;
    let logs;
    let pows;
    function rescale() {
      logs = logp(base), pows = powp(base);
      if (domain()[0] < 0) {
        logs = reflect(logs), pows = reflect(pows);
        transform(transformLogn, transformExpn);
      } else {
        transform(transformLog, transformExp);
      }
      return scale;
    }
    scale.base = function(_113) {
      return arguments.length ? (base = +_113, rescale()) : base;
    };
    scale.domain = function(_113) {
      return arguments.length ? (domain(_113), rescale()) : domain();
    };
    scale.ticks = (count) => {
      const d = domain();
      let u = d[0];
      let v = d[d.length - 1];
      const r = v < u;
      if (r) [u, v] = [v, u];
      let i = logs(u);
      let j = logs(v);
      let k2;
      let t;
      const n = count == null ? 10 : +count;
      let z = [];
      if (!(base % 1) && j - i < n) {
        i = Math.floor(i), j = Math.ceil(j);
        if (u > 0) for (; i <= j; ++i) {
          for (k2 = 1; k2 < base; ++k2) {
            t = i < 0 ? k2 / pows(-i) : k2 * pows(i);
            if (t < u) continue;
            if (t > v) break;
            z.push(t);
          }
        }
        else for (; i <= j; ++i) {
          for (k2 = base - 1; k2 >= 1; --k2) {
            t = i > 0 ? k2 / pows(-i) : k2 * pows(i);
            if (t < u) continue;
            if (t > v) break;
            z.push(t);
          }
        }
        if (z.length * 2 < n) z = ticks(u, v, n);
      } else {
        z = ticks(i, j, Math.min(j - i, n)).map(pows);
      }
      return r ? z.reverse() : z;
    };
    scale.tickFormat = (count, specifier) => {
      if (count == null) count = 10;
      if (specifier == null) specifier = base === 10 ? "s" : ",";
      if (typeof specifier !== "function") {
        if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;
        specifier = format(specifier);
      }
      if (count === Infinity) return specifier;
      const k2 = Math.max(1, base * count / scale.ticks().length);
      return (d) => {
        let i = d / pows(Math.round(logs(d)));
        if (i * base < base - 0.5) i *= base;
        return i <= k2 ? specifier(d) : "";
      };
    };
    scale.nice = () => {
      return domain(nice(domain(), {
        floor: (x2) => pows(Math.floor(logs(x2))),
        ceil: (x2) => pows(Math.ceil(logs(x2)))
      }));
    };
    return scale;
  }
  function log() {
    const scale = loggish(transformer()).domain([1, 10]);
    scale.copy = () => copy(scale, log()).base(scale.base());
    initRange.apply(scale, arguments);
    return scale;
  }

  // node_modules/d3-scale/src/symlog.js
  function transformSymlog(c2) {
    return function(x2) {
      return Math.sign(x2) * Math.log1p(Math.abs(x2 / c2));
    };
  }
  function transformSymexp(c2) {
    return function(x2) {
      return Math.sign(x2) * Math.expm1(Math.abs(x2)) * c2;
    };
  }
  function symlogish(transform) {
    var c2 = 1, scale = transform(transformSymlog(c2), transformSymexp(c2));
    scale.constant = function(_113) {
      return arguments.length ? transform(transformSymlog(c2 = +_113), transformSymexp(c2)) : c2;
    };
    return linearish(scale);
  }
  function symlog() {
    var scale = symlogish(transformer());
    scale.copy = function() {
      return copy(scale, symlog()).constant(scale.constant());
    };
    return initRange.apply(scale, arguments);
  }

  // node_modules/d3-scale/src/pow.js
  function transformPow(exponent2) {
    return function(x2) {
      return x2 < 0 ? -Math.pow(-x2, exponent2) : Math.pow(x2, exponent2);
    };
  }
  function transformSqrt(x2) {
    return x2 < 0 ? -Math.sqrt(-x2) : Math.sqrt(x2);
  }
  function transformSquare(x2) {
    return x2 < 0 ? -x2 * x2 : x2 * x2;
  }
  function powish(transform) {
    var scale = transform(identity2, identity2), exponent2 = 1;
    function rescale() {
      return exponent2 === 1 ? transform(identity2, identity2) : exponent2 === 0.5 ? transform(transformSqrt, transformSquare) : transform(transformPow(exponent2), transformPow(1 / exponent2));
    }
    scale.exponent = function(_113) {
      return arguments.length ? (exponent2 = +_113, rescale()) : exponent2;
    };
    return linearish(scale);
  }
  function pow() {
    var scale = powish(transformer());
    scale.copy = function() {
      return copy(scale, pow()).exponent(scale.exponent());
    };
    initRange.apply(scale, arguments);
    return scale;
  }
  function sqrt() {
    return pow.apply(null, arguments).exponent(0.5);
  }

  // node_modules/d3-scale/src/radial.js
  function square(x2) {
    return Math.sign(x2) * x2 * x2;
  }
  function unsquare(x2) {
    return Math.sign(x2) * Math.sqrt(Math.abs(x2));
  }
  function radial() {
    var squared = continuous(), range4 = [0, 1], round = false, unknown;
    function scale(x2) {
      var y2 = unsquare(squared(x2));
      return isNaN(y2) ? unknown : round ? Math.round(y2) : y2;
    }
    scale.invert = function(y2) {
      return squared.invert(square(y2));
    };
    scale.domain = function(_113) {
      return arguments.length ? (squared.domain(_113), scale) : squared.domain();
    };
    scale.range = function(_113) {
      return arguments.length ? (squared.range((range4 = Array.from(_113, number2)).map(square)), scale) : range4.slice();
    };
    scale.rangeRound = function(_113) {
      return scale.range(_113).round(true);
    };
    scale.round = function(_113) {
      return arguments.length ? (round = !!_113, scale) : round;
    };
    scale.clamp = function(_113) {
      return arguments.length ? (squared.clamp(_113), scale) : squared.clamp();
    };
    scale.unknown = function(_113) {
      return arguments.length ? (unknown = _113, scale) : unknown;
    };
    scale.copy = function() {
      return radial(squared.domain(), range4).round(round).clamp(squared.clamp()).unknown(unknown);
    };
    initRange.apply(scale, arguments);
    return linearish(scale);
  }

  // node_modules/d3-scale/src/quantile.js
  function quantile2() {
    var domain = [], range4 = [], thresholds = [], unknown;
    function rescale() {
      var i = 0, n = Math.max(1, range4.length);
      thresholds = new Array(n - 1);
      while (++i < n) thresholds[i - 1] = quantileSorted(domain, i / n);
      return scale;
    }
    function scale(x2) {
      return x2 == null || isNaN(x2 = +x2) ? unknown : range4[bisect_default(thresholds, x2)];
    }
    scale.invertExtent = function(y2) {
      var i = range4.indexOf(y2);
      return i < 0 ? [NaN, NaN] : [
        i > 0 ? thresholds[i - 1] : domain[0],
        i < thresholds.length ? thresholds[i] : domain[domain.length - 1]
      ];
    };
    scale.domain = function(_113) {
      if (!arguments.length) return domain.slice();
      domain = [];
      for (let d of _113) if (d != null && !isNaN(d = +d)) domain.push(d);
      domain.sort(ascending);
      return rescale();
    };
    scale.range = function(_113) {
      return arguments.length ? (range4 = Array.from(_113), rescale()) : range4.slice();
    };
    scale.unknown = function(_113) {
      return arguments.length ? (unknown = _113, scale) : unknown;
    };
    scale.quantiles = function() {
      return thresholds.slice();
    };
    scale.copy = function() {
      return quantile2().domain(domain).range(range4).unknown(unknown);
    };
    return initRange.apply(scale, arguments);
  }

  // node_modules/d3-scale/src/quantize.js
  function quantize() {
    var x0 = 0, x1 = 1, n = 1, domain = [0.5], range4 = [0, 1], unknown;
    function scale(x2) {
      return x2 != null && x2 <= x2 ? range4[bisect_default(domain, x2, 0, n)] : unknown;
    }
    function rescale() {
      var i = -1;
      domain = new Array(n);
      while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);
      return scale;
    }
    scale.domain = function(_113) {
      return arguments.length ? ([x0, x1] = _113, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];
    };
    scale.range = function(_113) {
      return arguments.length ? (n = (range4 = Array.from(_113)).length - 1, rescale()) : range4.slice();
    };
    scale.invertExtent = function(y2) {
      var i = range4.indexOf(y2);
      return i < 0 ? [NaN, NaN] : i < 1 ? [x0, domain[0]] : i >= n ? [domain[n - 1], x1] : [domain[i - 1], domain[i]];
    };
    scale.unknown = function(_113) {
      return arguments.length ? (unknown = _113, scale) : scale;
    };
    scale.thresholds = function() {
      return domain.slice();
    };
    scale.copy = function() {
      return quantize().domain([x0, x1]).range(range4).unknown(unknown);
    };
    return initRange.apply(linearish(scale), arguments);
  }

  // node_modules/d3-scale/src/threshold.js
  function threshold() {
    var domain = [0.5], range4 = [0, 1], unknown, n = 1;
    function scale(x2) {
      return x2 != null && x2 <= x2 ? range4[bisect_default(domain, x2, 0, n)] : unknown;
    }
    scale.domain = function(_113) {
      return arguments.length ? (domain = Array.from(_113), n = Math.min(domain.length, range4.length - 1), scale) : domain.slice();
    };
    scale.range = function(_113) {
      return arguments.length ? (range4 = Array.from(_113), n = Math.min(domain.length, range4.length - 1), scale) : range4.slice();
    };
    scale.invertExtent = function(y2) {
      var i = range4.indexOf(y2);
      return [domain[i - 1], domain[i]];
    };
    scale.unknown = function(_113) {
      return arguments.length ? (unknown = _113, scale) : unknown;
    };
    scale.copy = function() {
      return threshold().domain(domain).range(range4).unknown(unknown);
    };
    return initRange.apply(scale, arguments);
  }

  // node_modules/d3-time/src/interval.js
  var t0 = /* @__PURE__ */ new Date();
  var t1 = /* @__PURE__ */ new Date();
  function timeInterval(floori, offseti, count, field) {
    function interval2(date2) {
      return floori(date2 = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+date2)), date2;
    }
    interval2.floor = (date2) => {
      return floori(date2 = /* @__PURE__ */ new Date(+date2)), date2;
    };
    interval2.ceil = (date2) => {
      return floori(date2 = new Date(date2 - 1)), offseti(date2, 1), floori(date2), date2;
    };
    interval2.round = (date2) => {
      const d0 = interval2(date2), d1 = interval2.ceil(date2);
      return date2 - d0 < d1 - date2 ? d0 : d1;
    };
    interval2.offset = (date2, step) => {
      return offseti(date2 = /* @__PURE__ */ new Date(+date2), step == null ? 1 : Math.floor(step)), date2;
    };
    interval2.range = (start2, stop, step) => {
      const range4 = [];
      start2 = interval2.ceil(start2);
      step = step == null ? 1 : Math.floor(step);
      if (!(start2 < stop) || !(step > 0)) return range4;
      let previous;
      do
        range4.push(previous = /* @__PURE__ */ new Date(+start2)), offseti(start2, step), floori(start2);
      while (previous < start2 && start2 < stop);
      return range4;
    };
    interval2.filter = (test) => {
      return timeInterval((date2) => {
        if (date2 >= date2) while (floori(date2), !test(date2)) date2.setTime(date2 - 1);
      }, (date2, step) => {
        if (date2 >= date2) {
          if (step < 0) while (++step <= 0) {
            while (offseti(date2, -1), !test(date2)) {
            }
          }
          else while (--step >= 0) {
            while (offseti(date2, 1), !test(date2)) {
            }
          }
        }
      });
    };
    if (count) {
      interval2.count = (start2, end2) => {
        t0.setTime(+start2), t1.setTime(+end2);
        floori(t0), floori(t1);
        return Math.floor(count(t0, t1));
      };
      interval2.every = (step) => {
        step = Math.floor(step);
        return !isFinite(step) || !(step > 0) ? null : !(step > 1) ? interval2 : interval2.filter(field ? (d) => field(d) % step === 0 : (d) => interval2.count(0, d) % step === 0);
      };
    }
    return interval2;
  }

  // node_modules/d3-time/src/millisecond.js
  var millisecond = timeInterval(() => {
  }, (date2, step) => {
    date2.setTime(+date2 + step);
  }, (start2, end2) => {
    return end2 - start2;
  });
  millisecond.every = (k2) => {
    k2 = Math.floor(k2);
    if (!isFinite(k2) || !(k2 > 0)) return null;
    if (!(k2 > 1)) return millisecond;
    return timeInterval((date2) => {
      date2.setTime(Math.floor(date2 / k2) * k2);
    }, (date2, step) => {
      date2.setTime(+date2 + step * k2);
    }, (start2, end2) => {
      return (end2 - start2) / k2;
    });
  };
  var milliseconds = millisecond.range;

  // node_modules/d3-time/src/duration.js
  var durationSecond = 1e3;
  var durationMinute = durationSecond * 60;
  var durationHour = durationMinute * 60;
  var durationDay = durationHour * 24;
  var durationWeek = durationDay * 7;
  var durationMonth = durationDay * 30;
  var durationYear = durationDay * 365;

  // node_modules/d3-time/src/second.js
  var second = timeInterval((date2) => {
    date2.setTime(date2 - date2.getMilliseconds());
  }, (date2, step) => {
    date2.setTime(+date2 + step * durationSecond);
  }, (start2, end2) => {
    return (end2 - start2) / durationSecond;
  }, (date2) => {
    return date2.getUTCSeconds();
  });
  var seconds = second.range;

  // node_modules/d3-time/src/minute.js
  var timeMinute = timeInterval((date2) => {
    date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond);
  }, (date2, step) => {
    date2.setTime(+date2 + step * durationMinute);
  }, (start2, end2) => {
    return (end2 - start2) / durationMinute;
  }, (date2) => {
    return date2.getMinutes();
  });
  var timeMinutes = timeMinute.range;
  var utcMinute = timeInterval((date2) => {
    date2.setUTCSeconds(0, 0);
  }, (date2, step) => {
    date2.setTime(+date2 + step * durationMinute);
  }, (start2, end2) => {
    return (end2 - start2) / durationMinute;
  }, (date2) => {
    return date2.getUTCMinutes();
  });
  var utcMinutes = utcMinute.range;

  // node_modules/d3-time/src/hour.js
  var timeHour = timeInterval((date2) => {
    date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond - date2.getMinutes() * durationMinute);
  }, (date2, step) => {
    date2.setTime(+date2 + step * durationHour);
  }, (start2, end2) => {
    return (end2 - start2) / durationHour;
  }, (date2) => {
    return date2.getHours();
  });
  var timeHours = timeHour.range;
  var utcHour = timeInterval((date2) => {
    date2.setUTCMinutes(0, 0, 0);
  }, (date2, step) => {
    date2.setTime(+date2 + step * durationHour);
  }, (start2, end2) => {
    return (end2 - start2) / durationHour;
  }, (date2) => {
    return date2.getUTCHours();
  });
  var utcHours = utcHour.range;

  // node_modules/d3-time/src/day.js
  var timeDay = timeInterval(
    (date2) => date2.setHours(0, 0, 0, 0),
    (date2, step) => date2.setDate(date2.getDate() + step),
    (start2, end2) => (end2 - start2 - (end2.getTimezoneOffset() - start2.getTimezoneOffset()) * durationMinute) / durationDay,
    (date2) => date2.getDate() - 1
  );
  var timeDays = timeDay.range;
  var utcDay = timeInterval((date2) => {
    date2.setUTCHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setUTCDate(date2.getUTCDate() + step);
  }, (start2, end2) => {
    return (end2 - start2) / durationDay;
  }, (date2) => {
    return date2.getUTCDate() - 1;
  });
  var utcDays = utcDay.range;
  var unixDay = timeInterval((date2) => {
    date2.setUTCHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setUTCDate(date2.getUTCDate() + step);
  }, (start2, end2) => {
    return (end2 - start2) / durationDay;
  }, (date2) => {
    return Math.floor(date2 / durationDay);
  });
  var unixDays = unixDay.range;

  // node_modules/d3-time/src/week.js
  function timeWeekday(i) {
    return timeInterval((date2) => {
      date2.setDate(date2.getDate() - (date2.getDay() + 7 - i) % 7);
      date2.setHours(0, 0, 0, 0);
    }, (date2, step) => {
      date2.setDate(date2.getDate() + step * 7);
    }, (start2, end2) => {
      return (end2 - start2 - (end2.getTimezoneOffset() - start2.getTimezoneOffset()) * durationMinute) / durationWeek;
    });
  }
  var timeSunday = timeWeekday(0);
  var timeMonday = timeWeekday(1);
  var timeTuesday = timeWeekday(2);
  var timeWednesday = timeWeekday(3);
  var timeThursday = timeWeekday(4);
  var timeFriday = timeWeekday(5);
  var timeSaturday = timeWeekday(6);
  var timeSundays = timeSunday.range;
  var timeMondays = timeMonday.range;
  var timeTuesdays = timeTuesday.range;
  var timeWednesdays = timeWednesday.range;
  var timeThursdays = timeThursday.range;
  var timeFridays = timeFriday.range;
  var timeSaturdays = timeSaturday.range;
  function utcWeekday(i) {
    return timeInterval((date2) => {
      date2.setUTCDate(date2.getUTCDate() - (date2.getUTCDay() + 7 - i) % 7);
      date2.setUTCHours(0, 0, 0, 0);
    }, (date2, step) => {
      date2.setUTCDate(date2.getUTCDate() + step * 7);
    }, (start2, end2) => {
      return (end2 - start2) / durationWeek;
    });
  }
  var utcSunday = utcWeekday(0);
  var utcMonday = utcWeekday(1);
  var utcTuesday = utcWeekday(2);
  var utcWednesday = utcWeekday(3);
  var utcThursday = utcWeekday(4);
  var utcFriday = utcWeekday(5);
  var utcSaturday = utcWeekday(6);
  var utcSundays = utcSunday.range;
  var utcMondays = utcMonday.range;
  var utcTuesdays = utcTuesday.range;
  var utcWednesdays = utcWednesday.range;
  var utcThursdays = utcThursday.range;
  var utcFridays = utcFriday.range;
  var utcSaturdays = utcSaturday.range;

  // node_modules/d3-time/src/month.js
  var timeMonth = timeInterval((date2) => {
    date2.setDate(1);
    date2.setHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setMonth(date2.getMonth() + step);
  }, (start2, end2) => {
    return end2.getMonth() - start2.getMonth() + (end2.getFullYear() - start2.getFullYear()) * 12;
  }, (date2) => {
    return date2.getMonth();
  });
  var timeMonths = timeMonth.range;
  var utcMonth = timeInterval((date2) => {
    date2.setUTCDate(1);
    date2.setUTCHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setUTCMonth(date2.getUTCMonth() + step);
  }, (start2, end2) => {
    return end2.getUTCMonth() - start2.getUTCMonth() + (end2.getUTCFullYear() - start2.getUTCFullYear()) * 12;
  }, (date2) => {
    return date2.getUTCMonth();
  });
  var utcMonths = utcMonth.range;

  // node_modules/d3-time/src/year.js
  var timeYear = timeInterval((date2) => {
    date2.setMonth(0, 1);
    date2.setHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setFullYear(date2.getFullYear() + step);
  }, (start2, end2) => {
    return end2.getFullYear() - start2.getFullYear();
  }, (date2) => {
    return date2.getFullYear();
  });
  timeYear.every = (k2) => {
    return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => {
      date2.setFullYear(Math.floor(date2.getFullYear() / k2) * k2);
      date2.setMonth(0, 1);
      date2.setHours(0, 0, 0, 0);
    }, (date2, step) => {
      date2.setFullYear(date2.getFullYear() + step * k2);
    });
  };
  var timeYears = timeYear.range;
  var utcYear = timeInterval((date2) => {
    date2.setUTCMonth(0, 1);
    date2.setUTCHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setUTCFullYear(date2.getUTCFullYear() + step);
  }, (start2, end2) => {
    return end2.getUTCFullYear() - start2.getUTCFullYear();
  }, (date2) => {
    return date2.getUTCFullYear();
  });
  utcYear.every = (k2) => {
    return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => {
      date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / k2) * k2);
      date2.setUTCMonth(0, 1);
      date2.setUTCHours(0, 0, 0, 0);
    }, (date2, step) => {
      date2.setUTCFullYear(date2.getUTCFullYear() + step * k2);
    });
  };
  var utcYears = utcYear.range;

  // node_modules/d3-time/src/ticks.js
  function ticker(year, month, week, day, hour, minute) {
    const tickIntervals = [
      [second, 1, durationSecond],
      [second, 5, 5 * durationSecond],
      [second, 15, 15 * durationSecond],
      [second, 30, 30 * durationSecond],
      [minute, 1, durationMinute],
      [minute, 5, 5 * durationMinute],
      [minute, 15, 15 * durationMinute],
      [minute, 30, 30 * durationMinute],
      [hour, 1, durationHour],
      [hour, 3, 3 * durationHour],
      [hour, 6, 6 * durationHour],
      [hour, 12, 12 * durationHour],
      [day, 1, durationDay],
      [day, 2, 2 * durationDay],
      [week, 1, durationWeek],
      [month, 1, durationMonth],
      [month, 3, 3 * durationMonth],
      [year, 1, durationYear]
    ];
    function ticks2(start2, stop, count) {
      const reverse = stop < start2;
      if (reverse) [start2, stop] = [stop, start2];
      const interval2 = count && typeof count.range === "function" ? count : tickInterval(start2, stop, count);
      const ticks3 = interval2 ? interval2.range(start2, +stop + 1) : [];
      return reverse ? ticks3.reverse() : ticks3;
    }
    function tickInterval(start2, stop, count) {
      const target = Math.abs(stop - start2) / count;
      const i = bisector(([, , step2]) => step2).right(tickIntervals, target);
      if (i === tickIntervals.length) return year.every(tickStep(start2 / durationYear, stop / durationYear, count));
      if (i === 0) return millisecond.every(Math.max(tickStep(start2, stop, count), 1));
      const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];
      return t.every(step);
    }
    return [ticks2, tickInterval];
  }
  var [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);
  var [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);

  // node_modules/d3-time-format/src/locale.js
  function localDate(d) {
    if (0 <= d.y && d.y < 100) {
      var date2 = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
      date2.setFullYear(d.y);
      return date2;
    }
    return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);
  }
  function utcDate(d) {
    if (0 <= d.y && d.y < 100) {
      var date2 = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));
      date2.setUTCFullYear(d.y);
      return date2;
    }
    return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));
  }
  function newDate(y2, m, d) {
    return { y: y2, m, d, H: 0, M: 0, S: 0, L: 0 };
  }
  function formatLocale(locale3) {
    var locale_dateTime = locale3.dateTime, locale_date = locale3.date, locale_time = locale3.time, locale_periods = locale3.periods, locale_weekdays = locale3.days, locale_shortWeekdays = locale3.shortDays, locale_months = locale3.months, locale_shortMonths = locale3.shortMonths;
    var periodRe = formatRe(locale_periods), periodLookup = formatLookup(locale_periods), weekdayRe = formatRe(locale_weekdays), weekdayLookup = formatLookup(locale_weekdays), shortWeekdayRe = formatRe(locale_shortWeekdays), shortWeekdayLookup = formatLookup(locale_shortWeekdays), monthRe = formatRe(locale_months), monthLookup = formatLookup(locale_months), shortMonthRe = formatRe(locale_shortMonths), shortMonthLookup = formatLookup(locale_shortMonths);
    var formats = {
      "a": formatShortWeekday,
      "A": formatWeekday,
      "b": formatShortMonth,
      "B": formatMonth,
      "c": null,
      "d": formatDayOfMonth,
      "e": formatDayOfMonth,
      "f": formatMicroseconds,
      "g": formatYearISO,
      "G": formatFullYearISO,
      "H": formatHour24,
      "I": formatHour12,
      "j": formatDayOfYear,
      "L": formatMilliseconds,
      "m": formatMonthNumber,
      "M": formatMinutes,
      "p": formatPeriod,
      "q": formatQuarter,
      "Q": formatUnixTimestamp,
      "s": formatUnixTimestampSeconds,
      "S": formatSeconds,
      "u": formatWeekdayNumberMonday,
      "U": formatWeekNumberSunday,
      "V": formatWeekNumberISO,
      "w": formatWeekdayNumberSunday,
      "W": formatWeekNumberMonday,
      "x": null,
      "X": null,
      "y": formatYear,
      "Y": formatFullYear,
      "Z": formatZone,
      "%": formatLiteralPercent
    };
    var utcFormats = {
      "a": formatUTCShortWeekday,
      "A": formatUTCWeekday,
      "b": formatUTCShortMonth,
      "B": formatUTCMonth,
      "c": null,
      "d": formatUTCDayOfMonth,
      "e": formatUTCDayOfMonth,
      "f": formatUTCMicroseconds,
      "g": formatUTCYearISO,
      "G": formatUTCFullYearISO,
      "H": formatUTCHour24,
      "I": formatUTCHour12,
      "j": formatUTCDayOfYear,
      "L": formatUTCMilliseconds,
      "m": formatUTCMonthNumber,
      "M": formatUTCMinutes,
      "p": formatUTCPeriod,
      "q": formatUTCQuarter,
      "Q": formatUnixTimestamp,
      "s": formatUnixTimestampSeconds,
      "S": formatUTCSeconds,
      "u": formatUTCWeekdayNumberMonday,
      "U": formatUTCWeekNumberSunday,
      "V": formatUTCWeekNumberISO,
      "w": formatUTCWeekdayNumberSunday,
      "W": formatUTCWeekNumberMonday,
      "x": null,
      "X": null,
      "y": formatUTCYear,
      "Y": formatUTCFullYear,
      "Z": formatUTCZone,
      "%": formatLiteralPercent
    };
    var parses = {
      "a": parseShortWeekday,
      "A": parseWeekday,
      "b": parseShortMonth,
      "B": parseMonth,
      "c": parseLocaleDateTime,
      "d": parseDayOfMonth,
      "e": parseDayOfMonth,
      "f": parseMicroseconds,
      "g": parseYear,
      "G": parseFullYear,
      "H": parseHour24,
      "I": parseHour24,
      "j": parseDayOfYear,
      "L": parseMilliseconds,
      "m": parseMonthNumber,
      "M": parseMinutes,
      "p": parsePeriod,
      "q": parseQuarter,
      "Q": parseUnixTimestamp,
      "s": parseUnixTimestampSeconds,
      "S": parseSeconds,
      "u": parseWeekdayNumberMonday,
      "U": parseWeekNumberSunday,
      "V": parseWeekNumberISO,
      "w": parseWeekdayNumberSunday,
      "W": parseWeekNumberMonday,
      "x": parseLocaleDate,
      "X": parseLocaleTime,
      "y": parseYear,
      "Y": parseFullYear,
      "Z": parseZone,
      "%": parseLiteralPercent
    };
    formats.x = newFormat(locale_date, formats);
    formats.X = newFormat(locale_time, formats);
    formats.c = newFormat(locale_dateTime, formats);
    utcFormats.x = newFormat(locale_date, utcFormats);
    utcFormats.X = newFormat(locale_time, utcFormats);
    utcFormats.c = newFormat(locale_dateTime, utcFormats);
    function newFormat(specifier, formats2) {
      return function(date2) {
        var string = [], i = -1, j = 0, n = specifier.length, c2, pad2, format2;
        if (!(date2 instanceof Date)) date2 = /* @__PURE__ */ new Date(+date2);
        while (++i < n) {
          if (specifier.charCodeAt(i) === 37) {
            string.push(specifier.slice(j, i));
            if ((pad2 = pads[c2 = specifier.charAt(++i)]) != null) c2 = specifier.charAt(++i);
            else pad2 = c2 === "e" ? " " : "0";
            if (format2 = formats2[c2]) c2 = format2(date2, pad2);
            string.push(c2);
            j = i + 1;
          }
        }
        string.push(specifier.slice(j, i));
        return string.join("");
      };
    }
    function newParse(specifier, Z) {
      return function(string) {
        var d = newDate(1900, void 0, 1), i = parseSpecifier(d, specifier, string += "", 0), week, day;
        if (i != string.length) return null;
        if ("Q" in d) return new Date(d.Q);
        if ("s" in d) return new Date(d.s * 1e3 + ("L" in d ? d.L : 0));
        if (Z && !("Z" in d)) d.Z = 0;
        if ("p" in d) d.H = d.H % 12 + d.p * 12;
        if (d.m === void 0) d.m = "q" in d ? d.q : 0;
        if ("V" in d) {
          if (d.V < 1 || d.V > 53) return null;
          if (!("w" in d)) d.w = 1;
          if ("Z" in d) {
            week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();
            week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);
            week = utcDay.offset(week, (d.V - 1) * 7);
            d.y = week.getUTCFullYear();
            d.m = week.getUTCMonth();
            d.d = week.getUTCDate() + (d.w + 6) % 7;
          } else {
            week = localDate(newDate(d.y, 0, 1)), day = week.getDay();
            week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);
            week = timeDay.offset(week, (d.V - 1) * 7);
            d.y = week.getFullYear();
            d.m = week.getMonth();
            d.d = week.getDate() + (d.w + 6) % 7;
          }
        } else if ("W" in d || "U" in d) {
          if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
          day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();
          d.m = 0;
          d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;
        }
        if ("Z" in d) {
          d.H += d.Z / 100 | 0;
          d.M += d.Z % 100;
          return utcDate(d);
        }
        return localDate(d);
      };
    }
    function parseSpecifier(d, specifier, string, j) {
      var i = 0, n = specifier.length, m = string.length, c2, parse;
      while (i < n) {
        if (j >= m) return -1;
        c2 = specifier.charCodeAt(i++);
        if (c2 === 37) {
          c2 = specifier.charAt(i++);
          parse = parses[c2 in pads ? specifier.charAt(i++) : c2];
          if (!parse || (j = parse(d, string, j)) < 0) return -1;
        } else if (c2 != string.charCodeAt(j++)) {
          return -1;
        }
      }
      return j;
    }
    function parsePeriod(d, string, i) {
      var n = periodRe.exec(string.slice(i));
      return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
    }
    function parseShortWeekday(d, string, i) {
      var n = shortWeekdayRe.exec(string.slice(i));
      return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
    }
    function parseWeekday(d, string, i) {
      var n = weekdayRe.exec(string.slice(i));
      return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
    }
    function parseShortMonth(d, string, i) {
      var n = shortMonthRe.exec(string.slice(i));
      return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
    }
    function parseMonth(d, string, i) {
      var n = monthRe.exec(string.slice(i));
      return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
    }
    function parseLocaleDateTime(d, string, i) {
      return parseSpecifier(d, locale_dateTime, string, i);
    }
    function parseLocaleDate(d, string, i) {
      return parseSpecifier(d, locale_date, string, i);
    }
    function parseLocaleTime(d, string, i) {
      return parseSpecifier(d, locale_time, string, i);
    }
    function formatShortWeekday(d) {
      return locale_shortWeekdays[d.getDay()];
    }
    function formatWeekday(d) {
      return locale_weekdays[d.getDay()];
    }
    function formatShortMonth(d) {
      return locale_shortMonths[d.getMonth()];
    }
    function formatMonth(d) {
      return locale_months[d.getMonth()];
    }
    function formatPeriod(d) {
      return locale_periods[+(d.getHours() >= 12)];
    }
    function formatQuarter(d) {
      return 1 + ~~(d.getMonth() / 3);
    }
    function formatUTCShortWeekday(d) {
      return locale_shortWeekdays[d.getUTCDay()];
    }
    function formatUTCWeekday(d) {
      return locale_weekdays[d.getUTCDay()];
    }
    function formatUTCShortMonth(d) {
      return locale_shortMonths[d.getUTCMonth()];
    }
    function formatUTCMonth(d) {
      return locale_months[d.getUTCMonth()];
    }
    function formatUTCPeriod(d) {
      return locale_periods[+(d.getUTCHours() >= 12)];
    }
    function formatUTCQuarter(d) {
      return 1 + ~~(d.getUTCMonth() / 3);
    }
    return {
      format: function(specifier) {
        var f = newFormat(specifier += "", formats);
        f.toString = function() {
          return specifier;
        };
        return f;
      },
      parse: function(specifier) {
        var p = newParse(specifier += "", false);
        p.toString = function() {
          return specifier;
        };
        return p;
      },
      utcFormat: function(specifier) {
        var f = newFormat(specifier += "", utcFormats);
        f.toString = function() {
          return specifier;
        };
        return f;
      },
      utcParse: function(specifier) {
        var p = newParse(specifier += "", true);
        p.toString = function() {
          return specifier;
        };
        return p;
      }
    };
  }
  var pads = { "-": "", "_": " ", "0": "0" };
  var numberRe = /^\s*\d+/;
  var percentRe = /^%/;
  var requoteRe = /[\\^$*+?|[\]().{}]/g;
  function pad(value, fill, width) {
    var sign2 = value < 0 ? "-" : "", string = (sign2 ? -value : value) + "", length = string.length;
    return sign2 + (length < width ? new Array(width - length + 1).join(fill) + string : string);
  }
  function requote(s2) {
    return s2.replace(requoteRe, "\\$&");
  }
  function formatRe(names) {
    return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
  }
  function formatLookup(names) {
    return new Map(names.map((name2, i) => [name2.toLowerCase(), i]));
  }
  function parseWeekdayNumberSunday(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 1));
    return n ? (d.w = +n[0], i + n[0].length) : -1;
  }
  function parseWeekdayNumberMonday(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 1));
    return n ? (d.u = +n[0], i + n[0].length) : -1;
  }
  function parseWeekNumberSunday(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.U = +n[0], i + n[0].length) : -1;
  }
  function parseWeekNumberISO(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.V = +n[0], i + n[0].length) : -1;
  }
  function parseWeekNumberMonday(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.W = +n[0], i + n[0].length) : -1;
  }
  function parseFullYear(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 4));
    return n ? (d.y = +n[0], i + n[0].length) : -1;
  }
  function parseYear(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2e3), i + n[0].length) : -1;
  }
  function parseZone(d, string, i) {
    var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6));
    return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;
  }
  function parseQuarter(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 1));
    return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;
  }
  function parseMonthNumber(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.m = n[0] - 1, i + n[0].length) : -1;
  }
  function parseDayOfMonth(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.d = +n[0], i + n[0].length) : -1;
  }
  function parseDayOfYear(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 3));
    return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;
  }
  function parseHour24(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.H = +n[0], i + n[0].length) : -1;
  }
  function parseMinutes(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.M = +n[0], i + n[0].length) : -1;
  }
  function parseSeconds(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 2));
    return n ? (d.S = +n[0], i + n[0].length) : -1;
  }
  function parseMilliseconds(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 3));
    return n ? (d.L = +n[0], i + n[0].length) : -1;
  }
  function parseMicroseconds(d, string, i) {
    var n = numberRe.exec(string.slice(i, i + 6));
    return n ? (d.L = Math.floor(n[0] / 1e3), i + n[0].length) : -1;
  }
  function parseLiteralPercent(d, string, i) {
    var n = percentRe.exec(string.slice(i, i + 1));
    return n ? i + n[0].length : -1;
  }
  function parseUnixTimestamp(d, string, i) {
    var n = numberRe.exec(string.slice(i));
    return n ? (d.Q = +n[0], i + n[0].length) : -1;
  }
  function parseUnixTimestampSeconds(d, string, i) {
    var n = numberRe.exec(string.slice(i));
    return n ? (d.s = +n[0], i + n[0].length) : -1;
  }
  function formatDayOfMonth(d, p) {
    return pad(d.getDate(), p, 2);
  }
  function formatHour24(d, p) {
    return pad(d.getHours(), p, 2);
  }
  function formatHour12(d, p) {
    return pad(d.getHours() % 12 || 12, p, 2);
  }
  function formatDayOfYear(d, p) {
    return pad(1 + timeDay.count(timeYear(d), d), p, 3);
  }
  function formatMilliseconds(d, p) {
    return pad(d.getMilliseconds(), p, 3);
  }
  function formatMicroseconds(d, p) {
    return formatMilliseconds(d, p) + "000";
  }
  function formatMonthNumber(d, p) {
    return pad(d.getMonth() + 1, p, 2);
  }
  function formatMinutes(d, p) {
    return pad(d.getMinutes(), p, 2);
  }
  function formatSeconds(d, p) {
    return pad(d.getSeconds(), p, 2);
  }
  function formatWeekdayNumberMonday(d) {
    var day = d.getDay();
    return day === 0 ? 7 : day;
  }
  function formatWeekNumberSunday(d, p) {
    return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);
  }
  function dISO(d) {
    var day = d.getDay();
    return day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d);
  }
  function formatWeekNumberISO(d, p) {
    d = dISO(d);
    return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);
  }
  function formatWeekdayNumberSunday(d) {
    return d.getDay();
  }
  function formatWeekNumberMonday(d, p) {
    return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);
  }
  function formatYear(d, p) {
    return pad(d.getFullYear() % 100, p, 2);
  }
  function formatYearISO(d, p) {
    d = dISO(d);
    return pad(d.getFullYear() % 100, p, 2);
  }
  function formatFullYear(d, p) {
    return pad(d.getFullYear() % 1e4, p, 4);
  }
  function formatFullYearISO(d, p) {
    var day = d.getDay();
    d = day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d);
    return pad(d.getFullYear() % 1e4, p, 4);
  }
  function formatZone(d) {
    var z = d.getTimezoneOffset();
    return (z > 0 ? "-" : (z *= -1, "+")) + pad(z / 60 | 0, "0", 2) + pad(z % 60, "0", 2);
  }
  function formatUTCDayOfMonth(d, p) {
    return pad(d.getUTCDate(), p, 2);
  }
  function formatUTCHour24(d, p) {
    return pad(d.getUTCHours(), p, 2);
  }
  function formatUTCHour12(d, p) {
    return pad(d.getUTCHours() % 12 || 12, p, 2);
  }
  function formatUTCDayOfYear(d, p) {
    return pad(1 + utcDay.count(utcYear(d), d), p, 3);
  }
  function formatUTCMilliseconds(d, p) {
    return pad(d.getUTCMilliseconds(), p, 3);
  }
  function formatUTCMicroseconds(d, p) {
    return formatUTCMilliseconds(d, p) + "000";
  }
  function formatUTCMonthNumber(d, p) {
    return pad(d.getUTCMonth() + 1, p, 2);
  }
  function formatUTCMinutes(d, p) {
    return pad(d.getUTCMinutes(), p, 2);
  }
  function formatUTCSeconds(d, p) {
    return pad(d.getUTCSeconds(), p, 2);
  }
  function formatUTCWeekdayNumberMonday(d) {
    var dow = d.getUTCDay();
    return dow === 0 ? 7 : dow;
  }
  function formatUTCWeekNumberSunday(d, p) {
    return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);
  }
  function UTCdISO(d) {
    var day = d.getUTCDay();
    return day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d);
  }
  function formatUTCWeekNumberISO(d, p) {
    d = UTCdISO(d);
    return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);
  }
  function formatUTCWeekdayNumberSunday(d) {
    return d.getUTCDay();
  }
  function formatUTCWeekNumberMonday(d, p) {
    return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);
  }
  function formatUTCYear(d, p) {
    return pad(d.getUTCFullYear() % 100, p, 2);
  }
  function formatUTCYearISO(d, p) {
    d = UTCdISO(d);
    return pad(d.getUTCFullYear() % 100, p, 2);
  }
  function formatUTCFullYear(d, p) {
    return pad(d.getUTCFullYear() % 1e4, p, 4);
  }
  function formatUTCFullYearISO(d, p) {
    var day = d.getUTCDay();
    d = day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d);
    return pad(d.getUTCFullYear() % 1e4, p, 4);
  }
  function formatUTCZone() {
    return "+0000";
  }
  function formatLiteralPercent() {
    return "%";
  }
  function formatUnixTimestamp(d) {
    return +d;
  }
  function formatUnixTimestampSeconds(d) {
    return Math.floor(+d / 1e3);
  }

  // node_modules/d3-time-format/src/defaultLocale.js
  var locale2;
  var timeFormat;
  var timeParse;
  var utcFormat;
  var utcParse;
  defaultLocale2({
    dateTime: "%x, %X",
    date: "%-m/%-d/%Y",
    time: "%-I:%M:%S %p",
    periods: ["AM", "PM"],
    days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
    shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
    months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
    shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
  });
  function defaultLocale2(definition) {
    locale2 = formatLocale(definition);
    timeFormat = locale2.format;
    timeParse = locale2.parse;
    utcFormat = locale2.utcFormat;
    utcParse = locale2.utcParse;
    return locale2;
  }

  // node_modules/d3-scale/src/time.js
  function date(t) {
    return new Date(t);
  }
  function number3(t) {
    return t instanceof Date ? +t : +/* @__PURE__ */ new Date(+t);
  }
  function calendar(ticks2, tickInterval, year, month, week, day, hour, minute, second2, format2) {
    var scale = continuous(), invert2 = scale.invert, domain = scale.domain;
    var formatMillisecond = format2(".%L"), formatSecond = format2(":%S"), formatMinute = format2("%I:%M"), formatHour = format2("%I %p"), formatDay = format2("%a %d"), formatWeek = format2("%b %d"), formatMonth = format2("%B"), formatYear2 = format2("%Y");
    function tickFormat2(date2) {
      return (second2(date2) < date2 ? formatMillisecond : minute(date2) < date2 ? formatSecond : hour(date2) < date2 ? formatMinute : day(date2) < date2 ? formatHour : month(date2) < date2 ? week(date2) < date2 ? formatDay : formatWeek : year(date2) < date2 ? formatMonth : formatYear2)(date2);
    }
    scale.invert = function(y2) {
      return new Date(invert2(y2));
    };
    scale.domain = function(_113) {
      return arguments.length ? domain(Array.from(_113, number3)) : domain().map(date);
    };
    scale.ticks = function(interval2) {
      var d = domain();
      return ticks2(d[0], d[d.length - 1], interval2 == null ? 10 : interval2);
    };
    scale.tickFormat = function(count, specifier) {
      return specifier == null ? tickFormat2 : format2(specifier);
    };
    scale.nice = function(interval2) {
      var d = domain();
      if (!interval2 || typeof interval2.range !== "function") interval2 = tickInterval(d[0], d[d.length - 1], interval2 == null ? 10 : interval2);
      return interval2 ? domain(nice(d, interval2)) : scale;
    };
    scale.copy = function() {
      return copy(scale, calendar(ticks2, tickInterval, year, month, week, day, hour, minute, second2, format2));
    };
    return scale;
  }
  function time() {
    return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute, second, timeFormat).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments);
  }

  // node_modules/d3-scale/src/utcTime.js
  function utcTime() {
    return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, utcFormat).domain([Date.UTC(2e3, 0, 1), Date.UTC(2e3, 0, 2)]), arguments);
  }

  // node_modules/d3-scale/src/sequential.js
  function transformer2() {
    var x0 = 0, x1 = 1, t02, t12, k10, transform, interpolator = identity2, clamp = false, unknown;
    function scale(x2) {
      return x2 == null || isNaN(x2 = +x2) ? unknown : interpolator(k10 === 0 ? 0.5 : (x2 = (transform(x2) - t02) * k10, clamp ? Math.max(0, Math.min(1, x2)) : x2));
    }
    scale.domain = function(_113) {
      return arguments.length ? ([x0, x1] = _113, t02 = transform(x0 = +x0), t12 = transform(x1 = +x1), k10 = t02 === t12 ? 0 : 1 / (t12 - t02), scale) : [x0, x1];
    };
    scale.clamp = function(_113) {
      return arguments.length ? (clamp = !!_113, scale) : clamp;
    };
    scale.interpolator = function(_113) {
      return arguments.length ? (interpolator = _113, scale) : interpolator;
    };
    function range4(interpolate) {
      return function(_113) {
        var r0, r1;
        return arguments.length ? ([r0, r1] = _113, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];
      };
    }
    scale.range = range4(value_default);
    scale.rangeRound = range4(round_default);
    scale.unknown = function(_113) {
      return arguments.length ? (unknown = _113, scale) : unknown;
    };
    return function(t) {
      transform = t, t02 = t(x0), t12 = t(x1), k10 = t02 === t12 ? 0 : 1 / (t12 - t02);
      return scale;
    };
  }
  function copy2(source, target) {
    return target.domain(source.domain()).interpolator(source.interpolator()).clamp(source.clamp()).unknown(source.unknown());
  }
  function sequential() {
    var scale = linearish(transformer2()(identity2));
    scale.copy = function() {
      return copy2(scale, sequential());
    };
    return initInterpolator.apply(scale, arguments);
  }
  function sequentialLog() {
    var scale = loggish(transformer2()).domain([1, 10]);
    scale.copy = function() {
      return copy2(scale, sequentialLog()).base(scale.base());
    };
    return initInterpolator.apply(scale, arguments);
  }
  function sequentialSymlog() {
    var scale = symlogish(transformer2());
    scale.copy = function() {
      return copy2(scale, sequentialSymlog()).constant(scale.constant());
    };
    return initInterpolator.apply(scale, arguments);
  }
  function sequentialPow() {
    var scale = powish(transformer2());
    scale.copy = function() {
      return copy2(scale, sequentialPow()).exponent(scale.exponent());
    };
    return initInterpolator.apply(scale, arguments);
  }
  function sequentialSqrt() {
    return sequentialPow.apply(null, arguments).exponent(0.5);
  }

  // node_modules/d3-scale/src/sequentialQuantile.js
  function sequentialQuantile() {
    var domain = [], interpolator = identity2;
    function scale(x2) {
      if (x2 != null && !isNaN(x2 = +x2)) return interpolator((bisect_default(domain, x2, 1) - 1) / (domain.length - 1));
    }
    scale.domain = function(_113) {
      if (!arguments.length) return domain.slice();
      domain = [];
      for (let d of _113) if (d != null && !isNaN(d = +d)) domain.push(d);
      domain.sort(ascending);
      return scale;
    };
    scale.interpolator = function(_113) {
      return arguments.length ? (interpolator = _113, scale) : interpolator;
    };
    scale.range = function() {
      return domain.map((d, i) => interpolator(i / (domain.length - 1)));
    };
    scale.quantiles = function(n) {
      return Array.from({ length: n + 1 }, (_113, i) => quantile(domain, i / n));
    };
    scale.copy = function() {
      return sequentialQuantile(interpolator).domain(domain);
    };
    return initInterpolator.apply(scale, arguments);
  }

  // node_modules/d3-scale/src/diverging.js
  function transformer3() {
    var x0 = 0, x1 = 0.5, x2 = 1, s2 = 1, t02, t12, t2, k10, k21, interpolator = identity2, transform, clamp = false, unknown;
    function scale(x3) {
      return isNaN(x3 = +x3) ? unknown : (x3 = 0.5 + ((x3 = +transform(x3)) - t12) * (s2 * x3 < s2 * t12 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x3)) : x3));
    }
    scale.domain = function(_113) {
      return arguments.length ? ([x0, x1, x2] = _113, t02 = transform(x0 = +x0), t12 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t02 === t12 ? 0 : 0.5 / (t12 - t02), k21 = t12 === t2 ? 0 : 0.5 / (t2 - t12), s2 = t12 < t02 ? -1 : 1, scale) : [x0, x1, x2];
    };
    scale.clamp = function(_113) {
      return arguments.length ? (clamp = !!_113, scale) : clamp;
    };
    scale.interpolator = function(_113) {
      return arguments.length ? (interpolator = _113, scale) : interpolator;
    };
    function range4(interpolate) {
      return function(_113) {
        var r0, r1, r2;
        return arguments.length ? ([r0, r1, r2] = _113, interpolator = piecewise(interpolate, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];
      };
    }
    scale.range = range4(value_default);
    scale.rangeRound = range4(round_default);
    scale.unknown = function(_113) {
      return arguments.length ? (unknown = _113, scale) : unknown;
    };
    return function(t) {
      transform = t, t02 = t(x0), t12 = t(x1), t2 = t(x2), k10 = t02 === t12 ? 0 : 0.5 / (t12 - t02), k21 = t12 === t2 ? 0 : 0.5 / (t2 - t12), s2 = t12 < t02 ? -1 : 1;
      return scale;
    };
  }
  function diverging() {
    var scale = linearish(transformer3()(identity2));
    scale.copy = function() {
      return copy2(scale, diverging());
    };
    return initInterpolator.apply(scale, arguments);
  }
  function divergingLog() {
    var scale = loggish(transformer3()).domain([0.1, 1, 10]);
    scale.copy = function() {
      return copy2(scale, divergingLog()).base(scale.base());
    };
    return initInterpolator.apply(scale, arguments);
  }
  function divergingSymlog() {
    var scale = symlogish(transformer3());
    scale.copy = function() {
      return copy2(scale, divergingSymlog()).constant(scale.constant());
    };
    return initInterpolator.apply(scale, arguments);
  }
  function divergingPow() {
    var scale = powish(transformer3());
    scale.copy = function() {
      return copy2(scale, divergingPow()).exponent(scale.exponent());
    };
    return initInterpolator.apply(scale, arguments);
  }
  function divergingSqrt() {
    return divergingPow.apply(null, arguments).exponent(0.5);
  }

  // node_modules/victory-core/es/victory-util/scale.js
  var supportedScaleStrings = ["linear", "time", "log", "sqrt"];
  function toNewName(scale) {
    const capitalize3 = (s2) => s2 && s2[0].toUpperCase() + s2.slice(1);
    return `scale${capitalize3(scale)}`;
  }
  function validScale(scale) {
    if (typeof scale === "function") {
      return isFunction(scale.copy) && isFunction(scale.domain) && isFunction(scale.range);
    } else if (typeof scale === "string") {
      return supportedScaleStrings.includes(scale);
    }
    return false;
  }
  function isScaleDefined(props, axis) {
    if (!props.scale) {
      return false;
    } else if (props.scale.x || props.scale.y) {
      return !!props.scale[axis];
    }
    return true;
  }
  function getScaleTypeFromProps(props, axis) {
    if (!isScaleDefined(props, axis)) {
      return void 0;
    }
    const scale = props.scale[axis] || props.scale;
    return typeof scale === "string" ? scale : getType(scale);
  }
  function getScaleFromDomain(props, axis) {
    let domain;
    if (props.domain && props.domain[axis]) {
      domain = props.domain[axis];
    } else if (props.domain && Array.isArray(props.domain)) {
      domain = props.domain;
    }
    if (!domain) {
      return void 0;
    }
    return containsDates(domain) ? "time" : "linear";
  }
  function getScaleTypeFromData(props, axis) {
    if (!props.data) {
      return "linear";
    }
    const accessor = createAccessor(props[axis]);
    const axisData = props.data.map((datum) => {
      const processedData = (0, import_isPlainObject2.default)(accessor(datum)) ? accessor(datum)[axis] : accessor(datum);
      return processedData !== void 0 ? processedData : datum[axis];
    });
    return containsDates(axisData) ? "time" : "linear";
  }
  function getScaleFromName(name2) {
    if (validScale(name2)) {
      const methodName = toNewName(name2);
      return d3_scale_exports[methodName]();
    }
    return linear3();
  }
  function getBaseScale(props, axis) {
    const scale = getScaleFromProps(props, axis);
    if (scale) {
      return typeof scale === "string" ? getScaleFromName(scale) : scale;
    }
    const defaultScale = getScaleFromDomain(props, axis) || getScaleTypeFromData(props, axis);
    return getScaleFromName(defaultScale);
  }
  function getDefaultScale() {
    return linear3();
  }
  function getScaleFromProps(props, axis) {
    if (!isScaleDefined(props, axis)) {
      return void 0;
    }
    const scale = props.scale[axis] || props.scale;
    if (validScale(scale)) {
      return isFunction(scale) ? scale : getScaleFromName(scale);
    }
    return void 0;
  }
  function getScaleType(props, axis) {
    return getScaleTypeFromProps(props, axis) || getScaleTypeFromData(props, axis);
  }
  var DUCK_TYPES = [
    {
      name: "quantile",
      method: "quantiles"
    },
    {
      name: "log",
      method: "base"
    }
    // TODO(2214): Re-evaluate (1) duck typing approach, and (2) if duck typing,
    //   do we need a different approach? (Multiple keys? Stringifying functions?)
    // https://github.com/FormidableLabs/victory/issues/2214
    // Below are matches that don't seem to otherwise occur in Victory code base.
    // { name: "ordinal", method: "unknown" },
    // { name: "pow-sqrt", method: "exponent" },
    // { name: "quantize-threshold", method: "invertExtent" }
  ];
  function getType(scale) {
    if (typeof scale === "string") {
      return scale;
    }
    const scaleType = DUCK_TYPES.filter((type) => {
      return scale[type.method] !== void 0;
    })[0];
    return scaleType ? scaleType.name : void 0;
  }

  // node_modules/victory-core/es/victory-util/immutable.js
  var IMMUTABLE_ITERABLE = "@@__IMMUTABLE_ITERABLE__@@";
  var IMMUTABLE_RECORD = "@@__IMMUTABLE_RECORD__@@";
  var IMMUTABLE_LIST = "@@__IMMUTABLE_LIST__@@";
  function isIterable(x2) {
    return !!(x2 && x2[IMMUTABLE_ITERABLE]);
  }
  function isRecord(x2) {
    return !!(x2 && x2[IMMUTABLE_RECORD]);
  }
  function isImmutable(x2) {
    return isIterable(x2) || isRecord(x2);
  }
  function isList(x2) {
    return !!(x2 && x2[IMMUTABLE_LIST]);
  }
  function shallowToJS(x2, whitelist) {
    return isIterable(x2) ? x2.reduce((result, curr, key) => {
      let newCurr = curr;
      if (whitelist && whitelist[key]) {
        newCurr = shallowToJS(curr);
      }
      result[key] = newCurr;
      return result;
    }, isList(x2) ? [] : {}) : x2;
  }

  // node_modules/victory-core/es/victory-util/data.js
  function parseDatum(datum) {
    const immutableDatumWhitelist = {
      errorX: true,
      errorY: true
    };
    return isImmutable(datum) ? shallowToJS(datum, immutableDatumWhitelist) : datum;
  }
  function getLength(data) {
    return isIterable(data) ? data.size : data.length;
  }
  function generateDataArray(props, axis) {
    const propsDomain = (0, import_isPlainObject3.default)(props.domain) ? props.domain[axis] : props.domain;
    const domain = propsDomain || getBaseScale(props, axis).domain();
    const samples = props.samples || 1;
    const domainMax = Math.max(...domain);
    const domainMin = Math.min(...domain);
    const step = (domainMax - domainMin) / samples;
    const values = range(domainMin, domainMax, step);
    return values[values.length - 1] === domainMax ? values : values.concat(domainMax);
  }
  function sortData(dataset, sortKey, sortOrder) {
    if (sortOrder === void 0) {
      sortOrder = "ascending";
    }
    if (!sortKey) {
      return dataset;
    }
    let formattedSortKey = sortKey;
    if (sortKey === "x" || sortKey === "y") {
      formattedSortKey = `_${sortKey}`;
    }
    const order2 = sortOrder === "ascending" ? "asc" : "desc";
    return (0, import_orderBy2.default)(dataset, formattedSortKey, order2);
  }
  function cleanData(dataset, props) {
    const smallNumber = 1 / Number.MAX_SAFE_INTEGER;
    const scaleType = {
      x: getScaleType(props, "x"),
      y: getScaleType(props, "y")
    };
    if (scaleType.x !== "log" && scaleType.y !== "log") {
      return dataset;
    }
    const rules = (datum, axis) => {
      return scaleType[axis] === "log" ? datum[`_${axis}`] !== 0 : true;
    };
    const sanitize = (datum) => {
      const _x = rules(datum, "x") ? datum._x : smallNumber;
      const _y = rules(datum, "y") ? datum._y : smallNumber;
      const _y0 = rules(datum, "y0") ? datum._y0 : smallNumber;
      return Object.assign({}, datum, {
        _x,
        _y,
        _y0
      });
    };
    return dataset.map((datum) => {
      if (rules(datum, "x") && rules(datum, "y") && rules(datum, "y0")) {
        return datum;
      }
      return sanitize(datum);
    });
  }
  function getEventKey(key) {
    if (isFunction(key)) {
      return key;
    } else if (key === null || key === void 0) {
      return () => void 0;
    }
    return (0, import_property2.default)(key);
  }
  function addEventKeys(props, data) {
    const hasEventKeyAccessor = !!props.eventKey;
    const eventKeyAccessor = getEventKey(props.eventKey);
    return data.map((datum, index) => {
      if (datum.eventKey !== void 0) {
        return datum;
      } else if (hasEventKeyAccessor) {
        const eventKey = eventKeyAccessor(datum, index);
        return eventKey !== void 0 ? Object.assign({
          eventKey
        }, datum) : datum;
      }
      return datum;
    });
  }
  function formatDataFromDomain(dataset, domain, defaultBaseline) {
    const exists2 = (val) => val !== void 0;
    const minDomainX = getMinValue(domain.x);
    const maxDomainX = getMaxValue(domain.x);
    const minDomainY = getMinValue(domain.y);
    const maxDomainY = getMaxValue(domain.y);
    const underMin = (min3) => (val) => exists2(val) && val < min3;
    const overMax = (max3) => (val) => exists2(val) && val > max3;
    const isUnderMinX = underMin(minDomainX);
    const isUnderMinY = underMin(minDomainY);
    const isOverMaxX = overMax(maxDomainX);
    const isOverMaxY = overMax(maxDomainY);
    return dataset.map((datum) => {
      let {
        _x,
        _y,
        _y0,
        _y1
      } = datum;
      if (isUnderMinX(_x) || isOverMaxX(_x)) _x = null;
      const baseline = exists2(_y0) ? _y0 : defaultBaseline;
      const value = exists2(_y1) ? _y1 : _y;
      if (!exists2(value)) return datum;
      if (!exists2(baseline) && (isUnderMinY(value) || isOverMaxY(value))) _y = null;
      if (isUnderMinY(baseline) && isUnderMinY(value) || isOverMaxY(baseline) && isOverMaxY(value)) _y = _y0 = _y1 = null;
      if (isUnderMinY(baseline) && !isUnderMinY(value)) _y0 = minDomainY;
      if (isOverMaxY(baseline) && !isOverMaxY(value)) _y0 = maxDomainY;
      return Object.assign({}, datum, (0, import_omitBy2.default)({
        _x,
        _y,
        _y0,
        _y1
      }, import_isUndefined.default));
    });
  }
  function createStringMap(props, axis) {
    const stringsFromAxes = getStringsFromAxes(props, axis);
    const stringsFromCategories = getStringsFromCategories(props, axis);
    const stringsFromData = getStringsFromData(props, axis);
    const allStrings = (0, import_uniq2.default)([...stringsFromAxes, ...stringsFromCategories, ...stringsFromData]);
    return allStrings.length === 0 ? null : allStrings.reduce((memo4, string, index) => {
      memo4[string] = index + 1;
      return memo4;
    }, {});
  }
  function downsample(data, maxPoints, startingIndex) {
    if (startingIndex === void 0) {
      startingIndex = 0;
    }
    const dataLength = getLength(data);
    if (dataLength > maxPoints) {
      const k2 = Math.pow(2, Math.ceil(Math.log2(dataLength / maxPoints)));
      return data.filter(
        // ensure modulo is always calculated from same reference: i + startingIndex
        (d, i) => (i + startingIndex) % k2 === 0
      );
    }
    return data;
  }
  function formatData(dataset, props, expectedKeys) {
    const isArrayOrIterable = Array.isArray(dataset) || isIterable(dataset);
    if (!isArrayOrIterable || getLength(dataset) < 1) {
      return [];
    }
    const defaultKeys = ["x", "y", "y0"];
    expectedKeys = Array.isArray(expectedKeys) ? expectedKeys : defaultKeys;
    const createAccessor2 = (name2) => {
      return createAccessor(props[name2] !== void 0 ? props[name2] : name2);
    };
    const accessor = expectedKeys.reduce((memo4, type) => {
      memo4[type] = createAccessor2(type);
      return memo4;
    }, {});
    const preformattedData = (0, import_isEqual.default)(expectedKeys, defaultKeys) && props.x === "_x" && props.y === "_y" && props.y0 === "_y0";
    let stringMap;
    if (preformattedData === false) {
      stringMap = {
        x: expectedKeys.indexOf("x") !== -1 ? createStringMap(props, "x") : void 0,
        y: expectedKeys.indexOf("y") !== -1 ? createStringMap(props, "y") : void 0,
        y0: expectedKeys.indexOf("y0") !== -1 ? createStringMap(props, "y") : void 0
      };
    }
    const data = preformattedData ? dataset : dataset.reduce((dataArr, datum, index) => {
      const parsedDatum = parseDatum(datum);
      const fallbackValues = {
        x: index,
        y: parsedDatum
      };
      const processedValues = expectedKeys.reduce((memo4, type) => {
        const processedValue = accessor[type](parsedDatum);
        const value = processedValue !== void 0 ? processedValue : fallbackValues[type];
        if (value !== void 0) {
          if (typeof value === "string" && stringMap[type]) {
            memo4[`${type}Name`] = value;
            memo4[`_${type}`] = stringMap[type][value];
          } else {
            memo4[`_${type}`] = value;
          }
        }
        return memo4;
      }, {});
      const formattedDatum = Object.assign({}, processedValues, parsedDatum);
      if (!(0, import_isEmpty3.default)(formattedDatum)) {
        dataArr.push(formattedDatum);
      }
      return dataArr;
    }, []);
    const sortedData = sortData(data, props.sortKey, props.sortOrder);
    const cleanedData = cleanData(sortedData, props);
    return addEventKeys(props, cleanedData);
  }
  function generateData(props) {
    const xValues = generateDataArray(props, "x");
    const yValues = generateDataArray(props, "y");
    const values = xValues.map((x2, i) => {
      return {
        x: x2,
        y: yValues[i]
      };
    });
    return values;
  }
  function getCategories(props, axis) {
    return props.categories && !Array.isArray(props.categories) ? props.categories[axis] : props.categories;
  }
  function getData(props) {
    return props.data ? formatData(props.data, props) : formatData(generateData(props), props);
  }
  function getStringsFromAxes(props, axis) {
    const {
      tickValues,
      tickFormat: tickFormat2
    } = props;
    let tickValueArray;
    if (!tickValues || !Array.isArray(tickValues) && !tickValues[axis]) {
      tickValueArray = tickFormat2 && Array.isArray(tickFormat2) ? tickFormat2 : [];
    } else {
      tickValueArray = tickValues[axis] || tickValues;
    }
    return tickValueArray.filter((val) => typeof val === "string");
  }
  function getStringsFromCategories(props, axis) {
    if (!props.categories) {
      return [];
    }
    const categories = getCategories(props, axis);
    const categoryStrings = categories && categories.filter((val) => typeof val === "string");
    return categoryStrings ? removeUndefined(categoryStrings) : [];
  }
  function getStringsFromData(props, axis) {
    const isArrayOrIterable = Array.isArray(props.data) || isIterable(props.data);
    if (!isArrayOrIterable) {
      return [];
    }
    const key = props[axis] === void 0 ? axis : props[axis];
    const accessor = createAccessor(key);
    const data = props.data.reduce((memo4, d) => {
      memo4.push(parseDatum(d));
      return memo4;
    }, []);
    const sortedData = sortData(data, props.sortKey, props.sortOrder);
    const dataStrings = sortedData.reduce((dataArr, datum) => {
      const parsedDatum = parseDatum(datum);
      dataArr.push(accessor(parsedDatum));
      return dataArr;
    }, []).filter((datum) => typeof datum === "string");
    return dataStrings.reduce((prev, curr) => {
      if (curr !== void 0 && curr !== null && prev.indexOf(curr) === -1) {
        prev.push(curr);
      }
      return prev;
    }, []);
  }
  function isDataComponent(component) {
    const getRole = (child) => {
      return child && child.type ? child.type.role : "";
    };
    let role = getRole(component);
    if (role === "portal") {
      const children = import_react65.default.Children.toArray(component.props.children);
      role = children.length ? getRole(children[0]) : "";
    }
    const whitelist = ["area", "bar", "boxplot", "candlestick", "errorbar", "group", "histogram", "line", "pie", "scatter", "stack", "voronoi"];
    return whitelist.includes(role);
  }

  // node_modules/victory-core/es/victory-util/domain.js
  function cleanDomain(domain, props, axis) {
    const scaleType = getScaleType(props, axis);
    if (scaleType !== "log") {
      return domain;
    }
    const rules = (dom) => {
      const almostZero = dom[0] < 0 || dom[1] < 0 ? -1 / Number.MAX_SAFE_INTEGER : 1 / Number.MAX_SAFE_INTEGER;
      const domainOne = dom[0] === 0 ? almostZero : dom[0];
      const domainTwo = dom[1] === 0 ? almostZero : dom[1];
      return [domainOne, domainTwo];
    };
    return rules(domain);
  }
  function getDomainPadding(props, axis) {
    const formatPadding = (padding3) => {
      return Array.isArray(padding3) ? {
        left: padding3[0],
        right: padding3[1]
      } : {
        left: padding3,
        right: padding3
      };
    };
    return (0, import_isPlainObject4.default)(props.domainPadding) ? formatPadding(props.domainPadding[axis]) : formatPadding(props.domainPadding);
  }
  function getFlatData(dataset, axis) {
    const axisKey = `_${axis}`;
    return dataset.flat().map((datum) => {
      return datum[axisKey] && datum[axisKey][1] !== void 0 ? datum[axisKey][1] : datum[axisKey];
    });
  }
  function getExtremeFromData(dataset, axis, type) {
    if (type === void 0) {
      type = "min";
    }
    const getExtreme = (arr) => type === "max" ? Math.max(...arr) : Math.min(...arr);
    const initialValue = type === "max" ? -Infinity : Infinity;
    let containsDate = false;
    const result = dataset.flat().reduce((memo4, datum) => {
      const current0 = datum[`_${axis}0`] !== void 0 ? datum[`_${axis}0`] : datum[`_${axis}`];
      const current1 = datum[`_${axis}1`] !== void 0 ? datum[`_${axis}1`] : datum[`_${axis}`];
      const current = getExtreme([current0, current1]);
      containsDate = containsDate || current0 instanceof Date || current1 instanceof Date;
      return getExtreme([memo4, current]);
    }, initialValue);
    return containsDate ? new Date(result) : result;
  }
  function padDomain(domain, props, axis) {
    if (!props.domainPadding) {
      return domain;
    }
    const minDomain = getMinFromProps(props, axis);
    const maxDomain = getMaxFromProps(props, axis);
    const padding3 = getDomainPadding(props, axis);
    if (!padding3.left && !padding3.right) {
      return domain;
    }
    const min3 = getMinValue(domain);
    const max3 = getMaxValue(domain);
    const currentAxis = getCurrentAxis(axis, props.horizontal);
    const range4 = getRange(props, currentAxis);
    const rangeExtent = Math.abs(range4[0] - range4[1]);
    const paddedRangeExtent = Math.max(rangeExtent - padding3.left - padding3.right, 1);
    const paddedDomainExtent = Math.abs(max3.valueOf() - min3.valueOf()) / paddedRangeExtent * rangeExtent;
    const simplePadding = {
      left: paddedDomainExtent * padding3.left / rangeExtent,
      right: paddedDomainExtent * padding3.right / rangeExtent
    };
    let paddedDomain = {
      min: min3.valueOf() - simplePadding.left,
      max: max3.valueOf() + simplePadding.right
    };
    const singleQuadrantDomainPadding = (0, import_isPlainObject4.default)(props.singleQuadrantDomainPadding) ? props.singleQuadrantDomainPadding[axis] : props.singleQuadrantDomainPadding;
    const addsQuadrants = min3.valueOf() >= 0 && paddedDomain.min <= 0 || max3.valueOf() <= 0 && paddedDomain.max >= 0;
    const adjust = (val, type) => {
      const coerce = type === "min" && min3.valueOf() >= 0 && val <= 0 || type === "max" && max3.valueOf() <= 0 && val >= 0;
      return coerce ? 0 : val;
    };
    if (addsQuadrants && singleQuadrantDomainPadding !== false) {
      const initialPadding = {
        // @ts-expect-error `max/min` might be dates
        left: Math.abs(max3 - min3) * padding3.left / rangeExtent,
        // @ts-expect-error `max/min` might be dates
        right: Math.abs(max3 - min3) * padding3.right / rangeExtent
      };
      const adjustedDomain = {
        min: adjust(min3.valueOf() - initialPadding.left, "min"),
        max: adjust(max3.valueOf() + initialPadding.right, "max")
      };
      const finalPadding = {
        left: Math.abs(adjustedDomain.max - adjustedDomain.min) * padding3.left / rangeExtent,
        right: Math.abs(adjustedDomain.max - adjustedDomain.min) * padding3.right / rangeExtent
      };
      paddedDomain = {
        min: adjust(min3.valueOf() - finalPadding.left, "min"),
        max: adjust(max3.valueOf() + finalPadding.right, "max")
      };
    }
    const finalDomain = {
      min: minDomain !== void 0 ? minDomain : paddedDomain.min,
      max: maxDomain !== void 0 ? maxDomain : paddedDomain.max
    };
    return min3 instanceof Date || max3 instanceof Date ? getDomainFromMinMax(new Date(finalDomain.min), new Date(finalDomain.max)) : getDomainFromMinMax(finalDomain.min, finalDomain.max);
  }
  function createDomainFunction(getDomainFromDataFunction, formatDomainFunction) {
    const getDomainFromDataFn = isFunction(getDomainFromDataFunction) ? getDomainFromDataFunction : getDomainFromData;
    const formatDomainFn = isFunction(formatDomainFunction) ? formatDomainFunction : formatDomain;
    return (props, axis) => {
      const propsDomain = getDomainFromProps(props, axis);
      if (propsDomain) {
        return formatDomainFn(propsDomain, props, axis);
      }
      const categories = getCategories(props, axis);
      const domain = categories ? getDomainFromCategories(props, axis, categories) : getDomainFromDataFn(props, axis);
      return domain ? formatDomainFn(domain, props, axis) : void 0;
    };
  }
  function formatDomain(domain, props, axis) {
    return cleanDomain(padDomain(domain, props, axis), props, axis);
  }
  function getDomain(props, axis) {
    return createDomainFunction()(props, axis);
  }
  function getDomainFromCategories(props, axis, categories) {
    const categoriesArray = categories || getCategories(props, axis);
    const {
      polar,
      startAngle = 0,
      endAngle = 360
    } = props;
    if (!categoriesArray) {
      return void 0;
    }
    const minDomain = getMinFromProps(props, axis);
    const maxDomain = getMaxFromProps(props, axis);
    const stringArray = containsStrings(categoriesArray) ? getStringsFromCategories(props, axis) : [];
    const stringMap = stringArray.length === 0 ? null : stringArray.reduce((memo4, string, index) => {
      memo4[string] = index + 1;
      return memo4;
    }, {});
    const categoryValues = stringMap ? categoriesArray.map((value) => stringMap[value]) : categoriesArray;
    const min3 = minDomain !== void 0 ? minDomain : getMinValue(categoryValues);
    const max3 = maxDomain !== void 0 ? maxDomain : getMaxValue(categoryValues);
    const categoryDomain = getDomainFromMinMax(min3, max3);
    return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(categoryDomain, categoryValues) : categoryDomain;
  }
  function getDomainFromData(props, axis, dataset) {
    const datasetArray = dataset || getData(props);
    const {
      polar,
      startAngle = 0,
      endAngle = 360
    } = props;
    const minDomain = getMinFromProps(props, axis);
    const maxDomain = getMaxFromProps(props, axis);
    if (datasetArray.length < 1) {
      return minDomain !== void 0 && maxDomain !== void 0 ? getDomainFromMinMax(minDomain, maxDomain) : void 0;
    }
    const min3 = minDomain !== void 0 ? minDomain : getExtremeFromData(datasetArray, axis, "min");
    const max3 = maxDomain !== void 0 ? maxDomain : getExtremeFromData(datasetArray, axis, "max");
    const domain = getDomainFromMinMax(min3, max3);
    return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(datasetArray, axis)) : domain;
  }
  function getDomainFromMinMax(min3, max3) {
    const getSinglePointDomain = (val) => {
      const verySmallNumber = (
        // eslint-disable-next-line no-magic-numbers
        val === 0 ? 2 * Math.pow(10, -10) : Math.pow(10, -10)
      );
      const verySmallDate = 1;
      const minVal = val instanceof Date ? new Date(Number(val) - verySmallDate) : Number(val) - verySmallNumber;
      const maxVal = val instanceof Date ? new Date(Number(val) + verySmallDate) : Number(val) + verySmallNumber;
      return val === 0 ? [0, maxVal] : [minVal, maxVal];
    };
    return Number(min3) === Number(max3) ? getSinglePointDomain(max3) : [min3, max3];
  }
  function getDomainFromProps(props, axis) {
    const minDomain = getMinFromProps(props, axis);
    const maxDomain = getMaxFromProps(props, axis);
    if ((0, import_isPlainObject4.default)(props.domain) && props.domain[axis]) {
      return props.domain[axis];
    } else if (Array.isArray(props.domain)) {
      return props.domain;
    } else if (minDomain !== void 0 && maxDomain !== void 0) {
      return getDomainFromMinMax(minDomain, maxDomain);
    }
    return void 0;
  }
  function getDomainWithZero(props, axis) {
    const propsDomain = getDomainFromProps(props, axis);
    if (propsDomain) {
      return propsDomain;
    }
    const dataset = getData(props);
    const y0Min = dataset.reduce((min3, datum) => datum._y0 < min3 ? datum._y0 : min3, Infinity);
    const ensureZero = (domain) => {
      if (axis === "x") {
        return domain;
      }
      const defaultMin = y0Min !== Infinity ? y0Min : 0;
      const maxDomainProp = getMaxFromProps(props, axis);
      const minDomainProp = getMinFromProps(props, axis);
      const max3 = maxDomainProp !== void 0 ? maxDomainProp : getMaxValue(domain, defaultMin);
      const min3 = minDomainProp !== void 0 ? minDomainProp : getMinValue(domain, defaultMin);
      return getDomainFromMinMax(min3, max3);
    };
    const getDomainFunction = () => {
      return getDomainFromData(props, axis, dataset);
    };
    const formatDomainFunction = (domain) => {
      return formatDomain(ensureZero(domain), props, axis);
    };
    return createDomainFunction(getDomainFunction, formatDomainFunction)(props, axis);
  }
  function getMaxFromProps(props, axis) {
    if ((0, import_isPlainObject4.default)(props.maxDomain) && props.maxDomain[axis] !== void 0) {
      return props.maxDomain[axis];
    }
    return typeof props.maxDomain === "number" || (0, import_isDate.default)(props.maxDomain) ? props.maxDomain : void 0;
  }
  function getMinFromProps(props, axis) {
    if ((0, import_isPlainObject4.default)(props.minDomain) && props.minDomain[axis] !== void 0) {
      return props.minDomain[axis];
    }
    return typeof props.minDomain === "number" || (0, import_isDate.default)(props.minDomain) ? props.minDomain : void 0;
  }
  function getSymmetricDomain(domain, values) {
    const processedData = (0, import_sortedUniq.default)(values.sort((a2, b) => a2 - b));
    const step = processedData[1] - processedData[0];
    return [domain[0], domain[1] + step];
  }
  function isDomainComponent(component) {
    const getRole = (child) => {
      return child && child.type ? child.type.role : "";
    };
    let role = getRole(component);
    if (role === "portal") {
      const children = import_react66.default.Children.toArray(component.props.children);
      role = children.length ? getRole(children[0]) : "";
    }
    const whitelist = ["area", "axis", "bar", "boxplot", "candlestick", "errorbar", "group", "histogram", "line", "pie", "scatter", "stack", "voronoi"];
    return whitelist.includes(role);
  }

  // node_modules/victory-core/es/victory-util/axis.js
  function identity4(value) {
    return value;
  }
  function getAxis(props) {
    const {
      dependentAxis
    } = props;
    return dependentAxis ? "y" : "x";
  }
  function findAxisComponents(childComponents, predicate) {
    const predicateFunction = predicate || identity4;
    const findAxes = (children) => {
      return children.reduce((memo4, child) => {
        if (child.type && child.type.role === "axis" && predicateFunction(child)) {
          return memo4.concat(child);
        } else if (child.props && child.props.children) {
          return memo4.concat(findAxes(import_react67.default.Children.toArray(child.props.children)));
        }
        return memo4;
      }, []);
    };
    return findAxes(childComponents);
  }
  function getAxisComponent(childComponents, axis) {
    const matchesAxis = (component) => {
      const type = component.type.getAxis(component.props);
      return type === axis;
    };
    return findAxisComponents(childComponents, matchesAxis)[0];
  }
  function getAxisComponentsWithParent(childComponents, type) {
    const matchesType = (child) => {
      return type === "dependent" ? child.props.dependentAxis : !child.props.dependentAxis;
    };
    const findComponents = (children) => {
      return children.reduce((memo4, child) => {
        if (child.type && child.type.role === "axis" && matchesType(child)) {
          return memo4.concat(child);
        } else if (child.props && child.props.children) {
          const childAxis = findComponents(import_react67.default.Children.toArray(child.props.children));
          return childAxis.length > 0 ? memo4.concat(child) : memo4;
        }
        return memo4;
      }, []);
    };
    return findComponents(childComponents);
  }
  function getOrigin(domain) {
    const getSingleOrigin = (d) => {
      const domainMin = Math.min(...d);
      const domainMax = Math.max(...d);
      return domainMax < 0 ? domainMax : Math.max(0, domainMin);
    };
    return {
      x: containsDates(domain.x) ? new Date(Math.min(...domain.x)) : getSingleOrigin(domain.x),
      y: containsDates(domain.y) ? new Date(Math.min(...domain.y)) : getSingleOrigin(domain.y)
    };
  }
  function getOriginSign(origin, domain) {
    const getSign = () => {
      return origin <= 0 && Math.max(...domain) <= 0 ? "negative" : "positive";
    };
    return containsDates(domain) ? "positive" : getSign();
  }
  function isVertical(props) {
    const orientation = props.orientation || (props.dependentAxis ? "left" : "bottom");
    const vertical = {
      top: false,
      bottom: false,
      left: true,
      right: true
    };
    return vertical[orientation];
  }
  function stringTicks(props) {
    return props.tickValues !== void 0 && containsStrings(props.tickValues);
  }
  function getDefaultTickFormat(props) {
    const {
      tickValues
    } = props;
    const axis = getAxis(props);
    const stringMap = props.stringMap && props.stringMap[axis];
    const fallbackFormat = tickValues && !containsDates(tickValues) ? (x2) => x2 : void 0;
    if (!stringMap) {
      return stringTicks(props) ? (x2, index) => tickValues[index] : fallbackFormat;
    }
    const invertedStringMap = stringMap && invert(stringMap);
    const tickValueArray = (0, import_orderBy3.default)(Object.values(stringMap), (n) => n);
    const dataNames = tickValueArray.map((tick) => invertedStringMap[tick]);
    const dataTicks = ["", ...dataNames, ""];
    return (x2) => dataTicks[x2];
  }
  function getStringTicks(props) {
    const axis = getAxis(props);
    const stringMap = props.stringMap && props.stringMap[axis];
    const categories = Array.isArray(props.categories) ? props.categories : props.categories && props.categories[axis];
    const ticksFromCategories = categories && containsOnlyStrings(categories) ? categories.map((tick) => stringMap[tick]) : void 0;
    const ticksFromStringMap = stringMap && Object.values(stringMap);
    return ticksFromCategories && ticksFromCategories.length !== 0 ? ticksFromCategories : ticksFromStringMap;
  }
  function getTickArray(props) {
    const {
      tickValues,
      tickFormat: tickFormat2
    } = props;
    if (tickValues?.length === 0) {
      return [];
    }
    const axis = getAxis(props);
    const stringMap = props.stringMap && props.stringMap[axis];
    const getTicksFromFormat = () => {
      if (!tickFormat2 || !Array.isArray(tickFormat2)) {
        return void 0;
      }
      return containsStrings(tickFormat2) ? tickFormat2.map((t, i) => i) : tickFormat2;
    };
    let ticks2 = tickValues;
    if (stringMap) {
      ticks2 = getStringTicks(props);
    }
    if (tickValues && containsStrings(tickValues)) {
      ticks2 = stringMap ? tickValues.map((tick) => stringMap[tick]) : range(1, tickValues.length + 1);
    }
    const tickArray = ticks2 ? (0, import_uniq3.default)(ticks2) : getTicksFromFormat();
    const buildTickArray = (arr) => {
      const newTickArray = [];
      const domain = props.domain && props.domain[axis] || props.domain;
      if (arr) {
        arr.forEach((t, index) => {
          if (Array.isArray(domain)) {
            if (t >= getMinValue(domain).valueOf() && t <= getMaxValue(domain).valueOf()) {
              newTickArray.push({
                value: t,
                index
              });
            }
          } else {
            newTickArray.push({
              value: t,
              index
            });
          }
        });
        return newTickArray;
      }
      return void 0;
    };
    return Array.isArray(tickArray) && tickArray.length ? buildTickArray(tickArray) : void 0;
  }
  function getTickFormat(props, scale) {
    const {
      tickFormat: tickFormat2
    } = props;
    const axis = getAxis(props);
    const stringMap = props.stringMap && props.stringMap[axis];
    if (!tickFormat2) {
      const defaultTickFormat = getDefaultTickFormat(props);
      const scaleTickFormat = scale.tickFormat && isFunction(scale.tickFormat) ? scale.tickFormat() : (x2) => x2;
      return defaultTickFormat || scaleTickFormat;
    } else if (tickFormat2 && Array.isArray(tickFormat2)) {
      const tickArray = getTickArray(props);
      const tickArrayIndices = tickArray?.map((v) => v.index);
      const filteredTickFormat = tickFormat2.filter((t, index) => tickArrayIndices?.includes(index));
      return (x2, index) => filteredTickFormat[index];
    } else if (tickFormat2 && isFunction(tickFormat2)) {
      const applyStringTicks = (tick, index, ticks2) => {
        const invertedStringMap = invert(stringMap);
        const stringTickArray = ticks2.map((t) => invertedStringMap[t]);
        return props.tickFormat(invertedStringMap[tick], index, stringTickArray);
      };
      return stringMap ? applyStringTicks : tickFormat2;
    }
    return (x2) => x2;
  }
  function downsampleTicks(ticks2, tickCount) {
    if (!tickCount || !Array.isArray(ticks2) || ticks2.length <= tickCount) {
      return ticks2;
    }
    const k2 = Math.floor(ticks2.length / tickCount);
    return ticks2.filter((d, i) => i % k2 === 0);
  }
  function getTicks(props, scale, filterZero) {
    if (filterZero === void 0) {
      filterZero = false;
    }
    const {
      tickCount
    } = props;
    const tickArray = getTickArray(props);
    if (tickArray?.length === 0) {
      return [""];
    }
    const tickValues = tickArray ? tickArray.map((v) => v.value) : void 0;
    if (tickValues) {
      return downsampleTicks(tickValues, tickCount);
    } else if (scale.ticks && isFunction(scale.ticks)) {
      const defaultTickCount = tickCount || 5;
      const scaleTicks = scale.ticks(defaultTickCount);
      const scaledTickArray = Array.isArray(scaleTicks) && scaleTicks.length ? scaleTicks : scale.domain();
      const ticks2 = downsampleTicks(scaledTickArray, tickCount);
      if (filterZero) {
        const filteredTicks = ticks2.filter((value) => value !== 0);
        return filteredTicks.length ? filteredTicks : ticks2;
      }
      return ticks2;
    }
    return scale.domain();
  }
  function getDomainFromData2(props, axis) {
    const {
      polar,
      startAngle = 0,
      endAngle = 360
    } = props;
    const tickArray = getTickArray(props);
    const tickValues = tickArray && tickArray?.length !== 0 ? tickArray.map((v) => v.value) : void 0;
    if (!Array.isArray(tickValues)) {
      return void 0;
    }
    const minDomain = getMinFromProps(props, axis);
    const maxDomain = getMaxFromProps(props, axis);
    const tickStrings = stringTicks(props);
    const ticks2 = tickValues.map((value) => Number(value));
    const defaultMin = tickStrings ? 1 : getMinValue(ticks2);
    const defaultMax = tickStrings ? tickValues.length : getMaxValue(ticks2);
    const min3 = minDomain !== void 0 ? minDomain : defaultMin;
    const max3 = maxDomain !== void 0 ? maxDomain : defaultMax;
    const initialDomain = getDomainFromMinMax(min3, max3);
    const domain = polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(initialDomain, ticks2) : initialDomain;
    if (isVertical(props) && !polar) {
      domain.reverse();
    }
    return domain;
  }
  function getDomain2(props, axis) {
    const inherentAxis = getAxis(props);
    if (axis && axis !== inherentAxis) {
      return void 0;
    }
    return createDomainFunction(getDomainFromData2)(props, inherentAxis);
  }
  function getAxisValue(props, axis) {
    if (!props.axisValue) {
      return void 0;
    }
    const scaleAxis = axis === "x" ? "y" : "x";
    const scale = (0, import_isObject.default)(props.scale) && isFunction(props.scale[scaleAxis]) ? props.scale[scaleAxis] : void 0;
    if (!scale) {
      return void 0;
    }
    const stringMapAxis = axis === "x" ? "y" : "x";
    const stringMap = (0, import_isObject.default)(props.stringMap) && props.stringMap[stringMapAxis];
    const axisValue = stringMap && typeof props.axisValue === "string" ? stringMap[props.axisValue] : props.axisValue;
    return scale(axisValue);
  }
  function modifyProps2(props, fallbackProps12) {
    if (!(0, import_isObject.default)(props.theme)) {
      return modifyProps(props, fallbackProps12, "axis");
    }
    let role = "axis";
    if (props.dependentAxis && props.theme.dependentAxis) {
      role = "dependentAxis";
    } else if (!props.dependentAxis && props.theme.independentAxis) {
      role = "independentAxis";
    }
    if (role === "axis") {
      return modifyProps(props, fallbackProps12, "axis");
    }
    const axisTheme = (0, import_defaults5.default)({}, props.theme[role], props.theme.axis);
    const theme = Object.assign({}, props.theme, {
      axis: axisTheme
    });
    return modifyProps(Object.assign({}, props, {
      theme
    }), fallbackProps12, "axis");
  }

  // node_modules/victory-core/es/victory-util/default-transitions.js
  var default_transitions_exports = {};
  __export(default_transitions_exports, {
    continuousPolarTransitions: () => continuousPolarTransitions,
    continuousTransitions: () => continuousTransitions,
    discreteTransitions: () => discreteTransitions
  });
  function continuousTransitions() {
    return {
      onLoad: {
        duration: 2e3
      },
      onExit: {
        duration: 500
      },
      onEnter: {
        duration: 500
      }
    };
  }
  function continuousPolarTransitions() {
    return {
      onLoad: {
        duration: 2e3,
        before: () => ({
          _y: 0,
          _y1: 0,
          _y0: 0
        }),
        after: (datum) => ({
          _y: datum._y,
          _y1: datum._y1,
          _y0: datum._y0
        })
      },
      onExit: {
        duration: 500,
        before: (datum, index, data) => {
          const adjacent = (attr) => {
            const adj = index === 0 ? data[index + 1] : data[index - 1];
            return adj[attr];
          };
          return {
            _x: adjacent("_x"),
            _y: adjacent("_y"),
            _y0: adjacent("_y0")
          };
        }
      },
      onEnter: {
        duration: 500,
        before: (datum, index, data) => {
          const adjacent = (attr) => {
            const adj = index === 0 ? data[index + 1] : data[index - 1];
            return adj[attr];
          };
          return {
            _x: adjacent("_x"),
            _y: adjacent("_y"),
            _y0: adjacent("_y0")
          };
        },
        after: (datum) => ({
          _x: datum._x,
          _y: datum._y,
          _y1: datum._y1,
          _y0: datum._y0
        })
      }
    };
  }
  function discreteTransitions() {
    return {
      onLoad: {
        duration: 2e3,
        before: () => ({
          opacity: 0
        }),
        after: (datum) => datum
      },
      onExit: {
        duration: 600,
        before: () => ({
          opacity: 0
        })
      },
      onEnter: {
        duration: 600,
        before: () => ({
          opacity: 0
        }),
        after: (datum) => datum
      }
    };
  }

  // node_modules/victory-core/es/victory-util/hooks/index.js
  var hooks_exports = {};
  __export(hooks_exports, {
    useAnimationState: () => useAnimationState,
    usePreviousProps: () => usePreviousProps
  });

  // node_modules/victory-core/es/victory-util/hooks/use-previous-props.js
  var import_react68 = __toESM(require_react());
  function usePreviousProps(props) {
    const ref = import_react68.default.useRef();
    import_react68.default.useEffect(() => {
      ref.current = props;
    });
    return ref.current;
  }

  // node_modules/victory-core/es/victory-util/hooks/use-animation-state.js
  var import_react69 = __toESM(require_react());
  var import_defaults6 = __toESM(require_defaults());
  var INITIAL_STATE = {
    nodesShouldLoad: false,
    nodesDoneLoad: false,
    animating: true
  };
  var useAnimationState = function(initialState2) {
    if (initialState2 === void 0) {
      initialState2 = INITIAL_STATE;
    }
    const [state, _setState] = import_react69.default.useState(initialState2);
    const setState = import_react69.default.useCallback((newState) => {
      _setState((oldState) => ({
        ...oldState,
        ...newState
      }));
    }, [_setState]);
    const getAnimationProps = import_react69.default.useCallback((props, child, index) => {
      if (!props?.animate) {
        return child.props.animate;
      }
      const getFilteredState = () => {
        let childrenTransitions = state && state.childrenTransitions;
        childrenTransitions = isArrayOfArrays(childrenTransitions) ? childrenTransitions[index] : childrenTransitions;
        return (0, import_defaults6.default)({
          childrenTransitions
        }, state);
      };
      let getTransitions = props.animate && props.animate.getTransitions;
      const filteredState = getFilteredState();
      const parentState = props.animate && props.animate.parentState || filteredState;
      if (!getTransitions) {
        const getTransitionProps = getTransitionPropsFactory(props, filteredState, (newState) => setState(newState));
        getTransitions = (childComponent) => getTransitionProps(childComponent, index);
      }
      return (0, import_defaults6.default)({
        getTransitions,
        parentState
      }, props.animate, child.props.animate);
    }, [state, setState]);
    const setAnimationState = import_react69.default.useCallback((props, nextProps) => {
      if (!props?.animate) {
        return;
      }
      if (props.animate.parentState) {
        const nodesWillExit = props.animate.parentState.nodesWillExit;
        const oldProps = nodesWillExit ? props : null;
        const newState = (0, import_defaults6.default)({
          oldProps,
          nextProps
        }, props.animate.parentState);
        setState(newState);
      } else {
        const oldChildren = import_react69.default.Children.toArray(props.children);
        const nextChildren = import_react69.default.Children.toArray(nextProps.children);
        const isContinuous = (child) => {
          const check = (c2) => c2.type && c2.type.continuous;
          return Array.isArray(child) ? child.some(check) : check(child);
        };
        const continuous2 = !props.polar && oldChildren.some((child) => {
          return isContinuous(child) || child?.props?.children && isContinuous(child.props.children);
        });
        const {
          nodesWillExit,
          nodesWillEnter,
          childrenTransitions,
          nodesShouldEnter
        } = getInitialTransitionState(oldChildren, nextChildren);
        setState({
          nodesWillExit,
          nodesWillEnter,
          nodesShouldEnter,
          childrenTransitions: isArrayOfArrays(childrenTransitions) ? childrenTransitions[0] : childrenTransitions,
          oldProps: nodesWillExit ? props : void 0,
          nextProps,
          continuous: continuous2
        });
      }
    }, [setState]);
    const getProps2 = import_react69.default.useCallback((initialProps) => {
      return state && state.nodesWillExit ? state.oldProps || initialProps : initialProps;
    }, [state]);
    return {
      state,
      setState,
      getAnimationProps,
      setAnimationState,
      getProps: getProps2
    };
  };

  // node_modules/victory-core/es/victory-util/label-helpers.js
  var label_helpers_exports = {};
  __export(label_helpers_exports, {
    getDegrees: () => getDegrees,
    getPolarAngle: () => getPolarAngle,
    getPolarTextAnchor: () => getPolarTextAnchor,
    getPolarVerticalAnchor: () => getPolarVerticalAnchor,
    getProps: () => getProps,
    getText: () => getText
  });
  var import_defaults7 = __toESM(require_defaults());
  function getVerticalAnchor(props, datum) {
    if (datum === void 0) {
      datum = {};
    }
    const sign2 = datum._y >= 0 ? 1 : -1;
    const labelStyle = props.style && props.style.labels || {};
    if (datum.verticalAnchor || labelStyle.verticalAnchor) {
      return datum.verticalAnchor || labelStyle.verticalAnchor;
    } else if (!props.horizontal) {
      return sign2 >= 0 ? "end" : "start";
    }
    return "middle";
  }
  function getTextAnchor(props, datum) {
    if (datum === void 0) {
      datum = {};
    }
    const {
      style,
      horizontal
    } = props;
    const sign2 = datum._y >= 0 ? 1 : -1;
    const labelStyle = style && style.labels || {};
    if (datum.verticalAnchor || labelStyle.verticalAnchor) {
      return datum.verticalAnchor || labelStyle.verticalAnchor;
    } else if (!horizontal) {
      return "middle";
    }
    return sign2 >= 0 ? "start" : "end";
  }
  function getAngle(props, datum) {
    if (datum === void 0) {
      datum = {};
    }
    const labelStyle = props.style && props.style.labels || {};
    return datum.angle === void 0 ? labelStyle.angle : datum.angle;
  }
  function getPadding2(props, datum) {
    if (datum === void 0) {
      datum = {};
    }
    const {
      horizontal,
      style
    } = props;
    const labelStyle = style.labels || {};
    const defaultPadding = evaluateProp(labelStyle.padding, props) || 0;
    const sign2 = datum._y < 0 ? -1 : 1;
    return {
      x: horizontal ? sign2 * defaultPadding : 0,
      y: horizontal ? 0 : -1 * sign2 * defaultPadding
    };
  }
  function getOffset(props, datum) {
    if (props.polar) {
      return {};
    }
    const padding3 = getPadding2(props, datum);
    return {
      dx: padding3.x,
      dy: padding3.y
    };
  }
  function getPosition(props, datum) {
    const {
      polar
    } = props;
    const {
      x: x2,
      y: y2
    } = scalePoint(props, datum);
    if (!polar) {
      return {
        x: x2,
        y: y2
      };
    }
    const polarPadding = getPolarPadding(props, datum);
    return {
      x: x2 + polarPadding.x,
      y: y2 + polarPadding.y
    };
  }
  function getPolarPadding(props, datum) {
    const {
      style
    } = props;
    const degrees = getDegrees(props, datum);
    const labelStyle = style.labels || {};
    const padding3 = evaluateProp(labelStyle.padding, props) || 0;
    const angle = degreesToRadians(degrees);
    return {
      x: padding3 * Math.cos(angle),
      y: -padding3 * Math.sin(angle)
    };
  }
  function getLabelPlacement(props) {
    const {
      labelComponent,
      labelPlacement,
      polar
    } = props;
    const defaultLabelPlacement = polar ? "perpendicular" : "vertical";
    return labelPlacement ? labelPlacement : labelComponent.props && labelComponent.props.labelPlacement || defaultLabelPlacement;
  }
  function getPolarOrientation(degrees) {
    if (degrees < 45 || degrees > 315) {
      return "right";
    } else if (degrees >= 45 && degrees <= 135) {
      return "top";
    } else if (degrees > 135 && degrees < 225) {
      return "left";
    }
    return "bottom";
  }
  function getText(props, datum, index) {
    if (datum === void 0) {
      datum = {};
    }
    if (datum.label !== void 0) {
      return datum.label;
    }
    return Array.isArray(props.labels) ? props.labels[index] : props.labels;
  }
  function getPolarTextAnchor(props, degrees) {
    const labelPlacement = getLabelPlacement(props);
    if (labelPlacement === "perpendicular" || labelPlacement === "vertical" && (degrees === 90 || degrees === 270)) {
      return "middle";
    }
    return degrees <= 90 || degrees > 270 ? "start" : "end";
  }
  function getPolarVerticalAnchor(props, degrees) {
    const labelPlacement = getLabelPlacement(props);
    const orientation = getPolarOrientation(degrees);
    if (labelPlacement === "parallel" || orientation === "left" || orientation === "right") {
      return "middle";
    }
    return orientation === "top" ? "end" : "start";
  }
  function getPolarAngle(props, baseAngle) {
    const {
      labelPlacement,
      datum
    } = props;
    if (!labelPlacement || labelPlacement === "vertical") {
      return 0;
    }
    const degrees = baseAngle !== void 0 ? baseAngle % 360 : getDegrees(props, datum);
    const sign2 = degrees > 90 && degrees < 180 || degrees > 270 ? 1 : -1;
    let angle = 0;
    if (degrees === 0 || degrees === 180) {
      angle = 90;
    } else if (degrees > 0 && degrees < 180) {
      angle = 90 - degrees;
    } else if (degrees > 180 && degrees < 360) {
      angle = 270 - degrees;
    }
    const labelRotation = labelPlacement === "perpendicular" ? 0 : 90;
    return angle + sign2 * labelRotation;
  }
  function getDegrees(props, datum) {
    const {
      x: x2
    } = getPoint(datum);
    return radiansToDegrees(props.scale.x(x2)) % 360;
  }
  function getProps(props, index) {
    const {
      scale,
      data,
      style,
      horizontal,
      polar,
      width,
      height,
      theme,
      labelComponent,
      disableInlineStyles
    } = props;
    const datum = data[index];
    const degrees = getDegrees(props, datum);
    const textAnchor = polar ? getPolarTextAnchor(props, degrees) : getTextAnchor(props, datum);
    const verticalAnchor = polar ? getPolarVerticalAnchor(props, degrees) : getVerticalAnchor(props, datum);
    const angle = getAngle(props, datum);
    const text = getText(props, datum, index);
    const labelPlacement = getLabelPlacement(props);
    const {
      x: x2,
      y: y2
    } = getPosition(props, datum);
    const {
      dx,
      dy
    } = getOffset(props, datum);
    const labelProps = {
      angle,
      data,
      datum,
      disableInlineStyles,
      horizontal,
      index,
      polar,
      scale,
      labelPlacement,
      text,
      textAnchor,
      verticalAnchor,
      x: x2,
      y: y2,
      dx,
      dy,
      width,
      height,
      style: style.labels
    };
    if (!isTooltip(labelComponent)) {
      return labelProps;
    }
    const tooltipTheme = theme && theme.tooltip || {};
    return (0, import_defaults7.default)({}, labelProps, omit(tooltipTheme, ["style"]));
  }

  // node_modules/victory-core/es/victory-util/line-helpers.js
  var line_helpers_exports = {};
  __export(line_helpers_exports, {
    getInterpolationFunction: () => getInterpolationFunction,
    getLineFunction: () => getLineFunction
  });

  // node_modules/victory-vendor/es/d3-shape.js
  var d3_shape_exports = {};
  __export(d3_shape_exports, {
    arc: () => arc_default,
    area: () => area_default,
    areaRadial: () => areaRadial_default,
    curveBasis: () => basis_default2,
    curveBasisClosed: () => basisClosed_default2,
    curveBasisOpen: () => basisOpen_default,
    curveBumpX: () => bumpX,
    curveBumpY: () => bumpY,
    curveBundle: () => bundle_default,
    curveCardinal: () => cardinal_default,
    curveCardinalClosed: () => cardinalClosed_default,
    curveCardinalOpen: () => cardinalOpen_default,
    curveCatmullRom: () => catmullRom_default,
    curveCatmullRomClosed: () => catmullRomClosed_default,
    curveCatmullRomOpen: () => catmullRomOpen_default,
    curveLinear: () => linear_default,
    curveLinearClosed: () => linearClosed_default,
    curveMonotoneX: () => monotoneX,
    curveMonotoneY: () => monotoneY,
    curveNatural: () => natural_default,
    curveStep: () => step_default,
    curveStepAfter: () => stepAfter,
    curveStepBefore: () => stepBefore,
    line: () => line_default,
    lineRadial: () => lineRadial_default,
    link: () => link,
    linkHorizontal: () => linkHorizontal,
    linkRadial: () => linkRadial,
    linkVertical: () => linkVertical,
    pie: () => pie_default,
    pointRadial: () => pointRadial_default,
    radialArea: () => areaRadial_default,
    radialLine: () => lineRadial_default,
    stack: () => stack_default,
    stackOffsetDiverging: () => diverging_default,
    stackOffsetExpand: () => expand_default,
    stackOffsetNone: () => none_default,
    stackOffsetSilhouette: () => silhouette_default,
    stackOffsetWiggle: () => wiggle_default,
    stackOrderAppearance: () => appearance_default,
    stackOrderAscending: () => ascending_default,
    stackOrderDescending: () => descending_default2,
    stackOrderInsideOut: () => insideOut_default,
    stackOrderNone: () => none_default2,
    stackOrderReverse: () => reverse_default,
    symbol: () => Symbol2,
    symbolAsterisk: () => asterisk_default,
    symbolCircle: () => circle_default,
    symbolCross: () => cross_default,
    symbolDiamond: () => diamond_default,
    symbolDiamond2: () => diamond2_default,
    symbolPlus: () => plus_default,
    symbolSquare: () => square_default,
    symbolSquare2: () => square2_default,
    symbolStar: () => star_default,
    symbolTimes: () => times_default,
    symbolTriangle: () => triangle_default,
    symbolTriangle2: () => triangle2_default,
    symbolWye: () => wye_default,
    symbolX: () => times_default,
    symbols: () => symbolsFill,
    symbolsFill: () => symbolsFill,
    symbolsStroke: () => symbolsStroke
  });

  // node_modules/d3-shape/src/constant.js
  function constant_default2(x2) {
    return function constant() {
      return x2;
    };
  }

  // node_modules/d3-shape/src/math.js
  var abs = Math.abs;
  var atan2 = Math.atan2;
  var cos = Math.cos;
  var max2 = Math.max;
  var min2 = Math.min;
  var sin = Math.sin;
  var sqrt2 = Math.sqrt;
  var epsilon = 1e-12;
  var pi2 = Math.PI;
  var halfPi2 = pi2 / 2;
  var tau2 = 2 * pi2;
  function acos(x2) {
    return x2 > 1 ? 0 : x2 < -1 ? pi2 : Math.acos(x2);
  }
  function asin(x2) {
    return x2 >= 1 ? halfPi2 : x2 <= -1 ? -halfPi2 : Math.asin(x2);
  }

  // node_modules/d3-path/src/path.js
  var pi3 = Math.PI;
  var tau3 = 2 * pi3;
  var epsilon2 = 1e-6;
  var tauEpsilon = tau3 - epsilon2;
  function append(strings) {
    this._ += strings[0];
    for (let i = 1, n = strings.length; i < n; ++i) {
      this._ += arguments[i] + strings[i];
    }
  }
  function appendRound(digits) {
    let d = Math.floor(digits);
    if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);
    if (d > 15) return append;
    const k2 = 10 ** d;
    return function(strings) {
      this._ += strings[0];
      for (let i = 1, n = strings.length; i < n; ++i) {
        this._ += Math.round(arguments[i] * k2) / k2 + strings[i];
      }
    };
  }
  var Path = class {
    constructor(digits) {
      this._x0 = this._y0 = // start of current subpath
      this._x1 = this._y1 = null;
      this._ = "";
      this._append = digits == null ? append : appendRound(digits);
    }
    moveTo(x2, y2) {
      this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}`;
    }
    closePath() {
      if (this._x1 !== null) {
        this._x1 = this._x0, this._y1 = this._y0;
        this._append`Z`;
      }
    }
    lineTo(x2, y2) {
      this._append`L${this._x1 = +x2},${this._y1 = +y2}`;
    }
    quadraticCurveTo(x1, y1, x2, y2) {
      this._append`Q${+x1},${+y1},${this._x1 = +x2},${this._y1 = +y2}`;
    }
    bezierCurveTo(x1, y1, x2, y2, x3, y3) {
      this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x3},${this._y1 = +y3}`;
    }
    arcTo(x1, y1, x2, y2, r) {
      x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;
      if (r < 0) throw new Error(`negative radius: ${r}`);
      let x0 = this._x1, y0 = this._y1, x21 = x2 - x1, y21 = y2 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01;
      if (this._x1 === null) {
        this._append`M${this._x1 = x1},${this._y1 = y1}`;
      } else if (!(l01_2 > epsilon2)) ;
      else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon2) || !r) {
        this._append`L${this._x1 = x1},${this._y1 = y1}`;
      } else {
        let x20 = x2 - x0, y20 = y2 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l = r * Math.tan((pi3 - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21;
        if (Math.abs(t01 - 1) > epsilon2) {
          this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;
        }
        this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;
      }
    }
    arc(x2, y2, r, a0, a1, ccw) {
      x2 = +x2, y2 = +y2, r = +r, ccw = !!ccw;
      if (r < 0) throw new Error(`negative radius: ${r}`);
      let dx = r * Math.cos(a0), dy = r * Math.sin(a0), x0 = x2 + dx, y0 = y2 + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0;
      if (this._x1 === null) {
        this._append`M${x0},${y0}`;
      } else if (Math.abs(this._x1 - x0) > epsilon2 || Math.abs(this._y1 - y0) > epsilon2) {
        this._append`L${x0},${y0}`;
      }
      if (!r) return;
      if (da < 0) da = da % tau3 + tau3;
      if (da > tauEpsilon) {
        this._append`A${r},${r},0,1,${cw},${x2 - dx},${y2 - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;
      } else if (da > epsilon2) {
        this._append`A${r},${r},0,${+(da >= pi3)},${cw},${this._x1 = x2 + r * Math.cos(a1)},${this._y1 = y2 + r * Math.sin(a1)}`;
      }
    }
    rect(x2, y2, w, h) {
      this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}h${w = +w}v${+h}h${-w}Z`;
    }
    toString() {
      return this._;
    }
  };
  function path() {
    return new Path();
  }
  path.prototype = Path.prototype;

  // node_modules/d3-shape/src/path.js
  function withPath(shape) {
    let digits = 3;
    shape.digits = function(_113) {
      if (!arguments.length) return digits;
      if (_113 == null) {
        digits = null;
      } else {
        const d = Math.floor(_113);
        if (!(d >= 0)) throw new RangeError(`invalid digits: ${_113}`);
        digits = d;
      }
      return shape;
    };
    return () => new Path(digits);
  }

  // node_modules/d3-shape/src/arc.js
  function arcInnerRadius(d) {
    return d.innerRadius;
  }
  function arcOuterRadius(d) {
    return d.outerRadius;
  }
  function arcStartAngle(d) {
    return d.startAngle;
  }
  function arcEndAngle(d) {
    return d.endAngle;
  }
  function arcPadAngle(d) {
    return d && d.padAngle;
  }
  function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
    var x10 = x1 - x0, y10 = y1 - y0, x32 = x3 - x2, y32 = y3 - y2, t = y32 * x10 - x32 * y10;
    if (t * t < epsilon) return;
    t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
    return [x0 + t * x10, y0 + t * y10];
  }
  function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
    var x01 = x0 - x1, y01 = y0 - y1, lo = (cw ? rc : -rc) / sqrt2(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x11 = x0 + ox, y11 = y0 + oy, x10 = x1 + ox, y10 = y1 + oy, x00 = (x11 + x10) / 2, y00 = (y11 + y10) / 2, dx = x10 - x11, dy = y10 - y11, d2 = dx * dx + dy * dy, r = r1 - rc, D = x11 * y10 - x10 * y11, d = (dy < 0 ? -1 : 1) * sqrt2(max2(0, r * r * d2 - D * D)), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x00, dy0 = cy0 - y00, dx1 = cx1 - x00, dy1 = cy1 - y00;
    if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
    return {
      cx: cx0,
      cy: cy0,
      x01: -ox,
      y01: -oy,
      x11: cx0 * (r1 / r - 1),
      y11: cy0 * (r1 / r - 1)
    };
  }
  function arc_default() {
    var innerRadius = arcInnerRadius, outerRadius = arcOuterRadius, cornerRadius = constant_default2(0), padRadius = null, startAngle = arcStartAngle, endAngle = arcEndAngle, padAngle = arcPadAngle, context = null, path2 = withPath(arc);
    function arc() {
      var buffer, r, r0 = +innerRadius.apply(this, arguments), r1 = +outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) - halfPi2, a1 = endAngle.apply(this, arguments) - halfPi2, da = abs(a1 - a0), cw = a1 > a0;
      if (!context) context = buffer = path2();
      if (r1 < r0) r = r1, r1 = r0, r0 = r;
      if (!(r1 > epsilon)) context.moveTo(0, 0);
      else if (da > tau2 - epsilon) {
        context.moveTo(r1 * cos(a0), r1 * sin(a0));
        context.arc(0, 0, r1, a0, a1, !cw);
        if (r0 > epsilon) {
          context.moveTo(r0 * cos(a1), r0 * sin(a1));
          context.arc(0, 0, r0, a1, a0, cw);
        }
      } else {
        var a01 = a0, a11 = a1, a00 = a0, a10 = a1, da0 = da, da1 = da, ap = padAngle.apply(this, arguments) / 2, rp = ap > epsilon && (padRadius ? +padRadius.apply(this, arguments) : sqrt2(r0 * r0 + r1 * r1)), rc = min2(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), rc0 = rc, rc1 = rc, t02, t12;
        if (rp > epsilon) {
          var p0 = asin(rp / r0 * sin(ap)), p1 = asin(rp / r1 * sin(ap));
          if ((da0 -= p0 * 2) > epsilon) p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0;
          else da0 = 0, a00 = a10 = (a0 + a1) / 2;
          if ((da1 -= p1 * 2) > epsilon) p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1;
          else da1 = 0, a01 = a11 = (a0 + a1) / 2;
        }
        var x01 = r1 * cos(a01), y01 = r1 * sin(a01), x10 = r0 * cos(a10), y10 = r0 * sin(a10);
        if (rc > epsilon) {
          var x11 = r1 * cos(a11), y11 = r1 * sin(a11), x00 = r0 * cos(a00), y00 = r0 * sin(a00), oc;
          if (da < pi2) {
            if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {
              var ax = x01 - oc[0], ay = y01 - oc[1], bx = x11 - oc[0], by = y11 - oc[1], kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt2(ax * ax + ay * ay) * sqrt2(bx * bx + by * by))) / 2), lc = sqrt2(oc[0] * oc[0] + oc[1] * oc[1]);
              rc0 = min2(rc, (r0 - lc) / (kc - 1));
              rc1 = min2(rc, (r1 - lc) / (kc + 1));
            } else {
              rc0 = rc1 = 0;
            }
          }
        }
        if (!(da1 > epsilon)) context.moveTo(x01, y01);
        else if (rc1 > epsilon) {
          t02 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
          t12 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
          context.moveTo(t02.cx + t02.x01, t02.cy + t02.y01);
          if (rc1 < rc) context.arc(t02.cx, t02.cy, rc1, atan2(t02.y01, t02.x01), atan2(t12.y01, t12.x01), !cw);
          else {
            context.arc(t02.cx, t02.cy, rc1, atan2(t02.y01, t02.x01), atan2(t02.y11, t02.x11), !cw);
            context.arc(0, 0, r1, atan2(t02.cy + t02.y11, t02.cx + t02.x11), atan2(t12.cy + t12.y11, t12.cx + t12.x11), !cw);
            context.arc(t12.cx, t12.cy, rc1, atan2(t12.y11, t12.x11), atan2(t12.y01, t12.x01), !cw);
          }
        } else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
        if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);
        else if (rc0 > epsilon) {
          t02 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
          t12 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
          context.lineTo(t02.cx + t02.x01, t02.cy + t02.y01);
          if (rc0 < rc) context.arc(t02.cx, t02.cy, rc0, atan2(t02.y01, t02.x01), atan2(t12.y01, t12.x01), !cw);
          else {
            context.arc(t02.cx, t02.cy, rc0, atan2(t02.y01, t02.x01), atan2(t02.y11, t02.x11), !cw);
            context.arc(0, 0, r0, atan2(t02.cy + t02.y11, t02.cx + t02.x11), atan2(t12.cy + t12.y11, t12.cx + t12.x11), cw);
            context.arc(t12.cx, t12.cy, rc0, atan2(t12.y11, t12.x11), atan2(t12.y01, t12.x01), !cw);
          }
        } else context.arc(0, 0, r0, a10, a00, cw);
      }
      context.closePath();
      if (buffer) return context = null, buffer + "" || null;
    }
    arc.centroid = function() {
      var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a2 = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi2 / 2;
      return [cos(a2) * r, sin(a2) * r];
    };
    arc.innerRadius = function(_113) {
      return arguments.length ? (innerRadius = typeof _113 === "function" ? _113 : constant_default2(+_113), arc) : innerRadius;
    };
    arc.outerRadius = function(_113) {
      return arguments.length ? (outerRadius = typeof _113 === "function" ? _113 : constant_default2(+_113), arc) : outerRadius;
    };
    arc.cornerRadius = function(_113) {
      return arguments.length ? (cornerRadius = typeof _113 === "function" ? _113 : constant_default2(+_113), arc) : cornerRadius;
    };
    arc.padRadius = function(_113) {
      return arguments.length ? (padRadius = _113 == null ? null : typeof _113 === "function" ? _113 : constant_default2(+_113), arc) : padRadius;
    };
    arc.startAngle = function(_113) {
      return arguments.length ? (startAngle = typeof _113 === "function" ? _113 : constant_default2(+_113), arc) : startAngle;
    };
    arc.endAngle = function(_113) {
      return arguments.length ? (endAngle = typeof _113 === "function" ? _113 : constant_default2(+_113), arc) : endAngle;
    };
    arc.padAngle = function(_113) {
      return arguments.length ? (padAngle = typeof _113 === "function" ? _113 : constant_default2(+_113), arc) : padAngle;
    };
    arc.context = function(_113) {
      return arguments.length ? (context = _113 == null ? null : _113, arc) : context;
    };
    return arc;
  }

  // node_modules/d3-shape/src/array.js
  var slice = Array.prototype.slice;
  function array_default(x2) {
    return typeof x2 === "object" && "length" in x2 ? x2 : Array.from(x2);
  }

  // node_modules/d3-shape/src/curve/linear.js
  function Linear(context) {
    this._context = context;
  }
  Linear.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._point = 0;
    },
    lineEnd: function() {
      if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
      this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
          break;
        case 1:
          this._point = 2;
        // falls through
        default:
          this._context.lineTo(x2, y2);
          break;
      }
    }
  };
  function linear_default(context) {
    return new Linear(context);
  }

  // node_modules/d3-shape/src/point.js
  function x(p) {
    return p[0];
  }
  function y(p) {
    return p[1];
  }

  // node_modules/d3-shape/src/line.js
  function line_default(x2, y2) {
    var defined3 = constant_default2(true), context = null, curve = linear_default, output = null, path2 = withPath(line);
    x2 = typeof x2 === "function" ? x2 : x2 === void 0 ? x : constant_default2(x2);
    y2 = typeof y2 === "function" ? y2 : y2 === void 0 ? y : constant_default2(y2);
    function line(data) {
      var i, n = (data = array_default(data)).length, d, defined0 = false, buffer;
      if (context == null) output = curve(buffer = path2());
      for (i = 0; i <= n; ++i) {
        if (!(i < n && defined3(d = data[i], i, data)) === defined0) {
          if (defined0 = !defined0) output.lineStart();
          else output.lineEnd();
        }
        if (defined0) output.point(+x2(d, i, data), +y2(d, i, data));
      }
      if (buffer) return output = null, buffer + "" || null;
    }
    line.x = function(_113) {
      return arguments.length ? (x2 = typeof _113 === "function" ? _113 : constant_default2(+_113), line) : x2;
    };
    line.y = function(_113) {
      return arguments.length ? (y2 = typeof _113 === "function" ? _113 : constant_default2(+_113), line) : y2;
    };
    line.defined = function(_113) {
      return arguments.length ? (defined3 = typeof _113 === "function" ? _113 : constant_default2(!!_113), line) : defined3;
    };
    line.curve = function(_113) {
      return arguments.length ? (curve = _113, context != null && (output = curve(context)), line) : curve;
    };
    line.context = function(_113) {
      return arguments.length ? (_113 == null ? context = output = null : output = curve(context = _113), line) : context;
    };
    return line;
  }

  // node_modules/d3-shape/src/area.js
  function area_default(x0, y0, y1) {
    var x1 = null, defined3 = constant_default2(true), context = null, curve = linear_default, output = null, path2 = withPath(area);
    x0 = typeof x0 === "function" ? x0 : x0 === void 0 ? x : constant_default2(+x0);
    y0 = typeof y0 === "function" ? y0 : y0 === void 0 ? constant_default2(0) : constant_default2(+y0);
    y1 = typeof y1 === "function" ? y1 : y1 === void 0 ? y : constant_default2(+y1);
    function area(data) {
      var i, j, k2, n = (data = array_default(data)).length, d, defined0 = false, buffer, x0z = new Array(n), y0z = new Array(n);
      if (context == null) output = curve(buffer = path2());
      for (i = 0; i <= n; ++i) {
        if (!(i < n && defined3(d = data[i], i, data)) === defined0) {
          if (defined0 = !defined0) {
            j = i;
            output.areaStart();
            output.lineStart();
          } else {
            output.lineEnd();
            output.lineStart();
            for (k2 = i - 1; k2 >= j; --k2) {
              output.point(x0z[k2], y0z[k2]);
            }
            output.lineEnd();
            output.areaEnd();
          }
        }
        if (defined0) {
          x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);
          output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);
        }
      }
      if (buffer) return output = null, buffer + "" || null;
    }
    function arealine() {
      return line_default().defined(defined3).curve(curve).context(context);
    }
    area.x = function(_113) {
      return arguments.length ? (x0 = typeof _113 === "function" ? _113 : constant_default2(+_113), x1 = null, area) : x0;
    };
    area.x0 = function(_113) {
      return arguments.length ? (x0 = typeof _113 === "function" ? _113 : constant_default2(+_113), area) : x0;
    };
    area.x1 = function(_113) {
      return arguments.length ? (x1 = _113 == null ? null : typeof _113 === "function" ? _113 : constant_default2(+_113), area) : x1;
    };
    area.y = function(_113) {
      return arguments.length ? (y0 = typeof _113 === "function" ? _113 : constant_default2(+_113), y1 = null, area) : y0;
    };
    area.y0 = function(_113) {
      return arguments.length ? (y0 = typeof _113 === "function" ? _113 : constant_default2(+_113), area) : y0;
    };
    area.y1 = function(_113) {
      return arguments.length ? (y1 = _113 == null ? null : typeof _113 === "function" ? _113 : constant_default2(+_113), area) : y1;
    };
    area.lineX0 = area.lineY0 = function() {
      return arealine().x(x0).y(y0);
    };
    area.lineY1 = function() {
      return arealine().x(x0).y(y1);
    };
    area.lineX1 = function() {
      return arealine().x(x1).y(y0);
    };
    area.defined = function(_113) {
      return arguments.length ? (defined3 = typeof _113 === "function" ? _113 : constant_default2(!!_113), area) : defined3;
    };
    area.curve = function(_113) {
      return arguments.length ? (curve = _113, context != null && (output = curve(context)), area) : curve;
    };
    area.context = function(_113) {
      return arguments.length ? (_113 == null ? context = output = null : output = curve(context = _113), area) : context;
    };
    return area;
  }

  // node_modules/d3-shape/src/descending.js
  function descending_default(a2, b) {
    return b < a2 ? -1 : b > a2 ? 1 : b >= a2 ? 0 : NaN;
  }

  // node_modules/d3-shape/src/identity.js
  function identity_default2(d) {
    return d;
  }

  // node_modules/d3-shape/src/pie.js
  function pie_default() {
    var value = identity_default2, sortValues = descending_default, sort = null, startAngle = constant_default2(0), endAngle = constant_default2(tau2), padAngle = constant_default2(0);
    function pie(data) {
      var i, n = (data = array_default(data)).length, j, k2, sum3 = 0, index = new Array(n), arcs = new Array(n), a0 = +startAngle.apply(this, arguments), da = Math.min(tau2, Math.max(-tau2, endAngle.apply(this, arguments) - a0)), a1, p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)), pa = p * (da < 0 ? -1 : 1), v;
      for (i = 0; i < n; ++i) {
        if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {
          sum3 += v;
        }
      }
      if (sortValues != null) index.sort(function(i2, j2) {
        return sortValues(arcs[i2], arcs[j2]);
      });
      else if (sort != null) index.sort(function(i2, j2) {
        return sort(data[i2], data[j2]);
      });
      for (i = 0, k2 = sum3 ? (da - n * pa) / sum3 : 0; i < n; ++i, a0 = a1) {
        j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k2 : 0) + pa, arcs[j] = {
          data: data[j],
          index: i,
          value: v,
          startAngle: a0,
          endAngle: a1,
          padAngle: p
        };
      }
      return arcs;
    }
    pie.value = function(_113) {
      return arguments.length ? (value = typeof _113 === "function" ? _113 : constant_default2(+_113), pie) : value;
    };
    pie.sortValues = function(_113) {
      return arguments.length ? (sortValues = _113, sort = null, pie) : sortValues;
    };
    pie.sort = function(_113) {
      return arguments.length ? (sort = _113, sortValues = null, pie) : sort;
    };
    pie.startAngle = function(_113) {
      return arguments.length ? (startAngle = typeof _113 === "function" ? _113 : constant_default2(+_113), pie) : startAngle;
    };
    pie.endAngle = function(_113) {
      return arguments.length ? (endAngle = typeof _113 === "function" ? _113 : constant_default2(+_113), pie) : endAngle;
    };
    pie.padAngle = function(_113) {
      return arguments.length ? (padAngle = typeof _113 === "function" ? _113 : constant_default2(+_113), pie) : padAngle;
    };
    return pie;
  }

  // node_modules/d3-shape/src/curve/radial.js
  var curveRadialLinear = curveRadial(linear_default);
  function Radial(curve) {
    this._curve = curve;
  }
  Radial.prototype = {
    areaStart: function() {
      this._curve.areaStart();
    },
    areaEnd: function() {
      this._curve.areaEnd();
    },
    lineStart: function() {
      this._curve.lineStart();
    },
    lineEnd: function() {
      this._curve.lineEnd();
    },
    point: function(a2, r) {
      this._curve.point(r * Math.sin(a2), r * -Math.cos(a2));
    }
  };
  function curveRadial(curve) {
    function radial2(context) {
      return new Radial(curve(context));
    }
    radial2._curve = curve;
    return radial2;
  }

  // node_modules/d3-shape/src/lineRadial.js
  function lineRadial(l) {
    var c2 = l.curve;
    l.angle = l.x, delete l.x;
    l.radius = l.y, delete l.y;
    l.curve = function(_113) {
      return arguments.length ? c2(curveRadial(_113)) : c2()._curve;
    };
    return l;
  }
  function lineRadial_default() {
    return lineRadial(line_default().curve(curveRadialLinear));
  }

  // node_modules/d3-shape/src/areaRadial.js
  function areaRadial_default() {
    var a2 = area_default().curve(curveRadialLinear), c2 = a2.curve, x0 = a2.lineX0, x1 = a2.lineX1, y0 = a2.lineY0, y1 = a2.lineY1;
    a2.angle = a2.x, delete a2.x;
    a2.startAngle = a2.x0, delete a2.x0;
    a2.endAngle = a2.x1, delete a2.x1;
    a2.radius = a2.y, delete a2.y;
    a2.innerRadius = a2.y0, delete a2.y0;
    a2.outerRadius = a2.y1, delete a2.y1;
    a2.lineStartAngle = function() {
      return lineRadial(x0());
    }, delete a2.lineX0;
    a2.lineEndAngle = function() {
      return lineRadial(x1());
    }, delete a2.lineX1;
    a2.lineInnerRadius = function() {
      return lineRadial(y0());
    }, delete a2.lineY0;
    a2.lineOuterRadius = function() {
      return lineRadial(y1());
    }, delete a2.lineY1;
    a2.curve = function(_113) {
      return arguments.length ? c2(curveRadial(_113)) : c2()._curve;
    };
    return a2;
  }

  // node_modules/d3-shape/src/pointRadial.js
  function pointRadial_default(x2, y2) {
    return [(y2 = +y2) * Math.cos(x2 -= Math.PI / 2), y2 * Math.sin(x2)];
  }

  // node_modules/d3-shape/src/curve/bump.js
  var Bump = class {
    constructor(context, x2) {
      this._context = context;
      this._x = x2;
    }
    areaStart() {
      this._line = 0;
    }
    areaEnd() {
      this._line = NaN;
    }
    lineStart() {
      this._point = 0;
    }
    lineEnd() {
      if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
      this._line = 1 - this._line;
    }
    point(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0: {
          this._point = 1;
          if (this._line) this._context.lineTo(x2, y2);
          else this._context.moveTo(x2, y2);
          break;
        }
        case 1:
          this._point = 2;
        // falls through
        default: {
          if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x2) / 2, this._y0, this._x0, y2, x2, y2);
          else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y2) / 2, x2, this._y0, x2, y2);
          break;
        }
      }
      this._x0 = x2, this._y0 = y2;
    }
  };
  var BumpRadial = class {
    constructor(context) {
      this._context = context;
    }
    lineStart() {
      this._point = 0;
    }
    lineEnd() {
    }
    point(x2, y2) {
      x2 = +x2, y2 = +y2;
      if (this._point === 0) {
        this._point = 1;
      } else {
        const p0 = pointRadial_default(this._x0, this._y0);
        const p1 = pointRadial_default(this._x0, this._y0 = (this._y0 + y2) / 2);
        const p2 = pointRadial_default(x2, this._y0);
        const p3 = pointRadial_default(x2, y2);
        this._context.moveTo(...p0);
        this._context.bezierCurveTo(...p1, ...p2, ...p3);
      }
      this._x0 = x2, this._y0 = y2;
    }
  };
  function bumpX(context) {
    return new Bump(context, true);
  }
  function bumpY(context) {
    return new Bump(context, false);
  }
  function bumpRadial(context) {
    return new BumpRadial(context);
  }

  // node_modules/d3-shape/src/link.js
  function linkSource(d) {
    return d.source;
  }
  function linkTarget(d) {
    return d.target;
  }
  function link(curve) {
    let source = linkSource, target = linkTarget, x2 = x, y2 = y, context = null, output = null, path2 = withPath(link2);
    function link2() {
      let buffer;
      const argv = slice.call(arguments);
      const s2 = source.apply(this, argv);
      const t = target.apply(this, argv);
      if (context == null) output = curve(buffer = path2());
      output.lineStart();
      argv[0] = s2, output.point(+x2.apply(this, argv), +y2.apply(this, argv));
      argv[0] = t, output.point(+x2.apply(this, argv), +y2.apply(this, argv));
      output.lineEnd();
      if (buffer) return output = null, buffer + "" || null;
    }
    link2.source = function(_113) {
      return arguments.length ? (source = _113, link2) : source;
    };
    link2.target = function(_113) {
      return arguments.length ? (target = _113, link2) : target;
    };
    link2.x = function(_113) {
      return arguments.length ? (x2 = typeof _113 === "function" ? _113 : constant_default2(+_113), link2) : x2;
    };
    link2.y = function(_113) {
      return arguments.length ? (y2 = typeof _113 === "function" ? _113 : constant_default2(+_113), link2) : y2;
    };
    link2.context = function(_113) {
      return arguments.length ? (_113 == null ? context = output = null : output = curve(context = _113), link2) : context;
    };
    return link2;
  }
  function linkHorizontal() {
    return link(bumpX);
  }
  function linkVertical() {
    return link(bumpY);
  }
  function linkRadial() {
    const l = link(bumpRadial);
    l.angle = l.x, delete l.x;
    l.radius = l.y, delete l.y;
    return l;
  }

  // node_modules/d3-shape/src/symbol/asterisk.js
  var sqrt3 = sqrt2(3);
  var asterisk_default = {
    draw(context, size) {
      const r = sqrt2(size + min2(size / 28, 0.75)) * 0.59436;
      const t = r / 2;
      const u = t * sqrt3;
      context.moveTo(0, r);
      context.lineTo(0, -r);
      context.moveTo(-u, -t);
      context.lineTo(u, t);
      context.moveTo(-u, t);
      context.lineTo(u, -t);
    }
  };

  // node_modules/d3-shape/src/symbol/circle.js
  var circle_default = {
    draw(context, size) {
      const r = sqrt2(size / pi2);
      context.moveTo(r, 0);
      context.arc(0, 0, r, 0, tau2);
    }
  };

  // node_modules/d3-shape/src/symbol/cross.js
  var cross_default = {
    draw(context, size) {
      const r = sqrt2(size / 5) / 2;
      context.moveTo(-3 * r, -r);
      context.lineTo(-r, -r);
      context.lineTo(-r, -3 * r);
      context.lineTo(r, -3 * r);
      context.lineTo(r, -r);
      context.lineTo(3 * r, -r);
      context.lineTo(3 * r, r);
      context.lineTo(r, r);
      context.lineTo(r, 3 * r);
      context.lineTo(-r, 3 * r);
      context.lineTo(-r, r);
      context.lineTo(-3 * r, r);
      context.closePath();
    }
  };

  // node_modules/d3-shape/src/symbol/diamond.js
  var tan30 = sqrt2(1 / 3);
  var tan30_2 = tan30 * 2;
  var diamond_default = {
    draw(context, size) {
      const y2 = sqrt2(size / tan30_2);
      const x2 = y2 * tan30;
      context.moveTo(0, -y2);
      context.lineTo(x2, 0);
      context.lineTo(0, y2);
      context.lineTo(-x2, 0);
      context.closePath();
    }
  };

  // node_modules/d3-shape/src/symbol/diamond2.js
  var diamond2_default = {
    draw(context, size) {
      const r = sqrt2(size) * 0.62625;
      context.moveTo(0, -r);
      context.lineTo(r, 0);
      context.lineTo(0, r);
      context.lineTo(-r, 0);
      context.closePath();
    }
  };

  // node_modules/d3-shape/src/symbol/plus.js
  var plus_default = {
    draw(context, size) {
      const r = sqrt2(size - min2(size / 7, 2)) * 0.87559;
      context.moveTo(-r, 0);
      context.lineTo(r, 0);
      context.moveTo(0, r);
      context.lineTo(0, -r);
    }
  };

  // node_modules/d3-shape/src/symbol/square.js
  var square_default = {
    draw(context, size) {
      const w = sqrt2(size);
      const x2 = -w / 2;
      context.rect(x2, x2, w, w);
    }
  };

  // node_modules/d3-shape/src/symbol/square2.js
  var square2_default = {
    draw(context, size) {
      const r = sqrt2(size) * 0.4431;
      context.moveTo(r, r);
      context.lineTo(r, -r);
      context.lineTo(-r, -r);
      context.lineTo(-r, r);
      context.closePath();
    }
  };

  // node_modules/d3-shape/src/symbol/star.js
  var ka = 0.8908130915292852;
  var kr = sin(pi2 / 10) / sin(7 * pi2 / 10);
  var kx = sin(tau2 / 10) * kr;
  var ky = -cos(tau2 / 10) * kr;
  var star_default = {
    draw(context, size) {
      const r = sqrt2(size * ka);
      const x2 = kx * r;
      const y2 = ky * r;
      context.moveTo(0, -r);
      context.lineTo(x2, y2);
      for (let i = 1; i < 5; ++i) {
        const a2 = tau2 * i / 5;
        const c2 = cos(a2);
        const s2 = sin(a2);
        context.lineTo(s2 * r, -c2 * r);
        context.lineTo(c2 * x2 - s2 * y2, s2 * x2 + c2 * y2);
      }
      context.closePath();
    }
  };

  // node_modules/d3-shape/src/symbol/triangle.js
  var sqrt32 = sqrt2(3);
  var triangle_default = {
    draw(context, size) {
      const y2 = -sqrt2(size / (sqrt32 * 3));
      context.moveTo(0, y2 * 2);
      context.lineTo(-sqrt32 * y2, -y2);
      context.lineTo(sqrt32 * y2, -y2);
      context.closePath();
    }
  };

  // node_modules/d3-shape/src/symbol/triangle2.js
  var sqrt33 = sqrt2(3);
  var triangle2_default = {
    draw(context, size) {
      const s2 = sqrt2(size) * 0.6824;
      const t = s2 / 2;
      const u = s2 * sqrt33 / 2;
      context.moveTo(0, -s2);
      context.lineTo(u, t);
      context.lineTo(-u, t);
      context.closePath();
    }
  };

  // node_modules/d3-shape/src/symbol/wye.js
  var c = -0.5;
  var s = sqrt2(3) / 2;
  var k = 1 / sqrt2(12);
  var a = (k / 2 + 1) * 3;
  var wye_default = {
    draw(context, size) {
      const r = sqrt2(size / a);
      const x0 = r / 2, y0 = r * k;
      const x1 = x0, y1 = r * k + r;
      const x2 = -x1, y2 = y1;
      context.moveTo(x0, y0);
      context.lineTo(x1, y1);
      context.lineTo(x2, y2);
      context.lineTo(c * x0 - s * y0, s * x0 + c * y0);
      context.lineTo(c * x1 - s * y1, s * x1 + c * y1);
      context.lineTo(c * x2 - s * y2, s * x2 + c * y2);
      context.lineTo(c * x0 + s * y0, c * y0 - s * x0);
      context.lineTo(c * x1 + s * y1, c * y1 - s * x1);
      context.lineTo(c * x2 + s * y2, c * y2 - s * x2);
      context.closePath();
    }
  };

  // node_modules/d3-shape/src/symbol/times.js
  var times_default = {
    draw(context, size) {
      const r = sqrt2(size - min2(size / 6, 1.7)) * 0.6189;
      context.moveTo(-r, -r);
      context.lineTo(r, r);
      context.moveTo(-r, r);
      context.lineTo(r, -r);
    }
  };

  // node_modules/d3-shape/src/symbol.js
  var symbolsFill = [
    circle_default,
    cross_default,
    diamond_default,
    square_default,
    star_default,
    triangle_default,
    wye_default
  ];
  var symbolsStroke = [
    circle_default,
    plus_default,
    times_default,
    triangle2_default,
    asterisk_default,
    square2_default,
    diamond2_default
  ];
  function Symbol2(type, size) {
    let context = null, path2 = withPath(symbol);
    type = typeof type === "function" ? type : constant_default2(type || circle_default);
    size = typeof size === "function" ? size : constant_default2(size === void 0 ? 64 : +size);
    function symbol() {
      let buffer;
      if (!context) context = buffer = path2();
      type.apply(this, arguments).draw(context, +size.apply(this, arguments));
      if (buffer) return context = null, buffer + "" || null;
    }
    symbol.type = function(_113) {
      return arguments.length ? (type = typeof _113 === "function" ? _113 : constant_default2(_113), symbol) : type;
    };
    symbol.size = function(_113) {
      return arguments.length ? (size = typeof _113 === "function" ? _113 : constant_default2(+_113), symbol) : size;
    };
    symbol.context = function(_113) {
      return arguments.length ? (context = _113 == null ? null : _113, symbol) : context;
    };
    return symbol;
  }

  // node_modules/d3-shape/src/noop.js
  function noop_default() {
  }

  // node_modules/d3-shape/src/curve/basis.js
  function point2(that, x2, y2) {
    that._context.bezierCurveTo(
      (2 * that._x0 + that._x1) / 3,
      (2 * that._y0 + that._y1) / 3,
      (that._x0 + 2 * that._x1) / 3,
      (that._y0 + 2 * that._y1) / 3,
      (that._x0 + 4 * that._x1 + x2) / 6,
      (that._y0 + 4 * that._y1 + y2) / 6
    );
  }
  function Basis(context) {
    this._context = context;
  }
  Basis.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x0 = this._x1 = this._y0 = this._y1 = NaN;
      this._point = 0;
    },
    lineEnd: function() {
      switch (this._point) {
        case 3:
          point2(this, this._x1, this._y1);
        // falls through
        case 2:
          this._context.lineTo(this._x1, this._y1);
          break;
      }
      if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
      this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3;
          this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6);
        // falls through
        default:
          point2(this, x2, y2);
          break;
      }
      this._x0 = this._x1, this._x1 = x2;
      this._y0 = this._y1, this._y1 = y2;
    }
  };
  function basis_default2(context) {
    return new Basis(context);
  }

  // node_modules/d3-shape/src/curve/basisClosed.js
  function BasisClosed(context) {
    this._context = context;
  }
  BasisClosed.prototype = {
    areaStart: noop_default,
    areaEnd: noop_default,
    lineStart: function() {
      this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;
      this._point = 0;
    },
    lineEnd: function() {
      switch (this._point) {
        case 1: {
          this._context.moveTo(this._x2, this._y2);
          this._context.closePath();
          break;
        }
        case 2: {
          this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);
          this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);
          this._context.closePath();
          break;
        }
        case 3: {
          this.point(this._x2, this._y2);
          this.point(this._x3, this._y3);
          this.point(this._x4, this._y4);
          break;
        }
      }
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._x2 = x2, this._y2 = y2;
          break;
        case 1:
          this._point = 2;
          this._x3 = x2, this._y3 = y2;
          break;
        case 2:
          this._point = 3;
          this._x4 = x2, this._y4 = y2;
          this._context.moveTo((this._x0 + 4 * this._x1 + x2) / 6, (this._y0 + 4 * this._y1 + y2) / 6);
          break;
        default:
          point2(this, x2, y2);
          break;
      }
      this._x0 = this._x1, this._x1 = x2;
      this._y0 = this._y1, this._y1 = y2;
    }
  };
  function basisClosed_default2(context) {
    return new BasisClosed(context);
  }

  // node_modules/d3-shape/src/curve/basisOpen.js
  function BasisOpen(context) {
    this._context = context;
  }
  BasisOpen.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x0 = this._x1 = this._y0 = this._y1 = NaN;
      this._point = 0;
    },
    lineEnd: function() {
      if (this._line || this._line !== 0 && this._point === 3) this._context.closePath();
      this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3;
          var x0 = (this._x0 + 4 * this._x1 + x2) / 6, y0 = (this._y0 + 4 * this._y1 + y2) / 6;
          this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0);
          break;
        case 3:
          this._point = 4;
        // falls through
        default:
          point2(this, x2, y2);
          break;
      }
      this._x0 = this._x1, this._x1 = x2;
      this._y0 = this._y1, this._y1 = y2;
    }
  };
  function basisOpen_default(context) {
    return new BasisOpen(context);
  }

  // node_modules/d3-shape/src/curve/bundle.js
  function Bundle(context, beta) {
    this._basis = new Basis(context);
    this._beta = beta;
  }
  Bundle.prototype = {
    lineStart: function() {
      this._x = [];
      this._y = [];
      this._basis.lineStart();
    },
    lineEnd: function() {
      var x2 = this._x, y2 = this._y, j = x2.length - 1;
      if (j > 0) {
        var x0 = x2[0], y0 = y2[0], dx = x2[j] - x0, dy = y2[j] - y0, i = -1, t;
        while (++i <= j) {
          t = i / j;
          this._basis.point(
            this._beta * x2[i] + (1 - this._beta) * (x0 + t * dx),
            this._beta * y2[i] + (1 - this._beta) * (y0 + t * dy)
          );
        }
      }
      this._x = this._y = null;
      this._basis.lineEnd();
    },
    point: function(x2, y2) {
      this._x.push(+x2);
      this._y.push(+y2);
    }
  };
  var bundle_default = function custom10(beta) {
    function bundle(context) {
      return beta === 1 ? new Basis(context) : new Bundle(context, beta);
    }
    bundle.beta = function(beta2) {
      return custom10(+beta2);
    };
    return bundle;
  }(0.85);

  // node_modules/d3-shape/src/curve/cardinal.js
  function point3(that, x2, y2) {
    that._context.bezierCurveTo(
      that._x1 + that._k * (that._x2 - that._x0),
      that._y1 + that._k * (that._y2 - that._y0),
      that._x2 + that._k * (that._x1 - x2),
      that._y2 + that._k * (that._y1 - y2),
      that._x2,
      that._y2
    );
  }
  function Cardinal(context, tension) {
    this._context = context;
    this._k = (1 - tension) / 6;
  }
  Cardinal.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
      this._point = 0;
    },
    lineEnd: function() {
      switch (this._point) {
        case 2:
          this._context.lineTo(this._x2, this._y2);
          break;
        case 3:
          point3(this, this._x1, this._y1);
          break;
      }
      if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
      this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
          break;
        case 1:
          this._point = 2;
          this._x1 = x2, this._y1 = y2;
          break;
        case 2:
          this._point = 3;
        // falls through
        default:
          point3(this, x2, y2);
          break;
      }
      this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
      this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
    }
  };
  var cardinal_default = function custom11(tension) {
    function cardinal(context) {
      return new Cardinal(context, tension);
    }
    cardinal.tension = function(tension2) {
      return custom11(+tension2);
    };
    return cardinal;
  }(0);

  // node_modules/d3-shape/src/curve/cardinalClosed.js
  function CardinalClosed(context, tension) {
    this._context = context;
    this._k = (1 - tension) / 6;
  }
  CardinalClosed.prototype = {
    areaStart: noop_default,
    areaEnd: noop_default,
    lineStart: function() {
      this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
      this._point = 0;
    },
    lineEnd: function() {
      switch (this._point) {
        case 1: {
          this._context.moveTo(this._x3, this._y3);
          this._context.closePath();
          break;
        }
        case 2: {
          this._context.lineTo(this._x3, this._y3);
          this._context.closePath();
          break;
        }
        case 3: {
          this.point(this._x3, this._y3);
          this.point(this._x4, this._y4);
          this.point(this._x5, this._y5);
          break;
        }
      }
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._x3 = x2, this._y3 = y2;
          break;
        case 1:
          this._point = 2;
          this._context.moveTo(this._x4 = x2, this._y4 = y2);
          break;
        case 2:
          this._point = 3;
          this._x5 = x2, this._y5 = y2;
          break;
        default:
          point3(this, x2, y2);
          break;
      }
      this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
      this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
    }
  };
  var cardinalClosed_default = function custom12(tension) {
    function cardinal(context) {
      return new CardinalClosed(context, tension);
    }
    cardinal.tension = function(tension2) {
      return custom12(+tension2);
    };
    return cardinal;
  }(0);

  // node_modules/d3-shape/src/curve/cardinalOpen.js
  function CardinalOpen(context, tension) {
    this._context = context;
    this._k = (1 - tension) / 6;
  }
  CardinalOpen.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
      this._point = 0;
    },
    lineEnd: function() {
      if (this._line || this._line !== 0 && this._point === 3) this._context.closePath();
      this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3;
          this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
          break;
        case 3:
          this._point = 4;
        // falls through
        default:
          point3(this, x2, y2);
          break;
      }
      this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
      this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
    }
  };
  var cardinalOpen_default = function custom13(tension) {
    function cardinal(context) {
      return new CardinalOpen(context, tension);
    }
    cardinal.tension = function(tension2) {
      return custom13(+tension2);
    };
    return cardinal;
  }(0);

  // node_modules/d3-shape/src/curve/catmullRom.js
  function point4(that, x2, y2) {
    var x1 = that._x1, y1 = that._y1, x22 = that._x2, y22 = that._y2;
    if (that._l01_a > epsilon) {
      var a2 = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a, n = 3 * that._l01_a * (that._l01_a + that._l12_a);
      x1 = (x1 * a2 - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;
      y1 = (y1 * a2 - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;
    }
    if (that._l23_a > epsilon) {
      var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a, m = 3 * that._l23_a * (that._l23_a + that._l12_a);
      x22 = (x22 * b + that._x1 * that._l23_2a - x2 * that._l12_2a) / m;
      y22 = (y22 * b + that._y1 * that._l23_2a - y2 * that._l12_2a) / m;
    }
    that._context.bezierCurveTo(x1, y1, x22, y22, that._x2, that._y2);
  }
  function CatmullRom(context, alpha) {
    this._context = context;
    this._alpha = alpha;
  }
  CatmullRom.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
      this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
    },
    lineEnd: function() {
      switch (this._point) {
        case 2:
          this._context.lineTo(this._x2, this._y2);
          break;
        case 3:
          this.point(this._x2, this._y2);
          break;
      }
      if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
      this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      if (this._point) {
        var x23 = this._x2 - x2, y23 = this._y2 - y2;
        this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
      }
      switch (this._point) {
        case 0:
          this._point = 1;
          this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3;
        // falls through
        default:
          point4(this, x2, y2);
          break;
      }
      this._l01_a = this._l12_a, this._l12_a = this._l23_a;
      this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
      this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
      this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
    }
  };
  var catmullRom_default = function custom14(alpha) {
    function catmullRom(context) {
      return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);
    }
    catmullRom.alpha = function(alpha2) {
      return custom14(+alpha2);
    };
    return catmullRom;
  }(0.5);

  // node_modules/d3-shape/src/curve/catmullRomClosed.js
  function CatmullRomClosed(context, alpha) {
    this._context = context;
    this._alpha = alpha;
  }
  CatmullRomClosed.prototype = {
    areaStart: noop_default,
    areaEnd: noop_default,
    lineStart: function() {
      this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
      this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
    },
    lineEnd: function() {
      switch (this._point) {
        case 1: {
          this._context.moveTo(this._x3, this._y3);
          this._context.closePath();
          break;
        }
        case 2: {
          this._context.lineTo(this._x3, this._y3);
          this._context.closePath();
          break;
        }
        case 3: {
          this.point(this._x3, this._y3);
          this.point(this._x4, this._y4);
          this.point(this._x5, this._y5);
          break;
        }
      }
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      if (this._point) {
        var x23 = this._x2 - x2, y23 = this._y2 - y2;
        this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
      }
      switch (this._point) {
        case 0:
          this._point = 1;
          this._x3 = x2, this._y3 = y2;
          break;
        case 1:
          this._point = 2;
          this._context.moveTo(this._x4 = x2, this._y4 = y2);
          break;
        case 2:
          this._point = 3;
          this._x5 = x2, this._y5 = y2;
          break;
        default:
          point4(this, x2, y2);
          break;
      }
      this._l01_a = this._l12_a, this._l12_a = this._l23_a;
      this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
      this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
      this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
    }
  };
  var catmullRomClosed_default = function custom15(alpha) {
    function catmullRom(context) {
      return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);
    }
    catmullRom.alpha = function(alpha2) {
      return custom15(+alpha2);
    };
    return catmullRom;
  }(0.5);

  // node_modules/d3-shape/src/curve/catmullRomOpen.js
  function CatmullRomOpen(context, alpha) {
    this._context = context;
    this._alpha = alpha;
  }
  CatmullRomOpen.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
      this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
    },
    lineEnd: function() {
      if (this._line || this._line !== 0 && this._point === 3) this._context.closePath();
      this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      if (this._point) {
        var x23 = this._x2 - x2, y23 = this._y2 - y2;
        this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
      }
      switch (this._point) {
        case 0:
          this._point = 1;
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3;
          this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
          break;
        case 3:
          this._point = 4;
        // falls through
        default:
          point4(this, x2, y2);
          break;
      }
      this._l01_a = this._l12_a, this._l12_a = this._l23_a;
      this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
      this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2;
      this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2;
    }
  };
  var catmullRomOpen_default = function custom16(alpha) {
    function catmullRom(context) {
      return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);
    }
    catmullRom.alpha = function(alpha2) {
      return custom16(+alpha2);
    };
    return catmullRom;
  }(0.5);

  // node_modules/d3-shape/src/curve/linearClosed.js
  function LinearClosed(context) {
    this._context = context;
  }
  LinearClosed.prototype = {
    areaStart: noop_default,
    areaEnd: noop_default,
    lineStart: function() {
      this._point = 0;
    },
    lineEnd: function() {
      if (this._point) this._context.closePath();
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      if (this._point) this._context.lineTo(x2, y2);
      else this._point = 1, this._context.moveTo(x2, y2);
    }
  };
  function linearClosed_default(context) {
    return new LinearClosed(context);
  }

  // node_modules/d3-shape/src/curve/monotone.js
  function sign(x2) {
    return x2 < 0 ? -1 : 1;
  }
  function slope3(that, x2, y2) {
    var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), p = (s0 * h1 + s1 * h0) / (h0 + h1);
    return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;
  }
  function slope2(that, t) {
    var h = that._x1 - that._x0;
    return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;
  }
  function point5(that, t02, t12) {
    var x0 = that._x0, y0 = that._y0, x1 = that._x1, y1 = that._y1, dx = (x1 - x0) / 3;
    that._context.bezierCurveTo(x0 + dx, y0 + dx * t02, x1 - dx, y1 - dx * t12, x1, y1);
  }
  function MonotoneX(context) {
    this._context = context;
  }
  MonotoneX.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN;
      this._point = 0;
    },
    lineEnd: function() {
      switch (this._point) {
        case 2:
          this._context.lineTo(this._x1, this._y1);
          break;
        case 3:
          point5(this, this._t0, slope2(this, this._t0));
          break;
      }
      if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
      this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      var t12 = NaN;
      x2 = +x2, y2 = +y2;
      if (x2 === this._x1 && y2 === this._y1) return;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3;
          point5(this, slope2(this, t12 = slope3(this, x2, y2)), t12);
          break;
        default:
          point5(this, this._t0, t12 = slope3(this, x2, y2));
          break;
      }
      this._x0 = this._x1, this._x1 = x2;
      this._y0 = this._y1, this._y1 = y2;
      this._t0 = t12;
    }
  };
  function MonotoneY(context) {
    this._context = new ReflectContext(context);
  }
  (MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x2, y2) {
    MonotoneX.prototype.point.call(this, y2, x2);
  };
  function ReflectContext(context) {
    this._context = context;
  }
  ReflectContext.prototype = {
    moveTo: function(x2, y2) {
      this._context.moveTo(y2, x2);
    },
    closePath: function() {
      this._context.closePath();
    },
    lineTo: function(x2, y2) {
      this._context.lineTo(y2, x2);
    },
    bezierCurveTo: function(x1, y1, x2, y2, x3, y3) {
      this._context.bezierCurveTo(y1, x1, y2, x2, y3, x3);
    }
  };
  function monotoneX(context) {
    return new MonotoneX(context);
  }
  function monotoneY(context) {
    return new MonotoneY(context);
  }

  // node_modules/d3-shape/src/curve/natural.js
  function Natural(context) {
    this._context = context;
  }
  Natural.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x = [];
      this._y = [];
    },
    lineEnd: function() {
      var x2 = this._x, y2 = this._y, n = x2.length;
      if (n) {
        this._line ? this._context.lineTo(x2[0], y2[0]) : this._context.moveTo(x2[0], y2[0]);
        if (n === 2) {
          this._context.lineTo(x2[1], y2[1]);
        } else {
          var px = controlPoints(x2), py = controlPoints(y2);
          for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {
            this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x2[i1], y2[i1]);
          }
        }
      }
      if (this._line || this._line !== 0 && n === 1) this._context.closePath();
      this._line = 1 - this._line;
      this._x = this._y = null;
    },
    point: function(x2, y2) {
      this._x.push(+x2);
      this._y.push(+y2);
    }
  };
  function controlPoints(x2) {
    var i, n = x2.length - 1, m, a2 = new Array(n), b = new Array(n), r = new Array(n);
    a2[0] = 0, b[0] = 2, r[0] = x2[0] + 2 * x2[1];
    for (i = 1; i < n - 1; ++i) a2[i] = 1, b[i] = 4, r[i] = 4 * x2[i] + 2 * x2[i + 1];
    a2[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x2[n - 1] + x2[n];
    for (i = 1; i < n; ++i) m = a2[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];
    a2[n - 1] = r[n - 1] / b[n - 1];
    for (i = n - 2; i >= 0; --i) a2[i] = (r[i] - a2[i + 1]) / b[i];
    b[n - 1] = (x2[n] + a2[n - 1]) / 2;
    for (i = 0; i < n - 1; ++i) b[i] = 2 * x2[i + 1] - a2[i + 1];
    return [a2, b];
  }
  function natural_default(context) {
    return new Natural(context);
  }

  // node_modules/d3-shape/src/curve/step.js
  function Step(context, t) {
    this._context = context;
    this._t = t;
  }
  Step.prototype = {
    areaStart: function() {
      this._line = 0;
    },
    areaEnd: function() {
      this._line = NaN;
    },
    lineStart: function() {
      this._x = this._y = NaN;
      this._point = 0;
    },
    lineEnd: function() {
      if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);
      if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
      if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;
    },
    point: function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
          break;
        case 1:
          this._point = 2;
        // falls through
        default: {
          if (this._t <= 0) {
            this._context.lineTo(this._x, y2);
            this._context.lineTo(x2, y2);
          } else {
            var x1 = this._x * (1 - this._t) + x2 * this._t;
            this._context.lineTo(x1, this._y);
            this._context.lineTo(x1, y2);
          }
          break;
        }
      }
      this._x = x2, this._y = y2;
    }
  };
  function step_default(context) {
    return new Step(context, 0.5);
  }
  function stepBefore(context) {
    return new Step(context, 0);
  }
  function stepAfter(context) {
    return new Step(context, 1);
  }

  // node_modules/d3-shape/src/offset/none.js
  function none_default(series, order2) {
    if (!((n = series.length) > 1)) return;
    for (var i = 1, j, s0, s1 = series[order2[0]], n, m = s1.length; i < n; ++i) {
      s0 = s1, s1 = series[order2[i]];
      for (j = 0; j < m; ++j) {
        s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];
      }
    }
  }

  // node_modules/d3-shape/src/order/none.js
  function none_default2(series) {
    var n = series.length, o = new Array(n);
    while (--n >= 0) o[n] = n;
    return o;
  }

  // node_modules/d3-shape/src/stack.js
  function stackValue(d, key) {
    return d[key];
  }
  function stackSeries(key) {
    const series = [];
    series.key = key;
    return series;
  }
  function stack_default() {
    var keys = constant_default2([]), order2 = none_default2, offset2 = none_default, value = stackValue;
    function stack(data) {
      var sz = Array.from(keys.apply(this, arguments), stackSeries), i, n = sz.length, j = -1, oz;
      for (const d of data) {
        for (i = 0, ++j; i < n; ++i) {
          (sz[i][j] = [0, +value(d, sz[i].key, j, data)]).data = d;
        }
      }
      for (i = 0, oz = array_default(order2(sz)); i < n; ++i) {
        sz[oz[i]].index = i;
      }
      offset2(sz, oz);
      return sz;
    }
    stack.keys = function(_113) {
      return arguments.length ? (keys = typeof _113 === "function" ? _113 : constant_default2(Array.from(_113)), stack) : keys;
    };
    stack.value = function(_113) {
      return arguments.length ? (value = typeof _113 === "function" ? _113 : constant_default2(+_113), stack) : value;
    };
    stack.order = function(_113) {
      return arguments.length ? (order2 = _113 == null ? none_default2 : typeof _113 === "function" ? _113 : constant_default2(Array.from(_113)), stack) : order2;
    };
    stack.offset = function(_113) {
      return arguments.length ? (offset2 = _113 == null ? none_default : _113, stack) : offset2;
    };
    return stack;
  }

  // node_modules/d3-shape/src/offset/expand.js
  function expand_default(series, order2) {
    if (!((n = series.length) > 0)) return;
    for (var i, n, j = 0, m = series[0].length, y2; j < m; ++j) {
      for (y2 = i = 0; i < n; ++i) y2 += series[i][j][1] || 0;
      if (y2) for (i = 0; i < n; ++i) series[i][j][1] /= y2;
    }
    none_default(series, order2);
  }

  // node_modules/d3-shape/src/offset/diverging.js
  function diverging_default(series, order2) {
    if (!((n = series.length) > 0)) return;
    for (var i, j = 0, d, dy, yp, yn, n, m = series[order2[0]].length; j < m; ++j) {
      for (yp = yn = 0, i = 0; i < n; ++i) {
        if ((dy = (d = series[order2[i]][j])[1] - d[0]) > 0) {
          d[0] = yp, d[1] = yp += dy;
        } else if (dy < 0) {
          d[1] = yn, d[0] = yn += dy;
        } else {
          d[0] = 0, d[1] = dy;
        }
      }
    }
  }

  // node_modules/d3-shape/src/offset/silhouette.js
  function silhouette_default(series, order2) {
    if (!((n = series.length) > 0)) return;
    for (var j = 0, s0 = series[order2[0]], n, m = s0.length; j < m; ++j) {
      for (var i = 0, y2 = 0; i < n; ++i) y2 += series[i][j][1] || 0;
      s0[j][1] += s0[j][0] = -y2 / 2;
    }
    none_default(series, order2);
  }

  // node_modules/d3-shape/src/offset/wiggle.js
  function wiggle_default(series, order2) {
    if (!((n = series.length) > 0) || !((m = (s0 = series[order2[0]]).length) > 0)) return;
    for (var y2 = 0, j = 1, s0, m, n; j < m; ++j) {
      for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {
        var si = series[order2[i]], sij0 = si[j][1] || 0, sij1 = si[j - 1][1] || 0, s3 = (sij0 - sij1) / 2;
        for (var k2 = 0; k2 < i; ++k2) {
          var sk = series[order2[k2]], skj0 = sk[j][1] || 0, skj1 = sk[j - 1][1] || 0;
          s3 += skj0 - skj1;
        }
        s1 += sij0, s2 += s3 * sij0;
      }
      s0[j - 1][1] += s0[j - 1][0] = y2;
      if (s1) y2 -= s2 / s1;
    }
    s0[j - 1][1] += s0[j - 1][0] = y2;
    none_default(series, order2);
  }

  // node_modules/d3-shape/src/order/appearance.js
  function appearance_default(series) {
    var peaks = series.map(peak);
    return none_default2(series).sort(function(a2, b) {
      return peaks[a2] - peaks[b];
    });
  }
  function peak(series) {
    var i = -1, j = 0, n = series.length, vi, vj = -Infinity;
    while (++i < n) if ((vi = +series[i][1]) > vj) vj = vi, j = i;
    return j;
  }

  // node_modules/d3-shape/src/order/ascending.js
  function ascending_default(series) {
    var sums = series.map(sum);
    return none_default2(series).sort(function(a2, b) {
      return sums[a2] - sums[b];
    });
  }
  function sum(series) {
    var s2 = 0, i = -1, n = series.length, v;
    while (++i < n) if (v = +series[i][1]) s2 += v;
    return s2;
  }

  // node_modules/d3-shape/src/order/descending.js
  function descending_default2(series) {
    return ascending_default(series).reverse();
  }

  // node_modules/d3-shape/src/order/insideOut.js
  function insideOut_default(series) {
    var n = series.length, i, j, sums = series.map(sum), order2 = appearance_default(series), top2 = 0, bottom2 = 0, tops = [], bottoms = [];
    for (i = 0; i < n; ++i) {
      j = order2[i];
      if (top2 < bottom2) {
        top2 += sums[j];
        tops.push(j);
      } else {
        bottom2 += sums[j];
        bottoms.push(j);
      }
    }
    return bottoms.reverse().concat(tops);
  }

  // node_modules/d3-shape/src/order/reverse.js
  function reverse_default(series) {
    return none_default2(series).reverse();
  }

  // node_modules/victory-core/es/victory-util/line-helpers.js
  var defined = (d) => {
    const y2 = d._y1 !== void 0 ? d._y1 : d._y;
    return y2 !== null && y2 !== void 0 && d._y0 !== null;
  };
  var getXAccessor = (scale) => {
    return (d) => scale.x(d._x1 !== void 0 ? d._x1 : d._x);
  };
  var getYAccessor = (scale) => {
    return (d) => scale.y(d._y1 !== void 0 ? d._y1 : d._y);
  };
  var getAngleAccessor = (scale) => {
    return (d) => {
      const x2 = scale.x(d._x1 !== void 0 ? d._x1 : d._x);
      return -1 * x2 + Math.PI / 2;
    };
  };
  var toNewName2 = (interpolation) => {
    const capitalize3 = (s2) => s2 && s2[0].toUpperCase() + s2.slice(1);
    return `curve${capitalize3(interpolation)}`;
  };
  var toNewNameClosed = (interpolation) => {
    return `${toNewName2(interpolation)}Closed`;
  };
  var getInterpolationFunction = (props) => {
    const {
      interpolation
    } = props;
    if (typeof interpolation === "function") {
      return interpolation;
    }
    if (typeof interpolation === "string") {
      const {
        polar,
        openCurve = !polar
      } = props;
      const interpolationName = !openCurve ? toNewNameClosed(interpolation) : toNewName2(interpolation);
      return d3_shape_exports[interpolationName];
    }
    return linear_default;
  };
  var getLineFunction = (props) => {
    const {
      polar,
      scale,
      horizontal
    } = props;
    return polar ? lineRadial_default().defined(defined).curve(getInterpolationFunction(props)).angle(getAngleAccessor(scale)).radius(getYAccessor(scale)) : line_default().defined(defined).curve(getInterpolationFunction(props)).x(horizontal ? getYAccessor(scale) : getXAccessor(scale)).y(horizontal ? getXAccessor(scale) : getYAccessor(scale));
  };

  // node_modules/victory-core/es/victory-util/log.js
  function warn(message) {
    if (true) {
      if (console && console.warn) {
        console.warn(message);
      }
    }
  }

  // node_modules/victory-core/es/victory-util/point-path-helpers.js
  var point_path_helpers_exports = {};
  __export(point_path_helpers_exports, {
    circle: () => circle,
    cross: () => cross,
    diamond: () => diamond,
    minus: () => minus,
    plus: () => plus,
    square: () => square2,
    star: () => star,
    triangleDown: () => triangleDown,
    triangleUp: () => triangleUp
  });
  function circle(x2, y2, size) {
    return `M ${x2}, ${y2}
      m ${-size}, 0
      a ${size}, ${size} 0 1,0 ${size * 2},0
      a ${size}, ${size} 0 1,0 ${-size * 2},0`;
  }
  function square2(x2, y2, size) {
    const baseSize = 0.87 * size;
    const x0 = x2 - baseSize;
    const y1 = y2 + baseSize;
    const distance = x2 + baseSize - x0;
    return `M ${x0}, ${y1}
      h${distance}
      v-${distance}
      h-${distance}
      z`;
  }
  function diamond(x2, y2, size) {
    const baseSize = 0.87 * size;
    const length = Math.sqrt(2 * (baseSize * baseSize));
    return `M ${x2}, ${y2 + length}
      l ${length}, -${length}
      l -${length}, -${length}
      l -${length}, ${length}
      l ${length}, ${length}
      z`;
  }
  function triangleDown(x2, y2, size) {
    const height = size / 2 * Math.sqrt(3);
    const x0 = x2 - size;
    const x1 = x2 + size;
    const y0 = y2 - size;
    const y1 = y2 + height;
    return `M ${x0}, ${y0}
      L ${x1}, ${y0}
      L ${x2}, ${y1}
      z`;
  }
  function triangleUp(x2, y2, size) {
    const height = size / 2 * Math.sqrt(3);
    const x0 = x2 - size;
    const x1 = x2 + size;
    const y0 = y2 - height;
    const y1 = y2 + size;
    return `M ${x0}, ${y1}
      L ${x1}, ${y1}
      L ${x2}, ${y0}
      z`;
  }
  function plus(x2, y2, size) {
    const baseSize = 1.1 * size;
    const distance = baseSize / 1.5;
    return `
      M ${x2 - distance / 2}, ${y2 + baseSize}
      v-${distance}
      h-${distance}
      v-${distance}
      h${distance}
      v-${distance}
      h${distance}
      v${distance}
      h${distance}
      v${distance}
      h-${distance}
      v${distance}
      z`;
  }
  function cross(x2, y2, size) {
    const baseSize = 0.8 * size;
    const distance = baseSize / 1.5;
    return `
      M ${x2 - distance / 2}, ${y2 + baseSize + distance}
      v-${distance * 2}
      h-${distance}
      v-${distance}
      h${distance}
      v-${distance}
      h${distance}
      v${distance}
      h${distance}
      v${distance}
      h-${distance}
      v${distance * 2}
      z`;
  }
  function minus(x2, y2, size) {
    const baseSize = 1.1 * size;
    const lineHeight = baseSize - baseSize * 0.3;
    const x0 = x2 - baseSize;
    const y1 = y2 + lineHeight / 2;
    const distance = x2 + baseSize - x0;
    return `M ${x0}, ${y1}
      h${distance}
      v-${lineHeight}
      h-${distance}
      z`;
  }
  function star(x2, y2, size) {
    const baseSize = 1.35 * size;
    const angle = Math.PI / 5;
    const starCoords = range(10).map((index) => {
      const length = index % 2 === 0 ? baseSize : baseSize / 2;
      return `${length * Math.sin(angle * (index + 1)) + x2},
        ${length * Math.cos(angle * (index + 1)) + y2}`;
    });
    return `M ${starCoords.join("L")} z`;
  }

  // node_modules/victory-core/es/victory-util/selection.js
  var selection_exports = {};
  __export(selection_exports, {
    getBounds: () => getBounds,
    getDataCoordinates: () => getDataCoordinates,
    getDomainCoordinates: () => getDomainCoordinates,
    getParentSVG: () => getParentSVG,
    getSVGEventCoordinates: () => getSVGEventCoordinates
  });
  function transformTarget(target, matrix, dimension) {
    const {
      a: a2,
      d,
      e,
      f
    } = matrix;
    return dimension === "y" ? d * target + f : a2 * target + e;
  }
  function getTransformationMatrix(svg) {
    return svg.getScreenCTM().inverse();
  }
  function isNativeTouchEvent(nativeEvent) {
    return !!(nativeEvent && nativeEvent.identifier !== void 0);
  }
  function isReactTouchEvent(evt) {
    return evt.changedTouches && evt.changedTouches.length > 0;
  }
  function getParentSVG(evt) {
    if (isNativeTouchEvent(evt.nativeEvent)) {
      return void 0;
    }
    const getParent = (target) => {
      if (target.nodeName === "svg") {
        return target;
      }
      return target.parentNode ? getParent(target.parentNode) : target;
    };
    return getParent(evt.target);
  }
  function getSVGEventCoordinates(evt, svg) {
    if (isNativeTouchEvent(evt.nativeEvent)) {
      return {
        x: evt.nativeEvent.locationX,
        y: evt.nativeEvent.locationY
      };
    }
    const location = isReactTouchEvent(evt) ? evt.changedTouches[0] : evt;
    const matrix = getTransformationMatrix(svg || getParentSVG(location));
    return {
      x: transformTarget(location.clientX, matrix, "x"),
      y: transformTarget(location.clientY, matrix, "y")
    };
  }
  function getDomainCoordinates(props, domain) {
    const {
      horizontal
    } = props;
    const scale = props.scale;
    const domainObj = domain || {
      x: scale.x.domain(),
      y: scale.y.domain()
    };
    return {
      x: horizontal ? [scale.y(domainObj.y[0]), scale.y(domainObj.y[1])] : [scale.x(domainObj.x[0]), scale.x(domainObj.x[1])],
      y: horizontal ? [scale.x(domainObj.x[0]), scale.x(domainObj.x[1])] : [scale.y(domainObj.y[0]), scale.y(domainObj.y[1])]
    };
  }
  function getDataCoordinates(props, scale, x2, y2) {
    const {
      polar,
      horizontal
    } = props;
    if (!polar) {
      return {
        x: horizontal ? scale.x.invert(y2) : scale.x.invert(x2),
        y: horizontal ? scale.y.invert(x2) : scale.y.invert(y2)
      };
    }
    const origin = props.origin || {
      x: 0,
      y: 0
    };
    const baseX = x2 - origin.x;
    const baseY = y2 - origin.y;
    const radius = Math.abs(baseX * Math.sqrt(1 + Math.pow(-baseY / baseX, 2)));
    const angle = (-Math.atan2(baseY, baseX) + Math.PI * 2) % (Math.PI * 2);
    return {
      x: scale.x.invert(angle),
      y: scale.y.invert(radius)
    };
  }
  function getBounds(props) {
    const {
      x1,
      x2,
      y1,
      y2,
      scale
    } = props;
    const point1 = getDataCoordinates(props, scale, x1, y1);
    const point22 = getDataCoordinates(props, scale, x2, y2);
    const makeBound = (a2, b) => {
      return [getMinValue([a2, b]), getMaxValue([a2, b])];
    };
    return {
      x: makeBound(point1.x, point22.x),
      y: makeBound(point1.y, point22.y)
    };
  }

  // node_modules/victory-core/es/victory-util/style.js
  var style_exports = {};
  __export(style_exports, {
    getColorScale: () => getColorScale,
    toTransformString: () => toTransformString
  });

  // node_modules/victory-core/es/victory-theme/grayscale.js
  var colors = {
    blue: "#4F7DA1",
    pink: "#E2A37F",
    teal: "#00796B",
    purple: "#DF948A",
    green: "#8BC34A",
    orange: "#F4511E",
    cyan: "#006064",
    red: "#DF5A49",
    yellow: "#FFF59D"
  };
  var colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
  var charcoal = "#252525";
  var grey = "#969696";
  var qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
  var heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
  var warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
  var cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
  var red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
  var green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
  var blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
  var sansSerif = "'Gill Sans', 'Seravek', 'Trebuchet MS', sans-serif";
  var letterSpacing = "normal";
  var fontSize = 14;
  var baseProps = {
    width: 450,
    height: 300,
    padding: 50,
    colorScale
  };
  var baseLabelStyles = {
    fontFamily: sansSerif,
    fontSize,
    letterSpacing,
    padding: 10,
    fill: charcoal,
    stroke: "transparent"
  };
  var centeredLabelStyles = Object.assign({
    textAnchor: "middle"
  }, baseLabelStyles);
  var strokeLinecap = "round";
  var strokeLinejoin = "round";
  var grayscale = {
    palette: {
      colors,
      grayscale: colorScale,
      qualitative,
      heatmap,
      warm,
      cool,
      red,
      green,
      blue
    },
    area: Object.assign({
      style: {
        data: {
          fill: charcoal
        },
        labels: baseLabelStyles
      }
    }, baseProps),
    axis: Object.assign({
      style: {
        axis: {
          fill: "transparent",
          stroke: charcoal,
          strokeWidth: 1,
          strokeLinecap,
          strokeLinejoin
        },
        axisLabel: Object.assign({}, centeredLabelStyles, {
          padding: 25
        }),
        grid: {
          fill: "none",
          stroke: "none",
          pointerEvents: "painted"
        },
        ticks: {
          fill: "transparent",
          size: 1,
          stroke: "transparent"
        },
        tickLabels: baseLabelStyles
      }
    }, baseProps),
    bar: Object.assign({
      style: {
        data: {
          fill: charcoal,
          padding: 8,
          strokeWidth: 0
        },
        labels: baseLabelStyles
      }
    }, baseProps),
    boxplot: Object.assign({
      style: {
        max: {
          padding: 8,
          stroke: charcoal,
          strokeWidth: 1
        },
        maxLabels: Object.assign({}, baseLabelStyles, {
          padding: 3
        }),
        median: {
          padding: 8,
          stroke: charcoal,
          strokeWidth: 1
        },
        medianLabels: Object.assign({}, baseLabelStyles, {
          padding: 3
        }),
        min: {
          padding: 8,
          stroke: charcoal,
          strokeWidth: 1
        },
        minLabels: Object.assign({}, baseLabelStyles, {
          padding: 3
        }),
        q1: {
          padding: 8,
          fill: grey
        },
        q1Labels: Object.assign({}, baseLabelStyles, {
          padding: 3
        }),
        q3: {
          padding: 8,
          fill: grey
        },
        q3Labels: Object.assign({}, baseLabelStyles, {
          padding: 3
        })
      },
      boxWidth: 20
    }, baseProps),
    candlestick: Object.assign({
      style: {
        data: {
          stroke: charcoal,
          strokeWidth: 1
        },
        labels: Object.assign({}, baseLabelStyles, {
          padding: 5
        })
      },
      candleColors: {
        positive: "#ffffff",
        negative: charcoal
      }
    }, baseProps),
    chart: baseProps,
    errorbar: Object.assign({
      borderWidth: 8,
      style: {
        data: {
          fill: "transparent",
          stroke: charcoal,
          strokeWidth: 2
        },
        labels: baseLabelStyles
      }
    }, baseProps),
    group: Object.assign({
      colorScale
    }, baseProps),
    histogram: Object.assign({
      style: {
        data: {
          fill: grey,
          stroke: charcoal,
          strokeWidth: 2
        },
        labels: baseLabelStyles
      }
    }, baseProps),
    legend: {
      colorScale,
      gutter: 10,
      orientation: "vertical",
      titleOrientation: "top",
      style: {
        data: {
          type: "circle"
        },
        labels: baseLabelStyles,
        title: Object.assign({}, baseLabelStyles, {
          padding: 5
        })
      }
    },
    line: Object.assign({
      style: {
        data: {
          fill: "transparent",
          stroke: charcoal,
          strokeWidth: 2
        },
        labels: baseLabelStyles
      }
    }, baseProps),
    pie: {
      style: {
        data: {
          padding: 10,
          stroke: "transparent",
          strokeWidth: 1
        },
        labels: Object.assign({}, baseLabelStyles, {
          padding: 20
        })
      },
      colorScale,
      width: 400,
      height: 400,
      padding: 50
    },
    scatter: Object.assign({
      style: {
        data: {
          fill: charcoal,
          stroke: "transparent",
          strokeWidth: 0
        },
        labels: baseLabelStyles
      }
    }, baseProps),
    stack: Object.assign({
      colorScale
    }, baseProps),
    tooltip: {
      style: Object.assign({}, baseLabelStyles, {
        padding: 0,
        pointerEvents: "none"
      }),
      flyoutStyle: {
        stroke: charcoal,
        strokeWidth: 1,
        fill: "#f0f0f0",
        pointerEvents: "none"
      },
      flyoutPadding: 5,
      cornerRadius: 5,
      pointerLength: 10
    },
    voronoi: Object.assign({
      style: {
        data: {
          fill: "transparent",
          stroke: "transparent",
          strokeWidth: 0
        },
        labels: Object.assign({}, baseLabelStyles, {
          padding: 5,
          pointerEvents: "none"
        }),
        flyout: {
          stroke: charcoal,
          strokeWidth: 1,
          fill: "#f0f0f0",
          pointerEvents: "none"
        }
      }
    }, baseProps)
  };

  // node_modules/victory-core/es/victory-theme/material.js
  var yellow200 = "#FFF59D";
  var deepOrange600 = "#F4511E";
  var lime300 = "#DCE775";
  var lightGreen500 = "#8BC34A";
  var teal700 = "#00796B";
  var cyan900 = "#006064";
  var colorScale2 = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
  var blueGrey50 = "#ECEFF1";
  var blueGrey300 = "#90A4AE";
  var blueGrey700 = "#455A64";
  var grey900 = "#212121";
  var colors2 = {
    blue: "#4F7DA1",
    pink: "#E2A37F",
    teal: teal700,
    purple: "#DF948A",
    green: lightGreen500,
    orange: deepOrange600,
    cyan: cyan900,
    red: "#DF5A49",
    yellow: yellow200
  };
  var grayscale2 = [blueGrey50, blueGrey300, blueGrey700, grey900];
  var qualitative2 = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
  var heatmap2 = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
  var warm2 = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
  var cool2 = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
  var red2 = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
  var green2 = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
  var blue2 = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
  var sansSerif2 = "'Helvetica Neue', 'Helvetica', sans-serif";
  var letterSpacing2 = "normal";
  var fontSize2 = 12;
  var padding = 8;
  var baseProps2 = {
    width: 350,
    height: 350,
    padding: 50
  };
  var baseLabelStyles2 = {
    fontFamily: sansSerif2,
    fontSize: fontSize2,
    letterSpacing: letterSpacing2,
    padding,
    fill: blueGrey700,
    stroke: "transparent",
    strokeWidth: 0
  };
  var centeredLabelStyles2 = Object.assign({
    textAnchor: "middle"
  }, baseLabelStyles2);
  var strokeDasharray = "10, 5";
  var strokeLinecap2 = "round";
  var strokeLinejoin2 = "round";
  var material = {
    palette: {
      colors: colors2,
      grayscale: grayscale2,
      qualitative: qualitative2,
      heatmap: heatmap2,
      warm: warm2,
      cool: cool2,
      red: red2,
      green: green2,
      blue: blue2
    },
    area: Object.assign({
      style: {
        data: {
          fill: grey900
        },
        labels: baseLabelStyles2
      }
    }, baseProps2),
    axis: Object.assign({
      style: {
        axis: {
          fill: "transparent",
          stroke: blueGrey300,
          strokeWidth: 2,
          strokeLinecap: strokeLinecap2,
          strokeLinejoin: strokeLinejoin2
        },
        axisLabel: Object.assign({}, centeredLabelStyles2, {
          padding,
          stroke: "transparent"
        }),
        grid: {
          fill: "none",
          stroke: blueGrey50,
          strokeDasharray,
          strokeLinecap: strokeLinecap2,
          strokeLinejoin: strokeLinejoin2,
          pointerEvents: "painted"
        },
        ticks: {
          fill: "transparent",
          size: 5,
          stroke: blueGrey300,
          strokeWidth: 1,
          strokeLinecap: strokeLinecap2,
          strokeLinejoin: strokeLinejoin2
        },
        tickLabels: Object.assign({}, baseLabelStyles2, {
          fill: blueGrey700
        })
      }
    }, baseProps2),
    polarDependentAxis: Object.assign({
      style: {
        ticks: {
          fill: "transparent",
          size: 1,
          stroke: "transparent"
        }
      }
    }),
    bar: Object.assign({
      style: {
        data: {
          fill: blueGrey700,
          padding,
          strokeWidth: 0
        },
        labels: baseLabelStyles2
      }
    }, baseProps2),
    boxplot: Object.assign({
      style: {
        max: {
          padding,
          stroke: blueGrey700,
          strokeWidth: 1
        },
        maxLabels: Object.assign({}, baseLabelStyles2, {
          padding: 3
        }),
        median: {
          padding,
          stroke: blueGrey700,
          strokeWidth: 1
        },
        medianLabels: Object.assign({}, baseLabelStyles2, {
          padding: 3
        }),
        min: {
          padding,
          stroke: blueGrey700,
          strokeWidth: 1
        },
        minLabels: Object.assign({}, baseLabelStyles2, {
          padding: 3
        }),
        q1: {
          padding,
          fill: blueGrey700
        },
        q1Labels: Object.assign({}, baseLabelStyles2, {
          padding: 3
        }),
        q3: {
          padding,
          fill: blueGrey700
        },
        q3Labels: Object.assign({}, baseLabelStyles2, {
          padding: 3
        })
      },
      boxWidth: 20
    }, baseProps2),
    candlestick: Object.assign({
      style: {
        data: {
          stroke: blueGrey700
        },
        labels: Object.assign({}, baseLabelStyles2, {
          padding: 5
        })
      },
      candleColors: {
        positive: "#ffffff",
        negative: blueGrey700
      }
    }, baseProps2),
    chart: baseProps2,
    errorbar: Object.assign({
      borderWidth: 8,
      style: {
        data: {
          fill: "transparent",
          opacity: 1,
          stroke: blueGrey700,
          strokeWidth: 2
        },
        labels: baseLabelStyles2
      }
    }, baseProps2),
    group: Object.assign({
      colorScale: colorScale2
    }, baseProps2),
    histogram: Object.assign({
      style: {
        data: {
          fill: blueGrey700,
          stroke: grey900,
          strokeWidth: 2
        },
        labels: baseLabelStyles2
      }
    }, baseProps2),
    legend: {
      colorScale: colorScale2,
      gutter: 10,
      orientation: "vertical",
      titleOrientation: "top",
      style: {
        data: {
          type: "circle"
        },
        labels: baseLabelStyles2,
        title: Object.assign({}, baseLabelStyles2, {
          padding: 5
        })
      }
    },
    line: Object.assign({
      style: {
        data: {
          fill: "transparent",
          opacity: 1,
          stroke: blueGrey700,
          strokeWidth: 2
        },
        labels: baseLabelStyles2
      }
    }, baseProps2),
    pie: Object.assign({
      colorScale: colorScale2,
      style: {
        data: {
          padding,
          stroke: blueGrey50,
          strokeWidth: 1
        },
        labels: Object.assign({}, baseLabelStyles2, {
          padding: 20
        })
      }
    }, baseProps2),
    scatter: Object.assign({
      style: {
        data: {
          fill: blueGrey700,
          opacity: 1,
          stroke: "transparent",
          strokeWidth: 0
        },
        labels: baseLabelStyles2
      }
    }, baseProps2),
    stack: Object.assign({
      colorScale: colorScale2
    }, baseProps2),
    tooltip: {
      style: Object.assign({}, baseLabelStyles2, {
        padding: 0,
        pointerEvents: "none"
      }),
      flyoutStyle: {
        stroke: grey900,
        strokeWidth: 1,
        fill: "#f0f0f0",
        pointerEvents: "none"
      },
      flyoutPadding: 5,
      cornerRadius: 5,
      pointerLength: 10
    },
    voronoi: Object.assign({
      style: {
        data: {
          fill: "transparent",
          stroke: "transparent",
          strokeWidth: 0
        },
        labels: Object.assign({}, baseLabelStyles2, {
          padding: 5,
          pointerEvents: "none"
        }),
        flyout: {
          stroke: grey900,
          strokeWidth: 1,
          fill: "#f0f0f0",
          pointerEvents: "none"
        }
      }
    }, baseProps2)
  };

  // node_modules/victory-core/es/victory-theme/clean.js
  var gray = {
    white: "#FFFFFF",
    "50": "#FAFAFA",
    "100": "#F2F2F2",
    "200": "#E8E8E8",
    "300": "#E0E0E0",
    "400": "#D1D1D1",
    "500": "#757575",
    "600": "#5C5C5C",
    "700": "#424242",
    "800": "#333333",
    "900": "#292929",
    black: "#0F0F0F"
  };
  var yellow = {
    "100": "#FFEAB6",
    "300": "#FFD66E",
    "500": "#FCB400",
    "900": "#B87503"
  };
  var orange = {
    "100": "#FEE2D5",
    "300": "#FFA981",
    "500": "#FF6F2C",
    "700": "#FF4E1B",
    "900": "#D74D26"
  };
  var red3 = {
    "100": "#FFDCE5",
    "300": "#FF9EB7",
    "500": "#F82B60",
    "700": "#D31A3D",
    "900": "#BA1E45"
  };
  var purple = {
    "100": "#EDE3FE",
    "300": "#CDB0FF",
    "500": "#8B46FF",
    "900": "#6B1CB0"
  };
  var blue3 = {
    "100": "#CFDFFF",
    "300": "#9CC7FF",
    "500": "#2D7FF9",
    "700": "#0056B3",
    "900": "#2750AE"
  };
  var cyan = {
    "100": "#D0F0FD",
    "300": "#77D1F3",
    "500": "#18BFFF",
    "900": "#0B76B7"
  };
  var teal = {
    "100": "#C2F5E9",
    "300": "#72DDC3",
    "500": "#20D9D2",
    "900": "#06A09B"
  };
  var green3 = {
    "100": "#D1F7C4",
    "300": "#93E088",
    "500": "#20C933",
    "700": "#1B9B2A",
    "900": "#338A17"
  };
  var colors3 = {
    blue: blue3["500"],
    cyan: cyan["500"],
    green: green3["500"],
    yellow: yellow["500"],
    orange: orange["500"],
    red: red3["500"],
    purple: purple["500"],
    teal: teal["500"]
  };
  var colorScale3 = Object.values(colors3);
  var grayscale3 = [gray["100"], gray["300"], gray["500"], gray["700"], gray["900"]];
  var warm3 = [yellow["300"], yellow["500"], orange["500"], orange["900"], red3["500"]];
  var cool3 = [purple["500"], blue3["500"], cyan["500"], teal["500"], green3["500"]];
  var heatmap3 = [green3["900"], green3["500"], yellow["500"], orange["500"], red3["500"]];
  var redPalette = Object.values(red3);
  var greenPalette = Object.values(green3);
  var bluePalette = Object.values(blue3);
  var defaultColor = blue3["500"];
  var sansSerif3 = "'Inter', 'Helvetica Neue', 'Seravek', 'Helvetica', sans-serif";
  var letterSpacing3 = "normal";
  var fontSize3 = 12;
  var padding2 = 8;
  var baseProps3 = {
    width: 450,
    height: 300,
    padding: 60,
    colorScale: colorScale3
  };
  var baseLabelStyles3 = {
    fontFamily: sansSerif3,
    fontSize: fontSize3,
    fontWeight: 300,
    letterSpacing: letterSpacing3,
    padding: padding2,
    fill: gray["900"],
    stroke: "transparent"
  };
  var centeredLabelStyles3 = Object.assign({
    textAnchor: "middle"
  }, baseLabelStyles3);
  var strokeDasharray2 = "10, 5";
  var strokeLinecap3 = "round";
  var strokeLinejoin3 = "round";
  var borderRadius = 1;
  var clean = {
    palette: {
      colors: colors3,
      grayscale: grayscale3,
      qualitative: colorScale3,
      heatmap: heatmap3,
      warm: warm3,
      cool: cool3,
      red: redPalette,
      green: greenPalette,
      blue: bluePalette
    },
    area: Object.assign({
      style: {
        data: {
          fill: defaultColor,
          strokeWidth: 2,
          fillOpacity: 0.5
        },
        labels: baseLabelStyles3
      }
    }, baseProps3),
    axis: Object.assign({
      style: {
        axis: {
          fill: "transparent",
          stroke: gray["500"],
          strokeWidth: 1,
          strokeLinecap: strokeLinecap3,
          strokeLinejoin: strokeLinejoin3
        },
        axisLabel: Object.assign({}, centeredLabelStyles3, {
          padding: 35,
          stroke: "transparent"
        }),
        grid: {
          fill: "none",
          stroke: "none",
          painterEvents: "painted"
        },
        ticks: {
          fill: "transparent",
          size: 5,
          stroke: "transparent"
        },
        tickLabels: baseLabelStyles3
      }
    }, baseProps3),
    polarAxis: Object.assign({
      style: {
        axis: {
          stroke: gray["500"]
        },
        grid: {
          stroke: gray["400"],
          strokeDasharray: strokeDasharray2,
          strokeLinecap: strokeLinecap3,
          strokeLinejoin: strokeLinejoin3,
          pointerEvents: "painted"
        },
        ticks: {
          fill: "transparent",
          size: 5,
          stroke: gray["400"],
          strokeWidth: 1,
          strokeLinecap: strokeLinecap3,
          strokeLinejoin: strokeLinejoin3
        },
        tickLabels: baseLabelStyles3
      }
    }),
    polarDependentAxis: Object.assign({
      style: {
        axis: {
          stroke: gray["500"]
        },
        grid: {
          stroke: gray["400"],
          strokeDasharray: strokeDasharray2,
          strokeLinecap: strokeLinecap3,
          strokeLinejoin: strokeLinejoin3,
          pointerEvents: "painted"
        },
        ticks: {
          fill: "transparent",
          size: 5,
          stroke: gray["300"],
          strokeWidth: 1,
          strokeLinecap: strokeLinecap3,
          strokeLinejoin: strokeLinejoin3
        },
        tickLabels: baseLabelStyles3
      }
    }),
    bar: Object.assign({
      style: {
        data: {
          fill: defaultColor,
          padding: padding2,
          strokeWidth: 1,
          fillOpacity: 0.5
        },
        labels: baseLabelStyles3
      },
      cornerRadius: {
        top: borderRadius
      }
    }, baseProps3),
    boxplot: Object.assign({
      style: {
        max: {
          padding: padding2,
          stroke: gray["400"],
          strokeWidth: 2
        },
        maxLabels: Object.assign({}, baseLabelStyles3, {
          padding: 3
        }),
        median: {
          padding: padding2,
          stroke: gray.white,
          strokeWidth: 2
        },
        medianLabels: Object.assign({}, baseLabelStyles3, {
          padding: 3
        }),
        min: {
          padding: padding2,
          stroke: gray["400"],
          strokeWidth: 2
        },
        minLabels: Object.assign({}, baseLabelStyles3, {
          padding: 3
        }),
        q1: {
          padding: padding2,
          fill: colorScale3[0],
          rx: borderRadius,
          strokeWidth: 2
        },
        q1Labels: Object.assign({}, baseLabelStyles3, {
          padding: 3
        }),
        q3: {
          padding: padding2,
          fill: colorScale3[1],
          rx: borderRadius
        },
        q3Labels: Object.assign({}, baseLabelStyles3, {
          padding: 3
        })
      },
      boxWidth: 20
    }, baseProps3),
    candlestick: Object.assign({
      style: {
        data: {
          stroke: gray["300"],
          strokeWidth: 0,
          rx: borderRadius
        },
        labels: Object.assign({}, baseLabelStyles3, {
          padding: 5
        })
      },
      candleColors: {
        positive: green3["500"],
        negative: red3["500"]
      },
      wickStrokeWidth: 2
    }, baseProps3),
    chart: baseProps3,
    errorbar: Object.assign({
      borderWidth: 8,
      style: {
        data: {
          fill: "transparent",
          opacity: 1,
          stroke: gray["700"],
          strokeWidth: 2,
          strokeLinecap: strokeLinecap3
        },
        labels: baseLabelStyles3
      }
    }, baseProps3),
    group: Object.assign({
      colorScale: colorScale3
    }, baseProps3),
    histogram: Object.assign({
      style: {
        data: {
          fill: cyan["500"],
          fillOpacity: 0.5
        },
        labels: baseLabelStyles3
      },
      binSpacing: 4,
      cornerRadius: {
        top: borderRadius
      }
    }, baseProps3),
    label: baseLabelStyles3,
    legend: {
      colorScale: colorScale3,
      gutter: 24,
      borderPadding: 10,
      orientation: "horizontal",
      titleOrientation: "top",
      centerTitle: true,
      style: {
        data: {
          type: "circle"
        },
        labels: {
          ...baseLabelStyles3,
          fontSize: 12
        },
        title: Object.assign({}, baseLabelStyles3, {
          padding: padding2,
          fontSize: 16
        }),
        border: {
          stroke: gray["200"],
          strokeWidth: 2,
          padding: 16
        }
      }
    },
    line: Object.assign({
      style: {
        data: {
          fill: "transparent",
          opacity: 1,
          stroke: defaultColor,
          strokeWidth: 2,
          strokeLinecap: strokeLinecap3,
          strokeLinejoin: strokeLinejoin3
        },
        labels: baseLabelStyles3
      }
    }, baseProps3),
    pie: Object.assign({
      style: {
        parent: {
          backgroundColor: gray.white
        },
        data: {
          padding: padding2,
          stroke: gray.white,
          strokeWidth: 1
        },
        labels: {
          ...baseLabelStyles3,
          padding: 20,
          fill: gray["600"],
          fontSize: 10
        }
      },
      colorScale: colorScale3,
      cornerRadius: borderRadius
    }, baseProps3),
    scatter: Object.assign({
      style: {
        data: {
          fill: defaultColor,
          opacity: 1,
          stroke: "transparent",
          strokeWidth: 0
        },
        labels: {
          ...baseLabelStyles3,
          padding: 20
        }
      }
    }, baseProps3),
    stack: Object.assign({
      colorScale: colorScale3
    }, baseProps3),
    tooltip: {
      style: Object.assign({}, baseLabelStyles3, {
        padding: 0,
        pointerEvents: "none"
      }),
      flyoutStyle: {
        stroke: gray["300"],
        strokeWidth: 2,
        fill: gray.white,
        pointerEvents: "none"
      },
      flyoutPadding: {
        top: 8,
        bottom: 8,
        left: 16,
        right: 16
      },
      cornerRadius: borderRadius,
      pointerLength: 4
    },
    voronoi: Object.assign({
      style: {
        data: {
          fill: blue3["100"],
          stroke: defaultColor,
          strokeWidth: 2
        },
        labels: Object.assign({}, baseLabelStyles3, {
          padding: 5,
          pointerEvents: "none"
        }),
        flyout: {
          stroke: gray["900"],
          strokeWidth: 1,
          fill: gray["100"],
          pointerEvents: "none"
        },
        padding: {
          left: 2,
          bottom: 2
        }
      }
    }, baseProps3)
  };

  // node_modules/victory-core/es/victory-theme/victory-theme.js
  var VictoryTheme = {
    grayscale,
    material,
    clean
  };

  // node_modules/victory-core/es/victory-util/style.js
  var toTransformString = function(obj) {
    for (var _len = arguments.length, more = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      more[_key - 1] = arguments[_key];
    }
    if (more.length > 0) {
      return more.reduce((memo4, currentObj) => {
        return [memo4, toTransformString(currentObj)].join(" ");
      }, toTransformString(obj)).trim();
    }
    if (obj === void 0 || obj === null || typeof obj === "string") {
      return obj;
    }
    const transforms = [];
    for (const key in obj) {
      if (obj.hasOwnProperty(key)) {
        const value = obj[key];
        transforms.push(`${key}(${value})`);
      }
    }
    return transforms.join(" ").trim();
  };
  function getColorScale(name2, theme) {
    if (theme === void 0) {
      theme = VictoryTheme.material;
    }
    const {
      palette: {
        grayscale: grayscale4 = ["#cccccc", "#969696", "#636363", "#252525"],
        qualitative: qualitative3 = [],
        heatmap: heatmap4 = [],
        warm: warm4 = [],
        cool: cool4 = [],
        red: red4 = [],
        blue: blue4 = [],
        green: green4 = []
      } = {}
    } = theme;
    const scales = {
      grayscale: grayscale4,
      qualitative: qualitative3,
      heatmap: heatmap4,
      warm: warm4,
      cool: cool4,
      red: red4,
      blue: blue4,
      green: green4
    };
    const selectedScale = name2 && scales[name2]?.length ? scales[name2] : scales.grayscale;
    return selectedScale;
  }

  // node_modules/victory-core/es/victory-util/textsize.js
  var textsize_exports = {};
  __export(textsize_exports, {
    _approximateTextSizeInternal: () => _approximateTextSizeInternal,
    approximateTextSize: () => approximateTextSize,
    convertLengthToPixels: () => convertLengthToPixels
  });
  var import_defaults8 = __toESM(require_defaults());
  var import_memoize = __toESM(require_memoize());
  var fonts = {
    "American Typewriter": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.25, 0.4203125, 0.3296875, 0.6, 0.6375, 0.8015625, 0.8203125, 0.1875, 0.45625, 0.45625, 0.6375, 0.5, 0.2734375, 0.309375, 0.2734375, 0.4390625, 0.6375, 0.6375, 0.6375, 0.6375, 0.6375, 0.6375, 0.6375, 0.6375, 0.6375, 0.6375, 0.2734375, 0.2734375, 0.5, 0.5, 0.5, 0.6, 0.6921875, 0.7640625, 0.6921875, 0.6375, 0.728125, 0.6734375, 0.6203125, 0.7109375, 0.784375, 0.3828125, 0.6421875, 0.7859375, 0.6375, 0.9484375, 0.7640625, 0.65625, 0.6375, 0.65625, 0.7296875, 0.6203125, 0.6375, 0.7109375, 0.740625, 0.940625, 0.784375, 0.7578125, 0.6203125, 0.4375, 0.5, 0.4375, 0.5, 0.5, 0.4921875, 0.5734375, 0.5890625, 0.5109375, 0.6, 0.528125, 0.43125, 0.5578125, 0.6375, 0.3109375, 0.40625, 0.6234375, 0.309375, 0.928125, 0.6375, 0.546875, 0.6, 0.58125, 0.4921875, 0.4921875, 0.4, 0.6203125, 0.625, 0.825, 0.6375, 0.640625, 0.528125, 0.5, 0.5, 0.5, 0.6671875],
      avg: 0.5793421052631578
    },
    Arial: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.278125, 0.278125, 0.35625, 0.55625, 0.55625, 0.890625, 0.6671875, 0.1921875, 0.334375, 0.334375, 0.390625, 0.584375, 0.278125, 0.334375, 0.278125, 0.278125, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.278125, 0.278125, 0.584375, 0.584375, 0.584375, 0.55625, 1.015625, 0.6703125, 0.6671875, 0.7234375, 0.7234375, 0.6671875, 0.6109375, 0.778125, 0.7234375, 0.278125, 0.5, 0.6671875, 0.55625, 0.834375, 0.7234375, 0.778125, 0.6671875, 0.778125, 0.7234375, 0.6671875, 0.6109375, 0.7234375, 0.6671875, 0.9453125, 0.6671875, 0.6671875, 0.6109375, 0.278125, 0.278125, 0.278125, 0.4703125, 0.584375, 0.334375, 0.55625, 0.55625, 0.5, 0.55625, 0.55625, 0.3125, 0.55625, 0.55625, 0.2234375, 0.2703125, 0.5, 0.2234375, 0.834375, 0.55625, 0.55625, 0.55625, 0.55625, 0.346875, 0.5, 0.278125, 0.55625, 0.5, 0.7234375, 0.5, 0.5, 0.5, 0.334375, 0.2609375, 0.334375, 0.584375],
      avg: 0.528733552631579
    },
    "Arial Black": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.33125, 0.334375, 0.5, 0.6609375, 0.6671875, 1, 0.890625, 0.278125, 0.390625, 0.390625, 0.55625, 0.6609375, 0.334375, 0.334375, 0.334375, 0.28125, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.334375, 0.334375, 0.6609375, 0.6609375, 0.6609375, 0.6109375, 0.7453125, 0.78125, 0.778125, 0.778125, 0.778125, 0.7234375, 0.6671875, 0.834375, 0.834375, 0.390625, 0.6671875, 0.834375, 0.6671875, 0.9453125, 0.834375, 0.834375, 0.7234375, 0.834375, 0.78125, 0.7234375, 0.7234375, 0.834375, 0.7796875, 1.003125, 0.78125, 0.78125, 0.7234375, 0.390625, 0.28125, 0.390625, 0.6609375, 0.5125, 0.334375, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.41875, 0.6671875, 0.6671875, 0.334375, 0.384375, 0.6671875, 0.334375, 1, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.4703125, 0.6109375, 0.4453125, 0.6671875, 0.6140625, 0.946875, 0.6671875, 0.615625, 0.55625, 0.390625, 0.278125, 0.390625, 0.6609375],
      avg: 0.6213157894736842
    },
    Baskerville: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.25, 0.25, 0.40625, 0.6671875, 0.490625, 0.875, 0.7015625, 0.178125, 0.2453125, 0.246875, 0.4171875, 0.6671875, 0.25, 0.3125, 0.25, 0.521875, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.25, 0.25, 0.6671875, 0.6671875, 0.6671875, 0.396875, 0.9171875, 0.684375, 0.615625, 0.71875, 0.7609375, 0.625, 0.553125, 0.771875, 0.803125, 0.3546875, 0.515625, 0.78125, 0.6046875, 0.928125, 0.75, 0.8234375, 0.5625, 0.96875, 0.7296875, 0.5421875, 0.6984375, 0.771875, 0.7296875, 0.9484375, 0.771875, 0.678125, 0.6359375, 0.3640625, 0.521875, 0.3640625, 0.46875, 0.5125, 0.334375, 0.46875, 0.521875, 0.428125, 0.521875, 0.4375, 0.3890625, 0.4765625, 0.53125, 0.25, 0.359375, 0.4640625, 0.240625, 0.803125, 0.53125, 0.5, 0.521875, 0.521875, 0.365625, 0.334375, 0.2921875, 0.521875, 0.4640625, 0.678125, 0.4796875, 0.465625, 0.428125, 0.4796875, 0.5109375, 0.4796875, 0.6671875],
      avg: 0.5323519736842108
    },
    Courier: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5984375, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6078125, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.61875, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.615625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6140625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625],
      avg: 0.6020559210526316
    },
    "Courier New": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5984375, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625],
      avg: 0.6015296052631579
    },
    cursive: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1921875, 0.24375, 0.40625, 0.5671875, 0.3984375, 0.721875, 0.909375, 0.2328125, 0.434375, 0.365625, 0.4734375, 0.5578125, 0.19375, 0.3484375, 0.19375, 0.7734375, 0.503125, 0.4171875, 0.5453125, 0.45, 0.6046875, 0.4703125, 0.5984375, 0.55625, 0.503125, 0.5546875, 0.20625, 0.2, 0.5625, 0.5546875, 0.546875, 0.403125, 0.70625, 0.734375, 0.7078125, 0.64375, 0.85, 0.753125, 0.75, 0.6484375, 1.0765625, 0.44375, 0.5359375, 0.8359375, 0.653125, 1.0109375, 1.1515625, 0.6796875, 0.6984375, 1.0625, 0.8234375, 0.5125, 0.9234375, 0.8546875, 0.70625, 0.9109375, 0.7421875, 0.715625, 0.6015625, 0.4640625, 0.3359375, 0.4109375, 0.5421875, 0.5421875, 0.4328125, 0.5125, 0.5, 0.3859375, 0.7375, 0.359375, 0.75625, 0.540625, 0.5328125, 0.3203125, 0.5296875, 0.5015625, 0.484375, 0.7890625, 0.5640625, 0.4203125, 0.703125, 0.471875, 0.4734375, 0.35, 0.4125, 0.5640625, 0.471875, 0.6484375, 0.5296875, 0.575, 0.4140625, 0.415625, 0.20625, 0.3796875, 0.5421875],
      avg: 0.5604440789473684
    },
    fantasy: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.215625, 0.2625, 0.3265625, 0.6109375, 0.534375, 0.7625, 0.7828125, 0.2, 0.4359375, 0.4359375, 0.3765625, 0.5109375, 0.2796875, 0.4609375, 0.2796875, 0.5296875, 0.6640625, 0.253125, 0.521875, 0.4765625, 0.6640625, 0.490625, 0.528125, 0.5546875, 0.496875, 0.5421875, 0.2796875, 0.2796875, 0.5625, 0.4609375, 0.5625, 0.4828125, 0.609375, 0.740625, 0.7234375, 0.740625, 0.8265625, 0.7234375, 0.6171875, 0.7359375, 0.765625, 0.240625, 0.5453125, 0.715625, 0.6078125, 0.8640625, 0.653125, 0.9125, 0.6484375, 0.946875, 0.6921875, 0.653125, 0.6953125, 0.8015625, 0.58125, 0.784375, 0.671875, 0.6265625, 0.690625, 0.4359375, 0.5296875, 0.4359375, 0.53125, 0.5, 0.2875, 0.5375, 0.603125, 0.4984375, 0.60625, 0.53125, 0.434375, 0.6421875, 0.56875, 0.209375, 0.4671875, 0.5484375, 0.2203125, 0.709375, 0.55, 0.5984375, 0.6140625, 0.5765625, 0.40625, 0.4734375, 0.3734375, 0.559375, 0.4421875, 0.6421875, 0.4890625, 0.578125, 0.4484375, 0.2546875, 0.2203125, 0.2546875, 0.55],
      avg: 0.536496710526316
    },
    Geneva: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.3328125, 0.3046875, 0.5, 0.6671875, 0.6671875, 0.90625, 0.728125, 0.3046875, 0.446875, 0.446875, 0.5078125, 0.6671875, 0.3046875, 0.3796875, 0.3046875, 0.5390625, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.6671875, 0.3046875, 0.3046875, 0.6671875, 0.6671875, 0.6671875, 0.56875, 0.871875, 0.728125, 0.6375, 0.6515625, 0.7015625, 0.5765625, 0.5546875, 0.675, 0.690625, 0.2421875, 0.4921875, 0.6640625, 0.584375, 0.7890625, 0.709375, 0.7359375, 0.584375, 0.78125, 0.60625, 0.60625, 0.640625, 0.6671875, 0.728125, 0.946875, 0.6109375, 0.6109375, 0.5765625, 0.446875, 0.5390625, 0.446875, 0.6671875, 0.6671875, 0.5921875, 0.5546875, 0.6109375, 0.546875, 0.603125, 0.5765625, 0.390625, 0.6109375, 0.584375, 0.2359375, 0.334375, 0.5390625, 0.2359375, 0.8953125, 0.584375, 0.60625, 0.603125, 0.603125, 0.3875, 0.509375, 0.44375, 0.584375, 0.565625, 0.78125, 0.53125, 0.571875, 0.5546875, 0.4515625, 0.246875, 0.4515625, 0.6671875],
      avg: 0.5762664473684211
    },
    Georgia: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2421875, 0.33125, 0.4125, 0.64375, 0.6109375, 0.81875, 0.7109375, 0.215625, 0.375, 0.375, 0.4734375, 0.64375, 0.2703125, 0.375, 0.2703125, 0.46875, 0.6140625, 0.4296875, 0.559375, 0.553125, 0.565625, 0.5296875, 0.5671875, 0.503125, 0.596875, 0.5671875, 0.3125, 0.3125, 0.64375, 0.64375, 0.64375, 0.4796875, 0.9296875, 0.715625, 0.6546875, 0.6421875, 0.75, 0.6546875, 0.6, 0.7265625, 0.815625, 0.390625, 0.51875, 0.7203125, 0.6046875, 0.928125, 0.7671875, 0.7453125, 0.6109375, 0.7453125, 0.7234375, 0.5625, 0.61875, 0.7578125, 0.70625, 0.99375, 0.7125, 0.6640625, 0.6015625, 0.375, 0.46875, 0.375, 0.64375, 0.65, 0.5, 0.5046875, 0.56875, 0.4546875, 0.575, 0.484375, 0.39375, 0.509375, 0.5828125, 0.29375, 0.3671875, 0.546875, 0.2875, 0.88125, 0.5921875, 0.5390625, 0.571875, 0.5640625, 0.4109375, 0.4328125, 0.3453125, 0.5765625, 0.5203125, 0.75625, 0.50625, 0.5171875, 0.4453125, 0.43125, 0.375, 0.43125, 0.64375],
      avg: 0.5551809210526316
    },
    "Gill Sans": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2765625, 0.271875, 0.3546875, 0.584375, 0.5421875, 0.6765625, 0.625, 0.1890625, 0.3234375, 0.3234375, 0.4171875, 0.584375, 0.2203125, 0.3234375, 0.2203125, 0.28125, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.2203125, 0.2296875, 0.584375, 0.584375, 0.584375, 0.334375, 1.0109375, 0.6671875, 0.5640625, 0.709375, 0.75, 0.5, 0.4703125, 0.740625, 0.7296875, 0.25, 0.3125, 0.65625, 0.490625, 0.78125, 0.78125, 0.8234375, 0.5109375, 0.8234375, 0.6046875, 0.459375, 0.6046875, 0.709375, 0.6046875, 1.0421875, 0.709375, 0.6046875, 0.646875, 0.334375, 0.28125, 0.334375, 0.4703125, 0.5828125, 0.334375, 0.428125, 0.5, 0.4390625, 0.5109375, 0.4796875, 0.296875, 0.428125, 0.5, 0.2203125, 0.2265625, 0.5, 0.2203125, 0.771875, 0.5, 0.553125, 0.5, 0.5, 0.3984375, 0.3859375, 0.334375, 0.5, 0.4390625, 0.7203125, 0.5, 0.4390625, 0.4171875, 0.334375, 0.2609375, 0.334375, 0.584375],
      avg: 0.4933717105263159
    },
    Helvetica: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2796875, 0.2765625, 0.3546875, 0.5546875, 0.5546875, 0.8890625, 0.665625, 0.190625, 0.3328125, 0.3328125, 0.3890625, 0.5828125, 0.2765625, 0.3328125, 0.2765625, 0.3015625, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.2765625, 0.2765625, 0.584375, 0.5828125, 0.584375, 0.5546875, 1.0140625, 0.665625, 0.665625, 0.721875, 0.721875, 0.665625, 0.609375, 0.7765625, 0.721875, 0.2765625, 0.5, 0.665625, 0.5546875, 0.8328125, 0.721875, 0.7765625, 0.665625, 0.7765625, 0.721875, 0.665625, 0.609375, 0.721875, 0.665625, 0.94375, 0.665625, 0.665625, 0.609375, 0.2765625, 0.3546875, 0.2765625, 0.4765625, 0.5546875, 0.3328125, 0.5546875, 0.5546875, 0.5, 0.5546875, 0.5546875, 0.2765625, 0.5546875, 0.5546875, 0.221875, 0.240625, 0.5, 0.221875, 0.8328125, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.3328125, 0.5, 0.2765625, 0.5546875, 0.5, 0.721875, 0.5, 0.5, 0.5, 0.3546875, 0.259375, 0.353125, 0.5890625],
      avg: 0.5279276315789471
    },
    "Helvetica Neue": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.278125, 0.259375, 0.4265625, 0.55625, 0.55625, 1, 0.6453125, 0.278125, 0.2703125, 0.26875, 0.353125, 0.6, 0.278125, 0.3890625, 0.278125, 0.36875, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.278125, 0.278125, 0.6, 0.6, 0.6, 0.55625, 0.8, 0.6625, 0.6859375, 0.7234375, 0.7046875, 0.6125, 0.575, 0.759375, 0.7234375, 0.259375, 0.5203125, 0.6703125, 0.55625, 0.871875, 0.7234375, 0.7609375, 0.6484375, 0.7609375, 0.6859375, 0.6484375, 0.575, 0.7234375, 0.6140625, 0.9265625, 0.6125, 0.6484375, 0.6125, 0.259375, 0.36875, 0.259375, 0.6, 0.5, 0.25625, 0.5375, 0.59375, 0.5375, 0.59375, 0.5375, 0.2984375, 0.575, 0.55625, 0.2234375, 0.2375, 0.5203125, 0.2234375, 0.853125, 0.55625, 0.575, 0.59375, 0.59375, 0.334375, 0.5, 0.315625, 0.55625, 0.5, 0.759375, 0.51875, 0.5, 0.48125, 0.334375, 0.2234375, 0.334375, 0.6],
      avg: 0.5279440789473684
    },
    "Hoefler Text": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2359375, 0.2234375, 0.3921875, 0.7125, 0.49375, 0.8859375, 0.771875, 0.2125, 0.3078125, 0.309375, 0.375, 0.4234375, 0.234375, 0.3125, 0.234375, 0.3, 0.5828125, 0.365625, 0.434375, 0.3921875, 0.5234375, 0.3984375, 0.5125, 0.4328125, 0.46875, 0.5125, 0.234375, 0.234375, 0.515625, 0.4234375, 0.515625, 0.340625, 0.7609375, 0.7359375, 0.6359375, 0.721875, 0.8125, 0.6375, 0.5875, 0.8078125, 0.853125, 0.4296875, 0.503125, 0.78125, 0.609375, 0.9609375, 0.8515625, 0.8140625, 0.6125, 0.8140625, 0.71875, 0.49375, 0.7125, 0.76875, 0.771875, 1.125, 0.7765625, 0.7734375, 0.65625, 0.321875, 0.3078125, 0.321875, 0.3546875, 0.5, 0.3375, 0.446875, 0.5359375, 0.45, 0.5296875, 0.4546875, 0.425, 0.4921875, 0.54375, 0.2671875, 0.240625, 0.5390625, 0.25, 0.815625, 0.5375, 0.5234375, 0.5390625, 0.5421875, 0.365625, 0.36875, 0.35625, 0.5171875, 0.5015625, 0.75, 0.5, 0.509375, 0.44375, 0.2421875, 0.14375, 0.2421875, 0.35],
      avg: 0.5116447368421051
    },
    "Inter": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2796875, 0.2890625, 0.4671875, 0.634375, 0.6421875, 0.9828125, 0.6453125, 0.3, 0.365625, 0.365625, 0.5015625, 0.6625, 0.2890625, 0.4609375, 0.2890625, 0.3609375, 0.63125, 0.4078125, 0.6109375, 0.61875, 0.646875, 0.59375, 0.6203125, 0.5671875, 0.61875, 0.6203125, 0.2890625, 0.303125, 0.6625, 0.6625, 0.6625, 0.5125, 0.9671875, 0.690625, 0.6546875, 0.73125, 0.721875, 0.6015625, 0.590625, 0.746875, 0.74375, 0.26875, 0.571875, 0.671875, 0.565625, 0.9046875, 0.7546875, 0.765625, 0.6390625, 0.765625, 0.64375, 0.6421875, 0.646875, 0.7453125, 0.690625, 0.9859375, 0.6828125, 0.6796875, 0.6296875, 0.365625, 0.3609375, 0.365625, 0.471875, 0.45625, 0.3234375, 0.5625, 0.6125, 0.571875, 0.6125, 0.584375, 0.3703125, 0.6140625, 0.5921875, 0.2421875, 0.2548828125, 0.55, 0.2421875, 0.8765625, 0.5921875, 0.6, 0.6125, 0.6125, 0.3765625, 0.528125, 0.328125, 0.5921875, 0.5625, 0.81875, 0.546875, 0.5625, 0.553125, 0.4265625, 0.3328125, 0.4265625, 0.6625],
      avg: 0.5624362664473683
    },
    "Montserrat": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2625, 0.2609375, 0.3734375, 0.696875, 0.615625, 0.8296875, 0.6703125, 0.203125, 0.3296875, 0.3296875, 0.3875, 0.575, 0.2125, 0.3828125, 0.2125, 0.3953125, 0.6625, 0.3625, 0.56875, 0.5640625, 0.6625, 0.5671875, 0.609375, 0.5890625, 0.6390625, 0.609375, 0.2125, 0.2125, 0.575, 0.575, 0.575, 0.5671875, 1.034375, 0.7171875, 0.7546875, 0.7203125, 0.8265625, 0.6703125, 0.634375, 0.7734375, 0.8140625, 0.303125, 0.5078125, 0.7125, 0.5890625, 0.95625, 0.8140625, 0.8390625, 0.71875, 0.8390625, 0.7234375, 0.615625, 0.575, 0.7921875, 0.6984375, 1.1125, 0.65625, 0.6359375, 0.6515625, 0.31875, 0.396875, 0.31875, 0.5765625, 0.5, 0.6, 0.590625, 0.678125, 0.5640625, 0.678125, 0.6046875, 0.375, 0.6875, 0.678125, 0.2703125, 0.365625, 0.6015625, 0.2703125, 1.0625, 0.678125, 0.628125, 0.678125, 0.678125, 0.4015625, 0.4890625, 0.40625, 0.6734375, 0.5421875, 0.8796875, 0.534375, 0.5671875, 0.5125, 0.334375, 0.2953125, 0.334375, 0.575],
      avg: 0.571792763157895
    },
    monospace: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5984375, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6078125, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.61875, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.615625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6140625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625, 0.6015625],
      avg: 0.6020559210526316
    },
    Overpass: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2296875, 0.2765625, 0.4203125, 0.68125, 0.584375, 0.8515625, 0.7015625, 0.2203125, 0.3453125, 0.3453125, 0.53125, 0.63125, 0.2234375, 0.3953125, 0.2234375, 0.509375, 0.65, 0.4046875, 0.6171875, 0.60625, 0.6484375, 0.60625, 0.6015625, 0.5375, 0.615625, 0.6015625, 0.2234375, 0.2234375, 0.63125, 0.63125, 0.63125, 0.5015625, 0.8203125, 0.696875, 0.6671875, 0.65, 0.6859375, 0.6015625, 0.559375, 0.690625, 0.7078125, 0.2953125, 0.565625, 0.678125, 0.58125, 0.8046875, 0.7109375, 0.740625, 0.6421875, 0.740625, 0.6765625, 0.6046875, 0.590625, 0.696875, 0.6640625, 0.853125, 0.65, 0.6671875, 0.6625, 0.3734375, 0.509375, 0.3734375, 0.63125, 0.5125, 0.4, 0.5328125, 0.5625, 0.51875, 0.5625, 0.546875, 0.3359375, 0.5625, 0.565625, 0.25625, 0.3203125, 0.55, 0.265625, 0.85, 0.565625, 0.5671875, 0.5625, 0.5625, 0.4046875, 0.4765625, 0.3796875, 0.565625, 0.521875, 0.7265625, 0.53125, 0.5390625, 0.5125, 0.3671875, 0.275, 0.3671875, 0.63125],
      avg: 0.5430756578947369
    },
    Palatino: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.25, 0.278125, 0.371875, 0.60625, 0.5, 0.840625, 0.778125, 0.209375, 0.334375, 0.334375, 0.390625, 0.60625, 0.2578125, 0.334375, 0.25, 0.60625, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.25, 0.25, 0.60625, 0.60625, 0.60625, 0.4453125, 0.7484375, 0.778125, 0.6109375, 0.709375, 0.775, 0.6109375, 0.55625, 0.7640625, 0.8328125, 0.3375, 0.346875, 0.7265625, 0.6109375, 0.946875, 0.83125, 0.7875, 0.6046875, 0.7875, 0.66875, 0.525, 0.6140625, 0.778125, 0.7234375, 1, 0.6671875, 0.6671875, 0.6671875, 0.334375, 0.60625, 0.334375, 0.60625, 0.5, 0.334375, 0.5, 0.565625, 0.4453125, 0.6109375, 0.4796875, 0.340625, 0.55625, 0.5828125, 0.2921875, 0.2671875, 0.5640625, 0.2921875, 0.8828125, 0.5828125, 0.546875, 0.6015625, 0.5609375, 0.3953125, 0.425, 0.3265625, 0.603125, 0.565625, 0.834375, 0.5171875, 0.55625, 0.5, 0.334375, 0.60625, 0.334375, 0.60625],
      avg: 0.5408552631578947
    },
    "RedHatText": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2328125, 0.2203125, 0.35625, 0.6890625, 0.55, 0.7390625, 0.6703125, 0.2140625, 0.4015625, 0.4015625, 0.4546875, 0.53125, 0.2203125, 0.45625, 0.2203125, 0.515625, 0.6609375, 0.3078125, 0.5484375, 0.5875, 0.61875, 0.5703125, 0.6203125, 0.559375, 0.6140625, 0.6203125, 0.2203125, 0.2234375, 0.465625, 0.534375, 0.465625, 0.5125, 0.7671875, 0.6609375, 0.6703125, 0.7265625, 0.728125, 0.6203125, 0.6109375, 0.8, 0.73125, 0.253125, 0.6, 0.6125, 0.6078125, 0.8625, 0.7390625, 0.8109375, 0.6546875, 0.809375, 0.6484375, 0.6234375, 0.6171875, 0.7125, 0.6609375, 0.8984375, 0.6546875, 0.646875, 0.60625, 0.3625, 0.5203125, 0.3625, 0.540625, 0.4609375, 0.5234375, 0.5265625, 0.584375, 0.509375, 0.5828125, 0.5578125, 0.3703125, 0.5828125, 0.553125, 0.2234375, 0.24375, 0.4890625, 0.2234375, 0.8453125, 0.553125, 0.58125, 0.584375, 0.5828125, 0.353125, 0.453125, 0.378125, 0.553125, 0.5015625, 0.6984375, 0.4875, 0.4984375, 0.459375, 0.3953125, 0.2921875, 0.3953125, 0.58125],
      avg: 0.5341940789473685
    },
    "sans-serif": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.278125, 0.278125, 0.35625, 0.55625, 0.55625, 0.890625, 0.6671875, 0.1921875, 0.334375, 0.334375, 0.390625, 0.584375, 0.278125, 0.334375, 0.278125, 0.303125, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.55625, 0.278125, 0.278125, 0.5859375, 0.584375, 0.5859375, 0.55625, 1.015625, 0.6671875, 0.6671875, 0.7234375, 0.7234375, 0.6671875, 0.6109375, 0.778125, 0.7234375, 0.278125, 0.5, 0.6671875, 0.55625, 0.834375, 0.7234375, 0.778125, 0.6671875, 0.778125, 0.7234375, 0.6671875, 0.6109375, 0.7234375, 0.6671875, 0.9453125, 0.6671875, 0.6671875, 0.6109375, 0.278125, 0.35625, 0.278125, 0.478125, 0.55625, 0.334375, 0.55625, 0.55625, 0.5, 0.55625, 0.55625, 0.278125, 0.55625, 0.55625, 0.2234375, 0.2421875, 0.5, 0.2234375, 0.834375, 0.55625, 0.55625, 0.55625, 0.55625, 0.334375, 0.5, 0.278125, 0.55625, 0.5, 0.7234375, 0.5, 0.5, 0.5, 0.35625, 0.2609375, 0.3546875, 0.590625],
      avg: 0.5293256578947368
    },
    Seravek: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.215625, 0.296875, 0.4171875, 0.6734375, 0.4953125, 0.9125, 0.740625, 0.2421875, 0.3375, 0.3375, 0.409375, 0.60625, 0.2609375, 0.35625, 0.25625, 0.41875, 0.5921875, 0.3515625, 0.475, 0.4875, 0.5375, 0.509375, 0.5484375, 0.4546875, 0.5421875, 0.5484375, 0.25625, 0.2546875, 0.5875, 0.6171875, 0.5875, 0.4578125, 0.8140625, 0.6765625, 0.5703125, 0.6109375, 0.684375, 0.5109375, 0.4953125, 0.678125, 0.6859375, 0.2625, 0.2625, 0.5859375, 0.4734375, 0.846875, 0.709375, 0.740625, 0.509375, 0.740625, 0.584375, 0.5015625, 0.528125, 0.675, 0.5953125, 0.9453125, 0.596875, 0.540625, 0.540625, 0.359375, 0.4203125, 0.359375, 0.5109375, 0.421875, 0.4046875, 0.5015625, 0.5421875, 0.446875, 0.5453125, 0.484375, 0.38125, 0.5140625, 0.5546875, 0.240625, 0.2640625, 0.490625, 0.2765625, 0.8625, 0.5546875, 0.546875, 0.5453125, 0.5453125, 0.3625, 0.41875, 0.3890625, 0.5453125, 0.4703125, 0.7546875, 0.4921875, 0.4609375, 0.453125, 0.4015625, 0.2640625, 0.4015625, 0.58125],
      avg: 0.5044078947368421
    },
    serif: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2484375, 0.334375, 0.409375, 0.5, 0.5, 0.834375, 0.778125, 0.18125, 0.334375, 0.334375, 0.5, 0.5640625, 0.25, 0.334375, 0.25, 0.278125, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.278125, 0.278125, 0.5640625, 0.5640625, 0.5640625, 0.4453125, 0.921875, 0.7234375, 0.6671875, 0.6671875, 0.7234375, 0.6109375, 0.55625, 0.7234375, 0.7234375, 0.334375, 0.390625, 0.7234375, 0.6109375, 0.890625, 0.7234375, 0.7234375, 0.55625, 0.7234375, 0.6671875, 0.55625, 0.6109375, 0.7234375, 0.7234375, 0.9453125, 0.7234375, 0.7234375, 0.6109375, 0.334375, 0.340625, 0.334375, 0.4703125, 0.5, 0.3453125, 0.4453125, 0.5, 0.4453125, 0.5, 0.4453125, 0.3828125, 0.5, 0.5, 0.278125, 0.3359375, 0.5, 0.278125, 0.778125, 0.5, 0.5, 0.5, 0.5, 0.3375, 0.390625, 0.2796875, 0.5, 0.5, 0.7234375, 0.5, 0.5, 0.4453125, 0.48125, 0.2015625, 0.48125, 0.5421875],
      avg: 0.5126315789473684
    },
    Tahoma: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.3109375, 0.3328125, 0.4015625, 0.728125, 0.546875, 0.9765625, 0.70625, 0.2109375, 0.3828125, 0.3828125, 0.546875, 0.728125, 0.303125, 0.3640625, 0.303125, 0.3953125, 0.546875, 0.546875, 0.546875, 0.546875, 0.546875, 0.546875, 0.546875, 0.546875, 0.546875, 0.546875, 0.3546875, 0.3546875, 0.728125, 0.728125, 0.728125, 0.475, 0.909375, 0.6109375, 0.590625, 0.6015625, 0.6796875, 0.5625, 0.521875, 0.66875, 0.6765625, 0.3734375, 0.4171875, 0.6046875, 0.4984375, 0.771875, 0.66875, 0.7078125, 0.5515625, 0.7078125, 0.6375, 0.5578125, 0.5875, 0.65625, 0.60625, 0.903125, 0.58125, 0.5890625, 0.559375, 0.3828125, 0.39375, 0.3828125, 0.728125, 0.5625, 0.546875, 0.525, 0.553125, 0.4625, 0.553125, 0.5265625, 0.3546875, 0.553125, 0.5578125, 0.2296875, 0.328125, 0.51875, 0.2296875, 0.840625, 0.5578125, 0.54375, 0.553125, 0.553125, 0.3609375, 0.446875, 0.3359375, 0.5578125, 0.4984375, 0.7421875, 0.4953125, 0.4984375, 0.4453125, 0.48125, 0.3828125, 0.48125, 0.728125],
      avg: 0.5384374999999998
    },
    "Times New Roman": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2484375, 0.334375, 0.409375, 0.5, 0.5, 0.834375, 0.778125, 0.18125, 0.334375, 0.334375, 0.5, 0.5640625, 0.25, 0.334375, 0.25, 0.28125, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.278125, 0.278125, 0.5640625, 0.5640625, 0.5640625, 0.4453125, 0.921875, 0.7234375, 0.6671875, 0.6671875, 0.7234375, 0.6109375, 0.55625, 0.7234375, 0.7234375, 0.334375, 0.390625, 0.73125, 0.6109375, 0.890625, 0.7375, 0.7234375, 0.55625, 0.7234375, 0.6765625, 0.55625, 0.6109375, 0.7234375, 0.7234375, 0.9453125, 0.7234375, 0.7234375, 0.6109375, 0.334375, 0.28125, 0.334375, 0.4703125, 0.51875, 0.334375, 0.4453125, 0.503125, 0.4453125, 0.503125, 0.4453125, 0.4359375, 0.5, 0.5, 0.278125, 0.35625, 0.50625, 0.278125, 0.778125, 0.5, 0.5, 0.5046875, 0.5, 0.340625, 0.390625, 0.2796875, 0.5, 0.5, 0.7234375, 0.5, 0.5, 0.4453125, 0.48125, 0.2015625, 0.48125, 0.5421875],
      avg: 0.5134375
    },
    "Trebuchet MS": {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.3015625, 0.3671875, 0.325, 0.53125, 0.525, 0.6015625, 0.70625, 0.1609375, 0.3671875, 0.3671875, 0.3671875, 0.525, 0.3671875, 0.3671875, 0.3671875, 0.525, 0.525, 0.525, 0.525, 0.525, 0.525, 0.525, 0.525, 0.525, 0.525, 0.525, 0.3671875, 0.3671875, 0.525, 0.525, 0.525, 0.3671875, 0.771875, 0.590625, 0.5671875, 0.5984375, 0.6140625, 0.5359375, 0.525, 0.6765625, 0.6546875, 0.2796875, 0.4765625, 0.5765625, 0.5078125, 0.7109375, 0.6390625, 0.675, 0.5578125, 0.7421875, 0.5828125, 0.48125, 0.58125, 0.6484375, 0.5875, 0.853125, 0.5578125, 0.5703125, 0.5515625, 0.3671875, 0.3578125, 0.3671875, 0.525, 0.53125, 0.525, 0.5265625, 0.5578125, 0.4953125, 0.5578125, 0.546875, 0.375, 0.503125, 0.546875, 0.2859375, 0.3671875, 0.5046875, 0.2953125, 0.83125, 0.546875, 0.5375, 0.5578125, 0.5578125, 0.3890625, 0.40625, 0.396875, 0.546875, 0.490625, 0.7453125, 0.5015625, 0.49375, 0.475, 0.3671875, 0.525, 0.3671875, 0.525],
      avg: 0.5085197368421052
    },
    Verdana: {
      widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.35, 0.39375, 0.459375, 0.81875, 0.6359375, 1.0765625, 0.759375, 0.26875, 0.4546875, 0.4546875, 0.6359375, 0.81875, 0.3640625, 0.4546875, 0.3640625, 0.4703125, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.6359375, 0.4546875, 0.4546875, 0.81875, 0.81875, 0.81875, 0.546875, 1, 0.684375, 0.6859375, 0.6984375, 0.771875, 0.6328125, 0.575, 0.7765625, 0.7515625, 0.421875, 0.4546875, 0.69375, 0.5578125, 0.84375, 0.7484375, 0.7875, 0.603125, 0.7875, 0.7, 0.684375, 0.6171875, 0.7328125, 0.684375, 0.9890625, 0.6859375, 0.615625, 0.6859375, 0.4546875, 0.46875, 0.4546875, 0.81875, 0.6421875, 0.6359375, 0.6015625, 0.6234375, 0.521875, 0.6234375, 0.596875, 0.384375, 0.6234375, 0.6328125, 0.275, 0.3765625, 0.5921875, 0.275, 0.9734375, 0.6328125, 0.6078125, 0.6234375, 0.6234375, 0.43125, 0.521875, 0.3953125, 0.6328125, 0.5921875, 0.81875, 0.5921875, 0.5921875, 0.5265625, 0.6359375, 0.4546875, 0.6359375, 0.81875],
      avg: 0.6171875000000003
    }
  };
  var absoluteMeasurementUnitsToPixels = {
    mm: 3.8,
    sm: 38,
    pt: 1.33,
    pc: 16,
    in: 96,
    px: 1
  };
  var relativeMeasurementUnitsCoef = {
    em: 1,
    ex: 0.5
  };
  var coefficients = {
    heightOverlapCoef: 1.05,
    // Coefficient for height value to prevent overlap.
    lineCapitalCoef: 1.15
    // Coefficient for height value. Reserve space for capital chars.
  };
  var defaultStyle = {
    lineHeight: 1,
    letterSpacing: "0px",
    fontSize: 0,
    angle: 0,
    fontFamily: ""
  };
  var _degreeToRadian = (angle) => angle * Math.PI / 180;
  var _getFontData = (fontFamily) => {
    const possibleFonts = fontFamily.split(",").map((f) => f.replace(/'|"/g, ""));
    const fontMatch = possibleFonts.find((f) => fonts[f]) || "Helvetica";
    return fonts[fontMatch];
  };
  var _splitToLines = (text) => {
    return Array.isArray(text) ? text : text.toString().split(/\r\n|\r|\n/g);
  };
  var _getSizeWithRotate = (axisSize, dependentSize, angle) => {
    const angleInRadian = _degreeToRadian(angle);
    return Math.abs(Math.cos(angleInRadian) * axisSize) + Math.abs(Math.sin(angleInRadian) * dependentSize);
  };
  var convertLengthToPixels = (length, fontSize4) => {
    const attribute = length.match(/[a-zA-Z%]+/)?.[0];
    const value = Number(length.match(/[0-9.,]+/));
    let result;
    if (!attribute) {
      result = value || 0;
    } else if (absoluteMeasurementUnitsToPixels.hasOwnProperty(attribute)) {
      result = value * absoluteMeasurementUnitsToPixels[attribute];
    } else if (relativeMeasurementUnitsCoef.hasOwnProperty(attribute)) {
      result = (fontSize4 ? value * fontSize4 : value * defaultStyle.fontSize) * relativeMeasurementUnitsCoef[attribute];
    } else {
      result = value;
    }
    return result;
  };
  var _prepareParams = (inputStyle, index) => {
    const lineStyle = Array.isArray(inputStyle) ? inputStyle[index] : inputStyle;
    const style = (0, import_defaults8.default)({}, lineStyle, defaultStyle);
    return Object.assign({}, style, {
      fontFamily: style.fontFamily,
      letterSpacing: typeof style.letterSpacing === "number" ? style.letterSpacing : convertLengthToPixels(String(style.letterSpacing), style.fontSize),
      fontSize: typeof style.fontSize === "number" ? style.fontSize : convertLengthToPixels(String(style.fontSize))
    });
  };
  var _approximateTextWidthInternal = (text, style) => {
    if (text === void 0 || text === "" || text === null) {
      return 0;
    }
    const widths = _splitToLines(text).map((line, index) => {
      const len = line.toString().length;
      const {
        fontSize: fontSize4,
        letterSpacing: letterSpacing4,
        fontFamily
      } = _prepareParams(style, index);
      const fontData = _getFontData(fontFamily);
      const width = line.toString().split("").map((c2) => {
        return c2.charCodeAt(0) < fontData.widths.length ? fontData.widths[c2.charCodeAt(0)] : fontData.avg;
      }).reduce((cur, acc) => acc + cur, 0) * fontSize4;
      return width + letterSpacing4 * Math.max(len - 1, 0);
    });
    return Math.max(...widths);
  };
  var _approximateTextHeightInternal = (text, style) => {
    if (text === void 0 || text === "" || text === null) {
      return 0;
    }
    return _splitToLines(text).reduce((total, line, index) => {
      const lineStyle = _prepareParams(style, index);
      const containsCaps = line.toString().match(/[(A-Z)(0-9)]/);
      const height = containsCaps ? lineStyle.fontSize * coefficients.lineCapitalCoef : lineStyle.fontSize;
      return total + lineStyle.lineHeight * height;
    }, 0);
  };
  var _approximateDimensionsInternal = (text, style) => {
    const angle = Array.isArray(style) ? style[0] && style[0].angle : style && style.angle;
    const height = _approximateTextHeightInternal(text, style);
    const width = _approximateTextWidthInternal(text, style);
    const widthWithRotate = angle ? _getSizeWithRotate(width, height, angle) : width;
    const heightWithRotate = angle ? _getSizeWithRotate(height, width, angle) : height;
    return {
      width: widthWithRotate,
      height: heightWithRotate * coefficients.heightOverlapCoef
    };
  };
  var _getMeasurementContainer = (0, import_memoize.default)(() => {
    const element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
    element.setAttribute("xlink", "http://www.w3.org/1999/xlink");
    element.setAttribute("width", "300");
    element.setAttribute("height", "300");
    element.setAttribute("viewBox", "0 0 300 300");
    element.setAttribute("aria-hidden", "true");
    const containerElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
    element.appendChild(containerElement);
    element.style.position = "fixed";
    element.style.top = "-9999px";
    element.style.left = "-9999px";
    document.body.appendChild(element);
    return containerElement;
  });
  var styleToKeyComponent = (style) => {
    if (!style) {
      return "null";
    }
    return `${style.angle}:${style.fontFamily}:${style.fontSize}:${style.letterSpacing}:${style.lineHeight}`;
  };
  var _measureDimensionsInternal = (0, import_memoize.default)((text, style) => {
    let containerElement = _getMeasurementContainer();
    if (!containerElement.isConnected) {
      _getMeasurementContainer.cache.clear?.();
      containerElement = _getMeasurementContainer();
    }
    const lines = _splitToLines(text);
    let heightAcc = 0;
    for (const [i, line] of lines.entries()) {
      const textElement = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
      const params = _prepareParams(style, i);
      textElement.style.fontFamily = params.fontFamily;
      textElement.style.fontSize = `${params.fontSize}px`;
      textElement.style.lineHeight = params.lineHeight;
      textElement.style.fontFamily = params.fontFamily;
      textElement.style.letterSpacing = params.letterSpacing;
      textElement.textContent = line;
      textElement.setAttribute("x", "0");
      textElement.setAttribute("y", `${heightAcc}`);
      containerElement.appendChild(textElement);
      heightAcc += params.lineHeight * textElement.getBoundingClientRect().height;
    }
    const {
      width
    } = containerElement.getBoundingClientRect();
    containerElement.innerHTML = "";
    return {
      width: style?.angle ? _getSizeWithRotate(width, heightAcc, style?.angle) : width,
      height: style?.angle ? _getSizeWithRotate(heightAcc, width, style?.angle) : heightAcc
    };
  }, (text, style) => {
    const totalText = Array.isArray(text) ? text.join() : text;
    const totalStyle = Array.isArray(style) ? style.map(styleToKeyComponent).join() : styleToKeyComponent(style);
    return `${totalText}::${totalStyle}`;
  });
  var _approximateTextSizeInternal = {
    impl: function(text, style, __debugForceApproximate) {
      if (__debugForceApproximate === void 0) {
        __debugForceApproximate = false;
      }
      const isClient = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
      if (!isClient || __debugForceApproximate) {
        return _approximateDimensionsInternal(text, style);
      }
      return _measureDimensionsInternal(text, style);
    }
  };
  var approximateTextSize = (text, style) => _approximateTextSizeInternal.impl(text, style);

  // node_modules/victory-core/es/victory-util/wrapper.js
  var wrapper_exports = {};
  __export(wrapper_exports, {
    addBinsToParentPropsIfHistogram: () => addBinsToParentPropsIfHistogram,
    getAllEvents: () => getAllEvents,
    getCategories: () => getCategories2,
    getCategoryAndAxisStringsFromChildren: () => getCategoryAndAxisStringsFromChildren,
    getChildStyle: () => getChildStyle,
    getColor: () => getColor,
    getData: () => getData2,
    getDataFromChildren: () => getDataFromChildren,
    getDefaultDomainPadding: () => getDefaultDomainPadding,
    getDomain: () => getDomain3,
    getDomainFromChildren: () => getDomainFromChildren,
    getScale: () => getScale,
    getStringsFromChildren: () => getStringsFromChildren,
    getStringsFromChildrenCategories: () => getStringsFromChildrenCategories,
    getStringsFromData: () => getStringsFromData2,
    getStyle: () => getStyle,
    getWidth: () => getWidth
  });
  var import_react70 = __toESM(require_react());
  var import_defaults9 = __toESM(require_defaults());
  var import_uniq4 = __toESM(require_uniq());
  var import_groupBy = __toESM(require_groupBy());
  var import_uniqBy = __toESM(require_uniqBy());
  function addBinsToParentPropsIfHistogram(_ref) {
    let {
      children,
      props,
      childComponents,
      parentProps
    } = _ref;
    const someChildrenAreHistograms = children.some((child) => {
      return child.type && child.type.role === "histogram";
    });
    const allChildrenAreHistograms = someChildrenAreHistograms && children.length && children.every((child) => {
      return child.type && child.type.role === "histogram";
    });
    if (someChildrenAreHistograms && !allChildrenAreHistograms) {
      warn("VictoryHistogram only supports being stacked with other VictoryHistogram components. Check to make sure that you are only passing VictoryHistogram components to VictoryStack");
    }
    if (!allChildrenAreHistograms) {
      return parentProps;
    }
    let childBins = props.bins || childComponents[0].props.bins;
    if (!Array.isArray(childBins)) {
      const combinedData = children.reduce((memo4, child) => {
        const xAccessor = createAccessor(child.props.x || "x");
        return memo4.concat(child.props.data.map((datum) => ({
          x: xAccessor(datum)
        })));
      }, []);
      const getFormattedHistogramData = children[0].type.getFormattedData;
      childBins = getFormattedHistogramData({
        data: combinedData,
        bins: childBins
      }).reduce((memo4, _ref2, index) => {
        let {
          x0,
          x1
        } = _ref2;
        return index === 0 ? memo4.concat([x0, x1]) : memo4.concat(x1);
      }, []);
    }
    return {
      ...parentProps,
      bins: childBins
    };
  }
  function getDataFromChildren(props, childComponents) {
    const {
      polar,
      startAngle,
      endAngle,
      categories,
      minDomain,
      maxDomain
    } = props;
    let parentProps = {
      polar,
      startAngle,
      endAngle,
      categories,
      minDomain,
      maxDomain
    };
    let stack = 0;
    const children = childComponents ? childComponents.slice(0) : import_react70.default.Children.toArray(props.children);
    parentProps = addBinsToParentPropsIfHistogram({
      children,
      props,
      childComponents,
      parentProps
    });
    const iteratee = (child, childName, parent2) => {
      const childProps = Object.assign({}, child.props, parentProps);
      let childData;
      let childElement = child;
      if (!isDataComponent(child)) {
        return null;
      } else if (child.type && isFunction(child.type.getData)) {
        childElement = parent2 ? /* @__PURE__ */ import_react70.default.cloneElement(child, parent2.props) : child;
        childData = childElement.type.getData(childProps);
      } else {
        childData = getData(childProps);
      }
      stack += 1;
      return childData.map((datum, index) => Object.assign({
        _stack: stack,
        _group: index
      }, datum));
    };
    const stacked = children.filter((c2) => c2.type && c2.type.role === "stack").length;
    const combine = (memo4, val) => memo4.concat((0, import_uniqBy.default)(val, "_group"));
    const datasets = reduceChildren(children, iteratee, props, [], combine);
    const group = stacked ? "_group" : "_stack";
    return Object.values((0, import_groupBy.default)(datasets, group));
  }
  function getData2(props, childComponents) {
    if (props.data) {
      return getData(props);
    }
    return getDataFromChildren(props, childComponents || import_react70.default.Children.toArray(props.children));
  }
  function getWidth(props, groupLength, seriesLength) {
    const {
      datasets,
      horizontal
    } = props;
    const range4 = horizontal ? getRange(props, "y") : getRange(props, "x");
    const extent = Math.abs(range4[1] - range4[0]);
    const seriesLengthValue = seriesLength !== void 0 ? seriesLength : Array.isArray(datasets[0]) && datasets[0].length || 1;
    const groupLengthValue = groupLength || datasets.length;
    const bars = groupLengthValue * seriesLengthValue;
    const barRatio = 0.5;
    return Math.round(barRatio * extent / bars);
  }
  function getDefaultDomainPadding(props, axis, childComponents) {
    if (props.polar || axis !== "x") {
      return void 0;
    }
    const groupComponent = childComponents.filter((child) => {
      return child.type && child.type.role && child.type.role === "group";
    });
    if (groupComponent.length < 1) {
      return void 0;
    }
    const {
      offset: offset2,
      children
    } = groupComponent[0].props;
    if (!offset2) {
      return void 0;
    }
    const firstChild = Array.isArray(children) && children[0];
    if (!firstChild) {
      return void 0;
    }
    let barWidth = firstChild.props.barWidth;
    let dataLength = firstChild.props.data && firstChild.props.data.length || 1;
    if (firstChild && firstChild.type.role === "stack") {
      const nestedChild = firstChild.props.children && firstChild.props.children[0];
      if (!nestedChild) {
        return void 0;
      }
      barWidth = nestedChild.props.barWidth;
      dataLength = firstChild.props.children.length;
    }
    const width = barWidth || getWidth(props, children.length, dataLength);
    return {
      x: width * children.length / 2 + (offset2 - width * ((children.length - 1) / 2))
    };
  }
  function getDomainFromChildren(props, axis, childComponents) {
    const children = childComponents ? childComponents.slice(0) : import_react70.default.Children.toArray(props.children);
    const parentData = props.data ? getData(props) : void 0;
    const {
      polar,
      startAngle,
      endAngle,
      categories,
      minDomain,
      maxDomain,
      horizontal
    } = props;
    const baseParentProps = {
      horizontal,
      polar,
      startAngle,
      endAngle,
      minDomain,
      maxDomain,
      categories
    };
    const parentProps = parentData ? Object.assign(baseParentProps, {
      data: parentData
    }) : baseParentProps;
    const iteratee = (child) => {
      const sharedProps = Object.assign({}, child.props, parentProps);
      if (!isDomainComponent(child)) {
        return null;
      } else if (child.type && isFunction(child.type.getDomain)) {
        return child.props && child.type.getDomain(sharedProps, axis);
      }
      return getDomain(sharedProps, axis);
    };
    const childDomains = reduceChildren(children, iteratee, props);
    const min3 = childDomains.length === 0 ? 0 : getMinValue(childDomains);
    const max3 = childDomains.length === 0 ? 1 : getMaxValue(childDomains);
    return [min3, max3];
  }
  function getDomain3(props, axis, childComponents) {
    const children = childComponents || import_react70.default.Children.toArray(props.children);
    const propsDomain = getDomainFromProps(props, axis);
    const domainPadding = getDefaultDomainPadding(props, axis, children);
    let domain;
    if (propsDomain) {
      domain = propsDomain;
    } else {
      const minDomain = getMinFromProps(props, axis);
      const maxDomain = getMaxFromProps(props, axis);
      const dataset = (props.data || props.y) && getData(props);
      const dataDomain = dataset ? getDomainFromData(props, axis, dataset) : [];
      const childDomain = getDomainFromChildren(props, axis, children);
      const min3 = minDomain || getMinValue([...dataDomain, ...childDomain]);
      const max3 = maxDomain || getMaxValue([...dataDomain, ...childDomain]);
      domain = getDomainFromMinMax(min3, max3);
    }
    return formatDomain(domain, Object.assign({
      domainPadding
    }, props), axis);
  }
  function getScale(props, axis, childComponents) {
    if (props.data) {
      return getBaseScale(props, axis);
    }
    const children = childComponents ? childComponents.slice(0) : import_react70.default.Children.toArray(props.children);
    const iteratee = (child) => {
      const sharedProps = Object.assign({}, child.props, {
        horizontal: props.horizontal
      });
      return getScaleType(sharedProps, axis);
    };
    const childScale = (0, import_uniq4.default)(reduceChildren(children, iteratee, props));
    return childScale.length > 1 ? getScaleFromName("linear") : getScaleFromName(childScale[0]);
  }
  function getAllEvents(props) {
    const components = ["groupComponent", "containerComponent", "labelComponent"];
    const componentEvents = getComponentEvents(props, components);
    let events = props.events;
    if (Array.isArray(componentEvents)) {
      events = Array.isArray(props.events) ? componentEvents.concat(...props.events) : componentEvents;
    }
    return events || [];
  }
  function getColor(calculatedProps, child, index, theme) {
    const {
      style
    } = calculatedProps;
    let {
      colorScale: colorScale4,
      color: color2
    } = calculatedProps;
    if (style && style.data && style.data.fill) {
      return style.data.fill;
    }
    colorScale4 = child.props && child.props.colorScale ? child.props.colorScale : colorScale4;
    color2 = child.props && child.props.color ? child.props.color : color2;
    if (!colorScale4 && !color2) {
      return void 0;
    }
    const colors4 = Array.isArray(colorScale4) ? colorScale4 : getColorScale(colorScale4, theme);
    return color2 || colors4[index % colors4.length];
  }
  function getStyle(theme, style, role) {
    const defaultStyle2 = theme && theme[role] && theme[role].style ? theme[role].style : {};
    return getStyles(style, defaultStyle2);
  }
  function getChildStyle(child, index, calculatedProps, theme) {
    const {
      style,
      role
    } = calculatedProps;
    const childStyle = child.props.style || {};
    if (Array.isArray(childStyle)) {
      return childStyle;
    }
    const childRole = child.type && child.type.role;
    const defaultFill = childRole === "stack" ? void 0 : getColor(calculatedProps, child, index, theme);
    const defaultColor2 = childRole === "line" ? {
      fill: "none",
      stroke: defaultFill
    } : {
      fill: defaultFill
    };
    const dataWidth = role === "stack" ? {} : {
      width: getWidth(calculatedProps)
    };
    const dataStyle = (0, import_defaults9.default)({}, childStyle.data, Object.assign({}, dataWidth, style.data, defaultColor2));
    const labelsStyle = (0, import_defaults9.default)({}, childStyle.labels, style.labels);
    return {
      ...childStyle,
      parent: style.parent,
      data: dataStyle,
      labels: labelsStyle
    };
  }
  function getStringsFromChildrenCategories(childComponents, axis) {
    const iteratee = (child) => {
      if (!isDomainComponent(child)) {
        return null;
      }
      const childProps = child.props || {};
      return getStringsFromCategories(childProps, axis);
    };
    return reduceChildren(childComponents.slice(0), iteratee);
  }
  function getStringsFromData2(childComponents) {
    const iteratee = (child) => {
      const childProps = child.props || {};
      let data;
      if (!isDataComponent(child)) {
        return null;
      } else if (child.type && isFunction(child.type.getData)) {
        data = child.type.getData(childProps);
      } else {
        data = getData(childProps);
      }
      return data.map((d) => ({
        x: d.xName,
        y: d.yName
      }));
    };
    const initialMemo = {
      x: [],
      y: []
    };
    const combine = (memo4, datum) => {
      const x2 = Array.isArray(datum) ? datum.map((d) => d.x).filter(Boolean) : datum.x;
      const y2 = Array.isArray(datum) ? datum.map((d) => d.y).filter(Boolean) : datum.y;
      return {
        x: x2 !== void 0 ? memo4.x.concat(x2) : memo4.x,
        y: y2 !== void 0 ? memo4.y.concat(y2) : memo4.y
      };
    };
    return reduceChildren(childComponents.slice(0), iteratee, {}, initialMemo, combine);
  }
  function getCategoryAndAxisStringsFromChildren(props, axis, childComponents) {
    const categories = getStringsFromCategories(props, axis);
    const axisComponent = getAxisComponent(childComponents, axis);
    const axisStrings = axisComponent ? getStringsFromAxes(axisComponent.props, axis) : [];
    const categoryStrings = categories.length ? categories : getStringsFromChildrenCategories(childComponents, axis);
    return (0, import_uniq4.default)([...categoryStrings, ...axisStrings].flat());
  }
  function getStringsFromChildren(props, childComponents) {
    const children = childComponents || import_react70.default.Children.toArray(props.children);
    const xStrings = getCategoryAndAxisStringsFromChildren(props, "x", children);
    const yStrings = getCategoryAndAxisStringsFromChildren(props, "y", children);
    const dataStrings = getStringsFromData2(children);
    return {
      x: (0, import_uniq4.default)([...xStrings, ...dataStrings.x].flat()),
      y: (0, import_uniq4.default)([...yStrings, ...dataStrings.y].flat())
    };
  }
  function getCategories2(props, childComponents, allStrings) {
    const xPropCategories = props.categories && getStringsFromCategories(props, "x");
    const yPropCategories = props.categories && getStringsFromCategories(props, "y");
    const fallbackRequired = !xPropCategories || !yPropCategories;
    const fallbackProps12 = fallbackRequired ? allStrings || getStringsFromChildren(props, childComponents) : {};
    const xCategories = xPropCategories || fallbackProps12.x;
    const yCategories = yPropCategories || fallbackProps12.y;
    return {
      x: xCategories.length > 0 ? xCategories : void 0,
      y: yCategories.length > 0 ? yCategories : void 0
    };
  }

  // node_modules/victory-core/es/victory-portal/portal-outlet.js
  var import_react72 = __toESM(require_react());

  // node_modules/victory-core/es/victory-portal/portal-context.js
  var import_react71 = __toESM(require_react());
  var PortalContext = /* @__PURE__ */ import_react71.default.createContext(void 0);
  PortalContext.displayName = "PortalContext";
  var usePortalContext = () => {
    const context = import_react71.default.useContext(PortalContext);
    return context;
  };
  var PortalProvider = (_ref) => {
    let {
      children
    } = _ref;
    const [portalChildren, setPortalChildren] = import_react71.default.useState(/* @__PURE__ */ new Map());
    const addChild = import_react71.default.useCallback((id, element) => {
      setPortalChildren((prevChildren) => {
        const nextChildren = new Map(prevChildren);
        nextChildren.set(id, element);
        return nextChildren;
      });
    }, [setPortalChildren]);
    const removeChild = import_react71.default.useCallback((id) => {
      setPortalChildren((prevChildren) => {
        const nextChildren = new Map(prevChildren);
        nextChildren.delete(id);
        return nextChildren;
      });
    }, [setPortalChildren]);
    const contextValue = import_react71.default.useMemo(() => ({
      addChild,
      removeChild,
      children: portalChildren
    }), [addChild, removeChild, portalChildren]);
    return /* @__PURE__ */ import_react71.default.createElement(PortalContext.Provider, {
      value: contextValue
    }, children);
  };

  // node_modules/victory-core/es/victory-portal/portal-outlet.js
  var PortalOutlet = (_ref) => {
    let {
      as: portalComponent,
      ...props
    } = _ref;
    const portalContext = usePortalContext();
    if (!portalContext) {
      return null;
    }
    const children = Array.from(portalContext.children.values());
    return /* @__PURE__ */ import_react72.default.cloneElement(portalComponent, props, children);
  };

  // node_modules/victory-core/es/victory-container/victory-container.js
  function _extends3() {
    _extends3 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends3.apply(this, arguments);
  }
  var defaultProps2 = {
    className: "VictoryContainer",
    portalComponent: /* @__PURE__ */ import_react73.default.createElement(Portal, null),
    portalZIndex: 99,
    responsive: true,
    role: "img"
  };
  function useVictoryContainer(initialProps) {
    const props = {
      ...defaultProps2,
      ...initialProps
    };
    const {
      title,
      desc,
      width,
      height,
      responsive
    } = props;
    const localContainerRef = (0, import_react73.useRef)(null);
    const generatedId = (0, import_react73.useRef)((0, import_uniqueId.default)("victory-container-"));
    const containerId = props.containerId ?? generatedId.current;
    const getIdForElement = (elName) => `${containerId}-${elName}`;
    const userProps = getSafeUserProps(props);
    const dimensions = responsive ? {
      width: "100%",
      height: "100%"
    } : {
      width,
      height
    };
    const viewBox = responsive ? `0 0 ${width} ${height}` : void 0;
    const preserveAspectRatio = responsive ? props.preserveAspectRatio : void 0;
    const ariaLabelledBy = [title && getIdForElement("title"), props["aria-labelledby"]].filter(Boolean).join(" ") || void 0;
    const ariaDescribedBy = [desc && getIdForElement("desc"), props["aria-describedby"]].filter(Boolean).join(" ") || void 0;
    const titleId = getIdForElement("title");
    const descId = getIdForElement("desc");
    return {
      ...props,
      titleId,
      descId,
      dimensions,
      viewBox,
      preserveAspectRatio,
      ariaLabelledBy,
      ariaDescribedBy,
      userProps,
      localContainerRef
    };
  }
  var VictoryContainer = (initialProps) => {
    const {
      role,
      title,
      desc,
      children,
      className,
      portalZIndex,
      portalComponent,
      width,
      height,
      style,
      tabIndex,
      responsive,
      events,
      ouiaId,
      ouiaSafe,
      ouiaType,
      dimensions,
      ariaDescribedBy,
      ariaLabelledBy,
      viewBox,
      preserveAspectRatio,
      userProps,
      titleId,
      descId,
      containerRef,
      localContainerRef
    } = useVictoryContainer(initialProps);
    import_react73.default.useEffect(() => {
      if (!events?.onWheel) return;
      const handleWheel = (e) => e.preventDefault();
      const container = localContainerRef?.current;
      container?.addEventListener("wheel", handleWheel);
      return () => {
        container?.removeEventListener("wheel", handleWheel);
      };
    }, []);
    return /* @__PURE__ */ import_react73.default.createElement("div", {
      className,
      style: {
        ...style,
        width: responsive ? style?.width : dimensions.width,
        height: responsive ? style?.height : dimensions.height,
        pointerEvents: style?.pointerEvents ?? "none",
        touchAction: style?.touchAction ?? "none",
        position: style?.position ?? "relative"
      },
      "data-ouia-component-id": ouiaId,
      "data-ouia-component-type": ouiaType,
      "data-ouia-safe": ouiaSafe,
      ref: mergeRefs([localContainerRef, containerRef])
    }, /* @__PURE__ */ import_react73.default.createElement(PortalProvider, null, /* @__PURE__ */ import_react73.default.createElement("svg", _extends3({
      width,
      height,
      tabIndex,
      role,
      "aria-labelledby": ariaLabelledBy,
      "aria-describedby": ariaDescribedBy,
      viewBox,
      preserveAspectRatio,
      style: {
        ...dimensions,
        pointerEvents: "all"
      }
    }, userProps, events), title ? /* @__PURE__ */ import_react73.default.createElement("title", {
      id: titleId
    }, title) : null, desc ? /* @__PURE__ */ import_react73.default.createElement("desc", {
      id: descId
    }, desc) : null, children), /* @__PURE__ */ import_react73.default.createElement("div", {
      style: {
        ...dimensions,
        zIndex: portalZIndex,
        position: "absolute",
        top: 0,
        left: 0
      }
    }, /* @__PURE__ */ import_react73.default.createElement(PortalOutlet, {
      as: portalComponent,
      width,
      height,
      viewBox,
      preserveAspectRatio,
      style: {
        ...dimensions,
        overflow: "visible"
      }
    }))));
  };
  VictoryContainer.role = "container";

  // node_modules/victory-core/es/victory-label/victory-label.js
  var import_react78 = __toESM(require_react());
  var import_defaults11 = __toESM(require_defaults());
  var import_isEmpty4 = __toESM(require_isEmpty());

  // node_modules/victory-core/es/victory-portal/victory-portal.js
  var import_react74 = __toESM(require_react());
  var import_defaults10 = __toESM(require_defaults());
  var import_uniqueId2 = __toESM(require_uniqueId());
  var defaultProps3 = {
    groupComponent: /* @__PURE__ */ import_react74.default.createElement("g", null)
  };
  var VictoryPortal = (initialProps) => {
    const props = {
      ...defaultProps3,
      ...initialProps
    };
    const [id] = (0, import_react74.useState)((0, import_uniqueId2.default)());
    const portalContext = usePortalContext();
    if (!portalContext) {
      const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. Component will be rendered in place";
      warn(msg);
    }
    const children = Array.isArray(props.children) ? props.children[0] : props.children;
    const {
      groupComponent
    } = props;
    const childProps = children && children.props || {};
    const standardProps = childProps.groupComponent ? {
      groupComponent,
      standalone: false
    } : {};
    const newProps = (0, import_defaults10.default)(standardProps, childProps, omit(props, ["children", "groupComponent"]), {
      key: childProps.key ?? id
    });
    const child = children && /* @__PURE__ */ import_react74.default.cloneElement(children, newProps);
    import_react74.default.useEffect(() => {
      portalContext?.addChild(id, child);
    }, [props.children]);
    import_react74.default.useEffect(() => {
      return () => portalContext?.removeChild(id);
    }, []);
    return portalContext ? null : child;
  };
  VictoryPortal.role = "portal";

  // node_modules/victory-core/es/victory-primitives/rect.js
  var import_react75 = __toESM(require_react());
  function _extends4() {
    _extends4 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends4.apply(this, arguments);
  }
  var Rect = /* @__PURE__ */ (0, import_react75.forwardRef)((props, ref) => {
    const {
      desc,
      id,
      tabIndex,
      origin,
      ...rest
    } = props;
    const svgProps = {
      vectorEffect: "non-scaling-stroke",
      id: evaluateProp(id, props)?.toString(),
      tabIndex: evaluateProp(tabIndex, props),
      ...rest
    };
    return desc ? /* @__PURE__ */ import_react75.default.createElement("rect", _extends4({}, svgProps, {
      ref
    }), /* @__PURE__ */ import_react75.default.createElement("desc", null, desc)) : /* @__PURE__ */ import_react75.default.createElement("rect", _extends4({}, svgProps, {
      ref
    }));
  });

  // node_modules/victory-core/es/victory-primitives/text.js
  var import_react76 = __toESM(require_react());
  var Text2 = (props) => {
    const {
      children,
      desc,
      id,
      origin,
      tabIndex,
      title,
      ...rest
    } = props;
    const svgProps = {
      id: evaluateProp(id, props)?.toString(),
      tabIndex: evaluateProp(tabIndex, props),
      ...rest
    };
    return /* @__PURE__ */ import_react76.default.createElement("text", svgProps, title && /* @__PURE__ */ import_react76.default.createElement("title", null, title), desc && /* @__PURE__ */ import_react76.default.createElement("desc", null, desc), children);
  };

  // node_modules/victory-core/es/victory-primitives/tspan.js
  var import_react77 = __toESM(require_react());
  var TSpan = (props) => {
    const {
      desc,
      id,
      tabIndex,
      origin,
      ...rest
    } = props;
    const svgProps = {
      id: evaluateProp(id, props)?.toString(),
      tabIndex: evaluateProp(tabIndex, props),
      ...rest
    };
    return /* @__PURE__ */ import_react77.default.createElement("tspan", svgProps);
  };

  // node_modules/victory-core/es/victory-label/victory-label.js
  var defaultStyles = {
    fill: "#252525",
    fontSize: 14,
    fontFamily: "'Gill Sans', 'Gill Sans MT', 'Ser\xADavek', 'Trebuchet MS', sans-serif",
    stroke: "transparent"
  };
  var getPosition2 = (props, dimension) => {
    if (!props.datum) {
      return 0;
    }
    const scaledPoint = scalePoint(props, props.datum);
    return scaledPoint[dimension];
  };
  var getFontSize = (style) => {
    const baseSize = style && style.fontSize;
    if (typeof baseSize === "number") {
      return baseSize;
    } else if (baseSize === void 0 || baseSize === null) {
      return defaultStyles.fontSize;
    } else if (typeof baseSize === "string") {
      const fontSize4 = Number(baseSize.replace("px", ""));
      if (!isNaN(fontSize4)) {
        return fontSize4;
      }
      warn("fontSize should be expressed as a number of pixels");
      return defaultStyles.fontSize;
    }
    return defaultStyles.fontSize;
  };
  var getSingleValue = function(prop, index) {
    if (index === void 0) {
      index = 0;
    }
    return Array.isArray(prop) ? prop[index] || prop[0] : prop;
  };
  var shouldUseMultilineBackgrounds = (props) => {
    const {
      backgroundStyle,
      backgroundPadding
    } = props;
    return Array.isArray(backgroundStyle) && !(0, import_isEmpty4.default)(backgroundStyle) || Array.isArray(backgroundPadding) && !(0, import_isEmpty4.default)(backgroundPadding);
  };
  var getStyles2 = (style, props) => {
    if (props.disableInlineStyles) {
      const baseStyles = evaluateStyle(style, props);
      return {
        // Font size is necessary to calculate the y position of the label
        fontSize: getFontSize(baseStyles)
      };
    }
    const getSingleStyle = (s2) => {
      const baseStyles = evaluateStyle(s2 ? (0, import_defaults11.default)({}, s2, defaultStyles) : defaultStyles, props);
      return Object.assign({}, baseStyles, {
        fontSize: getFontSize(baseStyles)
      });
    };
    return Array.isArray(style) && !(0, import_isEmpty4.default)(style) ? style.map((s2) => getSingleStyle(s2)) : getSingleStyle(style);
  };
  var getBackgroundStyles = (style, props) => {
    if (!style) {
      return void 0;
    }
    return Array.isArray(style) && !(0, import_isEmpty4.default)(style) ? style.map((s2) => evaluateStyle(s2, props)) : evaluateStyle(style, props);
  };
  var getBackgroundPadding = (props) => {
    if (props.backgroundPadding && Array.isArray(props.backgroundPadding)) {
      return props.backgroundPadding.map((backgroundPadding) => {
        const padding4 = evaluateProp(backgroundPadding, props);
        return getPadding(padding4);
      });
    }
    const padding3 = evaluateProp(props.backgroundPadding, props);
    return getPadding(padding3);
  };
  var getLineHeight = (props) => {
    const lineHeight = evaluateProp(props.lineHeight, props);
    if (Array.isArray(lineHeight)) {
      return (0, import_isEmpty4.default)(lineHeight) ? [1] : lineHeight;
    }
    return lineHeight;
  };
  var getContent = (text, props) => {
    if (text === void 0 || text === null) {
      return void 0;
    }
    if (Array.isArray(text)) {
      return text.map((line) => evaluateProp(line, props));
    }
    const child = evaluateProp(text, props);
    if (child === void 0 || child === null) {
      return void 0;
    }
    return Array.isArray(child) ? child : `${child}`.split("\n");
  };
  var getDy = (props, verticalAnchor, lineHeight) => {
    const dy = props.dy ? evaluateProp(props.dy, props) : 0;
    const length = props.inline ? 1 : props.text.length;
    const capHeight = evaluateProp(props.capHeight, props);
    const anchor = verticalAnchor ? evaluateProp(verticalAnchor, props) : "middle";
    const fontSizes = [...Array(length).keys()].map((i) => getSingleValue(props.style, i).fontSize);
    const lineHeights = [...Array(length).keys()].map((i) => getSingleValue(lineHeight, i));
    if (anchor === "start") {
      return dy + (capHeight / 2 + lineHeights[0] / 2) * fontSizes[0];
    } else if (props.inline) {
      return anchor === "end" ? dy + (capHeight / 2 - lineHeights[0] / 2) * fontSizes[0] : dy + capHeight / 2 * fontSizes[0];
    } else if (length === 1) {
      return anchor === "end" ? dy + (capHeight / 2 + (0.5 - length) * lineHeights[0]) * fontSizes[0] : dy + (capHeight / 2 + (0.5 - length / 2) * lineHeights[0]) * fontSizes[0];
    }
    const allHeights = [...Array(length).keys()].reduce((memo4, i) => {
      return memo4 + (capHeight / 2 + (0.5 - length) * lineHeights[i]) * fontSizes[i] / length;
    }, 0);
    return anchor === "end" ? dy + allHeights : dy + allHeights / 2 + capHeight / 2 * lineHeights[length - 1] * fontSizes[length - 1];
  };
  var getTransform = (props, x2, y2) => {
    const {
      polar
    } = props;
    const style = getSingleValue(props.style);
    const defaultAngle = polar ? getPolarAngle(props) : 0;
    const baseAngle = style.angle === void 0 ? evaluateProp(props.angle, props) : style.angle;
    const angle = baseAngle === void 0 ? defaultAngle : baseAngle;
    const transform = props.transform || style.transform;
    const transformPart = transform && evaluateProp(transform, props);
    const rotatePart = angle && {
      rotate: [angle, x2, y2]
    };
    return transformPart || angle ? toTransformString(transformPart, rotatePart) : void 0;
  };
  var getXCoordinate = (calculatedProps, labelSizeWidth) => {
    const {
      direction,
      textAnchor,
      x: x2,
      dx
    } = calculatedProps;
    if (direction === "rtl") {
      return x2 - labelSizeWidth;
    }
    switch (textAnchor) {
      case "middle":
        return Math.round(x2 - labelSizeWidth / 2);
      case "end":
        return Math.round(x2 - labelSizeWidth);
      default:
        return x2 + (dx || 0);
    }
  };
  var getYCoordinate = (calculatedProps, textHeight) => {
    const {
      verticalAnchor,
      y: y2,
      originalDy = 0
    } = calculatedProps;
    const offset2 = y2 + originalDy;
    switch (verticalAnchor) {
      case "start":
        return Math.floor(offset2);
      case "end":
        return Math.ceil(offset2 - textHeight);
      default:
        return Math.floor(offset2 - textHeight / 2);
    }
  };
  var getFullBackground = (calculatedProps, tspanValues) => {
    const {
      dx = 0,
      transform,
      backgroundComponent,
      backgroundStyle,
      inline,
      backgroundPadding,
      capHeight
    } = calculatedProps;
    const textSizes = tspanValues.map((tspan) => {
      return tspan.textSize;
    });
    const height = inline ? Math.max(...textSizes.map((size) => size.height)) : textSizes.reduce((memo4, size, i) => {
      const capHeightAdjustment = i ? 0 : capHeight / 2;
      return memo4 + size.height * (tspanValues[i].lineHeight - capHeightAdjustment);
    }, 0);
    const width = inline ? textSizes.reduce((memo4, size, index) => {
      const offset2 = index ? dx : 0;
      return memo4 + size.width + offset2;
    }, 0) : Math.max(...textSizes.map((size) => size.width));
    const xCoordinate = getXCoordinate(calculatedProps, width);
    const yCoordinate = getYCoordinate(calculatedProps, height);
    const backgroundProps = {
      key: "background",
      height: height + backgroundPadding.top + backgroundPadding.bottom,
      style: backgroundStyle,
      transform,
      width: width + backgroundPadding.left + backgroundPadding.right,
      x: inline ? xCoordinate - backgroundPadding.left : xCoordinate + dx - backgroundPadding.left,
      y: yCoordinate
    };
    return /* @__PURE__ */ import_react78.default.cloneElement(backgroundComponent, (0, import_defaults11.default)({}, backgroundComponent.props, backgroundProps));
  };
  var getInlineXOffset = (calculatedProps, textElements, index) => {
    const {
      textAnchor
    } = calculatedProps;
    const widths = textElements.map((t) => t.widthWithPadding);
    const totalWidth = widths.reduce((memo4, width) => memo4 + width, 0);
    const centerOffset = -totalWidth / 2;
    switch (textAnchor) {
      case "start":
        return widths.reduce((memo4, width, i) => i < index ? memo4 + width : memo4, 0);
      case "end":
        return widths.reduce((memo4, width, i) => i > index ? memo4 - width : memo4, 0);
      default:
        return widths.reduce((memo4, width, i) => {
          const offsetWidth = i < index ? width : 0;
          return i === index ? memo4 + width / 2 : memo4 + offsetWidth;
        }, centerOffset);
    }
  };
  var getChildBackgrounds = (calculatedProps, tspanValues) => {
    const {
      dy,
      dx,
      transform,
      backgroundStyle,
      backgroundPadding,
      backgroundComponent,
      inline,
      y: y2
    } = calculatedProps;
    const textElements = tspanValues.map((current, i) => {
      const previous = getSingleValue(tspanValues, i - 1);
      const labelSize = current.textSize;
      const totalLineHeight = current.fontSize * current.lineHeight;
      const textHeight = Math.ceil(totalLineHeight);
      const padding3 = getSingleValue(backgroundPadding, i);
      const prevPadding = getSingleValue(backgroundPadding, i - 1);
      const xOffset = inline ? dx || 0 : 0;
      const childDy = i && !inline ? previous.fontSize * previous.lineHeight + prevPadding.top + prevPadding.bottom : dy - totalLineHeight * 0.5 - (current.fontSize - current.capHeight);
      return {
        textHeight,
        labelSize,
        heightWithPadding: textHeight + padding3.top + padding3.bottom,
        widthWithPadding: labelSize.width + padding3.left + padding3.right + xOffset,
        y: y2,
        fontSize: current.fontSize,
        dy: childDy
      };
    });
    return textElements.map((textElement, i) => {
      const xCoordinate = getXCoordinate(calculatedProps, textElement.labelSize.width);
      const yCoordinate = textElements.slice(0, i + 1).reduce((prev, curr) => {
        return prev + curr.dy;
      }, y2);
      const padding3 = getSingleValue(backgroundPadding, i);
      const height = textElement.heightWithPadding;
      const xCoord = inline ? getInlineXOffset(calculatedProps, textElements, i) + xCoordinate - padding3.left : xCoordinate;
      const yCoord = inline ? getYCoordinate(calculatedProps, height) - padding3.top : yCoordinate;
      const backgroundProps = {
        key: `tspan-background-${i}`,
        height,
        style: getSingleValue(backgroundStyle, i),
        width: textElement.widthWithPadding,
        transform,
        x: xCoord - padding3.left,
        y: yCoord
      };
      return /* @__PURE__ */ import_react78.default.cloneElement(backgroundComponent, (0, import_defaults11.default)({}, backgroundComponent.props, backgroundProps));
    });
  };
  var getBackgroundElement = (calculatedProps, tspanValues) => {
    return shouldUseMultilineBackgrounds(calculatedProps) ? getChildBackgrounds(calculatedProps, tspanValues) : getFullBackground(calculatedProps, tspanValues);
  };
  var calculateSpanDy = (tspanValues, i, calculatedProps) => {
    const current = getSingleValue(tspanValues, i);
    const previous = getSingleValue(tspanValues, i - 1);
    const previousHeight = previous.fontSize * previous.lineHeight;
    const currentHeight = current.fontSize * current.lineHeight;
    const previousCaps = previous.fontSize - previous.capHeight;
    const currentCaps = current.fontSize - current.capHeight;
    const textHeight = previousHeight - previous.fontSize / 2 + current.fontSize / 2 - previousHeight / 2 + currentHeight / 2 - currentCaps / 2 + previousCaps / 2;
    return shouldUseMultilineBackgrounds(calculatedProps) ? textHeight + current.backgroundPadding.top + previous.backgroundPadding.bottom : textHeight;
  };
  var getTSpanDy = (tspanValues, calculatedProps, i) => {
    const {
      inline
    } = calculatedProps;
    const current = getSingleValue(tspanValues, i);
    if (i && !inline) {
      return calculateSpanDy(tspanValues, i, calculatedProps);
    } else if (inline) {
      return i === 0 ? current.backgroundPadding.top : void 0;
    }
    return current.backgroundPadding.top;
  };
  var evaluateProps = (props) => {
    const text = getContent(props.text, props);
    const style = getStyles2(props.style, Object.assign({}, props, {
      text
    }));
    const backgroundStyle = getBackgroundStyles(props.backgroundStyle, Object.assign({}, props, {
      text,
      style
    }));
    const backgroundPadding = getBackgroundPadding(Object.assign({}, props, {
      text,
      style,
      backgroundStyle
    }));
    const id = evaluateProp(props.id, props);
    return Object.assign({}, props, {
      backgroundStyle,
      backgroundPadding,
      style,
      text,
      id
    });
  };
  var getCalculatedProps = (props) => {
    const ariaLabel = evaluateProp(props.ariaLabel, props);
    const style = getSingleValue(props.style);
    const lineHeight = getLineHeight(props);
    const direction = props.direction ? evaluateProp(props.direction, props) : "inherit";
    const textAnchor = props.textAnchor ? evaluateProp(props.textAnchor, props) : style.textAnchor || "start";
    const verticalAnchor = props.verticalAnchor ? evaluateProp(props.verticalAnchor, props) : style.verticalAnchor || "middle";
    const dx = props.dx ? evaluateProp(props.dx, props) : 0;
    const dy = getDy(props, verticalAnchor, lineHeight);
    const x2 = props.x !== void 0 ? props.x : getPosition2(props, "x");
    const y2 = props.y !== void 0 ? props.y : getPosition2(props, "y");
    const transform = getTransform(props, x2, y2);
    return Object.assign({}, props, {
      ariaLabel,
      lineHeight,
      direction,
      textAnchor,
      verticalAnchor,
      dx,
      dy,
      originalDy: evaluateProp(props.dy, props),
      transform,
      x: x2,
      y: y2
    });
  };
  var renderLabel = (calculatedProps, tspanValues) => {
    const {
      ariaLabel,
      inline,
      className,
      title,
      events,
      direction,
      text,
      textAnchor,
      dx,
      dy,
      transform,
      x: x2,
      y: y2,
      desc,
      id,
      tabIndex,
      tspanComponent,
      textComponent
    } = calculatedProps;
    const userProps = getSafeUserProps(calculatedProps);
    const textProps = {
      "aria-label": ariaLabel,
      key: "text",
      ...events,
      direction,
      dx,
      x: x2,
      y: y2 + dy,
      transform,
      className,
      title,
      desc: evaluateProp(desc, calculatedProps),
      tabIndex: evaluateProp(tabIndex, calculatedProps),
      id,
      ...userProps
    };
    const tspans = text.map((line, i) => {
      const currentStyle = tspanValues[i].style;
      const tspanProps = {
        key: `${id}-key-${i}`,
        x: !inline ? x2 : void 0,
        dx: inline ? dx + tspanValues[i].backgroundPadding.left : dx,
        dy: getTSpanDy(tspanValues, calculatedProps, i),
        textAnchor: currentStyle.textAnchor || textAnchor,
        style: currentStyle,
        children: line
      };
      return /* @__PURE__ */ import_react78.default.cloneElement(tspanComponent, tspanProps);
    });
    return /* @__PURE__ */ import_react78.default.cloneElement(textComponent, textProps, tspans);
  };
  var defaultProps4 = {
    backgroundComponent: /* @__PURE__ */ import_react78.default.createElement(Rect, null),
    groupComponent: /* @__PURE__ */ import_react78.default.createElement("g", null),
    direction: "inherit",
    textComponent: /* @__PURE__ */ import_react78.default.createElement(Text2, null),
    tspanComponent: /* @__PURE__ */ import_react78.default.createElement(TSpan, null),
    capHeight: 0.71,
    // Magic number from d3.
    lineHeight: 1
  };
  var VictoryLabel = (initialProps) => {
    const props = evaluateProps((0, import_defaults11.default)({}, initialProps, defaultProps4));
    if (props.text === null || props.text === void 0) {
      return null;
    }
    const calculatedProps = getCalculatedProps(props);
    const {
      text,
      style,
      capHeight,
      backgroundPadding,
      lineHeight
    } = calculatedProps;
    const tspanValues = text.map((line, i) => {
      const currentStyle = getSingleValue(style, i);
      const capHeightPx = convertLengthToPixels(`${capHeight}em`, currentStyle.fontSize);
      const currentLineHeight = getSingleValue(lineHeight, i);
      return {
        style: currentStyle,
        fontSize: currentStyle.fontSize || defaultStyles.fontSize,
        capHeight: capHeightPx,
        text: line,
        // TODO: This looks like a bug:
        textSize: approximateTextSize(line, currentStyle),
        lineHeight: currentLineHeight,
        backgroundPadding: getSingleValue(backgroundPadding, i)
      };
    });
    const label = renderLabel(calculatedProps, tspanValues);
    if (props.backgroundStyle) {
      const backgroundElement = getBackgroundElement(calculatedProps, tspanValues);
      const children = [backgroundElement, label];
      const backgroundWithLabel = /* @__PURE__ */ import_react78.default.cloneElement(props.groupComponent, {}, children);
      return props.renderInPortal ? /* @__PURE__ */ import_react78.default.createElement(VictoryPortal, null, backgroundWithLabel) : backgroundWithLabel;
    }
    return props.renderInPortal ? /* @__PURE__ */ import_react78.default.createElement(VictoryPortal, null, label) : label;
  };
  VictoryLabel.displayName = "VictoryLabel";
  VictoryLabel.role = "label";
  VictoryLabel.defaultStyles = defaultStyles;

  // node_modules/victory-core/es/victory-clip-container/victory-clip-container.js
  var import_react81 = __toESM(require_react());
  var import_defaults12 = __toESM(require_defaults());
  var import_uniqueId3 = __toESM(require_uniqueId());

  // node_modules/victory-core/es/victory-primitives/clip-path.js
  var import_react79 = __toESM(require_react());
  var ClipPath = (props) => /* @__PURE__ */ import_react79.default.createElement("defs", null, /* @__PURE__ */ import_react79.default.createElement("clipPath", {
    id: props.clipId?.toString()
  }, props.children));

  // node_modules/victory-core/es/victory-primitives/circle.js
  var import_react80 = __toESM(require_react());
  function _extends5() {
    _extends5 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends5.apply(this, arguments);
  }
  var Circle = /* @__PURE__ */ (0, import_react80.forwardRef)((props, ref) => {
    const {
      desc,
      id,
      tabIndex,
      origin,
      ...rest
    } = props;
    const svgProps = {
      vectorEffect: "non-scaling-stroke",
      id: evaluateProp(id, props)?.toString(),
      tabIndex: evaluateProp(tabIndex, props),
      ...rest
    };
    return desc ? /* @__PURE__ */ import_react80.default.createElement("circle", _extends5({}, svgProps, {
      ref
    }), /* @__PURE__ */ import_react80.default.createElement("desc", null, desc)) : /* @__PURE__ */ import_react80.default.createElement("circle", _extends5({}, svgProps, {
      ref
    }));
  });

  // node_modules/victory-core/es/victory-clip-container/victory-clip-container.js
  var VictoryClipContainer = class extends import_react81.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        clipId: props?.clipId
      };
    }
    // The clipId state is used to prevent hydration mismatches between the server and client (issue #2941).
    // A better alternative would be to utilize React 18's useId hook instead of uniqueId, which would avoid needing state for this purpose.
    // However, this component currently supports React 16 at the time of writing, so this workaround is necessary.
    componentDidMount() {
      if (!this.state.clipId) {
        this.setState({
          clipId: (0, import_uniqueId3.default)("victory-clip-")
        });
      }
    }
    calculateAttributes(props) {
      const {
        polar,
        origin,
        clipWidth = 0,
        clipHeight = 0,
        translateX = 0,
        translateY = 0
      } = props;
      const clipPadding = getPadding(props.clipPadding);
      const radius = props.radius || getRadius(props);
      return {
        x: (polar ? origin.x : translateX) - clipPadding.left,
        y: (polar ? origin.y : translateY) - clipPadding.top,
        width: Math.max((polar ? radius : clipWidth) + clipPadding.left + clipPadding.right, 0),
        height: Math.max((polar ? radius : clipHeight) + clipPadding.top + clipPadding.bottom, 0)
      };
    }
    renderClippedGroup(props, clipId) {
      const userProps = getSafeUserProps(props);
      const {
        style,
        events,
        transform,
        children,
        className,
        groupComponent,
        tabIndex
      } = props;
      const clipComponent = this.renderClipComponent(props, clipId);
      const groupProps = Object.assign({
        className,
        style,
        transform,
        key: `clipped-group-${clipId}`,
        clipPath: `url(#${clipId})`
      }, events);
      return /* @__PURE__ */ import_react81.default.cloneElement(groupComponent, {
        ...groupProps,
        tabIndex,
        ...userProps
      }, [clipComponent, ...import_react81.default.Children.toArray(children)]);
    }
    renderGroup(props) {
      const {
        style,
        events,
        transform,
        children,
        className,
        groupComponent,
        tabIndex
      } = props;
      return /* @__PURE__ */ import_react81.default.cloneElement(groupComponent, Object.assign({
        className,
        style,
        transform,
        "aria-label": props["aria-label"],
        tabIndex
      }, events), children);
    }
    renderClipComponent(props, clipId) {
      const {
        polar,
        origin,
        clipWidth = 0,
        clipHeight = 0,
        translateX = 0,
        translateY = 0,
        circleComponent,
        rectComponent,
        clipPathComponent
      } = props;
      const {
        top: top2,
        bottom: bottom2,
        left: left2,
        right: right2
      } = getPadding(props.clipPadding);
      let child;
      if (polar) {
        const radius = props.radius || getRadius(props);
        const circleProps = {
          r: Math.max(radius + left2 + right2, radius + top2 + bottom2, 0),
          cx: origin.x - left2,
          cy: origin.y - top2
        };
        child = /* @__PURE__ */ import_react81.default.cloneElement(circleComponent, circleProps);
      } else {
        const rectProps = {
          x: translateX - left2,
          y: translateY - top2,
          width: Math.max(clipWidth + left2 + right2, 0),
          height: Math.max(clipHeight + top2 + bottom2, 0)
        };
        child = /* @__PURE__ */ import_react81.default.cloneElement(rectComponent, rectProps);
      }
      return /* @__PURE__ */ import_react81.default.cloneElement(clipPathComponent, Object.assign({
        key: `clip-path-${clipId}`
      }, props, {
        clipId
      }), child);
    }
    getClipValue(props, axis) {
      const clipValues = {
        x: props.clipWidth,
        y: props.clipHeight
      };
      if (clipValues[axis] !== void 0) {
        return clipValues[axis];
      }
      const range4 = getRange(props, axis);
      return range4 ? Math.abs(range4[0] - range4[1]) || void 0 : void 0;
    }
    getTranslateValue(props, axis) {
      const translateValues = {
        x: props.translateX,
        y: props.translateY
      };
      if (translateValues[axis] !== void 0) {
        return translateValues[axis];
      }
      const range4 = getRange(props, axis);
      return range4 ? Math.min(...range4) : void 0;
    }
    render() {
      const clipHeight = this.getClipValue(this.props, "y");
      const clipWidth = this.getClipValue(this.props, "x");
      if (clipWidth === void 0 || clipHeight === void 0) {
        return this.renderGroup(this.props);
      }
      const translateX = this.getTranslateValue(this.props, "x");
      const translateY = this.getTranslateValue(this.props, "y");
      const clipProps = (0, import_defaults12.default)({}, this.props, {
        clipHeight,
        clipWidth,
        translateX,
        translateY
      });
      return this.renderClippedGroup(clipProps, this.state.clipId);
    }
  };
  __publicField(VictoryClipContainer, "displayName", "VictoryClipContainer");
  __publicField(VictoryClipContainer, "role", "container");
  __publicField(VictoryClipContainer, "defaultProps", {
    circleComponent: /* @__PURE__ */ import_react81.default.createElement(Circle, null),
    rectComponent: /* @__PURE__ */ import_react81.default.createElement(Rect, null),
    clipPathComponent: /* @__PURE__ */ import_react81.default.createElement(ClipPath, null),
    groupComponent: /* @__PURE__ */ import_react81.default.createElement("g", null)
  });

  // node_modules/victory-core/es/victory-primitives/arc.js
  var import_react83 = __toESM(require_react());
  var import_defaults13 = __toESM(require_defaults());

  // node_modules/victory-core/es/victory-primitives/path.js
  var import_react82 = __toESM(require_react());
  function _extends6() {
    _extends6 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends6.apply(this, arguments);
  }
  var Path2 = /* @__PURE__ */ (0, import_react82.forwardRef)((props, ref) => {
    const {
      desc,
      id,
      tabIndex,
      origin,
      ...rest
    } = props;
    const svgProps = {
      id: evaluateProp(id, props)?.toString(),
      tabIndex: evaluateProp(tabIndex, props),
      ...rest
    };
    return desc ? /* @__PURE__ */ import_react82.default.createElement("path", _extends6({}, svgProps, {
      ref
    }), /* @__PURE__ */ import_react82.default.createElement("desc", null, desc)) : /* @__PURE__ */ import_react82.default.createElement("path", _extends6({}, svgProps, {
      ref
    }));
  });

  // node_modules/victory-core/es/victory-primitives/arc.js
  var getArcPath = (props) => {
    const {
      cx,
      cy,
      r,
      startAngle,
      endAngle,
      closedPath
    } = props;
    const halfAngle = Math.abs(endAngle - startAngle) / 2 + startAngle;
    const x1 = cx + r * Math.cos(degreesToRadians(startAngle));
    const y1 = cy - r * Math.sin(degreesToRadians(startAngle));
    const x2 = cx + r * Math.cos(degreesToRadians(halfAngle));
    const y2 = cy - r * Math.sin(degreesToRadians(halfAngle));
    const x3 = cx + r * Math.cos(degreesToRadians(endAngle));
    const y3 = cy - r * Math.sin(degreesToRadians(endAngle));
    const largerArcFlag1 = halfAngle - startAngle <= 180 ? 0 : 1;
    const largerArcFlag2 = endAngle - halfAngle <= 180 ? 0 : 1;
    const arcStart = closedPath ? ` M ${cx}, ${cy} L ${x1}, ${y1}` : `M ${x1}, ${y1}`;
    const arc1 = `A ${r}, ${r}, 0, ${largerArcFlag1}, 0, ${x2}, ${y2}`;
    const arc2 = `A ${r}, ${r}, 0, ${largerArcFlag2}, 0, ${x3}, ${y3}`;
    const arcEnd = closedPath ? "Z" : "";
    return `${arcStart} ${arc1} ${arc2} ${arcEnd}`;
  };
  var evaluateProps2 = (props) => {
    const ariaLabel = evaluateProp(props.ariaLabel, props);
    const desc = evaluateProp(props.desc, props);
    const id = evaluateProp(props.id, props);
    const style = evaluateStyle(Object.assign({
      stroke: "black",
      fill: "none"
    }, props.style), props);
    const tabIndex = evaluateProp(props.tabIndex, props);
    return Object.assign({}, props, {
      ariaLabel,
      desc,
      id,
      style,
      tabIndex
    });
  };
  var defaultProps5 = {
    pathComponent: /* @__PURE__ */ import_react83.default.createElement(Path2, null),
    role: "presentation",
    shapeRendering: "auto"
  };
  var Arc = (initialProps) => {
    const props = evaluateProps2((0, import_defaults13.default)({}, initialProps, defaultProps5));
    return /* @__PURE__ */ import_react83.default.cloneElement(props.pathComponent, {
      ...props.events,
      "aria-label": props.ariaLabel,
      d: getArcPath(props),
      style: props.style,
      desc: props.desc,
      tabIndex: props.tabIndex,
      className: props.className,
      role: props.role,
      shapeRendering: props.shapeRendering,
      transform: props.transform,
      clipPath: props.clipPath
    });
  };

  // node_modules/victory-core/es/victory-primitives/background.js
  var import_react84 = __toESM(require_react());
  var import_defaults14 = __toESM(require_defaults());
  var evaluateProps3 = (props) => {
    const id = evaluateProp(props.id, props);
    return Object.assign({}, props, {
      id
    });
  };
  var defaultProps6 = {
    circleComponent: /* @__PURE__ */ import_react84.default.createElement(Circle, null),
    rectComponent: /* @__PURE__ */ import_react84.default.createElement(Rect, null),
    role: "presentation",
    shapeRendering: "auto"
  };
  var Background = (initialProps) => {
    const props = evaluateProps3((0, import_defaults14.default)({}, initialProps, defaultProps6));
    return props.polar ? /* @__PURE__ */ import_react84.default.cloneElement(props.circleComponent, {
      ...props.events,
      style: props.style,
      role: props.role,
      shapeRendering: props.shapeRendering,
      cx: props.x,
      cy: props.y,
      r: props.height,
      className: props.className
    }) : /* @__PURE__ */ import_react84.default.cloneElement(props.rectComponent, {
      ...props.events,
      style: props.style,
      role: props.role,
      shapeRendering: props.shapeRendering,
      x: props.x,
      y: props.y,
      rx: props.rx,
      ry: props.ry,
      width: props.width,
      height: props.height,
      className: props.className
    });
  };

  // node_modules/victory-core/es/victory-primitives/border.js
  var import_react85 = __toESM(require_react());
  var import_defaults15 = __toESM(require_defaults());
  var evaluateProps4 = (props) => {
    const ariaLabel = evaluateProp(props.ariaLabel, props);
    const desc = evaluateProp(props.desc, props);
    const id = evaluateProp(props.id, props);
    const style = evaluateStyle(Object.assign({
      fill: "none"
    }, props.style), props);
    const tabIndex = evaluateProp(props.tabIndex, props);
    return Object.assign({}, props, {
      ariaLabel,
      desc,
      id,
      style,
      tabIndex
    });
  };
  var defaultProps7 = {
    rectComponent: /* @__PURE__ */ import_react85.default.createElement(Rect, null),
    role: "presentation",
    shapeRendering: "auto"
  };
  var Border = (initialProps) => {
    const props = evaluateProps4((0, import_defaults15.default)({}, initialProps, defaultProps7));
    return /* @__PURE__ */ import_react85.default.cloneElement(props.rectComponent, {
      ...props.events,
      "aria-label": props.ariaLabel,
      style: props.style,
      desc: props.desc,
      tabIndex: props.tabIndex,
      transform: props.transform,
      className: props.className,
      role: props.role,
      shapeRendering: props.shapeRendering,
      x: props.x,
      y: props.y,
      width: props.width,
      height: props.height,
      clipPath: props.clipPath
    });
  };

  // node_modules/victory-core/es/victory-primitives/line.js
  var import_react86 = __toESM(require_react());
  function _extends7() {
    _extends7 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends7.apply(this, arguments);
  }
  var Line = /* @__PURE__ */ (0, import_react86.forwardRef)((props, ref) => {
    const {
      desc,
      id,
      tabIndex,
      origin,
      ...rest
    } = props;
    const svgProps = {
      vectorEffect: "non-scaling-stroke",
      id: evaluateProp(id, props)?.toString(),
      tabIndex: evaluateProp(tabIndex, props),
      ...rest
    };
    return desc ? /* @__PURE__ */ import_react86.default.createElement("line", _extends7({}, svgProps, {
      ref
    }), /* @__PURE__ */ import_react86.default.createElement("desc", null, desc)) : /* @__PURE__ */ import_react86.default.createElement("line", _extends7({}, svgProps, {
      ref
    }));
  });

  // node_modules/victory-core/es/victory-primitives/line-segment.js
  var import_react87 = __toESM(require_react());
  var import_defaults16 = __toESM(require_defaults());
  var evaluateProps5 = (props) => {
    const ariaLabel = evaluateProp(props.ariaLabel, props);
    const desc = evaluateProp(props.desc, props);
    const id = evaluateProp(props.id, props);
    const style = evaluateStyle(Object.assign({
      stroke: "black"
    }, props.style), props);
    const tabIndex = evaluateProp(props.tabIndex, props);
    return Object.assign({}, props, {
      ariaLabel,
      desc,
      id,
      style,
      tabIndex
    });
  };
  var defaultProps8 = {
    lineComponent: /* @__PURE__ */ import_react87.default.createElement(Line, null),
    role: "presentation",
    shapeRendering: "auto"
  };
  var LineSegment = (initialProps) => {
    const props = evaluateProps5((0, import_defaults16.default)({}, initialProps, defaultProps8));
    return /* @__PURE__ */ import_react87.default.cloneElement(props.lineComponent, {
      ...props.events,
      "aria-label": props.ariaLabel,
      style: props.style,
      desc: props.desc,
      tabIndex: props.tabIndex,
      className: props.className,
      role: props.role,
      shapeRendering: props.shapeRendering,
      x1: props.x1,
      x2: props.x2,
      y1: props.y1,
      y2: props.y2,
      transform: props.transform,
      clipPath: props.clipPath
    });
  };

  // node_modules/victory-core/es/victory-primitives/point.js
  var import_react88 = __toESM(require_react());
  var import_defaults17 = __toESM(require_defaults());
  var getPath = (props) => {
    const {
      x: x2,
      y: y2,
      size,
      symbol
    } = props;
    if (props.getPath) {
      return props.getPath(x2, y2, size);
    }
    const pathFunctions = point_path_helpers_exports;
    const symbolFunction = typeof pathFunctions[symbol] === "function" ? pathFunctions[symbol] : pathFunctions.circle;
    return symbolFunction(x2, y2, size);
  };
  var evaluateProps6 = (props) => {
    const ariaLabel = evaluateProp(props.ariaLabel, props);
    const desc = evaluateProp(props.desc, props);
    const id = evaluateProp(props.id, props);
    const size = evaluateProp(props.size, props);
    const style = evaluateStyle(props.style, props);
    const symbol = evaluateProp(props.symbol, props);
    const tabIndex = evaluateProp(props.tabIndex, props);
    return Object.assign({}, props, {
      ariaLabel,
      desc,
      id,
      size,
      style,
      symbol,
      tabIndex
    });
  };
  var defaultProps9 = {
    pathComponent: /* @__PURE__ */ import_react88.default.createElement(Path2, null),
    role: "presentation",
    shapeRendering: "auto"
  };
  var Point = (initialProps) => {
    const props = evaluateProps6((0, import_defaults17.default)({}, initialProps, defaultProps9));
    const userProps = getSafeUserProps(props);
    return /* @__PURE__ */ import_react88.default.cloneElement(props.pathComponent, {
      ...props.events,
      "aria-label": props.ariaLabel,
      d: getPath(props),
      style: props.style,
      desc: props.desc,
      tabIndex: props.tabIndex,
      role: props.role,
      shapeRendering: props.shapeRendering,
      className: props.className,
      transform: props.transform,
      clipPath: props.clipPath,
      ...userProps
    });
  };

  // node_modules/victory-shared-events/es/victory-shared-events.js
  var import_react89 = __toESM(require_react());
  var import_defaults18 = __toESM(require_defaults());
  var import_isEmpty5 = __toESM(require_isEmpty());
  var import_fromPairs = __toESM(require_fromPairs());
  var import_react_fast_compare3 = __toESM(require_react_fast_compare());
  var import_json_stringify_safe = __toESM(require_stringify());
  var VictorySharedEvents = class extends import_react89.default.Component {
    constructor(props) {
      super(props);
      this.getScopedEvents = events_exports.getScopedEvents.bind(this);
      this.getEventState = events_exports.getEventState.bind(this);
      this.state = this.state || {};
      this.sharedEventsCache = {};
      this.globalEvents = {};
      this.prevGlobalEventKeys = [];
      this.boundGlobalEvents = {};
      this.baseProps = this.getBaseProps(props);
    }
    shouldComponentUpdate(nextProps) {
      if (!(0, import_react_fast_compare3.default)(this.props, nextProps)) {
        this.baseProps = this.getBaseProps(nextProps);
        const externalMutations = this.getExternalMutations(nextProps, this.baseProps);
        this.applyExternalMutations(nextProps, externalMutations);
      }
      return true;
    }
    componentDidMount() {
      const globalEventKeys = Object.keys(this.globalEvents);
      globalEventKeys.forEach((key) => this.addGlobalListener(key));
      this.prevGlobalEventKeys = globalEventKeys;
    }
    componentDidUpdate() {
      const globalEventKeys = Object.keys(this.globalEvents);
      const removedGlobalEventKeys = collection_exports.difference(this.prevGlobalEventKeys, globalEventKeys);
      removedGlobalEventKeys.forEach((key) => this.removeGlobalListener(key));
      const addedGlobalEventKeys = collection_exports.difference(globalEventKeys, this.prevGlobalEventKeys);
      addedGlobalEventKeys.forEach((key) => this.addGlobalListener(key));
      this.prevGlobalEventKeys = globalEventKeys;
    }
    componentWillUnmount() {
      this.prevGlobalEventKeys.forEach((key) => this.removeGlobalListener(key));
    }
    addGlobalListener(key) {
      const boundListener = (event) => {
        const listener = this.globalEvents[key];
        return listener && listener(events_exports.emulateReactEvent(event));
      };
      this.boundGlobalEvents[key] = boundListener;
      window.addEventListener(events_exports.getGlobalEventNameFromKey(key), boundListener);
    }
    removeGlobalListener(key) {
      window.removeEventListener(events_exports.getGlobalEventNameFromKey(key), this.boundGlobalEvents[key]);
    }
    getAllEvents(props) {
      const components = ["container", "groupComponent"];
      const componentEvents = events_exports.getComponentEvents(props, components);
      if (Array.isArray(componentEvents)) {
        return Array.isArray(props.events) ? componentEvents.concat(...props.events) : componentEvents;
      }
      return props.events;
    }
    applyExternalMutations(props, externalMutations) {
      if (!(0, import_isEmpty5.default)(externalMutations)) {
        const callbacks = props.externalEventMutations.reduce((memo4, mutation) => helpers_exports.isFunction(mutation.callback) ? memo4.concat(mutation.callback) : memo4, []);
        const compiledCallbacks = callbacks.length ? () => {
          callbacks.forEach((c2) => c2());
        } : void 0;
        this.setState(externalMutations, compiledCallbacks);
      }
    }
    getExternalMutations(props, baseProps4) {
      return !(0, import_isEmpty5.default)(props.externalEventMutations) ? events_exports.getExternalMutationsWithChildren(props.externalEventMutations, baseProps4, this.state, Object.keys(baseProps4)) : void 0;
    }
    cacheSharedEvents(name2, sharedEvents, cacheValues) {
      this.sharedEventsCache[name2] = [sharedEvents, cacheValues];
    }
    getCachedSharedEvents(name2, cacheValues) {
      const [sharedEvents, prevCacheValues] = this.sharedEventsCache[name2] || [];
      if (sharedEvents && (0, import_react_fast_compare3.default)(cacheValues, prevCacheValues)) {
        return sharedEvents;
      }
      return void 0;
    }
    getBaseProps(props) {
      const {
        container
      } = props;
      const children = import_react89.default.Children.toArray(this.props.children);
      const childBaseProps = this.getBasePropsFromChildren(children);
      const parentBaseProps = container ? container.props : {};
      return Object.assign({}, childBaseProps, {
        parent: parentBaseProps
      });
    }
    getBasePropsFromChildren(childComponents) {
      const iteratee = (child, childName) => {
        if (child.type && helpers_exports.isFunction(child.type.getBaseProps)) {
          const baseProps5 = child.props && child.type.getBaseProps(child.props);
          return baseProps5 ? [[childName, baseProps5]] : null;
        }
        return null;
      };
      const baseProps4 = helpers_exports.reduceChildren(childComponents, iteratee);
      return (0, import_fromPairs.default)(baseProps4);
    }
    getNewChildren(props, baseProps4) {
      const {
        events,
        eventKey
      } = props;
      const alterChildren = (children, childNames2) => {
        return children.reduce((memo4, child, index) => {
          if (child.props.children) {
            const newChildren = import_react89.default.Children.toArray(child.props.children);
            const names = childNames2.slice(index, index + newChildren.length);
            const results = /* @__PURE__ */ import_react89.default.cloneElement(child, child.props, alterChildren(newChildren, names));
            return memo4.concat(results);
          } else if (childNames2[index] !== "parent" && child.type && helpers_exports.isFunction(child.type.getBaseProps)) {
            const name2 = child.props.name || childNames2[index];
            const childEvents = Array.isArray(events) && events.filter((event) => {
              if (event.target === "parent") {
                return false;
              }
              return Array.isArray(event.childName) ? event.childName.indexOf(name2) > -1 : event.childName === name2 || event.childName === "all";
            });
            const sharedEventsCacheValues = [name2, baseProps4, childEvents, (0, import_json_stringify_safe.default)(this.state[name2])];
            const sharedEvents = this.getCachedSharedEvents(name2, sharedEventsCacheValues) || {
              events: childEvents,
              // partially apply child name and baseProps,
              getEvents: (evts, target) => this.getScopedEvents(evts, target, name2, baseProps4),
              // partially apply child name
              getEventState: (key, target) => this.getEventState(key, target, name2)
            };
            this.cacheSharedEvents(name2, sharedEvents, sharedEventsCacheValues);
            return memo4.concat(/* @__PURE__ */ import_react89.default.cloneElement(child, Object.assign({
              key: `events-${name2}`,
              sharedEvents,
              eventKey,
              name: name2
            }, child.props)));
          }
          return memo4.concat(child);
        }, []);
      };
      const childNames = Object.keys(baseProps4);
      const childComponents = import_react89.default.Children.toArray(props.children);
      return alterChildren(childComponents, childNames);
    }
    getContainer(props, baseProps4, events) {
      const children = this.getNewChildren(props, baseProps4);
      const parents = Array.isArray(events) ? events.filter((event) => event.target === "parent") : [];
      const sharedEvents = parents.length > 0 ? {
        events: parents,
        // partially apply childName (null) and baseProps,
        getEvents: (evts, target) => this.getScopedEvents(evts, target, null, baseProps4),
        getEventState: this.getEventState
      } : null;
      const container = props.container || props.groupComponent;
      const role = container.type && container.type.role;
      const containerProps = container.props || {};
      const boundGetEvents = events_exports.getEvents.bind(this);
      const parentEvents = sharedEvents && boundGetEvents({
        sharedEvents
      }, "parent");
      const parentProps = (0, import_defaults18.default)({}, this.getEventState("parent", "parent"), containerProps, baseProps4.parent, {
        children
      });
      const containerEvents = (0, import_defaults18.default)({}, events_exports.getPartialEvents(parentEvents, "parent", parentProps), containerProps.events);
      this.globalEvents = events_exports.getGlobalEvents(containerEvents);
      const localEvents = events_exports.omitGlobalEvents(containerEvents);
      return role === "container" ? /* @__PURE__ */ import_react89.default.cloneElement(container, Object.assign({}, parentProps, {
        events: localEvents
      })) : /* @__PURE__ */ import_react89.default.cloneElement(container, localEvents, children);
    }
    render() {
      const events = this.getAllEvents(this.props);
      if (events) {
        return this.getContainer(this.props, this.baseProps, events);
      }
      return /* @__PURE__ */ import_react89.default.cloneElement(this.props.container, {
        children: this.props.children
      });
    }
  };
  __publicField(VictorySharedEvents, "displayName", "VictorySharedEvents");
  __publicField(VictorySharedEvents, "role", "shared-event-wrapper");
  __publicField(VictorySharedEvents, "contextType", timer_context_default);
  __publicField(VictorySharedEvents, "defaultProps", {
    groupComponent: /* @__PURE__ */ import_react89.default.createElement("g", null)
  });

  // node_modules/victory-axis/es/victory-axis.js
  var import_react90 = __toESM(require_react());
  var import_isEmpty6 = __toESM(require_isEmpty());

  // node_modules/victory-axis/es/helper-methods.js
  var import_defaults19 = __toESM(require_defaults());
  var orientationSign = {
    top: -1,
    left: -1,
    right: 1,
    bottom: 1
  };
  var exists = (val) => val !== null && val !== void 0;
  var getCurrentAxis2 = (props, axis) => {
    const {
      orientation,
      horizontal
    } = props;
    if (orientation) {
      const dimensions = {
        top: "x",
        bottom: "x",
        left: "y",
        right: "y"
      };
      return dimensions[orientation];
    }
    const otherAxis = axis === "x" ? "y" : "x";
    return horizontal ? otherAxis : axis;
  };
  var getScale2 = (props) => {
    const axis = axis_exports.getAxis(props);
    const currentAxis = getCurrentAxis2(props, axis);
    const scale = scale_exports.getBaseScale(props, axis);
    const propsDomain = props.domain && props.domain[axis];
    const domain = propsDomain || axis_exports.getDomain(props) || scale.domain();
    scale.range(helpers_exports.getRange(props, currentAxis));
    scale.domain(domain);
    return scale;
  };
  var getStyleObject = (props) => {
    const {
      theme,
      dependentAxis
    } = props;
    const generalAxisStyle = theme && theme.axis && theme.axis.style;
    const axisType = dependentAxis ? "dependentAxis" : "independentAxis";
    const specificAxisStyle = theme && theme[axisType] && theme[axisType].style;
    const mergeStyles = () => {
      const styleNamespaces = ["axis", "axisLabel", "grid", "parent", "tickLabels", "ticks"];
      return styleNamespaces.reduce((memo4, curr) => {
        memo4[curr] = (0, import_defaults19.default)({}, specificAxisStyle[curr], generalAxisStyle[curr]);
        return memo4;
      }, {});
    };
    return generalAxisStyle && specificAxisStyle ? mergeStyles() : specificAxisStyle || generalAxisStyle;
  };
  var getStyles3 = function(props, styleObject) {
    if (styleObject === void 0) {
      styleObject = {};
    }
    const style = props.style || {};
    const parentStyleProps = {
      height: "100%",
      width: "100%"
    };
    return {
      parent: (0, import_defaults19.default)(style.parent, styleObject.parent, parentStyleProps),
      axis: (0, import_defaults19.default)({}, style.axis, styleObject.axis),
      axisLabel: (0, import_defaults19.default)({}, style.axisLabel, styleObject.axisLabel),
      grid: (0, import_defaults19.default)({}, style.grid, styleObject.grid),
      ticks: (0, import_defaults19.default)({}, style.ticks, styleObject.ticks),
      tickLabels: (0, import_defaults19.default)({}, style.tickLabels, styleObject.tickLabels)
    };
  };
  var getTickProps = (layout, style, datum) => {
    const {
      position,
      transform
    } = layout;
    return {
      x1: transform.x,
      y1: transform.y,
      x2: transform.x + position.x2,
      y2: transform.y + position.y2,
      style,
      datum
    };
  };
  var getTickLabelProps = (layout, style, anchors, datum, text) => {
    const {
      position,
      transform
    } = layout;
    return {
      style,
      x: transform.x + position.x,
      y: transform.y + position.y,
      verticalAnchor: anchors.verticalAnchor,
      textAnchor: anchors.textAnchor,
      angle: style.angle,
      text,
      datum
    };
  };
  var getGridProps = (layout, style, datum) => {
    const {
      edge,
      transform
    } = layout;
    return {
      x1: transform.x,
      y1: transform.y,
      x2: edge.x + transform.x,
      y2: edge.y + transform.y,
      style,
      datum
    };
  };
  var getAxisProps = (modifiedProps, calculatedValues, globalTransform) => {
    const {
      style,
      padding: padding3,
      isVertical: isVertical2
    } = calculatedValues;
    const {
      width,
      height
    } = modifiedProps;
    return {
      style: style.axis,
      x1: isVertical2 ? globalTransform.x : padding3.left + globalTransform.x,
      x2: isVertical2 ? globalTransform.x : width - padding3.right + globalTransform.x,
      y1: isVertical2 ? padding3.top + globalTransform.y : globalTransform.y,
      y2: isVertical2 ? height - padding3.bottom + globalTransform.y : globalTransform.y
    };
  };
  var getEvaluatedStyles = (style, props) => {
    return {
      tickStyle: helpers_exports.evaluateStyle(style.ticks, props),
      labelStyle: helpers_exports.evaluateStyle(style.tickLabels, props),
      gridStyle: helpers_exports.evaluateStyle(style.grid, props)
    };
  };
  var getAxisLabelProps = (props, calculatedValues, globalTransform) => {
    const {
      style,
      orientation,
      padding: padding3,
      labelPadding,
      isVertical: isVertical2
    } = calculatedValues;
    const sign2 = orientationSign[orientation];
    const hPadding = padding3.left + padding3.right;
    const vPadding = padding3.top + padding3.bottom;
    const verticalAnchor = sign2 < 0 ? "end" : "start";
    const labelStyle = style.axisLabel;
    const angle = isVertical2 ? -90 : 0;
    const x2 = isVertical2 ? globalTransform.x + sign2 * labelPadding : (props.width - hPadding) / 2 + padding3.left + globalTransform.x;
    const y2 = isVertical2 ? (props.height - vPadding) / 2 + padding3.top + globalTransform.y : sign2 * labelPadding + globalTransform.y;
    return {
      x: x2,
      y: y2,
      verticalAnchor: labelStyle.verticalAnchor || verticalAnchor,
      textAnchor: labelStyle.textAnchor || "middle",
      angle: labelStyle.angle === void 0 ? angle : labelStyle.angle,
      style: labelStyle,
      text: props.label
    };
  };
  var getAnchors = (orientation, isVertical2) => {
    const anchorOrientation = {
      top: "end",
      left: "end",
      right: "start",
      bottom: "start"
    };
    const anchor = anchorOrientation[orientation];
    return {
      textAnchor: isVertical2 ? anchor : "middle",
      verticalAnchor: isVertical2 ? "middle" : anchor
    };
  };
  var getLabelPadding = (props, style) => {
    const labelStyle = style.axisLabel || {};
    if (labelStyle.padding !== void 0 && labelStyle.padding !== null) {
      return labelStyle.padding;
    }
    const isVertical2 = axis_exports.isVertical(props);
    const fontSize4 = labelStyle.fontSize || 14;
    return props.label ? fontSize4 * (isVertical2 ? 2.3 : 1.6) : 0;
  };
  var getDefaultOrientations = (axis, originSign, horizontal) => {
    const sign2 = originSign || "positive";
    const orientations = {
      positive: {
        x: "bottom",
        y: "left"
      },
      negative: {
        x: "top",
        y: "right"
      }
    };
    const horizontalOrientations = {
      positive: {
        x: "left",
        y: "bottom"
      },
      negative: {
        x: "right",
        y: "top"
      }
    };
    return horizontal ? horizontalOrientations[sign2][axis] : orientations[sign2][axis];
  };
  var getStandaloneOffset = (props, calculatedValues) => {
    const {
      style,
      scale,
      orientation,
      padding: padding3,
      axis,
      ticks: ticks2,
      stringTicks: stringTicks2,
      isVertical: isVertical2,
      labelPadding
    } = calculatedValues;
    const {
      polar,
      horizontal
    } = props;
    const sharedProps = {
      scale: {
        [axis]: scale
      },
      polar,
      horizontal,
      ticks: ticks2,
      stringTicks: stringTicks2
    };
    const xPadding = orientation === "right" ? padding3.right : padding3.left;
    const yPadding = orientation === "top" ? padding3.top : padding3.bottom;
    const offsetX = props.offsetX !== null && props.offsetX !== void 0 ? props.offsetX : xPadding;
    const offsetY = props.offsetY !== null && props.offsetY !== void 0 ? props.offsetY : yPadding;
    const fontSize4 = style.axisLabel.fontSize || 14;
    const tickSizes = ticks2.map((data, index) => {
      const tick = stringTicks2 ? props.tickValues[data - 1] : data;
      const tickStyle = helpers_exports.evaluateStyle(style.ticks, Object.assign({}, sharedProps, {
        tick,
        index
      }));
      return tickStyle.size || 0;
    });
    const totalPadding = fontSize4 + 2 * Math.max(...tickSizes) + labelPadding;
    const minimumPadding = 1.2 * fontSize4;
    const x2 = isVertical2 ? totalPadding : minimumPadding;
    const y2 = isVertical2 ? minimumPadding : totalPadding;
    return {
      x: offsetX !== null && offsetX !== void 0 ? offsetX : x2,
      y: offsetY !== null && offsetY !== void 0 ? offsetY : y2
    };
  };
  var isEqual7 = (a2, b) => {
    if (a2 instanceof Date && b instanceof Date) {
      return a2.getTime() === b.getTime();
    }
    return a2 === b;
  };
  var getOffset2 = (props, calculatedValues) => {
    const {
      scale,
      origin,
      orientation,
      orientations,
      domain,
      padding: padding3
    } = calculatedValues;
    const {
      top: top2,
      bottom: bottom2,
      left: left2,
      right: right2
    } = padding3;
    const calculatedOrientation = {
      x: orientation === "bottom" || orientation === "top" ? orientation : orientations.x,
      y: orientation === "left" || orientation === "right" ? orientation : orientations.y
    };
    const orientationOffset = {
      x: calculatedOrientation.y === "left" ? left2 : right2,
      y: calculatedOrientation.x === "bottom" ? bottom2 : top2
    };
    const originOffset = {
      x: calculatedOrientation.y === "left" ? 0 : props.width,
      y: calculatedOrientation.x === "bottom" ? props.height : 0
    };
    const originPosition = {
      x: isEqual7(origin.x, domain.x[0]) || isEqual7(origin.x, domain.x[1]) ? 0 : scale.x(origin.x),
      y: isEqual7(origin.y, domain.y[0]) || isEqual7(origin.y, domain.y[1]) ? 0 : scale.y(origin.y)
    };
    const x2 = originPosition.x ? Math.abs(originOffset.x - originPosition.x) : orientationOffset.x;
    const y2 = originPosition.y ? Math.abs(originOffset.y - originPosition.y) : orientationOffset.y;
    const offsetX = exists(props.offsetX) ? props.offsetX : x2;
    const offsetY = exists(props.offsetY) ? props.offsetY : y2;
    return {
      x: offsetX,
      y: offsetY
    };
  };
  var getHorizontalOffset = (props, calculatedValues) => {
    const {
      scale,
      origin,
      orientation,
      orientations,
      domain,
      padding: padding3
    } = calculatedValues;
    const {
      top: top2,
      bottom: bottom2,
      left: left2,
      right: right2
    } = padding3;
    const calculatedOrientation = {
      y: orientation === "bottom" || orientation === "top" ? orientation : orientations.x,
      x: orientation === "left" || orientation === "right" ? orientation : orientations.y
    };
    const orientationOffset = {
      x: calculatedOrientation.y === "bottom" ? bottom2 : top2,
      y: calculatedOrientation.x === "left" ? left2 : right2
    };
    const originOffset = {
      y: calculatedOrientation.x === "left" ? 0 : props.width,
      x: calculatedOrientation.y === "bottom" ? props.height : 0
    };
    const originPosition = {
      x: isEqual7(origin.x, domain.x[0]) || isEqual7(origin.x, domain.x[1]) ? 0 : scale.x(origin.x),
      y: isEqual7(origin.y, domain.y[0]) || isEqual7(origin.y, domain.y[1]) ? 0 : scale.y(origin.y)
    };
    const y2 = originPosition.x ? Math.abs(originOffset.x - originPosition.x) : orientationOffset.x;
    const x2 = originPosition.y ? Math.abs(originOffset.y - originPosition.y) : orientationOffset.y;
    const offsetX = exists(props.offsetX) ? props.offsetX : x2;
    const offsetY = exists(props.offsetY) ? props.offsetY : y2;
    return {
      x: offsetX,
      y: offsetY
    };
  };
  var getTransform2 = (props, calculatedValues, offset2) => {
    const {
      orientation,
      axis
    } = calculatedValues;
    const axisValue = axis_exports.getAxisValue(props, axis);
    return {
      top: {
        x: 0,
        y: axisValue !== void 0 ? axisValue : offset2.y
      },
      bottom: {
        x: 0,
        y: axisValue !== void 0 ? axisValue : props.height - offset2.y
      },
      left: {
        x: axisValue !== void 0 ? axisValue : offset2.x,
        y: 0
      },
      right: {
        x: axisValue !== void 0 ? axisValue : props.width - offset2.x,
        y: 0
      }
    }[orientation];
  };
  var getTickPosition = (style, orientation, isVertical2) => {
    const {
      tickStyle,
      labelStyle
    } = style;
    const size = tickStyle.size || 0;
    const tickPadding = tickStyle.padding || 0;
    const labelPadding = labelStyle.padding || 0;
    const tickSpacing = size + tickPadding + labelPadding;
    const sign2 = orientationSign[orientation];
    return {
      x: isVertical2 ? sign2 * tickSpacing : 0,
      x2: isVertical2 ? sign2 * size : 0,
      y: isVertical2 ? 0 : sign2 * tickSpacing,
      y2: isVertical2 ? 0 : sign2 * size
    };
  };
  var getTickTransform = (tick, globalTransform, isVertical2) => {
    return {
      x: isVertical2 ? globalTransform.x : tick + globalTransform.x,
      y: isVertical2 ? tick + globalTransform.y : globalTransform.y
    };
  };
  var getGridEdge = (props, calculatedValues) => {
    const {
      orientation,
      padding: padding3,
      isVertical: isVertical2
    } = calculatedValues;
    const sign2 = -orientationSign[orientation];
    const x2 = isVertical2 ? sign2 * (props.width - (padding3.left + padding3.right)) : 0;
    const y2 = isVertical2 ? 0 : sign2 * (props.height - (padding3.top + padding3.bottom));
    return {
      x: x2,
      y: y2
    };
  };
  var getGridOffset = (calculatedValues, offset2) => {
    const {
      padding: padding3,
      orientation,
      crossAxis
    } = calculatedValues;
    const xPadding = orientation === "right" ? padding3.right : padding3.left;
    const yPadding = orientation === "top" ? padding3.top : padding3.bottom;
    return {
      x: crossAxis ? offset2.x - xPadding : 0,
      y: crossAxis ? offset2.y - yPadding : 0
    };
  };
  var getLayoutProps = (modifiedProps, calculatedValues) => {
    let offset2;
    if (calculatedValues.domain.x && calculatedValues.domain.y) {
      offset2 = modifiedProps.horizontal ? getHorizontalOffset(modifiedProps, calculatedValues) : getOffset2(modifiedProps, calculatedValues);
    } else {
      offset2 = getStandaloneOffset(modifiedProps, calculatedValues);
    }
    return {
      globalTransform: getTransform2(modifiedProps, calculatedValues, offset2),
      gridOffset: getGridOffset(calculatedValues, offset2),
      gridEdge: getGridEdge(modifiedProps, calculatedValues)
    };
  };
  var getOrientation = (props) => {
    if (props.orientation) {
      return props.orientation;
    }
    const defaultOrientations = {
      dependent: props.horizontal ? "bottom" : "left",
      independent: props.horizontal ? "left" : "bottom"
    };
    return props.dependentAxis ? defaultOrientations.dependent : defaultOrientations.independent;
  };
  var getCalculatedValues = (props) => {
    const defaultStyles2 = getStyleObject(props);
    const style = getStyles3(props, defaultStyles2);
    const padding3 = helpers_exports.getPadding(props.padding);
    const labelPadding = getLabelPadding(props, style);
    const stringTicks2 = axis_exports.stringTicks(props) ? props.tickValues : void 0;
    const axis = axis_exports.getAxis(props);
    const axisDomain = axis_exports.getDomain(props);
    const axisScale = getScale2(props);
    const xAxisDomain = axis === "x" ? axisDomain : void 0;
    const yAxisDomain = axis === "y" ? axisDomain : void 0;
    const xAxisScale = axis === "x" ? axisScale : void 0;
    const yAxisScale = axis === "y" ? axisScale : void 0;
    const crossAxis = !(props.crossAxis === false || props.standalone === true);
    const ticks2 = axis_exports.getTicks(props, axisScale, crossAxis);
    const tickFormat2 = axis_exports.getTickFormat(props, axisScale);
    const range4 = {
      x: helpers_exports.getRange(props, "x"),
      y: helpers_exports.getRange(props, "y")
    };
    const domain = {
      x: props.domain && props.domain.x ? props.domain.x : xAxisDomain,
      y: props.domain && props.domain.y ? props.domain.y : yAxisDomain
    };
    const scale = {
      x: props.domain && props.domain.x ? scale_exports.getBaseScale(props, "x").domain(props.domain.x).range(props.horizontal ? range4.y : range4.x) : xAxisScale,
      y: props.domain && props.domain.y ? scale_exports.getBaseScale(props, "y").domain(props.domain.y).range(props.horizontal ? range4.x : range4.y) : yAxisScale
    };
    const origin = domain.x && domain.y ? axis_exports.getOrigin(domain) : void 0;
    const originSign = origin ? {
      x: axis_exports.getOriginSign(origin.x, domain.x),
      y: axis_exports.getOriginSign(origin.y, domain.y)
    } : void 0;
    const orientations = originSign ? {
      x: getDefaultOrientations("x", originSign.y, props.horizontal),
      y: getDefaultOrientations("y", originSign.x, props.horizontal)
    } : void 0;
    const orientation = orientations ? props.orientation || orientations[axis] : getOrientation(props);
    const isVertical2 = axis_exports.isVertical(Object.assign({}, props, {
      orientation
    }));
    const anchors = getAnchors(orientation, isVertical2);
    return {
      anchors,
      axis,
      crossAxis,
      domain,
      isVertical: isVertical2,
      labelPadding,
      orientation,
      orientations,
      origin,
      padding: padding3,
      scale,
      stringTicks: stringTicks2,
      style,
      tickFormat: tickFormat2,
      ticks: ticks2
    };
  };
  var getBaseProps = (initialProps, fallbackProps12) => {
    const props = axis_exports.modifyProps(initialProps, fallbackProps12);
    const calculatedValues = getCalculatedValues(props);
    const {
      axis,
      style,
      orientation,
      isVertical: isVertical2,
      scale,
      ticks: ticks2,
      tickFormat: tickFormat2,
      anchors,
      domain,
      stringTicks: stringTicks2
    } = calculatedValues;
    const otherAxis = axis === "x" ? "y" : "x";
    const {
      width,
      height,
      standalone,
      theme,
      polar,
      padding: padding3,
      horizontal
    } = props;
    const {
      globalTransform,
      gridOffset,
      gridEdge
    } = getLayoutProps(props, calculatedValues);
    const sharedProps = {
      scale: {
        [axis]: scale[axis]
      },
      polar,
      horizontal,
      ticks: ticks2,
      stringTicks: stringTicks2
    };
    const axisProps = getAxisProps(props, calculatedValues, globalTransform);
    const axisLabelProps = getAxisLabelProps(props, calculatedValues, globalTransform);
    const initialChildProps = {
      parent: Object.assign({
        style: style.parent,
        ticks: ticks2,
        standalone,
        theme,
        width,
        height,
        padding: padding3,
        domain
      }, sharedProps)
    };
    const gridProps = {
      dimension: otherAxis,
      range: {
        [otherAxis]: helpers_exports.getRange(props, otherAxis)
      },
      scale: props.scale && props.scale[otherAxis] ? {
        [otherAxis]: props.scale[otherAxis]
      } : void 0
    };
    return ticks2.reduce((childProps, tickValue, index) => {
      const tick = stringTicks2 ? stringTicks2[index] : tickValue;
      const text = tickFormat2(tickValue, index, ticks2);
      const styles3 = getEvaluatedStyles(style, Object.assign({}, sharedProps, {
        tick,
        tickValue,
        index,
        text
      }));
      const tickLayout = {
        position: getTickPosition(styles3, orientation, isVertical2),
        transform: getTickTransform(scale[axis]?.(tickValue), globalTransform, isVertical2)
      };
      const gridLayout = {
        edge: gridEdge,
        transform: {
          x: isVertical2 ? -gridOffset.x + globalTransform.x : scale[axis]?.(tickValue) + globalTransform.x,
          y: isVertical2 ? scale[axis]?.(tickValue) + globalTransform.y : gridOffset.y + globalTransform.y
        }
      };
      childProps[index] = {
        axis: Object.assign({
          dimension: axis
        }, sharedProps, axisProps),
        axisLabel: Object.assign({}, sharedProps, axisLabelProps),
        ticks: Object.assign({}, sharedProps, getTickProps(tickLayout, styles3.tickStyle, tickValue)),
        tickLabels: Object.assign({}, sharedProps, getTickLabelProps(tickLayout, styles3.labelStyle, anchors, tickValue, text)),
        grid: Object.assign({}, sharedProps, gridProps, getGridProps(gridLayout, styles3.gridStyle, tickValue))
      };
      return childProps;
    }, initialChildProps);
  };

  // node_modules/victory-axis/es/victory-axis.js
  var fallbackProps = {
    width: 450,
    height: 300,
    padding: 50
  };
  var options = {
    components: [{
      name: "axis",
      index: 0
    }, {
      name: "axisLabel",
      index: 0
    }, {
      name: "grid"
    }, {
      name: "parent",
      index: "parent"
    }, {
      name: "ticks"
    }, {
      name: "tickLabels"
    }]
  };
  var VictoryAxisBase = class extends import_react90.default.Component {
    static getStyles(props) {
      return getStyles3(props);
    }
    static getBaseProps(props) {
      return getBaseProps(props, fallbackProps);
    }
    renderLine(props) {
      const {
        axisComponent
      } = props;
      const axisProps = this.getComponentProps(axisComponent, "axis", 0);
      return /* @__PURE__ */ import_react90.default.cloneElement(axisComponent, axisProps);
    }
    renderLabel(props) {
      const {
        axisLabelComponent,
        label
      } = props;
      if (!label) {
        return null;
      }
      const axisLabelProps = this.getComponentProps(axisLabelComponent, "axisLabel", 0);
      return /* @__PURE__ */ import_react90.default.cloneElement(axisLabelComponent, axisLabelProps);
    }
    renderGridAndTicks(props) {
      const {
        tickComponent,
        tickLabelComponent,
        gridComponent,
        name: name2
      } = props;
      const shouldRender = (componentProps) => {
        const {
          style = {},
          events = {}
        } = componentProps;
        const visible = style.stroke !== "transparent" && style.stroke !== "none" && style.strokeWidth !== 0;
        return visible || !(0, import_isEmpty6.default)(events);
      };
      return this.dataKeys.map((key, index) => {
        const tickProps = this.getComponentProps(tickComponent, "ticks", index);
        const BaseTickComponent = /* @__PURE__ */ import_react90.default.cloneElement(tickComponent, tickProps);
        const TickComponent = shouldRender(BaseTickComponent.props) ? BaseTickComponent : void 0;
        const gridProps = this.getComponentProps(gridComponent, "grid", index);
        const BaseGridComponent = /* @__PURE__ */ import_react90.default.cloneElement(gridComponent, gridProps);
        const GridComponent = shouldRender(BaseGridComponent.props) ? BaseGridComponent : void 0;
        const tickLabelProps = this.getComponentProps(tickLabelComponent, "tickLabels", index);
        const TickLabel = /* @__PURE__ */ import_react90.default.cloneElement(tickLabelComponent, tickLabelProps);
        const children = [GridComponent, TickComponent, TickLabel].filter(Boolean);
        return /* @__PURE__ */ import_react90.default.cloneElement(props.groupComponent, {
          key: `${name2}-tick-group-${key}`
        }, children);
      });
    }
    fixLabelOverlap(gridAndTicks, props) {
      const isVertical2 = axis_exports.isVertical(props);
      const size = isVertical2 ? props.height : props.width;
      const isVictoryLabel = (child) => child.type && child.type.role === "label";
      const labels = gridAndTicks.map((gridAndTick) => gridAndTick.props.children).reduce((accumulator, childArr) => accumulator.concat(childArr), []).filter(isVictoryLabel).map((child) => child.props);
      const paddingToObject = (padding3) => typeof padding3 === "object" ? Object.assign({}, {
        top: 0,
        right: 0,
        bottom: 0,
        left: 0
      }, padding3) : {
        top: padding3,
        right: padding3,
        bottom: padding3,
        left: padding3
      };
      const labelsSumSize = labels.reduce((sum3, label) => {
        const padding3 = paddingToObject(label.style.padding);
        const labelSize = textsize_exports.approximateTextSize(label.text, {
          angle: label.angle,
          fontSize: label.style.fontSize,
          letterSpacing: label.style.letterSpacing,
          fontFamily: label.style.fontFamily
        });
        return sum3 + (isVertical2 ? labelSize.height + padding3.top + padding3.bottom : labelSize.width + padding3.right + padding3.left);
      }, 0);
      const availiableLabelCount = Math.floor(size * gridAndTicks.length / labelsSumSize);
      const divider = Math.ceil(gridAndTicks.length / availiableLabelCount) || 1;
      const getLabelCoord = (gridAndTick) => gridAndTick.props.children.filter(isVictoryLabel).reduce((prev, child) => (isVertical2 ? child.props.y : child.props.x) || 0, 0);
      const sorted = gridAndTicks.sort(
        (a2, b) => isVertical2 ? getLabelCoord(b) - getLabelCoord(a2) : getLabelCoord(a2) - getLabelCoord(b)
        // ordinary axis has left-right orientation
      );
      return sorted.filter((gridAndTick, index) => index % divider === 0);
    }
    // Overridden in native versions
    shouldAnimate() {
      return !!this.props.animate;
    }
    render() {
      const {
        animationWhitelist
      } = VictoryAxis;
      const props = axis_exports.modifyProps(this.props, fallbackProps);
      const userProps = user_props_exports.getSafeUserProps(this.props);
      if (this.shouldAnimate()) {
        return this.animateComponent(props, animationWhitelist);
      }
      const gridAndTicks = this.renderGridAndTicks(props);
      const modifiedGridAndTicks = props.fixLabelOverlap ? this.fixLabelOverlap(gridAndTicks, props) : gridAndTicks;
      const children = [this.renderLine(props), this.renderLabel(props), ...modifiedGridAndTicks];
      const container = /* @__PURE__ */ import_react90.default.cloneElement(props.containerComponent, userProps);
      return props.standalone ? this.renderContainer(container, children) : /* @__PURE__ */ import_react90.default.cloneElement(props.groupComponent, userProps, children);
    }
  };
  __publicField(VictoryAxisBase, "animationWhitelist", ["style", "domain", "range", "tickCount", "tickValues", "offsetX", "offsetY", "padding", "width", "height"]);
  __publicField(VictoryAxisBase, "displayName", "VictoryAxis");
  __publicField(VictoryAxisBase, "role", "axis");
  __publicField(VictoryAxisBase, "defaultTransitions", {
    onExit: {
      duration: 500
    },
    onEnter: {
      duration: 500
    }
  });
  __publicField(VictoryAxisBase, "defaultProps", {
    axisComponent: /* @__PURE__ */ import_react90.default.createElement(LineSegment, null),
    axisLabelComponent: /* @__PURE__ */ import_react90.default.createElement(VictoryLabel, null),
    tickLabelComponent: /* @__PURE__ */ import_react90.default.createElement(VictoryLabel, null),
    tickComponent: /* @__PURE__ */ import_react90.default.createElement(LineSegment, null),
    gridComponent: /* @__PURE__ */ import_react90.default.createElement(LineSegment, null),
    standalone: true,
    theme: VictoryTheme.grayscale,
    containerComponent: /* @__PURE__ */ import_react90.default.createElement(VictoryContainer, null),
    groupComponent: /* @__PURE__ */ import_react90.default.createElement("g", {
      role: "presentation"
    }),
    fixLabelOverlap: false
  });
  __publicField(VictoryAxisBase, "getDomain", axis_exports.getDomain);
  __publicField(VictoryAxisBase, "getAxis", axis_exports.getAxis);
  __publicField(VictoryAxisBase, "expectedComponents", ["axisComponent", "axisLabelComponent", "groupComponent", "containerComponent", "tickComponent", "tickLabelComponent", "gridComponent"]);
  var VictoryAxis = addEvents(VictoryAxisBase, options);

  // node_modules/victory-polar-axis/es/victory-polar-axis.js
  var import_react91 = __toESM(require_react());
  var import_isEmpty7 = __toESM(require_isEmpty());

  // node_modules/victory-polar-axis/es/helper-methods.js
  var import_defaults20 = __toESM(require_defaults());
  var import_uniqBy2 = __toESM(require_uniqBy());
  var getPosition3 = (r, angle, axis) => {
    return axis === "x" ? r * Math.cos(angle) : -r * Math.sin(angle);
  };
  var getAxisType = (props) => {
    const typicalType = props.dependentAxis ? "radial" : "angular";
    const invertedType = typicalType === "angular" ? "radial" : "angular";
    return props.horizontal ? invertedType : typicalType;
  };
  var filterTicks = (ticks2, scale) => {
    const compareTicks = (t) => scale(t) % (2 * Math.PI);
    return (0, import_uniqBy2.default)(ticks2, compareTicks);
  };
  var getEvaluatedStyles2 = (style, props) => {
    return {
      tickStyle: helpers_exports.evaluateStyle(style.ticks, props),
      labelStyle: helpers_exports.evaluateStyle(style.tickLabels, props),
      gridStyle: helpers_exports.evaluateStyle(style.grid, props)
    };
  };
  var getStyleObject2 = (props) => {
    const {
      theme = {},
      dependentAxis
    } = props;
    const generalAxisStyle = theme.polarAxis && theme.polarAxis.style || theme.axis && theme.axis.style;
    const polarAxisType = dependentAxis ? "polarDependentAxis" : "polarIndependentAxis";
    const standardAxisType = dependentAxis ? "dependentAxis" : "independentAxis";
    const specificAxisStyle = theme?.[polarAxisType]?.style || theme?.[standardAxisType]?.style;
    const mergeStyles = () => {
      const styleNamespaces = ["axis", "axisLabel", "grid", "parent", "tickLabels", "ticks"];
      return styleNamespaces.reduce((memo4, curr) => {
        memo4[curr] = (0, import_defaults20.default)({}, specificAxisStyle?.[curr], generalAxisStyle?.[curr]);
        return memo4;
      }, {});
    };
    return generalAxisStyle && specificAxisStyle ? mergeStyles() : specificAxisStyle || generalAxisStyle;
  };
  var getRadius2 = (props) => {
    const {
      left: left2,
      right: right2,
      top: top2,
      bottom: bottom2
    } = helpers_exports.getPadding(props.padding);
    const {
      width,
      height
    } = props;
    if (width === void 0 || height === void 0) {
      throw new Error("VictoryPolarAxis: width and height properties are required for standalone axes.");
    }
    return Math.min(width - left2 - right2, height - top2 - bottom2) / 2;
  };
  var getRange2 = (props, axis) => {
    if (props.range && props.range[axis]) {
      return props.range[axis];
    } else if (props.range && Array.isArray(props.range)) {
      return props.range;
    }
    const axisType = getAxisType(props);
    if (axisType === "angular") {
      const startAngle = helpers_exports.degreesToRadians(props.startAngle);
      const endAngle = helpers_exports.degreesToRadians(props.endAngle);
      return [startAngle, endAngle];
    }
    const radius = getRadius2(props);
    return [props.innerRadius || 0, radius];
  };
  var getScale3 = (props) => {
    const axis = axis_exports.getAxis(props);
    const scale = scale_exports.getBaseScale(props, axis);
    const domain = axis_exports.getDomain(props, axis) || scale.domain();
    const range4 = getRange2(props, axis);
    scale.range(range4);
    scale.domain(domain);
    return scale;
  };
  var getStyles4 = function(props, styleObject) {
    if (styleObject === void 0) {
      styleObject = {};
    }
    if (props.disableInlineStyles) {
      return {};
    }
    const style = props.style || {};
    const parentStyleProps = {
      height: "auto",
      width: "100%"
    };
    return {
      parent: (0, import_defaults20.default)(parentStyleProps, style.parent, styleObject.parent),
      axis: (0, import_defaults20.default)({}, style.axis, styleObject.axis),
      axisLabel: (0, import_defaults20.default)({}, style.axisLabel, styleObject.axisLabel),
      grid: (0, import_defaults20.default)({}, style.grid, styleObject.grid),
      ticks: (0, import_defaults20.default)({}, style.ticks, styleObject.ticks),
      tickLabels: (0, import_defaults20.default)({}, style.tickLabels, styleObject.tickLabels)
    };
  };
  var getAxisAngle = (props) => {
    const {
      axisAngle,
      startAngle,
      dependentAxis
    } = props;
    const axis = axis_exports.getAxis(props);
    const axisValue = axis_exports.getAxisValue(props, axis);
    if (axisValue === void 0 || !dependentAxis) {
      return axisAngle === void 0 ? startAngle : axisAngle;
    }
    return helpers_exports.radiansToDegrees(axisValue);
  };
  var getTickProps2 = (props, calculatedValues, tickValue, index) => {
    const {
      axisType,
      radius,
      scale,
      style,
      stringTicks: stringTicks2,
      ticks: ticks2,
      tickFormat: tickFormat2,
      origin
    } = calculatedValues;
    const text = tickFormat2(tickValue, index, ticks2);
    const tick = stringTicks2 ? stringTicks2[index] : tickValue;
    const {
      tickStyle
    } = getEvaluatedStyles2(style, {
      tick,
      tickValue,
      index,
      ticks: ticks2,
      stringTicks: stringTicks2,
      radius,
      scale,
      axisType,
      text
    });
    const axisAngle = axisType === "radial" ? getAxisAngle(props) : void 0;
    const tickPadding = tickStyle.padding || tickStyle.size || 0;
    const padAngle = helpers_exports.degreesToRadians(90 - axisAngle);
    const tickAngle = axisType === "angular" ? scale(tickValue) : helpers_exports.degreesToRadians(-1 * axisAngle);
    const tickRadius = axisType === "angular" ? radius : scale(tickValue);
    return axisType === "angular" ? {
      index,
      datum: tick,
      style: tickStyle,
      x1: getPosition3(tickRadius, tickAngle, "x") + origin.x,
      y1: getPosition3(tickRadius, tickAngle, "y") + origin.y,
      x2: getPosition3(tickRadius + tickPadding, tickAngle, "x") + origin.x,
      y2: getPosition3(tickRadius + tickPadding, tickAngle, "y") + origin.y
    } : {
      index,
      datum: tick,
      style: tickStyle,
      x1: tickRadius * Math.cos(tickAngle) + Math.cos(padAngle) * tickPadding + origin.x,
      x2: tickRadius * Math.cos(tickAngle) - Math.cos(padAngle) * tickPadding + origin.x,
      y1: tickRadius * Math.sin(tickAngle) + Math.sin(padAngle) * tickPadding + origin.y,
      y2: tickRadius * Math.sin(tickAngle) - Math.sin(padAngle) * tickPadding + origin.y
    };
  };
  var getTickLabelProps2 = (props, calculatedValues, tickValue, index) => {
    const {
      axisType,
      radius,
      tickFormat: tickFormat2,
      style,
      scale,
      ticks: ticks2,
      stringTicks: stringTicks2,
      origin
    } = calculatedValues;
    const text = tickFormat2(tickValue, index, ticks2);
    const tick = stringTicks2 ? stringTicks2[index] : tickValue;
    const {
      labelStyle
    } = getEvaluatedStyles2(style, {
      text,
      tick,
      tickValue,
      index,
      ticks: ticks2,
      stringTicks: stringTicks2,
      radius,
      scale,
      axisType
    });
    const {
      tickLabelComponent
    } = props;
    const labelPlacement = tickLabelComponent?.props.labelPlacement ? tickLabelComponent.props.labelPlacement : props.labelPlacement;
    const tickPadding = labelStyle.padding || 0;
    const angularPadding = 0;
    const axisAngle = axisType === "radial" ? getAxisAngle(props) : void 0;
    const labelAngle = axisType === "angular" ? helpers_exports.radiansToDegrees(scale(tickValue)) : axisAngle + angularPadding;
    const textAngle = labelStyle.angle === void 0 ? label_helpers_exports.getPolarAngle(Object.assign({}, props, {
      labelPlacement
    }), labelAngle) : labelStyle.angle;
    const labelRadius = axisType === "angular" ? radius + tickPadding : scale(tickValue);
    const textAnchor = labelStyle.textAnchor || label_helpers_exports.getPolarTextAnchor(Object.assign({}, props, {
      labelPlacement
    }), labelAngle);
    return {
      index,
      datum: tick,
      style: labelStyle,
      angle: textAngle,
      textAnchor,
      text,
      x: labelRadius * Math.cos(helpers_exports.degreesToRadians(labelAngle)) + origin.x,
      y: -labelRadius * Math.sin(helpers_exports.degreesToRadians(labelAngle)) + origin.y
    };
  };
  var getGridProps2 = (props, calculatedValues, tickValue, index) => {
    const {
      axisType,
      radius,
      style,
      scale,
      stringTicks: stringTicks2,
      ticks: ticks2,
      tickFormat: tickFormat2,
      origin
    } = calculatedValues;
    const text = tickFormat2(tickValue, index, ticks2);
    const {
      startAngle,
      endAngle,
      innerRadius = 0
    } = props;
    const tick = stringTicks2 ? stringTicks2[index] : tickValue;
    const {
      gridStyle
    } = getEvaluatedStyles2(style, {
      tick,
      tickValue,
      index,
      ticks: ticks2,
      stringTicks: stringTicks2,
      radius,
      scale,
      axisType,
      text
    });
    const angle = scale(tickValue);
    return axisType === "angular" ? {
      index,
      datum: tick,
      style: gridStyle,
      x1: getPosition3(radius, angle, "x") + origin.x,
      y1: getPosition3(radius, angle, "y") + origin.y,
      x2: getPosition3(innerRadius, angle, "x") + origin.x,
      y2: getPosition3(innerRadius, angle, "y") + origin.y
    } : {
      style: gridStyle,
      index,
      datum: tick,
      cx: origin.x,
      cy: origin.y,
      r: scale(tickValue),
      startAngle,
      endAngle
    };
  };
  var getAxisLabelProps2 = (props, calculatedValues) => {
    const {
      axisType,
      radius,
      style,
      origin
    } = calculatedValues;
    const {
      axisLabelComponent
    } = props;
    if (axisType !== "radial") {
      return {};
    }
    const labelPlacement = axisLabelComponent?.props.labelPlacement ? axisLabelComponent.props.labelPlacement : props.labelPlacement;
    const labelStyle = style && style.axisLabel || {};
    const axisAngle = axisType === "radial" ? getAxisAngle(props) : void 0;
    const textAngle = labelStyle.angle === void 0 ? label_helpers_exports.getPolarAngle(Object.assign({}, props, {
      labelPlacement
    }), axisAngle) : labelStyle.angle;
    const labelRadius = radius + (labelStyle.padding || 0);
    const textAnchor = labelStyle.textAnchor || label_helpers_exports.getPolarTextAnchor(Object.assign({}, props, {
      labelPlacement
    }), axisAngle);
    const verticalAnchor = labelStyle.verticalAnchor || label_helpers_exports.getPolarVerticalAnchor(Object.assign({}, props, {
      labelPlacement
    }), axisAngle);
    return {
      style: labelStyle,
      angle: textAngle,
      textAnchor,
      verticalAnchor,
      text: props.label,
      x: getPosition3(labelRadius, helpers_exports.degreesToRadians(axisAngle), "x") + origin.x,
      y: getPosition3(labelRadius, helpers_exports.degreesToRadians(axisAngle), "y") + origin.y
    };
  };
  var getAxisProps2 = (modifiedProps, calculatedValues) => {
    const {
      style,
      axisType,
      radius,
      origin
    } = calculatedValues;
    const {
      startAngle,
      endAngle,
      innerRadius = 0
    } = modifiedProps;
    const axisAngle = axisType === "radial" ? helpers_exports.degreesToRadians(getAxisAngle(modifiedProps)) : void 0;
    return axisType === "radial" ? {
      style: style.axis,
      x1: getPosition3(innerRadius, axisAngle, "x") + origin.x,
      x2: getPosition3(radius, axisAngle, "x") + origin.x,
      y1: getPosition3(innerRadius, axisAngle, "y") + origin.y,
      y2: getPosition3(radius, axisAngle, "y") + origin.y
    } : {
      style: style.axis,
      cx: origin.x,
      cy: origin.y,
      r: radius,
      startAngle,
      endAngle
    };
  };
  var getCalculatedValues2 = (initialProps) => {
    const props = Object.assign({
      polar: true
    }, initialProps);
    const defaultStyles2 = getStyleObject2(props);
    const style = getStyles4(props, defaultStyles2);
    const padding3 = helpers_exports.getPadding(props.padding);
    const axis = axis_exports.getAxis(props);
    const axisType = getAxisType(props);
    const stringTicks2 = axis_exports.stringTicks(props) ? props.tickValues : void 0;
    const domain = axis_exports.getDomain(props, axis);
    const range4 = getRange2(props, axis);
    const scale = getScale3(props);
    const initialTicks = axis_exports.getTicks(props, scale);
    const ticks2 = axisType === "angular" ? filterTicks(initialTicks, scale) : initialTicks;
    const tickFormat2 = axis_exports.getTickFormat(props, scale);
    const radius = getRadius2(props);
    const origin = helpers_exports.getPolarOrigin(props);
    return {
      axis,
      style,
      padding: padding3,
      stringTicks: stringTicks2,
      axisType,
      scale,
      ticks: ticks2,
      tickFormat: tickFormat2,
      domain,
      range: range4,
      radius,
      origin
    };
  };
  var getBaseProps2 = (initialProps, fallbackProps12) => {
    const props = axis_exports.modifyProps(initialProps, fallbackProps12);
    const calculatedValues = getCalculatedValues2(props);
    const {
      style,
      scale,
      ticks: ticks2,
      domain
    } = calculatedValues;
    const {
      width,
      height,
      standalone,
      theme,
      name: name2
    } = props;
    const axisProps = getAxisProps2(props, calculatedValues);
    const axisLabelProps = getAxisLabelProps2(props, calculatedValues);
    const initialChildProps = {
      parent: {
        style: style.parent,
        ticks: ticks2,
        scale,
        width,
        height,
        domain,
        standalone,
        theme,
        name: name2
      }
    };
    return ticks2.reduce((childProps, tick, index) => {
      childProps[index] = {
        axis: axisProps,
        axisLabel: axisLabelProps,
        ticks: getTickProps2(props, calculatedValues, tick, index),
        tickLabels: getTickLabelProps2(props, calculatedValues, tick, index),
        grid: getGridProps2(props, calculatedValues, tick, index)
      };
      return childProps;
    }, initialChildProps);
  };

  // node_modules/victory-polar-axis/es/victory-polar-axis.js
  var fallbackProps2 = {
    width: 450,
    height: 300,
    padding: 50
  };
  var VictoryPolarAxisBase = class extends import_react91.default.Component {
    static getScale(props) {
      return getScale3(props);
    }
    static getStyles(props) {
      return getStyles4(props, fallbackProps2.style);
    }
    static getBaseProps(props) {
      return getBaseProps2(props, fallbackProps2);
    }
    renderAxisLine(props) {
      const {
        dependentAxis
      } = props;
      const axisComponent = dependentAxis ? props.axisComponent : props.circularAxisComponent;
      const axisProps = this.getComponentProps(axisComponent, "axis", 0);
      return /* @__PURE__ */ import_react91.default.cloneElement(axisComponent, axisProps);
    }
    renderLabel(props) {
      const {
        axisLabelComponent,
        dependentAxis,
        label
      } = props;
      if (!label || !dependentAxis) {
        return null;
      }
      const axisLabelProps = this.getComponentProps(axisLabelComponent, "axisLabel", 0);
      return /* @__PURE__ */ import_react91.default.cloneElement(axisLabelComponent, axisLabelProps);
    }
    renderAxis(props) {
      const {
        tickComponent,
        tickLabelComponent,
        name: name2
      } = props;
      const shouldRender = (componentProps) => {
        const {
          style = {},
          events = {}
        } = componentProps;
        const visible = style.stroke !== "transparent" && style.stroke !== "none" && style.strokeWidth !== 0;
        return visible || !(0, import_isEmpty7.default)(events);
      };
      const axisType = props.dependentAxis ? "radial" : "angular";
      const gridComponent = axisType === "radial" ? props.circularGridComponent : props.gridComponent;
      const tickComponents = this.dataKeys.map((key, index) => {
        const tickProps = Object.assign({
          key: `${name2}-tick-${key}`
        }, this.getComponentProps(tickComponent, "ticks", index));
        const TickComponent = /* @__PURE__ */ import_react91.default.cloneElement(tickComponent, tickProps);
        return shouldRender(TickComponent.props) ? TickComponent : void 0;
      }).filter(Boolean);
      const gridComponents = this.dataKeys.map((key, index) => {
        const gridProps = Object.assign({
          key: `${name2}-grid-${key}`
        }, this.getComponentProps(gridComponent, "grid", index));
        const GridComponent = /* @__PURE__ */ import_react91.default.cloneElement(gridComponent, gridProps);
        return shouldRender(GridComponent.props) ? GridComponent : void 0;
      }).filter(Boolean);
      const tickLabelComponents = this.dataKeys.map((key, index) => {
        const tickLabelProps = Object.assign({
          key: `${name2}-tick-${key}`
        }, this.getComponentProps(tickLabelComponent, "tickLabels", index));
        return /* @__PURE__ */ import_react91.default.cloneElement(tickLabelComponent, tickLabelProps);
      });
      const axis = this.renderAxisLine(props);
      const axisLabel = this.renderLabel(props);
      const children = [axis, axisLabel, ...tickComponents, ...gridComponents, ...tickLabelComponents];
      return this.renderGroup(props, children);
    }
    // Overridden in victory-native
    renderGroup(props, children) {
      const {
        groupComponent
      } = props;
      return /* @__PURE__ */ import_react91.default.cloneElement(groupComponent, {}, children);
    }
    shouldAnimate() {
      return !!this.props.animate;
    }
    render() {
      const {
        animationWhitelist
      } = VictoryPolarAxis;
      const props = axis_exports.modifyProps(this.props, fallbackProps2);
      if (this.shouldAnimate()) {
        return this.animateComponent(props, animationWhitelist);
      }
      const children = this.renderAxis(props);
      return props.standalone ? this.renderContainer(props.containerComponent, children) : children;
    }
  };
  __publicField(VictoryPolarAxisBase, "animationWhitelist", ["style", "domain", "range", "tickCount", "tickValues", "padding", "width", "height"]);
  __publicField(VictoryPolarAxisBase, "displayName", "VictoryAxis");
  __publicField(VictoryPolarAxisBase, "role", "axis");
  __publicField(VictoryPolarAxisBase, "defaultTransitions", {
    onExit: {
      duration: 500
    },
    onEnter: {
      duration: 500
    }
  });
  __publicField(VictoryPolarAxisBase, "defaultProps", {
    axisComponent: /* @__PURE__ */ import_react91.default.createElement(LineSegment, null),
    axisLabelComponent: /* @__PURE__ */ import_react91.default.createElement(VictoryLabel, null),
    circularAxisComponent: /* @__PURE__ */ import_react91.default.createElement(Arc, null),
    circularGridComponent: /* @__PURE__ */ import_react91.default.createElement(Arc, null),
    containerComponent: /* @__PURE__ */ import_react91.default.createElement(VictoryContainer, null),
    endAngle: 360,
    gridComponent: /* @__PURE__ */ import_react91.default.createElement(LineSegment, null),
    groupComponent: /* @__PURE__ */ import_react91.default.createElement("g", {
      role: "presentation"
    }),
    labelPlacement: "parallel",
    startAngle: 0,
    standalone: true,
    theme: VictoryTheme.grayscale,
    tickComponent: /* @__PURE__ */ import_react91.default.createElement(LineSegment, null),
    tickLabelComponent: /* @__PURE__ */ import_react91.default.createElement(VictoryLabel, null)
  });
  __publicField(VictoryPolarAxisBase, "getDomain", axis_exports.getDomain);
  __publicField(VictoryPolarAxisBase, "getAxis", axis_exports.getAxis);
  __publicField(VictoryPolarAxisBase, "expectedComponents", ["axisComponent", "circularAxisComponent", "groupComponent", "containerComponent", "tickComponent", "tickLabelComponent", "gridComponent", "circularGridComponent"]);
  var options2 = {
    components: [{
      name: "axis",
      index: 0
    }, {
      name: "axisLabel",
      index: 0
    }, {
      name: "grid"
    }, {
      name: "parent",
      index: "parent"
    }, {
      name: "ticks"
    }, {
      name: "tickLabels"
    }]
  };
  var VictoryPolarAxis = addEvents(VictoryPolarAxisBase, options2);

  // node_modules/victory-chart/es/helper-methods.js
  var import_react92 = __toESM(require_react());
  var import_defaults21 = __toESM(require_defaults());
  var fallbackProps3 = {
    width: 450,
    height: 300,
    padding: 50
  };
  function getAxisProps3(child, props, calculatedProps) {
    const {
      domain,
      scale,
      stringMap,
      categories,
      horizontal
    } = calculatedProps;
    return {
      stringMap,
      horizontal,
      categories,
      startAngle: props.startAngle,
      endAngle: props.endAngle,
      innerRadius: props.innerRadius,
      domain,
      scale
    };
  }
  function getBackgroundWithProps(props, calculatedProps) {
    const backgroundElement = props.backgroundComponent;
    const height = props.polar ? calculatedProps.range.y[1] : calculatedProps.range.y[0] - calculatedProps.range.y[1];
    const width = calculatedProps.range.x[1] - calculatedProps.range.x[0];
    const xScale = props.horizontal ? calculatedProps.scale.y.range()[0] : calculatedProps.scale.x.range()[0];
    const yScale = props.horizontal ? calculatedProps.scale.x.range()[1] : calculatedProps.scale.y.range()[1];
    const xCoordinate = props.polar ? calculatedProps.origin.x : xScale;
    const yCoordinate = props.polar ? calculatedProps.origin.y : yScale;
    const parentName = props.name || "chart";
    const backgroundProps = {
      height,
      polar: props.polar,
      scale: calculatedProps.scale,
      style: props.style.background,
      x: xCoordinate,
      y: yCoordinate,
      key: `${parentName}-background`,
      width
    };
    return /* @__PURE__ */ import_react92.default.cloneElement(backgroundElement, (0, import_defaults21.default)({}, backgroundElement.props, backgroundProps));
  }
  function getChildProps(child, props, calculatedProps) {
    const axisChild = axis_exports.findAxisComponents([child]);
    if (axisChild.length > 0) {
      return getAxisProps3(axisChild[0], props, calculatedProps);
    }
    const {
      categories,
      domain,
      range: range4,
      scale,
      stringMap,
      horizontal
    } = calculatedProps;
    return {
      categories,
      domain,
      range: range4,
      scale,
      stringMap,
      horizontal
    };
  }
  function getStyles5(props) {
    const styleProps = props.style && props.style.parent;
    return {
      parent: (0, import_defaults21.default)({}, styleProps, {
        height: "100%",
        width: "100%",
        userSelect: "none"
      })
    };
  }
  function getCalculatedProps2(initialProps, childComponents) {
    const style = getStyles5(initialProps);
    const props = helpers_exports.modifyProps(initialProps, fallbackProps3, "chart");
    const {
      horizontal,
      polar
    } = props;
    const allStrings = wrapper_exports.getStringsFromChildren(props, childComponents);
    const categories = wrapper_exports.getCategories(props, childComponents, allStrings);
    const stringMap = createStringMap2(props, childComponents, allStrings);
    const domain = {
      x: getDomain4(Object.assign({}, props, {
        categories
      }), "x", childComponents),
      y: getDomain4(Object.assign({}, props, {
        categories
      }), "y", childComponents)
    };
    const range4 = {
      x: helpers_exports.getRange(props, "x"),
      y: helpers_exports.getRange(props, "y")
    };
    const baseScale = {
      x: scale_exports.getScaleFromProps(props, "x") || wrapper_exports.getScale(props, "x"),
      y: scale_exports.getScaleFromProps(props, "y") || wrapper_exports.getScale(props, "y")
    };
    const scale = {
      x: baseScale.x.domain(domain.x).range(horizontal ? range4.y : range4.x),
      y: baseScale.y.domain(domain.y).range(horizontal ? range4.x : range4.y)
    };
    const origin = polar ? helpers_exports.getPolarOrigin(props) : axis_exports.getOrigin(domain);
    const padding3 = helpers_exports.getPadding(props.padding);
    return {
      categories,
      domain,
      range: range4,
      horizontal,
      scale,
      stringMap,
      style,
      origin,
      padding: padding3
    };
  }
  function getChildren(props, childComponents, calculatedProps) {
    const children = childComponents || getChildComponents(props);
    const newCalculatedProps = calculatedProps || getCalculatedProps2(props, children);
    const baseStyle = newCalculatedProps.style.parent;
    const {
      height,
      polar,
      theme,
      width
    } = props;
    const {
      origin,
      horizontal
    } = newCalculatedProps;
    const parentName = props.name || "chart";
    return children.filter(import_react92.default.isValidElement).map((child, index) => {
      const role = child.type && child.type.role;
      const style = Array.isArray(child.props.style) ? child.props.style : (0, import_defaults21.default)({}, child.props.style, {
        parent: baseStyle
      });
      const childProps = getChildProps(child, props, newCalculatedProps);
      const name2 = child.props.name || `${parentName}-${role}-${index}`;
      const newProps = (0, import_defaults21.default)({
        horizontal,
        height,
        polar,
        theme,
        width,
        style,
        name: name2,
        origin: polar ? origin : void 0,
        padding: newCalculatedProps.padding,
        key: `${name2}-key-${index}`,
        standalone: false
      }, childProps);
      return /* @__PURE__ */ import_react92.default.cloneElement(child, newProps);
    });
  }
  var getChildComponents = (props, defaultAxes) => {
    let childComponents = import_react92.default.Children.toArray(props.children);
    if (childComponents.length === 0) {
      childComponents.push(defaultAxes.independent, defaultAxes.dependent);
    } else {
      const axisComponents = {
        dependent: axis_exports.getAxisComponentsWithParent(childComponents, "dependent"),
        independent: axis_exports.getAxisComponentsWithParent(childComponents, "independent")
      };
      if (axisComponents.dependent.length === 0 && axisComponents.independent.length === 0) {
        childComponents = props.prependDefaultAxes ? [defaultAxes.independent, defaultAxes.dependent].concat(childComponents) : childComponents.concat([defaultAxes.independent, defaultAxes.dependent]);
      }
    }
    return childComponents;
  };
  var getDomain4 = (props, axis, childComponents) => {
    const children = childComponents || import_react92.default.Children.toArray(props.children);
    const domain = wrapper_exports.getDomain(props, axis, children);
    const axisComponent = axis_exports.getAxisComponent(children, axis);
    const invertDomain = axisComponent && axisComponent.props && axisComponent.props.invertAxis;
    return invertDomain ? domain.concat().reverse() : domain;
  };
  var createStringMap2 = (props, childComponents, allStrings) => {
    const x2 = !allStrings.x || allStrings.x.length === 0 ? null : allStrings.x.reduce((memo4, string, index) => {
      memo4[string] = index + 1;
      return memo4;
    }, {});
    const y2 = !allStrings.y || allStrings.y.length === 0 ? null : allStrings.y.reduce((memo4, string, index) => {
      memo4[string] = index + 1;
      return memo4;
    }, {});
    return {
      x: x2,
      y: y2
    };
  };

  // node_modules/victory-chart/es/victory-chart.js
  var import_react_fast_compare4 = __toESM(require_react_fast_compare());
  var fallbackProps4 = {
    width: 450,
    height: 300,
    padding: 50
  };
  var defaultProps10 = {
    backgroundComponent: /* @__PURE__ */ import_react93.default.createElement(Background, null),
    containerComponent: /* @__PURE__ */ import_react93.default.createElement(VictoryContainer, null),
    defaultAxes: {
      independent: /* @__PURE__ */ import_react93.default.createElement(VictoryAxis, null),
      dependent: /* @__PURE__ */ import_react93.default.createElement(VictoryAxis, {
        dependentAxis: true
      })
    },
    defaultPolarAxes: {
      independent: /* @__PURE__ */ import_react93.default.createElement(VictoryPolarAxis, null),
      dependent: /* @__PURE__ */ import_react93.default.createElement(VictoryPolarAxis, {
        dependentAxis: true
      })
    },
    groupComponent: /* @__PURE__ */ import_react93.default.createElement("g", null),
    standalone: true,
    theme: VictoryTheme.grayscale
  };
  var VictoryChartImpl = (initialProps) => {
    const propsWithDefaults = import_react93.default.useMemo(() => (0, import_defaults22.default)({}, initialProps, defaultProps10), [initialProps]);
    const role = "chart";
    const {
      getAnimationProps,
      setAnimationState,
      getProps: getProps2
    } = hooks_exports.useAnimationState();
    const props = getProps2(propsWithDefaults);
    const modifiedProps = helpers_exports.modifyProps(props, fallbackProps4, role);
    const {
      desc,
      eventKey,
      containerComponent,
      standalone,
      groupComponent,
      externalEventMutations,
      width,
      height,
      theme,
      polar,
      name: name2,
      title
    } = modifiedProps;
    const axes = props.polar ? modifiedProps.defaultPolarAxes : modifiedProps.defaultAxes;
    const childComponents = import_react93.default.useMemo(() => getChildComponents(modifiedProps, axes), [modifiedProps, axes]);
    const calculatedProps = import_react93.default.useMemo(() => getCalculatedProps2(modifiedProps, childComponents), [modifiedProps, childComponents]);
    const {
      domain,
      scale,
      style,
      origin,
      horizontal
    } = calculatedProps;
    const newChildren = import_react93.default.useMemo(() => {
      const children = getChildren(props, childComponents, calculatedProps);
      const mappedChildren = children.map((child, index) => {
        const childProps = Object.assign({
          animate: getAnimationProps(props, child, index)
        }, child.props);
        return /* @__PURE__ */ import_react93.default.cloneElement(child, childProps);
      });
      if (props.style && props.style.background) {
        const backgroundComponent = getBackgroundWithProps(props, calculatedProps);
        mappedChildren.unshift(backgroundComponent);
      }
      return mappedChildren;
    }, [getAnimationProps, childComponents, props, calculatedProps]);
    const containerProps = import_react93.default.useMemo(() => {
      if (standalone) {
        return {
          desc,
          domain,
          width,
          height,
          horizontal,
          name: name2,
          origin: polar ? origin : void 0,
          polar,
          theme,
          title,
          scale,
          standalone,
          style: style.parent
        };
      }
      return {};
    }, [desc, domain, height, horizontal, name2, origin, polar, scale, standalone, style, title, theme, width]);
    const container = import_react93.default.useMemo(() => {
      if (standalone) {
        const defaultContainerProps = (0, import_defaults22.default)({}, containerComponent.props, containerProps, user_props_exports.getSafeUserProps(propsWithDefaults));
        return /* @__PURE__ */ import_react93.default.cloneElement(containerComponent, defaultContainerProps);
      }
      return groupComponent;
    }, [groupComponent, standalone, containerComponent, containerProps, propsWithDefaults]);
    const events = import_react93.default.useMemo(() => {
      return wrapper_exports.getAllEvents(props);
    }, [props]);
    const previousProps = hooks_exports.usePreviousProps(propsWithDefaults);
    import_react93.default.useEffect(() => {
      return () => {
        if (propsWithDefaults.animate) {
          setAnimationState(previousProps, propsWithDefaults);
        }
      };
    }, [setAnimationState, previousProps, propsWithDefaults]);
    if (!(0, import_isEmpty8.default)(events)) {
      return /* @__PURE__ */ import_react93.default.createElement(VictorySharedEvents, {
        container,
        eventKey,
        events,
        externalEventMutations
      }, newChildren);
    }
    return /* @__PURE__ */ import_react93.default.cloneElement(container, container.props, newChildren);
  };
  var VictoryChart = /* @__PURE__ */ import_react93.default.memo(VictoryChartImpl, import_react_fast_compare4.default);
  VictoryChart.displayName = "VictoryChart";
  VictoryChart.expectedComponents = ["groupComponent", "containerComponent"];

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartContainer/ChartContainer.js
  init_tslib_es6();
  var React318 = __toESM(require_react());
  var import_hoist_non_react_statics = __toESM(require_hoist_non_react_statics_cjs());

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-theme.js
  var import_cloneDeep = __toESM(require_cloneDeep());
  var import_merge = __toESM(require_merge());

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/ChartThemeColor.js
  var ChartThemeColor = {
    blue: "blue",
    cyan: "cyan",
    default: "blue",
    gold: "gold",
    gray: "gray",
    green: "green",
    multi: "multi",
    multiOrdered: "multi-ordered",
    multiUnordered: "multi-unordered",
    orange: "orange",
    purple: "purple",
    skeleton: "skeleton"
  };

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_grid_stroke_Color.js
  var chart_axis_grid_stroke_Color = {
    "name": "--pf-v5-chart-axis--grid--stroke--Color",
    "value": "#d2d2d2",
    "var": "var(--pf-v5-chart-axis--grid--stroke--Color, #d2d2d2)"
  };
  var chart_axis_grid_stroke_Color_default = chart_axis_grid_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_tick_stroke_Color.js
  var chart_axis_tick_stroke_Color = {
    "name": "--pf-v5-chart-axis--tick--stroke--Color",
    "value": "#d2d2d2",
    "var": "var(--pf-v5-chart-axis--tick--stroke--Color, #d2d2d2)"
  };
  var chart_axis_tick_stroke_Color_default = chart_axis_tick_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_FontFamily.js
  var chart_global_FontFamily = {
    "name": "--pf-v5-chart-global--FontFamily",
    "value": '"RedHatText", helvetica, arial, sans-serif',
    "var": 'var(--pf-v5-chart-global--FontFamily, "RedHatText", helvetica, arial, sans-serif)'
  };
  var chart_global_FontFamily_default = chart_global_FontFamily;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_letter_spacing.js
  var chart_global_letter_spacing = {
    "name": "--pf-v5-chart-global--letter-spacing",
    "value": "normal",
    "var": "var(--pf-v5-chart-global--letter-spacing, normal)"
  };
  var chart_global_letter_spacing_default = chart_global_letter_spacing;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_FontSize_sm.js
  var chart_global_FontSize_sm = {
    "name": "--pf-v5-chart-global--FontSize--sm",
    "value": 14,
    "var": "var(--pf-v5-chart-global--FontSize--sm, 14)"
  };
  var chart_global_FontSize_sm_default = chart_global_FontSize_sm;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_label_Padding.js
  var chart_global_label_Padding = {
    "name": "--pf-v5-chart-global--label--Padding",
    "value": 10,
    "var": "var(--pf-v5-chart-global--label--Padding, 10)"
  };
  var chart_global_label_Padding_default = chart_global_label_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_label_stroke.js
  var chart_global_label_stroke = {
    "name": "--pf-v5-chart-global--label--stroke",
    "value": "transparent",
    "var": "var(--pf-v5-chart-global--label--stroke, transparent)"
  };
  var chart_global_label_stroke_default = chart_global_label_stroke;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_label_text_anchor.js
  var chart_global_label_text_anchor = {
    "name": "--pf-v5-chart-global--label--text-anchor",
    "value": "middle",
    "var": "var(--pf-v5-chart-global--label--text-anchor, middle)"
  };
  var chart_global_label_text_anchor_default = chart_global_label_text_anchor;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_label_Fill.js
  var chart_global_label_Fill = {
    "name": "--pf-v5-chart-global--label--Fill",
    "value": "#151515",
    "var": "var(--pf-v5-chart-global--label--Fill, #151515)"
  };
  var chart_global_label_Fill_default = chart_global_label_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_layout_Padding.js
  var chart_global_layout_Padding = {
    "name": "--pf-v5-chart-global--layout--Padding",
    "value": 50,
    "var": "var(--pf-v5-chart-global--layout--Padding, 50)"
  };
  var chart_global_layout_Padding_default = chart_global_layout_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_layout_Height.js
  var chart_global_layout_Height = {
    "name": "--pf-v5-chart-global--layout--Height",
    "value": 300,
    "var": "var(--pf-v5-chart-global--layout--Height, 300)"
  };
  var chart_global_layout_Height_default = chart_global_layout_Height;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_layout_Width.js
  var chart_global_layout_Width = {
    "name": "--pf-v5-chart-global--layout--Width",
    "value": 450,
    "var": "var(--pf-v5-chart-global--layout--Width, 450)"
  };
  var chart_global_layout_Width_default = chart_global_layout_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_stroke_line_cap.js
  var chart_global_stroke_line_cap = {
    "name": "--pf-v5-chart-global--stroke-line-cap",
    "value": "round",
    "var": "var(--pf-v5-chart-global--stroke-line-cap, round)"
  };
  var chart_global_stroke_line_cap_default = chart_global_stroke_line_cap;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_stroke_line_join.js
  var chart_global_stroke_line_join = {
    "name": "--pf-v5-chart-global--stroke-line-join",
    "value": "round",
    "var": "var(--pf-v5-chart-global--stroke-line-join, round)"
  };
  var chart_global_stroke_line_join_default = chart_global_stroke_line_join;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_area_data_Fill.js
  var chart_area_data_Fill = {
    "name": "--pf-v5-chart-area--data--Fill",
    "value": "#151515",
    "var": "var(--pf-v5-chart-area--data--Fill, #151515)"
  };
  var chart_area_data_Fill_default = chart_area_data_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_area_Opacity.js
  var chart_area_Opacity = {
    "name": "--pf-v5-chart-area--Opacity",
    "value": 0.3,
    "var": "var(--pf-v5-chart-area--Opacity, 0.3)"
  };
  var chart_area_Opacity_default = chart_area_Opacity;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_area_stroke_Width.js
  var chart_area_stroke_Width = {
    "name": "--pf-v5-chart-area--stroke--Width",
    "value": 2,
    "var": "var(--pf-v5-chart-area--stroke--Width, 2)"
  };
  var chart_area_stroke_Width_default = chart_area_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_axis_stroke_Width.js
  var chart_axis_axis_stroke_Width = {
    "name": "--pf-v5-chart-axis--axis--stroke--Width",
    "value": 1,
    "var": "var(--pf-v5-chart-axis--axis--stroke--Width, 1)"
  };
  var chart_axis_axis_stroke_Width_default = chart_axis_axis_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_axis_stroke_Color.js
  var chart_axis_axis_stroke_Color = {
    "name": "--pf-v5-chart-axis--axis--stroke--Color",
    "value": "#d2d2d2",
    "var": "var(--pf-v5-chart-axis--axis--stroke--Color, #d2d2d2)"
  };
  var chart_axis_axis_stroke_Color_default = chart_axis_axis_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_axis_Fill.js
  var chart_axis_axis_Fill = {
    "name": "--pf-v5-chart-axis--axis--Fill",
    "value": "transparent",
    "var": "var(--pf-v5-chart-axis--axis--Fill, transparent)"
  };
  var chart_axis_axis_Fill_default = chart_axis_axis_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_axis_label_Padding.js
  var chart_axis_axis_label_Padding = {
    "name": "--pf-v5-chart-axis--axis-label--Padding",
    "value": 40,
    "var": "var(--pf-v5-chart-axis--axis-label--Padding, 40)"
  };
  var chart_axis_axis_label_Padding_default = chart_axis_axis_label_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_axis_label_stroke_Color.js
  var chart_axis_axis_label_stroke_Color = {
    "name": "--pf-v5-chart-axis--axis-label--stroke--Color",
    "value": "transparent",
    "var": "var(--pf-v5-chart-axis--axis-label--stroke--Color, transparent)"
  };
  var chart_axis_axis_label_stroke_Color_default = chart_axis_axis_label_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_grid_Fill.js
  var chart_axis_grid_Fill = {
    "name": "--pf-v5-chart-axis--grid--Fill",
    "value": "none",
    "var": "var(--pf-v5-chart-axis--grid--Fill, none)"
  };
  var chart_axis_grid_Fill_default = chart_axis_grid_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_grid_PointerEvents.js
  var chart_axis_grid_PointerEvents = {
    "name": "--pf-v5-chart-axis--grid--PointerEvents",
    "value": "painted",
    "var": "var(--pf-v5-chart-axis--grid--PointerEvents, painted)"
  };
  var chart_axis_grid_PointerEvents_default = chart_axis_grid_PointerEvents;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_tick_Fill.js
  var chart_axis_tick_Fill = {
    "name": "--pf-v5-chart-axis--tick--Fill",
    "value": "transparent",
    "var": "var(--pf-v5-chart-axis--tick--Fill, transparent)"
  };
  var chart_axis_tick_Fill_default = chart_axis_tick_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_tick_Size.js
  var chart_axis_tick_Size = {
    "name": "--pf-v5-chart-axis--tick--Size",
    "value": 5,
    "var": "var(--pf-v5-chart-axis--tick--Size, 5)"
  };
  var chart_axis_tick_Size_default = chart_axis_tick_Size;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_tick_Width.js
  var chart_axis_tick_Width = {
    "name": "--pf-v5-chart-axis--tick--Width",
    "value": 1,
    "var": "var(--pf-v5-chart-axis--tick--Width, 1)"
  };
  var chart_axis_tick_Width_default = chart_axis_tick_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_axis_tick_label_Fill.js
  var chart_axis_tick_label_Fill = {
    "name": "--pf-v5-chart-axis--tick-label--Fill",
    "value": "#4f5255",
    "var": "var(--pf-v5-chart-axis--tick-label--Fill, #4f5255)"
  };
  var chart_axis_tick_label_Fill_default = chart_axis_tick_label_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bar_Width.js
  var chart_bar_Width = {
    "name": "--pf-v5-chart-bar--Width",
    "value": 10,
    "var": "var(--pf-v5-chart-bar--Width, 10)"
  };
  var chart_bar_Width_default = chart_bar_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bar_data_stroke.js
  var chart_bar_data_stroke = {
    "name": "--pf-v5-chart-bar--data--stroke",
    "value": "none",
    "var": "var(--pf-v5-chart-bar--data--stroke, none)"
  };
  var chart_bar_data_stroke_default = chart_bar_data_stroke;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bar_data_Fill.js
  var chart_bar_data_Fill = {
    "name": "--pf-v5-chart-bar--data--Fill",
    "value": "#151515",
    "var": "var(--pf-v5-chart-bar--data--Fill, #151515)"
  };
  var chart_bar_data_Fill_default = chart_bar_data_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bar_data_Padding.js
  var chart_bar_data_Padding = {
    "name": "--pf-v5-chart-bar--data--Padding",
    "value": 8,
    "var": "var(--pf-v5-chart-bar--data--Padding, 8)"
  };
  var chart_bar_data_Padding_default = chart_bar_data_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bar_data_stroke_Width.js
  var chart_bar_data_stroke_Width = {
    "name": "--pf-v5-chart-bar--data-stroke--Width",
    "value": 0,
    "var": "var(--pf-v5-chart-bar--data-stroke--Width, 0)"
  };
  var chart_bar_data_stroke_Width_default = chart_bar_data_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_max_Padding.js
  var chart_boxplot_max_Padding = {
    "name": "--pf-v5-chart-boxplot--max--Padding",
    "value": 8,
    "var": "var(--pf-v5-chart-boxplot--max--Padding, 8)"
  };
  var chart_boxplot_max_Padding_default = chart_boxplot_max_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_max_stroke_Color.js
  var chart_boxplot_max_stroke_Color = {
    "name": "--pf-v5-chart-boxplot--max--stroke--Color",
    "value": "#151515",
    "var": "var(--pf-v5-chart-boxplot--max--stroke--Color, #151515)"
  };
  var chart_boxplot_max_stroke_Color_default = chart_boxplot_max_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_max_stroke_Width.js
  var chart_boxplot_max_stroke_Width = {
    "name": "--pf-v5-chart-boxplot--max--stroke--Width",
    "value": 1,
    "var": "var(--pf-v5-chart-boxplot--max--stroke--Width, 1)"
  };
  var chart_boxplot_max_stroke_Width_default = chart_boxplot_max_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_median_Padding.js
  var chart_boxplot_median_Padding = {
    "name": "--pf-v5-chart-boxplot--median--Padding",
    "value": 8,
    "var": "var(--pf-v5-chart-boxplot--median--Padding, 8)"
  };
  var chart_boxplot_median_Padding_default = chart_boxplot_median_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_median_stroke_Color.js
  var chart_boxplot_median_stroke_Color = {
    "name": "--pf-v5-chart-boxplot--median--stroke--Color",
    "value": "#151515",
    "var": "var(--pf-v5-chart-boxplot--median--stroke--Color, #151515)"
  };
  var chart_boxplot_median_stroke_Color_default = chart_boxplot_median_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_median_stroke_Width.js
  var chart_boxplot_median_stroke_Width = {
    "name": "--pf-v5-chart-boxplot--median--stroke--Width",
    "value": 1,
    "var": "var(--pf-v5-chart-boxplot--median--stroke--Width, 1)"
  };
  var chart_boxplot_median_stroke_Width_default = chart_boxplot_median_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_min_Padding.js
  var chart_boxplot_min_Padding = {
    "name": "--pf-v5-chart-boxplot--min--Padding",
    "value": 8,
    "var": "var(--pf-v5-chart-boxplot--min--Padding, 8)"
  };
  var chart_boxplot_min_Padding_default = chart_boxplot_min_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_min_stroke_Width.js
  var chart_boxplot_min_stroke_Width = {
    "name": "--pf-v5-chart-boxplot--min--stroke--Width",
    "value": 1,
    "var": "var(--pf-v5-chart-boxplot--min--stroke--Width, 1)"
  };
  var chart_boxplot_min_stroke_Width_default = chart_boxplot_min_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_min_stroke_Color.js
  var chart_boxplot_min_stroke_Color = {
    "name": "--pf-v5-chart-boxplot--min--stroke--Color",
    "value": "#151515",
    "var": "var(--pf-v5-chart-boxplot--min--stroke--Color, #151515)"
  };
  var chart_boxplot_min_stroke_Color_default = chart_boxplot_min_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_lower_quartile_Padding.js
  var chart_boxplot_lower_quartile_Padding = {
    "name": "--pf-v5-chart-boxplot--lower-quartile--Padding",
    "value": 8,
    "var": "var(--pf-v5-chart-boxplot--lower-quartile--Padding, 8)"
  };
  var chart_boxplot_lower_quartile_Padding_default = chart_boxplot_lower_quartile_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_lower_quartile_Fill.js
  var chart_boxplot_lower_quartile_Fill = {
    "name": "--pf-v5-chart-boxplot--lower-quartile--Fill",
    "value": "#8a8d90",
    "var": "var(--pf-v5-chart-boxplot--lower-quartile--Fill, #8a8d90)"
  };
  var chart_boxplot_lower_quartile_Fill_default = chart_boxplot_lower_quartile_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_upper_quartile_Padding.js
  var chart_boxplot_upper_quartile_Padding = {
    "name": "--pf-v5-chart-boxplot--upper-quartile--Padding",
    "value": 8,
    "var": "var(--pf-v5-chart-boxplot--upper-quartile--Padding, 8)"
  };
  var chart_boxplot_upper_quartile_Padding_default = chart_boxplot_upper_quartile_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_upper_quartile_Fill.js
  var chart_boxplot_upper_quartile_Fill = {
    "name": "--pf-v5-chart-boxplot--upper-quartile--Fill",
    "value": "#8a8d90",
    "var": "var(--pf-v5-chart-boxplot--upper-quartile--Fill, #8a8d90)"
  };
  var chart_boxplot_upper_quartile_Fill_default = chart_boxplot_upper_quartile_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_boxplot_box_Width.js
  var chart_boxplot_box_Width = {
    "name": "--pf-v5-chart-boxplot--box--Width",
    "value": 20,
    "var": "var(--pf-v5-chart-boxplot--box--Width, 20)"
  };
  var chart_boxplot_box_Width_default = chart_boxplot_box_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_candelstick_data_stroke_Width.js
  var chart_candelstick_data_stroke_Width = {
    "name": "--pf-v5-chart-candelstick--data--stroke--Width",
    "value": 1,
    "var": "var(--pf-v5-chart-candelstick--data--stroke--Width, 1)"
  };
  var chart_candelstick_data_stroke_Width_default = chart_candelstick_data_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_candelstick_data_stroke_Color.js
  var chart_candelstick_data_stroke_Color = {
    "name": "--pf-v5-chart-candelstick--data--stroke--Color",
    "value": "#151515",
    "var": "var(--pf-v5-chart-candelstick--data--stroke--Color, #151515)"
  };
  var chart_candelstick_data_stroke_Color_default = chart_candelstick_data_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_candelstick_candle_positive_Color.js
  var chart_candelstick_candle_positive_Color = {
    "name": "--pf-v5-chart-candelstick--candle--positive--Color",
    "value": "#fff",
    "var": "var(--pf-v5-chart-candelstick--candle--positive--Color, #fff)"
  };
  var chart_candelstick_candle_positive_Color_default = chart_candelstick_candle_positive_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_candelstick_candle_negative_Color.js
  var chart_candelstick_candle_negative_Color = {
    "name": "--pf-v5-chart-candelstick--candle--negative--Color",
    "value": "#151515",
    "var": "var(--pf-v5-chart-candelstick--candle--negative--Color, #151515)"
  };
  var chart_candelstick_candle_negative_Color_default = chart_candelstick_candle_negative_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_errorbar_BorderWidth.js
  var chart_errorbar_BorderWidth = {
    "name": "--pf-v5-chart-errorbar--BorderWidth",
    "value": 8,
    "var": "var(--pf-v5-chart-errorbar--BorderWidth, 8)"
  };
  var chart_errorbar_BorderWidth_default = chart_errorbar_BorderWidth;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_errorbar_data_Fill.js
  var chart_errorbar_data_Fill = {
    "name": "--pf-v5-chart-errorbar--data--Fill",
    "value": "transparent",
    "var": "var(--pf-v5-chart-errorbar--data--Fill, transparent)"
  };
  var chart_errorbar_data_Fill_default = chart_errorbar_data_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_errorbar_data_Opacity.js
  var chart_errorbar_data_Opacity = {
    "name": "--pf-v5-chart-errorbar--data--Opacity",
    "value": 1,
    "var": "var(--pf-v5-chart-errorbar--data--Opacity, 1)"
  };
  var chart_errorbar_data_Opacity_default = chart_errorbar_data_Opacity;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_errorbar_data_stroke_Width.js
  var chart_errorbar_data_stroke_Width = {
    "name": "--pf-v5-chart-errorbar--data-stroke--Width",
    "value": 2,
    "var": "var(--pf-v5-chart-errorbar--data-stroke--Width, 2)"
  };
  var chart_errorbar_data_stroke_Width_default = chart_errorbar_data_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_errorbar_data_stroke_Color.js
  var chart_errorbar_data_stroke_Color = {
    "name": "--pf-v5-chart-errorbar--data-stroke--Color",
    "value": "#151515",
    "var": "var(--pf-v5-chart-errorbar--data-stroke--Color, #151515)"
  };
  var chart_errorbar_data_stroke_Color_default = chart_errorbar_data_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_legend_gutter_Width.js
  var chart_legend_gutter_Width = {
    "name": "--pf-v5-chart-legend--gutter--Width",
    "value": 20,
    "var": "var(--pf-v5-chart-legend--gutter--Width, 20)"
  };
  var chart_legend_gutter_Width_default = chart_legend_gutter_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_legend_orientation.js
  var chart_legend_orientation = {
    "name": "--pf-v5-chart-legend--orientation",
    "value": "horizontal",
    "var": "var(--pf-v5-chart-legend--orientation, horizontal)"
  };
  var chart_legend_orientation_default = chart_legend_orientation;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_legend_title_orientation.js
  var chart_legend_title_orientation = {
    "name": "--pf-v5-chart-legend--title--orientation",
    "value": "top",
    "var": "var(--pf-v5-chart-legend--title--orientation, top)"
  };
  var chart_legend_title_orientation_default = chart_legend_title_orientation;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_legend_data_type.js
  var chart_legend_data_type = {
    "name": "--pf-v5-chart-legend--data--type",
    "value": "square",
    "var": "var(--pf-v5-chart-legend--data--type, square)"
  };
  var chart_legend_data_type_default = chart_legend_data_type;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_legend_title_Padding.js
  var chart_legend_title_Padding = {
    "name": "--pf-v5-chart-legend--title--Padding",
    "value": 2,
    "var": "var(--pf-v5-chart-legend--title--Padding, 2)"
  };
  var chart_legend_title_Padding_default = chart_legend_title_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_line_data_Fill.js
  var chart_line_data_Fill = {
    "name": "--pf-v5-chart-line--data--Fill",
    "value": "transparent",
    "var": "var(--pf-v5-chart-line--data--Fill, transparent)"
  };
  var chart_line_data_Fill_default = chart_line_data_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_line_data_Opacity.js
  var chart_line_data_Opacity = {
    "name": "--pf-v5-chart-line--data--Opacity",
    "value": 1,
    "var": "var(--pf-v5-chart-line--data--Opacity, 1)"
  };
  var chart_line_data_Opacity_default = chart_line_data_Opacity;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_line_data_stroke_Width.js
  var chart_line_data_stroke_Width = {
    "name": "--pf-v5-chart-line--data--stroke--Width",
    "value": 2,
    "var": "var(--pf-v5-chart-line--data--stroke--Width, 2)"
  };
  var chart_line_data_stroke_Width_default = chart_line_data_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_line_data_stroke_Color.js
  var chart_line_data_stroke_Color = {
    "name": "--pf-v5-chart-line--data--stroke--Color",
    "value": "#151515",
    "var": "var(--pf-v5-chart-line--data--stroke--Color, #151515)"
  };
  var chart_line_data_stroke_Color_default = chart_line_data_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_pie_Padding.js
  var chart_pie_Padding = {
    "name": "--pf-v5-chart-pie--Padding",
    "value": 20,
    "var": "var(--pf-v5-chart-pie--Padding, 20)"
  };
  var chart_pie_Padding_default = chart_pie_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_pie_data_Padding.js
  var chart_pie_data_Padding = {
    "name": "--pf-v5-chart-pie--data--Padding",
    "value": 8,
    "var": "var(--pf-v5-chart-pie--data--Padding, 8)"
  };
  var chart_pie_data_Padding_default = chart_pie_data_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_pie_data_stroke_Width.js
  var chart_pie_data_stroke_Width = {
    "name": "--pf-v5-chart-pie--data--stroke--Width",
    "value": 1,
    "var": "var(--pf-v5-chart-pie--data--stroke--Width, 1)"
  };
  var chart_pie_data_stroke_Width_default = chart_pie_data_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_pie_data_stroke_Color.js
  var chart_pie_data_stroke_Color = {
    "name": "--pf-v5-chart-pie--data--stroke--Color",
    "value": "transparent",
    "var": "var(--pf-v5-chart-pie--data--stroke--Color, transparent)"
  };
  var chart_pie_data_stroke_Color_default = chart_pie_data_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_pie_labels_Padding.js
  var chart_pie_labels_Padding = {
    "name": "--pf-v5-chart-pie--labels--Padding",
    "value": 8,
    "var": "var(--pf-v5-chart-pie--labels--Padding, 8)"
  };
  var chart_pie_labels_Padding_default = chart_pie_labels_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_pie_Height.js
  var chart_pie_Height = {
    "name": "--pf-v5-chart-pie--Height",
    "value": 230,
    "var": "var(--pf-v5-chart-pie--Height, 230)"
  };
  var chart_pie_Height_default = chart_pie_Height;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_pie_Width.js
  var chart_pie_Width = {
    "name": "--pf-v5-chart-pie--Width",
    "value": 230,
    "var": "var(--pf-v5-chart-pie--Width, 230)"
  };
  var chart_pie_Width_default = chart_pie_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_scatter_data_stroke_Color.js
  var chart_scatter_data_stroke_Color = {
    "name": "--pf-v5-chart-scatter--data--stroke--Color",
    "value": "transparent",
    "var": "var(--pf-v5-chart-scatter--data--stroke--Color, transparent)"
  };
  var chart_scatter_data_stroke_Color_default = chart_scatter_data_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_scatter_data_stroke_Width.js
  var chart_scatter_data_stroke_Width = {
    "name": "--pf-v5-chart-scatter--data--stroke--Width",
    "value": 0,
    "var": "var(--pf-v5-chart-scatter--data--stroke--Width, 0)"
  };
  var chart_scatter_data_stroke_Width_default = chart_scatter_data_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_scatter_data_Opacity.js
  var chart_scatter_data_Opacity = {
    "name": "--pf-v5-chart-scatter--data--Opacity",
    "value": 1,
    "var": "var(--pf-v5-chart-scatter--data--Opacity, 1)"
  };
  var chart_scatter_data_Opacity_default = chart_scatter_data_Opacity;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_scatter_data_Fill.js
  var chart_scatter_data_Fill = {
    "name": "--pf-v5-chart-scatter--data--Fill",
    "value": "#151515",
    "var": "var(--pf-v5-chart-scatter--data--Fill, #151515)"
  };
  var chart_scatter_data_Fill_default = chart_scatter_data_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_stack_data_stroke_Width.js
  var chart_stack_data_stroke_Width = {
    "name": "--pf-v5-chart-stack--data--stroke--Width",
    "value": 1,
    "var": "var(--pf-v5-chart-stack--data--stroke--Width, 1)"
  };
  var chart_stack_data_stroke_Width_default = chart_stack_data_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_corner_radius.js
  var chart_tooltip_corner_radius = {
    "name": "--pf-v5-chart-tooltip--corner-radius",
    "value": 0,
    "var": "var(--pf-v5-chart-tooltip--corner-radius, 0)"
  };
  var chart_tooltip_corner_radius_default = chart_tooltip_corner_radius;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_pointer_length.js
  var chart_tooltip_pointer_length = {
    "name": "--pf-v5-chart-tooltip--pointer-length",
    "value": 10,
    "var": "var(--pf-v5-chart-tooltip--pointer-length, 10)"
  };
  var chart_tooltip_pointer_length_default = chart_tooltip_pointer_length;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_Fill.js
  var chart_tooltip_Fill = {
    "name": "--pf-v5-chart-tooltip--Fill",
    "value": "#f0f0f0",
    "var": "var(--pf-v5-chart-tooltip--Fill, #f0f0f0)"
  };
  var chart_tooltip_Fill_default = chart_tooltip_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_flyoutStyle_corner_radius.js
  var chart_tooltip_flyoutStyle_corner_radius = {
    "name": "--pf-v5-chart-tooltip--flyoutStyle--corner-radius",
    "value": 0,
    "var": "var(--pf-v5-chart-tooltip--flyoutStyle--corner-radius, 0)"
  };
  var chart_tooltip_flyoutStyle_corner_radius_default = chart_tooltip_flyoutStyle_corner_radius;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_flyoutStyle_stroke_Width.js
  var chart_tooltip_flyoutStyle_stroke_Width = {
    "name": "--pf-v5-chart-tooltip--flyoutStyle--stroke--Width",
    "value": 0,
    "var": "var(--pf-v5-chart-tooltip--flyoutStyle--stroke--Width, 0)"
  };
  var chart_tooltip_flyoutStyle_stroke_Width_default = chart_tooltip_flyoutStyle_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_flyoutStyle_PointerEvents.js
  var chart_tooltip_flyoutStyle_PointerEvents = {
    "name": "--pf-v5-chart-tooltip--flyoutStyle--PointerEvents",
    "value": "none",
    "var": "var(--pf-v5-chart-tooltip--flyoutStyle--PointerEvents, none)"
  };
  var chart_tooltip_flyoutStyle_PointerEvents_default = chart_tooltip_flyoutStyle_PointerEvents;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_flyoutStyle_stroke_Color.js
  var chart_tooltip_flyoutStyle_stroke_Color = {
    "name": "--pf-v5-chart-tooltip--flyoutStyle--stroke--Color",
    "value": "#151515",
    "var": "var(--pf-v5-chart-tooltip--flyoutStyle--stroke--Color, #151515)"
  };
  var chart_tooltip_flyoutStyle_stroke_Color_default = chart_tooltip_flyoutStyle_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_flyoutStyle_Fill.js
  var chart_tooltip_flyoutStyle_Fill = {
    "name": "--pf-v5-chart-tooltip--flyoutStyle--Fill",
    "value": "#151515",
    "var": "var(--pf-v5-chart-tooltip--flyoutStyle--Fill, #151515)"
  };
  var chart_tooltip_flyoutStyle_Fill_default = chart_tooltip_flyoutStyle_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_pointer_Width.js
  var chart_tooltip_pointer_Width = {
    "name": "--pf-v5-chart-tooltip--pointer--Width",
    "value": 20,
    "var": "var(--pf-v5-chart-tooltip--pointer--Width, 20)"
  };
  var chart_tooltip_pointer_Width_default = chart_tooltip_pointer_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_Padding.js
  var chart_tooltip_Padding = {
    "name": "--pf-v5-chart-tooltip--Padding",
    "value": 8,
    "var": "var(--pf-v5-chart-tooltip--Padding, 8)"
  };
  var chart_tooltip_Padding_default = chart_tooltip_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_tooltip_PointerEvents.js
  var chart_tooltip_PointerEvents = {
    "name": "--pf-v5-chart-tooltip--PointerEvents",
    "value": "none",
    "var": "var(--pf-v5-chart-tooltip--PointerEvents, none)"
  };
  var chart_tooltip_PointerEvents_default = chart_tooltip_PointerEvents;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_data_Fill.js
  var chart_voronoi_data_Fill = {
    "name": "--pf-v5-chart-voronoi--data--Fill",
    "value": "transparent",
    "var": "var(--pf-v5-chart-voronoi--data--Fill, transparent)"
  };
  var chart_voronoi_data_Fill_default = chart_voronoi_data_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_data_stroke_Color.js
  var chart_voronoi_data_stroke_Color = {
    "name": "--pf-v5-chart-voronoi--data--stroke--Color",
    "value": "transparent",
    "var": "var(--pf-v5-chart-voronoi--data--stroke--Color, transparent)"
  };
  var chart_voronoi_data_stroke_Color_default = chart_voronoi_data_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_data_stroke_Width.js
  var chart_voronoi_data_stroke_Width = {
    "name": "--pf-v5-chart-voronoi--data--stroke--Width",
    "value": 0,
    "var": "var(--pf-v5-chart-voronoi--data--stroke--Width, 0)"
  };
  var chart_voronoi_data_stroke_Width_default = chart_voronoi_data_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_labels_Fill.js
  var chart_voronoi_labels_Fill = {
    "name": "--pf-v5-chart-voronoi--labels--Fill",
    "value": "#f0f0f0",
    "var": "var(--pf-v5-chart-voronoi--labels--Fill, #f0f0f0)"
  };
  var chart_voronoi_labels_Fill_default = chart_voronoi_labels_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_labels_Padding.js
  var chart_voronoi_labels_Padding = {
    "name": "--pf-v5-chart-voronoi--labels--Padding",
    "value": 8,
    "var": "var(--pf-v5-chart-voronoi--labels--Padding, 8)"
  };
  var chart_voronoi_labels_Padding_default = chart_voronoi_labels_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_labels_PointerEvents.js
  var chart_voronoi_labels_PointerEvents = {
    "name": "--pf-v5-chart-voronoi--labels--PointerEvents",
    "value": "none",
    "var": "var(--pf-v5-chart-voronoi--labels--PointerEvents, none)"
  };
  var chart_voronoi_labels_PointerEvents_default = chart_voronoi_labels_PointerEvents;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_flyout_stroke_Width.js
  var chart_voronoi_flyout_stroke_Width = {
    "name": "--pf-v5-chart-voronoi--flyout--stroke--Width",
    "value": 1,
    "var": "var(--pf-v5-chart-voronoi--flyout--stroke--Width, 1)"
  };
  var chart_voronoi_flyout_stroke_Width_default = chart_voronoi_flyout_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_flyout_PointerEvents.js
  var chart_voronoi_flyout_PointerEvents = {
    "name": "--pf-v5-chart-voronoi--flyout--PointerEvents",
    "value": "none",
    "var": "var(--pf-v5-chart-voronoi--flyout--PointerEvents, none)"
  };
  var chart_voronoi_flyout_PointerEvents_default = chart_voronoi_flyout_PointerEvents;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_flyout_stroke_Color.js
  var chart_voronoi_flyout_stroke_Color = {
    "name": "--pf-v5-chart-voronoi--flyout--stroke--Color",
    "value": "#151515",
    "var": "var(--pf-v5-chart-voronoi--flyout--stroke--Color, #151515)"
  };
  var chart_voronoi_flyout_stroke_Color_default = chart_voronoi_flyout_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_voronoi_flyout_stroke_Fill.js
  var chart_voronoi_flyout_stroke_Fill = {
    "name": "--pf-v5-chart-voronoi--flyout--stroke--Fill",
    "value": "#151515",
    "var": "var(--pf-v5-chart-voronoi--flyout--stroke--Fill, #151515)"
  };
  var chart_voronoi_flyout_stroke_Fill_default = chart_voronoi_flyout_stroke_Fill;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_pie_Height.js
  var chart_donut_pie_Height = {
    "name": "--pf-v5-chart-donut--pie--Height",
    "value": 230,
    "var": "var(--pf-v5-chart-donut--pie--Height, 230)"
  };
  var chart_donut_pie_Height_default = chart_donut_pie_Height;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_pie_angle_Padding.js
  var chart_donut_pie_angle_Padding = {
    "name": "--pf-v5-chart-donut--pie--angle--Padding",
    "value": 1,
    "var": "var(--pf-v5-chart-donut--pie--angle--Padding, 1)"
  };
  var chart_donut_pie_angle_Padding_default = chart_donut_pie_angle_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_pie_Padding.js
  var chart_donut_pie_Padding = {
    "name": "--pf-v5-chart-donut--pie--Padding",
    "value": 20,
    "var": "var(--pf-v5-chart-donut--pie--Padding, 20)"
  };
  var chart_donut_pie_Padding_default = chart_donut_pie_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_pie_Width.js
  var chart_donut_pie_Width = {
    "name": "--pf-v5-chart-donut--pie--Width",
    "value": 230,
    "var": "var(--pf-v5-chart-donut--pie--Width, 230)"
  };
  var chart_donut_pie_Width_default = chart_donut_pie_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_threshold_dynamic_pie_Height.js
  var chart_donut_threshold_dynamic_pie_Height = {
    "name": "--pf-v5-chart-donut--threshold--dynamic--pie--Height",
    "value": 202,
    "var": "var(--pf-v5-chart-donut--threshold--dynamic--pie--Height, 202)"
  };
  var chart_donut_threshold_dynamic_pie_Height_default = chart_donut_threshold_dynamic_pie_Height;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_threshold_dynamic_pie_Padding.js
  var chart_donut_threshold_dynamic_pie_Padding = {
    "name": "--pf-v5-chart-donut--threshold--dynamic--pie--Padding",
    "value": 20,
    "var": "var(--pf-v5-chart-donut--threshold--dynamic--pie--Padding, 20)"
  };
  var chart_donut_threshold_dynamic_pie_Padding_default = chart_donut_threshold_dynamic_pie_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_threshold_dynamic_pie_Width.js
  var chart_donut_threshold_dynamic_pie_Width = {
    "name": "--pf-v5-chart-donut--threshold--dynamic--pie--Width",
    "value": 202,
    "var": "var(--pf-v5-chart-donut--threshold--dynamic--pie--Width, 202)"
  };
  var chart_donut_threshold_dynamic_pie_Width_default = chart_donut_threshold_dynamic_pie_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_threshold_static_pie_Height.js
  var chart_donut_threshold_static_pie_Height = {
    "name": "--pf-v5-chart-donut--threshold--static--pie--Height",
    "value": 230,
    "var": "var(--pf-v5-chart-donut--threshold--static--pie--Height, 230)"
  };
  var chart_donut_threshold_static_pie_Height_default = chart_donut_threshold_static_pie_Height;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_threshold_static_pie_angle_Padding.js
  var chart_donut_threshold_static_pie_angle_Padding = {
    "name": "--pf-v5-chart-donut--threshold--static--pie--angle--Padding",
    "value": 1,
    "var": "var(--pf-v5-chart-donut--threshold--static--pie--angle--Padding, 1)"
  };
  var chart_donut_threshold_static_pie_angle_Padding_default = chart_donut_threshold_static_pie_angle_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_threshold_static_pie_Padding.js
  var chart_donut_threshold_static_pie_Padding = {
    "name": "--pf-v5-chart-donut--threshold--static--pie--Padding",
    "value": 20,
    "var": "var(--pf-v5-chart-donut--threshold--static--pie--Padding, 20)"
  };
  var chart_donut_threshold_static_pie_Padding_default = chart_donut_threshold_static_pie_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_threshold_static_pie_Width.js
  var chart_donut_threshold_static_pie_Width = {
    "name": "--pf-v5-chart-donut--threshold--static--pie--Width",
    "value": 230,
    "var": "var(--pf-v5-chart-donut--threshold--static--pie--Width, 230)"
  };
  var chart_donut_threshold_static_pie_Width_default = chart_donut_threshold_static_pie_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_utilization_dynamic_pie_Height.js
  var chart_donut_utilization_dynamic_pie_Height = {
    "name": "--pf-v5-chart-donut--utilization--dynamic--pie--Height",
    "value": 230,
    "var": "var(--pf-v5-chart-donut--utilization--dynamic--pie--Height, 230)"
  };
  var chart_donut_utilization_dynamic_pie_Height_default = chart_donut_utilization_dynamic_pie_Height;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_utilization_dynamic_pie_Padding.js
  var chart_donut_utilization_dynamic_pie_Padding = {
    "name": "--pf-v5-chart-donut--utilization--dynamic--pie--Padding",
    "value": 20,
    "var": "var(--pf-v5-chart-donut--utilization--dynamic--pie--Padding, 20)"
  };
  var chart_donut_utilization_dynamic_pie_Padding_default = chart_donut_utilization_dynamic_pie_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_utilization_dynamic_pie_angle_Padding.js
  var chart_donut_utilization_dynamic_pie_angle_Padding = {
    "name": "--pf-v5-chart-donut--utilization--dynamic--pie--angle--Padding",
    "value": 1,
    "var": "var(--pf-v5-chart-donut--utilization--dynamic--pie--angle--Padding, 1)"
  };
  var chart_donut_utilization_dynamic_pie_angle_Padding_default = chart_donut_utilization_dynamic_pie_angle_Padding;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_utilization_dynamic_pie_Width.js
  var chart_donut_utilization_dynamic_pie_Width = {
    "name": "--pf-v5-chart-donut--utilization--dynamic--pie--Width",
    "value": 230,
    "var": "var(--pf-v5-chart-donut--utilization--dynamic--pie--Width, 230)"
  };
  var chart_donut_utilization_dynamic_pie_Width_default = chart_donut_utilization_dynamic_pie_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_threshold_stroke_dash_array.js
  var chart_threshold_stroke_dash_array = {
    "name": "--pf-v5-chart-threshold--stroke-dash-array",
    "value": "4,2",
    "var": "var(--pf-v5-chart-threshold--stroke-dash-array, 4,2)"
  };
  var chart_threshold_stroke_dash_array_default = chart_threshold_stroke_dash_array;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_threshold_stroke_Width.js
  var chart_threshold_stroke_Width = {
    "name": "--pf-v5-chart-threshold--stroke--Width",
    "value": 1.5,
    "var": "var(--pf-v5-chart-threshold--stroke--Width, 1.5)"
  };
  var chart_threshold_stroke_Width_default = chart_threshold_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_Height.js
  var chart_bullet_Height = {
    "name": "--pf-v5-chart-bullet--Height",
    "value": 140,
    "var": "var(--pf-v5-chart-bullet--Height, 140)"
  };
  var chart_bullet_Height_default = chart_bullet_Height;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_comparative_measure_error_stroke_Width.js
  var chart_bullet_comparative_measure_error_stroke_Width = {
    "name": "--pf-v5-chart-bullet--comparative-measure--error--stroke--Width",
    "value": 2,
    "var": "var(--pf-v5-chart-bullet--comparative-measure--error--stroke--Width, 2)"
  };
  var chart_bullet_comparative_measure_error_stroke_Width_default = chart_bullet_comparative_measure_error_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_comparative_measure_stroke_Width.js
  var chart_bullet_comparative_measure_stroke_Width = {
    "name": "--pf-v5-chart-bullet--comparative-measure--stroke--Width",
    "value": 1,
    "var": "var(--pf-v5-chart-bullet--comparative-measure--stroke--Width, 1)"
  };
  var chart_bullet_comparative_measure_stroke_Width_default = chart_bullet_comparative_measure_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_comparative_measure_warning_stroke_Width.js
  var chart_bullet_comparative_measure_warning_stroke_Width = {
    "name": "--pf-v5-chart-bullet--comparative-measure--warning--stroke--Width",
    "value": 2,
    "var": "var(--pf-v5-chart-bullet--comparative-measure--warning--stroke--Width, 2)"
  };
  var chart_bullet_comparative_measure_warning_stroke_Width_default = chart_bullet_comparative_measure_warning_stroke_Width;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_group_title_divider_stroke_Width.js
  var chart_bullet_group_title_divider_stroke_Width = {
    "name": "--pf-v5-chart-bullet--group-title--divider--stroke--Width",
    "value": 2,
    "var": "var(--pf-v5-chart-bullet--group-title--divider--stroke--Width, 2)"
  };
  var chart_bullet_group_title_divider_stroke_Width_default = chart_bullet_group_title_divider_stroke_Width;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/base-theme.js
  var TYPOGRAPHY_FONT_FAMILY = chart_global_FontFamily_default.value.replace(/ /g, "");
  var TYPOGRAPHY_LETTER_SPACING = chart_global_letter_spacing_default.value;
  var TYPOGRAPHY_FONT_SIZE = chart_global_FontSize_sm_default.value;
  var LABEL_PROPS = {
    fontFamily: TYPOGRAPHY_FONT_FAMILY,
    fontSize: TYPOGRAPHY_FONT_SIZE,
    letterSpacing: TYPOGRAPHY_LETTER_SPACING,
    padding: chart_global_label_Padding_default.value,
    stroke: chart_global_label_stroke_default.var,
    fill: chart_global_label_Fill_default.var
  };
  var LABEL_CENTERED_PROPS = Object.assign(Object.assign({}, LABEL_PROPS), { textAnchor: chart_global_label_text_anchor_default.value });
  var LAYOUT_PROPS = {
    padding: chart_global_layout_Padding_default.value,
    height: chart_global_layout_Height_default.value,
    width: chart_global_layout_Width_default.value
  };
  var STROKE_LINE_CAP = chart_global_stroke_line_cap_default.value;
  var STROKE_LINE_JOIN = chart_global_stroke_line_join_default.value;
  var BaseTheme = {
    area: Object.assign(Object.assign({}, LAYOUT_PROPS), { style: {
      data: {
        fill: chart_area_data_Fill_default.var,
        fillOpacity: chart_area_Opacity_default.value,
        // Omit stroke to add a line border from color scale
        // stroke: chart_global_label_stroke.value,
        strokeWidth: chart_area_stroke_Width_default.value
      },
      labels: LABEL_CENTERED_PROPS
    } }),
    axis: Object.assign(Object.assign({}, LAYOUT_PROPS), { style: {
      axis: {
        fill: chart_axis_axis_Fill_default.var,
        strokeWidth: chart_axis_axis_stroke_Width_default.value,
        stroke: chart_axis_axis_stroke_Color_default.var,
        strokeLinecap: STROKE_LINE_CAP,
        strokeLinejoin: STROKE_LINE_JOIN
      },
      axisLabel: Object.assign(Object.assign({}, LABEL_CENTERED_PROPS), { padding: chart_axis_axis_label_Padding_default.value, stroke: chart_axis_axis_label_stroke_Color_default.var }),
      grid: {
        fill: chart_axis_grid_Fill_default.var,
        stroke: "transparent",
        pointerEvents: chart_axis_grid_PointerEvents_default.value,
        strokeLinecap: STROKE_LINE_CAP,
        strokeLinejoin: STROKE_LINE_JOIN
      },
      ticks: {
        fill: chart_axis_tick_Fill_default.var,
        size: chart_axis_tick_Size_default.value,
        stroke: chart_axis_tick_stroke_Color_default.var,
        strokeLinecap: STROKE_LINE_CAP,
        strokeLinejoin: STROKE_LINE_JOIN,
        strokeWidth: chart_axis_tick_Width_default.value
      },
      tickLabels: Object.assign(Object.assign({}, LABEL_PROPS), { fill: chart_axis_tick_label_Fill_default.var })
    } }),
    bar: Object.assign(Object.assign({}, LAYOUT_PROPS), { barWidth: chart_bar_Width_default.value, style: {
      data: {
        fill: chart_bar_data_Fill_default.var,
        padding: chart_bar_data_Padding_default.value,
        stroke: chart_bar_data_stroke_default.var,
        strokeWidth: chart_bar_data_stroke_Width_default.value
      },
      labels: LABEL_PROPS
    } }),
    // Victory is missing barWidth
    boxplot: Object.assign(Object.assign({}, LAYOUT_PROPS), { style: {
      max: {
        padding: chart_boxplot_max_Padding_default.value,
        stroke: chart_boxplot_max_stroke_Color_default.var,
        strokeWidth: chart_boxplot_max_stroke_Width_default.value
      },
      maxLabels: LABEL_PROPS,
      median: {
        padding: chart_boxplot_median_Padding_default.value,
        stroke: chart_boxplot_median_stroke_Color_default.var,
        strokeWidth: chart_boxplot_median_stroke_Width_default.value
      },
      medianLabels: LABEL_PROPS,
      min: {
        padding: chart_boxplot_min_Padding_default.value,
        stroke: chart_boxplot_min_stroke_Color_default.var,
        strokeWidth: chart_boxplot_min_stroke_Width_default.value
      },
      minLabels: LABEL_PROPS,
      q1: {
        fill: chart_boxplot_lower_quartile_Fill_default.var,
        padding: chart_boxplot_lower_quartile_Padding_default.value
      },
      q1Labels: LABEL_PROPS,
      q3: {
        fill: chart_boxplot_upper_quartile_Fill_default.var,
        padding: chart_boxplot_upper_quartile_Padding_default.value
      },
      q3Labels: LABEL_PROPS
    }, boxWidth: chart_boxplot_box_Width_default.value }),
    candlestick: Object.assign(Object.assign({}, LAYOUT_PROPS), { candleColors: {
      positive: chart_candelstick_candle_positive_Color_default.var,
      negative: chart_candelstick_candle_negative_Color_default.var
    }, style: {
      data: {
        stroke: chart_candelstick_data_stroke_Color_default.var,
        strokeWidth: chart_candelstick_data_stroke_Width_default.value
      },
      labels: LABEL_CENTERED_PROPS
    } }),
    chart: Object.assign({}, LAYOUT_PROPS),
    errorbar: Object.assign(Object.assign({}, LAYOUT_PROPS), { borderWidth: chart_errorbar_BorderWidth_default.value, style: {
      data: {
        fill: chart_errorbar_data_Fill_default.var,
        opacity: chart_errorbar_data_Opacity_default.value,
        stroke: chart_errorbar_data_stroke_Color_default.var,
        strokeWidth: chart_errorbar_data_stroke_Width_default.value
      },
      labels: LABEL_CENTERED_PROPS
    } }),
    group: Object.assign({}, LAYOUT_PROPS),
    legend: {
      gutter: chart_legend_gutter_Width_default.value,
      orientation: chart_legend_orientation_default.value,
      titleOrientation: chart_legend_title_orientation_default.value,
      style: {
        data: {
          type: chart_legend_data_type_default.value
        },
        labels: LABEL_PROPS,
        title: Object.assign(Object.assign({}, LABEL_PROPS), { fontSize: TYPOGRAPHY_FONT_SIZE, padding: chart_legend_title_Padding_default.value })
      }
    },
    line: Object.assign(Object.assign({}, LAYOUT_PROPS), { style: {
      data: {
        fill: chart_line_data_Fill_default.var,
        opacity: chart_line_data_Opacity_default.value,
        stroke: chart_line_data_stroke_Color_default.var,
        strokeWidth: chart_line_data_stroke_Width_default.value
      },
      labels: LABEL_CENTERED_PROPS
    } }),
    pie: {
      padding: chart_pie_Padding_default.value,
      style: {
        data: {
          padding: chart_pie_data_Padding_default.value,
          stroke: chart_pie_data_stroke_Color_default.var,
          strokeWidth: chart_pie_data_stroke_Width_default.value
        },
        labels: Object.assign(Object.assign({}, LABEL_PROPS), { padding: chart_pie_labels_Padding_default.value })
      },
      height: chart_pie_Height_default.value,
      width: chart_pie_Width_default.value
    },
    scatter: Object.assign(Object.assign({}, LAYOUT_PROPS), { style: {
      data: {
        fill: chart_scatter_data_Fill_default.var,
        opacity: chart_scatter_data_Opacity_default.value,
        stroke: chart_scatter_data_stroke_Color_default.var,
        strokeWidth: chart_scatter_data_stroke_Width_default.value
      },
      labels: LABEL_CENTERED_PROPS
    } }),
    stack: Object.assign(Object.assign({}, LAYOUT_PROPS), { style: {
      data: {
        strokeWidth: chart_stack_data_stroke_Width_default.value
      }
    } }),
    // Victory is missing style
    tooltip: {
      cornerRadius: chart_tooltip_corner_radius_default.value,
      flyoutPadding: chart_tooltip_Padding_default.value,
      flyoutStyle: {
        cornerRadius: chart_tooltip_flyoutStyle_corner_radius_default.value,
        fill: chart_tooltip_flyoutStyle_Fill_default.var,
        // background
        pointerEvents: chart_tooltip_flyoutStyle_PointerEvents_default.var,
        stroke: chart_tooltip_flyoutStyle_stroke_Color_default.var,
        // border
        strokeWidth: chart_tooltip_flyoutStyle_stroke_Width_default.var
      },
      pointerLength: chart_tooltip_pointer_length_default.value,
      pointerWidth: chart_tooltip_pointer_Width_default.value,
      style: {
        fill: chart_tooltip_Fill_default.var,
        // text
        pointerEvents: chart_tooltip_PointerEvents_default.var
      }
    },
    // Victory is missing cornerRadius and pointerWidth
    voronoi: Object.assign(Object.assign({}, LAYOUT_PROPS), { style: {
      data: {
        fill: chart_voronoi_data_Fill_default.var,
        stroke: chart_voronoi_data_stroke_Color_default.var,
        strokeWidth: chart_voronoi_data_stroke_Width_default.value
      },
      labels: Object.assign(Object.assign({}, LABEL_CENTERED_PROPS), { fill: chart_voronoi_labels_Fill_default.var, padding: chart_voronoi_labels_Padding_default.value, pointerEvents: chart_voronoi_labels_PointerEvents_default.value }),
      // Note: These properties override tooltip
      flyout: {
        fill: chart_voronoi_flyout_stroke_Fill_default.var,
        // background
        pointerEvents: chart_voronoi_flyout_PointerEvents_default.var,
        stroke: chart_voronoi_flyout_stroke_Color_default.var,
        // border
        strokeWidth: chart_voronoi_flyout_stroke_Width_default.var
      }
    } })
  };
  var BaseComponentTheme = {
    axis: {
      // TBD...
    },
    bullet: {
      chart: {
        height: chart_bullet_Height_default.value
      }
    },
    bulletComparativeErrorMeasure: {
      bar: {
        height: chart_bullet_Height_default.value,
        style: {
          data: {
            strokeWidth: chart_bullet_comparative_measure_error_stroke_Width_default.value
          }
        }
      }
    },
    bulletComparativeMeasure: {
      bar: {
        height: chart_bullet_Height_default.value,
        style: {
          data: {
            strokeWidth: chart_bullet_comparative_measure_stroke_Width_default.value
          }
        }
      }
    },
    bulletComparativeWarningMeasure: {
      bar: {
        height: chart_bullet_Height_default.value,
        style: {
          data: {
            strokeWidth: chart_bullet_comparative_measure_warning_stroke_Width_default.value
          }
        }
      }
    },
    bulletGroupTitle: {
      chart: {
        padding: {
          bottom: 0,
          left: 0,
          right: 0,
          top: chart_global_layout_Padding_default.value
        }
        // Victory incorrectly typed ThemeBaseProps.padding as number instead of PaddingProps
      },
      line: {
        style: {
          data: {
            strokeWidth: chart_bullet_group_title_divider_stroke_Width_default.value
          }
        }
      }
    },
    bulletPrimaryDotMeasure: {
      group: {
        height: chart_bullet_Height_default.value
      }
    },
    bulletPrimaryNegativeMeasure: {
      group: {
        height: chart_bullet_Height_default.value
      }
    },
    bulletPrimarySegmentedMeasure: {
      group: {
        height: chart_bullet_Height_default.value
      }
    },
    bulletQualitativeRange: {
      group: {
        height: chart_bullet_Height_default.value
      }
    },
    donut: {
      pie: {
        height: chart_donut_pie_Height_default.value,
        padding: chart_donut_pie_Padding_default.value,
        padAngle: chart_donut_pie_angle_Padding_default.value,
        width: chart_donut_pie_Width_default.value
      }
      // Victory is missing padAngle
    },
    donutThresholdDynamic: {
      pie: {
        height: chart_donut_threshold_dynamic_pie_Height_default.value,
        padding: chart_donut_threshold_dynamic_pie_Padding_default.value,
        width: chart_donut_threshold_dynamic_pie_Width_default.value
      }
    },
    donutThresholdStatic: {
      pie: {
        height: chart_donut_threshold_static_pie_Height_default.value,
        padAngle: chart_donut_threshold_static_pie_angle_Padding_default.value,
        padding: chart_donut_threshold_static_pie_Padding_default.value,
        width: chart_donut_threshold_static_pie_Width_default.value
      }
      // Victory is missing padAngle
    },
    donutUtilization: {
      pie: {
        height: chart_donut_utilization_dynamic_pie_Height_default.value,
        padding: chart_donut_utilization_dynamic_pie_Padding_default.value,
        padAngle: chart_donut_utilization_dynamic_pie_angle_Padding_default.value,
        width: chart_donut_utilization_dynamic_pie_Width_default.value
      }
      // Victory is missing padAngle
    },
    threshold: {
      line: {
        style: {
          data: {
            strokeDasharray: chart_threshold_stroke_dash_array_default.value,
            strokeWidth: chart_threshold_stroke_Width_default.value
          }
        }
      }
    }
  };

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_comparative_measure_Fill_Color.js
  var chart_bullet_comparative_measure_Fill_Color = {
    "name": "--pf-v5-chart-bullet--comparative-measure--Fill--Color",
    "value": "#4f5255",
    "var": "var(--pf-v5-chart-bullet--comparative-measure--Fill--Color, #4f5255)"
  };
  var chart_bullet_comparative_measure_Fill_Color_default = chart_bullet_comparative_measure_Fill_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_comparative_measure_stroke_Color.js
  var chart_bullet_comparative_measure_stroke_Color = {
    "name": "--pf-v5-chart-bullet--comparative-measure--stroke--Color",
    "value": "#4f5255",
    "var": "var(--pf-v5-chart-bullet--comparative-measure--stroke--Color, #4f5255)"
  };
  var chart_bullet_comparative_measure_stroke_Color_default = chart_bullet_comparative_measure_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_comparative_measure_error_Fill_Color.js
  var chart_bullet_comparative_measure_error_Fill_Color = {
    "name": "--pf-v5-chart-bullet--comparative-measure--error--Fill--Color",
    "value": "#c9190b",
    "var": "var(--pf-v5-chart-bullet--comparative-measure--error--Fill--Color, #c9190b)"
  };
  var chart_bullet_comparative_measure_error_Fill_Color_default = chart_bullet_comparative_measure_error_Fill_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_comparative_measure_error_stroke_Color.js
  var chart_bullet_comparative_measure_error_stroke_Color = {
    "name": "--pf-v5-chart-bullet--comparative-measure--error--stroke--Color",
    "value": "#c9190b",
    "var": "var(--pf-v5-chart-bullet--comparative-measure--error--stroke--Color, #c9190b)"
  };
  var chart_bullet_comparative_measure_error_stroke_Color_default = chart_bullet_comparative_measure_error_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_comparative_measure_warning_Fill_Color.js
  var chart_bullet_comparative_measure_warning_Fill_Color = {
    "name": "--pf-v5-chart-bullet--comparative-measure--warning--Fill--Color",
    "value": "#ec7a08",
    "var": "var(--pf-v5-chart-bullet--comparative-measure--warning--Fill--Color, #ec7a08)"
  };
  var chart_bullet_comparative_measure_warning_Fill_Color_default = chart_bullet_comparative_measure_warning_Fill_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_comparative_measure_warning_stroke_Color.js
  var chart_bullet_comparative_measure_warning_stroke_Color = {
    "name": "--pf-v5-chart-bullet--comparative-measure--warning--stroke--Color",
    "value": "#ec7a08",
    "var": "var(--pf-v5-chart-bullet--comparative-measure--warning--stroke--Color, #ec7a08)"
  };
  var chart_bullet_comparative_measure_warning_stroke_Color_default = chart_bullet_comparative_measure_warning_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_group_title_divider_Fill_Color.js
  var chart_bullet_group_title_divider_Fill_Color = {
    "name": "--pf-v5-chart-bullet--group-title--divider--Fill--Color",
    "value": "#f0f0f0",
    "var": "var(--pf-v5-chart-bullet--group-title--divider--Fill--Color, #f0f0f0)"
  };
  var chart_bullet_group_title_divider_Fill_Color_default = chart_bullet_group_title_divider_Fill_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_group_title_divider_stroke_Color.js
  var chart_bullet_group_title_divider_stroke_Color = {
    "name": "--pf-v5-chart-bullet--group-title--divider--stroke--Color",
    "value": "#f0f0f0",
    "var": "var(--pf-v5-chart-bullet--group-title--divider--stroke--Color, #f0f0f0)"
  };
  var chart_bullet_group_title_divider_stroke_Color_default = chart_bullet_group_title_divider_stroke_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_qualitative_range_ColorScale_100.js
  var chart_bullet_qualitative_range_ColorScale_100 = {
    "name": "--pf-v5-chart-bullet--qualitative-range--ColorScale--100",
    "value": "#f0f0f0",
    "var": "var(--pf-v5-chart-bullet--qualitative-range--ColorScale--100, #f0f0f0)"
  };
  var chart_bullet_qualitative_range_ColorScale_100_default = chart_bullet_qualitative_range_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_qualitative_range_ColorScale_200.js
  var chart_bullet_qualitative_range_ColorScale_200 = {
    "name": "--pf-v5-chart-bullet--qualitative-range--ColorScale--200",
    "value": "#d2d2d2",
    "var": "var(--pf-v5-chart-bullet--qualitative-range--ColorScale--200, #d2d2d2)"
  };
  var chart_bullet_qualitative_range_ColorScale_200_default = chart_bullet_qualitative_range_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_qualitative_range_ColorScale_300.js
  var chart_bullet_qualitative_range_ColorScale_300 = {
    "name": "--pf-v5-chart-bullet--qualitative-range--ColorScale--300",
    "value": "#b8bbbe",
    "var": "var(--pf-v5-chart-bullet--qualitative-range--ColorScale--300, #b8bbbe)"
  };
  var chart_bullet_qualitative_range_ColorScale_300_default = chart_bullet_qualitative_range_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_qualitative_range_ColorScale_400.js
  var chart_bullet_qualitative_range_ColorScale_400 = {
    "name": "--pf-v5-chart-bullet--qualitative-range--ColorScale--400",
    "value": "#8a8d90",
    "var": "var(--pf-v5-chart-bullet--qualitative-range--ColorScale--400, #8a8d90)"
  };
  var chart_bullet_qualitative_range_ColorScale_400_default = chart_bullet_qualitative_range_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_qualitative_range_ColorScale_500.js
  var chart_bullet_qualitative_range_ColorScale_500 = {
    "name": "--pf-v5-chart-bullet--qualitative-range--ColorScale--500",
    "value": "#6a6e73",
    "var": "var(--pf-v5-chart-bullet--qualitative-range--ColorScale--500, #6a6e73)"
  };
  var chart_bullet_qualitative_range_ColorScale_500_default = chart_bullet_qualitative_range_ColorScale_500;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_negative_measure_ColorScale_100.js
  var chart_bullet_negative_measure_ColorScale_100 = {
    "name": "--pf-v5-chart-bullet--negative-measure--ColorScale--100",
    "value": "#c9190b",
    "var": "var(--pf-v5-chart-bullet--negative-measure--ColorScale--100, #c9190b)"
  };
  var chart_bullet_negative_measure_ColorScale_100_default = chart_bullet_negative_measure_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_negative_measure_ColorScale_200.js
  var chart_bullet_negative_measure_ColorScale_200 = {
    "name": "--pf-v5-chart-bullet--negative-measure--ColorScale--200",
    "value": "#a30000",
    "var": "var(--pf-v5-chart-bullet--negative-measure--ColorScale--200, #a30000)"
  };
  var chart_bullet_negative_measure_ColorScale_200_default = chart_bullet_negative_measure_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_negative_measure_ColorScale_300.js
  var chart_bullet_negative_measure_ColorScale_300 = {
    "name": "--pf-v5-chart-bullet--negative-measure--ColorScale--300",
    "value": "#7d1007",
    "var": "var(--pf-v5-chart-bullet--negative-measure--ColorScale--300, #7d1007)"
  };
  var chart_bullet_negative_measure_ColorScale_300_default = chart_bullet_negative_measure_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_negative_measure_ColorScale_400.js
  var chart_bullet_negative_measure_ColorScale_400 = {
    "name": "--pf-v5-chart-bullet--negative-measure--ColorScale--400",
    "value": "#470000",
    "var": "var(--pf-v5-chart-bullet--negative-measure--ColorScale--400, #470000)"
  };
  var chart_bullet_negative_measure_ColorScale_400_default = chart_bullet_negative_measure_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_bullet_negative_measure_ColorScale_500.js
  var chart_bullet_negative_measure_ColorScale_500 = {
    "name": "--pf-v5-chart-bullet--negative-measure--ColorScale--500",
    "value": "#2c0000",
    "var": "var(--pf-v5-chart-bullet--negative-measure--ColorScale--500, #2c0000)"
  };
  var chart_bullet_negative_measure_ColorScale_500_default = chart_bullet_negative_measure_ColorScale_500;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_threshold_first_Color.js
  var chart_donut_threshold_first_Color = {
    "name": "--pf-v5-chart-donut--threshold--first--Color",
    "value": "#f0f0f0",
    "var": "var(--pf-v5-chart-donut--threshold--first--Color, #f0f0f0)"
  };
  var chart_donut_threshold_first_Color_default = chart_donut_threshold_first_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_threshold_second_Color.js
  var chart_donut_threshold_second_Color = {
    "name": "--pf-v5-chart-donut--threshold--second--Color",
    "value": "#d2d2d2",
    "var": "var(--pf-v5-chart-donut--threshold--second--Color, #d2d2d2)"
  };
  var chart_donut_threshold_second_Color_default = chart_donut_threshold_second_Color;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_donut_threshold_third_Color.js
  var chart_donut_threshold_third_Color = {
    "name": "--pf-v5-chart-donut--threshold--third--Color",
    "value": "#b8bbbe",
    "var": "var(--pf-v5-chart-donut--threshold--third--Color, #b8bbbe)"
  };
  var chart_donut_threshold_third_Color_default = chart_donut_threshold_third_Color;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/ChartThemeTypes.js
  var ChartBaseTheme = BaseTheme;
  var ChartBaseComponentTheme = BaseComponentTheme;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_blue_ColorScale_100.js
  var chart_theme_blue_ColorScale_100 = {
    "name": "--pf-v5-chart-theme--blue--ColorScale--100",
    "value": "#06c",
    "var": "var(--pf-v5-chart-theme--blue--ColorScale--100, #06c)"
  };
  var chart_theme_blue_ColorScale_100_default = chart_theme_blue_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_blue_ColorScale_200.js
  var chart_theme_blue_ColorScale_200 = {
    "name": "--pf-v5-chart-theme--blue--ColorScale--200",
    "value": "#8bc1f7",
    "var": "var(--pf-v5-chart-theme--blue--ColorScale--200, #8bc1f7)"
  };
  var chart_theme_blue_ColorScale_200_default = chart_theme_blue_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_blue_ColorScale_300.js
  var chart_theme_blue_ColorScale_300 = {
    "name": "--pf-v5-chart-theme--blue--ColorScale--300",
    "value": "#002f5d",
    "var": "var(--pf-v5-chart-theme--blue--ColorScale--300, #002f5d)"
  };
  var chart_theme_blue_ColorScale_300_default = chart_theme_blue_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_blue_ColorScale_400.js
  var chart_theme_blue_ColorScale_400 = {
    "name": "--pf-v5-chart-theme--blue--ColorScale--400",
    "value": "#519de9",
    "var": "var(--pf-v5-chart-theme--blue--ColorScale--400, #519de9)"
  };
  var chart_theme_blue_ColorScale_400_default = chart_theme_blue_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_blue_ColorScale_500.js
  var chart_theme_blue_ColorScale_500 = {
    "name": "--pf-v5-chart-theme--blue--ColorScale--500",
    "value": "#004b95",
    "var": "var(--pf-v5-chart-theme--blue--ColorScale--500, #004b95)"
  };
  var chart_theme_blue_ColorScale_500_default = chart_theme_blue_ColorScale_500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/color-theme.js
  var ColorTheme = (props) => {
    const { COLOR_SCALE: COLOR_SCALE11 } = props;
    return {
      area: {
        colorScale: COLOR_SCALE11,
        style: {
          data: {
            fill: COLOR_SCALE11[0]
          }
        }
      },
      axis: {
        colorScale: COLOR_SCALE11
      },
      bar: {
        colorScale: COLOR_SCALE11,
        style: {
          data: {
            fill: COLOR_SCALE11[0]
          }
        }
      },
      boxplot: {
        colorScale: COLOR_SCALE11,
        style: {
          q1: {
            fill: COLOR_SCALE11[0]
          },
          q3: {
            fill: COLOR_SCALE11[0]
          }
        }
      },
      candlestick: {
        colorScale: COLOR_SCALE11
      },
      chart: {
        colorScale: COLOR_SCALE11
      },
      errorbar: {
        colorScale: COLOR_SCALE11
      },
      group: {
        colorScale: COLOR_SCALE11
      },
      legend: {
        colorScale: COLOR_SCALE11
      },
      line: {
        colorScale: COLOR_SCALE11,
        style: {
          data: {
            stroke: COLOR_SCALE11[0]
          }
        }
      },
      pie: {
        colorScale: COLOR_SCALE11
      },
      scatter: {
        colorScale: COLOR_SCALE11
      },
      stack: {
        colorScale: COLOR_SCALE11
      },
      voronoi: {
        colorScale: COLOR_SCALE11
      }
    };
  };
  var ColorComponentTheme = (props) => {
    const { COLOR_SCALE: COLOR_SCALE11 } = props;
    return {
      axis: {
        axis: {
          style: {
            grid: {
              stroke: chart_axis_grid_stroke_Color_default.var
            },
            ticks: {
              stroke: chart_axis_tick_stroke_Color_default.var
            }
          }
        }
      },
      bullet: {
        // TBD...
      },
      bulletComparativeErrorMeasure: {
        bar: {
          style: {
            data: {
              fill: chart_bullet_comparative_measure_error_Fill_Color_default.var,
              stroke: chart_bullet_comparative_measure_error_stroke_Color_default.var
            }
          }
        }
      },
      bulletComparativeMeasure: {
        bar: {
          height: chart_bullet_Height_default.value,
          style: {
            data: {
              fill: chart_bullet_comparative_measure_Fill_Color_default.var,
              stroke: chart_bullet_comparative_measure_stroke_Color_default.var
            }
          }
        }
      },
      bulletComparativeWarningMeasure: {
        bar: {
          height: chart_bullet_Height_default.value,
          style: {
            data: {
              fill: chart_bullet_comparative_measure_warning_Fill_Color_default.var,
              stroke: chart_bullet_comparative_measure_warning_stroke_Color_default.var
            }
          }
        }
      },
      bulletGroupTitle: {
        line: {
          style: {
            data: {
              fill: chart_bullet_group_title_divider_Fill_Color_default.var,
              stroke: chart_bullet_group_title_divider_stroke_Color_default.var
            }
          }
        }
      },
      bulletPrimaryDotMeasure: {
        // TBD...
      },
      bulletPrimarySegmentedMeasure: {
        // TBD...
      },
      bulletQualitativeRange: {
        group: {
          colorScale: [
            chart_bullet_qualitative_range_ColorScale_100_default.var,
            chart_bullet_qualitative_range_ColorScale_200_default.var,
            chart_bullet_qualitative_range_ColorScale_300_default.var,
            chart_bullet_qualitative_range_ColorScale_400_default.var,
            chart_bullet_qualitative_range_ColorScale_500_default.var
          ]
        }
      },
      bulletPrimaryNegativeMeasure: {
        group: {
          colorScale: [
            chart_bullet_negative_measure_ColorScale_100_default.var,
            chart_bullet_negative_measure_ColorScale_200_default.var,
            chart_bullet_negative_measure_ColorScale_300_default.var,
            chart_bullet_negative_measure_ColorScale_400_default.var,
            chart_bullet_negative_measure_ColorScale_500_default.var
          ]
        }
      },
      donut: {
        // TBD...
      },
      donutThresholdDynamic: {
        legend: {
          // Merge just the first color of dynamic (blue, green, etc.) with static (grey) for expected colorScale
          colorScale: [COLOR_SCALE11[0], chart_donut_threshold_second_Color_default.var, chart_donut_threshold_third_Color_default.var]
        },
        // Merge the threshold colors in case users want to show the unused data
        pie: {
          colorScale: [
            COLOR_SCALE11[0],
            chart_donut_threshold_first_Color_default.var,
            chart_donut_threshold_second_Color_default.var,
            chart_donut_threshold_third_Color_default.var
          ]
        }
      },
      donutThresholdStatic: {
        pie: {
          colorScale: [
            chart_donut_threshold_first_Color_default.var,
            chart_donut_threshold_second_Color_default.var,
            chart_donut_threshold_third_Color_default.var
          ]
        }
      },
      donutUtilization: {
        legend: {
          colorScale: [
            COLOR_SCALE11[0],
            chart_donut_threshold_first_Color_default.var,
            chart_donut_threshold_second_Color_default.var,
            chart_donut_threshold_third_Color_default.var
          ]
        },
        pie: {
          colorScale: [COLOR_SCALE11[0], chart_donut_threshold_first_Color_default.var]
        }
      },
      label: {
        // TBD...
      },
      threshold: {
        // TBD...
      }
    };
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/colors/blue-theme.js
  var COLOR_SCALE = [
    chart_theme_blue_ColorScale_100_default.var,
    chart_theme_blue_ColorScale_200_default.var,
    chart_theme_blue_ColorScale_300_default.var,
    chart_theme_blue_ColorScale_400_default.var,
    chart_theme_blue_ColorScale_500_default.var
  ];
  var BlueColorTheme = ColorTheme({
    COLOR_SCALE
  });
  var BlueColorComponentTheme = ColorComponentTheme({
    COLOR_SCALE
  });

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_cyan_ColorScale_100.js
  var chart_theme_cyan_ColorScale_100 = {
    "name": "--pf-v5-chart-theme--cyan--ColorScale--100",
    "value": "#009596",
    "var": "var(--pf-v5-chart-theme--cyan--ColorScale--100, #009596)"
  };
  var chart_theme_cyan_ColorScale_100_default = chart_theme_cyan_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_cyan_ColorScale_200.js
  var chart_theme_cyan_ColorScale_200 = {
    "name": "--pf-v5-chart-theme--cyan--ColorScale--200",
    "value": "#a2d9d9",
    "var": "var(--pf-v5-chart-theme--cyan--ColorScale--200, #a2d9d9)"
  };
  var chart_theme_cyan_ColorScale_200_default = chart_theme_cyan_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_cyan_ColorScale_300.js
  var chart_theme_cyan_ColorScale_300 = {
    "name": "--pf-v5-chart-theme--cyan--ColorScale--300",
    "value": "#003737",
    "var": "var(--pf-v5-chart-theme--cyan--ColorScale--300, #003737)"
  };
  var chart_theme_cyan_ColorScale_300_default = chart_theme_cyan_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_cyan_ColorScale_400.js
  var chart_theme_cyan_ColorScale_400 = {
    "name": "--pf-v5-chart-theme--cyan--ColorScale--400",
    "value": "#73c5c5",
    "var": "var(--pf-v5-chart-theme--cyan--ColorScale--400, #73c5c5)"
  };
  var chart_theme_cyan_ColorScale_400_default = chart_theme_cyan_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_cyan_ColorScale_500.js
  var chart_theme_cyan_ColorScale_500 = {
    "name": "--pf-v5-chart-theme--cyan--ColorScale--500",
    "value": "#005f60",
    "var": "var(--pf-v5-chart-theme--cyan--ColorScale--500, #005f60)"
  };
  var chart_theme_cyan_ColorScale_500_default = chart_theme_cyan_ColorScale_500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/colors/cyan-theme.js
  var COLOR_SCALE2 = [
    chart_theme_cyan_ColorScale_100_default.var,
    chart_theme_cyan_ColorScale_200_default.var,
    chart_theme_cyan_ColorScale_300_default.var,
    chart_theme_cyan_ColorScale_400_default.var,
    chart_theme_cyan_ColorScale_500_default.var
  ];
  var CyanColorTheme = ColorTheme({
    COLOR_SCALE: COLOR_SCALE2
  });
  var CyanColorComponentTheme = ColorComponentTheme({
    COLOR_SCALE: COLOR_SCALE2
  });

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gold_ColorScale_100.js
  var chart_theme_gold_ColorScale_100 = {
    "name": "--pf-v5-chart-theme--gold--ColorScale--100",
    "value": "#f4c145",
    "var": "var(--pf-v5-chart-theme--gold--ColorScale--100, #f4c145)"
  };
  var chart_theme_gold_ColorScale_100_default = chart_theme_gold_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gold_ColorScale_200.js
  var chart_theme_gold_ColorScale_200 = {
    "name": "--pf-v5-chart-theme--gold--ColorScale--200",
    "value": "#f9e0a2",
    "var": "var(--pf-v5-chart-theme--gold--ColorScale--200, #f9e0a2)"
  };
  var chart_theme_gold_ColorScale_200_default = chart_theme_gold_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gold_ColorScale_300.js
  var chart_theme_gold_ColorScale_300 = {
    "name": "--pf-v5-chart-theme--gold--ColorScale--300",
    "value": "#c58c00",
    "var": "var(--pf-v5-chart-theme--gold--ColorScale--300, #c58c00)"
  };
  var chart_theme_gold_ColorScale_300_default = chart_theme_gold_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gold_ColorScale_400.js
  var chart_theme_gold_ColorScale_400 = {
    "name": "--pf-v5-chart-theme--gold--ColorScale--400",
    "value": "#f6d173",
    "var": "var(--pf-v5-chart-theme--gold--ColorScale--400, #f6d173)"
  };
  var chart_theme_gold_ColorScale_400_default = chart_theme_gold_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gold_ColorScale_500.js
  var chart_theme_gold_ColorScale_500 = {
    "name": "--pf-v5-chart-theme--gold--ColorScale--500",
    "value": "#f0ab00",
    "var": "var(--pf-v5-chart-theme--gold--ColorScale--500, #f0ab00)"
  };
  var chart_theme_gold_ColorScale_500_default = chart_theme_gold_ColorScale_500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/colors/gold-theme.js
  var COLOR_SCALE3 = [
    chart_theme_gold_ColorScale_100_default.var,
    chart_theme_gold_ColorScale_200_default.var,
    chart_theme_gold_ColorScale_300_default.var,
    chart_theme_gold_ColorScale_400_default.var,
    chart_theme_gold_ColorScale_500_default.var
  ];
  var GoldColorTheme = ColorTheme({
    COLOR_SCALE: COLOR_SCALE3
  });
  var GoldColorComponentTheme = ColorComponentTheme({
    COLOR_SCALE: COLOR_SCALE3
  });

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gray_ColorScale_100.js
  var chart_theme_gray_ColorScale_100 = {
    "name": "--pf-v5-chart-theme--gray--ColorScale--100",
    "value": "#b8bbbe",
    "var": "var(--pf-v5-chart-theme--gray--ColorScale--100, #b8bbbe)"
  };
  var chart_theme_gray_ColorScale_100_default = chart_theme_gray_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gray_ColorScale_200.js
  var chart_theme_gray_ColorScale_200 = {
    "name": "--pf-v5-chart-theme--gray--ColorScale--200",
    "value": "#f0f0f0",
    "var": "var(--pf-v5-chart-theme--gray--ColorScale--200, #f0f0f0)"
  };
  var chart_theme_gray_ColorScale_200_default = chart_theme_gray_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gray_ColorScale_300.js
  var chart_theme_gray_ColorScale_300 = {
    "name": "--pf-v5-chart-theme--gray--ColorScale--300",
    "value": "#6a6e73",
    "var": "var(--pf-v5-chart-theme--gray--ColorScale--300, #6a6e73)"
  };
  var chart_theme_gray_ColorScale_300_default = chart_theme_gray_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gray_ColorScale_400.js
  var chart_theme_gray_ColorScale_400 = {
    "name": "--pf-v5-chart-theme--gray--ColorScale--400",
    "value": "#d2d2d2",
    "var": "var(--pf-v5-chart-theme--gray--ColorScale--400, #d2d2d2)"
  };
  var chart_theme_gray_ColorScale_400_default = chart_theme_gray_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_gray_ColorScale_500.js
  var chart_theme_gray_ColorScale_500 = {
    "name": "--pf-v5-chart-theme--gray--ColorScale--500",
    "value": "#8a8d90",
    "var": "var(--pf-v5-chart-theme--gray--ColorScale--500, #8a8d90)"
  };
  var chart_theme_gray_ColorScale_500_default = chart_theme_gray_ColorScale_500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/colors/gray-theme.js
  var COLOR_SCALE4 = [
    chart_theme_gray_ColorScale_100_default.var,
    chart_theme_gray_ColorScale_200_default.var,
    chart_theme_gray_ColorScale_300_default.var,
    chart_theme_gray_ColorScale_400_default.var,
    chart_theme_gray_ColorScale_500_default.var
  ];
  var GrayColorTheme = ColorTheme({
    COLOR_SCALE: COLOR_SCALE4
  });
  var GrayColorComponentTheme = ColorComponentTheme({
    COLOR_SCALE: COLOR_SCALE4
  });

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_green_ColorScale_100.js
  var chart_theme_green_ColorScale_100 = {
    "name": "--pf-v5-chart-theme--green--ColorScale--100",
    "value": "#4cb140",
    "var": "var(--pf-v5-chart-theme--green--ColorScale--100, #4cb140)"
  };
  var chart_theme_green_ColorScale_100_default = chart_theme_green_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_green_ColorScale_200.js
  var chart_theme_green_ColorScale_200 = {
    "name": "--pf-v5-chart-theme--green--ColorScale--200",
    "value": "#bde2b9",
    "var": "var(--pf-v5-chart-theme--green--ColorScale--200, #bde2b9)"
  };
  var chart_theme_green_ColorScale_200_default = chart_theme_green_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_green_ColorScale_300.js
  var chart_theme_green_ColorScale_300 = {
    "name": "--pf-v5-chart-theme--green--ColorScale--300",
    "value": "#23511e",
    "var": "var(--pf-v5-chart-theme--green--ColorScale--300, #23511e)"
  };
  var chart_theme_green_ColorScale_300_default = chart_theme_green_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_green_ColorScale_400.js
  var chart_theme_green_ColorScale_400 = {
    "name": "--pf-v5-chart-theme--green--ColorScale--400",
    "value": "#7cc674",
    "var": "var(--pf-v5-chart-theme--green--ColorScale--400, #7cc674)"
  };
  var chart_theme_green_ColorScale_400_default = chart_theme_green_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_green_ColorScale_500.js
  var chart_theme_green_ColorScale_500 = {
    "name": "--pf-v5-chart-theme--green--ColorScale--500",
    "value": "#38812f",
    "var": "var(--pf-v5-chart-theme--green--ColorScale--500, #38812f)"
  };
  var chart_theme_green_ColorScale_500_default = chart_theme_green_ColorScale_500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/colors/green-theme.js
  var COLOR_SCALE5 = [
    chart_theme_green_ColorScale_100_default.var,
    chart_theme_green_ColorScale_200_default.var,
    chart_theme_green_ColorScale_300_default.var,
    chart_theme_green_ColorScale_400_default.var,
    chart_theme_green_ColorScale_500_default.var
  ];
  var GreenColorTheme = ColorTheme({
    COLOR_SCALE: COLOR_SCALE5
  });
  var GreenColorComponentTheme = ColorComponentTheme({
    COLOR_SCALE: COLOR_SCALE5
  });

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/skeleton-theme.js
  var LABEL_PROPS2 = {
    fill: "transparent",
    stroke: "transparent"
  };
  var LABEL_CENTERED_PROPS2 = Object.assign({}, LABEL_PROPS2);
  var ColorTheme2 = (props) => {
    const { COLOR_SCALE: COLOR_SCALE11 } = props;
    return {
      area: {
        colorScale: COLOR_SCALE11,
        style: {
          data: {
            fill: COLOR_SCALE11[0]
          },
          labels: LABEL_CENTERED_PROPS2
        }
      },
      axis: {
        colorScale: COLOR_SCALE11,
        style: {
          axis: {
            fill: "transparent",
            stroke: COLOR_SCALE11[0]
          },
          axisLabel: Object.assign(Object.assign({}, LABEL_CENTERED_PROPS2), { fill: COLOR_SCALE11[0], stroke: "transparent" }),
          grid: {
            fill: "transparent",
            stroke: "transparent"
          },
          ticks: {
            fill: "transparent",
            stroke: COLOR_SCALE11[0]
          },
          tickLabels: Object.assign(Object.assign({}, LABEL_PROPS2), { fill: "transparent" })
        }
      },
      bar: {
        colorScale: COLOR_SCALE11,
        style: {
          data: {
            fill: COLOR_SCALE11[0],
            stroke: COLOR_SCALE11[0]
          },
          labels: LABEL_PROPS2
        }
      },
      boxplot: {
        colorScale: COLOR_SCALE11,
        style: {
          max: {
            stroke: COLOR_SCALE11[0]
          },
          maxLabels: LABEL_PROPS2,
          median: {
            stroke: COLOR_SCALE11[0]
          },
          medianLabels: LABEL_PROPS2,
          min: {
            stroke: COLOR_SCALE11[0]
          },
          minLabels: LABEL_PROPS2,
          q1: {
            fill: COLOR_SCALE11[0]
          },
          q1Labels: LABEL_PROPS2,
          q3: {
            fill: COLOR_SCALE11[0]
          },
          q3Labels: LABEL_PROPS2
        }
      },
      candlestick: {
        colorScale: COLOR_SCALE11,
        style: {
          data: {
            stroke: COLOR_SCALE11[0]
          },
          labels: LABEL_CENTERED_PROPS2
        }
      },
      chart: {
        colorScale: COLOR_SCALE11
      },
      errorbar: {
        colorScale: COLOR_SCALE11,
        style: {
          data: {
            fill: "transparent",
            stroke: COLOR_SCALE11[0]
          },
          labels: LABEL_CENTERED_PROPS2
        }
      },
      group: {
        colorScale: COLOR_SCALE11
      },
      legend: {
        colorScale: COLOR_SCALE11,
        style: {
          labels: LABEL_PROPS2,
          title: Object.assign({}, LABEL_PROPS2)
        }
      },
      line: {
        colorScale: COLOR_SCALE11,
        style: {
          data: {
            fill: "transparent",
            stroke: COLOR_SCALE11[0]
          },
          labels: LABEL_CENTERED_PROPS2
        }
      },
      pie: {
        colorScale: COLOR_SCALE11,
        style: {
          data: {
            stroke: "transparent"
          },
          labels: Object.assign({}, LABEL_PROPS2)
        }
      },
      scatter: {
        colorScale: COLOR_SCALE11,
        style: {
          data: {
            fill: COLOR_SCALE11[0],
            stroke: "transparent"
          },
          labels: LABEL_CENTERED_PROPS2
        }
      },
      stack: {
        colorScale: COLOR_SCALE11
      },
      tooltip: {
        flyoutStyle: {
          fill: "transparent",
          // background
          stroke: "transparent"
          // border
        },
        style: {
          fill: "transparent"
          // text
        }
      },
      voronoi: {
        colorScale: COLOR_SCALE11,
        style: {
          data: {
            fill: COLOR_SCALE11[0],
            stroke: COLOR_SCALE11[0]
          },
          labels: Object.assign(Object.assign({}, LABEL_CENTERED_PROPS2), {
            fill: "transparent"
            // text
          }),
          // Note: These properties override tooltip
          flyout: {
            fill: "transparent",
            // background
            stroke: "transparent"
            // border
          }
        }
      }
    };
  };
  var ColorComponentTheme2 = (props) => {
    const { COLOR_SCALE: COLOR_SCALE11 } = props;
    return {
      axis: {
        axis: {
          style: {
            grid: {
              stroke: COLOR_SCALE11[0]
            },
            ticks: {
              stroke: COLOR_SCALE11[0]
            }
          }
        }
      },
      bullet: {
        // TBD...
      },
      bulletComparativeErrorMeasure: {
        bar: {
          style: {
            data: {
              fill: COLOR_SCALE11[0],
              stroke: COLOR_SCALE11[0]
            }
          }
        }
      },
      bulletComparativeMeasure: {
        bar: {
          style: {
            data: {
              fill: COLOR_SCALE11[0],
              stroke: COLOR_SCALE11[0]
            }
          }
        }
      },
      bulletComparativeWarningMeasure: {
        bar: {
          style: {
            data: {
              fill: COLOR_SCALE11[0],
              stroke: COLOR_SCALE11[0]
            }
          }
        }
      },
      bulletGroupTitle: {
        line: {
          style: {
            data: {
              fill: COLOR_SCALE11[0],
              stroke: COLOR_SCALE11[0]
            }
          }
        }
      },
      bulletPrimaryDotMeasure: {
        // TBD...
      },
      bulletPrimaryNegativeMeasure: {
        group: {
          colorScale: COLOR_SCALE11
        }
      },
      bulletPrimarySegmentedMeasure: {
        // TBD...
      },
      bulletQualitativeRange: {
        group: {
          colorScale: COLOR_SCALE11
        }
      },
      donut: {
        // TBD...
      },
      donutThresholdDynamic: {
        legend: {
          colorScale: COLOR_SCALE11
        },
        pie: {
          colorScale: COLOR_SCALE11
        }
      },
      donutThresholdStatic: {
        pie: {
          colorScale: COLOR_SCALE11
        }
      },
      donutUtilization: {
        legend: {
          colorScale: COLOR_SCALE11
        },
        pie: {
          colorScale: COLOR_SCALE11
        }
      },
      label: {
        backgroundStyle: {
          fill: COLOR_SCALE11[0]
        },
        style: LABEL_CENTERED_PROPS2
      },
      threshold: {
        // TBD...
      }
    };
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/colors/skeleton-theme.js
  var COLOR_SCALE6 = [
    chart_bullet_qualitative_range_ColorScale_100_default.var,
    chart_bullet_qualitative_range_ColorScale_200_default.var,
    chart_bullet_qualitative_range_ColorScale_300_default.var,
    chart_bullet_qualitative_range_ColorScale_400_default.var,
    chart_bullet_qualitative_range_ColorScale_500_default.var
  ];
  var SkeletonColorTheme = ColorTheme2({
    COLOR_SCALE: COLOR_SCALE6
  });
  var SkeletonColorComponentTheme = ColorComponentTheme2({
    COLOR_SCALE: COLOR_SCALE6
  });

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_100.js
  var chart_theme_multi_color_ordered_ColorScale_100 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--100",
    "value": "#06c",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--100, #06c)"
  };
  var chart_theme_multi_color_ordered_ColorScale_100_default = chart_theme_multi_color_ordered_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_200.js
  var chart_theme_multi_color_ordered_ColorScale_200 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--200",
    "value": "#4cb140",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--200, #4cb140)"
  };
  var chart_theme_multi_color_ordered_ColorScale_200_default = chart_theme_multi_color_ordered_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_300.js
  var chart_theme_multi_color_ordered_ColorScale_300 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--300",
    "value": "#009596",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--300, #009596)"
  };
  var chart_theme_multi_color_ordered_ColorScale_300_default = chart_theme_multi_color_ordered_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_400.js
  var chart_theme_multi_color_ordered_ColorScale_400 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--400",
    "value": "#f4c145",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--400, #f4c145)"
  };
  var chart_theme_multi_color_ordered_ColorScale_400_default = chart_theme_multi_color_ordered_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_500.js
  var chart_theme_multi_color_ordered_ColorScale_500 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--500",
    "value": "#ec7a08",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--500, #ec7a08)"
  };
  var chart_theme_multi_color_ordered_ColorScale_500_default = chart_theme_multi_color_ordered_ColorScale_500;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_600.js
  var chart_theme_multi_color_ordered_ColorScale_600 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--600",
    "value": "#8bc1f7",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--600, #8bc1f7)"
  };
  var chart_theme_multi_color_ordered_ColorScale_600_default = chart_theme_multi_color_ordered_ColorScale_600;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_700.js
  var chart_theme_multi_color_ordered_ColorScale_700 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--700",
    "value": "#23511e",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--700, #23511e)"
  };
  var chart_theme_multi_color_ordered_ColorScale_700_default = chart_theme_multi_color_ordered_ColorScale_700;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_800.js
  var chart_theme_multi_color_ordered_ColorScale_800 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--800",
    "value": "#a2d9d9",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--800, #a2d9d9)"
  };
  var chart_theme_multi_color_ordered_ColorScale_800_default = chart_theme_multi_color_ordered_ColorScale_800;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_900.js
  var chart_theme_multi_color_ordered_ColorScale_900 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--900",
    "value": "#f9e0a2",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--900, #f9e0a2)"
  };
  var chart_theme_multi_color_ordered_ColorScale_900_default = chart_theme_multi_color_ordered_ColorScale_900;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1000.js
  var chart_theme_multi_color_ordered_ColorScale_1000 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--1000",
    "value": "#8f4700",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--1000, #8f4700)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1000_default = chart_theme_multi_color_ordered_ColorScale_1000;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1100.js
  var chart_theme_multi_color_ordered_ColorScale_1100 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--1100",
    "value": "#002f5d",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--1100, #002f5d)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1100_default = chart_theme_multi_color_ordered_ColorScale_1100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1200.js
  var chart_theme_multi_color_ordered_ColorScale_1200 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--1200",
    "value": "#bde2b9",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--1200, #bde2b9)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1200_default = chart_theme_multi_color_ordered_ColorScale_1200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1300.js
  var chart_theme_multi_color_ordered_ColorScale_1300 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--1300",
    "value": "#003737",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--1300, #003737)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1300_default = chart_theme_multi_color_ordered_ColorScale_1300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1400.js
  var chart_theme_multi_color_ordered_ColorScale_1400 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--1400",
    "value": "#c58c00",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--1400, #c58c00)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1400_default = chart_theme_multi_color_ordered_ColorScale_1400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1500.js
  var chart_theme_multi_color_ordered_ColorScale_1500 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--1500",
    "value": "#f4b678",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--1500, #f4b678)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1500_default = chart_theme_multi_color_ordered_ColorScale_1500;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1600.js
  var chart_theme_multi_color_ordered_ColorScale_1600 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--1600",
    "value": "#519de9",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--1600, #519de9)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1600_default = chart_theme_multi_color_ordered_ColorScale_1600;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1700.js
  var chart_theme_multi_color_ordered_ColorScale_1700 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--1700",
    "value": "#38812f",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--1700, #38812f)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1700_default = chart_theme_multi_color_ordered_ColorScale_1700;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1800.js
  var chart_theme_multi_color_ordered_ColorScale_1800 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--1800",
    "value": "#73c5c5",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--1800, #73c5c5)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1800_default = chart_theme_multi_color_ordered_ColorScale_1800;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_1900.js
  var chart_theme_multi_color_ordered_ColorScale_1900 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--1900",
    "value": "#f6d173",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--1900, #f6d173)"
  };
  var chart_theme_multi_color_ordered_ColorScale_1900_default = chart_theme_multi_color_ordered_ColorScale_1900;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_2000.js
  var chart_theme_multi_color_ordered_ColorScale_2000 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--2000",
    "value": "#c46100",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--2000, #c46100)"
  };
  var chart_theme_multi_color_ordered_ColorScale_2000_default = chart_theme_multi_color_ordered_ColorScale_2000;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_2100.js
  var chart_theme_multi_color_ordered_ColorScale_2100 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--2100",
    "value": "#004b95",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--2100, #004b95)"
  };
  var chart_theme_multi_color_ordered_ColorScale_2100_default = chart_theme_multi_color_ordered_ColorScale_2100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_2200.js
  var chart_theme_multi_color_ordered_ColorScale_2200 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--2200",
    "value": "#7cc674",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--2200, #7cc674)"
  };
  var chart_theme_multi_color_ordered_ColorScale_2200_default = chart_theme_multi_color_ordered_ColorScale_2200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_2300.js
  var chart_theme_multi_color_ordered_ColorScale_2300 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--2300",
    "value": "#005f60",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--2300, #005f60)"
  };
  var chart_theme_multi_color_ordered_ColorScale_2300_default = chart_theme_multi_color_ordered_ColorScale_2300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_2400.js
  var chart_theme_multi_color_ordered_ColorScale_2400 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--2400",
    "value": "#f0ab00",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--2400, #f0ab00)"
  };
  var chart_theme_multi_color_ordered_ColorScale_2400_default = chart_theme_multi_color_ordered_ColorScale_2400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_ordered_ColorScale_2500.js
  var chart_theme_multi_color_ordered_ColorScale_2500 = {
    "name": "--pf-v5-chart-theme--multi-color-ordered--ColorScale--2500",
    "value": "#ef9234",
    "var": "var(--pf-v5-chart-theme--multi-color-ordered--ColorScale--2500, #ef9234)"
  };
  var chart_theme_multi_color_ordered_ColorScale_2500_default = chart_theme_multi_color_ordered_ColorScale_2500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/colors/multi-ordered-theme.js
  var COLOR_SCALE7 = [
    chart_theme_multi_color_ordered_ColorScale_100_default.var,
    chart_theme_multi_color_ordered_ColorScale_200_default.var,
    chart_theme_multi_color_ordered_ColorScale_300_default.var,
    chart_theme_multi_color_ordered_ColorScale_400_default.var,
    chart_theme_multi_color_ordered_ColorScale_500_default.var,
    chart_theme_multi_color_ordered_ColorScale_600_default.var,
    chart_theme_multi_color_ordered_ColorScale_700_default.var,
    chart_theme_multi_color_ordered_ColorScale_800_default.var,
    chart_theme_multi_color_ordered_ColorScale_900_default.var,
    chart_theme_multi_color_ordered_ColorScale_1000_default.var,
    chart_theme_multi_color_ordered_ColorScale_1100_default.var,
    chart_theme_multi_color_ordered_ColorScale_1200_default.var,
    chart_theme_multi_color_ordered_ColorScale_1300_default.var,
    chart_theme_multi_color_ordered_ColorScale_1400_default.var,
    chart_theme_multi_color_ordered_ColorScale_1500_default.var,
    chart_theme_multi_color_ordered_ColorScale_1600_default.var,
    chart_theme_multi_color_ordered_ColorScale_1700_default.var,
    chart_theme_multi_color_ordered_ColorScale_1800_default.var,
    chart_theme_multi_color_ordered_ColorScale_1900_default.var,
    chart_theme_multi_color_ordered_ColorScale_2000_default.var,
    chart_theme_multi_color_ordered_ColorScale_2100_default.var,
    chart_theme_multi_color_ordered_ColorScale_2200_default.var,
    chart_theme_multi_color_ordered_ColorScale_2300_default.var,
    chart_theme_multi_color_ordered_ColorScale_2400_default.var,
    chart_theme_multi_color_ordered_ColorScale_2500_default.var
  ];
  var MultiColorOrderedTheme = ColorTheme({
    COLOR_SCALE: COLOR_SCALE7
  });
  var MultiColorOrderedComponentTheme = ColorComponentTheme({
    COLOR_SCALE: COLOR_SCALE7
  });

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_100.js
  var chart_theme_multi_color_unordered_ColorScale_100 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--100",
    "value": "#06c",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--100, #06c)"
  };
  var chart_theme_multi_color_unordered_ColorScale_100_default = chart_theme_multi_color_unordered_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_200.js
  var chart_theme_multi_color_unordered_ColorScale_200 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--200",
    "value": "#f4c145",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--200, #f4c145)"
  };
  var chart_theme_multi_color_unordered_ColorScale_200_default = chart_theme_multi_color_unordered_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_300.js
  var chart_theme_multi_color_unordered_ColorScale_300 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--300",
    "value": "#4cb140",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--300, #4cb140)"
  };
  var chart_theme_multi_color_unordered_ColorScale_300_default = chart_theme_multi_color_unordered_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_400.js
  var chart_theme_multi_color_unordered_ColorScale_400 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--400",
    "value": "#5752d1",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--400, #5752d1)"
  };
  var chart_theme_multi_color_unordered_ColorScale_400_default = chart_theme_multi_color_unordered_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_500.js
  var chart_theme_multi_color_unordered_ColorScale_500 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--500",
    "value": "#ec7a08",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--500, #ec7a08)"
  };
  var chart_theme_multi_color_unordered_ColorScale_500_default = chart_theme_multi_color_unordered_ColorScale_500;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_600.js
  var chart_theme_multi_color_unordered_ColorScale_600 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--600",
    "value": "#009596",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--600, #009596)"
  };
  var chart_theme_multi_color_unordered_ColorScale_600_default = chart_theme_multi_color_unordered_ColorScale_600;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_700.js
  var chart_theme_multi_color_unordered_ColorScale_700 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--700",
    "value": "#b8bbbe",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--700, #b8bbbe)"
  };
  var chart_theme_multi_color_unordered_ColorScale_700_default = chart_theme_multi_color_unordered_ColorScale_700;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_800.js
  var chart_theme_multi_color_unordered_ColorScale_800 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--800",
    "value": "#8bc1f7",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--800, #8bc1f7)"
  };
  var chart_theme_multi_color_unordered_ColorScale_800_default = chart_theme_multi_color_unordered_ColorScale_800;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_900.js
  var chart_theme_multi_color_unordered_ColorScale_900 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--900",
    "value": "#c58c00",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--900, #c58c00)"
  };
  var chart_theme_multi_color_unordered_ColorScale_900_default = chart_theme_multi_color_unordered_ColorScale_900;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1000.js
  var chart_theme_multi_color_unordered_ColorScale_1000 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--1000",
    "value": "#bde2b9",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--1000, #bde2b9)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1000_default = chart_theme_multi_color_unordered_ColorScale_1000;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1100.js
  var chart_theme_multi_color_unordered_ColorScale_1100 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--1100",
    "value": "#2a265f",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--1100, #2a265f)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1100_default = chart_theme_multi_color_unordered_ColorScale_1100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1200.js
  var chart_theme_multi_color_unordered_ColorScale_1200 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--1200",
    "value": "#f4b678",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--1200, #f4b678)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1200_default = chart_theme_multi_color_unordered_ColorScale_1200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1300.js
  var chart_theme_multi_color_unordered_ColorScale_1300 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--1300",
    "value": "#003737",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--1300, #003737)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1300_default = chart_theme_multi_color_unordered_ColorScale_1300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1400.js
  var chart_theme_multi_color_unordered_ColorScale_1400 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--1400",
    "value": "#f0f0f0",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--1400, #f0f0f0)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1400_default = chart_theme_multi_color_unordered_ColorScale_1400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1500.js
  var chart_theme_multi_color_unordered_ColorScale_1500 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--1500",
    "value": "#002f5d",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--1500, #002f5d)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1500_default = chart_theme_multi_color_unordered_ColorScale_1500;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1600.js
  var chart_theme_multi_color_unordered_ColorScale_1600 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--1600",
    "value": "#f9e0a2",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--1600, #f9e0a2)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1600_default = chart_theme_multi_color_unordered_ColorScale_1600;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1700.js
  var chart_theme_multi_color_unordered_ColorScale_1700 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--1700",
    "value": "#23511e",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--1700, #23511e)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1700_default = chart_theme_multi_color_unordered_ColorScale_1700;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1800.js
  var chart_theme_multi_color_unordered_ColorScale_1800 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--1800",
    "value": "#b2b0ea",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--1800, #b2b0ea)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1800_default = chart_theme_multi_color_unordered_ColorScale_1800;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_1900.js
  var chart_theme_multi_color_unordered_ColorScale_1900 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--1900",
    "value": "#8f4700",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--1900, #8f4700)"
  };
  var chart_theme_multi_color_unordered_ColorScale_1900_default = chart_theme_multi_color_unordered_ColorScale_1900;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2000.js
  var chart_theme_multi_color_unordered_ColorScale_2000 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--2000",
    "value": "#a2d9d9",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--2000, #a2d9d9)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2000_default = chart_theme_multi_color_unordered_ColorScale_2000;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2100.js
  var chart_theme_multi_color_unordered_ColorScale_2100 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--2100",
    "value": "#6a6e73",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--2100, #6a6e73)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2100_default = chart_theme_multi_color_unordered_ColorScale_2100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2200.js
  var chart_theme_multi_color_unordered_ColorScale_2200 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--2200",
    "value": "#519de9",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--2200, #519de9)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2200_default = chart_theme_multi_color_unordered_ColorScale_2200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2300.js
  var chart_theme_multi_color_unordered_ColorScale_2300 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--2300",
    "value": "#f0ab00",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--2300, #f0ab00)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2300_default = chart_theme_multi_color_unordered_ColorScale_2300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2400.js
  var chart_theme_multi_color_unordered_ColorScale_2400 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--2400",
    "value": "#7cc674",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--2400, #7cc674)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2400_default = chart_theme_multi_color_unordered_ColorScale_2400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2500.js
  var chart_theme_multi_color_unordered_ColorScale_2500 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--2500",
    "value": "#3c3d99",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--2500, #3c3d99)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2500_default = chart_theme_multi_color_unordered_ColorScale_2500;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2600.js
  var chart_theme_multi_color_unordered_ColorScale_2600 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--2600",
    "value": "#ef9234",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--2600, #ef9234)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2600_default = chart_theme_multi_color_unordered_ColorScale_2600;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2700.js
  var chart_theme_multi_color_unordered_ColorScale_2700 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--2700",
    "value": "#005f60",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--2700, #005f60)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2700_default = chart_theme_multi_color_unordered_ColorScale_2700;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2800.js
  var chart_theme_multi_color_unordered_ColorScale_2800 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--2800",
    "value": "#d2d2d2",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--2800, #d2d2d2)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2800_default = chart_theme_multi_color_unordered_ColorScale_2800;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_2900.js
  var chart_theme_multi_color_unordered_ColorScale_2900 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--2900",
    "value": "#004b95",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--2900, #004b95)"
  };
  var chart_theme_multi_color_unordered_ColorScale_2900_default = chart_theme_multi_color_unordered_ColorScale_2900;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_3000.js
  var chart_theme_multi_color_unordered_ColorScale_3000 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--3000",
    "value": "#f6d173",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--3000, #f6d173)"
  };
  var chart_theme_multi_color_unordered_ColorScale_3000_default = chart_theme_multi_color_unordered_ColorScale_3000;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_3100.js
  var chart_theme_multi_color_unordered_ColorScale_3100 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--3100",
    "value": "#38812f",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--3100, #38812f)"
  };
  var chart_theme_multi_color_unordered_ColorScale_3100_default = chart_theme_multi_color_unordered_ColorScale_3100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_3200.js
  var chart_theme_multi_color_unordered_ColorScale_3200 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--3200",
    "value": "#8481dd",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--3200, #8481dd)"
  };
  var chart_theme_multi_color_unordered_ColorScale_3200_default = chart_theme_multi_color_unordered_ColorScale_3200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_3300.js
  var chart_theme_multi_color_unordered_ColorScale_3300 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--3300",
    "value": "#c46100",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--3300, #c46100)"
  };
  var chart_theme_multi_color_unordered_ColorScale_3300_default = chart_theme_multi_color_unordered_ColorScale_3300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_3400.js
  var chart_theme_multi_color_unordered_ColorScale_3400 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--3400",
    "value": "#73c5c5",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--3400, #73c5c5)"
  };
  var chart_theme_multi_color_unordered_ColorScale_3400_default = chart_theme_multi_color_unordered_ColorScale_3400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_multi_color_unordered_ColorScale_3500.js
  var chart_theme_multi_color_unordered_ColorScale_3500 = {
    "name": "--pf-v5-chart-theme--multi-color-unordered--ColorScale--3500",
    "value": "#8a8d90",
    "var": "var(--pf-v5-chart-theme--multi-color-unordered--ColorScale--3500, #8a8d90)"
  };
  var chart_theme_multi_color_unordered_ColorScale_3500_default = chart_theme_multi_color_unordered_ColorScale_3500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/colors/multi-unordered-theme.js
  var COLOR_SCALE8 = [
    chart_theme_multi_color_unordered_ColorScale_100_default.var,
    chart_theme_multi_color_unordered_ColorScale_200_default.var,
    chart_theme_multi_color_unordered_ColorScale_300_default.var,
    chart_theme_multi_color_unordered_ColorScale_400_default.var,
    chart_theme_multi_color_unordered_ColorScale_500_default.var,
    chart_theme_multi_color_unordered_ColorScale_600_default.var,
    chart_theme_multi_color_unordered_ColorScale_700_default.var,
    chart_theme_multi_color_unordered_ColorScale_800_default.var,
    chart_theme_multi_color_unordered_ColorScale_900_default.var,
    chart_theme_multi_color_unordered_ColorScale_1000_default.var,
    chart_theme_multi_color_unordered_ColorScale_1100_default.var,
    chart_theme_multi_color_unordered_ColorScale_1200_default.var,
    chart_theme_multi_color_unordered_ColorScale_1300_default.var,
    chart_theme_multi_color_unordered_ColorScale_1400_default.var,
    chart_theme_multi_color_unordered_ColorScale_1500_default.var,
    chart_theme_multi_color_unordered_ColorScale_1600_default.var,
    chart_theme_multi_color_unordered_ColorScale_1700_default.var,
    chart_theme_multi_color_unordered_ColorScale_1800_default.var,
    chart_theme_multi_color_unordered_ColorScale_1900_default.var,
    chart_theme_multi_color_unordered_ColorScale_2000_default.var,
    chart_theme_multi_color_unordered_ColorScale_2100_default.var,
    chart_theme_multi_color_unordered_ColorScale_2200_default.var,
    chart_theme_multi_color_unordered_ColorScale_2300_default.var,
    chart_theme_multi_color_unordered_ColorScale_2400_default.var,
    chart_theme_multi_color_unordered_ColorScale_2500_default.var,
    chart_theme_multi_color_unordered_ColorScale_2600_default.var,
    chart_theme_multi_color_unordered_ColorScale_2700_default.var,
    chart_theme_multi_color_unordered_ColorScale_2800_default.var,
    chart_theme_multi_color_unordered_ColorScale_2900_default.var,
    chart_theme_multi_color_unordered_ColorScale_3000_default.var,
    chart_theme_multi_color_unordered_ColorScale_3100_default.var,
    chart_theme_multi_color_unordered_ColorScale_3200_default.var,
    chart_theme_multi_color_unordered_ColorScale_3300_default.var,
    chart_theme_multi_color_unordered_ColorScale_3400_default.var,
    chart_theme_multi_color_unordered_ColorScale_3500_default.var
  ];
  var MultiColorUnorderedTheme = ColorTheme({
    COLOR_SCALE: COLOR_SCALE8
  });
  var MultiColorUnorderedComponentTheme = ColorComponentTheme({
    COLOR_SCALE: COLOR_SCALE8
  });

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_orange_ColorScale_100.js
  var chart_theme_orange_ColorScale_100 = {
    "name": "--pf-v5-chart-theme--orange--ColorScale--100",
    "value": "#ec7a08",
    "var": "var(--pf-v5-chart-theme--orange--ColorScale--100, #ec7a08)"
  };
  var chart_theme_orange_ColorScale_100_default = chart_theme_orange_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_orange_ColorScale_200.js
  var chart_theme_orange_ColorScale_200 = {
    "name": "--pf-v5-chart-theme--orange--ColorScale--200",
    "value": "#f4b678",
    "var": "var(--pf-v5-chart-theme--orange--ColorScale--200, #f4b678)"
  };
  var chart_theme_orange_ColorScale_200_default = chart_theme_orange_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_orange_ColorScale_300.js
  var chart_theme_orange_ColorScale_300 = {
    "name": "--pf-v5-chart-theme--orange--ColorScale--300",
    "value": "#8f4700",
    "var": "var(--pf-v5-chart-theme--orange--ColorScale--300, #8f4700)"
  };
  var chart_theme_orange_ColorScale_300_default = chart_theme_orange_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_orange_ColorScale_400.js
  var chart_theme_orange_ColorScale_400 = {
    "name": "--pf-v5-chart-theme--orange--ColorScale--400",
    "value": "#ef9234",
    "var": "var(--pf-v5-chart-theme--orange--ColorScale--400, #ef9234)"
  };
  var chart_theme_orange_ColorScale_400_default = chart_theme_orange_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_orange_ColorScale_500.js
  var chart_theme_orange_ColorScale_500 = {
    "name": "--pf-v5-chart-theme--orange--ColorScale--500",
    "value": "#c46100",
    "var": "var(--pf-v5-chart-theme--orange--ColorScale--500, #c46100)"
  };
  var chart_theme_orange_ColorScale_500_default = chart_theme_orange_ColorScale_500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/colors/orange-theme.js
  var COLOR_SCALE9 = [
    chart_theme_orange_ColorScale_100_default.var,
    chart_theme_orange_ColorScale_200_default.var,
    chart_theme_orange_ColorScale_300_default.var,
    chart_theme_orange_ColorScale_400_default.var,
    chart_theme_orange_ColorScale_500_default.var
  ];
  var OrangeColorTheme = ColorTheme({
    COLOR_SCALE: COLOR_SCALE9
  });
  var OrangeColorComponentTheme = ColorComponentTheme({
    COLOR_SCALE: COLOR_SCALE9
  });

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_purple_ColorScale_100.js
  var chart_theme_purple_ColorScale_100 = {
    "name": "--pf-v5-chart-theme--purple--ColorScale--100",
    "value": "#5752d1",
    "var": "var(--pf-v5-chart-theme--purple--ColorScale--100, #5752d1)"
  };
  var chart_theme_purple_ColorScale_100_default = chart_theme_purple_ColorScale_100;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_purple_ColorScale_200.js
  var chart_theme_purple_ColorScale_200 = {
    "name": "--pf-v5-chart-theme--purple--ColorScale--200",
    "value": "#b2b0ea",
    "var": "var(--pf-v5-chart-theme--purple--ColorScale--200, #b2b0ea)"
  };
  var chart_theme_purple_ColorScale_200_default = chart_theme_purple_ColorScale_200;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_purple_ColorScale_300.js
  var chart_theme_purple_ColorScale_300 = {
    "name": "--pf-v5-chart-theme--purple--ColorScale--300",
    "value": "#2a265f",
    "var": "var(--pf-v5-chart-theme--purple--ColorScale--300, #2a265f)"
  };
  var chart_theme_purple_ColorScale_300_default = chart_theme_purple_ColorScale_300;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_purple_ColorScale_400.js
  var chart_theme_purple_ColorScale_400 = {
    "name": "--pf-v5-chart-theme--purple--ColorScale--400",
    "value": "#8481dd",
    "var": "var(--pf-v5-chart-theme--purple--ColorScale--400, #8481dd)"
  };
  var chart_theme_purple_ColorScale_400_default = chart_theme_purple_ColorScale_400;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_theme_purple_ColorScale_500.js
  var chart_theme_purple_ColorScale_500 = {
    "name": "--pf-v5-chart-theme--purple--ColorScale--500",
    "value": "#3c3d99",
    "var": "var(--pf-v5-chart-theme--purple--ColorScale--500, #3c3d99)"
  };
  var chart_theme_purple_ColorScale_500_default = chart_theme_purple_ColorScale_500;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/themes/colors/purple-theme.js
  var COLOR_SCALE10 = [
    chart_theme_purple_ColorScale_100_default.var,
    chart_theme_purple_ColorScale_200_default.var,
    chart_theme_purple_ColorScale_300_default.var,
    chart_theme_purple_ColorScale_400_default.var,
    chart_theme_purple_ColorScale_500_default.var
  ];
  var PurpleColorTheme = ColorTheme({
    COLOR_SCALE: COLOR_SCALE10
  });
  var PurpleColorComponentTheme = ColorComponentTheme({
    COLOR_SCALE: COLOR_SCALE10
  });

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-theme.js
  var getTheme = (themeColor) => {
    const baseTheme = (0, import_cloneDeep.default)(ChartBaseTheme);
    return (0, import_merge.default)(baseTheme, getThemeColors(themeColor));
  };
  var getComponentTheme = (themeColor) => {
    const theme = (0, import_cloneDeep.default)(ChartBaseComponentTheme);
    return (0, import_merge.default)(theme, getThemeComponentColors(themeColor));
  };
  var getThemeColors = (themeColor) => {
    switch (themeColor) {
      case ChartThemeColor.blue:
        return BlueColorTheme;
      case ChartThemeColor.cyan:
        return CyanColorTheme;
      case ChartThemeColor.gold:
        return GoldColorTheme;
      case ChartThemeColor.gray:
        return GrayColorTheme;
      case ChartThemeColor.green:
        return GreenColorTheme;
      case ChartThemeColor.multi:
      case ChartThemeColor.multiOrdered:
        return MultiColorOrderedTheme;
      case ChartThemeColor.multiUnordered:
        return MultiColorUnorderedTheme;
      case ChartThemeColor.orange:
        return OrangeColorTheme;
      case ChartThemeColor.purple:
        return PurpleColorTheme;
      case ChartThemeColor.skeleton:
        return SkeletonColorTheme;
      default:
        return BlueColorTheme;
    }
  };
  var getThemeComponentColors = (themeColor) => {
    switch (themeColor) {
      case ChartThemeColor.blue:
        return BlueColorComponentTheme;
      case ChartThemeColor.cyan:
        return CyanColorComponentTheme;
      case ChartThemeColor.gold:
        return GoldColorComponentTheme;
      case ChartThemeColor.gray:
        return GrayColorComponentTheme;
      case ChartThemeColor.green:
        return GreenColorComponentTheme;
      case ChartThemeColor.multi:
      case ChartThemeColor.multiOrdered:
        return MultiColorOrderedComponentTheme;
      case ChartThemeColor.multiUnordered:
        return MultiColorUnorderedComponentTheme;
      case ChartThemeColor.orange:
        return OrangeColorComponentTheme;
      case ChartThemeColor.purple:
        return PurpleColorComponentTheme;
      case ChartThemeColor.skeleton:
        return SkeletonColorComponentTheme;
      default:
        return BlueColorComponentTheme;
    }
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-helpers.js
  var canUseDOM2 = !!(typeof window !== "undefined" && window.document && window.document.createElement);
  var getClassName = ({ className }) => {
    let cleanClassName;
    if (className) {
      cleanClassName = className.replace(/VictoryContainer/g, "").replace(/pf-v5-c-chart/g, "").replace(/pf-c-chart/g, "").replace(/\s+/g, " ").trim();
    }
    return cleanClassName && cleanClassName.length ? `pf-v5-c-chart ${cleanClassName}` : "pf-v5-c-chart";
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartContainer/ChartContainer.js
  var ChartContainer = (_a) => {
    var {
      className,
      themeColor,
      // destructure last
      theme = getTheme(themeColor)
    } = _a, rest = __rest(_a, ["className", "themeColor", "theme"]);
    const chartClassName = getClassName({ className });
    return React318.createElement(VictoryContainer, Object.assign({ className: chartClassName, theme }, rest));
  };
  ChartContainer.displayName = "ChartContainer";
  (0, import_hoist_non_react_statics.default)(ChartContainer, VictoryContainer);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartLegend/ChartLegend.js
  init_tslib_es6();
  var React322 = __toESM(require_react());
  var import_hoist_non_react_statics3 = __toESM(require_hoist_non_react_statics_cjs());

  // node_modules/victory-legend/es/victory-legend.js
  var import_react94 = __toESM(require_react());

  // node_modules/victory-legend/es/helper-methods.js
  var import_defaults23 = __toESM(require_defaults());
  var import_groupBy2 = __toESM(require_groupBy());
  var import_range2 = __toESM(require_range());
  var getColorScale2 = (props) => {
    const {
      colorScale: colorScale4,
      theme
    } = props;
    return typeof colorScale4 === "string" ? style_exports.getColorScale(colorScale4, theme) : colorScale4 || [];
  };
  var getLabelStyles = (props) => {
    const {
      data,
      style
    } = props;
    return data.map((datum, index) => {
      const baseLabelStyles4 = (0, import_defaults23.default)({}, datum.labels, style.labels);
      return helpers_exports.evaluateStyle(baseLabelStyles4, {
        datum,
        index,
        data
      });
    });
  };
  var getStyles6 = function(props, styleObject) {
    if (styleObject === void 0) {
      styleObject = {};
    }
    const style = props.style || {};
    const parentStyleProps = {
      height: "100%",
      width: "100%"
    };
    return {
      parent: (0, import_defaults23.default)(style.parent, styleObject.parent, parentStyleProps),
      data: (0, import_defaults23.default)({}, style.data, styleObject.data),
      labels: (0, import_defaults23.default)({}, style.labels, styleObject.labels),
      border: (0, import_defaults23.default)({}, style.border, styleObject.border),
      title: (0, import_defaults23.default)({}, style.title, styleObject.title)
    };
  };
  var getCalculatedValues3 = (props) => {
    const {
      orientation,
      theme
    } = props;
    const defaultStyles2 = theme && theme.legend && theme.legend.style ? theme.legend.style : {};
    const style = getStyles6(props, defaultStyles2);
    const colorScale4 = getColorScale2(props);
    const isHorizontal2 = orientation === "horizontal";
    const borderPadding = helpers_exports.getPadding(props.borderPadding);
    return Object.assign({}, props, {
      style,
      isHorizontal: isHorizontal2,
      colorScale: colorScale4,
      borderPadding
    });
  };
  var getColumn = (props, index) => {
    const {
      itemsPerRow,
      isHorizontal: isHorizontal2
    } = props;
    if (!itemsPerRow) {
      return isHorizontal2 ? index : 0;
    }
    return isHorizontal2 ? index % itemsPerRow : Math.floor(index / itemsPerRow);
  };
  var getRow = (props, index) => {
    const {
      itemsPerRow,
      isHorizontal: isHorizontal2
    } = props;
    if (!itemsPerRow) {
      return isHorizontal2 ? 0 : index;
    }
    return isHorizontal2 ? Math.floor(index / itemsPerRow) : index % itemsPerRow;
  };
  var groupData = (props) => {
    const {
      data
    } = props;
    const style = props.style && props.style.data || {};
    const labelStyles = getLabelStyles(props);
    return data.map((datum, index) => {
      const symbol = datum.symbol || {};
      const {
        fontSize: fontSize4
      } = labelStyles[index];
      const size = symbol.size || style.size || fontSize4 / 2.5;
      const symbolSpacer = props.symbolSpacer || Math.max(size, fontSize4);
      return {
        ...datum,
        size,
        symbolSpacer,
        fontSize: fontSize4,
        textSize: textsize_exports.approximateTextSize(datum.name, labelStyles[index]),
        column: getColumn(props, index),
        row: getRow(props, index)
      };
    });
  };
  var getColumnWidths = (props, data) => {
    const gutter = props.gutter || {};
    const gutterWidth = typeof gutter === "object" ? (gutter.left || 0) + (gutter.right || 0) : gutter || 0;
    const dataByColumn = (0, import_groupBy2.default)(data, "column");
    const columns = Object.keys(dataByColumn);
    return columns.reduce((memo4, curr, index) => {
      const lengths = dataByColumn[curr].map((d) => {
        return d.textSize.width + d.size + d.symbolSpacer + gutterWidth;
      });
      memo4[index] = Math.max(...lengths);
      return memo4;
    }, []);
  };
  var getRowHeights = (props, data) => {
    const gutter = props.rowGutter || {};
    const gutterHeight = typeof gutter === "object" ? (gutter.top || 0) + (gutter.bottom || 0) : gutter || 0;
    const dataByRow = (0, import_groupBy2.default)(data, "row");
    return Object.keys(dataByRow).reduce((memo4, curr, index) => {
      const rows = dataByRow[curr];
      const lengths = rows.map((d) => {
        return d.textSize.height + d.symbolSpacer + gutterHeight;
      });
      memo4[index] = Math.max(...lengths);
      return memo4;
    }, []);
  };
  var getTitleDimensions = (props) => {
    const style = props.style && props.style.title || {};
    const textSize = textsize_exports.approximateTextSize(props.title, style);
    const padding3 = style.padding || 0;
    return {
      height: textSize.height + 2 * padding3 || 0,
      width: textSize.width + 2 * padding3 || 0
    };
  };
  var getOffset3 = (datum, rowHeights, columnWidths) => {
    const {
      column,
      row
    } = datum;
    return {
      x: (0, import_range2.default)(column).reduce((memo4, curr) => memo4 + columnWidths[curr], 0),
      y: (0, import_range2.default)(row).reduce((memo4, curr) => memo4 + rowHeights[curr], 0)
    };
  };
  var getAnchors2 = (titleOrientation, centerTitle) => {
    const standardAnchors = {
      textAnchor: titleOrientation === "right" ? "end" : "start",
      verticalAnchor: titleOrientation === "bottom" ? "end" : "start"
    };
    if (centerTitle) {
      const horizontal = titleOrientation === "top" || titleOrientation === "bottom";
      return {
        textAnchor: horizontal ? "middle" : standardAnchors.textAnchor,
        verticalAnchor: horizontal ? standardAnchors.verticalAnchor : "middle"
      };
    }
    return standardAnchors;
  };
  var getTitleStyle = (props) => {
    const {
      titleOrientation,
      centerTitle,
      titleComponent
    } = props;
    const baseStyle = props.style && props.style.title || {};
    const componentStyle = titleComponent.props && titleComponent.props.style || {};
    const anchors = getAnchors2(titleOrientation, centerTitle);
    return Array.isArray(componentStyle) ? componentStyle.map((obj) => (0, import_defaults23.default)({}, obj, baseStyle, anchors)) : (0, import_defaults23.default)({}, componentStyle, baseStyle, anchors);
  };
  var getTitleProps = (props, borderProps) => {
    const {
      title,
      titleOrientation,
      centerTitle,
      borderPadding
    } = props;
    const {
      height,
      width
    } = borderProps;
    const style = getTitleStyle(props);
    const padding3 = Array.isArray(style) ? style[0].padding : style.padding;
    const horizontal = titleOrientation === "top" || titleOrientation === "bottom";
    const xOrientation = titleOrientation === "bottom" ? "bottom" : "top";
    const yOrientation = titleOrientation === "right" ? "right" : "left";
    const standardPadding = {
      x: centerTitle ? width / 2 : borderPadding[xOrientation] + (padding3 || 0),
      y: centerTitle ? height / 2 : borderPadding[yOrientation] + (padding3 || 0)
    };
    const getPadding3 = () => {
      return borderPadding[titleOrientation] + (padding3 || 0);
    };
    const xOffset = horizontal ? standardPadding.x : getPadding3();
    const yOffset = horizontal ? getPadding3() : standardPadding.y;
    return {
      x: titleOrientation === "right" ? props.x + width - xOffset : props.x + xOffset,
      y: titleOrientation === "bottom" ? props.y + height - yOffset : props.y + yOffset,
      style,
      text: title
    };
  };
  var getBorderProps = (props, contentHeight, contentWidth) => {
    const {
      x: x2,
      y: y2,
      borderPadding,
      style
    } = props;
    const height = (contentHeight || 0) + borderPadding.top + borderPadding.bottom;
    const width = (contentWidth || 0) + borderPadding.left + borderPadding.right;
    return {
      x: x2,
      y: y2,
      height,
      width,
      style: Object.assign({
        fill: "none"
      }, style.border)
    };
  };
  var getDimensions = (initialProps, fallbackProps12) => {
    const modifiedProps = helpers_exports.modifyProps(initialProps, fallbackProps12, "legend");
    const props = Object.assign({}, modifiedProps, getCalculatedValues3(modifiedProps));
    const {
      title,
      titleOrientation
    } = props;
    const groupedData = groupData(props);
    const columnWidths = getColumnWidths(props, groupedData);
    const rowHeights = getRowHeights(props, groupedData);
    const titleDimensions = title ? getTitleDimensions(props) : {
      height: 0,
      width: 0
    };
    return {
      height: titleOrientation === "left" || titleOrientation === "right" ? Math.max(sum2(rowHeights), titleDimensions.height) : sum2(rowHeights) + titleDimensions.height,
      width: titleOrientation === "left" || titleOrientation === "right" ? sum2(columnWidths) + titleDimensions.width : Math.max(sum2(columnWidths), titleDimensions.width)
    };
  };
  var getBaseProps3 = (initialProps, fallbackProps12) => {
    const modifiedProps = helpers_exports.modifyProps(initialProps, fallbackProps12, "legend");
    const props = Object.assign({}, modifiedProps, getCalculatedValues3(modifiedProps));
    const {
      data,
      standalone,
      theme,
      padding: padding3,
      style,
      colorScale: colorScale4,
      gutter,
      rowGutter,
      borderPadding,
      title,
      titleOrientation,
      name: name2,
      x: x2 = 0,
      y: y2 = 0
    } = props;
    const groupedData = groupData(props);
    const columnWidths = getColumnWidths(props, groupedData);
    const rowHeights = getRowHeights(props, groupedData);
    const labelStyles = getLabelStyles(props);
    const titleDimensions = title ? getTitleDimensions(props) : {
      height: 0,
      width: 0
    };
    const titleOffset = {
      x: titleOrientation === "left" ? titleDimensions.width : 0,
      y: titleOrientation === "top" ? titleDimensions.height : 0
    };
    const gutterOffset = {
      x: gutter && typeof gutter === "object" ? gutter.left || 0 : 0,
      y: rowGutter && typeof rowGutter === "object" ? rowGutter.top || 0 : 0
    };
    const {
      height,
      width
    } = getDimensions(props, fallbackProps12);
    const borderProps = getBorderProps(props, height, width);
    const titleProps = getTitleProps(props, borderProps);
    const initialChildProps = {
      parent: {
        data,
        standalone,
        theme,
        padding: padding3,
        name: name2,
        height: props.height,
        width: props.width,
        style: style.parent
      },
      all: {
        border: borderProps,
        title: titleProps
      }
    };
    return groupedData.reduce((childProps, datum, i) => {
      const color2 = colorScale4[i % colorScale4.length];
      const dataStyle = (0, import_defaults23.default)({}, datum.symbol, style.data, {
        fill: color2
      });
      const eventKey = !helpers_exports.isNil(datum.eventKey) ? datum.eventKey : i;
      const offset2 = getOffset3(datum, rowHeights, columnWidths);
      const originY = y2 + borderPadding.top + datum.symbolSpacer;
      const originX = x2 + borderPadding.left + datum.symbolSpacer;
      const dataProps = {
        index: i,
        data,
        datum,
        symbol: dataStyle.type || dataStyle.symbol || "circle",
        size: datum.size,
        style: dataStyle,
        y: originY + offset2.y + titleOffset.y + gutterOffset.y,
        x: originX + offset2.x + titleOffset.x + gutterOffset.x
      };
      const labelProps = {
        datum,
        data,
        text: datum.name,
        style: labelStyles[i],
        y: dataProps.y,
        x: dataProps.x + datum.symbolSpacer + datum.size / 2
      };
      childProps[eventKey] = {
        data: dataProps,
        labels: labelProps
      };
      return childProps;
    }, initialChildProps);
  };
  function sum2(array) {
    if (array && array.length) {
      let value = 0;
      for (let i = 0; i < array.length; i++) {
        value += array[i];
      }
      return value;
    }
    return 0;
  }

  // node_modules/victory-legend/es/victory-legend.js
  var fallbackProps5 = {
    orientation: "vertical",
    titleOrientation: "top",
    width: 450,
    height: 300,
    x: 0,
    y: 0
  };
  var defaultLegendData = [{
    name: "Series 1"
  }, {
    name: "Series 2"
  }];
  var VictoryLegendBase = class extends import_react94.default.Component {
    static getBaseProps(props) {
      return getBaseProps3(props, fallbackProps5);
    }
    static getDimensions(props) {
      return getDimensions(props, fallbackProps5);
    }
    renderChildren(props) {
      const {
        dataComponent,
        labelComponent,
        title
      } = props;
      const children = [];
      if (props.borderComponent) {
        const borderProps = this.getComponentProps(props.borderComponent, "border", "all");
        const borderComponent = /* @__PURE__ */ import_react94.default.cloneElement(props.borderComponent, borderProps);
        children.push(borderComponent);
      }
      if (dataComponent) {
        const dataComponents = this.dataKeys.map((_dataKey, index) => {
          if (_dataKey === "all") {
            return void 0;
          }
          const dataProps = this.getComponentProps(dataComponent, "data", index);
          return /* @__PURE__ */ import_react94.default.cloneElement(dataComponent, dataProps);
        }).filter((comp) => comp !== void 0);
        children.push(...dataComponents);
      }
      if (title && props.titleComponent) {
        const titleProps = this.getComponentProps(title, "title", "all");
        const titleComponent = /* @__PURE__ */ import_react94.default.cloneElement(props.titleComponent, titleProps);
        children.push(titleComponent);
      }
      if (labelComponent) {
        const labelComponents = this.dataKeys.map((_dataKey, index) => {
          if (_dataKey === "all") {
            return void 0;
          }
          const labelProps = this.getComponentProps(labelComponent, "labels", index);
          if (labelProps.text !== void 0 && labelProps.text !== null) {
            return /* @__PURE__ */ import_react94.default.cloneElement(labelComponent, labelProps);
          }
          return void 0;
        }).filter((comp) => comp !== void 0);
        children.push(...labelComponents);
      }
      return children;
    }
    render() {
      const {
        role
      } = this.constructor;
      const props = helpers_exports.modifyProps(this.props, fallbackProps5, role);
      const children = this.renderChildren(props);
      return props.standalone ? this.renderContainer(props.containerComponent, children) : /* @__PURE__ */ import_react94.default.cloneElement(props.groupComponent, {}, children);
    }
  };
  __publicField(VictoryLegendBase, "displayName", "VictoryLegend");
  __publicField(VictoryLegendBase, "role", "legend");
  __publicField(VictoryLegendBase, "defaultProps", {
    borderComponent: /* @__PURE__ */ import_react94.default.createElement(Border, null),
    data: defaultLegendData,
    containerComponent: /* @__PURE__ */ import_react94.default.createElement(VictoryContainer, null),
    dataComponent: /* @__PURE__ */ import_react94.default.createElement(Point, null),
    groupComponent: /* @__PURE__ */ import_react94.default.createElement("g", null),
    labelComponent: /* @__PURE__ */ import_react94.default.createElement(VictoryLabel, null),
    standalone: true,
    theme: VictoryTheme.grayscale,
    titleComponent: /* @__PURE__ */ import_react94.default.createElement(VictoryLabel, null)
  });
  __publicField(VictoryLegendBase, "expectedComponents", ["borderComponent", "containerComponent", "dataComponent", "groupComponent", "labelComponent", "titleComponent"]);
  var VictoryLegend = addEvents(VictoryLegendBase);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartLabel/ChartLabel.js
  init_tslib_es6();
  var React320 = __toESM(require_react());
  var import_hoist_non_react_statics2 = __toESM(require_hoist_non_react_statics_cjs());
  var import_defaults24 = __toESM(require_defaults());

  // node_modules/@patternfly/react-tokens/dist/esm/chart_global_label_Margin.js
  var chart_global_label_Margin = {
    "name": "--pf-v5-chart-global--label--Margin",
    "value": 8,
    "var": "var(--pf-v5-chart-global--label--Margin, 8)"
  };
  var chart_global_label_Margin_default = chart_global_label_Margin;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_legend_position.js
  var chart_legend_position = {
    "name": "--pf-v5-chart-legend--position",
    "value": "right",
    "var": "var(--pf-v5-chart-legend--position, right)"
  };
  var chart_legend_position_default = chart_legend_position;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/styles/common-styles.js
  var TYPOGRAPHY_FONT_FAMILY2 = chart_global_FontFamily_default.var;
  var TYPOGRAPHY_LETTER_SPACING2 = chart_global_letter_spacing_default.var;
  var TYPOGRAPHY_FONT_SIZE2 = chart_global_FontSize_sm_default.value;
  var CommonStyles = {
    label: {
      fontFamily: TYPOGRAPHY_FONT_FAMILY2,
      fontSize: TYPOGRAPHY_FONT_SIZE2,
      letterSpacing: TYPOGRAPHY_LETTER_SPACING2,
      margin: chart_global_label_Margin_default.value,
      fill: chart_global_label_Fill_default.var
    },
    legend: {
      margin: chart_legend_Margin_default.value,
      position: chart_legend_position_default.value
    }
  };

  // node_modules/@patternfly/react-tokens/dist/esm/chart_scatter_active_size.js
  var chart_scatter_active_size = {
    "name": "--pf-v5-chart-scatter--active--size",
    "value": 5,
    "var": "var(--pf-v5-chart-scatter--active--size, 5)"
  };
  var chart_scatter_active_size_default = chart_scatter_active_size;

  // node_modules/@patternfly/react-tokens/dist/esm/chart_scatter_size.js
  var chart_scatter_size = {
    "name": "--pf-v5-chart-scatter--size",
    "value": 3,
    "var": "var(--pf-v5-chart-scatter--size, 3)"
  };
  var chart_scatter_size_default = chart_scatter_size;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/styles/scatter-styles.js
  var ScatterStyles = {
    activeSize: chart_scatter_active_size_default.value,
    size: chart_scatter_size_default.value
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTheme/ChartStyles.js
  var ChartCommonStyles = CommonStyles;
  var ChartScatterStyles = ScatterStyles;

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartLabel/ChartLabel.js
  var ChartLabel = (_a) => {
    var { style, textAnchor } = _a, rest = __rest(_a, ["style", "textAnchor"]);
    const applyDefaultStyle = (customStyle) => (0, import_defaults24.default)(Object.assign(Object.assign({}, customStyle), {
      textAnchor
      // textAnchor prop must override given theme styles
    }), {
      fill: ChartCommonStyles.label.fill,
      fontFamily: ChartCommonStyles.label.fontFamily,
      fontSize: ChartCommonStyles.label.fontSize,
      letterSpacing: ChartCommonStyles.label.letterSpacing
    });
    const newStyle = Array.isArray(style) ? style.map(applyDefaultStyle) : applyDefaultStyle(style);
    return React320.createElement(VictoryLabel, Object.assign({ style: newStyle, textAnchor }, rest));
  };
  ChartLabel.displayName = "ChartLabel";
  (0, import_hoist_non_react_statics2.default)(ChartLabel, VictoryLabel);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartPoint/ChartPoint.js
  init_tslib_es6();
  var React321 = __toESM(require_react());

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartPoint/path-helpers.js
  var PathHelpers = {
    circle: (x2, y2, size) => `M ${x2}, ${y2}
      m ${-size}, 0
      a ${size}, ${size} 0 1,0 ${size * 2},0
      a ${size}, ${size} 0 1,0 ${-size * 2},0`,
    dash: (x2, y2, size) => {
      const baseSize = 1.1 * size;
      const lineHeight = baseSize - baseSize * 0.3;
      const x0 = x2 - baseSize;
      const y1 = y2 + lineHeight / 2;
      const distance = (x2 + baseSize - x0) * 0.3;
      const padding3 = distance / 3;
      return `M ${x0}, ${y1}
      h${distance}
      v-${lineHeight}
      h-${distance}
      z
      M ${x0 + distance + padding3}, ${y1}
      h${distance}
      v-${lineHeight}
      h-${distance}
      z
      M ${x0 + distance * 2 + padding3 * 2}, ${y1}
      h${distance}
      v-${lineHeight}
      h-${distance}
      z`;
    },
    diamond: (x2, y2, size) => {
      const baseSize = 0.87 * size;
      const length = Math.sqrt(2 * (baseSize * baseSize));
      return `M ${x2}, ${y2 + length}
      l ${length}, -${length}
      l -${length}, -${length}
      l -${length}, ${length}
      l ${length}, ${length}
      z`;
    },
    // The eye slash symbol is used to hide / show each data series individually
    // See https://github.com/patternfly/patternfly-next/issues/2352
    eyeSlash: (x2, y2, size) => {
      const baseSize = 0.87 * size;
      const x0 = x2 - baseSize;
      const y1 = y2 - size * 1.25;
      const data = ".013 .013 0 0 2.179 2.219c.7-.204 1.418-.307 2.152-.307 2.859 0 5.464 1.551 7.814 4.654.243 .321.268 .753.073 1.097l-.073.111-.236.305c-.632.801-1.282 1.491-1.951 2.071l1.773 1.806c.382.389 .382 1.012 0 1.401l-.058.059c-.387.394-1.02.4-1.414.013l-.013-.013-11.732-11.956c-.382-.389-.382-1.012 0-1.401l.058-.059c.387-.394 1.02-.4 1.414-.013zm-.674 3.71 1.407 1.436c-.329.604-.516 1.298-.516 2.038 0 2.323 1.848 4.206 4.127 4.206.726 0 1.408-.191 2-.526l.966.984c-.956.396-1.945.593-2.966.593-2.859 0-5.464-1.551-7.814-4.654-.243-.321-.268-.753-.073-1.097l.073-.111.236-.305c.823-1.042 1.676-1.897 2.56-2.565zm2.177 2.22 4.072 4.149c-.377.167-.793.259-1.23.259-1.71 0-3.096-1.412-3.096-3.155 0-.445.091-.869.254-1.253zm2.842-2.953c-.43 0-.845.067-1.234.191l.865.882c.121-.015.244-.022.369-.022 1.71 0 3.096 1.412 3.096 3.155 0 .127-.007.252-.022.375l.866.882c.122-.397.187-.819.187-1.257 0-2.323-1.848-4.206-4.127-4.206z";
      return `m${x0}, ${y1} ${data}`;
    },
    minus: (x2, y2, size) => {
      const baseSize = 1.1 * size;
      const lineHeight = baseSize - baseSize * 0.3;
      const x0 = x2 - baseSize;
      const y1 = y2 + lineHeight / 2;
      const distance = x2 + baseSize - x0;
      return `M ${x0}, ${y1}
      h${distance}
      v-${lineHeight}
      h-${distance}
      z`;
    },
    plus: (x2, y2, size) => {
      const baseSize = 1.1 * size;
      const distance = baseSize / 1.5;
      return `
      M ${x2 - distance / 2}, ${y2 + baseSize}
      v-${distance}
      h-${distance}
      v-${distance}
      h${distance}
      v-${distance}
      h${distance}
      v${distance}
      h${distance}
      v${distance}
      h-${distance}
      v${distance}
      z`;
    },
    star: (x2, y2, size) => {
      const baseSize = 1.35 * size;
      const angle = Math.PI / 5;
      const starCoords = [...Array(10).keys()].map((index) => {
        const length = index % 2 === 0 ? baseSize : baseSize / 2;
        return `${length * Math.sin(angle * (index + 1)) + x2},
        ${length * Math.cos(angle * (index + 1)) + y2}`;
      });
      return `M ${starCoords.join("L")} z`;
    },
    square: (x2, y2, size) => {
      const baseSize = 0.87 * size;
      const x0 = x2 - baseSize;
      const y1 = y2 + baseSize;
      const distance = x2 + baseSize - x0;
      return `M ${x0}, ${y1}
      h${distance}
      v-${distance}
      h-${distance}
      z`;
    },
    threshold: (x2, y2, size) => {
      const baseSize = 1.1 * size;
      const lineHeight = baseSize - baseSize * 0.3;
      const x0 = x2 - baseSize;
      const y1 = y2 + lineHeight / 2;
      const distance = (x2 + baseSize - x0) * 0.5;
      const padding3 = distance / 3;
      return `M ${x0}, ${y1}
      h${distance}
      v-${lineHeight}
      h-${distance}
      z
      M ${x0 + distance + padding3}, ${y1}
      h${distance}
      v-${lineHeight}
      h-${distance}
      z`;
    },
    triangleDown: (x2, y2, size) => {
      const height = size / 2 * Math.sqrt(3);
      const x0 = x2 - size;
      const x1 = x2 + size;
      const y0 = y2 - size;
      const y1 = y2 + height;
      return `M ${x0}, ${y0}
      L ${x1}, ${y0}
      L ${x2}, ${y1}
      z`;
    },
    triangleLeft: (x2, y2, size) => {
      const height = size / 2 * Math.sqrt(3);
      const x0 = x2 - height;
      const x1 = x2 + size;
      const y0 = y2 - size;
      const y1 = y2 + size;
      return `M ${x1}, ${y0}
      L ${x1}, ${y1}
      L ${x0}, ${y2}
      z`;
    },
    triangleRight: (x2, y2, size) => {
      const height = size / 2 * Math.sqrt(3);
      const x0 = x2 - size;
      const x1 = x2 + height;
      const y0 = y2 - size;
      const y1 = y2 + size;
      return `M ${x0}, ${y0}
      L ${x0}, ${y1}
      L ${x1}, ${y2}
      z`;
    },
    triangleUp: (x2, y2, size) => {
      const height = size / 2 * Math.sqrt(3);
      const x0 = x2 - size;
      const x1 = x2 + size;
      const y0 = y2 - height;
      const y1 = y2 + size;
      return `M ${x0}, ${y1}
      L ${x1}, ${y1}
      L ${x2}, ${y0}
      z`;
    }
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartPoint/ChartPoint.js
  var getPath2 = (props) => {
    const { x: x2, y: y2 } = props;
    const size = helpers_exports.evaluateProp(props.size, props);
    if (props.getPath) {
      return props.getPath(x2, y2, size);
    }
    const pathFunctions = {
      circle: PathHelpers.circle,
      square: PathHelpers.square,
      diamond: PathHelpers.diamond,
      eyeSlash: PathHelpers.eyeSlash,
      triangleDown: PathHelpers.triangleDown,
      triangleLeft: PathHelpers.triangleLeft,
      triangleRight: PathHelpers.triangleRight,
      triangleUp: PathHelpers.triangleUp,
      plus: PathHelpers.plus,
      minus: PathHelpers.minus,
      star: PathHelpers.star,
      dash: PathHelpers.dash,
      threshold: PathHelpers.threshold
    };
    const symbol = helpers_exports.evaluateProp(props.symbol, props);
    const key = symbol;
    const symbolFunction = typeof pathFunctions[key] === "function" ? pathFunctions[key] : pathFunctions.square;
    return symbolFunction(x2, y2, size);
  };
  var ChartPoint = (_a) => {
    var { active, className, clipPath, datum, desc, events, pathComponent = React321.createElement(Path2, null), role = "presentation", shapeRendering = "auto", tabIndex, transform } = _a, rest = __rest(_a, ["active", "className", "clipPath", "datum", "desc", "events", "pathComponent", "role", "shapeRendering", "tabIndex", "transform"]);
    const props = Object.assign({
      active,
      className,
      clipPath,
      datum,
      desc,
      events,
      role,
      shapeRendering,
      tabIndex,
      transform
    }, rest);
    return React321.cloneElement(pathComponent, Object.assign(Object.assign({
      className,
      clipPath,
      d: getPath2(props),
      desc: helpers_exports.evaluateProp(desc, props)
    }, events), {
      role,
      shapeRendering,
      style: helpers_exports.evaluateStyle(rest.style, props),
      tabIndex: helpers_exports.evaluateProp(tabIndex, props),
      transform
    }));
  };
  ChartPoint.displayName = "ChartPoint";

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartLegend/ChartLegend.js
  var ChartLegend = (_a) => {
    var {
      colorScale: colorScale4,
      containerComponent = React322.createElement(ChartContainer, null),
      dataComponent = React322.createElement(ChartPoint, null),
      labelComponent = React322.createElement(ChartLabel, null),
      name: name2,
      patternScale,
      responsive = true,
      style,
      themeColor,
      titleComponent = React322.createElement(ChartLabel, null),
      // destructure last
      theme = getTheme(themeColor)
    } = _a, rest = __rest(_a, ["colorScale", "containerComponent", "dataComponent", "labelComponent", "name", "patternScale", "responsive", "style", "themeColor", "titleComponent", "theme"]);
    const componentTheme = getComponentTheme(themeColor);
    const getDefaultStyle = () => {
      if (!patternScale) {
        return style;
      }
      const _style = style ? Object.assign({}, style) : {};
      _style.data = Object.assign({ fill: ({ index }) => {
        const themeColor2 = theme && theme.legend && theme.legend.colorScale ? theme.legend.colorScale[index % theme.legend.colorScale.length] : void 0;
        const color2 = colorScale4 ? colorScale4[index % colorScale4.length] : themeColor2;
        const pattern = patternScale[index % patternScale.length];
        return pattern ? pattern : color2;
      } }, _style.data);
      return _style;
    };
    const container = React322.cloneElement(containerComponent, Object.assign({
      responsive,
      theme
    }, containerComponent.props));
    const getLabelComponent = () => React322.cloneElement(labelComponent, Object.assign(
      Object.assign(Object.assign({}, name2 && { id: (props) => `${name2}-${labelComponent.type.displayName}-${props.index}` }), labelComponent.props),
      (componentTheme === null || componentTheme === void 0 ? void 0 : componentTheme.label) && componentTheme.label
      // override backgroundStyle
    ));
    const getTitleComponent = () => React322.cloneElement(titleComponent, Object.assign(
      Object.assign(Object.assign({}, name2 && { id: () => `${name2}-${titleComponent.type.displayName}` }), titleComponent.props),
      (componentTheme === null || componentTheme === void 0 ? void 0 : componentTheme.label) && componentTheme.label
      // override backgroundStyle
    ));
    return React322.createElement(VictoryLegend, Object.assign({ colorScale: colorScale4, containerComponent: container, dataComponent, labelComponent: getLabelComponent(), name: name2, style: getDefaultStyle(), theme, titleComponent: getTitleComponent() }, rest));
  };
  ChartLegend.displayName = "ChartLegend";
  (0, import_hoist_non_react_statics3.default)(ChartLegend, VictoryLegend, { getBaseProps: true });
  ChartLegend.getBaseProps = (props) => {
    const theme = getTheme(null);
    return VictoryLegend.getBaseProps(Object.assign({ titleComponent: React322.createElement(ChartLabel, null) }, props), {
      height: theme.chart.height,
      orientation: theme.legend.orientation,
      titleOrientation: theme.legend.titleOrientation,
      x: 0,
      y: 0,
      width: theme.chart.width
    });
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-origin.js
  var getPieOrigin = ({ height, padding: padding3, width }) => {
    const { top: top2, bottom: bottom2, left: left2, right: right2 } = helpers_exports.getPadding({ padding: padding3 });
    const radius = helpers_exports.getRadius({ height, width, padding: padding3 });
    const offsetX = (width - radius * 2 - left2 - right2) / 2;
    const offsetY = (height - radius * 2 - top2 - bottom2) / 2;
    return {
      x: radius + left2 + offsetX,
      y: radius + top2 + offsetY
    };
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-label.js
  var getLabelTextSize = ({ text, theme }) => {
    const style = theme.legend.style.labels;
    return textsize_exports.approximateTextSize(text, Object.assign({}, style));
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-legend.js
  init_tslib_es6();
  var import_defaults25 = __toESM(require_defaults());
  var React323 = __toESM(require_react());
  var getLegendMaxTextWidth = (legendData, theme) => {
    let legendXOffset = 0;
    legendData.map((data) => {
      const labelWidth = getLabelTextSize({ text: data.name, theme }).width;
      if (labelWidth > legendXOffset) {
        legendXOffset = labelWidth;
      }
    });
    return legendXOffset;
  };
  var getComputedLegend = ({
    allowWrap = true,
    chartType = "chart",
    colorScale: colorScale4,
    dx = 0,
    dy = 0,
    height,
    legendComponent,
    padding: padding3,
    patternScale,
    position = ChartCommonStyles.legend.position,
    theme,
    themeColor,
    width,
    // destructure last
    orientation = theme.legend.orientation
  }) => {
    const legendItemsProps = legendComponent.props ? legendComponent.props : {};
    const legendItemsPerRow = allowWrap ? getLegendItemsPerRow({
      dx,
      height,
      legendData: legendItemsProps.data,
      legendOrientation: legendItemsProps.legendOrientation ? legendItemsProps.legendOrientation : orientation,
      legendPosition: position,
      legendProps: legendItemsProps,
      padding: padding3,
      theme,
      width
    }) : void 0;
    const legendPositionProps = (0, import_defaults25.default)({}, legendComponent.props, {
      itemsPerRow: legendItemsPerRow
    });
    const legendX = getLegendX({
      chartType,
      dx,
      height,
      legendData: legendPositionProps.data,
      legendOrientation: legendPositionProps.legendOrientation ? legendPositionProps.legendOrientation : orientation,
      legendPosition: position,
      legendProps: legendPositionProps,
      padding: padding3,
      theme,
      width
    });
    const legendY = getLegendY({
      chartType,
      dy,
      height,
      legendData: legendPositionProps.data,
      legendOrientation: legendPositionProps.legendOrientation ? legendPositionProps.legendOrientation : orientation,
      legendProps: legendPositionProps,
      legendPosition: position,
      padding: padding3,
      theme,
      width
    });
    const legendProps = (0, import_defaults25.default)({}, legendComponent.props, {
      colorScale: colorScale4,
      itemsPerRow: legendItemsPerRow,
      orientation,
      patternScale,
      standalone: false,
      theme,
      themeColor,
      x: legendX > 0 ? legendX : 0,
      y: legendY > 0 ? legendY : 0
    });
    return React323.cloneElement(legendComponent, legendProps);
  };
  var getLegendDimensions = ({ legendData, legendOrientation, legendProps, theme }) => {
    if (legendData || legendProps.data) {
      return VictoryLegend.getDimensions(Object.assign(
        { data: legendData, orientation: legendOrientation, theme },
        legendProps
        // override above
      ));
    }
    return {};
  };
  var doesLegendFit = ({ dx = 0, height, legendPosition, legendData, legendOrientation, legendProps, padding: padding3, theme, width }) => {
    const { left: left2, right: right2 } = helpers_exports.getPadding({ padding: padding3 });
    const chartSize = {
      height,
      // Fixed size
      width: width - left2 - right2
    };
    const legendDimensions = getLegendDimensions({
      legendData,
      legendOrientation,
      legendProps,
      theme
    });
    let occupiedWidth = 0;
    switch (legendPosition) {
      case "bottom-left":
        occupiedWidth = left2 + dx;
        break;
      case "right":
        occupiedWidth = chartSize.width + ChartCommonStyles.legend.margin + left2 + dx;
        break;
      default:
        occupiedWidth = dx;
        break;
    }
    return width - occupiedWidth > legendDimensions.width;
  };
  var getLegendItemsPerRow = ({ dx, height, legendPosition, legendData, legendOrientation, legendProps, padding: padding3, theme, width }) => {
    let itemsPerRow = legendData ? legendData.length : 0;
    for (let i = itemsPerRow; i > 0; i--) {
      const fits = doesLegendFit({
        dx,
        height,
        legendPosition,
        legendData,
        legendOrientation,
        legendProps: Object.assign(Object.assign({}, legendProps), { itemsPerRow: i }),
        padding: padding3,
        theme,
        width
      });
      if (fits) {
        itemsPerRow = i;
        break;
      }
    }
    return itemsPerRow;
  };
  var getLegendItemsExtraHeight = ({ legendData, legendOrientation, legendProps, theme }) => {
    const legendDimensions = getLegendDimensions({
      legendData,
      legendOrientation,
      legendProps,
      theme
    });
    const legendDimensionsNoWrap = getLegendDimensions({
      legendData,
      legendOrientation,
      legendProps: Object.assign(Object.assign({}, legendProps), { itemsPerRow: void 0 }),
      theme
    });
    return Math.abs(legendDimensions.height - legendDimensionsNoWrap.height);
  };
  var getLegendX = (_a) => {
    var { chartType } = _a, rest = __rest(_a, ["chartType"]);
    return chartType === "pie" ? getPieLegendX(rest) : getChartLegendX(rest);
  };
  var getLegendY = (_a) => {
    var { chartType } = _a, rest = __rest(_a, ["chartType"]);
    switch (chartType) {
      case "pie":
        return getPieLegendY(rest);
      case "bullet":
        return getBulletLegendY(rest);
      default:
        return getChartLegendY(rest);
    }
  };
  var getBulletLegendY = ({ dy = 0, height, legendPosition, legendData, legendOrientation, legendProps, padding: padding3, theme, width }) => {
    const { left: left2, right: right2 } = helpers_exports.getPadding({ padding: padding3 });
    const chartSize = {
      height,
      // Fixed size
      width: width - left2 - right2
    };
    switch (legendPosition) {
      case "bottom":
      case "bottom-left":
        return chartSize.height + ChartCommonStyles.legend.margin + dy;
      case "right": {
        const legendDimensions = getLegendDimensions({
          legendData,
          legendOrientation,
          legendProps,
          theme
        });
        const legendPadding = (legendDataArr) => legendDataArr && legendDataArr.length > 0 ? 17 : 0;
        return (chartSize.height - legendDimensions.height) / 2 + legendPadding(legendData);
      }
      default:
        return dy;
    }
  };
  var getChartLegendX = ({ dx = 0, height, legendData, legendOrientation, legendPosition, legendProps, padding: padding3, theme, width }) => {
    const { top: top2, bottom: bottom2, left: left2, right: right2 } = helpers_exports.getPadding({ padding: padding3 });
    const chartSize = {
      height: Math.abs(height - (bottom2 + top2)),
      width: Math.abs(width - (left2 + right2))
    };
    const legendDimensions = getLegendDimensions({
      legendData,
      legendOrientation,
      legendProps,
      theme
    });
    switch (legendPosition) {
      case "bottom":
        return width > legendDimensions.width ? Math.round((width - legendDimensions.width) / 2) + dx : dx;
      case "bottom-left":
        return left2 + dx;
      case "right":
        return chartSize.width + ChartCommonStyles.legend.margin + left2 + dx;
      default:
        return dx;
    }
  };
  var getChartLegendY = ({ dy = 0, height, legendPosition, legendData, legendOrientation, legendProps, padding: padding3, theme, width }) => {
    const { top: top2, bottom: bottom2, left: left2, right: right2 } = helpers_exports.getPadding({ padding: padding3 });
    const chartSize = {
      height: Math.abs(height - (bottom2 + top2)),
      width: Math.abs(width - (left2 + right2))
    };
    switch (legendPosition) {
      case "bottom":
      case "bottom-left":
        return chartSize.height + ChartCommonStyles.legend.margin * 2 + top2 + dy;
      case "right": {
        const legendDimensions = getLegendDimensions({
          legendData,
          legendOrientation,
          legendProps,
          theme
        });
        const originX = chartSize.height / 2 + top2;
        const legendPadding = (legendDataArr) => legendDataArr && legendDataArr.length > 0 ? 2 : 0;
        return originX - legendDimensions.height / 2 + legendPadding(legendData);
      }
      default:
        return dy;
    }
  };
  var getPieLegendX = ({ dx = 0, height, legendData, legendOrientation, legendPosition, legendProps, padding: padding3, theme, width }) => {
    const origin = getPieOrigin({ height, padding: padding3, width });
    const radius = helpers_exports.getRadius({ height, width, padding: padding3 });
    const legendDimensions = getLegendDimensions({
      legendData,
      legendOrientation,
      legendProps,
      theme
    });
    switch (legendPosition) {
      case "bottom":
        return width > legendDimensions.width ? Math.round((width - legendDimensions.width) / 2) + dx : dx;
      case "right":
        return origin.x + ChartCommonStyles.label.margin + dx + radius;
      default:
        return dx;
    }
  };
  var getPieLegendY = ({ dy = 0, height, legendPosition, legendData, legendOrientation, legendProps, padding: padding3, theme, width }) => {
    const origin = getPieOrigin({ height, padding: padding3, width });
    const radius = helpers_exports.getRadius({ height, width, padding: padding3 });
    switch (legendPosition) {
      case "bottom":
        return origin.y + ChartCommonStyles.legend.margin + radius + dy;
      case "right": {
        const legendDimensions = getLegendDimensions({
          legendData,
          legendOrientation,
          legendProps,
          theme
        });
        const legendPadding = (legendDataArr) => legendDataArr && legendDataArr.length > 0 ? 2 : 0;
        return origin.y - legendDimensions.height / 2 + legendPadding(legendData);
      }
      default:
        return dy;
    }
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-padding.js
  var getPaddingForSide = (side, padding3, fallback) => {
    if (typeof padding3 == "number") {
      return padding3;
    } else if (typeof padding3 == "object" && Object.keys(padding3).length > 0) {
      return padding3[side] || 0;
    }
    return getPaddingForSide(side, fallback, 0);
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-patterns.js
  init_tslib_es6();
  var React324 = __toESM(require_react());
  var import_uniqueId4 = __toESM(require_uniqueId());
  var patterns = [
    // Set 1
    {
      // Left diagonal lines
      d: "M 0 0 L 5 5 M 4.5 -0.5 L 5.5 0.5 M -0.5 4.5 L 0.5 5.5",
      height: 5,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      patternTransform: "scale(1.4 1.4)",
      strokeWidth: 2,
      width: 5,
      x: 0,
      y: 0
    },
    {
      // Right diagonal lines
      d: "M 0 5 L 5 0 M -0.5 0.5 L 0.5 -0.5 M 4.5 5.5 L 5.5 4.5",
      height: 5,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      patternTransform: "scale(1.4 1.4)",
      strokeWidth: 2,
      width: 5,
      x: 0,
      y: 0
    },
    {
      // Vertical offset line
      d: "M 2 0 L 2 5 M 4 0 L 4 5",
      height: 5,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      patternTransform: "scale(1.4 1.4)",
      strokeWidth: 2,
      width: 5,
      x: 0,
      y: 0
    },
    {
      // Horizontal lines
      d: "M 0 2 L 5 2 M 0 4 L 5 4",
      height: 5,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      patternTransform: "scale(1.4 1.4)",
      strokeWidth: 2,
      width: 5,
      x: 0,
      y: 0
    },
    {
      // Vertical wave
      d: "M 0 1.5 L 2.5 1.5 L 2.5 0 M 2.5 5 L 2.5 3.5 L 5 3.5",
      height: 5,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      patternTransform: "scale(1.4 1.4)",
      strokeWidth: 2,
      width: 5,
      x: 0,
      y: 0
    },
    // Set 2
    {
      // Horizontal wave
      d: "M 0 0 L 5 10 L 10 0",
      height: 10,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      strokeWidth: 2,
      width: 10,
      x: 0,
      y: 0
    },
    {
      // Squares
      d: "M 3 3 L 8 3 L 8 8 L 3 8 Z",
      height: 10,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      strokeWidth: 2,
      width: 10,
      x: 0,
      y: 0
    },
    {
      // Circles
      d: "M 5 5 m -4 0 a 4 4 0 1 1 8 0 a 4 4 0 1 1 -8 0",
      height: 10,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      strokeWidth: 2,
      width: 10,
      x: 0,
      y: 0
    },
    {
      // Left diagonal lines (thin)
      d: "M 0 0 L 10 10 M 9 -1 L 11 1 M -1 9 L 1 11",
      height: 10,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      strokeWidth: 2,
      width: 10,
      x: 0,
      y: 0
    },
    {
      // Right diagonal lines (thin)
      d: "M 0 10 L 10 0 M -1 1 L 1 -1 M 9 11 L 11 9",
      height: 10,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      strokeWidth: 2,
      width: 10,
      x: 0,
      y: 0
    },
    // Set 3
    {
      // Diamonds
      d: "M 2 5 L 5 2 L 8 5 L 5 8 Z",
      height: 10,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      strokeWidth: 2,
      width: 10,
      x: 0,
      y: 0
    },
    {
      // Thin vertical lines
      d: "M 3 0 L 3 10 M 8 0 L 8 10",
      height: 5,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      patternTransform: "scale(1.4 1.4)",
      strokeWidth: 2,
      width: 5,
      x: 0,
      y: 0
    },
    {
      // Left zig zag
      d: "M 10 3 L 5 3 L 5 0 M 5 10 L 5 7 L 0 7",
      height: 10,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      strokeWidth: 2,
      width: 10,
      x: 0,
      y: 0
    },
    {
      // Thin horizontal lines
      d: "M 0 3 L 10 3 M 0 8 L 10 8",
      height: 5,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      patternTransform: "scale(1.4 1.4)",
      strokeWidth: 2,
      width: 5,
      x: 0,
      y: 0
    },
    {
      // Right zig zag
      d: "M 0 3 L 5 3 L 5 0 M 5 10 L 5 7 L 10 7",
      height: 10,
      fill: "none",
      patternContentUnits: "userSpaceOnUse",
      patternUnits: "userSpaceOnUse",
      strokeWidth: 2,
      width: 10,
      x: 0,
      y: 0
    }
  ];
  var getPatternId = () => (0, import_uniqueId4.default)("pf-pattern");
  var getPatternDefsId = (prefix, index) => {
    const id = `${prefix}:${index}`;
    return id;
  };
  var getPatternDefs = ({ colorScale: colorScale4, offset: offset2 = 0, patternId, patternUnshiftIndex = 0 }) => {
    const defaultPatterns = [...patterns];
    if (patternUnshiftIndex > 0 && patternUnshiftIndex < defaultPatterns.length) {
      defaultPatterns.unshift(defaultPatterns.splice(patternUnshiftIndex, 1)[0]);
    }
    const defs = React324.createElement(
      React324.Fragment,
      { key: `defs` },
      React324.createElement("defs", null, colorScale4.map((color2, index) => {
        const _a = defaultPatterns[(index + offset2) % defaultPatterns.length], { d, fill, stroke = color2, strokeWidth } = _a, rest = __rest(_a, ["d", "fill", "stroke", "strokeWidth"]);
        const id = getPatternDefsId(patternId, index);
        return React324.createElement(
          "pattern",
          Object.assign({ id, key: id }, rest),
          React324.createElement("path", { d, stroke, strokeWidth, fill })
        );
      }))
    );
    return defs;
  };
  var getPatternScale = (colorScale4, patternId) => colorScale4.map((val, index) => `url(#${getPatternDefsId(patternId, index)})`);
  var getDefaultColorScale = (colorScale4, themeColorScale) => {
    const result = [];
    const colors4 = colorScale4 ? colorScale4 : themeColorScale;
    colors4.forEach((val) => result.push(val));
    return result;
  };
  var getDefaultPatternScale = ({ colorScale: colorScale4, patternId, patternScale }) => {
    if (patternScale) {
      return patternScale;
    }
    const defaultPatternScale = getPatternScale(colorScale4, patternId);
    return defaultPatternScale && defaultPatternScale.length > 0 ? defaultPatternScale : void 0;
  };
  var mergePatternData = (data, patternScale) => {
    if (!patternScale) {
      return data;
    }
    return data.map((datum, index) => {
      const pattern = patternScale[index % patternScale.length];
      return Object.assign(Object.assign({}, pattern && { _fill: pattern }), datum);
    });
  };
  var useDefaultPatternProps = ({ colorScale: colorScale4, hasPatterns, patternScale, themeColorScale }) => {
    const defaultColorScale = getDefaultColorScale(colorScale4, themeColorScale);
    let defaultPatternScale = patternScale;
    let isPatternDefs = !patternScale && hasPatterns !== void 0;
    const patternId = React324.useMemo(() => isPatternDefs ? getPatternId() : void 0, [isPatternDefs]);
    if (isPatternDefs) {
      defaultPatternScale = getDefaultPatternScale({
        colorScale: defaultColorScale,
        patternId,
        patternScale
      });
    }
    if (Array.isArray(hasPatterns)) {
      for (let i = 0; i < defaultPatternScale.length; i++) {
        if (!(i < hasPatterns.length && hasPatterns[i])) {
          defaultPatternScale[i] = null;
        }
      }
    } else if (hasPatterns === false) {
      defaultPatternScale = void 0;
      isPatternDefs = false;
    }
    return { defaultColorScale, defaultPatternScale, isPatternDefs, patternId };
  };
  var renderChildrenWithPatterns = ({ children, patternScale, themeColor }) => React324.Children.toArray(children).map((child, index) => {
    if (React324.isValidElement(child)) {
      const childProps = __rest(child.props, []);
      const style = childProps.style ? Object.assign({}, childProps.style) : {};
      if (patternScale) {
        const pattern = patternScale[index % patternScale.length];
        style.data = Object.assign(Object.assign({}, pattern && { fill: pattern }), style.data);
      }
      const _child = React324.cloneElement(child, Object.assign(Object.assign(Object.assign(Object.assign({}, patternScale && { patternScale }), themeColor && { themeColor }), childProps), {
        style
        // Override child props
      }));
      return _child;
    }
    return child;
  });

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartUtils/chart-theme-types.js
  var import_merge2 = __toESM(require_merge());
  var getAxisTheme = (themeColor) => {
    const baseTheme = getTheme(themeColor);
    const componentTheme = getComponentTheme(themeColor);
    return (0, import_merge2.default)(baseTheme, componentTheme.axis);
  };
  var getChartTheme = (themeColor, showAxis) => {
    const theme = getTheme(themeColor);
    if (!showAxis) {
      theme.axis.padding = 0;
      theme.axis.style.axis.fill = "transparent";
      theme.axis.style.axis.stroke = "transparent";
      theme.axis.style.grid.fill = "transparent";
      theme.axis.style.grid.stroke = "transparent";
      theme.axis.style.ticks.fill = "transparent";
      theme.axis.style.ticks.stroke = "transparent";
      theme.axis.style.tickLabels.fill = "transparent";
    }
    return theme;
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/Chart/Chart.js
  var import_react95 = __toESM(require_react());
  var Chart = (_a) => {
    var {
      ariaDesc,
      ariaTitle,
      children,
      colorScale: colorScale4,
      hasPatterns,
      legendAllowWrap,
      legendComponent = React325.createElement(ChartLegend, null),
      legendData,
      legendPosition = ChartCommonStyles.legend.position,
      legendDirection = "ltr",
      name: name2,
      padding: padding3,
      patternScale,
      showAxis = true,
      themeColor,
      // destructure last
      theme = getChartTheme(themeColor, showAxis),
      containerComponent = React325.createElement(ChartContainer, null),
      legendOrientation = theme.legend.orientation,
      height = theme.chart.height,
      width = theme.chart.width
    } = _a, rest = __rest(_a, ["ariaDesc", "ariaTitle", "children", "colorScale", "hasPatterns", "legendAllowWrap", "legendComponent", "legendData", "legendPosition", "legendDirection", "name", "padding", "patternScale", "showAxis", "themeColor", "theme", "containerComponent", "legendOrientation", "height", "width"]);
    const defaultPadding = {
      bottom: getPaddingForSide("bottom", padding3, theme.chart.padding),
      left: getPaddingForSide("left", padding3, theme.chart.padding),
      right: getPaddingForSide("right", padding3, theme.chart.padding),
      top: getPaddingForSide("top", padding3, theme.chart.padding)
    };
    const { defaultColorScale, defaultPatternScale, isPatternDefs, patternId } = useDefaultPatternProps({
      colorScale: colorScale4,
      patternScale,
      hasPatterns,
      themeColorScale: theme.chart.colorScale
    });
    let labelComponent;
    if (containerComponent.props.labelComponent && containerComponent.props.labelComponent.type.displayName === "ChartLegendTooltip") {
      labelComponent = React325.cloneElement(containerComponent.props.labelComponent, Object.assign(Object.assign({ theme }, defaultPatternScale && { patternScale: defaultPatternScale }), containerComponent.props.labelComponent.props));
    }
    const container = React325.cloneElement(containerComponent, Object.assign(
      Object.assign(Object.assign(Object.assign({ desc: ariaDesc, title: ariaTitle, theme }, containerComponent.props), { className: getClassName({ className: containerComponent.props.className }) }), labelComponent && { labelComponent }),
      themeColor === ChartThemeColor.skeleton && { labelComponent: React325.createElement(ChartLabel, null) }
      // Omit cursor and tooltips
    ));
    let legendXOffset = 0;
    if (legendDirection === "rtl") {
      legendXOffset = getLegendMaxTextWidth(legendData, theme);
    }
    const legend = React325.cloneElement(legendComponent, Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ data: legendData }, name2 && { name: `${name2}-${legendComponent.type.displayName}` }), {
      orientation: legendOrientation,
      theme,
      themeColor
    }), legendDirection === "rtl" && {
      dataComponent: legendComponent.props.dataComponent ? React325.cloneElement(legendComponent.props.dataComponent, { transform: `translate(${legendXOffset})` }) : React325.createElement(ChartPoint, { transform: `translate(${legendXOffset})` })
    }), legendDirection === "rtl" && {
      labelComponent: legendComponent.props.labelComponent ? React325.cloneElement(legendComponent.props.labelComponent, { direction: "rtl", dx: legendXOffset - 30 }) : React325.createElement(ChartLabel, { direction: "rtl", dx: legendXOffset - 30 })
    }), legendComponent.props));
    const getLegend = () => {
      if (!legend.props.data) {
        return null;
      }
      let dx = 0;
      let dy = 0;
      let xAxisLabelHeight = 0;
      let legendTitleHeight = legend.props.title ? 10 : 0;
      React325.Children.toArray(children).map((child) => {
        if (child.type.role === "axis" && child.props.label && child.props.fixAxisLabelHeight) {
          xAxisLabelHeight = getLabelTextSize({ text: child.props.label, theme }).height + 10;
          legendTitleHeight = 0;
        }
      });
      if (legendPosition === "bottom") {
        dy += xAxisLabelHeight + legendTitleHeight;
      } else if (legendPosition === "bottom-left") {
        dy += xAxisLabelHeight + legendTitleHeight;
        dx = -10;
      }
      if (!showAxis) {
        dy -= chart_legend_Margin_default.value;
      }
      return getComputedLegend(Object.assign({
        allowWrap: legendAllowWrap === true || typeof legendAllowWrap === "function",
        chartType: "chart",
        colorScale: colorScale4,
        dx,
        dy,
        height,
        legendComponent: legend,
        padding: defaultPadding,
        position: legendPosition,
        theme,
        themeColor,
        width
      }, defaultPatternScale && { patternScale: defaultPatternScale }));
    };
    const renderChildren = () => React325.Children.toArray(children).map((child, index) => {
      if (React325.isValidElement(child)) {
        const childProps = __rest(child.props, []);
        return React325.cloneElement(child, Object.assign(
          Object.assign(Object.assign(Object.assign(Object.assign({ colorScale: colorScale4 }, defaultPatternScale && { patternScale: defaultPatternScale }), name2 && typeof child.name !== void 0 && {
            name: `${name2}-${child.type.displayName}-${index}`
          }), {
            theme,
            themeColor
          }), childProps),
          child.type.displayName === "ChartPie" && {
            data: mergePatternData(childProps.data, defaultPatternScale)
          }
          // Override child props
        ));
      }
      return child;
    });
    const computedLegend = getLegend();
    (0, import_react95.useEffect)(() => {
      if ((computedLegend === null || computedLegend === void 0 ? void 0 : computedLegend.props) && typeof legendAllowWrap === "function") {
        const extraHeight = getLegendItemsExtraHeight({
          legendData: computedLegend.props.data,
          legendOrientation: computedLegend.props.orientation,
          legendProps: computedLegend.props,
          theme
        });
        legendAllowWrap(extraHeight);
      }
    }, [computedLegend, legendAllowWrap, theme, width]);
    return React325.createElement(
      VictoryChart,
      Object.assign({ colorScale: colorScale4, containerComponent: container, height, name: name2, padding: defaultPadding, theme, width }, rest),
      renderChildren(),
      computedLegend,
      isPatternDefs && getPatternDefs({ patternId, colorScale: defaultColorScale })
    );
  };
  Chart.displayName = "Chart";
  (0, import_hoist_non_react_statics4.default)(Chart, VictoryChart);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartArea/ChartArea.js
  init_tslib_es6();
  var React328 = __toESM(require_react());
  var import_hoist_non_react_statics5 = __toESM(require_hoist_non_react_statics_cjs());

  // node_modules/victory-area/es/victory-area.js
  var import_react97 = __toESM(require_react());

  // node_modules/victory-area/es/helper-methods.js
  var getDataWithBaseline = (props, scale) => {
    let data = data_exports.getData(props);
    if (data.length < 2) {
      data = [];
    }
    const getDefaultMin = (axis) => {
      const defaultZero = scale_exports.getType(scale[axis]) === "log" ? 1 / Number.MAX_SAFE_INTEGER : 0;
      const domain = scale[axis].domain();
      const minY = collection_exports.getMinValue(domain);
      const maxY = collection_exports.getMaxValue(domain);
      let defaultMin = defaultZero;
      if (minY.valueOf() < 0 && maxY.valueOf() <= 0) {
        defaultMin = maxY;
      } else if (minY.valueOf() >= 0 && maxY.valueOf() > 0) {
        defaultMin = minY;
      }
      return collection_exports.containsDates(domain) ? new Date(defaultMin) : defaultMin;
    };
    return data.map((datum) => {
      const _y1 = datum._y1 !== void 0 ? datum._y1 : datum._y;
      const _y0 = datum._y0 !== void 0 ? datum._y0 : getDefaultMin("y");
      const _x1 = datum._x1 !== void 0 ? datum._x1 : datum._x;
      const _x0 = datum._x0 !== void 0 ? datum._x0 : getDefaultMin("x");
      return Object.assign({}, datum, {
        _y0,
        _y1,
        _x0,
        _x1
      });
    });
  };
  var getCalculatedValues4 = (props) => {
    const {
      polar
    } = props;
    const defaultStyles2 = helpers_exports.getDefaultStyles(props, "area");
    const style = helpers_exports.getStyles(props.style, defaultStyles2);
    const range4 = {
      x: helpers_exports.getRange(props, "x"),
      y: helpers_exports.getRange(props, "y")
    };
    const domain = {
      x: domain_exports.getDomainWithZero(props, "x"),
      y: domain_exports.getDomainWithZero(props, "y")
    };
    const scale = {
      x: scale_exports.getBaseScale(props, "x").domain(domain.x).range(props.horizontal ? range4.y : range4.x),
      y: scale_exports.getBaseScale(props, "y").domain(domain.y).range(props.horizontal ? range4.x : range4.y)
    };
    const origin = polar ? props.origin || helpers_exports.getPolarOrigin(props) : void 0;
    const data = getDataWithBaseline(props, scale);
    return {
      style,
      data,
      scale,
      domain,
      origin
    };
  };
  var getBaseProps4 = (initialProps, fallbackProps12) => {
    const modifiedProps = helpers_exports.modifyProps(initialProps, fallbackProps12, "area");
    const props = Object.assign({}, modifiedProps, getCalculatedValues4(modifiedProps));
    const {
      data,
      domain,
      events,
      groupComponent,
      height,
      horizontal,
      interpolation,
      origin,
      padding: padding3,
      polar,
      scale,
      sharedEvents,
      standalone,
      style,
      theme,
      width,
      labels,
      name: name2,
      disableInlineStyles
    } = props;
    const initialChildProps = {
      parent: {
        style: style.parent,
        width,
        height,
        scale,
        data,
        domain,
        standalone,
        theme,
        polar,
        origin,
        padding: padding3,
        name: name2,
        horizontal
      },
      all: {
        data: {
          horizontal,
          polar,
          origin,
          scale,
          data,
          interpolation,
          groupComponent,
          style: disableInlineStyles ? {} : style.data,
          disableInlineStyles
        }
      }
    };
    return data.reduce((childProps, datum, index) => {
      const text = label_helpers_exports.getText(props, datum, index);
      if (text !== void 0 && text !== null || labels && (events || sharedEvents)) {
        const eventKey = !helpers_exports.isNil(datum.eventKey) ? datum.eventKey : index;
        childProps[eventKey] = {
          labels: label_helpers_exports.getProps(props, index)
        };
      }
      return childProps;
    }, initialChildProps);
  };

  // node_modules/victory-area/es/area.js
  var import_react96 = __toESM(require_react());
  var import_defaults26 = __toESM(require_defaults());
  var defined2 = (d) => {
    const y2 = d._y1 !== void 0 ? d._y1 : d._y;
    return y2 !== null && y2 !== void 0 && d._y0 !== null;
  };
  var getXAccessor2 = (scale) => {
    return (d) => scale.x(d._x1 !== void 0 ? d._x1 : d._x);
  };
  var getYAccessor2 = (scale) => {
    return (d) => scale.y(d._y1 !== void 0 ? d._y1 : d._y);
  };
  var getY0Accessor = (scale) => {
    return (d) => scale.y(d._y0);
  };
  var getAngleAccessor2 = (scale) => {
    return (d) => {
      const x2 = scale.x(d._x1 !== void 0 ? d._x1 : d._x);
      return -1 * x2 + Math.PI / 2;
    };
  };
  var getCartesianArea = (props) => {
    const {
      horizontal,
      scale
    } = props;
    const interpolationFunction = line_helpers_exports.getInterpolationFunction(props);
    return horizontal ? area_default().defined(defined2).curve(interpolationFunction).x0(getY0Accessor(scale)).x1(getYAccessor2(scale)).y(getXAccessor2(scale)) : area_default().defined(defined2).curve(interpolationFunction).x(getXAccessor2(scale)).y1(getYAccessor2(scale)).y0(getY0Accessor(scale));
  };
  var getAreaFunction = (props) => {
    const {
      polar,
      scale
    } = props;
    const interpolationFunction = line_helpers_exports.getInterpolationFunction(props);
    return polar ? areaRadial_default().defined(defined2).curve(interpolationFunction).angle(getAngleAccessor2(scale)).outerRadius(getYAccessor2(scale)).innerRadius(getY0Accessor(scale)) : getCartesianArea(props);
  };
  var evaluateProps7 = (props) => {
    const ariaLabel = helpers_exports.evaluateProp(props.ariaLabel, props);
    const desc = helpers_exports.evaluateProp(props.desc, props);
    const id = helpers_exports.evaluateProp(props.id, props);
    const style = helpers_exports.evaluateStyle(Object.assign({
      fill: "black"
    }, props.style), props);
    const tabIndex = helpers_exports.evaluateProp(props.tabIndex, props);
    return Object.assign({}, props, {
      ariaLabel,
      desc,
      id,
      style,
      tabIndex
    });
  };
  var defaultProps11 = {
    groupComponent: /* @__PURE__ */ import_react96.default.createElement("g", null),
    pathComponent: /* @__PURE__ */ import_react96.default.createElement(Path2, null),
    role: "presentation",
    shapeRendering: "auto"
  };
  var Area = (initialProps) => {
    const props = evaluateProps7((0, import_defaults26.default)({}, initialProps, defaultProps11));
    const {
      ariaLabel,
      role,
      shapeRendering,
      className,
      polar,
      origin,
      data,
      pathComponent,
      events,
      groupComponent,
      clipPath,
      id,
      style,
      desc,
      tabIndex
    } = props;
    const userProps = user_props_exports.getSafeUserProps(props);
    const defaultTransform = polar && origin ? `translate(${origin.x}, ${origin.y})` : void 0;
    const transform = props.transform || defaultTransform;
    const renderLine = style.stroke && style.stroke !== "none" && style.stroke !== "transparent";
    const areaFunction = getAreaFunction(props);
    const lineFunction = renderLine && line_helpers_exports.getLineFunction(props);
    const areaStroke = style.stroke ? "none" : style.fill;
    const sharedProps = {
      "aria-label": ariaLabel,
      className,
      role,
      shapeRendering,
      transform,
      ...events,
      clipPath,
      tabIndex
    };
    const area = /* @__PURE__ */ import_react96.default.cloneElement(pathComponent, Object.assign({
      key: `${id}-area`,
      style: Object.assign({}, style, {
        stroke: areaStroke
      }),
      d: areaFunction(data),
      desc,
      tabIndex
    }, sharedProps, userProps));
    const line = renderLine ? /* @__PURE__ */ import_react96.default.cloneElement(pathComponent, Object.assign({
      key: `${id}-area-stroke`,
      style: Object.assign({}, style, {
        fill: "none"
      }),
      d: lineFunction(data)
    }, sharedProps)) : null;
    return renderLine ? /* @__PURE__ */ import_react96.default.cloneElement(groupComponent, userProps, [area, line]) : area;
  };

  // node_modules/victory-area/es/victory-area.js
  var fallbackProps6 = {
    width: 450,
    height: 300,
    padding: 50,
    interpolation: "linear"
  };
  var options3 = {
    components: [{
      name: "parent",
      index: "parent"
    }, {
      name: "data",
      index: "all"
    }, {
      name: "labels"
    }]
  };
  var _VictoryAreaBase = class _VictoryAreaBase extends import_react97.default.Component {
    static getBaseProps(props) {
      return getBaseProps4(props, fallbackProps6);
    }
    // Overridden in native versions
    shouldAnimate() {
      return !!this.props.animate;
    }
    render() {
      const {
        animationWhitelist,
        role
      } = _VictoryAreaBase;
      const props = helpers_exports.modifyProps(this.props, fallbackProps6, role);
      if (this.shouldAnimate()) {
        return this.animateComponent(props, animationWhitelist);
      }
      const children = this.renderContinuousData(props);
      const component = props.standalone ? this.renderContainer(props.containerComponent, children) : children;
      return user_props_exports.withSafeUserProps(component, props);
    }
  };
  __publicField(_VictoryAreaBase, "animationWhitelist", ["data", "domain", "height", "padding", "style", "width"]);
  __publicField(_VictoryAreaBase, "defaultProps", {
    containerComponent: /* @__PURE__ */ import_react97.default.createElement(VictoryContainer, null),
    dataComponent: /* @__PURE__ */ import_react97.default.createElement(Area, null),
    groupComponent: /* @__PURE__ */ import_react97.default.createElement(VictoryClipContainer, null),
    labelComponent: /* @__PURE__ */ import_react97.default.createElement(VictoryLabel, {
      renderInPortal: true
    }),
    samples: 50,
    sortKey: "x",
    sortOrder: "ascending",
    standalone: true,
    theme: VictoryTheme.grayscale
  });
  __publicField(_VictoryAreaBase, "displayName", "VictoryArea");
  __publicField(_VictoryAreaBase, "role", "area");
  __publicField(_VictoryAreaBase, "continuous", true);
  __publicField(_VictoryAreaBase, "defaultTransitions", default_transitions_exports.continuousTransitions());
  __publicField(_VictoryAreaBase, "defaultPolarTransitions", default_transitions_exports.continuousPolarTransitions());
  __publicField(_VictoryAreaBase, "getDomain", domain_exports.getDomainWithZero);
  __publicField(_VictoryAreaBase, "getData", data_exports.getData);
  __publicField(_VictoryAreaBase, "expectedComponents", ["dataComponent", "labelComponent", "groupComponent", "containerComponent"]);
  var VictoryAreaBase = _VictoryAreaBase;
  var VictoryArea = addEvents(VictoryAreaBase, options3);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartArea/ChartArea.js
  var ChartArea = (_a) => {
    var {
      containerComponent = React328.createElement(ChartContainer, null),
      themeColor,
      // destructure last
      theme = getTheme(themeColor)
    } = _a, rest = __rest(_a, ["containerComponent", "themeColor", "theme"]);
    const container = React328.cloneElement(containerComponent, Object.assign({ theme }, containerComponent.props));
    return React328.createElement(VictoryArea, Object.assign({ containerComponent: container, theme }, rest));
  };
  ChartArea.displayName = "ChartArea";
  (0, import_hoist_non_react_statics5.default)(ChartArea, VictoryArea);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartAxis/ChartAxis.js
  init_tslib_es6();
  var React329 = __toESM(require_react());
  var import_hoist_non_react_statics6 = __toESM(require_hoist_non_react_statics_cjs());
  var ChartAxis = (_a) => {
    var {
      axisLabelComponent = React329.createElement(ChartLabel, null),
      containerComponent = React329.createElement(ChartContainer, null),
      name: name2,
      showGrid = false,
      themeColor,
      tickLabelComponent = React329.createElement(ChartLabel, null),
      // destructure last
      theme = getTheme(themeColor)
    } = _a, rest = __rest(_a, ["axisLabelComponent", "containerComponent", "name", "showGrid", "themeColor", "tickLabelComponent", "theme"]);
    const componentTheme = getComponentTheme(themeColor);
    const container = React329.cloneElement(containerComponent, Object.assign({ theme }, containerComponent.props));
    const getAxisLabelComponent = () => React329.cloneElement(axisLabelComponent, Object.assign(
      Object.assign(Object.assign({}, name2 && {
        id: () => `${name2}-${axisLabelComponent.type.displayName}`
      }), axisLabelComponent.props),
      (componentTheme === null || componentTheme === void 0 ? void 0 : componentTheme.label) && componentTheme.label
      // override backgroundStyle
    ));
    const getTickLabelComponent = () => React329.cloneElement(tickLabelComponent, Object.assign(
      Object.assign(Object.assign({}, name2 && {
        id: (props) => `${name2}-${tickLabelComponent.type.displayName}-${props.index}`
      }), tickLabelComponent.props),
      (componentTheme === null || componentTheme === void 0 ? void 0 : componentTheme.label) && componentTheme.label
      // override backgroundStyle
    ));
    return React329.createElement(VictoryAxis, Object.assign({ axisLabelComponent: getAxisLabelComponent(), containerComponent: container, name: name2, theme: showGrid ? getAxisTheme(themeColor) : theme, tickLabelComponent: getTickLabelComponent() }, rest));
  };
  ChartAxis.displayName = "ChartAxis";
  (0, import_hoist_non_react_statics6.default)(ChartAxis, VictoryAxis);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTooltip/ChartTooltip.js
  init_tslib_es6();
  var React332 = __toESM(require_react());
  var import_hoist_non_react_statics7 = __toESM(require_hoist_non_react_statics_cjs());

  // node_modules/victory-tooltip/es/victory-tooltip.js
  var import_react99 = __toESM(require_react());
  var import_defaults28 = __toESM(require_defaults());
  var import_uniqueId5 = __toESM(require_uniqueId());
  var import_isPlainObject5 = __toESM(require_isPlainObject());
  var import_orderBy4 = __toESM(require_orderBy());

  // node_modules/victory-tooltip/es/flyout.js
  var import_react98 = __toESM(require_react());
  var import_defaults27 = __toESM(require_defaults());
  var getVerticalPath = (props) => {
    const {
      pointerWidth,
      cornerRadius,
      orientation,
      width,
      height,
      center
    } = props;
    const sign2 = orientation === "bottom" ? 1 : -1;
    const x2 = props.x + (props.dx || 0);
    const y2 = props.y + (props.dy || 0);
    const centerX = center.x;
    const centerY = center.y;
    const pointerEdge = centerY + sign2 * (height / 2);
    const oppositeEdge = centerY - sign2 * (height / 2);
    const rightEdge = centerX + width / 2;
    const leftEdge = centerX - width / 2;
    const pointerLength = sign2 * (y2 - pointerEdge) < 0 ? 0 : props.pointerLength;
    const direction = orientation === "bottom" ? "0 0 0" : "0 0 1";
    const arc = `${cornerRadius} ${cornerRadius} ${direction}`;
    return `M ${centerX - pointerWidth / 2}, ${pointerEdge}
    L ${pointerLength ? x2 : centerX + pointerWidth / 2}, ${pointerLength ? y2 : pointerEdge}
    L ${centerX + pointerWidth / 2}, ${pointerEdge}
    L ${rightEdge - cornerRadius}, ${pointerEdge}
    A ${arc} ${rightEdge}, ${pointerEdge - sign2 * cornerRadius}
    L ${rightEdge}, ${oppositeEdge + sign2 * cornerRadius}
    A ${arc} ${rightEdge - cornerRadius}, ${oppositeEdge}
    L ${leftEdge + cornerRadius}, ${oppositeEdge}
    A ${arc} ${leftEdge}, ${oppositeEdge + sign2 * cornerRadius}
    L ${leftEdge}, ${pointerEdge - sign2 * cornerRadius}
    A ${arc} ${leftEdge + cornerRadius}, ${pointerEdge}
    z`;
  };
  var getHorizontalPath = (props) => {
    const {
      pointerWidth,
      cornerRadius,
      orientation,
      width,
      height,
      center
    } = props;
    const sign2 = orientation === "left" ? 1 : -1;
    const x2 = props.x + (props.dx || 0);
    const y2 = props.y + (props.dy || 0);
    const centerX = center.x;
    const centerY = center.y;
    const pointerEdge = centerX - sign2 * (width / 2);
    const oppositeEdge = centerX + sign2 * (width / 2);
    const bottomEdge = centerY + height / 2;
    const topEdge = centerY - height / 2;
    const pointerLength = sign2 * (x2 - pointerEdge) > 0 ? 0 : props.pointerLength;
    const direction = orientation === "left" ? "0 0 0" : "0 0 1";
    const arc = `${cornerRadius} ${cornerRadius} ${direction}`;
    return `M ${pointerEdge}, ${centerY - pointerWidth / 2}
    L ${pointerLength ? x2 : pointerEdge}, ${pointerLength ? y2 : centerY + pointerWidth / 2}
    L ${pointerEdge}, ${centerY + pointerWidth / 2}
    L ${pointerEdge}, ${bottomEdge - cornerRadius}
    A ${arc} ${pointerEdge + sign2 * cornerRadius}, ${bottomEdge}
    L ${oppositeEdge - sign2 * cornerRadius}, ${bottomEdge}
    A ${arc} ${oppositeEdge}, ${bottomEdge - cornerRadius}
    L ${oppositeEdge}, ${topEdge + cornerRadius}
    A ${arc} ${oppositeEdge - sign2 * cornerRadius}, ${topEdge}
    L ${pointerEdge + sign2 * cornerRadius}, ${topEdge}
    A ${arc} ${pointerEdge}, ${topEdge + cornerRadius}
    z`;
  };
  var getFlyoutPath = (props) => {
    const orientation = props.orientation || "top";
    return orientation === "left" || orientation === "right" ? getHorizontalPath(props) : getVerticalPath(props);
  };
  var evaluateProps8 = (props) => {
    const id = helpers_exports.evaluateProp(props.id, props);
    const style = helpers_exports.evaluateStyle(props.style, props);
    return {
      ...props,
      id,
      style
    };
  };
  var defaultProps12 = {
    pathComponent: /* @__PURE__ */ import_react98.default.createElement(Path2, null),
    role: "presentation",
    shapeRendering: "auto"
  };
  var Flyout = (initialProps) => {
    const props = evaluateProps8((0, import_defaults27.default)({}, initialProps, defaultProps12));
    const userProps = user_props_exports.getSafeUserProps(props);
    user_props_exports.assert(props.height, "Flyout props[height] is undefined");
    user_props_exports.assert(props.width, "Flyout props[width] is undefined");
    user_props_exports.assert(props.x, "Flyout props[x] is undefined");
    user_props_exports.assert(props.y, "Flyout props[y] is undefined");
    const flyoutPathProps = {
      center: props.center || {
        x: 0,
        y: 0
      },
      cornerRadius: props.cornerRadius || 0,
      dx: props.dx,
      dy: props.dy,
      height: props.height,
      orientation: props.orientation || "top",
      pointerLength: props.pointerLength || 0,
      pointerWidth: props.pointerWidth || 0,
      width: props.width,
      x: props.x,
      y: props.y
    };
    return /* @__PURE__ */ import_react98.default.cloneElement(props.pathComponent, {
      ...props.events,
      ...userProps,
      style: props.style,
      d: getFlyoutPath(flyoutPathProps),
      className: props.className,
      shapeRendering: props.shapeRendering,
      role: props.role,
      transform: props.transform,
      clipPath: props.clipPath
    });
  };

  // node_modules/victory-tooltip/es/victory-tooltip.js
  var fallbackProps7 = {
    cornerRadius: 5,
    pointerLength: 10,
    pointerWidth: 10
  };
  var VictoryTooltip = class extends import_react99.default.Component {
    static defaultEvents(props) {
      const activate = props.activateData ? [{
        target: "labels",
        mutation: () => ({
          active: true
        })
      }, {
        target: "data",
        mutation: () => ({
          active: true
        })
      }] : [{
        target: "labels",
        mutation: () => ({
          active: true
        })
      }];
      const deactivate = props.activateData ? [{
        target: "labels",
        mutation: () => ({
          active: void 0
        })
      }, {
        target: "data",
        mutation: () => ({
          active: void 0
        })
      }] : [{
        target: "labels",
        mutation: () => ({
          active: void 0
        })
      }];
      return [{
        target: "data",
        eventHandlers: {
          onMouseOver: () => activate,
          onFocus: () => activate,
          onTouchStart: () => activate,
          onMouseOut: () => deactivate,
          onBlur: () => deactivate,
          onTouchEnd: () => deactivate
        }
      }];
    }
    constructor(props) {
      super(props);
      this.id = props.id === void 0 ? (0, import_uniqueId5.default)("tooltip-") : props.id;
    }
    getDefaultOrientation(props) {
      const {
        datum,
        horizontal,
        polar
      } = props;
      if (!polar) {
        const positive = horizontal ? "right" : "top";
        const negative = horizontal ? "left" : "bottom";
        return datum && datum.y < 0 ? negative : positive;
      }
      return this.getPolarOrientation(props);
    }
    getPolarOrientation(props) {
      const degrees = label_helpers_exports.getDegrees(props, props.datum);
      const placement = props.labelPlacement || "vertical";
      if (placement === "vertical") {
        return this.getVerticalOrientations(degrees);
      } else if (placement === "parallel") {
        return degrees < 90 || degrees > 270 ? "right" : "left";
      }
      return degrees > 180 ? "bottom" : "top";
    }
    getVerticalOrientations(degrees) {
      if (degrees < 45 || degrees > 315) {
        return "right";
      } else if (degrees >= 45 && degrees <= 135) {
        return "top";
      } else if (degrees > 135 && degrees < 225) {
        return "left";
      }
      return "bottom";
    }
    getStyles(props) {
      const theme = props.theme || VictoryTheme.grayscale;
      const defaultLabelStyles = theme && theme.tooltip && theme.tooltip.style ? theme.tooltip.style : {};
      const baseLabelStyle = Array.isArray(props.style) ? props.style.map((s2) => (0, import_defaults28.default)({}, s2, defaultLabelStyles)) : (0, import_defaults28.default)({}, props.style, defaultLabelStyles);
      const defaultFlyoutStyles = theme && theme.tooltip && theme.tooltip.flyoutStyle ? theme.tooltip.flyoutStyle : {};
      const baseFlyoutStyle = props.flyoutStyle ? (0, import_defaults28.default)({}, props.flyoutStyle, defaultFlyoutStyles) : defaultFlyoutStyles;
      const style = Array.isArray(baseLabelStyle) ? baseLabelStyle.map((s2) => helpers_exports.evaluateStyle(s2, props)) : helpers_exports.evaluateStyle(baseLabelStyle, props);
      const flyoutStyle = helpers_exports.evaluateStyle(baseFlyoutStyle, Object.assign({}, props, {
        style
      }));
      return {
        style,
        flyoutStyle
      };
    }
    getEvaluatedProps(props) {
      const {
        cornerRadius,
        centerOffset,
        dx,
        dy
      } = props;
      const active = helpers_exports.evaluateProp(props.active, props);
      let text = helpers_exports.evaluateProp(props.text, Object.assign({}, props, {
        active
      }));
      if (text === void 0 || text === null) {
        text = "";
      }
      if (typeof text === "number") {
        text = text.toString();
      }
      const {
        style,
        flyoutStyle
      } = this.getStyles(Object.assign({}, props, {
        active,
        text
      }));
      const orientation = helpers_exports.evaluateProp(props.orientation, Object.assign({}, props, {
        active,
        text,
        style,
        flyoutStyle
      })) || this.getDefaultOrientation(props);
      const padding3 = helpers_exports.evaluateProp(props.flyoutPadding, Object.assign({}, props, {
        active,
        text,
        style,
        flyoutStyle,
        orientation
      })) || this.getLabelPadding(style);
      const flyoutPadding = helpers_exports.getPadding(padding3);
      const pointerWidth = helpers_exports.evaluateProp(props.pointerWidth, Object.assign({}, props, {
        active,
        text,
        style,
        flyoutStyle,
        orientation
      }));
      const pointerLength = helpers_exports.evaluateProp(props.pointerLength, Object.assign({}, props, {
        active,
        text,
        style,
        flyoutStyle,
        orientation
      }));
      const labelSize = textsize_exports.approximateTextSize(text, style);
      const {
        flyoutHeight,
        flyoutWidth
      } = this.getDimensions(Object.assign({}, props, {
        style,
        flyoutStyle,
        active,
        text,
        orientation,
        flyoutPadding,
        pointerWidth,
        pointerLength
      }), labelSize);
      const evaluatedProps = Object.assign({}, props, {
        active,
        text,
        style,
        flyoutStyle,
        orientation,
        flyoutHeight,
        flyoutWidth,
        flyoutPadding,
        pointerWidth,
        pointerLength
      });
      const offsetX = (0, import_isPlainObject5.default)(centerOffset) && centerOffset?.x !== void 0 ? helpers_exports.evaluateProp(centerOffset.x, evaluatedProps) : 0;
      const offsetY = (0, import_isPlainObject5.default)(centerOffset) && centerOffset?.y !== void 0 ? helpers_exports.evaluateProp(centerOffset.y, evaluatedProps) : 0;
      return {
        ...evaluatedProps,
        centerOffset: {
          x: offsetX,
          y: offsetY
        },
        dx: dx !== void 0 ? helpers_exports.evaluateProp(dx, evaluatedProps) : 0,
        dy: dy !== void 0 ? helpers_exports.evaluateProp(dy, evaluatedProps) : 0,
        cornerRadius: helpers_exports.evaluateProp(cornerRadius, evaluatedProps)
      };
    }
    getCalculatedValues(props) {
      const {
        style,
        text,
        flyoutStyle,
        flyoutHeight,
        flyoutWidth
      } = props;
      const labelSize = textsize_exports.approximateTextSize(text, style);
      const flyoutDimensions = {
        height: flyoutHeight,
        width: flyoutWidth
      };
      const flyoutCenter = this.getFlyoutCenter(props, flyoutDimensions);
      const transform = this.getTransform(props);
      return {
        style,
        flyoutStyle,
        labelSize,
        flyoutDimensions,
        flyoutCenter,
        transform
      };
    }
    getTransform(props) {
      const {
        x: x2,
        y: y2,
        style
      } = props;
      const labelStyle = style || {};
      const angle = labelStyle.angle || props.angle || this.getDefaultAngle(props);
      return angle ? `rotate(${angle} ${x2} ${y2})` : void 0;
    }
    getDefaultAngle(props) {
      const {
        polar,
        labelPlacement,
        orientation,
        datum
      } = props;
      if (!polar || !labelPlacement || labelPlacement === "vertical") {
        return 0;
      }
      const degrees = label_helpers_exports.getDegrees(props, datum);
      const sign2 = degrees > 90 && degrees < 180 || degrees > 270 ? 1 : -1;
      const labelRotation = labelPlacement === "perpendicular" ? 0 : 90;
      let angle = 0;
      if (degrees === 0 || degrees === 180) {
        angle = orientation === "top" && degrees === 180 ? 270 : 90;
      } else if (degrees > 0 && degrees < 180) {
        angle = 90 - degrees;
      } else if (degrees > 180 && degrees < 360) {
        angle = 270 - degrees;
      }
      return angle + sign2 * labelRotation;
    }
    constrainTooltip(center, props, dimensions) {
      const {
        x: x2,
        y: y2
      } = center;
      const {
        width,
        height
      } = dimensions;
      const extent = {
        x: [0, props.width],
        y: [0, props.height]
      };
      const flyoutExtent = {
        x: [x2 - width / 2, x2 + width / 2],
        y: [y2 - height / 2, y2 + height / 2]
      };
      const adjustments = {
        x: [flyoutExtent.x[0] < extent.x[0] ? extent.x[0] - flyoutExtent.x[0] : 0, flyoutExtent.x[1] > extent.x[1] ? flyoutExtent.x[1] - extent.x[1] : 0],
        y: [flyoutExtent.y[0] < extent.y[0] ? extent.y[0] - flyoutExtent.y[0] : 0, flyoutExtent.y[1] > extent.y[1] ? flyoutExtent.y[1] - extent.y[1] : 0]
      };
      return {
        x: Math.round(x2 + adjustments.x[0] - adjustments.x[1]),
        y: Math.round(y2 + adjustments.y[0] - adjustments.y[1])
      };
    }
    getFlyoutCenter(props, dimensions) {
      const {
        x: x2,
        y: y2,
        dx,
        dy,
        pointerLength,
        orientation,
        constrainToVisibleArea,
        centerOffset
      } = props;
      const {
        height,
        width
      } = dimensions;
      const xSign = orientation === "left" ? -1 : 1;
      const ySign = orientation === "bottom" ? -1 : 1;
      const flyoutCenter = {
        x: orientation === "left" || orientation === "right" ? x2 + xSign * (pointerLength + width / 2 + xSign * dx) : x2 + dx,
        y: orientation === "top" || orientation === "bottom" ? y2 - ySign * (pointerLength + height / 2 - ySign * dy) : y2 + dy
      };
      const center = {
        x: (0, import_isPlainObject5.default)(props.center) && props.center.x !== void 0 ? props.center.x : flyoutCenter.x,
        y: (0, import_isPlainObject5.default)(props.center) && props.center.y !== void 0 ? props.center.y : flyoutCenter.y
      };
      const centerWithOffset = {
        x: center.x + centerOffset.x,
        y: center.y + centerOffset.y
      };
      return constrainToVisibleArea ? this.constrainTooltip(centerWithOffset, props, dimensions) : centerWithOffset;
    }
    getLabelPadding(style) {
      if (!style) {
        return 0;
      }
      const paddings = Array.isArray(style) ? style.map((s2) => s2.padding) : [style.padding];
      return Math.max(...paddings, 0);
    }
    getDimensions(props, labelSize) {
      const {
        orientation,
        pointerLength,
        pointerWidth,
        flyoutHeight,
        flyoutWidth,
        flyoutPadding
      } = props;
      const cornerRadius = helpers_exports.evaluateProp(props.cornerRadius, props);
      const getHeight = () => {
        const calculatedHeight = labelSize.height + flyoutPadding.top + flyoutPadding.bottom;
        const minHeight = orientation === "top" || orientation === "bottom" ? 2 * cornerRadius : 2 * cornerRadius + pointerWidth;
        return Math.max(minHeight, calculatedHeight);
      };
      const getWidth2 = () => {
        const calculatedWidth = labelSize.width + flyoutPadding.left + flyoutPadding.right;
        const minWidth = orientation === "left" || orientation === "right" ? 2 * cornerRadius + pointerLength : 2 * cornerRadius;
        return Math.max(minWidth, calculatedWidth);
      };
      return {
        flyoutHeight: flyoutHeight ? helpers_exports.evaluateProp(flyoutHeight, props) : getHeight(),
        flyoutWidth: flyoutWidth ? helpers_exports.evaluateProp(flyoutWidth, props) : getWidth2()
      };
    }
    getLabelProps(props, calculatedValues) {
      const {
        flyoutCenter,
        style,
        labelSize,
        dy = 0,
        dx = 0
      } = calculatedValues;
      const {
        text,
        datum,
        activePoints,
        labelComponent,
        index,
        flyoutPadding
      } = props;
      const textAnchor = (Array.isArray(style) && style.length ? style[0].textAnchor : style.textAnchor) || "middle";
      const getLabelX = () => {
        if (!textAnchor || textAnchor === "middle") {
          return flyoutCenter.x;
        }
        const sign2 = textAnchor === "end" ? -1 : 1;
        return flyoutCenter.x - sign2 * (labelSize.width / 2);
      };
      return (0, import_defaults28.default)({}, labelComponent.props, {
        key: `${this.id}-label-${index}`,
        text,
        datum,
        activePoints,
        textAnchor,
        dy,
        dx,
        style,
        x: getLabelX() + (flyoutPadding.left - flyoutPadding.right) / 2,
        y: flyoutCenter.y + (flyoutPadding.top - flyoutPadding.bottom) / 2,
        verticalAnchor: "middle",
        angle: style.angle
      });
    }
    getPointerOrientation(point6, center, flyoutDimensions) {
      const edges = {
        bottom: center.y + flyoutDimensions.height / 2,
        top: center.y - flyoutDimensions.height / 2,
        left: center.x - flyoutDimensions.width / 2,
        right: center.x + flyoutDimensions.width / 2
      };
      const gaps = [{
        side: "top",
        val: edges.top > point6.y ? edges.top - point6.y : -1
      }, {
        side: "bottom",
        val: edges.bottom < point6.y ? point6.y - edges.bottom : -1
      }, {
        side: "right",
        val: edges.right < point6.x ? point6.x - edges.right : -1
      }, {
        side: "left",
        val: edges.left > point6.x ? edges.left - point6.x : -1
      }];
      return (0, import_orderBy4.default)(gaps, "val", "desc")[0].side;
    }
    getFlyoutProps(props, calculatedValues) {
      const {
        flyoutDimensions,
        flyoutStyle,
        flyoutCenter
      } = calculatedValues;
      const {
        x: x2,
        y: y2,
        dx,
        dy,
        datum,
        activePoints,
        index,
        pointerLength,
        pointerWidth,
        cornerRadius,
        events,
        flyoutComponent
      } = props;
      const pointerOrientation = helpers_exports.evaluateProp(props.pointerOrientation, props);
      return (0, import_defaults28.default)({}, flyoutComponent.props, {
        x: x2,
        y: y2,
        dx,
        dy,
        datum,
        activePoints,
        index,
        pointerLength,
        pointerWidth,
        cornerRadius,
        events,
        orientation: pointerOrientation || this.getPointerOrientation({
          x: x2,
          y: y2
        }, flyoutCenter, flyoutDimensions),
        key: `${this.id}-tooltip-${index}`,
        width: flyoutDimensions.width,
        height: flyoutDimensions.height,
        style: flyoutStyle,
        center: flyoutCenter
      });
    }
    // Overridden in victory-core-native
    renderTooltip(props) {
      const active = helpers_exports.evaluateProp(props.active, props);
      const {
        renderInPortal
      } = props;
      if (!active) {
        return null;
      }
      const evaluatedProps = this.getEvaluatedProps(props);
      const {
        flyoutComponent,
        labelComponent,
        groupComponent
      } = evaluatedProps;
      const calculatedValues = this.getCalculatedValues(evaluatedProps);
      const children = [/* @__PURE__ */ import_react99.default.cloneElement(flyoutComponent, this.getFlyoutProps(evaluatedProps, calculatedValues)), /* @__PURE__ */ import_react99.default.cloneElement(labelComponent, this.getLabelProps(evaluatedProps, calculatedValues))];
      const tooltip = /* @__PURE__ */ import_react99.default.cloneElement(groupComponent, {
        role: "presentation",
        transform: calculatedValues.transform
      }, children);
      return renderInPortal ? /* @__PURE__ */ import_react99.default.createElement(VictoryPortal, null, tooltip) : tooltip;
    }
    render() {
      const props = helpers_exports.modifyProps(this.props, fallbackProps7, "tooltip");
      return this.renderTooltip(props);
    }
  };
  __publicField(VictoryTooltip, "displayName", "VictoryTooltip");
  __publicField(VictoryTooltip, "role", "tooltip");
  __publicField(VictoryTooltip, "defaultProps", {
    active: false,
    renderInPortal: true,
    labelComponent: /* @__PURE__ */ import_react99.default.createElement(VictoryLabel, null),
    flyoutComponent: /* @__PURE__ */ import_react99.default.createElement(Flyout, null),
    groupComponent: /* @__PURE__ */ import_react99.default.createElement("g", null)
  });

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartTooltip/ChartTooltip.js
  var ChartTooltip = (_a) => {
    var {
      constrainToVisibleArea = false,
      labelComponent = React332.createElement(ChartLabel, null),
      // Note that Victory provides its own label component here
      labelTextAnchor,
      themeColor,
      // destructure last
      theme = getTheme(themeColor)
    } = _a, rest = __rest(_a, ["constrainToVisibleArea", "labelComponent", "labelTextAnchor", "themeColor", "theme"]);
    const chartLabelComponent = React332.cloneElement(labelComponent, Object.assign({ textAnchor: labelTextAnchor, theme }, labelComponent.props));
    return React332.createElement(VictoryTooltip, Object.assign({ constrainToVisibleArea, labelComponent: chartLabelComponent, theme }, rest));
  };
  ChartTooltip.displayName = "ChartTooltip";
  (0, import_hoist_non_react_statics7.default)(ChartTooltip, VictoryTooltip);

  // node_modules/victory-scatter/es/victory-scatter.js
  var import_react100 = __toESM(require_react());

  // node_modules/victory-scatter/es/helper-methods.js
  var getSymbol = (data, props) => {
    if (props.bubbleProperty) {
      return "circle";
    }
    return data.symbol || props.symbol;
  };
  var getBubbleSize = (datum, props) => {
    const {
      data,
      z,
      maxBubbleSize,
      minBubbleSize
    } = props;
    const zData = data.map((point6) => point6[z]);
    const zMin = Math.min(...zData);
    const zMax = Math.max(...zData);
    const getMaxRadius = () => {
      const minPadding = Math.min(...Object.values(helpers_exports.getPadding(props.padding)));
      return Math.max(minPadding, 5);
    };
    const maxRadius = maxBubbleSize || getMaxRadius();
    const minRadius = minBubbleSize || maxRadius * 0.1;
    if (zMax === zMin) {
      return Math.max(minRadius, 1);
    }
    const maxArea = Math.PI * Math.pow(maxRadius, 2);
    const minArea = Math.PI * Math.pow(minRadius, 2);
    const pointArea = (datum[z] - zMin) / (zMax - zMin) * maxArea;
    const area = Math.max(pointArea, minArea);
    const radius = Math.sqrt(area / Math.PI);
    return Math.max(radius, 1);
  };
  var getSize = (datum, props) => {
    const {
      size,
      z
    } = props;
    if (datum.size) {
      return typeof datum.size === "function" ? datum.size : Math.max(datum.size, 1);
    } else if (typeof props.size === "function") {
      return size;
    } else if (datum[z]) {
      return getBubbleSize(datum, props);
    }
    return Math.max(size || 0, 1);
  };
  var getCalculatedValues5 = (props) => {
    const defaultStyles2 = helpers_exports.getDefaultStyles(props, "scatter");
    const style = helpers_exports.getStyles(props.style, defaultStyles2);
    const range4 = {
      x: helpers_exports.getRange(props, "x"),
      y: helpers_exports.getRange(props, "y")
    };
    const domain = {
      x: domain_exports.getDomain(props, "x"),
      y: domain_exports.getDomain(props, "y")
    };
    const scale = {
      x: scale_exports.getBaseScale(props, "x").domain(domain.x).range(props.horizontal ? range4.y : range4.x),
      y: scale_exports.getBaseScale(props, "y").domain(domain.y).range(props.horizontal ? range4.x : range4.y)
    };
    const origin = props.polar ? props.origin || helpers_exports.getPolarOrigin(props) : void 0;
    const z = props.bubbleProperty || "z";
    let data = data_exports.getData(props);
    data = data_exports.formatDataFromDomain(data, domain);
    return {
      domain,
      data,
      scale,
      style,
      origin,
      z
    };
  };
  var getBaseProps5 = (initialProps, fallbackProps12) => {
    const modifiedProps = helpers_exports.modifyProps(initialProps, fallbackProps12, "scatter");
    const props = Object.assign({}, modifiedProps, getCalculatedValues5(modifiedProps));
    const {
      data,
      domain,
      events,
      height,
      origin,
      padding: padding3,
      polar,
      scale,
      name: name2,
      sharedEvents,
      standalone,
      style,
      theme,
      width,
      labels,
      horizontal,
      disableInlineStyles
    } = props;
    const initialChildProps = {
      parent: {
        style: style.parent,
        scale,
        domain,
        data,
        height,
        width,
        standalone,
        theme,
        origin,
        polar,
        padding: padding3,
        name: name2,
        horizontal
      }
    };
    return data.reduce((childProps, datum, index) => {
      const eventKey = !helpers_exports.isNil(datum.eventKey) ? datum.eventKey : index;
      const {
        x: x2,
        y: y2
      } = helpers_exports.scalePoint(props, datum);
      const dataProps = {
        x: x2,
        y: y2,
        datum,
        data,
        index,
        scale,
        polar,
        origin,
        horizontal,
        size: getSize(datum, props),
        symbol: getSymbol(datum, props),
        style: disableInlineStyles ? {} : style.data,
        disableInlineStyles
      };
      childProps[eventKey] = {
        data: dataProps
      };
      const text = label_helpers_exports.getText(props, datum, index);
      if (text !== void 0 && text !== null || labels && (events || sharedEvents)) {
        childProps[eventKey].labels = label_helpers_exports.getProps(props, index);
      }
      return childProps;
    }, initialChildProps);
  };

  // node_modules/victory-scatter/es/victory-scatter.js
  var fallbackProps8 = {
    width: 450,
    height: 300,
    padding: 50,
    size: 3,
    symbol: "circle"
  };
  var VictoryScatterBase = class extends import_react100.default.Component {
    static getBaseProps(props) {
      return getBaseProps5(props, fallbackProps8);
    }
    // Overridden in native versions
    shouldAnimate() {
      return !!this.props.animate;
    }
    render() {
      const {
        animationWhitelist,
        role
      } = VictoryScatter;
      const props = helpers_exports.modifyProps(this.props, fallbackProps8, role);
      if (this.shouldAnimate()) {
        return this.animateComponent(props, animationWhitelist);
      }
      const children = this.renderData(props);
      const component = props.standalone ? this.renderContainer(props.containerComponent, children) : children;
      return user_props_exports.withSafeUserProps(component, props);
    }
  };
  __publicField(VictoryScatterBase, "animationWhitelist", ["data", "domain", "height", "maxBubbleSize", "padding", "samples", "size", "style", "width"]);
  __publicField(VictoryScatterBase, "displayName", "VictoryScatter");
  __publicField(VictoryScatterBase, "role", "scatter");
  __publicField(VictoryScatterBase, "defaultTransitions", default_transitions_exports.discreteTransitions());
  __publicField(VictoryScatterBase, "defaultProps", {
    containerComponent: /* @__PURE__ */ import_react100.default.createElement(VictoryContainer, null),
    dataComponent: /* @__PURE__ */ import_react100.default.createElement(Point, null),
    labelComponent: /* @__PURE__ */ import_react100.default.createElement(VictoryLabel, null),
    groupComponent: /* @__PURE__ */ import_react100.default.createElement("g", null),
    samples: 50,
    sortOrder: "ascending",
    standalone: true,
    theme: VictoryTheme.grayscale
  });
  __publicField(VictoryScatterBase, "getDomain", domain_exports.getDomain);
  __publicField(VictoryScatterBase, "getData", data_exports.getData);
  __publicField(VictoryScatterBase, "expectedComponents", ["dataComponent", "labelComponent", "groupComponent", "containerComponent"]);
  var VictoryScatter = addEvents(VictoryScatterBase);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartScatter/ChartScatter.js
  init_tslib_es6();
  var React334 = __toESM(require_react());
  var import_hoist_non_react_statics8 = __toESM(require_hoist_non_react_statics_cjs());
  var ChartScatter = (_a) => {
    var {
      containerComponent = React334.createElement(ChartContainer, null),
      themeColor,
      // destructure last
      theme = getTheme(themeColor)
    } = _a, rest = __rest(_a, ["containerComponent", "themeColor", "theme"]);
    const container = React334.cloneElement(containerComponent, Object.assign({ theme }, containerComponent.props));
    if (typeof rest.size === "undefined" && typeof rest.bubbleProperty === "undefined") {
      rest.size = ({ active }) => active ? ChartScatterStyles.activeSize : ChartScatterStyles.size;
    }
    return React334.createElement(VictoryScatter, Object.assign({ containerComponent: container, theme }, rest));
  };
  ChartScatter.displayName = "ChartScatter";
  (0, import_hoist_non_react_statics8.default)(ChartScatter, VictoryScatter);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartGroup/ChartGroup.js
  init_tslib_es6();
  var React337 = __toESM(require_react());
  var import_hoist_non_react_statics9 = __toESM(require_hoist_non_react_statics_cjs());

  // node_modules/victory-group/es/victory-group.js
  var import_defaults29 = __toESM(require_defaults());
  var import_isEmpty9 = __toESM(require_isEmpty());
  var import_react102 = __toESM(require_react());

  // node_modules/victory-group/es/helper-methods.js
  var import_react101 = __toESM(require_react());
  var import_react_fast_compare5 = __toESM(require_react_fast_compare());
  var fallbackProps9 = {
    width: 450,
    height: 300,
    padding: 50,
    offset: 0
  };
  function getCalculatedProps3(initialProps, childComponents) {
    const role = "group";
    const props = helpers_exports.modifyProps(initialProps, fallbackProps9, role);
    const style = wrapper_exports.getStyle(props.theme, props.style, role);
    const {
      offset: offset2,
      colorScale: colorScale4,
      color: color2,
      polar,
      horizontal
    } = props;
    const categories = props.categories || wrapper_exports.getCategories(props, childComponents, null);
    const datasets = props.datasets || wrapper_exports.getDataFromChildren(props, null);
    const domain = {
      x: wrapper_exports.getDomain(Object.assign({}, props, {
        categories
      }), "x", childComponents),
      y: wrapper_exports.getDomain(Object.assign({}, props, {
        categories
      }), "y", childComponents)
    };
    const range4 = props.range || {
      x: helpers_exports.getRange(props, "x"),
      y: helpers_exports.getRange(props, "y")
    };
    const baseScale = {
      x: scale_exports.getScaleFromProps(props, "x") || wrapper_exports.getScale(props, "x"),
      y: scale_exports.getScaleFromProps(props, "y") || wrapper_exports.getScale(props, "y")
    };
    const scale = {
      x: baseScale.x.domain(domain.x).range(props.horizontal ? range4.y : range4.x),
      y: baseScale.y.domain(domain.y).range(props.horizontal ? range4.x : range4.y)
    };
    const origin = polar ? props.origin : helpers_exports.getPolarOrigin(props);
    const padding3 = helpers_exports.getPadding(props.padding);
    return {
      datasets,
      categories,
      range: range4,
      domain,
      horizontal,
      scale,
      style,
      colorScale: colorScale4,
      color: color2,
      offset: offset2,
      origin,
      padding: padding3
    };
  }
  var withoutSharedEvents = (props) => {
    const {
      children
    } = props;
    const modifiedChildren = import_react101.default.Children.toArray(children).map((child) => {
      return {
        ...child,
        props: helpers_exports.omit(child.props, ["sharedEvents"])
      };
    });
    props.children = modifiedChildren;
    return props;
  };
  function useMemoizedProps(initialProps) {
    const modifiedProps = withoutSharedEvents(initialProps);
    const [props, setProps] = import_react101.default.useState(modifiedProps);
    import_react101.default.useEffect(() => {
      if (!(0, import_react_fast_compare5.default)(modifiedProps, props)) {
        setProps(modifiedProps);
      }
    }, [props, setProps, modifiedProps]);
    return import_react101.default.useMemo(() => {
      return getCalculatedProps3(props, props.children);
    }, [props]);
  }
  function pixelsToValue(props, axis, calculatedProps) {
    if (!props.offset) {
      return 0;
    }
    const currentAxis = helpers_exports.getCurrentAxis(axis, props.horizontal);
    const domain = calculatedProps.domain[axis];
    const range4 = calculatedProps.range[currentAxis];
    const domainExtent = Math.max(...domain) - Math.min(...domain);
    const rangeExtent = Math.max(...range4) - Math.min(...range4);
    return domainExtent / rangeExtent * props.offset;
  }
  function getX0(props, calculatedProps, index, role) {
    const groupLength = role === "stack" ? calculatedProps.datasets[0].length : calculatedProps.datasets.length;
    const center = (groupLength - 1) / 2;
    const totalWidth = pixelsToValue(props, "x", calculatedProps);
    return (index - center) * totalWidth;
  }
  function getPolarX0(props, calculatedProps, index, role) {
    const groupLength = role === "stack" ? calculatedProps.datasets[0].length : calculatedProps.datasets.length;
    const center = (groupLength - 1) / 2;
    const width = getAngularWidth(props, calculatedProps);
    return (index - center) * width;
  }
  function getAngularWidth(props, calculatedProps) {
    const {
      range: range4
    } = calculatedProps;
    const angularRange = Math.abs(range4.x[1] - range4.x[0]);
    const r = Math.max(...range4.y);
    return props.offset / (2 * Math.PI * r) * angularRange;
  }
  function getLabels(props, datasets, index) {
    if (!props.labels) {
      return void 0;
    }
    return Math.floor(datasets.length / 2) === index ? props.labels : void 0;
  }
  function getChildProps2(props, calculatedProps) {
    const {
      categories,
      domain,
      range: range4,
      scale,
      horizontal,
      origin,
      padding: padding3
    } = calculatedProps;
    const {
      width,
      height,
      theme,
      polar
    } = props;
    return {
      height,
      width,
      theme,
      polar,
      origin,
      categories,
      domain,
      range: range4,
      scale,
      horizontal,
      padding: padding3,
      standalone: false
    };
  }
  function getColorScale3(props, child) {
    const role = child.type && child.type.role;
    const colorScaleOptions = child.props.colorScale || props.colorScale;
    if (role !== "group" && role !== "stack") {
      return void 0;
    }
    return props.theme && props.theme.group ? colorScaleOptions || props.theme.group.colorScale : colorScaleOptions;
  }
  function getDataWithOffset(props, defaultDataset, offset2) {
    if (defaultDataset === void 0) {
      defaultDataset = [];
    }
    const dataset = props.data || props.y ? data_exports.getData(props) : defaultDataset;
    const xOffset = offset2 || 0;
    return dataset.map((datum) => {
      const _x1 = datum._x instanceof Date ? new Date(datum._x.getTime() + xOffset) : datum._x + xOffset;
      return Object.assign({}, datum, {
        _x1
      });
    });
  }
  function getChildren2(initialProps, childComponents, calculatedProps) {
    const props = helpers_exports.modifyProps(initialProps, fallbackProps9, "stack");
    const children = childComponents || import_react101.default.Children.toArray(props.children);
    const newCalculatedProps = calculatedProps || getCalculatedProps3(props, children);
    const {
      datasets
    } = newCalculatedProps;
    const {
      labelComponent,
      polar,
      theme
    } = props;
    const childProps = getChildProps2(props, newCalculatedProps);
    const parentName = props.name || "group";
    return children.map((child, index) => {
      const role = child.type && child.type.role;
      const xOffset = polar ? getPolarX0(props, newCalculatedProps, index, role) : getX0(props, newCalculatedProps, index, role);
      const style = role === "voronoi" || role === "tooltip" || role === "label" ? child.props.style : wrapper_exports.getChildStyle(child, index, newCalculatedProps, theme);
      const labels = props.labels ? getLabels(props, datasets, index) : child.props.labels;
      const name2 = child.props.name || `${parentName}-${role}-${index}`;
      return /* @__PURE__ */ import_react101.default.cloneElement(child, Object.assign({
        labels,
        style,
        key: `${name2}-key-${index}`,
        name: name2,
        data: getDataWithOffset(props, datasets[index], xOffset),
        colorScale: getColorScale3(props, child),
        labelComponent: labelComponent || child.props.labelComponent,
        xOffset
      }, childProps));
    });
  }

  // node_modules/victory-group/es/victory-group.js
  var import_react_fast_compare6 = __toESM(require_react_fast_compare());
  var fallbackProps10 = {
    width: 450,
    height: 300,
    padding: 50,
    offset: 0
  };
  var defaultProps13 = {
    containerComponent: /* @__PURE__ */ import_react102.default.createElement(VictoryContainer, null),
    groupComponent: /* @__PURE__ */ import_react102.default.createElement("g", null),
    samples: 50,
    standalone: true,
    theme: VictoryTheme.grayscale
  };
  var VictoryGroupBase = (initialProps) => {
    const role = VictoryGroup?.role;
    const {
      getAnimationProps,
      setAnimationState,
      getProps: getProps2
    } = hooks_exports.useAnimationState();
    const propsWithDefaults = import_react102.default.useMemo(() => (0, import_defaults29.default)({}, initialProps, defaultProps13), [initialProps]);
    const props = getProps2(propsWithDefaults);
    const modifiedProps = helpers_exports.modifyProps(props, fallbackProps10, role);
    const {
      eventKey,
      containerComponent,
      standalone,
      groupComponent,
      externalEventMutations,
      width,
      height,
      theme,
      polar,
      horizontal,
      name: name2
    } = modifiedProps;
    const childComponents = import_react102.default.Children.toArray(modifiedProps.children);
    const calculatedProps = useMemoizedProps(modifiedProps);
    const {
      domain,
      scale,
      style,
      origin
    } = calculatedProps;
    const newChildren = import_react102.default.useMemo(() => {
      const children = getChildren2(props, childComponents, calculatedProps);
      return children.map((child, index) => {
        const childProps = Object.assign({
          animate: getAnimationProps(props, child, index)
        }, child.props);
        return /* @__PURE__ */ import_react102.default.cloneElement(child, childProps);
      });
    }, [props, childComponents, calculatedProps, getAnimationProps]);
    const containerProps = import_react102.default.useMemo(() => {
      if (standalone) {
        return {
          domain,
          scale,
          width,
          height,
          standalone,
          theme,
          style: style.parent,
          horizontal,
          polar,
          origin,
          name: name2
        };
      }
      return {};
    }, [standalone, domain, scale, width, height, theme, style, horizontal, polar, origin, name2]);
    const userProps = import_react102.default.useMemo(() => user_props_exports.getSafeUserProps(propsWithDefaults), [propsWithDefaults]);
    const container = import_react102.default.useMemo(() => {
      if (standalone) {
        const defaultContainerProps = (0, import_defaults29.default)({}, containerComponent.props, containerProps, userProps);
        return /* @__PURE__ */ import_react102.default.cloneElement(containerComponent, defaultContainerProps);
      }
      return /* @__PURE__ */ import_react102.default.cloneElement(groupComponent, userProps);
    }, [groupComponent, standalone, containerComponent, containerProps, userProps]);
    const events = import_react102.default.useMemo(() => {
      return wrapper_exports.getAllEvents(props);
    }, [props]);
    const previousProps = hooks_exports.usePreviousProps(propsWithDefaults);
    import_react102.default.useEffect(() => {
      return () => {
        if (propsWithDefaults.animate) {
          setAnimationState(previousProps, props);
        }
      };
    }, [setAnimationState, previousProps, propsWithDefaults, props]);
    if (!(0, import_isEmpty9.default)(events)) {
      return /* @__PURE__ */ import_react102.default.createElement(VictorySharedEvents, {
        container,
        eventKey,
        events,
        externalEventMutations
      }, newChildren);
    }
    return /* @__PURE__ */ import_react102.default.cloneElement(container, container.props, newChildren);
  };
  var componentConfig = {
    role: "group",
    expectedComponents: ["groupComponent", "containerComponent", "labelComponent"],
    getChildren: getChildren2
  };
  var VictoryGroup = Object.assign(/* @__PURE__ */ import_react102.default.memo(VictoryGroupBase, import_react_fast_compare6.default), componentConfig);
  VictoryGroup.displayName = "VictoryGroup";

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartGroup/ChartGroup.js
  var ChartGroup = (_a) => {
    var {
      ariaDesc,
      ariaTitle,
      children,
      colorScale: colorScale4,
      containerComponent = React337.createElement(ChartContainer, null),
      hasPatterns,
      patternScale,
      themeColor,
      // destructure last
      theme = getTheme(themeColor)
    } = _a, rest = __rest(_a, ["ariaDesc", "ariaTitle", "children", "colorScale", "containerComponent", "hasPatterns", "patternScale", "themeColor", "theme"]);
    const container = React337.cloneElement(containerComponent, Object.assign(Object.assign({ desc: ariaDesc, title: ariaTitle, theme }, containerComponent.props), {
      className: getClassName({ className: containerComponent.props.className })
      // Override VictoryContainer class name
    }));
    const { defaultColorScale, defaultPatternScale, isPatternDefs, patternId } = useDefaultPatternProps({
      colorScale: colorScale4,
      hasPatterns,
      patternScale,
      themeColorScale: theme.group.colorScale
    });
    return React337.createElement(
      VictoryGroup,
      Object.assign({ colorScale: colorScale4, containerComponent: container, theme }, rest),
      renderChildrenWithPatterns({
        children,
        patternScale: defaultPatternScale,
        themeColor
      }),
      isPatternDefs && getPatternDefs({ patternId, colorScale: defaultColorScale })
    );
  };
  ChartGroup.displayName = "ChartGroup";
  (0, import_hoist_non_react_statics9.default)(ChartGroup, VictoryGroup);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartLine/ChartLine.js
  init_tslib_es6();
  var React340 = __toESM(require_react());
  var import_hoist_non_react_statics10 = __toESM(require_hoist_non_react_statics_cjs());

  // node_modules/victory-line/es/victory-line.js
  var import_react104 = __toESM(require_react());

  // node_modules/victory-line/es/helper-methods.js
  var getCalculatedValues6 = (props) => {
    let data = data_exports.getData(props);
    if (data.length < 2) {
      data = [];
    }
    const range4 = {
      x: helpers_exports.getRange(props, "x"),
      y: helpers_exports.getRange(props, "y")
    };
    const domain = {
      x: domain_exports.getDomain(props, "x"),
      y: domain_exports.getDomain(props, "y")
    };
    const scale = {
      x: scale_exports.getBaseScale(props, "x").domain(domain.x).range(props.horizontal ? range4.y : range4.x),
      y: scale_exports.getBaseScale(props, "y").domain(domain.y).range(props.horizontal ? range4.x : range4.y)
    };
    const origin = props.polar ? props.origin || helpers_exports.getPolarOrigin(props) : void 0;
    const defaultStyles2 = helpers_exports.getDefaultStyles(props, "line");
    const style = helpers_exports.getStyles(props.style, defaultStyles2);
    return {
      domain,
      data,
      scale,
      style,
      origin
    };
  };
  var getBaseProps6 = (initialProps, fallbackProps12) => {
    const modifiedProps = helpers_exports.modifyProps(initialProps, fallbackProps12, "line");
    const props = Object.assign({}, modifiedProps, getCalculatedValues6(modifiedProps));
    const {
      data,
      domain,
      events,
      groupComponent,
      height,
      horizontal,
      interpolation,
      origin,
      padding: padding3,
      polar,
      scale,
      sharedEvents,
      standalone,
      style,
      theme,
      width,
      labels,
      name: name2,
      disableInlineStyles
    } = props;
    const initialChildProps = {
      parent: {
        style: style.parent,
        scale,
        data,
        height,
        width,
        name: name2,
        domain,
        standalone,
        polar,
        origin,
        padding: padding3,
        horizontal
      },
      all: {
        data: {
          horizontal,
          polar,
          origin,
          scale,
          data,
          interpolation,
          groupComponent,
          style: disableInlineStyles ? {} : style.data,
          theme,
          disableInlineStyles
        }
      }
    };
    return data.reduce((childProps, datum, index) => {
      const text = label_helpers_exports.getText(props, datum, index);
      if (text !== void 0 && text !== null || labels && (events || sharedEvents)) {
        const eventKey = !helpers_exports.isNil(datum.eventKey) ? datum.eventKey : index;
        childProps[eventKey] = {
          labels: label_helpers_exports.getProps(props, index)
        };
      }
      return childProps;
    }, initialChildProps);
  };

  // node_modules/victory-line/es/curve.js
  var import_react103 = __toESM(require_react());
  var import_defaults30 = __toESM(require_defaults());
  var evaluateProps9 = (props) => {
    const ariaLabel = helpers_exports.evaluateProp(props.ariaLabel, props);
    const id = helpers_exports.evaluateProp(props.id, props);
    const style = helpers_exports.evaluateStyle(Object.assign({
      fill: "none",
      stroke: "black",
      pointerEvents: "stroke"
    }, props.style), props);
    const tabIndex = helpers_exports.evaluateProp(props.tabIndex, props);
    return Object.assign({}, props, {
      ariaLabel,
      id,
      style,
      tabIndex
    });
  };
  var defaultProps14 = {
    pathComponent: /* @__PURE__ */ import_react103.default.createElement(Path2, null),
    role: "presentation",
    shapeRendering: "auto"
  };
  var Curve = (initialProps) => {
    const props = evaluateProps9((0, import_defaults30.default)({}, initialProps, defaultProps14));
    const userProps = user_props_exports.getSafeUserProps(props);
    const {
      polar,
      origin
    } = props;
    const lineFunction = line_helpers_exports.getLineFunction(props);
    const defaultTransform = polar && origin ? `translate(${origin.x}, ${origin.y})` : void 0;
    const d = lineFunction(props.data);
    return /* @__PURE__ */ import_react103.default.cloneElement(props.pathComponent, {
      ...props.events,
      ...userProps,
      "aria-label": props.ariaLabel,
      d,
      style: props.style,
      transform: props.transform || defaultTransform,
      className: props.className,
      role: props.role,
      shapeRendering: props.shapeRendering,
      clipPath: props.clipPath,
      tabIndex: props.tabIndex
    });
  };

  // node_modules/victory-line/es/victory-line.js
  var fallbackProps11 = {
    width: 450,
    height: 300,
    padding: 50,
    interpolation: "linear"
  };
  var options4 = {
    components: [{
      name: "parent",
      index: "parent"
    }, {
      name: "data",
      index: "all"
    }, {
      name: "labels"
    }]
  };
  var _VictoryLineBase = class _VictoryLineBase extends import_react104.default.Component {
    constructor(props) {
      super(props);
    }
    static getBaseProps(props) {
      return getBaseProps6(props, fallbackProps11);
    }
    // Overridden in native versions
    shouldAnimate() {
      return !!this.props.animate;
    }
    render() {
      const {
        animationWhitelist,
        role
      } = _VictoryLineBase;
      const props = helpers_exports.modifyProps(this.props, fallbackProps11, role);
      if (this.shouldAnimate()) {
        return this.animateComponent(props, animationWhitelist);
      }
      const children = this.renderContinuousData(props);
      const component = props.standalone ? this.renderContainer(props.containerComponent, children) : children;
      return user_props_exports.withSafeUserProps(component, props);
    }
  };
  __publicField(_VictoryLineBase, "animationWhitelist", ["data", "domain", "height", "padding", "samples", "style", "width"]);
  __publicField(_VictoryLineBase, "displayName", "VictoryLine");
  __publicField(_VictoryLineBase, "role", "line");
  __publicField(_VictoryLineBase, "defaultTransitions", default_transitions_exports.continuousTransitions());
  __publicField(_VictoryLineBase, "defaultPolarTransitions", default_transitions_exports.continuousPolarTransitions());
  __publicField(_VictoryLineBase, "continuous", true);
  __publicField(_VictoryLineBase, "defaultProps", {
    containerComponent: /* @__PURE__ */ import_react104.default.createElement(VictoryContainer, null),
    dataComponent: /* @__PURE__ */ import_react104.default.createElement(Curve, null),
    labelComponent: /* @__PURE__ */ import_react104.default.createElement(VictoryLabel, {
      renderInPortal: true
    }),
    groupComponent: /* @__PURE__ */ import_react104.default.createElement(VictoryClipContainer, null),
    samples: 50,
    sortKey: "x",
    sortOrder: "ascending",
    standalone: true,
    theme: VictoryTheme.grayscale
  });
  __publicField(_VictoryLineBase, "getDomain", domain_exports.getDomain);
  __publicField(_VictoryLineBase, "getData", data_exports.getData);
  __publicField(_VictoryLineBase, "expectedComponents", ["dataComponent", "labelComponent", "groupComponent", "containerComponent"]);
  var VictoryLineBase = _VictoryLineBase;
  var VictoryLine = addEvents(VictoryLineBase, options4);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartLine/ChartLine.js
  var ChartLine = (_a) => {
    var {
      containerComponent = React340.createElement(ChartContainer, null),
      themeColor,
      // destructure last
      theme = getTheme(themeColor)
    } = _a, rest = __rest(_a, ["containerComponent", "themeColor", "theme"]);
    const container = React340.cloneElement(containerComponent, Object.assign({ theme }, containerComponent.props));
    return React340.createElement(VictoryLine, Object.assign({ containerComponent: container, theme }, rest));
  };
  ChartLine.displayName = "ChartLine";
  (0, import_hoist_non_react_statics10.default)(ChartLine, VictoryLine);

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartVoronoiContainer/ChartVoronoiContainer.js
  init_tslib_es6();
  var React343 = __toESM(require_react());
  var import_hoist_non_react_statics11 = __toESM(require_hoist_non_react_statics_cjs());

  // node_modules/victory-voronoi-container/es/victory-voronoi-container.js
  var import_react106 = __toESM(require_react());
  var import_defaults31 = __toESM(require_defaults());
  var import_pick4 = __toESM(require_pick());

  // node_modules/victory-voronoi-container/es/voronoi-helpers.js
  var import_isEmpty10 = __toESM(require_isEmpty());
  var import_isRegExp = __toESM(require_isRegExp());
  var import_throttle = __toESM(require_throttle());
  var import_react_fast_compare7 = __toESM(require_react_fast_compare());
  var import_lib = __toESM(require_lib());
  var import_react105 = __toESM(require_react());
  var ON_MOUSE_MOVE_THROTTLE_MS = 32;
  var VoronoiHelpersClass = class {
    constructor() {
      __publicField(this, "onMouseLeave", (evt, targetProps) => {
        this.onMouseMove.cancel();
        const activePoints = targetProps.activePoints || [];
        this.onDeactivated(targetProps, activePoints);
        const inactiveMutations = activePoints.length ? activePoints.map((point6) => this.getInactiveMutations(targetProps, point6)) : [];
        return this.getParentMutation([]).concat(...inactiveMutations);
      });
      __publicField(this, "handleMouseMove", (evt, targetProps) => {
        const activePoints = targetProps.activePoints || [];
        const parentSVG = targetProps.parentSVG || selection_exports.getParentSVG(evt);
        const mousePosition = selection_exports.getSVGEventCoordinates(evt, parentSVG);
        if (!this.withinBounds(targetProps, mousePosition)) {
          this.onDeactivated(targetProps, activePoints);
          const inactiveMutations2 = activePoints.length ? activePoints.map((point6) => this.getInactiveMutations(targetProps, point6)) : [];
          return this.getParentMutation([], mousePosition, parentSVG).concat(...inactiveMutations2);
        }
        const {
          points = [],
          index
        } = this.getVoronoiPoints(targetProps, mousePosition);
        const parentMutations = this.getParentMutation(points, mousePosition, parentSVG, index);
        if (activePoints.length && (0, import_react_fast_compare7.default)(points, activePoints)) {
          return parentMutations;
        }
        this.onActivated(targetProps, points);
        this.onDeactivated(targetProps, activePoints);
        const activeMutations = points.length ? points.map((point6) => this.getActiveMutations(targetProps, point6)) : [];
        const inactiveMutations = activePoints.length ? activePoints.map((point6) => this.getInactiveMutations(targetProps, point6)) : [];
        return parentMutations.concat(...inactiveMutations, ...activeMutations);
      });
      __publicField(this, "onMouseMove", (0, import_throttle.default)(this.handleMouseMove, ON_MOUSE_MOVE_THROTTLE_MS, {
        leading: true,
        trailing: false
      }));
    }
    withinBounds(props, point6) {
      const {
        width,
        height,
        polar,
        origin,
        scale
      } = props;
      const padding3 = helpers_exports.getPadding(props.voronoiPadding);
      const {
        x: x2,
        y: y2
      } = point6;
      if (polar) {
        const distanceSquared = Math.pow(x2 - origin.x, 2) + Math.pow(y2 - origin.y, 2);
        const radius = Math.max(...scale.y.range());
        return distanceSquared < Math.pow(radius, 2);
      }
      return x2 >= padding3.left && x2 <= width - padding3.right && y2 >= padding3.top && y2 <= height - padding3.bottom;
    }
    getDatasets(props) {
      const minDomain = {
        x: collection_exports.getMinValue(props.domain.x),
        y: collection_exports.getMinValue(props.domain.y)
      };
      const children = import_react105.default.Children.toArray(props.children);
      const addMeta = (data, name2, child) => {
        const continuous2 = child && child.type && child.type.continuous;
        const style = child ? child.props && child.props.style : props.style;
        return data.map((datum, index) => {
          const {
            x: x2,
            y: y2,
            y0,
            x0
          } = helpers_exports.getPoint(datum);
          const voronoiX = (Number(x2) + Number(x0)) / 2;
          const voronoiY = (Number(y2) + Number(y0)) / 2;
          return Object.assign({
            _voronoiX: props.voronoiDimension === "y" ? minDomain.x : voronoiX,
            _voronoiY: props.voronoiDimension === "x" ? minDomain.y : voronoiY,
            eventKey: index,
            childName: name2,
            continuous: continuous2,
            style
          }, datum);
        });
      };
      if (props.data) {
        return addMeta(props.data);
      }
      const getData3 = (childProps) => {
        const data = data_exports.getData(childProps);
        return Array.isArray(data) && data.length > 0 ? data : void 0;
      };
      const iteratee = (child, childName) => {
        const childProps = child.props || {};
        const name2 = childProps.name || childName;
        const blacklist = props.voronoiBlacklist || [];
        const blacklistStr = blacklist.filter((value) => !!value && typeof value.valueOf() === "string");
        const blacklistRegExp = blacklist.filter(import_isRegExp.default);
        const isRegExpMatch = blacklistRegExp.some((regExp) => regExp.test(name2));
        if (!data_exports.isDataComponent(child) || blacklistStr.includes(name2) || isRegExpMatch) {
          return null;
        }
        const getChildData2 = child.type && helpers_exports.isFunction(child.type.getData) ? child.type.getData : getData3;
        const childData = getChildData2(child.props);
        return childData ? addMeta(childData, name2, child) : null;
      };
      return helpers_exports.reduceChildren(children, iteratee, props);
    }
    findPoints(datasets, point6) {
      return datasets.filter((d) => {
        return point6._voronoiX === d._voronoiX && point6._voronoiY === d._voronoiY;
      });
    }
    withinRadius(point6, mousePosition, radius) {
      if (!point6) {
        return false;
      }
      if (!radius) {
        return true;
      }
      const {
        x: x2,
        y: y2
      } = mousePosition;
      const distanceSquared = Math.pow(x2 - point6[0], 2) + Math.pow(y2 - point6[1], 2);
      return distanceSquared < Math.pow(radius, 2);
    }
    getVoronoiPoints(props, mousePosition) {
      const datasets = this.getDatasets(props);
      const scaledData = datasets.map((d) => {
        const {
          x: x2,
          y: y2
        } = helpers_exports.scalePoint(props, d);
        return [x2, y2];
      });
      const delaunay = import_lib.default.from(scaledData);
      const index = delaunay.find(mousePosition.x, mousePosition.y);
      const withinRadius = this.withinRadius(scaledData[index], mousePosition, props.radius);
      const points = withinRadius ? this.findPoints(datasets, datasets[index]) : [];
      return {
        points,
        index
      };
    }
    getActiveMutations(props, point6) {
      const {
        childName,
        continuous: continuous2
      } = point6;
      const {
        activateData,
        activateLabels,
        labels
      } = props;
      if (!activateData && !activateLabels) {
        return [];
      }
      const defaultTarget = activateData ? ["data"] : [];
      const targets = labels && !activateLabels ? defaultTarget : defaultTarget.concat("labels");
      if ((0, import_isEmpty10.default)(targets)) {
        return [];
      }
      return targets.map((target) => {
        const eventKey = continuous2 === true && target === "data" ? "all" : point6.eventKey;
        return {
          childName,
          eventKey,
          target,
          mutation: () => ({
            active: true
          })
        };
      });
    }
    getInactiveMutations(props, point6) {
      const {
        childName,
        continuous: continuous2
      } = point6;
      const {
        activateData,
        activateLabels,
        labels
      } = props;
      if (!activateData && !activateLabels) {
        return [];
      }
      const defaultTarget = activateData ? ["data"] : [];
      const targets = labels && !activateLabels ? defaultTarget : defaultTarget.concat("labels");
      if ((0, import_isEmpty10.default)(targets)) {
        return [];
      }
      return targets.map((target) => {
        const eventKey = continuous2 && target === "data" ? "all" : point6.eventKey;
        return {
          childName,
          eventKey,
          target,
          mutation: () => null
        };
      });
    }
    // eslint-disable-next-line max-params
    getParentMutation(activePoints, mousePosition, parentSVG, vIndex) {
      return [{
        target: "parent",
        eventKey: "parent",
        mutation: () => ({
          activePoints,
          mousePosition,
          parentSVG,
          vIndex
        })
      }];
    }
    onActivated(props, points) {
      if (helpers_exports.isFunction(props.onActivated)) {
        props.onActivated(points, props);
      }
    }
    onDeactivated(props, points) {
      if (helpers_exports.isFunction(props.onDeactivated)) {
        props.onDeactivated(points, props);
      }
    }
  };
  var VoronoiHelpers = new VoronoiHelpersClass();

  // node_modules/victory-voronoi-container/es/victory-voronoi-container.js
  var VICTORY_VORONOI_CONTAINER_DEFAULT_PROPS = {
    activateData: true,
    activateLabels: true,
    labelComponent: /* @__PURE__ */ import_react106.default.createElement(VictoryTooltip, null),
    voronoiPadding: 5
  };
  var getPoint2 = (point6) => {
    const whitelist = ["_x", "_x1", "_x0", "_y", "_y1", "_y0"];
    return (0, import_pick4.default)(point6, whitelist);
  };
  var useVictoryVoronoiContainer = (initialProps) => {
    const props = {
      ...VICTORY_VORONOI_CONTAINER_DEFAULT_PROPS,
      ...initialProps
    };
    const {
      children
    } = props;
    const getDimension = () => {
      const {
        horizontal,
        voronoiDimension
      } = props;
      if (!horizontal || !voronoiDimension) {
        return voronoiDimension;
      }
      return voronoiDimension === "x" ? "y" : "x";
    };
    const getLabelPosition = (labelProps, points) => {
      const {
        mousePosition,
        mouseFollowTooltips
      } = props;
      const voronoiDimension = getDimension();
      const point6 = getPoint2(points[0]);
      const basePosition = helpers_exports.scalePoint(props, point6);
      let center = mouseFollowTooltips ? mousePosition : void 0;
      if (!voronoiDimension || points.length < 2) {
        return {
          ...basePosition,
          center: (0, import_defaults31.default)({}, labelProps.center, center)
        };
      }
      const x2 = voronoiDimension === "y" ? mousePosition.x : basePosition.x;
      const y2 = voronoiDimension === "x" ? mousePosition.y : basePosition.y;
      center = mouseFollowTooltips ? mousePosition : {
        x: x2,
        y: y2
      };
      return {
        x: x2,
        y: y2,
        center: (0, import_defaults31.default)({}, labelProps.center, center)
      };
    };
    const getStyle2 = (points, type) => {
      const {
        labels,
        labelComponent,
        theme
      } = props;
      const componentProps = labelComponent.props || {};
      const themeStyles = theme && theme.voronoi && theme.voronoi.style ? theme.voronoi.style : {};
      const componentStyleArray = type === "flyout" ? componentProps.flyoutStyle : componentProps.style;
      return points.reduce((memo4, datum, index) => {
        const labelProps = (0, import_defaults31.default)({}, componentProps, {
          datum,
          active: true
        });
        const text = helpers_exports.isFunction(labels) ? labels(labelProps) : void 0;
        const textArray = text !== void 0 ? `${text}`.split("\n") : [];
        const baseStyle = datum.style && datum.style[type] || {};
        const componentStyle = Array.isArray(componentStyleArray) ? componentStyleArray[index] : componentStyleArray;
        const style = helpers_exports.evaluateStyle((0, import_defaults31.default)({}, componentStyle, baseStyle, themeStyles[type]), labelProps);
        const styleArray = textArray.length ? textArray.map(() => style) : [style];
        return memo4.concat(styleArray);
      }, []);
    };
    const getDefaultLabelProps = (points) => {
      const {
        voronoiDimension,
        horizontal,
        mouseFollowTooltips
      } = props;
      const point6 = getPoint2(points[0]);
      const multiPoint = voronoiDimension && points.length > 1;
      const y2 = point6._y1 !== void 0 ? point6._y1 : point6._y;
      const defaultHorizontalOrientation = y2 < 0 ? "left" : "right";
      const defaultOrientation = y2 < 0 ? "bottom" : "top";
      const labelOrientation = horizontal ? defaultHorizontalOrientation : defaultOrientation;
      const orientation = mouseFollowTooltips ? void 0 : labelOrientation;
      return {
        orientation,
        pointerLength: multiPoint ? 0 : void 0,
        constrainToVisibleArea: multiPoint || mouseFollowTooltips ? true : void 0
      };
    };
    const getLabelProps = (points) => {
      const {
        labels,
        scale,
        labelComponent,
        theme,
        width,
        height
      } = props;
      const componentProps = labelComponent.props || {};
      const text = points.reduce((memo4, datum2) => {
        const labelProps2 = (0, import_defaults31.default)({}, componentProps, {
          datum: datum2,
          active: true
        });
        const t = helpers_exports.isFunction(labels) ? labels(labelProps2) : null;
        if (t === null || t === void 0) {
          return memo4;
        }
        return memo4.concat(`${t}`.split("\n"));
      }, []);
      const {
        childName,
        eventKey,
        style,
        continuous: continuous2,
        ...datum
      } = points[0];
      const name2 = props.name === childName ? childName : `${props.name}-${childName}`;
      const labelProps = (0, import_defaults31.default)({
        key: `${name2}-${eventKey}-voronoi-tooltip`,
        id: `${name2}-${eventKey}-voronoi-tooltip`,
        active: true,
        renderInPortal: false,
        activePoints: points,
        datum,
        scale,
        theme
      }, componentProps, {
        text,
        width,
        height,
        style: getStyle2(points, "labels"),
        flyoutStyle: getStyle2(points, "flyout")[0]
      }, getDefaultLabelProps(points));
      const labelPosition = getLabelPosition(labelProps, points);
      return (0, import_defaults31.default)({}, labelPosition, labelProps);
    };
    const getTooltip = () => {
      const {
        labels,
        activePoints,
        labelComponent
      } = props;
      if (!labels) {
        return null;
      }
      if (Array.isArray(activePoints) && activePoints.length) {
        const labelProps = getLabelProps(activePoints);
        const {
          text
        } = labelProps;
        const showLabel = Array.isArray(text) ? text.filter(Boolean).length : text;
        return showLabel ? /* @__PURE__ */ import_react106.default.cloneElement(labelComponent, labelProps) : null;
      }
      return null;
    };
    return {
      props,
      children: [...import_react106.default.Children.toArray(children), getTooltip()]
    };
  };
  var VictoryVoronoiContainer = (initialProps) => {
    const {
      props,
      children
    } = useVictoryVoronoiContainer(initialProps);
    return /* @__PURE__ */ import_react106.default.createElement(VictoryContainer, props, children);
  };
  VictoryVoronoiContainer.role = "container";
  VictoryVoronoiContainer.defaultEvents = (initialProps) => {
    const props = {
      ...VICTORY_VORONOI_CONTAINER_DEFAULT_PROPS,
      ...initialProps
    };
    const createEventHandler = (handler, disabled) => (
      // eslint-disable-next-line max-params
      (event, targetProps, eventKey, context) => disabled || props.disable ? {} : handler(event, {
        ...props,
        ...targetProps
      }, eventKey, context)
    );
    return [{
      target: "parent",
      eventHandlers: {
        onMouseLeave: createEventHandler(VoronoiHelpers.onMouseLeave),
        onTouchCancel: createEventHandler(VoronoiHelpers.onMouseLeave),
        onMouseMove: createEventHandler(VoronoiHelpers.onMouseMove),
        onTouchMove: createEventHandler(VoronoiHelpers.onMouseMove)
      }
    }, {
      target: "data",
      eventHandlers: props.disable ? {} : {
        onMouseOver: () => null,
        onMouseOut: () => null,
        onMouseMove: () => null
      }
    }];
  };

  // node_modules/@patternfly/react-charts/dist/esm/components/ChartVoronoiContainer/ChartVoronoiContainer.js
  var ChartVoronoiContainer = (_a) => {
    var {
      className,
      constrainToVisibleArea = false,
      themeColor,
      // destructure last
      theme = getTheme(themeColor),
      labelComponent = React343.createElement(ChartTooltip, null)
    } = _a, rest = __rest(_a, ["className", "constrainToVisibleArea", "themeColor", "theme", "labelComponent"]);
    const chartClassName = getClassName({ className });
    const chartLabelComponent = React343.cloneElement(labelComponent, Object.assign({
      constrainToVisibleArea,
      theme
    }, labelComponent.props));
    return (
      // Note: className is valid, but Victory is missing a type
      React343.createElement(VictoryVoronoiContainer, Object.assign({ className: chartClassName, labelComponent: chartLabelComponent, theme }, rest))
    );
  };
  ChartVoronoiContainer.displayName = "ChartVoronoiContainer";
  (0, import_hoist_non_react_statics11.default)(ChartVoronoiContainer, VictoryVoronoiContainer);

  // src/lib/monitor/monitorModals.jsx
  var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
  var _37 = cockpit_default.gettext;
  var MAX_REPORT_JSON_SIZE = 64 * 1024 * 1024;
  var MAX_BINARY_READ_SIZE = 64 * 1024 * 1024;
  var CSV_PREVIEW_LINES = 20;
  var formatLagSeconds = (seconds2, precision = 3) => {
    if (seconds2 === void 0 || seconds2 === null) {
      return null;
    }
    if (seconds2 >= 3600) {
      return `${(seconds2 / 3600).toFixed(precision)}h`;
    }
    if (seconds2 >= 60) {
      return `${(seconds2 / 60).toFixed(precision)}m`;
    }
    return `${seconds2.toFixed(precision)}s`;
  };
  var TaskLogModal = class extends import_react107.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        logData
      } = this.props;
      return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title: _37("Task Log"),
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { variant: "link", onClick: closeHandler, children: _37("Close") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Form, { isHorizontal: true, autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
            TextArea,
            {
              resizeOrientation: "vertical",
              className: "ds-logarea",
              value: logData,
              "aria-label": "text area example"
            }
          ) })
        }
      );
    }
  };
  var AgmtDetailsModal = class extends import_react107.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        agmt
      } = this.props;
      const convertedDate = {};
      const dateAttrs = [
        "last-update-start",
        "last-update-end",
        "last-init-start",
        "last-init-end"
      ];
      for (const attr of dateAttrs) {
        if (agmt[attr][0] === "19700101000000Z") {
          convertedDate[attr] = "Unavailable";
        } else {
          convertedDate[attr] = get_date_string(agmt[attr][0]);
        }
      }
      const btnList = [
        /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { variant: "link", onClick: closeHandler, children: _37("Cancel") }, "cancel")
      ];
      const title = _37("Replication Agreement Details (") + agmt["agmt-name"] + ")";
      return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          isOpen: showModal,
          onClose: closeHandler,
          actions: btnList,
          children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Form, { isHorizontal: true, children: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: _37("Replica") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("i", { children: agmt.replica }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: _37("Agreement Enabled") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("i", { children: agmt["replica-enabled"] }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: _37("Last Init Started") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("i", { children: convertedDate["last-init-start"] }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: _37("Last Init Ended") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("i", { children: convertedDate["last-init-end"] }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: _37("Last Initialization Status") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                TextArea,
                {
                  resizeOrientation: "vertical",
                  className: "ds-textarea",
                  value: agmt["last-init-status"],
                  "aria-label": "text area example"
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: _37("Replication In Progress") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("i", { children: agmt["update-in-progress"] }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: _37("Changes Sent") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("i", { children: agmt["number-changes-sent"] }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: _37("Last Update Started") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("i", { children: convertedDate["last-update-start"] }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: _37("Last Update Ended") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("i", { children: convertedDate["last-update-end"] }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: _37("Last Update Status") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                TextArea,
                {
                  resizeOrientation: "vertical",
                  className: "ds-textarea",
                  value: agmt["last-update-status"],
                  "aria-label": "text area example"
                }
              ) })
            ] })
          ] })
        }
      );
    }
  };
  var ConflictCompareModal = class extends import_react107.default.Component {
    render() {
      const {
        showModal,
        conflictEntry,
        validEntry,
        closeHandler,
        saveHandler,
        handleChange,
        handleRadioChange,
        convertConflictRadio,
        deleteConflictRadio,
        swapConflictRadio,
        newRDN
      } = this.props;
      const ignoreAttrs = [
        "createtimestamp",
        "creatorsname",
        "modifytimestamp",
        "modifiersname",
        "entryid",
        "entrydn",
        "parentid",
        "numsubordinates"
      ];
      let conflict = "dn: " + conflictEntry.dn + "\n";
      let valid = "dn: " + validEntry.dn + "\n";
      let conflictChildren = "0";
      let validChildren = "0";
      let orig_rdn = newRDN;
      if (newRDN === "") {
        orig_rdn = conflictEntry.dn.split("+");
        orig_rdn = orig_rdn[0] + "-MUST_CHANGE";
      }
      for (const key in conflictEntry.attrs) {
        if (key === "numsubordinates") {
          conflictChildren = conflictEntry.attrs[key];
        }
        if (!ignoreAttrs.includes(key)) {
          for (const attr of conflictEntry.attrs[key]) {
            conflict += key + ": " + attr + "\n";
          }
        }
      }
      for (const key in validEntry.attrs) {
        if (key === "numsubordinates") {
          validChildren = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("font", { color: "red", children: validEntry.attrs[key] });
        }
        if (!ignoreAttrs.includes(key)) {
          for (const attr of validEntry.attrs[key]) {
            valid += key + ": " + attr + "\n";
          }
        }
      }
      return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title: _37("Resolve Replication Conflict"),
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { variant: "primary", onClick: () => saveHandler(conflictEntry.dn), children: _37("Resolve Conflict") }, "confirm"),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { variant: "link", onClick: closeHandler, children: _37("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Form, { isHorizontal: true, autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { component: TextVariants.h4, children: _37("Valid Entry") }) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("p", { className: "ds-margin-top ds-right-align ds-font-size-sm", children: [
              _37("Child Entries: "),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: validChildren })
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TextArea, { id: "conflictValid", resizeOrientation: "vertical", className: "ds-conflict", value: valid, readOnlyVariant: "default" }) }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-margin-top-lg", span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { component: TextVariants.h4, children: _37("Conflict Entry") }) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-margin-top-lg", span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("p", { className: "ds-margin-top ds-right-align ds-font-size-sm", children: [
              _37("Child Entries: "),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: conflictChildren })
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TextArea, { id: "conflictConflict", resizeOrientation: "vertical", className: "ds-conflict", value: conflict, readOnlyVariant: "default" }) }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("hr", {}),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ds-container", children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                Radio,
                {
                  name: "resolve-choice",
                  onChange: handleRadioChange,
                  label: _37("Delete Conflict Entry"),
                  id: "deleteConflictRadio",
                  isChecked: deleteConflictRadio
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ds-left-margin", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                Tooltip,
                {
                  position: "top",
                  content: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { children: _37('This will delete the conflict entry, and the "valid" entry will remain intact.') }),
                  children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(OutlinedQuestionCircleIcon, {})
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ds-container ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                Radio,
                {
                  name: "resolve-choice",
                  onChange: handleRadioChange,
                  label: _37("Swap Conflict Entry With Valid Entry"),
                  id: "swapConflictRadio",
                  isChecked: swapConflictRadio
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ds-left-margin", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                Tooltip,
                {
                  className: "ds-margin-left",
                  position: "top",
                  content: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { children: _37('This will replace the "valid" entry with the conflict entry, but keeping the valid entry DN intact.') }),
                  children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(OutlinedQuestionCircleIcon, {})
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ds-container ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                Radio,
                {
                  name: "resolve-choice",
                  onChange: handleRadioChange,
                  label: _37("Convert Conflict Entry Into New Entry"),
                  id: "convertConflictRadio",
                  isChecked: convertConflictRadio
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ds-left-margin", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                Tooltip,
                {
                  position: "top",
                  content: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { children: _37(`The conflict entry uses a multi-valued RDN to specify the original DN and it's nsUniqueID.  To convert the conflict entry to a new entry you must provide a new RDN attribute/value for the new entry.  "RDN_ATTRIBUTE=VALUE".  For example: cn=my_new_entry`) }),
                  children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(OutlinedQuestionCircleIcon, {})
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ds-margin-top ds-margin-left-sm", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
              TextInput,
              {
                placeholder: _37("Enter new RDN here"),
                type: "text",
                onChange: (_event, value) => handleChange(_event),
                "aria-label": "new rdn label",
                id: "convertRDN",
                value: orig_rdn,
                isDisabled: !convertConflictRadio
              }
            ) })
          ] }) })
        }
      );
    }
  };
  var ReportCredentialsModal = class extends import_react107.default.Component {
    render() {
      const {
        handleFieldChange,
        showModal,
        closeHandler,
        newEntry,
        hostname,
        port,
        binddn,
        pwInputInteractive,
        bindpw,
        addConfig,
        editConfig,
        onMinusConfig,
        onPlusConfig,
        onConfigChange
      } = this.props;
      const value = newEntry ? _37("Add") : _37("Edit");
      const title = cockpit_default.format(_37("$0 Report Credentials"), value);
      return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
              Button,
              {
                variant: "primary",
                onClick: newEntry ? addConfig : editConfig,
                isDisabled: hostname === "" || binddn === "" || bindpw === "" && !pwInputInteractive,
                children: _37("Save")
              },
              "save"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { variant: "link", onClick: closeHandler, children: _37("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-label", span: 3, children: _37("Hostname") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                TextInput,
                {
                  value: hostname,
                  type: "text",
                  id: "credsHostname",
                  "aria-describedby": "cachememsize",
                  name: "credsHostname",
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-label", span: 3, children: _37("Port") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                NumberInput,
                {
                  value: port,
                  min: 1,
                  max: 65534,
                  onMinus: () => {
                    onMinusConfig("credsPort");
                  },
                  onChange: (e) => {
                    onConfigChange(e, "credsPort", 1);
                  },
                  onPlus: () => {
                    onPlusConfig("credsPort");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { title: _37("Bind DN for the specified instances"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-label", span: 3, children: _37("Bind DN") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                TextInput,
                {
                  value: binddn,
                  type: "text",
                  id: "credsBinddn",
                  "aria-describedby": "cachememsize",
                  name: "credsBinddn",
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { title: _37("Bind password for the specified instances"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-label", span: 3, children: _37("Password") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                TextInput,
                {
                  value: bindpw,
                  type: "password",
                  id: "credsBindpw",
                  "aria-describedby": "cachememsize",
                  name: "credsBindpw",
                  isDisabled: pwInputInteractive,
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { title: _37("Input the password interactively"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-label", span: 3, children: _37("Interactive Input") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                Checkbox,
                {
                  isChecked: pwInputInteractive,
                  id: "pwInputInteractive",
                  onChange: (e, checked) => {
                    handleFieldChange(e);
                  }
                }
              ) })
            ] })
          ] }) }) })
        }
      );
    }
  };
  var ReportConnectionModal = class extends import_react107.default.Component {
    render() {
      const {
        handleFieldChange,
        showModal,
        closeHandler,
        name: name2,
        hostname,
        port,
        binddn,
        pwInputInteractive,
        bindpw,
        addConn,
        onMinusConfig,
        onPlusConfig,
        onConfigChange
      } = this.props;
      return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title: _37("Add Replica Connection"),
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
              Button,
              {
                variant: "primary",
                onClick: addConn,
                isDisabled: name2 === "" || hostname === "" || port === "" || binddn === "" || bindpw === "" && !pwInputInteractive,
                children: _37("Save")
              },
              "save"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { variant: "link", onClick: closeHandler, children: _37("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-label", span: 3, children: _37("Connection Name") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                TextInput,
                {
                  value: name2,
                  type: "text",
                  id: "connName",
                  "aria-describedby": "connName",
                  name: "connName",
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-label", span: 3, children: _37("Hostname") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                TextInput,
                {
                  value: hostname,
                  type: "text",
                  id: "connHostname",
                  "aria-describedby": "connHostname",
                  name: "connHostname",
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-label", span: 3, children: _37("Port") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                NumberInput,
                {
                  value: port,
                  min: 1,
                  max: 65534,
                  onMinus: () => {
                    onMinusConfig("connPort");
                  },
                  onChange: (e) => {
                    onConfigChange(e, "connPort", 1);
                  },
                  onPlus: () => {
                    onPlusConfig("connPort");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { title: _37("Bind DN for the specified instances"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-label", span: 3, children: _37("Bind DN") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                TextInput,
                {
                  value: binddn,
                  type: "text",
                  id: "connBindDN",
                  "aria-describedby": "connBindDN",
                  name: "connBindDN",
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { title: _37("Bind password for the specified instance.  You can also specify a password file but the filename needs to be inside of brackets [/PATH/FILE]"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-label", span: 3, children: _37("Password") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                TextInput,
                {
                  value: bindpw,
                  type: "password",
                  id: "connCred",
                  "aria-describedby": "connCred",
                  name: "connCred",
                  isDisabled: pwInputInteractive,
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { title: _37("Input the password interactively, stores '*' as the password value in .dsrc"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-label", span: 3, children: _37("Interactive Input") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                Checkbox,
                {
                  isChecked: pwInputInteractive,
                  id: "pwInputInteractive",
                  onChange: (e, checked) => {
                    handleFieldChange(e);
                  }
                }
              ) })
            ] })
          ] }) }) })
        }
      );
    }
  };
  var ReportAliasesModal = class extends import_react107.default.Component {
    render() {
      const {
        handleFieldChange,
        showModal,
        closeHandler,
        newEntry,
        hostname,
        port,
        alias,
        addConfig,
        editConfig,
        onMinusConfig,
        onPlusConfig,
        onConfigChange
      } = this.props;
      const value = newEntry ? _37("Add") : _37("Edit");
      const title = cockpit_default.format(_37("$0 Report Alias"), value);
      return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
              Button,
              {
                variant: "primary",
                onClick: newEntry ? addConfig : editConfig,
                isDisabled: alias === "" || hostname === "",
                children: _37("Save")
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { variant: "link", onClick: closeHandler, children: _37("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { title: _37("Alias name for the instance"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-label", span: 3, children: _37("Alias") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                TextInput,
                {
                  value: alias,
                  type: "text",
                  id: "aliasName",
                  "aria-describedby": "aliasName",
                  name: "aliasName",
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { title: _37("An instance hostname"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-label", span: 3, children: _37("Hostname") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                TextInput,
                {
                  value: hostname,
                  type: "text",
                  id: "aliasHostname",
                  "aria-describedby": "aliasHostname",
                  name: "aliasHostname",
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { title: _37("An instance port"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-label", span: 3, children: _37("Port") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                NumberInput,
                {
                  value: port,
                  min: 1,
                  max: 65534,
                  onMinus: () => {
                    onMinusConfig("aliasPort");
                  },
                  onChange: (e) => {
                    onConfigChange(e, "aliasPort", 1);
                  },
                  onPlus: () => {
                    onPlusConfig("aliasPort");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) })
            ] })
          ] }) }) })
        }
      );
    }
  };
  var ReportLoginModal = class extends import_react107.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        processCredsInput,
        instanceName,
        disableBinddn,
        loginBinddn,
        loginBindpw
      } = this.props;
      const title = cockpit_default.format(_37("Replication Login Credentials for $0"), instanceName);
      return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
              Button,
              {
                variant: "primary",
                isDisabled: loginBinddn === "" || loginBindpw === "",
                onClick: processCredsInput,
                children: _37("Confirm Credentials Input")
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { variant: "link", onClick: closeHandler, children: _37("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { component: TextVariants.h5, children: _37("In order to get the replication agreement lag times and state, the authentication credentials to the remote replicas must be provided.") }) }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("hr", {}),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { component: TextVariants.h5, children: _37("Bind DN was acquired from <b>Replica Credentials</b> table. If you want to bind as another user, change or remove the Bind DN there.") }) }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { className: "ds-margin-top-lg", title: _37("Bind DN for the instance"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-label", span: 3, children: _37("Bind DN") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                TextInput,
                {
                  value: loginBinddn,
                  type: "text",
                  id: "loginBinddn",
                  "aria-describedby": "loginBinddn",
                  name: "loginBinddn",
                  isDisabled: disableBinddn,
                  onChange: (e, str) => {
                    handleChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { title: _37("Password for the Bind DN"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { className: "ds-label", span: 3, children: _37("Password") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                TextInput,
                {
                  value: loginBindpw,
                  type: "password",
                  id: "loginBindpw",
                  "aria-describedby": "loginBindpw",
                  name: "loginBindpw",
                  onChange: (e, str) => {
                    handleChange(e);
                  }
                }
              ) })
            ] })
          ] })
        }
      );
    }
  };
  var FullReportContent = class extends import_react107.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        oneTableReport: false,
        showDisabledAgreements: false
      };
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
    }
    handleSwitchChange(e) {
      if (typeof e === "boolean") {
        this.setState({
          oneTableReport: e
        });
      } else {
        this.setState({
          [e.target.id]: e.target.checked
        });
      }
    }
    render() {
      const {
        reportData,
        handleRefresh,
        reportRefreshing,
        reportLoading
      } = this.props;
      let suppliers = [];
      let supplierName;
      let supplierData;
      let resultGrids = [];
      let spinner = "";
      if (reportLoading) {
        const value = reportRefreshing ? _37("Refreshing") : _37("Loading");
        spinner = /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { title: _37("Do the refresh every few seconds"), children: [
          cockpit_default.format(_37("$0 the report..."), value),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Spinner, { className: "ds-left-margin", size: "lg" })
        ] });
      }
      let reportHeader = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { className: "ds-margin-top-xlg", component: TextVariants.h4, children: _37("There is no report, you must first generate the report in the <b>Prepare Report</b> tab.") }) });
      if (reportData.length > 0) {
        reportHeader = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Form, { isHorizontal: true, autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
            Checkbox,
            {
              title: _37("Display all agreements including the disabled ones and the ones we failed to connect to"),
              isChecked: this.state.showDisabledAgreements,
              id: "showDisabledAgreements",
              onChange: (e, checked) => {
                this.handleSwitchChange(e);
              },
              label: _37("Show Disabled Agreements")
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
            Button,
            {
              variant: "secondary",
              onClick: handleRefresh,
              className: "ds-float-right",
              children: _37("Refresh Report")
            },
            "refresh"
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
            Checkbox,
            {
              isChecked: this.state.oneTableReport,
              onChange: (e, checked) => {
                this.handleSwitchChange(e);
              },
              id: "oneTableReport",
              title: _37("Show all data in one table (it makes it easier to check lag times)"),
              label: _37("Table View")
            }
          ) })
        ] }) }) });
      }
      if (this.state.oneTableReport) {
        for (const supplier of reportData) {
          for (const replica of supplier.data) {
            let idx = replica.agmts_status.length;
            const agmts = JSON.parse(JSON.stringify(replica.agmts_status));
            while (idx--) {
              if (!this.state.showDisabledAgreements && "replica-enabled" in agmts[idx] && agmts[idx]["replica-enabled"][0] === "off") {
                agmts.splice(idx, 1);
              }
            }
            resultGrids = resultGrids.concat(agmts);
          }
        }
        suppliers = [/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
          ReportSingleTable,
          {
            rows: resultGrids,
            viewAgmt: this.props.viewAgmt
          },
          resultGrids
        ) }, "supp1")];
      } else {
        for (const supplier of reportData) {
          const s_data = supplier.data;
          if (s_data.length === 1 && (s_data[0].replica_status.startsWith("Unavailable") || s_data[0].replica_status.startsWith("Unreachable"))) {
            supplierData = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text, { className: "ds-margin-top-xlg", component: TextVariants.h4, children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: _37("Can not get replication information from Replica:") }),
              "\xA0\xA0",
              s_data[0].replica_status
            ] }) }) });
          } else {
            const supData = JSON.parse(JSON.stringify(supplier.data));
            for (const replica of supData) {
              let idx = replica.agmts_status.length;
              while (idx--) {
                if (!this.state.showDisabledAgreements && "replica-enabled" in replica.agmts_status[idx] && replica.agmts_status[idx]["replica-enabled"][0] === "off") {
                  replica.agmts_status.splice(idx, 1);
                }
              }
            }
            supplierData = supData.map((replica) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
              Grid,
              {
                className: "ds-margin-top-lg",
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 2, children: _37("Replica Root") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: replica.replica_root }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 2, children: _37("Replica ID") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: replica.replica_id }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 2, children: _37("Max CSN") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: replica.maxcsn }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 2, children: _37("Replica Status") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: replica.replica_status }) }),
                  "agmts_status" in replica && replica.agmts_status.length > 0 && "agmt-name" in replica.agmts_status[0] ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                    ReportConsumersTable,
                    {
                      rows: replica.agmts_status,
                      viewAgmt: this.props.viewAgmt
                    },
                    replica.agmts_status
                  ) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { component: TextVariants.h4, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("i", { children: _37("No Agreements Were Found") }) }) }) })
                ]
              },
              replica.replica_root + replica.replica_id
            ));
          }
          supplierName = /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ds-margin-top-xlg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TextContent, { title: _37("Supplier host:port (and alias if applicable)"), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text, { component: TextVariants.h2, children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CopyIcon, {}),
              "\xA0\xA0",
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("b", { children: _37("Supplier:") }),
              "\xA0\xA0",
              supplier.name
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("hr", {}),
            supplierData
          ] }, supplier.name);
          suppliers.push(supplierName);
        }
      }
      let report = suppliers.map((supplier) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { children: supplier }, supplier.key));
      if (reportLoading) {
        report = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 12, className: "ds-center ds-margin-top", children: spinner });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { children: [
        reportHeader,
        report,
        /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("hr", {})
      ] });
    }
  };
  var ScatterLineChart = class extends import_react107.default.PureComponent {
    constructor(props) {
      super(props);
      this.containerRef = import_react107.default.createRef();
      this.observer = () => {
      };
      this.state = {
        width: 0,
        showLegend: this.props.defaultShowLegend !== false,
        hiddenSeries: {}
      };
      this._resizeTimer = null;
      this._seriesCache = null;
      this.handleResize = () => {
        if (this._resizeTimer) {
          clearTimeout(this._resizeTimer);
        }
        this._resizeTimer = setTimeout(() => {
          if (this.containerRef.current && this.containerRef.current.clientWidth) {
            this.setState({ width: this.containerRef.current.clientWidth });
          }
        }, 250);
      };
      this.toggleLegendItem = this.toggleLegendItem.bind(this);
      this.handlePointClick = this.handlePointClick.bind(this);
    }
    handlePointClick(datum, seriesIndex) {
      if (this.props.onPointClick && datum.csnId) {
        this.props.onPointClick(datum);
      }
    }
    componentDidMount() {
      this.observer = getResizeObserver(this.containerRef.current, this.handleResize);
      this.handleResize();
    }
    componentWillUnmount() {
      this.observer();
      if (this._resizeTimer) {
        clearTimeout(this._resizeTimer);
        this._resizeTimer = null;
      }
    }
    toggleLegendItem(idx) {
      this.setState((prev) => ({
        hiddenSeries: { ...prev.hiddenSeries, [idx]: !prev.hiddenSeries[idx] }
      }));
    }
    _getSeriesSnapshot() {
      const { chartData, minY, maxY } = this.props;
      const cache = this._seriesCache;
      if (cache && cache.chartData === chartData && cache.minY === minY && cache.maxY === maxY) {
        return cache;
      }
      const baseSeries = Array.isArray(chartData?.series) ? chartData.series : [];
      const processedSeries = baseSeries.map((series) => {
        const datapoints = (series.datapoints || []).map((dp) => {
          const parsed = new Date(dp.x);
          if (isNaN(parsed.getTime())) {
            console.warn("Omitting invalid date value in chart data:", dp.x);
            return null;
          }
          return { ...dp, x: parsed, name: dp.name };
        }).filter((dp) => dp !== null);
        return { ...series, datapoints };
      });
      const allYValues = [];
      processedSeries.forEach((s2) => s2.datapoints.forEach((dp) => allYValues.push(dp.y)));
      const computedMin = minY != null ? minY : allYValues.length ? Math.max(0, Math.min(...allYValues) * 0.9) : 0;
      const computedMax = maxY != null ? maxY : allYValues.length ? Math.max(...allYValues) * 1.1 : 10;
      const snapshot = {
        chartData,
        minY,
        maxY,
        series: processedSeries,
        yDomain: { min: computedMin, max: computedMax }
      };
      this._seriesCache = snapshot;
      return snapshot;
    }
    render() {
      const { width } = this.state;
      const { chartData, title, yAxisLabel, xAxisLabel } = this.props;
      if (!chartData || !chartData.series || chartData.series.length === 0) {
        return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(EmptyState, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateIcon, { icon: "info" }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Title, { headingLevel: "h2", size: "lg", children: _37("No data available") }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateBody, { children: _37("There is no data available for this chart.") })
        ] });
      }
      if (!width || width <= 0) {
        return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { ref: this.containerRef, style: { height: "400px" }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Spinner, { size: "lg" }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "ds-margin-top", children: _37("Preparing chart...") })
        ] }) });
      }
      const { series, yDomain } = this._getSeriesSnapshot();
      const formatTimeValue = (seconds2) => formatLagSeconds(seconds2, 3);
      const formatTooltip = (datum) => {
        if (datum.childName && datum.childName.includes("line-")) {
          if (datum.hoverInfo) {
            return datum.hoverInfo.split(/<br\s*\/?>/i).join("\n");
          }
          return `${datum.name}: ${formatTimeValue(datum.y)}`;
        }
        return null;
      };
      const safeWidth = Math.max(width, 10);
      const safeHeight = 400;
      const visibleSeriesCount = series.filter((s2, idx) => !this.state.hiddenSeries[idx]).length;
      return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { ref: this.containerRef, children: [
        /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { style: { height: safeHeight + "px" }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
          Chart,
          {
            ariaDesc: title || "Replication data chart",
            ariaTitle: title || "Replication data chart",
            containerComponent: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
              ChartVoronoiContainer,
              {
                labels: ({ datum }) => formatTooltip(datum),
                constrainToVisibleArea: true,
                labelComponent: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                  ChartTooltip,
                  {
                    orientation: ({ datum }) => {
                      const yMax = yDomain.max;
                      const yMin = yDomain.min;
                      const yRange = yMax - yMin;
                      const threshold2 = yMin + yRange * 0.6;
                      return datum.y > threshold2 ? "bottom" : "top";
                    },
                    style: {
                      fontSize: "12px",
                      padding: 10,
                      whiteSpace: "pre-line",
                      // Important for newlines
                      pointerEvents: "none"
                    },
                    flyoutStyle: {
                      pointerEvents: "none"
                    },
                    dx: 0,
                    dy: ({ datum }) => {
                      const yMax = yDomain.max;
                      const yMin = yDomain.min;
                      const yRange = yMax - yMin;
                      const threshold2 = yMin + yRange * 0.6;
                      return datum.y > threshold2 ? 10 : -10;
                    }
                  }
                )
              }
            ),
            height: safeHeight,
            maxDomain: { y: yDomain.max },
            minDomain: { y: yDomain.min },
            padding: {
              bottom: 75,
              left: 90,
              right: 50,
              top: 50
            },
            themeColor: ChartThemeColor.blue,
            width: safeWidth,
            scale: { x: "time" },
            style: {
              background: { fill: "var(--pf-v5-global--BackgroundColor--100, #f9f9f9)" },
              axis: {
                grid: { stroke: "var(--pf-v5-global--BorderColor--100, #e8e8e8)", strokeWidth: 1 },
                ticks: { stroke: "var(--pf-v5-global--Color--200, #999)", size: 5 }
              },
              legend: {
                labels: {
                  fill: "var(--pf-v5-chart-global--label--Fill, currentColor)"
                }
              }
            },
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                ChartAxis,
                {
                  label: xAxisLabel || "",
                  fixLabelOverlap: true,
                  tickCount: 5,
                  tickFormat: (t) => {
                    return new Date(t).toLocaleString(void 0, {
                      month: "2-digit",
                      day: "2-digit",
                      hour: "2-digit",
                      minute: "2-digit",
                      second: "2-digit",
                      hour12: false
                    });
                  },
                  style: {
                    axisLabel: {
                      fontSize: 14,
                      padding: 40,
                      fill: "var(--pf-v5-chart-global--label--Fill, currentColor)"
                    },
                    tickLabels: {
                      fontSize: 12,
                      padding: 5,
                      fill: "var(--pf-v5-chart-global--label--Fill, currentColor)"
                    }
                  }
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                ChartAxis,
                {
                  dependentAxis: true,
                  showGrid: true,
                  label: yAxisLabel || "Value",
                  tickFormat: (t) => {
                    if (t >= 3600) {
                      const hours = (t / 3600).toFixed(1);
                      return `${hours}h`;
                    } else if (t >= 60) {
                      const minutes = (t / 60).toFixed(1);
                      return `${minutes}m`;
                    } else {
                      return `${t.toFixed(1)}s`;
                    }
                  },
                  style: {
                    axisLabel: {
                      fontSize: 14,
                      padding: 70,
                      fill: "var(--pf-v5-chart-global--label--Fill, currentColor)"
                    },
                    tickLabels: {
                      fontSize: 12,
                      padding: 5,
                      fill: "var(--pf-v5-chart-global--label--Fill, currentColor)"
                    },
                    grid: {
                      stroke: "var(--pf-v5-global--BorderColor--100)"
                    }
                  }
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ChartGroup, { children: series.map((s2, idx) => {
                if (this.state.hiddenSeries[idx]) {
                  return null;
                }
                const hasClickHandler = !!this.props.onPointClick;
                return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                  ChartScatter,
                  {
                    name: `scatter-${idx}`,
                    data: s2.datapoints,
                    style: {
                      data: {
                        fill: s2.color,
                        cursor: hasClickHandler ? "pointer" : "default"
                      }
                    },
                    events: hasClickHandler ? [{
                      target: "data",
                      eventHandlers: {
                        onClick: () => [{
                          target: "data",
                          mutation: (props) => {
                            this.handlePointClick(props.datum, idx);
                            return null;
                          }
                        }],
                        onMouseOver: () => [{
                          target: "data",
                          mutation: (props) => ({
                            style: {
                              ...props.style,
                              fill: s2.color,
                              cursor: "pointer",
                              strokeWidth: 2,
                              stroke: "var(--pf-v5-global--active-color--100, #0066cc)",
                              r: 6
                            }
                          })
                        }],
                        onMouseOut: () => [{
                          target: "data",
                          mutation: () => null
                        }]
                      }
                    }] : void 0
                  },
                  `scatter-${idx}`
                );
              }) }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ChartGroup, { children: series.map((s2, idx) => {
                if (this.state.hiddenSeries[idx]) {
                  return null;
                }
                return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                  ChartLine,
                  {
                    name: `line-${idx}`,
                    data: s2.datapoints,
                    style: {
                      data: {
                        stroke: s2.color,
                        strokeWidth: 2,
                        strokeDasharray: s2.style?.data?.strokeDasharray
                      }
                    }
                  },
                  `line-${idx}`
                );
              }) })
            ]
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { style: { display: "flex", justifyContent: "flex-end", marginTop: "8px" }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
          Button,
          {
            variant: "link",
            "aria-pressed": this.state.showLegend,
            countOptions: { isRead: true, count: visibleSeriesCount },
            onClick: () => this.setState({ showLegend: !this.state.showLegend }),
            children: this.state.showLegend ? _37("Hide legend") : _37("Show legend")
          }
        ) }),
        this.state.showLegend && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { style: { marginTop: "4px" }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { style: { display: "flex", flexWrap: "wrap", gap: "var(--pf-v5-global--spacer--md)" }, children: series.map((s2, idx) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
          "button",
          {
            type: "button",
            "aria-pressed": !this.state.hiddenSeries[idx],
            onClick: () => this.toggleLegendItem(idx),
            style: {
              display: "flex",
              alignItems: "center",
              cursor: "pointer",
              opacity: this.state.hiddenSeries[idx] ? 0.4 : 1,
              border: "none",
              background: "none",
              padding: 0,
              margin: 0
            },
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                "span",
                {
                  "aria-hidden": "true",
                  style: {
                    display: "inline-block",
                    width: 12,
                    height: 12,
                    background: s2.color,
                    marginRight: 8,
                    borderRadius: 2
                  }
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { style: { color: "var(--pf-v5-chart-global--label--Fill, currentColor)", fontSize: 14 }, children: s2.legendItem?.name || s2.name || `Series ${idx + 1}` })
            ]
          },
          `legend-${idx}`
        )) }) })
      ] });
    }
  };
  var CSNDetailModal = class extends import_react107.default.Component {
    constructor(props) {
      super(props);
      this.formatTimestamp = this.formatTimestamp.bind(this);
      this.formatLag = this.formatLag.bind(this);
    }
    formatTimestamp(isoString) {
      if (!isoString) return _37("Unknown");
      try {
        const date2 = new Date(isoString);
        if (isNaN(date2.getTime())) {
          console.warn("Invalid timestamp format:", isoString);
          return cockpit_default.format(_37("Invalid: $0"), isoString);
        }
        return date2.toLocaleString(void 0, {
          year: "numeric",
          month: "2-digit",
          day: "2-digit",
          hour: "2-digit",
          minute: "2-digit",
          second: "2-digit",
          fractionalSecondDigits: 3,
          hour12: false
        });
      } catch (e) {
        console.warn("Error formatting timestamp:", isoString, e);
        return cockpit_default.format(_37("Invalid: $0"), isoString);
      }
    }
    formatLag(seconds2) {
      return formatLagSeconds(seconds2, 3) || _37("N/A");
    }
    render() {
      const { csnData, onClose } = this.props;
      if (!csnData) {
        return null;
      }
      const arrivals = csnData.arrivals || [];
      const pathJson = JSON.stringify(csnData, null, 2);
      return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
        Modal,
        {
          variant: ModalVariant.large,
          title: _37("CSN Propagation Details"),
          isOpen: !!csnData,
          onClose,
          "aria-label": _37("CSN propagation details"),
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { variant: "primary", onClick: onClose, children: _37("Close") }, "close")
          ],
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Card, { isFlat: true, className: "ds-margin-bottom-md", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { hasGutter: true, children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionList, { isHorizontal: true, isCompact: true, children: [
                /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionListGroup, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListTerm, { children: _37("CSN") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListDescription, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                    ClipboardCopy,
                    {
                      variant: ClipboardCopyVariant.inline,
                      children: csnData.csn
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionListGroup, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListTerm, { children: _37("Entry DN") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListDescription, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Tooltip, { content: csnData.targetDn, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "pf-v5-u-text-truncate", style: { maxWidth: "300px", display: "inline-block" }, children: csnData.targetDn }) }) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionListGroup, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListTerm, { children: _37("Suffix") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListDescription, { children: csnData.suffix })
                ] })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionList, { isHorizontal: true, isCompact: true, children: [
                /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionListGroup, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListTerm, { children: _37("Origin Server") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListDescription, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Label, { color: "blue", icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ServerIcon, {}), children: csnData.originServer }) })
                ] }),
                csnData.originIncludedInArrivals === false && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionListGroup, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListTerm, { children: _37("Origin Note") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListDescription, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { component: TextVariants.small, style: { color: "var(--pf-v5-global--Color--200)" }, children: _37("Origin server record is outside the selected time range; entry details reflect the earliest arrival.") }) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionListGroup, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListTerm, { children: _37("Total Lag") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListDescription, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("strong", { children: this.formatLag(csnData.globalLag) }) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionListGroup, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListTerm, { children: _37("Servers Reached") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionListDescription, { children: [
                    csnData.serverCount,
                    csnData.replicatedToAll && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Label, { color: "green", icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CheckCircleIcon, {}), className: "ds-left-margin", children: _37("All") })
                  ] })
                ] })
              ] }) })
            ] }) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Card, { isFlat: true, className: "ds-margin-bottom-md", children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CardTitle, { children: _37("Arrival Timeline") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(CardBody, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                  Text,
                  {
                    component: TextVariants.small,
                    className: "ds-margin-bottom",
                    style: { color: "var(--pf-v5-global--Color--200)", fontStyle: "italic" },
                    children: _37("Note: Shows arrival order by time. Actual replication topology may differ in fan-out configurations.")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                  "div",
                  {
                    role: "list",
                    "aria-label": _37("CSN propagation timeline"),
                    style: {
                      display: "flex",
                      flexWrap: "wrap",
                      alignItems: "center",
                      gap: "var(--pf-v5-global--spacer--sm)",
                      padding: "var(--pf-v5-global--spacer--sm)"
                    },
                    children: arrivals.map((arrival, idx) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_react107.default.Fragment, { children: [
                      /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
                        "div",
                        {
                          role: "listitem",
                          "aria-label": cockpit_default.format(
                            arrival.isOrigin ? _37("Origin server: $0") : _37("Server $0, delay: $1"),
                            arrival.server,
                            arrival.isOrigin ? "" : this.formatLag(arrival.relativeDelay)
                          ),
                          style: {
                            display: "flex",
                            flexDirection: "column",
                            alignItems: "center",
                            padding: "var(--pf-v5-global--spacer--sm)",
                            backgroundColor: arrival.isOrigin ? "var(--pf-v5-global--palette--blue-50, #e7f1fa)" : "var(--pf-v5-global--BackgroundColor--200, #f0f0f0)",
                            borderRadius: "var(--pf-v5-global--BorderRadius--sm)",
                            border: arrival.isOrigin ? "2px solid var(--pf-v5-global--primary-color--100, #0066cc)" : "1px solid var(--pf-v5-global--BorderColor--100, #d2d2d2)",
                            minWidth: "120px"
                          },
                          children: [
                            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { component: TextVariants.small, style: { fontWeight: "bold" }, children: arrival.server }),
                            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { component: TextVariants.small, style: { fontSize: "0.75rem", color: "var(--pf-v5-global--Color--200)" }, children: this.formatTimestamp(arrival.timestamp) }),
                            arrival.isOrigin && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Label, { color: "blue", isCompact: true, style: { marginTop: "4px" }, children: _37("Origin") }),
                            !arrival.isOrigin && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Text, { component: TextVariants.small, style: { marginTop: "4px", color: "var(--pf-v5-global--success-color--100)" }, children: [
                              "+",
                              this.formatLag(arrival.relativeDelay)
                            ] })
                          ]
                        }
                      ),
                      idx < arrivals.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
                        "div",
                        {
                          role: "presentation",
                          "aria-hidden": "true",
                          style: {
                            display: "flex",
                            flexDirection: "column",
                            alignItems: "center",
                            padding: "0 var(--pf-v5-global--spacer--xs)"
                          },
                          children: [
                            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ArrowRightIcon, { style: { color: "var(--pf-v5-global--Color--200)" } }),
                            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { component: TextVariants.small, style: {
                              fontSize: "0.7rem",
                              color: "var(--pf-v5-global--Color--200)",
                              whiteSpace: "nowrap"
                            }, children: arrivals[idx + 1].hopLag !== void 0 ? this.formatLag(arrivals[idx + 1].hopLag) : "" })
                          ]
                        }
                      )
                    ] }, idx))
                  }
                )
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Card, { isFlat: true, className: "ds-margin-bottom-md", children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CardTitle, { children: _37("Arrival Details") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("table", { className: "pf-v5-c-table pf-m-compact", role: "grid", children: [
                /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("tr", { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("th", { children: _37("Server") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("th", { children: _37("Arrival Time") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("th", { children: _37("Hop Lag") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("th", { children: _37("Cumulative Delay") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("th", { children: _37("Duration") })
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("tbody", { children: arrivals.map((arrival, idx) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("tr", { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("td", { children: [
                    arrival.server,
                    arrival.isOrigin && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { style: { color: "var(--pf-v5-global--primary-color--100)", marginLeft: "var(--pf-v5-global--spacer--xs)" }, children: [
                      "(",
                      _37("Origin"),
                      ")"
                    ] })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("td", { children: this.formatTimestamp(arrival.timestamp) }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("td", { children: arrival.isOrigin ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("em", { children: _37("Origin") }) : this.formatLag(arrival.hopLag) }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("td", { children: this.formatLag(arrival.relativeDelay) }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("td", { children: arrival.duration ? this.formatLag(arrival.duration) : _37("N/A") })
                ] }, idx)) })
              ] }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Split, { hasGutter: true, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SplitItem, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
              ClipboardCopy,
              {
                variant: ClipboardCopyVariant.expansion,
                isExpanded: false,
                isCode: true,
                isReadOnly: true,
                hoverTip: _37("Copy full path JSON"),
                clickTip: _37("Copied!"),
                children: pathJson
              }
            ) }) })
          ]
        }
      );
    }
  };
  CSNDetailModal.propTypes = {
    csnData: import_prop_types36.default.object,
    onClose: import_prop_types36.default.func.isRequired
  };
  CSNDetailModal.defaultProps = {
    csnData: null
  };
  var LagReportModal = class extends import_react107.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: 0,
        ...this._freshReportState(),
        loadingSummary: false,
        loadingJson: false,
        loadingCsv: false,
        loadingPng: false,
        selectedCsnId: null
      };
      this.handleTabClick = this.handleTabClick.bind(this);
      this.loadData = this.loadData.bind(this);
      this.loadPngAsDataUrl = this.loadPngAsDataUrl.bind(this);
      this.downloadFile = this.downloadFile.bind(this);
      this.openInNewWindow = this.openInNewWindow.bind(this);
      this.renderSummaryTab = this.renderSummaryTab.bind(this);
      this.renderChartsTab = this.renderChartsTab.bind(this);
      this.renderPngTab = this.renderPngTab.bind(this);
      this.renderCsvTab = this.renderCsvTab.bind(this);
      this.renderReportFilesTab = this.renderReportFilesTab.bind(this);
      this.handleCsnPointClick = this.handleCsnPointClick.bind(this);
      this.handleCloseCsnDetails = this.handleCloseCsnDetails.bind(this);
      this._activeLoadToken = 0;
      this._isMounted = false;
      this._clientSamplingCap = {
        primary: 2e3,
        hop: 600
      };
    }
    _freshReportState(overrides = {}) {
      return {
        csvPreview: null,
        jsonData: null,
        error: null,
        pngDataUrl: null,
        pngError: false,
        summary: null,
        suffixStats: {},
        clientSamplingNotice: null,
        selectedCsnId: null,
        ...overrides
      };
    }
    handleCsnPointClick(datum) {
      if (datum && datum.csnId) {
        const { jsonData } = this.state;
        if (jsonData && jsonData.csnDetails && jsonData.csnDetails[datum.csnId]) {
          this.setState({ selectedCsnId: datum.csnId });
        } else {
          console.warn("CSN details not available for:", datum.csnId);
        }
      }
    }
    handleCloseCsnDetails() {
      this.setState({ selectedCsnId: null });
    }
    componentDidMount() {
      this._isMounted = true;
      this.loadData();
    }
    componentDidUpdate(prevProps) {
      if (this.props.reportUrls !== prevProps.reportUrls) {
        this.loadData();
      }
    }
    componentWillUnmount() {
      this._isMounted = false;
      if (this.state.pngDataUrl && this.state.pngDataUrl.startsWith("blob:")) {
        URL.revokeObjectURL(this.state.pngDataUrl);
      }
    }
    handleTabClick(event, tabIndex) {
      this.setState({ activeTabKey: tabIndex });
    }
    loadData() {
      const reportUrls = this.props.reportUrls || {};
      const loadToken = this._activeLoadToken + 1;
      this._activeLoadToken = loadToken;
      this.setState((prevState) => ({
        ...this._freshReportState(),
        activeTabKey: prevState.activeTabKey,
        loadingSummary: false,
        loadingJson: false,
        loadingCsv: false,
        loadingPng: false
      }));
      if (reportUrls.summary) {
        this._fetchSummary(reportUrls.summary, loadToken);
      }
      if (reportUrls.json) {
        this._fetchJsonData(reportUrls.json, loadToken);
      }
      if (reportUrls.csv) {
        this._fetchCsvPreview(reportUrls.csv, loadToken);
      }
      if (reportUrls.png) {
        this.loadPngAsDataUrl(reportUrls.png, loadToken);
      }
    }
    _isActive(loadToken) {
      return this._isMounted && this._activeLoadToken === loadToken;
    }
    _isTooLargeError(err) {
      if (!err) {
        return false;
      }
      if (err.problem === "too-large" || err.code === 413 || err.status === 413) {
        return true;
      }
      const message = err.message || (typeof err.toString === "function" ? err.toString() : "");
      if (!message) {
        return false;
      }
      return String(message).toLowerCase().indexOf("too much data") !== -1;
    }
    _handleLoadedJsonData(rawData, options5 = {}) {
      const { forcedSampling = false, samplingResult: precomputedSampling = null } = options5;
      const samplingResult = precomputedSampling || this._applyClientSamplingForDisplay(rawData);
      let notice = null;
      if (samplingResult.applied) {
        notice = forcedSampling ? _37("Charts were down-sampled automatically because the dataset is very large. Adjust filters or the time range to reduce the dataset, or download the full JSON/CSV for complete details.") : _37("Charts are down-sampled for responsiveness. Adjust filters or the time range for a smaller dataset if you need finer detail.");
      } else if (forcedSampling) {
        notice = _37("The dataset is very large. Charts are shown in full resolution and may respond slowly. Adjust filters or the time range if the UI becomes unresponsive.");
      }
      this.setState({
        jsonData: samplingResult.sampledData,
        clientSamplingNotice: notice,
        error: null
      });
    }
    async _readJsonFile(path2, options5) {
      const fileHandle = cockpit_default.file(path2, options5);
      try {
        const content = await fileHandle.read();
        return JSON.parse(content);
      } finally {
        try {
          fileHandle.close();
        } catch (closeErr) {
          console.error("Error closing JSON file handle:", closeErr);
        }
      }
    }
    async _fetchJsonData(jsonPath, loadToken) {
      if (!this._isActive(loadToken)) {
        return;
      }
      this.setState({ loadingJson: true });
      try {
        const data = await this._readJsonFile(jsonPath, { max_read_size: MAX_REPORT_JSON_SIZE });
        if (!this._isActive(loadToken)) {
          return;
        }
        this._handleLoadedJsonData(data);
      } catch (err) {
        if (!this._isActive(loadToken)) {
          return;
        }
        if (this._isTooLargeError(err)) {
          try {
            const fallbackData = await this._loadLargeJsonWithSampling(jsonPath);
            if (this._isActive(loadToken)) {
              this._handleLoadedJsonData(fallbackData, { forcedSampling: true });
            }
            return;
          } catch (fallbackErr) {
            console.error("Fallback load of large chart JSON failed:", fallbackErr);
            this.setState({
              error: _37("Chart data exceeds the UI limits and could not be displayed. Adjust the filters or time range and try again, or download the JSON report for full details."),
              clientSamplingNotice: null,
              jsonData: null
            });
            return;
          }
        }
        if (err instanceof SyntaxError) {
          console.error("Error parsing JSON data for charts:", err);
          this.setState({
            error: _37("Unable to parse the generated chart data. Download the JSON file to inspect it manually."),
            clientSamplingNotice: null,
            jsonData: null
          });
        } else {
          console.error("Error loading JSON data for charts:", err);
          const message = err && err.message ? cockpit_default.format(_37("Failed to load chart data: $0"), err.message) : _37("Failed to load chart data.");
          this.setState({
            error: message,
            clientSamplingNotice: null,
            jsonData: null
          });
        }
      } finally {
        if (this._isActive(loadToken)) {
          this.setState({ loadingJson: false });
        }
      }
    }
    async _fetchSummary(summaryPath, loadToken) {
      if (!this._isActive(loadToken)) {
        return;
      }
      this.setState({ loadingSummary: true });
      try {
        const data = await this._readJsonFile(summaryPath, { max_read_size: MAX_REPORT_JSON_SIZE });
        if (!this._isActive(loadToken)) {
          return;
        }
        this.setState({
          summary: data.analysis_summary,
          suffixStats: data.suffix_statistics || {},
          activeTabKey: 0
        });
      } catch (err) {
        if (!this._isActive(loadToken)) {
          return;
        }
        console.error("Error loading JSON summary:", err);
      } finally {
        if (this._isActive(loadToken)) {
          this.setState({ loadingSummary: false });
        }
      }
    }
    async _fetchCsvPreview(csvPath, loadToken) {
      if (!this._isActive(loadToken)) {
        return;
      }
      this.setState({ loadingCsv: true });
      try {
        const fileHandle = cockpit_default.file(csvPath);
        const content = await fileHandle.read();
        fileHandle.close();
        if (this._isActive(loadToken)) {
          const lines = content.split("\n").slice(0, CSV_PREVIEW_LINES).join("\n");
          this.setState({ csvPreview: lines });
        }
      } catch (err) {
        if (!this._isActive(loadToken)) {
          return;
        }
        console.error("Error loading CSV:", err);
        this.setState({ csvPreview: null });
      } finally {
        if (this._isActive(loadToken)) {
          this.setState({ loadingCsv: false });
        }
      }
    }
    async _readBinaryPngAsDataUrl(pngPath) {
      const fileHandle = cockpit_default.file(pngPath, { binary: true, max_read_size: MAX_BINARY_READ_SIZE });
      try {
        const content = await fileHandle.read();
        if (!content) {
          throw new Error("No content returned from PNG file");
        }
        return await new Promise((resolve, reject) => {
          const reader = new FileReader();
          reader.onload = () => resolve(reader.result);
          reader.onerror = () => reject(reader.error || new Error("Failed to read PNG blob"));
          reader.readAsDataURL(new Blob([content], { type: "image/png" }));
        });
      } finally {
        try {
          fileHandle.close();
        } catch (closeErr) {
          console.error("Error closing PNG file handle:", closeErr);
        }
      }
    }
    async loadPngAsDataUrl(pngPath, loadToken) {
      if (!pngPath || !this._isActive(loadToken)) {
        return;
      }
      this.setState({ loadingPng: true });
      try {
        const dataUrl = await this._readBinaryPngAsDataUrl(pngPath);
        if (this._isActive(loadToken)) {
          this.setState({ pngDataUrl: dataUrl, pngError: false });
        }
      } catch (err) {
        if (!this._isActive(loadToken)) {
          return;
        }
        console.error("Error loading PNG:", err);
        this.setState({ pngError: true });
      } finally {
        if (this._isActive(loadToken)) {
          this.setState({ loadingPng: false });
        }
      }
    }
    async _loadLargeJsonWithSampling(jsonPath) {
      const fileHandle = cockpit_default.file(jsonPath);
      try {
        const content = await fileHandle.read();
        return JSON.parse(content);
      } catch (parseError) {
        console.error("Error parsing large JSON data for charts:", parseError);
        throw parseError;
      } finally {
        try {
          fileHandle.close();
        } catch (closeErr) {
          console.error("Error closing JSON file handle:", closeErr);
        }
      }
    }
    _applyClientSamplingForDisplay(originalData) {
      let samplingApplied = false;
      const downsample2 = (points, limit) => {
        if (!Array.isArray(points) || points.length <= limit) return points;
        samplingApplied = true;
        const step = (points.length - 1) / (limit - 1);
        return Array.from(
          { length: limit },
          (_113, i) => points[Math.min(points.length - 1, Math.round(i * step))]
        );
      };
      return {
        sampledData: {
          ...originalData,
          replicationLags: originalData.replicationLags ? {
            ...originalData.replicationLags,
            series: (originalData.replicationLags.series || []).map((s2) => ({
              ...s2,
              datapoints: downsample2(s2.datapoints, this._clientSamplingCap.primary)
            }))
          } : void 0,
          hopLags: originalData.hopLags ? {
            ...originalData.hopLags,
            series: (originalData.hopLags.series || []).map((s2) => ({
              ...s2,
              datapoints: downsample2(s2.datapoints, this._clientSamplingCap.hop)
            }))
          } : void 0,
          metadata: {
            ...originalData.metadata,
            clientSampling: samplingApplied || void 0
          }
        },
        applied: samplingApplied
      };
    }
    downloadFile(url, filename) {
      if (!url) return;
      console.log("Downloading file:", url, "as", filename);
      let contentType;
      if (filename.endsWith(".html")) {
        contentType = "text/html";
      } else if (filename.endsWith(".png")) {
        contentType = "image/png";
      } else if (filename.endsWith(".csv")) {
        contentType = "text/csv";
      } else if (filename.endsWith(".json")) {
        contentType = "application/json";
      } else {
        contentType = "application/octet-stream";
      }
      const query = window.btoa(JSON.stringify({
        host: cockpit_default.transport.host,
        payload: "fsread1",
        binary: "raw",
        path: url,
        superuser: "require",
        max_read_size: 3 * 1024 * 1024 * 1024,
        external: {
          "content-disposition": `attachment; filename="${filename}"`,
          "content-type": contentType
        }
      }));
      const prefix = new URL(cockpit_default.transport.uri("channel/" + cockpit_default.transport.csrf_token)).pathname;
      const fullUrl = prefix + "?" + query;
      const iframe = document.createElement("iframe");
      iframe.setAttribute("src", fullUrl);
      iframe.setAttribute("hidden", "hidden");
      iframe.addEventListener("load", () => {
        const title = iframe.contentDocument?.title;
        if (title) {
          console.error("Download error:", title);
          if (this.props.addNotification) {
            this.props.addNotification(
              "error",
              cockpit_default.format(_37("Failed to download report: $0"), title)
            );
          }
        }
        setTimeout(() => {
          if (document.body.contains(iframe)) {
            document.body.removeChild(iframe);
          }
        }, 1e3);
      });
      document.body.appendChild(iframe);
    }
    openInNewWindow(url) {
      if (!url) return;
      window.open(url, "_blank");
    }
    renderSummaryTab() {
      const { summary, suffixStats, loadingSummary } = this.state;
      const { reportUrls } = this.props;
      if (loadingSummary && !summary) {
        return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Spinner, { size: "lg" }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "ds-margin-top", children: _37("Loading summary data...") })
        ] });
      }
      if (!summary) {
        return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(EmptyState, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateIcon, { icon: InfoIcon }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Title, { headingLevel: "h2", children: _37("No Summary Available") }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateBody, { children: _37("No report summary could be loaded.") })
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Card, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CardTitle, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Title, { headingLevel: "h2", children: _37("Replication Analysis Summary") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(CardBody, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Grid, { hasGutter: true, children: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Card, { isFlat: true, children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CardTitle, { children: _37("Analysis Overview") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionList, { isHorizontal: true, children: [
                /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionListGroup, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListTerm, { children: _37("Total Servers") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListDescription, { children: summary.total_servers || 0 })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionListGroup, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListTerm, { children: _37("Analyzed Log Events") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListDescription, { children: summary.analyzed_logs || 0 })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionListGroup, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListTerm, { children: _37("Total Updates") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListDescription, { children: summary.total_updates || 0 })
                ] })
              ] }) })
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Card, { isFlat: true, children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CardTitle, { children: _37("Replication Lag Statistics") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionList, { isHorizontal: true, children: [
                /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionListGroup, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListTerm, { children: _37("Minimum Lag") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListDescription, { children: summary.minimum_lag != null ? `${summary.minimum_lag.toFixed(3)} seconds` : _37("N/A") })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionListGroup, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListTerm, { children: _37("Maximum Lag") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListDescription, { children: summary.maximum_lag != null ? `${summary.maximum_lag.toFixed(3)} seconds` : _37("N/A") })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionListGroup, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListTerm, { children: _37("Average Lag") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListDescription, { children: summary.average_lag != null ? `${summary.average_lag.toFixed(3)} seconds` : _37("N/A") })
                ] })
              ] }) })
            ] }) }),
            Array.isArray(summary.skipped_log_dirs) && summary.skipped_log_dirs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
              Alert,
              {
                variant: "warning",
                isInline: true,
                title: _37("Some selected log directories were skipped"),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { component: TextVariants.small, children: _37("These directories could not be read during analysis") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(List, { className: "ds-margin-top-sm", children: summary.skipped_log_dirs.map((dir, idx) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ListItem, { children: dir }, idx)) })
                ]
              }
            ) }),
            summary.updates_by_suffix && Object.keys(summary.updates_by_suffix).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Card, { isFlat: true, children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CardTitle, { children: _37("Updates by Suffix") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(List, { children: Object.entries(summary.updates_by_suffix).map(([suffix, count]) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(ListItem, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("strong", { children: [
                  suffix,
                  ":"
                ] }),
                " ",
                count,
                " ",
                _37("updates")
              ] }, suffix)) }) })
            ] }) }),
            summary.time_range && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Card, { isFlat: true, children: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CardTitle, { children: _37("Time Range") }),
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionList, { isHorizontal: true, children: [
                /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionListGroup, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListTerm, { children: _37("Start Time") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListDescription, { children: summary.time_range.start || _37("From beginning") })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(DescriptionListGroup, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListTerm, { children: _37("End Time") }),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DescriptionListDescription, { children: summary.time_range.end || _37("To current") })
                ] })
              ] }) })
            ] }) })
          ] }),
          reportUrls && reportUrls.summary && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
            Button,
            {
              variant: "secondary",
              icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DownloadIcon, {}),
              onClick: () => this.downloadFile(reportUrls.summary, "replication_analysis_summary.json"),
              children: _37("Download Summary JSON")
            }
          ) })
        ] })
      ] }) });
    }
    renderChartsTab() {
      const { reportUrls } = this.props;
      const { loadingJson, jsonData, error, clientSamplingNotice, selectedCsnId } = this.state;
      if (loadingJson) {
        return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Spinner, { size: "lg" }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "ds-margin-top", children: _37("Loading chart data...") })
        ] });
      }
      if (!reportUrls || !reportUrls.json) {
        return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(EmptyState, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateIcon, { icon: InfoIcon }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Title, { headingLevel: "h2", children: _37("No Chart Data Available") }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateBody, { children: _37("No JSON chart data was found or could be loaded.") })
        ] });
      }
      if (error) {
        return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(EmptyState, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateIcon, { icon: ExclamationCircleIcon }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Title, { headingLevel: "h2", children: _37("Unable to Display Charts") }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateBody, { children: error }),
          reportUrls && reportUrls.json && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
            Button,
            {
              variant: "secondary",
              icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DownloadIcon, {}),
              onClick: () => this.downloadFile(reportUrls.json, "replication_analysis.json"),
              children: _37("Download JSON Data")
            }
          )
        ] });
      }
      const hasReplicationLags = jsonData && jsonData.replicationLags && jsonData.replicationLags.series && jsonData.replicationLags.series.length > 0;
      const hasHopLags = jsonData && jsonData.hopLags && jsonData.hopLags.series && jsonData.hopLags.series.length > 0;
      const hasCsnDetails = jsonData && jsonData.csnDetails && Object.keys(jsonData.csnDetails).length > 0;
      const selectedCsnData = selectedCsnId && hasCsnDetails ? jsonData.csnDetails[selectedCsnId] : null;
      if (!jsonData || !hasReplicationLags && !hasHopLags) {
        return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(EmptyState, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateIcon, { icon: InfoIcon }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Title, { headingLevel: "h2", children: _37("No Chart Data Available") }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateBody, { children: _37("Chart data was found but contains no visualization data.") }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
            Button,
            {
              variant: "secondary",
              icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DownloadIcon, {}),
              onClick: () => this.downloadFile(reportUrls.json, "replication_analysis.json"),
              children: _37("Download JSON Data")
            }
          )
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Grid, { hasGutter: true, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Card, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CardTitle, { children: _37("Interactive Charts") }),
        /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(CardBody, { children: [
          clientSamplingNotice && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Alert, { variant: "warning", isInline: true, className: "ds-margin-bottom", children: clientSamplingNotice }),
          hasCsnDetails && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
            Text,
            {
              component: TextVariants.small,
              className: "ds-margin-bottom",
              style: { color: "var(--pf-v5-global--Color--200)", fontStyle: "italic" },
              children: _37("Tip: Click on any chart point to view detailed CSN propagation path.")
            }
          ),
          hasReplicationLags && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ds-margin-bottom", children: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Title, { headingLevel: "h3", children: [
              jsonData.replicationLags.title || _37("Global Replication Lag Over Time"),
              jsonData.metadata && jsonData.metadata.timezone && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { style: { fontSize: "0.8em", fontWeight: "normal", marginLeft: "1em", color: "var(--pf-v5-global--Color--200)" }, children: [
                "(",
                jsonData.metadata.timezone,
                ")"
              ] })
            ] }),
            jsonData.metadata && jsonData.metadata.sampling && jsonData.metadata.sampling.applied && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Alert, { isInline: true, variant: "info", title: _37("Data was sampled for performance"), children: [
              jsonData.metadata.sampling.reducedTotalPoints && jsonData.metadata.sampling.originalTotalPoints ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { children: [
                cockpit_default.format(_37("Showing $0 of $1 data points."), jsonData.metadata.sampling.reducedTotalPoints, jsonData.metadata.sampling.originalTotalPoints),
                "\xA0"
              ] }) : null,
              jsonData.metadata.sampling.precision === "full" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: _37("Automatic sampling was applied because the dataset is very large. To view all points, consider filtering by time range or suffix.") }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: _37('For full precision without sampling, rerun with "Full Precision" mode (note: may be slower for large datasets).') })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
              ScatterLineChart,
              {
                chartData: jsonData.replicationLags,
                title: jsonData.replicationLags.title || _37("Global Replication Lag Over Time"),
                xAxisLabel: (jsonData.replicationLags.xAxisLabel || "").replace(/\s*Time\s*/g, ""),
                yAxisLabel: jsonData.replicationLags.yAxisLabel || _37("Lag Time (seconds)"),
                defaultShowLegend: true,
                onPointClick: hasCsnDetails ? this.handleCsnPointClick : void 0
              }
            )
          ] }),
          hasHopLags && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ds-margin-top-lg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Title, { headingLevel: "h3", children: [
              jsonData.hopLags.title || _37("Per-Hop Replication Lags"),
              jsonData.metadata && jsonData.metadata.timezone && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { style: { fontSize: "0.8em", fontWeight: "normal", marginLeft: "1em", color: "var(--pf-v5-global--Color--200)" }, children: [
                "(",
                jsonData.metadata.timezone,
                ")"
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
              ScatterLineChart,
              {
                chartData: jsonData.hopLags,
                title: jsonData.hopLags.title || _37("Per-Hop Replication Lags"),
                xAxisLabel: (jsonData.hopLags.xAxisLabel || "").replace(/\s*Time\s*/g, ""),
                yAxisLabel: jsonData.hopLags.yAxisLabel || _37("Hop Lag Time (seconds)"),
                defaultShowLegend: false,
                onPointClick: hasCsnDetails ? this.handleCsnPointClick : void 0
              }
            )
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
            CSNDetailModal,
            {
              csnData: selectedCsnData,
              onClose: this.handleCloseCsnDetails
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
            Button,
            {
              variant: "secondary",
              icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DownloadIcon, {}),
              onClick: () => this.downloadFile(reportUrls.json, "replication_analysis.json"),
              children: _37("Download JSON Data")
            }
          ) })
        ] })
      ] }) }) }) });
    }
    renderPngTab() {
      const { reportUrls } = this.props;
      const { loadingPng, pngDataUrl, pngError } = this.state;
      if (loadingPng) {
        return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Spinner, { size: "lg" }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "ds-margin-top", children: _37("Loading PNG data...") })
        ] });
      }
      if (!reportUrls || !reportUrls.png) {
        return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(EmptyState, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateIcon, { icon: InfoIcon }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Title, { headingLevel: "h2", children: _37("No PNG Report Available") }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateBody, { children: _37("No PNG report was generated. Make sure to select PNG format when generating the report.") })
        ] });
      }
      if (pngError) {
        return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(EmptyState, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateIcon, { icon: ExclamationCircleIcon }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Title, { headingLevel: "h2", children: _37("Error Loading PNG") }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateBody, { children: _37("There was an error loading the PNG image. Try downloading it instead.") }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
            Button,
            {
              variant: "primary",
              icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DownloadIcon, {}),
              onClick: () => this.downloadFile(reportUrls.png, "replication_analysis.png"),
              children: _37("Download PNG")
            }
          )
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Grid, { hasGutter: true, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Card, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CardTitle, { children: _37("Static Image Report") }),
        /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(CardBody, { children: [
          pngDataUrl ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ds-margin-bottom ds-text-center", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
            "img",
            {
              src: pngDataUrl,
              alt: _37("Replication Analysis Chart"),
              style: { maxWidth: "100%", height: "auto" }
            }
          ) }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ds-center", children: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Spinner, { size: "lg" }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "ds-margin-top", children: _37("Loading image...") })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ds-margin-top ds-text-center", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
            Button,
            {
              variant: "primary",
              icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DownloadIcon, {}),
              onClick: () => this.downloadFile(reportUrls.png, "replication_analysis.png"),
              children: _37("Download PNG")
            }
          ) })
        ] })
      ] }) }) }) });
    }
    renderCsvTab() {
      const { reportUrls } = this.props;
      const { loadingCsv, csvPreview } = this.state;
      if (loadingCsv) {
        return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Spinner, { size: "lg" }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "ds-margin-top", children: _37("Loading CSV data...") })
        ] });
      }
      if (!reportUrls || !reportUrls.csv) {
        return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(EmptyState, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateIcon, { icon: InfoIcon }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Title, { headingLevel: "h2", children: _37("No CSV Report Available") }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateBody, { children: _37("No CSV report was generated. Make sure to select CSV format when generating the report.") })
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Grid, { hasGutter: true, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Card, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CardTitle, { children: _37("CSV Data Preview") }),
        /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(CardBody, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ds-margin-bottom", children: csvPreview ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(TextContent, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { component: TextVariants.h3, children: _37("First 20 lines of CSV data:") }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("pre", { className: "ds-code-block ds-no-margin-bottom", children: csvPreview })
          ] }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(EmptyState, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateIcon, { icon: InfoIcon }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Title, { headingLevel: "h3", children: _37("CSV Preview Not Available") }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateBody, { children: _37("Preview could not be loaded. Try downloading the CSV file.") })
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ds-margin-top ds-text-center", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
            Button,
            {
              variant: "primary",
              icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DownloadIcon, {}),
              onClick: () => this.downloadFile(reportUrls.csv, "replication_analysis.csv"),
              children: _37("Download CSV")
            }
          ) })
        ] })
      ] }) }) }) });
    }
    renderReportFilesTab() {
      const { reportUrls } = this.props;
      if (!reportUrls || Object.keys(reportUrls).length === 0) {
        return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(EmptyState, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateIcon, { icon: InfoIcon }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Title, { headingLevel: "h2", children: _37("No Report Files Available") }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateBody, { children: _37("No report files were found or could be loaded.") })
        ] });
      }
      const fileEntries = [];
      if (reportUrls.summary) {
        fileEntries.push({
          key: "summary",
          label: _37("Summary JSON"),
          desc: _37("Analysis summary data in JSON format"),
          path: reportUrls.summary,
          filename: "replication_analysis_summary.json"
        });
      }
      if (reportUrls.json) {
        fileEntries.push({
          key: "json",
          label: _37("Interactive Charts JSON"),
          desc: _37("Chart data in JSON format"),
          path: reportUrls.json,
          filename: "replication_analysis.json"
        });
      }
      if (reportUrls.csv) {
        fileEntries.push({
          key: "csv",
          label: _37("CSV Data"),
          desc: _37("Tabular data in CSV format"),
          path: reportUrls.csv,
          filename: "replication_analysis.csv"
        });
      }
      if (reportUrls.png) {
        fileEntries.push({
          key: "png",
          label: _37("PNG Image"),
          desc: _37("Static chart image in PNG format"),
          path: reportUrls.png,
          filename: "replication_analysis.png"
        });
      }
      if (reportUrls.html) {
        fileEntries.push({
          key: "html",
          label: _37("Standalone HTML Report"),
          desc: _37("Self-contained HTML report with embedded charts"),
          path: reportUrls.html,
          filename: "replication_analysis.html"
        });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Grid, { hasGutter: true, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Card, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CardTitle, { children: _37("Report Files") }),
        /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(CardBody, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { component: TextVariants.h3, children: _37("Download report files:") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Grid, { hasGutter: true, className: "ds-margin-top", children: fileEntries.map((f) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_react107.default.Fragment, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
              Button,
              {
                variant: "link",
                onClick: () => this.downloadFile(f.path, f.filename),
                icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DownloadIcon, {}),
                children: f.label
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Text, { component: TextVariants.small, children: f.desc }) })
          ] }, f.key)) })
        ] })
      ] }) }) }) });
    }
    render() {
      const { showModal, closeHandler } = this.props;
      const { activeTabKey } = this.state;
      if (!showModal) {
        return null;
      }
      return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
        Modal,
        {
          variant: ModalVariant.large,
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { variant: "primary", onClick: closeHandler, children: _37("Close") }, "close")
          ],
          position: "top",
          "aria-label": _37("Replication Report Modal"),
          children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { style: { display: "flex", flexDirection: "column", maxHeight: "80vh" }, children: [
            /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
              Tabs,
              {
                activeKey: activeTabKey,
                onSelect: this.handleTabClick,
                "aria-label": _37("Report tabs"),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                    Tab,
                    {
                      eventKey: 0,
                      title: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TabTitleText, { children: _37("Summary") })
                    },
                    0
                  ),
                  this.props.reportUrls && this.props.reportUrls.json && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                    Tab,
                    {
                      eventKey: 1,
                      title: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TabTitleText, { children: _37("Charts") })
                    },
                    1
                  ),
                  this.props.reportUrls && this.props.reportUrls.png && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                    Tab,
                    {
                      eventKey: 2,
                      title: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TabTitleText, { children: _37("PNG Report") })
                    },
                    2
                  ),
                  this.props.reportUrls && this.props.reportUrls.csv && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                    Tab,
                    {
                      eventKey: 3,
                      title: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TabTitleText, { children: _37("CSV Report") })
                    },
                    3
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                    Tab,
                    {
                      eventKey: 4,
                      title: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TabTitleText, { children: _37("Report Files") })
                    },
                    4
                  )
                ]
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { style: { flex: 1, overflowY: "auto" }, children: [
              activeTabKey === 0 && this.renderSummaryTab(),
              activeTabKey === 1 && this.props.reportUrls && this.props.reportUrls.json && this.renderChartsTab(),
              activeTabKey === 2 && this.props.reportUrls && this.props.reportUrls.png && this.renderPngTab(),
              activeTabKey === 3 && this.props.reportUrls && this.props.reportUrls.csv && this.renderCsvTab(),
              activeTabKey === 4 && this.renderReportFilesTab()
            ] })
          ] })
        }
      );
    }
  };
  var ChooseLagReportModal = class extends import_react107.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: true,
        reports: [],
        reportDirectory: props.reportDirectory || "/tmp",
        error: null,
        selectedReport: null,
        showLagReportModal: false,
        reportUrls: null
      };
      this.loadReports = this.loadReports.bind(this);
      this.handleSelectReport = this.handleSelectReport.bind(this);
      this.closeLagReportModal = this.closeLagReportModal.bind(this);
    }
    componentDidMount() {
      this.loadReports();
    }
    componentDidUpdate(prevProps) {
      if (prevProps.reportDirectory !== this.props.reportDirectory) {
        this.setState({
          reportDirectory: this.props.reportDirectory,
          loading: true
        }, this.loadReports);
      }
    }
    loadReports() {
      const { reportDirectory } = this.state;
      this.setState({
        loading: true,
        error: null,
        reports: []
      });
      cockpit_default.spawn(["ls", "-1A", reportDirectory], { superuser: true, err: "ignore" }).then((output) => {
        if (!output.trim()) {
          this.setState({ loading: false });
          return;
        }
        const base = reportDirectory.endsWith("/") ? reportDirectory.slice(0, -1) : reportDirectory;
        const candidates = output.trim().split("\n").map((entry) => `${base}/${entry}`);
        candidates.unshift(base);
        const statPromises = candidates.map(
          (p) => cockpit_default.spawn(["stat", "-c", "%F", p], { superuser: true, err: "ignore" }).then((type) => ({ path: p, isDir: type.trim().toLowerCase().includes("directory") })).catch(() => ({ path: p, isDir: false }))
        );
        return Promise.all(statPromises).then((stats) => stats.filter((s2) => s2.isDir).map((s2) => s2.path));
      }).then((directories) => {
        if (!directories) {
          return;
        }
        const promises = directories.map((dir) => {
          return cockpit_default.spawn(["ls", "-1A", dir], { superuser: true, err: "ignore" }).then((output) => {
            const files = output.trim().split("\n").filter((f) => f);
            const validReportFiles = [
              "replication_analysis.json",
              "replication_analysis_summary.json",
              "replication_analysis.html",
              "replication_analysis.csv",
              "replication_analysis.png"
            ];
            const hasJson = files.includes("replication_analysis.json");
            const hasHtml = files.includes("replication_analysis.html");
            const hasCsv = files.includes("replication_analysis.csv");
            const hasPng = files.includes("replication_analysis.png");
            const hasSummary = files.includes("replication_analysis_summary.json");
            if (!hasJson && !hasHtml && !hasCsv && !hasPng && !hasSummary) {
              return null;
            }
            const hasUnexpectedFiles = files.some((file) => !validReportFiles.includes(file));
            if (hasUnexpectedFiles) {
              console.warn(`Directory ${dir} contains unexpected files, skipping:`, files);
              return null;
            }
            const reportName = dir.split("/").pop();
            let creationTime = "";
            return cockpit_default.spawn(["stat", "-c", "%y", dir], { superuser: true, err: "ignore" }).then((statOutput) => {
              try {
                const timestamp = statOutput.trim();
                creationTime = new Date(timestamp).toLocaleString();
              } catch (e) {
                console.error("Error parsing date from stat:", e);
                creationTime = _37("Unknown");
              }
              return {
                path: dir,
                name: reportName,
                creationTime,
                hasJson,
                hasHtml,
                hasCsv,
                hasPng,
                hasSummary
              };
            }).catch((statError) => {
              if (reportName.startsWith("repl_report_")) {
                try {
                  const timestamp = reportName.replace("repl_report_", "");
                  if (/^\d+$/.test(timestamp)) {
                    creationTime = new Date(parseInt(timestamp) * 1e3).toLocaleString();
                  } else {
                    creationTime = cockpit_default.format(_37("Custom: $0"), timestamp);
                  }
                } catch (e) {
                  creationTime = _37("Unknown");
                }
              } else {
                const dateMatch = files.match(/\w{3}\s+\d+\s+\d{2}:\d{2}/);
                if (dateMatch) {
                  creationTime = dateMatch[0];
                } else {
                  creationTime = _37("Unknown");
                }
              }
              return {
                path: dir,
                name: reportName,
                creationTime,
                hasJson,
                hasHtml,
                hasCsv,
                hasPng,
                hasSummary
              };
            });
          }).catch(() => {
            return null;
          });
        });
        return Promise.all(promises).then((results) => {
          const validReports = results.filter((report) => report !== null);
          validReports.sort((a2, b) => {
            try {
              return new Date(b.creationTime) - new Date(a2.creationTime);
            } catch (e) {
              return 0;
            }
          });
          this.setState({
            reports: validReports,
            loading: false
          });
        }).catch(() => {
          this.setState({ loading: false });
        });
      }).catch(() => {
        this.setState({ loading: false });
      });
    }
    handleSelectReport(report) {
      const reportUrls = {
        base: report.path,
        json: report.hasJson ? `${report.path}/replication_analysis.json` : null,
        html: report.hasHtml ? `${report.path}/replication_analysis.html` : null,
        csv: report.hasCsv ? `${report.path}/replication_analysis.csv` : null,
        png: report.hasPng ? `${report.path}/replication_analysis.png` : null
      };
      this.setState({
        selectedReport: report,
        showLagReportModal: true,
        reportUrls
      });
    }
    closeLagReportModal() {
      this.setState({
        showLagReportModal: false,
        selectedReport: null,
        reportUrls: null
      });
    }
    render() {
      const { showing, onClose } = this.props;
      const { loading, reports, error, showLagReportModal, reportUrls } = this.state;
      return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
          Modal,
          {
            variant: "large",
            title: _37("View Existing Report"),
            isOpen: showing,
            onClose,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { variant: "primary", onClick: onClose, children: _37("Close") }, "close")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Card, { isFullHeight: true, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(CardBody, { children: [
              error && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                Alert,
                {
                  variant: "danger",
                  title: _37("Error loading reports"),
                  isInline: true,
                  children: error
                }
              ),
              loading ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ds-center", children: [
                /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Spinner, { size: "lg" }),
                /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "ds-margin-top", children: _37("Loading reports...") })
              ] }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
                ExistingLagReportsTable,
                {
                  reports,
                  onSelectReport: this.handleSelectReport,
                  addNotification: this.props.addNotification
                }
              )
            ] }) }) })
          }
        ),
        showLagReportModal && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
          LagReportModal,
          {
            showing: showLagReportModal,
            reportName: _37("Report"),
            reportUrls,
            onClose: this.closeLagReportModal
          }
        )
      ] });
    }
  };
  ScatterLineChart.propTypes = {
    chartData: import_prop_types36.default.object,
    title: import_prop_types36.default.string,
    yAxisLabel: import_prop_types36.default.string,
    xAxisLabel: import_prop_types36.default.string,
    minY: import_prop_types36.default.number,
    maxY: import_prop_types36.default.number,
    defaultShowLegend: import_prop_types36.default.bool,
    onPointClick: import_prop_types36.default.func
  };
  ScatterLineChart.defaultProps = {
    chartData: null,
    title: "",
    yAxisLabel: "Value",
    xAxisLabel: "",
    minY: null,
    maxY: null,
    defaultShowLegend: true,
    onPointClick: null
  };
  AgmtDetailsModal.propTypes = {
    showModal: import_prop_types36.default.bool,
    closeHandler: import_prop_types36.default.func,
    agmt: import_prop_types36.default.object
  };
  AgmtDetailsModal.defaultProps = {
    showModal: false,
    agmt: {}
  };
  TaskLogModal.propTypes = {
    showModal: import_prop_types36.default.bool,
    closeHandler: import_prop_types36.default.func,
    logData: import_prop_types36.default.string
  };
  TaskLogModal.defaultProps = {
    showModal: false,
    agreement: ""
  };
  ConflictCompareModal.propTypes = {
    showModal: import_prop_types36.default.bool,
    conflictEntry: import_prop_types36.default.object,
    validEntry: import_prop_types36.default.object,
    closeHandler: import_prop_types36.default.func
  };
  ConflictCompareModal.defaultProps = {
    showModal: false,
    conflictEntry: { dn: "", attrs: [] },
    validEntry: {}
  };
  ReportCredentialsModal.propTypes = {
    showModal: import_prop_types36.default.bool,
    closeHandler: import_prop_types36.default.func,
    handleFieldChange: import_prop_types36.default.func,
    hostname: import_prop_types36.default.string,
    port: import_prop_types36.default.number,
    binddn: import_prop_types36.default.string,
    bindpw: import_prop_types36.default.string,
    pwInputInteractive: import_prop_types36.default.bool,
    newEntry: import_prop_types36.default.bool,
    addConfig: import_prop_types36.default.func,
    editConfig: import_prop_types36.default.func
  };
  ReportCredentialsModal.defaultProps = {
    showModal: false,
    hostname: "",
    port: 389,
    binddn: "",
    bindpw: "",
    pwInputInteractive: false,
    newEntry: false
  };
  ReportConnectionModal.propTypes = {
    showModal: import_prop_types36.default.bool,
    closeHandler: import_prop_types36.default.func,
    handleFieldChange: import_prop_types36.default.func,
    name: import_prop_types36.default.string,
    hostname: import_prop_types36.default.string,
    port: import_prop_types36.default.number,
    binddn: import_prop_types36.default.string,
    bindpw: import_prop_types36.default.string,
    pwInputInteractive: import_prop_types36.default.bool,
    addConn: import_prop_types36.default.func
  };
  ReportConnectionModal.defaultProps = {
    showModal: false,
    name: "",
    hostname: "",
    port: 636,
    binddn: "",
    bindpw: "",
    pwInputInteractive: false
  };
  ReportAliasesModal.propTypes = {
    showModal: import_prop_types36.default.bool,
    closeHandler: import_prop_types36.default.func,
    handleFieldChange: import_prop_types36.default.func,
    hostname: import_prop_types36.default.string,
    port: import_prop_types36.default.number,
    alias: import_prop_types36.default.string,
    newEntry: import_prop_types36.default.bool,
    addConfig: import_prop_types36.default.func,
    editConfig: import_prop_types36.default.func
  };
  ReportAliasesModal.defaultProps = {
    showModal: false,
    hostname: "",
    port: 389,
    alias: "",
    newEntry: false
  };
  ReportLoginModal.propTypes = {
    showModal: import_prop_types36.default.bool,
    closeHandler: import_prop_types36.default.func,
    handleChange: import_prop_types36.default.func,
    processCredsInput: import_prop_types36.default.func,
    instanceName: import_prop_types36.default.string,
    disableBinddn: import_prop_types36.default.bool,
    loginBinddn: import_prop_types36.default.string,
    loginBindpw: import_prop_types36.default.string
  };
  ReportLoginModal.defaultProps = {
    showModal: false,
    instanceName: "",
    disableBinddn: false,
    loginBinddn: "",
    loginBindpw: ""
  };
  FullReportContent.propTypes = {
    reportData: import_prop_types36.default.array,
    handleRefresh: import_prop_types36.default.func,
    reportRefreshing: import_prop_types36.default.bool
  };
  FullReportContent.defaultProps = {
    reportData: [],
    reportRefreshTimeout: 5,
    reportRefreshing: false
  };
  LagReportModal.propTypes = {
    showModal: import_prop_types36.default.bool,
    closeHandler: import_prop_types36.default.func,
    reportUrls: import_prop_types36.default.object
  };
  LagReportModal.defaultProps = {
    showModal: false,
    reportUrls: {}
  };
  ChooseLagReportModal.propTypes = {
    showing: import_prop_types36.default.bool,
    onClose: import_prop_types36.default.func,
    reportDirectory: import_prop_types36.default.string,
    addNotification: import_prop_types36.default.func
  };
  ChooseLagReportModal.defaultProps = {
    showing: false,
    onClose: () => {
    },
    reportDirectory: "/tmp",
    addNotification: () => {
    }
  };

  // src/lib/monitor/monitorTables.jsx
  var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
  var _38 = cockpit_default.gettext;
  var AbortCleanALLRUVTable = class extends import_react108.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _38("Task"), sortable: true },
          { title: _38("Created"), sortable: true },
          { title: _38("Replica ID"), sortable: true },
          { title: _38("Status"), sortable: true },
          { title: _38("Actions") }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.getLog = this.getLog.bind(this);
      this.createRows = this.createRows.bind(this);
    }
    getLog(log2) {
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
        Text,
        {
          component: TextVariants.pre,
          style: {
            whiteSpace: "pre-wrap",
            wordBreak: "break-word"
          },
          children: log2
        }
      ) });
    }
    createRows(tasks) {
      let rows = [];
      let columns = [...this.state.columns];
      for (const task of tasks) {
        rows.push({
          isOpen: false,
          cells: [
            task.attrs.cn[0],
            get_date_string(task.attrs.nstaskcreated[0]),
            task.attrs["replica-id"][0],
            task.attrs.nstaskstatus[0]
          ],
          originalData: task
        });
      }
      if (rows.length === 0) {
        rows = [{ cells: [_38("No Tasks")] }];
        columns = [{ title: _38("Abort CleanAllRUV Tasks") }];
      }
      return { rows, columns };
    }
    componentDidMount() {
      const { rows, columns } = this.createRows(this.props.tasks);
      this.setState({ rows, columns });
    }
    componentDidUpdate(prevProps) {
      if (prevProps.tasks !== this.props.tasks) {
        const { rows, columns } = this.createRows(this.props.tasks);
        this.setState({
          rows,
          columns,
          page: 1
        });
      }
    }
    handleCollapse(_event, rowIndex, isExpanding) {
      const rows = [...this.state.rows];
      rows[rowIndex].isOpen = isExpanding;
      this.setState({ rows });
    }
    handleSort(_event, index, direction) {
      const sorted_tasks = [];
      const rows = [];
      for (const task of this.props.tasks) {
        sorted_tasks.push({
          task,
          1: task.attrs.cn[0],
          2: get_date_string(task.attrs.nstaskcreated[0]),
          3: task.attrs["replica-id"][0],
          4: task.attrs.nstaskstatus[0]
        });
      }
      sorted_tasks.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_tasks.reverse();
      }
      for (let task of sorted_tasks) {
        task = task.task;
        rows.push({
          isOpen: false,
          cells: [
            task.attrs.cn[0],
            get_date_string(task.attrs.nstaskcreated[0]),
            task.attrs["replica-id"][0],
            task.attrs.nstaskstatus[0]
          ],
          originalData: task
        });
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const startIdx = perPage * page - perPage;
      const tableRows = rows.slice(startIdx, startIdx + perPage);
      const hasNoTasks = rows.length === 1 && rows[0].cells.length === 1;
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ds-margin-top-xlg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
          Table,
          {
            "aria-label": "Expandable table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                !hasNoTasks && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Th, { screenReaderText: "Row expansion" }),
                columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy,
                      onSort: this.handleSort,
                      columnIndex
                    } : void 0,
                    children: column.title
                  },
                  columnIndex
                ))
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_react108.default.Fragment, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                  !hasNoTasks && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                    Td,
                    {
                      expand: {
                        rowIndex,
                        isExpanded: row.isOpen,
                        onToggle: () => this.handleCollapse(null, rowIndex, !row.isOpen)
                      }
                    }
                  ),
                  row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: cell }, cellIndex))
                ] }),
                row.isOpen && row.originalData && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { isExpanded: true, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, {}),
                  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                    Td,
                    {
                      colSpan: columns.length + 1,
                      noPadding: true,
                      children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ExpandableRowContent, { children: this.getLog(row.originalData.attrs.nstasklog[0]) })
                    }
                  )
                ] })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
          Pagination,
          {
            itemCount: this.props.tasks.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var CleanALLRUVTable = class extends import_react108.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _38("Task"), sortable: true },
          { title: _38("Created"), sortable: true },
          { title: _38("Replica ID"), sortable: true },
          { title: _38("Status"), sortable: true },
          { title: _38("Actions") }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.getLog = this.getLog.bind(this);
      this.createRows = this.createRows.bind(this);
    }
    getLog(log2) {
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
        Text,
        {
          component: TextVariants.pre,
          style: {
            whiteSpace: "pre-wrap",
            wordBreak: "break-word"
          },
          children: log2
        }
      ) });
    }
    createRows(tasks) {
      let rows = [];
      let columns = [...this.state.columns];
      for (const task of tasks) {
        rows.push({
          isOpen: false,
          cells: [
            task.attrs.cn[0],
            get_date_string(task.attrs.nstaskcreated[0]),
            task.attrs["replica-id"][0],
            task.attrs.nstaskstatus[0]
          ],
          originalData: task
        });
      }
      if (rows.length === 0) {
        rows = [{ cells: [_38("No Tasks")] }];
        columns = [{ title: _38("CleanAllRUV Tasks") }];
      }
      return { rows, columns };
    }
    componentDidMount() {
      const { rows, columns } = this.createRows(this.props.tasks);
      this.setState({ rows, columns });
    }
    componentDidUpdate(prevProps) {
      if (prevProps.tasks !== this.props.tasks) {
        const { rows, columns } = this.createRows(this.props.tasks);
        this.setState({
          rows,
          columns,
          page: 1
          // Reset to first page when data changes
        });
      }
    }
    handleCollapse(_event, rowIndex, isExpanding) {
      const rows = [...this.state.rows];
      rows[rowIndex].isOpen = isExpanding;
      this.setState({ rows });
    }
    handleSort(_event, index, direction) {
      const sorted_tasks = [];
      const rows = [];
      for (const task of this.props.tasks) {
        sorted_tasks.push({
          task,
          1: task.attrs.cn[0],
          2: get_date_string(task.attrs.nstaskcreated[0]),
          3: task.attrs["replica-id"][0],
          4: task.attrs.nstaskstatus[0]
        });
      }
      sorted_tasks.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_tasks.reverse();
      }
      for (let task of sorted_tasks) {
        task = task.task;
        rows.push({
          isOpen: false,
          cells: [
            task.attrs.cn[0],
            get_date_string(task.attrs.nstaskcreated[0]),
            task.attrs["replica-id"][0],
            task.attrs.nstaskstatus[0]
          ],
          originalData: task
        });
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const startIdx = perPage * page - perPage;
      const tableRows = rows.slice(startIdx, startIdx + perPage);
      const hasNoTasks = rows.length === 1 && rows[0].cells.length === 1;
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ds-margin-top-xlg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
          Table,
          {
            "aria-label": "Expandable table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                !hasNoTasks && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Th, { screenReaderText: "Row expansion" }),
                columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy,
                      onSort: this.handleSort,
                      columnIndex
                    } : void 0,
                    children: column.title
                  },
                  columnIndex
                ))
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_react108.default.Fragment, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                  !hasNoTasks && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                    Td,
                    {
                      expand: {
                        rowIndex,
                        isExpanded: row.isOpen,
                        onToggle: () => this.handleCollapse(null, rowIndex, !row.isOpen)
                      }
                    }
                  ),
                  row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: cell }, cellIndex))
                ] }),
                row.isOpen && row.originalData && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { isExpanded: true, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, {}),
                  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                    Td,
                    {
                      colSpan: columns.length + 1,
                      noPadding: true,
                      children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ExpandableRowContent, { children: this.getLog(row.originalData.attrs.nstasklog[0]) })
                    }
                  )
                ] })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
          Pagination,
          {
            itemCount: this.props.tasks.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var WinsyncAgmtTable = class extends import_react108.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _38("Agreement"), sortable: true },
          { title: _38("Replica"), sortable: true },
          { title: _38("Enabled"), sortable: true },
          { title: _38("Poke"), sortable: false }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.getExpandedRow = this.getExpandedRow.bind(this);
    }
    getExpandedRow(agmt) {
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ExpandableRowContent, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Grid, { className: "ds-indent", children: [
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Session In Progress:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt["update-in-progress"][0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Changes Sent:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: numToCommas(agmt["number-changes-sent"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("hr", {}),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Init Started:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: get_date_string(agmt["last-init-start"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Init Ended:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: get_date_string(agmt["last-init-end"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Init Status:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt["last-init-status"][0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("hr", {}),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Updated Started:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: get_date_string(agmt["last-update-start"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Update Ended:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: get_date_string(agmt["last-update-end"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Update Status:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt["last-update-status"][0] }) })
      ] }) });
    }
    getWakeupButton(name2) {
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
        Button,
        {
          id: name2,
          variant: "primary",
          onClick: this.props.handlePokeAgmt,
          title: _38("Awaken the winsync replication agreement"),
          size: "sm",
          children: _38("Poke")
        }
      );
    }
    componentDidMount() {
      let rows = [];
      let columns = [...this.state.columns];
      let count = 0;
      for (const agmt of this.props.agmts) {
        rows.push({
          isOpen: false,
          cells: [
            agmt["agmt-name"][0],
            agmt.replica[0],
            agmt["replica-enabled"][0],
            { title: this.getWakeupButton(agmt["agmt-name"][0]) }
          ],
          originalData: agmt
        });
        count += 1;
      }
      if (rows.length === 0) {
        rows = [{ cells: [_38("No Agreements")] }];
        columns = [{ title: _38("Winsync Agreements") }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleCollapse(_event, rowIndex, isExpanding) {
      const rows = [...this.state.rows];
      rows[rowIndex].isOpen = isExpanding;
      this.setState({ rows });
    }
    handleSort(_event, index, direction) {
      const sorted_agmts = [];
      const rows = [];
      for (const agmt of this.props.agmts) {
        sorted_agmts.push({
          agmt,
          1: agmt["agmt-name"][0],
          2: agmt.replica[0],
          3: agmt["replica-enabled"][0]
        });
      }
      sorted_agmts.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_agmts.reverse();
      }
      for (let agmt of sorted_agmts) {
        agmt = agmt.agmt;
        rows.push({
          isOpen: false,
          cells: [
            agmt["agmt-name"][0],
            agmt.replica[0],
            agmt["replica-enabled"][0],
            { title: this.getWakeupButton(agmt["agmt-name"][0]) }
          ],
          originalData: agmt
        });
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const startIdx = perPage * page - perPage;
      const tableRows = rows.slice(startIdx, startIdx + perPage);
      const hasNoAgreements = rows.length === 1 && rows[0].cells.length === 1;
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ds-margin-top-xlg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
          Table,
          {
            "aria-label": "Winsync agreements table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                !hasNoAgreements && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Th, { screenReaderText: "Row expansion" }),
                columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy,
                      onSort: this.handleSort,
                      columnIndex
                    } : void 0,
                    children: column.title
                  },
                  columnIndex
                ))
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_react108.default.Fragment, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                  !hasNoAgreements && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                    Td,
                    {
                      expand: {
                        rowIndex,
                        isExpanded: row.isOpen,
                        onToggle: () => this.handleCollapse(null, rowIndex, !row.isOpen)
                      }
                    }
                  ),
                  row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: cell.title || cell }, cellIndex))
                ] }),
                row.isOpen && row.originalData && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { isExpanded: true, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, {}),
                  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                    Td,
                    {
                      colSpan: columns.length + 1,
                      noPadding: true,
                      children: this.getExpandedRow(row.originalData)
                    }
                  )
                ] })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
          Pagination,
          {
            itemCount: this.props.agmts.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var AgmtTable = class extends import_react108.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _38("Agreement"), sortable: true },
          { title: _38("Replica"), sortable: true },
          { title: _38("Enabled"), sortable: true },
          { title: "", sortable: false, screenReaderText: _38("Poke the agreement") }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.getExpandedRow = this.getExpandedRow.bind(this);
    }
    getExpandedRow(agmt) {
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ExpandableRowContent, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Grid, { className: "ds-indent", children: [
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Session In Progress:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt["update-in-progress"][0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Changes Sent:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: numToCommas(agmt["number-changes-sent"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Changes Skipped:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: numToCommas(agmt["number-changes-skipped"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Reap Active:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt["reap-active"][0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("hr", {}),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Init Started:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: get_date_string(agmt["last-init-start"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Init Ended:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: get_date_string(agmt["last-init-end"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Init Status:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt["last-init-status"][0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("hr", {}),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Updated Started:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: get_date_string(agmt["last-update-start"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Update Ended:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: get_date_string(agmt["last-update-end"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Update Status:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt["last-update-status"][0] }) })
      ] }) });
    }
    getWakeupButton(name2) {
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
        Button,
        {
          id: name2,
          variant: "primary",
          onClick: this.props.handlePokeAgmt,
          title: _38("Awaken the replication agreement"),
          size: "sm",
          children: _38("Poke")
        }
      );
    }
    componentDidMount() {
      let rows = [];
      let columns = [...this.state.columns];
      let count = 0;
      for (const agmt of this.props.agmts) {
        rows.push({
          isOpen: false,
          cells: [
            agmt["agmt-name"][0],
            agmt.replica[0],
            agmt["replica-enabled"][0],
            { title: this.getWakeupButton(agmt["agmt-name"][0]) }
          ],
          originalData: agmt
        });
        count += 1;
      }
      if (rows.length === 0) {
        rows = [{ cells: [_38("No Agreements")] }];
        columns = [{ title: _38("Replication Agreements") }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleCollapse(_event, rowIndex, isExpanding) {
      const rows = [...this.state.rows];
      rows[rowIndex].isOpen = isExpanding;
      this.setState({ rows });
    }
    handleSort(_event, index, direction) {
      const sorted_agmts = [];
      const rows = [];
      for (const agmt of this.props.agmts) {
        sorted_agmts.push({
          agmt,
          1: agmt["agmt-name"][0],
          2: agmt.replica[0],
          3: agmt["replica-enabled"][0]
        });
      }
      sorted_agmts.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_agmts.reverse();
      }
      for (let agmt of sorted_agmts) {
        agmt = agmt.agmt;
        rows.push({
          isOpen: false,
          cells: [
            agmt["agmt-name"][0],
            agmt.replica[0],
            agmt["replica-enabled"][0],
            { title: this.getWakeupButton(agmt["agmt-name"][0]) }
          ],
          originalData: agmt
        });
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const startIdx = perPage * page - perPage;
      const tableRows = rows.slice(startIdx, startIdx + perPage);
      const hasNoAgreements = rows.length === 1 && rows[0].cells.length === 1;
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ds-margin-top-xlg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
          Table,
          {
            "aria-label": "Agreements table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                !hasNoAgreements && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Th, { screenReaderText: "Row expansion" }),
                columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy,
                      onSort: this.handleSort,
                      columnIndex
                    } : void 0,
                    screenReaderText: column.screenReaderText,
                    children: column.title
                  },
                  columnIndex
                ))
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_react108.default.Fragment, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                  !hasNoAgreements && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                    Td,
                    {
                      expand: {
                        rowIndex,
                        isExpanded: row.isOpen,
                        onToggle: () => this.handleCollapse(null, rowIndex, !row.isOpen)
                      }
                    }
                  ),
                  row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: cell.title || cell }, cellIndex))
                ] }),
                row.isOpen && row.originalData && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { isExpanded: true, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, {}),
                  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                    Td,
                    {
                      colSpan: columns.length + 1,
                      noPadding: true,
                      children: this.getExpandedRow(row.originalData)
                    }
                  )
                ] })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
          Pagination,
          {
            itemCount: this.props.agmts.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var ConnectionTable = class extends import_react108.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          {
            title: _38("Connection Opened"),
            sortable: true
          },
          { title: _38("IP Address"), sortable: true },
          { title: _38("Conn ID"), sortable: true },
          { title: _38("Bind DN"), sortable: true },
          {
            title: _38("Max Threads"),
            sortable: true,
            info: {
              tooltip: _38('If connection is currently at "Max Threads" then it will block new operations')
            }
          }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
      this.getExpandedRow = this.getExpandedRow.bind(this);
    }
    getExpandedRow(ip, conn_date, parts) {
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Grid, { className: "ds-indent ds-margin-top ds-margin-bottom", children: [
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("IP Address:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: ip }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("File Descriptor:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: parts[0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Connection Opened:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: conn_date }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Operations Started:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: numToCommas(parts[2]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Connection ID:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: parts[9] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Operations Finished:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: numToCommas(parts[3]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Bind DN:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: parts[5] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Read/write Blocked:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: numToCommas(parts[4]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { className: "ds-margin-top-lg", span: 5, children: _38("Connection Currently At Max Threads:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { className: "ds-margin-top-lg", span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: parts[6] === "1" ? _38("Yes") : _38("No") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 5, children: _38("Number Of Times Connection Hit Max Threads:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: numToCommas(parts[7]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 5, children: _38("Number Of Operations Blocked By Max Threads:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: numToCommas(parts[8]) }) })
      ] });
    }
    componentDidMount() {
      const rows = [];
      let count = 0;
      for (const conn of this.props.conns) {
        const ip_parts = conn.split(":ip=");
        const parts = conn.split(":", 10);
        let ip = ip_parts[1];
        if (ip === "local") {
          ip = "LDAPI";
        }
        const conn_date = get_date_string(parts[1]);
        rows.push({
          isOpen: false,
          cells: [
            conn_date,
            ip,
            parts[9],
            parts[5],
            parts[6] === "1" ? "Yes" : "No"
          ]
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getExpandedRow(ip, conn_date, parts) }]
        });
        count += 2;
      }
      this.setState({
        rows
      });
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows, perPage, page } = this.state;
      const index = perPage * (page - 1) * 2 + rowKey;
      rows[index].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      let count = 0;
      for (const conn of this.props.conns) {
        const ip_parts = conn.split(":ip=");
        const parts = conn.split(":", 10);
        let ip = ip_parts[1];
        if (ip === "local") {
          ip = "LDAPI";
        }
        const conn_date = get_date_string(parts[1]);
        const val = value.toLowerCase();
        const conn_raw = conn.toLowerCase();
        if (val !== "" && conn_raw.indexOf(val) === -1 && ip.toLowerCase().indexOf(val) === -1 && conn_date.indexOf(value) === -1) {
          continue;
        }
        rows.push({
          isOpen: false,
          cells: [
            conn_date,
            ip,
            parts[9],
            parts[5],
            parts[6] === "1" ? "Yes" : "No"
          ]
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getExpandedRow(ip, conn_date, parts) }]
        });
        count += 2;
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    handleSort(_event, index, direction) {
      const sorted_conns = [];
      const rows = [];
      let count = 0;
      for (const conn of this.props.conns) {
        const ip_parts = conn.split(":ip=");
        const parts = conn.split(":", 10);
        let ip = ip_parts[1];
        if (ip === "local") {
          ip = "LDAPI";
        }
        const conn_date = get_date_string(parts[1]);
        sorted_conns.push({
          raw: conn,
          1: conn_date,
          2: ip,
          3: parts[9],
          4: parts[5],
          5: parts[6]
        });
      }
      sorted_conns.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_conns.reverse();
      }
      for (const conn of sorted_conns) {
        const raw_conn = conn.raw;
        const ip_parts = raw_conn.split(":ip=");
        const parts = raw_conn.split(":", 10);
        let ip = ip_parts[1];
        if (ip === "local") {
          ip = "LDAPI";
        }
        const conn_date = get_date_string(parts[1]);
        rows.push({
          isOpen: false,
          cells: [
            conn_date,
            ip,
            parts[9],
            parts[5],
            parts[6] === "1" ? "Yes" : "No"
          ]
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getExpandedRow(ip, conn_date, parts) }]
        });
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const origRows = [...rows];
      const startIdx = (perPage * page - perPage) * 2;
      const tableRows = origRows.splice(startIdx, perPage * 2);
      for (let idx = 1, count = 0; idx < tableRows.length; idx += 2, count += 2) {
        tableRows[idx].parent = count;
      }
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ds-margin-top-xlg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Text, { component: TextVariants.h4, children: [
          _38("Client Connections:"),
          /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { className: "ds-left-margin", children: numToCommas(this.props.conns.length) })
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
          SearchInput,
          {
            className: "ds-margin-top-xlg",
            placeholder: _38("Search connections"),
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
          Table,
          {
            "aria-label": "Expandable table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Th, { screenReaderText: "Row expansion" }),
                columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy,
                      onSort: this.handleSort,
                      columnIndex: columnIndex + 1
                    } : void 0,
                    info: column.info,
                    children: column.title
                  },
                  columnIndex
                ))
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => {
                if (row.parent !== void 0) {
                  return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
                    Tr,
                    {
                      isExpanded: tableRows[row.parent].isOpen,
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, {}),
                        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                          Td,
                          {
                            colSpan: columns.length + 1,
                            noPadding: true,
                            children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ExpandableRowContent, { children: row.cells[0].title })
                          }
                        )
                      ]
                    },
                    rowIndex
                  );
                }
                return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                    Td,
                    {
                      expand: {
                        rowIndex,
                        isExpanded: row.isOpen,
                        onToggle: () => this.handleCollapse(null, rowIndex, !row.isOpen)
                      }
                    }
                  ),
                  row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: typeof cell === "object" ? cell.title : cell }, cellIndex))
                ] }, rowIndex);
              }) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
          Pagination,
          {
            itemCount: this.props.conns.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var GlueTable = class extends import_react108.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _38("Glue Entry"), sortable: true },
          { title: _38("Description"), sortable: true },
          { title: _38("Created"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
    }
    componentDidMount() {
      const rows = [];
      for (const glue of this.props.glues) {
        rows.push([
          glue.dn,
          glue.attrs.nsds5replconflict[0],
          get_date_string(glue.attrs.createtimestamp[0])
        ]);
      }
      this.setState({ rows });
    }
    handleSort(_event, index, direction) {
      const sortedGlues = [...this.state.rows];
      sortedGlues.sort((a2, b) => {
        const aValue = a2[index];
        const bValue = b[index];
        return aValue < bValue ? -1 : aValue > bValue ? 1 : 0;
      });
      if (direction !== SortByDirection.asc) {
        sortedGlues.reverse();
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: sortedGlues,
        page: 1
      });
    }
    getActions(rowData) {
      return [
        {
          title: _38("Convert Glue Entry"),
          onClick: () => this.props.convertGlue(rowData[0])
        },
        {
          title: _38("Delete Glue Entry"),
          onClick: () => this.props.deleteGlue(rowData[0])
        }
      ];
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const hasRows = this.props.glues.length > 0;
      const startIdx = perPage * page - perPage;
      let tableRows = [...rows].splice(startIdx, perPage);
      let displayColumns = [...columns];
      if (!hasRows) {
        tableRows = [[_38("No Glue Entries")]];
        displayColumns = [{ title: _38("Replication Conflict Glue Entries") }];
      }
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ds-margin-top-lg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "glue table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                displayColumns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                  Th,
                  {
                    sort: hasRows && column.sortable ? {
                      sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                hasRows && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: cell }, cellIndex)),
                hasRows && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActions(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
          Pagination,
          {
            itemCount: this.props.glues.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var ConflictTable = class extends import_react108.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _38("Conflict DN"), sortable: true },
          { title: _38("Description"), sortable: true },
          { title: _38("Created"), sortable: true },
          { title: "", sortable: false, screenReaderText: _38("Resolve the conflict") }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.getResolveButton = this.getResolveButton.bind(this);
    }
    getResolveButton(name2) {
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
        Button,
        {
          id: name2,
          variant: "primary",
          size: "sm",
          onClick: () => {
            this.props.resolveConflict(name2);
          },
          children: _38("Resolve")
        }
      );
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const conflict of this.props.conflicts) {
        rows.push([
          conflict.dn,
          conflict.attrs.nsds5replconflict[0],
          get_date_string(conflict.attrs.createtimestamp[0]),
          this.getResolveButton(conflict.dn)
        ]);
      }
      if (rows.length === 0) {
        rows = [[_38("No Conflict Entries")]];
        columns = [{ title: _38("Replication Conflict Entries") }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const sortedConflicts = [...this.state.rows];
      sortedConflicts.sort((a2, b) => {
        const aValue = a2[index];
        const bValue = b[index];
        if (typeof aValue === "string") {
          return aValue.localeCompare(bValue);
        }
        return 0;
      });
      if (direction !== SortByDirection.asc) {
        sortedConflicts.reverse();
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: sortedConflicts,
        page: 1
      });
    }
    render() {
      const { columns, rows, perPage, page, sortBy } = this.state;
      const startIdx = perPage * page - perPage;
      const tableRows = [...rows].splice(startIdx, perPage);
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ds-margin-top-lg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "conflict table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tr, { children: columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                Th,
                {
                  sort: column.sortable ? {
                    sortBy,
                    onSort: this.handleSort,
                    columnIndex: idx
                  } : void 0,
                  screenReaderText: column.screenReaderText,
                  children: column.title
                },
                idx
              )) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tr, { children: row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: cell }, cellIndex)) }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
          Pagination,
          {
            itemCount: rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var DiskTable = class extends import_react108.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        sortBy: {},
        columns: [
          { title: _38("Disk Partition"), sortable: true },
          { title: _38("Disk Size"), sortable: true },
          { title: _38("Used Space"), sortable: true },
          { title: _38("Available Space"), sortable: true }
        ]
      };
      this.handleSort = this.handleSort.bind(this);
    }
    handleSort(_event, columnIndex, direction) {
      const sortedRows = [...this.props.rows].sort((a2, b) => a2[columnIndex] < b[columnIndex] ? -1 : a2[columnIndex] > b[columnIndex] ? 1 : 0);
      this.setState({
        sortBy: {
          index: columnIndex,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    render() {
      const { columns, sortBy } = this.state;
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Table, { "aria-label": "Sortable Table", variant: "compact", children: [
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tr, { children: columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
          Th,
          {
            sort: column.sortable ? {
              sortBy,
              onSort: this.handleSort,
              columnIndex
            } : void 0,
            children: column.title
          },
          columnIndex
        )) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tbody, { children: this.props.rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tr, { children: row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: cell }, cellIndex)) }, rowIndex)) })
      ] }) });
    }
  };
  var ReportAliasesTable = class extends import_react108.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        sortBy: {},
        columns: [
          { title: _38("Alias"), sortable: true },
          { title: _38("Connection Data"), sortable: true }
        ]
      };
    }
    getActions(rowData) {
      return [
        {
          title: _38("Edit Alias"),
          onClick: () => this.props.editConfig(rowData[0], rowData[1])
        },
        {
          title: _38("Delete Alias"),
          onClick: () => this.props.deleteConfig(rowData[0])
        }
      ];
    }
    render() {
      let columns = this.state.columns;
      let rows = JSON.parse(JSON.stringify(this.props.rows));
      const hasRows = rows.length > 0;
      if (!hasRows) {
        rows = [[_38("No Aliases")]];
        columns = [{ title: _38("Instance Aliases") }];
      }
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ds-margin-top-xlg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { className: "ds-center ds-margin-bottom", component: "h4", children: _38("Replica Naming Aliases") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
          Table,
          {
            variant: "compact",
            "aria-label": "Sortable Table",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                  Th,
                  {
                    sort: hasRows && column.sortable ? {
                      sortBy: this.props.sortBy,
                      onSort: this.props.handleSort,
                      columnIndex
                    } : void 0,
                    children: column.title
                  },
                  columnIndex
                )),
                hasRows && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tbody, { children: rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: cell }, cellIndex)) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: row.cells[0] }),
                hasRows && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActions(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        )
      ] });
    }
  };
  var ReportCredentialsTable = class extends import_react108.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        columns: [
          { title: _38("Connection Data"), sortable: true },
          { title: _38("Bind DN"), sortable: true },
          { title: _38("Password"), sortable: true }
        ]
      };
    }
    getActions(rowData) {
      return [
        {
          title: _38("Edit Connection"),
          onClick: () => this.props.editConfig(rowData[0], rowData[1], rowData.credsBindpw, rowData.pwInteractive)
        },
        {
          title: _38("Delete Connection"),
          onClick: () => this.props.deleteConfig(rowData[0])
        }
      ];
    }
    render() {
      const { columns } = this.state;
      let tableRows = [];
      let displayColumns = [...columns];
      const hasRows = this.props.rows.length > 0;
      if (!hasRows) {
        tableRows = [[_38("No Credentials")]];
        displayColumns = [{ title: _38("Credentials Table") }];
      } else {
        tableRows = this.props.rows.map((row) => {
          const rowCopy = JSON.parse(JSON.stringify(row));
          const pwInteractive = rowCopy.pwInputInteractive;
          let pwField = /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("i", { children: _38("Interactive Input is set") });
          if (!pwInteractive) {
            if (rowCopy.credsBindpw === "") {
              pwField = /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("i", { children: _38("Both Password or Interactive Input flag are not set") });
            } else {
              pwField = "********";
            }
          }
          const cells = [
            rowCopy.connData,
            rowCopy.credsBinddn,
            pwField
          ];
          cells.credsBindpw = rowCopy.credsBindpw;
          cells.pwInteractive = pwInteractive;
          return cells;
        });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ds-margin-top", children: [
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { className: "ds-center ds-margin-bottom", component: TextVariants.h4, children: _38("Replication Report Credentials") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
          Table,
          {
            "aria-label": "Cred Table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                displayColumns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                  Th,
                  {
                    sort: hasRows && column.sortable ? {
                      sortBy: this.props.sortBy,
                      onSort: this.props.handleSort,
                      columnIndex
                    } : void 0,
                    children: column.title
                  },
                  columnIndex
                )),
                hasRows && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: cell }, cellIndex)) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: row }),
                hasRows && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActions(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        )
      ] });
    }
  };
  var ReportSingleTable = class extends import_react108.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          {
            title: _38("Supplier"),
            sortable: true
          },
          { title: _38("Agreement"), sortable: true },
          { title: _38("Status"), sortable: true },
          { title: _38("Lag"), sortable: true }
        ]
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.getExpandedRow = this.getExpandedRow.bind(this);
    }
    getExpandedRow(agmt) {
      if (agmt["agmt-name"][0] === "-") {
        return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { component: TextVariants.h4, children: _38("No agreement information") }) });
      }
      let replEnabled;
      if (agmt["replica-enabled"] === "off") {
        replEnabled = /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ds-warning-icon", children: [
          agmt["replica-enabled"][0],
          " ",
          /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_exclamation_triangle_icon9.ExclamationTriangleIcon, {})
        ] });
      } else {
        replEnabled = agmt["replica-enabled"][0];
      }
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Grid, { className: "ds-indent", children: [
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Suffix & Replica ID:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt.replicaName[0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Replica Server Status:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt.replicaStatus[0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Replication Enabled:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: replEnabled }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Session In Progress:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt["update-in-progress"][0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Consumer:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt.replica[0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Changes Sent:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: numToCommas(agmt["number-changes-sent"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Changes Skipped:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: numToCommas(agmt["number-changes-skipped"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Reap Active:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt["reap-active"][0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("hr", {}),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Init Started:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: get_date_string(agmt["last-init-start"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Init Ended:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: get_date_string(agmt["last-init-end"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Init Status:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt["last-init-status"][0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("hr", {}),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Updated Started:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: get_date_string(agmt["last-update-start"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Update Ended:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: get_date_string(agmt["last-update-end"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Update Status:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt["last-update-status"][0] }) })
      ] });
    }
    componentDidMount() {
      let rows = [];
      let columns = [...this.state.columns];
      let agmtName;
      let count = 0;
      for (const replica of this.props.rows) {
        if (!("agmt-name" in replica)) {
          replica["agmt-name"] = ["-"];
        }
        if (!("replica" in replica)) {
          replica.replica = ["-"];
        }
        if (!("replica-enabled" in replica)) {
          replica["replica-enabled"] = ["-"];
        }
        if (!("replication-lag-time" in replica)) {
          replica["replication-lag-time"] = ["-"];
        }
        if (!("replication-status" in replica)) {
          replica["replication-status"] = ["-"];
        }
        if (replica["replica-enabled"][0] === "off") {
          agmtName = /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ds-warning-icon", title: _38("Agreement is disabled"), children: [
            replica["agmt-name"][0],
            " ",
            /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_exclamation_triangle_icon9.ExclamationTriangleIcon, {})
          ] });
        } else {
          agmtName = replica["agmt-name"][0];
        }
        rows.push(
          {
            isOpen: false,
            cells: [
              replica.supplierName[0],
              { title: agmtName },
              replica["replication-status"][0],
              replica["replication-lag-time"][0]
            ]
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(replica) }]
          }
        );
        count += 2;
      }
      if (rows.length === 0) {
        rows = [{ cells: [_38("No Agreements")] }];
        columns = [{ title: _38("Replication Agreements") }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows } = this.state;
      rows[rowKey].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sorted_agmts = [];
      const rows = [];
      let count = 0;
      for (const agmt of this.props.rows) {
        sorted_agmts.push({
          agmt,
          1: agmt.supplierName[0],
          2: agmt["agmt-name"][0],
          3: ["replication-status"][0],
          4: agmt["replication-lag-time"][0],
          enabled: agmt["replica-enabled"] !== "off"
        });
      }
      sorted_agmts.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_agmts.reverse();
      }
      for (let agmt of sorted_agmts) {
        let agmtName;
        if (agmt["replica-enabled"] === "off") {
          agmtName = /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ds-warning-icon", title: _38("Agreement is disabled"), children: [
            agmt["agmt-name"][0],
            " ",
            /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_exclamation_triangle_icon9.ExclamationTriangleIcon, {})
          ] });
        } else {
          agmtName = agmt["agmt-name"][0];
        }
        agmt = agmt.agmt;
        rows.push({
          isOpen: false,
          cells: [
            agmt.supplierName[0],
            { title: agmtName },
            agmt["replication-status"][0],
            agmt["replication-lag-time"][0]
          ],
          enabled: agmt.enabled
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getExpandedRow(agmt) }]
        });
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows
      });
    }
    render() {
      const { columns, rows, sortBy } = this.state;
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
        Table,
        {
          "aria-label": "Expandable table",
          variant: "compact",
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Th, { screenReaderText: "Row expansion" }),
              columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                Th,
                {
                  sort: column.sortable ? {
                    sortBy,
                    onSort: this.handleSort,
                    columnIndex: columnIndex + 1
                  } : void 0,
                  children: column.title
                },
                columnIndex
              ))
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tbody, { children: rows.map((row, rowIndex) => {
              if (row.parent !== void 0) {
                return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
                  Tr,
                  {
                    isExpanded: rows[row.parent].isOpen,
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, {}),
                      /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                        Td,
                        {
                          colSpan: columns.length + 1,
                          noPadding: true,
                          children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ExpandableRowContent, { children: row.cells[0].title })
                        }
                      )
                    ]
                  },
                  rowIndex
                );
              }
              return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                  Td,
                  {
                    expand: {
                      rowIndex,
                      isExpanded: row.isOpen,
                      onToggle: () => this.handleCollapse(null, rowIndex, !row.isOpen)
                    }
                  }
                ),
                row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: typeof cell === "object" ? cell.title : cell }, cellIndex))
              ] }, rowIndex);
            }) })
          ]
        }
      ) });
    }
  };
  var ReportConsumersTable = class extends import_react108.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        sortBy: {},
        rows: [],
        columns: [
          { title: _38("Agreement Name"), sortable: true },
          { title: _38("Enabled"), sortable: true },
          { title: _38("Status"), sortable: true },
          { title: _38("Lag"), sortable: true }
        ]
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.getExpandedRow = this.getExpandedRow.bind(this);
    }
    getExpandedRow(agmt) {
      let replEnabled;
      if (agmt["agmt-name"][0] === "-") {
        return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { component: TextVariants.h4, children: _38("No agreement information") }) });
      }
      if (agmt["replica-enabled"] === "off") {
        replEnabled = /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ds-warning-icon", children: [
          agmt["replica-enabled"][0],
          " ",
          /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_exclamation_triangle_icon9.ExclamationTriangleIcon, {})
        ] });
      } else {
        replEnabled = agmt["replica-enabled"][0];
      }
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Grid, { className: "ds-margin-left", children: [
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Suffix & Replica ID:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt.replicaName[0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Replica Server Status:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt.replicaStatus[0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Replication Enabled:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: replEnabled }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Session In Progress:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt["update-in-progress"][0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Consumer:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt.replica[0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Changes Sent:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: numToCommas(agmt["number-changes-sent"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Changes Skipped:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: numToCommas(agmt["number-changes-skipped"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Reap Active:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt["reap-active"][0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("hr", {}),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Init Started:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: get_date_string(agmt["last-init-start"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Init Ended:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: get_date_string(agmt["last-init-end"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Init Status:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt["last-init-status"][0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("hr", {}),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Updated Started:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: get_date_string(agmt["last-update-start"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Update Ended:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: get_date_string(agmt["last-update-end"][0]) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 3, children: _38("Last Update Status:") }),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("b", { children: agmt["last-update-status"][0] }) })
      ] });
    }
    componentDidMount() {
      let rows = [];
      let columns = [...this.state.columns];
      let count = 0;
      for (const replica of this.props.rows) {
        let replEnabled;
        if (!("agmt-name" in replica)) {
          replica["agmt-name"] = ["-"];
        }
        if (!("replica-enabled" in replica)) {
          replica["replica-enabled"] = ["-"];
        }
        if (!("replication-lag-time" in replica)) {
          replica["replication-lag-time"] = ["-"];
        }
        if (!("replication-status" in replica)) {
          replica["replication-status"] = ["-"];
        }
        if (replica["replica-enabled"] === "off") {
          replEnabled = /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ds-warning-icon", title: _38("Agreement is disabled"), children: [
            replica["replica-enabled"][0],
            " ",
            /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_exclamation_triangle_icon9.ExclamationTriangleIcon, {})
          ] });
        } else {
          replEnabled = replica["replica-enabled"][0];
        }
        rows.push(
          {
            isOpen: false,
            cells: [
              replica["agmt-name"][0],
              { title: replEnabled },
              replica["replication-status"][0],
              replica["replication-lag-time"][0]
            ]
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(replica) }]
          }
        );
        count += 2;
      }
      if (rows.length === 0) {
        rows = [{ cells: [_38("No Agreements")] }];
        columns = [{ title: _38("Replication Agreements") }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows } = this.state;
      rows[rowKey].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sorted_agmts = [];
      const rows = [];
      let count = 0;
      for (const agmt of this.props.rows) {
        sorted_agmts.push({
          agmt,
          1: agmt["agmt-name"][0],
          2: agmt["agmt-enabled"][0],
          3: agmt["replication-status"][0],
          4: agmt["replication-lag-time"][0]
        });
      }
      sorted_agmts.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_agmts.reverse();
      }
      for (let agmt of sorted_agmts) {
        let replEnabled;
        agmt = agmt.agmt;
        if (agmt["replica-enabled"] === "off") {
          replEnabled = /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ds-warning-icon", title: _38("Agreement is disabled"), children: [
            agmt["replica-enabled"][0],
            " ",
            /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_exclamation_triangle_icon9.ExclamationTriangleIcon, {})
          ] });
        } else {
          replEnabled = agmt["replica-enabled"][0];
        }
        rows.push({
          isOpen: false,
          cells: [
            agmt["agmt-name"][0],
            { title: replEnabled },
            agmt["replication-status"][0],
            agmt["replication-lag-time"][0]
          ]
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [{ title: this.getExpandedRow(agmt) }]
        });
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows
      });
    }
    render() {
      const { columns, rows, sortBy } = this.state;
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
        Table,
        {
          className: "ds-margin-top",
          "aria-label": "Expandable consumer table",
          variant: "compact",
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Th, { screenReaderText: "Row expansion" }),
              columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                Th,
                {
                  sort: column.sortable ? {
                    sortBy,
                    onSort: this.handleSort,
                    columnIndex: columnIndex + 1
                  } : void 0,
                  children: column.title
                },
                columnIndex
              ))
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tbody, { children: rows.map((row, rowIndex) => {
              if (row.parent !== void 0) {
                return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
                  Tr,
                  {
                    isExpanded: rows[row.parent].isOpen,
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, {}),
                      /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                        Td,
                        {
                          colSpan: columns.length + 1,
                          noPadding: true,
                          children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ExpandableRowContent, { children: row.cells[0].title })
                        }
                      )
                    ]
                  },
                  rowIndex
                );
              }
              return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                  Td,
                  {
                    expand: {
                      rowIndex,
                      isExpanded: row.isOpen,
                      onToggle: () => this.handleCollapse(null, rowIndex, !row.isOpen)
                    }
                  }
                ),
                row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: typeof cell === "object" ? cell.title : cell }, cellIndex))
              ] }, rowIndex);
            }) })
          ]
        }
      ) });
    }
  };
  var ReplDSRCTable = class extends import_react108.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        sortBy: {},
        columns: [
          { title: _38("Name"), sortable: true },
          { title: _38("Connection Data"), sortable: true },
          { title: _38("Bind DN"), sortable: true },
          { title: _38("Password"), sortable: true },
          { title: "", sortable: false, screenReaderText: _38("Delete Button") }
        ],
        rows: []
      };
      this.handleSort = this.handleSort.bind(this);
    }
    componentDidMount() {
      let columns = [...this.state.columns];
      let rows = [];
      for (const conn of this.props.rows) {
        let cred = conn[4];
        if (conn[4] === "*") {
          const desc = /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("i", { children: "Prompt" });
          cred = desc;
        } else if (!conn[4].startsWith("[")) {
          cred = "**********";
        }
        rows.push([
          conn[0],
          `${conn[1]}:${conn[2]}`,
          conn[3],
          cred,
          /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "pf-v5-u-text-align-center", children: this.props.getDeleteButton(conn[0]) })
        ]);
      }
      if (this.props.rows.length === 0) {
        rows = [[_38("There is no saved replication monitor connections")]];
        columns = [{ title: _38("Replication Connections") }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, columnIndex, direction) {
      const sortedRows = [...this.state.rows].sort((a2, b) => a2[columnIndex] < b[columnIndex] ? -1 : a2[columnIndex] > b[columnIndex] ? 1 : 0);
      this.setState({
        sortBy: {
          index: columnIndex,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    render() {
      const { columns, rows, sortBy } = this.state;
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
        Table,
        {
          "aria-label": "Sortable DSRC Table",
          variant: "compact",
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tr, { children: columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
              Th,
              {
                sort: column.sortable ? {
                  sortBy,
                  onSort: this.handleSort,
                  columnIndex
                } : void 0,
                screenReaderText: column.screenReaderText,
                children: column.title
              },
              columnIndex
            )) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tbody, { children: rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tr, { children: row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: cell }, cellIndex)) }, rowIndex)) })
          ]
        }
      ) });
    }
  };
  var ReplDSRCAliasTable = class extends import_react108.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        sortBy: {},
        columns: [
          { title: _38("Alias"), sortable: true },
          { title: _38("Connection Data"), sortable: true },
          { title: "", sortable: false, screenReaderText: _38("Delete Button") }
        ],
        rows: []
      };
      this.handleSort = this.handleSort.bind(this);
    }
    componentDidMount() {
      let columns = [...this.state.columns];
      let rows = [];
      for (const alias of this.props.rows) {
        rows.push([
          alias[0],
          alias[1] + ":" + alias[2],
          /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "pf-v5-u-text-align-center", children: this.props.getDeleteButton(alias[0]) })
        ]);
      }
      if (this.props.rows.length === 0) {
        rows = [[_38("There are no saved replication monitor aliases")]];
        columns = [{ title: _38("Replication Monitoring Aliases") }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, columnIndex, direction) {
      const sortedRows = [...this.state.rows].sort((a2, b) => a2[columnIndex] < b[columnIndex] ? -1 : a2[columnIndex] > b[columnIndex] ? 1 : 0);
      this.setState({
        sortBy: {
          index: columnIndex,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    render() {
      const { columns, rows, sortBy } = this.state;
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
        Table,
        {
          "aria-label": "Sortable DSRC Table",
          variant: "compact",
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tr, { children: columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
              Th,
              {
                sort: column.sortable ? {
                  sortBy,
                  onSort: this.handleSort,
                  columnIndex
                } : void 0,
                screenReaderText: column.screenReaderText,
                children: column.title
              },
              columnIndex
            )) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tbody, { children: rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tr, { children: row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: cell }, cellIndex)) }, rowIndex)) })
          ]
        }
      ) });
    }
  };
  var ExistingLagReportsTable = class extends import_react108.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        sortBy: {},
        expandedRows: /* @__PURE__ */ new Set(),
        reports: this.props.reports || [],
        showLagReportModal: false,
        reportUrls: null,
        selectedReport: null,
        showConfirmReportDelete: false,
        reportToDelete: null,
        modalSpinning: false,
        modalChecked: false
      };
      this.handleSetPage = (_evt, newPage) => {
        this.setState({ page: newPage });
      };
      this.handlePerPageSelect = (_evt, newPerPage) => {
        this.setState({ page: 1, perPage: newPerPage });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleViewReport = this.handleViewReport.bind(this);
      this.closeLagReportModal = this.closeLagReportModal.bind(this);
      this.showConfirmReportDelete = this.showConfirmReportDelete.bind(this);
      this.closeConfirmReportDelete = this.closeConfirmReportDelete.bind(this);
      this.deleteReport = this.deleteReport.bind(this);
      this.onChange = this.onChange.bind(this);
    }
    componentDidUpdate(prevProps) {
      if (prevProps.reports !== this.props.reports) {
        this.setState({ reports: this.props.reports || [] });
      }
    }
    handleSort(_event, index, direction) {
      this.setState({
        sortBy: {
          index,
          direction
        }
      });
    }
    handleViewReport(report) {
      const reportUrls = {
        base: report.path,
        json: report.hasJson ? `${report.path}/replication_analysis.json` : null,
        summary: report.hasJson ? `${report.path}/replication_analysis_summary.json` : null,
        html: report.hasHtml ? `${report.path}/replication_analysis.html` : null,
        csv: report.hasCsv ? `${report.path}/replication_analysis.csv` : null,
        png: report.hasPng ? `${report.path}/replication_analysis.png` : null
      };
      this.setState({
        showLagReportModal: true,
        reportUrls,
        selectedReport: report
      });
      if (this.props.onSelectReport) {
        this.props.onSelectReport(report);
      }
    }
    closeLagReportModal() {
      this.setState({
        showLagReportModal: false,
        reportUrls: null,
        selectedReport: null
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    showConfirmReportDelete(report) {
      this.setState({
        showConfirmReportDelete: true,
        reportToDelete: report,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeConfirmReportDelete() {
      this.setState({
        showConfirmReportDelete: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    deleteReport() {
      const { reportToDelete } = this.state;
      if (!reportToDelete || !reportToDelete.path) {
        return;
      }
      this.setState({
        modalSpinning: true
      });
      const reportPath = reportToDelete.path;
      const reportName = reportToDelete.name;
      const blockedPaths = [
        "/etc/",
        "/bin/",
        "/sbin/",
        "/usr/",
        "/lib/",
        "/lib64/",
        "/boot/",
        "/dev/",
        "/proc/",
        "/sys/",
        "/root/"
      ];
      const isBlockedPath = blockedPaths.some((prefix) => reportPath.startsWith(prefix));
      if (isBlockedPath) {
        const errorMsg = cockpit_default.format(_38("Cannot delete report from protected system path: $0"), reportPath);
        console.error("Attempted to delete report from protected path:", reportPath);
        this.setState({
          modalSpinning: false,
          showConfirmReportDelete: false,
          reportToDelete: null
        });
        if (this.props.addNotification) {
          this.props.addNotification("error", errorMsg);
        }
        return;
      }
      if (reportPath === "/" || reportPath.split("/").filter((p) => p).length < 2) {
        const errorMsg = cockpit_default.format(_38("Invalid report path: $0"), reportPath);
        console.error("Attempted to delete report from invalid path:", reportPath);
        this.setState({
          modalSpinning: false,
          showConfirmReportDelete: false,
          reportToDelete: null
        });
        if (this.props.addNotification) {
          this.props.addNotification("error", errorMsg);
        }
        return;
      }
      const reportFilePatterns = [
        "replication_analysis.json",
        "replication_analysis_summary.json",
        "replication_analysis.html",
        "replication_analysis.csv",
        "replication_analysis.png"
      ];
      const deletedFiles = [];
      cockpit_default.spawn(["ls", "-1A", reportPath], { superuser: true, err: "message" }).then((output) => {
        const files = output.trim().split("\n").filter((f) => f);
        const allFilesValid = files.every(
          (file) => reportFilePatterns.includes(file)
        );
        if (!allFilesValid) {
          const errorMsg = cockpit_default.format(
            _38("Report directory '$0' contains unexpected files and cannot be safely deleted."),
            reportName
          );
          console.error("Directory contains unexpected files, refusing to delete:", reportPath);
          console.error("Files found:", files);
          this.setState({
            modalSpinning: false,
            showConfirmReportDelete: false,
            reportToDelete: null
          });
          if (this.props.addNotification) {
            this.props.addNotification("error", errorMsg);
          }
          return Promise.reject(new Error("Directory contains unexpected files"));
        }
        const deletePromises = files.map((file) => {
          const filePath = `${reportPath}/${file}`;
          return cockpit_default.spawn(["rm", "-f", filePath], { superuser: true, err: "message" }).then(() => {
            deletedFiles.push(file);
            return Promise.resolve();
          }).catch((err) => {
            console.error(`Failed to delete file ${file}:`, err);
            return Promise.reject({ file, error: err });
          });
        });
        return Promise.all(deletePromises);
      }).then(() => {
        return cockpit_default.spawn(["rmdir", reportPath], { superuser: true, err: "message" });
      }).then(() => {
        this.setState((prevState) => ({
          reports: prevState.reports.filter((r) => r.path !== reportPath),
          modalSpinning: false,
          showConfirmReportDelete: false,
          reportToDelete: null
        }));
        if (this.props.addNotification) {
          this.props.addNotification(
            "success",
            cockpit_default.format(_38("Report '$0' successfully deleted"), reportName)
          );
        }
        if (this.props.onReportDeleted) {
          this.props.onReportDeleted(reportToDelete);
        }
      }).catch((err) => {
        console.error("Error deleting report:", err);
        let errorMsg;
        if (err && err.file) {
          errorMsg = cockpit_default.format(
            _38("Failed to delete file '$0' from report '$1'. The report directory may be partially deleted."),
            err.file,
            reportName
          );
        } else if (deletedFiles.length > 0) {
          errorMsg = cockpit_default.format(
            _38("Deleted $0 files from report '$1', but failed to remove the directory. You may need to manually clean up: $2"),
            deletedFiles.length,
            reportName,
            reportPath
          );
        } else {
          const errDetail = err && err.message ? err.message : err.toString();
          errorMsg = cockpit_default.format(
            _38("Failed to delete report '$0': $1"),
            reportName,
            errDetail
          );
        }
        this.setState({
          modalSpinning: false,
          showConfirmReportDelete: false,
          reportToDelete: null
        });
        if (this.props.addNotification) {
          this.props.addNotification("error", errorMsg);
        }
        if (this.props.onReloadReports) {
          this.props.onReloadReports();
        }
      });
    }
    render() {
      const { page, perPage, sortBy, reports, showLagReportModal, reportUrls, showConfirmReportDelete, reportToDelete, modalSpinning, modalChecked } = this.state;
      const { onSelectReport } = this.props;
      let sortedReports = [...reports];
      if (sortBy.index !== void 0) {
        sortedReports.sort((a2, b) => {
          if (sortBy.index === 0) {
            return sortBy.direction === "asc" ? a2.name.localeCompare(b.name) : b.name.localeCompare(a2.name);
          }
          if (sortBy.index === 1) {
            return sortBy.direction === "asc" ? new Date(a2.creationTime) - new Date(b.creationTime) : new Date(b.creationTime) - new Date(a2.creationTime);
          }
          if (sortBy.index === 2) {
            return sortBy.direction === "asc" ? a2.hasJson - b.hasJson : b.hasJson - a2.hasJson;
          }
          if (sortBy.index === 3) {
            return sortBy.direction === "asc" ? a2.hasHtml - b.hasHtml : b.hasHtml - a2.hasHtml;
          }
          if (sortBy.index === 4) {
            return sortBy.direction === "asc" ? a2.hasCsv - b.hasCsv : b.hasCsv - a2.hasCsv;
          }
          if (sortBy.index === 5) {
            return sortBy.direction === "asc" ? a2.hasPng - b.hasPng : b.hasPng - a2.hasPng;
          }
          return 0;
        });
      }
      const startIdx = (page - 1) * perPage;
      const paginatedReports = sortedReports.slice(startIdx, startIdx + perPage);
      const columns = [
        { title: _38("Report Name"), transforms: [sortable] },
        { title: _38("Creation Time"), transforms: [sortable] },
        { title: _38("JSON"), transforms: [] },
        { title: _38("HTML"), transforms: [] },
        { title: _38("CSV"), transforms: [] },
        { title: _38("PNG"), transforms: [] },
        { title: _38("Actions"), transforms: [] }
      ];
      return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "ds-margin-top-lg", children: reports.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
            Table,
            {
              "aria-label": _38("Existing Reports"),
              variant: "compact",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tr, { children: columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                  Th,
                  {
                    sort: {
                      columnIndex,
                      sortBy,
                      onSort: this.handleSort
                    },
                    children: column.title
                  },
                  columnIndex
                )) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Tbody, { children: paginatedReports.map((report, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tr, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: report.name }),
                  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: report.creationTime }),
                  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: report.hasJson ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CheckIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MinusIcon, {}) }),
                  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: report.hasHtml ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CheckIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MinusIcon, {}) }),
                  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: report.hasCsv ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CheckIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MinusIcon, {}) }),
                  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: report.hasPng ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CheckIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MinusIcon, {}) }),
                  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Td, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { style: { display: "flex", gap: "8px" }, children: [
                    /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                      Button,
                      {
                        variant: "primary",
                        onClick: () => this.handleViewReport(report),
                        children: _38("View")
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
                      Button,
                      {
                        variant: "danger",
                        onClick: () => this.showConfirmReportDelete(report),
                        children: _38("Delete")
                      }
                    )
                  ] }) })
                ] }, rowIndex)) })
              ]
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
            Pagination,
            {
              itemCount: reports.length,
              widgetId: "pagination-options-menu-bottom",
              perPage,
              page,
              variant: "bottom",
              onSetPage: this.handleSetPage,
              onPerPageSelect: this.handlePerPageSelect
            }
          )
        ] }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(EmptyState, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(EmptyStateIcon, { icon: SearchIcon }),
          /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Title, { headingLevel: "h4", size: "lg", children: _38("No reports found") }),
          /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(EmptyStateBody, { children: _38("No replication log analysis reports were found in the selected directory.") })
        ] }) }),
        showLagReportModal && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
          LagReportModal,
          {
            showModal: showLagReportModal,
            closeHandler: this.closeLagReportModal,
            reportUrls
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
          DoubleConfirmModal,
          {
            showModal: showConfirmReportDelete,
            closeHandler: this.closeConfirmReportDelete,
            handleChange: this.onChange,
            actionHandler: this.deleteReport,
            spinning: modalSpinning,
            item: reportToDelete ? reportToDelete.name : "",
            checked: modalChecked,
            mTitle: _38("Delete Report"),
            mMsg: _38("Are you sure you want to delete this report?"),
            mSpinningMsg: _38("Deleting ..."),
            mBtnName: _38("Delete Report")
          }
        )
      ] });
    }
  };
  ReplDSRCAliasTable.defaultProps = {
    rows: import_prop_types37.default.array
  };
  ReplDSRCAliasTable.defaultProps = {
    rows: []
  };
  ReplDSRCTable.defaultProps = {
    rows: import_prop_types37.default.array
  };
  ReplDSRCTable.defaultProps = {
    rows: []
  };
  AgmtTable.propTypes = {
    agmts: import_prop_types37.default.array,
    handlePokeAgmt: import_prop_types37.default.func
  };
  AgmtTable.defaultProps = {
    agmts: []
  };
  WinsyncAgmtTable.propTypes = {
    agmts: import_prop_types37.default.array,
    handlePokeAgmt: import_prop_types37.default.func
  };
  WinsyncAgmtTable.defaultProps = {
    agmts: []
  };
  ConnectionTable.propTypes = {
    conns: import_prop_types37.default.array
  };
  ConnectionTable.defaultProps = {
    conns: []
  };
  CleanALLRUVTable.propTypes = {
    tasks: import_prop_types37.default.array
  };
  CleanALLRUVTable.defaultProps = {
    tasks: []
  };
  AbortCleanALLRUVTable.propTypes = {
    tasks: import_prop_types37.default.array
  };
  AbortCleanALLRUVTable.defaultProps = {
    tasks: []
  };
  ConflictTable.propTypes = {
    conflicts: import_prop_types37.default.array,
    resolveConflict: import_prop_types37.default.func
  };
  ConflictTable.defaultProps = {
    conflicts: []
  };
  GlueTable.propTypes = {
    glues: import_prop_types37.default.array,
    convertGlue: import_prop_types37.default.func,
    deleteGlue: import_prop_types37.default.func
  };
  GlueTable.defaultProps = {
    glues: import_prop_types37.default.array
  };
  ReportCredentialsTable.propTypes = {
    rows: import_prop_types37.default.array,
    editConfig: import_prop_types37.default.func,
    deleteConfig: import_prop_types37.default.func
  };
  ReportCredentialsTable.defaultProps = {
    rows: []
  };
  ReportAliasesTable.propTypes = {
    rows: import_prop_types37.default.array,
    editConfig: import_prop_types37.default.func,
    deleteConfig: import_prop_types37.default.func
  };
  ReportAliasesTable.defaultProps = {
    rows: []
  };
  ReportConsumersTable.propTypes = {
    rows: import_prop_types37.default.array
  };
  ReportConsumersTable.defaultProps = {
    rows: []
  };
  ReportSingleTable.propTypes = {
    rows: import_prop_types37.default.array
  };
  ReportSingleTable.defaultProps = {
    rows: []
  };
  DiskTable.defaultProps = {
    rows: import_prop_types37.default.array
  };
  DiskTable.defaultProps = {
    rows: []
  };
  ExistingLagReportsTable.propTypes = {
    reports: import_prop_types37.default.array,
    onSelectReport: import_prop_types37.default.func,
    addNotification: import_prop_types37.default.func,
    onReportDeleted: import_prop_types37.default.func,
    onReloadReports: import_prop_types37.default.func
  };
  ExistingLagReportsTable.defaultProps = {
    reports: [],
    onSelectReport: () => {
    },
    addNotification: () => {
    },
    onReportDeleted: () => {
    },
    onReloadReports: () => {
    }
  };

  // src/lib/monitor/serverMonitor.jsx
  var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
  var _39 = cockpit_default.gettext;
  var refresh_interval = 1e4;
  var ServerMonitor = class extends import_react109.default.Component {
    constructor(props) {
      super(props);
      const initCPUChart = [];
      const initVirtChart = [];
      const initResChart = [];
      const initSwapChart = [];
      const initConnChart = [];
      const initConnEstablishedChart = [];
      const initConnTimeWaitChart = [];
      const initConnCloseWaitChart = [];
      for (let idx = 0; idx <= 5; idx++) {
        const value = refresh_interval / 1e3;
        const x_value = "0:00:" + (idx === 0 ? "00" : value * idx).toString();
        initCPUChart.push({ name: "CPU", x: x_value, y: 0 });
        initResChart.push({ name: "Resident", x: x_value, y: 0 });
        initVirtChart.push({ name: "Virtual", x: x_value, y: 0 });
        initSwapChart.push({ name: "Swap", x: x_value, y: 0 });
        initConnChart.push({ name: "Connections", x: x_value, y: 0 });
        initConnTimeWaitChart.push({ name: "Connections time wait", x: x_value, y: 0 });
        initConnCloseWaitChart.push({ name: "Connections close wait", x: x_value, y: 0 });
        initConnEstablishedChart.push({ name: "Connections established", x: x_value, y: 0 });
      }
      this.state = {
        activeKey: this.props.serverTab,
        port: 389,
        secure_port: 636,
        conn_highmark: 1e3,
        cpu_tick_values: [25, 50, 75, 100],
        mem_tick_values: [25, 50, 75, 100],
        conn_tick_values: [250, 500, 750, 1e3],
        mem_ratio: 0,
        total_threads: 0,
        chart_refresh: "",
        initCPUChart,
        initVirtChart,
        initResChart,
        initSwapChart,
        initConnChart,
        initConnEstablishedChart,
        initConnTimeWaitChart,
        initConnCloseWaitChart,
        cpuChart: [...initCPUChart],
        memVirtChart: [...initVirtChart],
        memResChart: [...initResChart],
        swapChart: [...initSwapChart],
        connChart: [...initConnChart],
        connEstablishedChart: [...initConnEstablishedChart],
        connTimeWaitChart: [...initConnTimeWaitChart],
        connCloseWaitChart: [...initConnCloseWaitChart]
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeKey: tabIndex
        });
      };
      this.startRefresh = this.startRefresh.bind(this);
      this.refreshCharts = this.refreshCharts.bind(this);
      this.stopRefresh = this.stopRefresh.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
      this.refreshCharts();
      this.startRefresh();
    }
    componentWillUnmount() {
      this.stopRefresh();
    }
    resetChartData() {
      this.setState({
        conn_highmark: 1e3,
        cpu_tick_values: [25, 50, 75, 100],
        mem_tick_values: [],
        conn_tick_values: [250, 500, 750, 1e3],
        cpuChart: [...this.state.initCPUChart],
        memVirtChart: [...this.state.initVirtChart],
        memResChart: [...this.state.initResChart],
        swapChart: [...this.state.initSwapChart],
        connChart: [...this.state.initConnChart],
        connCloseWaitChart: [...this.state.initConnCloseWaitChart],
        connTimeWaitChart: [...this.state.initConnTimeWaitChart],
        connEstablishedChart: [...this.state.initConnEstablishedChart]
      });
    }
    refreshCharts() {
      let cpu = 0;
      let mem_total = 0;
      let mem_rss_usage = 0;
      let mem_vms_usage = 0;
      let mem_swap_usage = 0;
      let virt_mem = 0;
      let res_mem = 0;
      let swap_mem = 0;
      let current_conns = 0;
      let conn_established = 0;
      let conn_close_wait = 0;
      let conn_time_wait = 0;
      let total_threads = 0;
      let conn_highmark = this.state.conn_highmark;
      let cpu_tick_values = this.state.cpu_tick_values;
      let conn_tick_values = this.state.conn_tick_values;
      let interval2 = "0:00:00";
      const cmd = [
        "dsconf",
        "-j",
        this.props.serverId,
        "monitor",
        "server",
        "--just-resources"
      ];
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const data = JSON.parse(content);
        const attrs = data.attrs;
        const date2 = /* @__PURE__ */ new Date();
        cpu = attrs["cpu_usage"][0];
        mem_rss_usage = attrs["mem_rss_percent"][0];
        mem_vms_usage = attrs["mem_vms_percent"][0];
        mem_swap_usage = attrs["mem_swap_percent"][0];
        virt_mem = attrs["vms"][0];
        res_mem = attrs["rss"][0];
        swap_mem = attrs["swap"][0];
        current_conns = attrs["connection_count"][0];
        conn_established = attrs["connection_established_count"][0];
        conn_close_wait = attrs["connection_close_wait_count"][0];
        conn_time_wait = attrs["connection_time_wait_count"][0];
        total_threads = attrs["total_threads"][0];
        mem_total = attrs["total_mem"][0];
        let hour = date2.getHours().toString();
        let min3 = date2.getMinutes();
        let sec = date2.getSeconds();
        if (min3 < 10) {
          min3 = "0" + min3;
        }
        if (sec < 10) {
          sec = "0" + sec;
        }
        interval2 = hour + ":" + min3 + ":" + sec;
        if (current_conns > conn_highmark) {
          conn_highmark = Math.ceil(current_conns / 1e3) * 1e3;
          const conn_incr = Math.ceil(conn_highmark / 4);
          let tick = conn_incr;
          conn_tick_values = [
            tick,
            tick += conn_incr,
            tick += conn_incr,
            tick += conn_incr
          ];
        }
        const cpuChart = this.state.cpuChart;
        cpuChart.shift();
        cpuChart.push({ name: _39("CPU"), x: interval2, y: parseInt(cpu) });
        const memVirtChart = this.state.memVirtChart;
        memVirtChart.shift();
        memVirtChart.push({ name: _39("Virtual Memory"), x: interval2, y: parseInt(mem_vms_usage) });
        const memResChart = this.state.memResChart;
        memResChart.shift();
        memResChart.push({ name: _39("Resident Memory"), x: interval2, y: parseInt(mem_rss_usage) });
        const swapChart = this.state.swapChart;
        swapChart.shift();
        swapChart.push({ name: "Swap", x: interval2, y: parseInt(mem_swap_usage) });
        const connChart = this.state.connChart;
        connChart.shift();
        connChart.push({ name: _39("Connections"), x: interval2, y: parseInt(current_conns) });
        const connEstablishedChart = this.state.connEstablishedChart;
        connEstablishedChart.shift();
        connEstablishedChart.push({ name: _39("Connections established"), x: interval2, y: parseInt(conn_established) });
        const connTimeWaitChart = this.state.connTimeWaitChart;
        connTimeWaitChart.shift();
        connTimeWaitChart.push({ name: _39("Connections time wait"), x: interval2, y: parseInt(conn_time_wait) });
        const connCloseWaitChart = this.state.connCloseWaitChart;
        connCloseWaitChart.shift();
        connCloseWaitChart.push({ name: _39("Connections close wait"), x: interval2, y: parseInt(conn_close_wait) });
        this.setState({
          cpu_tick_values,
          conn_tick_values,
          cpuChart,
          memVirtChart,
          memResChart,
          swapChart,
          connChart,
          connTimeWaitChart,
          connCloseWaitChart,
          connEstablishedChart,
          conn_highmark,
          current_conns,
          conn_close_wait,
          conn_time_wait,
          conn_established,
          mem_virt_size: virt_mem,
          mem_res_size: res_mem,
          mem_swap_size: swap_mem,
          mem_rss_ratio: mem_rss_usage,
          mem_vms_ratio: mem_vms_usage,
          mem_swap_ratio: mem_swap_usage,
          mem_total,
          cpu,
          total_threads
        });
      }).fail(() => {
        this.resetChartData();
      });
    }
    startRefresh() {
      this.setState({
        chart_refresh: setInterval(this.refreshCharts, refresh_interval)
      });
    }
    stopRefresh() {
      clearInterval(this.state.chart_refresh);
    }
    render() {
      const {
        cpu,
        connChart,
        connTimeWaitChart,
        connCloseWaitChart,
        connEstablishedChart,
        cpuChart,
        current_conns,
        conn_established,
        conn_close_wait,
        conn_time_wait,
        memResChart,
        memVirtChart,
        swapChart,
        mem_virt_size,
        mem_res_size,
        mem_swap_size,
        mem_rss_ratio,
        mem_vms_ratio,
        mem_swap_ratio,
        mem_total,
        total_threads
      } = this.state;
      const startTime = this.props.data.starttime[0];
      const currTime = this.props.data.currenttime[0];
      const startDate = get_date_string(this.props.data.starttime[0]);
      const uptime = get_date_diff(startTime, currTime);
      const conn_tick_values = this.state.conn_tick_values;
      let cpu_tick_values = this.state.cpu_tick_values;
      let mem_tick_values = this.state.mem_tick_values;
      if (cpu > 100) {
        let tick = Math.ceil(cpu / 100) * 100 / 4;
        let incr = tick;
        cpu_tick_values = [tick, tick += incr, tick += incr, tick += incr];
      } else {
        cpu_tick_values = [25, 50, 75, 100];
      }
      if (mem_vms_ratio > 100 || mem_rss_ratio > 100 || mem_swap_ratio > 100) {
        let mem_ratio;
        if (mem_vms_ratio >= mem_rss_ratio && mem_vms_ratio >= mem_swap_ratio) {
          mem_ratio = mem_vms_ratio;
        } else if (mem_rss_ratio >= mem_vms_ratio && mem_rss_ratio >= mem_swap_ratio) {
          mem_ratio = mem_rss_ratio;
        } else {
          mem_ratio = mem_swap_ratio;
        }
        let tick = Math.ceil(mem_ratio / 100) * 100 / 4;
        let incr = tick;
        mem_tick_values = [tick, tick += incr, tick += incr, tick += incr];
      } else {
        mem_tick_values = [25, 50, 75, 100];
      }
      return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { id: "monitor-server-page", children: [
        /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { component: TextVariants.h3, children: [
          _39("Server Statistics"),
          /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _39("Refresh suffix monitor"),
              onClick: () => this.props.handleReload(this.state.activeKey),
              children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Tabs, { isFilled: true, className: "ds-margin-top-lg", activeKey: this.state.activeKey, onSelect: this.handleNavSelect, children: [
          /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TabTitleText, { children: _39("Resource Charts") }), children: [
            /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Grid, { className: "ds-margin-top-lg", hasGutter: true, children: [
              /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: "6", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Card, { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(GridItem, { span: "4", title: _39("Established client connections to the server"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "ds-center", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { component: TextVariants.h2, children: _39("Connections") }) }),
                    /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { component: TextVariants.h6, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(current_conns) }) }) }),
                    /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Divider, { className: "ds-margin-top ds-margin-bottom" })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TextContent, { className: "ds-margin-top-lg", title: "Connections that are in an ESTABLISHED state", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { component: TextVariants.p, children: [
                    "Established: \xA0\xA0",
                    /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(conn_established) })
                  ] }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TextContent, { className: "ds-margin-top-lg", title: "Connections that are in a CLOSE_WAIT state", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { component: TextVariants.p, children: [
                    "Close wait: \xA0\xA0",
                    /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(conn_close_wait) })
                  ] }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TextContent, { className: "ds-margin-top-lg", title: "Connections that are in a TIME_WAIT state", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { component: TextVariants.p, children: [
                    "Time wait: \xA0\xA0",
                    /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(conn_time_wait) })
                  ] }) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: "8", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
                  Chart,
                  {
                    ariaDesc: "connection stats",
                    ariaTitle: _39("Live Connection Statistics"),
                    containerComponent: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
                    height: 220,
                    minDomain: { y: 0 },
                    padding: {
                      bottom: 30,
                      left: 60,
                      top: 10,
                      right: 30
                    },
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChartAxis, {}),
                      /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: conn_tick_values }),
                      /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(ChartGroup, { children: [
                        /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
                          ChartArea,
                          {
                            data: connChart
                          }
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
                          ChartArea,
                          {
                            data: connEstablishedChart,
                            interpolation: "monotoneX"
                          }
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
                          ChartArea,
                          {
                            data: connTimeWaitChart,
                            interpolation: "monotoneX"
                          }
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
                          ChartArea,
                          {
                            data: connCloseWaitChart,
                            interpolation: "monotoneX"
                          }
                        )
                      ] })
                    ]
                  }
                ) })
              ] }) }) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Card, { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(GridItem, { span: "4", className: "ds-center", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { className: "ds-margin-top-xlg", component: TextVariants.h3, children: _39("CPU Usage") }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { component: TextVariants.h6, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("b", { children: [
                    cpu,
                    "%"
                  ] }) }) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: "8", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
                  Chart,
                  {
                    ariaDesc: "cpu",
                    ariaTitle: _39("Server CPU Usage"),
                    containerComponent: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}%`, constrainToVisibleArea: true }),
                    height: 220,
                    minDomain: { y: 0 },
                    padding: {
                      bottom: 30,
                      left: 55,
                      top: 10,
                      right: 25
                    },
                    themeColor: ChartThemeColor.multiUnordered,
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChartAxis, {}),
                      /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
                        ChartAxis,
                        {
                          dependentAxis: true,
                          showGrid: true,
                          tickFormat: (value) => `${value}%`,
                          tickValues: cpu_tick_values
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChartGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
                        ChartArea,
                        {
                          data: cpuChart,
                          interpolation: "monotoneX"
                        }
                      ) })
                    ]
                  }
                ) })
              ] }) }) }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Card, { className: "ds-margin-top-lg ds-margin-bottom-md", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Grid, { hasGutter: true, children: [
              /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(GridItem, { className: "ds-center ds-margin-top-xl", span: "3", children: [
                /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TextContent, { className: "ds-margin-top", title: "The percentage of system memory used by Directory Server", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { component: TextVariants.h3, children: "Total System Memory" }) }),
                /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { component: TextVariants.h6, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: displayBytes(mem_total) }) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Divider, { className: "ds-margin-top ds-margin-bottom" }),
                /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TextContent, { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { component: TextVariants.h3, children: _39("Resident Size") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { component: TextVariants.h6, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: displayBytes(mem_res_size) }),
                  " (",
                  mem_rss_ratio,
                  "%)"
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { className: "ds-margin-top-lg", component: TextVariants.h3, children: _39("Virtual Size") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { component: TextVariants.h6, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: displayBytes(mem_virt_size) }),
                  " (",
                  mem_vms_ratio,
                  "%)"
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TextContent, { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Text, { component: TextVariants.h3, children: "Swap Size" }) }),
                /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Text, { component: TextVariants.h6, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: displayBytes(mem_swap_size) }),
                  " (",
                  mem_swap_ratio,
                  "%)"
                ] }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: "9", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
                Chart,
                {
                  ariaDesc: "Server Memory Utilization",
                  ariaTitle: _39("Live Server Memory Statistics"),
                  containerComponent: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}%`, constrainToVisibleArea: true }),
                  height: 125,
                  minDomain: { y: 0 },
                  padding: {
                    bottom: 30,
                    left: 60,
                    top: 10,
                    right: 30
                  },
                  themeColor: ChartThemeColor.multiUnordered,
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ChartAxis, {}),
                    /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
                      ChartAxis,
                      {
                        dependentAxis: true,
                        showGrid: true,
                        style: {
                          tickLabels: {
                            fontSize: 8
                          }
                        },
                        tickFormat: (value) => `${value}%`,
                        tickValues: mem_tick_values
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(ChartGroup, { children: [
                      /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
                        ChartArea,
                        {
                          data: memVirtChart,
                          interpolation: "monotoneX",
                          themeColor: ChartThemeColor.blue
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
                        ChartArea,
                        {
                          data: memResChart,
                          interpolation: "monotoneX",
                          themeColor: ChartThemeColor.green
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
                        ChartArea,
                        {
                          data: swapChart,
                          interpolation: "monotoneX",
                          themeColor: ChartThemeColor.red
                        }
                      )
                    ] })
                  ]
                }
              ) })
            ] }) }) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TabTitleText, { children: _39("Server Stats") }), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Grid, { hasGutter: true, className: "ds-margin-top-xlg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, children: _39("Server Instance") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: "slapd-" + this.props.serverId }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, children: _39("Version") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: this.props.data.version }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, children: _39("Server Started") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: startDate }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, children: _39("Server Uptime") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: uptime }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("hr", {}),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, title: "Active threads includes worker threads, listener threads, tasks, and persistent searches", children: _39("Active Threads") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: this.props.data.threads }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, title: "Count of all the threads the server has created. Includes replication agrements, housekeeping, worker threads, tasks, etc", children: _39("Total Threads") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: total_threads }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, children: _39("Threads Waiting To Read") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.data.readwaiters) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, children: _39("Conns At Max Threads") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.data.currentconnectionsatmaxthreads) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, children: _39("Conns Exceeded Max Threads") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.data.maxthreadsperconnhits) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, title: "Worker threads currently processing an operation", children: _39("Busy Workers") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.data.currentbusyworkers) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, title: "Peak number of busy worker threads since startup", children: _39("Max Busy Workers") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.data.maxbusyworkers) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, title: "Operations currently waiting in the work queue", children: _39("Work Queue Size") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.data.currentworkqueue) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, title: "High-water mark of work queue depth since startup", children: _39("Max Work Queue Size") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.data.maxworkqueue) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, children: _39("Total Connections") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.data.totalconnections) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, children: _39("Current Connections") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.data.currentconnections) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, children: _39("Operations Started") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.data.opsinitiated) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, children: _39("Operations Completed") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.data.opscompleted) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, children: _39("Entries Returned To Clients") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.data.entriessent) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 3, children: _39("Data Sent to Clients") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: displayBytes(this.props.data.bytessent) }) })
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TabTitleText, { children: _39("Connection Table") }), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ConnectionTable, { conns: this.props.data.connection }) }),
          /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Tab, { eventKey: 3, title: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TabTitleText, { children: _39("Disk Space") }), children: [
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
              DiskTable,
              {
                rows: this.props.disks
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
              Button,
              {
                className: "ds-margin-top-lg",
                variant: "secondary",
                onClick: this.props.handleReloadDisks,
                isLoading: this.props.diskReloadSpinning,
                spinnerAriaValueText: this.props.diskReloadSpinning ? "Refreshing" : void 0,
                isDisabled: this.props.diskReloadSpinning,
                children: this.props.diskReloadSpinning ? "Refreshing" : _39("Refresh")
              }
            )
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Tab, { eventKey: 4, title: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TabTitleText, { children: _39("SNMP Counters") }), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Grid, { className: "ds-margin-top-xlg", hasGutter: true, children: [
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Anonymous Binds") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.anonymousbinds[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Referrals") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.referrals[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Unauthenticated Binds") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.unauthbinds[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Returned Referrals") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.referralsreturned[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Simple Auth Binds") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.simpleauthbinds[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Bind Security Errors") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.bindsecurityerrors[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Strong Auth Binds") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.strongauthbinds[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Security Errors") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.securityerrors[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Initiated Operations") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.inops[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Errors") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.errors[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Compare Operations") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.compareops[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Current Connections") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.connections[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Add Operations") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.addentryops[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Total Connections") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.connectionseq[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Delete Operations") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.removeentryops[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Conns in Max Threads") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.connectionsinmaxthreads[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Modify Operations") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.modifyentryops[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Conns Exceeded Max Threads") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.connectionsmaxthreadscount[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("ModRDN Operations") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.modifyrdnops[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Data Received") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: displayBytes(this.props.snmpData.bytesrecv[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Search Operations") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.searchops[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Data Sent") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: displayBytes(this.props.snmpData.bytessent[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("One Level Searches") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.onelevelsearchops[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Entries Returned") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.entriesreturned[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 4, children: _39("Whole Tree Searches") }),
            /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: numToCommas(this.props.snmpData.wholesubtreesearchops[0]) }) })
          ] }) })
        ] })
      ] });
    }
  };
  ServerMonitor.propTypes = {
    serverId: import_prop_types38.default.string,
    data: import_prop_types38.default.object,
    handleReload: import_prop_types38.default.func,
    enableTree: import_prop_types38.default.func
  };
  ServerMonitor.defaultProps = {
    serverId: "",
    data: {}
  };
  var serverMonitor_default = ServerMonitor;

  // src/lib/monitor/dbMonitor.jsx
  var import_react110 = __toESM(require_react(), 1);
  var import_prop_types39 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
  var _40 = cockpit_default.gettext;
  var DatabaseMonitor = class extends import_react110.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: 0,
        data: {},
        loading: true,
        // refresh charts
        cache_refresh: "",
        count: 10,
        ndnCount: 5,
        dbCacheList: [],
        ndnCacheList: [],
        ndnCacheUtilList: [],
        ndn_cache_enabled: false
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.startCacheRefresh = this.startCacheRefresh.bind(this);
      this.refreshCache = this.refreshCache.bind(this);
    }
    componentDidMount() {
      this.resetChartData();
      this.refreshCache();
      this.startCacheRefresh();
      this.props.enableTree();
    }
    componentWillUnmount() {
      this.stopCacheRefresh();
    }
    resetChartData() {
      this.setState({
        data: {
          dbcachehitratio: [0],
          dbcachetries: [0],
          dbcachehits: [0],
          dbcachepagein: [0],
          dbcachepageout: [0],
          dbcacheroevict: [0],
          dbcacherwevict: [0],
          normalizeddncachehitratio: [0],
          maxnormalizeddncachesize: [0],
          currentnormalizeddncachesize: [0],
          normalizeddncachetries: [0],
          normalizeddncachehits: [0],
          normalizeddncacheevictions: [0],
          currentnormalizeddncachecount: [0],
          normalizeddncachethreadsize: [0],
          normalizeddncachethreadslots: [0]
        },
        dbCacheList: [
          { name: "", x: "1", y: 0 },
          { name: "", x: "2", y: 0 },
          { name: "", x: "3", y: 0 },
          { name: "", x: "4", y: 0 },
          { name: "", x: "5", y: 0 },
          { name: "", x: "6", y: 0 },
          { name: "", x: "7", y: 0 },
          { name: "", x: "8", y: 0 },
          { name: "", x: "9", y: 0 },
          { name: "", x: "10", y: 0 }
        ],
        ndnCacheList: [
          { name: "", x: "1", y: 0 },
          { name: "", x: "2", y: 0 },
          { name: "", x: "3", y: 0 },
          { name: "", x: "4", y: 0 },
          { name: "", x: "5", y: 0 }
        ],
        ndnCacheUtilList: [
          { name: "", x: "1", y: 0 },
          { name: "", x: "2", y: 0 },
          { name: "", x: "3", y: 0 },
          { name: "", x: "4", y: 0 },
          { name: "", x: "5", y: 0 }
        ],
        ndn_cache_enabled: false
      });
    }
    refreshCache() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "ldbm"
      ];
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        let count = this.state.count + 1;
        const ndnCount = this.state.ndnCount + 1;
        if (count > 100) {
          count = 1;
        }
        const dbratio = config.attrs.dbcachehitratio[0];
        const chart_data = this.state.dbCacheList;
        chart_data.shift();
        chart_data.push({ name: _40("Cache Hit Ratio"), x: count.toString(), y: parseInt(dbratio) });
        const ndn_cache_enabled = config.attrs.normalizeddncachehitratio && config.attrs.normalizeddncachehitratio.length > 0;
        let ndn_chart_data = this.state.ndnCacheList;
        let ndn_util_chart_data = this.state.ndnCacheUtilList;
        if (ndn_cache_enabled) {
          const ndnratio = config.attrs.normalizeddncachehitratio[0];
          ndn_chart_data = this.state.ndnCacheList;
          ndn_chart_data.shift();
          ndn_chart_data.push({ name: _40("Cache Hit Ratio"), x: count.toString(), y: parseInt(ndnratio) });
          ndn_util_chart_data = this.state.ndnCacheUtilList;
          const currNDNSize = parseInt(config.attrs.currentnormalizeddncachesize[0]);
          const maxNDNSize = parseInt(config.attrs.maxnormalizeddncachesize[0]);
          const ndn_utilization = currNDNSize / maxNDNSize * 100;
          ndn_util_chart_data.shift();
          ndn_util_chart_data.push({ name: _40("Cache Utilization"), x: ndnCount.toString(), y: parseInt(ndn_utilization) });
        }
        this.setState({
          data: config.attrs,
          loading: false,
          dbCacheList: chart_data,
          ndnCacheList: ndn_chart_data,
          ndnCacheUtilList: ndn_util_chart_data,
          count,
          ndnCount,
          ndn_cache_enabled
        });
      }).fail(() => {
        this.resetChartData();
      });
    }
    startCacheRefresh() {
      this.setState({
        cache_refresh: setInterval(this.refreshCache, 2e3)
      });
    }
    stopCacheRefresh() {
      clearInterval(this.state.cache_refresh);
    }
    render() {
      let chartColor = ChartThemeColor.green;
      let ndnChartColor = ChartThemeColor.green;
      let ndnUtilColor = ChartThemeColor.green;
      let dbcachehit = 0;
      let ndncachehit = 0;
      let ndncachemax = 0;
      let ndncachecurr = 0;
      let utilratio = 0;
      let content = /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
        /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { component: TextVariants.h3, children: _40("Loading database monitor information ...") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
      ] });
      if (!this.state.loading) {
        dbcachehit = parseInt(this.state.data.dbcachehitratio[0]);
        const ndn_cache_enabled = this.state.data.normalizeddncachehitratio && this.state.data.normalizeddncachehitratio.length > 0;
        if (ndn_cache_enabled) {
          ndncachehit = parseInt(this.state.data.normalizeddncachehitratio[0]);
          ndncachemax = parseInt(this.state.data.maxnormalizeddncachesize[0]);
          ndncachecurr = parseInt(this.state.data.currentnormalizeddncachesize[0]);
          utilratio = Math.round(ndncachecurr / ndncachemax * 100);
          if (utilratio === 0) {
            utilratio = 1;
          }
        }
        if (dbcachehit > 89) {
          chartColor = ChartThemeColor.green;
        } else if (dbcachehit > 74) {
          chartColor = ChartThemeColor.orange;
        } else {
          chartColor = ChartThemeColor.purple;
        }
        if (ndn_cache_enabled) {
          if (ndncachehit > 89) {
            ndnChartColor = ChartThemeColor.green;
          } else if (ndncachehit > 74) {
            ndnChartColor = ChartThemeColor.orange;
          } else {
            ndnChartColor = ChartThemeColor.purple;
          }
          if (utilratio > 95) {
            ndnUtilColor = ChartThemeColor.purple;
          } else if (utilratio > 90) {
            ndnUtilColor = ChartThemeColor.orange;
          } else {
            ndnUtilColor = ChartThemeColor.green;
          }
        }
        const tabs = [];
        tabs.push(
          /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TabTitleText, { children: _40("Database Cache") }), children: [
            /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ds-container", children: [
              /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ds-center", children: [
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TextContent, { className: "ds-margin-top-xlg", title: _40("The database cache hit ratio (dbcachehitratio)."), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { component: TextVariants.h3, children: _40("Cache Hit Ratio") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { component: TextVariants.h2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("b", { children: [
                  dbcachehit,
                  "%"
                ] }) }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "ds-margin-left", style: { height: "200px", width: "500px" }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
                Chart,
                {
                  ariaDesc: "Database Cache",
                  ariaTitle: _40("Live Database Cache Statistics"),
                  containerComponent: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
                  height: 200,
                  maxDomain: { y: 100 },
                  minDomain: { y: 0 },
                  padding: {
                    bottom: 30,
                    left: 40,
                    top: 10,
                    right: 10
                  },
                  width: 500,
                  themeColor: chartColor,
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartAxis, {}),
                    /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
                    /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
                      ChartArea,
                      {
                        data: this.state.dbCacheList
                      }
                    ) })
                  ]
                }
              ) })
            ] }) }) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Grid, { hasGutter: true, className: "ds-margin-top-xlg", children: [
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("Database Cache Hit Ratio:") }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("b", { children: [
                this.state.data.dbcachehitratio,
                "%"
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("Database Cache Tries:") }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.dbcachetries) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("Database Cache Hits:") }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.dbcachehits) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("Cache Pages Read:") }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.dbcachepagein) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("Cache Pages Written:") }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.dbcachepageout) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("Read-Only Page Evictions:") }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.dbcacheroevict) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("Read-Write Page Evictions:") }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.dbcacherwevict) }) })
            ] })
          ] }, "db-cache-tab")
        );
        if (ndn_cache_enabled) {
          tabs.push(
            /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TabTitleText, { children: _40("Normalized DN Cache") }), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ds-margin-top-lg", children: [
              /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Grid, { hasGutter: true, children: [
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ds-container", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ds-center", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TextContent, { className: "ds-margin-top-xlg", title: _40("The normalized DN cache hit ratio (normalizeddncachehitratio)."), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { component: TextVariants.h3, children: _40("Cache Hit Ratio") }) }),
                    /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { component: TextVariants.h2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("b", { children: [
                      ndncachehit,
                      "%"
                    ] }) }) })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "ds-margin-left", style: { height: "200px", width: "350px" }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
                    Chart,
                    {
                      ariaDesc: "NDN Cache",
                      ariaTitle: _40("Live Normalized DN Cache Statistics"),
                      containerComponent: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
                      height: 200,
                      maxDomain: { y: 100 },
                      minDomain: { y: 0 },
                      padding: {
                        bottom: 40,
                        left: 60,
                        top: 10,
                        right: 15
                      },
                      width: 350,
                      themeColor: ndnChartColor,
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartAxis, {}),
                        /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
                        /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
                          ChartArea,
                          {
                            data: this.state.ndnCacheList
                          }
                        ) })
                      ]
                    }
                  ) })
                ] }) }) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ds-container", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ds-center", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TextContent, { className: "ds-margin-top-lg", title: _40("The amount of the cache that is being used: max size (maxnormalizeddncachesize) vs current size (currentnormalizeddncachesize)"), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { component: TextVariants.h2, children: _40("Cache Utilization") }) }),
                    /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { component: TextVariants.h3, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("b", { children: [
                      utilratio,
                      "%"
                    ] }) }) }),
                    /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TextContent, { className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { component: TextVariants.h5, children: _40("Cached DN's") }) }),
                    /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.currentnormalizeddncachecount[0]) })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "ds-margin-left", style: { height: "200px", width: "350px" }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
                    Chart,
                    {
                      ariaDesc: "NDN Cache Utilization",
                      ariaTitle: _40("Live Normalized DN Cache Utilization Statistics"),
                      containerComponent: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
                      height: 200,
                      maxDomain: { y: 100 },
                      minDomain: { y: 0 },
                      padding: {
                        bottom: 40,
                        left: 60,
                        top: 10,
                        right: 15
                      },
                      width: 350,
                      themeColor: ndnUtilColor,
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartAxis, {}),
                        /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
                        /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
                          ChartArea,
                          {
                            data: this.state.ndnCacheUtilList
                          }
                        ) })
                      ]
                    }
                  ) })
                ] }) }) }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Grid, { hasGutter: true, className: "ds-margin-top-xlg", children: [
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Cache Hit Ratio:") }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("b", { children: [
                  this.state.data.normalizeddncachehitratio,
                  "%"
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Cache Max Size:") }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: displayBytes(this.state.data.maxnormalizeddncachesize) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Cache Tries:") }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.normalizeddncachetries) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Current Cache Size:") }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: displayBytes(this.state.data.currentnormalizeddncachesize) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Cache Hits:") }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.normalizeddncachehits) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Cache DN Count:") }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.currentnormalizeddncachecount) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Cache Evictions:") }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.normalizeddncacheevictions) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Cache Thread Size:") }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.normalizeddncachethreadsize) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Cache Thread Slots:") }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.normalizeddncachethreadslots) }) })
              ] })
            ] }) }, "ndn-cache-tab")
          );
        }
        content = /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: tabs });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { id: "db-content", children: [
        /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { className: "ds-sub-header", component: TextVariants.h2, children: _40("Database Performance Statistics") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "ds-margin-top-lg", children: content })
      ] });
    }
  };
  DatabaseMonitor.propTypes = {
    data: import_prop_types39.default.object,
    serverId: import_prop_types39.default.string,
    enableTree: import_prop_types39.default.func
  };
  DatabaseMonitor.defaultProps = {
    data: {},
    serverId: ""
  };
  var DatabaseMonitorMDB = class extends import_react110.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: 0,
        data: {},
        loading: true,
        // refresh chart
        cache_refresh: "",
        count: 10,
        ndnCount: 5,
        dbCacheList: [],
        ndnCacheList: [],
        ndnCacheUtilList: [],
        ndn_cache_enabled: false
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.startCacheRefresh = this.startCacheRefresh.bind(this);
      this.refreshCache = this.refreshCache.bind(this);
    }
    componentDidMount() {
      this.resetChartData();
      this.refreshCache();
      this.startCacheRefresh();
      this.props.enableTree();
    }
    componentWillUnmount() {
      this.stopCacheRefresh();
    }
    resetChartData() {
      this.setState({
        data: {
          normalizeddncachehitratio: [0],
          maxnormalizeddncachesize: [0],
          currentnormalizeddncachesize: [0],
          normalizeddncachetries: [0],
          normalizeddncachehits: [0],
          normalizeddncacheevictions: [0],
          currentnormalizeddncachecount: [0],
          normalizeddncachethreadsize: [0],
          normalizeddncachethreadslots: [0]
        },
        ndnCacheList: [
          { name: "", x: "1", y: 0 },
          { name: "", x: "2", y: 0 },
          { name: "", x: "3", y: 0 },
          { name: "", x: "4", y: 0 },
          { name: "", x: "5", y: 0 }
        ],
        ndnCacheUtilList: [
          { name: "", x: "1", y: 0 },
          { name: "", x: "2", y: 0 },
          { name: "", x: "3", y: 0 },
          { name: "", x: "4", y: 0 },
          { name: "", x: "5", y: 0 }
        ],
        ndn_cache_enabled: false
      });
    }
    refreshCache() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "ldbm"
      ];
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        let count = this.state.count + 1;
        const ndnCount = this.state.ndnCount + 1;
        if (count > 100) {
          count = 1;
        }
        const ndn_cache_enabled = config.attrs.normalizeddncachehitratio && config.attrs.normalizeddncachehitratio.length > 0;
        let ndn_chart_data = this.state.ndnCacheList;
        let ndn_util_chart_data = this.state.ndnCacheUtilList;
        if (ndn_cache_enabled) {
          const ndnratio = config.attrs.normalizeddncachehitratio[0];
          ndn_chart_data = this.state.ndnCacheList;
          ndn_chart_data.shift();
          ndn_chart_data.push({ name: _40("Cache Hit Ratio"), x: count.toString(), y: parseInt(ndnratio) });
          ndn_util_chart_data = this.state.ndnCacheUtilList;
          const currNDNSize = parseInt(config.attrs.currentnormalizeddncachesize[0]);
          const maxNDNSize = parseInt(config.attrs.maxnormalizeddncachesize[0]);
          const ndn_utilization = currNDNSize / maxNDNSize * 100;
          ndn_util_chart_data.shift();
          ndn_util_chart_data.push({ name: _40("Cache Utilization"), x: ndnCount.toString(), y: parseInt(ndn_utilization) });
        }
        this.setState({
          data: config.attrs,
          loading: false,
          ndnCacheList: ndn_chart_data,
          ndnCacheUtilList: ndn_util_chart_data,
          count,
          ndnCount,
          ndn_cache_enabled
        });
      }).fail(() => {
        this.resetChartData();
      });
    }
    startCacheRefresh() {
      this.setState({
        cache_refresh: setInterval(this.refreshCache, 2e3)
      });
    }
    stopCacheRefresh() {
      clearInterval(this.state.cache_refresh);
    }
    render() {
      let ndnChartColor = ChartThemeColor.green;
      let ndnUtilColor = ChartThemeColor.green;
      let ndncachehit = 0;
      let ndncachemax = 0;
      let ndncachecurr = 0;
      let utilratio = 0;
      let content = /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
        /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { component: TextVariants.h3, children: _40("Loading database monitor information ...") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
      ] });
      if (!this.state.loading) {
        const ndn_cache_enabled = this.state.data.normalizeddncachehitratio && this.state.data.normalizeddncachehitratio.length > 0;
        if (ndn_cache_enabled) {
          ndncachehit = parseInt(this.state.data.normalizeddncachehitratio[0]);
          ndncachemax = parseInt(this.state.data.maxnormalizeddncachesize[0]);
          ndncachecurr = parseInt(this.state.data.currentnormalizeddncachesize[0]);
          utilratio = Math.round(ndncachecurr / ndncachemax * 100);
          if (utilratio === 0) {
            utilratio = 1;
          }
          if (ndncachehit > 89) {
            ndnChartColor = ChartThemeColor.green;
          } else if (ndncachehit > 74) {
            ndnChartColor = ChartThemeColor.orange;
          } else {
            ndnChartColor = ChartThemeColor.purple;
          }
          if (utilratio > 95) {
            ndnUtilColor = ChartThemeColor.purple;
          } else if (utilratio > 90) {
            ndnUtilColor = ChartThemeColor.orange;
          } else {
            ndnUtilColor = ChartThemeColor.green;
          }
          content = /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TabTitleText, { children: _40("Normalized DN Cache") }), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ds-margin-top-lg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Grid, { hasGutter: true, children: [
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ds-container", children: [
                /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ds-center", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TextContent, { className: "ds-margin-top-xlg", title: _40("The normalized DN cache hit ratio (normalizeddncachehitratio)."), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { component: TextVariants.h3, children: _40("Cache Hit Ratio") }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { component: TextVariants.h2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("b", { children: [
                    ndncachehit,
                    "%"
                  ] }) }) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "ds-margin-left", style: { height: "200px", width: "350px" }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
                  Chart,
                  {
                    ariaDesc: "NDN Cache",
                    ariaTitle: _40("Live Normalized DN Cache Statistics"),
                    containerComponent: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
                    height: 200,
                    maxDomain: { y: 100 },
                    minDomain: { y: 0 },
                    padding: {
                      bottom: 40,
                      left: 60,
                      top: 10,
                      right: 15
                    },
                    width: 350,
                    themeColor: ndnChartColor,
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartAxis, {}),
                      /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
                      /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
                        ChartArea,
                        {
                          data: this.state.ndnCacheList
                        }
                      ) })
                    ]
                  }
                ) })
              ] }) }) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ds-container", children: [
                /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ds-center", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TextContent, { className: "ds-margin-top-lg", title: _40("The amount of the cache that is being used: max size (maxnormalizeddncachesize) vs current size (currentnormalizeddncachesize)"), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { component: TextVariants.h2, children: _40("Cache Utilization") }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { component: TextVariants.h3, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("b", { children: [
                    utilratio,
                    "%"
                  ] }) }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TextContent, { className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { component: TextVariants.h5, children: _40("Cached DN's") }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.currentnormalizeddncachecount[0]) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "ds-margin-left", style: { height: "200px", width: "350px" }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
                  Chart,
                  {
                    ariaDesc: "NDN Cache Utilization",
                    ariaTitle: _40("Live Normalized DN Cache Utilization Statistics"),
                    containerComponent: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
                    height: 200,
                    maxDomain: { y: 100 },
                    minDomain: { y: 0 },
                    padding: {
                      bottom: 40,
                      left: 60,
                      top: 10,
                      right: 15
                    },
                    width: 350,
                    themeColor: ndnUtilColor,
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartAxis, {}),
                      /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
                      /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChartGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
                        ChartArea,
                        {
                          data: this.state.ndnCacheUtilList
                        }
                      ) })
                    ]
                  }
                ) })
              ] }) }) }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Grid, { hasGutter: true, className: "ds-margin-top-xlg", children: [
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Cache Hit Ratio:") }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("b", { children: [
                this.state.data.normalizeddncachehitratio,
                "%"
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Cache Max Size:") }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: displayBytes(this.state.data.maxnormalizeddncachesize) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Cache Tries:") }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.normalizeddncachetries) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Current Cache Size:") }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: displayBytes(this.state.data.currentnormalizeddncachesize) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Cache Hits:") }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.normalizeddncachehits) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Cache DN Count:") }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.currentnormalizeddncachecount) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Cache Evictions:") }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.normalizeddncacheevictions) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Cache Thread Size:") }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.normalizeddncachethreadsize) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 3, children: _40("NDN Cache Thread Slots:") }),
              /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: numToCommas(this.state.data.normalizeddncachethreadslots) }) })
            ] })
          ] }) }) });
        } else {
          content = /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "ds-margin-top-xlg ds-center", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { component: TextVariants.h3, children: _40("Normalized DN Cache is disabled") }) }) });
        }
      }
      return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { id: "db-content", children: [
        /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Text, { className: "ds-sub-header", component: TextVariants.h2, children: _40("Database Performance Statistics") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "ds-margin-top-lg", children: content })
      ] });
    }
  };
  DatabaseMonitorMDB.propTypes = {
    data: import_prop_types39.default.object,
    serverId: import_prop_types39.default.string,
    enableTree: import_prop_types39.default.func
  };
  DatabaseMonitorMDB.defaultProps = {
    data: {},
    serverId: ""
  };

  // src/lib/monitor/suffixMonitor.jsx
  var import_react111 = __toESM(require_react(), 1);
  var import_prop_types40 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
  var _41 = cockpit_default.gettext;
  var SuffixMonitor = class extends import_react111.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: 0,
        data: {},
        loading: true,
        // refresh charts
        cache_refresh: "",
        count: 10,
        utilCount: 5,
        entryCacheList: [],
        entryUtilCacheList: [],
        dnCacheList: [],
        dnCacheUtilList: []
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.startCacheRefresh = this.startCacheRefresh.bind(this);
      this.refreshSuffixCache = this.refreshSuffixCache.bind(this);
    }
    componentDidMount() {
      this.resetChartData();
      this.refreshSuffixCache();
      this.startCacheRefresh();
      this.props.enableTree();
    }
    componentWillUnmount() {
      this.stopCacheRefresh();
    }
    resetChartData() {
      this.setState({
        data: {
          // Entry cache
          entrycachehitratio: [0],
          entrycachetries: [0],
          entrycachehits: [0],
          maxentrycachesize: [0],
          currententrycachesize: [0],
          maxentrycachecount: [0],
          currententrycachecount: [0],
          // DN cache
          dncachehitratio: [0],
          dncachetries: [0],
          dncachehits: [0],
          maxdncachesize: [0],
          currentdncachesize: [0],
          maxdncachecount: [0],
          currentdncachecount: [0]
        },
        entryCacheList: [
          { name: "", x: "1", y: 0 },
          { name: "", x: "2", y: 0 },
          { name: "", x: "3", y: 0 },
          { name: "", x: "4", y: 0 },
          { name: "", x: "5", y: 0 },
          { name: "", x: "6", y: 0 },
          { name: "", x: "7", y: 0 },
          { name: "", x: "8", y: 0 },
          { name: "", x: "9", y: 0 },
          { name: "", x: "10", y: 0 }
        ],
        entryUtilCacheList: [
          { name: "", x: "1", y: 0 },
          { name: "", x: "2", y: 0 },
          { name: "", x: "3", y: 0 },
          { name: "", x: "4", y: 0 },
          { name: "", x: "5", y: 0 }
        ],
        dnCacheList: [
          { name: "", x: "1", y: 0 },
          { name: "", x: "2", y: 0 },
          { name: "", x: "3", y: 0 },
          { name: "", x: "4", y: 0 },
          { name: "", x: "5", y: 0 },
          { name: "", x: "6", y: 0 },
          { name: "", x: "7", y: 0 },
          { name: "", x: "8", y: 0 },
          { name: "", x: "9", y: 0 },
          { name: "", x: "10", y: 0 }
        ],
        dnCacheUtilList: [
          { name: "", x: "1", y: 0 },
          { name: "", x: "2", y: 0 },
          { name: "", x: "3", y: 0 },
          { name: "", x: "4", y: 0 },
          { name: "", x: "5", y: 0 }
        ]
      });
    }
    refreshSuffixCache() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "backend",
        this.props.suffix
      ];
      log_cmd("refreshSuffixCache", "Get suffix monitor", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        let count = this.state.count + 1;
        const utilCount = this.state.utilCount + 1;
        if (count > 100) {
          count = 1;
        }
        const entryRatio = config.attrs.entrycachehitratio[0];
        const entry_data = this.state.entryCacheList;
        entry_data.shift();
        entry_data.push({ name: _41("Cache Hit Ratio"), x: count.toString(), y: parseInt(entryRatio) });
        const entry_util_data = this.state.entryUtilCacheList;
        let maxsize = config.attrs.maxentrycachesize[0];
        let currsize = config.attrs.currententrycachesize[0];
        let utilratio = Math.round(currsize / maxsize * 100);
        if (utilratio === 0) {
          utilratio = 1;
        }
        entry_util_data.shift();
        entry_util_data.push({ name: _41("Cache Utilization"), x: utilCount.toString(), y: parseInt(utilratio) });
        const dnratio = config.attrs.dncachehitratio[0];
        const dn_data = this.state.dnCacheList;
        dn_data.shift();
        dn_data.push({ name: _41("Cache Hit Ratio"), x: count.toString(), y: parseInt(dnratio) });
        const dn_util_data = this.state.dnCacheUtilList;
        currsize = parseInt(config.attrs.currentdncachesize[0]);
        maxsize = parseInt(config.attrs.maxdncachesize[0]);
        utilratio = currsize / maxsize * 100;
        if (utilratio === 0) {
          utilratio = 1;
        }
        dn_util_data.shift();
        dn_util_data.push({ name: _41("Cache Utilization"), x: utilCount.toString(), y: parseInt(utilratio) });
        this.setState({
          data: config.attrs,
          loading: false,
          entryCacheList: entry_data,
          entryUtilCacheList: entry_util_data,
          dnCacheList: dn_data,
          dnCacheUtilList: dn_util_data,
          count,
          utilCount
        });
      }).fail(() => {
        this.resetChartData();
      });
    }
    startCacheRefresh() {
      this.setState({
        cache_refresh: setInterval(this.refreshSuffixCache, 2e3)
      });
    }
    stopCacheRefresh() {
      clearInterval(this.state.cache_refresh);
    }
    render() {
      let entryChartColor = ChartThemeColor.green;
      let entryUtilChartColor = ChartThemeColor.green;
      let dnChartColor = ChartThemeColor.green;
      let dnUtilChartColor = ChartThemeColor.green;
      let cachehit = 1;
      let cachemax = 0;
      let cachecurr = 0;
      let cachecount = 0;
      let utilratio = 1;
      let dncachehit = 0;
      let dncachemax = 0;
      let dncachecurr = 0;
      let dncachecount = 0;
      let dnutilratio = 1;
      let SuffixIcon = TreeIcon;
      if (this.props.dbtype === "subsuffix") {
        SuffixIcon = LeafIcon;
      }
      let content = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
        /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { component: TextVariants.h3, children: _41("Loading Suffix Monitor Information ...") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
      ] });
      if (!this.state.loading) {
        cachehit = parseInt(this.state.data.entrycachehitratio[0]);
        cachemax = parseInt(this.state.data.maxentrycachesize[0]);
        cachecurr = parseInt(this.state.data.currententrycachesize[0]);
        cachecount = parseInt(this.state.data.currententrycachecount[0]);
        utilratio = Math.round(cachecurr / cachemax * 100);
        dncachehit = parseInt(this.state.data.dncachehitratio[0]);
        dncachemax = parseInt(this.state.data.maxdncachesize[0]);
        dncachecurr = parseInt(this.state.data.currentdncachesize[0]);
        dncachecount = parseInt(this.state.data.currentdncachecount[0]);
        dnutilratio = Math.round(dncachecurr / dncachemax * 100);
        if (utilratio === 0) {
          utilratio = 1;
        }
        if (dnutilratio === 0) {
          dnutilratio = 1;
        }
        if (cachehit > 89) {
          entryChartColor = ChartThemeColor.green;
        } else if (cachehit > 74) {
          entryChartColor = ChartThemeColor.orange;
        } else {
          entryChartColor = ChartThemeColor.purple;
        }
        if (utilratio > 95) {
          entryUtilChartColor = ChartThemeColor.purple;
        } else if (utilratio > 90) {
          entryUtilChartColor = ChartThemeColor.orange;
        } else {
          entryUtilChartColor = ChartThemeColor.green;
        }
        if (dncachehit > 89) {
          dnChartColor = ChartThemeColor.green;
        } else if (dncachehit > 74) {
          dnChartColor = ChartThemeColor.orange;
        } else {
          dnChartColor = ChartThemeColor.purple;
        }
        if (dnutilratio > 95) {
          dnUtilChartColor = ChartThemeColor.purple;
        } else if (dnutilratio > 90) {
          dnUtilChartColor = ChartThemeColor.orange;
        } else {
          dnUtilChartColor = ChartThemeColor.green;
        }
        content = /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { id: "monitor-suffix-page", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
          /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TabTitleText, { children: _41("Entry Cache") }), children: [
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Grid, { hasGutter: true, children: [
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ds-container", children: [
                /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ds-center", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { title: _41("The entry cache hit ratio (entrycachehitratio)"), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { className: "ds-margin-top", component: TextVariants.h3, children: _41("Cache Hit Ratio") }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { className: "ds-margin-top", component: TextVariants.h2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("b", { children: [
                    cachehit,
                    "%"
                  ] }) }) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "ds-margin-left", style: { height: "200px", width: "350px" }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
                  Chart,
                  {
                    ariaDesc: "Entry Cache",
                    ariaTitle: _41("Live Entry Cache Statistics"),
                    containerComponent: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
                    height: 200,
                    maxDomain: { y: 100 },
                    minDomain: { y: 0 },
                    padding: {
                      bottom: 40,
                      left: 60,
                      top: 10,
                      right: 15
                    },
                    width: 350,
                    themeColor: entryChartColor,
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartAxis, {}),
                      /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
                      /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
                        ChartArea,
                        {
                          data: this.state.entryCacheList
                        }
                      ) })
                    ]
                  }
                ) })
              ] }) }) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ds-container", children: [
                /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ds-center", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { title: _41("The amount of the cache that is being used: max size (maxentrycachesize) vs current size (currententrycachesize)"), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { className: "ds-margin-top", component: TextVariants.h3, children: _41("Cache Utilization") }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { component: TextVariants.h2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("b", { children: [
                    utilratio,
                    "%"
                  ] }) }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { className: "ds-margin-top-lg", component: TextVariants.h5, children: _41("Cached Entries") }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: cachecount })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "ds-margin-left", style: { height: "200px", width: "350px" }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
                  Chart,
                  {
                    ariaDesc: "Entry Cache Utilization",
                    ariaTitle: _41("Live Entry Cache Utilization Statistics"),
                    containerComponent: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
                    height: 200,
                    maxDomain: { y: 100 },
                    minDomain: { y: 0 },
                    padding: {
                      bottom: 40,
                      left: 60,
                      top: 10,
                      right: 15
                    },
                    width: 350,
                    themeColor: entryUtilChartColor,
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartAxis, {}),
                      /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
                      /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
                        ChartArea,
                        {
                          data: this.state.entryUtilCacheList
                        }
                      ) })
                    ]
                  }
                ) })
              ] }) }) }) })
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Grid, { hasGutter: true, className: "ds-margin-top-xlg", children: [
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("Entry Cache Hit Ratio:") }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("b", { children: [
                this.state.data.entrycachehitratio[0],
                "%"
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("Entry Cache Max Size:") }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("b", { children: [
                displayBytes(cachemax),
                " "
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("Entry Cache Hits:") }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: numToCommas(this.state.data.entrycachehits[0]) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("Entry Cache Current Size:") }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: displayBytes(cachecurr) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("Entry Cache Tries:") }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: numToCommas(this.state.data.entrycachetries[0]) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("Entry Cache Max Entries:") }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: numToCommas(this.state.data.maxentrycachecount[0]) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("Entry Cache Count:") }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: numToCommas(this.state.data.currententrycachecount[0]) }) })
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TabTitleText, { children: _41("DN Cache") }), children: [
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Grid, { hasGutter: true, children: [
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ds-container", children: [
                /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ds-center", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { title: _41("The DN cache hit ratio (dncachehitratio)"), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { className: "ds-margin-top", component: TextVariants.h3, children: _41("Cache Hit Ratio") }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { className: "ds-margin-top", component: TextVariants.h2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("b", { children: [
                    dncachehit,
                    "%"
                  ] }) }) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "ds-margin-left", style: { height: "200px", width: "350px" }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
                  Chart,
                  {
                    ariaDesc: "DN Cache",
                    ariaTitle: _41("Live DN Cache Statistics"),
                    containerComponent: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
                    height: 200,
                    maxDomain: { y: 100 },
                    minDomain: { y: 0 },
                    padding: {
                      bottom: 40,
                      left: 60,
                      top: 10,
                      right: 15
                    },
                    width: 350,
                    themeColor: dnChartColor,
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartAxis, {}),
                      /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
                      /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
                        ChartArea,
                        {
                          data: this.state.dnCacheList
                        }
                      ) })
                    ]
                  }
                ) })
              ] }) }) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ds-container", children: [
                /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ds-center", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { title: _41("The amount of the cache that is being used: max size (maxdncachesize) vs current size (currentdncachesize)"), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { className: "ds-margin-top", component: TextVariants.h3, children: _41("Cache Utilization") }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { component: TextVariants.h2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("b", { children: [
                    dnutilratio,
                    "%"
                  ] }) }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { className: "ds-margin-top-lg", component: TextVariants.h5, children: _41("Cached DN's") }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: numToCommas(dncachecount) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "ds-margin-left", style: { height: "200px", width: "350px" }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
                  Chart,
                  {
                    ariaDesc: "DN Cache Utilization",
                    ariaTitle: _41("Live DN Cache Utilization Statistics"),
                    containerComponent: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
                    height: 200,
                    maxDomain: { y: 100 },
                    minDomain: { y: 0 },
                    padding: {
                      bottom: 40,
                      left: 60,
                      top: 10,
                      right: 15
                    },
                    width: 350,
                    themeColor: dnUtilChartColor,
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartAxis, {}),
                      /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
                      /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
                        ChartArea,
                        {
                          data: this.state.dnCacheUtilList
                        }
                      ) })
                    ]
                  }
                ) })
              ] }) }) }) })
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Grid, { hasGutter: true, className: "ds-margin-top-xlg", children: [
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("DN Cache Hit Ratio:") }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("b", { children: [
                this.state.data.dncachehitratio[0],
                "%"
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("DN Cache Max Size:") }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: displayBytes(dncachemax) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("DN Cache Hits:") }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: numToCommas(this.state.data.dncachehits[0]) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("DN Cache Current Size:") }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: displayBytes(dncachecurr) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("DN Cache Tries:") }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: numToCommas(this.state.data.dncachetries[0]) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("DN Cache Max Count:") }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: numToCommas(this.state.data.maxdncachecount[0]) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("DN Cache Current Count:") }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: numToCommas(this.state.data.currentdncachecount[0]) }) })
            ] })
          ] })
        ] }) });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Text, { component: TextVariants.h2, children: [
          /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SuffixIcon, {}),
          " ",
          this.props.suffix,
          " (",
          /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: this.props.bename }),
          ")"
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "ds-margin-top-lg", children: content })
      ] });
    }
  };
  SuffixMonitor.propTypes = {
    serverId: import_prop_types40.default.string,
    suffix: import_prop_types40.default.string,
    bename: import_prop_types40.default.string,
    enableTree: import_prop_types40.default.func
  };
  SuffixMonitor.defaultProps = {
    serverId: "",
    suffix: "",
    bename: ""
  };
  var SuffixMonitorMDB = class extends import_react111.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: 0,
        data: {},
        loading: true,
        // refresh charts
        cache_refresh: "",
        count: 10,
        utilCount: 5,
        entryCacheList: [],
        entryUtilCacheList: []
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.startCacheRefresh = this.startCacheRefresh.bind(this);
      this.refreshSuffixCache = this.refreshSuffixCache.bind(this);
    }
    componentDidMount() {
      this.resetChartData();
      this.refreshSuffixCache();
      this.startCacheRefresh();
      this.props.enableTree();
    }
    componentWillUnmount() {
      this.stopCacheRefresh();
    }
    resetChartData() {
      this.setState({
        data: {
          // Entry cache
          entrycachehitratio: [0],
          entrycachetries: [0],
          entrycachehits: [0],
          maxentrycachesize: [0],
          currententrycachesize: [0],
          maxentrycachecount: [0],
          currententrycachecount: [0]
        },
        entryCacheList: [
          { name: "", x: "1", y: 0 },
          { name: "", x: "2", y: 0 },
          { name: "", x: "3", y: 0 },
          { name: "", x: "4", y: 0 },
          { name: "", x: "5", y: 0 },
          { name: "", x: "6", y: 0 },
          { name: "", x: "7", y: 0 },
          { name: "", x: "8", y: 0 },
          { name: "", x: "9", y: 0 },
          { name: "", x: "10", y: 0 }
        ]
      });
    }
    refreshSuffixCache() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "backend",
        this.props.suffix
      ];
      log_cmd("refreshSuffixCache", "Get suffix monitor", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        let count = this.state.count + 1;
        const utilCount = this.state.utilCount + 1;
        if (count > 100) {
          count = 1;
        }
        const entryRatio = config.attrs.entrycachehitratio[0];
        const entry_data = this.state.entryCacheList;
        entry_data.shift();
        entry_data.push({ name: _41("Cache Hit Ratio"), x: count.toString(), y: parseInt(entryRatio) });
        const entry_util_data = this.state.entryUtilCacheList;
        let maxsize = config.attrs.maxentrycachesize[0];
        let currsize = config.attrs.currententrycachesize[0];
        let utilratio = Math.round(currsize / maxsize * 100);
        if (utilratio === 0) {
          utilratio = 1;
        }
        entry_util_data.shift();
        entry_util_data.push({ name: _41("Cache Utilization"), x: utilCount.toString(), y: parseInt(utilratio) });
        this.setState({
          data: config.attrs,
          loading: false,
          entryCacheList: entry_data,
          entryUtilCacheList: entry_util_data,
          count,
          utilCount
        });
      }).fail(() => {
        this.resetChartData();
      });
    }
    startCacheRefresh() {
      this.setState({
        cache_refresh: setInterval(this.refreshSuffixCache, 2e3)
      });
    }
    stopCacheRefresh() {
      clearInterval(this.state.cache_refresh);
    }
    render() {
      let entryChartColor = ChartThemeColor.green;
      let entryUtilChartColor = ChartThemeColor.green;
      let cachehit = 1;
      let cachemax = 0;
      let cachecurr = 0;
      let cachecount = 0;
      let utilratio = 1;
      let SuffixIcon = TreeIcon;
      if (this.props.dbtype === "subsuffix") {
        SuffixIcon = LeafIcon;
      }
      let content = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
        /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { component: TextVariants.h3, children: _41("Loading Suffix Monitor Information ...") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
      ] });
      if (!this.state.loading) {
        cachehit = parseInt(this.state.data.entrycachehitratio[0]);
        cachemax = parseInt(this.state.data.maxentrycachesize[0]);
        cachecurr = parseInt(this.state.data.currententrycachesize[0]);
        cachecount = parseInt(this.state.data.currententrycachecount[0]);
        utilratio = Math.round(cachecurr / cachemax * 100);
        if (utilratio === 0) {
          utilratio = 1;
        }
        if (cachehit > 89) {
          entryChartColor = ChartThemeColor.green;
        } else if (cachehit > 74) {
          entryChartColor = ChartThemeColor.orange;
        } else {
          entryChartColor = ChartThemeColor.purple;
        }
        if (utilratio > 95) {
          entryUtilChartColor = ChartThemeColor.purple;
        } else if (utilratio > 90) {
          entryUtilChartColor = ChartThemeColor.orange;
        } else {
          entryUtilChartColor = ChartThemeColor.green;
        }
        content = /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { id: "monitor-suffix-page", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TabTitleText, { children: _41("Entry Cache") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Grid, { hasGutter: true, children: [
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ds-container", children: [
              /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ds-center", children: [
                /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { title: _41("The entry cache hit ratio (entrycachehitratio)"), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { className: "ds-margin-top", component: TextVariants.h3, children: _41("Cache Hit Ratio") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { className: "ds-margin-top", component: TextVariants.h2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("b", { children: [
                  cachehit,
                  "%"
                ] }) }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "ds-margin-left", style: { height: "200px", width: "350px" }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
                Chart,
                {
                  ariaDesc: "Entry Cache",
                  ariaTitle: _41("Live Entry Cache Statistics"),
                  containerComponent: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
                  height: 200,
                  maxDomain: { y: 100 },
                  minDomain: { y: 0 },
                  padding: {
                    bottom: 40,
                    left: 60,
                    top: 10,
                    right: 15
                  },
                  width: 350,
                  themeColor: entryChartColor,
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartAxis, {}),
                    /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
                    /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
                      ChartArea,
                      {
                        data: this.state.entryCacheList
                      }
                    ) })
                  ]
                }
              ) })
            ] }) }) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ds-container", children: [
              /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ds-center", children: [
                /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { title: _41("The amount of the cache that is being used: max size (maxentrycachesize) vs current size (currententrycachesize)"), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { className: "ds-margin-top", component: TextVariants.h3, children: _41("Cache Utilization") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { component: TextVariants.h2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("b", { children: [
                  utilratio,
                  "%"
                ] }) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text, { className: "ds-margin-top-lg", component: TextVariants.h5, children: _41("Cached Entries") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: cachecount })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "ds-margin-left", style: { height: "200px", width: "350px" }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
                Chart,
                {
                  ariaDesc: "Entry Cache Utilization",
                  ariaTitle: _41("Live Entry Cache Utilization Statistics"),
                  containerComponent: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartVoronoiContainer, { labels: ({ datum }) => `${datum.name}: ${datum.y}`, constrainToVisibleArea: true }),
                  height: 200,
                  maxDomain: { y: 100 },
                  minDomain: { y: 0 },
                  padding: {
                    bottom: 40,
                    left: 60,
                    top: 10,
                    right: 15
                  },
                  width: 350,
                  themeColor: entryUtilChartColor,
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartAxis, {}),
                    /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartAxis, { dependentAxis: true, showGrid: true, tickValues: [25, 50, 75, 100] }),
                    /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChartGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
                      ChartArea,
                      {
                        data: this.state.entryUtilCacheList
                      }
                    ) })
                  ]
                }
              ) })
            ] }) }) }) })
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Grid, { hasGutter: true, className: "ds-margin-top-xlg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("Entry Cache Hit Ratio:") }),
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("b", { children: [
              this.state.data.entrycachehitratio[0],
              "%"
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("Entry Cache Max Size:") }),
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("b", { children: [
              displayBytes(cachemax),
              " "
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("Entry Cache Hits:") }),
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: numToCommas(this.state.data.entrycachehits[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("Entry Cache Current Size:") }),
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: displayBytes(cachecurr) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("Entry Cache Tries:") }),
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: numToCommas(this.state.data.entrycachetries[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("Entry Cache Max Entries:") }),
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: numToCommas(this.state.data.maxentrycachecount[0]) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 3, children: _41("Entry Cache Count:") }),
            /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: numToCommas(this.state.data.currententrycachecount[0]) }) })
          ] })
        ] }) }) });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Text, { component: TextVariants.h2, children: [
          /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SuffixIcon, {}),
          " ",
          this.props.suffix,
          " (",
          /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: this.props.bename }),
          ")"
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "ds-margin-top-lg", children: content })
      ] });
    }
  };
  SuffixMonitorMDB.propTypes = {
    serverId: import_prop_types40.default.string,
    suffix: import_prop_types40.default.string,
    bename: import_prop_types40.default.string,
    enableTree: import_prop_types40.default.func
  };
  SuffixMonitorMDB.defaultProps = {
    serverId: "",
    suffix: "",
    bename: ""
  };

  // src/lib/monitor/chainingMonitor.jsx
  var import_react112 = __toESM(require_react(), 1);
  var import_prop_types41 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1);
  var _42 = cockpit_default.gettext;
  var ChainingMonitor = class extends import_react112.default.Component {
    componentDidMount() {
      this.props.enableTree();
    }
    render() {
      return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { id: "monitor-server-page", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Form, { isHorizontal: true, children: [
        /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Text, { component: TextVariants.h2, children: [
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(LinkIcon, {}),
          "\xA0\xA0",
          this.props.suffix,
          " (",
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("i", { children: this.props.bename }),
          ")",
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _42("Refresh chaining monitor"),
              onClick: () => this.props.reload(this.props.suffix),
              children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: _42("Add Operations") }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("b", { children: this.props.data.nsaddcount }) }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: _42("Delete Operations") }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("b", { children: this.props.data.nsdeletecount }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: _42("Modify Operations") }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("b", { children: this.props.data.nsmodifycount }) }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: _42("ModRDN Operations") }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("b", { children: this.props.data.nsrenamecount }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: _42("Base Searches") }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("b", { children: this.props.data.nssearchbasecount }) }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: _42("One-Level Searches") }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("b", { children: this.props.data.nssearchonelevelcount }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: _42("Subtree Searches") }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("b", { children: this.props.data.nssearchsubtreecount }) }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: _42("Abandon Operations") }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("b", { children: this.props.data.nsabandoncount }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: _42("Bind Operations") }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("b", { children: this.props.data.nsbindcount }) }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: _42("Unbind Operations") }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("b", { children: this.props.data.nsunbindcount }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: _42("Compare Operations") }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("b", { children: this.props.data.nscomparecount }) }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: _42("Outgoing Connections") }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("b", { children: this.props.data.nsopenopconnectioncount }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: _42("Outgoing Bind Connections") }),
          /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("b", { children: this.props.data.nsopenbindconnectioncount }) })
        ] })
      ] }) });
    }
  };
  ChainingMonitor.propTypes = {
    suffix: import_prop_types41.default.string,
    bename: import_prop_types41.default.string,
    data: import_prop_types41.default.object,
    enableTree: import_prop_types41.default.func
  };
  ChainingMonitor.defaultProps = {
    suffix: "",
    bename: "",
    data: {}
  };
  var chainingMonitor_default = ChainingMonitor;

  // src/lib/monitor/accesslog.jsx
  var import_react113 = __toESM(require_react(), 1);
  var import_prop_types42 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
  var _43 = cockpit_default.gettext;
  var AccessLogMonitor = class extends import_react113.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        accesslogData: "",
        accessReloading: false,
        accesslog_cont_refresh: "",
        accessRefreshing: false,
        accessLines: "50",
        isTextWrapped: false
      };
      this.handleRefreshAccessLog = this.handleRefreshAccessLog.bind(this);
      this.handleAccessChange = this.handleAccessChange.bind(this);
      this.accessRefreshCont = this.accessRefreshCont.bind(this);
      this.handleTextWrappedChange = this.handleTextWrappedChange.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
      this.handleRefreshAccessLog();
    }
    componentWillUnmount() {
      clearInterval(this.state.accesslog_cont_refresh);
    }
    accessRefreshCont(e) {
      if (e.target.checked) {
        this.setState({
          accesslog_cont_refresh: setInterval(this.handleRefreshAccessLog, 2e3),
          accessRefreshing: e.target.checked
        });
      } else {
        clearInterval(this.state.accesslog_cont_refresh);
        this.setState({
          accessRefreshing: e.target.checked
        });
      }
    }
    handleAccessChange(e) {
      const value = e.target.value;
      this.setState(() => ({
        accessLines: value
      }), this.handleRefreshAccessLog);
    }
    handleTextWrappedChange(_event, checked) {
      this.setState({
        isTextWrapped: checked
      });
    }
    handleRefreshAccessLog() {
      this.setState({
        accessReloading: true
      });
      let cmd;
      if (this.state.accessLines === "no-limit") {
        cmd = ["cat", this.props.logLocation];
      } else {
        cmd = ["tail", "-" + this.state.accessLines, this.props.logLocation];
      }
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.setState(() => ({
          accesslogData: content,
          accessReloading: false
        }));
      }).fail((err_msg) => {
        cockpit_default.error(err_msg);
        this.setState({
          accessReloading: false
        });
      });
    }
    render() {
      let spinner = null;
      if (this.state.accessReloading) {
        spinner = /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(ToolbarItem, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Spinner, { size: "sm" }),
          _43("Reloading access log...")
        ] });
      }
      const logViewerToolbar = /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Toolbar, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(ToolbarContent, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ToolbarItem, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(LogViewerSearch, { placeholder: _43("Search") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ToolbarItem, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
          FormSelect,
          {
            id: "accessLines",
            value: this.state.accessLines,
            onChange: (event) => {
              this.handleAccessChange(event);
            },
            "aria-label": _43("Lines to display"),
            style: { minWidth: "150px", width: "auto" },
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormSelectOption, { value: "50", label: "50" }, "50"),
              /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormSelectOption, { value: "100", label: "100" }, "100"),
              /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormSelectOption, { value: "200", label: "200" }, "200"),
              /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormSelectOption, { value: "300", label: "300" }, "300"),
              /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormSelectOption, { value: "400", label: "400" }, "400"),
              /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormSelectOption, { value: "500", label: "500" }, "500"),
              /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormSelectOption, { value: "1000", label: "1000" }, "1000"),
              /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormSelectOption, { value: "2000", label: "2000" }, "2000"),
              /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormSelectOption, { value: "5000", label: "5000" }, "5000"),
              /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormSelectOption, { value: "10000", label: "10000" }, "10000"),
              /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormSelectOption, { value: "50000", label: "50000" }, "50000"),
              /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormSelectOption, { value: "no-limit", label: _43("No Limit") }, "no-limit")
            ]
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ToolbarItem, { alignSelf: "center", className: "ds-float-right", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
          Checkbox,
          {
            id: "accessRefreshing",
            isChecked: this.state.accessRefreshing,
            onChange: (e) => {
              this.accessRefreshCont(e);
            },
            label: _43("Continuously Refresh")
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ToolbarItem, { alignSelf: "center", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
          Checkbox,
          {
            id: "wrapText",
            isChecked: this.state.isTextWrapped,
            onChange: this.handleTextWrappedChange,
            label: _43("Wrap text"),
            "aria-label": "wrap text checkbox"
          }
        ) }),
        spinner
      ] }) });
      return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { id: "monitor-log-access-page", children: [
        /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Text, { component: TextVariants.h3, children: [
          _43("Access Log"),
          /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _43("Refresh access log"),
              onClick: this.handleRefreshAccessLog,
              children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
          LogViewer,
          {
            data: this.state.accesslogData,
            isTextWrapped: this.state.isTextWrapped,
            toolbar: logViewerToolbar,
            scrollToRow: this.state.accesslogData.split("\n").length,
            height: "600px"
          }
        ) })
      ] });
    }
  };
  AccessLogMonitor.propTypes = {
    logLocation: import_prop_types42.default.string,
    enableTree: import_prop_types42.default.func
  };
  AccessLogMonitor.defaultProps = {
    logLocation: ""
  };
  var accesslog_default = AccessLogMonitor;

  // src/lib/monitor/auditlog.jsx
  var import_react114 = __toESM(require_react(), 1);
  var import_prop_types43 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
  var _44 = cockpit_default.gettext;
  var AuditLogMonitor = class extends import_react114.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        auditlogData: "",
        auditReloading: false,
        auditlog_cont_refresh: "",
        auditRefreshing: false,
        auditLines: "50",
        isTextWrapped: false
      };
      this.handleRefreshAuditLog = this.handleRefreshAuditLog.bind(this);
      this.handleAuditChange = this.handleAuditChange.bind(this);
      this.auditRefreshCont = this.auditRefreshCont.bind(this);
      this.handleTextWrappedChange = this.handleTextWrappedChange.bind(this);
    }
    componentWillUnmount() {
      clearInterval(this.state.auditlog_cont_refresh);
    }
    componentDidMount() {
      this.props.enableTree();
      this.handleRefreshAuditLog();
    }
    handleRefreshAuditLog() {
      this.setState({
        auditReloading: true
      });
      let cmd;
      if (this.state.auditLines === "no-limit") {
        cmd = ["cat", this.props.logLocation];
      } else {
        cmd = ["tail", "-" + this.state.auditLines, this.props.logLocation];
      }
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.setState(() => ({
          auditlogData: content,
          auditReloading: false
        }));
      }).fail((err_msg) => {
        cockpit_default.error(err_msg);
        this.setState({ auditReloading: false });
      });
    }
    auditRefreshCont(e) {
      if (e.target.checked) {
        this.setState({
          auditlog_cont_refresh: setInterval(this.handleRefreshAuditLog, 2e3),
          auditRefreshing: e.target.checked
        });
      } else {
        clearInterval(this.state.auditlog_cont_refresh);
        this.setState({
          auditRefreshing: e.target.checked
        });
      }
    }
    handleAuditChange(e) {
      const value = e.target.value;
      this.setState(() => ({
        auditLines: value
      }), this.handleRefreshAuditLog);
    }
    handleTextWrappedChange(_event, checked) {
      this.setState({
        isTextWrapped: checked
      });
    }
    render() {
      let spinner = null;
      if (this.state.auditReloading) {
        spinner = /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(ToolbarItem, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Spinner, { size: "sm" }),
          _44("Reloading audit log...")
        ] });
      }
      const logViewerToolbar = /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Toolbar, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(ToolbarContent, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ToolbarItem, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(LogViewerSearch, { placeholder: _44("Search") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ToolbarItem, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
          FormSelect,
          {
            id: "auditLines",
            value: this.state.auditLines,
            onChange: (event) => {
              this.handleAuditChange(event);
            },
            "aria-label": _44("Lines to display"),
            style: { minWidth: "150px", width: "auto" },
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormSelectOption, { value: "50", label: "50" }, "50"),
              /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormSelectOption, { value: "100", label: "100" }, "100"),
              /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormSelectOption, { value: "200", label: "200" }, "200"),
              /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormSelectOption, { value: "300", label: "300" }, "300"),
              /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormSelectOption, { value: "400", label: "400" }, "400"),
              /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormSelectOption, { value: "500", label: "500" }, "500"),
              /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormSelectOption, { value: "1000", label: "1000" }, "1000"),
              /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormSelectOption, { value: "2000", label: "2000" }, "2000"),
              /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormSelectOption, { value: "5000", label: "5000" }, "5000"),
              /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormSelectOption, { value: "10000", label: "10000" }, "10000"),
              /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormSelectOption, { value: "50000", label: "50000" }, "50000"),
              /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormSelectOption, { value: "no-limit", label: _44("No Limit") }, "no-limit")
            ]
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ToolbarItem, { alignSelf: "center", className: "ds-float-right", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
          Checkbox,
          {
            id: "auditRefreshing",
            isChecked: this.state.auditRefreshing,
            onChange: (e) => {
              this.auditRefreshCont(e);
            },
            label: _44("Continuously Refresh")
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ToolbarItem, { alignSelf: "center", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
          Checkbox,
          {
            id: "wrapText",
            isChecked: this.state.isTextWrapped,
            onChange: this.handleTextWrappedChange,
            label: _44("Wrap text"),
            "aria-label": "wrap text checkbox"
          }
        ) }),
        spinner
      ] }) });
      return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { id: "monitor-log-audit-page", children: [
        /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Text, { component: TextVariants.h3, children: [
          _44("Audit Log"),
          /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _44("Refresh audit log"),
              onClick: this.handleRefreshAuditLog,
              children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
          LogViewer,
          {
            data: this.state.auditlogData,
            isTextWrapped: this.state.isTextWrapped,
            toolbar: logViewerToolbar,
            scrollToRow: this.state.auditlogData.split("\n").length,
            height: "600px"
          }
        ) })
      ] });
    }
  };
  AuditLogMonitor.propTypes = {
    logLocation: import_prop_types43.default.string,
    enableTree: import_prop_types43.default.func
  };
  AuditLogMonitor.defaultProps = {
    logLocation: ""
  };
  var auditlog_default = AuditLogMonitor;

  // src/lib/monitor/auditfaillog.jsx
  var import_react115 = __toESM(require_react(), 1);
  var import_prop_types44 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1);
  var _45 = cockpit_default.gettext;
  var AuditFailLogMonitor = class extends import_react115.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        auditfaillogData: "",
        auditfailReloading: false,
        auditfaillog_cont_refresh: "",
        auditfailRefreshing: false,
        auditfailLines: "50",
        isTextWrapped: false
      };
      this.handleRefreshAuditFailLog = this.handleRefreshAuditFailLog.bind(this);
      this.handleAuditFailChange = this.handleAuditFailChange.bind(this);
      this.auditFailRefreshCont = this.auditFailRefreshCont.bind(this);
      this.handleTextWrappedChange = this.handleTextWrappedChange.bind(this);
    }
    componentWillUnmount() {
      clearInterval(this.state.auditfaillog_cont_refresh);
    }
    componentDidMount() {
      this.props.enableTree();
      this.handleRefreshAuditFailLog();
    }
    handleRefreshAuditFailLog() {
      this.setState({
        auditfailReloading: true
      });
      let cmd;
      if (this.state.auditfailLines === "no-limit") {
        cmd = ["cat", this.props.logLocation];
      } else {
        cmd = ["tail", "-" + this.state.auditfailLines, this.props.logLocation];
      }
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.setState(() => ({
          auditfaillogData: content,
          auditfailReloading: false
        }));
      }).fail((err_msg) => {
        cockpit_default.error(err_msg);
        this.setState({ auditfailReloading: false });
      });
    }
    auditFailRefreshCont(e) {
      if (e.target.checked) {
        this.setState({
          auditfaillog_cont_refresh: setInterval(this.handleRefreshAuditFailLog, 2e3),
          auditfailRefreshing: e.target.checked
        });
      } else {
        clearInterval(this.state.auditfaillog_cont_refresh);
        this.setState({
          auditfailRefreshing: e.target.checked
        });
      }
    }
    handleAuditFailChange(e) {
      const value = e.target.value;
      this.setState(() => ({
        auditfailLines: value
      }), this.handleRefreshAuditFailLog);
    }
    handleTextWrappedChange(_event, checked) {
      this.setState({
        isTextWrapped: checked
      });
    }
    render() {
      let spinner = null;
      if (this.state.auditfailReloading) {
        spinner = /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(ToolbarItem, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Spinner, { size: "sm" }),
          _45("Reloading audit failure log...")
        ] });
      }
      const logViewerToolbar = /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Toolbar, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(ToolbarContent, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ToolbarItem, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(LogViewerSearch, { placeholder: _45("Search") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ToolbarItem, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
          FormSelect,
          {
            id: "auditfailLines",
            value: this.state.auditfailLines,
            onChange: (event) => {
              this.handleAuditFailChange(event);
            },
            "aria-label": _45("Lines to display"),
            style: { minWidth: "150px", width: "auto" },
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FormSelectOption, { value: "50", label: "50" }, "50"),
              /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FormSelectOption, { value: "100", label: "100" }, "100"),
              /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FormSelectOption, { value: "200", label: "200" }, "200"),
              /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FormSelectOption, { value: "300", label: "300" }, "300"),
              /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FormSelectOption, { value: "400", label: "400" }, "400"),
              /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FormSelectOption, { value: "500", label: "500" }, "500"),
              /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FormSelectOption, { value: "1000", label: "1000" }, "1000"),
              /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FormSelectOption, { value: "2000", label: "2000" }, "2000"),
              /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FormSelectOption, { value: "5000", label: "5000" }, "5000"),
              /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FormSelectOption, { value: "10000", label: "10000" }, "10000"),
              /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FormSelectOption, { value: "50000", label: "50000" }, "50000"),
              /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FormSelectOption, { value: "no-limit", label: _45("No Limit") }, "no-limit")
            ]
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ToolbarItem, { alignSelf: "center", className: "ds-float-right", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
          Checkbox,
          {
            id: "auditfailRefreshing",
            isChecked: this.state.auditfailRefreshing,
            onChange: (e) => {
              this.auditFailRefreshCont(e);
            },
            label: _45("Continuously Refresh")
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ToolbarItem, { alignSelf: "center", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
          Checkbox,
          {
            id: "wrapText",
            isChecked: this.state.isTextWrapped,
            onChange: this.handleTextWrappedChange,
            label: _45("Wrap text"),
            "aria-label": "wrap text checkbox"
          }
        ) }),
        spinner
      ] }) });
      return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { id: "monitor-log-auditfail-page", children: [
        /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Text, { component: TextVariants.h3, children: [
          _45("Audit Failure Log"),
          /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _45("Refresh audit failure log"),
              onClick: this.handleRefreshAuditFailLog,
              children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
          LogViewer,
          {
            data: this.state.auditfaillogData,
            isTextWrapped: this.state.isTextWrapped,
            toolbar: logViewerToolbar,
            scrollToRow: this.state.auditfaillogData.split("\n").length,
            height: "600px"
          }
        ) })
      ] });
    }
  };
  AuditFailLogMonitor.propTypes = {
    logLocation: import_prop_types44.default.string,
    enableTree: import_prop_types44.default.func
  };
  AuditFailLogMonitor.defaultProps = {
    logLocation: ""
  };
  var auditfaillog_default = AuditFailLogMonitor;

  // src/lib/monitor/errorlog.jsx
  var import_react116 = __toESM(require_react(), 1);
  var import_prop_types45 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1);
  var _46 = cockpit_default.gettext;
  var ErrorLogMonitor = class extends import_react116.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        errorlogData: "",
        errorReloading: false,
        errorlog_cont_refresh: "",
        errorRefreshing: false,
        errorSevLevel: "Everything",
        errorLines: "50",
        isTextWrapped: false
      };
      const sev_emerg = " - EMERG - ";
      const sev_crit = " - CRIT - ";
      const sev_alert = " - ALERT - ";
      const sev_err = " - ERR - ";
      const sev_warn = " - WARN - ";
      const sev_notice = " - NOTICE - ";
      const sev_info = " - INFO - ";
      const sev_debug = " - DEBUG - ";
      this.sev_levels = {
        Emergency: sev_emerg,
        Critical: sev_crit,
        Alert: sev_alert,
        Error: sev_err,
        Warning: sev_warn,
        Notice: sev_notice,
        Info: sev_info,
        Debug: sev_debug
      };
      this.sev_all_errs = [sev_emerg, sev_crit, sev_alert, sev_err];
      this.sev_all_info = [sev_warn, sev_notice, sev_info, sev_debug];
      this.handleRefreshErrorLog = this.handleRefreshErrorLog.bind(this);
      this.errorRefreshCont = this.errorRefreshCont.bind(this);
      this.handleErrorChange = this.handleErrorChange.bind(this);
      this.handleSevChange = this.handleSevChange.bind(this);
      this.handleTextWrappedChange = this.handleTextWrappedChange.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
      this.handleRefreshErrorLog();
    }
    componentWillUnmount() {
      clearInterval(this.state.errorlog_cont_refresh);
    }
    handleRefreshErrorLog() {
      this.setState({
        errorReloading: true
      });
      let cmd;
      if (this.state.errorLines === "no-limit") {
        cmd = ["cat", this.props.logLocation];
      } else {
        cmd = ["tail", "-" + this.state.errorLines, this.props.logLocation];
      }
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
        if (this.state.errorSevLevel !== "Everything") {
          const lines = data.split("\n");
          let new_data = "";
          for (let i = 0; i < lines.length; i++) {
            let line = "";
            if (this.state.errorSevLevel === "Error Messages") {
              for (const lev of this.sev_all_errs) {
                if (lines[i].indexOf(lev) !== -1) {
                  line = lines[i] + "\n";
                }
              }
            } else if (this.state.errorSevLevel === "Info Messages") {
              for (const lev of this.sev_all_info) {
                if (lines[i].indexOf(lev) !== -1) {
                  line = lines[i] + "\n";
                }
              }
            } else if (lines[i].indexOf(this.sev_levels[this.state.errorSevLevel]) !== -1) {
              line = lines[i] + "\n";
            }
            new_data += line;
          }
          data = new_data;
        }
        this.setState(() => ({
          errorlogData: data,
          errorReloading: false
        }));
      }).fail((err_msg) => {
        cockpit_default.error(err_msg);
        this.setState({ errorReloading: false });
      });
    }
    errorRefreshCont(e) {
      if (e.target.checked) {
        this.setState({
          errorlog_cont_refresh: setInterval(this.handleRefreshErrorLog, 2e3),
          errorRefreshing: e.target.checked
        });
      } else {
        clearInterval(this.state.errorlog_cont_refresh);
        this.setState({
          errorRefreshing: e.target.checked
        });
      }
    }
    handleErrorChange(e) {
      const value = e.target.value;
      this.setState(() => ({
        errorLines: value
      }), this.handleRefreshErrorLog);
    }
    handleSevChange(e) {
      const value = e.target.value;
      this.setState({
        errorSevLevel: value
      }, this.handleRefreshErrorLog);
    }
    handleTextWrappedChange(_event, checked) {
      this.setState({
        isTextWrapped: checked
      });
    }
    render() {
      let spinner = null;
      if (this.state.errorReloading) {
        spinner = /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(ToolbarItem, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Spinner, { size: "sm" }),
          _46("Reloading errors log...")
        ] });
      }
      const logViewerToolbar = /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Toolbar, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(ToolbarContent, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ToolbarItem, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(LogViewerSearch, { placeholder: _46("Search") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ToolbarItem, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
          FormSelect,
          {
            id: "errorLines",
            value: this.state.errorLines,
            onChange: (event) => {
              this.handleErrorChange(event);
            },
            "aria-label": _46("Lines to display"),
            style: { minWidth: "150px", width: "auto" },
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "50", label: "50" }, "50"),
              /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "100", label: "100" }, "100"),
              /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "200", label: "200" }, "200"),
              /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "300", label: "300" }, "300"),
              /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "400", label: "400" }, "400"),
              /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "500", label: "500" }, "500"),
              /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "1000", label: "1000" }, "1000"),
              /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "2000", label: "2000" }, "2000"),
              /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "5000", label: "5000" }, "5000"),
              /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "10000", label: "10000" }, "10000"),
              /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "50000", label: "50000" }, "50000"),
              /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "no-limit", label: _46("No Limit") }, "no-limit")
            ]
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ToolbarItem, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "ds-container", children: [
          /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "ds-label", children: _46("Filter") }),
          /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
            FormSelect,
            {
              className: "ds-left-margin",
              value: this.state.errorSevLevel,
              onChange: (event) => {
                this.handleSevChange(event);
              },
              "aria-label": _46("Filter by severity"),
              style: { minWidth: "150px", width: "auto" },
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "Everything", label: _46("Everything") }, "Everything"),
                /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "Error Messages", label: _46("Error Messages") }, "Error Messages"),
                /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "Info Messages", label: _46("Info Messages") }, "Info Messages"),
                /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { isDisabled: true, value: "disabled", label: "---------------" }, "disabled"),
                /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "Emergency", label: "Emergency" }, "Emergency"),
                /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "Alert", label: "Alert" }, "Alert"),
                /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "Critical", label: "Critical" }, "Critical"),
                /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "Warning", label: "Warning" }, "Warning"),
                /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "Notice", label: "Notice" }, "Notice"),
                /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "Info", label: "Info" }, "Info"),
                /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormSelectOption, { value: "Debug", label: "Debug" }, "Debug")
              ]
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ToolbarItem, { alignSelf: "center", className: "ds-float-right", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
          Checkbox,
          {
            id: "errorRefreshing",
            isChecked: this.state.errorRefreshing,
            onChange: (e) => {
              this.errorRefreshCont(e);
            },
            label: _46("Continuously Refresh")
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ToolbarItem, { alignSelf: "center", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
          Checkbox,
          {
            id: "wrapText",
            isChecked: this.state.isTextWrapped,
            onChange: this.handleTextWrappedChange,
            label: _46("Wrap text"),
            "aria-label": "wrap text checkbox"
          }
        ) }),
        spinner
      ] }) });
      return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { id: "monitor-log-errors-page", children: [
        /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(Text, { component: TextVariants.h3, children: [
          _46("Errors Log"),
          /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _46("Refresh error log"),
              onClick: this.handleRefreshErrorLog,
              children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
          LogViewer,
          {
            data: this.state.errorlogData,
            isTextWrapped: this.state.isTextWrapped,
            toolbar: logViewerToolbar,
            scrollToRow: this.state.errorlogData.split("\n").length,
            height: "600px"
          }
        ) })
      ] });
    }
  };
  ErrorLogMonitor.propTypes = {
    logLocation: import_prop_types45.default.string,
    enableTree: import_prop_types45.default.func
  };
  ErrorLogMonitor.defaultProps = {
    logLocation: ""
  };
  var errorlog_default = ErrorLogMonitor;

  // src/lib/monitor/securitylog.jsx
  var import_react117 = __toESM(require_react(), 1);
  var import_prop_types46 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1);
  var _47 = cockpit_default.gettext;
  var SecurityLogMonitor = class extends import_react117.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        securitylogData: "",
        securityReloading: false,
        securitylog_cont_refresh: "",
        securityRefreshing: false,
        securityLines: "50",
        isTextWrapped: false
      };
      this.handleRefreshSecurityLog = this.handleRefreshSecurityLog.bind(this);
      this.handleSecurityChange = this.handleSecurityChange.bind(this);
      this.securityRefreshCont = this.securityRefreshCont.bind(this);
      this.handleTextWrappedChange = this.handleTextWrappedChange.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
      this.handleRefreshSecurityLog();
    }
    componentWillUnmount() {
      clearInterval(this.state.securitylog_cont_refresh);
    }
    securityRefreshCont(e) {
      if (e.target.checked) {
        this.setState({
          securitylog_cont_refresh: setInterval(this.handleRefreshSecurityLog, 2e3),
          securityRefreshing: e.target.checked
        });
      } else {
        clearInterval(this.state.securitylog_cont_refresh);
        this.setState({
          securityRefreshing: e.target.checked
        });
      }
    }
    handleSecurityChange(e) {
      const value = e.target.value;
      this.setState(() => ({
        securityLines: value
      }), this.handleRefreshSecurityLog);
    }
    handleTextWrappedChange(_event, checked) {
      this.setState({
        isTextWrapped: checked
      });
    }
    handleRefreshSecurityLog() {
      this.setState({
        securityReloading: true
      });
      let cmd;
      if (this.state.securityLines === "no-limit") {
        cmd = ["cat", this.props.logLocation];
      } else {
        cmd = ["tail", "-" + this.state.securityLines, this.props.logLocation];
      }
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.setState(() => ({
          securitylogData: content,
          securityReloading: false
        }));
      }).fail((err_msg) => {
        cockpit_default.error(err_msg);
        this.setState({
          securityReloading: false
        });
      });
    }
    render() {
      let spinner = null;
      if (this.state.securityReloading) {
        spinner = /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(ToolbarItem, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Spinner, { size: "sm" }),
          _47("Reloading security log...")
        ] });
      }
      const logViewerToolbar = /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Toolbar, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(ToolbarContent, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ToolbarItem, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(LogViewerSearch, { placeholder: _47("Search") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ToolbarItem, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
          FormSelect,
          {
            id: "securityLines",
            value: this.state.securityLines,
            onChange: (event) => {
              this.handleSecurityChange(event);
            },
            "aria-label": _47("Lines to display"),
            style: { minWidth: "150px", width: "auto" },
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormSelectOption, { value: "50", label: "50" }, "50"),
              /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormSelectOption, { value: "100", label: "100" }, "100"),
              /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormSelectOption, { value: "200", label: "200" }, "200"),
              /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormSelectOption, { value: "300", label: "300" }, "300"),
              /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormSelectOption, { value: "400", label: "400" }, "400"),
              /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormSelectOption, { value: "500", label: "500" }, "500"),
              /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormSelectOption, { value: "1000", label: "1000" }, "1000"),
              /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormSelectOption, { value: "2000", label: "2000" }, "2000"),
              /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormSelectOption, { value: "5000", label: "5000" }, "5000"),
              /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormSelectOption, { value: "10000", label: "10000" }, "10000"),
              /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormSelectOption, { value: "50000", label: "50000" }, "50000"),
              /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FormSelectOption, { value: "no-limit", label: _47("No Limit") }, "no-limit")
            ]
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ToolbarItem, { alignSelf: "center", className: "ds-float-right", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
          Checkbox,
          {
            id: "securityRefreshing",
            isChecked: this.state.securityRefreshing,
            onChange: (e) => {
              this.securityRefreshCont(e);
            },
            label: _47("Continuously Refresh")
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ToolbarItem, { alignSelf: "center", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
          Checkbox,
          {
            id: "wrapText",
            isChecked: this.state.isTextWrapped,
            onChange: this.handleTextWrappedChange,
            label: _47("Wrap text"),
            "aria-label": "wrap text checkbox"
          }
        ) }),
        spinner
      ] }) });
      return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { id: "monitor-log-security-page", children: [
        /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Text, { component: TextVariants.h3, children: [
          _47("Security Log"),
          /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _47("Refresh security log"),
              onClick: this.handleRefreshSecurityLog,
              children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
          LogViewer,
          {
            data: this.state.securitylogData,
            isTextWrapped: this.state.isTextWrapped,
            toolbar: logViewerToolbar,
            scrollToRow: this.state.securitylogData.split("\n").length,
            height: "600px"
          }
        ) })
      ] });
    }
  };
  SecurityLogMonitor.propTypes = {
    logLocation: import_prop_types46.default.string,
    enableTree: import_prop_types46.default.func
  };
  SecurityLogMonitor.defaultProps = {
    logLocation: ""
  };
  var securitylog_default = SecurityLogMonitor;

  // src/lib/monitor/replLogAnalysis.jsx
  var import_react118 = __toESM(require_react(), 1);
  var import_prop_types47 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1);
  var _48 = cockpit_default.gettext;
  var TIME_FORMAT_REGEX = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/;
  var UTC_OFFSET_REGEX = /^[+-]\d{4}$/;
  var ReplLogAnalysis = class extends import_react118.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        // Form inputs
        logDirs: "",
        logDirsList: [],
        suffixesList: [],
        currentSuffixInput: "",
        anonymizeOption: false,
        replicationFilter: "all",
        // 'all', 'only-fully', 'only-not'
        analysisPrecision: "balanced",
        // 'fast' | 'balanced' | 'full'
        lagTimeLowest: "",
        etimeLowest: "",
        utcOffset: "+0000",
        formatOptions: {
          json: true,
          // JSON format for PatternFly chart data
          html: false,
          // HTML format requires optional packages
          png: false,
          // PNG format requires optional packages
          csv: true
          // CSV format for tabular data
        },
        useCustomOutputDir: false,
        customOutputDir: "",
        reportName: "",
        // File browser state
        showFileBrowser: false,
        currentPath: "/var/log/dirsrv",
        directoryContents: [],
        selectedDirectories: [],
        isLoading: false,
        browsingError: null,
        fileBrowserPurpose: "logDirs",
        // can be "logDirs" or "outputDir"
        recentDirectories: ["/var/log/dirsrv", "/tmp"],
        // Accordion state
        expanded: ["sources-toggle", "display-toggle"],
        // Form validation
        errors: {
          logDirs: "",
          suffixes: "",
          utcOffset: "",
          startDate: "",
          endDate: "",
          formatOptions: "",
          customOutputDir: ""
        },
        // UI state
        isGeneratingReport: false,
        showLagReportModal: false,
        reportUrls: {},
        tempDirectories: [],
        // Track temp dirs for cleanup
        reportError: null,
        startDate: null,
        endDate: null,
        isReplReportsPackageInstalled: false,
        showChooseLagReportModal: false
      };
      this.handleInputChange = this.handleInputChange.bind(this);
      this.handleAnonymizeChange = this.handleAnonymizeChange.bind(this);
      this.handleReplicationFilterChange = this.handleReplicationFilterChange.bind(this);
      this.handleFormatOptionChange = this.handleFormatOptionChange.bind(this);
      this.handlePrecisionChange = this.handlePrecisionChange.bind(this);
      this.handleSubmit = this.handleSubmit.bind(this);
      this.generateReport = this.generateReport.bind(this);
      this.closeLagReportModal = this.closeLagReportModal.bind(this);
      this.validateForm = this.validateForm.bind(this);
      this.openFileBrowser = this.openFileBrowser.bind(this);
      this.closeFileBrowser = this.closeFileBrowser.bind(this);
      this.browseDirectory = this.browseDirectory.bind(this);
      this.addDirectory = this.addDirectory.bind(this);
      this.removeDirectory = this.removeDirectory.bind(this);
      this.navigateUp = this.navigateUp.bind(this);
      this.toggleDirectorySelection = this.toggleDirectorySelection.bind(this);
      this.addSelectedDirectories = this.addSelectedDirectories.bind(this);
      this.selectAllDirectories = this.selectAllDirectories.bind(this);
      this.handleSuffixInputChange = this.handleSuffixInputChange.bind(this);
      this.addSuffix = this.addSuffix.bind(this);
      this.removeSuffix = this.removeSuffix.bind(this);
      this.handleSuffixKeyPress = this.handleSuffixKeyPress.bind(this);
      this.handleNumberInputChange = this.handleNumberInputChange.bind(this);
      this.handleNumberInputMinus = this.handleNumberInputMinus.bind(this);
      this.handleNumberInputPlus = this.handleNumberInputPlus.bind(this);
      this.handleUtcOffsetChange = this.handleUtcOffsetChange.bind(this);
      this.handleUtcOffsetMinus = this.handleUtcOffsetMinus.bind(this);
      this.handleUtcOffsetPlus = this.handleUtcOffsetPlus.bind(this);
      this.handleStartDateChange = this.handleStartDateChange.bind(this);
      this.handleStartTimeChange = this.handleStartTimeChange.bind(this);
      this.handleEndDateChange = this.handleEndDateChange.bind(this);
      this.handleEndTimeChange = this.handleEndTimeChange.bind(this);
      this.formatDateTimeForCommand = this.formatDateTimeForCommand.bind(this);
      this.handleUseCustomOutputDirChange = this.handleUseCustomOutputDirChange.bind(this);
      this.selectOutputDirectory = this.selectOutputDirectory.bind(this);
      this.setCustomOutputDir = this.setCustomOutputDir.bind(this);
      this.handlePathInputChange = this.handlePathInputChange.bind(this);
      this.handlePathInputKeyPress = this.handlePathInputKeyPress.bind(this);
      this.handleCustomOutputDirChange = this.handleCustomOutputDirChange.bind(this);
      this.handleReportNameChange = this.handleReportNameChange.bind(this);
      this.openChooseLagReportModal = this.openChooseLagReportModal.bind(this);
      this.closeChooseLagReportModal = this.closeChooseLagReportModal.bind(this);
      this.toggleAccordion = this.toggleAccordion.bind(this);
      this.pathInputRef = import_react118.default.createRef();
      this.focusPathInput = this.focusPathInput.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
      this.validateDirectoryExists("/var/log/dirsrv");
      this.checkReplReportsPackage();
      if (this.props.replicatedSuffixes && this.props.replicatedSuffixes.length > 0) {
        this.setState({
          suffixesList: [...this.state.suffixesList, ...this.props.replicatedSuffixes]
        });
      }
    }
    validateDirectoryExists(path2) {
      return new Promise((resolve, reject) => {
        if (!path2 || path2.trim() === "") {
          resolve(false);
          return;
        }
        cockpit_default.spawn(["test", "-d", path2], { superuser: true, err: "message" }).then(() => resolve(true)).catch(() => resolve(false));
      });
    }
    checkReplReportsPackage() {
      cockpit_default.spawn(["rpm", "-q", "python3-lib389-repl-reports"], { err: "ignore" }).then(() => {
        this.setState({ isReplReportsPackageInstalled: true });
      }).catch(() => {
        this.setState((prevState) => ({
          isReplReportsPackageInstalled: false,
          // Disable HTML and PNG format options if package is not installed
          formatOptions: {
            ...prevState.formatOptions,
            html: false,
            png: false
          }
        }));
      });
    }
    handleInputChange(event, value) {
      let id = event.target.id;
      const errors = { ...this.state.errors };
      errors[id] = "";
      if (id === "utcOffset" && value && !UTC_OFFSET_REGEX.test(value)) {
        errors.utcOffset = _48("UTC offset must be in \xB1HHMM format (e.g., -0400, +0530)");
      }
      if ((id === "startDate" || id === "endDate") && value && !TIME_FORMAT_REGEX.test(value)) {
        errors[id] = _48("Date format must be YYYY-MM-DD HH:MM:SS");
      }
      if ((id === "lagTimeLowest" || id === "etimeLowest") && value) {
        const numValue = parseFloat(value);
        if (isNaN(numValue) || numValue < 0) {
          errors[id] = _48("Must be a positive number");
        }
      }
      this.setState({
        [id]: value,
        errors
      });
    }
    handleAnonymizeChange(checked) {
      this.setState({
        anonymizeOption: checked
      });
    }
    handleReplicationFilterChange(value) {
      this.setState({
        replicationFilter: value
      });
    }
    handlePrecisionChange(value) {
      this.setState({
        analysisPrecision: value
      });
    }
    handleFormatOptionChange(format2) {
      if ((format2 === "html" || format2 === "png") && !this.state.isReplReportsPackageInstalled) {
        return;
      }
      this.setState((prevState) => ({
        formatOptions: {
          ...prevState.formatOptions,
          [format2]: !prevState.formatOptions[format2]
        }
      }));
    }
    handleUseCustomOutputDirChange(checked) {
      this.setState({
        useCustomOutputDir: checked,
        // Reset custom directory if turning off the option
        customOutputDir: checked ? this.state.customOutputDir : "",
        errors: {
          ...this.state.errors,
          customOutputDir: ""
        }
      });
    }
    handleCustomOutputDirChange(event) {
      const value = event.target.value;
      this.setState({
        customOutputDir: value,
        errors: {
          ...this.state.errors,
          customOutputDir: ""
        }
      });
    }
    handleReportNameChange(event) {
      this.setState({
        reportName: event.target.value
      });
    }
    handleSuffixInputChange(event, value) {
      this.setState({
        currentSuffixInput: value,
        errors: {
          ...this.state.errors,
          suffixes: valid_dn(value) || value === "" ? "" : "Invalid DN format"
          // Validate and clear/set error
        }
      });
    }
    addSuffix() {
      const { suffixesList, currentSuffixInput } = this.state;
      const trimmedSuffix = currentSuffixInput.trim();
      if (!trimmedSuffix) {
        return;
      }
      if (!valid_dn(trimmedSuffix)) {
        this.setState({
          errors: {
            ...this.state.errors,
            suffixes: "Invalid DN format"
          }
        });
        return;
      }
      if (!suffixesList.includes(trimmedSuffix)) {
        const newList = [...suffixesList, trimmedSuffix];
        this.setState({
          suffixesList: newList,
          currentSuffixInput: "",
          // Clear the input field
          errors: {
            ...this.state.errors,
            suffixes: ""
            // Clear any previous error
          }
        });
      }
    }
    handleSuffixKeyPress(event) {
      if (event.key === "Enter") {
        event.preventDefault();
        this.addSuffix();
      }
    }
    removeSuffix(index) {
      const { suffixesList } = this.state;
      const newList = [...suffixesList];
      newList.splice(index, 1);
      this.setState({
        suffixesList: newList,
        errors: {
          ...this.state.errors,
          suffixes: newList.length === 0 ? _48("At least one suffix is required") : ""
        }
      });
    }
    async validateForm() {
      const { logDirsList, suffixesList, utcOffset, startDate, endDate, formatOptions, useCustomOutputDir, customOutputDir } = this.state;
      const errors = { ...this.state.errors };
      let isValid = true;
      if (logDirsList.length === 0) {
        errors.logDirs = _48("At least one log directory is required");
        isValid = false;
      } else {
        errors.logDirs = "";
      }
      if (suffixesList.length === 0) {
        errors.suffixes = _48("At least one suffix is required");
        isValid = false;
      } else {
        errors.suffixes = "";
      }
      if (!Object.values(formatOptions).some((selected) => selected)) {
        errors.formatOptions = _48("At least one report format must be selected");
        isValid = false;
      } else {
        errors.formatOptions = "";
      }
      if (useCustomOutputDir) {
        if (!customOutputDir || customOutputDir.trim() === "") {
          errors.customOutputDir = _48("Output directory is required when using custom location");
          isValid = false;
        } else {
          const dirExists = await this.validateDirectoryExists(customOutputDir);
          if (!dirExists) {
            errors.customOutputDir = _48("Directory does not exist or is not accessible");
            isValid = false;
          } else {
            errors.customOutputDir = "";
          }
        }
      }
      if (utcOffset && !UTC_OFFSET_REGEX.test(utcOffset)) {
        errors.utcOffset = _48("UTC offset must be in \xB1HHMM format (e.g., -0400, +0530)");
        isValid = false;
      }
      if (startDate && endDate && startDate > endDate) {
        errors.endDate = _48("End time must be after start time");
        isValid = false;
      }
      this.setState({ errors });
      return isValid;
    }
    handleSubmit(e) {
      e.preventDefault();
      this.validateForm().then((isValid) => {
        if (isValid) {
          this.generateReport();
        }
      });
    }
    generateReport() {
      this.setState({
        isGeneratingReport: true,
        reportError: null
      });
      let outputDir;
      let dirName;
      if (this.state.reportName.trim()) {
        dirName = this.state.reportName.trim();
      } else {
        const now3 = /* @__PURE__ */ new Date();
        const iso = now3.toISOString().replace(/:/g, "-").replace(/\..+/, "");
        const randomSuffix = Math.random().toString(36).slice(2, 8);
        dirName = `repl_report_${iso}_${randomSuffix}`;
      }
      if (this.state.useCustomOutputDir && this.state.customOutputDir) {
        outputDir = `${this.state.customOutputDir}/${dirName}`;
      } else {
        outputDir = `/tmp/${dirName}`;
        this.setState((prevState) => ({
          tempDirectories: [...prevState.tempDirectories, outputDir]
        }));
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "lag-report",
        "--log-dirs"
      ];
      const { logDirsList, suffixesList } = this.state;
      logDirsList.forEach((dir) => cmd.push(dir));
      if (suffixesList.length > 0) {
        cmd.push("--suffixes");
        suffixesList.forEach((suffix) => cmd.push(suffix));
      }
      cmd.push("--output-dir", outputDir);
      cmd.push("--json");
      const { formatOptions } = this.state;
      const outputFormats = [];
      if (formatOptions.json) {
        outputFormats.push("json");
      }
      if (formatOptions.html) {
        outputFormats.push("html");
      }
      if (formatOptions.png) {
        outputFormats.push("png");
      }
      if (formatOptions.csv) {
        outputFormats.push("csv");
      }
      cmd.push("--output-format", ...outputFormats);
      if (this.state.anonymizeOption) {
        cmd.push("--anonymous");
      }
      if (this.state.replicationFilter === "only-fully") {
        cmd.push("--only-fully-replicated");
      } else if (this.state.replicationFilter === "only-not") {
        cmd.push("--only-not-replicated");
      }
      if (this.state.lagTimeLowest) {
        cmd.push("--lag-time-lowest", this.state.lagTimeLowest);
      }
      if (this.state.etimeLowest) {
        cmd.push("--etime-lowest", this.state.etimeLowest);
      }
      const startTimeStr = this.formatDateTimeForCommand(this.state.startDate);
      if (startTimeStr) {
        cmd.push("--start-time", startTimeStr);
      }
      const endTimeStr = this.formatDateTimeForCommand(this.state.endDate);
      if (endTimeStr) {
        cmd.push("--end-time", endTimeStr);
      }
      if (this.state.analysisPrecision) {
        cmd.push("--precision", this.state.analysisPrecision);
      }
      if (this.state.utcOffset) {
        cmd.push("--utc-offset", this.state.utcOffset);
      }
      log_cmd("generateReplReport", "Generate replication log report", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        try {
          let result;
          try {
            const jsonStart = content.indexOf("{");
            if (jsonStart >= 0) {
              const jsonContent = content.substring(jsonStart);
              result = JSON.parse(jsonContent);
            } else {
              throw new Error("No JSON object found in response");
            }
          } catch (parseError) {
            console.error("JSON parse error:", parseError);
            throw new Error("Failed to parse server response as JSON: " + parseError.message);
          }
          if (!result || !result.type) {
            throw new Error("Invalid response format from server");
          }
          if (result.type === "list") {
            const reportUrls = {};
            if (Array.isArray(result.items)) {
              result.items.forEach((path2) => {
                if (path2.endsWith(".html")) {
                  reportUrls.html = path2;
                } else if (path2.endsWith(".png")) {
                  reportUrls.png = path2;
                } else if (path2.endsWith(".csv")) {
                  reportUrls.csv = path2;
                } else if (path2.endsWith("_summary.json")) {
                  reportUrls.summary = path2;
                } else if (path2.endsWith(".json") && !path2.endsWith("_summary.json")) {
                  reportUrls.json = path2;
                }
              });
            } else if (typeof result.items === "object" && result.items !== null) {
              Object.entries(result.items).forEach(([format2, path2]) => {
                if (format2 === "html" || path2.endsWith(".html")) {
                  reportUrls.html = path2;
                } else if (format2 === "png" || path2.endsWith(".png")) {
                  reportUrls.png = path2;
                } else if (format2 === "csv" || path2.endsWith(".csv")) {
                  reportUrls.csv = path2;
                } else if (format2 === "summary" || path2.endsWith("_summary.json")) {
                  reportUrls.summary = path2;
                } else if (format2 === "json" || path2.endsWith(".json") && !path2.endsWith("_summary.json")) {
                  reportUrls.json = path2;
                }
              });
            } else {
              throw new Error("Invalid items format in server response");
            }
            if (Object.keys(reportUrls).length > 0) {
              this.setState({
                isGeneratingReport: false,
                showLagReportModal: true,
                reportUrls
              });
            } else {
              throw new Error("No report files were found in the server response");
            }
          } else {
            throw new Error("Unexpected response type: " + result.type);
          }
        } catch (e) {
          console.error("Error processing report generation response:", e);
          this.setState({
            isGeneratingReport: false,
            reportError: e.message || _48("Failed to process the response from the server")
          });
          this.props.addNotification(
            "error",
            _48("Failed to process the response from the server: ") + (e.message || "")
          );
        }
      }).fail((err) => {
        let errMsg;
        try {
          const errorObj = getApiErrorMessage(err);
          errMsg = errorObj.desc || errorObj.message || err.toString();
        } catch (e) {
          errMsg = err.toString();
        }
        console.error("Report generation error:", errMsg);
        let displayMsg = errMsg;
        if (errMsg.includes("No replication data found") || errMsg.includes("No CSN data available")) {
          displayMsg = _48("No replication data found matching the specified criteria. ") + _48("The filters you selected may be too restrictive. Try:");
          displayMsg += "\n\u2022 " + _48("Reducing the lag time or etime threshold values");
          displayMsg += "\n\u2022 " + _48("Adjusting the replication status filter");
          displayMsg += "\n\u2022 " + _48("Expanding the time range");
          displayMsg += "\n\u2022 " + _48("Checking that the log directories contain replication events");
        } else if (errMsg.includes("parse") || errMsg.includes("function")) {
          displayMsg = _48("Failed to generate the report. Please check that:");
          displayMsg += "\n\u2022 " + _48("The log directories are valid and accessible");
          displayMsg += "\n\u2022 " + _48("The access logs contain replication data");
          displayMsg += "\n\u2022 " + _48("All required packages are installed (python3-lib389-repl-reports for HTML/PNG)");
        }
        this.setState({
          isGeneratingReport: false,
          reportError: displayMsg
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_48("Failed to generate replication log report: $0"), displayMsg)
        );
      });
    }
    closeLagReportModal() {
      this.setState({
        showLagReportModal: false,
        reportUrls: {}
      });
    }
    openFileBrowser() {
      this.setState({
        showFileBrowser: true,
        fileBrowserPurpose: "logDirs",
        selectedDirectories: [],
        // Reset selected directories when opening browser
        currentPath: "/var/log/dirsrv"
        // Always reset to the default log directory path
      }, () => {
        this.browseDirectory("/var/log/dirsrv");
      });
    }
    closeFileBrowser() {
      this.setState({
        showFileBrowser: false,
        browsingError: null
      });
    }
    browseDirectory(path2) {
      this.setState({
        isLoading: true,
        browsingError: null,
        selectedDirectories: []
        // Reset selections when changing directories
      });
      cockpit_default.spawn(["find", path2, "-maxdepth", "1", "-type", "d", "-not", "-path", "*/\\.*"], { superuser: true, err: "message" }).then((output) => {
        const dirs = output.trim().split("\n").filter((dir) => dir !== path2).sort();
        this.setState((prevState) => {
          let recentDirs = [...prevState.recentDirectories];
          if (!recentDirs.includes(path2)) {
            recentDirs.unshift(path2);
            recentDirs = recentDirs.slice(0, 5);
          }
          return {
            currentPath: path2,
            directoryContents: dirs,
            isLoading: false,
            recentDirectories: recentDirs
          };
        }, () => {
          this.focusPathInput();
        });
      }).catch((error) => {
        console.error("Error browsing directory:", error);
        this.setState({
          isLoading: false,
          browsingError: _48("Failed to browse directory: ") + (error.message || error)
        });
      });
    }
    navigateUp() {
      const parentPath = this.state.currentPath.split("/").slice(0, -1).join("/");
      if (parentPath) {
        this.browseDirectory(parentPath);
      } else {
        this.browseDirectory("/");
      }
    }
    focusPathInput() {
      if (this.pathInputRef && this.pathInputRef.current) {
        try {
          const el = this.pathInputRef.current;
          el.focus();
          if (typeof el.setSelectionRange === "function") {
            const len = (el.value || "").length;
            el.setSelectionRange(len, len);
          }
        } catch (e) {
        }
      }
    }
    handlePathInputChange(event) {
      this.setState({
        currentPath: event.target.value
      });
    }
    handlePathInputKeyPress(event) {
      if (event.key === "Enter") {
        this.browseDirectory(this.state.currentPath);
      }
    }
    addDirectory(path2) {
      if (this.state.fileBrowserPurpose === "logDirs") {
        const { logDirsList } = this.state;
        if (!logDirsList.includes(path2)) {
          const newList = [...logDirsList, path2];
          this.setState({
            logDirsList: newList,
            logDirs: newList.join("|"),
            errors: {
              ...this.state.errors,
              logDirs: ""
              // Clear any previous error
            }
          });
        }
      } else if (this.state.fileBrowserPurpose === "outputDir") {
        this.setCustomOutputDir(path2);
      }
      this.closeFileBrowser();
    }
    removeDirectory(index) {
      const { logDirsList } = this.state;
      const newList = [...logDirsList];
      newList.splice(index, 1);
      this.setState({
        logDirsList: newList,
        logDirs: newList.join("|"),
        errors: {
          ...this.state.errors,
          logDirs: newList.length === 0 ? _48("At least one log directory is required") : ""
        }
      });
    }
    toggleDirectorySelection(dir, isChecked) {
      this.setState((prevState) => {
        if (isChecked) {
          if (prevState.fileBrowserPurpose === "outputDir") {
            return { selectedDirectories: [dir] };
          }
          if (!prevState.selectedDirectories.includes(dir)) {
            return { selectedDirectories: [...prevState.selectedDirectories, dir] };
          }
        } else {
          return {
            selectedDirectories: prevState.selectedDirectories.filter((d) => d !== dir)
          };
        }
        return null;
      });
    }
    selectAllDirectories(isChecked) {
      if (this.state.fileBrowserPurpose === "outputDir") {
        return;
      }
      if (isChecked) {
        this.setState({ selectedDirectories: [...this.state.directoryContents] });
      } else {
        this.setState({ selectedDirectories: [] });
      }
    }
    addSelectedDirectories() {
      if (this.state.selectedDirectories.length === 0) {
        return;
      }
      if (this.state.fileBrowserPurpose === "logDirs") {
        this.setState((prevState) => ({
          logDirsList: [.../* @__PURE__ */ new Set([...prevState.logDirsList, ...prevState.selectedDirectories])],
          showFileBrowser: false,
          errors: {
            ...prevState.errors,
            logDirs: ""
            // Clear error if there was one
          }
        }));
      } else if (this.state.fileBrowserPurpose === "outputDir" && this.state.selectedDirectories.length > 0) {
        this.setCustomOutputDir(this.state.selectedDirectories[0]);
      }
    }
    handleNumberInputChange(id, event) {
      const value = event.target.value;
      const errors = { ...this.state.errors };
      errors[id] = "";
      if (value !== "") {
        const numValue = parseFloat(value);
        if (isNaN(numValue) || numValue < 0) {
          errors[id] = _48("Must be a positive number");
        }
      }
      this.setState({
        [id]: value === "" ? value : parseFloat(value),
        errors
      });
    }
    handleNumberInputMinus(id) {
      const currentValue = this.state[id];
      const numValue = currentValue === "" || isNaN(parseFloat(currentValue)) ? 0 : parseFloat(currentValue);
      if (numValue > 0) {
        const newValue = Math.max(0, numValue - 1);
        this.setState({
          [id]: newValue,
          errors: {
            ...this.state.errors,
            [id]: ""
          }
        });
      }
    }
    handleNumberInputPlus(id) {
      const currentValue = this.state[id];
      const numValue = currentValue === "" || isNaN(parseFloat(currentValue)) ? 0 : parseFloat(currentValue);
      const newValue = numValue + 1;
      this.setState({
        [id]: newValue,
        errors: {
          ...this.state.errors,
          [id]: ""
        }
      });
    }
    formatUtcOffset(minutes) {
      const absMinutes = Math.abs(minutes);
      const hours = Math.floor(absMinutes / 60);
      const mins = absMinutes % 60;
      const sign2 = minutes < 0 ? "-" : "+";
      return `${sign2}${hours.toString().padStart(2, "0")}${mins.toString().padStart(2, "0")}`;
    }
    parseUtcOffset(offsetStr) {
      if (!offsetStr || !UTC_OFFSET_REGEX.test(offsetStr)) {
        return 0;
      }
      const sign2 = offsetStr.charAt(0) === "-" ? -1 : 1;
      const hours = parseInt(offsetStr.substring(1, 3), 10);
      const minutes = parseInt(offsetStr.substring(3, 5), 10);
      return sign2 * (hours * 60 + minutes);
    }
    handleUtcOffsetChange(event, value) {
      const errors = { ...this.state.errors };
      errors.utcOffset = "";
      if (!value) {
        this.setState({
          utcOffset: "",
          errors
        });
        return;
      }
      if (UTC_OFFSET_REGEX.test(value)) {
        this.setState({
          utcOffset: value,
          errors
        });
        return;
      }
      errors.utcOffset = _48("UTC offset must be in \xB1HHMM format (e.g., -0400, +0530)");
      this.setState({
        utcOffset: value,
        errors
      });
    }
    handleUtcOffsetMinus() {
      const { utcOffset } = this.state;
      const currentMinutes = this.parseUtcOffset(utcOffset || "+0000");
      const newMinutes = Math.max(currentMinutes - 30, -1439);
      this.setState({
        utcOffset: this.formatUtcOffset(newMinutes),
        errors: {
          ...this.state.errors,
          utcOffset: ""
        }
      });
    }
    handleUtcOffsetPlus() {
      const { utcOffset } = this.state;
      const currentMinutes = this.parseUtcOffset(utcOffset || "+0000");
      const newMinutes = Math.min(currentMinutes + 30, 1439);
      this.setState({
        utcOffset: this.formatUtcOffset(newMinutes),
        errors: {
          ...this.state.errors,
          utcOffset: ""
        }
      });
    }
    handleStartDateChange(event, value, date2) {
      const errors = { ...this.state.errors };
      errors.startDate = "";
      const picked = date2 && isValidDate(date2) ? new Date(date2) : value ? new Date(value) : null;
      if (picked && isValidDate(picked)) {
        if (isValidDate(this.state.startDate)) {
          picked.setHours(this.state.startDate.getHours());
          picked.setMinutes(this.state.startDate.getMinutes());
          picked.setSeconds(this.state.startDate.getSeconds());
        }
        if (this.state.endDate) {
          if (picked > this.state.endDate) {
            errors.startDate = _48("Start date cannot be after end date");
          } else {
            errors.endDate = "";
          }
        }
        this.setState({ startDate: picked, errors });
      } else if (!value) {
        this.setState({ startDate: null, errors });
      }
    }
    handleStartTimeChange(event, time2, hour, minute, second2) {
      const { startDate } = this.state;
      const errors = { ...this.state.errors };
      errors.startDate = "";
      if (isValidDate(startDate)) {
        const updatedDate = new Date(startDate);
        updatedDate.setHours(hour || 0);
        updatedDate.setMinutes(minute || 0);
        updatedDate.setSeconds(second2 || 0);
        if (this.state.endDate) {
          if (updatedDate > this.state.endDate) {
            errors.startDate = _48("Start time cannot be after end time");
          } else {
            errors.endDate = "";
          }
        }
        this.setState({
          startDate: updatedDate,
          errors
        });
      }
    }
    handleEndDateChange(event, value, date2) {
      const errors = { ...this.state.errors };
      errors.endDate = "";
      const picked = date2 && isValidDate(date2) ? new Date(date2) : value ? new Date(value) : null;
      if (picked && isValidDate(picked)) {
        if (isValidDate(this.state.endDate)) {
          picked.setHours(this.state.endDate.getHours());
          picked.setMinutes(this.state.endDate.getMinutes());
          picked.setSeconds(this.state.endDate.getSeconds());
        }
        if (this.state.startDate) {
          if (picked < this.state.startDate) {
            errors.endDate = _48("End date cannot be before start date");
          } else {
            errors.startDate = "";
          }
        }
        this.setState({ endDate: picked, errors });
      } else if (!value) {
        this.setState({ endDate: null, errors });
      }
    }
    handleEndTimeChange(event, time2, hour, minute, second2) {
      const { endDate } = this.state;
      const errors = { ...this.state.errors };
      errors.endDate = "";
      if (isValidDate(endDate)) {
        const updatedDate = new Date(endDate);
        updatedDate.setHours(hour || 0);
        updatedDate.setMinutes(minute || 0);
        updatedDate.setSeconds(second2 || 0);
        if (this.state.startDate) {
          if (updatedDate < this.state.startDate) {
            errors.endDate = _48("End time cannot be before start time");
          } else {
            errors.startDate = "";
          }
        }
        this.setState({
          endDate: updatedDate,
          errors
        });
      }
    }
    formatDateTimeForCommand(date2) {
      if (!date2 || !isValidDate(date2)) return "";
      const year = date2.getFullYear();
      const month = String(date2.getMonth() + 1).padStart(2, "0");
      const day = String(date2.getDate()).padStart(2, "0");
      const hours = String(date2.getHours()).padStart(2, "0");
      const minutes = String(date2.getMinutes()).padStart(2, "0");
      const seconds2 = String(date2.getSeconds()).padStart(2, "0");
      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds2}`;
    }
    selectOutputDirectory() {
      this.setState({
        showFileBrowser: true,
        fileBrowserPurpose: "outputDir",
        selectedDirectories: [],
        currentPath: "/tmp"
        // Always reset to the default tmp directory for output
      }, () => {
        this.browseDirectory("/tmp");
      });
    }
    setCustomOutputDir(dir) {
      this.validateDirectoryExists(dir).then((exists2) => {
        this.setState({
          customOutputDir: dir,
          showFileBrowser: false,
          errors: {
            ...this.state.errors,
            customOutputDir: exists2 ? "" : _48("Directory does not exist or is not accessible")
          }
        });
      });
    }
    openChooseLagReportModal() {
      this.setState({ showChooseLagReportModal: true });
    }
    closeChooseLagReportModal() {
      this.setState({ showChooseLagReportModal: false });
    }
    toggleAccordion(id) {
      this.setState((prevState) => {
        const expanded = [...prevState.expanded];
        const index = expanded.indexOf(id);
        if (index >= 0) {
          expanded.splice(index, 1);
        } else {
          expanded.push(id);
        }
        return { expanded };
      });
    }
    render() {
      const {
        logDirsList,
        suffixesList,
        currentSuffixInput,
        anonymizeOption,
        replicationFilter,
        formatOptions,
        startDate,
        endDate,
        errors,
        isGeneratingReport,
        showLagReportModal,
        reportUrls,
        reportError: reportError2,
        showFileBrowser,
        currentPath,
        directoryContents,
        isLoading,
        browsingError,
        selectedDirectories,
        expanded,
        analysisPrecision
      } = this.state;
      const formIsValid = logDirsList.length > 0 && suffixesList.length > 0 && Object.values(formatOptions).some((selected) => selected) && Object.values(errors).every((err) => err === "");
      const renderLogDirectoriesList = () => {
        if (logDirsList.length === 0) {
          return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(EmptyState, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(EmptyStateIcon, { icon: FolderCloseIcon }),
            /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Title, { headingLevel: "h4", size: "md", children: _48("No log directories selected") }),
            /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(EmptyStateBody, { children: _48("Click 'Add Directory' to browse and select log directories") })
          ] });
        }
        return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DataList, { "aria-label": "Log directories list", children: logDirsList.map((dir, index) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DataListItem, { "aria-labelledby": `log-dir-${index}`, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DataListItemRow, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
          DataListItemCells,
          {
            dataListCells: [
              /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DataListCell, { width: 4, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { id: `log-dir-${index}`, children: [
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(FolderIcon, { className: "pf-v5-u-mr-sm" }),
                " ",
                dir
              ] }) }, "primary content"),
              /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DataListCell, { width: 1, alignRight: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                Button,
                {
                  variant: "plain",
                  "aria-label": _48("Remove directory"),
                  onClick: () => this.removeDirectory(index),
                  children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TrashIcon, {})
                }
              ) }, "secondary content")
            ]
          }
        ) }) }, index)) });
      };
      return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { children: [
          /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "pf-v5-u-display-flex pf-v5-u-align-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { component: TextVariants.h3, children: _48("Replication Log Analysis") }) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "pf-v5-u-mt-lg", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Card, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Form, { isHorizontal: true, autoComplete: "off", onSubmit: this.handleSubmit, children: [
            /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Accordion, { className: "pf-v5-u-mb-lg", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(AccordionItem, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                AccordionToggle,
                {
                  onClick: () => this.toggleAccordion("guide-toggle"),
                  isExpanded: expanded.includes("guide-toggle"),
                  id: "guide-toggle",
                  children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { component: TextVariants.h3, children: [
                    /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(InfoCircleIcon, { className: "pf-v5-u-mr-sm pf-v5-u-color-200" }),
                    " ",
                    _48("About Replication Log Analysis")
                  ] })
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(AccordionContent, { isHidden: !expanded.includes("guide-toggle"), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(TextContent, { className: "pf-v5-u-py-md pf-v5-u-px-lg", children: [
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: "This tool analyzes Directory Server access logs to generate replication performance reports showing how changes flow through your replication topology." }),
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { component: TextVariants.h4, className: "pf-v5-u-mt-md", children: "To use this tool:" }),
                /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("ol", { className: "pf-v5-u-pl-md", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("li", { className: "pf-v5-u-my-sm", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
                    /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: "Select the server log directories" }),
                    " to analyze. Each represents a server instance.",
                    /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { component: TextVariants.small, className: "pf-v5-u-ml-sm pf-v5-u-color-200", children: "(i.e. /var/log/dirsrv/slapd-supplier1/, /var/log/dirsrv/slapd-consumer2/)" })
                  ] }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("li", { className: "pf-v5-u-my-sm", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
                    /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: "Specify the suffixes" }),
                    " (naming contexts) you want to analyze"
                  ] }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("li", { className: "pf-v5-u-my-sm", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
                    /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: "Adjust filters and time ranges" }),
                    " if needed"
                  ] }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("li", { className: "pf-v5-u-my-sm", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: "Select your desired report formats" }) }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("li", { className: "pf-v5-u-my-sm", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text, { children: [
                    /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: "Click Generate Report" }),
                    " to create and view the analysis"
                  ] }) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text, { className: "pf-v5-u-mt-md", children: "The reports will show replication lag statistics, timing, and visualizations to help identify replication performance issues." })
              ] }) })
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "pf-v5-u-mx-lg pf-v5-u-mb-lg", children: [
              /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Card, { className: "pf-v5-u-mb-xl pf-v5-u-box-shadow-sm-on-lg", isFlat: true, children: [
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CardHeader, { className: "pf-v5-u-background-color-100", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Title, { headingLevel: "h4", size: "md", children: _48("Report Input") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CardBody, { className: "pf-v5-u-p-xl", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Grid, { hasGutter: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(GridItem, { span: 12, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
                    FormGroup,
                    {
                      label: _48("Log Directories"),
                      isRequired: true,
                      fieldId: "log-dirs",
                      labelIcon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                        Tooltip,
                        {
                          content: _48("Directories containing server access logs. These logs contain replication events needed for analysis."),
                          children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(InfoCircleIcon, {})
                        }
                      ),
                      className: "pf-v5-u-mb-xl",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "pf-v5-u-mb-md", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          Button,
                          {
                            variant: "secondary",
                            icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(PlusCircleIcon, {}),
                            onClick: this.openFileBrowser,
                            children: _48("Add Directory")
                          }
                        ) }),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "pf-v5-u-mt-md", children: renderLogDirectoriesList() }),
                        errors.logDirs && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { variant: "error", icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ExclamationCircleIcon, {}), children: errors.logDirs }) })
                      ]
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
                    FormGroup,
                    {
                      label: _48("Suffixes"),
                      isRequired: true,
                      fieldId: "suffixes",
                      labelIcon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                        Tooltip,
                        {
                          content: _48("Enter the suffix DN (Distinguished Name) for which you want to analyze replication, e.g. 'dc=example,dc=com'"),
                          children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(InfoCircleIcon, {})
                        }
                      ),
                      className: "ds-margin-top pf-v5-u-mb-xl",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { children: _48("Add one or more suffixes to analyze") }) }),
                        suffixesList.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "ds-margin-top ds-margin-bottom", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ChipGroup, { categoryName: _48("Selected Suffixes"), children: suffixesList.map((suffix, index) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          Chip,
                          {
                            onClick: () => this.removeSuffix(index),
                            children: suffix
                          },
                          index
                        )) }) }),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Split, { hasGutter: true, children: [
                          /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SplitItem, { isFilled: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                            TextInput,
                            {
                              id: "currentSuffixInput",
                              value: currentSuffixInput,
                              type: "text",
                              onChange: this.handleSuffixInputChange,
                              onKeyDown: this.handleSuffixKeyPress,
                              placeholder: _48("Enter a suffix (e.g., dc=example,dc=com)"),
                              validated: errors.suffixes ? "error" : "default",
                              "aria-label": "Suffix input"
                            }
                          ) }),
                          /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SplitItem, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                            Button,
                            {
                              variant: "secondary",
                              onClick: this.addSuffix,
                              isDisabled: !currentSuffixInput.trim(),
                              children: _48("Add")
                            }
                          ) })
                        ] }),
                        errors.suffixes && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { variant: "error", icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ExclamationCircleIcon, {}), children: errors.suffixes }) })
                      ]
                    }
                  )
                ] }) }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Card, { className: "pf-v5-u-mb-xl pf-v5-u-box-shadow-sm-on-lg", isFlat: true, children: [
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CardHeader, { className: "pf-v5-u-background-color-100", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Title, { headingLevel: "h4", size: "md", children: _48("Display Options") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CardBody, { className: "pf-v5-u-p-xl", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Grid, { hasGutter: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(GridItem, { span: 12, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
                    FormGroup,
                    {
                      label: _48("Server Anonymization"),
                      fieldId: "anonymize-option",
                      className: "ds-margin-top",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "ds-margin-top-sm" }),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          Radio,
                          {
                            id: "anonymizeYes",
                            name: "anonymizeOption",
                            label: _48("Anonymize server names"),
                            isChecked: anonymizeOption,
                            onChange: () => this.handleAnonymizeChange(true),
                            description: _48("Replace with generic identifiers like 'server_0'"),
                            className: "pf-v5-u-mb-lg"
                          }
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          Radio,
                          {
                            id: "anonymizeNo",
                            name: "anonymizeOption",
                            label: _48("Show actual server names"),
                            isChecked: !anonymizeOption,
                            onChange: () => this.handleAnonymizeChange(false)
                          }
                        )
                      ]
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
                    FormGroup,
                    {
                      label: _48("Replication Status Filter"),
                      fieldId: "replication-filter",
                      className: "ds-margin-top-xlg",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "ds-margin-top-sm" }),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          Radio,
                          {
                            id: "replicationFilterAll",
                            name: "replicationFilter",
                            label: _48("Show all replication entries"),
                            isChecked: replicationFilter === "all",
                            onChange: () => this.handleReplicationFilterChange("all"),
                            className: "pf-v5-u-mb-lg"
                          }
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          Radio,
                          {
                            id: "replicationFilterFullyReplicated",
                            name: "replicationFilter",
                            label: _48("Show only fully replicated entries"),
                            isChecked: replicationFilter === "only-fully",
                            onChange: () => this.handleReplicationFilterChange("only-fully"),
                            description: _48("Only show entries that successfully replicated to all servers"),
                            className: "pf-v5-u-mb-lg"
                          }
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          Radio,
                          {
                            id: "replicationFilterNotReplicated",
                            name: "replicationFilter",
                            label: _48("Show only entries that failed to replicate"),
                            isChecked: replicationFilter === "only-not",
                            onChange: () => this.handleReplicationFilterChange("only-not"),
                            description: _48("Only show entries that did not replicate to all servers")
                          }
                        )
                      ]
                    }
                  )
                ] }) }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Card, { className: "pf-v5-u-mb-xl pf-v5-u-box-shadow-sm-on-lg", isFlat: true, children: [
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CardHeader, { className: "pf-v5-u-background-color-100", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Title, { headingLevel: "h4", size: "md", children: _48("Time Range") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CardBody, { className: "pf-v5-u-p-xl", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Grid, { hasGutter: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(GridItem, { span: 12, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
                    FormGroup,
                    {
                      label: _48("Start Time"),
                      fieldId: "start-time",
                      className: "ds-margin-top",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(InputGroup, { children: [
                          /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(InputGroupItem, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                            DatePicker,
                            {
                              value: startDate ? yyyyMMddFormat(startDate) : "",
                              onChange: this.handleStartDateChange,
                              "aria-label": "Start date",
                              placeholder: "YYYY-MM-DD"
                            }
                          ) }),
                          /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(InputGroupItem, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                            TimePicker,
                            {
                              time: startDate ? `${String(startDate.getHours()).padStart(2, "0")}:${String(startDate.getMinutes()).padStart(2, "0")}:${String(startDate.getSeconds()).padStart(2, "0")}` : "00:00:00",
                              onChange: this.handleStartTimeChange,
                              "aria-label": "Start time",
                              is24Hour: true,
                              includeSeconds: true,
                              style: { width: "150px" },
                              isDisabled: !startDate
                            }
                          ) })
                        ] }),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperText, { children: errors.startDate ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { variant: "error", icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ExclamationCircleIcon, {}), children: errors.startDate }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { children: _48("Leave empty for beginning of logs") }) })
                      ]
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
                    FormGroup,
                    {
                      label: _48("End Time"),
                      fieldId: "end-time",
                      className: "ds-margin-top",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(InputGroup, { children: [
                          /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(InputGroupItem, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                            DatePicker,
                            {
                              value: endDate ? yyyyMMddFormat(endDate) : "",
                              onChange: this.handleEndDateChange,
                              "aria-label": "End date",
                              placeholder: "YYYY-MM-DD",
                              rangeStart: startDate,
                              isDisabled: false
                            }
                          ) }),
                          /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(InputGroupItem, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                            TimePicker,
                            {
                              time: endDate ? `${String(endDate.getHours()).padStart(2, "0")}:${String(endDate.getMinutes()).padStart(2, "0")}:${String(endDate.getSeconds()).padStart(2, "0")}` : "23:59:59",
                              onChange: this.handleEndTimeChange,
                              "aria-label": "End time",
                              is24Hour: true,
                              includeSeconds: true,
                              style: { width: "150px" },
                              isDisabled: !endDate
                            }
                          ) })
                        ] }),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperText, { children: errors.endDate ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { variant: "error", icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ExclamationCircleIcon, {}), children: errors.endDate }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { children: _48("Leave empty for current time") }) })
                      ]
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
                    FormGroup,
                    {
                      label: _48("UTC Offset"),
                      fieldId: "utc-offset",
                      labelIcon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                        Tooltip,
                        {
                          content: _48("Time zone offset applied when parsing log timestamps. Set this to match the timezone where your logs were generated."),
                          children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(InfoCircleIcon, {})
                        }
                      ),
                      className: "ds-margin-top",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Split, { hasGutter: true, children: [
                          /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SplitItem, { isFilled: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                            TextInput,
                            {
                              id: "utcOffset",
                              value: this.state.utcOffset,
                              type: "text",
                              onChange: this.handleUtcOffsetChange,
                              placeholder: "+0000",
                              validated: errors.utcOffset ? "error" : "default",
                              "aria-label": "UTC offset"
                            }
                          ) }),
                          /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SplitItem, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                            Button,
                            {
                              variant: "control",
                              onClick: this.handleUtcOffsetMinus,
                              "aria-label": _48("Decrease UTC offset by 30 minutes"),
                              children: "-"
                            }
                          ) }),
                          /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SplitItem, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                            Button,
                            {
                              variant: "control",
                              onClick: this.handleUtcOffsetPlus,
                              "aria-label": _48("Increase UTC offset by 30 minutes"),
                              children: "+"
                            }
                          ) })
                        ] }),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperText, { children: errors.utcOffset ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { variant: "error", icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ExclamationCircleIcon, {}), children: errors.utcOffset }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { children: _48("Format: \xB1HHMM (e.g., -0400, +0530)") }) })
                      ]
                    }
                  )
                ] }) }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Card, { className: "pf-v5-u-mb-xl pf-v5-u-box-shadow-sm-on-lg", isFlat: true, children: [
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CardHeader, { className: "pf-v5-u-background-color-100", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Title, { headingLevel: "h4", size: "md", children: _48("Thresholds") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CardBody, { className: "pf-v5-u-p-xl", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Grid, { hasGutter: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(GridItem, { span: 12, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
                    FormGroup,
                    {
                      label: _48("Lag Time (seconds)"),
                      fieldId: "lag-time",
                      labelIcon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                        Tooltip,
                        {
                          content: _48("Filter out entries with replication lag less than this value. Only show entries with lag times greater than or equal to this threshold."),
                          children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(InfoCircleIcon, {})
                        }
                      ),
                      className: "ds-margin-top",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          NumberInput,
                          {
                            id: "lagTimeLowest",
                            value: this.state.lagTimeLowest,
                            min: 0,
                            step: 0.1,
                            onMinus: () => this.handleNumberInputMinus("lagTimeLowest"),
                            onChange: (event) => this.handleNumberInputChange("lagTimeLowest", event),
                            onPlus: () => this.handleNumberInputPlus("lagTimeLowest"),
                            inputName: "lagTimeLowest",
                            inputAriaLabel: "Lag time threshold",
                            minusBtnAriaLabel: "Decrease lag time threshold",
                            plusBtnAriaLabel: "Increase lag time threshold"
                          }
                        ),
                        errors.lagTimeLowest && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { variant: "error", icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ExclamationCircleIcon, {}), children: errors.lagTimeLowest }) })
                      ]
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
                    FormGroup,
                    {
                      label: _48("ETime (seconds)"),
                      fieldId: "etime",
                      labelIcon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                        Tooltip,
                        {
                          content: _48("Filter out entries with execution time less than this value. ETime is the time taken by the server to process an operation."),
                          children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(InfoCircleIcon, {})
                        }
                      ),
                      className: "ds-margin-top",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          NumberInput,
                          {
                            id: "etimeLowest",
                            value: this.state.etimeLowest,
                            min: 0,
                            step: 0.1,
                            onMinus: () => this.handleNumberInputMinus("etimeLowest"),
                            onChange: (event) => this.handleNumberInputChange("etimeLowest", event),
                            onPlus: () => this.handleNumberInputPlus("etimeLowest"),
                            inputName: "etimeLowest",
                            inputAriaLabel: "Etime threshold",
                            minusBtnAriaLabel: "Decrease etime threshold",
                            plusBtnAriaLabel: "Increase etime threshold"
                          }
                        ),
                        errors.etimeLowest && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { variant: "error", icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ExclamationCircleIcon, {}), children: errors.etimeLowest }) })
                      ]
                    }
                  )
                ] }) }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Card, { className: "pf-v5-u-mb-xl pf-v5-u-box-shadow-sm-on-lg", isFlat: true, children: [
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CardHeader, { className: "pf-v5-u-background-color-100", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Title, { headingLevel: "h4", size: "md", children: _48("Report Output") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CardBody, { className: "pf-v5-u-p-xl", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Grid, { hasGutter: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(GridItem, { span: 12, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
                    FormGroup,
                    {
                      label: _48("Analysis Precision"),
                      fieldId: "analysis-precision",
                      className: "ds-margin-top-lg",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "ds-margin-top-sm" }),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          Radio,
                          {
                            id: "precisionFast",
                            name: "analysisPrecision",
                            label: _48("Fast (preview, sampled)"),
                            isChecked: analysisPrecision === "fast",
                            onChange: () => this.handlePrecisionChange("fast"),
                            description: _48("Quick preview using sampling for large datasets"),
                            className: "pf-v5-u-mb-md"
                          }
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          Radio,
                          {
                            id: "precisionBalanced",
                            name: "analysisPrecision",
                            label: _48("Balanced (default)"),
                            isChecked: analysisPrecision === "balanced",
                            onChange: () => this.handlePrecisionChange("balanced"),
                            description: _48("Good balance between speed and precision"),
                            className: "pf-v5-u-mb-md"
                          }
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          Radio,
                          {
                            id: "precisionFull",
                            name: "analysisPrecision",
                            label: _48("Full Precision (slower)"),
                            isChecked: analysisPrecision === "full",
                            onChange: () => this.handlePrecisionChange("full"),
                            description: _48("Process all points without sampling (note: very large datasets may still be auto-sampled for performance; use time range or suffix filters to reduce data volume)")
                          }
                        )
                      ]
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
                    FormGroup,
                    {
                      label: _48("Report Format"),
                      isRequired: true,
                      fieldId: "report-format",
                      className: "ds-margin-top-lg",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "ds-margin-top-sm" }),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          Checkbox,
                          {
                            id: "formatJson",
                            isChecked: formatOptions.json,
                            isDisabled: false,
                            label: _48("Interactive Charts and JSON"),
                            onChange: () => this.handleFormatOptionChange("json"),
                            className: "pf-v5-u-mb-md"
                          }
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          Tooltip,
                          {
                            content: !this.state.isReplReportsPackageInstalled ? _48("The python3-lib389-repl-reports package must be installed to use this format") : null,
                            trigger: this.state.isReplReportsPackageInstalled ? "manual" : "mouseenter",
                            children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                              Checkbox,
                              {
                                id: "formatHtml",
                                isChecked: formatOptions.html,
                                isDisabled: !this.state.isReplReportsPackageInstalled,
                                label: _48("Standalone HTML report"),
                                onChange: () => this.handleFormatOptionChange("html"),
                                className: "pf-v5-u-mb-md"
                              }
                            )
                          }
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          Tooltip,
                          {
                            content: !this.state.isReplReportsPackageInstalled ? _48("The python3-lib389-repl-reports package must be installed to use this format") : null,
                            trigger: this.state.isReplReportsPackageInstalled ? "manual" : "mouseenter",
                            children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                              Checkbox,
                              {
                                id: "formatPng",
                                isChecked: formatOptions.png,
                                isDisabled: !this.state.isReplReportsPackageInstalled,
                                label: _48("PNG image"),
                                onChange: () => this.handleFormatOptionChange("png"),
                                className: "pf-v5-u-mb-md"
                              }
                            )
                          }
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          Checkbox,
                          {
                            id: "formatCsv",
                            isChecked: formatOptions.csv,
                            label: _48("CSV data"),
                            onChange: () => this.handleFormatOptionChange("csv")
                          }
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperText, { children: errors.formatOptions ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { variant: "error", icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ExclamationCircleIcon, {}), children: errors.formatOptions }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
                          /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { children: _48("Select one or more report formats to generate") }),
                          !this.state.isReplReportsPackageInstalled && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { variant: "indeterminate", icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(InfoCircleIcon, {}), children: _48("Install the python3-lib389-repl-reports package to enable HTML and PNG report formats") })
                        ] }) })
                      ]
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
                    FormGroup,
                    {
                      label: _48("Output Location"),
                      fieldId: "output-location",
                      className: "ds-margin-top-lg",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "ds-margin-top-sm" }),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          Checkbox,
                          {
                            id: "use-custom-output",
                            label: _48("Use custom output directory"),
                            description: _48("Choose where to save generated reports"),
                            isChecked: this.state.useCustomOutputDir,
                            onChange: (_113, checked) => this.handleUseCustomOutputDirChange(checked),
                            className: "pf-v5-u-mb-md"
                          }
                        ),
                        this.state.useCustomOutputDir && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(InputGroup, { children: [
                          /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                            TextInput,
                            {
                              id: "custom-output-dir",
                              value: this.state.customOutputDir,
                              "aria-label": _48("Custom output directory"),
                              placeholder: _48("Enter output directory path"),
                              onChange: this.handleCustomOutputDirChange
                            }
                          ),
                          /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                            Button,
                            {
                              variant: "control",
                              onClick: this.selectOutputDirectory,
                              "aria-label": _48("Browse for output directory"),
                              children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(FolderOpenIcon, {})
                            }
                          )
                        ] }),
                        this.state.useCustomOutputDir && errors.customOutputDir && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { variant: "error", icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ExclamationCircleIcon, {}), children: errors.customOutputDir }) }),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { children: this.state.useCustomOutputDir ? _48("Reports will be saved to subdirectories inside this parent directory") : _48("Reports will be saved to a temporary directory and can be downloaded when ready") }) })
                      ]
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
                    FormGroup,
                    {
                      label: _48("Report Name"),
                      fieldId: "report-name",
                      className: "ds-margin-top-lg",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          TextInput,
                          {
                            id: "report-name",
                            value: this.state.reportName,
                            "aria-label": _48("Report name"),
                            placeholder: _48("Enter custom report name (optional)"),
                            onChange: this.handleReportNameChange
                          }
                        ),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { children: _48("A custom name for the report. If left blank, the current timestamp will be used.") }) })
                      ]
                    }
                  )
                ] }) }) })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Grid, { className: "pf-v5-u-mt-xl pf-v5-u-p-lg ds-margin-bottom-md", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(GridItem, { span: 12, className: "pf-v5-u-text-align-center", children: [
              /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "pf-v5-u-display-flex pf-v5-u-justify-content-center pf-v5-u-align-items-center pf-v5-u-my-xl", children: [
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                  Button,
                  {
                    variant: "primary",
                    type: "submit",
                    id: "generate-report-btn",
                    isDisabled: !formIsValid || isGeneratingReport,
                    isLoading: isGeneratingReport,
                    spinnerAriaValueText: isGeneratingReport ? "Generating" : void 0,
                    className: "pf-v5-u-mr-md",
                    size: "lg",
                    children: isGeneratingReport ? _48("Generating...") : _48("Generate Report")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                  Button,
                  {
                    variant: "secondary",
                    id: "choose-existing-report-btn",
                    onClick: this.openChooseLagReportModal,
                    size: "lg",
                    children: _48("View Existing Report")
                  }
                )
              ] }),
              reportError2 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                Alert,
                {
                  variant: "danger",
                  title: _48("Error generating report"),
                  className: "pf-v5-u-mt-xl",
                  isInline: true,
                  children: reportError2.split("\n").map((line, idx) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
                    line,
                    /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("br", {})
                  ] }, idx))
                }
              )
            ] }) })
          ] }) }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: this.state.fileBrowserPurpose === "outputDir" ? _48("Select Output Directory") : _48("Select Log Directory"),
            isOpen: showFileBrowser,
            onClose: this.closeFileBrowser,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Button, { variant: "link", onClick: this.closeFileBrowser, children: _48("Cancel") }, "cancel"),
              /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                Button,
                {
                  variant: "secondary",
                  onClick: () => this.addDirectory(currentPath),
                  isDisabled: !currentPath,
                  children: this.state.fileBrowserPurpose === "outputDir" ? _48("Select This Directory") : _48("Add Current Directory")
                },
                "select-current"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.addSelectedDirectories,
                  isDisabled: selectedDirectories.length === 0,
                  children: this.state.fileBrowserPurpose === "outputDir" ? _48("Select Directory") : selectedDirectories.length > 0 ? cockpit_default.format(_48("Add Selected ($0)"), selectedDirectories.length) : _48("Add Selected")
                },
                "select-multiple"
              )
            ],
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "pf-v5-u-mb-lg", children: [
                /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Split, { hasGutter: true, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SplitItem, { isFilled: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                    TextInput,
                    {
                      value: currentPath,
                      type: "text",
                      "aria-label": "Current path",
                      ref: this.pathInputRef,
                      onChange: this.handlePathInputChange,
                      onKeyDown: (e) => {
                        if (e.key === "Enter" || e.key === " ") {
                          this.browseDirectory(this.state.currentPath);
                        }
                      },
                      placeholder: _48("Type a directory path and press Enter or click Go")
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SplitItem, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                    Button,
                    {
                      variant: "secondary",
                      onClick: () => this.browseDirectory(currentPath),
                      "aria-label": _48("Go to path"),
                      children: _48("Go")
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SplitItem, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                    Button,
                    {
                      variant: "secondary",
                      onClick: this.navigateUp,
                      "aria-label": _48("Navigate up"),
                      children: _48("Up")
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperText, { className: "pf-v5-u-mt-sm", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HelperTextItem, { children: this.state.fileBrowserPurpose === "outputDir" ? _48("Select a parent directory where report subdirectories will be created") : _48("Type a path directly or browse using the directory view below") }) })
              ] }),
              isLoading ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Bullseye, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Spinner, { size: "xl" }) }) : browsingError ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                Alert,
                {
                  variant: "danger",
                  title: _48("Error browsing directory"),
                  isInline: true,
                  children: browsingError
                }
              ) : directoryContents.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(EmptyState, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(EmptyStateIcon, { icon: FolderOpenIcon }),
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Title, { headingLevel: "h4", size: "md", children: _48("No subdirectories found") }),
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(EmptyStateBody, { children: _48("This directory does not contain any subdirectories") })
              ] }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
                this.state.fileBrowserPurpose !== "outputDir" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "pf-v5-u-mb-md", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                  Checkbox,
                  {
                    id: "select-all-dirs",
                    label: _48("Select All"),
                    isChecked: selectedDirectories.length === directoryContents.length && directoryContents.length > 0,
                    onChange: (checked) => this.selectAllDirectories(checked)
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SimpleList, { "aria-label": "Directory contents", className: "pf-v5-u-mb-md", children: directoryContents.map((dir, index) => {
                  const isSelected = selectedDirectories.includes(dir);
                  const dirName = dir.split("/").pop();
                  return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                    SimpleListItem,
                    {
                      className: "pf-v5-u-mt-xs",
                      children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Split, { hasGutter: true, children: [
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SplitItem, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                          Checkbox,
                          {
                            id: `dir-checkbox-${index}`,
                            "aria-label": `Select ${dirName}`,
                            isChecked: isSelected,
                            onChange: (_113, checked) => this.toggleDirectorySelection(dir, checked)
                          }
                        ) }),
                        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SplitItem, { isFilled: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
                          "span",
                          {
                            onClick: () => this.browseDirectory(dir),
                            role: "button",
                            tabIndex: 0,
                            onKeyDown: (e) => {
                              if (e.key === "Enter" || e.key === " ") {
                                this.browseDirectory(dir);
                              }
                            },
                            style: { cursor: "pointer", color: "#0066CC" },
                            children: [
                              /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(FolderIcon, { className: "pf-v5-u-mr-sm" }),
                              " ",
                              dirName
                            ]
                          }
                        ) })
                      ] })
                    },
                    index
                  );
                }) })
              ] })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
          LagReportModal,
          {
            showModal: showLagReportModal,
            closeHandler: this.closeLagReportModal,
            reportUrls
          }
        ),
        this.state.showChooseLagReportModal && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
          ChooseLagReportModal,
          {
            showing: this.state.showChooseLagReportModal,
            onClose: this.closeChooseLagReportModal,
            reportDirectory: this.state.customOutputDir ? this.state.customOutputDir : "/tmp",
            addNotification: this.props.addNotification
          }
        )
      ] });
    }
  };
  ReplLogAnalysis.propTypes = {
    serverId: import_prop_types47.default.string,
    addNotification: import_prop_types47.default.func,
    enableTree: import_prop_types47.default.func,
    handleReload: import_prop_types47.default.func,
    replicatedSuffixes: import_prop_types47.default.array,
    toggleLoadingPage: import_prop_types47.default.func
  };
  ReplLogAnalysis.defaultProps = {
    serverId: "",
    replicatedSuffixes: [],
    toggleLoadingPage: () => {
    }
  };
  var replLogAnalysis_default = ReplLogAnalysis;

  // src/lib/monitor/replMonitor.jsx
  var import_react119 = __toESM(require_react(), 1);
  var import_prop_types48 = __toESM(require_prop_types(), 1);
  var import_trash_alt_icon2 = __toESM(require_trash_alt_icon(), 1);
  var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1);
  var _49 = cockpit_default.gettext;
  var ReplMonitor = class extends import_react119.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeKey: 0,
        activeConfigKey: 0,
        logData: "",
        showBindModal: false,
        showLogModal: false,
        showFullReportModal: false,
        showReportLoginModal: false,
        showCredentialsModal: false,
        showAliasesModal: false,
        loadingDSRC: false,
        modalSpinning: false,
        modalChecked: false,
        lagAgmts: [],
        credsData: [],
        aliasData: [],
        reportData: [],
        agmt: "",
        binddn: "cn=Directory Manager",
        bindpw: "",
        errObj: {},
        aliasList: [],
        newEntry: false,
        initCreds: true,
        isExpanded: false,
        fullReportProcess: {},
        interruptLoginCredsInput: false,
        doFullReportCleanup: false,
        reportRefreshing: false,
        reportLoading: false,
        // dsrc
        credRows: [...this.props.credRows],
        aliasRows: [...this.props.aliasRows],
        showAddDSRCCredModal: false,
        showAddDSRCAliasModal: false,
        showConfirmDeleteDSRCCred: false,
        showConfirmDeleteDSRCAlias: false,
        showConfirmOverwriteDSRC: false,
        deleteConn: "",
        deleteAlias: "",
        credsInstanceName: "",
        disableBinddn: false,
        loginBinddn: "",
        loginBindpw: "",
        inputLoginData: false,
        credsHostname: "",
        credsPort: 389,
        credsBinddn: "cn=Directory Manager",
        credsBindpw: "",
        pwInputInteractive: false,
        aliasHostname: "",
        aliasPort: 389,
        aliasName: "",
        credentialsList: [],
        dynamicCredentialsList: [],
        credSortBy: {},
        aliasesList: [],
        aliasSortBy: {}
      };
      this.handleToggle = (_event, isExpanded) => {
        this.setState({
          isExpanded
        });
      };
      this.maxValue = 65534;
      this.onFieldChange = this.onFieldChange.bind(this);
      this.handleNavConfigSelect = this.handleNavConfigSelect.bind(this);
      this.showAgmtModalRemote = this.showAgmtModalRemote.bind(this);
      this.closeAgmtModal = this.closeAgmtModal.bind(this);
      this.closeReportLoginModal = this.closeReportLoginModal.bind(this);
      this.addCreds = this.addCreds.bind(this);
      this.editCreds = this.editCreds.bind(this);
      this.removeCreds = this.removeCreds.bind(this);
      this.openCredsModal = this.openCredsModal.bind(this);
      this.handleShowAddCredsModal = this.handleShowAddCredsModal.bind(this);
      this.showEditCredsModal = this.showEditCredsModal.bind(this);
      this.closeCredsModal = this.closeCredsModal.bind(this);
      this.handleCredSort = this.handleCredSort.bind(this);
      this.handleNavSelect = this.handleNavSelect.bind(this);
      this.addAliases = this.addAliases.bind(this);
      this.editAliases = this.editAliases.bind(this);
      this.removeAliases = this.removeAliases.bind(this);
      this.openAliasesModal = this.openAliasesModal.bind(this);
      this.handleShowAddAliasesModal = this.handleShowAddAliasesModal.bind(this);
      this.showEditAliasesModal = this.showEditAliasesModal.bind(this);
      this.closeAliasesModal = this.closeAliasesModal.bind(this);
      this.handleAliasSort = this.handleAliasSort.bind(this);
      this.handleFullReport = this.handleFullReport.bind(this);
      this.processCredsInput = this.processCredsInput.bind(this);
      this.closeReportModal = this.closeReportModal.bind(this);
      this.refreshFullReport = this.refreshFullReport.bind(this);
      this.handleMinusConfig = this.handleMinusConfig.bind(this);
      this.handleConfigChange = this.handleConfigChange.bind(this);
      this.handlePlusConfig = this.handlePlusConfig.bind(this);
      this.loadDSRC = this.loadDSRC.bind(this);
      this.handleShowAddDSRCCred = this.handleShowAddDSRCCred.bind(this);
      this.handleShowAddDSRCAlias = this.handleShowAddDSRCAlias.bind(this);
      this.closeAddDSRCCred = this.closeAddDSRCCred.bind(this);
      this.closeAddDSRCAlias = this.closeAddDSRCAlias.bind(this);
      this.addDSRCCred = this.addDSRCCred.bind(this);
      this.addDSRCAlias = this.addDSRCAlias.bind(this);
      this.showConfirmDeleteDSRCCred = this.showConfirmDeleteDSRCCred.bind(this);
      this.showConfirmDeleteDSRCAlias = this.showConfirmDeleteDSRCAlias.bind(this);
      this.handleConfirmOverwriteDSRC = this.handleConfirmOverwriteDSRC.bind(this);
      this.closeConfirmDeleteDSRCCred = this.closeConfirmDeleteDSRCCred.bind(this);
      this.closeConfirmDeleteDSRCAlias = this.closeConfirmDeleteDSRCAlias.bind(this);
      this.closeConfirmOverwriteDSRC = this.closeConfirmOverwriteDSRC.bind(this);
      this.deleteDSRCCred = this.deleteDSRCCred.bind(this);
      this.deleteDSRCAlias = this.deleteDSRCAlias.bind(this);
      this.getAliasDeleteButton = this.getAliasDeleteButton.bind(this);
      this.getCredDeleteButton = this.getCredDeleteButton.bind(this);
      this.overwriteDSRC = this.overwriteDSRC.bind(this);
    }
    componentDidUpdate(prevProps, prevState) {
      if (!prevState.showReportLoginModal && this.state.showReportLoginModal) {
        if (this.timer) window.clearTimeout(this.timer);
        this.timer = window.setTimeout(() => {
          this.setState({
            showFullReportModal: false
          });
          this.timer = null;
        }, 300);
      }
      if (prevState.showReportLoginModal && !this.state.showReportLoginModal) {
        if (this.timer) window.clearTimeout(this.timer);
      }
    }
    componentWillUnmount() {
      if (this.timer) window.clearTimeout(this.timer);
    }
    loadDSRC() {
      this.setState({
        loadingDSRC: true
      });
      const dsrc_cmd = ["dsctl", "-j", this.props.serverId, "dsrc", "display"];
      log_cmd("loadDSRC", "Check for replication monitor configurations in the .dsrc file", dsrc_cmd);
      cockpit_default.spawn(dsrc_cmd, { superuser: true, err: "message" }).done((dsrc_content) => {
        const content = JSON.parse(dsrc_content);
        const credRows = [];
        const aliasRows = [];
        if ("repl-monitor-connections" in content) {
          const report_config = content["repl-monitor-connections"];
          for (const [connection, value] of Object.entries(report_config)) {
            const conn = connection + ":" + value;
            credRows.push(conn.split(":"));
          }
        }
        if ("repl-monitor-aliases" in content) {
          const report_config = content["repl-monitor-aliases"];
          for (const [alias_name, value] of Object.entries(report_config)) {
            const alias = alias_name + ":" + value;
            aliasRows.push(alias.split(":"));
          }
        }
        this.setState({
          credRows,
          aliasRows,
          loadingDSRC: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        console.log(`loadDSRC: Could not load .dsrc file: ${errMsg}`);
        this.setState({
          loadingDSRC: false
        });
      });
    }
    componentDidMount() {
      if (this.state.initCreds) {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "config",
          "get",
          "nsslapd-port",
          "nsslapd-localhost",
          "nsslapd-rootdn"
        ];
        log_cmd("ReplMonitor", "add credentials during componentDidMount", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          const config = JSON.parse(content);
          this.setState((prevState) => ({
            credentialsList: [
              ...prevState.credentialsList,
              {
                connData: `${config.attrs["nsslapd-localhost"][0]}:${config.attrs["nsslapd-port"][0]}`,
                credsBinddn: config.attrs["nsslapd-rootdn"][0],
                credsBindpw: "",
                pwInputInteractive: true
              }
            ],
            credRows: [...this.props.credRows],
            aliasRows: [...this.props.aliasRows]
          }));
          if ("replAgmts" in this.props.data) {
            for (const agmt of this.props.data.replAgmts) {
              this.setState((prevState) => ({
                credentialsList: [
                  ...prevState.credentialsList,
                  {
                    connData: `${agmt.replica}`,
                    credsBinddn: config.attrs["nsslapd-rootdn"][0],
                    credsBindpw: "",
                    pwInputInteractive: true
                  }
                ],
                initCreds: false
              }));
            }
          }
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.addNotification(
            "error",
            cockpit_default.format(_49("Failed to get config nsslapd-port, nsslapd-localhost and nasslapd-rootdn: $0"), errMsg)
          );
        });
      }
      this.props.enableTree();
    }
    handleMinusConfig(id) {
      this.setState({
        [id]: Number(this.state[id]) - 1
      });
    }
    handleConfigChange(event, id, min3) {
      const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
      this.setState({
        [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
      });
    }
    handlePlusConfig(id) {
      this.setState({
        [id]: Number(this.state[id]) + 1
      });
    }
    handleChange(value, evt) {
      if (evt.target.type === "number") {
        if (value) {
          value = parseInt(value);
        } else {
          value = 1;
        }
      }
      this.setState({
        [evt.target.id]: value
      });
    }
    onFieldChange(e) {
      let value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      if (e.target.type === "number") {
        if (e.target.value) {
          value = parseInt(e.target.value);
        } else {
          value = 1;
        }
      }
      this.setState({
        [e.target.id]: value
      });
    }
    handleNavSelect(event, tabIndex) {
      this.setState({
        activeKey: tabIndex
      });
    }
    handleNavConfigSelect(event, tabIndex) {
      this.setState({
        activeConfigKey: tabIndex
      });
    }
    getCredDeleteButton(name2) {
      return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("a", { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
        import_trash_alt_icon2.TrashAltIcon,
        {
          className: "ds-center",
          onClick: () => {
            this.showConfirmDeleteDSRCCred(name2);
          },
          title: _49("Delete replica connection")
        }
      ) });
    }
    getAliasDeleteButton(name2) {
      return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("a", { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
        import_trash_alt_icon2.TrashAltIcon,
        {
          className: "ds-center",
          onClick: () => {
            this.showConfirmDeleteDSRCAlias(name2);
          },
          title: _49("Delete replica alias")
        }
      ) });
    }
    closeLogModal() {
      this.setState({
        showLogModal: false
      });
    }
    showAgmtModalRemote(supplierName, replicaName, agmtName) {
      if (!agmtName) {
        this.props.addNotification(
          "error",
          _49("The agreement doesn't exist!")
        );
      } else {
        for (const supplier of this.state.reportData) {
          if (supplier.name === supplierName) {
            for (const replica of supplier.data) {
              if (`${replica.replica_root}:${replica.replica_id}` === replicaName) {
                for (const agmt of replica.agmts_status) {
                  if (agmt["agmt-name"][0] === agmtName) {
                    this.setState({
                      showAgmtModal: true,
                      agmt
                    });
                    break;
                  }
                }
              }
            }
          }
        }
      }
    }
    closeAgmtModal() {
      this.setState({
        showAgmtModal: false
      });
    }
    changeCreds(action) {
      const {
        credentialsList,
        oldCredsHostname,
        oldCredsPort,
        credsHostname,
        credsPort,
        credsBinddn,
        credsBindpw,
        pwInputInteractive
      } = this.state;
      if (credsHostname === "" || credsPort === "" || credsBinddn === "") {
        this.props.addNotification("warning", _49("Host, Port, and Bind DN are required."));
      } else if (credsBindpw === "" && !pwInputInteractive) {
        this.props.addNotification("warning", _49("Password field can't be empty, if Interactive Input is not selected"));
      } else {
        let credsExist = false;
        if (action === "add" && credentialsList.some((row) => row.connData === `${credsHostname}:${credsPort}`)) {
          credsExist = true;
        }
        if (action === "edit" && credentialsList.some((row) => row.connData === `${oldCredsHostname}:${oldCredsPort}`)) {
          this.setState({
            credentialsList: credentialsList.filter(
              (row) => row.connData !== `${oldCredsHostname}:${oldCredsPort}`
            )
          });
        }
        if (!credsExist) {
          this.setState((prevState) => ({
            credentialsList: [
              ...prevState.credentialsList,
              {
                connData: `${credsHostname}:${credsPort}`,
                credsBinddn,
                credsBindpw,
                pwInputInteractive
              }
            ]
          }));
        } else {
          this.props.addNotification(
            "error",
            cockpit_default.format(_49('Credentials "$0:$1" already exists'), credsHostname, credsPort)
          );
        }
        this.closeCredsModal();
      }
    }
    addCreds() {
      this.changeCreds("add");
    }
    editCreds() {
      this.changeCreds("edit");
    }
    removeCreds(connData) {
      this.setState({
        credentialsList: this.state.credentialsList.filter(
          (row) => row.connData !== connData
        )
      });
    }
    openCredsModal() {
      this.setState({
        showCredentialsModal: true
      });
    }
    handleShowAddCredsModal() {
      this.openCredsModal();
      this.setState({
        newEntry: true,
        oldCredsHostname: "",
        oldCredsPort: "",
        credsHostname: "",
        credsPort: 389,
        credsBinddn: "cn=Directory Manager",
        credsBindpw: "",
        pwInputInteractive: false
      });
    }
    showEditCredsModal(connData, bindDN, bindPW, pwInteractive) {
      this.openCredsModal();
      this.setState({
        newEntry: false,
        oldCredsHostname: connData.split(":")[0],
        oldCredsPort: connData.split(":")[1],
        credsHostname: connData.split(":")[0],
        credsPort: parseInt(connData.split(":")[1]),
        credsBinddn: bindDN,
        credsBindpw: bindPW,
        pwInputInteractive: pwInteractive
      });
    }
    closeCredsModal() {
      this.setState({
        showCredentialsModal: false
      });
    }
    handleCredSort(_event, index, direction) {
      const sorted_creds = [];
      const rows = [];
      for (const row of this.state.credentialsList) {
        sorted_creds.push({
          1: row.connData,
          2: row.credsBinddn,
          3: row.credsBindpw,
          4: row.pwInputInteractive
        });
      }
      sorted_creds.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_creds.reverse();
      }
      for (const cred of sorted_creds) {
        rows.push({
          connData: cred["1"],
          credsBinddn: cred["2"],
          credsBindpw: cred["3"],
          pwInputInteractive: cred["4"]
        });
      }
      this.setState({
        credSortBy: {
          index,
          direction
        },
        credentialsList: rows
      });
    }
    handleAliasSort(_event, index, direction) {
      const sorted_alias = [];
      const rows = [];
      for (const row of this.state.aliasesList) {
        sorted_alias.push({
          1: row[0],
          2: row[1]
        });
      }
      sorted_alias.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_alias.reverse();
      }
      for (const alias of sorted_alias) {
        rows.push([alias["1"], alias["2"]]);
      }
      this.setState({
        aliasSortBy: {
          index,
          direction
        },
        aliasesList: rows
      });
    }
    changeAlias(action) {
      const { aliasesList, aliasHostname, aliasPort, oldAliasName, aliasName } = this.state;
      let new_aliases = [...aliasesList];
      if (aliasPort === "" || aliasHostname === "" || aliasName === "") {
        this.props.addNotification("warning", _49("Host, Port, and Alias are required."));
      } else {
        let aliasExists = false;
        if (action === "add" && aliasesList.some((row) => row[0] === aliasName)) {
          aliasExists = true;
        }
        if (action === "edit" && aliasesList.some((row) => row[0] === oldAliasName)) {
          new_aliases = aliasesList.filter((row) => row[0] !== oldAliasName);
        }
        if (!aliasExists) {
          const connData = `${aliasHostname}:${aliasPort}`;
          new_aliases.push([aliasName, connData]);
          this.setState({
            aliasesList: new_aliases
          });
        } else {
          this.props.addNotification("error", cockpit_default.format(_49('Alias "$0" already exists'), aliasName));
        }
        this.closeAliasesModal();
      }
    }
    addAliases() {
      this.changeAlias("add");
    }
    editAliases() {
      this.changeAlias("edit");
    }
    removeAliases(alias) {
      this.setState({
        aliasesList: this.state.aliasesList.filter((row) => row[0] !== alias)
      });
    }
    openAliasesModal() {
      this.setState({
        showAliasesModal: true
      });
    }
    handleShowAddAliasesModal() {
      this.openAliasesModal();
      this.setState({
        newEntry: true,
        aliasHostname: "",
        aliasPort: 389,
        oldAliasName: "",
        aliasName: ""
      });
    }
    showEditAliasesModal(alias, connData) {
      this.openAliasesModal();
      this.setState({
        newEntry: false,
        aliasHostname: connData.split(":")[0],
        aliasPort: parseInt(connData.split(":")[1]),
        oldAliasName: alias,
        aliasName: alias
      });
    }
    closeAliasesModal() {
      this.setState({
        showAliasesModal: false
      });
    }
    handleConfirmOverwriteDSRC() {
      this.setState({
        showConfirmOverwriteDSRC: true
      });
    }
    closeConfirmOverwriteDSRC() {
      this.setState({
        showConfirmOverwriteDSRC: false
      });
    }
    overwriteDSRC() {
      const dsrc_cmd = ["dsctl", "-j", this.props.serverId, "dsrc", "display"];
      log_cmd("overwriteDSRC", "gather conns and aliases from .dsrc file", dsrc_cmd);
      cockpit_default.spawn(dsrc_cmd, { superuser: true, err: "message" }).done((dsrc_content) => {
        const content = JSON.parse(dsrc_content);
        const dsrcCreds = [];
        const dsrcAliases = [];
        let deleteCmd = ["dsctl", "-j", this.props.serverId, "dsrc", "repl-mon"];
        const addCmd = ["dsctl", "-j", this.props.serverId, "dsrc", "repl-mon"];
        if ("repl-monitor-connections" in content) {
          const report_config = content["repl-monitor-connections"];
          for (const [cred] of Object.entries(report_config)) {
            dsrcCreds.push(cred);
          }
        }
        if ("repl-monitor-aliases" in content) {
          const report_config = content["repl-monitor-aliases"];
          for (const [alias] of Object.entries(report_config)) {
            dsrcAliases.push(alias);
          }
        }
        if (this.state.credentialsList.length > 0 && dsrcCreds.length > 0) {
          deleteCmd.push("--del-conn");
          for (const repl of dsrcCreds) {
            deleteCmd.push(repl);
          }
        }
        if (this.state.aliasesList.length > 0 && dsrcAliases.length > 0) {
          deleteCmd.push("--del-alias");
          for (const alias of dsrcAliases) {
            deleteCmd.push(alias);
          }
        }
        if (deleteCmd.length === 5) {
          deleteCmd = "echo";
        }
        if (this.state.credentialsList.length > 0) {
          addCmd.push("--add-conn");
          for (const rowIdx in this.state.credentialsList) {
            const row = this.state.credentialsList[rowIdx];
            let password = row.credsBindpw;
            if (row.pwInputInteractive) {
              password = "*";
            }
            const idx = parseInt(rowIdx) + 1;
            const cred = `replica_${idx}:${row.connData}:${row.credsBinddn}:${password}`;
            addCmd.push(cred);
          }
        }
        if (this.state.aliasesList.length > 0) {
          addCmd.push("--add-alias");
          for (const row of this.state.aliasesList) {
            const alias = `${row[0]}:${row[1]}`;
            addCmd.push(alias);
          }
        }
        log_cmd("overwriteDSRC", "delete conns and aliases in the .dsrc file", deleteCmd);
        cockpit_default.spawn(deleteCmd, { superuser: true, err: "message" }).done(() => {
          log_cmd("overwriteDSRC", "add conns and aliases in the .dsrc file", addCmd);
          cockpit_default.spawn(addCmd, { superuser: true, err: "message" }).done(() => {
            this.setState({
              showConfirmOverwriteDSRC: false
            }, this.loadDSRC);
            this.props.addNotification(
              "success",
              _49("Successfully saved monitor configuration to the .dsrc file")
            );
          }).fail((err) => {
            const errMsg = getApiErrorMessage(err);
            this.setState({
              showConfirmOverwriteDSRC: false
            });
            this.props.addNotification(
              "error",
              cockpit_default.format(_49("Failed to delete from .dsrc file: $0"), errMsg)
            );
          });
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.addNotification(
            "error",
            cockpit_default.format(_49("Failed to add to .dsrc content: $0"), errMsg)
          );
          this.setState({
            showConfirmOverwriteDSRC: false
          });
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_49("Failed to get .dsrc content: $0"), errMsg)
        );
        this.setState({
          showConfirmOverwriteDSRC: false
        });
      });
    }
    refreshFullReport() {
      this.handleFullReport();
      this.setState({
        reportRefreshing: true
      });
    }
    handleFullReport(dsrc) {
      this.setState({
        reportLoading: true,
        activeKey: 2
      });
      let password = "";
      const credentials = [];
      const printCredentials = [];
      const aliases = [];
      if (dsrc) {
        for (const row of this.state.credRows) {
          credentials.push(`${row[1]}:${row[2]}:${row[3]}:${row[4]}`);
          printCredentials.push(`${row[1]}:${row[2]}:${row[3]}:********`);
        }
        for (const row of this.state.aliasRows) {
          aliases.push(`${row[0]}=${row[1]}:${row[2]}`);
        }
      } else {
        for (const row of this.state.credentialsList) {
          if (row.pwInputInteractive) {
            password = "*";
          } else {
            password = `${row.credsBindpw}`;
          }
          credentials.push(`${row.connData}:${row.credsBinddn}:${password}`);
          printCredentials.push(`${row.connData}:${row.credsBinddn}:********`);
        }
        for (const row of this.state.aliasesList) {
          aliases.push(`${row[0]}=${row[1]}`);
        }
      }
      let buffer = "";
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "monitor"
      ];
      if (aliases.length !== 0) {
        cmd = [...cmd, "-a"];
        for (const value of aliases) {
          cmd = [...cmd, value];
        }
      }
      let printCmd = cmd;
      if (credentials.length !== 0) {
        cmd = [...cmd, "-c"];
        for (const value of credentials) {
          cmd = [...cmd, value];
        }
        printCmd = [...printCmd, "-c"];
        for (const value of printCredentials) {
          printCmd = [...printCmd, value];
        }
      }
      log_cmd("handleFullReport", "Get the report for the current instance topology", printCmd);
      const proc = cockpit_default.spawn(cmd, { pty: true, environ: ["LC_ALL=C"], superuser: true, err: "message", directory: self.path });
      this.setState({
        fullReportProcess: proc
      });
      proc.done((data) => {
        const report = JSON.parse(buffer);
        let agmts_reparsed = [];
        let replica_reparsed = [];
        const supplier_reparsed = [];
        for (const supplier of report.items) {
          replica_reparsed = [];
          for (const replica of supplier.data) {
            agmts_reparsed = [];
            let agmts_done = false;
            if ("agmts_status" in replica) {
              for (const agmt of replica.agmts_status) {
                agmt.supplierName = [supplier.name];
                agmt.replicaName = [`${replica.replica_root}:${replica.replica_id}`];
                agmt.replicaStatus = [`${replica.replica_status}`];
                agmt.rowKey = [`${supplier.name}:${replica.replica_root}:${replica.replica_id}:${agmt["agmt-name"]}`];
                agmts_reparsed.push(agmt);
                agmts_done = true;
              }
            }
            if (!agmts_done) {
              const agmt_empty = {};
              agmt_empty.supplierName = [supplier.name];
              if (replica.replica_root || replica.replica_id) {
                agmt_empty.replicaName = [`${replica.replica_root || ""}:${replica.replica_id || ""}`];
              } else {
                agmt_empty.replicaName = [""];
              }
              agmt_empty.replicaStatus = [`${replica.replica_status}`];
              agmt_empty.rowKey = [`${supplier.name}:${replica.replica_root}:${replica.replica_id}:None`];
              agmts_reparsed.push(agmt_empty);
            }
            replica_reparsed.push({ ...replica, agmts_status: agmts_reparsed });
          }
          supplier_reparsed.push({ ...supplier, data: replica_reparsed });
        }
        const report_reparsed = { ...report, items: supplier_reparsed };
        this.setState({
          reportData: report_reparsed.items,
          showFullReportModal: true,
          reportLoading: false,
          doFullReportCleanup: true
        });
      }).fail(() => {
        const errMsg = getApiErrorMessage(buffer);
        this.props.addNotification(
          "error",
          cockpit_default.format(_49("Sync report has failed - $0"), errMsg)
        );
        this.setState({
          dynamicCredentialsList: [],
          reportLoading: false,
          doFullReportCleanup: true,
          activeReportKey: 1
        });
      }).stream((data) => {
        buffer += data;
        const lines = buffer.split("\n");
        const last_line = lines[lines.length - 1];
        let found_creds = false;
        if (last_line.startsWith("Enter a bind DN") && last_line.endsWith(": ")) {
          buffer = "";
          this.setState({
            credsInstanceName: data.split("a bind DN for ")[1].split(": ")[0]
          });
          for (const creds of this.state.dynamicCredentialsList) {
            if (creds.credsInstanceName === this.state.credsInstanceName) {
              found_creds = true;
              proc.input(`${creds.binddn}
`, true);
            }
          }
          if (!found_creds) {
            this.setState({
              showReportLoginModal: true,
              binddnRequired: true,
              disableBinddn: false,
              credsInstanceName: this.state.credsInstanceName,
              loginBinddn: "",
              loginBindpw: ""
            });
          }
        } else if ((last_line.startsWith("Enter a password") || last_line.startsWith("File ")) && last_line.endsWith(": ")) {
          buffer = "";
          this.setState({
            credsInstanceName: data.split(" on ")[1].split(": ")[0]
          });
          for (const creds of this.state.dynamicCredentialsList) {
            if (creds.credsInstanceName === this.state.credsInstanceName) {
              found_creds = true;
              proc.input(`${creds.bindpw}
`, true);
              this.setState({
                credsInstanceName: ""
              });
            }
          }
          if (!found_creds) {
            this.setState({
              showReportLoginModal: true,
              bindpwRequired: true,
              credsInstanceName: this.state.credsInstanceName,
              disableBinddn: true,
              loginBinddn: data.split("nter a password for ")[1].split(" on")[0],
              loginBindpw: ""
            });
          }
        }
      });
    }
    closeReportLoginModal() {
      this.setState({
        showReportLoginModal: false,
        reportLoading: false,
        activeReportKey: 1
      });
    }
    processCredsInput() {
      const {
        loginBinddn,
        loginBindpw,
        credsInstanceName,
        fullReportProcess
      } = this.state;
      if (loginBinddn === "" || loginBindpw === "") {
        this.props.addNotification("warning", _49("Bind DN and password are required."));
      } else {
        this.setState({
          showReportLoginModal: false,
          reportLoading: false
        });
        this.setState((prevState) => ({
          dynamicCredentialsList: [
            ...prevState.dynamicCredentialsList,
            {
              binddn: loginBinddn,
              bindpw: loginBindpw,
              credsInstanceName
            }
          ]
        }));
        if (this.state.binddnRequired) {
          fullReportProcess.input(`${loginBinddn}
`, true);
          this.setState({
            binddnRequired: false
          });
        } else if (this.state.bindpwRequired) {
          fullReportProcess.input(loginBindpw + "\n", true);
          this.setState({
            bindpwRequired: false
          });
        }
      }
    }
    closeReportModal() {
      this.setState({
        showFullReportModal: false,
        reportLoading: false
      });
    }
    // dsrc
    handleShowAddDSRCCred() {
      this.setState({
        showAddDSRCCredModal: true,
        modalChecked: false,
        modalSpinning: false,
        connName: "",
        connHostname: "",
        connPort: 636,
        connBindDN: "",
        credsCred: ""
      });
    }
    closeAddDSRCCred() {
      this.setState({
        showAddDSRCCredModal: false
      });
    }
    handleShowAddDSRCAlias() {
      this.setState({
        showAddDSRCAliasModal: true,
        modalChecked: false,
        modalSpinning: false,
        newEntry: true,
        aliasName: "",
        aliasPort: 636,
        aliasHostname: ""
      });
    }
    closeAddDSRCAlias() {
      this.setState({
        showAddDSRCAliasModal: false
      });
    }
    showConfirmDeleteDSRCCred(name2) {
      this.setState({
        showConfirmDeleteDSRCCred: true,
        connName: name2,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmDeleteDSRCCred() {
      this.setState({
        showConfirmDeleteDSRCCred: false
      });
    }
    showConfirmDeleteDSRCAlias(name2) {
      this.setState({
        showConfirmDeleteDSRCAlias: true,
        aliasName: name2,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmDeleteDSRCAlias() {
      this.setState({
        showConfirmDeleteDSRCAlias: false
      });
    }
    deleteDSRCCred() {
      const dsrc_cmd = ["dsctl", "-j", this.props.serverId, "dsrc", "repl-mon", "--del-conn=" + this.state.connName];
      this.setState({
        loadingDSRC: true
      });
      log_cmd("deleteDSRCCred", "Delete a replica connection from the .dsrc file", dsrc_cmd);
      cockpit_default.spawn(dsrc_cmd, { superuser: true, err: "message" }).done(() => {
        this.loadDSRC();
        this.setState({
          showConfirmDeleteDSRCCred: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_49("Failed to update .dsrc information: $0"), errMsg)
        );
        this.loadDSRC();
      });
    }
    deleteDSRCAlias() {
      const dsrc_cmd = ["dsctl", "-j", this.props.serverId, "dsrc", "repl-mon", "--del-alias=" + this.state.aliasName];
      this.setState({
        loadingDSRC: true
      });
      log_cmd("deleteDSRCCred", "Delete a replication monitor alias from the .dsrc file", dsrc_cmd);
      cockpit_default.spawn(dsrc_cmd, { superuser: true, err: "message" }).done(() => {
        this.loadDSRC();
        this.setState({
          showConfirmDeleteDSRCAlias: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_49("Failed to update .dsrc information: $0"), errMsg)
        );
        this.loadDSRC();
      });
    }
    addDSRCCred() {
      const {
        connName,
        connHostname,
        connPort,
        connBindDN,
        connCred
      } = this.state;
      const conn = connName + ":" + connHostname + ":" + connPort + ":" + connBindDN + ":" + connCred;
      const dsrc_cmd = ["dsctl", "-j", this.props.serverId, "dsrc", "repl-mon", "--add-conn=" + conn];
      this.setState({
        loadingDSRC: true
      });
      log_cmd("addDSRCCred", "Add a replica connection to the .dsrc file", dsrc_cmd);
      cockpit_default.spawn(dsrc_cmd, { superuser: true, err: "message" }).done(() => {
        this.setState({
          showAddDSRCCredModal: false
        });
        this.props.addNotification(
          "success",
          _49("Successfully added connection to .dsrc config file")
        );
        this.loadDSRC();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_49("Failed to update .dsrc information: $0"), errMsg)
        );
        this.loadDSRC();
      });
    }
    addDSRCAlias() {
      const alias = this.state.aliasName + ":" + this.state.aliasHostname + ":" + this.state.aliasPort;
      const dsrc_cmd = ["dsctl", "-j", this.props.serverId, "dsrc", "repl-mon", "--add-alias=" + alias];
      this.setState({
        loadingDSRC: true
      });
      log_cmd("addDSRCAlias", "Add an alias to the .dsrc file", dsrc_cmd);
      cockpit_default.spawn(dsrc_cmd, { superuser: true, err: "message" }).done(() => {
        this.setState({
          showAddDSRCAliasModal: false
        });
        this.props.addNotification(
          "success",
          _49("Successfully added alias to .dsrc config file")
        );
        this.loadDSRC();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_49("Failed to update .dsrc information: $0"), errMsg)
        );
        this.loadDSRC();
      });
    }
    render() {
      const reportData = this.state.reportData;
      const credentialsList = this.state.credentialsList;
      const aliasesList = this.state.aliasesList;
      const fullReportModal = "";
      let reportLoginModal = "";
      let reportCredentialsModal = "";
      let reportAliasesModal = "";
      let agmtDetailModal = "";
      const winsyncAgmtDetailModal = "";
      if (this.state.showReportLoginModal) {
        reportLoginModal = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
          ReportLoginModal,
          {
            showModal: this.state.showReportLoginModal,
            closeHandler: this.closeReportLoginModal,
            handleChange: this.onFieldChange,
            processCredsInput: this.processCredsInput,
            instanceName: this.state.credsInstanceName,
            disableBinddn: this.state.disableBinddn,
            loginBinddn: this.state.loginBinddn,
            loginBindpw: this.state.loginBindpw
          }
        );
      }
      if (this.state.showCredentialsModal) {
        reportCredentialsModal = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
          ReportCredentialsModal,
          {
            showModal: this.state.showCredentialsModal,
            closeHandler: this.closeCredsModal,
            handleFieldChange: this.onFieldChange,
            onMinusConfig: this.handleMinusConfig,
            onConfigChange: this.handleConfigChange,
            onPlusConfig: this.handlePlusConfig,
            newEntry: this.state.newEntry,
            hostname: this.state.credsHostname,
            port: this.state.credsPort,
            binddn: this.state.credsBinddn,
            bindpw: this.state.credsBindpw,
            pwInputInteractive: this.state.pwInputInteractive,
            addConfig: this.addCreds,
            editConfig: this.editCreds
          }
        );
      }
      if (this.state.showAliasesModal) {
        reportAliasesModal = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
          ReportAliasesModal,
          {
            showModal: this.state.showAliasesModal,
            closeHandler: this.closeAliasesModal,
            handleFieldChange: this.onFieldChange,
            onMinusConfig: this.handleMinusConfig,
            onConfigChange: this.handleConfigChange,
            onPlusConfig: this.handlePlusConfig,
            newEntry: this.state.newEntry,
            hostname: this.state.aliasHostname,
            port: this.state.aliasPort,
            alias: this.state.aliasName,
            addConfig: this.addAliases,
            editConfig: this.editAliases
          }
        );
      }
      if (this.state.showAgmtModal) {
        agmtDetailModal = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
          AgmtDetailsModal,
          {
            showModal: this.state.showAgmtModal,
            closeHandler: this.closeAgmtModal,
            agmt: this.state.agmt
          }
        );
      }
      let reportBtnName = _49("Generate Report");
      const extraPrimaryProps = {};
      if (this.state.reportLoading) {
        reportBtnName = _49("Generating ...");
        extraPrimaryProps.spinnerAriaValueText = _49("Generating");
      }
      let reportContent = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "ds-margin-top-lg ds-indent ds-margin-bottom-md", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Tabs, { isFilled: true, activeKey: this.state.activeKey, onSelect: this.handleNavSelect, children: [
        /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TabTitleText, { children: _49("Saved Report Configuration") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Tabs, { className: "ds-margin-top-lg", isBox: true, activeKey: this.state.activeConfigKey, onSelect: this.handleNavConfigSelect, children: [
            /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TabTitleText, { children: _49("Replica Credentials") }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
                ReplDSRCTable,
                {
                  rows: this.state.credRows,
                  getDeleteButton: this.getCredDeleteButton
                },
                this.state.credRows
              ),
              /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
                Button,
                {
                  className: "ds-margin-top-lg",
                  variant: "secondary",
                  onClick: this.handleShowAddDSRCCred,
                  title: _49("Add a replica credential to the .dsrc file"),
                  children: _49("Add Connection")
                }
              )
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TabTitleText, { children: _49("Replica Naming Aliases") }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
                ReplDSRCAliasTable,
                {
                  rows: this.state.aliasRows,
                  getDeleteButton: this.getAliasDeleteButton
                },
                this.state.aliasRows
              ),
              /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
                Button,
                {
                  className: "ds-margin-top-lg",
                  variant: "secondary",
                  onClick: this.handleShowAddDSRCAlias,
                  title: _49("Add a replica alias to the .dsrc file"),
                  children: _49("Add Alias")
                }
              )
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("hr", {}),
          this.state.credRows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
            Button,
            {
              variant: "primary",
              onClick: () => {
                this.handleFullReport(1);
              },
              title: _49("Use the specified credentials and display full topology report"),
              isLoading: this.state.reportLoading,
              isDisabled: this.state.reportLoading,
              spinnerAriaValueText: this.state.reportLoading ? _49("Generating") : void 0,
              ...extraPrimaryProps,
              children: reportBtnName
            }
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Tab, { eventKey: 1, id: "prepare-new-report", title: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TabTitleText, { children: _49("Prepare New Report") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
            ExpandableSection,
            {
              toggleText: this.state.isExpanded ? _49("Hide Help") : _49("Show Help"),
              onToggle: (event, isExpanded) => this.handleToggle(event, isExpanded),
              isExpanded: this.state.isExpanded,
              className: "ds-margin-top-lg ds-left-margin",
              children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "ds-left-indent-md", children: [
                /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text, { component: TextVariants.h3, children: _49("How To Use Replication Sync Report") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("ol", { className: "ds-left-indent-md ds-margin-top", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("li", { children: [
                    _49("Update The <b>Replication Credentials</b>"),
                    /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("ul", { children: [
                      /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("li", { children: _49("\u2022 Initially, the table is populated with the local instance's replication agreements, which includes the local instance.") }),
                      /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("li", { children: _49("\u2022 Add the remaining replica server credentials from your replication topology.") }),
                      /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("li", { children: _49("\u2022 It is advised to use an <b>Interactive Input</b> option for the password because it's more secure.") })
                    ] })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("li", { children: [
                    _49("Add <b>Replica Aliases</b> (if desired)"),
                    /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("ul", { children: [
                      /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("li", { children: _49("\u2022 Adding aliases will make the report more readable.") }),
                      /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("li", { children: _49("\u2022 Each Replica can have one alias. For example, you can give names like this: <b> Alias</b>=Main Supplier, <b>Hostname</b>=192.168.122.01, <b>Port</b>=38901") }),
                      /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("li", { children: _49("\u2022 In the report result, the report will have an entry like this: <b> Supplier: Main Supplier (192.168.122.01:38901)</b>.") })
                    ] })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("li", { children: [
                    _49("Press <b>Generate Report</b> Button"),
                    /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("ul", { children: [
                      /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("li", { children: _49("\u2022 It will initiate the report creation.") }),
                      /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("li", { children: _49("\u2022 You may be asked for the credentials while the process is running through the agreements.") })
                    ] })
                  ] })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", {})
              ] })
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
            Button,
            {
              className: "ds-margin-top-lg",
              variant: "primary",
              onClick: this.handleFullReport,
              title: _49("Use the specified credentials and display full topology report"),
              isLoading: this.state.reportLoading,
              isDisabled: this.state.reportLoading,
              spinnerAriaValueText: this.state.reportLoading ? "Generating" : void 0,
              ...extraPrimaryProps,
              children: reportBtnName
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
            Button,
            {
              className: "ds-margin-top-lg ds-left-margin",
              variant: "secondary",
              onClick: this.handleConfirmOverwriteDSRC,
              title: _49("Save the report configuration in the .dsrc file for future use."),
              children: _49("Save Report Configuration")
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("hr", {}),
          /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
            ReportCredentialsTable,
            {
              rows: credentialsList,
              deleteConfig: this.removeCreds,
              editConfig: this.showEditCredsModal,
              sortBy: this.state.credSortBy,
              onSort: this.handleCredSort
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
            Button,
            {
              className: "ds-margin-top",
              variant: "secondary",
              onClick: this.handleShowAddCredsModal,
              children: _49("Add Credentials")
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
            ReportAliasesTable,
            {
              rows: aliasesList,
              deleteConfig: this.removeAliases,
              editConfig: this.showEditAliasesModal,
              sortBy: this.state.aliasSortBy,
              onSort: this.handleAliasSort
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
            Button,
            {
              className: "ds-margin-top",
              variant: "secondary",
              onClick: this.handleShowAddAliasesModal,
              children: _49("Add Alias")
            }
          )
        ] }),
        reportData.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TabTitleText, { children: _49("Report Result") }), children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "ds-indent ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
          FullReportContent,
          {
            reportData,
            viewAgmt: this.showAgmtModalRemote,
            handleRefresh: this.refreshFullReport,
            reportRefreshing: this.state.reportRefreshing,
            reportLoading: this.state.reportLoading
          }
        ) }) })
      ] }) });
      if (this.state.loadingDSRC) {
        reportContent = /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Text, { component: TextVariants.h3, children: _49("Loading Replication DSRC Information ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
        ] });
      }
      let overwriteWarning = _49("Only one monitor configuration can be saved in the server's '~/.dsrc' file.  There is already an existing monitor configuration, and if you proceed it will be completely overwritten with the new configuration.");
      if (this.state.credRows.length === 0 && this.state.aliasRows.length === 0) {
        overwriteWarning = _49("This will save the current credentials and aliases to the server's '~/.dsrc' file so it can be reused in the future.");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { id: "repl-monitor-page", className: "ds-tab-table", children: [
        /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "ds-container", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Text, { component: TextVariants.h3, children: [
          _49("Synchronization Report"),
          /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _49("Refresh replication monitor"),
              onClick: this.props.handleReload,
              children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }) }),
        reportContent,
        fullReportModal,
        reportLoginModal,
        reportCredentialsModal,
        reportAliasesModal,
        agmtDetailModal,
        winsyncAgmtDetailModal,
        /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDeleteDSRCCred,
            closeHandler: this.closeConfirmDeleteDSRCCred,
            handleChange: this.onFieldChange,
            actionHandler: this.deleteDSRCCred,
            spinning: this.state.modalSpinning,
            item: this.state.connName,
            checked: this.state.modalChecked,
            mTitle: _49("Delete Replica Connection"),
            mMsg: _49("Are you really sure you want to delete this connection from the '~/.dsrc' file?"),
            mSpinningMsg: _49("Deleting Connection ..."),
            mBtnName: _49("Delete Connection")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDeleteDSRCAlias,
            closeHandler: this.closeConfirmDeleteDSRCAlias,
            handleChange: this.onFieldChange,
            actionHandler: this.deleteDSRCAlias,
            spinning: this.state.modalSpinning,
            item: this.state.aliasName,
            checked: this.state.modalChecked,
            mTitle: _49("Delete Replica Alias"),
            mMsg: _49("Are you really sure you want to delete this alias from the '~/.dsrc' file?"),
            mSpinningMsg: _49("Deleting Alias ..."),
            mBtnName: _49("Delete Alias")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmOverwriteDSRC,
            closeHandler: this.closeConfirmOverwriteDSRC,
            handleChange: this.onFieldChange,
            actionHandler: this.overwriteDSRC,
            spinning: this.state.modalSpinning,
            item: _49("Are you sure you want to proceed?"),
            checked: this.state.modalChecked,
            mTitle: _49("Overwrite Monitor Configuration"),
            mMsg: overwriteWarning,
            mSpinningMsg: _49("Writing DSRC ..."),
            mBtnName: _49("Write DSRC")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
          ReportAliasesModal,
          {
            showModal: this.state.showAddDSRCAliasModal,
            closeHandler: this.closeAddDSRCAlias,
            handleFieldChange: this.onFieldChange,
            onMinusConfig: this.handleMinusConfig,
            onConfigChange: this.handleConfigChange,
            onPlusConfig: this.handlePlusConfig,
            newEntry: this.state.newEntry,
            hostname: this.state.aliasHostname,
            port: this.state.aliasPort,
            alias: this.state.aliasName,
            addConfig: this.addDSRCAlias,
            editConfig: this.addDSRCAlias
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
          ReportConnectionModal,
          {
            showModal: this.state.showAddDSRCCredModal,
            closeHandler: this.closeAddDSRCCred,
            handleFieldChange: this.onFieldChange,
            onMinusConfig: this.handleMinusConfig,
            onConfigChange: this.handleConfigChange,
            onPlusConfig: this.handlePlusConfig,
            name: this.state.connName,
            hostname: this.state.connHostname,
            port: this.state.connPort,
            binddn: this.state.connBindDN,
            bindpw: this.state.connCred,
            pwInputInteractive: this.state.pwInputInteractive,
            addConn: this.addDSRCCred
          }
        )
      ] });
    }
  };
  ReplMonitor.propTypes = {
    data: import_prop_types48.default.object,
    suffix: import_prop_types48.default.string,
    serverId: import_prop_types48.default.string,
    credRows: import_prop_types48.default.array,
    aliasRows: import_prop_types48.default.array,
    addNotification: import_prop_types48.default.func,
    reloadConflicts: import_prop_types48.default.func,
    enableTree: import_prop_types48.default.func
  };
  ReplMonitor.defaultProps = {
    data: {},
    suffix: "",
    serverId: "",
    credRows: [],
    aliasRows: []
  };
  var replMonitor_default = ReplMonitor;

  // src/lib/monitor/replMonAgmts.jsx
  var import_react120 = __toESM(require_react(), 1);
  var import_prop_types49 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1);
  var _50 = cockpit_default.gettext;
  var ReplAgmtMonitor = class extends import_react120.default.Component {
    constructor(props) {
      super(props);
      this.state = {};
      this.pokeAgmt = this.pokeAgmt.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    pokeAgmt(evt) {
      const agmt_name = evt.target.id;
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "poke",
        "--suffix=" + this.props.suffix,
        agmt_name
      ];
      log_cmd("pokeAgmt", "Awaken the agreement", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          _50("Replication agreement has been poked")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_50("Failed to poke replication agreement $0 - $1"), agmt_name, errMsg)
        );
      });
    }
    render() {
      const replAgmts = this.props.data.replAgmts;
      return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "ds-container", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Text, { component: TextVariants.h3, children: [
          _50("Monitor Replication Agreements"),
          /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _50("Refresh replication monitor"),
              onClick: this.props.handleReload,
              children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
          AgmtTable,
          {
            agmts: replAgmts,
            handlePokeAgmt: this.pokeAgmt
          }
        )
      ] });
    }
  };
  ReplAgmtMonitor.propTypes = {
    data: import_prop_types49.default.object,
    suffix: import_prop_types49.default.string,
    serverId: import_prop_types49.default.string,
    addNotification: import_prop_types49.default.func,
    enableTree: import_prop_types49.default.func
  };
  ReplAgmtMonitor.defaultProps = {
    data: {},
    suffix: "",
    serverId: ""
  };
  var replMonAgmts_default = ReplAgmtMonitor;

  // src/lib/monitor/replMonWinsync.jsx
  var import_react121 = __toESM(require_react(), 1);
  var import_prop_types50 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1);
  var _51 = cockpit_default.gettext;
  var ReplAgmtWinsync = class extends import_react121.default.Component {
    constructor(props) {
      super(props);
      this.state = {};
      this.pokeAgmt = this.pokeAgmt.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    pokeAgmt(evt) {
      const agmt_name = evt.target.id;
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "poke",
        "--suffix=" + this.props.suffix,
        agmt_name
      ];
      log_cmd("pokeAgmt", "Awaken the agreement", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          _51("Replication Winysnc agreement has been poked")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_51("Failed to poke replication winsync agreement $0 - $1"), agmt_name, errMsg)
        );
      });
    }
    render() {
      const replWinsyncAgmts = this.props.data.replWinsyncAgmts;
      return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "ds-container", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Text, { component: TextVariants.h3, children: [
          _51("Monitor Winsync Agreements"),
          /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _51("Refresh replication monitor"),
              onClick: this.props.handleReload,
              children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
          WinsyncAgmtTable,
          {
            agmts: replWinsyncAgmts,
            handlePokeAgmt: this.pokeAgmt
          }
        )
      ] });
    }
  };
  ReplAgmtWinsync.propTypes = {
    data: import_prop_types50.default.object,
    suffix: import_prop_types50.default.string,
    serverId: import_prop_types50.default.string,
    addNotification: import_prop_types50.default.func,
    enableTree: import_prop_types50.default.func
  };
  ReplAgmtWinsync.defaultProps = {
    data: {},
    suffix: "",
    serverId: ""
  };
  var replMonWinsync_default = ReplAgmtWinsync;

  // src/lib/monitor/replMonTasks.jsx
  var import_react122 = __toESM(require_react(), 1);
  var import_prop_types51 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1);
  var _52 = cockpit_default.gettext;
  var ReplMonTasks = class extends import_react122.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        showLogModal: false,
        logData: "",
        activeTabTaskKey: 0
      };
      this.handleNavTaskSelect = (event, tabIndex) => {
        this.setState({
          activeTabTaskKey: tabIndex
        });
      };
      this.viewCleanLog = this.viewCleanLog.bind(this);
      this.viewAbortLog = this.viewAbortLog.bind(this);
      this.closeLogModal = this.closeLogModal.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    viewCleanLog(name2) {
      let logData = "";
      for (const task of this.props.data.cleanTasks) {
        if (task.attrs.cn[0] === name2) {
          logData = task.attrs.nstasklog[0];
          break;
        }
      }
      this.setState({
        showLogModal: true,
        logData
      });
    }
    viewAbortLog(name2) {
      let logData = "";
      for (const task of this.props.data.abortTasks) {
        if (task.attrs.cn[0] === name2) {
          logData = task.attrs.nstasklog[0];
          break;
        }
      }
      this.setState({
        showLogModal: true,
        logData
      });
    }
    closeLogModal() {
      this.setState({
        showLogModal: false
      });
    }
    render() {
      const cleanTasks = this.props.data.cleanTasks;
      const abortTasks = this.props.data.abortTasks;
      return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "ds-container", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Text, { component: TextVariants.h3, children: [
          _52("Monitor Replication Tasks"),
          /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _52("Refresh replication monitor"),
              onClick: this.props.handleReload,
              children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Tabs, { isBox: true, className: "ds-margin-top-lg", activeKey: this.state.activeTabTaskKey, onSelect: this.handleNavTaskSelect, children: [
          /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(TabTitleText, { children: [
            _52("CleanAllRUV Tasks "),
            /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("font", { size: "2", children: [
              "(",
              cleanTasks.length,
              ")"
            ] })
          ] }), children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "ds-indent ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
            CleanALLRUVTable,
            {
              tasks: cleanTasks,
              viewLog: this.viewCleanLog
            }
          ) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(TabTitleText, { children: [
            _52("Abort CleanAllRUV Tasks "),
            /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("font", { size: "2", children: [
              "(",
              abortTasks.length,
              ")"
            ] })
          ] }), children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "ds-indent ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
            AbortCleanALLRUVTable,
            {
              tasks: abortTasks,
              viewLog: this.viewAbortLog
            }
          ) }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
          TaskLogModal,
          {
            showModal: this.state.showLogModal,
            closeHandler: this.closeLogModal,
            logData: this.state.logData
          }
        )
      ] });
    }
  };
  ReplMonTasks.propTypes = {
    data: import_prop_types51.default.object,
    enableTree: import_prop_types51.default.func
  };
  ReplMonTasks.defaultProps = {
    data: {}
  };
  var replMonTasks_default = ReplMonTasks;

  // src/lib/monitor/replMonConflict.jsx
  var import_react123 = __toESM(require_react(), 1);
  var import_prop_types52 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1);
  var _53 = cockpit_default.gettext;
  var ReplMonConflict = class extends import_react123.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        showConfirmConvertConflict: false,
        showConfirmSwapConflict: false,
        showConfirmDeleteConflict: false,
        showConfirmDeleteAllConflicts: false,
        showCompareModal: false,
        showConfirmDeleteGlue: false,
        showConfirmConvertGlue: false,
        swapConflictRadio: false,
        deleteConflictRadio: false,
        convertConflictRadio: false,
        convertRDN: "",
        glueEntry: "",
        conflictEntry: "",
        modalChecked: false,
        modalSpinning: false,
        activeTabConflictKey: 0
      };
      this.handleNavConflictSelect = (event, tabIndex) => {
        this.setState({
          activeTabConflictKey: tabIndex
        });
      };
      this.convertConflict = this.convertConflict.bind(this);
      this.swapConflict = this.swapConflict.bind(this);
      this.deleteConflict = this.deleteConflict.bind(this);
      this.deleteAllConflicts = this.deleteAllConflicts.bind(this);
      this.resolveConflict = this.resolveConflict.bind(this);
      this.convertGlue = this.convertGlue.bind(this);
      this.deleteGlue = this.deleteGlue.bind(this);
      this.closeCompareModal = this.closeCompareModal.bind(this);
      this.confirmDeleteGlue = this.confirmDeleteGlue.bind(this);
      this.confirmConvertGlue = this.confirmConvertGlue.bind(this);
      this.closeConfirmDeleteGlue = this.closeConfirmDeleteGlue.bind(this);
      this.closeConfirmConvertGlue = this.closeConfirmConvertGlue.bind(this);
      this.closeConfirmDeleteAllConflicts = this.closeConfirmDeleteAllConflicts.bind(this);
      this.onRadioChange = this.onRadioChange.bind(this);
      this.onChange = this.onChange.bind(this);
      this.onConflictConversion = this.onConflictConversion.bind(this);
      this.confirmDeleteConflict = this.confirmDeleteConflict.bind(this);
      this.confirmConvertConflict = this.confirmConvertConflict.bind(this);
      this.confirmSwapConflict = this.confirmSwapConflict.bind(this);
      this.closeConfirmDeleteConflict = this.closeConfirmDeleteConflict.bind(this);
      this.closeConfirmConvertConflict = this.closeConfirmConvertConflict.bind(this);
      this.closeConfirmSwapConflict = this.closeConfirmSwapConflict.bind(this);
      this.confirmDeleteAllConflicts = this.confirmDeleteAllConflicts.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    onRadioChange(e, value) {
      const radioID = {
        swapConflictRadio: false,
        deleteConflictRadio: false,
        convertConflictRadio: false
      };
      radioID[e.target.id] = value;
      this.setState({
        swapConflictRadio: radioID.swapConflictRadio,
        deleteConflictRadio: radioID.deleteConflictRadio,
        convertConflictRadio: radioID.convertConflictRadio
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    convertConflict() {
      this.setState({ modalSpinning: true });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-conflict",
        "convert",
        this.state.conflictEntry,
        "--new-rdn=" + this.state.convertRDN
      ];
      log_cmd("convertConflict", "convert conflict entry", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reloadConflicts(this.props.suffix);
        this.props.addNotification(
          "success",
          _53("Replication conflict entry was converted into a valid entry")
        );
        this.setState({
          showCompareModal: false
        });
        this.closeConfirmConvertConflict();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_53("Failed to convert conflict entry entry: $0 - $1"), this.state.conflictEntry, errMsg)
        );
        this.closeConfirmConvertConflict();
      });
    }
    swapConflict() {
      this.setState({ modalSpinning: true });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-conflict",
        "swap",
        this.state.conflictEntry
      ];
      log_cmd("swapConflict", "swap in conflict entry", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reloadConflicts(this.props.suffix);
        this.props.addNotification(
          "success",
          _53("Replication Conflict Entry is now the Valid Entry")
        );
        this.setState({
          showCompareModal: false
        });
        this.closeConfirmSwapConflict();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_53("Failed to swap in conflict entry: $0 - $1"), this.state.conflictEntry, errMsg)
        );
        this.closeConfirmSwapConflict();
      });
    }
    deleteConflict() {
      this.setState({ modalSpinning: true });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-conflict",
        "delete",
        this.state.conflictEntry
      ];
      log_cmd("deleteConflict", "Delete conflict entry", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reloadConflicts(this.props.suffix);
        this.props.addNotification(
          "success",
          _53("Replication conflict entry was deleted")
        );
        this.setState({
          showCompareModal: false
        });
        this.closeConfirmConvertConflict();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_53("Failed to delete conflict entry: $0 - $1"), this.state.conflictEntry, errMsg)
        );
        this.closeConfirmDeleteConflict();
      });
    }
    deleteAllConflicts() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-conflict",
        "delete-all",
        this.props.suffix
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteAllConflicts", "Delete all conflict entries", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reloadConflicts(this.props.suffix);
        this.props.addNotification(
          "success",
          _53("All conflict entries were deleted")
        );
        this.setState({
          showConfirmDeleteAllConflicts: false,
          modalSpinning: false
        });
      }).fail((err) => {
        this.props.addNotification(
          "error",
          cockpit_default.format(
            _53("Failed to delete all conflict entries: $0 - $1"),
            this.props.suffix,
            err
          )
        );
        this.setState({
          showConfirmDeleteAllConflicts: false,
          modalSpinning: false
        });
      });
    }
    resolveConflict(dn) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-conflict",
        "compare",
        dn
      ];
      log_cmd("resolveConflict", "Compare conflict entry with valid entry", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const entries = JSON.parse(content);
        this.setState({
          cmpConflictEntry: entries.items[0],
          cmpValidEntry: entries.items[1],
          showCompareModal: true,
          deleteConflictRadio: true,
          swapConflictRadio: false,
          convertConflictRadio: false,
          convertRDN: ""
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_53("Failed to get conflict entries: $0 - $1"), dn, errMsg)
        );
      });
    }
    closeConfirmDeleteAllConflicts() {
      this.setState({
        showConfirmDeleteAllConflicts: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    confirmConvertGlue(dn) {
      this.setState({
        showConfirmConvertGlue: true,
        glueEntry: dn,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmConvertGlue() {
      this.setState({
        showConfirmConvertGlue: false,
        glueEntry: "",
        modalChecked: false,
        modalSpinning: false
      });
    }
    convertGlue() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-conflict",
        "convert-glue",
        this.state.glueEntry
      ];
      log_cmd("convertGlue", "Convert glue entry to normal entry", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reloadConflicts(this.props.suffix);
        this.props.addNotification(
          "success",
          _53("Replication glue entry was converted")
        );
        this.closeConfirmConvertGlue();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_53("Failed to convert glue entry: $0 - $1"), this.state.glueEntry, errMsg)
        );
        this.closeConfirmConvertGlue();
      });
    }
    confirmDeleteGlue(dn) {
      this.setState({
        showConfirmDeleteGlue: true,
        glueEntry: dn,
        modalChecked: false,
        modalSpinning: false
      });
    }
    confirmDeleteAllConflicts() {
      this.setState({
        showConfirmDeleteAllConflicts: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    deleteGlue() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-conflict",
        "delete-glue",
        this.state.glueEntry
      ];
      log_cmd("deleteGlue", "Delete glue entry", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reloadConflicts(this.props.suffix);
        this.props.addNotification(
          "success",
          _53("Replication glue entry was deleted")
        );
        this.closeConfirmDeleteGlue();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_53("Failed to delete glue entry: $0 - $1"), this.state.glueEntry, errMsg)
        );
        this.closeConfirmDeleteGlue();
      });
    }
    closeConfirmDeleteGlue() {
      this.setState({
        showConfirmDeleteGlue: false,
        glueEntry: "",
        modalChecked: false,
        modalSpinning: false
      });
    }
    onConflictConversion(dn) {
      if (this.state.deleteConflictRadio) {
        this.confirmDeleteConflict(dn);
      } else if (this.state.swapConflictRadio) {
        this.confirmSwapConflict(dn);
      } else {
        this.confirmConvertConflict(dn);
      }
    }
    confirmConvertConflict(dn) {
      if (this.state.convertRDN === "") {
        this.props.addNotification(
          "error",
          _53("You must provide a RDN if you want to convert the Conflict Entry")
        );
        return;
      }
      this.setState({
        showConfirmConvertConflict: true,
        conflictEntry: dn,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmConvertConflict() {
      this.setState({
        showConfirmConvertConflict: false,
        conflictEntry: "",
        modalChecked: false,
        modalSpinning: false,
        convertRDN: ""
      });
    }
    confirmSwapConflict(dn) {
      this.setState({
        showConfirmSwapConflict: true,
        conflictEntry: dn,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmSwapConflict() {
      this.setState({
        showConfirmSwapConflict: false,
        conflictEntry: "",
        modalChecked: false,
        modalSpinning: false
      });
    }
    confirmDeleteConflict(dn) {
      this.setState({
        showConfirmDeleteConflict: true,
        conflictEntry: dn,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmDeleteConflict() {
      this.setState({
        showConfirmDeleteConflict: false,
        conflictEntry: "",
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeCompareModal() {
      this.setState({
        showCompareModal: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    render() {
      const conflictEntries = this.props.data?.conflicts || [];
      const glueEntries = this.props.data?.glues || [];
      const deleteBtnName = this.state.modalSpinning ? "Deleting All Conflict Entries ..." : "Delete All Conflict Entries";
      return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "ds-container", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Text, { component: TextVariants.h3, children: [
          _53("Monitor Conflict and Glue Entries"),
          /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _53("Refresh replication monitor"),
              onClick: this.props.handleReload,
              children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Tabs, { isBox: true, className: "ds-margin-top-lg", activeKey: this.state.activeTabConflictKey, onSelect: this.handleNavConflictSelect, children: [
          /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(TabTitleText, { children: [
            _53("Conflict Entries "),
            /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("font", { size: "2", children: [
              "(",
              conflictEntries.length,
              ")"
            ] })
          ] }), children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "ds-indent ds-margin-top-lg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
              Tooltip,
              {
                content: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { children: _53("Replication conflict entries occur when two entries are created with the same DN (or name) on different servers at about the same time.  The automatic conflict resolution procedure renames the entry created last.  Its RDN is changed into a multi-valued RDN that includes the entry's original RDN and it's unique identifier (nsUniqueId).  There are several ways to resolve a conflict, but choosing which option to use is up to you.") }),
                children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("a", { className: "ds-indent ds-font-size-sm", children: _53("What Is A Replication Conflict Entry?") })
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
              ConflictTable,
              {
                conflicts: conflictEntries,
                resolveConflict: this.resolveConflict
              },
              conflictEntries
            ),
            conflictEntries.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
              Button,
              {
                variant: "secondary",
                ouiaId: "DangerSecondary",
                isDanger: true,
                "aria-label": "Delete all conflict entries",
                className: "ds-margin-top-lg",
                onClick: this.confirmDeleteAllConflicts,
                isDisabled: this.state.modalSpinning,
                isLoading: this.state.modalSpinning,
                children: deleteBtnName
              }
            )
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(TabTitleText, { children: [
            _53("Glue Entries "),
            /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("font", { size: "2", children: [
              "(",
              glueEntries.length,
              ")"
            ] })
          ] }), children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "ds-indent ds-margin-top-lg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
              Tooltip,
              {
                content: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { children: _53('When a Delete operation is replicated and the consumer server finds that the entry to be deleted has child entries, the conflict resolution procedure creates a "glue entry" to avoid having orphaned entries in the database.  In the same way, when an Add operation is replicated and the consumer server cannot find the parent entry, the conflict resolution procedure creates a "glue entry", representing the "parent entry", so that the new entry is not an orphaned entry.  You can choose to convert the glue entry, or remove the glue entry and all its child entries.') }),
                children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("a", { className: "ds-indent ds-font-size-sm", children: _53("What Is A Replication Glue Entry?") })
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
              GlueTable,
              {
                glues: glueEntries,
                convertGlue: this.confirmConvertGlue,
                deleteGlue: this.confirmDeleteGlue
              },
              glueEntries
            )
          ] }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
          ConflictCompareModal,
          {
            showModal: this.state.showCompareModal,
            conflictEntry: this.state.cmpConflictEntry,
            validEntry: this.state.cmpValidEntry,
            swapConflictRadio: this.state.swapConflictRadio,
            convertConflictRadio: this.state.convertConflictRadio,
            deleteConflictRadio: this.state.deleteConflictRadio,
            newRDN: this.state.convertRDN,
            closeHandler: this.closeCompareModal,
            saveHandler: this.onConflictConversion,
            handleChange: this.onChange,
            handleRadioChange: this.onRadioChange
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDeleteGlue,
            closeHandler: this.closeConfirmDeleteGlue,
            handleChange: this.onChange,
            actionHandler: this.deleteGlue,
            spinning: this.state.modalSpinning,
            item: this.state.glueEntry,
            checked: this.state.modalChecked,
            mTitle: _53("Delete Glue Entry"),
            mMsg: _53("Are you really sure you want to delete this glue entry and its child entries?"),
            mSpinningMsg: _53("Deleting Glue Entry ..."),
            mBtnName: _53("Delete Glue")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmConvertGlue,
            closeHandler: this.closeConfirmConvertGlue,
            handleChange: this.onChange,
            actionHandler: this.convertGlue,
            spinning: this.state.modalSpinning,
            item: this.state.glueEntry,
            checked: this.state.modalChecked,
            mTitle: _53("Convert Glue Entry"),
            mMsg: _53("Are you really sure you want to convert this glue entry to a regular entry?"),
            mSpinningMsg: _53("Converting Glue Entry ..."),
            mBtnName: _53("Convert Glue")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmConvertConflict,
            closeHandler: this.closeConfirmConvertConflict,
            handleChange: this.onChange,
            actionHandler: this.convertConflict,
            spinning: this.state.modalSpinning,
            item: this.state.conflictEntry,
            checked: this.state.modalChecked,
            mTitle: _53("Convert Conflict Entry Into New Entry"),
            mMsg: _53("Are you really sure you want to convert this conflict entry?"),
            mSpinningMsg: _53("Converting Conflict Entry ..."),
            mBtnName: _53("Convert Conflict")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmSwapConflict,
            closeHandler: this.closeConfirmSwapConflict,
            handleChange: this.onChange,
            actionHandler: this.swapConflict,
            spinning: this.state.modalSpinning,
            item: this.state.conflictEntry,
            checked: this.state.modalChecked,
            mTitle: _53("Swap Conflict Entry"),
            mMsg: _53("Are you really sure you want to swap this conflict entry with the valid entry?"),
            mSpinningMsg: _53("Swapping Conflict Entry ..."),
            mBtnName: _53("Swap Conflict")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDeleteConflict,
            closeHandler: this.closeConfirmDeleteConflict,
            handleChange: this.onChange,
            actionHandler: this.deleteConflict,
            spinning: this.state.modalSpinning,
            item: this.state.conflictEntry,
            checked: this.state.modalChecked,
            mTitle: _53("Delete Replication Conflict Entry"),
            mMsg: _53("Are you really sure you want to delete this conflict entry?"),
            mSpinningMsg: _53("Deleting Conflict Entry ..."),
            mBtnName: _53("Delete Conflict")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDeleteAllConflicts,
            closeHandler: this.closeConfirmDeleteAllConflicts,
            handleChange: this.onChange,
            actionHandler: this.deleteAllConflicts,
            spinning: this.state.modalSpinning,
            item: conflictEntries.length + " conflict entries",
            checked: this.state.modalChecked,
            mTitle: _53("Delete All Conflict Entries"),
            mMsg: _53("Are you really sure you want to delete all conflict entries?"),
            mSpinningMsg: _53("Deleting All Conflict Entries ..."),
            mBtnName: _53("Delete All Conflict Entries")
          }
        )
      ] });
    }
  };
  ReplMonConflict.propTypes = {
    data: import_prop_types52.default.object,
    serverId: import_prop_types52.default.string,
    addNotification: import_prop_types52.default.func,
    enableTree: import_prop_types52.default.func
  };
  ReplMonConflict.defaultProps = {
    data: {},
    serverId: ""
  };
  var replMonConflict_default = ReplMonConflict;

  // src/monitor.jsx
  var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1);
  var _54 = cockpit_default.gettext;
  var BE_IMPL_MDB2 = "mdb";
  var Monitor = class extends import_react124.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        nodes: [],
        node_name: "",
        node_text: "",
        node_type: "",
        node_item: "",
        loaded: false,
        snmpData: {},
        ldbmData: {},
        serverData: {},
        serverTab: 0,
        disks: [],
        loadingMsg: "",
        disableTree: false,
        activeItems: [{
          name: "Database",
          icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(DatabaseIcon, {}),
          id: "server-monitor",
          type: "server",
          children: [],
          defaultExpanded: true
        }],
        // Suffix
        suffixLoading: false,
        serverLoading: false,
        ldbmLoading: false,
        chainingLoading: false,
        diskReloadSpinning: false,
        // replication
        replLoading: false,
        replInitLoaded: false,
        replSuffix: "",
        replRole: "",
        replRid: "",
        replicatedSuffixes: [],
        credRows: [],
        aliasRows: [],
        // Logging
        accesslogLocation: "",
        errorlogLocation: "",
        auditlogLocation: "",
        auditfaillogLocation: "",
        securitylogLocation: "",
        // DB engine, bdb or mdb (default)
        dbEngine: BE_IMPL_MDB2
      };
      this.loadSuffixTree = this.loadSuffixTree.bind(this);
      this.enableTree = this.enableTree.bind(this);
      this.update_tree_nodes = this.update_tree_nodes.bind(this);
      this.handleTreeClick = this.handleTreeClick.bind(this);
      this.disableSuffixLoading = this.disableSuffixLoading.bind(this);
      this.loadMonitorLDBM = this.loadMonitorLDBM.bind(this);
      this.loadMonitorSNMP = this.loadMonitorSNMP.bind(this);
      this.reloadSNMP = this.reloadSNMP.bind(this);
      this.loadMonitorServer = this.loadMonitorServer.bind(this);
      this.reloadServer = this.reloadServer.bind(this);
      this.loadMonitorChaining = this.loadMonitorChaining.bind(this);
      this.loadDiskSpace = this.loadDiskSpace.bind(this);
      this.reloadDisks = this.reloadDisks.bind(this);
      this.getDBEngine = this.getDBEngine.bind(this);
      this.onHandleLoadMonitorReplication = this.onHandleLoadMonitorReplication.bind(this);
      this.loadCleanTasks = this.loadCleanTasks.bind(this);
      this.loadAbortTasks = this.loadAbortTasks.bind(this);
      this.loadReplicatedSuffixes = this.loadReplicatedSuffixes.bind(this);
      this.loadWinsyncAgmts = this.loadWinsyncAgmts.bind(this);
      this.reloadReplAgmts = this.reloadReplAgmts.bind(this);
      this.reloadReplWinsyncAgmts = this.reloadReplWinsyncAgmts.bind(this);
      this.loadConflicts = this.loadConflicts.bind(this);
      this.loadGlues = this.loadGlues.bind(this);
      this.gatherAllReplicaHosts = this.gatherAllReplicaHosts.bind(this);
      this.getAgmts = this.getAgmts.bind(this);
      this.loadMonitor = this.loadMonitor.bind(this);
    }
    componentDidMount() {
      this.getDBEngine();
    }
    componentDidUpdate(prevProps) {
      if (this.props.wasActiveList.includes(6)) {
        if (this.state.firstLoad) {
          this.loadMonitor();
        } else {
          if (this.props.serverId !== prevProps.serverId) {
            this.loadSuffixTree(false);
            this.getDBEngine();
          }
        }
      }
    }
    processTree(suffixData) {
      for (const suffix of suffixData) {
        if (suffix.type === "suffix") {
          suffix.icon = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TreeIcon, { size: "sm" });
        } else if (suffix.type === "subsuffix") {
          suffix.icon = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(LeafIcon, { size: "sm" });
        } else {
          suffix.icon = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(LinkIcon, { size: "sm" });
        }
        if (suffix.children.length === 0) {
          delete suffix.children;
        } else {
          this.processTree(suffix.children);
        }
      }
    }
    processReplSuffixes(suffixTree) {
      for (const suffix of this.state.replicatedSuffixes) {
        suffixTree.push({
          name: suffix,
          icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TreeIcon, { size: "sm" }),
          id: "replication-suffix-" + suffix,
          type: "replication-suffix",
          defaultExpanded: false,
          children: [
            {
              name: _54("Agreements"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(MonitoringIcon, {}),
              id: suffix + "-agmts",
              item: "agmt-mon",
              type: "repl-mon",
              suffix
            },
            {
              name: _54("Winsync Agreements"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(MonitoringIcon, {}),
              id: suffix + "-winsync",
              item: "winsync-mon",
              type: "repl-mon",
              suffix
            },
            {
              name: _54("Tasks"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(MonitoringIcon, {}),
              id: suffix + "-tasks",
              item: "task-mon",
              type: "repl-mon",
              suffix
            },
            {
              name: _54("Conflict Entries"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(MonitoringIcon, {}),
              id: suffix + "-conflict",
              item: "conflict-mon",
              type: "repl-mon",
              suffix
            }
          ]
        });
      }
    }
    loadSuffixTree(fullReset) {
      const basicData = [
        {
          name: _54("Server Statistics"),
          icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ClusterIcon, {}),
          id: "server-monitor",
          type: "server"
        },
        {
          name: _54("Replication"),
          icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TopologyIcon, {}),
          id: "replication-monitor",
          type: "replication",
          defaultExpanded: true,
          children: [
            {
              name: _54("Synchronization Report"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(MonitoringIcon, {}),
              id: "sync-report",
              item: "sync-report",
              type: "repl-mon"
            },
            {
              name: _54("Log Analysis"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(MonitoringIcon, {}),
              id: "log-analysis",
              item: "log-analysis",
              type: "repl-mon"
            }
          ]
        },
        {
          name: _54("Database"),
          icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(DatabaseIcon, {}),
          id: "database-monitor",
          type: "database",
          children: [],
          // Will be populated with treeData on success
          defaultExpanded: true
        },
        {
          name: _54("Logging"),
          icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(CatalogIcon, {}),
          id: "log-monitor",
          defaultExpanded: true,
          children: [
            {
              name: _54("Access Log"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(BookIcon, { size: "sm" }),
              id: "access-log-monitor",
              type: "log"
            },
            {
              name: _54("Audit Log"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(BookIcon, { size: "sm" }),
              id: "audit-log-monitor",
              type: "log"
            },
            {
              name: _54("Audit Failure Log"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(BookIcon, { size: "sm" }),
              id: "auditfail-log-monitor",
              type: "log"
            },
            {
              name: _54("Errors Log"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(BookIcon, { size: "sm" }),
              id: "error-log-monitor",
              type: "log"
            },
            {
              name: _54("Security Log"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(BookIcon, { size: "sm" }),
              id: "security-log-monitor",
              type: "log"
            }
          ]
        }
      ];
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "get-tree"
      ];
      log_cmd("getTree", "Start building the suffix tree", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const treeData = JSON.parse(content);
        this.processTree(treeData);
        let current_node = this.state.node_name;
        let type = this.state.node_type;
        if (fullReset) {
          current_node = "server-monitor";
          type = "server";
        }
        basicData[2].children = treeData;
        this.processReplSuffixes(basicData[1].children);
        this.setState(() => ({
          nodes: basicData,
          node_name: current_node,
          node_type: type
        }), this.update_tree_nodes);
      }).fail((err) => {
        let current_node = this.state.node_name;
        let type = this.state.node_type;
        if (fullReset) {
          current_node = "server-monitor";
          type = "server";
        }
        this.processReplSuffixes(basicData[1].children);
        this.setState(() => ({
          nodes: basicData,
          node_name: current_node,
          node_type: type
        }), this.update_tree_nodes);
      });
    }
    handleTreeClick(evt, treeViewItem, parentItem) {
      if (treeViewItem.id === "log-monitor" || treeViewItem.id === "replication-monitor" || treeViewItem.id.startsWith("replication-suffix")) {
        return;
      }
      if (this.state.activeItems.length === 0 || treeViewItem === this.state.activeItems[0]) {
        this.setState({
          activeItems: [treeViewItem, parentItem]
        });
        return;
      }
      this.setState({
        disableTree: true
        // Disable the tree to allow node to be fully loaded
      });
      if (treeViewItem.id === "database-monitor" || treeViewItem.id === "server-monitor") {
        this.setState((prevState) => {
          return {
            activeItems: [treeViewItem, parentItem],
            node_name: treeViewItem.id,
            node_text: treeViewItem.name,
            node_type: treeViewItem.type,
            disableTree: false,
            bename: ""
          };
        });
      } else if (treeViewItem.id === "access-log-monitor") {
        this.setState((prevState) => {
          return {
            activeItems: [treeViewItem, parentItem],
            node_name: treeViewItem.id,
            node_text: treeViewItem.name,
            node_type: treeViewItem.type,
            bename: ""
          };
        });
      } else if (treeViewItem.id === "audit-log-monitor") {
        this.setState((prevState) => {
          return {
            activeItems: [treeViewItem, parentItem],
            node_name: treeViewItem.id,
            node_text: treeViewItem.name,
            node_type: treeViewItem.type,
            bename: ""
          };
        });
      } else if (treeViewItem.id === "auditfail-log-monitor") {
        this.setState((prevState) => {
          return {
            activeItems: [treeViewItem, parentItem],
            node_name: treeViewItem.id,
            node_text: treeViewItem.name,
            node_type: treeViewItem.type,
            bename: ""
          };
        });
      } else if (treeViewItem.id === "error-log-monitor") {
        this.setState((prevState) => {
          return {
            activeItems: [treeViewItem, parentItem],
            node_name: treeViewItem.id,
            node_text: treeViewItem.name,
            node_type: treeViewItem.type,
            bename: ""
          };
        });
      } else if (treeViewItem.id === "sync-report") {
        this.gatherAllReplicaHosts(treeViewItem, parentItem);
      } else if (treeViewItem.id === "log-analysis") {
        this.setState({
          activeItems: [treeViewItem, parentItem],
          node_name: treeViewItem.id,
          node_text: treeViewItem.name,
          node_type: treeViewItem.type,
          node_item: treeViewItem.item,
          disableTree: false
        });
      } else {
        if (treeViewItem.type === "repl-mon") {
          this.onHandleLoadMonitorReplication(treeViewItem, parentItem);
        } else if (treeViewItem.id in this.state && ("chainingData" in this.state[treeViewItem.id] || "suffixData" in this.state[treeViewItem.id])) {
          this.setState((prevState) => {
            return {
              activeItems: [treeViewItem, parentItem],
              node_name: treeViewItem.id,
              node_text: treeViewItem.name,
              node_type: treeViewItem.type,
              disableTree: false,
              bename: treeViewItem.be
            };
          });
        } else {
          if (treeViewItem.type === "dblink") {
            this.loadMonitorChaining(treeViewItem.id);
          }
          this.setState((prevState) => {
            return {
              activeItems: [treeViewItem, parentItem],
              node_name: treeViewItem.id,
              node_text: treeViewItem.name,
              node_type: treeViewItem.type,
              bename: treeViewItem.be
            };
          });
        }
      }
    }
    update_tree_nodes() {
      this.setState({
        loaded: true,
        disableTree: false
      }, () => {
        const className = "pf-c-tree-view__list-item";
        const element = document.getElementById("monitor-tree");
        if (element) {
          const elements = element.getElementsByClassName(className);
          for (const el of elements) {
            el.setAttribute("title", el.innerText);
          }
        }
        this.loadDSRC();
      });
    }
    loadMonitor() {
      if (this.state.firstLoad) {
        this.setState({
          firstLoad: false
        });
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get",
        "nsslapd-auditlog",
        "nsslapd-accesslog",
        "nsslapd-errorlog",
        "nsslapd-auditfaillog",
        "nsslapd-securitylog"
      ];
      log_cmd("loadLogLocations", "Get log locations", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          accesslogLocation: config.attrs["nsslapd-accesslog"][0],
          auditlogLocation: config.attrs["nsslapd-auditlog"][0],
          auditfaillogLocation: config.attrs["nsslapd-auditfaillog"][0],
          errorlogLocation: config.attrs["nsslapd-errorlog"][0],
          securitylogLocation: config.attrs["nsslapd-securitylog"][0]
        });
      }, this.loadReplicatedSuffixes());
    }
    loadReplicatedSuffixes() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "list"
      ];
      log_cmd("loadReplicatedSuffixes", "Load replication suffixes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        let replSuffix = "";
        if (config.items.length > 0) {
          replSuffix = config.items[0];
        }
        this.setState({
          replicatedSuffixes: config.items,
          replSuffix
        });
      }, this.loadDiskSpace());
    }
    loadMonitorLDBM() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "ldbm"
      ];
      log_cmd("loadMonitorLDBM", "Load database monitor", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          ldbmData: config.attrs
        });
      }, this.loadMonitorServer());
    }
    loadMonitorServer() {
      const cmd = [
        "dsconf",
        "-j",
        this.props.serverId,
        "monitor",
        "server"
      ];
      log_cmd("loadMonitorServer", "Load server monitor", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          serverData: config.attrs
        });
      }, this.loadMonitorSNMP());
    }
    reloadServer(tab) {
      this.setState({
        serverLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        this.props.serverId,
        "monitor",
        "server"
      ];
      log_cmd("reloadServer", "Load server monitor", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          serverLoading: false,
          serverData: config.attrs,
          serverTab: tab
        }, this.reloadDisks());
      });
    }
    loadMonitorSNMP() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "snmp"
      ];
      log_cmd("loadMonitorSNMP", "Load snmp monitor", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          snmpData: config.attrs
        }, this.loadSuffixTree(true));
      });
    }
    loadDiskSpace() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "disk"
      ];
      log_cmd("loadDiskSpace", "Load disk space info", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const disks = JSON.parse(content);
        const rows = [];
        for (const disk of disks.items) {
          rows.push([disk.mount, disk.size, disk.used + " (" + disk.percent + "%)", disk.avail]);
        }
        this.setState({
          disks: rows
        });
      }, this.loadMonitorLDBM());
    }
    reloadDisks() {
      this.setState({
        diskReloadSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "disk"
      ];
      log_cmd("reloadDisks", "Reload disk stats", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const disks = JSON.parse(content);
        const rows = [];
        for (const disk of disks.items) {
          rows.push([disk.mount, disk.size, disk.used + " (" + disk.percent + "%)", disk.avail]);
        }
        this.setState({
          disks: rows,
          diskReloadSpinning: false
        });
      });
    }
    getDBEngine() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "config",
        "get"
      ];
      log_cmd("getDBEngine", "Get DB Implementation", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        if ("nsslapd-backend-implement" in attrs) {
          this.setState({
            dbEngine: attrs["nsslapd-backend-implement"][0]
          });
        }
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        console.log("getDBEngine - Error detecting DB implementation type -", errMsg);
      });
    }
    reloadSNMP() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "snmp"
      ];
      log_cmd("reloadSNMP", "Load snmp monitor", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          snmpData: config.attrs
        });
      });
    }
    loadMonitorChaining(suffix) {
      this.setState({
        chainingLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "monitor",
        "chaining",
        suffix
      ];
      log_cmd("loadMonitorChaining", "Load suffix monitor", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            chainingData: config.attrs
          },
          chainingLoading: false
        });
      }).fail(() => {
        this.setState({
          chainingLoading: false
        });
      });
    }
    disableSuffixLoading() {
      this.setState({
        suffixLoading: false
      });
    }
    loadCleanTasks(replSuffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-tasks",
        "list-cleanruv-tasks",
        "--suffix=" + replSuffix
      ];
      log_cmd("loadCleanTasks", "Load clean tasks", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          [replSuffix]: {
            ...this.state[replSuffix],
            cleanTasks: config.items
          }
        }, this.loadAbortTasks(replSuffix));
      }).fail(() => {
        this.setState({
          replLoading: false
        });
      });
    }
    loadAbortTasks(replSuffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-tasks",
        "list-abortruv-tasks",
        "--suffix=" + replSuffix
      ];
      log_cmd("loadAbortCleanTasks", "Load abort tasks", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          [replSuffix]: {
            ...this.state[replSuffix],
            abortTasks: config.items
          }
        }, this.loadConflicts(replSuffix));
      }).fail(() => {
        this.setState({
          replLoading: false
        });
      });
    }
    loadConflicts(replSuffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-conflict",
        "list",
        replSuffix
      ];
      log_cmd("loadConflicts", "Load conflict entries", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          [replSuffix]: {
            ...this.state[replSuffix],
            conflicts: config.items,
            glues: []
          }
        }, this.loadGlues(replSuffix));
      }).fail(() => {
        this.setState({
          replLoading: false
        });
      });
    }
    loadGlues(replSuffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-conflict",
        "list-glue",
        replSuffix
      ];
      log_cmd("loadGlues", "Load glue entries", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          [replSuffix]: {
            ...this.state[replSuffix],
            glues: config.items
          },
          replInitLoaded: true,
          replLoading: false
        });
      }).fail(() => {
        this.setState({
          replLoading: false
        });
      });
    }
    loadDSRC() {
      const dsrc_cmd = ["dsctl", "-j", this.props.serverId, "dsrc", "display"];
      log_cmd("loadDSRC", "Check for replication monitor configurations in the .dsrc file", dsrc_cmd);
      cockpit_default.spawn(dsrc_cmd, { superuser: true, err: "message" }).done((dsrc_content) => {
        const content = JSON.parse(dsrc_content);
        const credRows = [];
        const aliasRows = [];
        if ("repl-monitor-connections" in content) {
          const report_config = content["repl-monitor-connections"];
          for (const [connection, value] of Object.entries(report_config)) {
            const conn = connection + ":" + value;
            credRows.push(conn.split(":"));
          }
        }
        if ("repl-monitor-aliases" in content) {
          const report_config = content["repl-monitor-aliases"];
          for (const [alias_name, value] of Object.entries(report_config)) {
            const alias = alias_name + ":" + value;
            aliasRows.push(alias.split(":"));
          }
        }
        this.setState({
          credRows,
          aliasRows,
          replInitLoaded: true
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        console.log(`loadDSRC: Could not load .dsrc file: ${errMsg}`);
        this.setState({
          replLoading: false
        });
      });
    }
    loadWinsyncAgmts(replSuffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "winsync-status",
        "--suffix=" + replSuffix
      ];
      log_cmd("loadWinsyncAgmts", "Load winsync agmt status", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          [replSuffix]: {
            ...this.state[replSuffix],
            replWinsyncAgmts: config.items
          }
        }, this.loadCleanTasks(replSuffix));
      }).fail(() => {
        this.setState({
          replLoading: false
        });
      });
    }
    getAgmts(suffixList, idx) {
      const new_idx = idx + 1;
      if (new_idx > suffixList.length) {
        this.setState({
          replLoading: false,
          disableTree: false
        });
        return;
      }
      const suffix = suffixList[idx];
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "status",
        "--suffix=" + suffix
      ];
      log_cmd("gatherAllReplicaHosts", "Get replication hosts for repl report", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            replAgmts: config.items,
            abortTasks: [],
            cleanTasks: [],
            replWinsyncAgmts: []
          }
        }, () => {
          this.getAgmts(suffixList, new_idx);
        });
      }).fail(() => {
        this.setState({
          replLoading: false,
          disableTree: false
        });
      });
    }
    gatherAllReplicaHosts(treeViewItem, parentItem) {
      if (treeViewItem.name !== "") {
        this.setState({
          replLoading: true,
          activeItems: [treeViewItem, parentItem],
          node_name: treeViewItem.id,
          node_text: treeViewItem.name,
          node_type: treeViewItem.type,
          node_item: treeViewItem.item
        }, () => {
          this.getAgmts(this.state.replicatedSuffixes, 0);
        });
      } else {
        this.enableTree();
      }
    }
    onHandleLoadMonitorReplication(treeViewItem, parentItem) {
      if (treeViewItem.name !== "") {
        this.setState({
          replLoading: true
        });
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "replication",
          "status",
          "--suffix=" + treeViewItem.suffix
        ];
        log_cmd("onHandleLoadMonitorReplication", "Load replication suffix info", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          const config = JSON.parse(content);
          this.loadDSRC();
          this.setState({
            [treeViewItem.suffix]: {
              ...this.state[treeViewItem.suffix],
              replAgmts: config.items,
              abortTasks: [],
              cleanTasks: [],
              replWinsyncAgmts: []
            },
            activeItems: [treeViewItem, parentItem],
            node_name: treeViewItem.id,
            node_text: treeViewItem.name,
            node_type: treeViewItem.type,
            node_item: treeViewItem.item,
            replSuffix: treeViewItem.suffix,
            disableTree: false
          }, this.loadWinsyncAgmts(treeViewItem.suffix));
        }).fail(() => {
          this.setState({
            replLoading: false
          }, this.loadDSRC);
        });
      } else {
        this.enableTree();
      }
    }
    reloadReplAgmts(replSuffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "status",
        "--suffix=" + replSuffix
      ];
      log_cmd("reloadReplAgmts", "Load replication agmts", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          [replSuffix]: {
            ...this.state[replSuffix],
            replAgmts: config.items
          }
        });
      });
    }
    reloadReplWinsyncAgmts(replSuffix) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "winsync-status",
        "--suffix=" + replSuffix
      ];
      log_cmd("reloadReplWinsyncAgmts", "Load winysnc agmts", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          [replSuffix]: {
            ...this.state[replSuffix],
            replWinsyncAgmts: config.items
          }
        });
      });
    }
    enableTree() {
      this.setState({
        disableTree: false
      });
    }
    render() {
      const { nodes } = this.state;
      let monitorPage = "";
      let monitor_element = "";
      let disabled = "tree-view-container";
      if (this.state.disableTree) {
        disabled = "tree-view-container ds-disabled";
      }
      if (this.state.loaded) {
        if (this.state.node_name === "database-monitor" || this.state.node_name === "") {
          if (this.state.ldbmLoading) {
            monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
              /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Text, { component: TextVariants.h3, children: _54("Loading Database Monitor Information ...") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
            ] });
          } else {
            if (this.state.dbEngine === BE_IMPL_MDB2) {
              monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
                DatabaseMonitorMDB,
                {
                  data: this.state.ldbmData,
                  enableTree: this.enableTree,
                  serverId: this.props.serverId
                }
              );
            } else {
              monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
                DatabaseMonitor,
                {
                  data: this.state.ldbmData,
                  enableTree: this.enableTree,
                  serverId: this.props.serverId
                }
              );
            }
          }
        } else if (this.state.node_name === "server-monitor") {
          if (this.state.serverLoading) {
            monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
              /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Text, { component: TextVariants.h3, children: _54("Loading Server Monitor Information ...") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
            ] });
          } else {
            monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
              serverMonitor_default,
              {
                data: this.state.serverData,
                handleReload: this.reloadServer,
                serverId: this.props.serverId,
                disks: this.state.disks,
                handleReloadDisks: this.reloadDisks,
                diskReloadSpinning: this.state.diskReloadSpinning,
                snmpData: this.state.snmpData,
                snmpReload: this.reloadSNMP,
                enableTree: this.enableTree,
                serverTab: this.state.serverTab
              }
            );
          }
        } else if (this.state.node_name === "access-log-monitor") {
          monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
            accesslog_default,
            {
              logLocation: this.state.accesslogLocation,
              enableTree: this.enableTree
            }
          );
        } else if (this.state.node_name === "audit-log-monitor") {
          monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
            auditlog_default,
            {
              logLocation: this.state.auditlogLocation,
              enableTree: this.enableTree
            }
          );
        } else if (this.state.node_name === "auditfail-log-monitor") {
          monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
            auditfaillog_default,
            {
              logLocation: this.state.auditfaillogLocation,
              enableTree: this.enableTree
            }
          );
        } else if (this.state.node_name === "error-log-monitor") {
          monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
            errorlog_default,
            {
              logLocation: this.state.errorlogLocation,
              enableTree: this.enableTree
            }
          );
        } else if (this.state.node_name === "security-log-monitor") {
          monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
            securitylog_default,
            {
              logLocation: this.state.securitylogLocation,
              enableTree: this.enableTree
            }
          );
        } else if (this.state.node_type === "repl-mon") {
          if (this.state.replLoading) {
            monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
              /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Text, { component: TextVariants.h3, children: _54("Loading Replication Monitor Information ...") }) }),
              /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
            ] });
          } else {
            if (this.state.node_name === "sync-report") {
              monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
                replMonitor_default,
                {
                  serverId: this.props.serverId,
                  data: this.state[this.state.replSuffix],
                  credRows: this.state.credRows,
                  aliasRows: this.state.aliasRows,
                  addNotification: this.props.addNotification,
                  enableTree: this.enableTree,
                  handleReload: this.onHandleLoadMonitorReplication
                },
                this.state.node_name
              ) });
            } else if (this.state.node_name === "log-analysis") {
              monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
                replLogAnalysis_default,
                {
                  serverId: this.props.serverId,
                  addNotification: this.props.addNotification,
                  enableTree: this.enableTree,
                  handleReload: this.onHandleLoadMonitorReplication,
                  replicatedSuffixes: this.state.replicatedSuffixes
                },
                this.state.node_name
              ) });
            } else if (this.state.node_item === "agmt-mon") {
              monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
                replMonAgmts_default,
                {
                  suffix: this.state.replSuffix,
                  serverId: this.props.serverId,
                  data: this.state[this.state.replSuffix],
                  addNotification: this.props.addNotification,
                  reloadAgmts: this.reloadReplAgmts,
                  enableTree: this.enableTree,
                  handleReload: this.onHandleLoadMonitorReplication
                },
                this.state.node_name
              ) });
            } else if (this.state.node_item === "winsync-mon") {
              monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
                replMonWinsync_default,
                {
                  suffix: this.state.replSuffix,
                  serverId: this.props.serverId,
                  data: this.state[this.state.replSuffix],
                  addNotification: this.props.addNotification,
                  reloadAgmts: this.reloadReplWinsyncAgmts,
                  enableTree: this.enableTree,
                  handleReload: this.onHandleLoadMonitorReplication
                },
                this.state.node_name
              ) });
            } else if (this.state.node_item === "task-mon") {
              monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
                replMonTasks_default,
                {
                  suffix: this.state.replSuffix,
                  serverId: this.props.serverId,
                  data: this.state[this.state.replSuffix],
                  addNotification: this.props.addNotification,
                  enableTree: this.enableTree,
                  handleReload: this.onHandleLoadMonitorReplication
                },
                this.state.node_name
              ) });
            } else if (this.state.node_item === "conflict-mon") {
              monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
                replMonConflict_default,
                {
                  suffix: this.state.replSuffix,
                  serverId: this.props.serverId,
                  data: this.state[this.state.replSuffix],
                  addNotification: this.props.addNotification,
                  reloadConflicts: this.loadConflicts,
                  enableTree: this.enableTree,
                  handleReload: this.onHandleLoadMonitorReplication
                },
                this.state.node_name
              ) });
            }
          }
        } else if (this.state.node_name !== "") {
          if (this.state.chainingLoading) {
            monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
              /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Text, { component: TextVariants.h3, children: 'cockpit.format(_("Loading Chaining Monitor Information for $0 ..."), this.state.node_text)' }) }),
              /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
            ] });
          } else {
            if (this.state.node_type === "dblink") {
              monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
                chainingMonitor_default,
                {
                  suffix: this.state.node_text,
                  bename: this.state.bename,
                  reload: this.loadMonitorChaining,
                  data: this.state[this.state.node_text].chainingData,
                  enableTree: this.enableTree
                },
                this.state.node_text
              );
            } else {
              if (this.state.dbEngine === BE_IMPL_MDB2) {
                monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
                  SuffixMonitorMDB,
                  {
                    serverId: this.props.serverId,
                    suffix: this.state.node_text,
                    bename: this.state.bename,
                    enableTree: this.enableTree,
                    addNotification: this.props.addNotification
                  },
                  this.state.node_text
                );
              } else {
                monitor_element = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
                  SuffixMonitor,
                  {
                    serverId: this.props.serverId,
                    suffix: this.state.node_text,
                    bename: this.state.bename,
                    enableTree: this.enableTree,
                    addNotification: this.props.addNotification
                  },
                  this.state.node_text
                );
              }
            }
          }
        }
        monitorPage = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "container-fluid", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "ds-container", children: [
          /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Card, { className: "ds-tree", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: disabled, id: "monitor-tree", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
            TreeView,
            {
              hasSelectableNodes: true,
              data: nodes,
              activeItems: this.state.activeItems,
              onSelect: this.handleTreeClick
            }
          ) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "ds-tree-content", children: monitor_element })
        ] }) });
      } else {
        monitorPage = /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Text, { component: TextVariants.h3, children: _54("Loading Monitor Information ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { children: monitorPage });
    }
  };
  Monitor.propTypes = {
    addNotification: import_prop_types53.default.func,
    serverId: import_prop_types53.default.string
  };
  Monitor.defaultProps = {
    serverId: ""
  };

  // src/schema.jsx
  var import_react127 = __toESM(require_react(), 1);

  // src/lib/schema/schemaTables.jsx
  var import_react125 = __toESM(require_react(), 1);
  var import_prop_types54 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1);
  var _55 = cockpit_default.gettext;
  var ObjectClassesTable = class extends import_react125.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _55("Edit Objectclass"),
          onClick: () => this.props.editModalHandler(rowData.cells[0].content)
        },
        {
          isSeparator: true
        },
        {
          title: _55("Delete Objectclass"),
          onClick: () => this.props.deleteHandler(rowData.cells[0].content)
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          {
            title: _55("Objectclass Name"),
            sortable: true
          },
          {
            title: _55("OID"),
            sortable: true
          }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    handleSort(_event, columnIndex, direction) {
      const rows = [...this.state.rows];
      rows.sort((a2, b) => a2.cells[columnIndex].content > b.cells[columnIndex].content ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        rows.reverse();
      }
      this.setState({
        sortBy: {
          index: columnIndex,
          direction
        },
        rows,
        page: 1
      });
    }
    handleCollapse(_event, rowIndex, isExpanding) {
      const rows = [...this.state.rows];
      const index = this.state.perPage * (this.state.page - 1) + rowIndex;
      rows[index].isOpen = isExpanding;
      this.setState({ rows });
    }
    handleSearchChange(event, value) {
      const rows = [];
      const val = value.toLowerCase();
      for (const row of this.props.rows) {
        if (val !== "" && row.name[0].toLowerCase().indexOf(val) === -1 && row.oid[0].toLowerCase().indexOf(val) === -1) {
          continue;
        }
        let user_defined = false;
        if (row.x_origin.length > 0 && row.x_origin.indexOf("user defined") !== -1) {
          user_defined = true;
        }
        rows.push({
          isOpen: false,
          cells: [
            { content: row.name[0] },
            { content: row.oid[0] }
          ],
          disableActions: !user_defined,
          originalData: row
        });
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    getExpandedRow(row) {
      const kinds = ["STRUCTURAL", "ABSTRACT", "AUXILIARY"];
      const desc = row.desc ? row.desc[0] : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("i", { children: _55("No description") });
      const x_org = row.x_origin.join(" ");
      return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Grid, { className: "ds-left-indent-lg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: "Description:" }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: desc }) }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: "X-Origin:" }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: x_org }) }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: "Superior Objectclass:" }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: row.sup[0] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: "Kind:" }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: kinds[row.kind] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: "Requires Attributes:" }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: row.must.join(", ") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: "Allowed Attributes:" }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: row.may.join(", ") }) })
      ] });
    }
    componentDidMount() {
      const rows = [];
      for (const row of this.props.rows) {
        let user_defined = false;
        if (row.x_origin.length > 0 && row.x_origin.indexOf("user defined") !== -1) {
          user_defined = true;
        }
        rows.push({
          isOpen: false,
          cells: [
            { content: row.name[0] },
            { content: row.oid[0] }
          ],
          disableActions: !user_defined,
          originalData: row
        });
      }
      this.setState({
        rows
      });
    }
    render() {
      const { perPage, page, sortBy, rows, columns } = this.state;
      const startIdx = perPage * page - perPage;
      const tableRows = rows.slice(startIdx, startIdx + perPage);
      let content = /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "ds-center ds-margin-top-xlg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Text, { component: TextVariants.h3, children: _55("Loading Objectclasses ...") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
      ] });
      if (!this.props.loading) {
        content = /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { children: [
          /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
            SearchInput,
            {
              placeholder: _55("Search Objectclasses"),
              value: this.state.value,
              onChange: this.handleSearchChange,
              onClear: (evt) => this.handleSearchChange(evt, "")
            }
          ) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
            Table,
            {
              "aria-label": "objectclasses table",
              variant: "compact",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Tr, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Th, { screenReaderText: "Row expansion" }),
                  columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
                    Th,
                    {
                      sort: column.sortable ? {
                        sortBy,
                        onSort: this.handleSort,
                        columnIndex
                      } : void 0,
                      children: column.title
                    },
                    columnIndex
                  )),
                  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Th, { screenReaderText: "Actions" })
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_react125.default.Fragment, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Tr, { children: [
                    /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
                      Td,
                      {
                        expand: {
                          rowIndex,
                          isExpanded: row.isOpen,
                          onToggle: () => this.handleCollapse(null, rowIndex, !row.isOpen)
                        }
                      }
                    ),
                    row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Td, { children: cell.content }, cellIndex)),
                    /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
                      ActionsColumn,
                      {
                        items: this.getActionsForRow(row),
                        isDisabled: row.disableActions
                      }
                    ) })
                  ] }),
                  row.isOpen && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Tr, { isExpanded: true, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Td, { colSpan: columns.length + 2, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ExpandableRowContent, { children: this.getExpandedRow(row.originalData) }) }) })
                ] }, rowIndex)) })
              ]
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
            Pagination,
            {
              itemCount: rows.length,
              widgetId: "pagination-options-menu-bottom",
              perPage,
              page,
              variant: "bottom",
              onSetPage: this.handleSetPage,
              onPerPageSelect: this.handlePerPageSelect
            }
          )
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "ds-margin-top-lg", children: content });
    }
  };
  ObjectClassesTable.propTypes = {
    rows: import_prop_types54.default.array,
    editModalHandler: import_prop_types54.default.func,
    deleteHandler: import_prop_types54.default.func
  };
  ObjectClassesTable.defaultProps = {
    rows: []
  };
  var AttributesTable = class extends import_react125.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _55("Edit Attribute"),
          onClick: () => this.props.editModalHandler(rowData.cells[0].content)
        },
        {
          title: _55("Delete Attribute"),
          onClick: () => this.props.deleteHandler(rowData.cells[0].content)
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        noRows: true,
        columns: [
          {
            title: _55("Attribute Name"),
            sortable: true
          },
          { title: _55("OID"), sortable: true },
          { title: _55("Syntax"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
          // reset page back to 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    handleSort(_event, columnIndex, direction) {
      const sorted_rows = [];
      const rows = [];
      let count = 0;
      for (let idx = 0; idx < this.state.rows.length; idx += 2) {
        sorted_rows.push({
          expandedRow: this.state.rows[idx + 1],
          1: this.state.rows[idx].cells[0].content,
          2: this.state.rows[idx].cells[1].content,
          3: this.state.rows[idx].cells[2].content,
          not_user_defined: this.state.rows[idx].disableActions,
          originalData: this.state.rows[idx].originalData
        });
      }
      sorted_rows.sort((a2, b) => a2[columnIndex + 1] > b[columnIndex + 1] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_rows.reverse();
      }
      for (const srow of sorted_rows) {
        rows.push({
          isOpen: false,
          cells: [
            { content: srow[1] },
            { content: srow[2] },
            { content: srow[3] }
          ],
          disableActions: srow.not_user_defined,
          originalData: srow.originalData
        });
        srow.expandedRow.parent = count;
        rows.push(srow.expandedRow);
        count += 2;
      }
      this.setState({
        sortBy: {
          index: columnIndex,
          direction
        },
        rows,
        page: 1
      });
    }
    getExpandedRow(row) {
      const desc = row.desc ? row.desc[0] : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("i", { children: _55("No description") });
      const x_org = row.x_origin.join(", ");
      const usage = ["userApplications", "directoryOperation", "distributedOperation", "dSAOperation"];
      return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Grid, { className: "ds-left-indent-lg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: _55("Description:") }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: desc }) }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: _55("X-Origin:") }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: x_org }) }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: _55("Aliases:") }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: row.aliases ? row.aliases.join(", ") : "" }) }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: _55("Parent Attribute:") }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: row.sup.join(", ") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: _55("Read Only:") }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: row.no_user_mod ? "Yes" : "No" }) }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: _55("Multivalued:") }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: row.single_value ? "No" : "Yes" }) }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: _55("Usage:") }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: usage[row.usage] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: _55("Equality Matching Rules:") }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: row.equality ? row.equality.join(", ") : "" }) }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: _55("Substring Matching Rules:") }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: row.substr ? row.substr.join(", ") : "" }) }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: _55("Ordering Matching Rules:") }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("b", { children: row.ordering ? row.ordering.join(", ") : "" }) })
      ] });
    }
    getOIDContent(oid) {
      for (const syntax of this.props.syntaxes) {
        if (oid == syntax.id) {
          return oid + " (" + syntax.label + ")";
        }
      }
      return oid + " (Unknown)";
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      let noRows = false;
      for (const row of this.props.rows) {
        let user_defined = row.x_origin.includes("user defined");
        rows.push({
          isOpen: false,
          cells: [
            { content: row.name[0] },
            { content: row.oid[0] },
            { content: this.getOIDContent(row.syntax[0]) }
          ],
          disableActions: !user_defined,
          originalData: row
        });
      }
      if (rows.length === 0) {
        noRows = true;
        rows = [{ cells: [{ content: _55("No Attributes") }] }];
        columns = [{ title: _55("Attributes") }];
      }
      this.setState({
        rows,
        columns,
        noRows
      });
    }
    handleCollapse(event, rowKey, isOpen) {
      const { rows, perPage, page } = this.state;
      const index = perPage * (page - 1) + rowKey;
      rows[index].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      const val = value.toLowerCase();
      let count = 0;
      for (const row of this.props.rows) {
        let user_defined = false;
        if (val !== "" && row.name[0].toLowerCase().indexOf(val) === -1 && row.oid[0].toLowerCase().indexOf(val) === -1 && row.syntax[0].toLowerCase().indexOf(val) === -1) {
          continue;
        }
        if (row.x_origin.length > 0 && row.x_origin.indexOf("user defined") !== -1) {
          user_defined = true;
        }
        rows.push(
          {
            isOpen: false,
            cells: [
              { content: row.name[0] },
              { content: row.oid[0] },
              { content: this.getOIDContent(row.syntax[0]) }
            ],
            disableActions: !user_defined,
            originalData: row
          }
        );
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const { perPage, page, sortBy, rows, columns } = this.state;
      const startIdx = perPage * page - perPage;
      const tableRows = rows.slice(startIdx, startIdx + perPage);
      let content = /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "ds-center ds-margin-top-xlg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Text, { component: TextVariants.h3, children: _55("Loading Attributes ...") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
      ] });
      if (!this.props.loading) {
        content = /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { children: [
          /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
            SearchInput,
            {
              placeholder: _55("Search Attributes"),
              value: this.state.value,
              onChange: this.handleSearchChange,
              onClear: (evt) => this.handleSearchChange(evt, "")
            }
          ) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
            Table,
            {
              "aria-label": "attributes table",
              variant: "compact",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Tr, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Th, { screenReaderText: "Row expansion" }),
                  columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
                    Th,
                    {
                      sort: column.sortable ? {
                        sortBy,
                        onSort: this.handleSort,
                        columnIndex
                      } : void 0,
                      children: column.title
                    },
                    columnIndex
                  )),
                  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Th, { screenReaderText: "Actions" })
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_react125.default.Fragment, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Tr, { children: [
                    /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
                      Td,
                      {
                        expand: {
                          rowIndex,
                          isExpanded: row.isOpen,
                          onToggle: () => this.handleCollapse(null, rowIndex, !row.isOpen)
                        }
                      }
                    ),
                    row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Td, { children: cell.content }, cellIndex)),
                    /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
                      ActionsColumn,
                      {
                        items: this.getActionsForRow(row),
                        isDisabled: row.disableActions
                      }
                    ) })
                  ] }),
                  row.isOpen && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Tr, { isExpanded: true, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Td, { colSpan: columns.length + 2, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ExpandableRowContent, { children: this.getExpandedRow(row.originalData) }) }) })
                ] }, rowIndex)) })
              ]
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
            Pagination,
            {
              itemCount: rows.length,
              widgetId: "pagination-options-menu-bottom",
              perPage,
              page,
              variant: "bottom",
              onSetPage: this.handleSetPage,
              onPerPageSelect: this.handlePerPageSelect
            }
          )
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "ds-margin-top-lg", children: content });
    }
  };
  AttributesTable.propTypes = {
    rows: import_prop_types54.default.array,
    editModalHandler: import_prop_types54.default.func,
    deleteHandler: import_prop_types54.default.func,
    loading: import_prop_types54.default.bool
  };
  AttributesTable.defaultProps = {
    rows: [],
    syntaxes: [],
    loading: false
  };
  var MatchingRulesTable = class extends import_react125.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _55("Matching Rule"), sortable: true },
          { title: _55("OID"), sortable: true },
          { title: _55("Syntax"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    handleSort(_event, columnIndex, direction) {
      const sorted_rows = [];
      const rows = [];
      let count = 0;
      for (let idx = 0; idx < this.state.rows.length; idx += 2) {
        sorted_rows.push({
          expandedRow: this.state.rows[idx + 1],
          1: this.state.rows[idx].cells[0].content,
          2: this.state.rows[idx].cells[1].content,
          3: this.state.rows[idx].cells[2].content
        });
      }
      sorted_rows.sort((a2, b) => a2[columnIndex + 1] > b[columnIndex + 1] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_rows.reverse();
      }
      for (const srow of sorted_rows) {
        rows.push({
          isOpen: false,
          cells: [
            { content: srow[1] },
            { content: srow[2] },
            { content: srow[3] }
          ]
        });
        rows.push({
          ...srow.expandedRow,
          parent: count
        });
        count += 2;
      }
      this.setState({
        sortBy: {
          index: columnIndex,
          direction
        },
        rows,
        page: 1
      });
    }
    getExpandedRow(row) {
      let desc = _55("No description");
      if (row.desc) {
        desc = row.desc[0];
      }
      return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { offset: 1, span: 10, children: desc }) });
    }
    handleCollapse(_event, rowIndex, isExpanding) {
      const rows = [...this.state.rows];
      const index = this.state.perPage * (this.state.page - 1) * 2 + rowIndex;
      rows[index].isOpen = isExpanding;
      this.setState({ rows });
    }
    componentDidMount() {
      let rows = [];
      let count = 0;
      for (const row of this.props.rows) {
        rows.push(
          {
            isOpen: false,
            cells: [
              { content: row.name[0] },
              { content: row.oid[0] },
              { content: row.syntax[0] }
            ]
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ content: this.getExpandedRow(row) }]
          }
        );
        count += 2;
      }
      if (rows.length === 0) {
        rows = [{ cells: [{ content: "No Matching Rules" }] }];
        this.setState({
          columns: [{ title: "Matching Rules" }]
        });
      }
      this.setState({ rows });
    }
    handleSearchChange(event, value) {
      const rows = [];
      let count = 0;
      for (const row of this.props.rows) {
        const val = value.toLowerCase();
        let name2 = "";
        if (row.names && row.names.length > 0) {
          name2 = row.name[0];
        }
        if (name2.toLowerCase().indexOf(val) === -1 && row.oid[0].toLowerCase().indexOf(val) === -1 && row.syntax[0].toLowerCase().indexOf(val) === -1) {
          continue;
        }
        rows.push(
          {
            isOpen: false,
            cells: [
              { content: name2 || /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("i", { children: [
                "<",
                _55("No Name"),
                ">"
              ] }) },
              { content: row.oid[0] },
              { content: row.syntax[0] }
            ]
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ content: this.getExpandedRow(row) }]
          }
        );
        count += 2;
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const { perPage, page, sortBy, rows, columns } = this.state;
      const startIdx = (perPage * page - perPage) * 2;
      const tableRows = rows.slice(startIdx, startIdx + perPage * 2);
      const displayRows = tableRows.filter((row, index) => index % 2 === 0);
      const expandedContent = tableRows.filter((row, index) => index % 2 === 1);
      return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
          SearchInput,
          {
            placeholder: _55("Search Matching Rules"),
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "matching rules table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Tr, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Th, { screenReaderText: "Row expansion" }),
                columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy,
                      onSort: this.handleSort,
                      columnIndex
                    } : void 0,
                    children: column.title
                  },
                  columnIndex
                ))
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Tbody, { children: displayRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_react125.default.Fragment, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Tr, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
                    Td,
                    {
                      expand: {
                        rowIndex,
                        isExpanded: row.isOpen,
                        onToggle: () => this.handleCollapse(null, rowIndex * 2, !row.isOpen)
                      }
                    }
                  ),
                  row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Td, { children: cell.content }, cellIndex))
                ] }),
                row.isOpen && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Tr, { isExpanded: true, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Td, { colSpan: columns.length + 1, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ExpandableRowContent, { children: expandedContent[rowIndex].cells[0].content }) }) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
          Pagination,
          {
            itemCount: rows.length / 2,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  MatchingRulesTable.propTypes = {
    rows: import_prop_types54.default.array
  };
  MatchingRulesTable.defaultProps = {
    rows: []
  };

  // src/lib/schema/schemaModals.jsx
  var import_react126 = __toESM(require_react(), 1);
  var import_prop_types55 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1);
  var _56 = cockpit_default.gettext;
  var ObjectClassModal = class extends import_react126.default.Component {
    render() {
      const {
        newOcEntry,
        ocModalViewOnly,
        addHandler,
        editHandler,
        handleFieldChange,
        objectclasses,
        attributes,
        ocName,
        ocDesc,
        ocOID,
        ocParent,
        ocKind,
        ocMust,
        ocMay,
        objectclassModalShow,
        closeModal,
        loading,
        isRequiredAttrsOpen,
        isAllowedAttrsOpen,
        onRequiredAttrsToggle,
        onRequiredAttrsClear,
        onRequiredAttrsSelect,
        onRequiredAttrsCreateOption,
        onAllowedAttrsToggle,
        onAllowedAttrsClear,
        onAllowedAttrsSelect,
        onAllowedAttrsCreateOption,
        error,
        saveBtnDisabled
      } = this.props;
      const modalTitle = ocModalViewOnly ? cockpit_default.format(_56("View ObjectClass - $0"), ocName) : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
        cockpit_default.format(_56("$0 ObjectClass"), newOcEntry ? _56("Add") : _56("Edit")),
        ocName !== "" ? ` - ${ocName}` : "",
        " "
      ] });
      const btnList = [
        /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { variant: "link", onClick: closeModal, children: _56("Close") }, "cancel")
      ];
      if (!ocModalViewOnly) {
        let btnText = _56("Save");
        const extraPrimaryProps = {};
        if (loading) {
          btnText = _56("Saving...");
          extraPrimaryProps.spinnerAriaValueText = _56("Loading");
        }
        btnList.unshift(
          /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
            Button,
            {
              isLoading: loading,
              spinnerAriaValueText: loading ? _56("Loading") : void 0,
              variant: "primary",
              onClick: newOcEntry ? addHandler : editHandler,
              ...extraPrimaryProps,
              isDisabled: saveBtnDisabled || loading,
              children: btnText
            },
            "oc"
          )
        );
      }
      return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title: modalTitle,
          isOpen: objectclassModalShow,
          onClose: closeModal,
          actions: btnList,
          children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("Name of the objectClass"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("Objectclass Name") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                TextInput,
                {
                  value: ocName,
                  type: "text",
                  id: "ocName",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "ocName",
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  },
                  validated: error.ocName ? ValidatedOptions.error : ValidatedOptions.default,
                  isDisabled: !newOcEntry
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("Describes what is the objectClass's purpose"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("Description") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                TextInput,
                {
                  value: ocDesc,
                  type: "text",
                  id: "ocDesc",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "ocDesc",
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  },
                  validated: error.ocDesc ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("Object identifier"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("OID (optional)") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                TextInput,
                {
                  value: ocOID,
                  type: "text",
                  id: "ocOID",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "ocOID",
                  isDisabled: ocModalViewOnly,
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("An objectClass's parent"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("Parent Objectclass") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                FormSelect,
                {
                  id: "ocParent",
                  value: ocParent,
                  isDisabled: ocModalViewOnly,
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  },
                  "aria-label": "FormSelect Input",
                  children: objectclasses.map((obj, index) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FormSelectOption, { value: obj, label: obj }, index))
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("An objectClass's kind"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("Objectclass Kind") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
                FormSelect,
                {
                  id: "ocKind",
                  value: ocKind,
                  isDisabled: ocModalViewOnly,
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  },
                  "aria-label": "FormSelect Input",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FormSelectOption, { value: "STRUCTURAL", label: "STRUCTURAL" }, 0),
                    /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FormSelectOption, { value: "ABSTRACT", label: "ABSTRACT" }, 1),
                    /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FormSelectOption, { value: "AUXILIARY", label: "AUXILIARY" }, 2)
                  ]
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("A must attribute name"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("Required Attributes") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                dsBasicComponents_default,
                {
                  selected: ocMust,
                  onSelect: onRequiredAttrsSelect,
                  onClear: onRequiredAttrsClear,
                  options: attributes,
                  isOpen: isRequiredAttrsOpen,
                  onToggle: onRequiredAttrsToggle,
                  placeholder: _56("Type an attribute name..."),
                  noResultsText: _56("There are no matching entries"),
                  ariaLabel: "Type an attribute name",
                  isMulti: true,
                  isCreatable: true,
                  onCreateOption: onRequiredAttrsCreateOption
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("A may attribute name"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("Allowed Attributes") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                dsBasicComponents_default,
                {
                  selected: ocMay,
                  onSelect: onAllowedAttrsSelect,
                  onClear: onAllowedAttrsClear,
                  options: attributes,
                  isOpen: isAllowedAttrsOpen,
                  onToggle: onAllowedAttrsToggle,
                  placeholder: _56("Type an attribute name..."),
                  noResultsText: _56("There are no matching entries"),
                  ariaLabel: "Type an attribute name",
                  isMulti: true,
                  isCreatable: true,
                  onCreateOption: onAllowedAttrsCreateOption
                }
              ) })
            ] })
          ] })
        }
      ) });
    }
  };
  ObjectClassModal.propTypes = {
    addHandler: import_prop_types55.default.func,
    editHandler: import_prop_types55.default.func,
    newOcEntry: import_prop_types55.default.bool,
    ocModalViewOnly: import_prop_types55.default.bool,
    handleTypeaheadChange: import_prop_types55.default.func,
    handleFieldChange: import_prop_types55.default.func,
    objectclasses: import_prop_types55.default.array,
    attributes: import_prop_types55.default.array,
    ocName: import_prop_types55.default.string,
    ocDesc: import_prop_types55.default.string,
    ocOID: import_prop_types55.default.string,
    ocParent: import_prop_types55.default.string,
    ocKind: import_prop_types55.default.string,
    ocMust: import_prop_types55.default.array,
    ocMay: import_prop_types55.default.array,
    objectclassModalShow: import_prop_types55.default.bool,
    closeModal: import_prop_types55.default.func,
    loading: import_prop_types55.default.bool
  };
  ObjectClassModal.defaultProps = {
    newOcEntry: true,
    ocModalViewOnly: false,
    objectclasses: [],
    attributes: [],
    ocName: "",
    ocDesc: "",
    ocOID: "",
    ocParent: "",
    ocKind: "",
    ocMust: [],
    ocMay: [],
    objectclassModalShow: false,
    loading: false
  };
  var AttributeTypeModal = class extends import_react126.default.Component {
    render() {
      const {
        atName,
        atDesc,
        atOID,
        atParent,
        atSyntax,
        atUsage,
        atMultivalued,
        atNoUserMod,
        atAlias,
        atEqMr,
        atOrder,
        atSubMr,
        atModalViewOnly,
        attributeModalShow,
        newAtEntry,
        addHandler,
        editHandler,
        handleFieldChange,
        attributes,
        syntaxes,
        matchingrules,
        closeModal,
        loading,
        isParentAttrOpen,
        isAliasNameOpen,
        isEqualityMROpen,
        isOrderMROpen,
        isSubstringMROpen,
        onParentAttrToggle,
        onParentAttrClear,
        onParentAttrSelect,
        onAliasNameToggle,
        onAliasNameClear,
        onAliasNameSelect,
        onAliasNameCreateOption,
        onEqualityMRToggle,
        onEqualityMRClear,
        onEqualityMRSelect,
        onOrderMRToggle,
        onOrderMRClear,
        onOrderMRSelect,
        onSubstringMRToggle,
        onSubstringMRClear,
        onSubstringMRSelect,
        error,
        saveBtnDisabled
      } = this.props;
      const modalTitle = atModalViewOnly ? cockpit_default.format(_56("View Attribute - $0"), atName) : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
        cockpit_default.format(_56("$0 Attribute"), newAtEntry ? _56("Add") : _56("Edit")),
        atName !== "" ? ` - ${atName}` : "",
        " "
      ] });
      const btnList = [
        /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { variant: "link", onClick: closeModal, children: _56("Close") }, "cancel")
      ];
      if (!atModalViewOnly) {
        let btnText = _56("Save");
        const extraPrimaryProps = {};
        if (loading) {
          btnText = _56("Saving...");
          extraPrimaryProps.spinnerAriaValueText = _56("Loading");
        }
        btnList.unshift(
          /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
            Button,
            {
              isLoading: loading,
              spinnerAriaValueText: loading ? _56("Loading") : void 0,
              variant: "primary",
              onClick: newAtEntry ? addHandler : editHandler,
              ...extraPrimaryProps,
              isDisabled: saveBtnDisabled || loading,
              children: btnText
            },
            "at"
          )
        );
      }
      return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title: modalTitle,
          isOpen: attributeModalShow,
          onClose: closeModal,
          actions: btnList,
          children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("Name of the attribute"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("Attribute Name") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                TextInput,
                {
                  value: atName,
                  type: "text",
                  id: "atName",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "atName",
                  isDisabled: !newAtEntry,
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  },
                  validated: error.atName ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("Describes what is the attribute's purpose"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("Description") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                TextInput,
                {
                  value: atDesc,
                  type: "text",
                  id: "atDesc",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "atDesc",
                  isDisabled: atModalViewOnly,
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  },
                  validated: error.atDesc ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("Object identifier"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("OID (optional)") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                TextInput,
                {
                  value: atOID,
                  type: "text",
                  id: "atOID",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "atOID",
                  isDisabled: atModalViewOnly,
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("An attribute's parent/superior"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("Parent Attribute") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                dsBasicComponents_default,
                {
                  selected: atParent,
                  onSelect: onParentAttrSelect,
                  onClear: onParentAttrClear,
                  options: attributes,
                  isOpen: isParentAttrOpen,
                  onToggle: onParentAttrToggle,
                  placeholder: _56("Type an attribute name..."),
                  noResultsText: _56("There are no matching entries"),
                  ariaLabel: "Type an attribute name"
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("An attribute's syntax"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("Syntax Name") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                FormSelect,
                {
                  id: "atSyntax",
                  value: atSyntax,
                  isDisabled: atModalViewOnly,
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  },
                  "aria-label": "FormSelect Input",
                  children: syntaxes.map((syntax, index) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FormSelectOption, { value: syntax.id, label: syntax.label }, index))
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("An attribute's usage purpose"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("Attribute Usage") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
                FormSelect,
                {
                  id: "atUsage",
                  value: atUsage,
                  isDisabled: atModalViewOnly,
                  onChange: (e, str) => {
                    handleFieldChange(e);
                  },
                  "aria-label": "FormSelect Input",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FormSelectOption, { value: "userApplications", label: "userApplications" }, 0),
                    /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FormSelectOption, { value: "directoryOperation", label: "directoryOperation" }, 1),
                    /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FormSelectOption, { value: "distributedOperation", label: "distributedOperation" }, 2),
                    /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FormSelectOption, { value: "dSAOperation", label: "dSAOperation" }, 3)
                  ]
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("If attribute can have a multiple values"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("Multivalued Attribute") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                Checkbox,
                {
                  id: "atMultivalued",
                  isChecked: atMultivalued,
                  title: _56("If attribute can have a multiple values"),
                  onChange: (e, checked) => {
                    handleFieldChange(e);
                  },
                  isDisabled: atModalViewOnly
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("If attribute is not modifiable by a client application"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("Not Modifiable By A User") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                Checkbox,
                {
                  id: "atNoUserMod",
                  isChecked: atNoUserMod,
                  title: _56("If attribute is not modifiable by a client application"),
                  onChange: (e, checked) => {
                    handleFieldChange(e);
                  },
                  isDisabled: atModalViewOnly
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("An alias name for the attribute"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("Alias Names") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                dsBasicComponents_default,
                {
                  selected: atAlias,
                  onSelect: onAliasNameSelect,
                  onClear: onAliasNameClear,
                  options: atAlias,
                  isOpen: isAliasNameOpen,
                  onToggle: onAliasNameToggle,
                  placeholder: _56("Type an alias name..."),
                  noResultsText: _56("There are no matching entries"),
                  ariaLabel: "Type an alias name",
                  isMulti: true,
                  isCreatable: true,
                  onCreateOption: onAliasNameCreateOption
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("An equality matching rule"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("Equality Matching Rule") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                dsBasicComponents_default,
                {
                  selected: atEqMr,
                  onSelect: onEqualityMRSelect,
                  onClear: onEqualityMRClear,
                  options: matchingrules,
                  isOpen: isEqualityMROpen,
                  onToggle: onEqualityMRToggle,
                  placeholder: _56("Type an Equality matching rule..."),
                  noResultsText: _56("There are no matching rules"),
                  ariaLabel: "Type a matching rule"
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("An order matching rule"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("Order Matching Rule") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                dsBasicComponents_default,
                {
                  selected: atOrder,
                  onSelect: onOrderMRSelect,
                  onClear: onOrderMRClear,
                  options: matchingrules,
                  isOpen: isOrderMROpen,
                  onToggle: onOrderMRToggle,
                  placeholder: _56("Type an Ordering matching rule.."),
                  noResultsText: _56("There are no matching rules"),
                  ariaLabel: "Type a matching rule"
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Grid, { title: _56("A substring matching rule"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { className: "ds-label", span: 3, children: _56("Substring Matching Rule") }),
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                dsBasicComponents_default,
                {
                  selected: atSubMr,
                  onSelect: onSubstringMRSelect,
                  onClear: onSubstringMRClear,
                  options: matchingrules,
                  isOpen: isSubstringMROpen,
                  onToggle: onSubstringMRToggle,
                  placeholder: _56("Type a Substring matching rule..."),
                  noResultsText: _56("There are no matching rules"),
                  ariaLabel: "Type a matching rule"
                }
              ) })
            ] })
          ] })
        }
      ) });
    }
  };
  AttributeTypeModal.propTypes = {
    addHandler: import_prop_types55.default.func,
    editHandler: import_prop_types55.default.func,
    handleTypeaheadChange: import_prop_types55.default.func,
    handleFieldChange: import_prop_types55.default.func,
    attributes: import_prop_types55.default.array,
    matchingrules: import_prop_types55.default.array,
    syntaxes: import_prop_types55.default.array,
    atName: import_prop_types55.default.string,
    atDesc: import_prop_types55.default.string,
    atOID: import_prop_types55.default.string,
    atParent: import_prop_types55.default.string,
    atSyntax: import_prop_types55.default.string,
    atUsage: import_prop_types55.default.string,
    atMultivalued: import_prop_types55.default.bool,
    atNoUserMod: import_prop_types55.default.bool,
    atAlias: import_prop_types55.default.array,
    atEqMr: import_prop_types55.default.string,
    atOrder: import_prop_types55.default.string,
    atSubMr: import_prop_types55.default.string,
    atModalViewOnly: import_prop_types55.default.bool,
    attributeModalShow: import_prop_types55.default.bool,
    newAtEntry: import_prop_types55.default.bool,
    closeModal: import_prop_types55.default.func,
    loading: import_prop_types55.default.bool
  };
  AttributeTypeModal.defaultProps = {
    attributes: [],
    matchingrules: [],
    syntaxes: [],
    atName: "",
    atDesc: "",
    atOID: "",
    atParent: "",
    atSyntax: "",
    atUsage: "userApplications",
    atMultivalued: false,
    atNoUserMod: false,
    atAlias: [],
    atEqMr: "",
    atOrder: "",
    atSubMr: "",
    atModalViewOnly: false,
    attributeModalShow: false,
    newAtEntry: true,
    loading: false
  };

  // src/schema.jsx
  var import_prop_types56 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1);
  var _57 = cockpit_default.gettext;
  var Schema = class extends import_react127.default.Component {
    componentDidUpdate(prevProps) {
      if (this.props.wasActiveList.includes(4)) {
        if (this.state.firstLoad) {
          this.loadSyntaxesFirst();
        } else {
          if (this.props.serverId !== prevProps.serverId) {
            this.loadSyntaxesFirst();
          }
        }
      }
    }
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        loading: false,
        activeTabKey: 0,
        objectclassRows: [],
        filteredObjectclassRows: [],
        attributesRows: [],
        filteredAttributesRows: [],
        matchingrulesRows: [],
        syntaxes: [],
        attributes: [],
        objectclasses: [],
        matchingrules: [],
        deleteName: "",
        ocTableKey: 0,
        attrTableKey: 0,
        errObj: {},
        saveBtnDisabled: true,
        ocModalViewOnly: false,
        ocName: "",
        ocDesc: "",
        ocOID: "",
        ocParent: "",
        ocParentOptions: [],
        ocKind: "",
        ocMust: [],
        ocMustOptions: [],
        ocMay: [],
        ocMayOptions: [],
        ocUserDefined: false,
        objectclassModalShow: false,
        newOcEntry: true,
        ocTableLoading: false,
        ocModalLoading: false,
        atName: "",
        atDesc: "",
        atOID: "",
        atParent: "",
        atParentOptions: [],
        atSyntax: "",
        atUsage: "userApplications",
        atMultivalued: false,
        atNoUserMod: false,
        atAlias: [],
        atAliasOptions: [],
        atEqMr: "",
        atOrder: "",
        atSubMr: "",
        atUserDefined: false,
        atModalViewOnly: false,
        attributeModalShow: false,
        newAtEntry: true,
        atTableLoading: false,
        atModalLoading: false,
        isParentObjOpen: false,
        isRequiredAttrsOpen: false,
        isAllowedAttrsOpen: false,
        isParentAttrOpen: false,
        isAliasNameOpen: false,
        isEqualityMROpen: false,
        isOrderMROpen: false,
        isSubstringMROpen: false
      };
      this.handleSubstringMRToggle = (_event, isSubstringMROpen) => {
        this.setState({
          isSubstringMROpen
        });
      };
      this.handleSubstringMRClear = () => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        this.setState({
          atSubMr: "",
          isSubstringMROpen: false
        }, () => {
          this.onAttrChange(e);
        });
      };
      this.handleSubstringMRSelect = (event, selection) => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        if (this.state.atSubMr === selection) {
          this.setState({
            atSubMr: selection,
            isSubstringMROpen: false
          }, () => {
            this.onAttrChange(e);
          });
        } else {
          this.setState({
            atSubMr: selection,
            isSubstringMROpen: false
          }, () => {
            this.onAttrChange(e);
          });
        }
      };
      this.handleOrderMRToggle = (_event, isOrderMROpen) => {
        this.setState({
          isOrderMROpen
        });
      };
      this.handleOrderMRClear = () => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        this.setState({
          atOrder: "",
          isOrderMROpen: false
        }, () => {
          this.onAttrChange(e);
        });
      };
      this.handleOrderMRSelect = (event, selection) => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        if (this.state.atOrder === selection) {
          this.setState({
            atOrder: "",
            isOrderMROpen: false
          }, () => {
            this.onAttrChange(e);
          });
        } else {
          this.setState({
            atOrder: selection,
            isOrderMROpen: false
          }, () => {
            this.onAttrChange(e);
          });
        }
      };
      this.handleEqualityMRToggle = (_event, isEqualityMROpen) => {
        this.setState({
          isEqualityMROpen
        });
      };
      this.handleEqualityMRClear = () => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        this.setState({
          atEqMr: "",
          isEqualityMROpen: false
        }, () => {
          this.onAttrChange(e);
        });
      };
      this.handleEqualityMRSelect = (event, selection) => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        if (this.state.atEqMr === selection) {
          this.setState({
            atEqMr: "",
            isEqualityMROpen: false
          }, () => {
            this.onAttrChange(e);
          });
        } else {
          this.setState({
            atEqMr: selection,
            isEqualityMROpen: false
          }, () => {
            this.onAttrChange(e);
          });
        }
      };
      this.handleAliasNameToggle = (_event, isAliasNameOpen) => {
        this.setState({
          isAliasNameOpen
        });
      };
      this.handleAliasNameClear = () => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        this.setState({
          atAlias: [],
          isAliasNameOpen: false
        }, () => {
          this.onAttrChange(e);
        });
      };
      this.handleAliasNameSelect = (event, selection) => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        this.setState({
          atAlias: Array.isArray(selection) ? selection : [],
          isAliasNameOpen: false
        }, () => {
          this.onAttrChange(e);
        });
      };
      this.handleAliasNameCreateOption = (_event, newValue) => {
        if (!this.state.atAliasOptions.includes(newValue)) {
          this.setState({
            atAliasOptions: [...this.state.atAliasOptions, { value: newValue }],
            isAliasNameOpen: false
          });
        }
      };
      this.handleParentAttrToggle = (_event, isParentAttrOpen) => {
        this.setState({
          isParentAttrOpen
        });
      };
      this.handleParentAttrClear = () => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        this.setState({
          atParent: "",
          isParentAttrOpen: false
        }, () => {
          this.onAttrChange(e);
        });
      };
      this.handleParentAttrSelect = (event, selection) => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        if (this.state.atParent === selection) {
          this.setState({
            atParent: "",
            isParentAttrOpen: false
          }, () => {
            this.onAttrChange(e);
          });
        } else {
          this.setState(
            (prevState) => ({
              atParent: selection,
              isParentAttrOpen: false
            }),
            () => {
              this.onAttrChange(e);
            }
          );
        }
      };
      this.handleRequiredAttrsToggle = (_event, isRequiredAttrsOpen) => {
        this.setState({
          isRequiredAttrsOpen
        });
      };
      this.handleRequiredAttrsClear = () => {
        this.setState({
          ocMust: [],
          isRequiredAttrsOpen: false
        });
      };
      this.handleRequiredAttrsSelect = (event, selection) => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        this.setState({
          ocMust: Array.isArray(selection) ? selection : [],
          isRequiredAttrsOpen: false
        }, () => {
          this.onOCChange(e);
        });
      };
      this.handleRequiredAttrsCreateOption = (newValue) => {
        if (!this.state.ocMustOptions.includes(newValue)) {
          this.setState({
            ocMustOptions: [...this.state.ocMustOptions, { value: newValue }],
            isRequiredAttrsOpen: false
          });
        }
      };
      this.handleAllowedAttrsToggle = (_event, isAllowedAttrsOpen) => {
        this.setState({
          isAllowedAttrsOpen
        });
      };
      this.handleAllowedAttrsClear = () => {
        this.setState({
          ocMay: [],
          isAllowedAttrsOpen: false
        });
      };
      this.handleAllowedAttrsSelect = (event, selection) => {
        const e = { target: { id: "dummy", value: "", type: "input" } };
        this.setState({
          ocMay: Array.isArray(selection) ? selection : [],
          isAllowedAttrsOpen: false
        }, () => {
          this.onOCChange(e);
        });
      };
      this.handleAllowedAttrsCreateOption = (newValue) => {
        if (!this.state.ocMayOptions.includes(newValue)) {
          this.setState({
            ocMayOptions: [...this.state.ocMayOptions, { value: newValue }],
            isAllowedAttrsOpen: false
          });
        }
      };
      this.handleNavSelect = (event, tabIndex) => {
        event.preventDefault();
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.validateForm = this.validateForm.bind(this);
      this.onAttrChange = this.onAttrChange.bind(this);
      this.onOCChange = this.onOCChange.bind(this);
      this.onFieldChange = this.onFieldChange.bind(this);
      this.loadSchemaData = this.loadSchemaData.bind(this);
      this.loadSyntaxesFirst = this.loadSyntaxesFirst.bind(this);
      this.toggleLoading = this.toggleLoading.bind(this);
      this.showEditObjectclassModal = this.showEditObjectclassModal.bind(this);
      this.handleShowAddObjectclassModal = this.handleShowAddObjectclassModal.bind(this);
      this.openObjectclassModal = this.openObjectclassModal.bind(this);
      this.closeObjectclassModal = this.closeObjectclassModal.bind(this);
      this.doDeleteOC = this.doDeleteOC.bind(this);
      this.addObjectclass = this.addObjectclass.bind(this);
      this.editObjectclass = this.editObjectclass.bind(this);
      this.cmdOperationObjectclass = this.cmdOperationObjectclass.bind(this);
      this.showConfirmOCDelete = this.showConfirmOCDelete.bind(this);
      this.closeConfirmOCDelete = this.closeConfirmOCDelete.bind(this);
      this.showEditAttributeModal = this.showEditAttributeModal.bind(this);
      this.handleShowAddAttributeModal = this.handleShowAddAttributeModal.bind(this);
      this.openAttributeModal = this.openAttributeModal.bind(this);
      this.closeAttributeModal = this.closeAttributeModal.bind(this);
      this.doDeleteAttr = this.doDeleteAttr.bind(this);
      this.addAttribute = this.addAttribute.bind(this);
      this.editAttribute = this.editAttribute.bind(this);
      this.showConfirmAttrDelete = this.showConfirmAttrDelete.bind(this);
      this.closeConfirmAttrDelete = this.closeConfirmAttrDelete.bind(this);
    }
    toggleLoading(item) {
      if (item === "allSchema") {
        this.setState((prevState) => ({
          loading: !prevState.loading
        }));
      } else if (item === "ocTable") {
        this.setState((prevState) => ({
          ocTableLoading: !prevState.ocTableLoading
        }));
      } else if (item === "ocModal") {
        this.setState((prevState) => ({
          ocModalLoading: !prevState.ocModalLoading
        }));
      } else if (item === "atTable") {
        this.setState((prevState) => ({
          atTableLoading: !prevState.atTableLoading
        }));
      } else if (item === "atModal") {
        this.setState((prevState) => ({
          atModalLoading: !prevState.atModalLoading
        }));
      }
    }
    loadSyntaxesFirst() {
      if (this.state.firstLoad) {
        this.setState({
          firstLoad: false
        });
      }
      this.toggleLoading("allSchema");
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "get_syntaxes"
      ];
      log_cmd("loadSyntaxes", "Get syntaxes for attributetypes", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        this.setState({
          syntaxes: myObject.items
        });
        this.loadSchemaData(true);
      }).fail((err) => {
        if (err !== 0) {
          const errMsg = getApiErrorMessage(err);
          console.log("loadSyntaxes failed: ", errMsg);
        }
      });
    }
    loadSchemaData(initialLoading) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "list",
        "--include-oc-sup"
      ];
      log_cmd("loadSchemaData", "Get schema objects in one batch", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const myObject = JSON.parse(content);
        const attrs = [];
        const ocs = [];
        const mrs = [];
        const ocKey = this.state.ocTableKey + 1;
        const attrKey = this.state.attrTableKey + 1;
        for (const content2 of myObject.attributetypes.items) {
          attrs.push(content2.name[0]);
        }
        for (const content2 of myObject.objectclasses.items) {
          ocs.push(content2.name[0]);
        }
        for (const content2 of myObject.matchingrules.items) {
          if (content2.name[0] !== "") {
            mrs.push(content2.name[0]);
          } else {
            content2.name[0] = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("i", { children: "<No Name>" });
          }
        }
        this.setState({
          objectclassRows: myObject.objectclasses.items,
          attributesRows: myObject.attributetypes.items,
          matchingrulesRows: myObject.matchingrules.items,
          attributes: attrs,
          matchingrules: mrs,
          objectclasses: ocs
        });
        if (this.state.ocUserDefined) {
          this.setState({
            filteredObjectclassRows: searchFilter(
              "user defined",
              ["x_origin"],
              myObject.objectclasses.items
            ),
            ocTableKey: ocKey
          });
        } else {
          this.setState({
            filteredObjectclassRows: myObject.objectclasses.items,
            ocTableKey: ocKey
          });
        }
        if (this.state.atUserDefined) {
          this.setState({
            filteredAttributesRows: searchFilter(
              "user defined",
              ["x_origin"],
              myObject.attributetypes.items
            ),
            attrTableKey: attrKey
          });
        } else {
          this.setState({
            filteredAttributesRows: myObject.attributetypes.items,
            attrTableKey: attrKey
          });
        }
        if (initialLoading) {
          this.toggleLoading("allSchema");
        } else {
          this.setState({
            atTableLoading: false,
            ocTableLoading: false
          });
        }
      }).fail((err) => {
        if (err !== 0) {
          const errMsg = getApiErrorMessage(err);
          console.log("loadSchemaData failed: ", errMsg);
        }
        if (initialLoading) {
          this.toggleLoading("allSchema");
        } else {
          this.setState({
            atTableLoading: false,
            ocTableLoading: false
          });
        }
      });
    }
    showEditObjectclassModal(name2) {
      this.setState({
        ocModalViewOnly: false,
        saveBtnDisabled: true,
        errObj: {}
      });
      this.openObjectclassModal(name2);
    }
    handleShowAddObjectclassModal(rowData) {
      this.setState({
        ocModalViewOnly: false,
        saveBtnDisabled: true,
        errObj: { ocName: true, ocDesc: true }
      });
      this.openObjectclassModal();
    }
    openObjectclassModal(name2) {
      if (!name2) {
        this.setState({
          ocName: "",
          ocDesc: "",
          ocOID: "",
          ocParent: "top",
          ocKind: "",
          ocMust: [],
          ocMay: [],
          objectclassModalShow: true,
          newOcEntry: true
        });
      } else {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "schema",
          "objectclasses",
          "query",
          name2,
          "--include-sup"
        ];
        log_cmd("openObjectclassModal", "Fetch ObjectClass data from schema", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const obj = JSON.parse(content);
          const item = obj.oc;
          let ocMustList = [];
          let ocMayList = [];
          const kindOpts = ["STRUCTURAL", "ABSTRACT", "AUXILIARY"];
          this.setState({
            objectclassModalShow: true,
            newOcEntry: false,
            ocName: item.name === void 0 ? "" : item.name[0],
            ocDesc: item.desc === null ? "" : item.desc[0],
            ocOID: item.oid === void 0 ? "" : item.oid[0],
            ocKind: item.kind === void 0 ? "" : kindOpts[item.kind],
            ocParent: item.sup === void 0 ? [] : item.sup[0],
            // Store original values
            _ocName: item.name === void 0 ? "" : item.name[0],
            _ocDesc: item.desc === null ? "" : item.desc[0],
            _ocOID: item.oid === void 0 ? "" : item.oid[0],
            _ocKind: item.kind === void 0 ? "" : kindOpts[item.kind],
            _ocParent: item.sup === void 0 ? [] : item.sup[0]
          });
          if (item.must === void 0) {
            this.setState({ ocMust: [], _ocMust: [] });
          } else {
            for (const value of item.must) {
              ocMustList = [...ocMustList, value];
            }
            this.setState({
              ocMust: ocMustList,
              _ocMust: ocMustList
            });
          }
          if (item.may === void 0) {
            this.setState({ ocMay: [], _ocMay: [] });
          } else {
            for (const value of item.may) {
              ocMayList = [...ocMayList, value];
            }
            this.setState({
              ocMay: ocMayList,
              _ocMay: ocMayList
            });
          }
        }).fail((_113) => {
          this.setState({
            ocName: "",
            ocDesc: "",
            ocOID: "",
            ocParent: "",
            ocKind: "",
            ocMust: [],
            ocMay: [],
            objectclassModalShow: true,
            newOcEntry: true
          });
        });
      }
    }
    closeObjectclassModal() {
      this.setState({ objectclassModalShow: false });
    }
    closeConfirmOCDelete() {
      this.setState({
        showConfirmDeleteOC: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    showConfirmOCDelete(oc_name) {
      this.setState({
        showConfirmDeleteOC: true,
        modalChecked: false,
        modalSpinning: false,
        deleteName: oc_name
      });
    }
    doDeleteOC() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "objectclasses",
        "remove",
        this.state.deleteName
      ];
      this.setState({
        modalSpinning: true
      });
      this.toggleLoading("ocTable");
      log_cmd("deleteObjectclass", "Delete ObjectClass from schema", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteObjectclass", "Result", content);
        this.props.addNotification("success", cockpit_default.format(_57("ObjectClass $0 was successfully deleted"), this.state.deleteName));
        this.loadSchemaData();
        this.closeConfirmOCDelete();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_57("Error during ObjectClass removal operation - $0"), errMsg)
        );
        this.loadSchemaData();
        this.closeConfirmOCDelete();
      });
    }
    addObjectclass() {
      this.cmdOperationObjectclass("add");
    }
    editObjectclass() {
      this.cmdOperationObjectclass("replace");
    }
    cmdOperationObjectclass(action) {
      const { ocName, ocDesc, ocOID, ocParent, ocKind, ocMust, ocMay } = this.state;
      if (ocName === "") {
        this.props.addNotification("warning", _57("ObjectClass Name is required."));
      } else {
        let cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "schema",
          "objectclasses",
          action,
          ocName
        ];
        if (ocOID !== "") {
          cmd = [...cmd, "--oid", ocOID];
        }
        if (ocParent !== "") {
          cmd = [...cmd, "--sup", ocParent];
        }
        if (ocKind !== "") {
          cmd = [...cmd, "--kind", ocKind];
        }
        if (ocDesc !== "") {
          cmd = [...cmd, "--desc", ocDesc];
        }
        if (ocMust.length !== 0) {
          cmd = [...cmd, "--must"];
          for (const value of ocMust) {
            cmd = [...cmd, value];
          }
        }
        if (ocMay.length !== 0) {
          cmd = [...cmd, "--may"];
          for (const value of ocMay) {
            cmd = [...cmd, value];
          }
        }
        this.toggleLoading("ocModal");
        this.toggleLoading("ocTable");
        log_cmd("cmdOperationObjectclass", `Do the ${action} operation on ObjectClass`, cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          console.info("cmdOperationObjectclass", "Result", content);
          this.props.addNotification(
            "success",
            cockpit_default.format(_57("ObjectClass $0 - $1 operation was successful"), ocName, action)
          );
          this.loadSchemaData();
          this.closeObjectclassModal();
          this.toggleLoading("ocModal");
        }).fail((err) => {
          let errMsg = getApiErrorMessage(err);
          if ("info" in errMsg) {
            errMsg = errMsg + " " + errMsg.info;
          } else {
            errMsg = errMsg;
          }
          this.props.addNotification(
            "error",
            cockpit_default.format(_57("Error during the ObjectClass $0 operation - $1"), action, errMsg)
          );
          this.loadSchemaData();
          this.closeObjectclassModal();
          this.toggleLoading("ocModal");
        });
      }
    }
    showEditAttributeModal(name2) {
      this.setState({
        atModalViewOnly: false,
        saveBtnDisabled: true,
        errObj: {}
      });
      this.openAttributeModal(name2);
    }
    handleShowAddAttributeModal(rowData) {
      this.setState({
        atModalViewOnly: false,
        saveBtnDisabled: true,
        errObj: { atName: true, atDesc: true }
      });
      this.openAttributeModal();
    }
    openAttributeModal(name2) {
      if (!name2) {
        this.setState({
          atName: "",
          atDesc: "",
          atOID: "",
          atParent: "",
          atSyntax: "1.3.6.1.4.1.1466.115.121.1.15",
          atUsage: "userApplications",
          atMultivalued: false,
          atNoUserMod: false,
          atAlias: [],
          atEqMr: "",
          atOrder: "",
          atSubMr: "",
          attributeModalShow: true,
          newAtEntry: true
        });
      } else {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "schema",
          "attributetypes",
          "query",
          name2
        ];
        log_cmd("openAttributeModal", "Fetch Attribute data from schema", cmd);
        cockpit_default.spawn(cmd, {
          superuser: true,
          err: "message"
        }).done((content) => {
          const obj = JSON.parse(content);
          const item = obj.at;
          let atAliasList = [];
          const atUsageOpts = [
            "userApplications",
            "directoryOperation",
            "distributedOperation",
            "dSAOperation"
          ];
          this.setState({
            attributeModalShow: true,
            newAtEntry: false,
            atName: item.name === void 0 ? "" : item.name[0],
            atDesc: item.desc === null ? "" : item.desc[0],
            atOID: item.oid === void 0 ? "" : item.oid[0],
            atParent: item.sup.length === 0 ? "" : item.sup[0],
            atSyntax: item.syntax === void 0 ? "" : item.syntax[0],
            atUsage: item.usage === void 0 ? "" : atUsageOpts[item.usage],
            atMultivalued: !item.single_value,
            atNoUserMod: item.no_user_mod,
            atEqMr: item.equality === null ? "" : item.equality[0],
            atOrder: item.ordering === null ? "" : item.ordering[0],
            atSubMr: item.substr === null ? "" : item.substr[0],
            // store orig valuses
            _atName: item.name === void 0 ? "" : item.name[0],
            _atDesc: item.desc === null ? "" : item.desc[0],
            _atOID: item.oid === void 0 ? "" : item.oid[0],
            _atParent: item.sup[0],
            _atSyntax: item.syntax === void 0 ? "" : item.syntax[0],
            _atUsage: item.usage === void 0 ? "" : atUsageOpts[item.usage],
            _atMultivalued: !item.single_value,
            _atNoUserMod: item.no_user_mod,
            _atEqMr: item.equality === null ? "" : item.equality[0],
            _atOrder: item.ordering === null ? "" : item.ordering[0],
            _atSubMr: item.substr === null ? "" : item.substr[0]
          });
          if (item.aliases === null) {
            this.setState({ atAlias: [], _atAlias: [] });
          } else {
            for (const value of item.aliases) {
              atAliasList = [...atAliasList, value];
            }
            this.setState({
              atAlias: atAliasList,
              _atAlias: atAliasList
            });
          }
        }).fail((_113) => {
          this.setState({
            atName: "",
            atDesc: "",
            atOID: "",
            atParent: "",
            atSyntax: "",
            atUsage: "userApplications",
            atMultivalued: false,
            atNoUserMod: false,
            atAlias: [],
            atEqMr: "",
            atOrder: "",
            atSubMr: "",
            attributeModalShow: true,
            newAtEntry: true
          });
        });
      }
    }
    closeAttributeModal() {
      this.setState({
        attributeModalShow: false
      });
    }
    closeConfirmAttrDelete() {
      this.setState({
        showConfirmAttrDelete: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    showConfirmAttrDelete(attr_name) {
      this.setState({
        showConfirmAttrDelete: true,
        modalChecked: false,
        modalSpinning: false,
        deleteName: attr_name
      });
    }
    doDeleteAttr() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "remove",
        this.state.deleteName
      ];
      this.setState({
        modalSpinning: true
      });
      this.toggleLoading("atTable");
      log_cmd("deleteAttribute", "Delete Attribute from schema", cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("deleteAttribute", "Result", content);
        this.props.addNotification("success", cockpit_default.format(_57("Attribute $0 was successfully deleted"), this.state.deleteName));
        this.loadSchemaData();
        this.closeConfirmAttrDelete();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_57("Error during Attribute removal operation - $0"), errMsg)
        );
        this.loadSchemaData();
        this.closeConfirmAttrDelete();
      });
    }
    addAttribute() {
      const {
        atName,
        atDesc,
        atOID,
        atParent,
        atSyntax,
        atUsage,
        atMultivalued,
        atNoUserMod,
        atAlias,
        atEqMr,
        atOrder,
        atSubMr
      } = this.state;
      const eqMR = atEqMr;
      const orderMR = atOrder;
      const subMR = atSubMr;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "add",
        atName
      ];
      cmd = [...cmd, "--syntax", atSyntax];
      if (atAlias.length !== 0) {
        cmd = [...cmd, "--aliases"];
        for (const value of atAlias) {
          cmd = [...cmd, value];
        }
      }
      if (atParent !== "") {
        cmd = [...cmd, "--sup", atParent];
      }
      if (eqMR !== "") {
        cmd = [...cmd, "--equality", eqMR];
      }
      if (subMR !== "") {
        cmd = [...cmd, "--substr", subMR];
      }
      if (orderMR !== "") {
        cmd = [...cmd, "--ordering", orderMR];
      }
      if (atMultivalued) {
        cmd = [...cmd, "--multi-value"];
      } else {
        cmd = [...cmd, "--single-value"];
      }
      if (atNoUserMod) {
        cmd = [...cmd, "--no-user-mod"];
      } else {
        cmd = [...cmd, "--user-mod"];
      }
      if (atOID !== "") {
        cmd = [...cmd, "--oid", atOID];
      }
      if (atUsage !== "") {
        cmd = [...cmd, "--usage", atUsage];
      }
      if (atDesc !== "") {
        cmd = [...cmd, "--desc", atDesc];
      }
      this.toggleLoading("atModal");
      this.toggleLoading("atTable");
      log_cmd("cmdOperationAttribute", `Do the add operation on Attribute`, cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("cmdOperationAttribute", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_57("Attribute $0 - add operation was successful"), atName)
        );
        this.loadSchemaData();
        this.closeAttributeModal();
        this.toggleLoading("atModal");
      }).fail((err) => {
        let errMsg = getApiErrorMessage(err);
        if ("info" in errMsg) {
          errMsg = errMsg + " " + errMsg.info;
        } else {
          errMsg = errMsg;
        }
        this.props.addNotification(
          "error",
          cockpit_default.format(_57("Error during the Attribute add operation - $0"), errMsg)
        );
        this.loadSchemaData();
        this.closeAttributeModal();
        this.toggleLoading("atModal");
      });
    }
    editAttribute(action) {
      const {
        atName,
        atDesc,
        atOID,
        atParent,
        atSyntax,
        atUsage,
        atMultivalued,
        atNoUserMod,
        atAlias,
        atEqMr,
        atOrder,
        atSubMr
      } = this.state;
      let eqMR = atEqMr;
      let orderMR = atOrder;
      let subMR = atSubMr;
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "replace",
        atName
      ];
      cmd = [...cmd, "--syntax", atSyntax];
      if (!listsEqual(atAlias, this.state._atAlias)) {
        cmd = [...cmd, "--aliases"];
        for (const value of atAlias) {
          cmd = [...cmd, value];
        }
      }
      if (atParent !== "") {
        cmd = [...cmd, "--sup", atParent];
      } else if (this.state._atParent !== "") {
        eqMR = "";
        orderMR = "";
        subMR = "";
      }
      if (eqMR !== "") {
        cmd = [...cmd, "--equality", eqMR];
      }
      if (subMR !== "") {
        cmd = [...cmd, "--substr", subMR];
      }
      if (orderMR !== "") {
        cmd = [...cmd, "--ordering", orderMR];
      }
      if (atMultivalued) {
        cmd = [...cmd, "--multi-value"];
      } else {
        cmd = [...cmd, "--single-value"];
      }
      if (atNoUserMod) {
        cmd = [...cmd, "--no-user-mod"];
      } else {
        cmd = [...cmd, "--user-mod"];
      }
      if (atOID !== "") {
        cmd = [...cmd, "--oid", atOID];
      }
      if (atUsage !== "") {
        cmd = [...cmd, "--usage", atUsage];
      }
      if (atDesc !== "") {
        cmd = [...cmd, "--desc", atDesc];
      }
      this.toggleLoading("atModal");
      this.toggleLoading("atTable");
      log_cmd("cmdOperationAttribute", `Do the replace operation on Attribute`, cmd);
      cockpit_default.spawn(cmd, {
        superuser: true,
        err: "message"
      }).done((content) => {
        console.info("cmdOperationAttribute", "Result", content);
        this.props.addNotification(
          "success",
          cockpit_default.format(_57("Attribute $0 - replace operation was successful"), atName)
        );
        this.loadSchemaData();
        this.closeAttributeModal();
        this.toggleLoading("atModal");
      }).fail((err) => {
        let errMsg = getApiErrorMessage(err);
        if ("info" in errMsg) {
          errMsg = errMsg + " " + errMsg.info;
        } else {
          errMsg = errMsg;
        }
        this.props.addNotification(
          "error",
          cockpit_default.format(_57("Error during the Attribute replace operation - $0"), errMsg)
        );
        this.loadSchemaData();
        this.closeAttributeModal();
        this.toggleLoading("atModal");
      });
    }
    validateForm(attr, value, attrs, errObj) {
      let all_good = true;
      for (const check_attr of attrs) {
        errObj[check_attr] = false;
        if (attr !== check_attr) {
          if (this.state[check_attr] === "") {
            errObj[check_attr] = true;
            all_good = false;
          }
        } else if (value === "") {
          errObj[check_attr] = true;
          all_good = false;
        }
      }
      return all_good;
    }
    onAttrChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let saveBtnDisabled = true;
      const errObj = this.state.errObj;
      let all_good;
      const attrs = [
        "atName",
        "atDesc",
        "atOID",
        "atMultivalued",
        "atNoUserMod",
        "atSyntax",
        "atEqMr",
        "atOrder",
        "atSubMr",
        "atParent"
      ];
      const attrLists = [
        "atAlias"
      ];
      if (this.state.newAtEntry) {
        if (this.validateForm(attr, value, ["atName", "atDesc", "atSyntax"], errObj)) {
          saveBtnDisabled = false;
        }
      } else {
        all_good = this.validateForm(attr, value, ["atName", "atDesc", "atSyntax"], errObj);
        if (all_good) {
          for (const check_attr of attrs) {
            if (attr !== check_attr) {
              if (this.state[check_attr] !== this.state["_" + check_attr]) {
                saveBtnDisabled = false;
                break;
              }
            } else if (value !== this.state["_" + check_attr]) {
              saveBtnDisabled = false;
              break;
            }
          }
          for (const check_attr of attrLists) {
            if (!listsEqual(this.state[check_attr], this.state["_" + check_attr])) {
              saveBtnDisabled = false;
              break;
            }
          }
        }
      }
      this.setState({
        [attr]: value,
        saveBtnDisabled,
        errObj
      });
    }
    onOCChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let saveBtnDisabled = true;
      const errObj = this.state.errObj;
      let all_good;
      const attrs = [
        "ocName",
        "ocDesc",
        "ocOID",
        "ocParent"
      ];
      const attrLists = [
        "ocMust",
        "ocMay"
      ];
      if (this.state.newOcEntry) {
        if (this.validateForm(attr, value, ["ocName", "ocDesc", "ocParent"], errObj)) {
          saveBtnDisabled = false;
        }
      } else {
        all_good = this.validateForm(attr, value, ["ocName", "ocDesc", "ocParent"], errObj);
        if (all_good) {
          for (const check_attr of attrs) {
            if (attr !== check_attr) {
              if (this.state[check_attr] !== this.state["_" + check_attr]) {
                saveBtnDisabled = false;
                break;
              }
            } else if (value !== this.state["_" + check_attr]) {
              saveBtnDisabled = false;
              break;
            }
          }
          for (const check_attr of attrLists) {
            if (!listsEqual(this.state[check_attr], this.state["_" + check_attr])) {
              saveBtnDisabled = false;
              break;
            }
          }
        }
      }
      this.setState({
        [attr]: value,
        saveBtnDisabled,
        errObj
      });
    }
    onFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const ocKey = this.state.ocTableKey + 1;
      const attrKey = this.state.attrTableKey + 1;
      if (e.target.id === "ocUserDefined") {
        if (value) {
          this.setState({
            filteredObjectclassRows: searchFilter(
              "user defined",
              ["x_origin"],
              this.state.objectclassRows
            ),
            ocTableKey: ocKey
          });
        } else {
          this.setState({
            filteredObjectclassRows: this.state.objectclassRows,
            ocTableKey: ocKey
          });
        }
      } else if (e.target.id === "atUserDefined") {
        if (value) {
          this.setState({
            filteredAttributesRows: searchFilter(
              "user defined",
              ["x_origin"],
              this.state.attributesRows
            ),
            attrTableKey: attrKey
          });
        } else {
          this.setState({
            filteredAttributesRows: this.state.attributesRows,
            attrTableKey: attrKey
          });
        }
      }
      this.setState({
        [e.target.id]: value
      });
    }
    render() {
      let schemaPage = "";
      if (this.state.loading) {
        schemaPage = /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ds-center ds-margin-top-xlg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Text, { component: TextVariants.h3, children: _57("Loading Schema Information ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
        ] });
      } else {
        schemaPage = /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ds-indent ds-margin-top-xlg ds-margin-bottom-md", children: [
          /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Tabs, { isBox: true, activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
            /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TabTitleText, { children: _57("Objectclasses") }), children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ds-margin-top-xlg ds-indent", children: [
              /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
                Checkbox,
                {
                  id: "ocUserDefined",
                  isChecked: this.state.ocUserDefined,
                  title: _57("Show only the objectclasses that are defined by a user and have the X-ORIGIN set to 'user defined'"),
                  onChange: (e, checked) => {
                    this.onFieldChange(e);
                  },
                  label: _57("Only Show Non-standard/Custom Schema")
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
                ObjectClassesTable,
                {
                  className: "ds-margin-top-lg",
                  rows: this.state.filteredObjectclassRows,
                  editModalHandler: this.showEditObjectclassModal,
                  deleteHandler: this.showConfirmOCDelete,
                  loading: this.state.ocTableLoading
                },
                this.state.ocTableKey
              ),
              /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleShowAddObjectclassModal,
                  className: "ds-margin-top",
                  children: _57("Add ObjectClass")
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
                ObjectClassModal,
                {
                  addHandler: this.addObjectclass,
                  editHandler: this.editObjectclass,
                  newOcEntry: this.state.newOcEntry,
                  ocModalViewOnly: this.state.ocModalViewOnly,
                  handleFieldChange: this.onOCChange,
                  objectclasses: this.state.objectclasses,
                  attributes: this.state.attributes,
                  ocName: this.state.ocName,
                  ocDesc: this.state.ocDesc,
                  ocOID: this.state.ocOID,
                  ocParent: this.state.ocParent,
                  ocKind: this.state.ocKind,
                  ocMust: this.state.ocMust,
                  ocMay: this.state.ocMay,
                  objectclassModalShow: this.state.objectclassModalShow,
                  closeModal: this.closeObjectclassModal,
                  loading: this.state.ocModalLoading,
                  isParentObjOpen: this.state.isParentObjOpen,
                  isRequiredAttrsOpen: this.state.isRequiredAttrsOpen,
                  isAllowedAttrsOpen: this.state.isAllowedAttrsOpen,
                  onRequiredAttrsToggle: this.handleRequiredAttrsToggle,
                  onRequiredAttrsClear: this.handleRequiredAttrsClear,
                  onRequiredAttrsSelect: this.handleRequiredAttrsSelect,
                  onRequiredAttrsCreateOption: this.handleRequiredAttrsCreateOption,
                  onAllowedAttrsToggle: this.handleAllowedAttrsToggle,
                  onAllowedAttrsClear: this.handleAllowedAttrsClear,
                  onAllowedAttrsSelect: this.handleAllowedAttrsSelect,
                  onAllowedAttrsCreateOption: this.handleAllowedAttrsCreateOption,
                  saveBtnDisabled: this.state.saveBtnDisabled,
                  error: this.state.errObj
                }
              )
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TabTitleText, { children: _57("Attributes") }), children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "ds-margin-top-xlg ds-indent", children: [
              /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
                Checkbox,
                {
                  id: "atUserDefined",
                  isChecked: this.state.atUserDefined,
                  title: _57("Show only the attributes that are defined by a user, and have the X-ORIGIN set to 'user defined'"),
                  onChange: (e, checked) => {
                    this.onFieldChange(e);
                  },
                  label: _57("Only Show Non-standard/Custom Schema")
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
                AttributesTable,
                {
                  className: "ds-margin-top-lg",
                  rows: this.state.filteredAttributesRows,
                  editModalHandler: this.showEditAttributeModal,
                  deleteHandler: this.showConfirmAttrDelete,
                  syntaxes: this.state.syntaxes,
                  loading: this.state.atTableLoading
                },
                this.state.attrTableKey
              ),
              /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleShowAddAttributeModal,
                  className: "ds-margin-top",
                  children: _57("Add Attribute")
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
                AttributeTypeModal,
                {
                  addHandler: this.addAttribute,
                  editHandler: this.editAttribute,
                  newAtEntry: this.state.newAtEntry,
                  atModalViewOnly: this.state.atModalViewOnly,
                  handleFieldChange: this.onAttrChange,
                  objectclasses: this.state.objectclasses,
                  attributes: this.state.attributes,
                  matchingrules: this.state.matchingrules,
                  syntaxes: this.state.syntaxes,
                  atName: this.state.atName,
                  atDesc: this.state.atDesc,
                  atOID: this.state.atOID,
                  atParent: this.state.atParent,
                  atSyntax: this.state.atSyntax,
                  atUsage: this.state.atUsage,
                  atMultivalued: this.state.atMultivalued,
                  atNoUserMod: this.state.atNoUserMod,
                  atAlias: this.state.atAlias,
                  atEqMr: this.state.atEqMr,
                  atOrder: this.state.atOrder,
                  atSubMr: this.state.atSubMr,
                  attributeModalShow: this.state.attributeModalShow,
                  closeModal: this.closeAttributeModal,
                  loading: this.state.atModalLoading,
                  isParentAttrOpen: this.state.isParentAttrOpen,
                  isAliasNameOpen: this.state.isAliasNameOpen,
                  isEqualityMROpen: this.state.isEqualityMROpen,
                  isOrderMROpen: this.state.isOrderMROpen,
                  isSubstringMROpen: this.state.isSubstringMROpen,
                  onParentAttrToggle: this.handleParentAttrToggle,
                  onParentAttrClear: this.handleParentAttrClear,
                  onParentAttrSelect: this.handleParentAttrSelect,
                  onAliasNameToggle: this.handleAliasNameToggle,
                  onAliasNameClear: this.handleAliasNameClear,
                  onAliasNameSelect: this.handleAliasNameSelect,
                  onAliasNameCreateOption: this.handleAliasNameCreateOption,
                  onEqualityMRToggle: this.handleEqualityMRToggle,
                  onEqualityMRClear: this.handleEqualityMRClear,
                  onEqualityMRSelect: this.handleEqualityMRSelect,
                  onOrderMRToggle: this.handleOrderMRToggle,
                  onOrderMRClear: this.handleOrderMRClear,
                  onOrderMRSelect: this.handleOrderMRSelect,
                  onSubstringMRToggle: this.handleSubstringMRToggle,
                  onSubstringMRClear: this.handleSubstringMRClear,
                  onSubstringMRSelect: this.handleSubstringMRSelect,
                  saveBtnDisabled: this.state.saveBtnDisabled,
                  error: this.state.errObj
                }
              )
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TabTitleText, { children: _57("Matching Rules") }), children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "ds-margin-top-xlg ds-indent", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
              MatchingRulesTable,
              {
                rows: this.state.matchingrulesRows
              }
            ) }) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
            DoubleConfirmModal,
            {
              showModal: this.state.showConfirmDeleteOC,
              closeHandler: this.closeConfirmOCDelete,
              handleChange: this.onFieldChange,
              actionHandler: this.doDeleteOC,
              spinning: this.state.modalSpinning,
              item: this.state.deleteName,
              checked: this.state.modalChecked,
              mTitle: _57("Delete An Objectclass"),
              mMsg: _57("Are you sure you want to delete this Objectclass?"),
              mSpinningMsg: _57("Deleting objectclass ..."),
              mBtnName: _57("Delete Objectclass")
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
            DoubleConfirmModal,
            {
              showModal: this.state.showConfirmAttrDelete,
              closeHandler: this.closeConfirmAttrDelete,
              handleChange: this.onFieldChange,
              actionHandler: this.doDeleteAttr,
              spinning: this.state.modalSpinning,
              item: this.state.deleteName,
              checked: this.state.modalChecked,
              mTitle: _57("Delete An Attribute"),
              mMsg: _57("Are you sure you want to delete this Attribute?"),
              mSpinningMsg: _57("Deleting attribute ..."),
              mBtnName: _57("Delete Attribute")
            }
          )
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { children: schemaPage });
    }
  };
  Schema.propTypes = {
    addNotification: import_prop_types56.default.func,
    serverId: import_prop_types56.default.string
  };
  Schema.defaultProps = {
    serverId: ""
  };

  // src/replication.jsx
  var import_react136 = __toESM(require_react(), 1);

  // src/lib/replication/replSuffix.jsx
  var import_react135 = __toESM(require_react(), 1);

  // src/lib/replication/replChangelog.jsx
  var import_react128 = __toESM(require_react(), 1);
  var import_prop_types57 = __toESM(require_prop_types(), 1);
  var import_outlined_question_circle_icon3 = __toESM(require_outlined_question_circle_icon(), 1);
  var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1);
  var _58 = cockpit_default.gettext;
  var Changelog = class extends import_react128.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: false,
        errObj: {},
        showConfirmDelete: false,
        saveBtnDisabled: true,
        // Changelog settings
        clMaxEntries: Number(this.props.clMaxEntries) === 0 ? -1 : Number(this.props.clMaxEntries),
        clMaxAge: Number(this.props.clMaxAge.slice(0, -1)) === 0 || this.props.clMaxAge === "-1" ? -1 : Number(this.props.clMaxAge.slice(0, -1)),
        clMaxAgeUnit: this.props.clMaxAge !== "" && this.props.clMaxAge !== "-1" ? this.props.clMaxAge.slice(-1).toLowerCase() : "s",
        clTrimInt: Number(this.props.clTrimInt) === 0 ? -1 : Number(this.props.clTrimInt),
        clEncrypt: this.props.clEncrypt,
        // Preserve original settings
        _clMaxEntries: Number(this.props.clMaxEntries) === 0 ? -1 : Number(this.props.clMaxEntries),
        _clMaxAge: Number(this.props.clMaxAge.slice(0, -1)) === 0 || this.props.clMaxAge === "-1" ? -1 : Number(this.props.clMaxAge.slice(0, -1)),
        _clMaxAgeUnit: this.props.clMaxAge !== "" && this.props.clMaxAge !== "-1" ? this.props.clMaxAge.slice(-1).toLowerCase() : "s",
        _clTrimInt: Number(this.props.clTrimInt) === 0 ? -1 : Number(this.props.clTrimInt),
        _clEncrypt: this.props.clEncrypt
      };
      this.minValue = -1;
      this.maxValue = 2e7;
      this.onMinus = (id) => {
        if (id === "clMaxAge" && this.state.clMaxAge === 1) {
          this.setState({
            [id]: this.minValue
          }, () => {
            this.validateSaveBtn();
          });
        } else {
          if (this.state[id] === this.minValue) {
            return;
          }
          this.setState({
            [id]: Number(this.state[id]) - 1
          }, () => {
            this.validateSaveBtn();
          });
        }
      };
      this.onChange = (event, id) => {
        if (id === "clMaxAge" && event.target.value === "0") {
          return;
        }
        const newValue = isNaN(event.target.value) || event.target.value === "" ? -1 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < this.minValue ? this.minValue : newValue
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.onPlus = (id) => {
        if (id === "clMaxAge" && this.state.clMaxAge === -1) {
          this.setState({
            [id]: 1
          }, () => {
            this.validateSaveBtn();
          });
        } else {
          if (this.state[id] === this.maxValue) {
            return;
          }
          this.setState({
            [id]: Number(this.state[id]) + 1
          }, () => {
            this.validateSaveBtn();
          });
        }
      };
      this.handleChange = this.handleChange.bind(this);
      this.handleSaveSettings = this.handleSaveSettings.bind(this);
    }
    handleSaveSettings() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "set-changelog",
        "--suffix",
        this.props.suffix
      ];
      let requires_restart = false;
      let msg = "Successfully updated changelog configuration.";
      if (this.state.clMaxEntries !== this.state._clMaxEntries) {
        cmd.push("--max-entries=" + this.state.clMaxEntries);
      }
      if (this.state.clMaxAge !== this.state._clMaxAge || this.state.clMaxAgeUnit !== this.state._clMaxAgeUnit) {
        if (this.state.clMaxAge === -1) {
          cmd.push("--max-age=" + this.state.clMaxAge);
        } else {
          cmd.push("--max-age=" + this.state.clMaxAge + this.state.clMaxAgeUnit);
        }
      }
      if (this.state.clTrimInt !== this.state._clTrimInt) {
        cmd.push("--trim-interval=" + this.state.clTrimInt);
      }
      if (this.state.clEncrypt !== this.state._clEncrypt) {
        if (this.state.clEncrypt) {
          cmd.push("--encrypt");
          msg += _58("  This requires a server restart to take effect");
          requires_restart = true;
        } else {
          cmd.push("--disable-encrypt");
        }
      }
      if (cmd.length > 6) {
        this.setState({
          // Start the spinner
          saving: true
        });
        log_cmd("handleSaveSettings", "Applying replication changelog changes", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.reloadChangelog();
          this.props.addNotification(
            requires_restart ? "warning" : "success",
            msg
          );
          this.setState({
            saving: false,
            saveBtnDisabled: true
          });
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.reloadChangelog();
          this.setState({
            saving: false
          });
          let msg2 = errMsg;
          if ("info" in errMsg) {
            msg2 = errMsg + " - " + errMsg.info;
          }
          this.props.addNotification(
            "error",
            cockpit_default.format(_58("Error updating changelog configuration - $0"), msg2)
          );
        });
      }
    }
    validateSaveBtn() {
      let saveBtnDisabled = true;
      if (this.state.clMaxEntries !== this.state._clMaxEntries || this.state.clMaxAge !== this.state._clMaxAge || this.state.clMaxAgeUnit !== this.state._clMaxAgeUnit || this.state.clTrimInt !== this.state._clTrimInt || this.state.clEncrypt !== this.state._clEncrypt) {
        saveBtnDisabled = false;
      }
      this.setState({
        saveBtnDisabled
      });
    }
    handleChange(str, e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn();
      });
    }
    reloadChangelog() {
      this.setState({
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "get-changelog",
        "--suffix",
        this.props.suffix
      ];
      log_cmd("reloadChangelog", "Load the replication changelog info", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        let clMaxEntries = "";
        let clMaxAge = "";
        let clMaxAgeUnit = "s";
        let clTrimInt = "";
        let clEncrypt = false;
        for (const attr in config.attrs) {
          const val = config.attrs[attr][0];
          if (attr === "nsslapd-changelogmaxentries") {
            clMaxEntries = val;
          } else if (attr === "nsslapd-changelogmaxage") {
            if (val !== "-1") {
              clMaxAge = val.slice(0, -1);
              clMaxAgeUnit = val.slice(-1).toLowerCase();
            } else {
              clMaxAge = val;
              clMaxAgeUnit = "s";
            }
          } else if (attr === "nsslapd-changelogtrim-interval") {
            clTrimInt = val;
          } else if (attr === "nsslapd-encryptionalgorithm") {
            clEncrypt = true;
          }
        }
        this.setState({
          clMaxEntries: Number(clMaxEntries) === 0 ? -1 : Number(clMaxEntries),
          clMaxAge: Number(clMaxAge) === 0 ? -1 : Number(clMaxAge),
          clMaxAgeUnit,
          clTrimInt: Number(clTrimInt) === 0 ? -1 : Number(clTrimInt),
          clEncrypt,
          // Preserve original settings
          _clMaxEntries: Number(clMaxEntries) === 0 ? -1 : Number(clMaxEntries),
          _clMaxAge: Number(clMaxAge) === 0 ? -1 : Number(clMaxAge),
          _clMaxAgeUnit: clMaxAgeUnit,
          _clTrimInt: Number(clTrimInt) === 0 ? -1 : Number(clTrimInt),
          _clEncrypt: clEncrypt,
          saveBtnDisabled: true,
          loading: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_58('Failed to reload changelog for "$0" - $1'), this.props.suffix, errMsg)
        );
        this.setState({
          loading: false,
          saveBtnDisabled: true
        });
      });
    }
    render() {
      let clPage;
      let saveBtnName = _58("Save Settings");
      const extraPrimaryProps = {};
      if (this.state.saving) {
        saveBtnName = _58("Saving settings ...");
        extraPrimaryProps.spinnerAriaValueText = _58("Saving");
      } else if (this.loading) {
        clPage = /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Text, { component: TextVariants.h3, children: _58("Loading Changelog Configuration ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Spinner, { className: "ds-margin-top-lg", size: "md" })
        ] });
      } else {
        clPage = /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "ds-margin-top-lg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Form, { isHorizontal: true, children: [
            /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
              Grid,
              {
                title: _58("Changelog trimming parameter.  Set the maximum number of changelog entries allowed in the database (nsslapd-changelogmaxentries)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(GridItem, { className: "ds-label", span: 3, children: _58("Changelog Maximum Entries") }),
                  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                    NumberInput,
                    {
                      value: this.state.clMaxEntries,
                      min: this.minValue,
                      max: this.maxValue,
                      onMinus: () => {
                        this.onMinus("clMaxEntries");
                      },
                      onChange: (e) => {
                        this.onChange(e, "clMaxEntries");
                      },
                      onPlus: () => {
                        this.onPlus("clMaxEntries");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 8
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
              Grid,
              {
                title: _58("Changelog trimming parameter.  This set the maximum age of a changelog entry (nsslapd-changelogmaxage)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(GridItem, { className: "ds-label", span: 3, children: _58("Changelog Maximum Age") }),
                  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                    NumberInput,
                    {
                      value: this.state.clMaxAge,
                      min: this.minValue,
                      max: this.maxValue,
                      onMinus: () => {
                        this.onMinus("clMaxAge");
                      },
                      onChange: (e) => {
                        this.onChange(e, "clMaxAge");
                      },
                      onPlus: () => {
                        this.onPlus("clMaxAge");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 8
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(GridItem, { className: "ds-margin-left", span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
                    FormSelect,
                    {
                      className: "ds-margin-left",
                      id: "clMaxAgeUnit",
                      value: this.state.clMaxAgeUnit,
                      onChange: (e, str) => this.handleChange(str, e),
                      "aria-label": "FormSelect Input",
                      isDisabled: this.state.clMaxAge < 1,
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(FormSelectOption, { value: "s", label: _58("Seconds") }, "s"),
                        /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(FormSelectOption, { value: "m", label: _58("Minutes") }, "m"),
                        /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(FormSelectOption, { value: "h", label: _58("Hours") }, "h"),
                        /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(FormSelectOption, { value: "d", label: _58("Days") }, "d"),
                        /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(FormSelectOption, { value: "w", label: _58("Weeks") }, "w")
                      ]
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
              Grid,
              {
                title: _58("The changelog trimming interval.  Set how often the changelog checks if there are entries that can be purged from the changelog based on the trimming parameters (nsslapd-changelogtrim-interval)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(GridItem, { className: "ds-label", span: 3, children: _58("Changelog Trimming Interval") }),
                  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                    NumberInput,
                    {
                      value: this.state.clTrimInt,
                      min: this.minValue,
                      max: this.maxValue,
                      onMinus: () => {
                        this.onMinus("clTrimInt");
                      },
                      onChange: (e) => {
                        this.onChange(e, "clTrimInt");
                      },
                      onPlus: () => {
                        this.onPlus("clTrimInt");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 8
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(GridItem, { className: "ds-label", span: 3, children: [
                _58("Changelog Encryption"),
                /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                  Tooltip,
                  {
                    id: "CLtooltip",
                    position: "bottom",
                    content: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { children: _58("Changelog encryption requires that the server must already be configured for security/TLS.  This setting also requires that you export and import the changelog which must be done while the database is in read-only mode.  So first put the database into read-only mode, then export the changelog, enable changelog encryption, restart the server, import the changelog, and finally unset the database read-only mode.") }),
                    children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                      import_outlined_question_circle_icon3.OutlinedQuestionCircleIcon,
                      {
                        className: "ds-left-margin"
                      }
                    )
                  }
                )
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                Checkbox,
                {
                  id: "clEncrypt",
                  isChecked: this.state.clEncrypt,
                  onChange: (e, str) => this.handleChange(str, e)
                }
              ) })
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
            Button,
            {
              className: "ds-margin-top-xlg",
              variant: "primary",
              onClick: this.handleSaveSettings,
              isDisabled: this.state.saveBtnDisabled || this.state.saving,
              isLoading: this.state.saving,
              spinnerAriaValueText: this.state.saving ? _58("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveBtnName
            }
          )
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: this.state.saving ? "ds-disabled" : "", children: clPage });
    }
  };
  Changelog.propTypes = {
    serverId: import_prop_types57.default.string,
    clMaxEntries: import_prop_types57.default.string,
    clMaxAge: import_prop_types57.default.string,
    clTrimInt: import_prop_types57.default.string,
    clEncrypt: import_prop_types57.default.bool,
    addNotification: import_prop_types57.default.func,
    suffix: import_prop_types57.default.string
  };
  Changelog.defaultProps = {
    serverId: "",
    clMaxEntries: "",
    clMaxAge: "",
    clTrimInt: "",
    clEncrypt: false,
    suffix: ""
  };

  // src/lib/replication/replConfig.jsx
  var import_react131 = __toESM(require_react(), 1);

  // src/lib/replication/replTables.jsx
  var import_react129 = __toESM(require_react(), 1);
  var import_prop_types58 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1);
  var _59 = cockpit_default.gettext;
  var ReplAgmtTable = class extends import_react129.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _59("Edit Agreement"),
          onClick: () => this.props.edit(rowData[0])
        },
        {
          title: _59("Initialize Agreement"),
          onClick: () => this.props.init(rowData[0])
        },
        {
          title: _59("Poke Agreement"),
          onClick: () => this.props.poke(rowData[0])
        },
        {
          title: _59("Disable/Enable Agreement"),
          onClick: () => this.props.enable(rowData[0], rowData[3])
        },
        {
          isSeparator: true
        },
        {
          title: _59("Delete Agreement"),
          onClick: () => this.props.delete(rowData[0], rowData[3])
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _59("Name"), sortable: true },
          { title: _59("Host"), sortable: true },
          { title: _59("Port"), sortable: true },
          { title: _59("State"), sortable: true },
          { title: _59("Last Init Status"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
    }
    componentDidMount() {
      this.setState({ page: this.props.page });
    }
    convertStatus(msg) {
      if (msg === "Initialized") {
        return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("i", { children: _59("Initialized") });
      } else if (msg === "Not Initialized") {
        return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("i", { children: _59("Not Initialized") });
      } else if (msg === "Initializing") {
        return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { children: [
          /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("i", { children: _59("Initializing") }),
          " ",
          /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Spinner, { size: "sm" })
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("i", { children: msg });
    }
    render() {
      const rows = [];
      let columns = this.state.columns;
      let has_rows = true;
      let tableRows;
      const rows_copy = JSON.parse(JSON.stringify(this.props.rows));
      for (const row of rows_copy) {
        rows.push([row[0], row[1], row[2], row[3], this.convertStatus(row[5])]);
      }
      if (rows.length === 0) {
        has_rows = false;
        columns = [{ title: _59("Replication Agreements") }];
        tableRows = [{ cells: [_59("No Agreements")] }];
      } else {
        const startIdx = this.state.perPage * this.state.page - this.state.perPage;
        tableRows = rows.splice(startIdx, this.state.perPage);
      }
      return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "ds-margin-top-xlg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
          SearchInput,
          {
            className: "ds-margin-top-xlg",
            placeholder: _59("Search agreements"),
            value: this.props.value,
            onChange: this.props.handleSearch,
            onClear: (evt) => this.props.search(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
          Table,
          {
            className: "ds-margin-top-lg",
            "aria-label": "agmt table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy: this.props.sortBy,
                      onSort: this.props.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Td, { children: cell }, cellIndex)) : row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Td, { children: cell }, cellIndex)),
                has_rows && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActionsForRow(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage: this.state.perPage,
            page: this.state.page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var ManagerTable = class extends import_react129.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getRowActions", (row) => [
        {
          title: "Change password",
          onClick: () => this.props.showEditManager(row)
        },
        {
          isSeparator: true
        },
        {
          title: "Delete manager",
          onClick: () => this.props.confirmDelete(row)
        }
      ]);
      this.state = {
        sortBy: {},
        rows: [],
        columns: [
          {
            title: "Manager Name",
            sortable: true
          }
        ]
      };
      this.handleSort = this.handleSort.bind(this);
    }
    componentDidMount() {
      let rows = [...this.props.rows];
      let columns = this.state.columns;
      if (this.props.rows.length === 0) {
        rows = [[_59("No Replication Managers")]];
        columns = [{ title: "" }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, columnIndex, sortDirection) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[0] < b[0] ? -1 : a2[0] > b[0] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index: columnIndex,
          direction: sortDirection
        },
        rows: sortDirection === "asc" ? sortedRows : sortedRows.reverse()
      });
    }
    render() {
      return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
        Table,
        {
          "aria-label": "manager table",
          variant: "compact",
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Tr, { children: this.state.columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
              Th,
              {
                sort: column.sortable ? {
                  sortBy: this.state.sortBy,
                  onSort: this.handleSort,
                  columnIndex
                } : void 0,
                screenReaderText: column.screenReaderText,
                textCenter: columnIndex === 1,
                children: column.title
              },
              columnIndex
            )) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Tbody, { children: this.state.rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Tr, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Td, { children: row }, row),
              this.props.rows.length !== 0 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Td, { isActionCell: true, textCenter: true, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
                ActionsColumn,
                {
                  items: this.getRowActions(row)
                }
              ) }, row + "action")
            ] }, rowIndex)) })
          ]
        }
      );
    }
  };
  var RUVTable = class extends import_react129.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        sortBy: {},
        rows: [],
        columns: [
          { title: _59("Replica ID"), sortable: true },
          { title: _59("Replica LDAP URL"), sortable: true },
          { title: _59("Max CSN"), sortable: true },
          { title: "", sortable: false, screenReaderText: _59("Clean RUV") }
        ]
      };
      this.handleSort = this.handleSort.bind(this);
      this.getCleanButton = this.getCleanButton.bind(this);
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const row of this.props.rows) {
        rows.push([
          row.rid,
          row.url,
          row.maxcsn,
          this.getCleanButton(row.rid)
        ]);
      }
      if (rows.length === 0) {
        rows = [{ cells: [_59("No RUV's")] }];
        columns = [{ title: _59("Remote RUV's") }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    getCleanButton(rid) {
      return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
        Button,
        {
          variant: "warning",
          onClick: () => {
            this.props.confirmDelete(rid);
          },
          title: _59("Remove this RUV/Replica ID from all the Replicas."),
          children: _59("Clean RUV")
        }
      );
    }
    render() {
      const tableRows = this.state.rows.map((row, rowIndex) => ({
        cells: Array.isArray(row) ? row : row.cells
      }));
      return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
        Table,
        {
          "aria-label": "ruv table",
          variant: "compact",
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Tr, { children: this.state.columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
              Th,
              {
                sort: column.sortable ? {
                  sortBy: this.state.sortBy,
                  onSort: this.handleSort,
                  columnIndex
                } : void 0,
                screenReaderText: column.screenReaderText,
                children: column.title
              },
              columnIndex
            )) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Tr, { children: row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
              Td,
              {
                textCenter: cellIndex === row.cells.length - 1,
                children: cell
              },
              cellIndex
            )) }, rowIndex)) })
          ]
        }
      ) });
    }
  };
  var ReplicaLDIFTable = class extends import_react129.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _59("LDIF File"), sortable: true },
          { title: _59("Creation Date"), sortable: true },
          { title: _59("File Size"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      for (const ldifRow of this.props.rows) {
        rows.push(ldifRow);
      }
      if (rows.length === 0) {
        rows = [[_59("No LDIF files")]];
        columns = [{ title: _59("LDIF File") }];
      }
      this.setState({
        rows,
        columns
      });
    }
    handleSort(_event, index, direction) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse(),
        page: 1
      });
    }
    render() {
      const { columns, rows, sortBy } = this.state;
      return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
        Table,
        {
          "aria-label": "ldif table",
          variant: "compact",
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Tr, { children: columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
              Th,
              {
                sort: column.sortable ? {
                  sortBy,
                  onSort: this.handleSort,
                  columnIndex: idx
                } : void 0,
                children: column.title
              },
              idx
            )) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Tbody, { children: rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Tr, { children: Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Td, { children: cell }, cellIndex)) : row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Td, { children: cell }, cellIndex)) }, rowIndex)) })
          ]
        }
      );
    }
  };
  ReplAgmtTable.propTypes = {
    rows: import_prop_types58.default.array,
    edit: import_prop_types58.default.func,
    poke: import_prop_types58.default.func,
    init: import_prop_types58.default.func,
    enable: import_prop_types58.default.func,
    delete: import_prop_types58.default.func
  };
  ReplAgmtTable.defaultProps = {
    rows: []
  };
  ManagerTable.propTypes = {
    rows: import_prop_types58.default.array,
    confirmDelete: import_prop_types58.default.func
  };
  ManagerTable.defaultProps = {
    rows: []
  };
  RUVTable.propTypes = {
    rows: import_prop_types58.default.array,
    confirmDelete: import_prop_types58.default.func
  };
  RUVTable.defaultProps = {
    rows: []
  };
  ReplicaLDIFTable.propTypes = {
    rows: import_prop_types58.default.array
  };
  ReplicaLDIFTable.defaultProps = {
    rows: []
  };

  // src/lib/replication/replModals.jsx
  var import_react130 = __toESM(require_react(), 1);
  var import_prop_types59 = __toESM(require_prop_types(), 1);
  var import_exclamation_triangle_icon10 = __toESM(require_exclamation_triangle_icon(), 1);
  var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1);
  var _60 = cockpit_default.gettext;
  var WinsyncAgmtModal = class extends import_react130.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: 0
      };
      this.handleNavSelect = (event, tabIndex) => {
        event.preventDefault();
        this.setState({
          activeTabKey: tabIndex
        });
      };
    }
    hasMainErrors(errors) {
      const attrs = [
        "agmtName",
        "agmtHost",
        "agmtPort",
        "agmtBindDN",
        "agmtBindPW",
        "agmtBindPWConfirm"
      ];
      for (const attr of attrs) {
        if (attr in errors && errors[attr]) {
          return true;
        }
      }
      return false;
    }
    hasDomainErrors(errors) {
      const attrs = [
        "agmtWinDomain",
        "agmtWinSubtree",
        "agmtDSSubtree"
      ];
      for (const attr of attrs) {
        if (attr in errors && errors[attr]) {
          return true;
        }
      }
      return false;
    }
    hasScheduleErrors(errors) {
      const attrs = [
        "agmtStartTime",
        "agmtEndTime"
      ];
      for (const attr of attrs) {
        if (attr in errors && errors[attr]) {
          return true;
        }
      }
      return false;
    }
    render() {
      const {
        showModal,
        closeHandler,
        saveHandler,
        handleChange,
        handleTimeChange,
        handleFracChange,
        onSelectToggle,
        onSelectClear,
        spinning,
        agmtName,
        agmtHost,
        agmtPort,
        agmtProtocol,
        agmtBindDN,
        agmtBindPW,
        agmtBindPWConfirm,
        agmtFracAttrs,
        agmtSync,
        agmtSyncMon,
        agmtSyncTue,
        agmtSyncWed,
        agmtSyncThu,
        agmtSyncFri,
        agmtSyncSat,
        agmtSyncSun,
        agmtStartTime,
        agmtEndTime,
        agmtSyncGroups,
        agmtSyncUsers,
        agmtWinDomain,
        agmtWinSubtree,
        agmtDSSubtree,
        agmtOneWaySync,
        // "both", "toWindows", "fromWindows"
        agmtSyncInterval,
        agmtInit,
        availAttrs,
        error,
        isExcludeAttrOpen
      } = this.props;
      const saveDisabled = !this.props.saveOK;
      let title = _60("Create");
      let initRow = "";
      let name2 = "agmt-modal";
      const startHour = agmtStartTime.substring(0, 2);
      const startMin = agmtStartTime.substring(2, 4);
      const startTime = startHour + ":" + startMin;
      const endHour = agmtEndTime.substring(0, 2);
      const endMin = agmtEndTime.substring(2, 4);
      const endTime = endHour + ":" + endMin;
      let saveBtnName = _60("Save Agreement");
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = _60("Saving Agreement ...");
        extraPrimaryProps.spinnerAriaValueText = _60("Saving");
      }
      let mainSettingsError = "";
      let scheduleError = "";
      let domainError = "";
      if (this.hasMainErrors(error)) {
        mainSettingsError = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabTitleIcon, { className: "ds-warning-icon", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_exclamation_triangle_icon10.ExclamationTriangleIcon, {}) });
      }
      if (this.hasDomainErrors(error)) {
        domainError = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabTitleIcon, { className: "ds-warning-icon", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_exclamation_triangle_icon10.ExclamationTriangleIcon, {}) });
      }
      if (this.hasScheduleErrors(error)) {
        scheduleError = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabTitleIcon, { className: "ds-warning-icon", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_exclamation_triangle_icon10.ExclamationTriangleIcon, {}) });
      }
      if (this.props.edit) {
        title = _60("Edit");
        name2 = "agmt-modal-edit";
      } else {
        initRow = /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Consumer Initialization") }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
            FormSelect,
            {
              value: agmtInit,
              id: "agmtInit",
              onChange: (e, str) => {
                handleChange(e);
              },
              "aria-label": "FormSelect Input",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { value: "noinit", label: _60("Do Not Initialize") }, 0),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { value: "online-init", label: _60("Do Online Initialization") }, 1)
              ]
            }
          ) })
        ] });
      }
      let scheduleRow = /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ds-left-indent-md", children: [
        /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Grid, { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 12, children: _60("Days To Send Synchronization Updates") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ds-indent ds-margin-top", children: [
          /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Checkbox,
              {
                id: "agmtSyncMon",
                onChange: (e, checked) => {
                  handleChange(e);
                },
                name: name2,
                isChecked: agmtSyncMon,
                label: _60("Monday"),
                isValid: !error.agmtSyncMon
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Checkbox,
              {
                id: "agmtSyncFri",
                onChange: (e, checked) => {
                  handleChange(e);
                },
                name: name2,
                isChecked: agmtSyncFri,
                label: _60("Friday"),
                isValid: !error.agmtSyncFri
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Checkbox,
              {
                id: "agmtSyncTue",
                onChange: (e, checked) => {
                  handleChange(e);
                },
                name: name2,
                isChecked: agmtSyncTue,
                isValid: !error.agmtSyncTue,
                label: _60("Tuesday")
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Checkbox,
              {
                id: "agmtSyncSat",
                onChange: (e, checked) => {
                  handleChange(e);
                },
                name: name2,
                isChecked: agmtSyncSat,
                isValid: !error.agmtSyncSat,
                label: _60("Saturday")
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Checkbox,
              {
                id: "agmtSyncWed",
                onChange: (e, checked) => {
                  handleChange(e);
                },
                name: name2,
                isChecked: agmtSyncWed,
                label: _60("Wednesday"),
                isValid: !error.agmtSyncWed
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Checkbox,
              {
                id: "agmtSyncSun",
                onChange: (e, checked) => {
                  handleChange(e);
                },
                name: name2,
                isChecked: agmtSyncSun,
                isValid: !error.agmtSyncSun,
                label: _60("Sunday")
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
            Checkbox,
            {
              id: "agmtSyncThu",
              onChange: (e, checked) => {
                handleChange(e);
              },
              name: name2,
              isChecked: agmtSyncThu,
              isValid: !error.agmtSyncThu,
              label: _60("Thursday")
            }
          ) }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top-lg", title: _60("Time to start initiating replication sessions"), children: [
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Replication Start Time") }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              TimePicker,
              {
                time: startTime,
                id: "agmtStartTime",
                onChange: (_event, time2, hour, min3, seconds2, isValid) => {
                  handleTimeChange(this.props.edit ? "edit" : "create", "agmtStartTime", time2);
                },
                stepMinutes: 5,
                direction: "up",
                is24Hour: true
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: _60("Start time must be before the End time") })
          ] })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { title: _60("Time to initiating replication sessions"), children: [
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Replication End Time") }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              TimePicker,
              {
                time: endTime,
                id: "agmtEndTime",
                onChange: (_event, time2, hour, min3, seconds2, isValid) => {
                  handleTimeChange(this.props.edit ? "edit" : "create", "agmtEndTime", time2);
                },
                stepMinutes: 5,
                direction: "up",
                is24Hour: true
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: _60("End time must be after the Start time") })
          ] })
        ] })
      ] });
      if (!agmtSync) {
        scheduleRow = "";
      }
      title = cockpit_default.format(_60("$0 Winsync Agreement"), title);
      return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          className: "ds-modal-winsync-agmt",
          "aria-labelledby": "ds-modal",
          title,
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Button,
              {
                variant: "primary",
                isDisabled: saveDisabled || spinning,
                onClick: saveHandler,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? _60("Saving") : void 0,
                ...extraPrimaryProps,
                children: saveBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, { variant: "link", onClick: closeHandler, children: _60("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: spinning ? "ds-disabled" : "", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Form, { isHorizontal: true, autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
              mainSettingsError,
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabTitleText, { children: _60("Main Settings") })
            ] }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Agreement Name") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                  TextInput,
                  {
                    value: agmtName,
                    type: "text",
                    id: "agmtName",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "agmtName",
                    onChange: (e, str) => {
                      handleChange(e);
                    },
                    isDisabled: this.props.edit,
                    validated: error.agmtName ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Windows AD Host") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                  TextInput,
                  {
                    value: agmtHost,
                    type: "text",
                    id: "agmtHost",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "agmtHost",
                    onChange: (e, str) => {
                      handleChange(e);
                    },
                    validated: error.agmtHost ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Windows AD Port") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                  TextInput,
                  {
                    value: agmtPort,
                    type: "number",
                    id: "agmtPort",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "agmtPort",
                    onChange: (e, str) => {
                      handleChange(e);
                    },
                    validated: error.agmtPort ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Bind DN") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                    TextInput,
                    {
                      value: agmtBindDN,
                      type: "text",
                      id: "agmtBindDN",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "agmtBindDN",
                      onChange: (e, str) => {
                        handleChange(e);
                      },
                      validated: error.agmtBindDN ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: _60("Value must be a valid DN") })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Bind Password") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                    TextInput,
                    {
                      value: agmtBindPW,
                      type: "password",
                      id: "agmtBindPW",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "agmtBindPW",
                      onChange: (e, str) => {
                        handleChange(e);
                      },
                      validated: error.agmtBindPW ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: _60("Passwords must match") })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Confirm Password") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                    TextInput,
                    {
                      value: agmtBindPWConfirm,
                      type: "password",
                      id: "agmtBindPWConfirm",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "agmtBindPWConfirm",
                      onChange: (e, str) => {
                        handleChange(e);
                      },
                      validated: error.agmtBindPWConfirm ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: _60("Passwords must match") })
                ] })
              ] }),
              initRow
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
              domainError,
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabTitleText, { children: _60("Domain & Content") })
            ] }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Windows Domain Name") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                  TextInput,
                  {
                    value: agmtWinDomain,
                    type: "text",
                    id: "agmtWinDomain",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "agmtWinDomain",
                    onChange: (e, str) => {
                      handleChange(e);
                    },
                    validated: error.agmtWinDomain ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top-lg", title: _60("The Active Directory subtree to synchronize"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Windows Subtree") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                    TextInput,
                    {
                      value: agmtWinSubtree,
                      type: "text",
                      id: "agmtWinSubtree",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "agmtWinSubtree",
                      onChange: (e, str) => {
                        handleChange(e);
                      },
                      placeholder: _60("e.g. cn=Users,dc=domain,dc=com"),
                      validated: error.agmtWinSubtree ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: "Value must be a valid DN" })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", title: _60("Directory Server subtree to synchronize"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("DS Subtree") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                    TextInput,
                    {
                      value: agmtDSSubtree,
                      type: "text",
                      id: "agmtDSSubtree",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "agmtDSSubtree",
                      onChange: (e, str) => {
                        handleChange(e);
                      },
                      placeholder: _60("e.g. ou=People,dc=domain,dc=com"),
                      validated: error.agmtDSSubtree ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: _60("Value must be a valid DN") })
                ] })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabTitleText, { children: _60("Advanced Settings") }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Connection Protocol") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
                  FormSelect,
                  {
                    value: agmtProtocol,
                    id: "agmtProtocol",
                    onChange: (e, str) => {
                      handleChange(e);
                    },
                    "aria-label": "FormSelect Input",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { value: "LDAPS", label: _60("LDAPS") }, 0),
                      /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { value: "StartTLS", label: _60("StartTLS") }, 1)
                    ]
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Synchronization Direction") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
                  FormSelect,
                  {
                    value: agmtOneWaySync,
                    id: "agmtOneWaySync",
                    onChange: (e, str) => {
                      handleChange(e);
                    },
                    "aria-label": "FormSelect Input",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { title: _60("Synchronization in both directions (default behavior)."), value: "both", label: _60("both") }, 0),
                      /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { title: _60("Only synchronize Directory Server updates to Windows."), value: "toWindows", label: _60("toWindows") }, 1),
                      /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { title: _60("Only synchronize Windows updates to Directory Server."), value: "fromWindows", label: _60("fromWindows") }, 2)
                    ]
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", title: _60("The interval to check for updates on Windows.  Default is 300 seconds"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Synchronization Interval") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                  TextInput,
                  {
                    value: agmtSyncInterval,
                    type: "number",
                    id: "agmtSyncInterval",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "agmtSyncInterval",
                    onChange: (e, str) => {
                      handleChange(e);
                    },
                    validated: error.agmtSyncInterval ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", title: _60("Attribute to exclude from replication"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Exclude Attributes") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: agmtFracAttrs,
                    onSelect: (e, selection) => {
                      handleFracChange(selection);
                    },
                    onClear: onSelectClear,
                    options: availAttrs,
                    isOpen: isExcludeAttrOpen,
                    onToggle: onSelectToggle,
                    placeholder: _60("Start typing an attribute..."),
                    noResultsText: _60("There are no matching entries"),
                    ariaLabel: "Type an attribute",
                    isMulti: true
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Grid, { className: "ds-margin-top-med", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                Checkbox,
                {
                  id: "agmtSyncGroups",
                  onChange: (e, checked) => {
                    handleChange(e);
                  },
                  name: name2,
                  isChecked: agmtSyncGroups,
                  label: _60("Synchronize New Windows Groups")
                }
              ) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                Checkbox,
                {
                  id: "agmtSyncUsers",
                  onChange: (e, checked) => {
                    handleChange(e);
                  },
                  name: name2,
                  isChecked: agmtSyncUsers,
                  label: _60("Synchronize New Windows Users")
                }
              ) }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Tab, { eventKey: 3, title: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
              scheduleError,
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabTitleText, { children: _60("Scheduling") })
            ] }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text, { component: TextVariants.h5, children: _60("By default replication updates are sent to the replica as soon as possible, but if there is a need for replication updates to only be sent on certain days and within certain windows of time then you can setup a custom replication schedule.") }) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-margin-top-lg", span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                  Checkbox,
                  {
                    id: "agmtSync",
                    isChecked: agmtSync,
                    onChange: (e, checked) => {
                      handleChange(e);
                    },
                    name: name2,
                    label: _60("Use A Custom Schedule")
                  }
                ) })
              ] }),
              scheduleRow
            ] })
          ] }) }) })
        }
      );
    }
  };
  var ReplAgmtModal = class extends import_react130.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: 0
      };
      this.handleNavSelect = (event, tabIndex) => {
        event.preventDefault();
        this.setState({
          activeTabKey: tabIndex
        });
      };
    }
    hasMainErrors(errors) {
      const attrs = [
        "agmtName",
        "agmtHost",
        "agmtPort",
        "agmtBindDN",
        "agmtBindPW",
        "agmtBindPWConfirm"
      ];
      for (const attr of attrs) {
        if (attr in errors && errors[attr]) {
          return true;
        }
      }
      return false;
    }
    hasBootErrors(errors) {
      const attrs = [
        "agmtBootstrapBindDN",
        "agmtBootstrapBindPW",
        "agmtBootstrapBindPWConfirm"
      ];
      for (const attr of attrs) {
        if (attr in errors && errors[attr]) {
          return true;
        }
      }
      return false;
    }
    hasScheduleErrors(errors) {
      const attrs = [
        "agmtStartTime",
        "agmtEndTime"
      ];
      for (const attr of attrs) {
        if (attr in errors && errors[attr]) {
          return true;
        }
      }
      return false;
    }
    render() {
      const {
        showModal,
        closeHandler,
        saveHandler,
        handleChange,
        handleTimeChange,
        handleStripChange,
        handleFracChange,
        handleFracInitChange,
        onExcludeAttrsToggle,
        onExcludeAttrsClear,
        onExcludeAttrsInitToggle,
        onExcludeAttrsInitClear,
        onStripAttrsToggle,
        onStripAttrsClear,
        isExcludeAttrsOpen,
        isExcludeInitAttrsOpen,
        isStripAttrsOpen,
        spinning,
        agmtName,
        agmtHost,
        agmtPort,
        agmtProtocol,
        agmtBindMethod,
        agmtBindMethodOptions,
        agmtBindDN,
        agmtBindPW,
        agmtBindPWConfirm,
        agmtBootstrap,
        agmtBootstrapBindDN,
        agmtBootstrapBindPW,
        agmtBootstrapBindPWConfirm,
        agmtBootstrapProtocol,
        agmtBootstrapBindMethod,
        agmtBootstrapBindMethodOptions,
        agmtStripAttrs,
        agmtFracAttrs,
        agmtFracInitAttrs,
        agmtSync,
        agmtSyncMon,
        agmtSyncTue,
        agmtSyncWed,
        agmtSyncThu,
        agmtSyncFri,
        agmtSyncSat,
        agmtSyncSun,
        agmtStartTime,
        agmtEndTime,
        agmtInit,
        availAttrs,
        error
      } = this.props;
      const saveDisabled = !this.props.saveOK;
      let title = _60("Create");
      let initRow = "";
      let name2 = "agmt-modal";
      const bootstrapTitle = _60("If you are using Bind Group's on the consumer replica you can configure bootstrap credentials that can be used to do online initializations, or bootstrap a session if the bind groups get out of synchronization");
      const startHour = agmtStartTime.substring(0, 2);
      const startMin = agmtStartTime.substring(2, 4);
      const startTime = startHour + ":" + startMin;
      const endHour = agmtEndTime.substring(0, 2);
      const endMin = agmtEndTime.substring(2, 4);
      const endTime = endHour + ":" + endMin;
      let saveBtnName = _60("Save Agreement");
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = _60("Saving Agreement ...");
        extraPrimaryProps.spinnerAriaValueText = _60("Saving");
      }
      let mainSettingsError = "";
      let bootSettingsError = "";
      let scheduleSettingsError = "";
      if (this.hasMainErrors(error)) {
        mainSettingsError = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabTitleIcon, { className: "ds-warning-icon", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_exclamation_triangle_icon10.ExclamationTriangleIcon, {}) });
      }
      if (this.hasBootErrors(error)) {
        bootSettingsError = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabTitleIcon, { className: "ds-warning-icon", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_exclamation_triangle_icon10.ExclamationTriangleIcon, {}) });
      }
      if (this.hasScheduleErrors(error)) {
        scheduleSettingsError = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabTitleIcon, { className: "ds-warning-icon", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_exclamation_triangle_icon10.ExclamationTriangleIcon, {}) });
      }
      if (this.props.edit) {
        title = _60("Edit");
        name2 = "agmt-modal-edit";
      } else {
        initRow = /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Consumer Initialization") }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
            FormSelect,
            {
              value: agmtInit,
              id: "agmtInit",
              onChange: (e, str) => {
                handleChange(e);
              },
              "aria-label": "FormSelect Input",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { value: "noinit", label: _60("Do Not Initialize") }, 0),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { value: "online-init", label: _60("Do Online Initialization") }, 1)
              ]
            }
          ) })
        ] });
      }
      let bootstrapRow = /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ds-left-indent-md", children: [
        /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top-lg", title: _60("The Bind DN the agreement can use to bootstrap initialization"), children: [
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Bind DN") }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              TextInput,
              {
                value: agmtBootstrapBindDN,
                type: "text",
                id: "agmtBootstrapBindDN",
                "aria-describedby": "horizontal-form-name-helper",
                name: "agmtBootstrapBindDN",
                onChange: (e, str) => {
                  handleChange(e);
                },
                validated: error.agmtBootstrapBindDN ? ValidatedOptions.error : ValidatedOptions.default
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: _60("Value must be a valid DN") })
          ] })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, title: _60("The Bind DN password for bootstrap initialization"), children: _60("Password") }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              TextInput,
              {
                value: agmtBootstrapBindPW,
                type: "password",
                id: "agmtBootstrapBindPW",
                "aria-describedby": "horizontal-form-name-helper",
                name: "agmtBootstrapBindPW",
                onChange: (e, str) => {
                  handleChange(e);
                },
                validated: error.agmtBootstrapBindPW ? ValidatedOptions.error : ValidatedOptions.default
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: _60("Password must match") })
          ] })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, title: _60("Confirm the Bind DN password for bootstrap initialization"), children: _60("Confirm Password") }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              TextInput,
              {
                value: agmtBootstrapBindPWConfirm,
                type: "password",
                id: "agmtBootstrapBindPWConfirm",
                "aria-describedby": "horizontal-form-name-helper",
                name: "agmtBootstrapBindPWConfirm",
                onChange: (e, str) => {
                  handleChange(e);
                },
                validated: error.agmtBootstrapBindPWConfirm ? ValidatedOptions.error : ValidatedOptions.default
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: _60("Passwords must match") })
          ] })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, title: _60("The connection protocol for bootstrap initialization"), children: _60("Connection Protocol") }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
            FormSelect,
            {
              value: agmtBootstrapProtocol,
              id: "agmtBootstrapProtocol",
              onChange: (e, str) => {
                handleChange(e);
              },
              "aria-label": "FormSelect Input",
              validated: error.agmtBootstrapProtocol ? ValidatedOptions.error : ValidatedOptions.default,
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { value: "LDAP", label: _60("LDAP") }, 0),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { value: "LDAPS", label: _60("LDAPS") }, 1),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { value: "STARTTLS", label: _60("STARTTLS") }, 2)
              ]
            }
          ) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, title: _60("The authentication method for bootstrap initialization"), children: _60("Authentication Method") }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
            FormSelect,
            {
              value: agmtBootstrapBindMethod,
              id: "agmtBootstrapBindMethod",
              onChange: (e, str) => {
                handleChange(e);
              },
              "aria-label": "FormSelect Input",
              validated: error.agmtBootstrapBindMethod ? ValidatedOptions.error : ValidatedOptions.default,
              children: agmtBootstrapBindMethodOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { value: option, label: option }, index))
            }
          ) })
        ] })
      ] });
      let scheduleRow = /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ds-left-indent-md", children: [
        /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Grid, { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 12, children: _60("Days To Send Replication Updates") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ds-indent ds-margin-top", children: [
          /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Checkbox,
              {
                id: "agmtSyncMon",
                onChange: (e, checked) => {
                  handleChange(e);
                },
                name: name2,
                isChecked: agmtSyncMon,
                label: _60("Monday"),
                isValid: !error.agmtSyncMon
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Checkbox,
              {
                id: "agmtSyncFri",
                onChange: (e, checked) => {
                  handleChange(e);
                },
                name: name2,
                isChecked: agmtSyncFri,
                label: _60("Friday"),
                isValid: !error.agmtSyncFri
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Checkbox,
              {
                id: "agmtSyncTue",
                onChange: (e, checked) => {
                  handleChange(e);
                },
                name: name2,
                isChecked: agmtSyncTue,
                isValid: !error.agmtSyncTue,
                label: _60("Tuesday")
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Checkbox,
              {
                id: "agmtSyncSat",
                onChange: (e, checked) => {
                  handleChange(e);
                },
                name: name2,
                isChecked: agmtSyncSat,
                isValid: !error.agmtSyncSat,
                label: _60("Saturday")
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Checkbox,
              {
                id: "agmtSyncWed",
                onChange: (e, checked) => {
                  handleChange(e);
                },
                name: name2,
                isChecked: agmtSyncWed,
                label: _60("Wednesday"),
                isValid: !error.agmtSyncWed
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Checkbox,
              {
                id: "agmtSyncSun",
                onChange: (e, checked) => {
                  handleChange(e);
                },
                name: name2,
                isChecked: agmtSyncSun,
                isValid: !error.agmtSyncSun,
                label: _60("Sunday")
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
            Checkbox,
            {
              id: "agmtSyncThu",
              onChange: (e, checked) => {
                handleChange(e);
              },
              name: name2,
              isChecked: agmtSyncThu,
              isValid: !error.agmtSyncThu,
              label: _60("Thursday")
            }
          ) }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top-lg", title: _60("Time to start initiating replication sessions"), children: [
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Replication Start Time") }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              TimePicker,
              {
                time: startTime,
                id: "agmtStartTime",
                onChange: (_event, time2, hour, min3, seconds2, isValid) => {
                  handleTimeChange(this.props.edit ? "edit" : "create", "agmtStartTime", time2);
                },
                stepMinutes: 5,
                is24Hour: true
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: _60("Start time must be before the End time") })
          ] })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { title: _60("Time to initiating replication sessions"), children: [
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Replication End Time") }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              TimePicker,
              {
                time: endTime,
                id: "agmtEndTime",
                onChange: (_event, time2, hour, min3, seconds2, isValid) => {
                  handleTimeChange(this.props.edit ? "edit" : "create", "agmtEndTime", time2);
                },
                stepMinutes: 5,
                is24Hour: true
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: _60("End time must be after the Start time") })
          ] })
        ] })
      ] });
      if (!agmtSync) {
        scheduleRow = "";
      }
      if (!agmtBootstrap) {
        bootstrapRow = "";
      }
      title = cockpit_default.format(_60("$0 Replication Agreement"), title);
      return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          className: "ds-modal-repl-agmt",
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Button,
              {
                variant: "primary",
                isDisabled: saveDisabled || spinning,
                onClick: saveHandler,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? _60("Saving") : void 0,
                ...extraPrimaryProps,
                children: saveBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, { variant: "link", onClick: closeHandler, children: _60("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: spinning ? "ds-disabled" : "", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Form, { isHorizontal: true, autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
              mainSettingsError,
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabTitleText, { children: _60("Main Settings") })
            ] }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Agreement Name") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                    TextInput,
                    {
                      value: agmtName,
                      type: "text",
                      id: "agmtName",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "agmtName",
                      onChange: (e, str) => {
                        handleChange(e);
                      },
                      isDisabled: this.props.edit,
                      validated: error.agmtName ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: _60("Required field") })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Consumer Host") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                    TextInput,
                    {
                      value: agmtHost,
                      type: "text",
                      id: "agmtHost",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "agmtHost",
                      onChange: (e, str) => {
                        handleChange(e);
                      },
                      validated: error.agmtHost ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: _60("Required field") })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Consumer Port") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                    TextInput,
                    {
                      value: agmtPort,
                      type: "number",
                      id: "agmtPort",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "agmtPort",
                      onChange: (e, str) => {
                        handleChange(e);
                      },
                      validated: error.agmtPort ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: _60("Port must be between 1 and 65535") })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Bind DN") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                    TextInput,
                    {
                      value: agmtBindDN,
                      type: "text",
                      id: "agmtBindDN",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "agmtBindDN",
                      onChange: (e, str) => {
                        handleChange(e);
                      },
                      validated: error.agmtBindDN ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: _60("Value must be a valid DN") })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Bind Password") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                    TextInput,
                    {
                      value: agmtBindPW,
                      type: "password",
                      id: "agmtBindPW",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "agmtBindPW",
                      onChange: (e, str) => {
                        handleChange(e);
                      },
                      validated: error.agmtBindPW ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: _60("Passwords must match") })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Confirm Password") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                    TextInput,
                    {
                      value: agmtBindPWConfirm,
                      type: "password",
                      id: "agmtBindPWConfirm",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "agmtBindPWConfirm",
                      onChange: (e, str) => {
                        handleChange(e);
                      },
                      validated: error.agmtBindPWConfirm ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormHelperText, { children: _60("Passwords must match") })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Connection Protocol") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
                  FormSelect,
                  {
                    value: agmtProtocol,
                    id: "agmtProtocol",
                    onChange: (e, str) => {
                      handleChange(e);
                    },
                    "aria-label": "FormSelect Input",
                    validated: error.agmtProtocol ? ValidatedOptions.error : ValidatedOptions.default,
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { value: "LDAP", label: _60("LDAP") }, 0),
                      /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { value: "LDAPS", label: _60("LDAPS") }, 1),
                      /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { value: "STARTTLS", label: _60("STARTTLS") }, 2)
                    ]
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Authentication Method") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                  FormSelect,
                  {
                    value: agmtBindMethod,
                    id: "agmtBindMethod",
                    onChange: (e, str) => {
                      handleChange(e);
                    },
                    "aria-label": "FormSelect Input",
                    validated: error.agmtBindMethod ? ValidatedOptions.error : ValidatedOptions.default,
                    children: agmtBindMethodOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { value: option, label: option }, index))
                  }
                ) })
              ] }),
              initRow
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabTitleText, { children: _60("Fractional Settings") }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top-lg", title: _60("Attribute to exclude from replication"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Exclude Attributes") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: agmtFracAttrs,
                    onSelect: (e, selection) => {
                      handleFracChange(selection);
                    },
                    onClear: onExcludeAttrsClear,
                    options: availAttrs,
                    isOpen: isExcludeAttrsOpen,
                    onToggle: onExcludeAttrsToggle,
                    placeholder: _60("Start typing an attribute..."),
                    ariaLabel: "Type an attribute",
                    isMulti: true
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", title: _60("Attribute to exclude from replica Initializations"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Exclude Init Attributes") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: agmtFracInitAttrs,
                    onSelect: (e, selection) => {
                      handleFracInitChange(selection);
                    },
                    onClear: onExcludeAttrsInitClear,
                    options: availAttrs,
                    isOpen: isExcludeInitAttrsOpen,
                    onToggle: onExcludeAttrsInitToggle,
                    placeholder: _60("Start typing an attribute..."),
                    noResultsText: _60("There are no matching entries"),
                    ariaLabel: "Type an attribute",
                    isMulti: true
                  }
                ) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", title: _60("Attributes to strip from a replication update"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Strip Attributes") }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: agmtStripAttrs,
                    onSelect: (e, selection) => {
                      handleStripChange(selection);
                    },
                    onClear: onStripAttrsClear,
                    options: availAttrs,
                    isOpen: isStripAttrsOpen,
                    onToggle: onStripAttrsToggle,
                    placeholder: _60("Start typing an attribute..."),
                    noResultsText: _60("There are no matching entries"),
                    ariaLabel: "Type an attribute",
                    isMulti: true
                  }
                ) })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
              bootSettingsError,
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabTitleText, { children: _60("Bootstrap Settings") })
            ] }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Grid, { className: "ds-margin-top-med", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                Checkbox,
                {
                  id: "agmtBootstrap",
                  isChecked: agmtBootstrap,
                  onChange: (e, checked) => {
                    handleChange(e);
                  },
                  name: name2,
                  title: bootstrapTitle,
                  label: _60("Enable Bootstrap Settings")
                }
              ) }) }),
              bootstrapRow
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Tab, { eventKey: 3, title: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
              scheduleSettingsError,
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabTitleText, { children: _60("Scheduling") })
            ] }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top-med", children: [
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text, { component: TextVariants.h5, children: _60("By default replication updates are sent to the replica as soon as possible, but if there is a need for replication updates to only be sent on certain days and within certain windows of time then you can setup a custom replication schedule.") }) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-margin-top-lg", span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                  Checkbox,
                  {
                    id: "agmtSync",
                    isChecked: agmtSync,
                    onChange: (e, checked) => {
                      handleChange(e);
                    },
                    name: name2,
                    label: _60("Use A Custom Schedule")
                  }
                ) })
              ] }),
              scheduleRow
            ] })
          ] }) }) })
        }
      );
    }
  };
  var ChangeReplRoleModal = class extends import_react130.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        showConfirmPromote: false,
        showConfirmDemote: false
      };
    }
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        role,
        spinning,
        checked,
        onMinus,
        onNumberChange,
        onPlus,
        newRID
      } = this.props;
      let spinner = "";
      let changeType = "";
      let roleOptions = [];
      let ridRow = "";
      const newRole = this.props.newRole;
      let saveDisabled = !checked;
      if (role === "Supplier") {
        changeType = "Demoting";
        roleOptions = ["Hub", "Consumer"];
      } else if (role === "Consumer") {
        changeType = "Promoting";
        roleOptions = ["Supplier", "Hub"];
      } else {
        if (newRole === "Supplier") {
          changeType = "Promoting";
        } else {
          changeType = "Demoting";
        }
        roleOptions = ["Supplier", "Consumer"];
      }
      if (newRole === "Supplier") {
        ridRow = /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top-lg", title: _60("Supplier Replica Identifier.  This must be unique across all the Supplier replicas in your environment"), children: [
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Replica ID") }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
            NumberInput,
            {
              value: newRID,
              min: 1,
              max: 65534,
              onMinus,
              onChange: onNumberChange,
              onPlus,
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 8
            }
          ) })
        ] });
      }
      if (spinning) {
        spinner = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ds-margin-top ds-modal-spinner", children: [
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Spinner, { size: "md" }),
          changeType,
          " replica ..."
        ] }) });
        saveDisabled = true;
      }
      return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
        Modal,
        {
          variant: ModalVariant.small,
          title: _60("Change Replica Role"),
          isOpen: showModal,
          "aria-labelledby": "ds-modal",
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Button,
              {
                variant: "primary",
                onClick: () => {
                  saveHandler(changeType);
                },
                isDisabled: saveDisabled,
                children: _60("Change Role")
              },
              "change"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, { variant: "link", onClick: closeHandler, children: _60("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text, { component: TextVariants.h3, children: _60("Please choose the new replication role you would like for this suffix") }) }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("New Role") }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                FormSelect,
                {
                  value: newRole,
                  id: "newRole",
                  onChange: (e, str) => {
                    handleChange(e);
                  },
                  "aria-label": "FormSelect Input",
                  children: roleOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(FormSelectOption, { value: option, label: option }, index))
                }
              ) })
            ] }),
            ridRow,
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Grid, { className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 12, className: "ds-center", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Checkbox,
              {
                id: "modalChecked",
                isChecked: checked,
                onChange: (e, checked2) => {
                  handleChange(e);
                },
                label: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("b", { children: _60("Yes") }),
                  _60(", I am sure.")
                ] })
              }
            ) }) }),
            spinner
          ] })
        }
      );
    }
  };
  var AddEditManagerModal = class extends import_react130.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        spinning,
        manager,
        manager_passwd,
        manager_passwd_confirm,
        error,
        edit
      } = this.props;
      let saveBtnName = this.props.edit ? "Save Replication Manager" : _60("Add Replication Manager");
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = this.props.edit ? "Saving Replication Manager ..." : _60("Adding Replication Manager ...");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title: this.props.edit ? "Edit Replication Manager" : _60("Add Replication Manager"),
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Button,
              {
                variant: "primary",
                onClick: saveHandler,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? _60("Saving") : void 0,
                ...extraPrimaryProps,
                isDisabled: error.manager || error.manager_passwd || error.manager_passwd_confirm || spinning,
                children: saveBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, { variant: "link", onClick: closeHandler, children: _60("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text, { component: TextVariants.h3, children: this.props.edit ? "" : _60("Create a Replication Manager entry, and add it to the replication configuration for this suffix.  If the entry already exists it will be overwritten with the new credentials.") }) }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top-lg", title: _60("The DN of the replication manager"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Replication Manager DN") }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                TextInput,
                {
                  value: manager,
                  type: "text",
                  id: "manager",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "manager",
                  onChange: (e, str) => {
                    handleChange(e);
                  },
                  isDisabled: this.props.edit,
                  validated: error.manager ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", title: _60("Replication Manager password"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: this.props.edit ? "New password" : _60("Password") }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                TextInput,
                {
                  value: manager_passwd,
                  type: "password",
                  id: "manager_passwd",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "manager_passwd",
                  onChange: (e, str) => {
                    handleChange(e);
                  },
                  validated: error.manager_passwd ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top", title: _60("Replication Manager password"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: this.props.edit ? "Confirm new password" : _60("Confirm Password") }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                TextInput,
                {
                  value: manager_passwd_confirm,
                  type: "password",
                  id: "manager_passwd_confirm",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "manager_passwd_confirm",
                  onChange: (e, str) => {
                    handleChange(e);
                  },
                  validated: error.manager_passwd_confirm ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] })
          ] })
        }
      );
    }
  };
  var EnableReplModal = class extends import_react130.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        spinning,
        enableRole,
        enableRID,
        enableBindDN,
        enableBindPW,
        enableBindPWConfirm,
        enableBindGroupDN,
        error,
        onMinus,
        onPlus,
        onNumberChange
      } = this.props;
      let saveBtnName = _60("Enable Replication");
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = _60("Enabling Replication ...");
        extraPrimaryProps.spinnerAriaValueText = _60("Saving");
      }
      let replicaIDRow = "";
      if (enableRole === "Supplier") {
        replicaIDRow = /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 3, className: "ds-label", children: _60("Replica ID") }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
            NumberInput,
            {
              value: enableRID,
              min: 1,
              max: 65534,
              onMinus,
              onChange: onNumberChange,
              onPlus,
              inputName: "input",
              inputAriaLabel: "number input",
              minusBtnAriaLabel: "minus",
              plusBtnAriaLabel: "plus",
              widthChars: 6
            }
          ) })
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title: _60("Enable Replication"),
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Button,
              {
                variant: "primary",
                onClick: saveHandler,
                isDisabled: this.props.disabled || spinning,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? _60("Saving") : void 0,
                ...extraPrimaryProps,
                children: saveBtnName
              },
              "enable"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, { variant: "link", onClick: closeHandler, children: _60("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text, { component: TextVariants.h6, children: _60("Choose the replication role for this suffix.  If it is a Supplier replica then you must pick a unique ID to identify it among the other Supplier replicas in your environment.  The replication changelog will also automatically be created for you.") }) }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 3, className: "ds-label", children: _60("Replication Role") }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                dsBasicComponents_default,
                {
                  selected: enableRole,
                  onSelect: (e, selection) => {
                    const syntheticEvent = { target: { id: "enableRole", value: selection } };
                    handleChange(syntheticEvent);
                  },
                  options: [_60("Supplier"), _60("Hub"), _60("Consumer")],
                  placeholder: _60("Select role..."),
                  ariaLabel: "Replication role selection",
                  isMulti: false
                }
              ) })
            ] }),
            replicaIDRow,
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("hr", {}),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text, { component: TextVariants.h6, children: _60('You can optionally define the authentication information for this replicated suffix.  Either a Manager DN and Password, a Bind Group DN, or both, can be provided.  The Manager DN should be an entry under "cn=config" and if it does not exist it will be created, while the Bind Group DN is usually an existing group located in the database suffix.  Typically, just the Manager DN and Password are used when enabling replication for a suffix.') }) }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { title: _60("The DN of the replication manager.  If you supply a password the entry will be created in the server (it will also overwrite the entry is it already exists)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Replication Manager DN") }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                TextInput,
                {
                  value: enableBindDN,
                  type: "text",
                  id: "enableBindDN",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "enableBindDN",
                  onChange: (e, str) => {
                    handleChange(e);
                  },
                  validated: error.enableBindDN ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { title: _60("Replication Manager password"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Password") }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                TextInput,
                {
                  value: enableBindPW,
                  type: "password",
                  id: "enableBindPW",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "enableBindPW",
                  onChange: (e, str) => {
                    handleChange(e);
                  },
                  validated: error.enableBindPW ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { title: _60("Confirm the Replication Manager password"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Confirm Password") }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                TextInput,
                {
                  value: enableBindPWConfirm,
                  type: "password",
                  id: "enableBindPWConfirm",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "enableBindPWConfirm",
                  onChange: (e, str) => {
                    handleChange(e);
                  },
                  validated: error.enableBindPWConfirm ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { title: _60("The DN of a group that contains users that can perform replication updates"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 3, children: _60("Bind Group DN") }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                TextInput,
                {
                  value: enableBindGroupDN,
                  type: "text",
                  id: "enableBindGroupDN",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "enableBindGroupDN",
                  onChange: (e, str) => {
                    handleChange(e);
                  },
                  validated: error.enableBindGroupDN ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] })
          ] })
        }
      );
    }
  };
  var ExportCLModal = class extends import_react130.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        default: true,
        debug: false
      };
    }
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        handleLDIFChange,
        handleRadioChange,
        saveHandler,
        spinning,
        defaultCL,
        debugCL,
        decodeCL,
        exportCSN,
        ldifFile,
        saveOK
      } = this.props;
      let page = "";
      let saveBtnName = _60("Export Changelog");
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = _60("Exporting ...");
        extraPrimaryProps.spinnerAriaValueText = _60("Saving");
      }
      if (defaultCL) {
        page = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text, { component: TextVariants.h4, children: _60("This will export the changelog to the server's LDIF directory.  This is the only LDIF file that can be imported into the server for enabling changelog encryption.  Do not edit or rename the file.") }) });
      } else {
        page = /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Text, { component: TextVariants.h4, children: _60("The LDIF file that is generated should <b>not</b> be used to initialize the Replication Changelog.  It is only meant for debugging/investigative purposes.") }) }) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Grid, { className: "ds-margin-top-xlg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { className: "ds-label", span: 2, children: _60("LDIF File") }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              TextInput,
              {
                value: ldifFile,
                type: "text",
                id: "ldifFile",
                "aria-describedby": "horizontal-form-name-helper",
                name: "ldifFile",
                onChange: (e, str) => {
                  handleLDIFChange(e);
                }
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Grid, { className: "ds-margin-top-xlg ds-margin-left", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
            Checkbox,
            {
              id: "decodeCL",
              isChecked: decodeCL,
              isDisabled: exportCSN,
              onChange: (e, checked) => {
                handleChange(e);
              },
              label: _60("Decode base64 changes")
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Grid, { className: "ds-margin-top ds-margin-left", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
            Checkbox,
            {
              id: "exportCSN",
              isChecked: exportCSN,
              isDisabled: decodeCL,
              onChange: (e, checked) => {
                handleChange(e);
              },
              label: _60("Only Export CSN's")
            }
          ) })
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          className: "ds-modal-changelog-export",
          title: _60("Create Replication Change Log LDIF File"),
          isOpen: showModal,
          "aria-labelledby": "ds-modal",
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Button,
              {
                variant: "primary",
                onClick: saveHandler,
                isDisabled: !saveOK || spinning,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? _60("Saving") : void 0,
                ...extraPrimaryProps,
                children: saveBtnName
              },
              "export"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, { variant: "link", onClick: closeHandler, children: _60("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Grid, { className: "ds-indent ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Radio,
              {
                isChecked: defaultCL,
                name: "radioGroup",
                onChange: handleRadioChange,
                label: _60("Export to LDIF For Reinitializing The Changelog"),
                id: "defaultCL"
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Grid, { className: "ds-indent", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
              Radio,
              {
                isChecked: debugCL,
                name: "radioGroup",
                onChange: handleRadioChange,
                label: _60("Export to LDIF For Debugging"),
                id: "debugCL"
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("hr", {}),
            page
          ] })
        }
      );
    }
  };
  EnableReplModal.propTypes = {
    showModal: import_prop_types59.default.bool,
    closeHandler: import_prop_types59.default.func,
    handleChange: import_prop_types59.default.func,
    saveHandler: import_prop_types59.default.func,
    spinning: import_prop_types59.default.bool,
    disabled: import_prop_types59.default.bool,
    error: import_prop_types59.default.object
  };
  EnableReplModal.defaultProps = {
    showModal: false,
    spinning: false,
    disabled: false,
    error: {}
  };
  AddEditManagerModal.propTypes = {
    showModal: import_prop_types59.default.bool,
    closeHandler: import_prop_types59.default.func,
    handleChange: import_prop_types59.default.func,
    saveHandler: import_prop_types59.default.func,
    spinning: import_prop_types59.default.bool,
    error: import_prop_types59.default.object,
    edit: import_prop_types59.default.bool
  };
  AddEditManagerModal.defaultProps = {
    showModal: false,
    spinning: false,
    error: {}
  };
  ChangeReplRoleModal.propTypes = {
    showModal: import_prop_types59.default.bool,
    closeHandler: import_prop_types59.default.func,
    handleChange: import_prop_types59.default.func,
    saveHandler: import_prop_types59.default.func,
    spinning: import_prop_types59.default.bool,
    role: import_prop_types59.default.string,
    newRole: import_prop_types59.default.string
  };
  ChangeReplRoleModal.defaultProps = {
    showModal: false,
    spinning: false,
    role: "",
    newRole: ""
  };
  ReplAgmtModal.propTypes = {
    showModal: import_prop_types59.default.bool,
    closeHandler: import_prop_types59.default.func,
    handleChange: import_prop_types59.default.func,
    handleStripChange: import_prop_types59.default.func,
    handleFracChange: import_prop_types59.default.func,
    handleFracInitChange: import_prop_types59.default.func,
    saveHandler: import_prop_types59.default.func,
    spinning: import_prop_types59.default.bool,
    availAttrs: import_prop_types59.default.array,
    agmtName: import_prop_types59.default.string,
    agmtHost: import_prop_types59.default.string,
    agmtPort: import_prop_types59.default.string,
    agmtProtocol: import_prop_types59.default.string,
    agmtBindMethod: import_prop_types59.default.string,
    agmtBindDN: import_prop_types59.default.string,
    agmtBindPW: import_prop_types59.default.string,
    agmtBindPWConfirm: import_prop_types59.default.string,
    agmtBootstrap: import_prop_types59.default.bool,
    agmtBootstrapProtocol: import_prop_types59.default.string,
    agmtBootstrapBindMethod: import_prop_types59.default.string,
    agmtBootstrapBindDN: import_prop_types59.default.string,
    agmtBootstrapBindPW: import_prop_types59.default.string,
    agmtBootstrapBindPWConfirm: import_prop_types59.default.string,
    agmtStripAttrs: import_prop_types59.default.array,
    agmtFracAttrs: import_prop_types59.default.array,
    agmtFracInitAttrs: import_prop_types59.default.array,
    agmtSync: import_prop_types59.default.bool,
    agmtSyncMon: import_prop_types59.default.bool,
    agmtSyncTue: import_prop_types59.default.bool,
    agmtSyncWed: import_prop_types59.default.bool,
    agmtSyncThu: import_prop_types59.default.bool,
    agmtSyncFri: import_prop_types59.default.bool,
    agmtSyncSat: import_prop_types59.default.bool,
    agmtSyncSun: import_prop_types59.default.bool,
    agmtStartTime: import_prop_types59.default.string,
    agmtEndTime: import_prop_types59.default.string,
    saveOK: import_prop_types59.default.bool,
    error: import_prop_types59.default.object,
    edit: import_prop_types59.default.bool
  };
  ReplAgmtModal.defaultProps = {
    showModal: false,
    spinning: false,
    availAttrs: [],
    agmtName: "",
    agmtHost: "",
    agmtPort: "636",
    agmtProtocol: "LDAP",
    agmtBindMethod: "SIMPLE",
    agmtBindDN: "",
    agmtBindPW: "",
    agmtBindPWConfirm: "",
    agmtBootstrap: false,
    agmtBootstrapProtocol: "LDAP",
    agmtBootstrapBindMethod: "SIMPLE",
    agmtBootstrapBindDN: "",
    agmtBootstrapBindPW: "",
    agmtBootstrapBindPWConfirm: "",
    agmtStripAttrs: [],
    agmtFracAttrs: [],
    agmtFracInitAttrs: [],
    agmtSync: true,
    agmtSyncMon: false,
    agmtSyncTue: false,
    agmtSyncWed: false,
    agmtSyncThu: false,
    agmtSyncFri: false,
    agmtSyncSat: false,
    agmtSyncSun: false,
    agmtStartTime: "00:00",
    agmtEndTime: "23:59",
    saveOK: false,
    error: {},
    edit: false
  };
  WinsyncAgmtModal.propTypes = {
    showModal: import_prop_types59.default.bool,
    closeHandler: import_prop_types59.default.func,
    handleChange: import_prop_types59.default.func,
    handleFracChange: import_prop_types59.default.func,
    saveHandler: import_prop_types59.default.func,
    spinning: import_prop_types59.default.bool,
    availAttrs: import_prop_types59.default.array,
    agmtName: import_prop_types59.default.string,
    agmtHost: import_prop_types59.default.string,
    agmtPort: import_prop_types59.default.string,
    agmtProtocol: import_prop_types59.default.string,
    agmtBindDN: import_prop_types59.default.string,
    agmtBindPW: import_prop_types59.default.string,
    agmtBindPWConfirm: import_prop_types59.default.string,
    agmtFracAttrs: import_prop_types59.default.array,
    agmtSync: import_prop_types59.default.bool,
    agmtSyncMon: import_prop_types59.default.bool,
    agmtSyncTue: import_prop_types59.default.bool,
    agmtSyncWed: import_prop_types59.default.bool,
    agmtSyncThu: import_prop_types59.default.bool,
    agmtSyncFri: import_prop_types59.default.bool,
    agmtSyncSat: import_prop_types59.default.bool,
    agmtSyncSun: import_prop_types59.default.bool,
    agmtStartTime: import_prop_types59.default.string,
    agmtEndTime: import_prop_types59.default.string,
    agmtSyncGroups: import_prop_types59.default.bool,
    agmtSyncUsers: import_prop_types59.default.bool,
    agmtWinDomain: import_prop_types59.default.string,
    agmtWinSubtree: import_prop_types59.default.string,
    agmtDSSubtree: import_prop_types59.default.string,
    agmtOneWaySync: import_prop_types59.default.string,
    agmtSyncInterval: import_prop_types59.default.string,
    saveOK: import_prop_types59.default.bool,
    error: import_prop_types59.default.object,
    edit: import_prop_types59.default.bool
  };
  WinsyncAgmtModal.defaultProps = {
    showModal: false,
    spinning: false,
    availAttrs: [],
    agmtName: "",
    agmtHost: "",
    agmtPort: "636",
    agmtProtocol: "LDAPS",
    agmtBindDN: "",
    agmtBindPW: "",
    agmtBindPWConfirm: "",
    agmtFracAttrs: [],
    agmtSync: true,
    agmtSyncMon: false,
    agmtSyncTue: false,
    agmtSyncWed: false,
    agmtSyncThu: false,
    agmtSyncFri: false,
    agmtSyncSat: false,
    agmtSyncSun: false,
    agmtStartTime: "00:00",
    agmtEndTime: "23:59",
    agmtSyncGroups: false,
    agmtSyncUsers: false,
    agmtWinDomain: "",
    agmtWinSubtree: "",
    agmtDSSubtree: "",
    agmtOneWaySync: "both",
    // "both", "toWindows", "fromWindows"
    agmtSyncInterval: "",
    saveOK: false,
    error: {},
    edit: false
  };

  // src/lib/replication/replConfig.jsx
  var import_prop_types60 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1);
  var _61 = cockpit_default.gettext;
  var ReplConfig = class extends import_react131.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        saving: false,
        showConfirmManagerDelete: false,
        showAddEditManagerModal: false,
        showPromoteDemoteModal: false,
        addEditManagerSpinning: false,
        editManager: false,
        roleChangeSpinning: false,
        manager: "cn=replication manager,cn=config",
        manager_passwd: "",
        manager_passwd_confirm: "",
        newRole: this.props.role === "Supplier" ? "Hub" : "Supplier",
        newRID: 1,
        modalSpinning: false,
        modalChecked: false,
        errObj: {},
        saveBtnDisabled: true,
        isExpanded: false,
        // Config Settings
        nsds5replicabinddn: this.props.data?.nsds5replicabinddn || [],
        nsds5replicabinddngroup: this.props.data?.nsds5replicabinddngroup || "",
        nsds5replicabinddngroupcheckinterval: Number(this.props.data.nsds5replicabinddngroupcheckinterval) === 0 ? -1 : Number(this.props.data.nsds5replicabinddngroupcheckinterval),
        nsds5replicareleasetimeout: Number(this.props.data.nsds5replicareleasetimeout),
        nsds5replicapurgedelay: Number(this.props.data.nsds5replicapurgedelay) === 0 ? 604800 : Number(this.props.data.nsds5replicapurgedelay),
        nsds5replicatombstonepurgeinterval: Number(this.props.data.nsds5replicatombstonepurgeinterval) === 0 ? 86400 : Number(this.props.data.nsds5replicatombstonepurgeinterval),
        nsds5replicaprecisetombstonepurging: Number(this.props.data.nsds5replicaprecisetombstonepurging),
        nsds5replicaprotocoltimeout: Number(this.props.data.nsds5replicaprotocoltimeout) === 0 ? 120 : Number(this.props.data.nsds5replicaprotocoltimeout),
        nsds5replicabackoffmin: Number(this.props.data.nsds5replicabackoffmin) === 0 ? 3 : Number(this.props.data.nsds5replicabackoffmin),
        nsds5replicabackoffmax: Number(this.props.data.nsds5replicabackoffmax) === 0 ? 300 : Number(this.props.data.nsds5replicabackoffmax),
        nsds5replicakeepaliveupdateinterval: Number(this.props.data.nsds5replicakeepaliveupdateinterval) === 0 ? 3600 : Number(this.props.data.nsds5replicakeepaliveupdateinterval),
        // Original settings
        _nsds5replicabinddn: this.props.data?.nsds5replicabinddn || [],
        _nsds5replicabinddngroup: this.props.data?.nsds5replicabinddngroup || "",
        _nsds5replicabinddngroupcheckinterval: Number(this.props.data.nsds5replicabinddngroupcheckinterval) === 0 ? -1 : Number(this.props.data.nsds5replicabinddngroupcheckinterval),
        _nsds5replicareleasetimeout: this.props.data.nsds5replicareleasetimeout,
        _nsds5replicapurgedelay: Number(this.props.data.nsds5replicapurgedelay) === 0 ? 604800 : Number(this.props.data.nsds5replicapurgedelay),
        _nsds5replicatombstonepurgeinterval: Number(this.props.data.nsds5replicatombstonepurgeinterval) === 0 ? 86400 : Number(this.props.data.nsds5replicatombstonepurgeinterval),
        _nsds5replicaprecisetombstonepurging: this.props.data.nsds5replicaprecisetombstonepurging,
        _nsds5replicaprotocoltimeout: Number(this.props.data.nsds5replicaprotocoltimeout) === 0 ? 120 : Number(this.props.data.nsds5replicaprotocoltimeout),
        _nsds5replicabackoffmin: Number(this.props.data.nsds5replicabackoffmin) === 0 ? 3 : Number(this.props.data.nsds5replicabackoffmin),
        _nsds5replicabackoffmax: Number(this.props.data.nsds5replicabackoffmax) === 0 ? 300 : Number(this.props.data.nsds5replicabackoffmax),
        _nsds5replicakeepaliveupdateinterval: Number(this.props.data.nsds5replicakeepaliveupdateinterval) === 0 ? 3600 : Number(this.props.data.nsds5replicakeepaliveupdateinterval)
      };
      this.handleToggle = (_event, isExpanded) => {
        this.setState({
          isExpanded
        });
      };
      this.handleMinusChange = () => {
        this.setState({
          newRID: Number(this.state.newRID) - 1
        });
      };
      this.handleNumberChange = (event) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          newRID: newValue > 65534 ? 65534 : newValue < 1 ? 1 : newValue
        });
      };
      this.handlePlusChange = () => {
        this.setState({
          newRID: Number(this.state.newRID) + 1
        });
      };
      this.maxValue = 2e7;
      this.onMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.onConfigChange = (event, id, min3) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.confirmManagerDelete = this.confirmManagerDelete.bind(this);
      this.closeConfirmManagerDelete = this.closeConfirmManagerDelete.bind(this);
      this.deleteManager = this.deleteManager.bind(this);
      this.handleShowAddManager = this.handleShowAddManager.bind(this);
      this.handleShowEditManager = this.handleShowEditManager.bind(this);
      this.closeAddEditManagerModal = this.closeAddEditManagerModal.bind(this);
      this.addManager = this.addManager.bind(this);
      this.handleChange = this.handleChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.onManagerChange = this.onManagerChange.bind(this);
      this.handleShowPromoteDemoteModal = this.handleShowPromoteDemoteModal.bind(this);
      this.closePromoteDemoteModal = this.closePromoteDemoteModal.bind(this);
      this.doRoleChange = this.doRoleChange.bind(this);
      this.handleSaveConfig = this.handleSaveConfig.bind(this);
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
    }
    doRoleChange(changeType) {
      let action = "demote";
      if (changeType === "Promoting") {
        action = "promote";
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        action,
        "--suffix=" + this.props.suffix,
        "--newrole=" + this.state.newRole
      ];
      if (this.state.newRole === "Supplier") {
        const ridNum = parseInt(this.state.newRID, 10);
        if (ridNum < 1 || ridNum >= 65535) {
          this.props.addNotification(
            "error",
            _61("A Supplier replica requires a unique numerical identifier.  Please enter an ID between 1 and 65534")
          );
          return;
        }
        cmd.push("--replica-id=" + this.state.newRID);
      }
      this.setState({
        roleChangeSpinning: true
      });
      log_cmd("doRoleChange", "change replica role", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload();
        this.props.addNotification(
          "success",
          cockpit_default.format(
            _61("Successfully $0 replica to a $1"),
            action + "d",
            this.state.newRole
          )
        );
        this.setState({
          roleChangeSpinning: false,
          showPromoteDemoteModal: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reload();
        this.props.addNotification(
          "error",
          cockpit_default.format(_61("Failed to $0 replica - $1"), action, errMsg)
        );
        this.setState({
          roleChangeSpinning: false,
          showPromoteDemoteModal: false
        });
      });
    }
    closePromoteDemoteModal() {
      this.setState({
        showPromoteDemoteModal: false
      });
    }
    handleShowPromoteDemoteModal() {
      this.setState({
        showPromoteDemoteModal: true,
        modalChecked: false
      });
    }
    closeAddEditManagerModal() {
      this.setState({
        showAddEditManagerModal: false
      });
    }
    handleShowAddManager() {
      this.setState({
        showAddEditManagerModal: true,
        manager: "cn=replication manager,cn=config",
        manager_passwd: "",
        manager_passwd_confirm: "",
        editManager: false,
        errObj: {
          manager_passwd: true,
          manager_passwd_confirm: true
        }
      });
    }
    handleShowEditManager(manager) {
      this.setState({
        showAddEditManagerModal: true,
        manager,
        manager_passwd: "",
        manager_passwd_confirm: "",
        editManager: true,
        errObj: {
          manager_passwd: false,
          manager_passwd_confirm: false
        }
      });
    }
    addManager() {
      if (!valid_dn(this.state.manager)) {
        this.props.addNotification(
          "error",
          cockpit_default.format(_61("Invalid DN for the Replication Manager: $0"), this.state.manager)
        );
        return;
      }
      if (this.state.manager_passwd === "" || this.state.manager_passwd_confirm === "") {
        this.props.addNotification(
          "error",
          _61("You must provide a password for the Replication Manager")
        );
        return;
      }
      if (this.state.manager_passwd !== this.state.manager_passwd_confirm) {
        this.props.addNotification(
          "error",
          _61("Passwords do not match")
        );
        return;
      }
      this.setState({
        addEditManagerSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "create-manager",
        "--suffix=" + this.props.suffix,
        "--name=" + this.state.manager
      ];
      const config = {
        cmd,
        promptArg: "",
        // repl manager auto prompts when passwd is missing
        passwd: this.state.manager_passwd,
        addNotification: this.props.addNotification,
        msg: _61("Replication Manager"),
        success_msg: this.state.editManager ? "Successfully edited Replication Manager" : _61("Successfully added Replication Manager"),
        error_msg: this.state.editManager ? "Failure editing Replication Manager" : _61("Failure adding Replication Manager"),
        state_callback: () => {
          this.setState({
            addEditManagerSpinning: false,
            showAddEditManagerModal: false
          });
        },
        reload_func: this.props.reloadConfig,
        reload_arg: this.props.suffix,
        funcName: "addManager",
        funcDesc: this.state.editManager ? "Editing Replication Manager" : _61("Adding Replication Manager")
      };
      callCmdStreamPassword(config);
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      });
    }
    validateSaveBtn() {
      let saveBtnDisabled = true;
      const config_attrs = [
        "nsds5replicabinddngroup",
        "nsds5replicabinddngroupcheckinterval",
        "nsds5replicapurgedelay",
        "nsds5replicatombstonepurgeinterval",
        "nsds5replicareleasetimeout",
        "nsds5replicaprotocoltimeout",
        "nsds5replicabackoffmin",
        "nsds5replicabackoffmax",
        "nsds5replicaprecisetombstonepurging",
        "nsds5replicakeepaliveupdateinterval"
      ];
      for (const config_attr of config_attrs) {
        if (this.state[config_attr] !== this.state["_" + config_attr]) {
          saveBtnDisabled = false;
          break;
        }
      }
      this.setState({
        saveBtnDisabled
      });
    }
    handleChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let saveBtnDisabled = true;
      let valueErr = false;
      const errObj = this.state.errObj;
      const config_attrs = [
        "nsds5replicabinddngroup",
        "nsds5replicabinddngroupcheckinterval",
        "nsds5replicapurgedelay",
        "nsds5replicatombstonepurgeinterval",
        "nsds5replicareleasetimeout",
        "nsds5replicaprotocoltimeout",
        "nsds5replicabackoffmin",
        "nsds5replicabackoffmax",
        "nsds5replicaprecisetombstonepurging",
        "nsds5replicakeepaliveupdateinterval"
      ];
      for (const config_attr of config_attrs) {
        if (attr === config_attr && this.state["_" + config_attr] !== value) {
          saveBtnDisabled = false;
          break;
        }
      }
      for (const config_attr of config_attrs) {
        if (attr !== config_attr && this.state["_" + config_attr] !== this.state[config_attr]) {
          saveBtnDisabled = false;
          break;
        }
      }
      if (attr === "nsds5replicabinddngroup") {
        if (!valid_dn(value)) {
          valueErr = true;
          saveBtnDisabled = true;
        }
      } else if (this.state.nsds5replicabinddngroup !== "" && !valid_dn(this.state.nsds5replicabinddngroup)) {
        saveBtnDisabled = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [attr]: value,
        saveBtnDisabled,
        errObj
      });
    }
    onManagerChange(e) {
      const value = e.target.value;
      const attr = e.target.id;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      if (attr === "manager_passwd") {
        if (value !== this.state.manager_passwd_confirm) {
          valueErr = true;
        } else {
          errObj[attr] = false;
          errObj.manager_passwd_confirm = false;
        }
      } else if (attr === "manager_passwd_confirm") {
        if (value !== this.state.manager_passwd) {
          valueErr = true;
        } else {
          errObj[attr] = false;
          errObj.manager_passwd = false;
        }
      }
      if (attr === "manager") {
        if (!valid_dn(value)) {
          valueErr = true;
        } else {
          errObj[attr] = false;
        }
      }
      errObj[attr] = valueErr;
      this.setState({
        [attr]: value,
        errObj
      });
    }
    confirmManagerDelete(name2) {
      this.setState({
        showConfirmManagerDelete: true,
        modalChecked: false,
        modalSpinning: false,
        manager: name2
      });
    }
    closeConfirmManagerDelete() {
      this.setState({
        showConfirmManagerDelete: false,
        manager: ""
      });
    }
    deleteManager() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "delete-manager",
        "--suffix=" + this.props.suffix,
        "--name=" + this.state.manager
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("deleteManager", "Deleting Replication Manager", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reloadConfig(this.props.suffix);
        this.setState({
          modalSpinning: false
        });
        this.props.addNotification(
          "success",
          _61("Successfully removed Replication Manager")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reloadConfig(this.props.suffix);
        this.props.addNotification(
          "error",
          cockpit_default.format(_61("Failure removing Replication Manager - $0"), errMsg)
        );
        this.setState({
          modalSpinning: false
        });
      });
    }
    handleSaveConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "set",
        "--suffix=" + this.props.suffix
      ];
      if (this.state.nsds5replicabackoffmax !== this.state._nsds5replicabackoffmax) {
        cmd.push("--repl-backoff-max=" + this.state.nsds5replicabackoffmax);
      }
      if (this.state.nsds5replicabackoffmin !== this.state._nsds5replicabackoffmin) {
        cmd.push("--repl-backoff-min=" + this.state.nsds5replicabackoffmin);
      }
      if (this.state.nsds5replicaprotocoltimeout !== this.state._nsds5replicaprotocoltimeout) {
        cmd.push("--repl-protocol-timeout=" + this.state.nsds5replicaprotocoltimeout);
      }
      if (this.state.nsds5replicaprecisetombstonepurging !== this.state._nsds5replicaprecisetombstonepurging) {
        if (this.state.nsds5replicaprecisetombstonepurging) {
          cmd.push("--repl-fast-tombstone-purging=on");
        } else {
          cmd.push("--repl-fast-tombstone-purging=off");
        }
      }
      if (this.state.nsds5replicatombstonepurgeinterval !== this.state._nsds5replicatombstonepurgeinterval) {
        cmd.push("--repl-tombstone-purge-interval=" + this.state.nsds5replicatombstonepurgeinterval);
      }
      if (this.state.nsds5replicabinddngroup !== this.state._nsds5replicabinddngroup) {
        cmd.push("--repl-bind-group=" + this.state.nsds5replicabinddngroup);
      }
      if (this.state.nsds5replicabinddngroupcheckinterval !== this.state._nsds5replicabinddngroupcheckinterval) {
        cmd.push("--repl-bind-group-interval=" + this.state.nsds5replicabinddngroupcheckinterval);
      }
      if (this.state.nsds5replicakeepaliveupdateinterval !== this.state._nsds5replicakeepaliveupdateinterval) {
        cmd.push("--repl-keepalive-update-interval=" + this.state.nsds5replicakeepaliveupdateinterval);
      }
      if (this.state.nsds5replicareleasetimeout !== this.state._nsds5replicareleasetimeout) {
        cmd.push("--repl-release-timeout=" + this.state.nsds5replicareleasetimeout);
      }
      if (this.state.nsds5replicapurgedelay !== this.state._nsds5replicapurgedelay) {
        cmd.push("--repl-purge-delay=" + this.state.nsds5replicapurgedelay);
      }
      if (cmd.length > 6) {
        this.setState({
          // Start the spinner
          saving: true
        });
        log_cmd("handleSaveConfig", "Applying replication changes", cmd);
        const msg = _61("Successfully updated replication configuration.");
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.props.reloadConfig(this.props.suffix);
          this.props.addNotification(
            "success",
            msg
          );
          this.setState({
            saving: false
          });
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.reloadConfig(this.props.suffix);
          this.setState({
            saving: false
          });
          let msg2 = errMsg;
          if ("info" in errMsg) {
            msg2 = errMsg + " - " + errMsg.info;
          }
          this.props.addNotification(
            "error",
            cockpit_default.format(_61("Error updating replication configuration - $0"), msg2)
          );
        });
      }
    }
    render() {
      let roleButton = "";
      const manager_rows = [];
      let saveBtnName = _61("Save Configuration");
      const extraPrimaryProps = {};
      if (this.state.saving) {
        saveBtnName = _61("Saving Config ...");
        extraPrimaryProps.spinnerAriaValueText = _61("Saving");
      }
      for (const row of this.props.data.nsds5replicabinddn) {
        manager_rows.push(row);
      }
      if (this.props.role === "Supplier") {
        roleButton = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
          Button,
          {
            variant: "primary",
            onClick: this.handleShowPromoteDemoteModal,
            title: _61("Demote this Supplier replica to a Hub or Consumer"),
            className: "ds-left-margin",
            children: _61("Change Role")
          }
        );
      } else if (this.props.role === "Hub") {
        roleButton = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
          Button,
          {
            variant: "primary",
            onClick: this.handleShowPromoteDemoteModal,
            title: _61("Promote or Demote this Hub replica to a Supplier or Consumer"),
            className: "ds-left-margin",
            children: _61("Change Role")
          }
        );
      } else {
        roleButton = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
          Button,
          {
            variant: "primary",
            onClick: this.handleShowPromoteDemoteModal,
            title: _61("Promote this Consumer replica to a Supplier or Hub"),
            className: "ds-left-margin",
            children: _61("Change Role")
          }
        );
      }
      return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: this.state.saving ? "ds-disabled" : "", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "ds-margin-top-xxlg ds-left-margin", children: [
        /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
          /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(Grid, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { className: "ds-label", span: 2, children: _61("Replica Role") }),
            /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
              TextInput,
              {
                value: this.props.role,
                type: "text",
                "aria-describedby": "horizontal-form-name-helper",
                name: "replrole",
                id: "replrole",
                isDisabled: true
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { span: 1, children: roleButton })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(Grid, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { className: "ds-label", span: 2, children: _61("Replica ID") }),
            /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
              TextInput,
              {
                value: this.props.data.nsds5replicaid,
                type: "text",
                "aria-describedby": "horizontal-form-name-helper",
                name: "replid",
                id: "replid",
                isDisabled: true
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(Grid, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { className: "ds-label", span: 12, children: _61("Replication Managers") }),
            /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { className: "ds-margin-top", span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
              ManagerTable,
              {
                rows: manager_rows,
                confirmDelete: this.confirmManagerDelete,
                showEditManager: this.handleShowEditManager
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
            Button,
            {
              variant: "secondary",
              onClick: this.handleShowAddManager,
              children: _61("Add Replication Manager")
            }
          ) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
            ExpandableSection,
            {
              toggleText: this.state.isExpanded ? _61("Hide Advanced Settings") : _61("Show Advanced Settings"),
              onToggle: (event, isExpanded) => this.handleToggle(event, isExpanded),
              isExpanded: this.state.isExpanded,
              children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "ds-margin-top ds-margin-left ds-margin-bottom-md", children: [
                /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
                  Grid,
                  {
                    title: _61("The DN of the replication manager group"),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { className: "ds-label", span: 3, children: _61("Bind DN Group") }),
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
                        TextInput,
                        {
                          value: this.state.nsds5replicabinddngroup,
                          type: "text",
                          id: "nsds5replicabinddngroup",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "nsds5replicabinddngroup",
                          onChange: (e, str) => {
                            this.handleChange(e);
                          },
                          validated: this.state.errObj.nsds5replicabinddngroup && this.state.nsds5replicabinddngroup !== "" ? ValidatedOptions.error : ValidatedOptions.default
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
                  Grid,
                  {
                    title: _61("The interval to check for any changes in the group membership specified in the Bind DN Group and automatically rebuilds the list for the replication managers accordingly.  (nsds5replicabinddngroupcheckinterval)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { className: "ds-label", span: 3, children: _61("Bind DN Group Check Interval") }),
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
                        NumberInput,
                        {
                          value: this.state.nsds5replicabinddngroupcheckinterval,
                          min: -1,
                          max: this.maxValue,
                          onMinus: () => {
                            this.onMinusConfig("nsds5replicabinddngroupcheckinterval");
                          },
                          onChange: (e) => {
                            this.onConfigChange(e, "nsds5replicabinddngroupcheckinterval", -1);
                          },
                          onPlus: () => {
                            this.onPlusConfig("nsds5replicabinddngroupcheckinterval");
                          },
                          inputName: "input",
                          inputAriaLabel: "number input",
                          minusBtnAriaLabel: "minus",
                          plusBtnAriaLabel: "plus",
                          widthChars: 8
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
                  Grid,
                  {
                    title: _61("This controls the maximum age of deleted entries (tombstone entries), and entry state information.  (nsds5replicapurgedelay)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { className: "ds-label", span: 3, children: _61("Purge Delay") }),
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
                        NumberInput,
                        {
                          value: this.state.nsds5replicapurgedelay,
                          min: -1,
                          max: this.maxValue,
                          onMinus: () => {
                            this.onMinusConfig("nsds5replicapurgedelay");
                          },
                          onChange: (e) => {
                            this.onConfigChange(e, "nsds5replicapurgedelay", -1);
                          },
                          onPlus: () => {
                            this.onPlusConfig("nsds5replicapurgedelay");
                          },
                          inputName: "input",
                          inputAriaLabel: "number input",
                          minusBtnAriaLabel: "minus",
                          plusBtnAriaLabel: "plus",
                          widthChars: 8
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
                  Grid,
                  {
                    title: _61("This attribute specifies the time interval in seconds between purge operation cycles.  (nsds5replicatombstonepurgeinterval)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { className: "ds-label", span: 3, children: _61("Tombstone Purge Interval") }),
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
                        NumberInput,
                        {
                          value: this.state.nsds5replicatombstonepurgeinterval,
                          min: -1,
                          max: this.maxValue,
                          onMinus: () => {
                            this.onMinusConfig("nsds5replicatombstonepurgeinterval");
                          },
                          onChange: (e) => {
                            this.onConfigChange(e, "nsds5replicatombstonepurgeinterval", -1);
                          },
                          onPlus: () => {
                            this.onPlusConfig("nsds5replicatombstonepurgeinterval");
                          },
                          inputName: "input",
                          inputAriaLabel: "number input",
                          minusBtnAriaLabel: "minus",
                          plusBtnAriaLabel: "plus",
                          widthChars: 8
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
                  Grid,
                  {
                    title: _61("A time limit (in seconds) that tells a replication session to yield if other replicas are trying to acquire this one (nsds5replicareleasetimeout)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { className: "ds-label", span: 3, children: _61("Replica Release Timeout") }),
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
                        NumberInput,
                        {
                          value: this.state.nsds5replicareleasetimeout,
                          min: 0,
                          max: this.maxValue,
                          onMinus: () => {
                            this.onMinusConfig("nsds5replicareleasetimeout");
                          },
                          onChange: (e) => {
                            this.onConfigChange(e, "nsds5replicareleasetimeout", 0);
                          },
                          onPlus: () => {
                            this.onPlusConfig("nsds5replicareleasetimeout");
                          },
                          inputName: "input",
                          inputAriaLabel: "number input",
                          minusBtnAriaLabel: "minus",
                          plusBtnAriaLabel: "plus",
                          widthChars: 8
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
                  Grid,
                  {
                    title: _61("A timeout on how long to wait before stopping a replication session when the server is being stopped, replication is being disabled, or when removing a replication agreement. (nsds5replicaprotocoltimeout)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { className: "ds-label", span: 3, children: _61("Replication Timeout") }),
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
                        NumberInput,
                        {
                          value: this.state.nsds5replicaprotocoltimeout,
                          min: 1,
                          max: this.maxValue,
                          onMinus: () => {
                            this.onMinusConfig("nsds5replicaprotocoltimeout");
                          },
                          onChange: (e) => {
                            this.onConfigChange(e, "nsds5replicaprotocoltimeout", 1);
                          },
                          onPlus: () => {
                            this.onPlusConfig("nsds5replicaprotocoltimeout");
                          },
                          inputName: "input",
                          inputAriaLabel: "number input",
                          minusBtnAriaLabel: "minus",
                          plusBtnAriaLabel: "plus",
                          widthChars: 8
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
                  Grid,
                  {
                    title: _61("This is the minimum amount of time in seconds that a replication session will go into a backoff state  (nsds5replicabackoffmin)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { className: "ds-label", span: 3, children: _61("Back Off Minimum") }),
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
                        NumberInput,
                        {
                          value: this.state.nsds5replicabackoffmin,
                          min: 1,
                          max: this.maxValue,
                          onMinus: () => {
                            this.onMinusConfig("nsds5replicabackoffmin");
                          },
                          onChange: (e) => {
                            this.onConfigChange(e, "nsds5replicabackoffmin", 1);
                          },
                          onPlus: () => {
                            this.onPlusConfig("nsds5replicabackoffmin");
                          },
                          inputName: "input",
                          inputAriaLabel: "number input",
                          minusBtnAriaLabel: "minus",
                          plusBtnAriaLabel: "plus",
                          widthChars: 8
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
                  Grid,
                  {
                    title: _61("This is the maximum amount of time in seconds that a replication session will go into a backoff state  (nsds5replicabackoffmax)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { className: "ds-label", span: 3, children: _61("Back Off Maximum") }),
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
                        NumberInput,
                        {
                          value: this.state.nsds5replicabackoffmax,
                          min: 1,
                          max: this.maxValue,
                          onMinus: () => {
                            this.onMinusConfig("nsds5replicabackoffmax");
                          },
                          onChange: (e) => {
                            this.onConfigChange(e, "nsds5replicabackoffmax", 1);
                          },
                          onPlus: () => {
                            this.onPlusConfig("nsds5replicabackoffmax");
                          },
                          inputName: "input",
                          inputAriaLabel: "number input",
                          minusBtnAriaLabel: "minus",
                          plusBtnAriaLabel: "plus",
                          widthChars: 8
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
                  Grid,
                  {
                    title: _61("The interval in seconds that the server will apply an internal update to get the RUV from getting stale. (nsds5replicakeepaliveupdateinterval)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { className: "ds-label", span: 3, children: _61("Refresh RUV Interval") }),
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
                        NumberInput,
                        {
                          value: this.state.nsds5replicakeepaliveupdateinterval,
                          min: 60,
                          max: this.maxValue,
                          onMinus: () => {
                            this.onMinusConfig("nsds5replicakeepaliveupdateinterval");
                          },
                          onChange: (e) => {
                            this.onConfigChange(e, "nsds5replicakeepaliveupdateinterval", 60);
                          },
                          onPlus: () => {
                            this.onPlusConfig("nsds5replicakeepaliveupdateinterval");
                          },
                          inputName: "input",
                          inputAriaLabel: "number input",
                          minusBtnAriaLabel: "minus",
                          plusBtnAriaLabel: "plus",
                          widthChars: 8
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
                  Grid,
                  {
                    title: _61("Enables faster tombstone purging (nsds5replicaprecisetombstonepurging)."),
                    className: "ds-margin-top",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { className: "ds-label", span: 3, children: _61("Fast Tombstone Purging") }),
                      /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
                        Checkbox,
                        {
                          id: "nsds5replicaprecisetombstonepurging",
                          isChecked: this.state.nsds5replicaprecisetombstonepurging,
                          onChange: (e, str) => {
                            this.handleChange(e);
                          }
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Grid, { className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
                  Button,
                  {
                    variant: "primary",
                    onClick: this.handleSaveConfig,
                    isDisabled: this.state.saveBtnDisabled,
                    isLoading: this.state.saving,
                    spinnerAriaValueText: this.state.saving ? _61("Saving") : void 0,
                    ...extraPrimaryProps,
                    children: saveBtnName
                  }
                ) }) })
              ] })
            }
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmManagerDelete,
            closeHandler: this.closeConfirmManagerDelete,
            handleChange: this.onModalChange,
            actionHandler: this.deleteManager,
            spinning: this.state.modalSpinning,
            item: this.state.manager,
            checked: this.state.modalChecked,
            mTitle: _61("Remove Replication Manager"),
            mMsg: _61("Are you sure you want to remove this Replication Manager?"),
            mSpinningMsg: _61("Removing Manager ..."),
            mBtnName: _61("Remove Manager")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
          AddEditManagerModal,
          {
            showModal: this.state.showAddEditManagerModal,
            closeHandler: this.closeAddEditManagerModal,
            handleChange: this.onManagerChange,
            saveHandler: this.addManager,
            spinning: this.state.addEditManagerSpinning,
            manager: this.state.manager,
            manager_passwd: this.state.manager_passwd,
            manager_passwd_confirm: this.state.manager_passwd_confirm,
            error: this.state.errObj,
            edit: this.state.editManager
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
          ChangeReplRoleModal,
          {
            showModal: this.state.showPromoteDemoteModal,
            closeHandler: this.closePromoteDemoteModal,
            handleChange: this.onModalChange,
            saveHandler: this.doRoleChange,
            spinning: this.state.roleChangeSpinning,
            role: this.props.role,
            newRole: this.state.newRole,
            checked: this.state.modalChecked,
            newRID: this.state.newRID,
            onMinus: this.handleMinusChange,
            onNumberChange: this.handleNumberChange,
            onPlus: this.handlePlusChange
          }
        )
      ] }) });
    }
  };
  ReplConfig.propTypes = {
    role: import_prop_types60.default.string,
    suffix: import_prop_types60.default.string,
    data: import_prop_types60.default.object,
    serverId: import_prop_types60.default.string
  };
  ReplConfig.defaultProps = {
    role: "",
    suffix: "",
    data: {},
    serverId: ""
  };

  // src/lib/replication/winsyncAgmts.jsx
  var import_react132 = __toESM(require_react(), 1);
  var import_prop_types61 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1);
  var _62 = cockpit_default.gettext;
  var WinsyncAgmts = class extends import_react132.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "_mounted", false);
      this.state = {
        showCreateAgmtModal: false,
        showEditAgmtModal: false,
        showConfirmDeleteAgmt: false,
        showConfirmInitAgmt: false,
        showConfirmEnableAgmt: false,
        showConfirmDisableAgmt: false,
        errObj: {},
        savingAgmt: false,
        mounted: false,
        rows: [],
        page: 1,
        value: "",
        sortBy: {},
        // Create agreement
        agmtName: "",
        agmtHost: "",
        agmtPort: "",
        agmtProtocol: "LDAPS",
        agmtBindDN: "",
        agmtBindPW: "",
        agmtBindPWConfirm: "",
        agmtFracAttrs: [],
        agmtSync: true,
        agmtSyncMon: true,
        agmtSyncTue: true,
        agmtSyncWed: true,
        agmtSyncThu: true,
        agmtSyncFri: true,
        agmtSyncSat: true,
        agmtSyncSun: true,
        agmtStartTime: "0000",
        agmtEndTime: "2359",
        agmtInit: "noinit",
        agmtSaveOK: false,
        modalChecked: false,
        modalSpinning: false,
        // Winsync specific settings
        agmtSyncGroups: false,
        agmtSyncUsers: true,
        agmtWinDomain: "",
        agmtWinSubtree: "",
        agmtDSSubtree: "",
        agmtOneWaySync: "both",
        // "both", "toWindows", "fromWindows"
        agmtSyncInterval: "",
        // Init agmt
        agmtInitCounter: 0,
        agmtInitIntervals: [],
        isExcludeAttrCreateOpen: false,
        isExcludeAttrEditOpen: false
      };
      this.handleExcludeAttrCreateToggle = (_event, isExcludeAttrCreateOpen) => {
        this.setState({
          isExcludeAttrCreateOpen
        });
      };
      this.handleExcludeAttrCreateClear = () => {
        this.setState({
          agmtFracAttrs: [],
          isExcludeAttrCreateOpen: false
        });
      };
      this.handleExcludeAttrEditToggle = (_event, isExcludeAttrEditOpen) => {
        this.setState({
          isExcludeAttrEditOpen
        });
      };
      this.handleExcludeAttrEditClear = () => {
        this.setState({
          agmtFracAttrs: [],
          isExcludeAttrEditOpen: false
        });
      };
      this.handleShowCreateAgmtModal = this.handleShowCreateAgmtModal.bind(this);
      this.closeCreateAgmtModal = this.closeCreateAgmtModal.bind(this);
      this.closeEditAgmtModal = this.closeEditAgmtModal.bind(this);
      this.handleTASelectChange = this.handleTASelectChange.bind(this);
      this.onTimeChange = this.onTimeChange.bind(this);
      this.onCreateChange = this.onCreateChange.bind(this);
      this.onEditChange = this.onEditChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.onTAFracAttrChange = this.onTAFracAttrChange.bind(this);
      this.onTAFracAttrChangeEdit = this.onTAFracAttrChangeEdit.bind(this);
      this.createAgmt = this.createAgmt.bind(this);
      this.showEditAgmt = this.showEditAgmt.bind(this);
      this.saveAgmt = this.saveAgmt.bind(this);
      this.pokeAgmt = this.pokeAgmt.bind(this);
      this.initAgmt = this.initAgmt.bind(this);
      this.enableAgmt = this.enableAgmt.bind(this);
      this.disableAgmt = this.disableAgmt.bind(this);
      this.deleteAgmt = this.deleteAgmt.bind(this);
      this.showConfirmDeleteAgmt = this.showConfirmDeleteAgmt.bind(this);
      this.closeConfirmDeleteAgmt = this.closeConfirmDeleteAgmt.bind(this);
      this.showConfirmInitAgmt = this.showConfirmInitAgmt.bind(this);
      this.closeConfirmInitAgmt = this.closeConfirmInitAgmt.bind(this);
      this.confirmToggle = this.confirmToggle.bind(this);
      this.closeConfirmEnableAgmt = this.closeConfirmEnableAgmt.bind(this);
      this.closeConfirmDisableAgmt = this.closeConfirmDisableAgmt.bind(this);
      this.watchAgmtInit = this.watchAgmtInit.bind(this);
      this.onSort = this.onSort.bind(this);
      this.onSearchChange = this.onSearchChange.bind(this);
    }
    componentDidMount() {
      this._mounted = true;
      const rows = JSON.parse(JSON.stringify(this.props.rows));
      this.setState({ rows });
    }
    componentWillUnmount() {
      this._mounted = false;
    }
    onModalChange(e) {
      this.setState({
        [e.target.id]: e.target.checked
      });
    }
    validateConfig(attr, value, errObj) {
      let all_good = true;
      const configAttrs2 = [
        "agmtName",
        "agmtHost",
        "agmtWinDomain"
      ];
      const dnAttrs = [
        "agmtBindDN",
        "agmtWinSubtree",
        "agmtWinSubtree",
        "agmtDSSubtree"
      ];
      if (attr === "agmtSync" && value === true) {
        errObj.agmtSyncMon = false;
        errObj.agmtSyncTue = false;
        errObj.agmtSyncWed = false;
        errObj.agmtSyncThu = false;
        errObj.agmtSyncFri = false;
        errObj.agmtSyncSat = false;
        errObj.agmtSyncSun = false;
        errObj.agmtStartTime = false;
        errObj.agmtEndTime = false;
      }
      for (const configAttr of configAttrs2) {
        if (attr === configAttr) {
          if (value === "") {
            errObj[attr] = true;
            all_good = false;
          } else {
            errObj[attr] = false;
          }
        } else if (this.state[configAttr] === "") {
          errObj[configAttr] = true;
          all_good = false;
        }
      }
      for (const dnAttr of dnAttrs) {
        if (attr === dnAttr) {
          if (!valid_dn(value)) {
            errObj[dnAttr] = true;
            all_good = false;
          } else {
            errObj[attr] = false;
          }
        } else if (!valid_dn(this.state[dnAttr])) {
          errObj[dnAttr] = true;
          all_good = false;
        }
      }
      if (attr === "agmtPort") {
        if (!valid_port(value)) {
          errObj.agmtPort = true;
          all_good = false;
        } else {
          errObj.agmtPort = false;
        }
      }
      if (attr === "agmtBindPW") {
        if (value !== this.state.agmtBindPWConfirm || value === "") {
          errObj.agmtBindPW = true;
          errObj.agmtBindPWConfirm = true;
          all_good = false;
        } else {
          errObj.agmtBindPW = false;
          errObj.agmtBindPWConfirm = false;
        }
      } else if (attr === "agmtBindPWConfirm") {
        if (value !== this.state.agmtBindPW || value === "") {
          errObj.agmtBindPW = true;
          errObj.agmtBindPWConfirm = true;
          all_good = false;
        } else {
          errObj.agmtBindPW = false;
          errObj.agmtBindPWConfirm = false;
        }
      } else if (this.state.agmtBindPW !== this.state.agmtBindPWConfirm || this.state.agmtBindPW === "" || this.state.agmtBindPWConfirm === "") {
        errObj.agmtBindPW = true;
        errObj.agmtBindPWConfirm = true;
        all_good = false;
      }
      if (attr === "agmtSync") {
        if (value) {
          errObj.agmtStartTime = false;
          errObj.agmtEndTime = false;
          this.setState({
            agmtSyncMon: true,
            agmtSyncTue: true,
            agmtSyncWed: true,
            agmtSyncThu: true,
            agmtSyncFri: true,
            agmtSyncSat: true,
            agmtSyncSun: true,
            agmtStartTime: "0000",
            agmtEndTime: "2359"
          });
        }
      } else if (this.state.agmtSync) {
        let have_days = false;
        const days = [
          "agmtSyncSun",
          "agmtSyncMon",
          "agmtSyncTue",
          "agmtSyncWed",
          "agmtSyncThu",
          "agmtSyncFri",
          "agmtSyncSat"
        ];
        for (const day of days) {
          if (attr !== day && this.state[day] || attr === day && value) {
            have_days = true;
            break;
          }
        }
        errObj.agmtSyncSun = false;
        errObj.agmtSyncMon = false;
        errObj.agmtSyncTue = false;
        errObj.agmtSyncWed = false;
        errObj.agmtSyncThu = false;
        errObj.agmtSyncFri = false;
        errObj.agmtSyncSat = false;
        if (!have_days) {
          errObj.agmtSyncSun = true;
          errObj.agmtSyncMon = true;
          errObj.agmtSyncTue = true;
          errObj.agmtSyncWed = true;
          errObj.agmtSyncThu = true;
          errObj.agmtSyncFri = true;
          errObj.agmtSyncSat = true;
          all_good = false;
        } else if (attr === "agmtStartTime") {
          if (value === "") {
            all_good = false;
            errObj.agmtStartTime = true;
          } else if (value >= this.state.agmtEndTime) {
            errObj.agmtStartTime = true;
            all_good = false;
          } else {
            errObj.agmtStartTime = false;
            errObj.agmtEndTime = false;
          }
        } else if (attr === "agmtEndTime") {
          if (value === "") {
            errObj.agmtEndTime = true;
            all_good = false;
          } else if (this.state.agmtStartTime >= value) {
            errObj.agmtStartTime = true;
            all_good = false;
          } else {
            errObj.agmtStartTime = false;
            errObj.agmtEndTime = false;
          }
        } else if (this.state.agmtStartTime >= this.state.agmtEndTime) {
          errObj.agmtStartTime = true;
          all_good = false;
        }
      }
      return all_good;
    }
    onTimeChange(action, attr, val) {
      let value = val.replace(":", "");
      const errObj = this.state.errObj;
      const e = { target: { id: "dummy", value: "", type: "input" } };
      if (value === "") {
        value = "0000";
      }
      if (attr === "agmtStartTime") {
        if (value > this.state.agmtEndTime) {
          errObj.agmtStartTime = true;
        } else {
          errObj.agmtStartTime = false;
          errObj.agmtEndTime = false;
        }
      } else if (attr === "agmtEndTime") {
        if (this.state.agmtStartTime > value) {
          errObj.agmtEndTime = true;
        } else {
          errObj.agmtEndTime = false;
          errObj.agmtStartTime = false;
        }
      }
      this.setState({
        [attr]: value,
        errObj
      }, () => {
        action === "edit" ? this.onEditChange(e) : this.onCreateChange(e);
      });
    }
    onCreateChange(e) {
      let value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      const errObj = this.state.errObj;
      let all_good = true;
      if (e.target.type === "time") {
        value = value.replace(":", "");
      }
      all_good = this.validateConfig(attr, value, errObj);
      this.setState({
        [attr]: value,
        errObj,
        agmtSaveOK: all_good,
        [e.target.toggle]: false
      });
    }
    onEditChange(e) {
      let value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      const errObj = this.state.errObj;
      let all_good = true;
      errObj[attr] = false;
      if (e.target.type === "time") {
        value = value.replace(":", "");
      }
      all_good = this.validateConfig(attr, value, errObj);
      if (all_good) {
        all_good = false;
        if (attr !== "agmtHost" && this.state.agmtHost !== this.state._agmtHost || attr !== "agmtPort" && this.state.agmtPort !== this.state._agmtPort || attr !== "agmtBindDN" && this.state.agmtBindDN !== this.state._agmtBindDN || attr !== "agmtBindMethod" && this.state.agmtBindMethod !== this.state._agmtBindMethod || attr !== "agmtProtocol" && this.state.agmtProtocol !== this.state._agmtProtocol || attr !== "agmtSync" && this.state.agmtSync !== this.state._agmtSync || attr !== "agmtFracAttrs" && !listsEqual(this.state.agmtFracAttrs, this.state._agmtFracAttrs) || attr !== "agmtSyncGroups" && this.state.agmtSyncGroups !== this.state._agmtSyncGroups || attr !== "agmtSyncUsers" && this.state.agmtSyncUsers !== this.state._agmtSyncUsers || attr !== "agmtWinDomain" && this.state.agmtWinDomain !== this.state._agmtWinDomain || attr !== "agmtWinSubtree" && this.state.agmtWinSubtree !== this.state._agmtWinSubtree || attr !== "agmtDSSubtree" && this.state.agmtDSSubtree !== this.state._agmtDSSubtree || attr !== "agmtOneWaySync" && this.state.agmtOneWaySync !== this.state._agmtOneWaySync || attr !== "agmtSyncInterval" && this.state.agmtSyncInterval !== this.state._agmtSyncInterval) {
          all_good = true;
        }
        if (attr !== "agmtSync" && this.state.agmtSync || attr === "agmtSync" && value) {
          if (attr !== "agmtSyncMon" && this.state.agmtSyncMon !== this.state._agmtSyncMon || attr !== "agmtSyncTue" && this.state.agmtSyncTue !== this.state._agmtSyncTue || attr !== "agmtSyncWed" && this.state.agmtSyncWed !== this.state._agmtSyncWed || attr !== "agmtSyncThu" && this.state.agmtSyncThu !== this.state._agmtSyncThu || attr !== "agmtSyncFri" && this.state.agmtSyncFri !== this.state._agmtSyncFri || attr !== "agmtSyncSat" && this.state.agmtSyncSat !== this.state._agmtSyncSat || attr !== "agmtSyncSun" && this.state.agmtSyncSun !== this.state._agmtSyncSun || attr !== "agmtStartTime" && this.state.agmtStartTime !== this.state._agmtStartTime || attr !== "agmtEndTime" && this.state.agmtEndTime !== this.state._agmtEndTime) {
            all_good = true;
          }
        }
        if (attr === "agmtFracAttrs" && !this.listEqual(value, this.state._agmtFracAttrs)) {
          all_good = true;
        } else if (attr !== "dummy" && value !== this.state["_" + attr]) {
          all_good = true;
        }
      }
      this.setState({
        [attr]: value,
        errObj,
        agmtSaveOK: all_good,
        [e.target.toggle]: false
      });
    }
    handleTASelectChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      errObj[attr] = valueErr;
      if (attr.endsWith("Attrs")) {
        this.setState({
          [attr]: Array.isArray(value) ? value : [],
          errObj,
          [e.target.toggle]: false
        });
      } else {
        this.setState({
          [attr]: value,
          errObj,
          [e.target.toggle]: false
        });
      }
    }
    onTAFracAttrChangeEdit(selection) {
      const e = { target: { id: "dummy", value: "", type: "input" } };
      const newFracAttrs = Array.isArray(selection) ? selection : [];
      this.setState({
        agmtFracAttrs: newFracAttrs,
        isExcludeAttrsEditOpen: false
      }, () => {
        this.onEditChange(e);
      });
    }
    onTAFracAttrChange(values) {
      const e = {
        target: {
          name: "agmt-modal",
          id: "agmtFracAttrs",
          value: values,
          type: "input",
          toggle: "isExcludeAttrCreateOpen"
        }
      };
      this.handleChange(e);
    }
    showConfirmDeleteAgmt(agmtName) {
      this.setState({
        agmtName,
        showConfirmDeleteAgmt: true,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeConfirmDeleteAgmt() {
      this.setState({
        showConfirmDeleteAgmt: false,
        modalChecked: false
      });
    }
    showConfirmInitAgmt(agmtName) {
      this.setState({
        agmtName,
        showConfirmInitAgmt: true,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeConfirmInitAgmt() {
      this.setState({
        showConfirmInitAgmt: false,
        modalChecked: false
      });
    }
    handleShowCreateAgmtModal() {
      this.setState({
        showCreateAgmtModal: true,
        agmtName: "",
        agmtHost: "",
        agmtPort: "636",
        agmtProtocol: "LDAP",
        agmtBindDN: "",
        agmtBindPW: "",
        agmtBindPWConfirm: "",
        agmtFracAttrs: [],
        agmtSync: false,
        agmtSyncMon: true,
        agmtSyncTue: true,
        agmtSyncWed: true,
        agmtSyncThu: true,
        agmtSyncFri: true,
        agmtSyncSat: true,
        agmtSyncSun: true,
        agmtStartTime: "0000",
        agmtEndTime: "2359",
        agmtInit: "noinit",
        agmtSaveOK: false,
        agmtSyncGroups: false,
        agmtSyncUsers: true,
        agmtWinDomain: "",
        agmtWinSubtree: "",
        agmtDSSubtree: "",
        agmtOneWaySync: "both",
        // "both", "toWindows", "fromWindows"
        agmtSyncInterval: "",
        errObj: {
          // Marks all these fields as required
          agmtName: true,
          agmtHost: true,
          agmtBindDN: true,
          agmtBindPW: true,
          agmtBindPWConfirm: true,
          agmtWinDomain: true,
          agmtWinSubtree: true,
          agmtDSSubtree: true
        }
      });
    }
    closeCreateAgmtModal() {
      this.setState({
        showCreateAgmtModal: false
      });
    }
    closeEditAgmtModal() {
      this.setState({
        showEditAgmtModal: false
      });
    }
    showEditAgmt(agmtName) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "get",
        agmtName,
        "--suffix=" + this.props.suffix
      ];
      log_cmd("showEditAgmt", "Edit winsync agreement", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        let agmtName2 = "";
        let agmtHost = "";
        let agmtPort = "";
        let agmtProtocol = "";
        let agmtBindDN = "";
        let agmtBindPW = "";
        let agmtBindPWConfirm = "";
        let agmtFracAttrs = [];
        let agmtSync = false;
        let agmtSyncMon = false;
        let agmtSyncTue = false;
        let agmtSyncWed = false;
        let agmtSyncThu = false;
        let agmtSyncFri = false;
        let agmtSyncSat = false;
        let agmtSyncSun = false;
        let agmtStartTime = "0000";
        let agmtEndTime = "2359";
        let agmtSyncGroups = false;
        let agmtSyncUsers = false;
        let agmtWinDomain = "";
        let agmtWinSubtree = "";
        let agmtDSSubtree = "";
        let agmtOneWaySync = "both";
        let agmtSyncInterval = "";
        for (const attr in config.attrs) {
          const val = config.attrs[attr][0];
          if (attr === "winsyncinterval") {
            agmtSyncInterval = val;
          }
          if (attr === "onewaysync") {
            agmtOneWaySync = val;
          }
          if (attr === "nsds7directoryreplicasubtree") {
            agmtDSSubtree = val;
          }
          if (attr === "nsds7windowsreplicasubtree") {
            agmtWinSubtree = val;
          }
          if (attr === "nsds7windowsdomain") {
            agmtWinDomain = val;
          }
          if (attr === "nsds7newwinusersyncenabled") {
            if (val.toLowerCase() === "on") {
              agmtSyncUsers = true;
            }
          }
          if (attr === "nsds7newwingroupsyncenabled") {
            if (val.toLowerCase() === "on") {
              agmtSyncGroups = true;
            }
          }
          if (attr === "cn") {
            agmtName2 = val;
          }
          if (attr === "nsds5replicahost") {
            agmtHost = val;
          }
          if (attr === "nsds5replicaport") {
            agmtPort = val;
          }
          if (attr === "nsds5replicatransportinfo") {
            agmtProtocol = val;
          }
          if (attr === "nsds5replicabinddn") {
            agmtBindDN = val;
          }
          if (attr === "nsds5replicacredentials") {
            agmtBindPW = val;
            agmtBindPWConfirm = val;
          }
          if (attr === "nsds5replicatedattributelist") {
            const attrs = val.replace("(objectclass=*) $ EXCLUDE", "").trim();
            agmtFracAttrs = attrs.split(" ");
          }
          if (attr === "nsds5replicaupdateschedule") {
            agmtSync = true;
            const parts = val.split(" ");
            const times = parts[0].split("-");
            const days = parts[1];
            agmtStartTime = times[0];
            agmtEndTime = times[1];
            if (days.includes("0")) {
              agmtSyncSun = true;
            }
            if (days.includes("1")) {
              agmtSyncMon = true;
            }
            if (days.includes("2")) {
              agmtSyncTue = true;
            }
            if (days.includes("3")) {
              agmtSyncWed = true;
            }
            if (days.includes("4")) {
              agmtSyncThu = true;
            }
            if (days.includes("5")) {
              agmtSyncFri = true;
            }
            if (days.includes("6")) {
              agmtSyncSat = true;
            }
          }
        }
        if (this._mounted) {
          this.setState({
            showEditAgmtModal: true,
            errObj: {},
            agmtName: agmtName2,
            agmtHost,
            agmtPort,
            agmtProtocol,
            agmtBindDN,
            agmtBindPW,
            agmtBindPWConfirm,
            agmtFracAttrs,
            agmtSync,
            agmtSyncMon,
            agmtSyncTue,
            agmtSyncWed,
            agmtSyncThu,
            agmtSyncFri,
            agmtSyncSat,
            agmtSyncSun,
            agmtStartTime,
            agmtEndTime,
            agmtSyncGroups,
            agmtSyncUsers,
            agmtWinDomain,
            agmtWinSubtree,
            agmtDSSubtree,
            agmtOneWaySync,
            agmtSyncInterval,
            agmtSaveOK: false,
            // Record original values before editing
            _agmtName: agmtName2,
            _agmtHost: agmtHost,
            _agmtPort: agmtPort,
            _agmtProtocol: agmtProtocol,
            _agmtBindDN: agmtBindDN,
            _agmtBindPW: agmtBindPW,
            _agmtBindPWConfirm: agmtBindPWConfirm,
            _agmtFracAttrs: agmtFracAttrs,
            _agmtSync: agmtSync,
            _agmtSyncMon: agmtSyncMon,
            _agmtSyncTue: agmtSyncTue,
            _agmtSyncWed: agmtSyncWed,
            _agmtSyncThu: agmtSyncThu,
            _agmtSyncFri: agmtSyncFri,
            _agmtSyncSat: agmtSyncSat,
            _agmtSyncSun: agmtSyncSun,
            _agmtStartTime: agmtStartTime,
            _agmtEndTime: agmtEndTime,
            _agmtSyncGroups: agmtSyncGroups,
            _agmtSyncUsers: agmtSyncUsers,
            _agmtWinDomain: agmtWinDomain,
            _agmtWinSubtree: agmtWinSubtree,
            _agmtDSSubtree: agmtDSSubtree,
            _agmtOneWaySync: agmtOneWaySync,
            _agmtSyncInterval: agmtSyncInterval
          });
        }
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_62('Failed to get agreement information for: "$0" - $1'), agmtName, errMsg)
        );
      });
    }
    saveAgmt() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "set",
        this.state.agmtName,
        "--suffix=" + this.props.suffix
      ];
      const passwd = "";
      if (this.state.agmtSync) {
        let agmt_days = "";
        if (this.state.agmtSyncSun) {
          agmt_days += "0";
        }
        if (this.state.agmtSyncMon) {
          agmt_days += "1";
        }
        if (this.state.agmtSyncTue) {
          agmt_days += "2";
        }
        if (this.state.agmtSyncWed) {
          agmt_days += "3";
        }
        if (this.state.agmtSyncThu) {
          agmt_days += "4";
        }
        if (this.state.agmtSyncFri) {
          agmt_days += "5";
        }
        if (this.state.agmtSyncSat) {
          agmt_days += "6";
        }
        cmd.push("--schedule=" + this.state.agmtStartTime.replace(":", "") + "-" + this.state.agmtEndTime.replace(":", "") + " " + agmt_days);
      } else if (this.state.agmtSync !== this.state._agmtSync && !this.state.agmtSync) {
        cmd.push("--schedule=");
      }
      if (this.state.agmtSyncGroups !== this.state._agmtSyncGroups) {
        let val = "off";
        if (this.state.agmtSyncGroups) {
          val = "on";
        }
        cmd.push("--sync-groups=" + val);
      }
      if (this.state.agmtSyncUsers !== this.state._agmtSyncUsers) {
        let val = "off";
        if (this.state.agmtSyncUsers) {
          val = "on";
        }
        cmd.push("--sync-users=" + val);
      }
      if (this.state.agmtWinDomain !== this.state._agmtWinDomain) {
        cmd.push("--win-domain=" + this.state.agmtWinDomain);
      }
      if (this.state.agmtWinSubtree !== this.state._agmtWinSubtree) {
        cmd.push("--win-subtree=" + this.state.agmtWinSubtree);
      }
      if (this.state.agmtDSSubtree !== this.state._agmtDSSubtree) {
        cmd.push("--ds-subtree=" + this.state.agmtDSSubtree);
      }
      if (this.state.agmtOneWaySync !== this.state._agmtOneWaySync) {
        let value = this.state.agmtOneWaySync;
        if (value === "both") {
          value = "";
        }
        cmd.push("--one-way-sync=" + value);
      }
      if (this.state.agmtSyncInterval !== this.state._agmtSyncInterval) {
        cmd.push("--sync-interval=" + this.state.agmtSyncInterval);
      }
      if (this.state.agmtProtocol !== this.state._agmtProtocol) {
        cmd.push("--conn-protocol=" + this.state.agmtProtocol);
      }
      if (this.state.agmtBindPW !== this.state._agmtBindPW) {
        cmd.push("--bind-passwd=" + this.state.agmtBindPW);
      }
      if (this.state.agmtBindDN !== this.state._agmtBindDN) {
        cmd.push("--bind-passwd=" + this.state.agmtBindDN);
      }
      if (this.state.agmtFracAttrs !== this.state._agmtFracAttrs) {
        cmd.push("--frac-list=" + this.state.agmtFracAttrs.join(" "));
      }
      if (this.state.agmtHost !== this.state._agmtHost) {
        cmd.push("--host=" + this.state.agmtHost);
      }
      if (this.state.agmtPort !== this.state._agmtPort) {
        cmd.push("--port=" + this.state.agmtPort);
      }
      this.setState({
        savingAgmt: true
      });
      const config = {
        cmd,
        promptArg: "--bind-passwd-prompt",
        passwd,
        addNotification: this.props.addNotification,
        success_msg: _62("Successfully updated winsync agreement"),
        error_msg: _62("Failed to update winsync agreement"),
        state_callback: () => {
          this.setState({
            savingAgmt: false,
            showEditAgmtModal: false
          });
        },
        reload_func: this.props.reload,
        reload_arg: this.props.suffix,
        funcName: "saveAgmt",
        funcDesc: "update winsync agreement"
      };
      callCmdStreamPassword(config);
    }
    pokeAgmt(agmtName) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "poke",
        agmtName,
        "--suffix=" + this.props.suffix
      ];
      log_cmd("pokeAgmt", "send updates now", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          _62("Successfully poked winsync agreement")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_62("Failed to poke winsync agreement - $0"), errMsg)
        );
      });
    }
    initAgmt() {
      this.setState({
        modalSpinning: true
      });
      const init_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "init",
        "--suffix=" + this.props.suffix,
        this.state.agmtName
      ];
      log_cmd("initAgmt", "Initialize winsync agreement", init_cmd);
      cockpit_default.spawn(init_cmd, { superuser: true, err: "message" }).done((content) => {
        const agmtIntervalCount = this.state.agmtInitCounter + 1;
        const intervals = this.state.agmtInitIntervals;
        this.props.reload(this.props.suffix);
        intervals[agmtIntervalCount] = setInterval(this.watchAgmtInit, 2e3, this.state.agmtName, agmtIntervalCount);
        if (this._mounted) {
          this.setState({
            agmtInitCounter: agmtIntervalCount,
            agmtInitIntervals: intervals,
            showConfirmInitAgmt: false
          });
        }
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_62("Failed to initialize winsync agreement - $0"), errMsg)
        );
        this.setState({
          showConfirmInitAgmt: false
        });
      });
    }
    confirmToggle(agmtName, state) {
      if (state === "Enabled") {
        this.setState({
          agmtName,
          showConfirmDisableAgmt: true,
          modalSpinning: false,
          modalChecked: false
        });
      } else {
        this.setState({
          agmtName,
          showConfirmEnableAgmt: true,
          modalSpinning: false,
          modalChecked: false
        });
      }
    }
    closeConfirmEnableAgmt() {
      this.setState({
        showConfirmEnableAgmt: false
      });
    }
    closeConfirmDisableAgmt() {
      this.setState({
        showConfirmDisableAgmt: false
      });
    }
    enableAgmt(agmtName) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "enable",
        agmtName,
        "--suffix=" + this.props.suffix
      ];
      log_cmd("enableAgmt", "enable agmt", cmd);
      this.setState({
        modalSpinning: true
      });
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          _62("Successfully enabled winsync agreement")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_62("Failed to enabled winsync agreement - $0"), errMsg)
        );
      });
    }
    disableAgmt(agmtName) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "disable",
        agmtName,
        "--suffix=" + this.props.suffix
      ];
      log_cmd("disableAgmt", "Disable agmt", cmd);
      this.setState({
        modalSpinning: true
      });
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          _62("Successfully disabled winsync agreement")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_62("Failed to disable winsync agreement - $0"), errMsg)
        );
      });
    }
    deleteAgmt() {
      this.setState({
        deleteSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "delete",
        "--suffix=" + this.props.suffix,
        this.state.agmtName
      ];
      log_cmd("deleteAgmt", "Delete agmt", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          _62("Successfully deleted winsync agreement")
        );
        this.setState({
          showConfirmDeleteAgmt: false,
          deleteSpinning: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_62("Failed to delete winsync agreement - $0"), errMsg)
        );
        this.setState({
          showConfirmDeleteAgmt: false,
          deleteSpinning: false
        });
      });
    }
    createAgmt() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "create",
        this.state.agmtName,
        "--suffix=" + this.props.suffix,
        "--host=" + this.state.agmtHost,
        "--port=" + this.state.agmtPort,
        "--conn-protocol=" + this.state.agmtProtocol,
        "--bind-dn=" + this.state.agmtBindDN,
        "--ds-subtree=" + this.state.agmtDSSubtree,
        "--win-subtree=" + this.state.agmtWinSubtree,
        "--win-domain=" + this.state.agmtWinDomain,
        "--one-way-sync=" + this.state.agmtOneWaySync
      ];
      const passwd = this.state.agmtBindPW;
      if (this.state.agmtSync) {
        let agmt_days = "";
        if (this.state.agmtSyncSun) {
          agmt_days += "0";
        }
        if (this.state.agmtSyncMon) {
          agmt_days += "1";
        }
        if (this.state.agmtSyncTue) {
          agmt_days += "2";
        }
        if (this.state.agmtSyncWed) {
          agmt_days += "3";
        }
        if (this.state.agmtSyncThu) {
          agmt_days += "4";
        }
        if (this.state.agmtSyncFri) {
          agmt_days += "5";
        }
        if (this.state.agmtSyncSat) {
          agmt_days += "6";
        }
        cmd.push("--schedule=" + this.state.agmtStartTime.replace(":", "") + "-" + this.state.agmtEndTime.replace(":", "") + " " + agmt_days);
      }
      if (this.state.agmtFracAttrs.length > 0) {
        cmd.push("--frac-list=" + this.state.agmtFracAttrs.join(" "));
      }
      if (this.state.agmtSyncGroups) {
        cmd.push("--sync-groups=on");
      }
      if (this.state.agmtSyncUsers) {
        cmd.push("--sync-users=on");
      }
      if (this.state.agmtSyncInterval !== "") {
        cmd.push("--sync-interval=" + this.state.agmtSyncInterval);
      }
      this.setState({
        savingAgmt: true
      });
      let ext_func = "";
      if (this.state.agmtInit === "online-init") {
        ext_func = this.initAgmt;
      }
      log_cmd("createAgmt", "Create winsync agmt", cmd);
      const config = {
        cmd,
        promptArg: "--bind-passwd-prompt",
        passwd,
        addNotification: this.props.addNotification,
        success_msg: _62("Successfully created winsync agreement"),
        error_msg: _62("Failed to create winsync agreement"),
        state_callback: () => {
          this.setState({
            savingAgmt: false,
            showCreateAgmtModal: false
          });
        },
        reload_func: this.props.reload,
        reload_arg: this.props.suffix,
        ext_func,
        ext_arg: this.state.agmtName,
        funcName: "createAgmt",
        funcDesc: _62("Create winsync agreement")
      };
      callCmdStreamPassword(config);
    }
    watchAgmtInit(agmtName, idx) {
      const status_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "init-status",
        "--suffix=" + this.props.suffix,
        agmtName
      ];
      log_cmd("watchAgmtInit", "Get initialization status for agmt", status_cmd);
      cockpit_default.spawn(status_cmd, { superuser: true, err: "message" }).done((data) => {
        const init_status = JSON.parse(data);
        if (init_status.startsWith("Agreement successfully initialized") || init_status.startsWith("Agreement initialization failed")) {
          clearInterval(this.state.agmtInitIntervals[idx]);
          this.props.reload(this.props.suffix);
        }
      });
    }
    onSort(_event, index, direction) {
      const sortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    onSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      for (const row of this.props.rows) {
        if (val !== "" && row[0].indexOf(val) === -1 && row[1].indexOf(val) === -1 && row[2].indexOf(val) === -1) {
          continue;
        }
        rows.push([row[0], row[1], row[2], row[3], row[4], row[5]]);
      }
      if (val === "") {
        rows = JSON.parse(JSON.stringify(this.props.rows));
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ds-margin-right", children: [
        /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
          ReplAgmtTable,
          {
            rows: this.state.rows,
            edit: this.showEditAgmt,
            poke: this.pokeAgmt,
            init: this.showConfirmInitAgmt,
            enable: this.confirmToggle,
            delete: this.showConfirmDeleteAgmt,
            page: this.state.page,
            sort: this.onSort,
            sortBy: this.state.sortBy,
            search: this.onSearchChange,
            value: this.state.value
          },
          this.state.rows
        ),
        /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "ds-margin-top ds-container ds-inline ds-margin-bottom-md", children: [
          /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
            Button,
            {
              variant: "primary",
              onClick: this.handleShowCreateAgmtModal,
              children: _62("Create Agreement")
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
            Button,
            {
              className: "ds-left-margin",
              variant: "secondary",
              onClick: () => {
                this.props.reload(this.props.suffix);
              },
              children: _62("Refresh Agreements")
            }
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
          WinsyncAgmtModal,
          {
            showModal: this.state.showCreateAgmtModal,
            closeHandler: this.closeCreateAgmtModal,
            handleChange: this.onCreateChange,
            handleTimeChange: this.onTimeChange,
            handleFracChange: this.onTAFracAttrChange,
            onSelectToggle: this.handleExcludeAttrCreateToggle,
            onSelectClear: this.handleExcludeAttrCreateClear,
            isExcludeAttrOpen: this.state.isExcludeAttrCreateOpen,
            saveHandler: this.createAgmt,
            getToggleId: this.getToggleId,
            spinning: this.state.savingAgmt,
            agmtName: this.state.agmtName,
            agmtHost: this.state.agmtHost,
            agmtPort: this.state.agmtPort,
            agmtBindDN: this.state.agmtBindDN,
            agmtBindPW: this.state.agmtBindPW,
            agmtBindPWConfirm: this.state.agmtBindPWConfirm,
            agmtProtocol: this.state.agmtProtocol,
            agmtFracAttrs: this.state.agmtFracAttrs,
            agmtSync: this.state.agmtSync,
            agmtSyncMon: this.state.agmtSyncMon,
            agmtSyncTue: this.state.agmtSyncTue,
            agmtSyncWed: this.state.agmtSyncWed,
            agmtSyncThu: this.state.agmtSyncThu,
            agmtSyncFri: this.state.agmtSyncFri,
            agmtSyncSat: this.state.agmtSyncSat,
            agmtSyncSun: this.state.agmtSyncSun,
            agmtStartTime: this.state.agmtStartTime,
            agmtEndTime: this.state.agmtEndTime,
            agmtSyncGroups: this.state.agmtSyncGroups,
            agmtSyncUsers: this.state.agmtSyncUsers,
            agmtWinDomain: this.state.agmtWinDomain,
            agmtWinSubtree: this.state.agmtWinSubtree,
            agmtDSSubtree: this.state.agmtDSSubtree,
            agmtOneWaySync: this.state.agmtOneWaySync,
            agmtSyncInterval: this.state.agmtSyncInterval,
            agmtInit: this.state.agmtInit,
            availAttrs: this.props.attrs,
            error: this.state.errObj,
            saveOK: this.state.agmtSaveOK
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
          WinsyncAgmtModal,
          {
            showModal: this.state.showEditAgmtModal,
            closeHandler: this.closeEditAgmtModal,
            handleChange: this.onEditChange,
            handleTimeChange: this.onTimeChange,
            handleFracChange: this.onTAFracAttrChangeEdit,
            onSelectToggle: this.handleExcludeAttrEditToggle,
            onSelectClear: this.handleExcludeAttrEditClear,
            isExcludeAttrOpen: this.state.isExcludeAttrEditOpen,
            getToggleId: this.getToggleId,
            saveHandler: this.saveAgmt,
            spinning: this.state.savingAgmt,
            agmtName: this.state.agmtName,
            agmtHost: this.state.agmtHost,
            agmtPort: this.state.agmtPort,
            agmtBindDN: this.state.agmtBindDN,
            agmtBindPW: this.state.agmtBindPW,
            agmtBindPWConfirm: this.state.agmtBindPWConfirm,
            agmtProtocol: this.state.agmtProtocol,
            agmtStripAttrs: this.state.agmtStripAttrs,
            agmtFracAttrs: this.state.agmtFracAttrs,
            agmtFracInitAttrs: this.state.agmtFracInitAttrs,
            agmtSync: this.state.agmtSync,
            agmtSyncMon: this.state.agmtSyncMon,
            agmtSyncTue: this.state.agmtSyncTue,
            agmtSyncWed: this.state.agmtSyncWed,
            agmtSyncThu: this.state.agmtSyncThu,
            agmtSyncFri: this.state.agmtSyncFri,
            agmtSyncSat: this.state.agmtSyncSat,
            agmtSyncSun: this.state.agmtSyncSun,
            agmtStartTime: this.state.agmtStartTime,
            agmtEndTime: this.state.agmtEndTime,
            agmtSyncGroups: this.state.agmtSyncGroups,
            agmtSyncUsers: this.state.agmtSyncUsers,
            agmtWinDomain: this.state.agmtWinDomain,
            agmtWinSubtree: this.state.agmtWinSubtree,
            agmtDSSubtree: this.state.agmtDSSubtree,
            agmtOneWaySync: this.state.agmtOneWaySync,
            agmtSyncInterval: this.state.agmtSyncInterval,
            agmtInit: this.state.agmtInit,
            availAttrs: this.props.attrs,
            error: this.state.errObj,
            saveOK: this.state.agmtSaveOK,
            edit: true
          },
          this.state.showEditAgmtModal ? "edit1" : "edit0"
        ),
        /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDeleteAgmt,
            closeHandler: this.closeConfirmDeleteAgmt,
            handleChange: this.onModalChange,
            actionHandler: this.deleteAgmt,
            spinning: this.state.modalSpinning,
            item: this.state.agmtName,
            checked: this.state.modalChecked,
            mTitle: _62("Delete Winsync Agreement"),
            mMsg: _62("Are you sure you want to delete this winsync agreement"),
            mSpinningMsg: _62("Deleting Winsync Agreement ..."),
            mBtnName: _62("Delete Agreement")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmInitAgmt,
            closeHandler: this.closeConfirmInitAgmt,
            handleChange: this.onModalChange,
            actionHandler: this.initAgmt,
            spinning: this.state.modalSpinning,
            item: this.state.agmtName,
            checked: this.state.modalChecked,
            mTitle: _62("Initialize Winsync Agreement"),
            mMsg: _62("Are you sure you want to initialize this winsync agreement?"),
            mSpinningMsg: _62("Initializing Winsync Agreement ..."),
            mBtnName: _62("Initialize Agreement")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmEnableAgmt,
            closeHandler: this.closeConfirmEnableAgmt,
            handleChange: this.onModalChange,
            actionHandler: this.enableAgmt,
            spinning: this.state.modalSpinning,
            item: this.state.agmtName,
            checked: this.state.modalChecked,
            mTitle: _62("Enable Winsync Agreement"),
            mMsg: _62("Are you sure you want to enable this winsync agreement?"),
            mSpinningMsg: _62("Enabling Winsync Agreement ..."),
            mBtnName: _62("Enable Agreement")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDisableAgmt,
            closeHandler: this.closeConfirmDisableAgmt,
            handleChange: this.onModalChange,
            actionHandler: this.disableAgmt,
            spinning: this.state.modalSpinning,
            item: this.state.agmtName,
            checked: this.state.modalChecked,
            mTitle: _62("Disable Winsync Agreement"),
            mMsg: _62("Are you sure you want to disable this winsync agreement?"),
            mSpinningMsg: _62("Disabling Winsync Agreement ..."),
            mBtnName: _62("Disable Agreement")
          }
        )
      ] });
    }
  };
  WinsyncAgmts.propTypes = {
    suffix: import_prop_types61.default.string,
    serverId: import_prop_types61.default.string,
    rows: import_prop_types61.default.array,
    addNotification: import_prop_types61.default.func
  };
  WinsyncAgmts.defaultProps = {
    serverId: "",
    suffix: "",
    rows: []
  };

  // src/lib/replication/replAgmts.jsx
  var import_react133 = __toESM(require_react(), 1);
  var import_prop_types62 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1);
  var ldapOptions = ["SIMPLE", "SASL/DIGEST-MD5", "SASL/GSSAPI"];
  var ldapsOptions = ["SIMPLE", "SSLCLIENTAUTH"];
  var ldapBootstrapOptions = ["SIMPLE"];
  var ldapsBootstrapOptions = ["SIMPLE", "SSLCLIENTAUTH"];
  var _63 = cockpit_default.gettext;
  var ReplAgmts = class extends import_react133.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "_mounted", false);
      __publicField(this, "onSelectToggle", (_event, isExpanded, toggleId) => {
        this.setState({
          [toggleId]: isExpanded
        });
      });
      __publicField(this, "onSelectClear", (toggleId, collection) => {
        this.setState({
          [toggleId]: false,
          [collection]: []
        });
      });
      this.state = {
        showCreateAgmtModal: false,
        showEditAgmtModal: false,
        showConfirmDeleteAgmt: false,
        showConfirmInitAgmt: false,
        showConfirmEnableAgmt: false,
        showConfirmDisableAgmt: false,
        errObj: {},
        savingAgmt: false,
        mounted: false,
        rows: [],
        page: 1,
        value: "",
        sortBy: {},
        // Create agreement
        agmtName: "",
        agmtHost: "",
        agmtPort: "636",
        agmtProtocol: "LDAPS",
        agmtBindMethod: "SIMPLE",
        agmtBindMethodOptions: ldapsOptions,
        agmtBindDN: "cn=replication manager,cn=config",
        agmtBindPW: "",
        agmtBindPWConfirm: "",
        agmtBootstrap: false,
        agmtBootstrapProtocol: "LDAPS",
        agmtBootstrapBindMethod: "SIMPLE",
        agmtBootstrapBindMethodOptions: ldapsBootstrapOptions,
        agmtBootstrapBindDN: "cn=replication manager,cn=config",
        agmtBootstrapBindPW: "",
        agmtBootstrapBindPWConfirm: "",
        agmtStripAttrs: [],
        agmtFracAttrs: [],
        agmtFracInitAttrs: [],
        agmtSync: true,
        agmtSyncMon: true,
        agmtSyncTue: true,
        agmtSyncWed: true,
        agmtSyncThu: true,
        agmtSyncFri: true,
        agmtSyncSat: true,
        agmtSyncSun: true,
        agmtStartTime: "0000",
        agmtEndTime: "2359",
        agmtInit: "noinit",
        agmtSaveOK: false,
        modalChecked: false,
        modalSpinning: false,
        // Init agmt
        agmtInitCounter: 0,
        agmtInitIntervals: [],
        isExcludeAttrsCreateOpen: false,
        isExcludeInitAttrsCreateOpen: false,
        isStripAttrsCreateOpen: false,
        isExcludeAttrsEditOpen: false,
        isExcludeInitAttrsEditOpen: false,
        isStripAttrsEditOpen: false
      };
      this.handleExcludeAttrsCreateToggle = (_event, isExcludeAttrsCreateOpen) => {
        this.setState({
          isExcludeAttrsCreateOpen
        });
      };
      this.handleExcludeAttrsCreateClear = () => {
        this.setState({
          agmtFracAttrs: [],
          isExcludeAttrsCreateOpen: false
        });
      };
      this.handleExcludeAttrsInitCreateToggle = (_event, isExcludeInitAttrsCreateOpen) => {
        this.setState({
          isExcludeInitAttrsCreateOpen
        });
      };
      this.handleExcludeAttrsInitCreateClear = () => {
        this.setState({
          agmtFracInitAttrs: [],
          isExcludeInitAttrsCreateOpen: false
        });
      };
      this.onStripAttrsCreateToggle = (_event, isStripAttrsCreateOpen) => {
        this.setState({
          isStripAttrsCreateOpen
        });
      };
      this.handleStripAttrsCreateClear = () => {
        this.setState({
          agmtStripAttrs: [],
          isStripAttrsCreateOpen: false
        });
      };
      this.handleExcludeAttrsEditToggle = (_event, isExcludeAttrsEditOpen) => {
        this.setState({
          isExcludeAttrsEditOpen
        });
      };
      this.handleExcludeAttrsEditClear = () => {
        this.setState({
          agmtFracAttrs: [],
          isExcludeAttrsEditOpen: false
        });
      };
      this.handleExcludeAttrsInitEditToggle = (_event, isExcludeInitAttrsEditOpen) => {
        this.setState({
          isExcludeInitAttrsEditOpen
        });
      };
      this.handleExcludeAttrsInitEditClear = () => {
        this.setState({
          agmtFracInitAttrs: [],
          isExcludeInitAttrsEditOpen: false
        });
      };
      this.onStripAttrsEditToggle = (_event, isStripAttrsEditOpen) => {
        this.setState({
          isStripAttrsEditOpen
        });
      };
      this.handleStripAttrsEditClear = () => {
        this.setState({
          agmtStripAttrs: [],
          isStripAttrsEditOpen: false
        });
      };
      this.handleShowCreateAgmtModal = this.handleShowCreateAgmtModal.bind(this);
      this.closeCreateAgmtModal = this.closeCreateAgmtModal.bind(this);
      this.closeEditAgmtModal = this.closeEditAgmtModal.bind(this);
      this.handleTASelectChange = this.handleTASelectChange.bind(this);
      this.onTimeChange = this.onTimeChange.bind(this);
      this.onCreateChange = this.onCreateChange.bind(this);
      this.onEditChange = this.onEditChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.onTAFracInitAttrChange = this.onTAFracInitAttrChange.bind(this);
      this.onTAFracAttrChange = this.onTAFracAttrChange.bind(this);
      this.onTAStripAttrChange = this.onTAStripAttrChange.bind(this);
      this.onTAFracInitAttrChangeEdit = this.onTAFracInitAttrChangeEdit.bind(this);
      this.onTAFracAttrChangeEdit = this.onTAFracAttrChangeEdit.bind(this);
      this.onTAStripAttrChangeEdit = this.onTAStripAttrChangeEdit.bind(this);
      this.createAgmt = this.createAgmt.bind(this);
      this.showEditAgmt = this.showEditAgmt.bind(this);
      this.saveAgmt = this.saveAgmt.bind(this);
      this.pokeAgmt = this.pokeAgmt.bind(this);
      this.initAgmt = this.initAgmt.bind(this);
      this.enableAgmt = this.enableAgmt.bind(this);
      this.disableAgmt = this.disableAgmt.bind(this);
      this.deleteAgmt = this.deleteAgmt.bind(this);
      this.showConfirmDeleteAgmt = this.showConfirmDeleteAgmt.bind(this);
      this.closeConfirmDeleteAgmt = this.closeConfirmDeleteAgmt.bind(this);
      this.showConfirmInitAgmt = this.showConfirmInitAgmt.bind(this);
      this.closeConfirmInitAgmt = this.closeConfirmInitAgmt.bind(this);
      this.confirmToggle = this.confirmToggle.bind(this);
      this.closeConfirmEnableAgmt = this.closeConfirmEnableAgmt.bind(this);
      this.closeConfirmDisableAgmt = this.closeConfirmDisableAgmt.bind(this);
      this.watchAgmtInit = this.watchAgmtInit.bind(this);
      this.onSort = this.onSort.bind(this);
      this.onSearchChange = this.onSearchChange.bind(this);
      this.validateConfig = this.validateConfig.bind(this);
    }
    componentDidMount() {
      this._mounted = true;
      const rows = JSON.parse(JSON.stringify(this.props.rows));
      this.setState({ rows });
    }
    componentWillUnmount() {
      this._mounted = false;
    }
    onModalChange(e) {
      this.setState({
        [e.target.id]: e.target.checked
      });
    }
    validateConfig(attr, value, modalData, errObj) {
      let all_good = true;
      const configAttrs2 = [
        "agmtName",
        "agmtHost"
      ];
      const dnAttrs = [
        "agmtBindDN"
      ];
      if (attr === "agmtBootstrap" && value === false) {
        errObj.agmtBootstrapBindDN = false;
        errObj.agmtBootstrapBindPW = false;
        errObj.agmtBootstrapBindPWConfirm = false;
      }
      if (attr === "agmtSync" && value === true) {
        errObj.agmtSyncMon = false;
        errObj.agmtSyncTue = false;
        errObj.agmtSyncWed = false;
        errObj.agmtSyncThu = false;
        errObj.agmtSyncFri = false;
        errObj.agmtSyncSat = false;
        errObj.agmtSyncSun = false;
        errObj.agmtStartTime = false;
        errObj.agmtEndTime = false;
      }
      for (const configAttr of configAttrs2) {
        if (attr === configAttr) {
          if (value === "") {
            errObj[attr] = true;
            all_good = false;
          } else {
            errObj[attr] = false;
          }
        } else if (this.state[configAttr] === "") {
          errObj[configAttr] = true;
          all_good = false;
        }
      }
      for (const dnAttr of dnAttrs) {
        if (attr === dnAttr) {
          if (!valid_dn(value)) {
            errObj[dnAttr] = true;
            all_good = false;
          } else {
            errObj[attr] = false;
          }
        } else if (!valid_dn(this.state[dnAttr])) {
          errObj[dnAttr] = true;
          all_good = false;
        }
      }
      if (attr === "agmtPort") {
        if (!valid_port(value)) {
          errObj.agmtPort = true;
          all_good = false;
        } else {
          errObj.agmtPort = false;
        }
      } else if (attr === "agmtProtocol") {
        if (value === "LDAP") {
          modalData.agmtBindMethodOptions = ldapOptions;
        } else {
          modalData.agmtBindMethodOptions = ldapsOptions;
        }
        if (modalData.agmtBindMethodOptions.indexOf(this.state.agmtBindMethod) === -1) {
          modalData.agmtBindMethod = modalData.agmtBindMethodOptions[0];
        }
      } else if (attr === "agmtBindMethod") {
        modalData.agmtBindMethod = value;
      } else if (attr === "agmtBootstrapBindMethod") {
        modalData.agmtBootstrapBindMethod = value;
      } else if (attr === "agmtBootstrapProtocol") {
        if (value === "LDAP") {
          modalData.agmtBootstrapBindMethodOptions = ldapBootstrapOptions;
        } else {
          modalData.agmtBootstrapBindMethodOptions = ldapsBootstrapOptions;
        }
        if (modalData.agmtBootstrapBindMethodOptions.indexOf(this.state.agmtBootstrapBindMethod) === -1) {
          modalData.agmtBootstrapBindMethod = modalData.agmtBootstrapBindMethodOptions[0];
        }
      }
      if (attr === "agmtBindMethod" && (value !== "SIMPLE" && value !== "SASL/DIGEST-MD5")) {
        errObj.agmtBindPW = false;
        errObj.agmtBindPWConfirm = false;
      } else if (this.state.agmtBindMethod === "SIMPLE" || this.state.agmtBindMethod === "SASL/DIGEST-MD5" || attr === "agmtBindMethod" && (value === "SIMPLE" || value === "SASL/DIGEST-MD5")) {
        if (attr === "agmtBindPW") {
          if (value !== this.state.agmtBindPWConfirm || value === "") {
            errObj.agmtBindPW = true;
            errObj.agmtBindPWConfirm = true;
            all_good = false;
          } else {
            errObj.agmtBindPW = false;
            errObj.agmtBindPWConfirm = false;
          }
        } else if (attr === "agmtBindPWConfirm") {
          if (value !== this.state.agmtBindPW || value === "") {
            errObj.agmtBindPW = true;
            errObj.agmtBindPWConfirm = true;
            all_good = false;
          } else {
            errObj.agmtBindPW = false;
            errObj.agmtBindPWConfirm = false;
          }
        } else if (this.state.agmtBindPW !== this.state.agmtBindPWConfirm || this.state.agmtBindPW === "" || this.state.agmtBindPWConfirm === "") {
          errObj.agmtBindPW = true;
          errObj.agmtBindPWConfirm = true;
          all_good = false;
        }
      } else {
        errObj.agmtBindPW = false;
        errObj.agmtBindPWConfirm = false;
      }
      if (attr === "agmtBootstrap") {
        if (value) {
          if (this.state.agmtBootstrapBindMethod === "SIMPLE") {
            if (this.state.agmtBootstrapBindPW === "" || this.state.agmtBootstrapBindPWConfirm === "") {
              errObj.agmtBootstrapBindPW = true;
              errObj.agmtBootstrapBindPWConfirm = true;
              all_good = false;
            } else if (this.state.agmtBootstrapBindPW !== this.state.agmtBootstrapBindPWConfirm) {
              errObj.agmtBootstrapBindPW = true;
              errObj.agmtBootstrapBindPWConfirm = true;
              all_good = false;
            } else {
              errObj.agmtBootstrapProtocol = false;
              errObj.agmtBootstrapBindMethod = false;
            }
          } else {
            errObj.agmtBootstrapProtocol = false;
            errObj.agmtBootstrapBindMethod = false;
          }
          if (this.state.agmtBootstrapBindDN === "" || !valid_dn(this.state.agmtBootstrapBindDN)) {
            errObj.agmtBootstrapBindDN = true;
            all_good = false;
          }
        }
      } else if (this.state.agmtBootstrap) {
        if (attr === "agmtBootstrapBindDN") {
          if (value === "" || !valid_dn(value)) {
            errObj.agmtBootstrapBindDN = true;
            all_good = false;
          } else {
            errObj.agmtBootstrapBindDN = false;
          }
        } else if (this.state.agmtBootstrapBindDN === "" || !valid_dn(this.state.agmtBootstrapBindDN)) {
          errObj.agmtBootstrapBindDN = true;
          all_good = false;
        } else {
          errObj.agmtBootstrapBindDN = false;
        }
        if (attr === "agmtBootstrapBindMethod") {
          if (value === "SIMPLE") {
            if (this.state.agmtBootstrapBindPW === "" || this.state.agmtBootstrapBindPWConfirm === "") {
              errObj.agmtBootstrapBindPW = true;
              errObj.agmtBootstrapBindPWConfirm = true;
              all_good = false;
            } else if (this.state.agmtBootstrapBindPW !== this.state.agmtBootstrapBindPWConfirm) {
              errObj.agmtBootstrapBindPW = true;
              errObj.agmtBootstrapBindPWConfirm = true;
              all_good = false;
            }
          } else {
            errObj.agmtBootstrapBindPW = false;
            errObj.agmtBootstrapBindPWConfirm = false;
            if (this.state.agmtBootstrapProtocol === "LDAP") {
              errObj.agmtBootstrapBindMethod = true;
              all_good = false;
            } else {
              errObj.agmtBootstrapProtocol = false;
              errObj.agmtBootstrapBindMethod = false;
            }
          }
        } else if (this.state.agmtBootstrapBindMethod === "SIMPLE") {
          if (attr === "agmtBootstrapBindPW") {
            if (value === "") {
              all_good = false;
              errObj.agmtBootstrapBindPW = true;
            } else if (value !== this.state.agmtBootstrapBindPWConfirm) {
              errObj.agmtBootstrapBindPW = true;
              errObj.agmtBootstrapBindPWConfirm = true;
              all_good = false;
            } else {
              errObj.agmtBootstrapBindPW = false;
              errObj.agmtBootstrapBindPWConfirm = false;
            }
          } else if (this.state.agmtBootstrapBindPW === "") {
            all_good = false;
          }
          if (attr === "agmtBootstrapBindPWConfirm") {
            if (value === "") {
              all_good = false;
              errObj.agmtBootstrapBindPWConfirm = true;
            } else if (value !== this.state.agmtBootstrapBindPW) {
              errObj.agmtBootstrapBindPW = true;
              errObj.agmtBootstrapBindPWConfirm = true;
              all_good = false;
            } else {
              errObj.agmtBootstrapBindPW = false;
              errObj.agmtBootstrapBindPWConfirm = false;
            }
          } else if (this.state.agmtBootstrapBindPWConfirm === "") {
            all_good = false;
          }
        } else {
          if (this.state.agmtBootstrapProtocol === "LDAP") {
            errObj.agmtBootstrapProtocol = true;
            all_good = false;
          } else {
            errObj.agmtBootstrapProtocol = false;
            errObj.agmtBootstrapBindMethod = false;
          }
        }
      }
      if (attr === "agmtSync") {
        if (value) {
          errObj.agmtStartTime = false;
          errObj.agmtEndTime = false;
          this.setState({
            agmtSyncMon: true,
            agmtSyncTue: true,
            agmtSyncWed: true,
            agmtSyncThu: true,
            agmtSyncFri: true,
            agmtSyncSat: true,
            agmtSyncSun: true,
            agmtStartTime: "0000",
            agmtEndTime: "2359"
          });
        }
      } else if (this.state.agmtSync) {
        let have_days = false;
        const days = [
          "agmtSyncSun",
          "agmtSyncMon",
          "agmtSyncTue",
          "agmtSyncWed",
          "agmtSyncThu",
          "agmtSyncFri",
          "agmtSyncSat"
        ];
        for (const day of days) {
          if (attr !== day && this.state[day] || attr === day && value) {
            have_days = true;
            break;
          }
        }
        errObj.agmtSyncSun = false;
        errObj.agmtSyncMon = false;
        errObj.agmtSyncTue = false;
        errObj.agmtSyncWed = false;
        errObj.agmtSyncThu = false;
        errObj.agmtSyncFri = false;
        errObj.agmtSyncSat = false;
        if (!have_days) {
          errObj.agmtSyncSun = true;
          errObj.agmtSyncMon = true;
          errObj.agmtSyncTue = true;
          errObj.agmtSyncWed = true;
          errObj.agmtSyncThu = true;
          errObj.agmtSyncFri = true;
          errObj.agmtSyncSat = true;
          all_good = false;
        } else if (attr === "agmtStartTime") {
          if (value === "") {
            all_good = false;
            errObj.agmtStartTime = true;
          } else if (value >= this.state.agmtEndTime) {
            errObj.agmtStartTime = true;
            all_good = false;
          } else {
            errObj.agmtStartTime = false;
            errObj.agmtEndTime = false;
          }
        } else if (attr === "agmtEndTime") {
          if (value === "") {
            errObj.agmtEndTime = true;
            all_good = false;
          } else if (this.state.agmtStartTime >= value) {
            errObj.agmtStartTime = true;
            all_good = false;
          } else {
            errObj.agmtStartTime = false;
            errObj.agmtEndTime = false;
          }
        } else if (this.state.agmtStartTime >= this.state.agmtEndTime) {
          errObj.agmtStartTime = true;
          all_good = false;
        }
      }
      return all_good;
    }
    onTimeChange(action, attr, val) {
      let value = val.replace(":", "");
      const errObj = this.state.errObj;
      const e = { target: { id: "dummy", value: "", type: "input" } };
      if (value === "") {
        value = "0000";
      }
      if (attr === "agmtStartTime") {
        if (value > this.state.agmtEndTime) {
          errObj.agmtStartTime = true;
        } else {
          errObj.agmtStartTime = false;
          errObj.agmtEndTime = false;
        }
      } else if (attr === "agmtEndTime") {
        if (this.state.agmtStartTime > value) {
          errObj.agmtEndTime = true;
        } else {
          errObj.agmtEndTime = false;
          errObj.agmtStartTime = false;
        }
      }
      this.setState({
        [attr]: value,
        errObj
      }, () => {
        action === "edit" ? this.onEditChange(e) : this.onCreateChange(e);
      });
    }
    onCreateChange(e) {
      let value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      const errObj = this.state.errObj;
      let all_good = true;
      const modalData = {
        agmtBindMethod: this.state.agmtBindMethod,
        agmtBindMethodOptions: this.state.agmtBindMethodOptions,
        agmtBootstrapBindMethod: this.state.agmtBootstrapBindMethod,
        agmtBootstrapBindMethodOptions: this.state.agmtBootstrapBindMethodOptions
      };
      if (e.target.type === "time") {
        value = value.replace(":", "");
      }
      all_good = this.validateConfig(attr, value, modalData, errObj);
      this.setState({
        [attr]: value,
        errObj,
        agmtSaveOK: all_good,
        agmtBindMethod: modalData.agmtBindMethod,
        agmtBindMethodOptions: modalData.agmtBindMethodOptions,
        agmtBootstrapBindMethod: modalData.agmtBootstrapBindMethod,
        agmtBootstrapBindMethodOptions: modalData.agmtBootstrapBindMethodOptions,
        [e.target.toggle]: false
      });
    }
    onEditChange(e) {
      let value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      const errObj = this.state.errObj;
      let all_good = false;
      const modalData = {
        agmtBindMethod: this.state.agmtBindMethod,
        agmtBindMethodOptions: this.state.agmtBindMethodOptions,
        agmtBootstrapBindMethod: this.state.agmtBootstrapBindMethod,
        agmtBootstrapBindMethodOptions: this.state.agmtBootstrapBindMethodOptions
      };
      errObj[attr] = false;
      if (e.target.type === "time") {
        value = value.replace(":", "");
      }
      all_good = this.validateConfig(attr, value, modalData, errObj);
      if (all_good) {
        all_good = false;
        if (attr !== "agmtHost" && this.state.agmtHost !== this.state._agmtHost || attr !== "agmtPort" && this.state.agmtPort !== this.state._agmtPort || attr !== "agmtBindDN" && this.state.agmtBindDN !== this.state._agmtBindDN || attr !== "agmtBindMethod" && this.state.agmtBindMethod !== this.state._agmtBindMethod || attr !== "agmtProtocol" && this.state.agmtProtocol !== this.state._agmtProtocol || attr !== "agmtSync" && this.state.agmtSync !== this.state._agmtSync || attr !== "agmtBootstrap" && this.state.agmtBootstrap !== this.state._agmtBootstrap || attr !== "agmtStripAttrs" && !listsEqual(this.state.agmtStripAttrs, this.state._agmtStripAttrs) || attr !== "agmtFracAttrs" && !listsEqual(this.state.agmtFracAttrs, this.state._agmtFracAttrs) || attr !== "agmtFracInitAttrs" && !listsEqual(this.state.agmtFracInitAttrs, this.state._agmtFracInitAttrs)) {
          all_good = true;
        }
        if (attr !== "agmtSync" && this.state.agmtSync || attr === "agmtSync" && value) {
          if (attr !== "agmtSyncMon" && this.state.agmtSyncMon !== this.state._agmtSyncMon || attr !== "agmtSyncTue" && this.state.agmtSyncTue !== this.state._agmtSyncTue || attr !== "agmtSyncWed" && this.state.agmtSyncWed !== this.state._agmtSyncWed || attr !== "agmtSyncThu" && this.state.agmtSyncThu !== this.state._agmtSyncThu || attr !== "agmtSyncFri" && this.state.agmtSyncFri !== this.state._agmtSyncFri || attr !== "agmtSyncSat" && this.state.agmtSyncSat !== this.state._agmtSyncSat || attr !== "agmtSyncSun" && this.state.agmtSyncSun !== this.state._agmtSyncSun || attr !== "agmtStartTime" && this.state.agmtStartTime !== this.state._agmtStartTime || attr !== "agmtEndTime" && this.state.agmtEndTime !== this.state._agmtEndTime) {
            all_good = true;
          }
        }
        if (attr !== "agmtBootstrap" && this.state.agmtBootstrap || attr === "agmtBootstrap" && value) {
          if (attr !== "agmtBootstrapBindDN" && this.state.agmtBootstrapBindDN !== this.state._agmtBootstrapBindDN || attr !== "agmtBootstrapBindPW" && this.state.agmtBootstrapBindPW !== this.state._agmtBootstrapBindPW || attr !== "agmtBootstrapBindPWConfirm" && this.state.agmtBootstrapBindPWConfirm !== this.state._agmtBootstrapBindPWConfirm || attr !== "agmtBootstrapBindMethod" && this.state.agmtBootstrapBindMethod !== this.state._agmtBootstrapBindMethod || attr !== "agmtBootstrapProtocol" && this.state.agmtBootstrapProtocol !== this.state._agmtBootstrapProtocol) {
            all_good = true;
          }
        }
        if (attr === "agmtStripAttrs" && !listsEqual(value, this.state._agmtStripAttrs) || attr === "agmtFracAttrs" && !listsEqual(value, this.state._agmtFracAttrs) || attr === "agmtFracInitAttrs" && !listsEqual(value, this.state._agmtFracInitAttrs)) {
          all_good = true;
        } else if (attr !== "dummy" && value !== this.state["_" + attr]) {
          all_good = true;
        }
      }
      this.setState({
        [attr]: value,
        errObj,
        agmtSaveOK: all_good,
        agmtBindMethod: modalData.agmtBindMethod,
        agmtBindMethodOptions: modalData.agmtBindMethodOptions,
        agmtBootstrapBindMethod: modalData.agmtBootstrapBindMethod,
        agmtBootstrapBindMethodOptions: modalData.agmtBootstrapBindMethodOptions,
        [e.target.toggle]: false
      });
    }
    handleTASelectChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      errObj[attr] = valueErr;
      if (attr.endsWith("Attrs")) {
        this.setState({
          [attr]: Array.isArray(value) ? value : [],
          errObj,
          [e.target.toggle]: false
        });
      } else {
        this.setState({
          [attr]: value,
          errObj,
          [e.target.toggle]: false
        });
      }
    }
    onTAStripAttrChangeEdit(selection) {
      const e = { target: { id: "dummy", value: "", type: "input" } };
      const newStripAttrs = Array.isArray(selection) ? selection : [];
      this.setState({
        agmtStripAttrs: newStripAttrs,
        isStripAttrsEditOpen: false
      }, () => {
        this.onEditChange(e);
      });
    }
    onTAFracAttrChangeEdit(selection) {
      const e = { target: { id: "dummy", value: "", type: "input" } };
      const newFracAttrs = Array.isArray(selection) ? selection : [];
      this.setState({
        agmtFracAttrs: newFracAttrs,
        isExcludeAttrsEditOpen: false
      }, () => {
        this.onEditChange(e);
      });
    }
    onTAFracInitAttrChangeEdit(selection) {
      const e = { target: { id: "dummy", value: "", type: "input" } };
      const newFracInitAttrs = Array.isArray(selection) ? selection : [];
      this.setState({
        agmtFracInitAttrs: newFracInitAttrs,
        isExcludeInitAttrsEditOpen: false
      }, () => {
        this.onEditChange(e);
      });
    }
    onTAStripAttrChange(values) {
      const e = {
        target: {
          name: "agmt-modal",
          id: "agmtStripAttrs",
          value: values,
          type: "input",
          toggle: "isStripAttrsCreateOpen"
        }
      };
      this.handleTASelectChange(e);
    }
    onTAFracAttrChange(values) {
      const e = {
        target: {
          name: "agmt-modal",
          id: "agmtFracAttrs",
          value: values,
          type: "input",
          toggle: "isExcludeAttrsCreateOpen"
        }
      };
      this.handleTASelectChange(e);
    }
    onTAFracInitAttrChange(values) {
      const e = {
        target: {
          name: "agmt-modal",
          id: "agmtFracInitAttrs",
          value: values,
          type: "input",
          toggle: "isExcludeInitAttrsCreateOpen"
        }
      };
      this.handleTASelectChange(e);
    }
    showConfirmDeleteAgmt(agmtName) {
      this.setState({
        agmtName,
        showConfirmDeleteAgmt: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmDeleteAgmt() {
      this.setState({
        showConfirmDeleteAgmt: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    showConfirmInitAgmt(agmtName) {
      this.setState({
        agmtName,
        showConfirmInitAgmt: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmInitAgmt() {
      this.setState({
        showConfirmInitAgmt: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    handleShowCreateAgmtModal() {
      this.setState({
        showCreateAgmtModal: true,
        agmtName: "",
        agmtHost: "",
        agmtPort: "636",
        agmtProtocol: "LDAPS",
        agmtBindMethod: "SIMPLE",
        agmtBindDN: "cn=replication manager,cn=config",
        agmtBindPW: "",
        agmtBindPWConfirm: "",
        agmtBootstrap: false,
        agmtBootstrapProtocol: "LDAPS",
        agmtBootstrapBindMethod: "SIMPLE",
        agmtBootstrapBindDN: "cn=replication manager,cn=config",
        agmtBootstrapBindPW: "",
        agmtBootstrapBindPWConfirm: "",
        agmtStripAttrs: [],
        agmtFracAttrs: [],
        agmtFracInitAttrs: [],
        agmtSync: false,
        agmtSyncMon: true,
        agmtSyncTue: true,
        agmtSyncWed: true,
        agmtSyncThu: true,
        agmtSyncFri: true,
        agmtSyncSat: true,
        agmtSyncSun: true,
        agmtStartTime: "0000",
        agmtEndTime: "2359",
        agmtInit: "noinit",
        agmtSaveOK: false,
        errObj: {}
      });
    }
    closeCreateAgmtModal() {
      this.setState({
        showCreateAgmtModal: false
      });
    }
    closeEditAgmtModal() {
      this.setState({
        showEditAgmtModal: false
      });
    }
    showEditAgmt(agmtName) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "get",
        agmtName,
        "--suffix=" + this.props.suffix
      ];
      log_cmd("showEditAgmt", "Edit replication agreement", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        let agmtName2 = "";
        let agmtHost = "";
        let agmtPort = "";
        let agmtProtocol = "";
        let agmtBindMethod = "";
        let agmtBindDN = "";
        let agmtBindPW = "";
        let agmtBindPWConfirm = "";
        let agmtBootstrap = false;
        let agmtBootstrapProtocol = "";
        let agmtBootstrapBindMethod = "SIMPLE";
        let agmtBootstrapBindDN = "";
        let agmtBootstrapBindPW = "";
        let agmtBootstrapBindPWConfirm = "";
        let agmtStripAttrs = [];
        let agmtFracAttrs = [];
        let agmtFracInitAttrs = [];
        let agmtSync = false;
        let agmtSyncMon = false;
        let agmtSyncTue = false;
        let agmtSyncWed = false;
        let agmtSyncThu = false;
        let agmtSyncFri = false;
        let agmtSyncSat = false;
        let agmtSyncSun = false;
        let agmtStartTime = "0000";
        let agmtEndTime = "2359";
        for (const attr in config.attrs) {
          const val = config.attrs[attr][0];
          if (attr === "cn") {
            agmtName2 = val;
          }
          if (attr === "nsds5replicahost") {
            agmtHost = val;
          }
          if (attr === "nsds5replicaport") {
            agmtPort = val;
          }
          if (attr === "nsds5replicatransportinfo") {
            agmtProtocol = val;
          }
          if (attr === "nsds5replicabindmethod") {
            agmtBindMethod = val.toUpperCase();
          }
          if (attr === "nsds5replicabinddn") {
            agmtBindDN = val;
          }
          if (attr === "nsds5replicacredentials") {
            agmtBindPW = val;
            agmtBindPWConfirm = val;
          }
          if (attr === "nsds5replicabootstraptransportinfo") {
            agmtBootstrapProtocol = val;
          }
          if (attr === "nsds5replicabootstrapbindmethod") {
            agmtBootstrapBindMethod = val.toUpperCase();
          }
          if (attr === "nsds5replicabootstrapbinddn") {
            agmtBootstrapBindDN = val;
            agmtBootstrap = true;
          }
          if (attr === "nsds5replicabootstrapcredentials") {
            agmtBootstrapBindPW = val;
            agmtBootstrapBindPWConfirm = val;
          }
          if (attr === "nsds5replicatedattributelist") {
            const attrs = val.replace("(objectclass=*) $ EXCLUDE", "").trim();
            agmtFracAttrs = attrs.split(" ");
          }
          if (attr === "nsds5replicatedattributelisttotal") {
            const attrs = val.replace("(objectclass=*) $ EXCLUDE", "").trim();
            agmtFracInitAttrs = attrs.split(" ");
          }
          if (attr === "nsds5replicastripattrs") {
            agmtStripAttrs = val.split(" ");
          }
          if (attr === "nsds5replicaupdateschedule") {
            agmtSync = true;
            const parts = val.split(" ");
            const times = parts[0].split("-");
            const days = parts[1];
            agmtStartTime = times[0];
            agmtEndTime = times[1];
            if (days.includes("0")) {
              agmtSyncSun = true;
            }
            if (days.includes("1")) {
              agmtSyncMon = true;
            }
            if (days.includes("2")) {
              agmtSyncTue = true;
            }
            if (days.includes("3")) {
              agmtSyncWed = true;
            }
            if (days.includes("4")) {
              agmtSyncThu = true;
            }
            if (days.includes("5")) {
              agmtSyncFri = true;
            }
            if (days.includes("6")) {
              agmtSyncSat = true;
            }
          }
        }
        if (this._mounted) {
          this.setState({
            showEditAgmtModal: true,
            agmtName: agmtName2,
            agmtHost,
            agmtPort,
            agmtProtocol,
            agmtBindMethod,
            agmtBindDN,
            agmtBindPW,
            agmtBindPWConfirm,
            agmtBootstrap,
            agmtBootstrapProtocol,
            agmtBootstrapBindMethod,
            agmtBootstrapBindDN,
            agmtBootstrapBindPW,
            agmtBootstrapBindPWConfirm,
            agmtStripAttrs,
            agmtFracAttrs,
            agmtFracInitAttrs,
            agmtSync,
            agmtSyncMon,
            agmtSyncTue,
            agmtSyncWed,
            agmtSyncThu,
            agmtSyncFri,
            agmtSyncSat,
            agmtSyncSun,
            agmtStartTime,
            agmtEndTime,
            agmtSaveOK: false,
            modalMsg: "",
            errObj: {},
            // Record original values before editing
            _agmtName: agmtName2,
            _agmtHost: agmtHost,
            _agmtPort: agmtPort,
            _agmtProtocol: agmtProtocol,
            _agmtBindMethod: agmtBindMethod,
            _agmtBindDN: agmtBindDN,
            _agmtBindPW: agmtBindPW,
            _agmtBindPWConfirm: agmtBindPWConfirm,
            _agmtBootstrap: agmtBootstrap,
            _agmtBootstrapProtocol: agmtBootstrapProtocol,
            _agmtBootstrapBindMethod: agmtBootstrapBindMethod,
            _agmtBootstrapBindDN: agmtBootstrapBindDN,
            _agmtBootstrapBindPW: agmtBootstrapBindPW,
            _agmtBootstrapBindPWConfirm: agmtBootstrapBindPWConfirm,
            _agmtStripAttrs: agmtStripAttrs,
            _agmtFracAttrs: agmtFracAttrs,
            _agmtFracInitAttrs: agmtFracInitAttrs,
            _agmtSync: agmtSync,
            _agmtSyncMon: agmtSyncMon,
            _agmtSyncTue: agmtSyncTue,
            _agmtSyncWed: agmtSyncWed,
            _agmtSyncThu: agmtSyncThu,
            _agmtSyncFri: agmtSyncFri,
            _agmtSyncSat: agmtSyncSat,
            _agmtSyncSun: agmtSyncSun,
            _agmtStartTime: agmtStartTime,
            _agmtEndTime: agmtEndTime
          });
        }
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_63('Failed to get agreement information for: "$0" - $1'), agmtName, errMsg)
        );
      });
    }
    saveAgmt() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "set",
        this.state.agmtName,
        "--suffix=" + this.props.suffix
      ];
      let passwd = "";
      let bootstrap_passwd = "";
      if (this.state.agmtSync) {
        let agmt_days = "";
        if (this.state.agmtSyncSun) {
          agmt_days += "0";
        }
        if (this.state.agmtSyncMon) {
          agmt_days += "1";
        }
        if (this.state.agmtSyncTue) {
          agmt_days += "2";
        }
        if (this.state.agmtSyncWed) {
          agmt_days += "3";
        }
        if (this.state.agmtSyncThu) {
          agmt_days += "4";
        }
        if (this.state.agmtSyncFri) {
          agmt_days += "5";
        }
        if (this.state.agmtSyncSat) {
          agmt_days += "6";
        }
        cmd.push("--schedule=" + this.state.agmtStartTime.replace(":", "") + "-" + this.state.agmtEndTime.replace(":", "") + " " + agmt_days);
      } else if (this.state.agmtSync !== this.state._agmtSync && !this.state.agmtSync) {
        cmd.push("--schedule=");
      }
      if (this.state.agmtBindMethod !== this.state._agmtBindMethod) {
        cmd.push("--bind-method=" + this.state.agmtBindMethod);
      }
      if (this.state.agmtProtocol !== this.state._agmtProtocol) {
        cmd.push("--conn-protocol=" + this.state.agmtProtocol);
      }
      if (this.state.agmtBindPW !== this.state._agmtBindPW) {
        passwd = this.state.agmtBindPW;
      }
      if (this.state.agmtBindDN !== this.state._agmtBindDN) {
        cmd.push("--bind-dn=" + this.state.agmtBindDN);
      }
      if (this.state.agmtFracAttrs !== this.state._agmtFracAttrs) {
        cmd.push("--frac-list=" + this.state.agmtFracAttrs.join(" "));
      }
      if (this.state.agmtFracInitAttrs !== this.state._agmtFracInitAttrs) {
        cmd.push("--frac-list-total=" + this.state.agmtFracInitAttrs.join(" "));
      }
      if (this.state.agmtStripAttrs !== this.state._agmtStripAttrs) {
        cmd.push("--strip-list=" + this.state.agmtStripAttrs.join(" "));
      }
      if (this.state.agmtHost !== this.state._agmtHost) {
        cmd.push("--host=" + this.state.agmtHost);
      }
      if (this.state.agmtPort !== this.state._agmtPort) {
        cmd.push("--port=" + this.state.agmtPort);
      }
      if (this.state.agmtBootstrap) {
        if (this.state.agmtBootstrapBindMethod !== this.state._agmtBootstrapBindMethod) {
          cmd.push("--bootstrap-bind-method=" + this.state.agmtBootstrapBindMethod);
        }
        if (this.state.agmtBootstrapProtocol !== this.state._agmtBootstrapProtocol) {
          cmd.push("--bootstrap-conn-protocol=" + this.state.agmtBootstrapProtocol);
        }
        if (this.state.agmtBootstrapBindPW !== this.state._agmtBootstrapBindPW) {
          bootstrap_passwd = this.state.agmtBootstrapBindPW;
        }
        if (this.state.agmtBootstrapBindDN !== this.state._agmtBootstrapBindDN) {
          cmd.push("--bootstrap-bind-dn=" + this.state.agmtBootstrapBindDN);
        }
      }
      this.setState({
        savingAgmt: true
      });
      if (passwd !== "") {
        cmd.push("--bind-passwd-prompt");
      }
      if (bootstrap_passwd !== "") {
        cmd.push("--bootstrap-bind-passwd-prompt");
      }
      log_cmd("saveAgmt", "edit agmt", cmd);
      let buffer = "";
      let error = null;
      const proc = cockpit_default.spawn(cmd, { pty: true, environ: ["LC_ALL=C"], superuser: true, err: "message" });
      proc.done((data) => {
        this.props.reload(this.props.suffix);
        if (this._mounted) {
          this.setState({
            savingAgmt: false,
            showEditAgmtModal: false
          });
        }
        this.props.addNotification(
          "success",
          _63("Successfully updated replication agreement")
        );
      }).fail(() => {
        const errMsg = getApiErrorMessage(error);
        this.props.addNotification(
          "error",
          cockpit_default.format(_63("Failed to update replication agreement - $0"), errMsg)
        );
        this.setState({
          savingAgmt: false
        });
      }).stream((data) => {
        try {
          JSON.parse(data);
          error = data;
          return;
        } catch (e) {
        }
        buffer += data;
        const lines = buffer.split("\n");
        const last_line = lines[lines.length - 1].toLowerCase();
        if (bootstrap_passwd !== "") {
          proc.input(bootstrap_passwd + "\n", true);
        } else {
          proc.input(passwd + "\n", true);
        }
      });
    }
    pokeAgmt(agmtName) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "poke",
        agmtName,
        "--suffix=" + this.props.suffix
      ];
      log_cmd("pokeAgmt", "send updates now", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          _63("Successfully poked replication agreement")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_63("Failed to poke replication agreement - $0"), errMsg)
        );
      });
    }
    initAgmt(agmtName) {
      this.setState({
        modalSpinning: true
      });
      const init_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "init",
        "--suffix=" + this.props.suffix,
        this.state.agmtName
      ];
      log_cmd("initAgmt", "Initialize agreement", init_cmd);
      cockpit_default.spawn(init_cmd, { superuser: true, err: "message" }).done((content) => {
        const agmtIntervalCount = this.state.agmtInitCounter + 1;
        const intervals = this.state.agmtInitIntervals;
        this.props.reload(this.props.suffix);
        intervals[agmtIntervalCount] = setInterval(this.watchAgmtInit, 2e3, this.state.agmtName, agmtIntervalCount);
        if (this._mounted) {
          this.setState({
            agmtInitCounter: agmtIntervalCount,
            agmtInitIntervals: intervals,
            showConfirmInitAgmt: false
          });
        }
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_63("Failed to initialize replication agreement - $0"), errMsg)
        );
        this.setState({
          showConfirmInitAgmt: false
        });
      });
    }
    confirmToggle(agmtName, state) {
      if (state === "Enabled") {
        this.setState({
          agmtName,
          showConfirmDisableAgmt: true,
          modalChecked: false,
          modalSpinning: false
        });
      } else {
        this.setState({
          agmtName,
          showConfirmEnableAgmt: true,
          modalChecked: false,
          modalSpinning: false
        });
      }
    }
    closeConfirmEnableAgmt() {
      this.setState({
        showConfirmEnableAgmt: false
      });
    }
    closeConfirmDisableAgmt() {
      this.setState({
        showConfirmDisableAgmt: false
      });
    }
    enableAgmt() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "enable",
        this.state.agmtName,
        "--suffix=" + this.props.suffix
      ];
      log_cmd("enableAgmt", "enable agmt", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          _63("Successfully enabled replication agreement")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_63("Failed to enabled replication agreement - $0"), errMsg)
        );
      });
    }
    disableAgmt() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "disable",
        this.state.agmtName,
        "--suffix=" + this.props.suffix
      ];
      log_cmd("disableAgmt", "Disable agmt", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          _63("Successfully disabled replication agreement")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_63("Failed to disable replication agreement - $0"), errMsg)
        );
      });
    }
    deleteAgmt() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "delete",
        "--suffix=" + this.props.suffix,
        this.state.agmtName
      ];
      log_cmd("deleteAgmt", "Delete agmt", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          _63("Successfully deleted replication agreement")
        );
        this.setState({
          showConfirmDeleteAgmt: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_63("Failed to delete replication agreement - $0"), errMsg)
        );
        this.setState({
          showConfirmDeleteAgmt: false
        });
      });
    }
    createAgmt() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "create",
        this.state.agmtName,
        "--suffix=" + this.props.suffix,
        "--host=" + this.state.agmtHost,
        "--port=" + this.state.agmtPort,
        "--bind-method=" + this.state.agmtBindMethod,
        "--conn-protocol=" + this.state.agmtProtocol,
        "--bind-dn=" + this.state.agmtBindDN
      ];
      let passwd = "";
      let bootstrap_passwd = "";
      if (this.state.agmtBindPW !== "") {
        passwd = this.state.agmtBindPW;
      }
      if (this.state.agmtSync) {
        let agmt_days = "";
        if (this.state.agmtSyncSun) {
          agmt_days += "0";
        }
        if (this.state.agmtSyncMon) {
          agmt_days += "1";
        }
        if (this.state.agmtSyncTue) {
          agmt_days += "2";
        }
        if (this.state.agmtSyncWed) {
          agmt_days += "3";
        }
        if (this.state.agmtSyncThu) {
          agmt_days += "4";
        }
        if (this.state.agmtSyncFri) {
          agmt_days += "5";
        }
        if (this.state.agmtSyncSat) {
          agmt_days += "6";
        }
        cmd.push("--schedule=" + this.state.agmtStartTime.replace(":", "") + "-" + this.state.agmtEndTime.replace(":", "") + " " + agmt_days);
      }
      if (this.state.agmtFracAttrs.length > 0) {
        cmd.push("--frac-list=" + this.state.agmtFracAttrs.join(" "));
      }
      if (this.state.agmtFracInitAttrs.length > 0) {
        cmd.push("--frac-list-total=" + this.state.agmtFracInitAttrs.join(" "));
      }
      if (this.state.agmtStripAttrs.length > 0) {
        cmd.push("--strip-list=" + this.state.agmtStripAttrs.join(" "));
      }
      if (this.state.agmtBootstrap) {
        if (this.state.agmtBootstrapBindDN !== "") {
          cmd.push("--bootstrap-bind-dn=" + this.state.agmtBootstrapBindDN);
        }
        if (this.state.agmtBootstrapBindPW !== "") {
          bootstrap_passwd = this.state.agmtBootstrapBindPW;
        }
        if (this.state.agmtBootstrapBindMethod !== "") {
          cmd.push("--bootstrap-bind-method=" + this.state.agmtBootstrapBindMethod);
        }
        if (this.state.agmtBootstrapProtocol !== "") {
          cmd.push("--bootstrap-conn-protocol=" + this.state.agmtBootstrapProtocol);
        }
      }
      this.setState({
        savingAgmt: true
      });
      if (passwd !== "") {
        cmd.push("--bind-passwd-prompt");
      }
      if (bootstrap_passwd !== "") {
        cmd.push("--bootstrap-bind-passwd-prompt");
      }
      log_cmd("createAgmt", "Create agmt", cmd);
      let buffer = "";
      let error = null;
      const proc = cockpit_default.spawn(cmd, { pty: true, environ: ["LC_ALL=C"], superuser: true, err: "message" });
      proc.done((data) => {
        this.props.reload(this.props.suffix);
        if (this._mounted) {
          this.setState({
            savingAgmt: false,
            showCreateAgmtModal: false
          });
        }
        this.props.addNotification(
          "success",
          _63("Successfully created replication agreement")
        );
        if (this.state.agmtInit === "online-init") {
          this.initAgmt(this.state.agmtName);
        }
      }).fail(() => {
        const errMsg = getApiErrorMessage(error);
        this.props.addNotification(
          "error",
          cockpit_default.format(_63("Failed to create replication agreement - $0"), errMsg)
        );
        this.setState({
          savingAgmt: false
        });
      }).stream((data) => {
        try {
          JSON.parse(data);
          error = data;
          return;
        } catch (e) {
        }
        buffer += data;
        const lines = buffer.split("\n");
        const last_line = lines[lines.length - 1].toLowerCase();
        if (bootstrap_passwd !== "") {
          proc.input(bootstrap_passwd + "\n", true);
        } else {
          proc.input(passwd + "\n", true);
        }
      });
    }
    watchAgmtInit(agmtName, idx) {
      const status_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "init-status",
        "--suffix=" + this.props.suffix,
        agmtName
      ];
      log_cmd("watchAgmtInit", "Get initialization status for agmt", status_cmd);
      cockpit_default.spawn(status_cmd, { superuser: true, err: "message" }).done((data) => {
        const init_status = JSON.parse(data);
        if (init_status.startsWith("Agreement successfully initialized") || init_status.startsWith("Agreement initialization failed")) {
          clearInterval(this.state.agmtInitIntervals[idx]);
          this.props.reload(this.props.suffix);
        }
      });
    }
    onSort(_event, index, direction) {
      const sortedRows = this.state.rows.sort((a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0);
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    onSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      for (const row of this.props.rows) {
        if (val !== "" && row[0].indexOf(val) === -1 && row[1].indexOf(val) === -1 && row[2].indexOf(val) === -1) {
          continue;
        }
        rows.push([row[0], row[1], row[2], row[3], row[4], row[5]]);
      }
      if (val === "") {
        rows = JSON.parse(JSON.stringify(this.props.rows));
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "ds-margin-right ds-margin-bottom-md", children: [
        /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
          ReplAgmtTable,
          {
            rows: this.state.rows,
            edit: this.showEditAgmt,
            poke: this.pokeAgmt,
            init: this.showConfirmInitAgmt,
            enable: this.confirmToggle,
            delete: this.showConfirmDeleteAgmt,
            page: this.state.page,
            handleSort: this.onSort,
            sortBy: this.state.sortBy,
            handleSearch: this.onSearchChange,
            value: this.state.value
          },
          this.state.rows
        ),
        /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "ds-margin-top ds-container ds-inline", children: [
          /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
            Button,
            {
              variant: "primary",
              onClick: this.handleShowCreateAgmtModal,
              children: _63("Create Agreement")
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
            Button,
            {
              className: "ds-left-margin",
              variant: "secondary",
              onClick: () => {
                this.props.reload(this.props.suffix);
              },
              children: _63("Refresh Agreements")
            }
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
          ReplAgmtModal,
          {
            showModal: this.state.showCreateAgmtModal,
            closeHandler: this.closeCreateAgmtModal,
            handleChange: this.onCreateChange,
            handleTimeChange: this.onTimeChange,
            handleStripChange: this.onTAStripAttrChange,
            handleFracChange: this.onTAFracAttrChange,
            handleFracInitChange: this.onTAFracInitAttrChange,
            onExcludeAttrsToggle: this.handleExcludeAttrsCreateToggle,
            onExcludeAttrsClear: this.handleExcludeAttrsCreateClear,
            onExcludeAttrsInitToggle: this.handleExcludeAttrsInitCreateToggle,
            onExcludeAttrsInitClear: this.handleExcludeAttrsInitCreateClear,
            onStripAttrsToggle: this.onStripAttrsCreateToggle,
            onStripAttrsClear: this.handleStripAttrsCreateClear,
            isExcludeAttrsOpen: this.state.isExcludeAttrsCreateOpen,
            isExcludeInitAttrsOpen: this.state.isExcludeInitAttrsCreateOpen,
            isStripAttrsOpen: this.state.isStripAttrsCreateOpen,
            saveHandler: this.createAgmt,
            spinning: this.state.savingAgmt,
            agmtName: this.state.agmtName,
            agmtHost: this.state.agmtHost,
            agmtPort: this.state.agmtPort,
            agmtBindDN: this.state.agmtBindDN,
            agmtBindPW: this.state.agmtBindPW,
            agmtBindPWConfirm: this.state.agmtBindPWConfirm,
            agmtProtocol: this.state.agmtProtocol,
            agmtBindMethod: this.state.agmtBindMethod,
            agmtBindMethodOptions: this.state.agmtBindMethodOptions,
            agmtBootstrap: this.state.agmtBootstrap,
            agmtBootstrapBindDN: this.state.agmtBootstrapBindDN,
            agmtBootstrapBindPW: this.state.agmtBootstrapBindPW,
            agmtBootstrapBindPWConfirm: this.state.agmtBootstrapBindPWConfirm,
            agmtBootstrapProtocol: this.state.agmtBootstrapProtocol,
            agmtBootstrapBindMethod: this.state.agmtBootstrapBindMethod,
            agmtBootstrapBindMethodOptions: this.state.agmtBootstrapBindMethodOptions,
            agmtStripAttrs: this.state.agmtStripAttrs,
            agmtFracAttrs: this.state.agmtFracAttrs,
            agmtFracInitAttrs: this.state.agmtFracInitAttrs,
            agmtSync: this.state.agmtSync,
            agmtSyncMon: this.state.agmtSyncMon,
            agmtSyncTue: this.state.agmtSyncTue,
            agmtSyncWed: this.state.agmtSyncWed,
            agmtSyncThu: this.state.agmtSyncThu,
            agmtSyncFri: this.state.agmtSyncFri,
            agmtSyncSat: this.state.agmtSyncSat,
            agmtSyncSun: this.state.agmtSyncSun,
            agmtStartTime: this.state.agmtStartTime,
            agmtEndTime: this.state.agmtEndTime,
            agmtInit: this.state.agmtInit,
            availAttrs: this.props.attrs,
            error: this.state.errObj,
            saveOK: this.state.agmtSaveOK
          },
          this.state.showCreateAgmtModal ? "create1" : "create0"
        ),
        /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
          ReplAgmtModal,
          {
            showModal: this.state.showEditAgmtModal,
            closeHandler: this.closeEditAgmtModal,
            handleChange: this.onEditChange,
            handleTimeChange: this.onTimeChange,
            handleStripChange: this.onTAStripAttrChangeEdit,
            handleFracChange: this.onTAFracAttrChangeEdit,
            handleFracInitChange: this.onTAFracInitAttrChangeEdit,
            onExcludeAttrsToggle: this.handleExcludeAttrsEditToggle,
            onExcludeAttrsClear: this.handleExcludeAttrsEditClear,
            onExcludeAttrsInitToggle: this.handleExcludeAttrsInitEditToggle,
            onExcludeAttrsInitClear: this.handleExcludeAttrsInitEditClear,
            onStripAttrsToggle: this.onStripAttrsEditToggle,
            onStripAttrsClear: this.handleStripAttrsEditClear,
            isExcludeAttrsOpen: this.state.isExcludeAttrsEditOpen,
            isExcludeInitAttrsOpen: this.state.isExcludeInitAttrsEditOpen,
            isStripAttrsOpen: this.state.isStripAttrsEditOpen,
            saveHandler: this.saveAgmt,
            spinning: this.state.savingAgmt,
            agmtName: this.state.agmtName,
            agmtHost: this.state.agmtHost,
            agmtPort: this.state.agmtPort,
            agmtBindDN: this.state.agmtBindDN,
            agmtBindPW: this.state.agmtBindPW,
            agmtBindPWConfirm: this.state.agmtBindPWConfirm,
            agmtProtocol: this.state.agmtProtocol,
            agmtBindMethod: this.state.agmtBindMethod,
            agmtBindMethodOptions: this.state.agmtBindMethodOptions,
            agmtBootstrap: this.state.agmtBootstrap,
            agmtBootstrapBindDN: this.state.agmtBootstrapBindDN,
            agmtBootstrapBindPW: this.state.agmtBootstrapBindPW,
            agmtBootstrapBindPWConfirm: this.state.agmtBootstrapBindPWConfirm,
            agmtBootstrapProtocol: this.state.agmtBootstrapProtocol,
            agmtBootstrapBindMethod: this.state.agmtBootstrapBindMethod,
            agmtBootstrapBindMethodOptions: this.state.agmtBootstrapBindMethodOptions,
            agmtStripAttrs: this.state.agmtStripAttrs,
            agmtFracAttrs: this.state.agmtFracAttrs,
            agmtFracInitAttrs: this.state.agmtFracInitAttrs,
            agmtSync: this.state.agmtSync,
            agmtSyncMon: this.state.agmtSyncMon,
            agmtSyncTue: this.state.agmtSyncTue,
            agmtSyncWed: this.state.agmtSyncWed,
            agmtSyncThu: this.state.agmtSyncThu,
            agmtSyncFri: this.state.agmtSyncFri,
            agmtSyncSat: this.state.agmtSyncSat,
            agmtSyncSun: this.state.agmtSyncSun,
            agmtStartTime: this.state.agmtStartTime,
            agmtEndTime: this.state.agmtEndTime,
            agmtInit: this.state.agmtInit,
            availAttrs: this.props.attrs,
            error: this.state.errObj,
            saveOK: this.state.agmtSaveOK,
            edit: true
          },
          this.state.showEditAgmtModal ? "edit1" : "edit0"
        ),
        /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDeleteAgmt,
            closeHandler: this.closeConfirmDeleteAgmt,
            handleChange: this.onModalChange,
            actionHandler: this.deleteAgmt,
            spinning: this.state.modalSpinning,
            item: this.state.agmtName,
            checked: this.state.modalChecked,
            mTitle: _63("Delete Replication Agreement"),
            mMsg: _63("Are you sure you want to delete this replication agreement?"),
            mSpinningMsg: _63("Deleting Replication Agreement ..."),
            mBtnName: _63("Delete Agreement")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmInitAgmt,
            closeHandler: this.closeConfirmInitAgmt,
            handleChange: this.onModalChange,
            actionHandler: this.initAgmt,
            spinning: this.state.modalSpinning,
            item: this.state.agmtName,
            checked: this.state.modalChecked,
            mTitle: _63("Initialize Replication Agreement"),
            mMsg: _63("Are you sure you want to initialize this replication agreement?"),
            mSpinningMsg: _63("Initializing Replication Agreement ..."),
            mBtnName: _63("Initialize Agreement")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmEnableAgmt,
            closeHandler: this.closeConfirmEnableAgmt,
            handleChange: this.onModalChange,
            actionHandler: this.enableAgmt,
            spinning: this.state.modalSpinning,
            item: this.state.agmtName,
            checked: this.state.modalChecked,
            mTitle: _63("Enable Replication Agreement"),
            mMsg: _63("Are you sure you want to enable this replication agreement?"),
            mSpinningMsg: _63("Enabling ..."),
            mBtnName: _63("Enable Agreement")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDisableAgmt,
            closeHandler: this.closeConfirmDisableAgmt,
            handleChange: this.onModalChange,
            actionHandler: this.disableAgmt,
            spinning: this.state.modalSpinning,
            item: this.state.agmtName,
            checked: this.state.modalChecked,
            mTitle: _63("Disable Replication Agreement"),
            mMsg: _63("Are you sure you want to disable this replication agreement?"),
            mSpinningMsg: _63("Disabling ..."),
            mBtnName: _63("Disable Agreement")
          }
        )
      ] });
    }
  };
  ReplAgmts.propTypes = {
    suffix: import_prop_types62.default.string,
    serverId: import_prop_types62.default.string,
    rows: import_prop_types62.default.array,
    addNotification: import_prop_types62.default.func,
    attrs: import_prop_types62.default.array
  };
  ReplAgmts.defaultProps = {
    serverId: "",
    suffix: "",
    rows: [],
    attrs: []
  };

  // src/lib/replication/replTasks.jsx
  var import_react134 = __toESM(require_react(), 1);
  var import_prop_types63 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1);
  var _64 = cockpit_default.gettext;
  var ReplRUV = class extends import_react134.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        errObj: {},
        rid: "",
        localRID: "",
        ldifLocation: "",
        saveOK: false,
        showConfirmCleanRUV: false,
        modalChecked: false,
        modalSpinning: false,
        showConfirmCLImport: false,
        showCLExport: false,
        defaultCL: true,
        debugCL: false,
        decodeCL: false,
        exportCSN: false,
        ldifFile: "/tmp/changelog.ldif"
      };
      this.showConfirmCleanRUV = this.showConfirmCleanRUV.bind(this);
      this.closeConfirmCleanRUV = this.closeConfirmCleanRUV.bind(this);
      this.handleShowConfirmCLImport = this.handleShowConfirmCLImport.bind(this);
      this.closeConfirmCLImport = this.closeConfirmCLImport.bind(this);
      this.handleShowCLExport = this.handleShowCLExport.bind(this);
      this.closeCLExport = this.closeCLExport.bind(this);
      this.showConfirmExport = this.showConfirmExport.bind(this);
      this.closeConfirmExport = this.closeConfirmExport.bind(this);
      this.handleLDIFChange = this.handleLDIFChange.bind(this);
      this.onCLLDIFChange = this.onCLLDIFChange.bind(this);
      this.onRadioChange = this.onRadioChange.bind(this);
      this.onChange = this.onChange.bind(this);
      this.cleanRUV = this.cleanRUV.bind(this);
      this.exportChangelog = this.exportChangelog.bind(this);
      this.importChangelog = this.importChangelog.bind(this);
    }
    showConfirmCleanRUV(rid) {
      this.setState({
        rid,
        showConfirmCleanRUV: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmCleanRUV() {
      this.setState({
        showConfirmCleanRUV: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    handleShowConfirmCLImport() {
      this.setState({
        showConfirmCLImport: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmCLImport() {
      this.setState({
        showConfirmCLImport: false,
        modalChecked: false,
        modalSpinning: false
      });
    }
    handleShowCLExport() {
      this.setState({
        saveOK: true,
        showCLExport: true,
        decodeCL: false,
        defaultCL: true,
        debugCL: false,
        exportChangelog: false,
        ldifFile: "/tmp/changelog.ldif"
      });
    }
    closeCLExport() {
      this.setState({
        showCLExport: false
      });
    }
    showConfirmExport() {
      this.setState({
        saveOK: false,
        showConfirmExport: true,
        ldifLocation: ""
      });
    }
    closeConfirmExport() {
      this.setState({
        showConfirmExport: false
      });
    }
    onRadioChange(e, _113) {
      let defaultCL = false;
      let debugCL = false;
      if (e.target.id === "defaultCL") {
        defaultCL = true;
      } else if (e.target.id === "debugCL") {
        debugCL = true;
      }
      this.setState({
        defaultCL,
        debugCL
      });
    }
    cleanRUV() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-tasks",
        "cleanallruv",
        "--replica-id=" + this.state.rid,
        "--force-cleaning",
        "--suffix=" + this.props.suffix
      ];
      log_cmd("cleanRUV", "Clean the rid", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(this.props.suffix);
        this.props.addNotification(
          "success",
          _64("Successfully started CleanAllRUV task")
        );
        this.closeConfirmCleanRUV();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_64("Failed to start CleanAllRUV task - $0"), errMsg)
        );
        this.closeConfirmCleanRUV();
      });
    }
    handleLDIFChange(e) {
      const value = e.target.value;
      let saveOK = true;
      if (value === "" || bad_file_name(value)) {
        saveOK = false;
      }
      this.setState({
        [e.target.id]: value,
        saveOK
      });
    }
    onCLLDIFChange(e) {
      const value = e.target.value;
      let saveOK = true;
      if (value === "" || value.indexOf(" ") >= 0) {
        saveOK = false;
      }
      this.setState({
        [e.target.id]: value,
        saveOK
      });
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    importChangelog() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "import-changelog",
        "default",
        "--replica-root",
        this.props.suffix
      ];
      this.setState({
        modalSpinning: true
      });
      log_cmd("importChangelog", "Import relication changelog via LDIF", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          _64("Changelog was successfully initialized")
        );
        this.setState({
          showConfirmCLImport: false,
          modalSpinning: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_64("Error importing changelog LDIF - $0"), errMsg)
        );
        this.setState({
          showConfirmCLImport: false,
          modalSpinning: false
        });
      });
    }
    exportChangelog() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "export-changelog"
      ];
      if (this.state.defaultCL) {
        cmd.push("default");
      } else {
        cmd.push("to-ldif");
        if (this.state.exportCSN) {
          cmd.push("--csn-only");
        }
        if (this.state.decodeCL) {
          cmd.push("--decode");
        }
        if (this.state.ldifFile) {
          cmd.push("--output-file=" + this.state.ldifFile);
        }
      }
      cmd.push("--replica-root=" + this.props.suffix);
      this.setState({
        exportSpinner: true
      });
      log_cmd("exportChangelog", "Import relication changelog via LDIF", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.addNotification(
          "success",
          _64("Changelog was successfully exported")
        );
        this.setState({
          showCLExport: false,
          exportSpinner: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_64("Error importing changelog LDIF - $0"), errMsg)
        );
        this.setState({
          showCLExport: false,
          exportSpinner: false
        });
      });
    }
    render() {
      const remote_rows = [];
      let localRID = "";
      let localURL = "";
      let localCSN = "";
      let localRawCSN = "";
      let localMinCSN = "";
      let localRawMinCSN = "";
      for (const row of this.props.rows) {
        if (row.rid === this.props.localRID) {
          localRID = row.rid;
          localURL = row.url;
          localCSN = row.maxcsn;
          localRawCSN = row.raw_maxcsn;
          localMinCSN = row.csn;
          localRawMinCSN = row.raw_csn;
        } else {
          remote_rows.push(row);
        }
      }
      let localRUV = /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "ds-left-indent-md", children: [
        /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Grid, { className: "ds-margin-top-med", children: [
          /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(GridItem, { span: 2, children: _64("Replica ID") }),
          /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("b", { children: localRID }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(GridItem, { span: 2, children: _64("LDAP URL") }),
          /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("b", { children: localURL }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(GridItem, { span: 2, children: _64("Min CSN") }),
          /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(GridItem, { span: 10, children: [
            /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("b", { children: localMinCSN }),
            " (",
            localRawMinCSN,
            ")"
          ] })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(GridItem, { span: 2, children: _64("Max CSN") }),
          /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(GridItem, { span: 10, children: [
            /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("b", { children: localCSN }),
            " (",
            localRawCSN,
            ")"
          ] })
        ] })
      ] });
      if (localRID === "") {
        localRUV = /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "ds-indent ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("i", { children: _64("There is no local RUV, the database might not have been initialized yet.") }) });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "ds-margin-top-xlg ds-indent", children: [
        /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Text, { component: TextVariants.h3, children: [
          _64("Local RUV"),
          /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _64("Refresh the RUV for this suffix"),
              onClick: () => {
                this.props.reload(this.props.suffix);
              },
              children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }),
        localRUV,
        /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(TextContent, { className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Text, { component: TextVariants.h3, children: [
          _64("Remote RUV's"),
          /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _64("Refresh the remote RUVs for this suffix"),
              onClick: () => {
                this.props.reload(this.props.suffix);
              },
              children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "ds-left-indent-md", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
          RUVTable,
          {
            rows: remote_rows,
            confirmDelete: this.showConfirmCleanRUV
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(TextContent, { className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Text, { component: TextVariants.h3, children: _64("Replication Change Log Tasks") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Form, { className: "ds-margin-top-lg ds-left-indent-md", isHorizontal: true, autoComplete: "off", children: [
          /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Grid, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
              GridItem,
              {
                span: 3,
                title: _64("Export the changelog to an LDIF file.  Typically used for changelog encryption purposes, or debugging."),
                children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
                  Button,
                  {
                    variant: "primary",
                    onClick: this.handleShowCLExport,
                    children: _64("Export Changelog")
                  }
                )
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "ds-margin-top", children: _64("Export the replication changelog to a LDIF file.  Used for preparing to encrypt the changelog, or simply for debugging.") }) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
              GridItem,
              {
                span: 3,
                title: _64("Initialize the changelog with an LDIF file for changelog encryption purposes."),
                children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
                  Button,
                  {
                    variant: "primary",
                    onClick: this.handleShowConfirmCLImport,
                    children: _64("Import Changelog")
                  }
                )
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "ds-margin-top", children: _64("Initialize the replication changelog from an LDIF file.  Used to initialize the change log after encryption has been enabled.") }) })
          ] })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("hr", {}),
        /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmCleanRUV,
            closeHandler: this.closeConfirmCleanRUV,
            handleChange: this.onChange,
            actionHandler: this.cleanRUV,
            spinning: this.state.modalSpinning,
            item: "Replica ID " + this.state.rid,
            checked: this.state.modalChecked,
            mTitle: _64("Remove RUV Element (CleanAllRUV)"),
            mMsg: _64("Are you sure you want to attempt to clean this Replica ID from the suffix?"),
            mSpinningMsg: _64("Starting cleaning task (CleanAllRUV) ..."),
            mBtnName: _64("Remove RUV Element")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmCLImport,
            closeHandler: this.closeConfirmCLImport,
            handleChange: this.onChange,
            actionHandler: this.importChangelog,
            spinning: this.state.modalSpinning,
            item: "Replicated Suffix " + this.props.suffix,
            checked: this.state.modalChecked,
            mTitle: _64("Initialize Replication Changelog From LDIF"),
            mMsg: _64("Are you sure you want to attempt to initialize the changelog from LDIF?  This will reject all operations during during the initialization."),
            mSpinningMsg: _64("Initializing Replication Change Log ..."),
            mBtnName: _64("Import Changelog LDIF")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
          ExportCLModal,
          {
            showModal: this.state.showCLExport,
            closeHandler: this.closeCLExport,
            handleChange: this.onChange,
            handleLDIFChange: this.onCLLDIFChange,
            handleRadioChange: this.onRadioChange,
            saveHandler: this.exportChangelog,
            defaultCL: this.state.defaultCL,
            debugCL: this.state.debugCL,
            decodeCL: this.state.decodeCL,
            exportCSN: this.state.exportCSN,
            ldifFile: this.state.ldifFile,
            spinning: this.state.exportSpinner,
            saveOK: this.state.saveOK
          }
        )
      ] });
    }
  };
  ReplRUV.propTypes = {
    suffix: import_prop_types63.default.string,
    serverId: import_prop_types63.default.string,
    rows: import_prop_types63.default.array,
    addNotification: import_prop_types63.default.func,
    localRID: import_prop_types63.default.string,
    reload: import_prop_types63.default.func
  };
  ReplRUV.defaultProps = {
    serverId: "",
    suffix: "",
    rows: [],
    localRID: ""
  };

  // src/lib/replication/replSuffix.jsx
  var import_prop_types64 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1);
  var _65 = cockpit_default.gettext;
  var ReplSuffix = class extends import_react135.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: false,
        activeTabKey: 0,
        showDisableConfirm: false,
        replicationEnabled: false,
        errObj: {},
        replEnabled: this.props.replicated,
        // Enable replication settings
        showEnableReplModal: false,
        enableRole: "Supplier",
        enableRID: 1,
        enableBindDN: "cn=replication manager,cn=config",
        enableBindPW: "",
        enableBindPWConfirm: "",
        enableBindGroupDN: "",
        enableSpinning: false,
        disabled: true,
        // Disable repl enable button
        // Disable replication
        showDisableReplModal: false,
        disableChecked: false,
        disableSpinning: false,
        modalChecked: false,
        modalSpinning: false
      };
      this.handleMinusChange = () => {
        this.setState({
          enableRID: Number(this.state.enableRID) - 1
        });
      };
      this.handleNumberChange = (event) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          enableRID: newValue > 65534 ? 65534 : newValue < 1 ? 1 : newValue
        });
      };
      this.handlePlusChange = () => {
        this.setState({
          enableRID: Number(this.state.enableRID) + 1
        });
      };
      this.handleNavSelect = (event, tabIndex) => {
        event.preventDefault();
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleReplChange = this.handleReplChange.bind(this);
      this.onEnableChange = this.onEnableChange.bind(this);
      this.validateEnable = this.validateEnable.bind(this);
      this.onChange = this.onChange.bind(this);
      this.handleNavSelect = this.handleNavSelect.bind(this);
      this.disableReplication = this.disableReplication.bind(this);
      this.enableReplication = this.enableReplication.bind(this);
      this.closeEnableReplModal = this.closeEnableReplModal.bind(this);
      this.closeDisableReplModal = this.closeDisableReplModal.bind(this);
    }
    componentDidMount() {
      this.props.enableTree();
    }
    handleNavSelect(key) {
      this.setState({ activeKey: key });
    }
    handleReplChange() {
      if (this.props.replicated) {
        this.setState({
          showDisableReplModal: true,
          modalChecked: false,
          modalSpinning: false
        });
      } else {
        this.setState({
          showEnableReplModal: true,
          enableSpinning: false
        });
      }
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj
      });
    }
    validateEnable() {
      const errObj = {};
      let all_good = true;
      const dnAttrs = ["enableBindDN", "enableBindGroupDN"];
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && (!valid_dn(this.state[attr]) || !this.state[attr].includes(","))) {
          all_good = false;
          errObj[attr] = true;
        }
      }
      if (this.state.enableBindDN) {
        if (this.state.enableBindPW === "" || this.state.enableBindPW !== this.state.enableBindPWConfirm) {
          errObj.enableBindPW = true;
          errObj.enableBindPWConfirm = true;
          all_good = false;
        }
      }
      this.setState({
        errObj,
        disabled: !all_good
      });
    }
    onEnableChange(e) {
      const value = e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateEnable();
      });
    }
    closeEnableReplModal() {
      this.setState({
        showEnableReplModal: false
      });
    }
    enableReplication() {
      if (this.state.enableBindDN !== "" && !valid_dn(this.state.enableBindDN)) {
        this.props.addNotification(
          "error",
          cockpit_default.format(_65("The Bind DN is not a valid DN (Distinguished Name) $0"), this.state.enableBindDN)
        );
        return;
      }
      if (this.state.enableBindGroupDN !== "" && !valid_dn(this.state.enableBindGroupDN)) {
        this.props.addNotification(
          "error",
          _65("The Group DN is not a valid DN (Distinguished Name)")
        );
        return;
      }
      if (this.state.enableBindPW !== this.state.enableBindPWConfirm) {
        this.props.addNotification(
          "error",
          _65("The Bind DN passwords do not match")
        );
        return;
      }
      if (this.state.enableRID !== "" && (this.state.enableRID < 1 || this.state.enableRID > 65534)) {
        this.props.addNotification(
          "error",
          _65("The Replica ID is not in the valid range of 1 - 65534")
        );
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "enable",
        "--suffix=" + this.props.suffix,
        "--role=" + this.state.enableRole
      ];
      let passwd = "";
      if (this.state.enableBindDN !== "") {
        cmd.push("--bind-dn=" + this.state.enableBindDN);
      }
      if (this.state.enableBindPW !== "") {
        passwd = this.state.enableBindPW;
      }
      if (this.state.enableBindGroupDN !== "") {
        cmd.push("--bind-group-dn=" + this.state.enableBindGroupDN);
      }
      if (this.state.enableRole === "Supplier") {
        cmd.push("--replica-id=" + this.state.enableRID);
      }
      this.setState({
        enableSpinning: true
      });
      this.props.disableTree();
      const config = {
        cmd,
        promptArg: "--bind-passwd-prompt",
        passwd,
        addNotification: this.props.addNotification,
        success_msg: cockpit_default.format(_65("Successfully enabled replication for $0"), this.props.suffix),
        error_msg: cockpit_default.format(_65("Failed to enable replication for $0"), this.props.suffix),
        state_callback: () => {
        },
        reload_func: this.props.reload,
        reload_arg: "1",
        funcName: "enableReplication",
        funcDesc: "Enable replication"
      };
      callCmdStreamPassword(config);
    }
    closeDisableReplModal() {
      this.setState({
        showDisableReplModal: false
      });
    }
    disableReplication() {
      this.props.disableTree();
      this.setState({
        modalSpinning: true
      });
      const cmd = ["dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket", "replication", "disable", "--suffix=" + this.props.suffix];
      log_cmd("disableReplication", "Disable replication", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload(1);
        this.setState({
          modalSpinning: false
        });
        this.props.addNotification(
          "success",
          cockpit_default.format(_65("Successfully disabled replication for $0"), this.props.suffix)
        );
      }).fail((err) => {
        this.props.reload(1);
        this.setState({
          modalSpinning: false
        });
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_65("Failed to disable replication for $0 - $1"), this.props.suffix, errMsg)
        );
      });
    }
    //
    // Render the component
    //
    render() {
      let spinning = "";
      let spintext = "";
      let SuffixIcon = TreeIcon;
      if (this.props.replicated) {
        SuffixIcon = CloneIcon;
      } else {
        if (this.props.repl === "subsuffix") {
          SuffixIcon = LeafIcon;
        }
      }
      if (this.props.spinning) {
        spinning = /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Spinner, { className: "ds-margin-top ds-margin-left ds-inline-spinner", size: "sm" });
        spintext = /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("font", { size: "2", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("i", { children: _65("Refreshing") }) });
      }
      let suffixClass = "ds-margin-top-lg";
      if (this.props.disabled) {
        suffixClass = "ds-margin-top-lg ds-disabled";
      }
      let enabledContent = /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: suffixClass, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Tabs, { isFilled: true, activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
        /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(TabTitleText, { children: _65("Configuration") }), children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
          ReplConfig,
          {
            suffix: this.props.suffix,
            role: this.props.role,
            data: this.props.data,
            serverId: this.props.serverId,
            addNotification: this.props.addNotification,
            reload: this.props.reload,
            reloadConfig: this.props.reloadConfig
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(TabTitleText, { children: [
          _65("Agreements "),
          /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("font", { size: "2", children: [
            "(",
            this.props.agmtRows.length,
            ")"
          ] })
        ] }), children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
          ReplAgmts,
          {
            suffix: this.props.suffix,
            serverId: this.props.serverId,
            rows: this.props.agmtRows,
            addNotification: this.props.addNotification,
            reload: this.props.reloadAgmts,
            attrs: this.props.attrs,
            disableTable: this.props.disableAgmtTable
          },
          this.props.agmtRows
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(TabTitleText, { children: [
          _65("Winsync Agreements "),
          /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("font", { size: "2", children: [
            "(",
            this.props.winsyncRows.length,
            ")"
          ] })
        ] }), children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
          WinsyncAgmts,
          {
            suffix: this.props.suffix,
            serverId: this.props.serverId,
            rows: this.props.winsyncRows,
            addNotification: this.props.addNotification,
            reload: this.props.reloadWinsyncAgmts,
            attrs: this.props.attrs,
            disableTable: this.props.disableWSAgmtTable
          },
          this.props.winsyncRows
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Tab, { eventKey: 3, title: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(TabTitleText, { children: _65("Change Log") }), children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
          Changelog,
          {
            suffix: this.props.suffix,
            serverId: this.props.serverId,
            addNotification: this.props.addNotification,
            clMaxEntries: this.props.data.clMaxEntries,
            clMaxAge: this.props.data.clMaxAge,
            clTrimInt: this.props.data.clTrimInt,
            clEncrypt: this.props.data.clEncrypt
          },
          this.props.data
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Tab, { eventKey: 4, title: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(TabTitleText, { children: _65("RUV's & Tasks") }), children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
          ReplRUV,
          {
            suffix: this.props.suffix,
            serverId: this.props.serverId,
            rows: this.props.ruvRows,
            addNotification: this.props.addNotification,
            reload: this.props.reloadRUV,
            localRID: this.props.data.nsds5replicaid,
            ldifRows: this.props.ldifRows
          },
          this.props.ruvRows
        ) })
      ] }) });
      let replActionButton = "";
      if (this.props.replicated) {
        replActionButton = /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
          Button,
          {
            className: "ds-float-right",
            variant: "danger",
            onClick: this.handleReplChange,
            title: _65("Disable replication, and remove all replication agreements."),
            children: _65("Disable")
          }
        );
      } else {
        enabledContent = /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "ds-center ds-margin-top-xlg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Text, { component: TextVariants.h3, children: _65("Replication is not enabled for this suffix") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
            Button,
            {
              variant: "primary",
              onClick: this.handleReplChange,
              className: "ds-margin-top-lg",
              children: _65("Enable Replication")
            }
          )
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { id: "suffix-page", children: [
        /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(GridItem, { className: "ds-suffix-header", span: 8, children: [
            /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SuffixIcon, {}),
            "\xA0\xA0",
            this.props.suffix,
            /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
              Button,
              {
                variant: "plain",
                "aria-label": _65("Refresh replication settings for this suffix"),
                onClick: () => this.props.reload(false),
                children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SyncAltIcon, {})
              }
            ),
            spinning,
            " ",
            spintext
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(GridItem, { span: 4, children: replActionButton })
        ] }),
        enabledContent,
        /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
          EnableReplModal,
          {
            showModal: this.state.showEnableReplModal,
            closeHandler: this.closeEnableReplModal,
            handleChange: this.onEnableChange,
            saveHandler: this.enableReplication,
            spinning: this.state.enableSpinning,
            enableRole: this.state.enableRole,
            enableRID: this.state.enableRID,
            enableBindDN: this.state.enableBindDN,
            disabled: this.state.disabled,
            onMinus: this.handleMinusChange,
            onNumberChange: this.handleNumberChange,
            onPlus: this.handlePlusChange,
            error: this.state.errObj
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showDisableReplModal,
            closeHandler: this.closeDisableReplModal,
            handleChange: this.onChange,
            actionHandler: this.disableReplication,
            spinning: this.state.modalSpinning,
            item: this.props.suffix,
            checked: this.state.modalChecked,
            mTitle: _65("Disable Replication"),
            mMsg: _65("Are you sure you want to disable replication for this suffix?"),
            mSpinningMsg: _65("Disabling Replication ..."),
            mBtnName: _65("Disable Replication")
          }
        )
      ] });
    }
  };
  ReplSuffix.propTypes = {
    serverId: import_prop_types64.default.string,
    suffix: import_prop_types64.default.string,
    role: import_prop_types64.default.string,
    addNotification: import_prop_types64.default.func,
    agmtRows: import_prop_types64.default.array,
    ldifRows: import_prop_types64.default.array,
    winsyncRows: import_prop_types64.default.array,
    ruvRows: import_prop_types64.default.array,
    reloadAgmts: import_prop_types64.default.func,
    reloadRUV: import_prop_types64.default.func,
    reloadConfig: import_prop_types64.default.func,
    reload: import_prop_types64.default.func,
    replicated: import_prop_types64.default.bool,
    attrs: import_prop_types64.default.array,
    enableTree: import_prop_types64.default.func,
    disableTree: import_prop_types64.default.func,
    spinning: import_prop_types64.default.bool,
    disabled: import_prop_types64.default.bool
  };
  ReplSuffix.defaultProps = {
    serverId: "",
    suffix: "",
    role: "",
    agmtRows: [],
    winsyncRows: [],
    ruvRows: [],
    ldifRows: [],
    replicated: false,
    attrs: [],
    spinning: false,
    disabled: false
  };

  // src/replication.jsx
  var import_prop_types65 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1);
  var _66 = cockpit_default.gettext;
  var Replication = class extends import_react136.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        errObj: {},
        nodes: [],
        node_name: "",
        node_type: "",
        node_replicated: false,
        disableTree: true,
        activeItems: [],
        // Suffix
        suffixLoading: false,
        attributes: [],
        role: "",
        rid: "0",
        bindDNs: [],
        bindDNGroup: "",
        agmtRows: [],
        winsyncRows: [],
        ruvRows: [],
        suffixSpinning: false,
        disabled: false,
        clLoading: false,
        clMaxEntries: "",
        clMaxAge: "",
        clTrimInt: "",
        clEncrypt: false,
        suffixKey: 0,
        ldifRows: [],
        showDisableConfirm: false,
        loaded: false,
        suffixTreeLoaded: false,
        suffixTreeLoading: false,
        attrsLoaded: false,
        attrsLoading: false,
        replConfigLoaded: false,
        replConfigLoading: false,
        changelogLoaded: false,
        changelogLoading: false,
        agmtsLoaded: false,
        agmtsLoading: false,
        winsyncLoaded: false,
        winsyncLoading: false,
        ruvLoaded: false,
        ruvLoading: false
      };
      this.handleTreeClick = this.handleTreeClick.bind(this);
      this.handleChange = this.handleChange.bind(this);
      this.disableTree = this.disableTree.bind(this);
      this.enableTree = this.enableTree.bind(this);
      this.update_tree_nodes = this.update_tree_nodes.bind(this);
      this.reloadConfig = this.reloadConfig.bind(this);
      this.reloadAgmts = this.reloadAgmts.bind(this);
      this.reloadWinsyncAgmts = this.reloadWinsyncAgmts.bind(this);
      this.reloadRUV = this.reloadRUV.bind(this);
      this.loadAttrs = this.loadAttrs.bind(this);
      this.loadReplSuffix = this.loadReplSuffix.bind(this);
      this.reloadChangelog = this.reloadChangelog.bind(this);
      this.loadSuffixTree = this.loadSuffixTree.bind(this);
      this.loadLDIFs = this.loadLDIFs.bind(this);
      this.resetLoadProgress = this.resetLoadProgress.bind(this);
    }
    resetLoadProgress() {
      this.setState({
        loaded: false,
        suffixTreeLoaded: false,
        suffixTreeLoading: false,
        attrsLoaded: false,
        attrsLoading: false,
        replConfigLoaded: false,
        replConfigLoading: false,
        changelogLoaded: false,
        changelogLoading: false,
        agmtsLoaded: false,
        agmtsLoading: false,
        winsyncLoaded: false,
        winsyncLoading: false,
        ruvLoaded: false,
        ruvLoading: false
      }, () => {
        this.loadSuffixTree(true);
      });
    }
    componentDidUpdate(prevProps) {
      if (this.props.wasActiveList.includes(3)) {
        if (this.state.firstLoad) {
          this.resetLoadProgress();
        } else {
          if (this.props.serverId !== prevProps.serverId) {
            this.resetLoadProgress();
          }
        }
      }
    }
    reloadChangelog() {
      this.setState({
        clLoading: true
      });
      const cmd = ["dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket", "replication", "get-changelog"];
      log_cmd("reloadChangelog", "Reload the changelog", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        let clDir = "";
        let clMaxEntries = "";
        let clMaxAge = "";
        let clTrimInt = "";
        let clEncrypt = false;
        for (const attr in config.attrs) {
          const val = config.attrs[attr][0];
          if (attr === "nsslapd-changelogdir") {
            clDir = val;
          }
          if (attr === "nsslapd-changelogmaxentries") {
            clMaxEntries = val;
          }
          if (attr === "nsslapd-changelogmaxage") {
            clMaxAge = val;
          }
          if (attr === "nsslapd-changelogtrim-interval") {
            clTrimInt = val;
          }
          if (attr === "nsslapd-encryptionalgorithm") {
            clEncrypt = true;
          }
        }
        this.setState({
          clDir,
          clMaxEntries,
          clMaxAge,
          clTrimInt,
          clEncrypt,
          clLoading: false
        });
      }).fail(() => {
        this.setState({
          clDir: "",
          clMaxEntries: "",
          clMaxAge: "",
          clTrimInt: "",
          clEncrypt: false,
          clLoading: false
        });
      });
    }
    processBranch(treeBranch) {
      if (treeBranch === void 0 || treeBranch.length === 0) {
        return;
      }
      for (const sub in treeBranch) {
        if (!treeBranch[sub].type.endsWith("suffix")) {
          treeBranch.splice(sub, 1);
          continue;
        } else if (treeBranch[sub].replicated) {
          treeBranch[sub].icon = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CloneIcon, { size: "sm" });
          treeBranch[sub].replicated = true;
        }
        if (treeBranch[sub].children.length === 0) {
          delete treeBranch[sub].children;
        } else {
          this.processBranch(treeBranch[sub].children);
        }
        this.loadReplSuffix(treeBranch[sub].id);
      }
    }
    loadSuffixTree(fullReset) {
      if (this.state.firstLoad) {
        this.setState({
          firstLoad: false
        });
      }
      this.setState({
        loaded: false,
        suffixTreeLoading: true
      });
      const basicData = [
        {
          name: _66("Suffixes"),
          icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TopologyIcon, {}),
          id: "repl-suffixes",
          children: [],
          defaultExpanded: true
        }
      ];
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "backend",
        "get-tree"
      ];
      log_cmd("loadSuffixTree", "Start building the suffix tree", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        let treeData = [];
        if (content !== "") {
          treeData = JSON.parse(content);
          for (const suffix of treeData) {
            if (suffix.type === "suffix") {
              suffix.icon = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TreeIcon, { size: "sm" });
            } else if (suffix.type === "subsuffix") {
              suffix.icon = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(LeafIcon, { size: "sm" });
            }
            if (suffix.children.length === 0) {
              delete suffix.children;
            }
          }
        }
        let current_node = this.state.node_name;
        let current_type = this.state.node_type;
        let replicated = this.state.node_replicated;
        if (fullReset && treeData.length > 0) {
          let found = false;
          for (let i = 0; i < treeData.length; i++) {
            if (treeData[i].replicated) {
              treeData[i].icon = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CloneIcon, { size: "sm" });
              replicated = true;
              if (!found) {
                current_node = treeData[i].id;
                current_type = treeData[i].type;
                this.setState({
                  activeItems: [treeData[i], basicData[0]]
                });
                this.loadReplSuffix(treeData[i].id);
                found = true;
              }
            }
            this.processBranch(treeData[i].children);
            if (treeData[i].children && treeData[i].children.length === 0) {
              delete treeData[i].children;
            }
          }
          if (!found) {
            current_node = treeData[0].id;
            current_type = treeData[0].type;
            this.setState({
              activeItems: [treeData[0], basicData[0]]
            });
            this.loadReplSuffix(treeData[0].id);
          }
        } else if (treeData.length > 0) {
          for (const suffix of treeData) {
            this.processBranch(suffix.children);
            if (suffix.id === current_node) {
              replicated = suffix.replicated;
            }
            if (suffix.replicated) {
              suffix.icon = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CloneIcon, { size: "sm" });
            }
          }
          this.loadReplSuffix(current_node);
        } else {
          this.loadReplSuffix("");
        }
        basicData[0].children = treeData;
        this.setState({
          nodes: basicData,
          node_name: current_node,
          node_type: current_type,
          node_replicated: replicated,
          suffixTreeLoaded: true,
          suffixTreeLoading: false
        }, () => {
          this.update_tree_nodes();
        });
        this.loadAttrs();
      }).fail((err) => {
        let current_node = this.state.node_name;
        let current_type = this.state.node_type;
        let replicated = this.state.node_replicated;
        this.setState({
          nodes: basicData,
          node_name: current_node,
          node_type: current_type,
          node_replicated: replicated,
          suffixTreeLoading: false,
          suffixTreeLoaded: true
        }, () => {
          this.update_tree_nodes();
        });
      });
    }
    handleTreeClick(evt, treeViewItem, parentItem) {
      if (treeViewItem.id === "repl-suffixes") {
        return;
      }
      this.setState({
        activeItems: [treeViewItem],
        node_name: treeViewItem.id,
        node_type: treeViewItem.type,
        node_replicated: treeViewItem.replicated,
        disableTree: true
        // Disable the tree to allow node to be fully loaded
      });
      if (treeViewItem.id in this.state) {
        this.setState({
          disableTree: false,
          suffixKey: /* @__PURE__ */ new Date()
        });
      } else {
        this.loadReplSuffix(treeViewItem.id);
        this.setState((prevState) => {
          return {
            suffixKey: /* @__PURE__ */ new Date()
          };
        });
      }
    }
    update_tree_nodes() {
      this.setState({
        disableTree: false
      }, () => {
        const className = "pf-c-tree-view__list-item";
        const element = document.getElementById("repl-tree");
        if (element) {
          const elements = element.getElementsByClassName(className);
          for (const el of elements) {
            if (el.id === "repl-suffixes") {
              continue;
            }
            el.setAttribute("title", el.innerText);
          }
        }
      });
    }
    handleChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj
      });
    }
    closeSuffixModal() {
      this.setState({
        showSuffixModal: false
      });
    }
    reloadAgmts(suffix) {
      this.setState({
        suffixSpinning: true,
        disabled: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-agmt",
        "list",
        "--suffix",
        suffix
      ];
      log_cmd("reloadAgmts", "get repl agreements", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const obj = JSON.parse(content);
        const rows = [];
        for (const idx in obj.items) {
          const agmt_attrs = obj.items[idx].attrs;
          let state = "Enabled";
          let update_status = "";
          let agmt_init_status = "";
          if ("nsds5replicaenabled" in agmt_attrs) {
            if (agmt_attrs.nsds5replicaenabled[0].toLowerCase() === "off") {
              state = "Disabled";
            }
          }
          if ("nsds5replicalastupdatestatus" in agmt_attrs) {
            update_status = agmt_attrs.nsds5replicalastupdatestatus[0];
          }
          if ("nsds5replicalastinitstatus" in agmt_attrs && agmt_attrs.nsds5replicalastinitstatus[0] !== "") {
            agmt_init_status = agmt_attrs.nsds5replicalastinitstatus[0];
            if (agmt_init_status === "Error (0) Total update in progress" || agmt_init_status === "Error (0)") {
              agmt_init_status = "Initializing";
            } else if (agmt_init_status === "Error (0) Total update succeeded") {
              agmt_init_status = "Initialized";
            }
          } else if (agmt_attrs.nsds5replicalastinitstart[0] === "19700101000000Z") {
            agmt_init_status = "Not Initialized";
          } else if ("nsds5beginreplicarefresh" in agmt_attrs) {
            agmt_init_status = "Initializing";
          }
          rows.push([
            agmt_attrs.cn[0],
            agmt_attrs.nsds5replicahost[0],
            agmt_attrs.nsds5replicaport[0],
            state,
            update_status,
            agmt_init_status
          ]);
        }
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            agmtRows: rows
          },
          suffixSpinning: false,
          disabled: false
        });
      }).fail(() => {
        this.setState({
          suffixSpinning: false,
          disabled: false
        });
      });
    }
    reloadWinsyncAgmts(suffix) {
      this.setState({
        suffixSpinning: true,
        disabled: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "repl-winsync-agmt",
        "list",
        "--suffix",
        suffix
      ];
      log_cmd("reloadWinsyncAgmts", "Get Winsync Agreements", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const obj = JSON.parse(content);
        const ws_rows = [];
        for (const idx in obj.items) {
          let state = "Enabled";
          let update_status = "";
          let ws_agmt_init_status = "Initialized";
          const agmt_attrs = obj.items[idx].attrs;
          if ("nsds5replicaenabled" in agmt_attrs) {
            if (agmt_attrs.nsds5replicaenabled[0].toLowerCase() === "off") {
              state = "Disabled";
            }
          }
          if ("nsds5replicalastupdatestatus" in agmt_attrs) {
            update_status = agmt_attrs.nsds5replicalastupdatestatus[0];
          }
          if ("nsds5replicalastinitstatus" in agmt_attrs && agmt_attrs.nsds5replicalastinitstatus[0] !== "") {
            ws_agmt_init_status = agmt_attrs.nsds5replicalastinitstatus[0];
            if (ws_agmt_init_status === "Error (0) Total update in progress" || ws_agmt_init_status === "Error (0)") {
              ws_agmt_init_status = "Initializing";
            } else if (ws_agmt_init_status === "Error (0) Total update succeeded") {
              ws_agmt_init_status = "Initialized";
            }
          } else if ("nsds5replicalastinitstart" in agmt_attrs && agmt_attrs.nsds5replicalastinitstart[0] === "19700101000000Z") {
            ws_agmt_init_status = "Not Initialized";
          } else if ("nsds5beginreplicarefresh" in agmt_attrs) {
            ws_agmt_init_status = "Initializing";
          }
          ws_rows.push([
            agmt_attrs.cn[0],
            agmt_attrs.nsds5replicahost[0],
            agmt_attrs.nsds5replicaport[0],
            state,
            update_status,
            ws_agmt_init_status
          ]);
        }
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            winsyncRows: ws_rows
          },
          suffixSpinning: false,
          disabled: false
        });
      }).fail(() => {
        this.setState({
          suffixSpinning: false,
          disabled: false
        });
      });
    }
    reloadConfig(suffix) {
      this.setState({
        suffixSpinning: true,
        disabled: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "get",
        "--suffix",
        suffix
      ];
      log_cmd("reloadConfig", "Reload suffix repl config", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        let current_role = "";
        let nsds5replicaprecisetombstonepurging = false;
        if ("nsds5replicaprecisetombstonepurging" in config.attrs) {
          if (config.attrs.nsds5replicaprecisetombstonepurging[0].toLowerCase() === "on") {
            nsds5replicaprecisetombstonepurging = true;
          }
        }
        if (config.attrs.nsds5replicatype[0] === "3") {
          current_role = "Supplier";
        } else {
          if (config.attrs.nsds5flags[0] === "1") {
            current_role = "Hub";
          } else {
            current_role = "Consumer";
          }
        }
        this.setState({
          [suffix]: {
            role: current_role,
            nsds5flags: config.attrs.nsds5flags[0],
            nsds5replicatype: config.attrs.nsds5replicatype[0],
            nsds5replicaid: "nsds5replicaid" in config.attrs ? config.attrs.nsds5replicaid[0] : "",
            nsds5replicabinddn: "nsds5replicabinddn" in config.attrs ? config.attrs.nsds5replicabinddn : [],
            nsds5replicabinddngroup: "nsds5replicabinddngroup" in config.attrs ? config.attrs.nsds5replicabinddngroup[0] : "",
            nsds5replicabinddngroupcheckinterval: "nsds5replicabinddngroupcheckinterval" in config.attrs ? config.attrs.nsds5replicabinddngroupcheckinterval[0] : "",
            nsds5replicareleasetimeout: "nsds5replicareleasetimeout" in config.attrs ? config.attrs.nsds5replicareleasetimeout[0] : "",
            nsds5replicapurgedelay: "nsds5replicapurgedelay" in config.attrs ? config.attrs.nsds5replicapurgedelay[0] : "",
            nsds5replicatombstonepurgeinterval: "nsds5replicatombstonepurgeinterval" in config.attrs ? config.attrs.nsds5replicatombstonepurgeinterval[0] : "",
            nsds5replicaprecisetombstonepurging,
            nsds5replicaprotocoltimeout: "nsds5replicaprotocoltimeout" in config.attrs ? config.attrs.nsds5replicaprotocoltimeout[0] : "",
            nsds5replicabackoffmin: "nsds5replicabackoffmin" in config.attrs ? config.attrs.nsds5replicabackoffmin[0] : "",
            nsds5replicabackoffmax: "nsds5replicabackoffmax" in config.attrs ? config.attrs.nsds5replicabackoffmax[0] : "",
            nsds5replicakeepaliveupdateinterval: "nsds5replicakeepaliveupdateinterval" in config.attrs ? config.attrs.nsds5replicakeepaliveupdateinterval[0] : "3600"
          },
          suffixSpinning: false,
          disabled: false,
          suffixKey: /* @__PURE__ */ new Date()
        }, this.loadLDIFs);
      }).fail(() => {
        this.setState({
          suffixSpinning: false,
          disabled: false
        });
      });
    }
    reloadRUV(suffix) {
      this.setState({
        suffixSpinning: true,
        disabled: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "get-ruv",
        "--suffix=" + suffix
      ];
      log_cmd("reloadRUV", "Get the suffix RUV", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const ruvs = JSON.parse(content);
        const ruv_rows = [];
        for (const idx in ruvs.items) {
          const ruv = ruvs.items[idx];
          ruv_rows.push({
            rid: ruv.rid,
            url: ruv.url,
            csn: ruv.csn,
            raw_csn: ruv.raw_csn,
            maxcsn: ruv.maxcsn,
            raw_maxcsn: ruv.raw_maxcsn
          });
        }
        this.setState({
          [suffix]: {
            ...this.state[suffix],
            ruvRows: ruv_rows
          },
          suffixSpinning: false,
          disabled: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        if (errMsg !== "No such object") {
          this.props.addNotification(
            "error",
            cockpit_default.format(_66("Error loading suffix RUV - $0"), errMsg)
          );
        }
        this.setState({
          suffixSpinning: false,
          disabled: false
        });
      });
    }
    loadLDIFs() {
      const cmd = [
        "dsctl",
        "-j",
        this.props.serverId,
        "ldifs"
      ];
      log_cmd("loadLDIFs", "Load replication LDIF Files", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const rows = [];
        for (const row of config.items) {
          if (row[3].toLowerCase() === this.state.node_name.toLowerCase()) {
            rows.push([row[0], row[1], row[2]]);
          }
        }
        this.setState({
          ldifRows: rows,
          loaded: true
        }, () => {
          this.update_tree_nodes();
        });
      });
    }
    loadReplSuffix(suffix) {
      this.setState({
        activeKey: 1,
        suffixLoading: true,
        [suffix]: {},
        replConfigLoading: true,
        replConfigLoaded: false,
        changelogLoaded: false,
        changelogLoading: false,
        agmtsLoaded: false,
        agmtsLoading: false,
        winsyncLoaded: false,
        winsyncLoading: false,
        ruvLoaded: false,
        ruvLoading: false
      });
      let cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "replication",
        "get",
        "--suffix",
        suffix
      ];
      log_cmd("loadReplSuffix", "Load suffix repl config", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        let current_role = "";
        let nsds5replicaprecisetombstonepurging = false;
        if ("nsds5replicaprecisetombstonepurging" in config.attrs) {
          if (config.attrs.nsds5replicaprecisetombstonepurging[0].toLowerCase() === "on") {
            nsds5replicaprecisetombstonepurging = true;
          }
        }
        if (config.attrs.nsds5replicatype[0] === "3") {
          current_role = "Supplier";
        } else {
          if (config.attrs.nsds5flags[0] === "1") {
            current_role = "Hub";
          } else {
            current_role = "Consumer";
          }
        }
        this.setState({
          [suffix]: {
            role: current_role,
            nsds5flags: config.attrs.nsds5flags[0],
            nsds5replicatype: config.attrs.nsds5replicatype[0],
            nsds5replicaid: "nsds5replicaid" in config.attrs ? config.attrs.nsds5replicaid[0] : "",
            nsds5replicabinddn: "nsds5replicabinddn" in config.attrs ? config.attrs.nsds5replicabinddn : [],
            nsds5replicabinddngroup: "nsds5replicabinddngroup" in config.attrs ? config.attrs.nsds5replicabinddngroup[0] : "",
            nsds5replicabinddngroupcheckinterval: "nsds5replicabinddngroupcheckinterval" in config.attrs ? config.attrs.nsds5replicabinddngroupcheckinterval[0] : "",
            nsds5replicareleasetimeout: "nsds5replicareleasetimeout" in config.attrs ? config.attrs.nsds5replicareleasetimeout[0] : "",
            nsds5replicapurgedelay: "nsds5replicapurgedelay" in config.attrs ? config.attrs.nsds5replicapurgedelay[0] : "",
            nsds5replicatombstonepurgeinterval: "nsds5replicatombstonepurgeinterval" in config.attrs ? config.attrs.nsds5replicatombstonepurgeinterval[0] : "",
            nsds5replicaprecisetombstonepurging,
            nsds5replicaprotocoltimeout: "nsds5replicaprotocoltimeout" in config.attrs ? config.attrs.nsds5replicaprotocoltimeout[0] : "",
            nsds5replicabackoffmin: "nsds5replicabackoffmin" in config.attrs ? config.attrs.nsds5replicabackoffmin[0] : "",
            nsds5replicabackoffmax: "nsds5replicabackoffmax" in config.attrs ? config.attrs.nsds5replicabackoffmax[0] : "",
            nsds5replicakeepaliveupdateinterval: "nsds5replicakeepaliveupdateinterval" in config.attrs ? config.attrs.nsds5replicakeepaliveupdateinterval[0] : "3600",
            clMaxEntries: "",
            clMaxAge: "",
            clTrimInt: "",
            clEncrypt: false
          }
        }, () => {
          this.setState({
            replConfigLoaded: true,
            replConfigLoading: false,
            changelogLoading: true
          });
        });
        cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "replication",
          "get-changelog",
          "--suffix",
          suffix
        ];
        log_cmd("loadReplSuffix", "Load the replication info", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content2) => {
          const config2 = JSON.parse(content2);
          let clMaxEntries = "";
          let clMaxAge = "";
          let clTrimInt = "";
          let clEncrypt = false;
          for (const attr in config2.attrs) {
            const val = config2.attrs[attr][0];
            if (attr === "nsslapd-changelogmaxentries") {
              clMaxEntries = val;
            }
            if (attr === "nsslapd-changelogmaxage") {
              if (val !== "-1") {
                const unit2 = val[val.length - 1];
                if (unit2 >= "0" && unit2 <= "9") {
                  clMaxAge = val + "s";
                } else {
                  clMaxAge = val;
                }
              } else {
                clMaxAge = val;
              }
            }
            if (attr === "nsslapd-changelogtrim-interval") {
              clTrimInt = val;
            }
            if (attr === "nsslapd-encryptionalgorithm") {
              clEncrypt = true;
            }
          }
          this.setState({
            [suffix]: {
              ...this.state[suffix],
              clMaxEntries,
              clMaxAge,
              clTrimInt,
              clEncrypt
            }
          }, () => {
            this.setState({
              changelogLoaded: true,
              changelogLoading: false,
              agmtsLoading: true
            });
          });
          cmd = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "repl-agmt",
            "list",
            "--suffix",
            suffix
          ];
          log_cmd("loadReplSuffix", "get repl agreements", cmd);
          cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content3) => {
            const obj = JSON.parse(content3);
            const rows = [];
            for (const idx in obj.items) {
              const agmt_attrs = obj.items[idx].attrs;
              let state = "Enabled";
              let update_status = "";
              let agmt_init_status = "";
              if ("nsds5replicaenabled" in agmt_attrs) {
                if (agmt_attrs.nsds5replicaenabled[0].toLowerCase() === "off") {
                  state = "Disabled";
                }
              }
              if ("nsds5replicalastupdatestatus" in agmt_attrs) {
                update_status = agmt_attrs.nsds5replicalastupdatestatus[0];
              }
              if ("nsds5replicalastinitstatus" in agmt_attrs && agmt_attrs.nsds5replicalastinitstatus[0] !== "") {
                agmt_init_status = agmt_attrs.nsds5replicalastinitstatus[0];
                if (agmt_init_status === "Error (0) Total update in progress" || agmt_init_status === "Error (0)") {
                  agmt_init_status = "Initializing";
                } else if (agmt_init_status === "Error (0) Total update succeeded") {
                  agmt_init_status = "Initialized";
                }
              } else if ("nsds5replicalastinitstart" in agmt_attrs && agmt_attrs.nsds5replicalastinitstart[0] === "19700101000000Z") {
                agmt_init_status = "Not Initialized";
              } else if ("nsds5beginreplicarefresh" in agmt_attrs) {
                agmt_init_status = "Initializing";
              }
              rows.push([
                agmt_attrs.cn[0],
                agmt_attrs.nsds5replicahost[0],
                agmt_attrs.nsds5replicaport[0],
                state,
                update_status,
                agmt_init_status
              ]);
            }
            this.setState({
              [suffix]: {
                ...this.state[suffix],
                agmtRows: rows
              }
            }, () => {
              this.setState({
                agmtsLoaded: true,
                agmtsLoading: false,
                winsyncLoading: true
              });
            });
            cmd = [
              "dsconf",
              "-j",
              "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
              "repl-winsync-agmt",
              "list",
              "--suffix",
              suffix
            ];
            log_cmd("loadReplSuffix", "Get Winsync Agreements", cmd);
            cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content4) => {
              const obj2 = JSON.parse(content4);
              const ws_rows = [];
              for (const idx in obj2.items) {
                let state = "Enabled";
                let update_status = "";
                let ws_agmt_init_status = "Initialized";
                const agmt_attrs = obj2.items[idx].attrs;
                if ("nsds5replicaenabled" in agmt_attrs) {
                  if (agmt_attrs.nsds5replicaenabled[0].toLowerCase() === "off") {
                    state = "Disabled";
                  }
                }
                if ("nsds5replicalastupdatestatus" in agmt_attrs) {
                  update_status = agmt_attrs.nsds5replicalastupdatestatus[0];
                }
                if ("nsds5replicalastinitstatus" in agmt_attrs && agmt_attrs.nsds5replicalastinitstatus[0] !== "") {
                  ws_agmt_init_status = agmt_attrs.nsds5replicalastinitstatus[0];
                  if (ws_agmt_init_status === "Error (0) Total update in progress" || ws_agmt_init_status === "Error (0)") {
                    ws_agmt_init_status = "Initializing";
                  } else if (ws_agmt_init_status === "Error (0) Total update succeeded") {
                    ws_agmt_init_status = "Initialized";
                  }
                } else if ("nsds5replicalastinitstart" in agmt_attrs && agmt_attrs.nsds5replicalastinitstart[0] === "19700101000000Z") {
                  ws_agmt_init_status = "Not Initialized";
                } else if ("nsds5beginreplicarefresh" in agmt_attrs) {
                  ws_agmt_init_status = "Initializing";
                }
                ws_rows.push([
                  agmt_attrs.cn[0],
                  agmt_attrs.nsds5replicahost[0],
                  agmt_attrs.nsds5replicaport[0],
                  state,
                  update_status,
                  ws_agmt_init_status
                ]);
              }
              this.setState({
                [suffix]: {
                  ...this.state[suffix],
                  winsyncRows: ws_rows
                }
              }, () => {
                this.setState({
                  winsyncLoaded: true,
                  winsyncLoading: false,
                  ruvLoading: true
                });
              });
              cmd = [
                "dsconf",
                "-j",
                "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
                "replication",
                "get-ruv",
                "--suffix=" + suffix
              ];
              log_cmd("loadReplSuffix", "Get the suffix RUV", cmd);
              cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content5) => {
                const ruvs = JSON.parse(content5);
                const ruv_rows = [];
                for (const idx in ruvs.items) {
                  const ruv = ruvs.items[idx];
                  ruv_rows.push({
                    rid: ruv.rid,
                    url: ruv.url,
                    csn: ruv.csn,
                    raw_csn: ruv.raw_csn,
                    maxcsn: ruv.maxcsn,
                    raw_maxcsn: ruv.raw_maxcsn
                  });
                }
                this.setState({
                  [suffix]: {
                    ...this.state[suffix],
                    ruvRows: ruv_rows
                  },
                  ruvLoaded: true,
                  ruvLoading: false,
                  suffixLoading: false,
                  disableTree: false
                }, () => {
                  this.loadLDIFs();
                });
              }).fail((err) => {
                const errMsg = getApiErrorMessage(err);
                if (errMsg !== "No such object" && !errMsg.includes("There is no RUV for suffix")) {
                  this.props.addNotification(
                    "error",
                    cockpit_default.format(_66("Error loading suffix RUV - $0"), errMsg)
                  );
                }
                this.setState({
                  ruvLoading: false,
                  suffixLoading: false,
                  disableTree: false
                }, () => {
                  this.loadLDIFs();
                });
              });
            }).fail((err) => {
              const errMsg = getApiErrorMessage(err);
              this.props.addNotification(
                "error",
                cockpit_default.format(_66("Error loading winsync agreements - $0"), errMsg)
              );
              this.setState({
                winsyncLoading: false,
                suffixLoading: false,
                disableTree: false
              }, () => {
                this.loadLDIFs();
              });
            });
          }).fail((err) => {
            const errMsg = getApiErrorMessage(err);
            this.props.addNotification(
              "error",
              cockpit_default.format(_66("Error loading replication agreements configuration - $0"), errMsg)
            );
            this.setState({
              agmtsLoading: false,
              suffixLoading: false,
              disableTree: false
            }, () => {
              this.loadLDIFs();
            });
          });
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.props.addNotification(
            "error",
            cockpit_default.format(_66("Error loading replication changelog configuration - $0"), errMsg)
          );
          this.setState({
            changelogLoading: false,
            suffixLoading: false,
            disableTree: false
          }, () => {
            this.loadLDIFs();
          });
        });
      }).fail(() => {
        this.setState({
          replConfigLoading: false,
          suffixLoading: false,
          disableTree: false,
          node_replicated: false
        }, () => {
          this.loadLDIFs();
        });
      });
    }
    loadAttrs() {
      this.setState({
        attrsLoading: true
      });
      const attr_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "list"
      ];
      log_cmd("Suffixes", "Get attrs", attr_cmd);
      cockpit_default.spawn(attr_cmd, { superuser: true, err: "message" }).done((content) => {
        const attrContent = JSON.parse(content);
        const attrs = [];
        for (const content2 of attrContent.items) {
          attrs.push(content2.name[0]);
        }
        this.setState({
          attributes: attrs,
          attrsLoaded: true,
          attrsLoading: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_66("Error loading attributes - $0"), errMsg)
        );
        this.setState({
          attributes: [],
          attrsLoaded: true,
          attrsLoading: false
        });
      });
    }
    enableTree() {
      this.setState({
        disableTree: false
      });
    }
    disableTree() {
      this.setState({
        disableTree: true
      });
    }
    render() {
      const { nodes } = this.state;
      let repl_page = "";
      let repl_element = "";
      let disabled = "tree-view-container";
      if (this.state.disableTree) {
        disabled = "tree-view-container ds-disabled";
      }
      if (!this.state.loaded) {
        repl_page = /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(Text, { component: TextVariants.h3, children: [
            _66("Loading Replication Information ..."),
            /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Spinner, { isInline: true, className: "ds-left-margin", size: "lg" })
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
            ProgressStepper,
            {
              className: "ds-margin-top-xlg",
              "aria-label": "Progress stepper for replication loading",
              isCenterAligned: true,
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.suffixTreeLoading,
                    variant: this.state.suffixTreeLoaded ? "success" : "pending",
                    icon: !this.state.suffixTreeLoaded ? this.state.suffixTreeLoading ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(check_circle_icon_default, {}),
                    id: "suffixTreeLoading",
                    titleId: "load suffix tree",
                    "aria-label": "Loading suffix tree step",
                    children: !this.state.suffixTreeLoaded ? _66("Loading Suffix Tree") : _66("Suffix Tree Loaded")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.attrsLoading,
                    variant: this.state.attrsLoaded ? "success" : "pending",
                    icon: !this.state.attrsLoaded ? this.state.attrsLoading ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(check_circle_icon_default, {}),
                    id: "attrsLoading",
                    titleId: "load replication attributes",
                    "aria-label": "Loading replication attributes step",
                    children: !this.state.attrsLoaded ? _66("Loading Schema") : _66("Schema Loaded")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.replConfigLoading,
                    variant: this.state.replConfigLoaded ? "success" : "pending",
                    icon: !this.state.replConfigLoaded ? this.state.replConfigLoading ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(check_circle_icon_default, {}),
                    id: "replConfigLoading",
                    titleId: "load replication suffix configuration",
                    "aria-label": "Loading replication configuration step",
                    children: !this.state.replConfigLoaded ? _66("Loading Replication Config") : _66("Replication Config Loaded")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.changelogLoading,
                    variant: this.state.changelogLoaded ? "success" : "pending",
                    icon: !this.state.changelogLoaded ? this.state.changelogLoading ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(check_circle_icon_default, {}),
                    id: "changelogLoading",
                    titleId: "load replication changelog settings",
                    "aria-label": "Loading replication changelog step",
                    children: !this.state.changelogLoaded ? _66("Loading Changelog") : _66("Changelog Loaded")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.agmtsLoading,
                    variant: this.state.agmtsLoaded ? "success" : "pending",
                    icon: !this.state.agmtsLoaded ? this.state.agmtsLoading ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(check_circle_icon_default, {}),
                    id: "agmtsLoading",
                    titleId: "load replication agreements",
                    "aria-label": "Loading replication agreements step",
                    children: !this.state.agmtsLoaded ? _66("Loading Agreements") : _66("Agreements Loaded")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.winsyncLoading,
                    variant: this.state.winsyncLoaded ? "success" : "pending",
                    icon: !this.state.winsyncLoaded ? this.state.winsyncLoading ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(check_circle_icon_default, {}),
                    id: "winsyncLoading",
                    titleId: "load winsync agreements",
                    "aria-label": "Loading winsync agreements step",
                    children: !this.state.winsyncLoaded ? _66("Loading Winsync Agreements") : _66("Winsync Agreements Loaded")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.ruvLoading,
                    variant: this.state.ruvLoaded ? "success" : "pending",
                    icon: !this.state.ruvLoaded ? this.state.ruvLoading ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(check_circle_icon_default, {}),
                    id: "ruvLoading",
                    titleId: "load suffix ruv",
                    "aria-label": "Loading suffix ruv step",
                    children: !this.state.ruvLoaded ? _66("Loading RUV") : _66("RUV Loaded")
                  }
                )
              ]
            }
          )
        ] });
      } else {
        if (this.state.suffixLoading) {
          repl_element = /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
            /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(Text, { component: TextVariants.h3, children: [
              _66("Loading Replication Configuration For "),
              /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("b", { children: [
                this.state.node_name,
                " ..."
              ] })
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
          ] });
        } else {
          if (this.state.node_name === "") {
            repl_element = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "ds-margin-top-xlg ds-center", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(TextContent, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Text, { component: TextVariants.h3, children: _66("There are no suffixes in the database") }),
              /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: () => {
                    this.loadSuffixTree(true);
                  },
                  children: _66("Refresh")
                }
              )
            ] }) });
          } else if (this.state.node_name in this.state) {
            repl_element = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
              ReplSuffix,
              {
                serverId: this.props.serverId,
                suffix: this.state.node_name,
                role: this.state[this.state.node_name].role,
                data: this.state[this.state.node_name],
                addNotification: this.props.addNotification,
                agmtRows: this.state[this.state.node_name].agmtRows,
                winsyncRows: this.state[this.state.node_name].winsyncRows,
                ruvRows: this.state[this.state.node_name].ruvRows,
                ldifRows: this.state.ldifRows,
                reloadAgmts: this.reloadAgmts,
                reloadWinsyncAgmts: this.reloadWinsyncAgmts,
                reloadRUV: this.reloadRUV,
                reloadConfig: this.reloadConfig,
                reloadLDIF: this.loadLDIFs,
                reload: this.resetLoadProgress,
                attrs: this.state.attributes,
                replicated: this.state.node_replicated,
                enableTree: this.enableTree,
                disableTree: this.disableTree,
                disabled: this.state.disabled,
                spinning: this.state.suffixSpinning
              },
              this.state.suffixKey
            ) });
          } else {
            repl_element = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
              ReplSuffix,
              {
                serverId: this.props.serverId,
                suffix: this.state.node_name,
                role: "",
                data: "",
                addNotification: this.props.addNotification,
                disableWSAgmtTable: this.state.disableWSAgmtTable,
                disableAgmtTable: this.state.disableAgmtTable,
                reloadAgmts: this.reloadAgmts,
                reloadWinsyncAgmts: this.reloadWinsyncAgmts,
                reloadRUV: this.reloadRUV,
                reloadLDIF: this.loadLDIFs,
                reloadConfig: this.reloadConfig,
                reload: this.resetLoadProgress,
                attrs: this.state.attributes,
                replicated: this.state.node_replicated,
                enableTree: this.enableTree,
                disableTree: this.disableTree,
                spinning: this.state.suffixSpinning,
                disabled: this.state.disabled,
                ldifRows: this.state.ldifRows
              },
              this.state.node_name
            );
          }
        }
        repl_page = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "container-fluid", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "ds-container", children: [
          /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Card, { className: "ds-tree", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: disabled, id: "repl-tree", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
            TreeView,
            {
              data: nodes,
              activeItems: this.state.activeItems,
              onSelect: this.handleTreeClick
            }
          ) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "ds-tree-content", children: repl_element })
        ] }) });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { children: repl_page });
    }
  };
  Replication.propTypes = {
    addNotification: import_prop_types65.default.func,
    serverId: import_prop_types65.default.string
  };
  Replication.defaultProps = {
    serverId: ""
  };

  // src/server.jsx
  var import_react154 = __toESM(require_react(), 1);
  var import_prop_types82 = __toESM(require_prop_types(), 1);

  // src/lib/server/settings.jsx
  var import_react137 = __toESM(require_react(), 1);
  var import_prop_types66 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1);
  var general_attrs3 = [
    "nsslapd-port",
    "nsslapd-secureport",
    "nsslapd-localhost",
    "nsslapd-listenhost",
    "nsslapd-bakdir",
    "nsslapd-ldifdir",
    "nsslapd-schemadir",
    "nsslapd-certdir"
  ];
  var path_attrs = [
    "nsslapd-bakdir",
    "nsslapd-ldifdir",
    "nsslapd-schemadir",
    "nsslapd-certdir"
  ];
  var rootdn_attrs = [
    "nsslapd-rootpwstoragescheme",
    "nsslapd-rootpw",
    "confirmRootpw"
  ];
  var disk_attrs = [
    "nsslapd-disk-monitoring",
    "nsslapd-disk-monitoring-logging-critical",
    "nsslapd-disk-monitoring-threshold",
    "nsslapd-disk-monitoring-grace-period"
  ];
  var adv_attrs = [
    "nsslapd-allow-anonymous-access",
    "nsslapd-entryusn-global",
    "nsslapd-ignore-time-skew",
    "nsslapd-readonly",
    "nsslapd-anonlimitsdn",
    "nsslapd-schemacheck",
    "nsslapd-syntaxcheck",
    "nsslapd-plugin-logging",
    "nsslapd-syntaxlogging",
    "nsslapd-plugin-binddn-tracking",
    "nsslapd-attribute-name-exceptions",
    "nsslapd-dn-validate-strict",
    "nsslapd-haproxy-trusted-ip"
  ];
  var _67 = cockpit_default.gettext;
  var ServerSettings = class extends import_react137.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: true,
        activeTabKey: 0,
        attrs: this.props.attrs,
        // Setting lists
        configSaveDisabled: true,
        configReloading: false,
        errObjConfig: {},
        rootDNReloading: false,
        rootDNSaveDisabled: true,
        errObjRootDN: {},
        diskMonReloading: false,
        diskMonSaveDisabled: true,
        errObjDiskMon: {},
        advSaveDisabled: true,
        advReloading: false,
        errObjAdv: {},
        haproxyIPs: [],
        _haproxyIPs: [],
        haproxyIPsOptions: [],
        isHaproxyIPsOpen: false,
        invalidIP: false
      };
      this.handleOnHaproxyIPsToggle = (_event, isHaproxyIPsOpen) => {
        this.setState({
          isHaproxyIPsOpen,
          invalidIP: false
        });
      };
      this.handleOnHaproxyIPsSelect = (event, selection, nav_tab) => {
        const id = "nsslapd-haproxy-trusted-ip";
        const newHaproxyIPs = Array.isArray(selection) ? selection : [];
        this.setState({
          haproxyIPs: newHaproxyIPs,
          isHaproxyIPsOpen: false
        }, () => {
          this.validateSaveBtn(nav_tab, id, newHaproxyIPs);
        });
      };
      this.handleOnHaproxyIPsClear = (event, nav_tab) => {
        const id = "nsslapd-haproxy-trusted-ip";
        const selection = [];
        this.setState({
          haproxyIPs: [],
          isHaproxyIPsOpen: false,
          invalidIP: false
        }, () => {
          this.validateSaveBtn(nav_tab, id, selection);
        });
      };
      this.handleOnCreateHaproxyIP = (newValue) => {
        if (!this.state.haproxyIPsOptions.includes(newValue)) {
          this.setState({
            haproxyIPsOptions: [...this.state.haproxyIPsOptions, newValue],
            isHaproxyIPsOpen: false
          });
        }
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.options = [
        { value: "PBKDF2-SHA512", label: "PBKDF2-SHA512", disabled: false },
        { value: "PBKDF2-SHA256", label: "PBKDF2-SHA256", disabled: false },
        { value: "PBKDF2_SHA256", label: "PBKDF2_SHA256", disabled: false },
        { value: "SSHA512", label: "SSHA512", disabled: false },
        { value: "SSHA384", label: "SSHA384", disabled: false },
        { value: "SSHA256", label: "SSHA256", disabled: false },
        { value: "SSHA", label: "SSHA", disabled: false },
        { value: "MD5", label: "MD5", disabled: false },
        { value: "SMD5", label: "SMD5", disabled: false },
        { value: "CRYPT-MD5", label: "CRYPT-MD5", disabled: false },
        { value: "CRYPT-SHA512", label: "CRYPT-SHA512", disabled: false },
        { value: "CRYPT-SHA256", label: "CRYPT-SHA256", disabled: false },
        { value: "CRYPT", label: "CRYPT", disabled: false },
        { value: "GOST_YESCRYPT", label: "GOST_YESCRYPT", disabled: false },
        { value: "CLEAR", label: "CLEAR", disabled: false }
      ];
      this.validatePaths = this.validatePaths.bind(this);
      this.validateAllTabs = this.validateAllTabs.bind(this);
      this.handleChange = this.handleChange.bind(this);
      this.loadConfig = this.loadConfig.bind(this);
      this.handleSaveConfig = this.handleSaveConfig.bind(this);
      this.handleReloadConfig = this.handleReloadConfig.bind(this);
      this.handleSaveRootDN = this.handleSaveRootDN.bind(this);
      this.reloadRootDN = this.reloadRootDN.bind(this);
      this.handleSaveDiskMonitoring = this.handleSaveDiskMonitoring.bind(this);
      this.reloadDiskMonitoring = this.reloadDiskMonitoring.bind(this);
      this.handleSaveAdvanced = this.handleSaveAdvanced.bind(this);
      this.reloadAdvanced = this.reloadAdvanced.bind(this);
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
      this.validatePortOnBlur = this.validatePortOnBlur.bind(this);
      this.onMinusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.onConfigChange = (event, id, min3, max3, nav_tab) => {
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        let newValue = isNaN(event.target.value) ? min3 : Number(event.target.value);
        newValue = newValue > maxValue ? maxValue : newValue < min3 ? min3 : newValue;
        this.setState({
          [id]: newValue
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.onPlusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.loadConfig();
      } else {
        this.validateAllTabs();
        this.props.enableTree();
      }
    }
    handleNavSelect(key) {
      this.setState({ activeKey: key });
    }
    validatePaths(disableSaveBtn) {
      let disableBtn = disableSaveBtn;
      const errObj = this.state.errObjConfig;
      for (const attr of path_attrs) {
        const cmd = `[ -d "${this.state[attr]}" ]`;
        cockpit_default.script(cmd, [], { superuser: true, err: "message" }).done((output) => {
          errObj[attr] = false;
          this.setState({
            errObjConfig: errObj,
            configSaveDisabled: disableBtn
          });
        }).fail(() => {
          errObj[attr] = true;
          disableBtn = true;
          this.setState({
            configSaveDisabled: disableBtn,
            errObjConfig: errObj
          });
        });
      }
    }
    async validateSaveBtn(nav_tab, attr, value) {
      let disableSaveBtn = true;
      let disableBtnName = "";
      let config_attrs = [];
      let valueErr = false;
      let invalidIP = false;
      let errObj = {};
      if (nav_tab === "config") {
        config_attrs = general_attrs3;
        disableBtnName = "configSaveDisabled";
        errObj = this.state.errObjConfig;
      } else if (nav_tab === "rootdn") {
        disableBtnName = "rootDNSaveDisabled";
        config_attrs = rootdn_attrs;
        errObj = this.state.errObjRootDN;
      } else if (nav_tab === "diskmon") {
        disableBtnName = "diskMonSaveDisabled";
        config_attrs = disk_attrs;
        errObj = this.state.errObjDiskMon;
      } else if (nav_tab === "adv") {
        disableBtnName = "advSaveDisabled";
        config_attrs = adv_attrs;
        errObj = this.state.errObjAdv;
      }
      for (const config_attr of config_attrs) {
        if (attr === config_attr && String(this.state["_" + config_attr]) !== String(value)) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const config_attr of config_attrs) {
        if (attr !== config_attr && String(this.state["_" + config_attr]) !== String(this.state[config_attr])) {
          disableSaveBtn = false;
          break;
        }
      }
      if (nav_tab === "config") {
        if (attr !== "nsslapd-listenhost" && value === "") {
          valueErr = true;
          disableSaveBtn = true;
        }
      } else if (nav_tab === "rootdn") {
        if (attr === "nsslapd-rootpw") {
          if (value !== this.state.confirmRootpw) {
            disableSaveBtn = true;
            valueErr = true;
            errObj["nsslapd-rootpw"] = true;
          } else {
            errObj.confirmRootpw = false;
            errObj["nsslapd-rootpw"] = false;
          }
        }
        if (attr === "confirmRootpw") {
          if (value !== this.state["nsslapd-rootpw"]) {
            disableSaveBtn = true;
            valueErr = true;
            errObj.confirmRootpw = true;
          } else {
            errObj.confirmRootpw = false;
            errObj["nsslapd-rootpw"] = false;
          }
        }
        if (value === "") {
          disableSaveBtn = true;
          valueErr = true;
        }
      } else if (nav_tab === "diskmon") {
        if (value === "" && typeof value !== "boolean") {
          valueErr = true;
          disableSaveBtn = true;
        }
        if (attr === "nsslapd-disk-monitoring-threshold") {
          const numVal = Number(value);
          if (numVal < 4096) {
            valueErr = true;
            disableSaveBtn = true;
          }
        }
      } else if (nav_tab === "adv") {
        if (attr === "nsslapd-anonlimitsdn" && !valid_dn(value)) {
          valueErr = true;
          errObj[attr] = true;
        }
        if (value === "" && attr !== "nsslapd-anonlimitsdn" && typeof value !== "boolean") {
          valueErr = true;
          disableSaveBtn = true;
        }
        if (attr === "nsslapd-haproxy-trusted-ip") {
          for (const ip of value) {
            if (value && !isValidIpAddressOrCIDR(ip)) {
              invalidIP = true;
              disableSaveBtn = true;
              break;
            }
          }
        }
      }
      errObj[attr] = valueErr;
      this.setState({
        [attr]: value,
        invalidIP,
        errObjConfig: errObj,
        [disableBtnName]: disableSaveBtn
      }, () => {
        this.validatePaths(disableSaveBtn);
      });
    }
    handleChange(e, nav_tab) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn(nav_tab, attr, value);
      });
    }
    validateAllTabs() {
      const tabs = ["config", "rootdn", "diskmon", "adv"];
      tabs.forEach((tab) => {
        let attrs;
        switch (tab) {
          case "config":
            attrs = general_attrs3;
            break;
          case "rootdn":
            attrs = rootdn_attrs;
            break;
          case "diskmon":
            attrs = disk_attrs;
            break;
          case "adv":
            attrs = adv_attrs;
            break;
        }
        attrs.forEach((attr) => {
          this.validateSaveBtn(tab, attr, this.state[attr]);
        });
      });
    }
    async validatePortOnBlur(attr) {
      const portValue = Number(this.state[attr]);
      if (isNaN(portValue)) {
        return;
      }
      try {
        const portInUse = await is_port_in_use(portValue);
        const origValue = Number(this.state["_" + attr]);
        const errObj = { ...this.state.errObjConfig };
        if (portInUse && portValue !== origValue) {
          errObj[attr] = true;
        } else {
          errObj[attr] = false;
        }
        const hasErrors = Object.values(errObj).some((error) => error === true);
        this.setState({
          errObjConfig: errObj,
          configSaveDisabled: hasErrors
        });
      } catch (error) {
        console.error("Error checking port:", error);
        const errObj = { ...this.state.errObjConfig };
        errObj[attr] = true;
        const hasErrors = Object.values(errObj).some((error2) => error2 === true);
        this.setState({
          errObjConfig: errObj,
          configSaveDisabled: hasErrors
        });
      }
    }
    loadConfig() {
      const attrs = this.state.attrs;
      let diskMonitoring = false;
      let diskLogCritical = false;
      let schemaCheck = false;
      let syntaxCheck = false;
      let pluginLogging = false;
      let syntaxLogging = false;
      let bindDNTracking = false;
      let nameExceptions = false;
      let dnValidate = false;
      let usnGlobal = false;
      let ignoreSkew = false;
      let readOnly = false;
      let listenhost = "";
      if (attrs["nsslapd-entryusn-global"][0] === "on") {
        usnGlobal = true;
      }
      if (attrs["nsslapd-ignore-time-skew"][0] === "on") {
        ignoreSkew = true;
      }
      if (attrs["nsslapd-readonly"][0] === "on") {
        readOnly = true;
      }
      if (attrs["nsslapd-disk-monitoring"][0] === "on") {
        diskMonitoring = true;
      }
      if (attrs["nsslapd-disk-monitoring-logging-critical"][0] === "on") {
        diskLogCritical = true;
      }
      if (attrs["nsslapd-schemacheck"][0] === "on") {
        schemaCheck = true;
      }
      if (attrs["nsslapd-syntaxcheck"][0] === "on") {
        syntaxCheck = true;
      }
      if (attrs["nsslapd-plugin-logging"][0] === "on") {
        pluginLogging = true;
      }
      if (attrs["nsslapd-syntaxlogging"][0] === "on") {
        syntaxLogging = true;
      }
      if (attrs["nsslapd-plugin-binddn-tracking"][0] === "on") {
        bindDNTracking = true;
      }
      if (attrs["nsslapd-attribute-name-exceptions"][0] === "on") {
        nameExceptions = true;
      }
      if (attrs["nsslapd-dn-validate-strict"][0] === "on") {
        dnValidate = true;
      }
      if ("nsslapd-listenhost" in attrs) {
        listenhost = attrs["nsslapd-listenhost"][0];
      }
      this.setState({
        loaded: true,
        loading: false,
        errObjConfig: {},
        errObjRootDN: {},
        errObjDiskMon: {},
        errObjAdv: {},
        // Settings
        "nsslapd-port": parseInt(attrs["nsslapd-port"][0]),
        "nsslapd-secureport": parseInt(attrs["nsslapd-secureport"][0]),
        "nsslapd-localhost": attrs["nsslapd-localhost"][0],
        "nsslapd-listenhost": listenhost,
        "nsslapd-bakdir": attrs["nsslapd-bakdir"][0],
        "nsslapd-ldifdir": attrs["nsslapd-ldifdir"][0],
        "nsslapd-schemadir": attrs["nsslapd-schemadir"][0],
        "nsslapd-certdir": attrs["nsslapd-certdir"][0],
        "nsslapd-rootdn": attrs["nsslapd-rootdn"][0],
        "nsslapd-rootpw": attrs["nsslapd-rootpw"][0],
        confirmRootpw: attrs["nsslapd-rootpw"][0],
        "nsslapd-rootpwstoragescheme": attrs["nsslapd-rootpwstoragescheme"][0],
        "nsslapd-anonlimitsdn": attrs["nsslapd-anonlimitsdn"][0],
        haproxyIPs: attrs["nsslapd-haproxy-trusted-ip"] ? attrs["nsslapd-haproxy-trusted-ip"] : [],
        "nsslapd-haproxy-trusted-ip": attrs["nsslapd-haproxy-trusted-ip"] ? attrs["nsslapd-haproxy-trusted-ip"] : [],
        "nsslapd-disk-monitoring-threshold": parseInt(attrs["nsslapd-disk-monitoring-threshold"][0]),
        "nsslapd-disk-monitoring-grace-period": parseInt(attrs["nsslapd-disk-monitoring-grace-period"][0]),
        "nsslapd-allow-anonymous-access": attrs["nsslapd-allow-anonymous-access"][0],
        "nsslapd-disk-monitoring": diskMonitoring,
        "nsslapd-disk-monitoring-logging-critical": diskLogCritical,
        "nsslapd-schemacheck": schemaCheck,
        "nsslapd-syntaxcheck": syntaxCheck,
        "nsslapd-plugin-logging": pluginLogging,
        "nsslapd-syntaxlogging": syntaxLogging,
        "nsslapd-plugin-binddn-tracking": bindDNTracking,
        "nsslapd-attribute-name-exceptions": nameExceptions,
        "nsslapd-dn-validate-strict": dnValidate,
        "nsslapd-entryusn-global": usnGlobal,
        "nsslapd-ignore-time-skew": ignoreSkew,
        "nsslapd-readonly": readOnly,
        // Record original values
        "_nsslapd-port": parseInt(attrs["nsslapd-port"][0]),
        "_nsslapd-secureport": parseInt(attrs["nsslapd-secureport"][0]),
        "_nsslapd-localhost": attrs["nsslapd-localhost"][0],
        "_nsslapd-listenhost": listenhost,
        "_nsslapd-bakdir": attrs["nsslapd-bakdir"][0],
        "_nsslapd-ldifdir": attrs["nsslapd-ldifdir"][0],
        "_nsslapd-schemadir": attrs["nsslapd-schemadir"][0],
        "_nsslapd-certdir": attrs["nsslapd-certdir"][0],
        "_nsslapd-rootdn": attrs["nsslapd-rootdn"][0],
        "_nsslapd-rootpw": attrs["nsslapd-rootpw"][0],
        _confirmRootpw: attrs["nsslapd-rootpw"][0],
        "_nsslapd-rootpwstoragescheme": attrs["nsslapd-rootpwstoragescheme"][0],
        "_nsslapd-anonlimitsdn": attrs["nsslapd-anonlimitsdn"][0],
        _haproxyIPs: attrs["nsslapd-haproxy-trusted-ip"] ? attrs["nsslapd-haproxy-trusted-ip"] : [],
        "_nsslapd-haproxy-trusted-ip": attrs["nsslapd-haproxy-trusted-ip"] ? attrs["nsslapd-haproxy-trusted-ip"] : [],
        "_nsslapd-disk-monitoring-threshold": parseInt(attrs["nsslapd-disk-monitoring-threshold"][0]),
        "_nsslapd-disk-monitoring-grace-period": parseInt(attrs["nsslapd-disk-monitoring-grace-period"][0]),
        "_nsslapd-allow-anonymous-access": attrs["nsslapd-allow-anonymous-access"][0],
        "_nsslapd-disk-monitoring": diskMonitoring,
        "_nsslapd-disk-monitoring-logging-critical": diskLogCritical,
        "_nsslapd-schemacheck": schemaCheck,
        "_nsslapd-syntaxcheck": syntaxCheck,
        "_nsslapd-plugin-logging": pluginLogging,
        "_nsslapd-syntaxlogging": syntaxLogging,
        "_nsslapd-plugin-binddn-tracking": bindDNTracking,
        "_nsslapd-attribute-name-exceptions": nameExceptions,
        "_nsslapd-dn-validate-strict": dnValidate,
        "_nsslapd-entryusn-global": usnGlobal,
        "_nsslapd-ignore-time-skew": ignoreSkew,
        "_nsslapd-readonly": readOnly
      }, () => {
        this.validateAllTabs();
        this.props.enableTree();
      });
    }
    handleSaveRootDN() {
      this.setState({
        rootDNReloading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of rootdn_attrs) {
        if (attr !== "confirmRootpw" && this.state["_" + attr] !== this.state[attr]) {
          cmd.push(attr + "=" + this.state[attr]);
        }
      }
      log_cmd("handleSaveRootDN", "Saving changes to root DN", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.reloadRootDN();
        this.props.addNotification(
          "success",
          _67("Successfully updated Directory Manager configuration")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.reloadRootDN();
        this.props.addNotification(
          "error",
          cockpit_default.format(_67("Error updating Directory Manager configuration - $0"), errMsg)
        );
      });
    }
    reloadRootDN() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("handleReloadConfig", "Reload Directory Manager configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        this.setState(
          () => ({
            rootDNReloading: false,
            "nsslapd-rootdn": attrs["nsslapd-rootdn"][0],
            "nsslapd-rootpw": attrs["nsslapd-rootpw"][0],
            confirmRootpw: attrs["nsslapd-rootpw"][0],
            "nsslapd-rootpwstoragescheme": attrs["nsslapd-rootpwstoragescheme"][0],
            // Record original values
            "_nsslapd-rootdn": attrs["nsslapd-rootdn"][0],
            "_nsslapd-rootpw": attrs["nsslapd-rootpw"][0],
            _confirmRootpw: attrs["nsslapd-rootpw"][0],
            "_nsslapd-rootpwstoragescheme": attrs["nsslapd-rootpwstoragescheme"][0],
            rootDNSaveDisabled: true
          })
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.setState({
          rootDNReloading: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_67("Error reloading Directory Manager configuration - $0"), errMsg)
        );
      });
    }
    handleSaveDiskMonitoring() {
      this.setState({
        diskMonReloading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of disk_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      log_cmd("handleSaveDiskMonitoring", "Saving changes to Disk Monitoring", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.reloadDiskMonitoring();
        this.props.addNotification(
          "success",
          _67("Successfully updated Disk Monitoring configuration")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.reloadDiskMonitoring();
        this.props.addNotification(
          "error",
          cockpit_default.format(_67("Error updating Disk Monitoring configuration - $0"), errMsg)
        );
      });
    }
    reloadDiskMonitoring() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("reloadDiskMonitoring", "Reload Disk Monitoring configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        let diskMonitoring = false;
        let diskLogCritical = false;
        if (attrs["nsslapd-disk-monitoring"][0] === "on") {
          diskMonitoring = true;
        }
        if (attrs["nsslapd-disk-monitoring-logging-critical"][0] === "on") {
          diskLogCritical = true;
        }
        this.setState(
          () => ({
            diskMonReloading: false,
            "nsslapd-disk-monitoring-threshold": attrs["nsslapd-disk-monitoring-threshold"][0],
            "nsslapd-disk-monitoring-grace-period": attrs["nsslapd-disk-monitoring-grace-period"][0],
            "nsslapd-disk-monitoring": diskMonitoring,
            "nsslapd-disk-monitoring-logging-critical": diskLogCritical,
            // Record original values
            "_nsslapd-disk-monitoring-threshold": attrs["nsslapd-disk-monitoring-threshold"][0],
            "_nsslapd-disk-monitoring-grace-period": attrs["nsslapd-disk-monitoring-grace-period"][0],
            "_nsslapd-disk-monitoring": diskMonitoring,
            "_nsslapd-disk-monitoring-logging-critical": diskLogCritical,
            diskMonSaveDisabled: true
          })
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.setState({
          diskMonReloading: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_67("Error reloading Disk Monitoring configuration - $0"), errMsg)
        );
      });
    }
    /* We use this function for multi-valued config attributes because they require a special treatment */
    handleMultivaluedAttributeReplace(attrs) {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "delete",
        "nsslapd-haproxy-trusted-ip"
      ];
      log_cmd("handleMultivaluedAttributeReplace", "Removing cn=config attribute", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        if (attrs.length > 0) {
          const cmd2 = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "config",
            "add",
            ...attrs
          ];
          log_cmd("handleMultivaluedAttributeReplace", "Adding multivalued cn=config attribute", cmd2);
          cockpit_default.spawn(cmd2, { superuser: true, err: "message" }).done((content2) => {
            this.reloadAdvanced();
            this.props.addNotification(
              "success",
              "Successfully updated Advanced configuration"
            );
          }).fail((err) => {
            const errMsg = getApiErrorMessage(err);
            this.reloadAdvanced();
            this.props.addNotification(
              "error",
              `Error updating Advanced configuration - ${errMsg}`
            );
          });
        } else {
          this.reloadAdvanced();
          this.props.addNotification(
            "success",
            "Successfully updated Advanced configuration"
          );
        }
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.reloadAdvanced();
        this.props.addNotification(
          "error",
          `Error updating Advanced configuration - ${errMsg}`
        );
      });
    }
    handleSaveAdvanced() {
      this.setState({
        advReloading: true
      });
      let doHaproxy = false;
      const addHAproxy = [];
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of adv_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          if (attr === "nsslapd-haproxy-trusted-ip") {
            if (this.state.haproxyIPs.sort().toString() !== this.state._haproxyIPs.sort().toString()) {
              doHaproxy = true;
              for (const val of this.state.haproxyIPs) {
                addHAproxy.push(attr + "=" + val);
              }
            }
          } else {
            let val = this.state[attr];
            if (typeof val === "boolean") {
              if (val) {
                val = "on";
              } else {
                val = "off";
              }
            }
            cmd.push(attr + "=" + val);
          }
        }
      }
      if (cmd.length === 5 && doHaproxy) {
        this.handleMultivaluedAttributeReplace(addHAproxy);
        return;
      }
      log_cmd("handleSaveAdvanced", "Saving Advanced configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        if (doHaproxy) {
          this.handleMultivaluedAttributeReplace(addHAproxy);
        } else {
          this.reloadAdvanced();
          this.props.addNotification(
            "success",
            _67("Successfully updated Advanced configuration")
          );
        }
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.reloadAdvanced();
        this.props.addNotification(
          "error",
          cockpit_default.format(_67("Error updating Advanced configuration - $0"), errMsg)
        );
      });
    }
    reloadAdvanced() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("reloadAdvanced", "Reload Advanced configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        let schemaCheck = false;
        let syntaxCheck = false;
        let pluginLogging = false;
        let syntaxLogging = false;
        let bindDNTracking = false;
        let nameExceptions = false;
        let dnValidate = false;
        let usnGlobal = false;
        let ignoreSkew = false;
        let readOnly = false;
        if (attrs["nsslapd-entryusn-global"][0] === "on") {
          usnGlobal = true;
        }
        if (attrs["nsslapd-ignore-time-skew"][0] === "on") {
          ignoreSkew = true;
        }
        if (attrs["nsslapd-readonly"][0] === "on") {
          readOnly = true;
        }
        if (attrs["nsslapd-schemacheck"][0] === "on") {
          schemaCheck = true;
        }
        if (attrs["nsslapd-syntaxcheck"][0] === "on") {
          syntaxCheck = true;
        }
        if (attrs["nsslapd-plugin-logging"][0] === "on") {
          pluginLogging = true;
        }
        if (attrs["nsslapd-syntaxlogging"][0] === "on") {
          syntaxLogging = true;
        }
        if (attrs["nsslapd-plugin-binddn-tracking"][0] === "on") {
          bindDNTracking = true;
        }
        if (attrs["nsslapd-attribute-name-exceptions"][0] === "on") {
          nameExceptions = true;
        }
        if (attrs["nsslapd-dn-validate-strict"][0] === "on") {
          dnValidate = true;
        }
        this.setState(
          () => ({
            "nsslapd-anonlimitsdn": attrs["nsslapd-anonlimitsdn"][0],
            haproxyIPs: attrs["nsslapd-haproxy-trusted-ip"] ? attrs["nsslapd-haproxy-trusted-ip"] : [],
            "nsslapd-haproxy-trusted-ip": attrs["nsslapd-haproxy-trusted-ip"] ? attrs["nsslapd-haproxy-trusted-ip"] : [],
            "nsslapd-allow-anonymous-access": attrs["nsslapd-allow-anonymous-access"][0],
            "nsslapd-schemacheck": schemaCheck,
            "nsslapd-syntaxcheck": syntaxCheck,
            "nsslapd-plugin-logging": pluginLogging,
            "nsslapd-syntaxLogging": syntaxLogging,
            "nsslapd-plugin-binddn-tracking": bindDNTracking,
            "nsslapd-attribute-name-exceptions": nameExceptions,
            "nsslapd-dn-validate-strict": dnValidate,
            "nsslapd-entryusn-global": usnGlobal,
            "nsslapd-ignore-time-skew": ignoreSkew,
            "nsslapd-readonly": readOnly,
            // Record original values
            "_nsslapd-anonlimitsdn": attrs["nsslapd-anonlimitsdn"][0],
            _haproxyIPs: attrs["nsslapd-haproxy-trusted-ip"] ? attrs["nsslapd-haproxy-trusted-ip"] : [],
            "_nsslapd-haproxy-trusted-ip": attrs["nsslapd-haproxy-trusted-ip"] ? attrs["nsslapd-haproxy-trusted-ip"] : [],
            "_nsslapd-allow-anonymous-access": attrs["nsslapd-allow-anonymous-access"][0],
            "_nsslapd-schemacheck": schemaCheck,
            "_nsslapd-syntaxcheck": syntaxCheck,
            "_nsslapd-plugin-logging": pluginLogging,
            "_nsslapd-syntaxLogging": syntaxLogging,
            "_nsslapd-plugin-binddn-tracking": bindDNTracking,
            "_nsslapd-attribute-name-exceptions": nameExceptions,
            "_nsslapd-dn-validate-strict": dnValidate,
            "_nsslapd-entryusn-global": usnGlobal,
            "_nsslapd-ignore-time-skew": ignoreSkew,
            "_nsslapd-readonly": readOnly,
            advReloading: false,
            advSaveDisabled: true,
            isHaproxyIPsOpen: false
          })
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_67("Error loading Advanced configuration - $0"), errMsg)
        );
        this.setState({
          advReloading: false
        });
      });
    }
    handleSaveConfig() {
      this.setState({
        configReloading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of general_attrs3) {
        if (this.state["_" + attr] !== this.state[attr]) {
          cmd.push(attr + "=" + this.state[attr]);
        }
      }
      log_cmd("handleSaveConfig", "Applying server config change", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleReloadConfig();
        this.props.addNotification(
          "warning",
          _67("Successfully updated server configuration.  These changes require the server to be restarted to take effect.")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.handleReloadConfig();
        this.props.addNotification(
          "error",
          cockpit_default.format(_67("Error updating server configuration - $0"), errMsg)
        );
      });
    }
    handleReloadConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("handleReloadConfig", "Reload server configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        let listenhost = "";
        if ("nsslapd-listenhost" in attrs) {
          listenhost = attrs["nsslapd-listenhost"][0];
        }
        this.setState(
          () => ({
            configReloading: false,
            configSaveDisabled: true,
            errObjConfig: {},
            errObjRootDN: {},
            errObjDiskMon: {},
            errObjAdv: {},
            "nsslapd-port": attrs["nsslapd-port"][0],
            "nsslapd-secureport": attrs["nsslapd-secureport"][0],
            "nsslapd-localhost": attrs["nsslapd-localhost"][0],
            "nsslapd-listenhost": listenhost,
            "nsslapd-bakdir": attrs["nsslapd-bakdir"][0],
            "nsslapd-ldifdir": attrs["nsslapd-ldifdir"][0],
            "nsslapd-schemadir": attrs["nsslapd-schemadir"][0],
            "nsslapd-certdir": attrs["nsslapd-certdir"][0],
            // Record original values
            "_nsslapd-port": attrs["nsslapd-port"][0],
            "_nsslapd-secureport": attrs["nsslapd-secureport"][0],
            "_nsslapd-localhost": attrs["nsslapd-localhost"][0],
            "_nsslapd-listenhost": listenhost,
            "_nsslapd-bakdir": attrs["nsslapd-bakdir"][0],
            "_nsslapd-ldifdir": attrs["nsslapd-ldifdir"][0],
            "_nsslapd-schemadir": attrs["nsslapd-schemadir"][0],
            "_nsslapd-certdir": attrs["nsslapd-certdir"][0]
          })
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_67("Error reloading server configuration - $0"), errMsg)
        );
        this.setState({
          configReloading: false
        });
      });
    }
    render() {
      let body = "";
      let diskMonitor = "";
      let saveBtnName = _67("Save Settings");
      const extraPrimaryProps = {};
      if (this.state.configReloading || this.state.rootDNReloading || this.state.diskMonReloading || this.state.advReloading) {
        saveBtnName = _67("Saving settings ...");
        extraPrimaryProps.spinnerAriaValueText = _67("Saving");
      }
      if (this.state["nsslapd-disk-monitoring"]) {
        diskMonitor = /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Form, { isHorizontal: true, autoComplete: "off", className: "ds-margin-top-lg ds-left-indent-lg ds-margin-bottom", children: [
          /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
            Grid,
            {
              title: _67("The available disk space, in bytes, that will trigger the shutdown process. Default is 2mb. Once below half of the threshold then we enter the shutdown mode. Value range: 4096 - 9223372036854775807. (nsslapd-disk-monitoring-threshold)"),
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 3, children: _67("Disk Monitoring Threshold") }),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(GridItem, { span: 9, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-disk-monitoring-threshold"],
                      min: 4096,
                      max: 922337203685477,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-disk-monitoring-threshold", "diskmon");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-disk-monitoring-threshold", 1, 922337203685477, "diskmon");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-disk-monitoring-threshold", "diskmon");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 8
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(FormHelperText, { children: _67("Value must be greater than or equal to 4096") })
                ] })
              ]
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
            Grid,
            {
              title: _67("How many minutes to wait to allow an admin to clean up disk space before shutting slapd down. The default is 60 minutes. (nsslapd-disk-monitoring-grace-period)"),
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 3, children: _67("Disk Monitoring Grace Period") }),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                  NumberInput,
                  {
                    value: this.state["nsslapd-disk-monitoring-grace-period"],
                    min: 1,
                    max: 2147483647,
                    onMinus: () => {
                      this.onMinusConfig("nsslapd-disk-monitoring-grace-period", "diskmon");
                    },
                    onChange: (e) => {
                      this.onConfigChange(e, "nsslapd-disk-monitoring-grace-period", 1, 2147483647, "diskmon");
                    },
                    onPlus: () => {
                      this.onPlusConfig("nsslapd-disk-monitoring-grace-period", "diskmon");
                    },
                    inputName: "input",
                    inputAriaLabel: "number input",
                    minusBtnAriaLabel: "minus",
                    plusBtnAriaLabel: "plus",
                    widthChars: 8
                  }
                ) })
              ]
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
            Grid,
            {
              className: "ds-margin-top",
              title: _67("When disk space gets critically low do not remove logs to free up disk space. (nsslapd-disk-monitoring-logging-critical)"),
              children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                Checkbox,
                {
                  id: "nsslapd-disk-monitoring-logging-critical",
                  isChecked: this.state["nsslapd-disk-monitoring-logging-critical"],
                  onChange: (e, str) => {
                    this.handleChange(e, "diskmon");
                  },
                  label: _67("Preserve Logs Even If Disk Space Gets Low")
                }
              ) })
            }
          )
        ] });
      }
      if (this.state.loading) {
        body = /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "ds-loading-spinner ds-margin-top ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Text, { component: TextVariants.h3, children: '_("Loading Server Settings ...")' }) }),
          /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Spinner, { className: "ds-margin-top", size: "md" })
        ] });
      } else {
        body = /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "ds-margin-bottom-md", children: [
          /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Text, { component: TextVariants.h3, children: [
            _67("Server Settings"),
            /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
              Button,
              {
                variant: "plain",
                "aria-label": _67("Refresh configuration settings"),
                onClick: this.handleReloadConfig,
                children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(SyncAltIcon, { size: "lg" })
              }
            )
          ] }) }) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: this.state.loading ? "ds-fadeout" : "ds-fadein ds-left-margin", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Tabs, { isFilled: true, className: "ds-margin-top-lg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
            /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(TabTitleText, { children: _67("General Settings") }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Form, { autoComplete: "off", className: "ds-margin-top-xlg ds-left-margin", children: [
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
                  Grid,
                  {
                    title: _67("The version of the Directory Server package"),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 2, children: _67("Server Version") }),
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                        TextInput,
                        {
                          value: this.props.version,
                          type: "text",
                          id: "server-version",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "server-version",
                          isDisabled: true
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
                  Grid,
                  {
                    title: _67("The server's local hostname (nsslapd-localhost)."),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 2, children: _67("Server Hostname") }),
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                        TextInput,
                        {
                          value: this.state["nsslapd-localhost"],
                          type: "text",
                          id: "nsslapd-localhost",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "server-hostname",
                          onChange: (e, str) => {
                            this.handleChange(e, "config");
                          },
                          validated: this.state.errObjConfig["nsslapd-localhost"] ? ValidatedOptions.error : ValidatedOptions.default
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
                  Grid,
                  {
                    title: _67("The server's port number (nsslapd-port)."),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 2, children: _67("LDAP Port") }),
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(GridItem, { span: 9, children: [
                        /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                          NumberInput,
                          {
                            value: this.state["nsslapd-port"],
                            min: 1,
                            max: 65534,
                            onMinus: () => {
                              this.onMinusConfig("nsslapd-port", "config");
                            },
                            onChange: (e) => {
                              this.onConfigChange(e, "nsslapd-port", 1, 65534, "config");
                            },
                            onBlur: () => {
                              this.validatePortOnBlur("nsslapd-port");
                            },
                            onPlus: () => {
                              this.onPlusConfig("nsslapd-port", "config");
                            },
                            inputName: "input",
                            inputAriaLabel: "number input",
                            minusBtnAriaLabel: "minus",
                            plusBtnAriaLabel: "plus",
                            widthChars: 8
                          }
                        ),
                        this.state.errObjConfig["nsslapd-port"] && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(HelperTextItem, { variant: "error", children: "This port is already in use, please choose another." }) })
                      ] })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
                  Grid,
                  {
                    title: _67("The server's secure port number (nsslapd-secureport)."),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 2, children: _67("LDAPS Port") }),
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(GridItem, { span: 9, children: [
                        /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                          NumberInput,
                          {
                            value: this.state["nsslapd-secureport"],
                            min: 1,
                            max: 65534,
                            onMinus: () => {
                              this.onMinusConfig("nsslapd-secureport", "config");
                            },
                            onChange: (e) => {
                              this.onConfigChange(e, "nsslapd-secureport", 1, 65534, "config");
                            },
                            onBlur: () => {
                              this.validatePortOnBlur("nsslapd-secureport");
                            },
                            onPlus: () => {
                              this.onPlusConfig("nsslapd-secureport", "config");
                            },
                            inputName: "input",
                            inputAriaLabel: "number input",
                            minusBtnAriaLabel: "minus",
                            plusBtnAriaLabel: "plus",
                            widthChars: 8
                          }
                        ),
                        this.state.errObjConfig["nsslapd-secureport"] && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(HelperTextItem, { variant: "error", children: "This port is already in use, please choose another." }) })
                      ] })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
                  Grid,
                  {
                    title: _67("This parameter can be used to restrict the Directory Server instance to a single IP interface (hostname, or IP address).  Requires restart. (nsslapd-listenhost)."),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 2, children: _67("Listen Host Address") }),
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                        TextInput,
                        {
                          value: this.state["nsslapd-listenhost"],
                          type: "text",
                          id: "nsslapd-listenhost",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "server-listenhost",
                          onChange: (e, str) => {
                            this.handleChange(e, "config");
                          },
                          validated: this.state.errObjConfig["nsslapd-listenhost"] ? ValidatedOptions.error : ValidatedOptions.default
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
                  Grid,
                  {
                    title: this.state.errObjConfig["nsslapd-bakdir"] ? _67("Invalid backup directory path!") : _67("The location where database backups are stored (nsslapd-bakdir)."),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 2, children: _67("Backup Directory") }),
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(GridItem, { span: 9, children: [
                        /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                          TextInput,
                          {
                            value: this.state["nsslapd-bakdir"],
                            type: "text",
                            id: "nsslapd-bakdir",
                            "aria-describedby": "horizontal-form-name-helper",
                            name: "server-bakdir",
                            onChange: (e, str) => {
                              this.handleChange(e, "config");
                            },
                            validated: this.state.errObjConfig["nsslapd-bakdir"] ? ValidatedOptions.error : ValidatedOptions.default
                          }
                        ),
                        this.state.errObjConfig["nsslapd-bakdir"] && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(FormHelperText, { children: "Invalid path" })
                      ] })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
                  Grid,
                  {
                    title: this.state.errObjConfig["nsslapd-ldifdir"] ? _67("Invalid LDIF directory path!") : _67("The location where the server's LDIF files are located (nsslapd-ldifdir)."),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 2, children: _67("LDIF File Directory") }),
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(GridItem, { span: 9, children: [
                        /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                          TextInput,
                          {
                            value: this.state["nsslapd-ldifdir"],
                            type: "text",
                            id: "nsslapd-ldifdir",
                            "aria-describedby": "horizontal-form-name-helper",
                            name: "server-ldifdir",
                            onChange: (e, str) => {
                              this.handleChange(e, "config");
                            },
                            validated: this.state.errObjConfig["nsslapd-ldifdir"] ? ValidatedOptions.error : ValidatedOptions.default
                          }
                        ),
                        this.state.errObjConfig["nsslapd-ldifdir"] && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(FormHelperText, { children: "Invalid path" })
                      ] })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
                  Grid,
                  {
                    title: this.state.errObjConfig["nsslapd-schemadir"] ? _67("Invalid schema directory path!") : _67("The location for the servers custom schema files. (nsslapd-schemadir)."),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 2, children: _67("Schema Directory") }),
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(GridItem, { span: 9, children: [
                        /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                          TextInput,
                          {
                            value: this.state["nsslapd-schemadir"],
                            type: "text",
                            id: "nsslapd-schemadir",
                            "aria-describedby": "horizontal-form-name-helper",
                            name: "server-schemadir",
                            onChange: (e, str) => {
                              this.handleChange(e, "config");
                            },
                            validated: this.state.errObjConfig["nsslapd-schemadir"] ? ValidatedOptions.error : ValidatedOptions.default
                          }
                        ),
                        this.state.errObjConfig["nsslapd-schemadir"] && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(FormHelperText, { children: "Invalid path" })
                      ] })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
                  Grid,
                  {
                    title: this.state.errObjConfig["nsslapd-certdir"] ? _67("Invalid certificate directory path!") : _67("The location of the server's certificates (nsslapd-certdir)."),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 2, children: _67("Certificate Directory") }),
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(GridItem, { span: 9, children: [
                        /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                          TextInput,
                          {
                            value: this.state["nsslapd-certdir"],
                            type: "text",
                            id: "nsslapd-certdir",
                            "aria-describedby": "horizontal-form-name-helper",
                            name: "server-certdir",
                            onChange: (e, str) => {
                              this.handleChange(e, "config");
                            },
                            validated: this.state.errObjConfig["nsslapd-certdir"] ? ValidatedOptions.error : ValidatedOptions.default
                          }
                        ),
                        this.state.errObjConfig["nsslapd-certdir"] && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(FormHelperText, { children: "Invalid path" })
                      ] })
                    ]
                  }
                )
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                Button,
                {
                  isDisabled: this.state.configSaveDisabled || this.state.configReloading,
                  variant: "primary",
                  className: "ds-margin-top-xlg ds-left-margin",
                  onClick: this.handleSaveConfig,
                  isLoading: this.state.configReloading,
                  spinnerAriaValueText: this.state.configReloading ? _67("Saving") : void 0,
                  ...extraPrimaryProps,
                  children: saveBtnName
                }
              )
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(TabTitleText, { children: _67("Directory Manager") }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Form, { className: "ds-margin-top-xlg ds-left-margin", isHorizontal: true, children: [
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
                  Grid,
                  {
                    title: _67("The DN of the unrestricted directory manager (nsslapd-rootdn)."),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 3, children: _67("Directory Manager DN") }),
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                        TextInput,
                        {
                          value: this.state["nsslapd-rootdn"],
                          type: "text",
                          id: "nsslapd-rootdn",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "nsslapd-rootdn",
                          isDisabled: true
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
                  Grid,
                  {
                    title: _67("The password for the Root DN/Directory Manager (nsslapd-rootpw)."),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 3, children: _67("Directory Manager Password") }),
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                        TextInput,
                        {
                          value: this.state["nsslapd-rootpw"],
                          type: "password",
                          id: "nsslapd-rootpw",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "nsslapd-rootpw",
                          onChange: (e, str) => {
                            this.handleChange(e, "rootdn");
                          },
                          validated: this.state.errObjRootDN["nsslapd-rootpw"] ? ValidatedOptions.error : ValidatedOptions.default
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
                  Grid,
                  {
                    title: _67("Confirm the Directory Manager password"),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 3, children: _67("Confirm Password") }),
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                        TextInput,
                        {
                          value: this.state.confirmRootpw,
                          type: "password",
                          id: "confirmRootpw",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "confirmRootpw",
                          onChange: (e, str) => {
                            this.handleChange(e, "rootdn");
                          },
                          validated: this.state.errObjRootDN.confirmRootpw ? ValidatedOptions.error : ValidatedOptions.default
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
                  Grid,
                  {
                    title: _67("Set the Directory Manager password storage scheme (nsslapd-rootpwstoragescheme)."),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 3, children: _67("Password Storage Scheme") }),
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                        FormSelect,
                        {
                          id: "nsslapd-rootpwstoragescheme",
                          value: this.state["nsslapd-rootpwstoragescheme"],
                          onChange: (e, str) => {
                            this.handleChange(e, "rootdn");
                          },
                          "aria-label": "FormSelect Input",
                          children: this.options.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(FormSelectOption, { value: option.value, label: option.label }, index))
                        }
                      ) })
                    ]
                  }
                )
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                Button,
                {
                  variant: "primary",
                  className: "ds-margin-top-xlg ds-left-margin",
                  isDisabled: this.state.rootDNSaveDisabled || this.state.rootDNReloading,
                  onClick: this.handleSaveRootDN,
                  isLoading: this.state.rootDNReloading,
                  spinnerAriaValueText: this.state.rootDNReloading ? _67("Saving") : void 0,
                  ...extraPrimaryProps,
                  children: saveBtnName
                }
              )
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(TabTitleText, { children: _67("Disk Monitoring") }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Form, { className: "ds-margin-left ds-margin-top-xlg", autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                Checkbox,
                {
                  id: "nsslapd-disk-monitoring",
                  isChecked: this.state["nsslapd-disk-monitoring"],
                  onChange: (e, str) => {
                    this.handleChange(e, "diskmon");
                  },
                  label: _67("Enable Disk Space Monitoring")
                }
              ) }),
              diskMonitor,
              /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                Button,
                {
                  isDisabled: this.state.diskMonSaveDisabled || this.state.diskMonReloading,
                  variant: "primary",
                  className: "ds-margin-top-xlg",
                  onClick: this.handleSaveDiskMonitoring,
                  isLoading: this.state.diskMonReloading,
                  spinnerAriaValueText: this.state.diskMonReloading ? _67("Saving") : void 0,
                  ...extraPrimaryProps,
                  children: saveBtnName
                }
              )
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Tab, { eventKey: 3, title: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(TabTitleText, { children: _67("Advanced Settings") }), children: [
              /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Form, { className: "ds-margin-top-xlg ds-left-margin", isHorizontal: true, autoComplete: "off", children: [
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Grid, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                    Checkbox,
                    {
                      id: "nsslapd-schemacheck",
                      isChecked: this.state["nsslapd-schemacheck"],
                      onChange: (e, str) => {
                        this.handleChange(e, "adv");
                      },
                      title: _67("Enable schema checking (nsslapd-schemacheck)."),
                      "aria-label": "uncontrolled checkbox example",
                      label: _67("Enable Schema Checking")
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                    Checkbox,
                    {
                      id: "nsslapd-syntaxcheck",
                      isChecked: this.state["nsslapd-syntaxcheck"],
                      onChange: (e, str) => {
                        this.handleChange(e, "adv");
                      },
                      title: _67("Enable attribute syntax checking (nsslapd-syntaxcheck)."),
                      label: _67("Enable Attribute Syntax Checking")
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Grid, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                    Checkbox,
                    {
                      id: "nsslapd-plugin-logging",
                      isChecked: this.state["nsslapd-plugin-logging"],
                      onChange: (e, str) => {
                        this.handleChange(e, "adv");
                      },
                      title: _67("Enable plugins to log access and audit events.  (nsslapd-plugin-logging)."),
                      label: _67("Enable Plugin Logging")
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                    Checkbox,
                    {
                      id: "nsslapd-syntaxlogging",
                      isChecked: this.state["nsslapd-syntaxlogging"],
                      onChange: (e, str) => {
                        this.handleChange(e, "adv");
                      },
                      title: _67("Enable syntax logging (nsslapd-syntaxlogging)."),
                      label: _67("Enable Attribute Syntax Logging")
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Grid, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                    Checkbox,
                    {
                      id: "nsslapd-plugin-binddn-tracking",
                      isChecked: this.state["nsslapd-plugin-binddn-tracking"],
                      onChange: (e, str) => {
                        this.handleChange(e, "adv");
                      },
                      label: _67("Enable Plugin Bind DN Tracking"),
                      title: _67("Enabling this feature will write new operational attributes to the modified entry: internalModifiersname & internalCreatorsname. These new attributes contain the plugin DN, while modifiersname will be the original binding entry that triggered the update. (nsslapd-plugin-binddn-tracking).")
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                    Checkbox,
                    {
                      id: "nsslapd-attribute-name-exceptions",
                      isChecked: this.state["nsslapd-attribute-name-exceptions"],
                      onChange: (e, str) => {
                        this.handleChange(e, "adv");
                      },
                      title: _67("Allows non-standard characters in attribute names to be used for backwards compatibility with older servers (nsslapd-attribute-name-exceptions)."),
                      label: _67("Allow Attribute Naming Exceptions")
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Grid, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                    Checkbox,
                    {
                      id: "nsslapd-dn-validate-strict",
                      isChecked: this.state["nsslapd-dn-validate-strict"],
                      onChange: (e, str) => {
                        this.handleChange(e, "adv");
                      },
                      label: _67("Strict DN Syntax Validation"),
                      title: _67("Enables strict syntax validation for DNs, according to section 3 in RFC 4514 (nsslapd-dn-validate-strict).")
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                    Checkbox,
                    {
                      id: "nsslapd-entryusn-global",
                      isChecked: this.state["nsslapd-entryusn-global"],
                      onChange: (e, str) => {
                        this.handleChange(e, "adv");
                      },
                      title: _67("For USN plugin - maintain unique USNs across all back end databases (nsslapd-entryusn-global)."),
                      label: _67("Maintain Unique USNs Across All Backends")
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Grid, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                    Checkbox,
                    {
                      id: "nsslapd-ignore-time-skew",
                      isChecked: this.state["nsslapd-ignore-time-skew"],
                      onChange: (e, str) => {
                        this.handleChange(e, "adv");
                      },
                      title: _67("Ignore replication time skew when acquiring a replica to start a replciation session (nsslapd-ignore-time-skew)."),
                      label: _67("Ignore CSN Time Skew")
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                    Checkbox,
                    {
                      id: "nsslapd-readonly",
                      isChecked: this.state["nsslapd-readonly"],
                      onChange: (e, str) => {
                        this.handleChange(e, "adv");
                      },
                      title: _67("Make entire server read-only (nsslapd-readonly)"),
                      label: _67("Server Read-Only")
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
                  Grid,
                  {
                    className: "ds-margin-top",
                    title: _67("Allow anonymous binds to the server (nsslapd-allow-anonymous-access)."),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 3, children: _67("Allow Anonymous Access") }),
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
                        FormSelect,
                        {
                          id: "nsslapd-allow-anonymous-access",
                          value: this.state["nsslapd-allow-anonymous-access"],
                          onChange: (e, str) => {
                            this.handleChange(e, "adv");
                          },
                          "aria-label": "FormSelect Input",
                          children: [
                            /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(FormSelectOption, { value: "on", label: "on" }, "0"),
                            /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(FormSelectOption, { value: "off", label: "off" }, "1"),
                            /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                              FormSelectOption,
                              {
                                value: "rootdse",
                                label: "rootdse",
                                title: _67("Allows anonymous search and read access to search the root DSE itself, but restricts access to all other directory entries. ")
                              },
                              "2"
                            )
                          ]
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
                  Grid,
                  {
                    title: _67("The DN of a template entry containing the resource limits to apply to anonymous connections (nsslapd-anonlimitsdn)."),
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 3, children: _67("Anonymous Resource Limits DN") }),
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                        TextInput,
                        {
                          value: this.state["nsslapd-anonlimitsdn"],
                          type: "text",
                          id: "nsslapd-anonlimitsdn",
                          "aria-describedby": "horizontal-form-name-helper",
                          name: "nsslapd-anonlimitsdn",
                          onChange: (e, str) => {
                            this.handleChange(e, "adv");
                          },
                          validated: this.state.errObjAdv.anonLimitsDN ? ValidatedOptions.error : ValidatedOptions.default
                        }
                      ) })
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
                  Grid,
                  {
                    title: "HAProxy header is only checked if this setting (nsslapd-haproxy-trusted-ip) is configured. It should have a list of trusted HAProxy server IPs or subnets in CIDR notation (e.g., 192.168.1.0/24)",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(GridItem, { className: "ds-label", span: 3, children: "Trusted HAProxy Server IPs/Subnets" }),
                      /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(GridItem, { span: 5, children: [
                        /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                          dsBasicComponents_default,
                          {
                            selected: this.state.haproxyIPs,
                            onSelect: (e, selection) => {
                              this.handleOnHaproxyIPsSelect(e, selection, "adv");
                            },
                            onClear: (e) => {
                              this.handleOnHaproxyIPsClear(e, "adv");
                            },
                            options: [],
                            isOpen: this.state.isHaproxyIPsOpen,
                            onToggle: this.handleOnHaproxyIPsToggle,
                            placeholder: "Type trusted HAProxy server IP or subnet (e.g., 192.168.1.0/24)",
                            ariaLabel: "Type trusted HAProxy server IP address or CIDR subnet",
                            validated: this.state.invalidIP ? "error" : "default",
                            isMulti: true,
                            isCreatable: true,
                            onCreateOption: this.handleOnCreateHaproxyIP
                          }
                        ),
                        this.state.invalidIP && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(HelperText, { className: "ds-left-margin", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(HelperTextItem, { variant: "error", children: "Invalid format for IP address or CIDR subnet" }) })
                      ] })
                    ]
                  }
                )
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
                Button,
                {
                  isDisabled: this.state.advSaveDisabled || this.state.advReloading,
                  variant: "primary",
                  className: "ds-margin-top-xlg ds-left-margin",
                  onClick: this.handleSaveAdvanced,
                  isLoading: this.state.advReloading,
                  spinnerAriaValueText: this.state.advReloading ? _67("Saving") : void 0,
                  ...extraPrimaryProps,
                  children: saveBtnName
                }
              )
            ] })
          ] }) })
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
        "div",
        {
          id: "server-settings-page",
          className: this.state.configReloading || this.state.rootDNReloading || this.state.diskMonReloading || this.state.advReloading ? "ds-disabled" : "",
          children: body
        }
      );
    }
  };
  ServerSettings.propTypes = {
    addNotification: import_prop_types66.default.func,
    serverId: import_prop_types66.default.string,
    version: import_prop_types66.default.string,
    attrs: import_prop_types66.default.object
  };
  ServerSettings.defaultProps = {
    serverId: "",
    version: "",
    attrs: {}
  };

  // src/lib/server/tuning.jsx
  var import_react138 = __toESM(require_react(), 1);
  var import_prop_types67 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1);
  var tuning_attrs = [
    "nsslapd-ndn-cache-enabled",
    "nsslapd-ignore-virtual-attrs",
    "nsslapd-connection-nocanon",
    "nsslapd-enable-turbo-mode",
    "nsslapd-threadnumber",
    "nsslapd-maxthreadsperconn",
    "nsslapd-maxdescriptors",
    "nsslapd-timelimit",
    "nsslapd-sizelimit",
    "nsslapd-pagedsizelimit",
    "nsslapd-idletimeout",
    "nsslapd-ioblocktimeout",
    "nsslapd-outbound-ldap-io-timeout",
    "nsslapd-maxbersize",
    "nsslapd-maxsasliosize",
    "nsslapd-listen-backlog-size",
    "nsslapd-max-filter-nest-level",
    "nsslapd-maxcontrolsperop",
    "nsslapd-tcp-fin-timeout",
    "nsslapd-tcp-keepalive-time",
    "nsslapd-maxsimplepaged-per-conn"
  ];
  var _68 = cockpit_default.gettext;
  var ServerTuning = class extends import_react138.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: false,
        loaded: false,
        activeKey: 1,
        saveDisabled: true,
        errObj: {},
        attrs: this.props.attrs
      };
      this.maxValue = 2e9;
      this.onMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.onConfigChange = (event, id, min3, max3) => {
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > maxValue ? maxValue : newValue < min3 ? min3 : newValue
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
      this.handleChange = this.handleChange.bind(this);
      this.loadConfig = this.loadConfig.bind(this);
      this.handleSaveConfig = this.handleSaveConfig.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.loadConfig();
      } else {
        this.props.enableTree();
      }
    }
    validateSaveBtn() {
      let saveBtnDisabled = true;
      for (const config_attr of tuning_attrs) {
        if (this.state[config_attr].toString() !== this.state["_" + config_attr].toString()) {
          saveBtnDisabled = false;
          break;
        }
      }
      this.setState({
        saveDisabled: saveBtnDisabled
      });
    }
    handleChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn();
      });
    }
    loadConfig(reloading) {
      if (reloading) {
        this.setState({
          loaded: false
        });
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("loadConfig", "Load server tuning configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        let ndnEnabled = false;
        let ignoreVirtAttrs = false;
        let connNoCannon = false;
        let turboMode = false;
        if (attrs["nsslapd-ndn-cache-enabled"][0] === "on") {
          ndnEnabled = true;
        }
        if (attrs["nsslapd-ignore-virtual-attrs"][0] === "on") {
          ignoreVirtAttrs = true;
        }
        if (attrs["nsslapd-connection-nocanon"][0] === "on") {
          connNoCannon = true;
        }
        if (attrs["nsslapd-enable-turbo-mode"][0] === "on") {
          turboMode = true;
        }
        this.setState({
          loaded: true,
          loading: false,
          saveDisabled: true,
          // Settings
          "nsslapd-ndn-cache-enabled": ndnEnabled,
          "nsslapd-ignore-virtual-attrs": ignoreVirtAttrs,
          "nsslapd-connection-nocanon": connNoCannon,
          "nsslapd-enable-turbo-mode": turboMode,
          "nsslapd-threadnumber": parseInt(attrs["nsslapd-threadnumber"][0]),
          "nsslapd-maxthreadsperconn": parseInt(attrs["nsslapd-maxthreadsperconn"][0]),
          "nsslapd-maxdescriptors": parseInt(attrs["nsslapd-maxdescriptors"][0]),
          "nsslapd-timelimit": parseInt(attrs["nsslapd-timelimit"][0]),
          "nsslapd-sizelimit": parseInt(attrs["nsslapd-sizelimit"][0]),
          "nsslapd-pagedsizelimit": parseInt(attrs["nsslapd-pagedsizelimit"][0]),
          "nsslapd-idletimeout": parseInt(attrs["nsslapd-idletimeout"][0]),
          "nsslapd-ioblocktimeout": parseInt(attrs["nsslapd-ioblocktimeout"][0]),
          "nsslapd-outbound-ldap-io-timeout": parseInt(attrs["nsslapd-outbound-ldap-io-timeout"][0]),
          "nsslapd-maxbersize": parseInt(attrs["nsslapd-maxbersize"][0]),
          "nsslapd-maxsasliosize": parseInt(attrs["nsslapd-maxsasliosize"][0]),
          "nsslapd-listen-backlog-size": parseInt(attrs["nsslapd-listen-backlog-size"][0]),
          "nsslapd-max-filter-nest-level": parseInt(attrs["nsslapd-max-filter-nest-level"][0]),
          "nsslapd-maxcontrolsperop": parseInt(attrs["nsslapd-maxcontrolsperop"][0]),
          "nsslapd-tcp-fin-timeout": parseInt(attrs["nsslapd-tcp-fin-timeout"][0]),
          "nsslapd-tcp-keepalive-time": parseInt(attrs["nsslapd-tcp-keepalive-time"][0]),
          "nsslapd-maxsimplepaged-per-conn": parseInt(attrs["nsslapd-maxsimplepaged-per-conn"][0]),
          // Record original values
          "_nsslapd-ndn-cache-enabled": ndnEnabled,
          "_nsslapd-ignore-virtual-attrs": ignoreVirtAttrs,
          "_nsslapd-connection-nocanon": connNoCannon,
          "_nsslapd-enable-turbo-mode": turboMode,
          "_nsslapd-threadnumber": parseInt(attrs["nsslapd-threadnumber"][0]),
          "_nsslapd-maxthreadsperconn": parseInt(attrs["nsslapd-maxthreadsperconn"][0]),
          "_nsslapd-maxdescriptors": parseInt(attrs["nsslapd-maxdescriptors"][0]),
          "_nsslapd-timelimit": parseInt(attrs["nsslapd-timelimit"][0]),
          "_nsslapd-sizelimit": parseInt(attrs["nsslapd-sizelimit"][0]),
          "_nsslapd-pagedsizelimit": parseInt(attrs["nsslapd-pagedsizelimit"][0]),
          "_nsslapd-idletimeout": parseInt(attrs["nsslapd-idletimeout"][0]),
          "_nsslapd-ioblocktimeout": parseInt(attrs["nsslapd-ioblocktimeout"][0]),
          "_nsslapd-outbound-ldap-io-timeout": parseInt(attrs["nsslapd-outbound-ldap-io-timeout"][0]),
          "_nsslapd-maxbersize": parseInt(attrs["nsslapd-maxbersize"][0]),
          "_nsslapd-maxsasliosize": parseInt(attrs["nsslapd-maxsasliosize"][0]),
          "_nsslapd-listen-backlog-size": parseInt(attrs["nsslapd-listen-backlog-size"][0]),
          "_nsslapd-max-filter-nest-level": parseInt(attrs["nsslapd-max-filter-nest-level"][0]),
          "_nsslapd-maxcontrolsperop": parseInt(attrs["nsslapd-maxcontrolsperop"][0]),
          "_nsslapd-tcp-fin-timeout": parseInt(attrs["nsslapd-tcp-fin-timeout"][0]),
          "_nsslapd-tcp-keepalive-time": parseInt(attrs["nsslapd-tcp-keepalive-time"][0]),
          "_nsslapd-maxsimplepaged-per-conn": parseInt(attrs["nsslapd-maxsimplepaged-per-conn"][0])
        }, this.props.enableTree());
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.setState({
          loaded: true
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_68("Error loading server configuration - $0"), errMsg)
        );
      });
    }
    handleSaveConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      this.setState({
        loading: true
      });
      for (const attr of tuning_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      log_cmd("handleSaveConfig", "Saving Tuning configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.loadConfig();
        this.props.addNotification(
          "success",
          _68("Successfully updated tuning configuration")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.loadConfig();
        this.props.addNotification(
          "error",
          cockpit_default.format(_68("Error updating tuning configuration - $0"), errMsg)
        );
      });
    }
    render() {
      let body = "";
      let saveBtnName = _68("Save Settings");
      const extraPrimaryProps = {};
      if (this.state.loading) {
        saveBtnName = _68("Saving settings ...");
        extraPrimaryProps.spinnerAriaValueText = _68("Saving");
      }
      if (!this.state.loaded) {
        body = /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "ds-loading-spinner ds-margin-top-xlg ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Text, { component: TextVariants.h3, children: _68("Loading Tuning Configuration ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Spinner, { className: "ds-margin-top", size: "lg" })
        ] });
      } else {
        body = /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: this.state.loading ? "ds-disabled ds-margin-bottom-md" : "ds-margin-bottom-md", children: [
          /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(Text, { component: TextVariants.h3, children: [
            _68("Tuning & Limits"),
            /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
              Button,
              {
                variant: "plain",
                "aria-label": _68("Refresh settings"),
                onClick: () => {
                  this.loadConfig(1);
                },
                children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(SyncAltIcon, { size: "lg" })
              }
            )
          ] }) }) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(Form, { className: "ds-margin-left", isHorizontal: true, children: [
            /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(Grid, { className: "ds-margin-top-xlg", children: [
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", span: 2, title: _68("The number of worker threads that handle database operations.  Set to '-1' for enable auto tuning. (nsslapd-threadnumber)."), children: _68("Number Of Worker Threads") }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-threadnumber"],
                  min: -1,
                  max: 512,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-threadnumber");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-threadnumber", -1, 512);
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-threadnumber");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                GridItem,
                {
                  className: "ds-label",
                  offset: 5,
                  span: 2,
                  title: _68("The maximum number of threads that can handle requests for a single connection (nsslapd-maxthreadsperconn)."),
                  children: _68("Maximum Threads Per Connection")
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-maxthreadsperconn"],
                  min: 1,
                  max: 65535,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-maxthreadsperconn");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-maxthreadsperconn", 0, 0);
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-maxthreadsperconn");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
              Grid,
              {
                title: _68("The maximum number of seconds allocated for a search request.  Set to '-1' to disable the time limit (nsslapd-timelimit)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", span: 2, children: _68("Search Time Limit") }),
                  /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-timelimit"],
                      min: -1,
                      max: this.maxValue,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-timelimit");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-timelimit", -1, 0);
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-timelimit");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 8
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", offset: 5, span: 2, title: _68("The maximum number of entries to return from a search operation.  Set to '-1' to disable the size limit (nsslapd-sizelimit)."), children: _68("Search Size Limit") }),
                  /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-sizelimit"],
                      min: -1,
                      max: this.maxValue,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-sizelimit");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-sizelimit", -1, 0);
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-sizelimit");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 8
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", span: 2, title: _68("The maximum number of entries to return from a paged search operation. Set to '-1' to disable the size limit (nsslapd-pagedsizelimit)."), children: _68("Paged Search Size Limit") }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-pagedsizelimit"],
                  min: -1,
                  max: this.maxValue,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-pagedsizelimit");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-pagedsizelimit", -1, 0);
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-pagedsizelimit");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", offset: 5, span: 2, title: _68("Sets the amount of time in seconds after which an idle LDAP client connection is closed by the server (nsslapd-idletimeout)."), children: _68("Idle Connection Timeout") }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-idletimeout"],
                  min: 0,
                  max: this.maxValue,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-idletimeout");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-idletimeout", 0, 0);
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-idletimeout");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", span: 2, title: _68("Sets the amount of time in milliseconds after which the connection to a stalled LDAP client is closed (nsslapd-ioblocktimeout)."), children: _68("I/O Block Timeout") }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-ioblocktimeout"],
                  min: 0,
                  max: this.maxValue,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-ioblocktimeout");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-ioblocktimeout", 0, 0);
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-ioblocktimeout");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", offset: 5, span: 2, title: _68("Sets the I/O wait time for all outbound LDAP connections (nsslapd-outbound-ldap-io-timeout)."), children: _68("Outbound IO Timeout") }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-outbound-ldap-io-timeout"],
                  min: 0,
                  max: this.maxValue,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-outbound-ldap-io-timeout");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-outbound-ldap-io-timeout", 0, 0);
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-outbound-ldap-io-timeout");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", span: 2, title: _68("The maximum size in bytes allowed for an incoming message (nsslapd-maxbersize)."), children: _68("Maximum BER Size") }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-maxbersize"],
                  min: 0,
                  max: this.maxValue,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-maxbersize");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-maxbersize", 0, 0);
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-maxbersize");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", offset: 5, span: 2, title: _68("The maximum allowed SASL IO packet size that the server will accept (nsslapd-maxsasliosize)."), children: _68("Maximum SASL IO Size") }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-maxsasliosize"],
                  min: -1,
                  max: this.maxValue,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-maxsasliosize");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-maxsasliosize", -1, 0);
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-maxsasliosize");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", span: 2, title: _68("The maximum length for how long the connection queue for the socket can grow before refusing connections (nsslapd-listen-backlog-size)."), children: _68("Listen Backlog Size") }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-listen-backlog-size"],
                  min: 1,
                  max: this.maxValue,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-listen-backlog-size");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-listen-backlog-size", 1, 0);
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-listen-backlog-size");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", offset: 5, span: 2, title: _68("Sets how deep a nested search filter is analysed (nsslapd-max-filter-nest-level)."), children: _68("Maximum Nested Filter Level") }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-max-filter-nest-level"],
                  min: -1,
                  max: this.maxValue,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-max-filter-nest-level");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-max-filter-nest-level", -1, 0);
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-max-filter-nest-level");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", span: 2, title: _68("Sets the time in seconds after which a TCP connection is closed if there is no more data to send (nsslapd-tcp-fin-timeout)."), children: _68("TCP FIN Timeout") }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-tcp-fin-timeout"],
                  min: 0,
                  max: this.maxValue,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-tcp-fin-timeout");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-tcp-fin-timeout", 0, 0);
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-tcp-fin-timeout");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", offset: 5, span: 2, title: _68("Sets the time in milliseconds after which a TCP connection is closed if there is no more data to send (nsslapd-tcp-keepalive-time)."), children: _68("TCP Keepalive Time") }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-tcp-keepalive-time"],
                  min: 0,
                  max: this.maxValue,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-tcp-keepalive-time");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-tcp-keepalive-time", 0, 0);
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-tcp-keepalive-time");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                GridItem,
                {
                  className: "ds-label",
                  span: 2,
                  title: _68("Maximum number of paged results searches allowed on a connection (nsslapd-maxsimplepaged-per-conn)."),
                  children: _68("Maximum Paged Result Searches Per Connection")
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-maxsimplepaged-per-conn"],
                  min: -1,
                  max: this.maxValue,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-maxsimplepaged-per-conn");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-maxsimplepaged-per-conn", -1, 0);
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-maxsimplepaged-per-conn");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", offset: 5, span: 2, title: _68("The maximum number of LDAP controls allowed per operation (nsslapd-maxcontrolsperop)."), children: _68("Maximum Controls Per Operation") }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-maxcontrolsperop"],
                  min: 1,
                  max: 1e3,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-maxcontrolsperop");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-maxcontrolsperop", 1, 0);
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-maxcontrolsperop");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", span: 4, title: _68("Disable DNS reverse entries for outgoing connections (nsslapd-connection-nocanon)."), children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                Checkbox,
                {
                  id: "nsslapd-connection-nocanon",
                  isChecked: this.state["nsslapd-connection-nocanon"],
                  onChange: (e, checked) => {
                    this.handleChange(e);
                  },
                  label: _68("Disable Reverse DNS Lookups")
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", offset: 5, span: 4, title: _68("Sets the worker threads to continuously read a connection without passing it back to the polling mechanism. (nsslapd-enable-turbo-mode)."), children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                Checkbox,
                {
                  id: "nsslapd-enable-turbo-mode",
                  isChecked: this.state["nsslapd-enable-turbo-mode"],
                  onChange: (e, checked) => {
                    this.handleChange(e);
                  },
                  label: _68("Enable Connection Turbo Mode")
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", span: 4, title: _68("Disable the virtual attribute lookup in a search entry (nsslapd-ignore-virtual-attrs)."), children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                Checkbox,
                {
                  id: "nsslapd-ignore-virtual-attrs",
                  isChecked: this.state["nsslapd-ignore-virtual-attrs"],
                  onChange: (e, checked) => {
                    this.handleChange(e);
                  },
                  label: _68("Disable Virtual Attribute Lookups")
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(GridItem, { className: "ds-label", offset: 5, span: 4, title: _68("Enable the normalized DN cache.  Each thread has its own cache (nsslapd-ndn-cache-enabled)."), children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
                Checkbox,
                {
                  isChecked: this.state["nsslapd-ndn-cache-enabled"],
                  id: "nsslapd-ndn-cache-enabled",
                  onChange: (e, checked) => {
                    this.handleChange(e);
                  },
                  label: _68("Enable Normalized DN Cache")
                }
              ) })
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
            Button,
            {
              isDisabled: this.state.saveDisabled || this.state.loading,
              variant: "primary",
              className: "ds-margin-top-xlg ds-left-margin",
              onClick: this.handleSaveConfig,
              isLoading: this.state.loading,
              spinnerAriaValueText: this.state.loading ? _68("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveBtnName
            }
          )
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { id: "tuning-content", children: body });
    }
  };
  ServerTuning.propTypes = {
    addNotification: import_prop_types67.default.func,
    serverId: import_prop_types67.default.string,
    attrs: import_prop_types67.default.object
  };
  ServerTuning.defaultProps = {
    serverId: "",
    attrs: {}
  };

  // src/lib/server/sasl.jsx
  var import_react141 = __toESM(require_react(), 1);

  // src/lib/server/serverTables.jsx
  var import_react139 = __toESM(require_react(), 1);
  var import_prop_types68 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1);
  var _69 = cockpit_default.gettext;
  var SASLTable = class extends import_react139.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _69("Edit Mapping"),
          onClick: () => this.props.editMapping(
            rowData.cells[0].content,
            rowData.regex,
            rowData.cells[1].content,
            rowData.filter,
            rowData.cells[2].content
          )
        },
        {
          title: _69("Delete Mapping"),
          onClick: () => this.props.deleteMapping(rowData.cells[0].content)
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        dropdownIsOpen: false,
        hasRows: true,
        columns: [
          {
            title: _69("Mapping Name"),
            sortable: true
          },
          { title: _69("Search Base"), sortable: true },
          { title: _69("Priority"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    handleSort(_event, columnIndex, direction) {
      const sorted_rows = [];
      const rows = [];
      let count = 0;
      for (let idx = 0; idx < this.state.rows.length; idx += 2) {
        sorted_rows.push({
          expandedRow: this.state.rows[idx + 1],
          1: this.state.rows[idx].cells[0].content,
          2: this.state.rows[idx].cells[1].content,
          3: this.state.rows[idx].cells[2].content,
          regex: this.state.rows[idx].regex,
          filter: this.state.rows[idx].filter
        });
      }
      sorted_rows.sort((a2, b) => a2[columnIndex + 1] > b[columnIndex + 1] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_rows.reverse();
      }
      for (const srow of sorted_rows) {
        rows.push({
          isOpen: false,
          cells: [
            { content: srow[1] },
            { content: srow[2] },
            { content: srow[3] }
          ],
          regex: srow.regex,
          filter: srow.filter
        });
        srow.expandedRow.parent = count;
        rows.push(srow.expandedRow);
        count += 2;
      }
      this.setState({
        sortBy: {
          index: columnIndex,
          direction
        },
        rows,
        page: 1
      });
    }
    getExpandedRow(regex, filter) {
      return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Grid, { className: "ds-left-indent-lg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(GridItem, { span: 3, children: _69("Regular Expression:") }),
        /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("b", { children: regex }) }),
        /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(GridItem, { span: 3, children: _69("Search Filter:") }),
        /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("b", { children: filter }) })
      ] });
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      let hasRows = true;
      let count = 0;
      for (const row of this.props.rows) {
        rows.push({
          isOpen: false,
          cells: [
            { content: row.cn[0] },
            { content: row.nssaslmapbasedntemplate[0] },
            { content: row.nssaslmappriority[0] }
          ],
          regex: row.nssaslmapregexstring[0],
          filter: row.nssaslmapfiltertemplate[0]
        });
        count += 1;
      }
      if (rows.length === 0) {
        rows = [{ cells: [{ content: _69("No SASL Mappings") }] }];
        columns = [{ title: _69("SASL Mappings") }];
        hasRows = false;
      }
      this.setState({
        rows,
        columns,
        hasRows
      });
    }
    handleCollapse(_event, rowIndex, isExpanding) {
      const rows = [...this.state.rows];
      const index = this.state.perPage * (this.state.page - 1) * 2 + rowIndex;
      rows[index].isOpen = isExpanding;
      this.setState({ rows });
    }
    handleSearchChange(event, value) {
      const rows = [];
      let count = 0;
      for (const row of this.props.rows) {
        const val = value.toLowerCase();
        if (val !== "" && row.cn[0].toLowerCase().indexOf(val) === -1 && row.nssaslmapbasedntemplate[0].toLowerCase().indexOf(val) === -1 && row.nssaslmappriority[0].toLowerCase().indexOf(val) === -1) {
          continue;
        }
        rows.push({
          isOpen: false,
          cells: [
            { content: row.cn[0] },
            { content: row.nssaslmapbasedntemplate[0] },
            { content: row.nssaslmappriority[0] }
          ],
          regex: row.nssaslmapregexstring[0],
          filter: row.nssaslmapfiltertemplate[0]
        });
        count += 1;
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const { perPage, page, sortBy, rows, columns, hasRows } = this.state;
      const startIdx = (perPage * page - perPage) * 2;
      const tableRows = rows.slice(startIdx, startIdx + perPage * 2);
      return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "ds-margin-top-lg", children: [
        hasRows && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
          SearchInput,
          {
            placeholder: _69("Search Mappings"),
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
          Table,
          {
            "aria-label": "sasl table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Tr, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Th, { screenReaderText: "Row expansion" }),
                columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy,
                      onSort: this.handleSort,
                      columnIndex
                    } : void 0,
                    children: column.title
                  },
                  columnIndex
                )),
                /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react139.default.Fragment, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Tr, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
                    Td,
                    {
                      expand: {
                        rowIndex,
                        isExpanded: row.isOpen,
                        onToggle: () => this.handleCollapse(null, rowIndex, !row.isOpen)
                      }
                    }
                  ),
                  row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Td, { children: cell.content }, cellIndex)),
                  /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
                    ActionsColumn,
                    {
                      items: this.getActionsForRow(row)
                    }
                  ) })
                ] }),
                row.isOpen && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Tr, { isExpanded: true, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Td, { colSpan: columns.length + 2, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ExpandableRowContent, { children: this.getExpandedRow(row.regex, row.filter) }) }) })
              ] }, rowIndex)) })
            ]
          }
        ),
        hasRows && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
          Pagination,
          {
            itemCount: this.state.rows.length / 2,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  SASLTable.propTypes = {
    rows: import_prop_types68.default.array,
    editMapping: import_prop_types68.default.func,
    deleteMapping: import_prop_types68.default.func
  };
  SASLTable.defaultProps = {
    rows: []
  };

  // src/lib/server/serverModals.jsx
  var import_react140 = __toESM(require_react(), 1);
  var import_prop_types69 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1);
  var _70 = cockpit_default.gettext;
  var SASLMappingModal = class extends import_react140.default.Component {
    render() {
      let title = this.props.type;
      let btnText = _70("Create Mapping");
      const extraPrimaryProps = {};
      if (title !== "Create") {
        btnText = _70("Save Mapping");
      }
      title = cockpit_default.format(_70("$0 SASL Mapping"), title);
      if (this.props.spinning) {
        btnText = _70("Saving...");
        extraPrimaryProps.spinnerAriaValueText = _70("Loading");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title,
          isOpen: this.props.showModal,
          onClose: this.props.handleClose,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
              Button,
              {
                isDisabled: this.props.saveDisabled || this.props.spinning,
                variant: "primary",
                isLoading: this.props.spinning,
                spinnerAriaValueText: this.props.spinning ? _70("Loading") : void 0,
                onClick: () => {
                  this.props.saveHandler(this.props.name);
                },
                ...extraPrimaryProps,
                children: btnText
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Button, { variant: "link", onClick: this.props.handleClose, children: _70("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
              Grid,
              {
                title: _70("SASL Mapping entry name"),
                className: "ds-margin-top",
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(GridItem, { className: "ds-label", span: 3, children: _70("SASL Mapping Name") }),
                  /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(GridItem, { span: 9, children: [
                    /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
                      TextInput,
                      {
                        value: this.props.name,
                        type: "text",
                        id: "saslMapName",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "saslMapName",
                        onChange: (e, str) => {
                          this.props.handleChange(e);
                        },
                        validated: this.props.error.saslMapName ? ValidatedOptions.error : ValidatedOptions.default,
                        isRequired: true,
                        isDisabled: this.props.type === "Edit"
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(FormHelperText, { children: _70("You must provide a name for this mapping") })
                  ] })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
              Grid,
              {
                title: _70("SASL Mapping Regular Expression"),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(GridItem, { className: "ds-label", span: 3, children: _70("Regular Expression") }),
                  /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(GridItem, { span: 9, children: [
                    /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
                      TextInput,
                      {
                        value: this.props.regex,
                        type: "text",
                        id: "saslMapRegex",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "saslMapRegex",
                        onChange: (e, str) => {
                          this.props.handleChange(e);
                        },
                        isRequired: true,
                        validated: this.props.error.saslMapRegex ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(FormHelperText, { children: _70("You must provide a valid regular expression") })
                  ] })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
              Grid,
              {
                title: _70("Test Regular Expression"),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(GridItem, { className: "ds-label", span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("font", { size: "2", children: _70("* Test Regex") }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
                    TextInput,
                    {
                      value: this.props.testText,
                      type: "text",
                      id: "saslTestText",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "saslTestText",
                      onChange: (e, str) => {
                        this.props.handleChange(e);
                      },
                      placeholder: _70("Enter text to test regex")
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
                    Button,
                    {
                      className: "ds-left-margin",
                      isDisabled: this.props.testBtnDisabled || this.props.error.saslMapRegex,
                      variant: "primary",
                      onClick: this.props.handleTestRegex,
                      children: _70("Test It")
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
              Grid,
              {
                title: _70("The search base or a specific entry DN to match against the constructed DN"),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(GridItem, { className: "ds-label", span: 3, children: _70("SASL Mapping Base") }),
                  /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(GridItem, { span: 9, children: [
                    /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
                      TextInput,
                      {
                        value: this.props.base,
                        type: "text",
                        id: "saslBase",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "saslBase",
                        onChange: (e, str) => {
                          this.props.handleChange(e);
                        },
                        isRequired: true,
                        validated: this.props.error.saslBase ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(FormHelperText, { children: _70("You must provide a search base") })
                  ] })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
              Grid,
              {
                title: _70("SASL mapping search filter"),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(GridItem, { className: "ds-label", span: 3, children: _70("SASL Mapping Filter") }),
                  /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(GridItem, { span: 9, children: [
                    /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
                      TextInput,
                      {
                        value: this.props.filter,
                        type: "text",
                        id: "saslFilter",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "saslFilter",
                        onChange: (e, str) => {
                          this.props.handleChange(e);
                        },
                        isRequired: true,
                        validated: this.props.error.saslFilter ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(FormHelperText, { children: _70("You must provide an LDAP search filter") })
                  ] })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
              Grid,
              {
                title: _70("Set the mapping priority for which mappings should be tried first"),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(GridItem, { className: "ds-label", span: 3, children: _70("SASL Mapping Priority") }),
                  /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(GridItem, { span: 9, children: [
                    /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
                      TextInput,
                      {
                        value: this.props.priority,
                        type: "number",
                        id: "saslPriority",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "saslPriority",
                        onChange: (e, str) => {
                          this.props.handleChange(e);
                        },
                        validated: this.props.error.saslPriority ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(FormHelperText, { children: _70("Priority must be between 1 and 100") })
                  ] })
                ]
              }
            )
          ] })
        }
      );
    }
  };
  SASLMappingModal.propTypes = {
    showModal: import_prop_types69.default.bool,
    testBtnDisabled: import_prop_types69.default.bool,
    saveDisabled: import_prop_types69.default.bool,
    closeHandler: import_prop_types69.default.func,
    handleChange: import_prop_types69.default.func,
    handleTestRegex: import_prop_types69.default.func,
    saveHandler: import_prop_types69.default.func,
    error: import_prop_types69.default.object,
    name: import_prop_types69.default.string,
    regex: import_prop_types69.default.string,
    testText: import_prop_types69.default.string,
    base: import_prop_types69.default.string,
    filter: import_prop_types69.default.string,
    priority: import_prop_types69.default.string,
    spinning: import_prop_types69.default.bool
  };
  SASLMappingModal.defaultProps = {
    showModal: false,
    testBtnDisabled: true,
    saveDisabled: true,
    error: {},
    name: "",
    regex: "",
    testText: "",
    base: "",
    filter: "",
    priority: "",
    spinning: import_prop_types69.default.bool
  };

  // src/lib/server/sasl.jsx
  var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1);
  var _71 = cockpit_default.gettext;
  var ServerSASL = class extends import_react141.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        configLoading: false,
        tableLoading: false,
        loaded: false,
        activeKey: 1,
        errObj: {},
        saveDisabled: true,
        supportedMechs: [],
        mappingKey: 0,
        // Main settings
        allowedMechs: [],
        mappingFallback: false,
        maxBufSize: "",
        // Mapping modal
        showMapping: false,
        saveMappingDisabled: true,
        testRegexDisabled: true,
        testBtnDisabled: true,
        saslMapName: "",
        saslMapRegex: "",
        saslTestText: "",
        saslBase: "",
        saslFilter: "",
        saslPriority: "100",
        saslModalType: _71("Create"),
        saslErrObj: {},
        showConfirmDelete: false,
        modalChecked: false,
        isAllowedMechOpen: false
      };
      this.handleOnAllowedMechToggle = (_event, isAllowedMechOpen) => {
        this.setState({
          isAllowedMechOpen
        });
      };
      this.handleOnSelect = (event, selection) => {
        this.setState({
          allowedMechs: Array.isArray(selection) ? selection : []
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.handleOnAllowedMechClear = () => {
        this.setState({
          allowedMechs: [],
          isAllowedMechOpen: false
        });
      };
      this.validateRegex = this.validateRegex.bind(this);
      this.validateModal = this.validateModal.bind(this);
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
      this.handleChange = this.handleChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.onTestRegex = this.onTestRegex.bind(this);
      this.handleLoadConfig = this.handleLoadConfig.bind(this);
      this.loadMechs = this.loadMechs.bind(this);
      this.loadSASLMappings = this.loadSASLMappings.bind(this);
      this.handleSaveConfig = this.handleSaveConfig.bind(this);
      this.handleShowCreateMapping = this.handleShowCreateMapping.bind(this);
      this.showEditMapping = this.showEditMapping.bind(this);
      this.closeMapping = this.closeMapping.bind(this);
      this.showConfirmDelete = this.showConfirmDelete.bind(this);
      this.closeConfirmDelete = this.closeConfirmDelete.bind(this);
      this.createMapping = this.createMapping.bind(this);
      this.editMapping = this.editMapping.bind(this);
      this.deleteMapping = this.deleteMapping.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.handleLoadConfig();
      } else {
        this.props.enableTree();
      }
    }
    normalizeRegex(regex_str) {
      return regex_str.replace(/\\\(/g, "(").replace(/\\\)/g, ")");
    }
    validateRegex(regex) {
      const errObj = this.state.saslErrObj;
      let saveMappingDisabled = this.state.saveMappingDisabled;
      if (this.state.saslMapRegex === "") {
        errObj.saslMapRegex = true;
      } else {
        try {
          RegExp(this.state.saslMapRegex);
          const cleaned_regex = this.normalizeRegex(this.state.saslMapRegex);
          RegExp(cleaned_regex);
          errObj.saslMapRegex = false;
        } catch (e) {
          errObj.saslMapRegex = true;
          saveMappingDisabled = true;
        }
      }
      this.setState({
        saslErrObj: errObj,
        saveMappingDisabled
      });
      return !errObj.saslMapRegex;
    }
    onTestRegex() {
      const test_string = this.state.saslTestText;
      if (this.validateRegex()) {
        const cleaned_regex = this.normalizeRegex(this.state.saslMapRegex);
        const sasl_regex = RegExp(cleaned_regex);
        if (sasl_regex.test(test_string)) {
          this.props.addNotification(
            "success",
            _71("The test string matches the Regular Expression")
          );
        } else {
          this.props.addNotification(
            "warning",
            _71("The test string does not match the Regular Expression")
          );
        }
      } else {
        this.props.addNotification(
          "error",
          _71("Invalid regular expression")
        );
      }
    }
    validateSaveBtn() {
      const attrs = ["mappingFallback", "maxBufSize"];
      let disableSaveBtn = true;
      for (const attr of attrs) {
        if (this.state[attr] !== this.state["_" + attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      const orig_mechs = [...this.state._allowedMechs];
      const new_mechs = [...this.state.allowedMechs];
      if (!listsEqual(orig_mechs, new_mechs)) {
        disableSaveBtn = false;
      }
      this.setState({
        saveDisabled: disableSaveBtn
      });
    }
    handleChange(e) {
      let attr = "";
      let value = "";
      value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      attr = e.target.id;
      this.setState({
        [attr]: value,
        isAllowedMechOpen: false
      }, () => {
        this.validateSaveBtn();
      });
    }
    validateModal() {
      let disableSaveBtn = true;
      let disableRegexTestBtn = true;
      const errObj = this.state.saslErrObj;
      let error = false;
      const attrs = ["saslMapName", "saslMapRegex", "saslBase", "saslPriority", "saslFilter"];
      for (const attr of attrs) {
        if (this.state[attr] === "" || attr === "saslPriority" && this.state[attr] === "0") {
          errObj[attr] = true;
          error = true;
        } else {
          errObj[attr] = false;
        }
      }
      if (!error) {
        for (const attr of attrs) {
          if (this.state[attr] !== this.state["_" + attr]) {
            disableSaveBtn = false;
            break;
          }
        }
      }
      if (this.state.saslMapRegex !== "" && this.state.saslTestText !== "") {
        disableRegexTestBtn = false;
      }
      this.setState({
        saveMappingDisabled: disableSaveBtn,
        testBtnDisabled: disableRegexTestBtn,
        saslErrObj: errObj
      }, () => {
        this.validateRegex();
      });
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateModal();
      });
    }
    handleLoadConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("handleLoadConfig", "Get SASL settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        let allowedMechsVal = attrs["nsslapd-allowed-sasl-mechanisms"][0];
        let allowedMechs = [];
        let fallback = false;
        if (attrs["nsslapd-sasl-mapping-fallback"][0] === "on") {
          fallback = true;
        }
        if (allowedMechsVal !== "") {
          if (allowedMechsVal.indexOf(",") > -1) {
            allowedMechsVal = allowedMechsVal.trim();
            allowedMechs = allowedMechsVal.split(",");
          } else {
            allowedMechs = allowedMechsVal.split(" ");
          }
        }
        this.setState({
          maxBufSize: attrs["nsslapd-sasl-max-buffer-size"][0],
          allowedMechs,
          mappingFallback: fallback,
          saveDisabled: true,
          // Store original values
          _maxBufSize: attrs["nsslapd-sasl-max-buffer-size"][0],
          _allowedMechs: allowedMechs,
          _mappingFallback: fallback
        }, this.loadMechs());
      });
    }
    loadMechs() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "sasl",
        "get-available-mechs"
      ];
      log_cmd("loadMechs", "Get supported SASL mechanisms", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          supportedMechs: config.items
        }, this.loadSASLMappings());
      });
    }
    loadSASLMappings() {
      const cmd = ["dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket", "sasl", "list", "--details"];
      log_cmd("get_and_set_sasl", "Get SASL mappings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const saslMapObj = JSON.parse(content);
        const mappings = [];
        for (const mapping of saslMapObj.items) {
          if (!("nssaslmappriority" in mapping.attrs)) {
            mapping.attrs.nssaslmappriority = ["100"];
          }
          mappings.push(mapping.attrs);
        }
        const key = this.state.mappingKey + 1;
        this.setState({
          mappings,
          mappingKey: key,
          loaded: true,
          tableLoading: false,
          configLoading: false,
          showMappingModal: false,
          showConfirmDelete: false
        }, this.props.enableTree);
      });
    }
    handleShowCreateMapping() {
      this.setState({
        showMappingModal: true,
        saveMappingDisabled: true,
        testRegexDisabled: true,
        saslModalType: _71("Create"),
        saslMapName: "",
        saslMapRegex: "",
        saslTestText: "",
        saslBase: "",
        saslFilter: "",
        saslPriority: "100",
        saslErrObj: {}
      });
    }
    closeMapping() {
      this.setState({
        showMappingModal: false
      });
    }
    showEditMapping(name2, regex, base, filter, priority) {
      this.setState({
        showMappingModal: true,
        saveMappingDisabled: true,
        testRegexDisabled: true,
        saslModalType: _71("Edit"),
        saslMapName: name2,
        saslMapRegex: regex,
        saslTestText: "",
        saslBase: base,
        saslFilter: filter,
        saslPriority: priority,
        // Note original values
        _saslMapName: name2,
        _saslMapRegex: regex,
        _saslTestText: "",
        _saslBase: base,
        _saslFilter: filter,
        _saslPriority: priority,
        saslErrObj: {}
      });
    }
    showConfirmDelete(name2) {
      this.setState({
        saslMapName: name2,
        modalChecked: false,
        showConfirmDelete: true
      });
    }
    closeConfirmDelete() {
      this.setState({
        modalChecked: false,
        showConfirmDelete: false
      });
    }
    createMapping() {
      this.setState({
        tableLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "sasl",
        "create",
        "--cn=" + this.state.saslMapName,
        "--nsSaslMapFilterTemplate=" + this.state.saslFilter,
        "--nsSaslMapRegexString=" + this.state.saslMapRegex,
        "--nsSaslMapBaseDNTemplate=" + this.state.saslBase,
        "--nsSaslMapPriority=" + this.state.saslPriority
      ];
      log_cmd("createMapping", "Create sasl mapping", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadConfig();
        this.props.addNotification(
          "success",
          _71("Successfully create new SASL Mapping")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.handleLoadConfig();
        this.props.addNotification(
          "error",
          cockpit_default.format(_71("Error creating new SASL Mapping - $0"), errMsg)
        );
      });
    }
    editMapping(name2) {
      const new_mappings = this.state.mappings;
      for (const saslMap of new_mappings) {
        if (saslMap.cn[0] === name2) {
          saslMap.nssaslmapregexstring = [/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Spinner, { className: "ds-lower-field", loading: true, size: "sm" }, new_mappings[0].nssaslmapregexstring[0])];
          saslMap.nssaslmapbasedntemplate = [/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Spinner, { className: "ds-lower-field", loading: true, size: "sm" }, new_mappings[0].nssaslmapbasedntemplate[0])];
          saslMap.nssaslmapfiltertemplate = [/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Spinner, { className: "ds-lower-field", loading: true, size: "sm" }, new_mappings[0].nssaslmapfiltertemplate[0])];
          saslMap.nssaslmappriority = [/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Spinner, { className: "ds-lower-field", loading: true, size: "sm" }, new_mappings[0].nssaslmappriority[0])];
        }
      }
      this.setState({
        mappings: new_mappings,
        tableLoading: true
      });
      const delete_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "sasl",
        "delete",
        this.state._saslMapName
      ];
      const create_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "sasl",
        "create",
        "--cn=" + this.state.saslMapName,
        "--nsSaslMapFilterTemplate=" + this.state.saslFilter,
        "--nsSaslMapRegexString=" + this.state.saslMapRegex,
        "--nsSaslMapBaseDNTemplate=" + this.state.saslBase,
        "--nsSaslMapPriority=" + this.state.saslPriority
      ];
      log_cmd("editMapping", "deleting sasl mapping", delete_cmd);
      cockpit_default.spawn(delete_cmd, { superuser: true, err: "message" }).done((content) => {
        log_cmd("editMapping", "Create new sasl mapping", create_cmd);
        cockpit_default.spawn(create_cmd, { superuser: true, err: "message" }).done((content2) => {
          this.handleLoadConfig();
          this.props.addNotification(
            "success",
            _71("Successfully updated SASL Mapping")
          );
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.closeMapping();
          this.handleLoadConfig();
          this.props.addNotification(
            "error",
            cockpit_default.format(_71("Error updating SASL Mapping - $0"), errMsg)
          );
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.handleLoadConfig();
        this.closeMapping();
        this.props.addNotification(
          "error",
          cockpit_default.format(_71("Error replacing SASL Mapping - $0"), errMsg)
        );
      });
    }
    deleteMapping() {
      const new_mappings = this.state.mappings;
      for (const saslMap of new_mappings) {
        if (saslMap.cn[0] === this.state.saslMapName) {
          saslMap.nssaslmapregexstring = [/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Spinner, { className: "ds-lower-field", loading: true, size: "sm" }, new_mappings[0].nssaslmapregexstring[0])];
          saslMap.nssaslmapbasedntemplate = [/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Spinner, { className: "ds-lower-field", loading: true, size: "sm" }, new_mappings[0].nssaslmapbasedntemplate[0])];
          saslMap.nssaslmapfiltertemplate = [/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Spinner, { className: "ds-lower-field", loading: true, size: "sm" }, new_mappings[0].nssaslmapfiltertemplate[0])];
          saslMap.nssaslmappriority = [/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Spinner, { className: "ds-lower-field", loading: true, size: "sm" }, new_mappings[0].nssaslmappriority[0])];
        }
      }
      this.setState({
        mappings: new_mappings,
        tableLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "sasl",
        "delete",
        this.state.saslMapName
      ];
      log_cmd("deleteMapping", "Delete sasl mapping", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadConfig();
        this.props.addNotification(
          "success",
          _71("Successfully deleted SASL Mapping")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.handleLoadConfig();
        this.closeConfirmDelete();
        this.props.addNotification(
          "error",
          cockpit_default.format(_71("Error deleting SASL Mapping - $0"), errMsg)
        );
      });
    }
    handleSaveConfig() {
      this.setState({
        configLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config"
      ];
      const mech_str_new = this.state.allowedMechs.join(" ");
      const mech_str_orig = this.state._allowedMechs.join(" ");
      if (mech_str_orig !== mech_str_new) {
        if (mech_str_new.length === 0) {
          cmd.push("delete");
          cmd.push("nsslapd-allowed-sasl-mechanisms");
        } else {
          cmd.push("replace");
          cmd.push("nsslapd-allowed-sasl-mechanisms=" + mech_str_new);
        }
      } else {
        cmd.push("replace");
      }
      if (this.state._mappingFallback !== this.state.mappingFallback) {
        let value = "off";
        if (this.state.mappingFallback) {
          value = "on";
        }
        cmd.push("nsslapd-sasl-mapping-fallback=" + value);
      }
      if (this.state._maxBufSize !== this.state.maxBufSize) {
        cmd.push("nsslapd-sasl-max-buffer-size=" + this.state.maxBufSize);
      }
      log_cmd("handleSaveConfig", "Applying SASL config change", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.handleLoadConfig();
        this.props.addNotification(
          "warning",
          _71("Successfully updated SASL configuration.  These changes require the server to be restarted to take effect.")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.handleLoadConfig();
        this.props.addNotification(
          "error",
          cockpit_default.format(_71("Error updating SASL configuration - $0"), errMsg)
        );
      });
    }
    render() {
      let body = "";
      let saveBtnName = _71("Save Settings");
      const extraPrimaryProps = {};
      if (this.state.configLoading) {
        saveBtnName = _71("Saving settings ...");
        extraPrimaryProps.spinnerAriaValueText = _71("Saving");
      }
      if (!this.state.loaded) {
        body = /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "ds-loading-spinner ds-margin-top-xlg ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Text, { component: TextVariants.h3, children: _71("Loading SASL Configuration ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Spinner, { className: "ds-margin-top", size: "lg" })
        ] });
      } else {
        body = /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: this.state.configLoading ? "ds-disabled ds-margin-bottom-md" : "ds-margin-bottom-md", children: [
          /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(Text, { component: TextVariants.h3, children: [
            _71("SASL Settings"),
            /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
              Button,
              {
                variant: "plain",
                "aria-label": _71("Refresh SASL settings"),
                onClick: this.handleLoadConfig,
                children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(SyncAltIcon, {})
              }
            )
          ] }) }) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(Form, { isHorizontal: true, autoComplete: "off", className: "ds-margin-left", children: [
            /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(Grid, { title: _71("The maximum SASL buffer size in bytes (nsslapd-sasl-max-buffer-size)."), className: "ds-margin-top-xlg", children: [
              /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(GridItem, { className: "ds-label", span: 3, children: _71("Max SASL Buffer Size") }),
              /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
                TextInput,
                {
                  value: this.state.maxBufSize,
                  type: "number",
                  id: "maxBufSize",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "maxBufSize",
                  onChange: (e, str) => {
                    this.handleChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
              Grid,
              {
                title: _71("A list of SASL mechanisms the server will only accept (nsslapd-allowed-sasl-mechanisms).  The default is all mechanisms are allowed."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(GridItem, { className: "ds-label", span: 3, children: _71("Allowed SASL Mechanisms") }),
                  /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
                    dsBasicComponents_default,
                    {
                      selected: this.state.allowedMechs,
                      onSelect: this.handleOnSelect,
                      onClear: this.handleOnAllowedMechClear,
                      options: this.state.supportedMechs,
                      isOpen: this.state.isAllowedMechOpen,
                      onToggle: this.handleOnAllowedMechToggle,
                      placeholder: _71("Type SASL mechanism to allow..."),
                      noResultsText: "There are no matching entries",
                      ariaLabel: "Type SASL mechanism to allow",
                      isMulti: true
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
              Grid,
              {
                title: _71("Check all sasl mappings until one succeeds or they all fail (nsslapd-sasl-mapping-fallback)."),
                children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
                  Checkbox,
                  {
                    isChecked: this.state.mappingFallback,
                    id: "mappingFallback",
                    onChange: (e, checked) => {
                      this.handleChange(e);
                    },
                    label: _71("Allow SASL Mapping Fallback")
                  }
                )
              }
            )
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
            Button,
            {
              isDisabled: this.state.saveDisabled || this.state.configLoading,
              variant: "primary",
              className: "ds-margin-top-xlg ds-margin-left",
              onClick: this.handleSaveConfig,
              isLoading: this.state.configLoading,
              spinnerAriaValueText: this.state.configLoading ? _71("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveBtnName
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(Grid, { className: "ds-margin-top ds-margin-left", children: [
            /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(GridItem, { span: 11, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Divider, {}) }),
            /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Text, { className: "ds-center ds-margin-top", component: TextVariants.h3, children: _71("SASL Mappings") }) }),
            /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(GridItem, { span: 11, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
              SASLTable,
              {
                rows: this.state.mappings,
                editMapping: this.showEditMapping,
                deleteMapping: this.showConfirmDelete,
                className: "ds-margin-top ds-margin-left"
              },
              this.state.mappingKey
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
            Button,
            {
              variant: "primary",
              onClick: this.handleShowCreateMapping,
              className: "ds-margin-top ds-margin-left",
              children: _71("Create New Mapping")
            }
          )
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { id: "server-sasl-page", children: [
        body,
        /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
          SASLMappingModal,
          {
            showModal: this.state.showMappingModal,
            testBtnDisabled: this.state.testBtnDisabled,
            saveDisabled: this.state.saveMappingDisabled,
            handleClose: this.closeMapping,
            handleChange: this.onModalChange,
            handleTestRegex: this.onTestRegex,
            saveHandler: this.state.saslModalType === "Create" ? this.createMapping : this.editMapping,
            error: this.state.saslErrObj,
            type: this.state.saslModalType,
            name: this.state.saslMapName,
            regex: this.state.saslMapRegex,
            testText: this.state.saslTestText,
            base: this.state.saslBase,
            filter: this.state.saslFilter,
            priority: this.state.saslPriority,
            spinning: this.state.tableLoading
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDelete,
            closeHandler: this.closeConfirmDelete,
            handleChange: this.onModalChange,
            actionHandler: this.deleteMapping,
            item: this.state.saslMapName,
            checked: this.state.modalChecked,
            spinning: this.state.tableLoading,
            mTitle: _71("Delete SASL Mapping"),
            mMsg: _71("Are you sure you want to delete this SASL mapping?"),
            mSpinningMsg: _71("Deleting SASL Mapping ..."),
            mBtnName: _71("Delete Mapping")
          }
        )
      ] });
    }
  };

  // src/lib/server/ldapi.jsx
  var import_react142 = __toESM(require_react(), 1);
  var import_prop_types70 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime72 = __toESM(require_jsx_runtime(), 1);
  var ldapi_attrs = [
    "nsslapd-ldapifilepath",
    "nsslapd-ldapimaprootdn",
    "nsslapd-ldapientrysearchbase",
    "nsslapd-ldapigidnumbertype",
    "nsslapd-ldapiuidnumbertype"
  ];
  var _72 = cockpit_default.gettext;
  var ServerLDAPI = class extends import_react142.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        loading: false,
        loaded: false,
        saveDisabled: true,
        attrs: this.props.attrs,
        attributes: [],
        isUIDOpen: false,
        isGIDOpen: false
      };
      this.handleUIDToggle = (_event, isUIDOpen) => {
        this.setState({
          isUIDOpen
        });
      };
      this.handleUIDSelect = (event, selection, isPlaceholder) => {
        this.setState({
          "nsslapd-ldapiuidnumbertype": selection,
          isUIDOpen: false
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.handleGIDToggle = (_event, isGIDOpen) => {
        this.setState({
          isGIDOpen
        });
      };
      this.handleGIDSelect = (event, selection, isPlaceholder) => {
        this.setState({
          "nsslapd-ldapigidnumbertype": selection,
          isGIDOpen: false
        }, () => {
          this.validateSaveBtn();
        });
      };
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
      this.handleChange = this.handleChange.bind(this);
      this.handleLoadConfig = this.handleLoadConfig.bind(this);
      this.handleSaveConfig = this.handleSaveConfig.bind(this);
      this.getAttributes = this.getAttributes.bind(this);
      this.reloadConfig = this.reloadConfig.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.handleLoadConfig();
      } else {
        this.props.enableTree();
      }
    }
    getAttributes() {
      const attr_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "list"
      ];
      log_cmd("getAttributes", "Get attrs", attr_cmd);
      cockpit_default.spawn(attr_cmd, { superuser: true, err: "message" }).done((content) => {
        const attrContent = JSON.parse(content);
        const attrs = [];
        for (const content2 of attrContent.items) {
          attrs.push(content2.name[0]);
        }
        this.setState({
          attributes: attrs
        }, this.props.enableTree);
      });
    }
    validateSaveBtn() {
      let disableSaveBtn = true;
      for (const ldapi_attr of ldapi_attrs) {
        if (this.state["_" + ldapi_attr].toLowerCase() !== this.state[ldapi_attr].toLowerCase()) {
          disableSaveBtn = false;
          break;
        }
      }
      if (this.state["nsslapd-ldapimaptoentries"] !== this.state["_nsslapd-ldapimaptoentries"]) {
        disableSaveBtn = false;
      }
      this.setState({
        saveDisabled: disableSaveBtn
      });
    }
    handleChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn();
      });
    }
    handleLoadConfig() {
      const attrs = this.state.attrs;
      let mapToEntries = false;
      if ("nsslapd-ldapimaptoentries" in attrs) {
        if (attrs["nsslapd-ldapimaptoentries"][0] === "on") {
          mapToEntries = true;
        }
      }
      this.setState({
        loading: false,
        loaded: true,
        saveDisabled: true,
        "nsslapd-ldapimaptoentries": mapToEntries,
        "nsslapd-ldapifilepath": attrs["nsslapd-ldapifilepath"][0],
        "nsslapd-ldapimaprootdn": attrs["nsslapd-ldapimaprootdn"][0],
        "nsslapd-ldapientrysearchbase": attrs["nsslapd-ldapientrysearchbase"][0],
        "nsslapd-ldapigidnumbertype": attrs["nsslapd-ldapigidnumbertype"][0],
        "nsslapd-ldapiuidnumbertype": attrs["nsslapd-ldapiuidnumbertype"][0],
        // Record original values
        "_nsslapd-ldapimaptoentries": mapToEntries,
        "_nsslapd-ldapimaprootdn": attrs["nsslapd-ldapimaprootdn"][0],
        "_nsslapd-ldapifilepath": attrs["nsslapd-ldapifilepath"][0],
        "_nsslapd-ldapientrysearchbase": attrs["nsslapd-ldapientrysearchbase"][0],
        "_nsslapd-ldapigidnumbertype": attrs["nsslapd-ldapigidnumbertype"][0],
        "_nsslapd-ldapiuidnumbertype": attrs["nsslapd-ldapiuidnumbertype"][0]
      }, this.getAttributes);
    }
    reloadConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("reloadConfig", "Reload server configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        this.setState({
          attrs
        }, this.handleLoadConfig);
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.setState({
          loading: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_72("Error loading server configuration - $0"), errMsg)
        );
      });
    }
    handleSaveConfig() {
      this.setState({
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of [...ldapi_attrs, "nsslapd-ldapimaptoentries"]) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      log_cmd("handleSaveConfig", "Saving LDAPI settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.setState({
          loading: false
        }, this.reloadConfig);
        this.props.addNotification(
          "success",
          _72("Successfully updated LDAPI configuration")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.setState({
          loading: false
        }, this.reloadConfig);
        this.props.addNotification(
          "error",
          cockpit_default.format(_72("Error updating LDAPI configuration - $0"), errMsg)
        );
      });
    }
    render() {
      let mapUserAttrs = "";
      const extraPrimaryProps = {};
      let saveBtnName = _72("Save Settings");
      if (this.state.loading) {
        saveBtnName = _72("Saving settings ...");
        extraPrimaryProps.spinnerAriaValueText = _72("Loading");
      }
      if (this.state["nsslapd-ldapimaptoentries"]) {
        mapUserAttrs = /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { children: [
          /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
            Grid,
            {
              className: "ds-margin-top",
              title: _72("The Directory Server attribute to map system UIDs to user entries (nsslapd-ldapiuidnumbertype)."),
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(GridItem, { className: "ds-label", span: 3, children: _72("LDAPI UID Number Attribute") }),
                /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
                  dsBasicComponents_default,
                  {
                    ariaLabel: "Select UID Input",
                    onToggle: this.handleUIDToggle,
                    onSelect: this.handleUIDSelect,
                    selected: this.state["nsslapd-ldapiuidnumbertype"],
                    isOpen: this.state.isUIDOpen,
                    options: this.state.attributes
                  }
                ) })
              ]
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
            Grid,
            {
              className: "ds-margin-top",
              title: _72("The Directory Server attribute to map system GUIDs to user entries (nsslapd-ldapigidnumbertype)."),
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(GridItem, { className: "ds-label", span: 3, children: _72("LDAPI GID Number Attribute") }),
                /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
                  dsBasicComponents_default,
                  {
                    ariaLabel: "Select GID Input",
                    onToggle: this.handleGIDToggle,
                    onSelect: this.handleGIDSelect,
                    selected: this.state["nsslapd-ldapigidnumbertype"],
                    isOpen: this.state.isGIDOpen,
                    options: this.state.attributes
                  }
                ) })
              ]
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
            Grid,
            {
              title: _72("The subtree to search for user entries to use for autobind. (nsslapd-ldapientrysearchbase)."),
              className: "ds-margin-top",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(GridItem, { className: "ds-label", span: 3, children: _72("LDAPI Entry Search Base") }),
                /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
                  TextInput,
                  {
                    value: this.state["nsslapd-ldapientrysearchbase"],
                    type: "text",
                    id: "nsslapd-ldapientrysearchbase",
                    "aria-describedby": "horizontal-form-name-helper",
                    onChange: (e, str) => {
                      this.handleChange(e);
                    }
                  }
                ) })
              ]
            }
          )
        ] });
      }
      let body = /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(Form, { className: "ds-margin-top-xlg ds-margin-left", isHorizontal: true, children: [
          /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(Grid, { title: _72("The Unix socket file (nsslapd-ldapifilepath).  The UI requires this exact path so it is a read-only setting."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(GridItem, { className: "ds-label", span: 3, children: _72("LDAPI Socket File Path") }),
            /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
              TextInput,
              {
                value: this.state["nsslapd-ldapifilepath"],
                type: "text",
                id: "nsslapd-ldapifilepath",
                "aria-describedby": "horizontal-form-name-helper",
                isDisabled: true
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(Grid, { title: _72("Map the Unix root entry to this Directory Manager DN (nsslapd-ldapimaprootdn).  The UI requires this to be set to the current root DN so it is a read-only setting. The attribute is obsolete. Current root DN is used."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(GridItem, { className: "ds-label", span: 3, children: _72("LDAPI Map To Root DN") }),
            /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
              TextInput,
              {
                value: this.state["nsslapd-ldapimaprootdn"],
                type: "text",
                id: "nsslapd-ldapimaprootdn",
                "aria-describedby": "horizontal-form-name-helper",
                isDisabled: true
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
            Grid,
            {
              title: _72("Map regular system users to Directory Server entries (nsslapd-ldapimaptoentries)."),
              className: "ds-margin-top",
              children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
                Checkbox,
                {
                  id: "nsslapd-ldapimaptoentries",
                  isChecked: this.state["nsslapd-ldapimaptoentries"],
                  onChange: (e, checked) => {
                    this.handleChange(e);
                  },
                  "aria-label": "uncontrolled checkbox example",
                  label: _72("Map System Users to Database Entries")
                }
              ) })
            }
          ),
          mapUserAttrs
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
          Button,
          {
            isDisabled: this.state.saveDisabled || this.state.loading,
            variant: "primary",
            className: "ds-margin-top-xlg ds-margin-left",
            onClick: this.handleSaveConfig,
            isLoading: this.state.loading,
            spinnerAriaValueText: this.state.loading ? _72("Saving") : void 0,
            ...extraPrimaryProps,
            children: saveBtnName
          }
        )
      ] });
      if (!this.state.loaded) {
        body = /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Text, { component: TextVariants.h3, children: _72("Loading LDAPI configuration ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Spinner, { className: "ds-margin-top", size: "lg" })
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { id: "server-ldapi-page", className: this.state.loading ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(Text, { component: TextVariants.h3, children: [
          _72("LDAPI & AutoBind Settings"),
          /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _72("Refresh LDAPI settings"),
              onClick: this.handleLoadConfig,
              children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }) }) }),
        body
      ] });
    }
  };
  ServerLDAPI.propTypes = {
    addNotification: import_prop_types70.default.func,
    serverId: import_prop_types70.default.string,
    attrs: import_prop_types70.default.object
  };
  ServerLDAPI.defaultProps = {
    serverId: "",
    attrs: {}
  };

  // src/lib/server/accessLog.jsx
  var import_react143 = __toESM(require_react(), 1);
  var import_prop_types71 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime73 = __toESM(require_jsx_runtime(), 1);
  var settings_attrs = [
    "nsslapd-accesslog",
    "nsslapd-accesslog-level",
    "nsslapd-accesslog-logbuffering",
    "nsslapd-accesslog-logging-enabled",
    "nsslapd-accesslog-log-format",
    "nsslapd-accesslog-time-format"
  ];
  var rotation_attrs = [
    "nsslapd-accesslog-logrotationsync-enabled",
    "nsslapd-accesslog-logrotationsynchour",
    "nsslapd-accesslog-logrotationsyncmin",
    "nsslapd-accesslog-logrotationtime",
    "nsslapd-accesslog-logrotationtimeunit",
    "nsslapd-accesslog-maxlogsize",
    "nsslapd-accesslog-maxlogsperdir",
    "nsslapd-accesslog-compress"
  ];
  var rotation_attrs_no_time = [
    "nsslapd-accesslog-logrotationsync-enabled",
    "nsslapd-accesslog-logrotationtime",
    "nsslapd-accesslog-logrotationtimeunit",
    "nsslapd-accesslog-maxlogsize",
    "nsslapd-accesslog-maxlogsperdir",
    "nsslapd-accesslog-compress"
  ];
  var exp_attrs3 = [
    "nsslapd-accesslog-logexpirationtime",
    "nsslapd-accesslog-logexpirationtimeunit",
    "nsslapd-accesslog-logmaxdiskspace",
    "nsslapd-accesslog-logminfreediskspace"
  ];
  var _73 = cockpit_default.gettext;
  var ServerAccessLog = class extends import_react143.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleTimeChange", (_event, time2, hour, min3, seconds2, isValid) => {
        let disableSaveBtn = true;
        if (hour.length === 2 && hour[0] === "0") {
          hour = hour[1];
        }
        if (min3.length === 2 && min3[0] === "0") {
          min3 = min3[1];
        }
        for (const config_attr of rotation_attrs_no_time) {
          if (this.state[config_attr] !== this.state["_" + config_attr]) {
            disableSaveBtn = false;
            break;
          }
        }
        if (hour !== this.state["_nsslapd-accesslog-logrotationsynchour"] || min3 !== this.state["_nsslapd-accesslog-logrotationsyncmin"]) {
          disableSaveBtn = false;
        }
        this.setState({
          "nsslapd-accesslog-logrotationsynchour": hour,
          "nsslapd-accesslog-logrotationsyncmin": min3,
          saveRotationDisabled: disableSaveBtn
        });
      });
      this.defaultLevel = /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_jsx_runtime73.Fragment, { children: [
        _73("Default Logging"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("font", { size: "1", className: "ds-info-color", children: "(level 256)" })
      ] });
      this.internalOpLevel = /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_jsx_runtime73.Fragment, { children: [
        _73("Internal Operations"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("font", { size: "1", className: "ds-info-color", children: "(level 4)" })
      ] });
      this.refLevel = /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_jsx_runtime73.Fragment, { children: [
        _73("Entry Access and Referrals"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("font", { size: "1", className: "ds-info-color", children: "(level 512)" })
      ] });
      this.state = {
        loading: false,
        loaded: false,
        activeTabKey: 0,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        attrs: this.props.attrs,
        canSelectAll: false,
        isExpanded: false,
        rows: [
          { cells: [{ title: this.defaultLevel }], level: 256, selected: true },
          { cells: [{ title: this.internalOpLevel }], level: 4, selected: false },
          { cells: [{ title: this.refLevel }], level: 512, selected: false }
        ],
        columns: [
          { title: _73("Logging Level") }
        ]
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleOnToggle = (_event, isExpanded) => {
        this.setState({
          isExpanded
        });
      };
      this.handleChange = this.handleChange.bind(this);
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.handleTimeChange = this.handleTimeChange.bind(this);
      this.loadConfig = this.loadConfig.bind(this);
      this.refreshConfig = this.refreshConfig.bind(this);
      this.saveConfig = this.saveConfig.bind(this);
      this.handleOnSelect = this.handleOnSelect.bind(this);
      this.onMinusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.onConfigChange = (event, id, min3, max3, nav_tab) => {
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        let newValue = isNaN(event.target.value) ? min3 : Number(event.target.value);
        newValue = newValue > maxValue ? maxValue : newValue < min3 ? min3 : newValue;
        this.setState({
          [id]: newValue
        }, () => {
          this.validateSaveBtn(nav_tab, id, newValue);
        });
      };
      this.onPlusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.loadConfig();
      } else {
        this.props.enableTree();
      }
    }
    validateSaveBtn(nav_tab, attr, value) {
      let disableSaveBtn = true;
      let disableBtnName = "";
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs;
        disableBtnName = "saveSettingsDisabled";
        for (const row of this.state.rows) {
          for (const orig_row of this.state._rows) {
            if (orig_row.level === row.level) {
              if (orig_row.selected !== row.selected) {
                disableSaveBtn = false;
                break;
              }
            }
          }
        }
      } else if (nav_tab === "rotation") {
        disableBtnName = "saveRotationDisabled";
        config_attrs = rotation_attrs;
      } else {
        config_attrs = exp_attrs3;
        disableBtnName = "saveExpDisabled";
      }
      for (const config_attr of config_attrs) {
        if (attr === config_attr && this.state["_" + config_attr].toString() !== value.toString()) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const config_attr of config_attrs) {
        if (attr !== config_attr && this.state["_" + config_attr].toString() !== this.state[config_attr].toString()) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [disableBtnName]: disableSaveBtn
      });
    }
    handleChange(e, nav_tab) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn(nav_tab, attr, value);
      });
    }
    handleSwitchChange(value) {
      this.setState({
        "nsslapd-accesslog-compress": value
      }, () => {
        this.validateSaveBtn("rotation", "nsslapd-accesslog-compress", value);
      });
    }
    saveConfig(nav_tab) {
      let new_level = 0;
      this.setState({
        loading: true
      });
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs;
      } else if (nav_tab === "rotation") {
        config_attrs = rotation_attrs;
      } else {
        config_attrs = exp_attrs3;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of config_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      for (const row of this.state.rows) {
        if (row.selected) {
          new_level += row.level;
        }
      }
      if (new_level.toString() !== this.state["_nsslapd-accesslog-level"]) {
        if (new_level === 0) {
          new_level = 256;
        }
        cmd.push("nsslapd-accesslog-level=" + new_level.toString());
      }
      if (cmd.length === 5) {
        return;
      }
      log_cmd("saveConfig", "Saving access log settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload();
        this.refreshConfig(1);
        this.props.addNotification(
          "success",
          _73("Successfully updated Access Log settings")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reload();
        this.refreshConfig(1);
        this.props.addNotification(
          "error",
          cockpit_default.format(_73("Error saving Access Log settings - $0"), errMsg)
        );
      });
    }
    refreshConfig(loading) {
      if (!loading) {
        this.setState({
          loading: true,
          loaded: false
        });
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("refreshConfig", "load Access Log configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        let enabled = false;
        let buffering = false;
        let compress = false;
        const level_val = parseInt(attrs["nsslapd-accesslog-level"][0]);
        const rows = [...this.state.rows];
        if (attrs["nsslapd-accesslog-logging-enabled"][0] === "on") {
          enabled = true;
        }
        if (attrs["nsslapd-accesslog-logbuffering"][0] === "on") {
          buffering = true;
        }
        if (attrs["nsslapd-accesslog-compress"][0] === "on") {
          compress = true;
        }
        for (const row in rows) {
          if (rows[row].level & level_val) {
            rows[row].selected = true;
          } else {
            rows[row].selected = false;
          }
        }
        this.setState({
          loading: false,
          loaded: true,
          saveSettingsDisabled: true,
          saveRotationDisabled: true,
          saveExpDisabled: true,
          "nsslapd-accesslog": attrs["nsslapd-accesslog"][0],
          "nsslapd-accesslog-level": attrs["nsslapd-accesslog-level"][0],
          "nsslapd-accesslog-logbuffering": buffering,
          "nsslapd-accesslog-logexpirationtime": parseInt(attrs["nsslapd-accesslog-logexpirationtime"][0]),
          "nsslapd-accesslog-logexpirationtimeunit": attrs["nsslapd-accesslog-logexpirationtimeunit"][0],
          "nsslapd-accesslog-logging-enabled": enabled,
          "nsslapd-accesslog-logmaxdiskspace": parseInt(attrs["nsslapd-accesslog-logmaxdiskspace"][0]),
          "nsslapd-accesslog-logminfreediskspace": parseInt(attrs["nsslapd-accesslog-logminfreediskspace"][0]),
          "nsslapd-accesslog-logrotationsync-enabled": attrs["nsslapd-accesslog-logrotationsync-enabled"][0],
          "nsslapd-accesslog-logrotationsynchour": parseInt(attrs["nsslapd-accesslog-logrotationsynchour"][0]),
          "nsslapd-accesslog-logrotationsyncmin": parseInt(attrs["nsslapd-accesslog-logrotationsyncmin"][0]),
          "nsslapd-accesslog-logrotationtime": parseInt(attrs["nsslapd-accesslog-logrotationtime"][0]),
          "nsslapd-accesslog-logrotationtimeunit": attrs["nsslapd-accesslog-logrotationtimeunit"][0],
          "nsslapd-accesslog-maxlogsize": parseInt(attrs["nsslapd-accesslog-maxlogsize"][0]),
          "nsslapd-accesslog-maxlogsperdir": parseInt(attrs["nsslapd-accesslog-maxlogsperdir"][0]),
          "nsslapd-accesslog-compress": compress,
          "nsslapd-accesslog-log-format": attrs["nsslapd-accesslog-log-format"][0],
          "nsslapd-accesslog-time-format": attrs["nsslapd-accesslog-time-format"][0],
          rows,
          // Record original values
          _rows: JSON.parse(JSON.stringify(rows)),
          "_nsslapd-accesslog": attrs["nsslapd-accesslog"][0],
          "_nsslapd-accesslog-level": attrs["nsslapd-accesslog-level"][0],
          "_nsslapd-accesslog-logbuffering": buffering,
          "_nsslapd-accesslog-logexpirationtime": parseInt(attrs["nsslapd-accesslog-logexpirationtime"][0]),
          "_nsslapd-accesslog-logexpirationtimeunit": attrs["nsslapd-accesslog-logexpirationtimeunit"][0],
          "_nsslapd-accesslog-logging-enabled": enabled,
          "_nsslapd-accesslog-logmaxdiskspace": parseInt(attrs["nsslapd-accesslog-logmaxdiskspace"][0]),
          "_nsslapd-accesslog-logminfreediskspace": parseInt(attrs["nsslapd-accesslog-logminfreediskspace"][0]),
          "_nsslapd-accesslog-logrotationsync-enabled": attrs["nsslapd-accesslog-logrotationsync-enabled"][0],
          "_nsslapd-accesslog-logrotationsynchour": parseInt(attrs["nsslapd-accesslog-logrotationsynchour"][0]),
          "_nsslapd-accesslog-logrotationsyncmin": parseInt(attrs["nsslapd-accesslog-logrotationsyncmin"][0]),
          "_nsslapd-accesslog-logrotationtime": parseInt(attrs["nsslapd-accesslog-logrotationtime"][0]),
          "_nsslapd-accesslog-logrotationtimeunit": attrs["nsslapd-accesslog-logrotationtimeunit"][0],
          "_nsslapd-accesslog-maxlogsize": parseInt(attrs["nsslapd-accesslog-maxlogsize"][0]),
          "_nsslapd-accesslog-maxlogsperdir": parseInt(attrs["nsslapd-accesslog-maxlogsperdir"][0]),
          "_nsslapd-accesslog-compress": compress,
          "_nsslapd-accesslog-log-format": attrs["nsslapd-accesslog-log-format"][0],
          "_nsslapd-accesslog-time-format": attrs["nsslapd-accesslog-time-format"][0]
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_73("Error loading Access Log configuration - $0"), errMsg)
        );
        this.setState({
          loading: false,
          loaded: true
        });
      });
    }
    loadConfig() {
      const attrs = this.state.attrs;
      let enabled = false;
      let buffering = false;
      let compress = false;
      const level_val = parseInt(attrs["nsslapd-accesslog-level"][0]);
      const rows = [...this.state.rows];
      this.setState({
        loading: true
      });
      if (attrs["nsslapd-accesslog-logging-enabled"][0] === "on") {
        enabled = true;
      }
      if (attrs["nsslapd-accesslog-logbuffering"][0] === "on") {
        buffering = true;
      }
      if (attrs["nsslapd-accesslog-compress"][0] === "on") {
        compress = true;
      }
      for (const row in rows) {
        if (rows[row].level & level_val) {
          rows[row].selected = true;
        } else {
          rows[row].selected = false;
        }
      }
      this.setState({
        loading: false,
        loaded: true,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        "nsslapd-accesslog": attrs["nsslapd-accesslog"][0],
        "nsslapd-accesslog-level": attrs["nsslapd-accesslog-level"][0],
        "nsslapd-accesslog-logbuffering": buffering,
        "nsslapd-accesslog-logexpirationtime": parseInt(attrs["nsslapd-accesslog-logexpirationtime"][0]),
        "nsslapd-accesslog-logexpirationtimeunit": attrs["nsslapd-accesslog-logexpirationtimeunit"][0],
        "nsslapd-accesslog-logging-enabled": enabled,
        "nsslapd-accesslog-logmaxdiskspace": parseInt(attrs["nsslapd-accesslog-logmaxdiskspace"][0]),
        "nsslapd-accesslog-logminfreediskspace": parseInt(attrs["nsslapd-accesslog-logminfreediskspace"][0]),
        "nsslapd-accesslog-logrotationsync-enabled": attrs["nsslapd-accesslog-logrotationsync-enabled"][0],
        "nsslapd-accesslog-logrotationsynchour": parseInt(attrs["nsslapd-accesslog-logrotationsynchour"][0]),
        "nsslapd-accesslog-logrotationsyncmin": parseInt(attrs["nsslapd-accesslog-logrotationsyncmin"][0]),
        "nsslapd-accesslog-logrotationtime": parseInt(attrs["nsslapd-accesslog-logrotationtime"][0]),
        "nsslapd-accesslog-logrotationtimeunit": attrs["nsslapd-accesslog-logrotationtimeunit"][0],
        "nsslapd-accesslog-maxlogsize": parseInt(attrs["nsslapd-accesslog-maxlogsize"][0]),
        "nsslapd-accesslog-maxlogsperdir": parseInt(attrs["nsslapd-accesslog-maxlogsperdir"][0]),
        "nsslapd-accesslog-compress": compress,
        "nsslapd-accesslog-log-format": attrs["nsslapd-accesslog-log-format"][0],
        "nsslapd-accesslog-time-format": attrs["nsslapd-accesslog-time-format"][0],
        rows,
        // Record original values
        _rows: JSON.parse(JSON.stringify(rows)),
        "_nsslapd-accesslog": attrs["nsslapd-accesslog"][0],
        "_nsslapd-accesslog-level": attrs["nsslapd-accesslog-level"][0],
        "_nsslapd-accesslog-logbuffering": buffering,
        "_nsslapd-accesslog-logexpirationtime": parseInt(attrs["nsslapd-accesslog-logexpirationtime"][0]),
        "_nsslapd-accesslog-logexpirationtimeunit": attrs["nsslapd-accesslog-logexpirationtimeunit"][0],
        "_nsslapd-accesslog-logging-enabled": enabled,
        "_nsslapd-accesslog-logmaxdiskspace": parseInt(attrs["nsslapd-accesslog-logmaxdiskspace"][0]),
        "_nsslapd-accesslog-logminfreediskspace": parseInt(attrs["nsslapd-accesslog-logminfreediskspace"][0]),
        "_nsslapd-accesslog-logrotationsync-enabled": attrs["nsslapd-accesslog-logrotationsync-enabled"][0],
        "_nsslapd-accesslog-logrotationsynchour": parseInt(attrs["nsslapd-accesslog-logrotationsynchour"][0]),
        "_nsslapd-accesslog-logrotationsyncmin": parseInt(attrs["nsslapd-accesslog-logrotationsyncmin"][0]),
        "_nsslapd-accesslog-logrotationtime": parseInt(attrs["nsslapd-accesslog-logrotationtime"][0]),
        "_nsslapd-accesslog-logrotationtimeunit": attrs["nsslapd-accesslog-logrotationtimeunit"][0],
        "_nsslapd-accesslog-maxlogsize": parseInt(attrs["nsslapd-accesslog-maxlogsize"][0]),
        "_nsslapd-accesslog-maxlogsperdir": parseInt(attrs["nsslapd-accesslog-maxlogsperdir"][0]),
        "_nsslapd-accesslog-compress": compress,
        "_nsslapd-accesslog-log-format": attrs["nsslapd-accesslog-log-format"][0],
        "_nsslapd-accesslog-time-format": attrs["nsslapd-accesslog-time-format"][0]
      }, this.props.enableTree);
    }
    handleOnSelect(event, isSelected, rowId) {
      let disableSaveBtn = true;
      const rows = [...this.state.rows];
      rows[rowId].selected = isSelected;
      for (const config_attr of settings_attrs) {
        if (this.state["_" + config_attr] !== this.state[config_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const row of rows) {
        for (const orig_row of this.state._rows) {
          if (orig_row.level === row.level) {
            if (orig_row.selected !== row.selected) {
              disableSaveBtn = false;
              break;
            }
          }
        }
      }
      this.setState({
        rows,
        saveSettingsDisabled: disableSaveBtn
      });
    }
    render() {
      let saveSettingsName = _73("Save Log Settings");
      let saveRotationName = _73("Save Rotation Settings");
      let saveDeletionName = _73("Save Deletion Settings");
      const extraPrimaryProps = {};
      let rotationTime = "";
      let hour = this.state["nsslapd-accesslog-logrotationsynchour"] ? this.state["nsslapd-accesslog-logrotationsynchour"] : "00";
      let min3 = this.state["nsslapd-accesslog-logrotationsyncmin"] ? this.state["nsslapd-accesslog-logrotationsyncmin"] : "00";
      if (this.state.loading) {
        saveSettingsName = _73("Saving settings ...");
        saveRotationName = _73("Saving settings ...");
        saveDeletionName = _73("Saving settings ...");
        extraPrimaryProps.spinnerAriaValueText = _73("Loading");
      }
      if (hour.length === 1) {
        hour = "0" + hour;
      }
      if (min3.length === 1) {
        min3 = "0" + min3;
      }
      rotationTime = hour + ":" + min3;
      const time_format_title = /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_jsx_runtime73.Fragment, { children: [
        _73("Time Format"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("font", { size: "1", children: [
          "(",
          _73("JSON only"),
          ")"
        ] })
      ] });
      let body = /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "ds-margin-top-lg ds-left-margin", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Tabs, { className: "ds-margin-top-xlg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
        /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TabTitleText, { children: _73("Settings") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
            Checkbox,
            {
              className: "ds-margin-top-xlg ds-left-margin",
              id: "nsslapd-accesslog-logging-enabled",
              isChecked: this.state["nsslapd-accesslog-logging-enabled"],
              onChange: (e, checked) => {
                this.handleChange(e, "settings");
              },
              title: _73("Enable access logging (nsslapd-accesslog-logging-enabled)."),
              label: _73("Enable Access Logging")
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Form, { className: "ds-margin-top-lg ds-left-margin", isHorizontal: true, children: [
            /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
              Grid,
              {
                title: _73("Enable access logging (nsslapd-accesslog)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { className: "ds-label", span: 3, children: _73("Access Log Location") }),
                  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
                    TextInput,
                    {
                      value: this.state["nsslapd-accesslog"],
                      type: "text",
                      id: "nsslapd-accesslog",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "nsslapd-accesslog",
                      onChange: (e, str) => {
                        this.handleChange(e, "settings");
                      }
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Grid, { title: _73("Time format using strftime formatting (nsslapd-accesslog-time-format). This only applies to the JSON log format"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { className: "ds-label", span: 3, children: time_format_title }),
              /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
                TextInput,
                {
                  value: this.state["nsslapd-accesslog-time-format"],
                  type: "text",
                  id: "nsslapd-accesslog-time-format",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "nsslapd-accesslog-time-format",
                  onChange: (e, str) => {
                    this.handleChange(e, "settings");
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Grid, { title: _73("Choose the log format (nsslapd-accesslog-log-format)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { className: "ds-label", span: 3, children: _73("Log Format") }),
              /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
                FormSelect,
                {
                  id: "nsslapd-accesslog-log-format",
                  value: this.state["nsslapd-accesslog-log-format"],
                  onChange: (e, str) => {
                    this.handleChange(e, "settings");
                  },
                  "aria-label": "FormSelect Input",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(FormSelectOption, { value: "default", label: "Default" }, "0"),
                    /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(FormSelectOption, { value: "json", label: "JSON" }, "1"),
                    /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(FormSelectOption, { value: "json-pretty", label: "JSON (pretty)" }, "2")
                  ]
                }
              ) })
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
            Checkbox,
            {
              className: "ds-left-margin ds-margin-top-lg",
              id: "nsslapd-accesslog-logbuffering",
              isChecked: this.state["nsslapd-accesslog-logbuffering"],
              onChange: (e, checked) => {
                this.handleChange(e, "settings");
              },
              title: _73("Disable access log buffering for faster troubleshooting, but this will impact server performance (nsslapd-accesslog-logbuffering)."),
              label: _73("Access Log Buffering Enabled")
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
            ExpandableSection,
            {
              className: "ds-left-margin ds-margin-top-lg ds-font-size-md",
              toggleText: this.state.isExpanded ? _73("Hide Logging Levels") : _73("Show Logging Levels"),
              onToggle: this.handleOnToggle,
              isExpanded: this.state.isExpanded,
              children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { offset: 1, span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Table, { "aria-label": "Selectable Table", variant: "compact", children: [
                /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Tr, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Th, { screenReaderText: "Checkboxes" }),
                  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Th, { children: this.state.columns[0].title })
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Tbody, { children: this.state.rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Tr, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
                    Td,
                    {
                      select: {
                        rowIndex,
                        onSelect: (_event, isSelecting) => this.handleOnSelect(_event, isSelecting, rowIndex),
                        isSelected: row.selected
                      }
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Td, { children: row.cells[0].title })
                ] }, rowIndex)) })
              ] }) }) })
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
            Button,
            {
              isDisabled: this.state.saveSettingsDisabled || this.state.loading,
              variant: "primary",
              className: "ds-margin-top-xlg",
              onClick: () => {
                this.saveConfig("settings");
              },
              isLoading: this.state.loading,
              spinnerAriaValueText: this.state.loading ? _73("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveSettingsName
            },
            "save settings"
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TabTitleText, { children: _73("Rotation Policy") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Form, { className: "ds-margin-top-lg ds-left-margin", isHorizontal: true, children: [
            /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
              Grid,
              {
                className: "ds-margin-top",
                title: _73("The maximum number of logs that are archived (nsslapd-accesslog-maxlogsperdir)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { className: "ds-label", span: 3, children: _73("Maximum Number Of Logs") }),
                  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-accesslog-maxlogsperdir"],
                      min: 1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-accesslog-maxlogsperdir", "rotation");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-accesslog-maxlogsperdir", 1, 2147483647, "rotation");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-accesslog-maxlogsperdir", "rotation");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Grid, { title: _73("The maximum size of each log file in megabytes (nsslapd-accesslog-maxlogsize)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { className: "ds-label", span: 3, children: _73("Maximum Log Size (in MB)") }),
              /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-accesslog-maxlogsize"],
                  min: -1,
                  max: 2147483647,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-accesslog-maxlogsize", "rotation");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-accesslog-maxlogsize", -1, 2147483647, "rotation");
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-accesslog-maxlogsize", "rotation");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 6
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("hr", {}),
            /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Grid, { title: _73("Rotate the log based this number of time units (nsslapd-accesslog-logrotationtime)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { className: "ds-label", span: 3, children: _73("Create New Log Every ...") }),
              /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-accesslog-logrotationtime"],
                  min: -1,
                  max: 2147483647,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-accesslog-logrotationtime", "rotation");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-accesslog-logrotationtime", -1, 2147483647, "rotation");
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-accesslog-logrotationtime", "rotation");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 6
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { offset: 5, span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
                FormSelect,
                {
                  id: "nsslapd-accesslog-logrotationtimeunit",
                  value: this.state["nsslapd-accesslog-logrotationtimeunit"],
                  onChange: (e, str) => {
                    this.handleChange(e, "rotation");
                  },
                  "aria-label": "log rotation time unit select",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(FormSelectOption, { value: "minute", label: _73("minute") }, "0"),
                    /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(FormSelectOption, { value: "hour", label: _73("hour") }, "1"),
                    /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(FormSelectOption, { value: "day", label: _73("day") }, "2"),
                    /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(FormSelectOption, { value: "week", label: _73("week") }, "3"),
                    /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(FormSelectOption, { value: "month", label: _73("month") }, "4")
                  ]
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Grid, { title: _73("The time when the log should be rotated (nsslapd-accesslog-logrotationsynchour, nsslapd-accesslog-logrotationsyncmin)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { className: "ds-label", span: 3, children: _73("Time Of Day") }),
              /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
                TimePicker,
                {
                  time: rotationTime,
                  onChange: this.handleTimeChange,
                  is24Hour: true
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Grid, { title: _73("Compress (gzip) the log after it's rotated."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { className: "ds-label", span: 3, children: _73("Compress Rotated Logs") }),
              /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { className: "ds-label", span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
                Switch,
                {
                  id: "nsslapd-accesslog-compress",
                  isChecked: this.state["nsslapd-accesslog-compress"],
                  onChange: (_event, value) => this.handleSwitchChange(value),
                  "aria-label": "nsslapd-accesslog-compress"
                }
              ) })
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
            Button,
            {
              isDisabled: this.state.saveRotationDisabled || this.state.loading,
              variant: "primary",
              className: "ds-margin-top-xlg ds-left-margin",
              onClick: () => {
                this.saveConfig("rotation");
              },
              isLoading: this.state.loading,
              spinnerAriaValueText: this.state.loading ? _73("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveRotationName
            },
            "save rot settings"
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TabTitleText, { children: _73("Deletion Policy") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Form, { className: "ds-margin-top-lg ds-left-margin", isHorizontal: true, children: [
            /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
              Grid,
              {
                className: "ds-margin-top",
                title: _73("The server deletes the oldest archived log when the total of all the logs reaches this amount (nsslapd-accesslog-logmaxdiskspace)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { className: "ds-label", span: 3, children: _73("Log Archive Exceeds (in MB)") }),
                  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-accesslog-logmaxdiskspace"],
                      min: -1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-accesslog-logmaxdiskspace", "exp");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-accesslog-logmaxdiskspace", -1, 2147483647, "exp");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-accesslog-logmaxdiskspace", "exp");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
              Grid,
              {
                title: _73("The server deletes the oldest archived log file when available disk space is less than this amount. (nsslapd-accesslog-logminfreediskspace)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { className: "ds-label", span: 3, children: _73("Free Disk Space (in MB)") }),
                  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-accesslog-logminfreediskspace"],
                      min: -1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-accesslog-logminfreediskspace", "exp");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-accesslog-logminfreediskspace", -1, 2147483647, "exp");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-accesslog-logminfreediskspace", "exp");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
              Grid,
              {
                title: _73("Server deletes an old archived log file when it is older than the specified age. (nsslapd-accesslog-logexpirationtime)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { className: "ds-label", span: 3, children: _73("Log File is Older Than ...") }),
                  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-accesslog-logexpirationtime"],
                      min: -1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-accesslog-logexpirationtime", "exp");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-accesslog-logexpirationtime", -1, 2147483647, "exp");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-accesslog-logexpirationtime", "exp");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { offset: 5, span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
                    FormSelect,
                    {
                      id: "nsslapd-accesslog-logexpirationtimeunit",
                      value: this.state["nsslapd-accesslog-logexpirationtimeunit"],
                      onChange: (e, str) => {
                        this.handleChange(e, "exp");
                      },
                      "aria-label": "log expiration time unit select",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(FormSelectOption, { value: "day", label: _73("day") }, "2"),
                        /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(FormSelectOption, { value: "week", label: _73("week") }, "3"),
                        /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(FormSelectOption, { value: "month", label: _73("month") }, "4")
                      ]
                    }
                  ) })
                ]
              }
            )
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
            Button,
            {
              isDisabled: this.state.saveExpDisabled || this.state.loading,
              variant: "primary",
              className: "ds-margin-top-xlg ds-left-margin",
              onClick: () => {
                this.saveConfig("exp");
              },
              isLoading: this.state.loading,
              spinnerAriaValueText: this.state.loading ? _73("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveDeletionName
            },
            "save del settings"
          )
        ] })
      ] }) });
      if (!this.state.loaded) {
        body = /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Text, { component: TextVariants.h3, children: _73("Loading Access Log Settings ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Spinner, { size: "xl" })
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { id: "server-accesslog-page", className: this.state.loading ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Text, { component: TextVariants.h3, children: [
          _73("Access Log Settings"),
          /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _73("Refresh log settings"),
              onClick: () => {
                this.refreshConfig();
              },
              children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }) }) }),
        body
      ] });
    }
  };
  ServerAccessLog.propTypes = {
    addNotification: import_prop_types71.default.func,
    serverId: import_prop_types71.default.string,
    attrs: import_prop_types71.default.object
  };
  ServerAccessLog.defaultProps = {
    serverId: "",
    attrs: {}
  };

  // src/lib/server/auditLog.jsx
  var import_react144 = __toESM(require_react(), 1);
  var import_prop_types72 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime74 = __toESM(require_jsx_runtime(), 1);
  var settings_attrs2 = [
    "nsslapd-auditlog",
    "nsslapd-auditlog-logging-enabled",
    "nsslapd-auditlog-logbuffering",
    "nsslapd-auditlog-log-format",
    "nsslapd-auditlog-time-format"
  ];
  var rotation_attrs2 = [
    "nsslapd-auditlog-logrotationsync-enabled",
    "nsslapd-auditlog-logrotationsynchour",
    "nsslapd-auditlog-logrotationsyncmin",
    "nsslapd-auditlog-logrotationtime",
    "nsslapd-auditlog-logrotationtimeunit",
    "nsslapd-auditlog-maxlogsize",
    "nsslapd-auditlog-maxlogsperdir",
    "nsslapd-auditlog-compress"
  ];
  var rotation_attrs_no_time2 = [
    "nsslapd-auditlog-logrotationsync-enabled",
    "nsslapd-auditlog-logrotationtime",
    "nsslapd-auditlog-logrotationtimeunit",
    "nsslapd-auditlog-maxlogsize",
    "nsslapd-auditlog-maxlogsperdir",
    "nsslapd-auditlog-compress"
  ];
  var exp_attrs4 = [
    "nsslapd-auditlog-logexpirationtime",
    "nsslapd-auditlog-logexpirationtimeunit",
    "nsslapd-auditlog-logmaxdiskspace",
    "nsslapd-auditlog-logminfreediskspace"
  ];
  var _74 = cockpit_default.gettext;
  var ServerAuditLog = class extends import_react144.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleTimeChange", (_event, time2, hour, min3, seconds2, isValid) => {
        let disableSaveBtn = true;
        if (hour.length === 2 && hour[0] === "0") {
          hour = hour[1];
        }
        if (min3.length === 2 && min3[0] === "0") {
          min3 = min3[1];
        }
        for (const config_attr of rotation_attrs_no_time2) {
          if (this.state[config_attr] !== this.state["_" + config_attr]) {
            disableSaveBtn = false;
            break;
          }
        }
        if (hour !== this.state["_nsslapd-auditlog-logrotationsynchour"] || min3 !== this.state["_nsslapd-auditlog-logrotationsyncmin"]) {
          disableSaveBtn = false;
        }
        this.setState({
          "nsslapd-auditlog-logrotationsynchour": hour,
          "nsslapd-auditlog-logrotationsyncmin": min3,
          saveRotationDisabled: disableSaveBtn
        });
      });
      this.state = {
        loading: false,
        loaded: false,
        activeTabKey: 0,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        attrs: this.props.attrs,
        displayAttrs: [],
        isDisplayAttrOpen: false,
        attributes: this.props.displayAttrs,
        displayAllAttrs: false
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleOnDisplayAttrSelect = (event, selection) => {
        this.setState({
          displayAttrs: Array.isArray(selection) ? selection : []
        }, () => {
          this.validateSaveBtn("settings", "none", "none");
        });
      };
      this.handleOnDisplayAttrToggle = (_event, isDisplayAttrOpen) => {
        this.setState({
          isDisplayAttrOpen
        });
      };
      this.handleOnDisplayAttrClear = () => {
        this.setState({
          displayAttrs: [],
          isDisplayAttrOpen: false
        }, () => {
          this.validateSaveBtn("settings", "none", "none");
        });
      };
      this.handleChange = this.handleChange.bind(this);
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.handleTimeChange = this.handleTimeChange.bind(this);
      this.loadConfig = this.loadConfig.bind(this);
      this.refreshConfig = this.refreshConfig.bind(this);
      this.saveConfig = this.saveConfig.bind(this);
      this.onMinusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.onConfigChange = (event, id, min3, max3, nav_tab) => {
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        let newValue = isNaN(event.target.value) ? min3 : Number(event.target.value);
        newValue = newValue > maxValue ? maxValue : newValue < min3 ? min3 : newValue;
        this.setState({
          [id]: newValue
        }, () => {
          this.validateSaveBtn(nav_tab, id, newValue);
        });
      };
      this.onPlusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.loadConfig();
      } else {
        this.props.enableTree();
      }
    }
    validateSaveBtn(nav_tab, attr, value) {
      let disableSaveBtn = true;
      let disableBtnName = "";
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs2;
        disableBtnName = "saveSettingsDisabled";
      } else if (nav_tab === "rotation") {
        disableBtnName = "saveRotationDisabled";
        config_attrs = rotation_attrs2;
      } else {
        config_attrs = exp_attrs4;
        disableBtnName = "saveExpDisabled";
      }
      for (const config_attr of config_attrs) {
        if (attr === config_attr && this.state["_" + config_attr].toString() !== value.toString()) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const config_attr of config_attrs) {
        if (attr !== config_attr && this.state["_" + config_attr].toString() !== this.state[config_attr].toString()) {
          disableSaveBtn = false;
          break;
        }
      }
      if (this.state.displayAllAttrs !== this.state._displayAllAttrs) {
        disableSaveBtn = false;
      }
      if (!this.state.displayAllAttrs && !listsEqual(this.state.displayAttrs, this.state._displayAttrs)) {
        disableSaveBtn = false;
      }
      this.setState({
        [disableBtnName]: disableSaveBtn
      });
    }
    handleChange(e, nav_tab) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn(nav_tab, attr, value);
      });
    }
    handleSwitchChange(value) {
      this.setState({
        "nsslapd-auditlog-compress": value
      }, () => {
        this.validateSaveBtn("rotation", "nsslapd-auditlog-compress", value);
      });
    }
    saveConfig(nav_tab) {
      this.setState({
        loading: true
      });
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs2;
      } else if (nav_tab === "rotation") {
        config_attrs = rotation_attrs2;
      } else {
        config_attrs = exp_attrs4;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of config_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      if (!this.state.displayAllAttrs && !listsEqual(this.state.displayAttrs, this.state._displayAttrs)) {
        if (this.state.displayAttrs.length > 0) {
          const val = this.state.displayAttrs.join(" ");
          cmd.push("nsslapd-auditlog-display-attrs=" + val);
        } else {
          cmd.push("nsslapd-auditlog-display-attrs=");
        }
      }
      if (this.state.displayAllAttrs !== this.state._displayAllAttrs) {
        if (this.state.displayAllAttrs) {
          cmd.push("nsslapd-auditlog-display-attrs=*");
        } else if (this.state.displayAttrs.length === 0) {
          cmd.push("nsslapd-auditlog-display-attrs=");
        }
      }
      if (cmd.length === 5) {
        return;
      }
      log_cmd("saveConfig", "Saving audit log settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload();
        this.refreshConfig(1);
        this.props.addNotification(
          "success",
          _74("Successfully updated Audit Log settings")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reload();
        this.refreshConfig(1);
        this.props.addNotification(
          "error",
          cockpit_default.format(_74("Error saving Audit Log settings - $0"), errMsg)
        );
      });
    }
    refreshConfig(loading) {
      if (!loading) {
        this.setState({
          loading: true,
          loaded: false
        });
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("refreshConfig", "load Audit Log configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        let enabled = false;
        let compressed = false;
        let buffering = false;
        let display_attrs = [];
        let displayAllAttrs = this.state.displayAllAttrs;
        if (attrs["nsslapd-auditlog-logging-enabled"][0] === "on") {
          enabled = true;
        }
        if (attrs["nsslapd-auditlog-compress"][0] === "on") {
          compressed = true;
        }
        if (attrs["nsslapd-auditlog-logbuffering"][0] === "on") {
          buffering = true;
        }
        if ("nsslapd-auditlog-display-attrs" in attrs) {
          if (attrs["nsslapd-auditlog-display-attrs"][0] === "*") {
            displayAllAttrs = true;
          } else if (attrs["nsslapd-auditlog-display-attrs"][0] !== "") {
            displayAllAttrs = false;
            display_attrs = attrs["nsslapd-auditlog-display-attrs"][0].split(/[, ]+/);
          }
        }
        this.setState({
          loading: false,
          loaded: true,
          saveSettingsDisabled: true,
          saveRotationDisabled: true,
          saveExpDisabled: true,
          "nsslapd-auditlog": attrs["nsslapd-auditlog"][0],
          "nsslapd-auditlog-logexpirationtime": parseInt(attrs["nsslapd-auditlog-logexpirationtime"][0]),
          "nsslapd-auditlog-logexpirationtimeunit": attrs["nsslapd-auditlog-logexpirationtimeunit"][0],
          "nsslapd-auditlog-logging-enabled": enabled,
          "nsslapd-auditlog-logmaxdiskspace": parseInt(attrs["nsslapd-auditlog-logmaxdiskspace"][0]),
          "nsslapd-auditlog-logminfreediskspace": parseInt(attrs["nsslapd-auditlog-logminfreediskspace"][0]),
          "nsslapd-auditlog-logrotationsync-enabled": attrs["nsslapd-auditlog-logrotationsync-enabled"][0],
          "nsslapd-auditlog-logrotationsynchour": parseInt(attrs["nsslapd-auditlog-logrotationsynchour"][0]),
          "nsslapd-auditlog-logrotationsyncmin": parseInt(attrs["nsslapd-auditlog-logrotationsyncmin"][0]),
          "nsslapd-auditlog-logrotationtime": parseInt(attrs["nsslapd-auditlog-logrotationtime"][0]),
          "nsslapd-auditlog-logrotationtimeunit": attrs["nsslapd-auditlog-logrotationtimeunit"][0],
          "nsslapd-auditlog-maxlogsize": parseInt(attrs["nsslapd-auditlog-maxlogsize"][0]),
          "nsslapd-auditlog-maxlogsperdir": parseInt(attrs["nsslapd-auditlog-maxlogsperdir"][0]),
          "nsslapd-auditlog-compress": compressed,
          "nsslapd-auditlog-logbuffering": buffering,
          "nsslapd-auditlog-log-format": attrs["nsslapd-auditlog-log-format"][0],
          "nsslapd-auditlog-time-format": attrs["nsslapd-auditlog-time-format"][0],
          displayAttrs: display_attrs,
          displayAllAttrs,
          // Record original values
          "_nsslapd-auditlog": attrs["nsslapd-auditlog"][0],
          "_nsslapd-auditlog-logexpirationtime": parseInt(attrs["nsslapd-auditlog-logexpirationtime"][0]),
          "_nsslapd-auditlog-logexpirationtimeunit": attrs["nsslapd-auditlog-logexpirationtimeunit"][0],
          "_nsslapd-auditlog-logging-enabled": enabled,
          "_nsslapd-auditlog-logmaxdiskspace": parseInt(attrs["nsslapd-auditlog-logmaxdiskspace"][0]),
          "_nsslapd-auditlog-logminfreediskspace": parseInt(attrs["nsslapd-auditlog-logminfreediskspace"][0]),
          "_nsslapd-auditlog-logrotationsync-enabled": attrs["nsslapd-auditlog-logrotationsync-enabled"][0],
          "_nsslapd-auditlog-logrotationsynchour": parseInt(attrs["nsslapd-auditlog-logrotationsynchour"][0]),
          "_nsslapd-auditlog-logrotationsyncmin": parseInt(attrs["nsslapd-auditlog-logrotationsyncmin"][0]),
          "_nsslapd-auditlog-logrotationtime": parseInt(attrs["nsslapd-auditlog-logrotationtime"][0]),
          "_nsslapd-auditlog-logrotationtimeunit": attrs["nsslapd-auditlog-logrotationtimeunit"][0],
          "_nsslapd-auditlog-maxlogsize": parseInt(attrs["nsslapd-auditlog-maxlogsize"][0]),
          "_nsslapd-auditlog-maxlogsperdir": parseInt(attrs["nsslapd-auditlog-maxlogsperdir"][0]),
          "_nsslapd-auditlog-compress": compressed,
          "_nsslapd-auditlog-logbuffering": buffering,
          "_nsslapd-auditlog-log-format": attrs["nsslapd-auditlog-log-format"][0],
          "_nsslapd-auditlog-time-format": attrs["nsslapd-auditlog-time-format"][0],
          _displayAttrs: display_attrs,
          _displayAllAttrs: displayAllAttrs
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_74("Error loading Audit Log configuration - $0"), errMsg)
        );
        this.setState({
          loading: false,
          loaded: true
        });
      });
    }
    loadConfig() {
      const attrs = this.state.attrs;
      let enabled = false;
      let compressed = false;
      let buffering = false;
      let display_attrs = [];
      let displayAllAttrs = this.state.displayAllAttrs;
      this.setState({
        loading: true,
        loaded: false
      });
      if (attrs["nsslapd-auditlog-logging-enabled"][0] === "on") {
        enabled = true;
      }
      if (attrs["nsslapd-auditlog-compress"][0] === "on") {
        compressed = true;
      }
      if (attrs["nsslapd-auditlog-logbuffering"][0] === "on") {
        buffering = true;
      }
      if ("nsslapd-auditlog-display-attrs" in attrs) {
        if (attrs["nsslapd-auditlog-display-attrs"][0] === "*") {
          displayAllAttrs = true;
        } else if (attrs["nsslapd-auditlog-display-attrs"][0] !== "") {
          display_attrs = attrs["nsslapd-auditlog-display-attrs"][0].split(/[, ]+/);
        }
      }
      this.setState({
        loading: false,
        loaded: true,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        "nsslapd-auditlog": attrs["nsslapd-auditlog"][0],
        "nsslapd-auditlog-logexpirationtime": attrs["nsslapd-auditlog-logexpirationtime"][0],
        "nsslapd-auditlog-logexpirationtimeunit": attrs["nsslapd-auditlog-logexpirationtimeunit"][0],
        "nsslapd-auditlog-logging-enabled": enabled,
        "nsslapd-auditlog-logmaxdiskspace": attrs["nsslapd-auditlog-logmaxdiskspace"][0],
        "nsslapd-auditlog-logminfreediskspace": attrs["nsslapd-auditlog-logminfreediskspace"][0],
        "nsslapd-auditlog-logrotationsync-enabled": attrs["nsslapd-auditlog-logrotationsync-enabled"][0],
        "nsslapd-auditlog-logrotationsynchour": attrs["nsslapd-auditlog-logrotationsynchour"][0],
        "nsslapd-auditlog-logrotationsyncmin": attrs["nsslapd-auditlog-logrotationsyncmin"][0],
        "nsslapd-auditlog-logrotationtime": attrs["nsslapd-auditlog-logrotationtime"][0],
        "nsslapd-auditlog-logrotationtimeunit": attrs["nsslapd-auditlog-logrotationtimeunit"][0],
        "nsslapd-auditlog-maxlogsize": attrs["nsslapd-auditlog-maxlogsize"][0],
        "nsslapd-auditlog-maxlogsperdir": parseInt(attrs["nsslapd-auditlog-maxlogsperdir"][0]),
        "nsslapd-auditlog-compress": compressed,
        "nsslapd-auditlog-logbuffering": buffering,
        "nsslapd-auditlog-log-format": attrs["nsslapd-auditlog-log-format"][0],
        "nsslapd-auditlog-time-format": attrs["nsslapd-auditlog-time-format"][0],
        displayAttrs: display_attrs,
        displayAllAttrs,
        // Record original values,
        "_nsslapd-auditlog": attrs["nsslapd-auditlog"][0],
        "_nsslapd-auditlog-logexpirationtime": attrs["nsslapd-auditlog-logexpirationtime"][0],
        "_nsslapd-auditlog-logexpirationtimeunit": attrs["nsslapd-auditlog-logexpirationtimeunit"][0],
        "_nsslapd-auditlog-logging-enabled": enabled,
        "_nsslapd-auditlog-logmaxdiskspace": attrs["nsslapd-auditlog-logmaxdiskspace"][0],
        "_nsslapd-auditlog-logminfreediskspace": attrs["nsslapd-auditlog-logminfreediskspace"][0],
        "_nsslapd-auditlog-logrotationsync-enabled": attrs["nsslapd-auditlog-logrotationsync-enabled"][0],
        "_nsslapd-auditlog-logrotationsynchour": attrs["nsslapd-auditlog-logrotationsynchour"][0],
        "_nsslapd-auditlog-logrotationsyncmin": attrs["nsslapd-auditlog-logrotationsyncmin"][0],
        "_nsslapd-auditlog-logrotationtime": attrs["nsslapd-auditlog-logrotationtime"][0],
        "_nsslapd-auditlog-logrotationtimeunit": attrs["nsslapd-auditlog-logrotationtimeunit"][0],
        "_nsslapd-auditlog-maxlogsize": attrs["nsslapd-auditlog-maxlogsize"][0],
        "_nsslapd-auditlog-maxlogsperdir": parseInt(attrs["nsslapd-auditlog-maxlogsperdir"][0]),
        "_nsslapd-auditlog-compress": compressed,
        "_nsslapd-auditlog-logbuffering": buffering,
        "_nsslapd-auditlog-log-format": attrs["nsslapd-auditlog-log-format"][0],
        "_nsslapd-auditlog-time-format": attrs["nsslapd-auditlog-time-format"][0],
        _displayAttrs: display_attrs,
        _displayAllAttrs: displayAllAttrs
      }, this.props.enableTree);
    }
    render() {
      let saveSettingsName = _74("Save Log Settings");
      let saveRotationName = _74("Save Rotation Settings");
      let saveDeletionName = _74("Save Deletion Settings");
      const extraPrimaryProps = {};
      let rotationTime = "";
      let hour = this.state["nsslapd-auditlog-logrotationsynchour"] ? this.state["nsslapd-auditlog-logrotationsynchour"] : "00";
      let min3 = this.state["nsslapd-auditlog-logrotationsyncmin"] ? this.state["nsslapd-auditlog-logrotationsyncmin"] : "00";
      if (this.state.loading) {
        saveSettingsName = _74("Saving settings ...");
        saveRotationName = _74("Saving settings ...");
        saveDeletionName = _74("Saving settings ...");
        extraPrimaryProps.spinnerAriaValueText = _74("Loading");
      }
      if (hour.length === 1) {
        hour = "0" + hour;
      }
      if (min3.length === 1) {
        min3 = "0" + min3;
      }
      rotationTime = hour + ":" + min3;
      const time_format_title = /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
        _74("Time Format"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("font", { size: "1", children: [
          "(",
          _74("JSON only"),
          ")"
        ] })
      ] });
      let body = /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "ds-margin-top-lg ds-left-margin", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Tabs, { className: "ds-margin-top-xlg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
        /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(TabTitleText, { children: _74("Settings") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
            Checkbox,
            {
              className: "ds-margin-top-xlg ds-left-margin",
              id: "nsslapd-auditlog-logging-enabled",
              isChecked: this.state["nsslapd-auditlog-logging-enabled"],
              onChange: (e, checked) => {
                this.handleChange(e, "settings");
              },
              title: _74("Enable audit logging (nsslapd-auditlog-logging-enabled)."),
              label: _74("Enable Audit Logging")
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Form, { className: "ds-margin-top-lg ds-left-margin", isHorizontal: true, children: [
            /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
              Grid,
              {
                title: _74("Enable audit logging (nsslapd-auditlog)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { className: "ds-label", span: 3, children: _74("Audit Log Location") }),
                  /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
                    TextInput,
                    {
                      value: this.state["nsslapd-auditlog"],
                      type: "text",
                      id: "nsslapd-auditlog",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "nsslapd-auditlog",
                      onChange: (e, str) => {
                        this.handleChange(e, "settings");
                      }
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Grid, { title: _74("Time format using strftime formatting (nsslapd-auditlog-time-format). This only applies to the JSON log format"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { className: "ds-label", span: 3, children: time_format_title }),
              /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
                TextInput,
                {
                  value: this.state["nsslapd-auditlog-time-format"],
                  type: "text",
                  id: "nsslapd-auditlog-time-format",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "nsslapd-auditlog-time-format",
                  onChange: (e, str) => {
                    this.handleChange(e, "settings");
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Grid, { title: _74("Choose the log format (nsslapd-auditlog-log-format)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { className: "ds-label", span: 3, children: _74("Log Format") }),
              /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
                FormSelect,
                {
                  id: "nsslapd-auditlog-log-format",
                  value: this.state["nsslapd-auditlog-log-format"],
                  onChange: (e, str) => {
                    this.handleChange(e, "settings");
                  },
                  "aria-label": "FormSelect Input",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(FormSelectOption, { value: "default", label: "Default" }, "0"),
                    /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(FormSelectOption, { value: "json", label: "JSON" }, "1"),
                    /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(FormSelectOption, { value: "json-pretty", label: "JSON (pretty)" }, "2")
                  ]
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Grid, { title: _74("Display attributes from the entry in the audit log (nsslapd-auditlog-display-attrs)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { className: "ds-label", span: 3, children: _74("Display Attributes") }),
              /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(GridItem, { span: 5, children: [
                /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: this.state.displayAllAttrs ? "ds-hidden" : "ds-margin-bottom", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
                  dsBasicComponents_default,
                  {
                    isMulti: true,
                    ariaLabel: "Type an attribute",
                    onToggle: this.handleOnDisplayAttrToggle,
                    onSelect: this.handleOnDisplayAttrSelect,
                    onClear: this.handleOnDisplayAttrClear,
                    selected: this.state.displayAttrs,
                    isOpen: this.state.isDisplayAttrOpen,
                    placeholder: _74("Type an attribute..."),
                    noResultsText: _74("There are no matching attributes"),
                    options: this.state.attributes
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
                  Checkbox,
                  {
                    className: "ds-lower-field-md",
                    id: "displayAllAttrs",
                    isChecked: this.state.displayAllAttrs,
                    onChange: (e, checked) => {
                      this.handleChange(e, "settings");
                    },
                    title: _74("Display all attributes from the entry in the audit log (nsslapd-auditlog-display-attrs)."),
                    label: _74("All Attributes")
                  }
                )
              ] })
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
            Checkbox,
            {
              className: "ds-left-margin ds-margin-top-lg",
              id: "nsslapd-auditlog-logbuffering",
              isChecked: this.state["nsslapd-auditlog-logbuffering"],
              onChange: (e, checked) => {
                this.handleChange(e, "settings");
              },
              title: _74("This applies to both the audit & auditfail logs.  Disable audit log buffering for faster troubleshooting, but this will impact server performance (nsslapd-auditlog-logbuffering)."),
              label: _74("Audit Log Buffering Enabled")
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
            Button,
            {
              isDisabled: this.state.saveSettingsDisabled || this.state.loading,
              variant: "primary",
              className: "ds-margin-top-xlg",
              onClick: () => {
                this.saveConfig("settings");
              },
              isLoading: this.state.loading,
              spinnerAriaValueText: this.state.loading ? _74("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveSettingsName
            },
            "save settings"
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(TabTitleText, { children: _74("Rotation Policy") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Form, { className: "ds-margin-top-lg ds-left-margin", isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
              Grid,
              {
                className: "ds-margin-top",
                title: _74("The maximum number of logs that are archived (nsslapd-auditlog-maxlogsperdir)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { className: "ds-label", span: 3, children: _74("Maximum Number Of Logs") }),
                  /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-auditlog-maxlogsperdir"],
                      min: 1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-auditlog-maxlogsperdir", "rotation");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-auditlog-maxlogsperdir", 1, 2147483647, "rotation");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-auditlog-maxlogsperdir", "rotation");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Grid, { title: _74("The maximum size of each log file in megabytes (nsslapd-auditlog-maxlogsize)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { className: "ds-label", span: 3, children: _74("Maximum Log Size (in MB)") }),
              /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-auditlog-maxlogsize"],
                  min: -1,
                  max: 2147483647,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-auditlog-maxlogsize", "rotation");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-auditlog-maxlogsize", -1, 2147483647, "rotation");
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-auditlog-maxlogsize", "rotation");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 6
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("hr", {}),
            /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Grid, { title: _74("Rotate the log based this number of time units (nsslapd-auditlog-logrotationtime)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { className: "ds-label", span: 3, children: _74("Create New Log Every ...") }),
              /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-auditlog-logrotationtime"],
                  min: -1,
                  max: 2147483647,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-auditlog-logrotationtime", "rotation");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-auditlog-logrotationtime", -1, 2147483647, "rotation");
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-auditlog-logrotationtime", "rotation");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 6
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { offset: 5, span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
                FormSelect,
                {
                  id: "nsslapd-auditlog-logrotationtimeunit",
                  value: this.state["nsslapd-auditlog-logrotationtimeunit"],
                  onChange: (e, str) => {
                    this.handleChange(e, "rotation");
                  },
                  "aria-label": "log rotation time unit select",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(FormSelectOption, { value: "minute", label: _74("minute") }, "0"),
                    /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(FormSelectOption, { value: "hour", label: _74("hour") }, "1"),
                    /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(FormSelectOption, { value: "day", label: _74("day") }, "2"),
                    /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(FormSelectOption, { value: "week", label: _74("week") }, "3"),
                    /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(FormSelectOption, { value: "month", label: _74("month") }, "4")
                  ]
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Grid, { title: _74("The time when the log should be rotated (nsslapd-auditlog-logrotationsynchour, nsslapd-auditlog-logrotationsyncmin)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { className: "ds-label", span: 3, children: _74("Time Of Day") }),
              /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
                TimePicker,
                {
                  time: rotationTime,
                  onChange: this.handleTimeChange,
                  is24Hour: true
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Grid, { title: _74("Compress (gzip) the log after it's rotated."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { className: "ds-label", span: 3, children: _74("Compress Rotated Logs") }),
              /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { className: "ds-label", span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
                Switch,
                {
                  id: "nsslapd-auditlog-compress",
                  isChecked: this.state["nsslapd-auditlog-compress"],
                  onChange: (_event, value) => this.handleSwitchChange(value),
                  "aria-label": "nsslapd-auditlog-compress"
                }
              ) })
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
            Button,
            {
              isDisabled: this.state.saveRotationDisabled || this.state.loading,
              variant: "primary",
              className: "ds-margin-top-xlg ds-left-margin",
              onClick: () => {
                this.saveConfig("rotation");
              },
              isLoading: this.state.loading,
              spinnerAriaValueText: this.state.loading ? _74("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveRotationName
            },
            "save rot settings"
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(TabTitleText, { children: _74("Deletion Policy") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Form, { className: "ds-margin-top-lg ds-left-margin", isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
              Grid,
              {
                className: "ds-margin-top",
                title: _74("The server deletes the oldest archived log when the total of all the logs reaches this amount (nsslapd-auditlog-logmaxdiskspace)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { className: "ds-label", span: 3, children: _74("Log Archive Exceeds (in MB)") }),
                  /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-auditlog-logmaxdiskspace"],
                      min: -1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-auditlog-logmaxdiskspace", "exp");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-auditlog-logmaxdiskspace", -1, 2147483647, "exp");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-auditlog-logmaxdiskspace", "exp");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
              Grid,
              {
                title: _74("The server deletes the oldest archived log file when available disk space is less than this amount. (nsslapd-auditlog-logminfreediskspace)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { className: "ds-label", span: 3, children: _74("Free Disk Space (in MB)") }),
                  /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-auditlog-logminfreediskspace"],
                      min: -1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-auditlog-logminfreediskspace", "exp");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-auditlog-logminfreediskspace", -1, 2147483647, "exp");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-auditlog-logminfreediskspace", "exp");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
              Grid,
              {
                title: _74("Server deletes an old archived log file when it is older than the specified age. (nsslapd-auditlog-logexpirationtime)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { className: "ds-label", span: 3, children: _74("Log File is Older Than ...") }),
                  /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-auditlog-logexpirationtime"],
                      min: -1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-auditlog-logexpirationtime", "exp");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-auditlog-logexpirationtime", -1, 2147483647, "exp");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-auditlog-logexpirationtime", "exp");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { offset: 5, span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
                    FormSelect,
                    {
                      id: "nsslapd-auditlog-logexpirationtimeunit",
                      value: this.state["nsslapd-auditlog-logexpirationtimeunit"],
                      onChange: (e, str) => {
                        this.handleChange(e, "exp");
                      },
                      "aria-label": "log expiration time unit select",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(FormSelectOption, { value: "day", label: _74("day") }, "2"),
                        /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(FormSelectOption, { value: "week", label: _74("week") }, "3"),
                        /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(FormSelectOption, { value: "month", label: _74("month") }, "4")
                      ]
                    }
                  ) })
                ]
              }
            )
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
            Button,
            {
              isDisabled: this.state.saveExpDisabled || this.state.loading,
              variant: "primary",
              className: "ds-margin-top-xlg ds-left-margin",
              onClick: () => {
                this.saveConfig("exp");
              },
              isLoading: this.state.loading,
              spinnerAriaValueText: this.state.loading ? _74("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveDeletionName
            },
            "save del settings"
          )
        ] })
      ] }) });
      if (!this.state.loaded) {
        body = /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "ds-loading-spinner ds-margin-top-xlg ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Text, { component: TextVariants.h3, children: _74("Loading Audit Log settings ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Spinner, { className: "ds-margin-top", size: "lg" })
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { id: "server-auditlog-page", className: this.state.loading ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Text, { component: TextVariants.h3, children: [
          _74("Audit Log Settings"),
          /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _74("Refresh log settings"),
              onClick: () => {
                this.refreshConfig();
              },
              children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }) }) }),
        body
      ] });
    }
  };
  ServerAuditLog.propTypes = {
    addNotification: import_prop_types72.default.func,
    serverId: import_prop_types72.default.string,
    attrs: import_prop_types72.default.object,
    displayAttrs: import_prop_types72.default.array
  };
  ServerAuditLog.defaultProps = {
    serverId: "",
    attrs: {},
    displayAttrs: []
  };

  // src/lib/server/auditfailLog.jsx
  var import_react145 = __toESM(require_react(), 1);
  var import_prop_types73 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime75 = __toESM(require_jsx_runtime(), 1);
  var settings_attrs3 = [
    "nsslapd-auditfaillog",
    "nsslapd-auditfaillog-logging-enabled"
  ];
  var rotation_attrs3 = [
    "nsslapd-auditfaillog-logrotationsync-enabled",
    "nsslapd-auditfaillog-logrotationsynchour",
    "nsslapd-auditfaillog-logrotationsyncmin",
    "nsslapd-auditfaillog-logrotationtime",
    "nsslapd-auditfaillog-logrotationtimeunit",
    "nsslapd-auditfaillog-maxlogsize",
    "nsslapd-auditfaillog-maxlogsperdir",
    "nsslapd-auditfaillog-compress"
  ];
  var rotation_attrs_no_time3 = [
    "nsslapd-auditfaillog-logrotationsync-enabled",
    "nsslapd-auditfaillog-logrotationtime",
    "nsslapd-auditfaillog-logrotationtimeunit",
    "nsslapd-auditfaillog-maxlogsize",
    "nsslapd-auditfaillog-maxlogsperdir",
    "nsslapd-auditfaillog-compress"
  ];
  var exp_attrs5 = [
    "nsslapd-auditfaillog-logexpirationtime",
    "nsslapd-auditfaillog-logexpirationtimeunit",
    "nsslapd-auditfaillog-logmaxdiskspace",
    "nsslapd-auditfaillog-logminfreediskspace"
  ];
  var _75 = cockpit_default.gettext;
  var ServerAuditFailLog = class extends import_react145.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleTimeChange", (_event, time2, hour, min3, seconds2, isValid) => {
        let disableSaveBtn = true;
        if (hour.length === 2 && hour[0] === "0") {
          hour = hour[1];
        }
        if (min3.length === 2 && min3[0] === "0") {
          min3 = min3[1];
        }
        for (const config_attr of rotation_attrs_no_time3) {
          if (this.state[config_attr] !== this.state["_" + config_attr]) {
            disableSaveBtn = false;
            break;
          }
        }
        if (hour !== this.state["_nsslapd-auditfaillog-logrotationsynchour"] || min3 !== this.state["_nsslapd-auditfaillog-logrotationsyncmin"]) {
          disableSaveBtn = false;
        }
        this.setState({
          "nsslapd-auditfaillog-logrotationsynchour": hour,
          "nsslapd-auditfaillog-logrotationsyncmin": min3,
          saveRotationDisabled: disableSaveBtn
        });
      });
      this.state = {
        loading: false,
        loaded: false,
        activeTabKey: 0,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        attrs: this.props.attrs
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleChange = this.handleChange.bind(this);
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.handleTimeChange = this.handleTimeChange.bind(this);
      this.loadConfig = this.loadConfig.bind(this);
      this.refreshConfig = this.refreshConfig.bind(this);
      this.saveConfig = this.saveConfig.bind(this);
      this.onMinusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.onConfigChange = (event, id, min3, max3, nav_tab) => {
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        let newValue = isNaN(event.target.value) ? min3 : Number(event.target.value);
        newValue = newValue > maxValue ? maxValue : newValue < min3 ? min3 : newValue;
        this.setState({
          [id]: newValue
        }, () => {
          this.validateSaveBtn(nav_tab, id, newValue);
        });
      };
      this.onPlusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.loadConfig();
      } else {
        this.props.enableTree();
      }
    }
    validateSaveBtn(nav_tab, attr, value) {
      let disableSaveBtn = true;
      let disableBtnName = "";
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs3;
        disableBtnName = "saveSettingsDisabled";
      } else if (nav_tab === "rotation") {
        disableBtnName = "saveRotationDisabled";
        config_attrs = rotation_attrs3;
      } else {
        config_attrs = exp_attrs5;
        disableBtnName = "saveExpDisabled";
      }
      for (const config_attr of config_attrs) {
        if (attr === config_attr && this.state["_" + config_attr].toString() !== value.toString()) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const config_attr of config_attrs) {
        console.log("testlog" + config_attr);
        if (attr !== config_attr && this.state["_" + config_attr].toString() !== this.state[config_attr].toString()) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [disableBtnName]: disableSaveBtn
      });
    }
    handleChange(e, nav_tab) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn(nav_tab, attr, value);
      });
    }
    handleSwitchChange(value) {
      this.setState({
        "nsslapd-auditfaillog-compress": value
      }, () => {
        this.validateSaveBtn("rotation", "nsslapd-auditfaillog-compress", value);
      });
    }
    saveConfig(nav_tab) {
      this.setState({
        loading: true
      });
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs3;
      } else if (nav_tab === "rotation") {
        config_attrs = rotation_attrs3;
      } else {
        config_attrs = exp_attrs5;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of config_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      if (cmd.length === 5) {
        return;
      }
      log_cmd("saveConfig", "Saving audit fail log settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload();
        this.refreshConfig(1);
        this.props.addNotification(
          "success",
          _75("Successfully updated Audit Fail Log settings")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reload();
        this.refreshConfig(1);
        this.props.addNotification(
          "error",
          cockpit_default.format(_75("Error saving Audit Fail Log settings - $0"), errMsg)
        );
      });
    }
    refreshConfig(loading) {
      if (!loading) {
        this.setState({
          loading: true,
          loaded: false
        });
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("refreshConfig", "load Audit Fail Log configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        let enabled = false;
        let compressed = false;
        if (attrs["nsslapd-auditfaillog-logging-enabled"][0] === "on") {
          enabled = true;
        }
        if (attrs["nsslapd-auditfaillog-compress"][0] === "on") {
          compressed = true;
        }
        this.setState(
          () => ({
            loading: false,
            loaded: true,
            saveSettingsDisabled: true,
            saveRotationDisabled: true,
            saveExpDisabled: true,
            "nsslapd-auditfaillog": attrs["nsslapd-auditfaillog"][0],
            "nsslapd-auditfaillog-logexpirationtime": parseInt(attrs["nsslapd-auditfaillog-logexpirationtime"][0]),
            "nsslapd-auditfaillog-logexpirationtimeunit": attrs["nsslapd-auditfaillog-logexpirationtimeunit"][0],
            "nsslapd-auditfaillog-logging-enabled": enabled,
            "nsslapd-auditfaillog-logmaxdiskspace": parseInt(attrs["nsslapd-auditfaillog-logmaxdiskspace"][0]),
            "nsslapd-auditfaillog-logminfreediskspace": parseInt(attrs["nsslapd-auditfaillog-logminfreediskspace"][0]),
            "nsslapd-auditfaillog-logrotationsync-enabled": attrs["nsslapd-auditfaillog-logrotationsync-enabled"][0],
            "nsslapd-auditfaillog-logrotationsynchour": parseInt(attrs["nsslapd-auditfaillog-logrotationsynchour"][0]),
            "nsslapd-auditfaillog-logrotationsyncmin": parseInt(attrs["nsslapd-auditfaillog-logrotationsyncmin"][0]),
            "nsslapd-auditfaillog-logrotationtime": parseInt(attrs["nsslapd-auditfaillog-logrotationtime"][0]),
            "nsslapd-auditfaillog-logrotationtimeunit": attrs["nsslapd-auditfaillog-logrotationtimeunit"][0],
            "nsslapd-auditfaillog-maxlogsize": parseInt(attrs["nsslapd-auditfaillog-maxlogsize"][0]),
            "nsslapd-auditfaillog-maxlogsperdir": parseInt(attrs["nsslapd-auditfaillog-maxlogsperdir"][0]),
            "nsslapd-auditfaillog-compress": compressed,
            // Record original values
            "_nsslapd-auditfaillog": attrs["nsslapd-auditfaillog"][0],
            "_nsslapd-auditfaillog-logexpirationtime": parseInt(attrs["nsslapd-auditfaillog-logexpirationtime"][0]),
            "_nsslapd-auditfaillog-logexpirationtimeunit": attrs["nsslapd-auditfaillog-logexpirationtimeunit"][0],
            "_nsslapd-auditfaillog-logging-enabled": enabled,
            "_nsslapd-auditfaillog-logmaxdiskspace": parseInt(attrs["nsslapd-auditfaillog-logmaxdiskspace"][0]),
            "_nsslapd-auditfaillog-logminfreediskspace": parseInt(attrs["nsslapd-auditfaillog-logminfreediskspace"][0]),
            "_nsslapd-auditfaillog-logrotationsync-enabled": attrs["nsslapd-auditfaillog-logrotationsync-enabled"][0],
            "_nsslapd-auditfaillog-logrotationsynchour": parseInt(attrs["nsslapd-auditfaillog-logrotationsynchour"][0]),
            "_nsslapd-auditfaillog-logrotationsyncmin": parseInt(attrs["nsslapd-auditfaillog-logrotationsyncmin"][0]),
            "_nsslapd-auditfaillog-logrotationtime": parseInt(attrs["nsslapd-auditfaillog-logrotationtime"][0]),
            "_nsslapd-auditfaillog-logrotationtimeunit": attrs["nsslapd-auditfaillog-logrotationtimeunit"][0],
            "_nsslapd-auditfaillog-maxlogsize": parseInt(attrs["nsslapd-auditfaillog-maxlogsize"][0]),
            "_nsslapd-auditfaillog-maxlogsperdir": parseInt(attrs["nsslapd-auditfaillog-maxlogsperdir"][0]),
            "_nsslapd-auditfaillog-compress": compressed
          })
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_75("Error loading Audit Fail Log configuration - $0"), errMsg)
        );
        this.setState({
          loading: false,
          loaded: true
        });
      });
    }
    loadConfig() {
      const attrs = this.state.attrs;
      let enabled = false;
      let compressed = false;
      this.setState({
        loading: true
      });
      if (attrs["nsslapd-auditfaillog-logging-enabled"][0] === "on") {
        enabled = true;
      }
      if (attrs["nsslapd-auditfaillog-compress"][0] === "on") {
        compressed = true;
      }
      this.setState({
        loading: false,
        loaded: true,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        "nsslapd-auditfaillog": attrs["nsslapd-auditfaillog"][0],
        "nsslapd-auditfaillog-logexpirationtime": parseInt(attrs["nsslapd-auditfaillog-logexpirationtime"][0]),
        "nsslapd-auditfaillog-logexpirationtimeunit": attrs["nsslapd-auditfaillog-logexpirationtimeunit"][0],
        "nsslapd-auditfaillog-logging-enabled": enabled,
        "nsslapd-auditfaillog-logmaxdiskspace": parseInt(attrs["nsslapd-auditfaillog-logmaxdiskspace"][0]),
        "nsslapd-auditfaillog-logminfreediskspace": parseInt(attrs["nsslapd-auditfaillog-logminfreediskspace"][0]),
        "nsslapd-auditfaillog-logrotationsync-enabled": attrs["nsslapd-auditfaillog-logrotationsync-enabled"][0],
        "nsslapd-auditfaillog-logrotationsynchour": parseInt(attrs["nsslapd-auditfaillog-logrotationsynchour"][0]),
        "nsslapd-auditfaillog-logrotationsyncmin": parseInt(attrs["nsslapd-auditfaillog-logrotationsyncmin"][0]),
        "nsslapd-auditfaillog-logrotationtime": parseInt(attrs["nsslapd-auditfaillog-logrotationtime"][0]),
        "nsslapd-auditfaillog-logrotationtimeunit": attrs["nsslapd-auditfaillog-logrotationtimeunit"][0],
        "nsslapd-auditfaillog-maxlogsize": parseInt(attrs["nsslapd-auditfaillog-maxlogsize"][0]),
        "nsslapd-auditfaillog-maxlogsperdir": parseInt(attrs["nsslapd-auditfaillog-maxlogsperdir"][0]),
        "nsslapd-auditfaillog-compress": compressed,
        // Record original values,
        "_nsslapd-auditfaillog": attrs["nsslapd-auditfaillog"][0],
        "_nsslapd-auditfaillog-logexpirationtime": parseInt(attrs["nsslapd-auditfaillog-logexpirationtime"][0]),
        "_nsslapd-auditfaillog-logexpirationtimeunit": attrs["nsslapd-auditfaillog-logexpirationtimeunit"][0],
        "_nsslapd-auditfaillog-logging-enabled": enabled,
        "_nsslapd-auditfaillog-logmaxdiskspace": parseInt(attrs["nsslapd-auditfaillog-logmaxdiskspace"][0]),
        "_nsslapd-auditfaillog-logminfreediskspace": parseInt(attrs["nsslapd-auditfaillog-logminfreediskspace"][0]),
        "_nsslapd-auditfaillog-logrotationsync-enabled": attrs["nsslapd-auditfaillog-logrotationsync-enabled"][0],
        "_nsslapd-auditfaillog-logrotationsynchour": parseInt(attrs["nsslapd-auditfaillog-logrotationsynchour"][0]),
        "_nsslapd-auditfaillog-logrotationsyncmin": parseInt(attrs["nsslapd-auditfaillog-logrotationsyncmin"][0]),
        "_nsslapd-auditfaillog-logrotationtime": parseInt(attrs["nsslapd-auditfaillog-logrotationtime"][0]),
        "_nsslapd-auditfaillog-logrotationtimeunit": attrs["nsslapd-auditfaillog-logrotationtimeunit"][0],
        "_nsslapd-auditfaillog-maxlogsize": parseInt(attrs["nsslapd-auditfaillog-maxlogsize"][0]),
        "_nsslapd-auditfaillog-maxlogsperdir": parseInt(attrs["nsslapd-auditfaillog-maxlogsperdir"][0]),
        "_nsslapd-auditfaillog-compress": compressed
      }, this.props.enableTree);
    }
    render() {
      let saveSettingsName = _75("Save Log Settings");
      let saveRotationName = _75("Save Rotation Settings");
      let saveDeletionName = _75("Save Deletion Settings");
      const extraPrimaryProps = {};
      let rotationTime = "";
      let hour = this.state["nsslapd-auditfaillog-logrotationsynchour"] ? this.state["nsslapd-auditfaillog-logrotationsynchour"] : "00";
      let min3 = this.state["nsslapd-auditfaillog-logrotationsyncmin"] ? this.state["nsslapd-auditfaillog-logrotationsyncmin"] : "00";
      if (this.state.loading) {
        saveSettingsName = _75("Saving settings ...");
        saveRotationName = _75("Saving settings ...");
        saveDeletionName = _75("Saving settings ...");
        extraPrimaryProps.spinnerAriaValueText = _75("Loading");
      }
      if (hour.length === 1) {
        hour = "0" + hour;
      }
      if (min3.length === 1) {
        min3 = "0" + min3;
      }
      rotationTime = hour + ":" + min3;
      let body = /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "ds-margin-top-lg ds-left-margin", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Tabs, { className: "ds-margin-top-xlg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
        /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TabTitleText, { children: _75("Settings") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
            Checkbox,
            {
              className: "ds-margin-top-xlg ds-left-margin",
              id: "nsslapd-auditfaillog-logging-enabled",
              isChecked: this.state["nsslapd-auditfaillog-logging-enabled"],
              onChange: (e, checked) => {
                this.handleChange(e, "settings");
              },
              title: _75("Enable audit fail logging (nsslapd-auditfaillog-logging-enabled)."),
              label: _75("Enable Audit Fail Logging")
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Form, { className: "ds-margin-top-lg ds-left-margin", isHorizontal: true, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
            Grid,
            {
              title: _75("Enable audit fail logging (nsslapd-auditfaillog)."),
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { className: "ds-label", span: 3, children: _75("Audit Fail Log Location") }),
                /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
                  TextInput,
                  {
                    value: this.state["nsslapd-auditfaillog"],
                    type: "text",
                    id: "nsslapd-auditfaillog",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "nsslapd-auditfaillog",
                    onChange: (e, str) => {
                      this.handleChange(e, "settings");
                    }
                  }
                ) })
              ]
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
            Button,
            {
              isDisabled: this.state.saveSettingsDisabled || this.state.loading,
              variant: "primary",
              className: "ds-margin-top-xlg",
              onClick: () => {
                this.saveConfig("settings");
              },
              isLoading: this.state.loading,
              spinnerAriaValueText: this.state.loading ? _75("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveSettingsName
            },
            "save settings"
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TabTitleText, { children: _75("Rotation Policy") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Form, { className: "ds-margin-top-lg ds-left-margin", isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
              Grid,
              {
                className: "ds-margin-top",
                title: _75("The maximum number of logs that are archived (nsslapd-auditfaillog-maxlogsperdir)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { className: "ds-label", span: 3, children: _75("Maximum Number Of Logs") }),
                  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-auditfaillog-maxlogsperdir"],
                      min: 1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-auditfaillog-maxlogsperdir", "rotation");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-auditfaillog-maxlogsperdir", 1, 2147483647, "rotation");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-auditfaillog-maxlogsperdir", "rotation");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Grid, { title: _75("The maximum size of each log file in megabytes (nsslapd-auditfaillog-maxlogsize)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { className: "ds-label", span: 3, children: _75("Maximum Log Size (in MB)") }),
              /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-auditfaillog-maxlogsize"],
                  min: -1,
                  max: 2147483647,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-auditfaillog-maxlogsize", "rotation");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-auditfaillog-maxlogsize", -1, 2147483647, "rotation");
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-auditfaillog-maxlogsize", "rotation");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 6
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("hr", {}),
            /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Grid, { title: _75("Rotate the log based this number of time units (nsslapd-auditfaillog-logrotationtime)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { className: "ds-label", span: 3, children: _75("Create New Log Every ...") }),
              /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-auditfaillog-logrotationtime"],
                  min: -1,
                  max: 2147483647,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-auditfaillog-logrotationtime", "rotation");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-auditfaillog-logrotationtime", -1, 2147483647, "rotation");
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-auditfaillog-logrotationtime", "rotation");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 6
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { offset: 5, span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
                FormSelect,
                {
                  id: "nsslapd-auditfaillog-logrotationtimeunit",
                  value: this.state["nsslapd-auditfaillog-logrotationtimeunit"],
                  onChange: (e, str) => {
                    this.handleChange(e, "rotation");
                  },
                  "aria-label": "log rotation time unit select",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(FormSelectOption, { value: "minute", label: _75("minute") }, "0"),
                    /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(FormSelectOption, { value: "hour", label: _75("hour") }, "1"),
                    /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(FormSelectOption, { value: "day", label: _75("day") }, "2"),
                    /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(FormSelectOption, { value: "week", label: _75("week") }, "3"),
                    /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(FormSelectOption, { value: "month", label: _75("month") }, "4")
                  ]
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Grid, { title: _75("The time when the log should be rotated (nsslapd-auditfaillog-logrotationsynchour, nsslapd-auditfaillog-logrotationsyncmin)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { className: "ds-label", span: 3, children: _75("Time Of Day") }),
              /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
                TimePicker,
                {
                  time: rotationTime,
                  onChange: this.handleTimeChange,
                  is24Hour: true
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Grid, { title: _75("Compress (gzip) the log after it's rotated."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { className: "ds-label", span: 3, children: _75("Compress Rotated Logs") }),
              /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { className: "ds-label", span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
                Switch,
                {
                  id: "nsslapd-auditfaillog-compress",
                  isChecked: this.state["nsslapd-auditfaillog-compress"],
                  onChange: (_event, value) => this.handleSwitchChange(value),
                  "aria-label": "nsslapd-auditfaillog-compress"
                }
              ) })
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
            Button,
            {
              isDisabled: this.state.saveRotationDisabled || this.state.loading,
              variant: "primary",
              className: "ds-margin-top-xlg ds-left-margin",
              onClick: () => {
                this.saveConfig("rotation");
              },
              isLoading: this.state.loading,
              spinnerAriaValueText: this.state.loading ? _75("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveRotationName
            },
            "save rot settings"
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TabTitleText, { children: _75("Deletion Policy") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Form, { className: "ds-margin-top-lg ds-left-margin", isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
              Grid,
              {
                className: "ds-margin-top",
                title: _75("The server deletes the oldest archived log when the total of all the logs reaches this amount (nsslapd-auditfaillog-logmaxdiskspace)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { className: "ds-label", span: 3, children: _75("Log Archive Exceeds (in MB)") }),
                  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-auditfaillog-logmaxdiskspace"],
                      min: -1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-auditfaillog-logmaxdiskspace", "exp");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-auditfaillog-logmaxdiskspace", -1, 2147483647, "exp");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-auditfaillog-logmaxdiskspace", "exp");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
              Grid,
              {
                title: _75("The server deletes the oldest archived log file when available disk space is less than this amount. (nsslapd-auditfaillog-logminfreediskspace)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { className: "ds-label", span: 3, children: _75("Free Disk Space (in MB)") }),
                  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-auditfaillog-logminfreediskspace"],
                      min: -1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-auditfaillog-logminfreediskspace", "exp");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-auditfaillog-logminfreediskspace", -1, 2147483647, "exp");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-auditfaillog-logminfreediskspace", "exp");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
              Grid,
              {
                title: _75("Server deletes an old archived log file when it is older than the specified age. (nsslapd-auditfaillog-logexpirationtime)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { className: "ds-label", span: 3, children: _75("Log File is Older Than ...") }),
                  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-auditfaillog-logexpirationtime"],
                      min: -1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-auditfaillog-logexpirationtime", "exp");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-auditfaillog-logexpirationtime", -1, 2147483647, "exp");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-auditfaillog-logexpirationtime", "exp");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { offset: 5, span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
                    FormSelect,
                    {
                      id: "nsslapd-auditfaillog-logexpirationtimeunit",
                      value: this.state["nsslapd-auditfaillog-logexpirationtimeunit"],
                      onChange: (e, str) => {
                        this.handleChange(e, "exp");
                      },
                      "aria-label": "log expiration time unit select",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(FormSelectOption, { value: "day", label: _75("day") }, "2"),
                        /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(FormSelectOption, { value: "week", label: _75("week") }, "3"),
                        /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(FormSelectOption, { value: "month", label: _75("month") }, "4")
                      ]
                    }
                  ) })
                ]
              }
            )
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
            Button,
            {
              isDisabled: this.state.saveExpDisabled || this.state.loading,
              variant: "primary",
              className: "ds-margin-top-xlg ds-left-margin",
              onClick: () => {
                this.saveConfig("exp");
              },
              isLoading: this.state.loading,
              spinnerAriaValueText: this.state.loading ? _75("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveDeletionName
            },
            "save del settings"
          )
        ] })
      ] }) });
      if (!this.state.loaded) {
        body = /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "ds-loading-spinner ds-margin-top-xlg ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Text, { component: TextVariants.h3, children: _75("Loading Audit Fail Log Settings ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Spinner, { className: "ds-margin-top", size: "lg" })
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { id: "server-auditfaillog-page", className: this.state.loading ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Text, { component: TextVariants.h3, children: [
          _75("Audit Fail Log Settings"),
          /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _75("Refresh log settings"),
              onClick: () => {
                this.refreshConfig();
              },
              children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }) }) }),
        body
      ] });
    }
  };
  ServerAuditFailLog.propTypes = {
    addNotification: import_prop_types73.default.func,
    serverId: import_prop_types73.default.string,
    attrs: import_prop_types73.default.object
  };
  ServerAuditFailLog.defaultProps = {
    serverId: "",
    attrs: {}
  };

  // src/lib/server/errorLog.jsx
  var import_react146 = __toESM(require_react(), 1);
  var import_prop_types74 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1);
  var settings_attrs4 = [
    "nsslapd-errorlog",
    "nsslapd-errorlog-level",
    "nsslapd-errorlog-logging-enabled",
    "nsslapd-errorlog-log-format",
    "nsslapd-errorlog-time-format",
    "nsslapd-errorlog-logbuffering"
  ];
  var _76 = cockpit_default.gettext;
  var rotation_attrs4 = [
    "nsslapd-errorlog-logrotationsync-enabled",
    "nsslapd-errorlog-logrotationsynchour",
    "nsslapd-errorlog-logrotationsyncmin",
    "nsslapd-errorlog-logrotationtime",
    "nsslapd-errorlog-logrotationtimeunit",
    "nsslapd-errorlog-maxlogsize",
    "nsslapd-errorlog-maxlogsperdir",
    "nsslapd-errorlog-compress"
  ];
  var rotation_attrs_no_time4 = [
    "nsslapd-errorlog-logrotationsync-enabled",
    "nsslapd-errorlog-logrotationtime",
    "nsslapd-errorlog-logrotationtimeunit",
    "nsslapd-errorlog-maxlogsize",
    "nsslapd-errorlog-maxlogsperdir",
    "nsslapd-errorlog-compress"
  ];
  var exp_attrs6 = [
    "nsslapd-errorlog-logexpirationtime",
    "nsslapd-errorlog-logexpirationtimeunit",
    "nsslapd-errorlog-logmaxdiskspace",
    "nsslapd-errorlog-logminfreediskspace"
  ];
  var ServerErrorLog = class extends import_react146.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleTimeChange", (_event, time2, hour, min3, seconds2, isValid) => {
        let disableSaveBtn = true;
        if (hour.length === 2 && hour[0] === "0") {
          hour = hour[1];
        }
        if (min3.length === 2 && min3[0] === "0") {
          min3 = min3[1];
        }
        for (const config_attr of rotation_attrs_no_time4) {
          if (this.state[config_attr] !== this.state["_" + config_attr]) {
            disableSaveBtn = false;
            break;
          }
        }
        if (hour !== this.state["_nsslapd-errorlog-logrotationsynchour"] || min3 !== this.state["_nsslapd-errorlog-logrotationsyncmin"]) {
          disableSaveBtn = false;
        }
        this.setState({
          "nsslapd-errorlog-logrotationsynchour": hour,
          "nsslapd-errorlog-logrotationsyncmin": min3,
          saveRotationDisabled: disableSaveBtn
        });
      });
      __publicField(this, "handleOnSelect", (_event, isSelected, rowIndex) => {
        let disableSaveBtn = true;
        const rows = [...this.state.rows];
        rows[rowIndex].selected = isSelected;
        for (const config_attr of settings_attrs4) {
          if (this.state["_" + config_attr] !== this.state[config_attr]) {
            disableSaveBtn = false;
            break;
          }
        }
        for (const row of rows) {
          for (const orig_row of this.state._rows) {
            if (orig_row.level === row.level && orig_row.selected !== row.selected) {
              disableSaveBtn = false;
              break;
            }
          }
        }
        this.setState({
          rows,
          saveSettingsDisabled: disableSaveBtn
        });
      });
      this.traceLevel = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
        _76("Trace Function Calls"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("font", { size: "1", className: "ds-info-color", children: _76("(level 1)") })
      ] });
      this.packetLevel = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
        _76("Packet Handling"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("font", { size: "1", className: "ds-info-color", children: _76("(level 2)") })
      ] });
      this.heavyLevel = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
        _76("Heavy Trace Output"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("font", { size: "1", className: "ds-info-color", children: _76("(level 4)") })
      ] });
      this.connLevel = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
        _76("Connection Management"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("font", { size: "1", className: "ds-info-color", children: _76("(level 8)") })
      ] });
      this.packetSentLevel = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
        _76("Packets Sent & Received"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("font", { size: "1", className: "ds-info-color", children: _76("(level 16)") })
      ] });
      this.filterLevel = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
        _76("Search Filter Processing"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("font", { size: "1", className: "ds-info-color", children: _76("(level 32)") })
      ] });
      this.configLevel = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
        _76("Config File Processing"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("font", { size: "1", className: "ds-info-color", children: _76("(level 64)") })
      ] });
      this.aclLevel = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
        _76("Access Control List Processing"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("font", { size: "1", className: "ds-info-color", children: _76("(level 128)") })
      ] });
      this.entryLevel = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
        _76("Log Entry Parsing"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("font", { size: "1", className: "ds-info-color", children: _76("(level 2048)") })
      ] });
      this.houseLevel = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
        _76("Housekeeping"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("font", { size: "1", className: "ds-info-color", children: _76("(level 4096)") })
      ] });
      this.replLevel = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
        _76("Replication"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("font", { size: "1", className: "ds-info-color", children: _76("(level 8192)") })
      ] });
      this.cacheLevel = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
        _76("Entry Cache"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("font", { size: "1", className: "ds-info-color", children: _76("(level 32768)") })
      ] });
      this.pluginLevel = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
        _76("Plugin"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("font", { size: "1", className: "ds-info-color", children: _76("(level 65536)") })
      ] });
      this.aclSummaryevel = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
        _76("Access Control Summary"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("font", { size: "1", className: "ds-info-color", children: _76("(level 262144)") })
      ] });
      this.dbLevel = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
        _76("Backend Database"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("font", { size: "1", className: "ds-info-color", children: _76("(level 524288)") })
      ] });
      this.pwdpolicyLevel = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
        _76("Password Policy"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("font", { size: "1", className: "ds-info-color", children: _76("(level 1048576)") })
      ] });
      this.state = {
        loading: false,
        loaded: false,
        activeTabKey: 0,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        attrs: this.props.attrs,
        canSelectAll: false,
        isExpanded: false,
        rows: [
          { cells: [{ title: this.traceLevel }], level: 1, selected: false },
          { cells: [{ title: this.packetLevel }], level: 2, selected: false },
          { cells: [{ title: this.heavyLevel }], level: 4, selected: false },
          { cells: [{ title: this.connLevel }], level: 8, selected: false },
          { cells: [{ title: this.packetSentLevel }], level: 16, selected: false },
          { cells: [{ title: this.filterLevel }], level: 32, selected: false },
          { cells: [{ title: this.configLevel }], level: 64, selected: false },
          { cells: [{ title: this.aclLevel }], level: 128, selected: false },
          { cells: [{ title: this.entryLevel }], level: 2048, selected: false },
          { cells: [{ title: this.houseLevel }], level: 4096, selected: false },
          { cells: [{ title: this.replLevel }], level: 8192, selected: false },
          { cells: [{ title: this.cacheLevel }], level: 32768, selected: false },
          { cells: [{ title: this.pluginLevel }], level: 65536, selected: false },
          { cells: [{ title: this.aclSummaryevel }], level: 262144, selected: false },
          { cells: [{ title: this.dbLevel }], level: 524288, selected: false },
          { cells: [{ title: this.pwdpolicyLevel }], level: 1048576, selected: false }
        ],
        columns: [
          { title: _76("Logging Level") }
        ]
      };
      this.handleOnToggle = (_event, isExpanded) => {
        this.setState({
          isExpanded
        });
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleChange = this.handleChange.bind(this);
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.handleTimeChange = this.handleTimeChange.bind(this);
      this.loadConfig = this.loadConfig.bind(this);
      this.handleRefreshConfig = this.handleRefreshConfig.bind(this);
      this.saveConfig = this.saveConfig.bind(this);
      this.handleOnSelect = this.handleOnSelect.bind(this);
      this.onMinusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.onConfigChange = (event, id, min3, max3, nav_tab) => {
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        let newValue = isNaN(event.target.value) ? min3 : Number(event.target.value);
        newValue = newValue > maxValue ? maxValue : newValue < min3 ? min3 : newValue;
        this.setState({
          [id]: newValue
        }, () => {
          this.validateSaveBtn(nav_tab, id, newValue);
        });
      };
      this.onPlusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.loadConfig();
      } else {
        this.props.enableTree();
      }
    }
    validateSaveBtn(nav_tab, attr, value) {
      let disableSaveBtn = true;
      let disableBtnName = "";
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs4;
        disableBtnName = "saveSettingsDisabled";
        for (const row of this.state.rows) {
          for (const orig_row of this.state._rows) {
            if (orig_row.level === row.level) {
              if (orig_row.selected !== row.selected) {
                disableSaveBtn = false;
                break;
              }
            }
          }
        }
      } else if (nav_tab === "rotation") {
        disableBtnName = "saveRotationDisabled";
        config_attrs = rotation_attrs4;
      } else {
        config_attrs = exp_attrs6;
        disableBtnName = "saveExpDisabled";
      }
      for (const config_attr of config_attrs) {
        if (attr === config_attr && this.state["_" + config_attr].toString() !== value.toString()) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const config_attr of config_attrs) {
        if (attr !== config_attr && this.state["_" + config_attr].toString() !== this.state[config_attr].toString()) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [disableBtnName]: disableSaveBtn
      });
    }
    handleChange(e, nav_tab) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn(nav_tab, attr, value);
      });
    }
    handleSwitchChange(value) {
      this.setState({
        "nsslapd-errorlog-compress": value
      }, () => {
        this.validateSaveBtn("rotation", "nsslapd-errorlog-compress", value);
      });
    }
    saveConfig(nav_tab) {
      let new_level = 0;
      this.setState({
        loading: true
      });
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs4;
      } else if (nav_tab === "rotation") {
        config_attrs = rotation_attrs4;
      } else {
        config_attrs = exp_attrs6;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of config_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      for (const row of this.state.rows) {
        if (row.selected) {
          new_level += row.level;
        }
      }
      if (new_level.toString() !== this.state["_nsslapd-errorlog-level"]) {
        if (new_level === 0) {
          new_level = 16384;
        }
        cmd.push("nsslapd-errorlog-level=" + new_level.toString());
      }
      if (cmd.length === 5) {
        return;
      }
      log_cmd("saveConfig", "Saving Error log settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload();
        this.handleRefreshConfig(1);
        this.props.addNotification(
          "success",
          _76("Successfully updated Error Log settings")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reload();
        this.handleRefreshConfig(1);
        this.props.addNotification(
          "error",
          cockpit_default.format(_76("Error saving Error Log settings - $0"), errMsg)
        );
      });
    }
    handleRefreshConfig(loading) {
      if (!loading) {
        this.setState({
          loading: true,
          loaded: false
        });
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("handleRefreshConfig", "load Error Log configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        let enabled = false;
        let compressed = false;
        let buffering = false;
        const level_val = parseInt(attrs["nsslapd-errorlog-level"][0]);
        const rows = [...this.state.rows];
        if (attrs["nsslapd-errorlog-logging-enabled"][0] === "on") {
          enabled = true;
        }
        if (attrs["nsslapd-errorlog-compress"][0] === "on") {
          compressed = true;
        }
        if (attrs["nsslapd-errorlog-logbuffering"][0] === "on") {
          buffering = true;
        }
        for (const row in rows) {
          if (rows[row].level & level_val) {
            rows[row].selected = true;
          } else {
            rows[row].selected = false;
          }
        }
        this.setState(
          () => ({
            loading: false,
            loaded: true,
            saveSettingsDisabled: true,
            saveRotationDisabled: true,
            saveExpDisabled: true,
            "nsslapd-errorlog": attrs["nsslapd-errorlog"][0],
            "nsslapd-errorlog-level": attrs["nsslapd-errorlog-level"][0],
            "nsslapd-errorlog-logexpirationtime": parseInt(attrs["nsslapd-errorlog-logexpirationtime"][0]),
            "nsslapd-errorlog-logexpirationtimeunit": attrs["nsslapd-errorlog-logexpirationtimeunit"][0],
            "nsslapd-errorlog-logging-enabled": enabled,
            "nsslapd-errorlog-logmaxdiskspace": parseInt(attrs["nsslapd-errorlog-logmaxdiskspace"][0]),
            "nsslapd-errorlog-logminfreediskspace": parseInt(attrs["nsslapd-errorlog-logminfreediskspace"][0]),
            "nsslapd-errorlog-logrotationsync-enabled": attrs["nsslapd-errorlog-logrotationsync-enabled"][0],
            "nsslapd-errorlog-logrotationsynchour": parseInt(attrs["nsslapd-errorlog-logrotationsynchour"][0]),
            "nsslapd-errorlog-logrotationsyncmin": parseInt(attrs["nsslapd-errorlog-logrotationsyncmin"][0]),
            "nsslapd-errorlog-logrotationtime": parseInt(attrs["nsslapd-errorlog-logrotationtime"][0]),
            "nsslapd-errorlog-logrotationtimeunit": attrs["nsslapd-errorlog-logrotationtimeunit"][0],
            "nsslapd-errorlog-maxlogsize": parseInt(attrs["nsslapd-errorlog-maxlogsize"][0]),
            "nsslapd-errorlog-maxlogsperdir": parseInt(attrs["nsslapd-errorlog-maxlogsperdir"][0]),
            "nsslapd-errorlog-compress": compressed,
            "nsslapd-errorlog-logbuffering": buffering,
            "nsslapd-errorlog-log-format": attrs["nsslapd-errorlog-log-format"][0],
            "nsslapd-errorlog-time-format": attrs["nsslapd-errorlog-time-format"][0],
            rows,
            // Record original values
            _rows: JSON.parse(JSON.stringify(rows)),
            "_nsslapd-errorlog": attrs["nsslapd-errorlog"][0],
            "_nsslapd-errorlog-level": attrs["nsslapd-errorlog-level"][0],
            "_nsslapd-errorlog-logexpirationtime": parseInt(attrs["nsslapd-errorlog-logexpirationtime"][0]),
            "_nsslapd-errorlog-logexpirationtimeunit": attrs["nsslapd-errorlog-logexpirationtimeunit"][0],
            "_nsslapd-errorlog-logging-enabled": enabled,
            "_nsslapd-errorlog-logmaxdiskspace": parseInt(attrs["nsslapd-errorlog-logmaxdiskspace"][0]),
            "_nsslapd-errorlog-logminfreediskspace": parseInt(attrs["nsslapd-errorlog-logminfreediskspace"][0]),
            "_nsslapd-errorlog-logrotationsync-enabled": attrs["nsslapd-errorlog-logrotationsync-enabled"][0],
            "_nsslapd-errorlog-logrotationsynchour": parseInt(attrs["nsslapd-errorlog-logrotationsynchour"][0]),
            "_nsslapd-errorlog-logrotationsyncmin": parseInt(attrs["nsslapd-errorlog-logrotationsyncmin"][0]),
            "_nsslapd-errorlog-logrotationtime": parseInt(attrs["nsslapd-errorlog-logrotationtime"][0]),
            "_nsslapd-errorlog-logrotationtimeunit": attrs["nsslapd-errorlog-logrotationtimeunit"][0],
            "_nsslapd-errorlog-maxlogsize": parseInt(attrs["nsslapd-errorlog-maxlogsize"][0]),
            "_nsslapd-errorlog-maxlogsperdir": parseInt(attrs["nsslapd-errorlog-maxlogsperdir"][0]),
            "_nsslapd-errorlog-compress": compressed,
            "_nsslapd-errorlog-logbuffering": buffering,
            "_nsslapd-errorlog-log-format": attrs["nsslapd-errorlog-log-format"][0],
            "_nsslapd-errorlog-time-format": attrs["nsslapd-errorlog-time-format"][0]
          })
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_76("Error loading Error Log configuration - $0"), errMsg)
        );
        this.setState({
          loading: false,
          loaded: true
        });
      });
    }
    loadConfig() {
      const attrs = this.state.attrs;
      let enabled = false;
      let compressed = false;
      let buffering = false;
      const level_val = parseInt(attrs["nsslapd-errorlog-level"][0]);
      const rows = [...this.state.rows];
      this.setState({
        loading: true
      });
      if (attrs["nsslapd-errorlog-logging-enabled"][0] === "on") {
        enabled = true;
      }
      if (attrs["nsslapd-errorlog-compress"][0] === "on") {
        compressed = true;
      }
      if (attrs["nsslapd-errorlog-logbuffering"][0] === "on") {
        buffering = true;
      }
      for (const row in rows) {
        if (rows[row].level & level_val) {
          rows[row].selected = true;
        } else {
          rows[row].selected = false;
        }
      }
      this.setState({
        loading: false,
        loaded: true,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        "nsslapd-errorlog": attrs["nsslapd-errorlog"][0],
        "nsslapd-errorlog-level": attrs["nsslapd-errorlog-level"][0],
        "nsslapd-errorlog-logexpirationtime": parseInt(attrs["nsslapd-errorlog-logexpirationtime"][0]),
        "nsslapd-errorlog-logexpirationtimeunit": attrs["nsslapd-errorlog-logexpirationtimeunit"][0],
        "nsslapd-errorlog-logging-enabled": enabled,
        "nsslapd-errorlog-logmaxdiskspace": parseInt(attrs["nsslapd-errorlog-logmaxdiskspace"][0]),
        "nsslapd-errorlog-logminfreediskspace": parseInt(attrs["nsslapd-errorlog-logminfreediskspace"][0]),
        "nsslapd-errorlog-logrotationsync-enabled": attrs["nsslapd-errorlog-logrotationsync-enabled"][0],
        "nsslapd-errorlog-logrotationsynchour": parseInt(attrs["nsslapd-errorlog-logrotationsynchour"][0]),
        "nsslapd-errorlog-logrotationsyncmin": parseInt(attrs["nsslapd-errorlog-logrotationsyncmin"][0]),
        "nsslapd-errorlog-logrotationtime": parseInt(attrs["nsslapd-errorlog-logrotationtime"][0]),
        "nsslapd-errorlog-logrotationtimeunit": attrs["nsslapd-errorlog-logrotationtimeunit"][0],
        "nsslapd-errorlog-maxlogsize": parseInt(attrs["nsslapd-errorlog-maxlogsize"][0]),
        "nsslapd-errorlog-maxlogsperdir": parseInt(attrs["nsslapd-errorlog-maxlogsperdir"][0]),
        "nsslapd-errorlog-compress": compressed,
        "nsslapd-errorlog-logbuffering": buffering,
        "nsslapd-errorlog-log-format": attrs["nsslapd-errorlog-log-format"][0],
        "nsslapd-errorlog-time-format": attrs["nsslapd-errorlog-time-format"][0],
        rows,
        // Record original values
        _rows: JSON.parse(JSON.stringify(rows)),
        "_nsslapd-errorlog": attrs["nsslapd-errorlog"][0],
        "_nsslapd-errorlog-level": attrs["nsslapd-errorlog-level"][0],
        "_nsslapd-errorlog-logexpirationtime": parseInt(attrs["nsslapd-errorlog-logexpirationtime"][0]),
        "_nsslapd-errorlog-logexpirationtimeunit": attrs["nsslapd-errorlog-logexpirationtimeunit"][0],
        "_nsslapd-errorlog-logging-enabled": enabled,
        "_nsslapd-errorlog-logmaxdiskspace": parseInt(attrs["nsslapd-errorlog-logmaxdiskspace"][0]),
        "_nsslapd-errorlog-logminfreediskspace": parseInt(attrs["nsslapd-errorlog-logminfreediskspace"][0]),
        "_nsslapd-errorlog-logrotationsync-enabled": attrs["nsslapd-errorlog-logrotationsync-enabled"][0],
        "_nsslapd-errorlog-logrotationsynchour": parseInt(attrs["nsslapd-errorlog-logrotationsynchour"][0]),
        "_nsslapd-errorlog-logrotationsyncmin": parseInt(attrs["nsslapd-errorlog-logrotationsyncmin"][0]),
        "_nsslapd-errorlog-logrotationtime": parseInt(attrs["nsslapd-errorlog-logrotationtime"][0]),
        "_nsslapd-errorlog-logrotationtimeunit": attrs["nsslapd-errorlog-logrotationtimeunit"][0],
        "_nsslapd-errorlog-maxlogsize": parseInt(attrs["nsslapd-errorlog-maxlogsize"][0]),
        "_nsslapd-errorlog-maxlogsperdir": parseInt(attrs["nsslapd-errorlog-maxlogsperdir"][0]),
        "_nsslapd-errorlog-compress": compressed,
        "_nsslapd-errorlog-logbuffering": buffering,
        "_nsslapd-errorlog-log-format": attrs["nsslapd-errorlog-log-format"][0],
        "_nsslapd-errorlog-time-format": attrs["nsslapd-errorlog-time-format"][0]
      }, this.props.enableTree);
    }
    render() {
      let saveSettingsName = _76("Save Log Settings");
      let saveRotationName = _76("Save Rotation Settings");
      let saveDeletionName = _76("Save Deletion Settings");
      const extraPrimaryProps = {};
      let rotationTime = "";
      let hour = this.state["nsslapd-errorlog-logrotationsynchour"] ? this.state["nsslapd-errorlog-logrotationsynchour"] : "00";
      let min3 = this.state["nsslapd-errorlog-logrotationsyncmin"] ? this.state["nsslapd-errorlog-logrotationsyncmin"] : "00";
      if (this.state.loading) {
        saveSettingsName = _76("Saving settings ...");
        saveRotationName = _76("Saving settings ...");
        saveDeletionName = _76("Saving settings ...");
        extraPrimaryProps.spinnerAriaValueText = _76("Loading");
      }
      if (hour.length === 1) {
        hour = "0" + hour;
      }
      if (min3.length === 1) {
        min3 = "0" + min3;
      }
      rotationTime = hour + ":" + min3;
      const time_format_title = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
        _76("Time Format"),
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("font", { size: "1", children: [
          "(",
          _76("JSON only"),
          ")"
        ] })
      ] });
      let body = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "ds-margin-top-lg ds-left-margin", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Tabs, { className: "ds-margin-top-xlg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
        /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TabTitleText, { children: _76("Settings") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
            Checkbox,
            {
              className: "ds-margin-top-xlg ds-left-margin",
              id: "nsslapd-errorlog-logging-enabled",
              isChecked: this.state["nsslapd-errorlog-logging-enabled"],
              onChange: (e, checked) => {
                this.handleChange(e, "settings");
              },
              title: _76("Enable Error logging (nsslapd-errorlog-logging-enabled)."),
              label: _76("Enable Error Logging")
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Form, { className: "ds-margin-top-lg ds-left-margin", isHorizontal: true, children: [
            /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
              Grid,
              {
                title: _76("Enable Error logging (nsslapd-errorlog)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { className: "ds-label", span: 3, children: _76("Error Log Location") }),
                  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
                    TextInput,
                    {
                      value: this.state["nsslapd-errorlog"],
                      type: "text",
                      id: "nsslapd-errorlog",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "nsslapd-errorlog",
                      onChange: (e, str) => {
                        this.handleChange(e, "settings");
                      }
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Grid, { title: _76("Time format using strftime formatting (nsslapd-errorlog-time-format). This only applies to the JSON log format"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { className: "ds-label", span: 3, children: time_format_title }),
              /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
                TextInput,
                {
                  value: this.state["nsslapd-errorlog-time-format"],
                  type: "text",
                  id: "nsslapd-errorlog-time-format",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "nsslapd-errorlog-time-format",
                  onChange: (e, str) => {
                    this.handleChange(e, "settings");
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Grid, { title: _76("Choose the log format (nsslapd-errorlog-log-format)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { className: "ds-label", span: 3, children: _76("Log Format") }),
              /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
                FormSelect,
                {
                  id: "nsslapd-errorlog-log-format",
                  value: this.state["nsslapd-errorlog-log-format"],
                  onChange: (e, str) => {
                    this.handleChange(e, "settings");
                  },
                  "aria-label": "FormSelect Input",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FormSelectOption, { value: "default", label: "Default" }, "0"),
                    /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FormSelectOption, { value: "json", label: "JSON" }, "1"),
                    /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FormSelectOption, { value: "json-pretty", label: "JSON (pretty)" }, "2")
                  ]
                }
              ) })
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
            Checkbox,
            {
              className: "ds-left-margin ds-margin-top-lg",
              id: "nsslapd-errorlog-logbuffering",
              isChecked: this.state["nsslapd-errorlog-logbuffering"],
              onChange: (e, checked) => {
                this.handleChange(e, "settings");
              },
              title: "This applies to the error log. Enable error log buffering when using verbose logging levels, otherwise verbose logging levels will impact server performance (nsslapd-errorlog-logbuffering).",
              label: _76("Error Log Buffering Enabled")
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
            ExpandableSection,
            {
              className: "ds-left-margin ds-margin-top-lg ds-font-size-md",
              toggleText: this.state.isExpanded ? _76("Hide Verbose Logging Levels") : _76("Show Verbose Logging Levels"),
              onToggle: (event, isExpanded) => this.handleOnToggle(event, isExpanded),
              isExpanded: this.state.isExpanded,
              children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { offset: 1, span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
                Table,
                {
                  "aria-label": "Selectable Error Log Levels",
                  variant: "compact",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Tr, { children: [
                      /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Th, { screenReaderText: "Checkboxes" }),
                      /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Th, { children: _76("Logging Level") })
                    ] }) }),
                    /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Tbody, { children: this.state.rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Tr, { children: [
                      /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
                        Td,
                        {
                          select: {
                            rowIndex,
                            onSelect: (_event, isSelecting) => this.handleOnSelect(_event, isSelecting, rowIndex),
                            isSelected: row.selected
                          }
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Td, { children: row.cells[0].title })
                    ] }, rowIndex)) })
                  ]
                }
              ) }) })
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
            Button,
            {
              isDisabled: this.state.saveSettingsDisabled || this.state.loading,
              variant: "primary",
              className: "ds-margin-top-xlg",
              onClick: () => {
                this.saveConfig("settings");
              },
              isLoading: this.state.loading,
              spinnerAriaValueText: this.state.loading ? _76("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveSettingsName
            },
            "save settings"
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TabTitleText, { children: _76("Rotation Policy") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Form, { className: "ds-margin-top-lg ds-left-margin", isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
              Grid,
              {
                className: "ds-margin-top",
                title: _76("The maximum number of logs that are archived (nsslapd-errorlog-maxlogsperdir)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { className: "ds-label", span: 3, children: _76("Maximum Number Of Logs") }),
                  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-errorlog-maxlogsperdir"],
                      min: 1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-errorlog-maxlogsperdir", "rotation");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-errorlog-maxlogsperdir", 1, 2147483647, "rotation");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-errorlog-maxlogsperdir", "rotation");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Grid, { title: _76("The maximum size of each log file in megabytes (nsslapd-errorlog-maxlogsize)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { className: "ds-label", span: 3, children: _76("Maximum Log Size (in MB)") }),
              /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-errorlog-maxlogsize"],
                  min: -1,
                  max: 2147483647,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-errorlog-maxlogsize", "rotation");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-errorlog-maxlogsize", -1, 2147483647, "rotation");
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-errorlog-maxlogsize", "rotation");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 6
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("hr", {}),
            /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Grid, { title: _76("Rotate the log based this number of time units (nsslapd-errorlog-logrotationtime)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { className: "ds-label", span: 3, children: _76("Create New Log Every ...") }),
              /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-errorlog-logrotationtime"],
                  min: -1,
                  max: 2147483647,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-errorlog-logrotationtime", "rotation");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-errorlog-logrotationtime", -1, 2147483647, "rotation");
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-errorlog-logrotationtime", "rotation");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 6
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { offset: 5, span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
                FormSelect,
                {
                  id: "nsslapd-errorlog-logrotationtimeunit",
                  value: this.state["nsslapd-errorlog-logrotationtimeunit"],
                  onChange: (e, str) => {
                    this.handleChange(e, "rotation");
                  },
                  "aria-label": "log rotation time unit select",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FormSelectOption, { value: "minute", label: _76("minute") }, "0"),
                    /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FormSelectOption, { value: "hour", label: _76("hour") }, "1"),
                    /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FormSelectOption, { value: "day", label: _76("day") }, "2"),
                    /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FormSelectOption, { value: "week", label: _76("week") }, "3"),
                    /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FormSelectOption, { value: "month", label: _76("month") }, "4")
                  ]
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Grid, { title: _76("The time when the log should be rotated (nsslapd-errorlog-logrotationsynchour, nsslapd-errorlog-logrotationsyncmin)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { className: "ds-label", span: 3, children: _76("Time Of Day") }),
              /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
                TimePicker,
                {
                  time: rotationTime,
                  onChange: this.handleTimeChange,
                  is24Hour: true
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Grid, { title: _76("Compress (gzip) the log after it's rotated."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { className: "ds-label", span: 3, children: _76("Compress Rotated Logs") }),
              /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { className: "ds-label", span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
                Switch,
                {
                  id: "nsslapd-errorlog-compress",
                  isChecked: this.state["nsslapd-errorlog-compress"],
                  onChange: (_event, value) => this.handleSwitchChange(value),
                  "aria-label": "nsslapd-errorlog-compress"
                }
              ) })
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
            Button,
            {
              isDisabled: this.state.saveRotationDisabled || this.state.loading,
              variant: "primary",
              className: "ds-margin-top-xlg ds-left-margin",
              onClick: () => {
                this.saveConfig("rotation");
              },
              isLoading: this.state.loading,
              spinnerAriaValueText: this.state.loading ? _76("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveRotationName
            },
            "save rot settings"
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TabTitleText, { children: _76("Deletion Policy") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Form, { className: "ds-margin-top-lg ds-left-margin", isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
              Grid,
              {
                className: "ds-margin-top",
                title: _76("The server deletes the oldest archived log when the total of all the logs reaches this amount (nsslapd-errorlog-logmaxdiskspace)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { className: "ds-label", span: 3, children: _76("Log Archive Exceeds (in MB)") }),
                  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-errorlog-logmaxdiskspace"],
                      min: -1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-errorlog-logmaxdiskspace", "exp");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-errorlog-logmaxdiskspace", -1, 2147483647, "exp");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-errorlog-logmaxdiskspace", "exp");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
              Grid,
              {
                title: _76("The server deletes the oldest archived log file when available disk space is less than this amount. (nsslapd-errorlog-logminfreediskspace)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { className: "ds-label", span: 3, children: _76("Free Disk Space (in MB)") }),
                  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-errorlog-logminfreediskspace"],
                      min: -1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-errorlog-logminfreediskspace", "exp");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-errorlog-logminfreediskspace", -1, 2147483647, "exp");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-errorlog-logminfreediskspace", "exp");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
              Grid,
              {
                title: _76("Server deletes an old archived log file when it is older than the specified age. (nsslapd-errorlog-logexpirationtime)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { className: "ds-label", span: 3, children: _76("Log File is Older Than ...") }),
                  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-errorlog-logexpirationtime"],
                      min: -1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-errorlog-logexpirationtime", "exp");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-errorlog-logexpirationtime", -1, 2147483647, "exp");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-errorlog-logexpirationtime", "exp");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { offset: 5, span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
                    FormSelect,
                    {
                      id: "nsslapd-errorlog-logexpirationtimeunit",
                      value: this.state["nsslapd-errorlog-logexpirationtimeunit"],
                      onChange: (e, str) => {
                        this.handleChange(e, "exp");
                      },
                      "aria-label": "log expiration time unit select",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FormSelectOption, { value: "day", label: _76("day") }, "2"),
                        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FormSelectOption, { value: "week", label: _76("week") }, "3"),
                        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FormSelectOption, { value: "month", label: _76("month") }, "4")
                      ]
                    }
                  ) })
                ]
              }
            )
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
            Button,
            {
              isDisabled: this.state.saveExpDisabled || this.state.loading,
              variant: "primary",
              className: "ds-margin-top-xlg ds-left-margin",
              onClick: () => {
                this.saveConfig("exp");
              },
              isLoading: this.state.loading,
              spinnerAriaValueText: this.state.loading ? _76("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveDeletionName
            },
            "save del settings"
          )
        ] })
      ] }) });
      if (!this.state.loaded) {
        body = /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "ds-loading-spinner ds-margin-top-xlg ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Text, { component: TextVariants.h3, children: _76("Loading Error Log Settings ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Spinner, { className: "ds-margin-top", size: "lg" })
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { id: "server-errorlog-page", className: this.state.loading ? "ds-disabled ds-margin-bottom-md" : "ds-margin-bottom-md", children: [
        /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Text, { component: TextVariants.h3, children: [
          _76("Error Log Settings"),
          /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _76("Refresh log settings"),
              onClick: () => {
                this.handleRefreshConfig();
              },
              children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }) }) }),
        body
      ] });
    }
  };
  ServerErrorLog.propTypes = {
    addNotification: import_prop_types74.default.func,
    serverId: import_prop_types74.default.string,
    attrs: import_prop_types74.default.object
  };
  ServerErrorLog.defaultProps = {
    serverId: "",
    attrs: {}
  };

  // src/lib/server/securityLog.jsx
  var import_react147 = __toESM(require_react(), 1);
  var import_prop_types75 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime77 = __toESM(require_jsx_runtime(), 1);
  var _77 = cockpit_default.gettext;
  var settings_attrs5 = [
    "nsslapd-securitylog",
    "nsslapd-securitylog-logbuffering",
    "nsslapd-securitylog-logging-enabled"
  ];
  var rotation_attrs5 = [
    "nsslapd-securitylog-logrotationsync-enabled",
    "nsslapd-securitylog-logrotationsynchour",
    "nsslapd-securitylog-logrotationsyncmin",
    "nsslapd-securitylog-logrotationtime",
    "nsslapd-securitylog-logrotationtimeunit",
    "nsslapd-securitylog-maxlogsize",
    "nsslapd-securitylog-maxlogsperdir",
    "nsslapd-securitylog-compress"
  ];
  var rotation_attrs_no_time5 = [
    "nsslapd-securitylog-logrotationsync-enabled",
    "nsslapd-securitylog-logrotationtime",
    "nsslapd-securitylog-logrotationtimeunit",
    "nsslapd-securitylog-maxlogsize",
    "nsslapd-securitylog-maxlogsperdir",
    "nsslapd-securitylog-compress"
  ];
  var exp_attrs7 = [
    "nsslapd-securitylog-logexpirationtime",
    "nsslapd-securitylog-logexpirationtimeunit",
    "nsslapd-securitylog-logmaxdiskspace",
    "nsslapd-securitylog-logminfreediskspace"
  ];
  var ServerSecurityLog = class extends import_react147.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleTimeChange", (_event, time2, hour, min3, seconds2, isValid) => {
        let disableSaveBtn = true;
        if (hour.length === 2 && hour[0] === "0") {
          hour = hour[1];
        }
        if (min3.length === 2 && min3[0] === "0") {
          min3 = min3[1];
        }
        for (const config_attr of rotation_attrs_no_time5) {
          if (this.state[config_attr] !== this.state["_" + config_attr]) {
            disableSaveBtn = false;
            break;
          }
        }
        if (hour !== this.state["_nsslapd-securitylog-logrotationsynchour"] || min3 !== this.state["_nsslapd-securitylog-logrotationsyncmin"]) {
          disableSaveBtn = false;
        }
        this.setState({
          "nsslapd-securitylog-logrotationsynchour": hour,
          "nsslapd-securitylog-logrotationsyncmin": min3,
          saveRotationDisabled: disableSaveBtn
        });
      });
      this.state = {
        loading: false,
        loaded: false,
        activeTabKey: 0,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        attrs: this.props.attrs
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.handleChange = this.handleChange.bind(this);
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.handleTimeChange = this.handleTimeChange.bind(this);
      this.loadConfig = this.loadConfig.bind(this);
      this.refreshConfig = this.refreshConfig.bind(this);
      this.saveConfig = this.saveConfig.bind(this);
      this.onMinusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.onConfigChange = (event, id, min3, max3, nav_tab) => {
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        let newValue = isNaN(event.target.value) ? min3 : Number(event.target.value);
        newValue = newValue > maxValue ? maxValue : newValue < min3 ? min3 : newValue;
        this.setState({
          [id]: newValue
        }, () => {
          this.validateSaveBtn(nav_tab, id, newValue);
        });
      };
      this.onPlusConfig = (id, nav_tab) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validateSaveBtn(nav_tab, id, Number(this.state[id]));
        });
      };
      this.validateSaveBtn = this.validateSaveBtn.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.loadConfig();
      } else {
        this.props.enableTree();
      }
    }
    validateSaveBtn(nav_tab, attr, value) {
      let disableSaveBtn = true;
      let disableBtnName = "";
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs5;
        disableBtnName = "saveSettingsDisabled";
      } else if (nav_tab === "rotation") {
        disableBtnName = "saveRotationDisabled";
        config_attrs = rotation_attrs5;
      } else {
        config_attrs = exp_attrs7;
        disableBtnName = "saveExpDisabled";
      }
      for (const config_attr of config_attrs) {
        if (attr === config_attr && this.state["_" + config_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const config_attr of config_attrs) {
        if (attr !== config_attr && this.state["_" + config_attr] !== this.state[config_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [disableBtnName]: disableSaveBtn
      });
    }
    handleChange(e, nav_tab) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      this.setState({
        [attr]: value
      }, () => {
        this.validateSaveBtn(nav_tab, attr, value);
      });
    }
    handleSwitchChange(value) {
      this.setState({
        "nsslapd-securitylog-compress": value
      }, () => {
        this.validateSaveBtn("rotation", "nsslapd-securitylog-compress", value);
      });
    }
    saveConfig(nav_tab) {
      this.setState({
        loading: true
      });
      let config_attrs = [];
      if (nav_tab === "settings") {
        config_attrs = settings_attrs5;
      } else if (nav_tab === "rotation") {
        config_attrs = rotation_attrs5;
      } else {
        config_attrs = exp_attrs7;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "replace"
      ];
      for (const attr of config_attrs) {
        if (this.state["_" + attr] !== this.state[attr]) {
          let val = this.state[attr];
          if (typeof val === "boolean") {
            if (val) {
              val = "on";
            } else {
              val = "off";
            }
          }
          cmd.push(attr + "=" + val);
        }
      }
      if (cmd.length === 5) {
        return;
      }
      log_cmd("saveConfig", "Saving security log settings", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload();
        this.refreshConfig(1);
        this.props.addNotification(
          "success",
          _77("Successfully updated Security Log settings")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reload();
        this.refreshConfig(1);
        this.props.addNotification(
          "error",
          cockpit_default.format(_77("Error saving Security Log settings - $0"), errMsg)
        );
      });
    }
    refreshConfig(loading) {
      if (!loading) {
        this.setState({
          loading: true,
          loaded: false
        });
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("refreshConfig", "load Security Log configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        let enabled = false;
        let buffering = false;
        let compress = false;
        if (attrs["nsslapd-securitylog-logging-enabled"][0] === "on") {
          enabled = true;
        }
        if (attrs["nsslapd-securitylog-logbuffering"][0] === "on") {
          buffering = true;
        }
        if (attrs["nsslapd-securitylog-compress"][0] === "on") {
          compress = true;
        }
        this.setState({
          loading: false,
          loaded: true,
          saveSettingsDisabled: true,
          saveRotationDisabled: true,
          saveExpDisabled: true,
          "nsslapd-securitylog": attrs["nsslapd-securitylog"][0],
          "nsslapd-securitylog-logbuffering": buffering,
          "nsslapd-securitylog-logexpirationtime": parseInt(attrs["nsslapd-securitylog-logexpirationtime"][0]),
          "nsslapd-securitylog-logexpirationtimeunit": attrs["nsslapd-securitylog-logexpirationtimeunit"][0],
          "nsslapd-securitylog-logging-enabled": enabled,
          "nsslapd-securitylog-logmaxdiskspace": parseInt(attrs["nsslapd-securitylog-logmaxdiskspace"][0]),
          "nsslapd-securitylog-logminfreediskspace": parseInt(attrs["nsslapd-securitylog-logminfreediskspace"][0]),
          "nsslapd-securitylog-logrotationsync-enabled": attrs["nsslapd-securitylog-logrotationsync-enabled"][0],
          "nsslapd-securitylog-logrotationsynchour": parseInt(attrs["nsslapd-securitylog-logrotationsynchour"][0]),
          "nsslapd-securitylog-logrotationsyncmin": parseInt(attrs["nsslapd-securitylog-logrotationsyncmin"][0]),
          "nsslapd-securitylog-logrotationtime": parseInt(attrs["nsslapd-securitylog-logrotationtime"][0]),
          "nsslapd-securitylog-logrotationtimeunit": attrs["nsslapd-securitylog-logrotationtimeunit"][0],
          "nsslapd-securitylog-maxlogsize": parseInt(attrs["nsslapd-securitylog-maxlogsize"][0]),
          "nsslapd-securitylog-maxlogsperdir": parseInt(attrs["nsslapd-securitylog-maxlogsperdir"][0]),
          "nsslapd-securitylog-compress": compress,
          // Record original values
          "_nsslapd-securitylog": attrs["nsslapd-securitylog"][0],
          "_nsslapd-securitylog-logbuffering": buffering,
          "_nsslapd-securitylog-logexpirationtime": parseInt(attrs["nsslapd-securitylog-logexpirationtime"][0]),
          "_nsslapd-securitylog-logexpirationtimeunit": attrs["nsslapd-securitylog-logexpirationtimeunit"][0],
          "_nsslapd-securitylog-logging-enabled": enabled,
          "_nsslapd-securitylog-logmaxdiskspace": parseInt(attrs["nsslapd-securitylog-logmaxdiskspace"][0]),
          "_nsslapd-securitylog-logminfreediskspace": parseInt(attrs["nsslapd-securitylog-logminfreediskspace"][0]),
          "_nsslapd-securitylog-logrotationsync-enabled": attrs["nsslapd-securitylog-logrotationsync-enabled"][0],
          "_nsslapd-securitylog-logrotationsynchour": parseInt(attrs["nsslapd-securitylog-logrotationsynchour"][0]),
          "_nsslapd-securitylog-logrotationsyncmin": parseInt(attrs["nsslapd-securitylog-logrotationsyncmin"][0]),
          "_nsslapd-securitylog-logrotationtime": parseInt(attrs["nsslapd-securitylog-logrotationtime"][0]),
          "_nsslapd-securitylog-logrotationtimeunit": attrs["nsslapd-securitylog-logrotationtimeunit"][0],
          "_nsslapd-securitylog-maxlogsize": parseInt(attrs["nsslapd-securitylog-maxlogsize"][0]),
          "_nsslapd-securitylog-maxlogsperdir": parseInt(attrs["nsslapd-securitylog-maxlogsperdir"][0]),
          "_nsslapd-securitylog-compress": compress
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_77("Error loading Security Log configuration - $0"), errMsg)
        );
        this.setState({
          loading: false,
          loaded: true
        });
      });
    }
    loadConfig() {
      const attrs = this.state.attrs;
      let enabled = false;
      let buffering = false;
      let compress = false;
      this.setState({
        loading: true
      });
      if (attrs["nsslapd-securitylog-logging-enabled"][0] === "on") {
        enabled = true;
      }
      if (attrs["nsslapd-securitylog-logbuffering"][0] === "on") {
        buffering = true;
      }
      if (attrs["nsslapd-securitylog-compress"][0] === "on") {
        compress = true;
      }
      this.setState({
        loading: false,
        loaded: true,
        saveSettingsDisabled: true,
        saveRotationDisabled: true,
        saveExpDisabled: true,
        "nsslapd-securitylog": attrs["nsslapd-securitylog"][0],
        "nsslapd-securitylog-logbuffering": buffering,
        "nsslapd-securitylog-logexpirationtime": parseInt(attrs["nsslapd-securitylog-logexpirationtime"][0]),
        "nsslapd-securitylog-logexpirationtimeunit": attrs["nsslapd-securitylog-logexpirationtimeunit"][0],
        "nsslapd-securitylog-logging-enabled": enabled,
        "nsslapd-securitylog-logmaxdiskspace": parseInt(attrs["nsslapd-securitylog-logmaxdiskspace"][0]),
        "nsslapd-securitylog-logminfreediskspace": parseInt(attrs["nsslapd-securitylog-logminfreediskspace"][0]),
        "nsslapd-securitylog-logrotationsync-enabled": attrs["nsslapd-securitylog-logrotationsync-enabled"][0],
        "nsslapd-securitylog-logrotationsynchour": parseInt(attrs["nsslapd-securitylog-logrotationsynchour"][0]),
        "nsslapd-securitylog-logrotationsyncmin": parseInt(attrs["nsslapd-securitylog-logrotationsyncmin"][0]),
        "nsslapd-securitylog-logrotationtime": parseInt(attrs["nsslapd-securitylog-logrotationtime"][0]),
        "nsslapd-securitylog-logrotationtimeunit": attrs["nsslapd-securitylog-logrotationtimeunit"][0],
        "nsslapd-securitylog-maxlogsize": parseInt(attrs["nsslapd-securitylog-maxlogsize"][0]),
        "nsslapd-securitylog-maxlogsperdir": parseInt(attrs["nsslapd-securitylog-maxlogsperdir"][0]),
        "nsslapd-securitylog-compress": compress,
        // Record original values
        "_nsslapd-securitylog": attrs["nsslapd-securitylog"][0],
        "_nsslapd-securitylog-logbuffering": buffering,
        "_nsslapd-securitylog-logexpirationtime": parseInt(attrs["nsslapd-securitylog-logexpirationtime"][0]),
        "_nsslapd-securitylog-logexpirationtimeunit": attrs["nsslapd-securitylog-logexpirationtimeunit"][0],
        "_nsslapd-securitylog-logging-enabled": enabled,
        "_nsslapd-securitylog-logmaxdiskspace": parseInt(attrs["nsslapd-securitylog-logmaxdiskspace"][0]),
        "_nsslapd-securitylog-logminfreediskspace": parseInt(attrs["nsslapd-securitylog-logminfreediskspace"][0]),
        "_nsslapd-securitylog-logrotationsync-enabled": attrs["nsslapd-securitylog-logrotationsync-enabled"][0],
        "_nsslapd-securitylog-logrotationsynchour": parseInt(attrs["nsslapd-securitylog-logrotationsynchour"][0]),
        "_nsslapd-securitylog-logrotationsyncmin": parseInt(attrs["nsslapd-securitylog-logrotationsyncmin"][0]),
        "_nsslapd-securitylog-logrotationtime": parseInt(attrs["nsslapd-securitylog-logrotationtime"][0]),
        "_nsslapd-securitylog-logrotationtimeunit": attrs["nsslapd-securitylog-logrotationtimeunit"][0],
        "_nsslapd-securitylog-maxlogsize": parseInt(attrs["nsslapd-securitylog-maxlogsize"][0]),
        "_nsslapd-securitylog-maxlogsperdir": parseInt(attrs["nsslapd-securitylog-maxlogsperdir"][0]),
        "_nsslapd-securitylog-compress": compress
      }, this.props.enableTree);
    }
    render() {
      let saveSettingsName = _77("Save Log Settings");
      let saveRotationName = _77("Save Rotation Settings");
      let saveDeletionName = _77("Save Deletion Settings");
      const extraPrimaryProps = {};
      let rotationTime = "";
      let hour = this.state["nsslapd-securitylog-logrotationsynchour"] ? this.state["nsslapd-securitylog-logrotationsynchour"] : "00";
      let min3 = this.state["nsslapd-securitylog-logrotationsyncmin"] ? this.state["nsslapd-securitylog-logrotationsyncmin"] : "00";
      if (this.state.loading) {
        saveSettingsName = _77("Saving settings ...");
        saveRotationName = _77("Saving settings ...");
        saveDeletionName = _77("Saving settings ...");
        extraPrimaryProps.spinnerAriaValueText = _77("Loading");
      }
      if (hour.length === 1) {
        hour = "0" + hour;
      }
      if (min3.length === 1) {
        min3 = "0" + min3;
      }
      rotationTime = hour + ":" + min3;
      let body = /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "ds-margin-top-lg ds-left-margin", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Tabs, { className: "ds-margin-top-xlg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
        /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(TabTitleText, { children: _77("Settings") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
            Checkbox,
            {
              className: "ds-margin-top-xlg ds-left-margin",
              id: "nsslapd-securitylog-logging-enabled",
              isChecked: this.state["nsslapd-securitylog-logging-enabled"],
              onChange: (e, checked) => {
                this.handleChange(e, "settings");
              },
              title: _77("Enable security logging (nsslapd-securitylog-logging-enabled)."),
              label: _77("Enable Security Logging")
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Form, { className: "ds-margin-top-lg ds-left-margin", isHorizontal: true, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
            Grid,
            {
              title: _77("Enable security logging (nsslapd-securitylog)."),
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { className: "ds-label", span: 3, children: _77("Security Log Location") }),
                /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
                  TextInput,
                  {
                    value: this.state["nsslapd-securitylog"],
                    type: "text",
                    id: "nsslapd-securitylog",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "nsslapd-securitylog",
                    onChange: (e, str) => {
                      this.handleChange(e, "settings");
                    }
                  }
                ) })
              ]
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
            Checkbox,
            {
              className: "ds-left-margin ds-margin-top-lg",
              id: "nsslapd-securitylog-logbuffering",
              isChecked: this.state["nsslapd-securitylog-logbuffering"],
              onChange: (e, checked) => {
                this.handleChange(e, "settings");
              },
              title: _77("Disable security log buffering for faster troubleshooting, but this will impact server performance (nsslapd-securitylog-logbuffering)."),
              label: _77("Security Log Buffering Enabled")
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
            Button,
            {
              isDisabled: this.state.saveSettingsDisabled || this.state.loading,
              variant: "primary",
              className: "ds-margin-top-xlg",
              onClick: () => {
                this.saveConfig("settings");
              },
              isLoading: this.state.loading,
              spinnerAriaValueText: this.state.loading ? _77("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveSettingsName
            },
            "save settings"
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(TabTitleText, { children: _77("Rotation Policy") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Form, { className: "ds-margin-top-lg ds-left-margin", isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
              Grid,
              {
                className: "ds-margin-top",
                title: _77("The maximum number of logs that are archived (nsslapd-securitylog-maxlogsperdir)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { className: "ds-label", span: 3, children: _77("Maximum Number Of Logs") }),
                  /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-securitylog-maxlogsperdir"],
                      min: 1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-securitylog-maxlogsperdir", "rotation");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-securitylog-maxlogsperdir", 1, 2147483647, "rotation");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-securitylog-maxlogsperdir", "rotation");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Grid, { title: _77("The maximum size of each log file in megabytes (nsslapd-securitylog-maxlogsize)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { className: "ds-label", span: 3, children: _77("Maximum Log Size (in MB)") }),
              /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-securitylog-maxlogsize"],
                  min: -1,
                  max: 2147483647,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-securitylog-maxlogsize", "rotation");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-securitylog-maxlogsize", -1, 2147483647, "rotation");
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-securitylog-maxlogsize", "rotation");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 6
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("hr", {}),
            /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Grid, { title: _77("Rotate the log based this number of time units (nsslapd-securitylog-logrotationtime)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { className: "ds-label", span: 3, children: _77("Create New Log Every ...") }),
              /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
                NumberInput,
                {
                  value: this.state["nsslapd-securitylog-logrotationtime"],
                  min: -1,
                  max: 2147483647,
                  onMinus: () => {
                    this.onMinusConfig("nsslapd-securitylog-logrotationtime", "rotation");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "nsslapd-securitylog-logrotationtime", -1, 2147483647, "rotation");
                  },
                  onPlus: () => {
                    this.onPlusConfig("nsslapd-securitylog-logrotationtime", "rotation");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 6
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { offset: 5, span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
                FormSelect,
                {
                  id: "nsslapd-securitylog-logrotationtimeunit",
                  value: this.state["nsslapd-securitylog-logrotationtimeunit"],
                  onChange: (e, str) => {
                    this.handleChange(e, "rotation");
                  },
                  "aria-label": "log rotation time unit select",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(FormSelectOption, { value: "minute", label: _77("minute") }, "0"),
                    /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(FormSelectOption, { value: "hour", label: _77("hour") }, "1"),
                    /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(FormSelectOption, { value: "day", label: _77("day") }, "2"),
                    /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(FormSelectOption, { value: "week", label: _77("week") }, "3"),
                    /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(FormSelectOption, { value: "month", label: _77("month") }, "4")
                  ]
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Grid, { title: _77("The time when the log should be rotated (nsslapd-securitylog-logrotationsynchour, nsslapd-securitylog-logrotationsyncmin)."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { className: "ds-label", span: 3, children: _77("Time Of Day") }),
              /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
                TimePicker,
                {
                  time: rotationTime,
                  onChange: this.handleTimeChange,
                  is24Hour: true
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Grid, { title: _77("Compress (gzip) the log after it's rotated."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { className: "ds-label", span: 3, children: _77("Compress Rotated Logs") }),
              /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { className: "ds-label", span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
                Switch,
                {
                  id: "nsslapd-securitylog-compress",
                  isChecked: this.state["nsslapd-securitylog-compress"],
                  onChange: (_event, value) => this.handleSwitchChange(value),
                  "aria-label": "nsslapd-securitylog-compress"
                }
              ) })
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
            Button,
            {
              isDisabled: this.state.saveRotationDisabled || this.state.loading,
              variant: "primary",
              className: "ds-margin-top-xlg ds-left-margin",
              onClick: () => {
                this.saveConfig("rotation");
              },
              isLoading: this.state.loading,
              spinnerAriaValueText: this.state.loading ? _77("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveRotationName
            },
            "save rot settings"
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(TabTitleText, { children: _77("Deletion Policy") }), children: [
          /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Form, { className: "ds-margin-top-lg ds-left-margin", isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
              Grid,
              {
                className: "ds-margin-top",
                title: _77("The server deletes the oldest archived log when the total of all the logs reaches this amount (nsslapd-securitylog-logmaxdiskspace)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { className: "ds-label", span: 3, children: _77("Log Archive Exceeds (in MB)") }),
                  /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-securitylog-logmaxdiskspace"],
                      min: -1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-securitylog-logmaxdiskspace", "exp");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-securitylog-logmaxdiskspace", -1, 2147483647, "exp");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-securitylog-logmaxdiskspace", "exp");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
              Grid,
              {
                title: _77("The server deletes the oldest archived log file when available disk space is less than this amount. (nsslapd-securitylog-logminfreediskspace)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { className: "ds-label", span: 3, children: _77("Free Disk Space (in MB)") }),
                  /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-securitylog-logminfreediskspace"],
                      min: -1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-securitylog-logminfreediskspace", "exp");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-securitylog-logminfreediskspace", -1, 2147483647, "exp");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-securitylog-logminfreediskspace", "exp");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
              Grid,
              {
                title: _77("Server deletes an old archived log file when it is older than the specified age. (nsslapd-securitylog-logexpirationtime)."),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { className: "ds-label", span: 3, children: _77("Log File is Older Than ...") }),
                  /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
                    NumberInput,
                    {
                      value: this.state["nsslapd-securitylog-logexpirationtime"],
                      min: -1,
                      max: 2147483647,
                      onMinus: () => {
                        this.onMinusConfig("nsslapd-securitylog-logexpirationtime", "exp");
                      },
                      onChange: (e) => {
                        this.onConfigChange(e, "nsslapd-securitylog-logexpirationtime", -1, 2147483647, "exp");
                      },
                      onPlus: () => {
                        this.onPlusConfig("nsslapd-securitylog-logexpirationtime", "exp");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 6
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { offset: 5, span: 1, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
                    FormSelect,
                    {
                      id: "nsslapd-securitylog-logexpirationtimeunit",
                      value: this.state["nsslapd-securitylog-logexpirationtimeunit"],
                      onChange: (e, str) => {
                        this.handleChange(e, "exp");
                      },
                      "aria-label": "log expiration time unit select",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(FormSelectOption, { value: "day", label: _77("day") }, "2"),
                        /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(FormSelectOption, { value: "week", label: _77("week") }, "3"),
                        /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(FormSelectOption, { value: "month", label: _77("month") }, "4")
                      ]
                    }
                  ) })
                ]
              }
            )
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
            Button,
            {
              isDisabled: this.state.saveExpDisabled || this.state.loading,
              variant: "primary",
              className: "ds-margin-top-xlg ds-left-margin",
              onClick: () => {
                this.saveConfig("exp");
              },
              isLoading: this.state.loading,
              spinnerAriaValueText: this.state.loading ? _77("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveDeletionName
            },
            "save del settings"
          )
        ] })
      ] }) });
      if (!this.state.loaded) {
        body = /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Text, { component: TextVariants.h3, children: _77("Loading Security Log Settings ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Spinner, { size: "xl" })
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { id: "server-securitylog-page", className: this.state.loading ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Text, { component: TextVariants.h3, children: [
          _77("Security Log Settings"),
          /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
            Button,
            {
              variant: "plain",
              "aria-label": _77("Refresh log settings"),
              onClick: () => {
                this.refreshConfig();
              },
              children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SyncAltIcon, {})
            }
          )
        ] }) }) }) }),
        body
      ] });
    }
  };
  ServerSecurityLog.propTypes = {
    addNotification: import_prop_types75.default.func,
    serverId: import_prop_types75.default.string,
    attrs: import_prop_types75.default.object
  };
  ServerSecurityLog.defaultProps = {
    serverId: "",
    attrs: {}
  };

  // src/security.jsx
  var import_react153 = __toESM(require_react(), 1);

  // src/lib/security/certificateManagement.jsx
  var import_react150 = __toESM(require_react(), 1);

  // src/lib/security/securityTables.jsx
  var import_react148 = __toESM(require_react(), 1);
  var import_prop_types76 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime78 = __toESM(require_jsx_runtime(), 1);
  var _78 = cockpit_default.gettext;
  var KeyTable = class extends import_react148.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _78("Delete Key"),
          onClick: () => {
            if (rowData[1]) {
              this.props.delKey(rowData[1]);
            }
          }
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        hasRows: false,
        columns: [
          { title: _78("Cipher"), sortable: true },
          { title: _78("Key Identifier"), sortable: true },
          { title: _78("State"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      let hasRows = true;
      for (const ServerKey of this.props.ServerKeys) {
        rows.push([
          ServerKey.attrs.cipher,
          ServerKey.attrs.key_id,
          ServerKey.attrs.state
        ]);
      }
      if (rows.length === 0) {
        rows = [{ cells: [_78("No Orphan keys")] }];
        columns = [{ title: _78("Orphan keys") }];
        hasRows = false;
      }
      this.setState({
        rows,
        columns,
        hasRows
      });
    }
    handleSort(_event, index, direction) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    render() {
      const { perPage, page, sortBy, rows, columns, hasRows } = this.state;
      const startIdx = perPage * page - perPage;
      const tableRows = rows.slice(startIdx, startIdx + perPage);
      return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "ds-margin-top-lg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
          Tooltip,
          {
            content: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("p", { children: [
              _78("An orphan key is a private key in the NSS DB for which there is NO cert with the corresponding public key. An orphan key is created during CSR creation, when the certificate associated with a CSR has been imported into the NSS DB its orphan state will be removed."),
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("br", {}),
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("br", {}),
              _78("Make sure an orphan key is not associated with a submitted CSR before you delete it.")
            ] }) }),
            children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("a", { className: "ds-font-size-sm", children: _78("What is an orphan key?") })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "orph key table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                hasRows && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { children: cell }, cellIndex)) : row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { children: cell }, cellIndex)),
                hasRows && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActionsForRow(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        hasRows && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
          Pagination,
          {
            itemCount: rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var CSRTable = class extends import_react148.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _78("Delete CSR"),
          onClick: () => this.props.delCSR(rowData[0])
        },
        {
          title: _78("View CSR"),
          onClick: () => this.props.viewCSR(rowData[0])
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _78("Name"), sortable: true },
          { title: _78("Subject DN"), sortable: true },
          { title: _78("Subject Alternative Names"), sortable: true },
          { title: _78("Modification Date"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    handleSort(_event, index, direction) {
      const sortedRows = [...this.state.rows].sort(
        (a2, b) => a2[index] < b[index] ? -1 : a2[index] > b[index] ? 1 : 0
      );
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows: direction === SortByDirection.asc ? sortedRows : sortedRows.reverse()
      });
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      let hasRows = true;
      for (const ServerCSR of this.props.ServerCSRs) {
        rows.push([
          ServerCSR.attrs.name,
          ServerCSR.attrs.subject,
          ServerCSR.attrs.subject_alt_names.join(", "),
          ServerCSR.attrs.modified
        ]);
      }
      if (rows.length === 0) {
        rows = [{ cells: [_78("No Certificate Signing Requests")] }];
        columns = [{ title: _78("Certificate Signing Requests") }];
        hasRows = false;
      }
      this.setState({
        rows,
        columns,
        hasRows
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      for (const cert of this.props.ServerCSRs) {
        const val = value.toLowerCase();
        if (val !== "" && cert.attrs.name.toLowerCase().indexOf(val) === -1 && cert.attrs.subject.toLowerCase().indexOf(val) === -1 && cert.attrs.subject_alt_names.join().toLowerCase().indexOf(val) === -1 && cert.attrs.modified.toLowerCase().indexOf(val) === -1) {
          continue;
        }
        rows.push([
          cert.attrs.name,
          cert.attrs.subject,
          cert.attrs.subject_alt_names.join(", "),
          cert.attrs.modified
        ]);
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const { perPage, page, sortBy, rows, columns, hasRows } = this.state;
      const tableRows = rows.slice((page - 1) * perPage, page * perPage);
      return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "ds-margin-top-lg", children: [
        hasRows && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
          SearchInput,
          {
            placeholder: _78("Search CSRs"),
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
          Table,
          {
            className: "ds-margin-top",
            "aria-label": "csr table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Tr, { children: [
                columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                hasRows && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Tr, { children: [
                Array.isArray(row) ? row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { children: cell }, cellIndex)) : row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { children: cell }, cellIndex)),
                hasRows && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
                  ActionsColumn,
                  {
                    items: this.getActionsForRow(row)
                  }
                ) })
              ] }, rowIndex)) })
            ]
          }
        ),
        hasRows && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
          Pagination,
          {
            itemCount: rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var CertTable = class extends import_react148.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _78("Edit Trust Flags"),
          onClick: () => this.props.editCert(rowData.cells[0].content, rowData.flags)
        },
        {
          title: _78("Export Certificate"),
          onClick: () => this.props.exportCert(rowData.cells[0].content)
        },
        {
          isSeparator: true
        },
        {
          title: _78("Delete Certificate"),
          onClick: () => this.props.delCert(rowData.cells[0].content)
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        dropdownIsOpen: false,
        hasRows: false,
        columns: [
          {
            title: _78("Nickname"),
            sortable: true
          },
          { title: _78("Subject DN"), sortable: true },
          { title: _78("Expiration Date"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    handleSort(_event, columnIndex, direction) {
      const rows = [...this.state.rows];
      rows.sort((a2, b) => a2.cells[columnIndex].content > b.cells[columnIndex].content ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        rows.reverse();
      }
      this.setState({
        sortBy: {
          index: columnIndex,
          direction
        },
        rows,
        page: 1
      });
    }
    getExpandedRow(issuer, flags) {
      return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Grid, { className: "ds-left-indent-lg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { span: 3, children: _78("Issuer DN:") }),
        /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("b", { children: issuer }) }),
        /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { span: 3, children: _78("Trust Flags:") }),
        /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("b", { children: flags }) })
      ] });
    }
    componentDidMount() {
      let rows = [];
      let columns = this.state.columns;
      let count = 0;
      let hasRows = true;
      for (const cert of this.props.certs) {
        rows.push({
          isOpen: false,
          cells: [
            { content: cert.attrs.nickname },
            { content: cert.attrs.subject },
            { content: cert.attrs.expires }
          ],
          issuer: cert.attrs.issuer,
          flags: cert.attrs.flags,
          originalData: cert.attrs
          // Store the original data for expansion
        });
        count += 1;
      }
      if (rows.length === 0) {
        rows = [{ cells: [{ content: _78("No Certificates") }] }];
        columns = [{ title: _78("Certificates") }];
        hasRows = false;
      }
      this.setState({
        rows,
        columns,
        hasRows
      });
    }
    handleCollapse(_event, rowIndex, isExpanding) {
      const rows = [...this.state.rows];
      const index = this.state.perPage * (this.state.page - 1) * 2 + rowIndex;
      rows[index].isOpen = isExpanding;
      this.setState({ rows });
    }
    handleSearchChange(event, value) {
      const rows = [];
      let count = 0;
      for (const cert of this.props.certs) {
        const val = value.toLowerCase();
        if (val !== "" && cert.attrs.nickname.toLowerCase().indexOf(val) === -1 && cert.attrs.subject.toLowerCase().indexOf(val) === -1 && cert.attrs.issuer.toLowerCase().indexOf(val) === -1 && cert.attrs.expires.toLowerCase().indexOf(val) === -1) {
          continue;
        }
        rows.push(
          {
            isOpen: false,
            cells: [
              { content: cert.attrs.nickname },
              { content: cert.attrs.subject },
              { content: cert.attrs.expires }
            ],
            issuer: cert.attrs.issuer,
            flags: cert.attrs.flags
          }
        );
        count += 1;
      }
      this.setState({
        rows,
        value,
        page: 1
      });
    }
    render() {
      const { perPage, page, sortBy, rows, columns, hasRows } = this.state;
      const startIdx = (perPage * page - perPage) * 2;
      const tableRows = rows.slice(startIdx, startIdx + perPage * 2);
      return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "ds-margin-top-lg", children: [
        hasRows && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
          SearchInput,
          {
            placeholder: _78("Search Certificates"),
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
          Table,
          {
            "aria-label": "cert table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Tr, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Th, { screenReaderText: "Row expansion" }),
                columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy,
                      onSort: this.handleSort,
                      columnIndex
                    } : void 0,
                    children: column.title
                  },
                  columnIndex
                )),
                /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_react148.default.Fragment, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Tr, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
                    Td,
                    {
                      expand: {
                        rowIndex,
                        isExpanded: row.isOpen,
                        onToggle: () => this.handleCollapse(null, rowIndex, !row.isOpen)
                      }
                    }
                  ),
                  row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { children: cell.content }, cellIndex)),
                  hasRows && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
                    ActionsColumn,
                    {
                      items: this.getActionsForRow(row)
                    }
                  ) })
                ] }),
                row.isOpen && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Tr, { isExpanded: true, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { colSpan: columns.length + 2, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(ExpandableRowContent, { children: this.getExpandedRow(row.issuer, row.flags) }) }) })
              ] }, rowIndex)) })
            ]
          }
        ),
        hasRows && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
          Pagination,
          {
            itemCount: this.state.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  var CRLTable = class extends import_react148.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActionsForRow", (rowData) => [
        {
          title: _78("View CRL"),
          onClick: () => this.props.editConfig(rowData.cells[0], rowData.cells[1], rowData.credsBindpw, rowData.pwInteractive)
        },
        {
          title: _78("Delete CRL"),
          onClick: () => this.props.deleteConfig(rowData.cells[0])
        }
      ]);
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        hasRows: false,
        columns: [
          { title: _78("Issued By"), sortable: true },
          { title: _78("Effective Date"), sortable: true },
          { title: _78("Next Update"), sortable: true },
          { title: _78("Type"), sortable: true }
        ]
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    handleSort(_event, index, direction) {
      const sorted_rows = [];
      const rows = [];
      let count = 0;
      for (let idx = 0; idx < this.state.rows.length; idx += 2) {
        sorted_rows.push({
          1: this.state.rows[idx].cells[0],
          2: this.state.rows[idx].cells[1],
          3: this.state.rows[idx].cells[2],
          issuer: this.state.rows[idx].issuer,
          flags: this.state.rows[idx].flags,
          expandedRow: this.state.rows[idx + 1]
        });
      }
      sorted_rows.sort((a2, b) => a2[index] > b[index] ? 1 : -1);
      if (direction !== SortByDirection.asc) {
        sorted_rows.reverse();
      }
      for (const srow of sorted_rows) {
        rows.push({
          isOpen: false,
          cells: [srow[1], srow[2], srow[3]],
          issuer: srow.issuer,
          flags: srow.flags
        });
        srow.expandedRow.parent = count;
        rows.push(srow.expandedRow);
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    handleSearchChange(event, value) {
      const rows = [];
      let count = 0;
      for (const cert of this.props.certs) {
        const val = value.toLowerCase();
        if (val !== "" && cert.attrs.nickname.toLowerCase().indexOf(val) === -1 && cert.attrs.subject.toLowerCase().indexOf(val) === -1 && cert.attrs.issuer.toLowerCase().indexOf(val) === -1 && cert.attrs.expires.toLowerCase().indexOf(val) === -1) {
          continue;
        }
        rows.push(
          {
            isOpen: false,
            cells: [cert.attrs.nickname, cert.attrs.subject, cert.attrs.expires],
            issuer: cert.attrs.issuer,
            flags: cert.attrs.flags
          },
          {
            parent: count,
            fullWidth: true,
            cells: [{ title: this.getExpandedRow(cert.attrs.issuer, cert.attrs.flags) }]
          }
        );
        count += 2;
      }
      this.setState({
        rows,
        value,
        page: 1,
        hasRows: rows.length !== 0
      });
    }
    render() {
      const tableRows = this.state.rows.slice(
        (this.state.page - 1) * this.state.perPage,
        this.state.page * this.state.perPage
      );
      return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "ds-margin-top", children: [
        /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
          SearchInput,
          {
            placeholder: _78("Search CRL's"),
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
          Table,
          {
            "aria-label": "CRL Table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Tr, { children: [
                this.state.columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
                  Th,
                  {
                    sort: column.sortable ? {
                      sortBy: this.state.sortBy,
                      onSort: this.handleSort,
                      columnIndex: idx
                    } : void 0,
                    children: column.title
                  },
                  idx
                )),
                this.state.hasRows && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Th, { screenReaderText: "Actions" })
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_react148.default.Fragment, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Tr, { children: [
                  row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { children: cell }, cellIndex)),
                  this.state.hasRows && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
                    ActionsColumn,
                    {
                      items: this.getActionsForRow(row)
                    }
                  ) })
                ] }),
                row.isOpen && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Tr, { isExpanded: true, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { colSpan: this.state.columns.length + 1, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(ExpandableRowContent, { children: this.getExpandedRow(row.issuer, row.flags) }) }) })
              ] }, rowIndex)) })
            ]
          }
        ),
        this.state.hasRows && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
          Pagination,
          {
            itemCount: this.state.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage: this.state.perPage,
            page: this.state.page,
            variant: "bottom",
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        )
      ] });
    }
  };
  function getAssignedModuleByCert(modules, certNickname, currentModuleName = "") {
    if (!certNickname) {
      return null;
    }
    return modules.find(
      (module) => module.certNickname === certNickname && module.name !== currentModuleName
    ) || null;
  }
  function validateEncryptionModuleForm({
    mode = "create",
    name: name2 = "",
    certNickname = "",
    token = "",
    modules = [],
    currentModuleName = ""
  }) {
    const errors = {};
    if (mode === "create" && name2.trim() === "") {
      errors.name = _78("Module name is required.");
    }
    if (certNickname.trim() === "") {
      errors.certNickname = _78("Server certificate nickname is required.");
    }
    if (token.trim() === "") {
      errors.token = _78("Token is required.");
    }
    if (!errors.certNickname) {
      const assignedModule = getAssignedModuleByCert(modules, certNickname.trim(), currentModuleName);
      if (assignedModule) {
        errors.certNickname = cockpit_default.format(
          _78("Certificate nickname is already assigned to module '$0'."),
          assignedModule.name
        );
      }
    }
    return {
      valid: Object.keys(errors).length === 0,
      errors
    };
  }
  function EncryptionModuleModal({
    isOpen,
    mode,
    formState,
    formErrors,
    certOptions,
    onFormChange,
    onCertSelect,
    onClose,
    onSave,
    saving,
    saveDisabled
  }) {
    const isEdit = mode === "edit";
    const title = isEdit ? _78("Edit Encryption Module") : _78("Add Encryption Module");
    const btnLabel = isEdit ? _78("Save") : _78("Create");
    const selectedCert = formState.certNickname ? [formState.certNickname] : [];
    const validatedName = formErrors.name ? "error" : "default";
    const validatedToken = formErrors.token ? "error" : "default";
    const validatedCert = formErrors.certNickname ? "error" : "default";
    const formattedCertOptions = certOptions.map((option) => {
      if (typeof option === "string") {
        return option;
      }
      const inUseSuffix = option.inUseByModule ? cockpit_default.format(_78(" (in use by '$0')"), option.inUseByModule) : "";
      return {
        value: option.nickname,
        label: `${option.nickname}${inUseSuffix}`,
        isDisabled: option.selectable === false
      };
    });
    return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
      Modal,
      {
        variant: ModalVariant.medium,
        title,
        isOpen,
        onClose,
        "aria-labelledby": "encryption-module-modal",
        actions: [
          /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
            Button,
            {
              variant: "primary",
              onClick: onSave,
              isDisabled: saving || saveDisabled,
              isLoading: saving,
              spinnerAriaValueText: saving ? _78("Saving") : void 0,
              children: btnLabel
            },
            "save"
          ),
          /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Button, { variant: "link", onClick: onClose, isDisabled: saving, children: _78("Cancel") }, "cancel")
        ],
        children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
          /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { className: "ds-label", span: 4, children: _78("Module Name") }),
            /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(GridItem, { span: 8, children: [
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
                TextInput,
                {
                  id: "name",
                  value: formState.name,
                  onChange: (_event, value) => onFormChange("name", value),
                  isDisabled: isEdit || saving,
                  validated: validatedName
                }
              ),
              formErrors.name && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Text, { component: "small", className: "ds-margin-top-sm", children: formErrors.name })
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { className: "ds-label", span: 4, children: _78("Server Certificate Name") }),
            /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(GridItem, { span: 8, children: [
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
                dsBasicComponents_default,
                {
                  selected: selectedCert,
                  onSelect: (_event, value) => onCertSelect(value),
                  onClear: () => onCertSelect(""),
                  options: formattedCertOptions,
                  isCreatable: true,
                  onCreateOption: (value) => onCertSelect(value),
                  allowCustomValues: true,
                  placeholder: _78("Type a server certificate nickname..."),
                  validationMessage: formErrors.certNickname,
                  validated: validatedCert,
                  ariaLabel: _78("Encryption module certificate selector")
                }
              ),
              formErrors.certNickname && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Text, { component: "small", className: "ds-margin-top-sm", children: formErrors.certNickname })
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { className: "ds-label", span: 4, children: _78("Token") }),
            /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(GridItem, { span: 8, children: [
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
                TextInput,
                {
                  id: "token",
                  value: formState.token,
                  onChange: (_event, value) => onFormChange("token", value),
                  isDisabled: saving,
                  validated: validatedToken
                }
              ),
              formErrors.token && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Text, { component: "small", className: "ds-margin-top-sm", children: formErrors.token })
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { className: "ds-label", span: 4, children: _78("Server Certificate Extract File") }),
            /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
              TextInput,
              {
                id: "serverCertExtractFile",
                value: formState.serverCertExtractFile,
                onChange: (_event, value) => onFormChange("serverCertExtractFile", value),
                isDisabled: saving
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { className: "ds-label", span: 4, children: _78("Server Key Extract File") }),
            /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
              TextInput,
              {
                id: "serverKeyExtractFile",
                value: formState.serverKeyExtractFile,
                onChange: (_event, value) => onFormChange("serverKeyExtractFile", value),
                isDisabled: saving
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { className: "ds-label", span: 4, children: _78("Activated") }),
            /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
              Switch,
              {
                id: "module-activated",
                isChecked: formState.activated,
                onChange: (_event, checked) => onFormChange("activated", checked),
                isDisabled: saving,
                label: _78("Enabled"),
                labelOff: _78("Disabled")
              }
            ) })
          ] }),
          formErrors._form && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Grid, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Text, { component: "small", children: formErrors._form }) }) })
        ] })
      }
    );
  }
  function EncryptionModuleTable(props) {
    const {
      modules,
      rows,
      certOptions,
      loading,
      loadError,
      partialDataCount,
      actionInProgress,
      onCreateModule,
      onEditModule,
      onToggleModule,
      onDeleteModule
    } = props;
    const [isModalOpen, setIsModalOpen] = import_react148.default.useState(false);
    const [modalMode, setModalMode] = import_react148.default.useState("create");
    const [editingModuleName, setEditingModuleName] = import_react148.default.useState("");
    const [expandedRows, setExpandedRows] = import_react148.default.useState({});
    const [formErrors, setFormErrors] = import_react148.default.useState({});
    const [formState, setFormState] = import_react148.default.useState({
      name: "",
      certNickname: "",
      token: "internal (software)",
      serverCertExtractFile: "",
      serverKeyExtractFile: "",
      activated: false
    });
    const [editInitialState, setEditInitialState] = import_react148.default.useState(null);
    const modalCertOptions = import_react148.default.useMemo(() => {
      const options5 = Array.isArray(certOptions) ? [...certOptions] : [];
      const current = formState.certNickname?.trim();
      if (current && !options5.some((option) => option.nickname === current)) {
        options5.push({
          nickname: current,
          inUseByModule: null,
          selectable: true,
          isAdHoc: true
        });
      }
      return options5;
    }, [certOptions, formState.certNickname]);
    const openCreateModal = () => {
      setModalMode("create");
      setEditingModuleName("");
      setEditInitialState(null);
      setFormErrors({});
      setFormState({
        name: "",
        certNickname: "",
        token: "internal (software)",
        serverCertExtractFile: "",
        serverKeyExtractFile: "",
        activated: false
      });
      setIsModalOpen(true);
    };
    const openEditModal = (module) => {
      const initialState2 = {
        name: module.name || "",
        certNickname: module.certNickname || "",
        token: module.token || "internal (software)",
        serverCertExtractFile: module.serverCertExtractFile || "",
        serverKeyExtractFile: module.serverKeyExtractFile || "",
        activated: module.activated === "on"
      };
      setModalMode("edit");
      setEditingModuleName(module.name);
      setEditInitialState(initialState2);
      setFormErrors({});
      setFormState(initialState2);
      setIsModalOpen(true);
    };
    const closeModal = () => {
      if (actionInProgress) {
        return;
      }
      setIsModalOpen(false);
    };
    const handleFormChange = (field, value) => {
      setFormState((prev) => ({ ...prev, [field]: value }));
      setFormErrors((prev) => {
        if (!prev[field] && !prev._form) {
          return prev;
        }
        const next = { ...prev };
        delete next[field];
        delete next._form;
        return next;
      });
    };
    const normalizedFormState = import_react148.default.useMemo(() => ({
      name: formState.name.trim(),
      certNickname: formState.certNickname.trim(),
      token: formState.token.trim(),
      serverCertExtractFile: formState.serverCertExtractFile.trim(),
      serverKeyExtractFile: formState.serverKeyExtractFile.trim(),
      activated: !!formState.activated
    }), [formState]);
    const isUnchangedEdit = import_react148.default.useMemo(() => {
      if (modalMode !== "edit" || !editInitialState) {
        return false;
      }
      return normalizedFormState.name === editInitialState.name.trim() && normalizedFormState.certNickname === editInitialState.certNickname.trim() && normalizedFormState.token === editInitialState.token.trim() && normalizedFormState.serverCertExtractFile === editInitialState.serverCertExtractFile.trim() && normalizedFormState.serverKeyExtractFile === editInitialState.serverKeyExtractFile.trim() && normalizedFormState.activated === !!editInitialState.activated;
    }, [modalMode, editInitialState, normalizedFormState]);
    const liveValidation = import_react148.default.useMemo(() => validateEncryptionModuleForm({
      mode: modalMode,
      name: formState.name,
      certNickname: formState.certNickname,
      token: formState.token,
      modules,
      currentModuleName: editingModuleName
    }), [modalMode, formState, modules, editingModuleName]);
    const isSaveDisabled = actionInProgress || !liveValidation.valid || isUnchangedEdit;
    const handleSave = () => {
      if (!liveValidation.valid) {
        setFormErrors(liveValidation.errors);
        return;
      }
      if (isUnchangedEdit) {
        setFormErrors({
          _form: _78("No changes detected.")
        });
        return;
      }
      setFormErrors({});
      const payload = normalizedFormState;
      if (modalMode === "edit") {
        onEditModule(editingModuleName, payload, () => setIsModalOpen(false));
      } else {
        onCreateModule(payload, () => setIsModalOpen(false));
      }
    };
    const toggleExpand = (moduleName) => {
      setExpandedRows((prev) => ({
        ...prev,
        [moduleName]: !prev[moduleName]
      }));
    };
    return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "ds-margin-top-lg", children: [
      /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Button, { variant: "primary", onClick: openCreateModal, isDisabled: loading || actionInProgress, children: _78("Add Encryption Module") }) }) }),
      loadError && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(TextContent, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Text, { component: "small", children: cockpit_default.format(_78("Unable to load encryption modules: $0"), loadError) }) }),
      !loadError && partialDataCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(TextContent, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Text, { component: "small", children: cockpit_default.format(_78("Some encryption module entries were skipped because required data was incomplete: $0"), partialDataCount) }) }),
      /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Table, { className: "ds-margin-top", "aria-label": _78("Encryption module table"), variant: "compact", children: [
        /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Tr, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Th, { screenReaderText: _78("Row expansion") }),
          /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Th, { children: _78("Module Name") }),
          /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Th, { children: _78("Server Certificate Name") }),
          /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Th, { children: _78("Activated") }),
          /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Th, { screenReaderText: _78("Actions") })
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Tbody, { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Tr, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, {}),
          /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { colSpan: 4, children: _78("Loading encryption modules...") })
        ] }) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Tr, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, {}),
          /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { colSpan: 4, children: loadError ? _78("Unable to display encryption modules due to load errors.") : _78("No Encryption Modules") })
        ] }) : rows.map((row, rowIndex) => {
          const module = modules.find((item) => item.name === row.name) || row;
          const isExpanded = !!expandedRows[row.name];
          const rowActions = [
            {
              title: _78("Edit"),
              onClick: () => openEditModal(module),
              isDisabled: actionInProgress
            },
            {
              title: row.activated === "on" ? _78("Disable") : _78("Enable"),
              onClick: () => onToggleModule(module, row.activated !== "on"),
              isDisabled: actionInProgress
            },
            { isSeparator: true },
            {
              title: _78("Delete"),
              onClick: () => onDeleteModule(module),
              isDisabled: actionInProgress
            }
          ];
          return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_react148.default.Fragment, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Tr, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
                Td,
                {
                  expand: {
                    rowIndex,
                    isExpanded,
                    onToggle: () => toggleExpand(row.name)
                  }
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { children: row.name }),
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { children: row.certNickname }),
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { children: row.activated === "on" ? _78("On") : _78("Off") }),
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(ActionsColumn, { items: rowActions }) })
            ] }),
            isExpanded && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Tr, { isExpanded: true, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Td, { colSpan: 5, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(ExpandableRowContent, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(Grid, { className: "ds-left-indent-md", children: [
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { span: 3, children: _78("Token:") }),
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("b", { children: module.token || "-" }) }),
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { span: 3, children: _78("Server Cert Extract File:") }),
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("b", { children: module.serverCertExtractFile || "-" }) }),
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { span: 3, children: _78("Server Key Extract File:") }),
              /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("b", { children: module.serverKeyExtractFile || "-" }) })
            ] }) }) }) })
          ] }, row.name);
        }) })
      ] }),
      /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
        EncryptionModuleModal,
        {
          isOpen: isModalOpen,
          mode: modalMode,
          formState,
          formErrors,
          certOptions: modalCertOptions,
          onFormChange: handleFormChange,
          onCertSelect: (value) => handleFormChange("certNickname", value),
          onClose: closeModal,
          onSave: handleSave,
          saving: actionInProgress,
          saveDisabled: isSaveDisabled
        }
      )
    ] });
  }
  CertTable.propTypes = {
    // serverId: PropTypes.string,
    certs: import_prop_types76.default.array,
    editCert: import_prop_types76.default.func,
    delCert: import_prop_types76.default.func
  };
  CertTable.defaultProps = {
    // serverId: "",
    certs: []
  };
  CSRTable.propTypes = {
    ServerCSRs: import_prop_types76.default.array,
    delCSR: import_prop_types76.default.func,
    viewCSR: import_prop_types76.default.func
  };
  CSRTable.defaultProps = {
    ServerCSRs: []
  };
  KeyTable.propTypes = {
    ServerKeys: import_prop_types76.default.array,
    delKey: import_prop_types76.default.func
  };
  KeyTable.defaultProps = {
    ServerKeys: []
  };
  EncryptionModuleTable.propTypes = {
    modules: import_prop_types76.default.array,
    rows: import_prop_types76.default.array,
    certOptions: import_prop_types76.default.array,
    loading: import_prop_types76.default.bool,
    loadError: import_prop_types76.default.string,
    partialDataCount: import_prop_types76.default.number,
    actionInProgress: import_prop_types76.default.bool,
    onCreateModule: import_prop_types76.default.func,
    onEditModule: import_prop_types76.default.func,
    onToggleModule: import_prop_types76.default.func,
    onDeleteModule: import_prop_types76.default.func
  };

  // src/lib/security/securityModals.jsx
  var import_react149 = __toESM(require_react(), 1);
  var import_outlined_question_circle_icon4 = __toESM(require_outlined_question_circle_icon(), 1);
  var import_prop_types77 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime79 = __toESM(require_jsx_runtime(), 1);
  var _79 = cockpit_default.gettext;
  var ExportCertModal = class extends import_react149.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        fileName,
        nickName,
        binaryFormat,
        certDir,
        spinning
      } = this.props;
      let exportBtnName = _79("Export Certificate");
      const extraPrimaryProps = {};
      if (spinning) {
        exportBtnName = _79("Exporting Certificate ...");
        extraPrimaryProps.spinnerAriaValueText = _79("Exporting");
      }
      const title = /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
        _79("Export Certificate:"),
        " \xA0\xA0",
        /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("i", { children: nickName })
      ] });
      const desc = /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
        _79("Enter the full path and file name, if the path portion is omitted the certificate is written to the server's certificate directory "),
        /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("i", { children: certDir })
      ] });
      return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Button,
              {
                variant: "primary",
                onClick: saveHandler,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? _79("Exporting") : void 0,
                ...extraPrimaryProps,
                isDisabled: fileName === "" || spinning,
                children: exportBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Button, { variant: "link", onClick: closeHandler, children: _79("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Form, { isHorizontal: true, autoComplete: "off", className: "ds-margin-top-lg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { className: "ds-label", span: 12, children: desc }) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Grid, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { className: "ds-label", span: 3, children: _79("Certificate File Name") }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                TextInput,
                {
                  type: "text",
                  title: _79("Enter full path to and and including certificate file name"),
                  id: "exportFileName",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "exportFileName",
                  onChange: (e, str) => {
                    handleChange(e);
                  },
                  validated: fileName === "" ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                GridItem,
                {
                  title: _79("Export certificate in its binary format.  Otherwise a PEM file is created."),
                  className: "ds-margin-top-lg",
                  span: 12,
                  children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                    Checkbox,
                    {
                      label: _79("Export Certificate In Binary/DER Format"),
                      isChecked: binaryFormat,
                      onChange: (e, checked) => {
                        handleChange(e);
                      },
                      id: "exportDERFormat",
                      name: "binaryFormat"
                    }
                  )
                }
              )
            ] })
          ] })
        }
      );
    }
  };
  var SecurityAddCertModal = class extends import_react149.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        isPasswordSectionExpanded: false
      };
      this.handlePasswordSectionToggle = this.handlePasswordSectionToggle.bind(this);
    }
    handlePasswordSectionToggle(event, isExpanded) {
      this.setState({
        isPasswordSectionExpanded: isExpanded
      });
    }
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        spinning,
        certName,
        certFile,
        certRadioFile,
        certRadioSelect,
        certRadioUpload,
        handleRadioChange,
        badCertText,
        certNames,
        certNicknames,
        CACertNicknames,
        // Select server cert
        handleCertSelect,
        selectCertName,
        // File Upload
        uploadValue,
        uploadFileName,
        uploadIsLoading,
        uploadIsRejected,
        handleFileInputChange,
        handleTextOrDataChange,
        handleFileReadStarted,
        handleFileReadFinished,
        handleClear,
        handleFileRejected,
        // PKCS#12 Password options
        pkcs12PinMethod,
        pkcs12PinFile,
        pkcs12PinText,
        forceCertAdd,
        handlePkcs12PinMethodChange,
        handlePkcs12PinFileChange,
        handlePkcs12PinTextChange,
        handleForceCertAddChange
      } = this.props;
      let saveBtnName = _79("Add Certificate");
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = _79("Adding Certificate ...");
        extraPrimaryProps.spinnerAriaValueText = _79("Saving");
      }
      const certTextLabel = /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
        Tooltip,
        {
          content: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: _79('Paste the base64 encoded certificate that starts with "-----BEGIN CERTIFICATE-----" and ends with "-----END CERTIFICATE-----".  Make sure there are no special carriage return characters after each line.') }),
          children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { children: [
            _79("Upload PEM File, or Certificate Text"),
            " ",
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_outlined_question_circle_icon4.OutlinedQuestionCircleIcon, {})
          ] })
        }
      ) });
      let title = _79("Add Server Certificate");
      let desc = _79("Add a Server Certificate to the security database.");
      let selectValidated = ValidatedOptions.default;
      if (certRadioSelect && certNames.length === 0) {
        selectValidated = ValidatedOptions.error;
      }
      return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Button,
              {
                variant: "primary",
                onClick: () => {
                  saveHandler(false);
                },
                isLoading: spinning,
                spinnerAriaValueText: spinning ? _79("Saving") : void 0,
                ...extraPrimaryProps,
                isDisabled: certName === "" || certRadioFile && certFile === "" || certRadioUpload && (uploadValue === "" || badCertText) || certRadioSelect && certNames.length === 0 || pkcs12PinMethod === "file" && (pkcs12PinFile === "" || !file_is_path(pkcs12PinFile)) || pkcs12PinMethod === "stdin" && pkcs12PinText === "" || certNicknames.includes(certName) || CACertNicknames.includes(certName),
                children: saveBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Button, { variant: "link", onClick: closeHandler, children: _79("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Text, { component: TextVariants.h4, children: desc }) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
              Grid,
              {
                className: "ds-margin-top-sm",
                title: _79("Enter name/nickname of the certificate"),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { className: "ds-label", span: 3, children: _79("Certificate Nickname") }),
                  /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(GridItem, { span: 9, children: [
                    /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                      TextInput,
                      {
                        type: "text",
                        id: "certName",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "certName",
                        onChange: (e, str) => {
                          handleChange(e);
                        },
                        validated: certName === "" || certNicknames.includes(certName) || CACertNicknames.includes(certName) ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ),
                    (certNicknames.includes(certName) || CACertNicknames.includes(certName)) && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(HelperTextItem, { variant: "error", children: _79("Please use a unique certificate nickname") }) })
                  ] })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              ExpandableSection,
              {
                toggleText: this.state.isPasswordSectionExpanded ? _79("Hide PKCS#12 Password Options") : _79("Show PKCS#12 Password Options"),
                onToggle: this.handlePasswordSectionToggle,
                isExpanded: this.state.isPasswordSectionExpanded,
                children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "ds-indent-lg", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(TextContent, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Text, { component: TextVariants.p, children: _79("These password settings are only used for PKCS#12 password protected certificates. These settings are ignored for other certificate types.") }) }),
                  /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Grid, { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(GridItem, { span: 12, children: [
                    /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                      Radio,
                      {
                        id: "noPasswordRadio",
                        label: _79("Non-PKCS#12 Certificate"),
                        name: "pkcs12PinMethod",
                        isChecked: pkcs12PinMethod === "noPassword",
                        onChange: handlePkcs12PinMethodChange
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                      "div",
                      {
                        className: "ds-margin-top",
                        title: _79("Password will be read from stdin when prompted by the command"),
                        children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                          Radio,
                          {
                            id: "pkcs12PinRadioStdin",
                            label: _79("Password"),
                            name: "pkcs12PinMethod",
                            isChecked: pkcs12PinMethod === "stdin",
                            onChange: handlePkcs12PinMethodChange
                          }
                        )
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "ds-margin-top ds-radio-indent", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                      TextInput,
                      {
                        type: "password",
                        id: "pkcs12PinTextStdin",
                        "aria-describedby": "pkcs12-pin-stdin-helper",
                        name: "pkcs12PinText",
                        value: pkcs12PinText,
                        onChange: (e, value) => {
                          handlePkcs12PinTextChange(value);
                        },
                        placeholder: _79("Enter password to send via stdin"),
                        validated: pkcs12PinMethod === "stdin" && pkcs12PinText === "" ? ValidatedOptions.error : ValidatedOptions.default,
                        isDisabled: pkcs12PinMethod !== "stdin"
                      }
                    ) }),
                    /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                      "div",
                      {
                        className: "ds-margin-top",
                        title: _79("Read password from a file on the server"),
                        children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                          Radio,
                          {
                            id: "pkcs12PinRadioFile",
                            className: "ds-margin-top-lg",
                            label: _79("Read password from file"),
                            name: "pkcs12PinMethod",
                            isChecked: pkcs12PinMethod === "file",
                            onChange: handlePkcs12PinMethodChange
                          }
                        )
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "ds-margin-top ds-radio-indent", children: [
                      /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                        TextInput,
                        {
                          type: "text",
                          id: "pkcs12PinFile",
                          "aria-describedby": "pkcs12-pin-file-helper",
                          name: "pkcs12PinFile",
                          value: pkcs12PinFile,
                          onChange: (e, value) => {
                            handlePkcs12PinFileChange(value);
                          },
                          placeholder: _79("Enter full path to password file"),
                          isDisabled: pkcs12PinMethod !== "file",
                          validated: pkcs12PinMethod === "file" && (pkcs12PinFile === "" || !file_is_path(pkcs12PinFile)) ? ValidatedOptions.error : ValidatedOptions.default
                        }
                      ),
                      pkcs12PinMethod === "file" && pkcs12PinFile !== "" && !file_is_path(pkcs12PinFile) && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(HelperTextItem, { variant: "error", children: _79("Please enter a valid file path (must start with '/' and not end with '/')") }) })
                    ] }),
                    /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "ds-margin-top-xxlg", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                      Tooltip,
                      {
                        position: TooltipPosition.bottomStart,
                        content: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: _79("Force certificate addition without validation. This bypasses certificate chain validation checks.") }),
                        children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                          Checkbox,
                          {
                            id: "forceCertAdd",
                            className: "ds-margin-top-lg",
                            label: _79("Skip certificate verification"),
                            isChecked: forceCertAdd,
                            onChange: (e, checked) => {
                              handleForceCertAddChange(checked);
                            }
                          }
                        )
                      }
                    ) })
                  ] }) })
                ] })
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(GridItem, { span: 12, children: [
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { title: _79("Upload the contents of a PEM file from the client's system."), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                Radio,
                {
                  id: "certRadioUpload",
                  label: certTextLabel,
                  name: "certChoice",
                  onChange: handleRadioChange,
                  isChecked: certRadioUpload
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: certRadioUpload ? "ds-margin-top ds-radio-indent" : "ds-margin-top ds-radio-indent ds-disabled", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                FileUpload,
                {
                  id: "uploadPEMFile",
                  type: "text",
                  value: uploadValue,
                  filename: uploadFileName,
                  filenamePlaceholder: _79("Drag and drop a file, or upload one"),
                  onFileInputChange: handleFileInputChange,
                  onDataChange: handleTextOrDataChange,
                  onTextChange: handleTextOrDataChange,
                  onReadStarted: handleFileReadStarted,
                  onReadFinished: handleFileReadFinished,
                  onClearClick: handleClear,
                  isLoading: uploadIsLoading,
                  dropzoneProps: {
                    accept: ".pem",
                    onDropRejected: handleFileRejected
                  },
                  validated: uploadIsRejected || certRadioUpload && uploadValue === "" || certRadioUpload && badCertText ? "error" : "default",
                  browseButtonText: _79("Upload PEM File")
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { title: _79("Choose a certificate from the server's certificate directory"), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                Radio,
                {
                  id: "certRadioSelect",
                  className: "ds-margin-top-lg",
                  label: _79("Choose Certificate From Server"),
                  name: "certChoice",
                  isChecked: certRadioSelect,
                  onChange: handleRadioChange
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: certRadioSelect ? "ds-margin-top ds-radio-indent" : "ds-margin-top ds-radio-indent ds-disabled", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
                FormSelect,
                {
                  value: selectCertName,
                  id: "selectCertName",
                  onChange: (e, str) => {
                    handleCertSelect(str);
                  },
                  "aria-label": "FormSelect Input",
                  className: "ds-cert-select",
                  validated: selectValidated,
                  children: [
                    certNames.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                      FormSelectOption,
                      {
                        value: "",
                        label: _79("No certificates present"),
                        isDisabled: true,
                        isPlaceholder: true
                      },
                      "none"
                    ),
                    certNames.length > 0 && certNames.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                      FormSelectOption,
                      {
                        value: option,
                        label: option
                      },
                      index
                    ))
                  ]
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { title: _79("Enter the full path on the server to and including the certificate file name"), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                Radio,
                {
                  id: "certRadioFile",
                  className: "ds-margin-top-lg",
                  label: _79("Certificate File Location"),
                  name: "certChoice",
                  isChecked: certRadioFile,
                  onChange: handleRadioChange
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: certRadioFile ? "ds-margin-top ds-radio-indent" : "ds-margin-top ds-radio-indent ds-disabled", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                TextInput,
                {
                  type: "text",
                  id: "certFile",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "certFile",
                  onChange: (e, value) => {
                    handleChange(e);
                  },
                  validated: certRadioFile && certFile === "" ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }) })
          ] })
        }
      );
    }
  };
  var SecurityAddCACertModal = class extends import_react149.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        spinning,
        certName,
        certFile,
        certRadioFile,
        certRadioSelect,
        certRadioUpload,
        handleRadioChange,
        badCertText,
        certNames,
        certNicknames,
        CACertNicknames,
        // Select server cert
        handleCertSelect,
        selectCertName,
        // File Upload
        uploadValue,
        uploadFileName,
        uploadIsLoading,
        uploadIsRejected,
        handleFileInputChange,
        handleTextOrDataChange,
        handleFileReadStarted,
        handleFileReadFinished,
        handleClear,
        handleFileRejected
      } = this.props;
      let saveBtnName = _79("Add Certificate");
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = _79("Adding Certificate ...");
        extraPrimaryProps.spinnerAriaValueText = _79("Saving");
      }
      const certTextLabel = /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
        Tooltip,
        {
          content: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: _79('Paste the base64 encoded certificate that starts with "-----BEGIN CERTIFICATE-----" and ends with "-----END CERTIFICATE-----".  Make sure there are no special carriage return characters after each line.') }),
          children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { children: [
            _79("Upload PEM File, or Certificate Text"),
            " ",
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_outlined_question_circle_icon4.OutlinedQuestionCircleIcon, {})
          ] })
        }
      ) });
      let title = _79("Add Certificate Authority");
      let desc = _79("Add a CA Certificate to the security database.");
      let selectValidated = ValidatedOptions.default;
      if (certRadioSelect && certNames.length === 0) {
        selectValidated = ValidatedOptions.error;
      }
      return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title,
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Button,
              {
                variant: "primary",
                onClick: () => {
                  saveHandler(true);
                },
                isLoading: spinning,
                spinnerAriaValueText: spinning ? _79("Saving") : void 0,
                ...extraPrimaryProps,
                isDisabled: certName === "" || certRadioFile && certFile === "" || certRadioUpload && (uploadValue === "" || badCertText) || certRadioSelect && certNames.length === 0 || certNicknames.includes(certName) || CACertNicknames.includes(certName),
                children: saveBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Button, { variant: "link", onClick: closeHandler, children: _79("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Text, { component: TextVariants.h4, children: desc }) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
              Grid,
              {
                className: "ds-margin-top-sm",
                title: _79("Enter name/nickname of the certificate"),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { className: "ds-label", span: 3, children: _79("Certificate Nickname") }),
                  /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(GridItem, { span: 9, children: [
                    /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                      TextInput,
                      {
                        type: "text",
                        id: "certName",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "certName",
                        onChange: (e, str) => {
                          handleChange(e);
                        },
                        validated: certName === "" || certNicknames.includes(certName) || CACertNicknames.includes(certName) ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ),
                    (certNicknames.includes(certName) || CACertNicknames.includes(certName)) && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(HelperTextItem, { variant: "error", children: _79("Please use a unique certificate nickname") }) })
                  ] })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Grid, { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(GridItem, { span: 12, children: [
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { title: _79("Upload the contents of a PEM file from the client's system."), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                Radio,
                {
                  id: "certRadioUpload",
                  label: certTextLabel,
                  name: "certChoice",
                  onChange: handleRadioChange,
                  isChecked: certRadioUpload
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: certRadioUpload ? "ds-margin-top ds-radio-indent" : "ds-margin-top ds-radio-indent ds-disabled", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                FileUpload,
                {
                  id: "uploadPEMFile",
                  type: "text",
                  value: uploadValue,
                  filename: uploadFileName,
                  filenamePlaceholder: _79("Drag and drop a file, or upload one"),
                  onFileInputChange: handleFileInputChange,
                  onDataChange: handleTextOrDataChange,
                  onTextChange: handleTextOrDataChange,
                  onReadStarted: handleFileReadStarted,
                  onReadFinished: handleFileReadFinished,
                  onClearClick: handleClear,
                  isLoading: uploadIsLoading,
                  dropzoneProps: {
                    accept: ".pem",
                    onDropRejected: handleFileRejected
                  },
                  validated: uploadIsRejected || certRadioUpload && uploadValue === "" || certRadioUpload && badCertText ? "error" : "default",
                  browseButtonText: _79("Upload PEM File")
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { title: _79("Choose a certificate from the server's certificate directory"), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                Radio,
                {
                  id: "certRadioSelect",
                  className: "ds-margin-top-lg",
                  label: _79("Choose Certificate From Server"),
                  name: "certChoice",
                  isChecked: certRadioSelect,
                  onChange: handleRadioChange
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: certRadioSelect ? "ds-margin-top ds-radio-indent" : "ds-margin-top ds-radio-indent ds-disabled", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
                FormSelect,
                {
                  value: selectCertName,
                  id: "selectCertName",
                  onChange: (e, str) => {
                    handleCertSelect(str);
                  },
                  "aria-label": "FormSelect Input",
                  className: "ds-cert-select",
                  validated: selectValidated,
                  children: [
                    certNames.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                      FormSelectOption,
                      {
                        value: "",
                        label: _79("No certificates present"),
                        isDisabled: true,
                        isPlaceholder: true
                      },
                      "none"
                    ),
                    certNames.length > 0 && certNames.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                      FormSelectOption,
                      {
                        value: option,
                        label: option
                      },
                      index
                    ))
                  ]
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { title: _79("Enter the full path on the server to and including the certificate file name"), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                Radio,
                {
                  id: "certRadioFile",
                  className: "ds-margin-top-lg",
                  label: _79("Certificate File Location"),
                  name: "certChoice",
                  isChecked: certRadioFile,
                  onChange: handleRadioChange
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: certRadioFile ? "ds-margin-top ds-radio-indent" : "ds-margin-top ds-radio-indent ds-disabled", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                TextInput,
                {
                  type: "text",
                  id: "certFile",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "certFile",
                  onChange: (e, value) => {
                    handleChange(e);
                  },
                  validated: certRadioFile && certFile === "" ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }) })
          ] })
        }
      );
    }
  };
  var EMPTY_OPTIONS = [];
  var SecurityAddCSRModal = class extends import_react149.default.Component {
    constructor() {
      super(...arguments);
      __publicField(this, "validateCreateHostname", (hostname) => {
        return validHostname(hostname) !== null;
      });
    }
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        previewValue,
        spinning,
        csrName,
        csrAltNames,
        csrIsSelectOpen,
        handleOnToggle,
        handleOnSelect,
        error
      } = this.props;
      let saveBtnName = _79("Create Certificate Signing Request");
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = _79("Creating Certificate Signing Request ...");
        extraPrimaryProps.spinnerAriaValueText = _79("Saving");
      }
      let validAltNames = true;
      let invalidNames = "";
      for (const hostname of csrAltNames) {
        if (!validHostname(hostname)) {
          validAltNames = false;
          if (invalidNames === "") {
            invalidNames += '"' + hostname + '"';
          } else {
            invalidNames += ', "' + hostname + '"';
          }
        }
      }
      return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title: _79("Create Certificate Signing Request"),
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Button,
              {
                variant: "primary",
                onClick: saveHandler,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? _79("Saving") : void 0,
                ...extraPrimaryProps,
                isDisabled: error.csrName || bad_file_name(csrName) || error.csrSubjectCommonName || spinning || !validAltNames,
                children: saveBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Button, { variant: "link", onClick: closeHandler, children: _79("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Form, { className: "ds-margin-top", isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Grid, { title: _79("CSR Name"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { className: "ds-label", span: 3, children: _79("Name") }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                TextInput,
                {
                  title: _79("Name used to identify a CSR"),
                  type: "text",
                  id: "csrName",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "csrName",
                  onChange: (e, str) => {
                    handleChange(e);
                  },
                  validated: error.csrName || bad_file_name(csrName) ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Grid, { title: _79("CSR Subject alternative host names"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { className: "ds-label", span: 3, children: _79("Subject Alternative Names") }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(GridItem, { span: 9, children: [
                /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                  dsBasicComponents_default,
                  {
                    selected: csrAltNames,
                    onSelect: handleOnSelect,
                    options: EMPTY_OPTIONS,
                    isOpen: csrIsSelectOpen,
                    onToggle: handleOnToggle,
                    placeholder: _79("Type an alternative host name"),
                    ariaLabel: "Type a host name",
                    isMulti: true,
                    isCreatable: true,
                    validateCreate: this.validateCreateHostname,
                    validated: validAltNames ? "default" : "error"
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: validAltNames ? "ds-hidden" : "", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(HelperTextItem, { variant: "error", children: [
                  _79("Invalid host names: "),
                  invalidNames
                ] }) }) })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Divider, {}),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Grid, { title: _79("CSR Subject: Common Name"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { className: "ds-label", span: 3, children: _79("Common Name (CN)") }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                TextInput,
                {
                  title: _79("The fully qualified domain name (FQDN) of your server"),
                  type: "text",
                  id: "csrSubjectCommonName",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "csrSubjectCommonName",
                  onChange: (e, str) => {
                    handleChange(e);
                  },
                  validated: error.csrSubjectCommonName ? ValidatedOptions.error : ValidatedOptions.default
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Grid, { title: _79("CSR Subject: Organisation"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { className: "ds-label", span: 3, children: _79("Organization (O)") }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                TextInput,
                {
                  title: _79("The legal name of your organization"),
                  type: "text",
                  id: "csrSubjectOrg",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "csrSubjectOrg",
                  onChange: (e, str) => {
                    handleChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Grid, { title: _79("CSR Subject: Organisational Unit"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { className: "ds-label", span: 3, children: _79("Organizational Unit (OU)") }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                TextInput,
                {
                  title: _79("The division of your organization handling the certificate"),
                  type: "text",
                  id: "csrSubjectOrgUnit",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "csrSubjectOrgUnit",
                  onChange: (e, str) => {
                    handleChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Grid, { title: _79("CSR Subject: City/Locality"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { className: "ds-label", span: 3, children: _79("City/Locality (L)") }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                TextInput,
                {
                  title: _79("The city where your organization is located"),
                  type: "text",
                  id: "csrSubjectLocality",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "csrSubjectLocality",
                  onChange: (e, str) => {
                    handleChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Grid, { title: _79("CSR Subject: State/Region"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { className: "ds-label", span: 3, children: _79("State/County/Region (ST)") }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                TextInput,
                {
                  title: _79("The state/region where your organization is located"),
                  type: "text",
                  id: "csrSubjectState",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "csrSubjectState",
                  onChange: (e, str) => {
                    handleChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Grid, { title: _79("CSR Subject: Country Code"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { className: "ds-label", span: 3, children: _79("Country Code (C)") }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                TextInput,
                {
                  title: _79("Two-letter country code where organization is located"),
                  type: "text",
                  id: "csrSubjectCountry",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "csrSubjectCountry",
                  onChange: (e, str) => {
                    handleChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Grid, { title: _79("CSR Subject: Email Address"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { className: "ds-label", span: 3, children: _79("Email Address") }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                TextInput,
                {
                  title: _79("Email address used to contact your organization"),
                  type: "text",
                  id: "csrSubjectEmail",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "csrSubjectEmail",
                  onChange: (e, str) => {
                    handleChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Divider, {}),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 3, children: _79("Computed Subject") }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("b", { children: previewValue }) })
            ] })
          ] })
        }
      );
    }
  };
  var SecurityViewCSRModal = class extends import_react149.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        item,
        name: name2
      } = this.props;
      return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title: name2 + ".csr",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Button, { variant: "link", onClick: closeHandler, children: _79("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(TextContent, { title: _79("CSR content"), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Text, { component: TextVariants.pre, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Text, { component: TextVariants.small, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ClipboardCopy, { hoverTip: _79("Copy to clipboard"), clickTip: "Copied", variant: ClipboardCopyVariant.expansion, isBlock: true, children: item || _79("Nothing to display") }) }) }) })
        }
      );
    }
  };
  var SecurityEnableModal = class extends import_react149.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        primaryName,
        certs,
        spinning
      } = this.props;
      const certNames = [];
      for (const cert of certs) {
        certNames.push(cert.attrs.nickname);
      }
      let saveBtnName = _79("Enable Security");
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = _79("Enabling Security ...");
        extraPrimaryProps.spinnerAriaValueText = _79("Saving");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
        Modal,
        {
          variant: ModalVariant.small,
          "aria-labelledby": "ds-modal",
          title: _79("Enable Security"),
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Button,
              {
                variant: "primary",
                onClick: saveHandler,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? _79("Saving") : void 0,
                ...extraPrimaryProps,
                isDisabled: spinning,
                children: saveBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Button, { variant: "link", onClick: closeHandler, children: _79("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Text, { component: TextVariants.h4, children: _79("You are choosing to enable security for the Directory Server which allows the server to accept incoming client TLS connections.  Please select which certificate the server should use.") }) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("hr", {}),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Grid, { className: "ds-margin-top", title: _79("The server certificates the Directory Server can use"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { className: "ds-label", span: 4, children: _79("Available Certificates") }),
              /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { sm: 8, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
                FormSelect,
                {
                  value: primaryName,
                  id: "certNameSelect",
                  onChange: (e, str) => {
                    handleChange(e);
                  },
                  "aria-label": "FormSelect Input",
                  children: certNames.map((option) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(FormSelectOption, { value: option, label: option }, option))
                }
              ) })
            ] })
          ] })
        }
      );
    }
  };
  var EditCertModal = class extends import_react149.default.Component {
    render() {
      const {
        showModal,
        closeHandler,
        handleChange,
        saveHandler,
        flags,
        spinning
      } = this.props;
      let saveBtnName = _79("Save Flags");
      const extraPrimaryProps = {};
      if (spinning) {
        saveBtnName = _79("Saving flags ...");
        extraPrimaryProps.spinnerAriaValueText = _79("Saving");
      }
      let CSSLChecked = false;
      let CEmailChecked = false;
      let COSChecked = false;
      let TSSLChecked = false;
      let TEmailChecked = false;
      let TOSChecked = false;
      let cSSLChecked = false;
      let cEmailChecked = false;
      let cOSChecked = false;
      let PSSLChecked = false;
      let PEmailChecked = false;
      let POSChecked = false;
      let pSSLChecked = false;
      let pEmailChecked = false;
      let pOSChecked = false;
      let uSSLChecked = false;
      let uEmailChecked = false;
      let uOSChecked = false;
      let SSLFlags = "";
      let EmailFlags = "";
      let OSFlags = "";
      if (flags !== "") {
        [SSLFlags, EmailFlags, OSFlags] = flags.split(",");
        if (SSLFlags.includes("T")) {
          TSSLChecked = true;
        }
        if (EmailFlags.includes("T")) {
          TEmailChecked = true;
        }
        if (OSFlags.includes("T")) {
          TOSChecked = true;
        }
        if (SSLFlags.includes("C")) {
          CSSLChecked = true;
        }
        if (EmailFlags.includes("C")) {
          CEmailChecked = true;
        }
        if (OSFlags.includes("C")) {
          COSChecked = true;
        }
        if (SSLFlags.includes("c")) {
          cSSLChecked = true;
        }
        if (EmailFlags.includes("c")) {
          cEmailChecked = true;
        }
        if (OSFlags.includes("c")) {
          cOSChecked = true;
        }
        if (SSLFlags.includes("P")) {
          PSSLChecked = true;
        }
        if (EmailFlags.includes("P")) {
          PEmailChecked = true;
        }
        if (OSFlags.includes("P")) {
          POSChecked = true;
        }
        if (SSLFlags.includes("p")) {
          pSSLChecked = true;
        }
        if (EmailFlags.includes("p")) {
          pEmailChecked = true;
        }
        if (OSFlags.includes("p")) {
          pOSChecked = true;
        }
        if (SSLFlags.includes("u")) {
          uSSLChecked = true;
        }
        if (EmailFlags.includes("u")) {
          uEmailChecked = true;
        }
        if (OSFlags.includes("u")) {
          uOSChecked = true;
        }
      }
      const title = _79("Edit Certificate Trust Flags (") + this.props.flags + ")";
      return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          "aria-labelledby": "ds-modal",
          title,
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Button,
              {
                variant: "primary",
                onClick: saveHandler,
                isLoading: spinning,
                spinnerAriaValueText: spinning ? _79("Saving") : void 0,
                ...extraPrimaryProps,
                isDisabled: this.props.disableSaveBtn || spinning,
                children: saveBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Button, { variant: "link", onClick: closeHandler, children: _79("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 6, children: _79("Flags") }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: _79("SSL") }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: _79("Email") }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: _79("Object Signing") }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("hr", {}),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 6, title: _79("Trusted CA (flag 'C', also implies 'c' flag)"), children: _79("(C) - Trusted CA") }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "CflagSSL",
                isChecked: CSSLChecked,
                onChange: (e, checked) => {
                  handleChange(e);
                }
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "CflagEmail",
                isChecked: CEmailChecked,
                onChange: (e, checked) => {
                  handleChange(e);
                }
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "CflagOS",
                isChecked: COSChecked,
                onChange: (e, checked) => {
                  handleChange(e);
                }
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 6, title: _79("Trusted CA for client authentication (flag 'T')"), children: _79("(T) - Trusted CA Client Auth") }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "TflagSSL",
                isChecked: TSSLChecked,
                onChange: (e, checked) => {
                  handleChange(e);
                }
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "TflagEmail",
                isChecked: TEmailChecked,
                onChange: (e, checked) => {
                  handleChange(e);
                }
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "TflagOS",
                isChecked: TOSChecked,
                onChange: (e, checked) => {
                  handleChange(e);
                }
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 6, title: _79("Valid CA (flag 'c')"), children: _79("(c) - Valid CA") }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "cflagSSL",
                isChecked: cSSLChecked,
                onChange: (e, checked) => {
                  handleChange(e);
                }
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "cflagEmail",
                isChecked: cEmailChecked,
                onChange: (e, checked) => {
                  handleChange(e);
                }
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "cflagOS",
                isChecked: cOSChecked,
                onChange: (e, checked) => {
                  handleChange(e);
                }
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 6, title: _79("Trusted Peer (flag 'P', implies flag 'p')"), children: _79("(P) - Trusted Peer") }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "PflagSSL",
                isChecked: PSSLChecked,
                onChange: (e, checked) => {
                  handleChange(e);
                }
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "PflagEmail",
                isChecked: PEmailChecked,
                onChange: (e, checked) => {
                  handleChange(e);
                }
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "PflagOS",
                isChecked: POSChecked,
                onChange: (e, checked) => {
                  handleChange(e);
                }
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 6, title: _79("Valid Peer (flag 'p')"), children: _79("(p) - Valid Peer") }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "pflagSSL",
                isChecked: pSSLChecked,
                onChange: (e, checked) => {
                  handleChange(e);
                }
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "pflagEmail",
                isChecked: pEmailChecked,
                onChange: (e, checked) => {
                  handleChange(e);
                }
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "pflagOS",
                isChecked: pOSChecked,
                onChange: (e, checked) => {
                  handleChange(e);
                }
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("hr", {}),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 6, title: _79("A private key is associated with the certificate. This is a dynamic flag and you cannot adjust it."), children: _79("(u) - Private Key") }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "uflagSSL",
                isChecked: uSSLChecked,
                isDisabled: true
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "uflagEmail",
                isChecked: uEmailChecked,
                isDisabled: true
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
              Checkbox,
              {
                id: "uflagOS",
                isChecked: uOSChecked,
                isDisabled: true
              }
            ) })
          ] })
        }
      );
    }
  };
  SecurityEnableModal.propTypes = {
    showModal: import_prop_types77.default.bool,
    closeHandler: import_prop_types77.default.func,
    handleChange: import_prop_types77.default.func,
    saveHandler: import_prop_types77.default.func,
    primaryName: import_prop_types77.default.string,
    certs: import_prop_types77.default.array,
    spinning: import_prop_types77.default.bool
  };
  SecurityEnableModal.defaultProps = {
    showModal: false,
    primaryName: "",
    certs: [],
    spinning: false
  };
  EditCertModal.propTypes = {
    showModal: import_prop_types77.default.bool,
    closeHandler: import_prop_types77.default.func,
    handleChange: import_prop_types77.default.func,
    saveHandler: import_prop_types77.default.func,
    flags: import_prop_types77.default.string,
    spinning: import_prop_types77.default.bool
  };
  EditCertModal.defaultProps = {
    showModal: false,
    flags: "",
    spinning: false
  };
  ExportCertModal.propTypes = {
    showModal: import_prop_types77.default.bool,
    closeHandler: import_prop_types77.default.func,
    handleChange: import_prop_types77.default.func,
    saveHandler: import_prop_types77.default.func,
    binaryFormat: import_prop_types77.default.bool,
    fileName: import_prop_types77.default.string,
    spinning: import_prop_types77.default.bool
  };
  ExportCertModal.defaultProps = {
    showModal: false,
    fileName: "",
    binaryFormat: false,
    spinning: false
  };
  SecurityAddCertModal.propTypes = {
    showModal: import_prop_types77.default.bool,
    closeHandler: import_prop_types77.default.func,
    handleChange: import_prop_types77.default.func,
    saveHandler: import_prop_types77.default.func,
    spinning: import_prop_types77.default.bool,
    error: import_prop_types77.default.object
  };
  SecurityAddCertModal.defaultProps = {
    showModal: false,
    spinning: false,
    saveHandler: () => {
    },
    error: {}
  };
  SecurityAddCACertModal.propTypes = {
    showModal: import_prop_types77.default.bool,
    closeHandler: import_prop_types77.default.func,
    handleChange: import_prop_types77.default.func,
    saveHandler: import_prop_types77.default.func,
    spinning: import_prop_types77.default.bool,
    error: import_prop_types77.default.object
  };
  SecurityAddCACertModal.defaultProps = {
    showModal: false,
    spinning: false,
    saveHandler: () => {
    },
    error: {}
  };
  SecurityAddCSRModal.propTypes = {
    showModal: import_prop_types77.default.bool,
    closeHandler: import_prop_types77.default.func,
    handleChange: import_prop_types77.default.func,
    saveHandler: import_prop_types77.default.func,
    spinning: import_prop_types77.default.bool,
    error: import_prop_types77.default.object
  };
  SecurityAddCSRModal.defaultProps = {
    showModal: false,
    spinning: false,
    error: {}
  };
  SecurityViewCSRModal.propTypes = {
    showModal: import_prop_types77.default.bool,
    closeHandler: import_prop_types77.default.func
  };
  SecurityViewCSRModal.defaultProps = {
    showModal: false,
    spinning: false
  };

  // src/lib/security/certificateManagement.jsx
  var import_prop_types78 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime80 = __toESM(require_jsx_runtime(), 1);
  var _80 = cockpit_default.gettext;
  var CertificateManagement = class extends import_react150.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: 0,
        ServerCerts: this.props.ServerCerts,
        CACerts: this.props.CACerts,
        ServerCSRs: this.props.ServerCSRs,
        ServerKeys: this.props.ServerKeys,
        certNicknames: this.props.certNicknames,
        CACertNicknames: this.props.CACertNicknames,
        tableKey: 0,
        showEditModal: false,
        showAddModal: false,
        showAddCAModal: false,
        showAddCSRModal: false,
        showViewCSRModal: false,
        modalSpinning: false,
        showConfirmDelete: false,
        showCSRConfirmDelete: false,
        showKeyConfirmDelete: false,
        showExportModal: false,
        certName: "",
        certFile: "",
        csrContent: "",
        csrName: "",
        csrAltNames: [],
        csrIsSelectOpen: false,
        csrSubject: "",
        csrSubjectCommonName: "",
        csrSubjectOrg: "",
        csrSubjectOrgUnit: "",
        csrSubjectLocality: "",
        csrSubjectState: "",
        csrSubjectCountry: "",
        csrSubjectEmail: "",
        keyID: "",
        flags: "",
        _flags: "",
        errObj: {},
        isCACert: false,
        showConfirmCAChange: false,
        loading: false,
        modalChecked: false,
        disableSaveBtn: true,
        exportNickname: "",
        exportDERFormat: false,
        exportFileName: "",
        certRadioFile: false,
        certRadioSelect: false,
        certRadioUpload: true,
        availCertNames: [],
        selectCertName: "",
        isSelectCertOpen: false,
        // Upload PEM file
        uploadValue: "",
        uploadFileName: "",
        uploadIsLoading: false,
        uploadIsRejected: false,
        // PKCS#12 Password options
        pkcs12PinMethod: "noPassword",
        pkcs12PinFile: "",
        pkcs12PinText: "",
        forceCertAdd: false
      };
      this.onFileInputChange = (e, file) => {
        this.setState({
          uploadFile: file.name
        });
      };
      this.onTextOrDataChange = (e, value) => {
        this.setState({
          uploadValue: value.trim()
        }, () => this.validateCertText());
      };
      this.onFileReadStarted = () => {
        this.setState({
          uploadIsLoading: true
        });
      };
      this.onFileReadFinished = () => {
        this.setState({
          uploadIsLoading: false
        });
      };
      this.onClear = () => {
        this.setState({
          uploadValue: "",
          uploadFileName: "",
          uploadIsRejected: false
        });
      };
      this.handleFileRejected = () => {
        this.setState({
          uploadIsRejected: true
        });
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.sortFlags = (str) => {
        const flags = str.split("");
        const sorted_flags = flags.sort();
        return sorted_flags.join("");
      };
      this.onCertSelect = (value) => {
        this.setState({
          selectCertName: value
        });
      };
      this.csrOnSelect = (e, selection) => {
        this.setState({
          csrAltNames: Array.isArray(selection) ? selection : []
        });
      };
      this.csrOnToggle = (isOpen) => {
        this.setState({
          csrIsSelectOpen: isOpen
        });
      };
      this.onChange = this.onChange.bind(this);
      this.onCSRChange = this.onCSRChange.bind(this);
      this.addCert = this.addCert.bind(this);
      this.showAddModal = this.showAddModal.bind(this);
      this.showAddCAModal = this.showAddCAModal.bind(this);
      this.closeAddModal = this.closeAddModal.bind(this);
      this.closeAddCAModal = this.closeAddCAModal.bind(this);
      this.showAddCSRModal = this.showAddCSRModal.bind(this);
      this.closeAddCSRModal = this.closeAddCSRModal.bind(this);
      this.showViewCSRModal = this.showViewCSRModal.bind(this);
      this.closeViewCSRModal = this.closeViewCSRModal.bind(this);
      this.showEditModal = this.showEditModal.bind(this);
      this.closeEditModal = this.closeEditModal.bind(this);
      this.showEditCAModal = this.showEditCAModal.bind(this);
      this.onFlagChange = this.onFlagChange.bind(this);
      this.editCert = this.editCert.bind(this);
      this.doEditCert = this.doEditCert.bind(this);
      this.closeConfirmCAChange = this.closeConfirmCAChange.bind(this);
      this.showDeleteConfirm = this.showDeleteConfirm.bind(this);
      this.showCSRDeleteConfirm = this.showCSRDeleteConfirm.bind(this);
      this.showKeyDeleteConfirm = this.showKeyDeleteConfirm.bind(this);
      this.delCert = this.delCert.bind(this);
      this.addCSR = this.addCSR.bind(this);
      this.delCSR = this.delCSR.bind(this);
      this.showCSR = this.showCSR.bind(this);
      this.delKey = this.delKey.bind(this);
      this.closeConfirmDelete = this.closeConfirmDelete.bind(this);
      this.closeCSRConfirmDelete = this.closeCSRConfirmDelete.bind(this);
      this.closeKeyConfirmDelete = this.closeKeyConfirmDelete.bind(this);
      this.reloadCerts = this.reloadCerts.bind(this);
      this.reloadCACerts = this.reloadCACerts.bind(this);
      this.reloadCSRs = this.reloadCSRs.bind(this);
      this.reloadOrphanKeys = this.reloadOrphanKeys.bind(this);
      this.buildSubject = this.buildSubject.bind(this);
      this.showExportModal = this.showExportModal.bind(this);
      this.closeExportModal = this.closeExportModal.bind(this);
      this.exportCert = this.exportCert.bind(this);
      this.onRadioChange = this.onRadioChange.bind(this);
      this.validateCertText = this.validateCertText.bind(this);
      this.getCertFiles = this.getCertFiles.bind(this);
      this.onPkcs12PinMethodChange = this.onPkcs12PinMethodChange.bind(this);
      this.onPkcs12PinFileChange = this.onPkcs12PinFileChange.bind(this);
      this.onPkcs12PinTextChange = this.onPkcs12PinTextChange.bind(this);
      this.onForceCertAddChange = this.onForceCertAddChange.bind(this);
    }
    componentDidMount() {
      this.getCertFiles();
    }
    showAddModal() {
      this.setState({
        showAddModal: true,
        certFile: "",
        certName: "",
        uploadFile: "",
        uploadValue: "",
        uploadIsRejected: false,
        uploadIsLoading: false,
        certRadioFile: false,
        certRadioSelect: false,
        certRadioUpload: true,
        isSelectCertOpen: false,
        modalSpinning: false,
        pkcs12PinMethod: "noPassword",
        pkcs12PinFile: "",
        pkcs12PinText: "",
        forceCertAdd: false
      });
    }
    closeAddModal() {
      this.setState({
        showAddModal: false,
        pkcs12PinMethod: "noPassword",
        pkcs12PinFile: "",
        pkcs12PinText: "",
        forceCertAdd: false
      });
    }
    showAddCAModal() {
      this.setState({
        showAddCAModal: true,
        certFile: "",
        certName: "",
        uploadFile: "",
        uploadValue: "",
        uploadIsRejected: false,
        uploadIsLoading: false,
        certRadioFile: false,
        certRadioSelect: false,
        certRadioUpload: true,
        isSelectCertOpen: false,
        modalSpinning: false,
        pkcs12PinMethod: "noPassword",
        pkcs12PinFile: "",
        pkcs12PinText: "",
        forceCertAdd: false
      });
    }
    closeAddCAModal() {
      this.setState({
        showAddCAModal: false,
        pkcs12PinMethod: "noPassword",
        pkcs12PinFile: "",
        pkcs12PinText: "",
        forceCertAdd: false
      });
    }
    onRadioChange(e, _113) {
      let certRadioFile = false;
      let certRadioSelect = false;
      let certRadioUpload = false;
      if (e.target.id === "certRadioFile") {
        certRadioFile = true;
      } else if (e.target.id === "certRadioSelect") {
        certRadioSelect = true;
      } else if (e.target.id === "certRadioUpload") {
        certRadioUpload = true;
      }
      this.setState({
        certRadioFile,
        certRadioSelect,
        certRadioUpload
      });
    }
    onPkcs12PinMethodChange(e, _113) {
      let pkcs12PinMethod = "";
      if (e.target.id === "pkcs12PinRadioStdin") {
        pkcs12PinMethod = "stdin";
      } else if (e.target.id === "pkcs12PinRadioFile") {
        pkcs12PinMethod = "file";
      } else if (e.target.id === "noPasswordRadio") {
        pkcs12PinMethod = "noPassword";
      }
      this.setState({
        pkcs12PinMethod,
        pkcs12PinFile: "",
        pkcs12PinText: ""
      });
    }
    onPkcs12PinFileChange(value) {
      this.setState({
        pkcs12PinFile: value
      });
    }
    onPkcs12PinTextChange(value) {
      this.setState({
        pkcs12PinText: value
      });
    }
    onForceCertAddChange(checked) {
      this.setState({
        forceCertAdd: checked
      });
    }
    showAddCSRModal() {
      this.setState({
        showAddCSRModal: true,
        csrSubject: "",
        csrName: "",
        csrSubjectCommonName: "",
        csrSubjectOrg: "",
        csrSubjectOrgUnit: "",
        csrSubjectLocality: "",
        csrSubjectState: "",
        csrSubjectCountry: "",
        csrSubjectEmail: "",
        csrAltNames: [],
        errObj: { csrName: true, csrSubjectCommonName: true }
      });
    }
    closeAddCSRModal() {
      this.setState({
        showAddCSRModal: false,
        csrSubject: "",
        csrName: "",
        csrSubjectCommonName: "",
        csrSubjectOrg: "",
        csrSubjectOrgUnit: "",
        csrSubjectLocality: "",
        csrSubjectState: "",
        csrSubjectCountry: "",
        csrSubjectEmail: ""
      });
    }
    showViewCSRModal(name2) {
      this.showCSR(name2);
      this.setState({
        showViewCSRModal: true,
        csrName: name2,
        errObj: { csrName: true }
      });
    }
    closeViewCSRModal() {
      this.setState({
        showViewCSRModal: false
      });
    }
    showExportModal(nickname) {
      this.setState({
        showExportModal: true,
        exportNickname: nickname,
        exportDERFormat: false,
        exportFileName: ""
      });
    }
    closeExportModal() {
      this.setState({
        showExportModal: false,
        exportNickname: ""
      });
    }
    exportCert() {
      this.setState({
        modalSpinning: true
      });
      let exportFileName = this.state.exportFileName;
      if (this.state.exportDERFormat && !exportFileName.toLowerCase().endsWith(".crt")) {
        exportFileName += ".crt";
      }
      if (!this.state.exportDERFormat && !exportFileName.toLowerCase().endsWith(".pem")) {
        exportFileName += ".pem";
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "export-cert",
        this.state.exportNickname,
        "--output-file=" + exportFileName
      ];
      if (this.state.exportDERFormat) {
        cmd.push("--binary-format");
      }
      log_cmd("exportCert", "Exporting certificate", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
        this.getCertFiles();
        this.reloadCACerts();
        this.setState({
          showExportModal: false,
          exportNickname: "",
          modalSpinning: false
        });
        this.props.addNotification(
          "success",
          cockpit_default.format(_80("Successfully exported certificate as: $0"), exportFileName)
        );
      }).fail((err) => {
        const msg = getApiErrorMessage(err);
        this.setState({
          showExportModal: false,
          exportNickname: "",
          modalSpinning: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_80("Error exporting certificate - $0"), msg)
        );
      });
    }
    deleteTmpCert(filename) {
      const cmd = [
        "rm",
        filename
      ];
      log_cmd("deleteTmpCert", "deleting tmp cert file", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).fail((err) => {
        this.props.addNotification(
          "warning",
          cockpit_default.format(_80("Error deleting tmp certificate - $0"), err)
        );
      });
    }
    getCertFiles() {
      const cmd = [
        // '/bin/sh', '-c',
        "find",
        this.props.certDir,
        "-type",
        "f",
        "-name",
        "*.pem",
        "-o",
        "-name",
        "*.crt"
      ];
      log_cmd("getCertFiles", "creating tmp cert file for importing", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((certs_raw) => {
        const certs = certs_raw.split(/\r?\n/);
        const certNames = [];
        for (let i = 0, count = 0; i < certs.length; i++) {
          if (certs[i] !== "") {
            certNames[count] = certs[i].replace(this.props.certDir + "/", "");
            count++;
          }
        }
        certNames.sort();
        let selectCertName = "";
        if (certNames.length > 0) {
          selectCertName = certNames[0];
        }
        this.setState({
          availCertNames: certNames,
          selectCertName
        });
      }).fail((err) => {
        console.log("Failed to get cert file names: ", err);
      });
    }
    addCert(isCACert) {
      this.setState({
        modalSpinning: true,
        loading: true
      });
      let certType = "certificate";
      if (isCACert) {
        certType = "ca-certificate";
      }
      if (this.state.certRadioUpload && this.state.uploadValue) {
        const certFile = this.props.certDir + "/tmp-cert-" + Date.now() + ".tmp";
        const certText = this.state.uploadValue;
        const create_cert_cmd = [
          "/bin/sh",
          "-c",
          "/usr/bin/echo -e '" + certText + "' > " + certFile
        ];
        log_cmd("addCert", "creating tmp cert file for importing: ", create_cert_cmd);
        cockpit_default.spawn(create_cert_cmd, { superuser: true, err: "message" }).done(() => {
          const cmd = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "security",
            certType,
            "add",
            "--name=" + this.state.certName,
            "--file=" + certFile
          ];
          if (this.state.pkcs12PinMethod === "file" && this.state.pkcs12PinFile !== "") {
            cmd.push("--pkcs12-pin-path=" + this.state.pkcs12PinFile);
          } else if (this.state.pkcs12PinMethod === "stdin") {
            cmd.push("--pkcs12-pin-stdin");
          }
          if (this.state.forceCertAdd) {
            cmd.push("--do-it");
          }
          log_cmd("addCert", "Adding cert (tmp): ", cmd);
          if (this.state.pkcs12PinMethod === "stdin") {
            let buffer = "";
            const proc = cockpit_default.spawn(cmd, { pty: true, environ: ["LC_ALL=C"], superuser: true, err: "message" });
            proc.done(() => {
              this.deleteTmpCert(certFile);
              this.reloadCACerts();
              this.setState({
                showAddModal: false,
                modalSpinning: false,
                loading: false
              });
              this.reloadOrphanKeys();
              this.props.addNotification(
                "success",
                _80("Successfully added certificate")
              );
              this.closeAddCAModal();
              this.closeAddModal();
            }).fail((err) => {
              const msg = buffer ? getApiErrorMessage(buffer) : getApiErrorMessage(err);
              this.deleteTmpCert(certFile);
              this.closeAddCAModal();
              this.closeAddModal();
              this.setState({
                modalSpinning: false,
                loading: false
              });
              this.props.addNotification(
                "error",
                cockpit_default.format(_80("Error adding certificate - $0"), msg)
              );
            }).stream((data) => {
              buffer += data;
              const lines = buffer.split("\n");
              const last_line = lines[lines.length - 1].toLowerCase();
              if (last_line.includes("password") || last_line.includes("pin")) {
                proc.input(this.state.pkcs12PinText + "\n", true);
              }
            });
          } else {
            cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
              this.deleteTmpCert(certFile);
              this.reloadCACerts();
              this.setState({
                showAddModal: false,
                modalSpinning: false,
                loading: false
              });
              this.reloadOrphanKeys();
              this.props.addNotification(
                "success",
                _80("Successfully added certificate")
              );
              this.closeAddCAModal();
              this.closeAddModal();
            }).fail((err) => {
              const msg = getApiErrorMessage(err);
              this.deleteTmpCert(certFile);
              this.closeAddCAModal();
              this.closeAddModal();
              this.setState({
                modalSpinning: false,
                loading: false
              });
              this.props.addNotification(
                "error",
                cockpit_default.format(_80("Error adding certificate - $0"), msg)
              );
            });
          }
        }).fail((err) => {
          this.setState({
            modalSpinning: false,
            loading: false
          });
          this.props.addNotification(
            "error",
            cockpit_default.format(_80("Failed to create temporary certificate file: $0"), err)
          );
        });
      } else {
        const cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "security",
          certType,
          "add",
          "--name=" + this.state.certName
        ];
        if (this.state.certRadioFile) {
          cmd.push("--file=" + this.state.certFile);
        } else {
          cmd.push("--file=" + this.props.certDir + "/" + this.state.selectCertName);
        }
        if (this.state.pkcs12PinMethod === "file" && this.state.pkcs12PinFile !== "") {
          cmd.push("--pkcs12-pin-path=" + this.state.pkcs12PinFile);
        } else if (this.state.pkcs12PinMethod === "stdin") {
          cmd.push("--pkcs12-pin-stdin");
        }
        if (this.state.forceCertAdd) {
          cmd.push("--do-it");
        }
        log_cmd("addCert", "Adding cert: ", cmd);
        if (this.state.pkcs12PinMethod === "stdin") {
          let buffer = "";
          const proc = cockpit_default.spawn(cmd, { pty: true, environ: ["LC_ALL=C"], superuser: true, err: "message" });
          proc.done(() => {
            this.reloadCACerts();
            this.closeAddCAModal();
            this.closeAddModal();
            this.setState({
              showAddModal: false,
              certFile: "",
              certName: "",
              modalSpinning: false
            });
            this.reloadOrphanKeys();
            this.props.addNotification(
              "success",
              _80("Successfully added certificate")
            );
          }).fail((err) => {
            const msg = buffer ? getApiErrorMessage(buffer) : getApiErrorMessage(err);
            this.closeAddCAModal();
            this.closeAddModal();
            this.setState({
              modalSpinning: false,
              loading: false
            });
            this.props.addNotification(
              "error",
              cockpit_default.format(_80("Error adding certificate - $0"), msg)
            );
          }).stream((data) => {
            buffer += data;
            const lines = buffer.split("\n");
            const last_line = lines[lines.length - 1].toLowerCase();
            if (last_line.includes("password") || last_line.includes("pin")) {
              proc.input(this.state.pkcs12PinText + "\n", true);
            }
          });
        } else {
          cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
            this.reloadCACerts();
            this.closeAddCAModal();
            this.closeAddModal();
            this.setState({
              showAddModal: false,
              certFile: "",
              certName: "",
              modalSpinning: false
            });
            this.reloadOrphanKeys();
            this.props.addNotification(
              "success",
              _80("Successfully added certificate")
            );
          }).fail((err) => {
            const msg = getApiErrorMessage(err);
            this.closeAddCAModal();
            this.closeAddModal();
            this.setState({
              modalSpinning: false,
              loading: false
            });
            this.props.addNotification(
              "error",
              cockpit_default.format(_80("Error adding certificate - $0"), msg)
            );
          });
        }
      }
    }
    addCSR() {
      this.setState({
        modalSpinning: true,
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "csr",
        "req",
        "--name=" + this.state.csrName,
        "--subject=" + this.state.csrSubject
      ];
      for (const altname of this.state.csrAltNames) {
        cmd.push(altname);
      }
      log_cmd("addCSR", "Creating CSR", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
        this.reloadCSRs();
        this.setState({
          showAddCSRModal: false,
          csrSubject: "",
          csrName: "",
          modalSpinning: false
        });
        this.props.addNotification(
          "success",
          _80("Successfully created CSR")
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        if (errMsg.includes("certutil -s: improperly formatted name:")) {
          this.props.addNotification(
            "error",
            _80("Error Improperly formatted subject")
          );
        } else {
          this.props.addNotification(
            "error",
            cockpit_default.format(_80("Error creating CSR - $0"), errMsg)
          );
        }
        this.setState({
          modalSpinning: false,
          loading: false
        });
      });
    }
    showCSR(name2) {
      if (name2 === "") {
        this.props.addNotification(
          "warning",
          _80("Missing CSR Name")
        );
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "csr",
        "get",
        name2
      ];
      log_cmd("showCSR", "Displaying CSR", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.setState({
          csrContent: content,
          showViewCSRModal: true
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_80("Error displaying CSR - $0"), errMsg)
        );
      });
    }
    showDeleteConfirm(nickname) {
      this.setState({
        showConfirmDelete: true,
        certName: nickname,
        modalSpinning: false,
        modalChecked: false
      });
    }
    showCSRDeleteConfirm(name2) {
      this.setState({
        showCSRConfirmDelete: true,
        csrName: name2,
        modalSpinning: false,
        modalChecked: false
      });
    }
    showKeyDeleteConfirm(key_id) {
      this.setState({
        showKeyConfirmDelete: true,
        keyID: key_id,
        modalSpinning: false,
        modalChecked: false
      });
    }
    delCert() {
      this.setState({
        modalSpinning: true,
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "certificate",
        "del",
        this.state.certName
      ];
      log_cmd("delCert", "Deleting certificate", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
        this.reloadCACerts();
        this.setState({
          certName: "",
          modalSpinning: false,
          showConfirmDelete: false
        });
        this.props.addNotification(
          "success",
          _80("Successfully deleted certificate")
        );
      }).fail((err) => {
        const msg = getApiErrorMessage(err);
        this.setState({
          certName: "",
          modalSpinning: false,
          loading: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_80("Error deleting certificate - $0"), msg)
        );
      });
    }
    delCSR(name2) {
      this.setState({
        modalSpinning: true,
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "csr",
        "del",
        this.state.csrName
      ];
      log_cmd("delCSR", "Deleting CSR", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
        this.reloadCSRs();
        this.setState({
          csrName: "",
          csrSubject: "",
          modalSpinning: false,
          showCSRConfirmDelete: false
        });
        this.props.addNotification(
          "success",
          _80("Successfully deleted CSR")
        );
      }).fail((err) => {
        const msg = getApiErrorMessage(err);
        this.setState({
          csrName: "",
          csrSubject: "",
          modalSpinning: false,
          loading: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_80("Error deleting CSR - $0"), msg)
        );
      });
    }
    delKey(name2) {
      this.setState({
        modalSpinning: true,
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "key",
        "del",
        this.state.keyID
      ];
      log_cmd("delKey", "Deleting key", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
        this.reloadOrphanKeys();
        this.setState({
          keyID: "",
          modalSpinning: false,
          showKeyConfirmDelete: false
        });
        this.props.addNotification(
          "success",
          _80("Successfully deleted key")
        );
      }).fail((err) => {
        const msg = getApiErrorMessage(err);
        this.setState({
          keyID: "",
          modalSpinning: false,
          loading: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_80("Error deleting key - $0"), msg)
        );
      });
    }
    showEditModal(name2, flags) {
      this.setState({
        showEditModal: true,
        certName: name2,
        flags,
        isCACert: false
      });
    }
    closeEditModal() {
      this.setState({
        showEditModal: false,
        flags: ""
      });
    }
    showEditCAModal(nickname, flags) {
      this.setState({
        showEditModal: true,
        certName: nickname,
        flags,
        _flags: flags,
        isCACert: true
      });
    }
    editCert() {
      if (this.state.isCACert) {
        let SSLFlags = "";
        SSLFlags = this.state.flags.split(",", 1);
        if (!SSLFlags[0].includes("C") || !SSLFlags[0].includes("T")) {
          this.setState({
            showConfirmCAChange: true,
            modalSpinning: false,
            modalChecked: false
          });
          return;
        }
      }
      this.doEditCert();
    }
    closeConfirmCAChange() {
      this.setState({
        showConfirmCAChange: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    doEditCert() {
      this.setState({
        modalSpinning: true,
        loading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "certificate",
        "set-trust-flags",
        this.state.certName,
        "--flags=" + this.state.flags
      ];
      log_cmd("doEditCert", "Editing trust flags", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
        this.reloadCACerts();
        this.setState({
          showEditModal: false,
          flags: "",
          certName: "",
          modalSpinning: false
        });
        this.props.addNotification(
          "success",
          _80("Successfully changed certificate's trust flags")
        );
      }).fail((err) => {
        const msg = getApiErrorMessage(err);
        this.setState({
          showEditModal: false,
          flags: "",
          certName: "",
          modalSpinning: false,
          loading: false
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_80("Error setting trust flags - $0"), msg)
        );
      });
    }
    validateCertText() {
      const value = this.state.uploadValue;
      if (!value.startsWith("-----BEGIN CERTIFICATE-----") || !value.endsWith("-----END CERTIFICATE-----")) {
        this.setState({
          badCertText: true
        });
      } else {
        this.setState({
          badCertText: false
        });
      }
    }
    onChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj
      });
    }
    onCSRChange(e) {
      const value = e.target.value;
      const attr = e.target.id;
      const errObj = this.state.errObj;
      let valueErr = false;
      if (value === "") {
        valueErr = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [attr]: value,
        errObj
      }, this.buildSubject);
    }
    buildSubject() {
      let subject = "";
      const csrSubjectCN = this.state.csrSubjectCommonName;
      const csrSubjectO = this.state.csrSubjectOrg;
      const csrSubjectOU = this.state.csrSubjectOrgUnit;
      const csrSubjectL = this.state.csrSubjectLocality;
      const csrSubjectST = this.state.csrSubjectState;
      const csrSubjectC = this.state.csrSubjectCountry;
      const csrSubjectE = this.state.csrSubjectEmail;
      if (csrSubjectCN.length !== 0) {
        subject = "CN=" + csrSubjectCN;
      }
      if (csrSubjectO.length !== 0) {
        subject += ",O=" + csrSubjectO;
      }
      if (csrSubjectOU.length !== 0) {
        subject += ",OU=" + csrSubjectOU;
      }
      if (csrSubjectL.length !== 0) {
        subject += ",L=" + csrSubjectL;
      }
      if (csrSubjectST.length !== 0) {
        subject += ",ST=" + csrSubjectST;
      }
      if (csrSubjectC.length !== 0) {
        subject += ",C=" + csrSubjectC;
      }
      if (csrSubjectE.length !== 0) {
        subject += ",E=" + csrSubjectE;
      }
      this.setState({
        csrSubject: subject
      });
    }
    onFlagChange(e) {
      const checked = e.target.checked;
      const id = e.target.id;
      const flags = this.state.flags;
      let SSLFlags = "";
      let EmailFlags = "";
      let OSFlags = "";
      let newFlags = "";
      let disableSaveBtn = true;
      [SSLFlags, EmailFlags, OSFlags] = flags.split(",");
      if (id.endsWith("SSL")) {
        for (const trustFlag of ["C", "T", "c", "P", "p"]) {
          if (id.startsWith(trustFlag)) {
            if (checked) {
              SSLFlags += trustFlag;
            } else {
              SSLFlags = SSLFlags.replace(trustFlag, "");
            }
            SSLFlags = this.sortFlags(SSLFlags);
          }
        }
      } else if (id.endsWith("Email")) {
        for (const trustFlag of ["C", "T", "c", "P", "p"]) {
          if (id.startsWith(trustFlag)) {
            if (checked) {
              EmailFlags += trustFlag;
            } else {
              EmailFlags = EmailFlags.replace(trustFlag, "");
            }
            EmailFlags = this.sortFlags(EmailFlags);
          }
        }
      } else {
        for (const trustFlag of ["C", "T", "c", "P", "p"]) {
          if (id.startsWith(trustFlag)) {
            if (checked) {
              OSFlags += trustFlag;
            } else {
              OSFlags = OSFlags.replace(trustFlag, "");
            }
            OSFlags = this.sortFlags(OSFlags);
          }
        }
      }
      newFlags = SSLFlags + "," + EmailFlags + "," + OSFlags;
      if (newFlags !== this.state._flags) {
        disableSaveBtn = false;
      }
      this.setState({
        flags: newFlags,
        disableSaveBtn
      });
    }
    closeConfirmDelete() {
      this.setState({
        showConfirmDelete: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeCSRConfirmDelete() {
      this.setState({
        showCSRConfirmDelete: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeKeyConfirmDelete() {
      this.setState({
        showKeyConfirmDelete: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    reloadCerts() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "certificate",
        "list"
      ];
      log_cmd("reloadCerts", "Load certificates", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const certs = JSON.parse(content);
        const key = this.state.tableKey + 1;
        const certNames = [];
        for (const cert of certs) {
          certNames.push(cert.attrs.nickname);
        }
        this.setState({
          ServerCerts: certs,
          loading: false,
          tableKey: key,
          showConfirmCAChange: false,
          certNicknames: certNames
        }, this.getCertFiles);
      }).fail((err) => {
        const msg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_80("Error loading server certificates - $0"), msg)
        );
      });
    }
    reloadCSRs() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "csr",
        "list"
      ];
      log_cmd("reloadCSRs", "Reload CSRs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const csrs = JSON.parse(content);
        const key = this.state.tableKey + 1;
        this.setState({
          ServerCSRs: csrs,
          loading: false,
          tableKey: key,
          showConfirmCSRChange: false
        }, this.reloadOrphanKeys);
      }).fail((err) => {
        const msg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_80("Error loading CSRs - $0"), msg)
        );
      });
    }
    reloadOrphanKeys() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "key",
        "list",
        "--orphan"
      ];
      log_cmd("reloadOrphanKeys", "Reload Orphan Keys", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const keys = JSON.parse(content);
        const key = this.state.tableKey + 1;
        this.setState(
          () => ({
            ServerKeys: keys,
            loading: false,
            tableKey: key
          })
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        if (!errMsg.includes("certutil: no keys found")) {
          this.props.addNotification(
            "error",
            cockpit_default.format(_80("Error loading Orphan Keys - $0"), errMsg)
          );
        }
        this.setState({
          loading: false,
          ServerKeys: []
        });
      });
    }
    reloadCACerts() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "ca-certificate",
        "list"
      ];
      log_cmd("reloadCACerts", "Load certificates", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const certs = JSON.parse(content);
        const certNames = [];
        for (const cert of certs) {
          certNames.push(cert.attrs.nickname);
        }
        this.setState({
          CACerts: certs,
          loading: false,
          CACertNicknames: certNames
        }, this.reloadCerts);
      }).fail((err) => {
        const msg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_80("Error loading CA certificates - $0"), msg)
        );
      });
    }
    render() {
      let certificatePage = "";
      if (this.state.loading) {
        certificatePage = /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "ds-loading-spinner ds-center ds-margin-top-xlg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Text, { component: TextVariants.h3, children: _80("Loading Certificates ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Spinner, { size: "lg" })
        ] });
      } else {
        certificatePage = /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Tabs, { isBox: true, isSecondary: true, className: "ds-margin-top-xlg ds-left-indent", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
          /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(TabTitleText, { children: [
            _80("Trusted Certificate Authorities"),
            " ",
            /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("font", { size: "2", children: [
              "(",
              this.state.CACerts.length,
              ")"
            ] })
          ] }), children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "ds-margin-top-lg ds-left-indent", children: [
            /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
              CertTable,
              {
                certs: this.state.CACerts,
                editCert: this.showEditCAModal,
                exportCert: this.showExportModal,
                delCert: this.showDeleteConfirm
              },
              this.state.tableKey
            ),
            /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
              Button,
              {
                variant: "primary",
                className: "ds-margin-top-lg",
                onClick: () => {
                  this.showAddCAModal();
                },
                children: _80("Add CA Certificate")
              }
            )
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(TabTitleText, { children: [
            _80("TLS Certificates"),
            " ",
            /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("font", { size: "2", children: [
              "(",
              this.state.ServerCerts.length,
              ")"
            ] })
          ] }), children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "ds-margin-top-lg ds-left-indent", children: [
            /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
              CertTable,
              {
                certs: this.state.ServerCerts,
                editCert: this.showEditModal,
                exportCert: this.showExportModal,
                delCert: this.showDeleteConfirm
              },
              this.state.tableKey
            ),
            /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
              Button,
              {
                variant: "primary",
                className: "ds-margin-top-lg",
                onClick: () => {
                  this.showAddModal();
                },
                children: _80("Add Server Certificate")
              }
            )
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(TabTitleText, { children: [
            _80("Certificate Signing Requests"),
            " ",
            /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("font", { size: "2", children: [
              "(",
              this.state.ServerCSRs.length,
              ")"
            ] })
          ] }), children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "ds-margin-top-lg ds-left-indent", children: [
            /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
              CSRTable,
              {
                ServerCSRs: this.state.ServerCSRs,
                delCSR: this.showCSRDeleteConfirm,
                viewCSR: this.showViewCSRModal
              },
              this.state.tableKey
            ),
            /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
              Button,
              {
                variant: "primary",
                className: "ds-margin-top-lg",
                onClick: () => {
                  this.showAddCSRModal();
                },
                children: _80("Create Certificate Signing Request")
              }
            )
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Tab, { eventKey: 3, title: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(TabTitleText, { children: [
            " ",
            _80("Orphan Keys"),
            " ",
            /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("font", { size: "2", children: [
              "(",
              this.state.ServerKeys.length,
              ")"
            ] })
          ] }), children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "ds-margin-top-lg ds-left-indent", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
            KeyTable,
            {
              ServerKeys: this.state.ServerKeys,
              delKey: this.showKeyDeleteConfirm
            },
            this.state.tableKey
          ) }) })
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { children: [
        certificatePage,
        /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
          ExportCertModal,
          {
            showModal: this.state.showExportModal,
            closeHandler: this.closeExportModal,
            handleChange: this.onChange,
            saveHandler: this.exportCert,
            nickName: this.state.exportNickname,
            binaryFormat: this.state.exportDERFormat,
            fileName: this.state.exportFileName,
            certDir: this.props.certDir,
            spinning: this.state.modalSpinning
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
          EditCertModal,
          {
            showModal: this.state.showEditModal,
            closeHandler: this.closeEditModal,
            handleChange: this.onFlagChange,
            saveHandler: this.editCert,
            flags: this.state.flags,
            disableSaveBtn: this.state.disableSaveBtn,
            spinning: this.state.modalSpinning
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
          SecurityAddCertModal,
          {
            showModal: this.state.showAddModal,
            closeHandler: this.closeAddModal,
            handleChange: this.onChange,
            saveHandler: this.addCert,
            spinning: this.state.modalSpinning,
            certFile: this.state.certFile,
            certName: this.state.certName,
            certNames: this.state.availCertNames,
            certNicknames: this.state.certNicknames,
            CACertNicknames: this.state.CACertNicknames,
            selectCertName: this.state.selectCertName,
            isSelectCertOpen: this.state.isSelectCertOpen,
            handleCertSelect: this.onCertSelect,
            certRadioFile: this.state.certRadioFile,
            certRadioSelect: this.state.certRadioSelect,
            certRadioUpload: this.state.certRadioUpload,
            handleRadioChange: this.onRadioChange,
            badCertText: this.state.badCertText,
            uploadValue: this.state.uploadValue,
            uploadFileName: this.state.uploadFileName,
            uploadIsLoading: this.state.uploadIsLoading,
            uploadIsRejected: this.state.uploadIsRejected,
            handleFileInputChange: this.onFileInputChange,
            handleTextOrDataChange: this.onTextOrDataChange,
            handleFileReadStarted: this.onFileReadStarted,
            handleFileReadFinished: this.onFileReadFinished,
            handleClear: this.onClear,
            handleFileRejected: this.handleFileRejected,
            pkcs12PinMethod: this.state.pkcs12PinMethod,
            pkcs12PinFile: this.state.pkcs12PinFile,
            pkcs12PinText: this.state.pkcs12PinText,
            forceCertAdd: this.state.forceCertAdd,
            handlePkcs12PinMethodChange: this.onPkcs12PinMethodChange,
            handlePkcs12PinFileChange: this.onPkcs12PinFileChange,
            handlePkcs12PinTextChange: this.onPkcs12PinTextChange,
            handleForceCertAddChange: this.onForceCertAddChange
          },
          "addCert-" + this.state.showAddModal
        ),
        /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
          SecurityAddCACertModal,
          {
            showModal: this.state.showAddCAModal,
            closeHandler: this.closeAddCAModal,
            handleChange: this.onChange,
            saveHandler: this.addCert,
            spinning: this.state.modalSpinning,
            certFile: this.state.certFile,
            certName: this.state.certName,
            certNames: this.state.availCertNames,
            certNicknames: this.state.certNicknames,
            CACertNicknames: this.state.CACertNicknames,
            selectCertName: this.state.selectCertName,
            isSelectCertOpen: this.state.isSelectCertOpen,
            handleCertSelect: this.onCertSelect,
            certRadioFile: this.state.certRadioFile,
            certRadioSelect: this.state.certRadioSelect,
            certRadioUpload: this.state.certRadioUpload,
            handleRadioChange: this.onRadioChange,
            badCertText: this.state.badCertText,
            uploadValue: this.state.uploadValue,
            uploadFileName: this.state.uploadFileName,
            uploadIsLoading: this.state.uploadIsLoading,
            uploadIsRejected: this.state.uploadIsRejected,
            handleFileInputChange: this.onFileInputChange,
            handleTextOrDataChange: this.onTextOrDataChange,
            handleFileReadStarted: this.onFileReadStarted,
            handleFileReadFinished: this.onFileReadFinished,
            handleClear: this.onClear,
            handleFileRejected: this.handleFileRejected
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
          SecurityAddCSRModal,
          {
            showModal: this.state.showAddCSRModal,
            closeHandler: this.closeAddCSRModal,
            handleChange: this.onCSRChange,
            saveHandler: this.addCSR,
            previewValue: this.state.csrSubject,
            csrName: this.state.csrName,
            csrAltNames: this.state.csrAltNames,
            csrIsSelectOpen: this.state.csrIsSelectOpen,
            handleOnSelect: this.csrOnSelect,
            handleOnToggle: this.csrOnToggle,
            spinning: this.state.modalSpinning,
            error: this.state.errObj
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
          SecurityViewCSRModal,
          {
            showModal: this.state.showViewCSRModal,
            closeHandler: this.closeViewCSRModal,
            name: this.state.csrName,
            item: this.state.csrContent,
            error: this.state.errObj
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDelete,
            closeHandler: this.closeConfirmDelete,
            handleChange: this.onChange,
            actionHandler: this.delCert,
            spinning: this.state.modalSpinning,
            item: this.state.certName,
            checked: this.state.modalChecked,
            mTitle: _80("Delete Certificate"),
            mMsg: _80("Are you sure you want to delete this certificate?"),
            mSpinningMsg: _80("Deleting Certificate ..."),
            mBtnName: _80("Delete Certificate")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showCSRConfirmDelete,
            closeHandler: this.closeCSRConfirmDelete,
            handleChange: this.onChange,
            actionHandler: this.delCSR,
            spinning: this.state.modalSpinning,
            item: this.state.csrName,
            checked: this.state.modalChecked,
            mTitle: _80("Delete CSR"),
            mMsg: _80("Are you sure you want to delete this CSR?"),
            mSpinningMsg: _80("Deleting CSR ..."),
            mBtnName: _80("Delete CSR")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showKeyConfirmDelete,
            closeHandler: this.closeKeyConfirmDelete,
            handleChange: this.onChange,
            actionHandler: this.delKey,
            spinning: this.state.modalSpinning,
            item: this.state.keyID,
            checked: this.state.modalChecked,
            mTitle: _80("Delete Key"),
            mMsg: _80("Are you sure you want to delete this Key?"),
            mSpinningMsg: _80("Deleting Key ..."),
            mBtnName: _80("Delete Key")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmCAChange,
            closeHandler: this.closeConfirmCAChange,
            handleChange: this.onChange,
            actionHandler: this.doEditCert,
            spinning: this.state.modalSpinning,
            item: this.state.certName,
            checked: this.state.modalChecked,
            mTitle: _80("Warning - Altering CA Certificate Properties"),
            mMsg: _80("Removing the 'C' or 'T' flags from the SSL trust category could break all TLS connectivity to and from the server, are you sure you want to proceed?"),
            mSpinningMsg: _80("Editing CA Certificate ..."),
            mBtnName: _80("Change Trust Flags")
          }
        )
      ] });
    }
  };
  CertificateManagement.propTypes = {
    serverId: import_prop_types78.default.string,
    CACerts: import_prop_types78.default.array,
    ServerCerts: import_prop_types78.default.array,
    ServerCSRs: import_prop_types78.default.array,
    ServerKeys: import_prop_types78.default.array,
    addNotification: import_prop_types78.default.func
  };
  CertificateManagement.defaultProps = {
    serverId: "",
    CACerts: [],
    ServerCerts: [],
    ServerCSRs: [],
    ServerKeys: []
  };

  // src/lib/security/encryptionModules.jsx
  var import_react151 = __toESM(require_react(), 1);
  var import_prop_types79 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime81 = __toESM(require_jsx_runtime(), 1);
  var _81 = cockpit_default.gettext;
  function getModuleAttrValue(attrs, attrName, defaultValue = "") {
    const rawValue = attrs?.[attrName];
    if (Array.isArray(rawValue)) {
      return rawValue.length > 0 ? rawValue[0] : defaultValue;
    }
    if (rawValue === null || rawValue === void 0) {
      return defaultValue;
    }
    return rawValue;
  }
  function makeEncryptionModuleRows(modules) {
    return modules.map((module) => ({
      name: module.name,
      certNickname: module.certNickname,
      activated: module.activated,
      token: module.token,
      serverCertExtractFile: module.serverCertExtractFile,
      serverKeyExtractFile: module.serverKeyExtractFile
    }));
  }
  function normalizeEncryptionModuleEntry(entry) {
    const attrs = entry?.attrs || entry || {};
    return {
      name: getModuleAttrValue(attrs, "cn", ""),
      certNickname: getModuleAttrValue(attrs, "nssslpersonalityssl", ""),
      activated: getModuleAttrValue(attrs, "nssslactivation", "off").toLowerCase(),
      token: getModuleAttrValue(attrs, "nsssltoken", "internal (software)"),
      serverCertExtractFile: getModuleAttrValue(attrs, "servercertextractfile", ""),
      serverKeyExtractFile: getModuleAttrValue(attrs, "serverkeyextractfile", ""),
      dn: entry?.dn || ""
    };
  }
  function EncryptionModules({ addNotification, serverId, serverCertNames }) {
    const [modules, setModules] = import_react151.default.useState([]);
    const [rows, setRows] = import_react151.default.useState([]);
    const [loadError, setLoadError] = import_react151.default.useState("");
    const [partialDataCount, setPartialDataCount] = import_react151.default.useState(0);
    const [certOptions, setCertOptions] = import_react151.default.useState([]);
    const [actionInProgress, setActionInProgress] = import_react151.default.useState(false);
    const [showToggleConfirm, setShowToggleConfirm] = import_react151.default.useState(false);
    const [showDeleteConfirm, setShowDeleteConfirm] = import_react151.default.useState(false);
    const [confirmChecked, setConfirmChecked] = import_react151.default.useState(false);
    const [confirmSpinning, setConfirmSpinning] = import_react151.default.useState(false);
    const [pendingModule, setPendingModule] = import_react151.default.useState(null);
    const [pendingModuleActivate, setPendingModuleActivate] = import_react151.default.useState(false);
    const [loading, setLoading] = import_react151.default.useState(true);
    const parseCmdError = import_react151.default.useCallback((err) => {
      try {
        const errObj = getApiErrorMessage(err);
        let msg = errObj.desc;
        if ("info" in errObj) {
          msg = `${errObj.desc} - ${errObj.info}`;
        }
        return msg;
      } catch (e) {
        return err?.toString() || _81("Unexpected error");
      }
    }, []);
    const formatOpError = import_react151.default.useCallback((opName, targetName, msg) => {
      const opLabel = _81(opName);
      const target = targetName ? cockpit_default.format(_81(" for '$0'"), targetName) : "";
      return cockpit_default.format(_81("Failed to $0$1 - $2"), opLabel, target, msg);
    }, []);
    const buildEncryptionModuleCertOptions = import_react151.default.useCallback((moduleList, certNames) => {
      const usageByCert = {};
      for (const module of moduleList) {
        if (module.certNickname) {
          usageByCert[module.certNickname] = module.name;
        }
      }
      return (certNames || []).map((nickname) => ({
        nickname,
        inUseByModule: usageByCert[nickname] || null,
        selectable: !usageByCert[nickname],
        isAdHoc: false
      }));
    }, []);
    const loadEncryptionModules = import_react151.default.useCallback(() => {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
        "security",
        "encryption-module",
        "list"
      ];
      log_cmd("loadEncryptionModules", "Load encryption modules", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const moduleResp = JSON.parse(content);
        const moduleItems = moduleResp.items || [];
        const normalizedModules = moduleItems.map((item) => normalizeEncryptionModuleEntry(item));
        const cleanModules = normalizedModules.filter((module) => module.name !== "");
        const partialCount = normalizedModules.length - cleanModules.length;
        const tableRows = makeEncryptionModuleRows(cleanModules);
        const moduleCertOptions = buildEncryptionModuleCertOptions(cleanModules, serverCertNames);
        setModules(cleanModules);
        setRows(tableRows);
        setCertOptions(moduleCertOptions);
        setLoadError("");
        setPartialDataCount(partialCount);
        setLoading(false);
      }).fail((err) => {
        const msg = parseCmdError(err);
        setModules([]);
        setRows([]);
        setCertOptions([]);
        setLoadError(msg);
        setPartialDataCount(0);
        setLoading(false);
        addNotification(
          "error",
          cockpit_default.format(_81("Error loading encryption modules - $0"), msg)
        );
      });
    }, [addNotification, buildEncryptionModuleCertOptions, parseCmdError, serverCertNames, serverId]);
    import_react151.default.useEffect(() => {
      loadEncryptionModules();
    }, [loadEncryptionModules]);
    import_react151.default.useEffect(() => {
      setCertOptions(buildEncryptionModuleCertOptions(modules, serverCertNames));
    }, [buildEncryptionModuleCertOptions, modules, serverCertNames]);
    const runEncryptionModuleOperation = import_react151.default.useCallback(({ cmd, opName, successMsg, actionTarget: targetName = "" }) => {
      if (actionInProgress) {
        return Promise.reject(new Error("busy"));
      }
      log_cmd("runEncryptionModuleOperation", opName, cmd);
      setActionInProgress(true);
      return cockpit_default.spawn(cmd, { superuser: true, err: "message" }).then(() => {
        addNotification("success", successMsg);
        setActionInProgress(false);
        loadEncryptionModules();
      }).catch((err) => {
        const msg = parseCmdError(err);
        const formattedMsg = formatOpError(opName, targetName, msg);
        addNotification("error", formattedMsg);
        setActionInProgress(false);
        throw err;
      });
    }, [actionInProgress, addNotification, formatOpError, loadEncryptionModules, parseCmdError]);
    const createEncryptionModule = import_react151.default.useCallback((payload, onSuccessClose) => {
      if (actionInProgress) {
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
        "security",
        "encryption-module",
        "add",
        payload.name,
        "--cert-nickname",
        payload.certNickname,
        "--token",
        payload.token
      ];
      if (payload.activated) {
        cmd.push("--activated");
      }
      if (payload.serverCertExtractFile) {
        cmd.push("--server-cert-extract-file", payload.serverCertExtractFile);
      }
      if (payload.serverKeyExtractFile) {
        cmd.push("--server-key-extract-file", payload.serverKeyExtractFile);
      }
      runEncryptionModuleOperation({
        cmd,
        opName: "create encryption module",
        actionTarget: payload.name,
        successMsg: cockpit_default.format(_81("Successfully created encryption module '$0'."), payload.name)
      }).then(() => {
        onSuccessClose();
      }).catch(() => {
      });
    }, [actionInProgress, runEncryptionModuleOperation, serverId]);
    const editEncryptionModule = import_react151.default.useCallback((moduleName, payload, onSuccessClose) => {
      if (actionInProgress) {
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
        "security",
        "encryption-module",
        "edit",
        moduleName,
        "--cert-nickname",
        payload.certNickname,
        "--token",
        payload.token
      ];
      if (payload.activated) {
        cmd.push("--activate");
      } else {
        cmd.push("--deactivate");
      }
      if (payload.serverCertExtractFile) {
        cmd.push("--server-cert-extract-file", payload.serverCertExtractFile);
      }
      if (payload.serverKeyExtractFile) {
        cmd.push("--server-key-extract-file", payload.serverKeyExtractFile);
      }
      runEncryptionModuleOperation({
        cmd,
        opName: "edit encryption module",
        actionTarget: moduleName,
        successMsg: cockpit_default.format(_81("Successfully updated encryption module '$0'."), moduleName)
      }).then(() => {
        onSuccessClose();
      }).catch(() => {
      });
    }, [actionInProgress, runEncryptionModuleOperation, serverId]);
    const openToggleConfirm = import_react151.default.useCallback((module, activate) => {
      setShowToggleConfirm(true);
      setConfirmChecked(false);
      setConfirmSpinning(false);
      setPendingModule(module);
      setPendingModuleActivate(activate);
    }, []);
    const openDeleteConfirm = import_react151.default.useCallback((module) => {
      setShowDeleteConfirm(true);
      setConfirmChecked(false);
      setConfirmSpinning(false);
      setPendingModule(module);
    }, []);
    const closeConfirm = import_react151.default.useCallback(() => {
      if (confirmSpinning) {
        return;
      }
      setShowToggleConfirm(false);
      setShowDeleteConfirm(false);
      setConfirmChecked(false);
      setConfirmSpinning(false);
      setPendingModule(null);
      setPendingModuleActivate(false);
    }, [confirmSpinning]);
    const onConfirmChange = import_react151.default.useCallback((e) => {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      setConfirmChecked(value);
    }, []);
    const confirmToggle = import_react151.default.useCallback(() => {
      if (!pendingModule || actionInProgress || confirmSpinning) {
        return;
      }
      const activate = pendingModuleActivate;
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
        "security",
        "encryption-module",
        "edit",
        pendingModule.name,
        activate ? "--activate" : "--deactivate"
      ];
      setConfirmSpinning(true);
      runEncryptionModuleOperation({
        cmd,
        opName: activate ? "enable encryption module" : "disable encryption module",
        actionTarget: pendingModule.name,
        successMsg: cockpit_default.format(
          activate ? _81("Successfully enabled encryption module '$0'.") : _81("Successfully disabled encryption module '$0'."),
          pendingModule.name
        )
      }).then(() => {
        setShowToggleConfirm(false);
        setConfirmChecked(false);
        setConfirmSpinning(false);
        setPendingModule(null);
        setPendingModuleActivate(false);
      }).catch(() => {
        setConfirmSpinning(false);
      });
    }, [actionInProgress, confirmSpinning, pendingModule, pendingModuleActivate, runEncryptionModuleOperation, serverId]);
    const confirmDelete = import_react151.default.useCallback(() => {
      if (!pendingModule || actionInProgress || confirmSpinning) {
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
        "security",
        "encryption-module",
        "delete",
        pendingModule.name
      ];
      setConfirmSpinning(true);
      runEncryptionModuleOperation({
        cmd,
        opName: "delete encryption module",
        actionTarget: pendingModule.name,
        successMsg: cockpit_default.format(_81("Successfully deleted encryption module '$0'."), pendingModule.name)
      }).then(() => {
        setShowDeleteConfirm(false);
        setConfirmChecked(false);
        setConfirmSpinning(false);
        setPendingModule(null);
        setPendingModuleActivate(false);
      }).catch(() => {
        setConfirmSpinning(false);
      });
    }, [actionInProgress, confirmSpinning, pendingModule, runEncryptionModuleOperation, serverId]);
    return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(import_jsx_runtime81.Fragment, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
        EncryptionModuleTable,
        {
          modules,
          rows,
          certOptions,
          loading,
          loadError,
          partialDataCount,
          actionInProgress,
          onCreateModule: createEncryptionModule,
          onEditModule: editEncryptionModule,
          onToggleModule: openToggleConfirm,
          onDeleteModule: openDeleteConfirm
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
        DoubleConfirmModal,
        {
          showModal: showToggleConfirm,
          closeHandler: closeConfirm,
          handleChange: onConfirmChange,
          actionHandler: confirmToggle,
          spinning: confirmSpinning,
          item: pendingModule ? pendingModule.name : "",
          checked: confirmChecked,
          mTitle: pendingModuleActivate ? _81("Enable Encryption Module") : _81("Disable Encryption Module"),
          mMsg: pendingModuleActivate ? _81("Are you sure you want to enable this encryption module?") : _81("Are you sure you want to disable this encryption module?"),
          mSpinningMsg: pendingModuleActivate ? _81("Enabling ...") : _81("Disabling ..."),
          mBtnName: pendingModuleActivate ? _81("Enable") : _81("Disable")
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
        DoubleConfirmModal,
        {
          showModal: showDeleteConfirm,
          closeHandler: closeConfirm,
          handleChange: onConfirmChange,
          actionHandler: confirmDelete,
          spinning: confirmSpinning,
          item: pendingModule ? pendingModule.name : "",
          checked: confirmChecked,
          mTitle: _81("Delete Encryption Module"),
          mMsg: pendingModule && pendingModule.activated === "on" ? _81("This encryption module is currently active. Deleting active modules is allowed but requires confirmation. Continue?") : _81("Are you sure you want to delete this encryption module?"),
          mSpinningMsg: _81("Deleting ..."),
          mBtnName: _81("Delete")
        }
      )
    ] });
  }
  EncryptionModules.propTypes = {
    addNotification: import_prop_types79.default.func,
    serverId: import_prop_types79.default.string,
    serverCertNames: import_prop_types79.default.array
  };
  var encryptionModules_default = EncryptionModules;

  // src/lib/security/ciphers.jsx
  var import_react152 = __toESM(require_react(), 1);
  var import_prop_types80 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime82 = __toESM(require_jsx_runtime(), 1);
  var _82 = cockpit_default.gettext;
  var Ciphers = class extends import_react152.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        allowCiphers: [],
        denyCiphers: [],
        cipherPref: "default",
        prefs: this.props.cipherPref,
        saving: false,
        availableCiphers: this.props.supportedCiphers,
        // Select Typeahead
        isAllowCipherOpen: false,
        isDenyCipherOpen: false,
        disableSaveBtn: true
      };
      this.handleAllowCipherToggle = (_event, isAllowCipherOpen) => {
        this.setState({
          isAllowCipherOpen
        });
      };
      this.handleAllowCipherClear = () => {
        this.setState({
          allowCiphers: [],
          isAllowCipherOpen: false
        });
      };
      this.handleDenyCipherToggle = (_event, isDenyCipherOpen) => {
        this.setState({
          isDenyCipherOpen
        });
      };
      this.handleDenyCipherClear = () => {
        this.setState({
          denyCiphers: [],
          isDenyCipherOpen: false
        });
      };
      this.handlePrefChange = this.handlePrefChange.bind(this);
      this.saveCipherPref = this.saveCipherPref.bind(this);
      this.handleAllowCipherChange = this.handleAllowCipherChange.bind(this);
      this.handleDenyCipherChange = this.handleDenyCipherChange.bind(this);
    }
    componentDidMount() {
      let cipherPref = "default";
      const allowedCiphers = [];
      const deniedCiphers = [];
      const availableCiphers = this.props.supportedCiphers.slice(0);
      if (this.props.cipherPref !== "") {
        let rawCiphers = this.props.cipherPref.split(",");
        if (rawCiphers[0].toLowerCase() === "default") {
          rawCiphers.shift();
        } else if (rawCiphers[0].toLowerCase() === "+all") {
          cipherPref = "+all";
          rawCiphers.shift();
        } else if (rawCiphers[0].toLowerCase() === "-all") {
          cipherPref = "-all";
          rawCiphers.shift();
        }
        rawCiphers = rawCiphers.map(function(x2) {
          return x2.toUpperCase();
        });
        for (const cipher of rawCiphers) {
          if (cipher.startsWith("+")) {
            allowedCiphers.push(cipher.substring(1));
          } else if (cipher.startsWith("-")) {
            deniedCiphers.push(cipher.substring(1));
          }
        }
        for (const enabled_cipher of this.props.enabledCiphers) {
          if (availableCiphers.includes(enabled_cipher)) {
            const index = availableCiphers.indexOf(enabled_cipher);
            if (index > -1) {
              availableCiphers.splice(index, 1);
            }
          }
        }
        for (const allow_cipher of allowedCiphers) {
          if (availableCiphers.includes(allow_cipher)) {
            const index = availableCiphers.indexOf(allow_cipher);
            if (index > -1) {
              availableCiphers.splice(index, 1);
            }
          }
        }
        for (const deny_cipher of deniedCiphers) {
          if (availableCiphers.includes(deny_cipher)) {
            const index = availableCiphers.indexOf(deny_cipher);
            if (index > -1) {
              availableCiphers.splice(index, 1);
            }
          }
        }
      }
      this.setState({
        cipherPref,
        _cipherPref: cipherPref,
        allowCiphers: allowedCiphers,
        _allowCiphers: [...allowedCiphers],
        denyCiphers: deniedCiphers,
        _denyCiphers: [...deniedCiphers],
        availableCiphers
      });
    }
    saveCipherPref() {
      this.setState({
        saving: true
      });
      let prefs = this.state.cipherPref;
      if (this.state.cipherPref !== "default") {
        for (const cipher of this.state.allowCiphers) {
          prefs += ",+" + cipher;
        }
        for (const cipher of this.state.denyCiphers) {
          prefs += ",-" + cipher;
        }
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "ciphers",
        "set",
        "--",
        prefs
      ];
      log_cmd("saveCipherPref", "Saving cipher preferences", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
        this.props.addNotification(
          "success",
          _82("Successfully set cipher preferences.")
        );
        this.props.addNotification(
          "warning",
          _82("You must restart the Directory Server for these changes to take effect.")
        );
        this.setState({
          saving: false,
          disableSaveBtn: true
        });
        this.props.reload();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        let msg = errMsg;
        if ("info" in errMsg) {
          msg = errMsg + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          cockpit_default.format(_82("Error setting cipher preferences - $0"), msg)
        );
        this.setState({
          saving: false,
          disableSaveBtn: true
        });
      });
    }
    handlePrefChange(val) {
      let disableSaveBtn = true;
      if (JSON.stringify(this.state.allowCiphers) !== JSON.stringify(this.state._allowCiphers) || JSON.stringify(this.state.denyCiphers) !== JSON.stringify(this.state._denyCiphers)) {
        disableSaveBtn = false;
      }
      if (this.state._cipherPref !== val) {
        disableSaveBtn = false;
      }
      this.setState({
        cipherPref: val,
        disableSaveBtn
      });
    }
    handleAllowCipherChange(e, selection) {
      let disableSaveBtn = true;
      const newAllowCiphers = Array.isArray(selection) ? selection : [];
      const allCiphers = [...this.props.cipherPref];
      const availableCiphers = allCiphers.filter(
        (cipher) => !newAllowCiphers.includes(cipher) && !this.state.denyCiphers.includes(cipher)
      ).sort();
      if (this.state.cipherPref !== this.state._cipherPref) {
        disableSaveBtn = false;
      }
      if (JSON.stringify(this.state._allowCiphers) !== JSON.stringify(newAllowCiphers)) {
        disableSaveBtn = false;
      }
      this.setState({
        allowCiphers: newAllowCiphers,
        isAllowCipherOpen: false,
        availableCiphers,
        disableSaveBtn
      });
    }
    handleDenyCipherChange(e, selection) {
      let disableSaveBtn = true;
      const newDenyCiphers = Array.isArray(selection) ? selection : [];
      const allCiphers = [...this.props.cipherPref];
      const availableCiphers = allCiphers.filter(
        (cipher) => !this.state.allowCiphers.includes(cipher) && !newDenyCiphers.includes(cipher)
      ).sort();
      if (this.state.cipherPref !== this.state._cipherPref) {
        disableSaveBtn = false;
      }
      if (JSON.stringify(this.state._denyCiphers) !== JSON.stringify(newDenyCiphers)) {
        disableSaveBtn = false;
      }
      this.setState({
        denyCiphers: newDenyCiphers,
        isDenyCipherOpen: false,
        availableCiphers,
        disableSaveBtn
      });
    }
    render() {
      const supportedCiphers = [];
      const enabledCiphers = [];
      let cipherPage;
      let saveBtnName = _82("Save Settings");
      const extraPrimaryProps = {};
      if (this.state.saving) {
        saveBtnName = _82("Saving settings ...");
        extraPrimaryProps.spinnerAriaValueText = _82("Saving");
      }
      for (const cipher of this.props.supportedCiphers) {
        if (!this.props.enabledCiphers.includes(cipher)) {
          supportedCiphers.push(cipher);
        }
      }
      for (const cipher of this.props.enabledCiphers) {
        enabledCiphers.push(cipher);
      }
      let supportedList = supportedCiphers.map(
        (name2) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(SimpleListItem, { children: name2 }, name2)
      );
      if (supportedList.length === 0) {
        supportedList = "";
      }
      let enabledList = enabledCiphers.map(
        (name2) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(SimpleListItem, { children: name2 }, name2)
      );
      if (enabledList.length === 0) {
        enabledList = "";
      }
      if (this.state.saving) {
        cipherPage = /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "ds-center ds-margin-top-lg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Text, { component: TextVariants.h3, children: _82("Saving Cipher Preferences ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Spinner, { size: "lg" })
        ] });
      } else {
        cipherPage = /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "ds-indent", children: [
          /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Form, { className: "ds-margin-top-lg", isHorizontal: true, children: [
            /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(GridItem, { span: 5, title: _82("The current ciphers the server is accepting.  This list is only updated after a server restart."), children: [
                /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Text, { component: TextVariants.h3, children: [
                  _82("Enabled Ciphers"),
                  " ",
                  /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("font", { size: "2", children: [
                    "(",
                    enabledList.length,
                    ")"
                  ] })
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("hr", {}),
                /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "ds-box", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(SimpleList, { "aria-label": _82("enabled cipher list"), children: enabledList }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(GridItem, { span: 2 }),
              /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(GridItem, { span: 5, title: _82("The current ciphers the server supports"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Text, { component: TextVariants.h3, children: [
                  _82("Supported Ciphers"),
                  " ",
                  /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("font", { size: "2", children: [
                    "(",
                    supportedList.length,
                    ")"
                  ] })
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("hr", {}),
                /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "ds-box", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(SimpleList, { "aria-label": "supported cipher list", children: supportedList }) })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("hr", {}),
            /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(GridItem, { className: "ds-label", span: 2, children: _82("Cipher Suite") }),
              /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(GridItem, { span: 10, children: [
                /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
                  FormSelect,
                  {
                    id: "cipherPref",
                    value: this.state.cipherPref,
                    onChange: (_event, val) => this.handlePrefChange(val),
                    "aria-label": "pref select",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(FormSelectOption, { value: "default", label: _82("Default Ciphers") }, "1"),
                      /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(FormSelectOption, { value: "+all", label: _82("All Ciphers") }, "2"),
                      /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(FormSelectOption, { value: "-all", label: _82("No Ciphers") }, "3")
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(FormHelperText, { children: [
                  _82("Default cipher suite is chosen. It enables the default ciphers advertised by NSS except weak ciphers."),
                  this.state.allowCiphers.length !== 0 || this.state.denyCiphers.length !== 0 ? _82(" Any data in the 'Allow Specific Ciphers' and 'Deny Specific Ciphers' fields will be cleaned after the restart.") : ""
                ] })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(GridItem, { className: "ds-label", span: 2, children: _82("Allow Specific Ciphers") }),
              /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
                dsBasicComponents_default,
                {
                  selected: this.state.allowCiphers,
                  onSelect: this.handleAllowCipherChange,
                  onClear: this.handleAllowCipherClear,
                  options: this.state.availableCiphers,
                  isOpen: this.state.isAllowCipherOpen,
                  onToggle: this.handleAllowCipherToggle,
                  placeholder: _82("Type a cipher..."),
                  noResultsText: _82("There are no matching entries"),
                  ariaLabel: _82("Type a cipher"),
                  isMulti: true,
                  isDisabled: this.state.cipherPref === "default"
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Grid, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(GridItem, { className: "ds-label", span: 2, children: _82("Deny Specific Ciphers") }),
              /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
                dsBasicComponents_default,
                {
                  selected: this.state.denyCiphers,
                  onSelect: this.handleDenyCipherChange,
                  onClear: this.handleDenyCipherClear,
                  options: this.state.availableCiphers,
                  isOpen: this.state.isDenyCipherOpen,
                  onToggle: this.handleDenyCipherToggle,
                  placeholder: _82("Type a cipher..."),
                  noResultsText: _82("There are no matching entries"),
                  ariaLabel: _82("Type a cipher"),
                  isMulti: true,
                  isDisabled: this.state.cipherPref === "default"
                }
              ) })
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
            Button,
            {
              variant: "primary",
              className: "ds-margin-top-xlg",
              onClick: () => {
                this.saveCipherPref();
              },
              isDisabled: this.state.disableSaveBtn || this.state.saving,
              isLoading: this.state.saving,
              spinnerAriaValueText: this.state.saving ? _82("Saving") : void 0,
              ...extraPrimaryProps,
              children: saveBtnName
            }
          )
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: this.state.saving ? "ds-disabled" : "", children: cipherPage });
    }
  };
  Ciphers.propTypes = {
    serverId: import_prop_types80.default.string,
    supportedCiphers: import_prop_types80.default.array,
    enabledCiphers: import_prop_types80.default.array,
    cipherPref: import_prop_types80.default.string,
    addNotification: import_prop_types80.default.func
  };
  Ciphers.defaultProps = {
    serverId: "",
    supportedCiphers: [],
    enabledCiphers: [],
    cipherPref: ""
  };

  // src/security.jsx
  var import_prop_types81 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime83 = __toESM(require_jsx_runtime(), 1);
  var _83 = cockpit_default.gettext;
  var configAttrs = [
    "sslVersionMin",
    "sslVersionMax",
    "secureListenhost",
    "clientAuth",
    "validateCert",
    "requireSecureBinds",
    "checkHostname",
    "allowWeakCipher",
    "nstlsallowclientrenegotiation",
    "extractPEMFiles"
  ];
  var configCoreAttrs = [
    "secureListenhost",
    "requireSecureBinds",
    "checkHostname",
    "allowWeakCipher",
    "nstlsallowclientrenegotiation"
  ];
  var Security = class extends import_react153.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "onSelectToggle", (_event, isExpanded, toggleId) => {
        this.setState({
          [toggleId]: isExpanded
        });
      });
      __publicField(this, "onSelectClear", (toggleId, collection) => {
        this.setState({
          [toggleId]: false,
          [collection]: []
        });
      });
      this.state = {
        loaded: false,
        saving: false,
        activeTabKey: 0,
        errObj: {},
        showConfirmDisable: false,
        showSecurityEnableModal: false,
        primaryCertName: "",
        serverCertNames: [],
        serverCerts: [],
        CACerts: [],
        CACertNames: [],
        isMinSSLOpen: false,
        isMaxSSLOpen: false,
        isClientAuthOpen: false,
        isValidateCertOpen: false,
        disableSaveBtn: true,
        modalChecked: false,
        modalSpinning: false,
        // Ciphers
        supportedCiphers: [],
        enabledCiphers: [],
        // Certificate Signing Requests
        serverCSRs: [],
        // Orphan keys
        serverOrphanKeys: [],
        // Config settings
        securityEnabled: false,
        requireSecureBinds: false,
        secureListenhost: false,
        clientAuth: false,
        checkHostname: false,
        validateCert: "",
        sslVersionMin: "",
        sslVersionMax: "",
        allowWeakCipher: false,
        nssslpersonalityssl: "",
        nstlsallowclientrenegotiation: true,
        // Original config Settings
        _securityEnabled: false,
        _requireSecureBinds: false,
        _secureListenhost: false,
        _clientAuth: false,
        _checkHostname: false,
        _validateCert: "",
        _sslVersionMin: "",
        _sslVersionMax: "",
        _allowWeakCipher: false,
        _nssslpersonalityssl: "",
        _nssslpersonalityssllist: "",
        _nstlsallowclientrenegotiation: true,
        isServerCertOpen: false,
        // progress steps
        configLoaded: false,
        configLoading: false,
        ciphersLoaded: false,
        ciphersLoading: false,
        certsLoaded: false,
        certsLoading: false,
        caCertsLoaded: false,
        caCertsLoading: false,
        csrsLoaded: false,
        csrsLoading: false,
        orphanKeysLoaded: false,
        orphanKeysLoading: false
      };
      this.handleServerCertSelect = (event, selection) => {
        let disableSaveBtn = !this.configChanged();
        if (this.state._nssslpersonalityssl !== selection) {
          disableSaveBtn = false;
        }
        this.setState({
          nssslpersonalityssl: selection,
          isServerCertOpen: false,
          disableSaveBtn
        });
      };
      this.handleServerCertToggle = (_event, isServerCertOpen) => {
        this.setState({
          isServerCertOpen
        });
      };
      this.handleServerCertClear = () => {
        this.setState({
          nssslpersonalityssl: "",
          isServerCertOpen: false
        });
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.configChanged = () => {
        for (const config_attr of configCoreAttrs) {
          if (this.state[config_attr] !== this.state["_" + config_attr]) {
            return true;
          }
        }
        return false;
      };
      this.handleMinSSLToggle = (_event, isMinSSLOpen) => {
        this.setState({
          isMinSSLOpen
        });
      };
      this.handleMinSSLSelect = (event, selection, isPlaceholder) => {
        let disableSaveBtn = !this.configChanged();
        if (this.state._sslVersionMin !== selection) {
          disableSaveBtn = false;
        }
        this.setState({
          sslVersionMin: selection,
          isMinSSLOpen: false,
          disableSaveBtn
        });
      };
      this.handleMaxSSLToggle = (_event, isMaxSSLOpen) => {
        this.setState({
          isMaxSSLOpen
        });
      };
      this.handleMaxSSLSelect = (event, selection, isPlaceholder) => {
        let disableSaveBtn = !this.configChanged();
        if (this.state._sslVersionMax !== selection) {
          disableSaveBtn = false;
        }
        this.setState({
          sslVersionMax: selection,
          isMaxSSLOpen: false,
          disableSaveBtn
        });
      };
      this.handleClientAuthToggle = (_event, isClientAuthOpen) => {
        this.setState({
          isClientAuthOpen
        });
      };
      this.handleClientAuthSelect = (event, selection, isPlaceholder) => {
        let disableSaveBtn = !this.configChanged();
        if (this.state._clientAuth !== selection) {
          disableSaveBtn = false;
        }
        this.setState({
          clientAuth: selection,
          isClientAuthOpen: false,
          disableSaveBtn
        });
      };
      this.handleValidateCertToggle = (_event, isValidateCertOpen) => {
        this.setState({
          isValidateCertOpen
        });
      };
      this.handleValidateCertSelect = (event, selection, isPlaceholder) => {
        let disableSaveBtn = !this.configChanged();
        if (this.state._validateCert !== selection) {
          disableSaveBtn = false;
        }
        this.setState({
          validateCert: selection,
          isValidateCertOpen: false,
          disableSaveBtn
        });
      };
      this.handleChange = this.handleChange.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.handleSwitchChange = this.handleSwitchChange.bind(this);
      this.handleTypeaheadChange = this.handleTypeaheadChange.bind(this);
      this.loadSecurityConfig = this.loadSecurityConfig.bind(this);
      this.loadEnabledCiphers = this.loadEnabledCiphers.bind(this);
      this.loadSupportedCiphers = this.loadSupportedCiphers.bind(this);
      this.loadCerts = this.loadCerts.bind(this);
      this.loadCACerts = this.loadCACerts.bind(this);
      this.loadCSRs = this.loadCSRs.bind(this);
      this.closeConfirmDisable = this.closeConfirmDisable.bind(this);
      this.enableSecurity = this.enableSecurity.bind(this);
      this.disableSecurity = this.disableSecurity.bind(this);
      this.saveSecurityConfig = this.saveSecurityConfig.bind(this);
      this.closeSecurityEnableModal = this.closeSecurityEnableModal.bind(this);
      this.handleReloadConfig = this.handleReloadConfig.bind(this);
      this.onSelectToggle = this.onSelectToggle.bind(this);
      this.onSelectClear = this.onSelectClear.bind(this);
      this.handleTypeaheadChange = this.handleTypeaheadChange.bind(this);
      this.onSecEnableChange = this.onSecEnableChange.bind(this);
    }
    componentDidMount() {
      if (!this.state.loaded) {
        this.setState({ securityEnabled: true }, this.setState({ securityEnabled: false }));
        this.loadSecurityConfig();
      } else {
        this.props.enableTree();
      }
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    handleReloadConfig() {
      this.setState({
        loaded: false,
        configLoaded: false,
        ciphersLoaded: false,
        certsLoaded: false,
        caCertsLoaded: false,
        csrsLoaded: false,
        orphanKeysLoaded: false,
        configLoading: false,
        ciphersLoading: false,
        certsLoading: false,
        caCertsLoading: false,
        csrsLoading: false,
        orphanKeysLoading: false
      }, this.loadSecurityConfig);
    }
    loadSupportedCiphers() {
      this.setState({
        ciphersLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "ciphers",
        "list",
        "--supported"
      ];
      log_cmd("loadSupportedCiphers", "Load the security configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          supportedCiphers: config.items
        }, this.loadEnabledCiphers);
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        let msg = errMsg;
        if ("info" in errMsg) {
          msg = errMsg + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          cockpit_default.format(_83("Error loading security configuration - $0"), msg)
        );
      });
    }
    loadEnabledCiphers() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "ciphers",
        "list",
        "--enabled"
      ];
      log_cmd("loadEnabledCiphers", "Load the security configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        this.setState({
          enabledCiphers: config.items,
          ciphersLoaded: true,
          ciphersLoading: false
        }, this.loadCerts);
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        let msg = errMsg;
        if ("info" in errMsg) {
          msg = errMsg + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          cockpit_default.format(_83("Error loading security configuration - $0"), msg)
        );
      });
    }
    loadCACerts() {
      this.setState({
        caCertsLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "ca-certificate",
        "list"
      ];
      log_cmd("loadCACerts", "Load CA certificates", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const certs = JSON.parse(content);
        const certNames = [];
        for (const cert of certs) {
          certNames.push(cert.attrs.nickname);
        }
        this.setState(
          () => ({
            CACerts: certs,
            CACertNames: certNames,
            caCertsLoaded: true,
            caCertsLoading: false
          }),
          this.loadCSRs
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        let msg = errMsg;
        if ("info" in errMsg) {
          msg = errMsg + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          cockpit_default.format(_83("Error loading CA certificates - $0"), msg)
        );
      });
    }
    loadCerts() {
      this.setState({
        certsLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "certificate",
        "list"
      ];
      log_cmd("loadCerts", "Load certificates", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const certs = JSON.parse(content);
        const certNames = [];
        for (const cert of certs) {
          certNames.push(cert.attrs.nickname);
        }
        this.setState(
          () => ({
            serverCerts: certs,
            serverCertNames: certNames,
            certsLoaded: true,
            certsLoading: false
          }),
          this.loadCACerts
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        let msg = errMsg;
        if ("info" in errMsg) {
          msg = errMsg + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          cockpit_default.format(_83("Error loading server certificates - $0"), msg)
        );
      });
    }
    loadCSRs() {
      this.setState({
        csrsLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "csr",
        "list"
      ];
      log_cmd("loadCSRs", "Load CSRs", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const csrs = JSON.parse(content);
        this.setState(
          () => ({
            serverCSRs: csrs,
            csrsLoaded: true,
            csrsLoading: false
          }),
          this.loadOrphanKeys
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        let msg = errMsg;
        if ("info" in errMsg) {
          msg = errMsg + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          cockpit_default.format(_83("Error loading CSRs - $0"), msg)
        );
      });
    }
    loadOrphanKeys() {
      this.setState({
        orphanKeysLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "key",
        "list",
        "--orphan"
      ];
      log_cmd("loadOrphanKeys", "Load Orphan Keys", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const keys = JSON.parse(content);
        this.setState(
          () => ({
            serverOrphanKeys: keys,
            loaded: true,
            orphanKeysLoaded: true,
            orphanKeysLoading: false
          }),
          this.props.enableTree()
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        if (!errMsg.includes("certutil: no keys found")) {
          this.props.addNotification(
            "error",
            cockpit_default.format(_83("Error loading Orphan Keys - $0"), errMsg)
          );
        }
        this.setState({
          loaded: true,
          serverOrphanKeys: []
        }, this.props.enableTree());
      });
    }
    loadRSAConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "rsa",
        "get"
      ];
      log_cmd("loadRSAConfig", "Load the RSA configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const nickname = config.items.nssslpersonalityssl;
        this.setState(() => ({
          nssslpersonalityssl: nickname,
          _nssslpersonalityssl: nickname,
          configLoaded: true,
          configLoading: false
        }), this.loadSupportedCiphers);
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        let msg = errMsg;
        if ("info" in errMsg) {
          msg = errMsg + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          cockpit_default.format(_83("Error loading security RSA configuration - $0"), msg)
        );
      });
    }
    loadSecurityConfig(saving) {
      this.setState({
        configLoading: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "get"
      ];
      log_cmd("loadSecurityConfig", "Load the security configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.items;
        let secEnabled = false;
        let secReqSecBinds = false;
        let clientAuth = "allowed";
        let validateCert = "warn";
        let cipherPref = "default";
        let allowWeak = false;
        let renegot = true;
        let checkHostname = false;
        let extractPEMFiles = false;
        if ("nstlsallowclientrenegotiation" in config.items) {
          if (config.items.nstlsallowclientrenegotiation === "off") {
            renegot = false;
          }
        }
        if ("nsslapd-security" in attrs) {
          if (attrs["nsslapd-security"].toLowerCase() === "on") {
            secEnabled = true;
          }
        }
        if ("nsslapd-require-secure-binds" in attrs) {
          if (attrs["nsslapd-require-secure-binds"].toLowerCase() === "on") {
            secReqSecBinds = true;
          }
        }
        if ("nssslclientauth" in attrs) {
          if (attrs.nssslclientauth !== "") {
            clientAuth = attrs.nssslclientauth;
          }
        }
        if ("nsslapd-validate-cert" in attrs) {
          if (attrs["nsslapd-validate-cert"] !== "") {
            validateCert = attrs["nsslapd-validate-cert"].toLowerCase();
          }
        }
        if ("allowweakcipher" in attrs) {
          if (attrs.allowweakcipher.toLowerCase() === "on") {
            allowWeak = true;
          }
        }
        if ("nsslapd-ssl-check-hostname" in attrs) {
          if (attrs["nsslapd-ssl-check-hostname"].toLowerCase() === "on") {
            checkHostname = true;
          }
        }
        if ("nsssl3ciphers" in attrs) {
          if (attrs.nsssl3ciphers !== "") {
            cipherPref = attrs.nsssl3ciphers;
          }
        }
        if ("nsslapd-extract-pemfiles" in attrs) {
          if (attrs["nsslapd-extract-pemfiles"].toLowerCase() === "on") {
            extractPEMFiles = true;
          }
        }
        this.setState(() => ({
          securityEnabled: secEnabled,
          requireSecureBinds: secReqSecBinds,
          secureListenhost: attrs["nsslapd-securelistenhost"],
          clientAuth,
          checkHostname,
          validateCert,
          sslVersionMin: attrs.sslversionmin,
          sslVersionMax: attrs.sslversionmax,
          allowWeakCipher: allowWeak,
          cipherPref,
          nstlsallowclientrenegotiation: renegot,
          extractPEMFiles,
          _nstlsallowclientrenegotiation: renegot,
          _securityEnabled: secEnabled,
          _requireSecureBinds: secReqSecBinds,
          _secureListenhost: attrs["nsslapd-securelistenhost"],
          _clientAuth: clientAuth,
          _checkHostname: checkHostname,
          _validateCert: validateCert,
          _sslVersionMin: attrs.sslversionmin,
          _sslVersionMax: attrs.sslversionmax,
          _allowWeakCipher: allowWeak,
          _extractPEMFiles: extractPEMFiles,
          disableSaveBtn: true
        }), function() {
          if (!saving) {
            this.loadRSAConfig();
          }
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        let msg = errMsg;
        if ("info" in errMsg) {
          msg = errMsg + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          cockpit_default.format(_83("Error loading security configuration - $0"), msg)
        );
      });
    }
    handleSwitchChange(value) {
      if (!value) {
        this.setState({ showConfirmDisable: true });
      } else {
        if (this.state.serverCerts.length > 0) {
          this.setState({
            primaryCertName: this.state.nssslpersonalityssl,
            showSecurityEnableModal: true
          });
        } else {
          this.props.addNotification(
            "error",
            _83("There must be at least one server certificate present in the security database to enable security")
          );
        }
      }
    }
    closeSecurityEnableModal() {
      this.setState({
        showSecurityEnableModal: false
      });
    }
    onSecEnableChange(e) {
      const value = e.target.value.trim();
      this.setState({
        primaryCertName: value
      });
    }
    closeConfirmDisable() {
      this.setState({
        showConfirmDisable: false
      });
    }
    enableSecurity() {
      this.setState({
        secEnableSpinner: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "enable"
      ];
      if (this.state._nssslpersonalityssl !== this.state.primaryCertName) {
        const rsa_cmd = [
          "dsconf",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
          "security",
          "rsa",
          "set",
          "--nss-cert-name=" + this.state.primaryCertName
        ];
        log_cmd("enableSecurity", "Update RSA", rsa_cmd);
        cockpit_default.spawn(rsa_cmd, { superuser: true, err: "message" }).done(() => {
          this.loadSecurityConfig();
          log_cmd("enableSecurity", "Enable security", cmd);
          cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
            this.loadSecurityConfig();
            this.props.addNotification(
              "success",
              _83("Successfully enabled security.")
            );
            this.props.addNotification(
              "warning",
              _83("You must restart the Directory Server for these changes to take effect.")
            );
            this.setState({
              securityEnabled: true,
              secEnableSpinner: false,
              showSecurityEnableModal: false
            });
          }).fail((err) => {
            const errMsg = getApiErrorMessage(err);
            let msg = errMsg;
            if ("info" in errMsg) {
              msg = errMsg + " - " + errMsg.info;
            }
            this.props.addNotification(
              "error",
              cockpit_default.format(_83("Error enabling security - $0"), msg)
            );
            this.setState({
              secEnableSpinner: false,
              showSecurityEnableModal: false
            });
          });
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          let msg = errMsg;
          if ("info" in errMsg) {
            msg = errMsg + " - " + errMsg.info;
          }
          this.props.addNotification(
            "error",
            cockpit_default.format(_83("Error enabling security (RSA cert name)- $0"), msg)
          );
          this.setState({
            secEnableSpinner: false,
            showSecurityEnableModal: false
          });
        });
      } else {
        log_cmd("enableSecurity", "Enable security", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
          this.props.addNotification(
            "success",
            _83("Successfully enabled security.")
          );
          this.props.addNotification(
            "warning",
            _83("You must restart the Directory Server for these changes to take effect.")
          );
          this.setState({
            securityEnabled: true,
            secEnableSpinner: false,
            showSecurityEnableModal: false
          });
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          let msg = errMsg;
          if ("info" in errMsg) {
            msg = errMsg + " - " + errMsg.info;
          }
          this.props.addNotification(
            "error",
            cockpit_default.format(_83("Error enabling security - $0"), msg)
          );
          this.setState({
            secEnableSpinner: false,
            showSecurityEnableModal: false
          });
        });
      }
    }
    disableSecurity() {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "disable"
      ];
      log_cmd("disableSecurity", "Disable security", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
        this.props.addNotification(
          "success",
          _83("Successfully disabled security.")
        );
        this.props.addNotification(
          "warning",
          _83("You must restart the Directory Server for these changes to take effect.")
        );
        this.setState({
          securityEnabled: false,
          modalSpinning: false,
          showConfirmDisable: false
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        let msg = errMsg;
        if ("info" in errMsg) {
          msg = errMsg + " - " + errMsg.info;
        }
        this.props.addNotification(
          "error",
          cockpit_default.format(_83("Error disabling security - $0"), msg)
        );
        this.setState({
          modalSpinning: false,
          showConfirmDisable: false
        });
      });
    }
    saveSecurityConfig() {
      let sslMin = this.state._sslVersionMin;
      let sslMax = this.state._sslVersionMax;
      if (this.state._sslVersionMin !== this.state.sslVersionMin) {
        sslMin = this.state.sslVersionMin;
      }
      if (this.state._sslVersionMax !== this.state.sslVersionMax) {
        sslMax = this.state.sslVersionMax;
      }
      if (sslMin > sslMax) {
        this.props.addNotification(
          "error",
          _83("The TLS minimum version must be less than or equal to the TLS maximum version")
        );
        this.loadSecurityConfig();
        return;
      }
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "set"
      ];
      const rsa_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "security",
        "rsa",
        "set"
      ];
      if (this.state._validateCert !== this.state.validateCert) {
        cmd.push("--verify-cert-chain-on-startup=" + this.state.validateCert);
      }
      if (this.state._sslVersionMin !== this.state.sslVersionMin) {
        cmd.push("--tls-protocol-min=" + this.state.sslVersionMin);
      }
      if (this.state._sslVersionMax !== this.state.sslVersionMax) {
        cmd.push("--tls-protocol-max=" + this.state.sslVersionMax);
      }
      if (this.state._clientAuth !== this.state.clientAuth) {
        cmd.push("--tls-client-auth=" + this.state.clientAuth);
      }
      if (this.state._secureListenhost !== this.state.secureListenhost) {
        cmd.push("--listen-host=" + this.state.secureListenhost);
      }
      if (this.state._allowWeakCipher !== this.state.allowWeakCipher) {
        let val = "off";
        if (this.state.allowWeakCipher) {
          val = "on";
        }
        cmd.push("--allow-insecure-ciphers=" + val);
      }
      if (this.state._checkHostname !== this.state.checkHostname) {
        let val = "off";
        if (this.state.checkHostname) {
          val = "on";
        }
        cmd.push("--check-hostname=" + val);
      }
      if (this.state._requireSecureBinds !== this.state.requireSecureBinds) {
        let val = "off";
        if (this.state.requireSecureBinds) {
          val = "on";
        }
        cmd.push("--require-secure-authentication=" + val);
      }
      if (this.state._extractPEMFiles !== this.state.extractPEMFiles) {
        let val = "off";
        if (this.state.extractPEMFiles) {
          val = "on";
        }
        cmd.push("--extract-pemfiles=" + val);
      }
      if (this.state._nstlsallowclientrenegotiation !== this.state.nstlsallowclientrenegotiation) {
        let val = "off";
        if (this.state.nstlsallowclientrenegotiation) {
          val = "on";
        }
        cmd.push("--tls-client-renegotiation=" + val);
      }
      if (this.state._nssslpersonalityssl !== this.state.nssslpersonalityssl) {
        rsa_cmd.push("--nss-cert-name=" + this.state.nssslpersonalityssl);
      }
      if (rsa_cmd.length > 6) {
        log_cmd("saveSecurityConfig", "Applying security RSA config change", rsa_cmd);
        const msg = _83("Successfully updated security RSA configuration.");
        this.setState({
          // Start the spinner
          saving: true
        });
        cockpit_default.spawn(rsa_cmd, { superuser: true, err: "message" }).done((content) => {
          this.loadSecurityConfig();
          if (cmd.length < 6) {
            this.props.addNotification(
              "success",
              msg
            );
            this.props.addNotification(
              "warning",
              _83("You must restart the Directory Server for these changes to take effect.")
            );
            this.setState({
              saving: false
            });
          }
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.loadSecurityConfig();
          this.setState({
            saving: false
          });
          let msg2 = errMsg;
          if ("info" in errMsg) {
            msg2 = errMsg + " - " + errMsg.info;
          }
          this.props.addNotification(
            "error",
            cockpit_default.format(_83("Error updating security RSA configuration - $0"), msg2)
          );
        });
      }
      if (cmd.length > 5) {
        log_cmd("saveSecurityConfig", "Applying security config change", cmd);
        const msg = _83("Successfully updated security configuration.");
        this.setState({
          // Start the spinner
          saving: true
        });
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          this.loadSecurityConfig(1);
          this.props.addNotification(
            "success",
            msg
          );
          this.props.addNotification(
            "warning",
            _83("You must restart the Directory Server for these changes to take effect.")
          );
          this.setState({
            saving: false
          });
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          this.loadSecurityConfig();
          this.setState({
            saving: false
          });
          let msg2 = errMsg;
          if ("info" in errMsg) {
            msg2 = errMsg + " - " + errMsg.info;
          }
          this.props.addNotification(
            "error",
            cockpit_default.format(_83("Error updating security configuration - $0"), msg2)
          );
        });
      }
    }
    handleTypeaheadChange(value, collection) {
      this.setState({
        [collection]: [...this.state[collection], value]
      });
    }
    handleChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const attr = e.target.id;
      let disableSaveBtn = true;
      for (const config_attr of configAttrs) {
        if (attr === config_attr && this.state["_" + config_attr] !== value) {
          disableSaveBtn = false;
          break;
        }
      }
      for (const config_attr of configAttrs) {
        if (attr !== config_attr && this.state["_" + config_attr] !== this.state[config_attr]) {
          disableSaveBtn = false;
          break;
        }
      }
      this.setState({
        [attr]: value,
        disableSaveBtn
      });
    }
    render() {
      let securityPage = "";
      let saveBtnName = _83("Save Settings");
      const extraPrimaryProps = {};
      if (this.state.saving) {
        saveBtnName = _83("Saving settings ...");
        extraPrimaryProps.spinnerAriaValueText = _83("Loading");
      }
      if (this.state.loaded && !this.state.saving) {
        let configPage = "";
        if (this.state.securityEnabled) {
          configPage = /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "ds-margin-bottom-md", children: [
            /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
              /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
                Grid,
                {
                  title: _83("The minimum SSL/TLS version the server will accept (sslversionmin)."),
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GridItem, { className: "ds-label", span: 3, children: _83("Minimum TLS Version") }),
                    /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                      dsBasicComponents_default,
                      {
                        selected: this.state.sslVersionMin,
                        onSelect: this.handleMinSSLSelect,
                        options: ["TLS1.3", "TLS1.2", "TLS1.1", "TLS1.0", "SSL3"],
                        isOpen: this.state.isMinSSLOpen,
                        onToggle: this.handleMinSSLToggle,
                        ariaLabel: "Select Input"
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
                Grid,
                {
                  title: _83("The maximum SSL/TLS version the server will accept (sslversionmax)."),
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GridItem, { className: "ds-label", span: 3, children: _83("Maximum TLS Version") }),
                    /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                      dsBasicComponents_default,
                      {
                        selected: this.state.sslVersionMax,
                        onSelect: this.handleMaxSSLSelect,
                        options: ["TLS1.3", "TLS1.2", "TLS1.1", "TLS1.0", "SSL3"],
                        isOpen: this.state.isMaxSSLOpen,
                        onToggle: this.handleMaxSSLToggle,
                        ariaLabel: "Select Input"
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
                Grid,
                {
                  title: _83("Sets how the Directory Server enforces TLS client authentication (nsSSLClientAuth)."),
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GridItem, { className: "ds-label", span: 3, children: _83("Client Authentication") }),
                    /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                      dsBasicComponents_default,
                      {
                        selected: this.state.clientAuth,
                        onSelect: this.handleClientAuthSelect,
                        options: ["off", "allowed", "required"],
                        isOpen: this.state.isClientAuthOpen,
                        onToggle: this.handleClientAuthToggle,
                        ariaLabel: "Select Input"
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
                Grid,
                {
                  title: _83("Validate server's certificate expiration date (nsslapd-validate-cert)."),
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GridItem, { className: "ds-label", span: 3, children: _83("Validate Certificate") }),
                    /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                      dsBasicComponents_default,
                      {
                        selected: this.state.validateCert,
                        onSelect: this.handleValidateCertSelect,
                        options: ["warn", "on", "off"],
                        isOpen: this.state.isValidateCertOpen,
                        onToggle: this.handleValidateCertToggle,
                        ariaLabel: "Select Input"
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
                Grid,
                {
                  title: _83("This parameter can be used to restrict the Directory Server instance to a single IP interface (hostname, or IP address).  This parameter specifically sets what interface to use for TLS traffic.  Requires restart. (nsslapd-securelistenhost)."),
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GridItem, { className: "ds-label", span: 3, children: _83("Secure Listen Host") }),
                    /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                      TextInput,
                      {
                        value: this.state.secureListenhost,
                        type: "text",
                        id: "secureListenhost",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "server-hostname",
                        onChange: (e, str) => {
                          this.handleChange(e);
                        }
                      }
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                Grid,
                {
                  title: _83("Require all connections use TLS (nsslapd-require-secure-binds)."),
                  children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GridItem, { className: "ds-label", span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                    Checkbox,
                    {
                      id: "requireSecureBinds",
                      isChecked: this.state.requireSecureBinds,
                      onChange: (e, checked) => {
                        this.handleChange(e);
                      },
                      label: _83("Require Secure Connections")
                    }
                  ) })
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                Grid,
                {
                  title: _83("Verify authenticity of a request by matching the host name against the value assigned to the common name (cn) attribute of the subject name (subjectDN field) in the certificate being presented. (nsslapd-ssl-check-hostname)."),
                  children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GridItem, { className: "ds-label", span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                    Checkbox,
                    {
                      id: "checkHostname",
                      isChecked: this.state.checkHostname,
                      onChange: (e, checked) => {
                        this.handleChange(e);
                      },
                      label: _83("Verify Certificate Subject Hostname")
                    }
                  ) })
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                Grid,
                {
                  title: _83("Allow weak ciphers (allowWeakCipher)."),
                  children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GridItem, { className: "ds-label", span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                    Checkbox,
                    {
                      id: "allowWeakCipher",
                      isChecked: this.state.allowWeakCipher,
                      onChange: (e, checked) => {
                        this.handleChange(e);
                      },
                      title: _83("Allow weak ciphers (allowWeakCipher)."),
                      label: _83("Allow Weak Ciphers")
                    }
                  ) })
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                Grid,
                {
                  title: _83("Allow client-initiated renegotiation (nsTLSAllowClientRenegotiation)."),
                  children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GridItem, { className: "ds-label", span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                    Checkbox,
                    {
                      id: "nstlsallowclientrenegotiation",
                      isChecked: this.state.nstlsallowclientrenegotiation,
                      onChange: (e, checked) => {
                        this.handleChange(e);
                      },
                      title: _83("Allow client-initiated renegotiation (nsTLSAllowClientRenegotiation)."),
                      label: _83("Allow Client Renegotiation")
                    }
                  ) })
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                Grid,
                {
                  title: _83("At server shutdown extract the server's certificates and keys to PEM files (nsslapd-extract-pemfiles)."),
                  children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GridItem, { className: "ds-label", span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                    Checkbox,
                    {
                      id: "extractPEMFiles",
                      isChecked: this.state.extractPEMFiles,
                      onChange: (e, checked) => {
                        this.handleChange(e);
                      },
                      label: _83("Extract PEM Files")
                    }
                  ) })
                }
              )
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
              Button,
              {
                variant: "primary",
                className: "ds-margin-top-xlg",
                onClick: () => {
                  this.saveSecurityConfig();
                },
                isDisabled: this.state.disableSaveBtn || this.state.saving,
                isLoading: this.state.saving,
                spinnerAriaValueText: this.state.saving ? _83("Saving") : void 0,
                ...extraPrimaryProps,
                children: saveBtnName
              }
            )
          ] });
        }
        securityPage = /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "ds-margin-bottom-md", children: [
          /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Text, { component: TextVariants.h3, children: [
            _83("Security Settings"),
            /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
              Button,
              {
                variant: "plain",
                "aria-label": _83("Refresh settings"),
                onClick: this.handleReloadConfig,
                children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(SyncAltIcon, { size: "lg" })
              }
            )
          ] }) }) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "ds-tab-table", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Tabs, { className: "ds-margin-top-xlg", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
            /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(TabTitleText, { children: _83("Security Configuration") }), children: /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Grid, { className: "ds-margin-top-xlg ds-left-indent-md", children: [
              /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GridItem, { className: "ds-label", span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                Switch,
                {
                  id: "simple-switch",
                  label: _83("Security Enabled"),
                  labelOff: "Security Disabled",
                  isChecked: this.state.securityEnabled,
                  onChange: (_event, value) => this.handleSwitchChange(value)
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("hr", {}),
              configPage
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(TabTitleText, { children: _83("Certificate Management") }), children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
              CertificateManagement,
              {
                serverId: this.props.serverId,
                CACerts: this.state.CACerts,
                ServerCerts: this.state.serverCerts,
                ServerCSRs: this.state.serverCSRs,
                ServerKeys: this.state.serverOrphanKeys,
                addNotification: this.props.addNotification,
                certDir: this.props.certDir,
                certNicknames: this.state.serverCertNames,
                CACertNicknames: this.state.CACertNames,
                reloadCerts: this.loadCerts
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(TabTitleText, { children: _83("Cipher Preferences") }), children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "ds-indent ds-tab-table", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
              Ciphers,
              {
                serverId: this.props.serverId,
                supportedCiphers: this.state.supportedCiphers,
                cipherPref: this.state.cipherPref,
                enabledCiphers: this.state.enabledCiphers,
                addNotification: this.props.addNotification,
                reload: this.loadSecurityConfig
              },
              this.state.cipherPref
            ) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Tab, { eventKey: 3, title: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(TabTitleText, { children: _83("Encryption Modules") }), children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "ds-indent ds-tab-table", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
              encryptionModules_default,
              {
                serverId: this.props.serverId,
                addNotification: this.props.addNotification,
                serverCertNames: this.state.serverCertNames
              }
            ) }) })
          ] }) })
        ] });
      } else {
        securityPage = /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Text, { component: TextVariants.h3, children: [
            _83("Loading Security Information"),
            /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Spinner, { isInline: true, className: "ds-left-margin", size: "lg" })
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
            ProgressStepper,
            {
              className: "ds-margin-top-xlg",
              "aria-label": "Progress stepper for all the various security related info",
              isCenterAligned: true,
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.configLoading,
                    variant: this.state.configLoaded ? "success" : "pending",
                    id: "configLoading",
                    titleId: "load all the core security information",
                    "aria-label": "Loading the core security information step",
                    icon: this.state.configLoading ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(check_circle_icon_default, {}),
                    children: !this.state.configLoaded ? _83("Loading Configuration") : _83("Configuration Loaded")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.ciphersLoading,
                    variant: this.state.ciphersLoaded ? "success" : "pending",
                    icon: !this.state.ciphersLoaded ? this.state.ciphersLoading ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(check_circle_icon_default, {}),
                    id: "cipherLoading",
                    titleId: "load all the cipher information",
                    "aria-label": "Loading the cipher information step",
                    children: !this.state.ciphersLoaded ? _83("Loading Ciphers") : _83("Ciphers Loaded")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.certsLoading,
                    variant: this.state.certsLoaded ? "success" : "pending",
                    icon: !this.state.certsLoaded ? this.state.certsLoading ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(check_circle_icon_default, {}),
                    id: "loadCerts",
                    titleId: "load all the certificate information",
                    "aria-label": "Loading the certificate information step",
                    children: !this.state.certsLoaded ? _83("Loading Certificates") : _83("Certificates Loaded")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.caCertsLoading,
                    variant: this.state.caCertsLoaded ? "success" : "pending",
                    icon: !this.state.caCertsLoaded ? this.state.caCertsLoading ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(check_circle_icon_default, {}),
                    id: "caCertsLoading",
                    titleId: "load all the CA certificate information",
                    "aria-label": "Loading the CA certificate information step",
                    children: !this.state.caCertsLoaded ? _83("Loading CA Certificates") : _83("CA Certificates Loaded")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.csrsLoading,
                    variant: this.state.csrsLoaded ? "success" : "pending",
                    icon: !this.state.csrsLoaded ? this.state.csrsLoading ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(check_circle_icon_default, {}),
                    id: "csrLoading",
                    titleId: "load all the CSR information",
                    "aria-label": "Loading the CSR information step",
                    children: !this.state.csrsLoaded ? _83("Loading CSRs") : _83("CSRs Loaded")
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
                  ProgressStep,
                  {
                    isCurrent: this.state.orphanKeysLoading,
                    variant: this.state.orphanKeysLoaded ? "success" : "pending",
                    icon: !this.state.orphanKeysLoaded ? this.state.orphanKeysLoading ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(in_progress_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(pending_icon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(check_circle_icon_default, {}),
                    id: "orphanKeysLoading",
                    titleId: "load all the orphan key information",
                    "aria-label": "Loading the orphan key information step",
                    children: !this.state.orphanKeysLoaded ? _83("Loading Orphan Keys") : _83("Orphan Keys Loaded")
                  }
                )
              ]
            }
          )
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: this.state.saving ? "ds-disabled" : "", children: [
        securityPage,
        /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmDisable,
            closeHandler: this.closeConfirmDisable,
            handleChange: this.onModalChange,
            actionHandler: this.disableSecurity,
            spinning: this.state.modalSpinning,
            item: "Requires server restart to take effect.",
            checked: this.state.modalChecked,
            mTitle: _83("Disable Security"),
            mMsg: _83("Are you sure you want to disable security?"),
            mSpinningMsg: _83("Disabling ..."),
            mBtnName: _83("Disable")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
          SecurityEnableModal,
          {
            showModal: this.state.showSecurityEnableModal,
            closeHandler: this.closeSecurityEnableModal,
            handleChange: this.onSecEnableChange,
            saveHandler: this.enableSecurity,
            primaryName: this.state.primaryCertName,
            certs: this.state.serverCerts,
            spinning: this.state.secEnableSpinner
          }
        )
      ] });
    }
  };
  Security.propTypes = {
    addNotification: import_prop_types81.default.func,
    serverId: import_prop_types81.default.string
  };
  Security.defaultProps = {
    serverId: ""
  };

  // src/server.jsx
  var import_jsx_runtime84 = __toESM(require_jsx_runtime(), 1);
  var _84 = cockpit_default.gettext;
  var Server = class extends import_react154.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        firstLoad: true,
        nodes: [],
        node_name: "settings-config",
        node_text: "",
        attrs: [],
        displayAttrs: [],
        loaded: false,
        disableTree: false,
        activeItems: [
          {
            name: _84("Server Settings"),
            id: "settings-config",
            icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(CogIcon, {})
          }
        ]
      };
      this.loadTree = this.loadTree.bind(this);
      this.getAttributes = this.getAttributes.bind(this);
      this.reloadConfig = this.reloadConfig.bind(this);
      this.enableTree = this.enableTree.bind(this);
      this.handleTreeClick = this.handleTreeClick.bind(this);
    }
    componentDidUpdate() {
      if (this.props.wasActiveList.includes(1)) {
        if (this.state.firstLoad) {
          this.loadConfig();
        }
      }
    }
    enableTree() {
      this.setState({
        disableTree: false
      });
    }
    getAttributes() {
      const attr_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "list"
      ];
      log_cmd("getAttributes", "Get attributes for audit log display attributes", attr_cmd);
      cockpit_default.spawn(attr_cmd, { superuser: true, err: "message" }).done((content) => {
        const attrContent = JSON.parse(content);
        const attrs = [];
        for (const content2 of attrContent.items) {
          attrs.push(content2.name[0]);
        }
        this.setState({
          displayAttrs: attrs
        });
      });
    }
    loadConfig() {
      this.setState({
        loaded: false,
        firstLoad: false
      });
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("loadConfig", "Load server configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        this.setState(
          {
            loaded: true,
            attrs
          },
          this.loadTree()
        );
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.setState({
          loaded: true
        });
        this.props.addNotification(
          "error",
          cockpit_default.format(_84("Error loading server configuration - $0"), errMsg)
        );
      });
    }
    reloadConfig() {
      const cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "config",
        "get"
      ];
      log_cmd("reloadConfig", "Reload server configuration", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        const config = JSON.parse(content);
        const attrs = config.attrs;
        this.setState({
          attrs
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.addNotification(
          "error",
          cockpit_default.format(_84("Error reloading server configuration - $0"), errMsg)
        );
      });
    }
    loadTree() {
      const basicData = [
        {
          name: _84("Server Settings"),
          id: "settings-config",
          icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(CogIcon, {})
        },
        {
          name: _84("Tuning & Limits"),
          icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(TachometerAltIcon, {}),
          id: "tuning-config"
        },
        {
          name: _84("Security"),
          icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(LockIcon, {}),
          id: "security-config"
        },
        {
          name: _84("SASL Settings & Mappings"),
          icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(RouteIcon, {}),
          id: "sasl-config"
        },
        {
          name: _84("LDAPI & Autobind"),
          icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(KeyIcon, {}),
          id: "ldapi-config"
        },
        {
          name: _84("Logging"),
          icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(CatalogIcon, {}),
          id: "logging-config",
          children: [
            {
              name: _84("Access Log"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(BookIcon, { size: "sm" }),
              id: "access-log-config"
            },
            {
              name: _84("Audit Log"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(BookIcon, { size: "sm" }),
              id: "audit-log-config"
            },
            {
              name: _84("Audit Failure Log"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(BookIcon, { size: "sm" }),
              id: "auditfail-log-config"
            },
            {
              name: _84("Errors Log"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(BookIcon, { size: "sm" }),
              id: "error-log-config"
            },
            {
              name: _84("Security Log"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(BookIcon, { size: "sm" }),
              id: "security-log-config"
            }
          ],
          defaultExpanded: true
        }
      ];
      this.setState({
        nodes: basicData,
        node_name: this.state.node_name
      }, this.getAttributes());
    }
    handleTreeClick(evt, treeViewItem, parentItem) {
      if (treeViewItem.id !== "logging-config" && treeViewItem.id !== this.state.node_name) {
        this.setState({
          activeItems: [treeViewItem, parentItem],
          node_name: treeViewItem.id,
          disableTree: true
          // Disable the tree to allow node to be fully loaded
        });
      }
    }
    render() {
      const { nodes } = this.state;
      let serverPage = /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
        /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Text, { component: TextVariants.h3, children: _84("Loading Server Configuration ...") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
      ] });
      let server_element = "";
      let disabled = "tree-view-container";
      if (this.state.disableTree) {
        disabled = "tree-view-container ds-disabled";
      }
      if (this.state.loaded) {
        if (this.state.node_name === "settings-config" || this.state.node_name === "") {
          server_element = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
            ServerSettings,
            {
              serverId: this.props.serverId,
              attrs: this.state.attrs,
              version: this.props.version,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification
            }
          );
        } else if (this.state.node_name === "tuning-config") {
          server_element = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
            ServerTuning,
            {
              serverId: this.props.serverId,
              attrs: this.state.attrs,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification
            }
          );
        } else if (this.state.node_name === "sasl-config") {
          server_element = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
            ServerSASL,
            {
              serverId: this.props.serverId,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification
            }
          );
        } else if (this.state.node_name === "security-config") {
          server_element = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
            Security,
            {
              addNotification: this.props.addNotification,
              serverId: this.props.serverId,
              enableTree: this.enableTree,
              certDir: this.state.attrs["nsslapd-certdir"]
            }
          );
        } else if (this.state.node_name === "ldapi-config") {
          server_element = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
            ServerLDAPI,
            {
              serverId: this.props.serverId,
              attrs: this.state.attrs,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification
            }
          );
        } else if (this.state.node_name === "access-log-config") {
          server_element = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
            ServerAccessLog,
            {
              serverId: this.props.serverId,
              attrs: this.state.attrs,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification,
              reload: this.reloadConfig
            }
          );
        } else if (this.state.node_name === "audit-log-config") {
          server_element = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
            ServerAuditLog,
            {
              serverId: this.props.serverId,
              attrs: this.state.attrs,
              displayAttrs: this.state.displayAttrs,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification,
              reload: this.reloadConfig
            }
          );
        } else if (this.state.node_name === "auditfail-log-config") {
          server_element = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
            ServerAuditFailLog,
            {
              serverId: this.props.serverId,
              attrs: this.state.attrs,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification,
              reload: this.reloadConfig
            }
          );
        } else if (this.state.node_name === "error-log-config") {
          server_element = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
            ServerErrorLog,
            {
              serverId: this.props.serverId,
              attrs: this.state.attrs,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification,
              reload: this.reloadConfig
            }
          );
        } else if (this.state.node_name === "security-log-config") {
          server_element = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
            ServerSecurityLog,
            {
              serverId: this.props.serverId,
              attrs: this.state.attrs,
              enableTree: this.enableTree,
              addNotification: this.props.addNotification,
              reload: this.reloadConfig
            }
          );
        }
        serverPage = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "container-fluid", children: /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "ds-container", children: [
          /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Card, { className: "ds-tree", children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
            "div",
            {
              className: disabled,
              id: "server-tree",
              children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
                TreeView,
                {
                  data: nodes,
                  activeItems: this.state.activeItems,
                  onSelect: this.handleTreeClick
                }
              )
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "ds-tree-content", children: server_element })
        ] }) });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { children: serverPage });
    }
  };
  Server.propTypes = {
    addNotification: import_prop_types82.default.func,
    serverId: import_prop_types82.default.string
  };
  Server.defaultProps = {
    serverId: ""
  };

  // src/dsModals.jsx
  var import_react155 = __toESM(require_react(), 1);
  var import_prop_types83 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime85 = __toESM(require_jsx_runtime(), 1);
  var _85 = cockpit_default.gettext;
  var CreateInstanceModal = class extends import_react155.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        createServerId: "",
        createPort: 389,
        createSecurePort: 636,
        createDM: "cn=Directory Manager",
        createDMPassword: "",
        createDMPasswordConfirm: "",
        createDBCheckbox: false,
        createDBSuffix: "",
        createDBName: "",
        createTLSCert: true,
        createInitDB: "noInit",
        loadingCreate: false,
        createOK: false,
        createBuffer: "",
        createCompleted: false,
        modalMsg: "",
        errObj: {}
      };
      this.maxValue = 65535;
      this.onMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        }, () => {
          this.validate();
        });
      };
      this.onConfigChange = (event, id, min3) => {
        const newValue = isNaN(event.target.value) ? min3 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
        }, () => {
          this.validate();
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        }, () => {
          this.validate();
        });
      };
      this.handleFieldChange = this.handleFieldChange.bind(this);
      this.validate = this.validate.bind(this);
      this.handleCreateInstance = this.handleCreateInstance.bind(this);
      this.validInstName = this.validInstName.bind(this);
      this.validRootDN = this.validRootDN.bind(this);
    }
    validInstName(name2) {
      return /^(?!-)[\w#%@_:-]*$/.test(name2);
    }
    validRootDN(dn) {
      if (dn.endsWith(",")) {
        return false;
      }
      const dn_regex = /^([A-Za-z]+=(?=\\S)([ -~]+)$)/;
      const result = dn_regex.test(dn);
      return result;
    }
    validate() {
      let all_good = true;
      let createServerIdMsg = "";
      const errObj = {};
      const reqAttrs = [
        "createServerId",
        "createDM",
        "createDMPassword",
        "createDMPasswordConfirm"
      ];
      const dnAttrs = [
        "createDM"
      ];
      if (this.state.createServerId !== "") {
        if (this.state.createServerId.length > 80) {
          all_good = false;
          errObj.createServerId = true;
          createServerIdMsg = _85("Instance name must be less than 80 characters");
        } else if (!this.validInstName(this.state.createServerId)) {
          all_good = false;
          errObj.createServerId = true;
          createServerIdMsg = _85("Instance name can only contain letters, numbers, and these characters: % # - @ : _");
        }
      }
      for (const attr of reqAttrs) {
        if (this.state[attr] === "") {
          all_good = false;
          errObj[attr] = true;
        }
      }
      for (const attr of dnAttrs) {
        if (this.state[attr] !== "" && !valid_dn(this.state[attr])) {
          all_good = false;
          errObj[attr] = true;
        }
      }
      if (this.state.createDMPassword !== this.state.createDMPasswordConfirm || this.state.createDMPassword.length < 8) {
        all_good = false;
        errObj.createDMPassword = true;
        errObj.createDMPasswordConfirm = true;
      }
      if (this.state.createDBCheckbox) {
        if (!valid_db_name(this.state.createDBName)) {
          all_good = false;
          errObj["createDBName"] = true;
        }
        if (!valid_dn(this.state.createDBSuffix)) {
          all_good = false;
          errObj.createDBSuffix = true;
        }
      }
      this.setState({
        createOK: all_good,
        createServerIdMsg,
        errObj
      });
    }
    handleFieldChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      }, () => {
        this.validate();
      });
    }
    handleCreateInstance() {
      const {
        createServerId,
        createPort,
        createSecurePort,
        createDM,
        createDMPassword,
        createDBSuffix,
        createDBName,
        createTLSCert,
        createInitDB,
        createDBCheckbox
      } = this.state;
      const { closeHandler, addNotification, loadInstanceList } = this.props;
      let self_sign = "False";
      if (createTLSCert) {
        self_sign = "True";
      }
      let newServerId = createServerId;
      newServerId = newServerId.replace(/^slapd-/i, "");
      let setup_inf = "[general]\nconfig_version = 2\nfull_machine_name = FQDN\n\n[slapd]\nuser = dirsrv\ngroup = dirsrv\ninstance_name = " + newServerId + "\nport = " + createPort + "\nroot_dn = " + createDM + "\nsecure_port = " + createSecurePort + "\nself_sign_cert = " + self_sign + "\n";
      if (createDBCheckbox) {
        setup_inf += "\n[backend-" + createDBName + "]\nsuffix = " + createDBSuffix + "\n";
        if (createInitDB === "createSample") {
          setup_inf += "sample_entries = yes\n";
        }
        if (createInitDB === "createSuffix") {
          setup_inf += "create_suffix_entry = yes\n";
        }
      }
      this.setState({
        loadingCreate: true,
        createBuffer: ""
      });
      const hostname_cmd = ["hostnamectl", "status", "--static"];
      log_cmd("handleCreateInstance", "Get FQDN ...", hostname_cmd);
      cockpit_default.spawn(hostname_cmd, { superuser: true, err: "message" }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.setState({
          loadingCreate: false
        });
        addNotification("error", cockpit_default.format(_85("Failed to get hostname! $0"), errMsg));
      }).done((data) => {
        if (data.trim() === "") {
          data = "localhost.localdomain";
        }
        setup_inf = setup_inf.replace("FQDN", data);
        const setup_file = "/tmp/389-setup-" + (/* @__PURE__ */ new Date()).getTime() + ".inf";
        const rm_cmd = ["rm", setup_file];
        const create_file_cmd = ["touch", setup_file];
        log_cmd("handleCreateInstance", "Setting FQDN...", create_file_cmd);
        cockpit_default.spawn(create_file_cmd, { superuser: true, err: "message" }).fail((err) => {
          this.setState({
            loadingCreate: false
          });
          addNotification(
            "error",
            cockpit_default.format(_85("Failed to create installation file! $0"), err.message)
          );
        }).done(() => {
          const chmod_cmd = ["chmod", "600", setup_file];
          log_cmd("handleCreateInstance", "Setting initial INF file permissions...", chmod_cmd);
          cockpit_default.spawn(chmod_cmd, { superuser: true, err: "message" }).fail((err) => {
            cockpit_default.spawn(rm_cmd, { superuser: true, err: "message" });
            this.setState({
              loadingCreate: false
            });
            addNotification(
              "error",
              cockpit_default.format(_85("Failed to set permissions on setup file $0: $1"), setup_file, err.message)
            );
          }).done(() => {
            const cmd = [
              "/bin/sh",
              "-c",
              "/usr/bin/echo -e '" + setup_inf + "' >> " + setup_file
            ];
            let createBuffer = "";
            log_cmd("handleCreateInstance", "Apply changes to INF file...", "");
            cockpit_default.spawn(cmd, { superuser: true, err: "message" }).fail((err) => {
              this.setState({
                loadingCreate: false
              });
              addNotification(
                "error",
                cockpit_default.format(_85("Failed to populate installation file! $0"), err.message)
              );
            }).done(() => {
              const cmd2 = ["dscreate", "-j", "from-file", setup_file];
              log_cmd("handleCreateInstance", "Creating instance...", cmd2);
              cockpit_default.spawn(cmd2, {
                superuser: true,
                err: "message"
              }).fail((err) => {
                const errMsg = getApiErrorMessage(err.message);
                cockpit_default.spawn(rm_cmd, { superuser: true });
                this.setState({
                  loadingCreate: false
                });
                addNotification(
                  "error",
                  `${errMsg}`
                );
              }).done(() => {
                log_cmd("handleCreateInstance", "Instance creation complete, remove INF file...", rm_cmd);
                cockpit_default.spawn(rm_cmd, { superuser: true });
                const dm_pw_cmd = [
                  "dsconf",
                  "-j",
                  "ldapi://%2fvar%2frun%2fslapd-" + newServerId + ".socket",
                  "directory_manager",
                  "password_change"
                ];
                const config = {
                  cmd: dm_pw_cmd,
                  promptArg: "",
                  passwd: createDMPassword,
                  addNotification,
                  success_msg: cockpit_default.format(_85("Successfully created instance: slapd-$0"), createServerId),
                  error_msg: _85("Failed to set Directory Manager password"),
                  state_callback: () => {
                    this.setState({ loadingCreate: false });
                  },
                  reload_func: loadInstanceList,
                  reload_arg: createServerId,
                  ext_func: closeHandler,
                  ext_arg: "",
                  funcName: "handleCreateInstance",
                  funcDesc: _85("Set Directory Manager password...")
                };
                callCmdStreamPassword(config);
              }).stream((line) => {
                this.setState({
                  createBuffer: this.state.createBuffer + line
                });
              });
            });
          });
        });
      });
    }
    render() {
      const { showModal, closeHandler } = this.props;
      const {
        loadingCreate,
        createServerId,
        createPort,
        createSecurePort,
        createDM,
        createDMPassword,
        createDMPasswordConfirm,
        createDBCheckbox,
        createDBSuffix,
        createDBName,
        createTLSCert,
        createInitDB,
        createOK,
        createBuffer,
        errObj
      } = this.state;
      let saveBtnName = _85("Create Instance");
      const extraPrimaryProps = {};
      if (loadingCreate) {
        saveBtnName = _85("Creating Instance ...");
        extraPrimaryProps.spinnerAriaValueText = "Saving";
      }
      let createBufferItem = null;
      if (createBuffer !== "") {
        createBufferItem = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
          LogViewer,
          {
            data: createBuffer,
            isTextWrapped: false,
            hasLineNumbers: false,
            scrollToRow: createBuffer.length,
            height: "200px"
          }
        );
      }
      return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
        Modal,
        {
          variant: ModalVariant.medium,
          title: _85("Create New Server Instance"),
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
              Button,
              {
                variant: "primary",
                onClick: this.handleCreateInstance,
                isDisabled: !createOK || loadingCreate,
                isLoading: loadingCreate,
                spinnerAriaValueText: loadingCreate ? "Saving" : void 0,
                ...extraPrimaryProps,
                children: saveBtnName
              },
              "confirm"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
              Button,
              {
                variant: "link",
                onClick: closeHandler,
                isDisabled: loadingCreate,
                children: _85("Close")
              },
              "close"
            )
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: loadingCreate ? "ds-disabled" : "", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
              Grid,
              {
                className: "ds-margin-top",
                title: _85("The instance name, this is what gets appended to 'slapd-'. The instance name can only contain letters, numbers, and: # % @ : - _"),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(GridItem, { className: "ds-label", span: 4, children: _85("Instance Name") }),
                  /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(GridItem, { span: 8, children: [
                    /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
                      TextInput,
                      {
                        value: createServerId,
                        type: "text",
                        id: "createServerId",
                        "aria-describedby": "horizontal-form-name-helper",
                        name: "createServerId",
                        onChange: (e, str) => {
                          this.handleFieldChange(e);
                        },
                        validated: errObj.createServerId ? ValidatedOptions.error : ValidatedOptions.default
                      }
                    ),
                    errObj.createServerId && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(FormHelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(HelperTextItem, { variant: "error", children: this.state.createServerIdMsg }) }) })
                  ] })
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Grid, { title: _85("The server port number should be in the range of 0 to 65534"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(GridItem, { className: "ds-label", span: 4, children: _85("Port") }),
              /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(GridItem, { span: 8, children: [
                /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
                  NumberInput,
                  {
                    value: createPort,
                    min: 1,
                    max: 65534,
                    onMinus: () => {
                      this.onMinusConfig("createPort");
                    },
                    onChange: (e) => {
                      this.onConfigChange(e, "createPort", 0);
                    },
                    onPlus: () => {
                      this.onPlusConfig("createPort");
                    },
                    inputName: "input",
                    inputAriaLabel: "number input",
                    minusBtnAriaLabel: "minus",
                    plusBtnAriaLabel: "plus",
                    widthChars: 8
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(FormHelperText, { className: "ds-info-color", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(HelperTextItem, { variant: "indeterminate", children: _85("Port 0 will disable non-TLS connections") }) }) })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Grid, { title: _85("The secure port number for TLS connections. It should be in the range of 1 to 65534"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(GridItem, { className: "ds-label", span: 4, children: _85("Secure Port") }),
              /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
                NumberInput,
                {
                  value: createSecurePort,
                  min: 1,
                  max: 65534,
                  onMinus: () => {
                    this.onMinusConfig("createSecurePort");
                  },
                  onChange: (e) => {
                    this.onConfigChange(e, "createSecurePort", 1);
                  },
                  onPlus: () => {
                    this.onPlusConfig("createSecurePort");
                  },
                  inputName: "input",
                  inputAriaLabel: "number input",
                  minusBtnAriaLabel: "minus",
                  plusBtnAriaLabel: "plus",
                  widthChars: 8
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Grid, { title: _85("Create a self-signed certificate database in /etc/dirsrc/ssca directory"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(GridItem, { className: "ds-label-checkbox", span: 4, children: _85("Create Self-Signed TLS Certificate") }),
              /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
                Checkbox,
                {
                  id: "createTLSCert",
                  isChecked: createTLSCert,
                  onChange: (e, checked) => {
                    this.handleFieldChange(e);
                  }
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Grid, { title: _85("The DN for the unrestricted user"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(GridItem, { className: "ds-label", span: 4, children: _85("Directory Manager DN") }),
              /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(GridItem, { span: 8, children: [
                /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
                  TextInput,
                  {
                    value: createDM,
                    type: "text",
                    id: "createDM",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "createDM",
                    onChange: (e, str) => {
                      this.handleFieldChange(e);
                    },
                    validated: errObj.createDM ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ),
                errObj.createDM && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(FormHelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(HelperTextItem, { variant: "error", children: _85("Enter a valid DN") }) }) })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Grid, { title: _85("Directory Manager password must be at least 8 characters in length"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(GridItem, { className: "ds-label", span: 4, children: _85("Directory Manager Password") }),
              /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(GridItem, { span: 8, children: [
                /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
                  TextInput,
                  {
                    value: createDMPassword,
                    type: "password",
                    id: "createDMPassword",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "createDMPassword",
                    onChange: (e, str) => {
                      this.handleFieldChange(e);
                    },
                    validated: errObj.createDMPassword ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ),
                errObj.createDMPassword && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(FormHelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(HelperTextItem, { variant: "error", children: "Password must be set with at least 8 characters, and it must match the confirmation password" }) }) })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Grid, { title: _85("Confirm the previously entered password"), children: [
              /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(GridItem, { className: "ds-label", span: 4, children: _85("Confirm Password") }),
              /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(GridItem, { span: 8, children: [
                /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
                  TextInput,
                  {
                    value: createDMPasswordConfirm,
                    type: "password",
                    id: "createDMPasswordConfirm",
                    "aria-describedby": "horizontal-form-name-helper",
                    name: "createDMPasswordConfirm",
                    onChange: (e, str) => {
                      this.handleFieldChange(e);
                    },
                    validated: errObj.createDMPasswordConfirm ? ValidatedOptions.error : ValidatedOptions.default
                  }
                ),
                errObj.createDMPasswordConfirm && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(FormHelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(HelperTextItem, { variant: "error", children: "Confirmation password must be set with at least 8 characters, and it must match the first password" }) }) })
              ] })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Grid, { className: "ds-margin-top", title: _85("Create a database during the installation"), children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
              Checkbox,
              {
                id: "createDBCheckbox",
                label: _85("Create Database"),
                isChecked: createDBCheckbox,
                onChange: (e, checked) => {
                  this.handleFieldChange(e);
                }
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: createDBCheckbox ? "" : "ds-hidden", children: [
              /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Grid, { title: _85("Database suffix, like 'dc=example,dc=com'. The suffix must be a valid LDAP Distinguished Name (DN)"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(GridItem, { className: "ds-label", offset: 1, span: 3, children: _85("Database Suffix") }),
                /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(GridItem, { span: 8, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
                    TextInput,
                    {
                      value: createDBSuffix,
                      placeholder: "e.g. dc=company,dc=com",
                      type: "text",
                      id: "createDBSuffix",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "createDBSuffix",
                      isDisabled: !createDBCheckbox,
                      onChange: (e, str) => {
                        this.handleFieldChange(e);
                      },
                      validated: errObj.createDBSuffix ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  errObj.createDBSuffix && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(FormHelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(HelperTextItem, { variant: "error", children: _85("Value must be a valid DN") }) }) })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Grid, { className: "ds-margin-top", title: _85("The name for the backend database, like 'userroot'. The name can be a combination of alphanumeric characters, dashes (-), and underscores (_). No other characters are allowed, and the name must be unique across all backends"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(GridItem, { className: "ds-label", offset: 1, span: 3, children: _85("Database Name") }),
                /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(GridItem, { span: 8, children: [
                  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
                    TextInput,
                    {
                      value: createDBName,
                      placeholder: "e.g. userRoot",
                      type: "text",
                      id: "createDBName",
                      "aria-describedby": "horizontal-form-name-helper",
                      name: "createDBName",
                      isDisabled: !createDBCheckbox,
                      onChange: (e, str) => {
                        this.handleFieldChange(e);
                      },
                      validated: errObj.createDBName ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  errObj.createDBName && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(FormHelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(HelperText, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(HelperTextItem, { variant: "error", children: createDBName === "" ? _85("Name is required") : "Invalid database name" }) }) })
                ] })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(GridItem, { className: "ds-label", offset: 1, span: 3, children: _85("Database Initialization") }),
                /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
                  FormSelect,
                  {
                    id: "createInitDB",
                    value: createInitDB,
                    onChange: (event, value) => {
                      this.handleFieldChange(event);
                    },
                    "aria-label": "FormSelect Input",
                    isDisabled: !createDBCheckbox,
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(FormSelectOption, { value: "noInit", label: _85("Do Not Initialize Database") }, "1"),
                      /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(FormSelectOption, { value: "createSuffix", label: _85("Create Suffix Entry") }, "2"),
                      /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(FormSelectOption, { value: "createSample", label: _85("Create Sample Entries") }, "3")
                    ]
                  }
                ) })
              ] })
            ] }),
            createBufferItem,
            /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: createDBCheckbox ? "ds-margin-top ds-margin-bottom" : "ds-margin-top ds-margin-bottom-md" })
          ] }) })
        }
      );
    }
  };
  var SchemaReloadModal = class extends import_react155.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        reloadSchemaDir: "",
        loadingSchemaTask: false
      };
      this.handleReloadSchema = this.handleReloadSchema.bind(this);
      this.handleFieldChange = this.handleFieldChange.bind(this);
    }
    handleFieldChange(e) {
      this.setState({
        [e.target.id]: e.target.value
      });
    }
    handleReloadSchema(e) {
      const { addNotification, serverId, closeHandler } = this.props;
      const { reloadSchemaDir } = this.state;
      this.setState({
        loadingSchemaTask: true
      });
      let cmd = ["dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket", "schema", "reload", "--wait"];
      if (reloadSchemaDir !== "") {
        cmd = [...cmd, "--schemadir", reloadSchemaDir];
      }
      log_cmd("handleReloadSchema", "Reload schema files", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
        addNotification("success", _85("Successfully reloaded schema"));
        this.setState({
          loadingSchemaTask: false
        });
        closeHandler();
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        addNotification("error", cockpit_default.format(_85("Failed to reload schema files - $0"), errMsg));
        closeHandler();
      });
    }
    render() {
      const { loadingSchemaTask, reloadSchemaDir } = this.state;
      const { showModal, closeHandler } = this.props;
      let spinner = "";
      if (loadingSchemaTask) {
        spinner = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "ds-margin-top ds-modal-spinner", children: [
          /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Spinner, { size: "lg" }),
          "Reloading schema files..."
        ] }) });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
        Modal,
        {
          variant: ModalVariant.small,
          title: _85("Reload Schema Files"),
          "aria-labelledby": "ds-modal",
          isOpen: showModal,
          onClose: closeHandler,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Button, { variant: "primary", onClick: this.handleReloadSchema, children: _85("Reload Schema") }, "confirm"),
            /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Button, { variant: "link", onClick: closeHandler, children: _85("Cancel") }, "cancel")
          ],
          children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Form, { isHorizontal: true, autoComplete: "off", children: [
            /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Grid, { title: _85("The name of the database link."), children: [
              /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(GridItem, { className: "ds-label", span: 3, children: "Schema File Directory" }),
              /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
                TextInput,
                {
                  value: reloadSchemaDir,
                  type: "text",
                  id: "reloadSchemaDir",
                  "aria-describedby": "horizontal-form-name-helper",
                  name: "reloadSchemaDir",
                  onChange: (e, str) => {
                    this.handleFieldChange(e);
                  }
                }
              ) })
            ] }),
            spinner
          ] })
        }
      );
    }
  };
  var ManageBackupsModal = class extends import_react155.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeKey: 1,
        showConfirmBackupDelete: false,
        showConfirmBackup: false,
        showConfirmRestore: false,
        showConfirmRestoreReplace: false,
        showConfirmLDIFReplace: false,
        showBackupModal: false,
        backupSpinning: false,
        refreshing: false,
        backupName: "",
        deleteBackup: "",
        modalSpinning: false,
        modalChecked: false,
        errObj: {},
        backupBuffer: "",
        backupCompleted: false,
        restoreCompleted: false
      };
      this.handleNavSelect = this.handleNavSelect.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.doBackup = this.doBackup.bind(this);
      this.deleteBackup = this.deleteBackup.bind(this);
      this.restoreBackup = this.restoreBackup.bind(this);
      this.showConfirmRestore = this.showConfirmRestore.bind(this);
      this.closeConfirmRestore = this.closeConfirmRestore.bind(this);
      this.showConfirmBackup = this.showConfirmBackup.bind(this);
      this.closeConfirmBackup = this.closeConfirmBackup.bind(this);
      this.showConfirmBackupDelete = this.showConfirmBackupDelete.bind(this);
      this.closeConfirmBackupDelete = this.closeConfirmBackupDelete.bind(this);
      this.handleShowBackupModal = this.handleShowBackupModal.bind(this);
      this.closeBackupModal = this.closeBackupModal.bind(this);
      this.validateBackup = this.validateBackup.bind(this);
      this.closeConfirmRestoreReplace = this.closeConfirmRestoreReplace.bind(this);
    }
    closeExportModal() {
      this.setState({
        showExportModal: false
      });
    }
    handleShowBackupModal() {
      this.setState({
        showBackupModal: true,
        backupSpinning: false,
        backupName: "",
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeBackupModal() {
      this.setState({
        showBackupModal: false,
        backupBuffer: "",
        backupCompleted: false
      });
    }
    showConfirmBackup(name2) {
      this.setState({
        showConfirmBackup: true,
        backupName: name2,
        modalChecked: false,
        modalSpinning: false,
        backupCompleted: false
      });
    }
    closeConfirmBackup() {
      this.setState({
        showConfirmBackup: false,
        backupCompleted: false
      });
    }
    showConfirmRestore(name2) {
      this.setState({
        showConfirmRestore: true,
        backupName: name2,
        modalChecked: false,
        modalSpinning: false,
        backupBuffer: ""
      });
    }
    closeConfirmRestore() {
      this.setState({
        showConfirmRestore: false,
        modalSpinning: false,
        modalChecked: false,
        backupBuffer: ""
      });
    }
    showConfirmBackupDelete(name2) {
      this.setState({
        showConfirmBackupDelete: true,
        backupName: name2,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmBackupDelete() {
      this.setState({
        showConfirmBackupDelete: false
      });
    }
    closeConfirmRestoreReplace() {
      this.setState({
        showConfirmRestoreReplace: false
      });
    }
    validateBackup() {
      for (let i = 0; i < this.props.backups.length; i++) {
        if (this.state.backupName === this.props.backups[i].name) {
          this.setState({
            showConfirmRestoreReplace: true
          });
          return;
        }
      }
      this.doBackup();
    }
    doBackup() {
      this.setState({
        backupSpinning: true,
        backupBuffer: ""
      });
      const cmd = ["dsctl", "-j", this.props.serverId, "status"];
      cockpit_default.spawn(cmd, { superuser: true }).done((status_data) => {
        const status_json = JSON.parse(status_data);
        if (status_json.running === true) {
          const cmd2 = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "backup",
            "create"
          ];
          if (this.state.backupName !== "") {
            if (bad_file_name(this.state.backupName)) {
              this.props.addNotification(
                "warning",
                _85("Backup name should not be a path.  All backups are stored in the server's backup directory")
              );
              return;
            }
            cmd2.push(this.state.backupName);
          }
          cmd2.push("--watch");
          let backupBuffer = "";
          log_cmd("doBackup", "Add backup task online", cmd2);
          cockpit_default.spawn(cmd2, { pty: true, superuser: true, err: "message" }).done((content) => {
            this.props.reload();
            this.setState({
              backupCompleted: true,
              backupSpinning: false
            });
            const cmd3 = [
              "dsconf",
              "-j",
              "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
              "config",
              "get",
              "nsslapd-bakdir"
            ];
            log_cmd("doBackup", "Get the backup directory", cmd3);
            cockpit_default.spawn(cmd3, { superuser: true, err: "message" }).done((content2) => {
              const config = JSON.parse(content2);
              const attrs = config.attrs;
              this.props.addNotification(
                "success",
                cockpit_default.format(_85("Server has been backed up. You can find the backup in $0 directory on the server machine."), attrs["nsslapd-bakdir"][0])
              );
            }).fail((err) => {
              const errMsg = getApiErrorMessage(err);
              this.props.addNotification(
                "error",
                cockpit_default.format(_85("Error while trying to get the server's backup directory - $0"), errMsg)
              );
              this.setState({
                backupBuffer: "",
                backupCompleted: true
              });
            });
          }).fail((err) => {
            const errMsg = getApiErrorMessage(err);
            this.props.reload();
            this.setState({
              backupCompleted: true,
              backupSpinning: false
            });
            this.props.addNotification(
              "error",
              cockpit_default.format(_85("Failure backing up server - $0"), errMsg)
            );
          }).stream((data) => {
            backupBuffer += data;
            this.setState({
              backupBuffer
            });
          });
        } else {
          let backupBuffer = "";
          const cmd2 = ["dsctl", "-j", this.props.serverId, "db2bak"];
          if (this.state.backupName !== "") {
            if (bad_file_name(this.state.backupName)) {
              this.props.addNotification(
                "warning",
                _85("Backup name should not be a path.  All backups are stored in the server's backup directory")
              );
              return;
            }
            cmd2.push(this.state.backupName);
          }
          cmd2.push("--watch");
          log_cmd("doBackup", "Doing backup of the server offline", cmd2);
          cockpit_default.spawn(cmd2, { pty: true, superuser: true, err: "message" }).done((content) => {
            this.props.reload();
            this.setState({
              backupCompleted: true,
              backupSpinning: false
            });
            this.props.addNotification("success", _85("Server has been backed up"));
          }).fail((err) => {
            const errMsg = getApiErrorMessage(err);
            this.props.reload();
            this.setState({
              backupCompleted: true,
              backupSpinning: false
            });
            this.props.addNotification(
              "error",
              cockpit_default.format(_85("Failure backing up server - $0"), errMsg)
            );
          }).stream((data) => {
            backupBuffer += data;
            this.setState({
              backupBuffer
            });
          });
        }
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        console.log("Failed to check the server status", errMsg);
      });
    }
    restoreBackup() {
      this.setState({
        modalSpinning: true,
        backupBuffer: ""
      });
      let backupBuffer = "";
      const cmd = ["dsctl", "-j", this.props.serverId, "status"];
      cockpit_default.spawn(cmd, { superuser: true }).done((status_data) => {
        const status_json = JSON.parse(status_data);
        if (status_json.running === true) {
          const cmd2 = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "backup",
            "restore",
            this.state.backupName,
            "--watch"
          ];
          log_cmd("restoreBackup", "Restoring server online", cmd2);
          cockpit_default.spawn(cmd2, { pty: true, superuser: true, err: "message" }).done((content) => {
            this.setState({
              restoreCompleted: true,
              modalSpinning: false
            });
            this.props.addNotification("success", _85("Server has been restored"));
          }).fail((err) => {
            const errMsg = getApiErrorMessage(err);
            this.setState({
              restoreCompleted: true,
              modalSpinning: false
            });
            this.props.addNotification(
              "error",
              cockpit_default.format(_85("Failure restoring up server - $0"), errMsg)
            );
          }).stream((data) => {
            backupBuffer += data;
            this.setState({
              backupBuffer
            });
          });
        } else {
          const cmd2 = [
            "dsctl",
            "-j",
            this.props.serverId,
            "bak2db",
            this.state.backupName,
            "--watch"
          ];
          log_cmd("restoreBackup", "Restoring server offline", cmd2);
          cockpit_default.spawn(cmd2, { pty: true, superuser: true, err: "message" }).done((content) => {
            this.setState({
              restoreCompleted: true,
              modalSpinning: false
            });
            this.props.addNotification("success", _85("Server has been restored"));
          }).fail((err) => {
            const errMsg = getApiErrorMessage(err);
            this.setState({
              restoreCompleted: true,
              modalSpinning: false
            });
            this.props.addNotification(
              "error",
              cockpit_default.format(_85("Failure restoring up server - $0"), errMsg)
            );
          }).stream((data) => {
            backupBuffer += data;
            this.setState({
              backupBuffer
            });
          });
        }
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        console.log("Failed to check the server status", errMsg);
      });
    }
    deleteBackup(e) {
      this.setState({
        modalSpinning: true
      });
      const cmd = [
        "dsctl",
        "-j",
        this.props.serverId,
        "backups",
        "--delete",
        this.state.backupName
      ];
      log_cmd("deleteBackup", "Deleting backup", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.props.reload();
        this.setState({
          modalSpinning: false
        });
        this.props.addNotification("success", _85("Backup was successfully deleted"));
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.props.reload();
        this.setState({
          modalSpinning: false
        });
        this.props.addNotification("error", cockpit_default.format(_85("Failure deleting backup - $0"), errMsg));
      });
    }
    handleNavSelect(key) {
      this.setState({ activeKey: key });
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      let valueErr = false;
      const errObj = this.state.errObj;
      if (value === "") {
        valueErr = true;
      }
      errObj[e.target.id] = valueErr;
      this.setState({
        [e.target.id]: value,
        errObj
      });
    }
    render() {
      const { showModal, closeHandler, backups } = this.props;
      let bufferItem = null;
      if (this.state.backupBuffer !== "") {
        bufferItem = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
          LogViewer,
          {
            data: this.state.backupBuffer,
            isTextWrapped: false,
            hasLineNumbers: false,
            scrollToRow: this.state.backupBuffer.length,
            height: "200px"
          }
        );
      }
      return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: _85("Manage Backups"),
            "aria-labelledby": "ds-modal",
            isOpen: showModal,
            onClose: closeHandler,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Button, { variant: "primary", onClick: this.handleShowBackupModal, children: _85("Create Backup") }, "confirm")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
              BackupTable,
              {
                className: "ds-margin-top-xlg",
                rows: backups,
                confirmRestore: this.showConfirmRestore,
                confirmDelete: this.showConfirmBackupDelete
              },
              backups
            )
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
          BackupModal,
          {
            showModal: this.state.showBackupModal,
            closeHandler: this.closeBackupModal,
            handleChange: this.onModalChange,
            saveHandler: this.validateBackup,
            spinning: this.state.backupSpinning,
            watchBuffer: bufferItem,
            error: this.state.errObj,
            backupCompleted: this.state.backupCompleted
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmRestore,
            closeHandler: this.closeConfirmRestore,
            handleChange: this.onModalChange,
            actionHandler: this.restoreBackup,
            spinning: this.state.modalSpinning,
            item: bufferItem ? bufferItem : this.state.backupName,
            checked: this.state.modalChecked,
            mTitle: _85("Restore Backup"),
            mMsg: _85("Are you sure you want to restore this backup?"),
            mSpinningMsg: _85("Restoring ..."),
            mBtnName: this.state.restoreCompleted ? null : _85("Restore Backup")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmBackupDelete,
            closeHandler: this.closeConfirmBackupDelete,
            handleChange: this.onModalChange,
            actionHandler: this.deleteBackup,
            spinning: this.state.modalSpinning,
            item: this.state.backupName,
            checked: this.state.modalChecked,
            mTitle: _85("Delete Backup"),
            mMsg: _85("Are you sure you want to delete this backup?"),
            mSpinningMsg: _85("Deleting ..."),
            mBtnName: _85("Delete Backup")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showConfirmRestoreReplace,
            closeHandler: this.closeConfirmRestoreReplace,
            handleChange: this.onModalChange,
            actionHandler: this.deleteBackup,
            spinning: this.state.modalSpinning,
            item: bufferItem ? bufferItem : this.state.backupName,
            checked: this.state.modalChecked,
            mTitle: _85("Replace Existing Backup"),
            mMsg: _85(" backup already eixsts with the same name, do you want to replace it?"),
            mSpinningMsg: _85("Replacing ..."),
            mBtnName: _85("Replace Backup")
          }
        )
      ] });
    }
  };
  CreateInstanceModal.propTypes = {
    showModal: import_prop_types83.default.bool,
    closeHandler: import_prop_types83.default.func,
    addNotification: import_prop_types83.default.func,
    loadInstanceList: import_prop_types83.default.func
  };
  CreateInstanceModal.defaultProps = {
    showModal: false
  };
  SchemaReloadModal.propTypes = {
    showModal: import_prop_types83.default.bool,
    closeHandler: import_prop_types83.default.func,
    addNotification: import_prop_types83.default.func,
    serverId: import_prop_types83.default.string
  };
  SchemaReloadModal.defaultProps = {
    showModal: false,
    serverId: ""
  };
  ManageBackupsModal.propTypes = {
    showModal: import_prop_types83.default.bool,
    closeHandler: import_prop_types83.default.func,
    addNotification: import_prop_types83.default.func,
    serverId: import_prop_types83.default.string
  };
  ManageBackupsModal.defaultProps = {
    showModal: false,
    serverId: ""
  };

  // src/LDAPEditor.jsx
  var import_react182 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/lib/utils.jsx
  var import_react156 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/lib/options.jsx
  var LdapOptions = {
    sizeLimit: 2e3,
    timeLimit: 10
  };
  function getSizeLimit() {
    return LdapOptions.sizeLimit;
  }
  function getTimeLimit() {
    return LdapOptions.timeLimit;
  }

  // src/lib/ldap_editor/lib/constants.jsx
  var ENTRY_MENU = {
    search: "search",
    edit: "edit",
    new: "new",
    rename: "rename",
    lockRole: "lockRole",
    lockAccount: "lockAccount",
    unlockRole: "unlockRole",
    unlockAccount: "unlockAccount",
    acis: "acis",
    cos: "cos",
    delete: "delete",
    refresh: "refresh"
  };
  var BINARY_ATTRIBUTES = [
    "jpegphoto",
    "usercertificate",
    "usercertificate;binary",
    "cacertificate",
    "cacertificate;binary",
    "nssymmetrickey"
  ];
  var WEB_SOCKET_MAX_PAYLOAD = 1280 * 1024;
  var LDIF_MAX_CHAR_PER_LINE = 78;
  var LDAP_OPERATIONS = {
    add: "add",
    delete: "delete",
    replace: "replace"
  };
  var ENTRY_TYPE = {
    user: "USER",
    ou: "OU",
    other: "OTHER"
  };
  var INET_ORG_ATTRS = [
    "audio",
    "businessCategory",
    "carLicense",
    "departmentNumber",
    "displayName",
    "employeeNumber",
    "employeeType",
    "givenName",
    "homePhone",
    "homePostalAddress",
    "initials",
    "jpegPhoto",
    "labeledURI",
    "mail",
    "manager",
    "mobile",
    "o",
    "pager",
    "photo",
    "roomNumber",
    "secretary",
    "uid",
    "userCertificate",
    "x500UniqueIdentifier",
    "preferredLanguage",
    "userSMIMECertificate",
    "userPKCS12"
  ];
  var ORG_PERSON_ATTRS = [
    "title",
    "x121Address",
    "registeredAddress",
    "destinationIndicator",
    "preferredDeliveryMethod",
    "telexNumber",
    "teletexTerminalIdentifier",
    "internationalISDNNumber",
    "facsimileTelephoneNumber",
    "street",
    "postOfficeBox",
    "postalCode",
    "postalAddress",
    "physicalDeliveryOfficeName",
    "ou",
    "st",
    "l"
  ];
  var PERSON_REQ_ATTRS = ["cn", "sn"];
  var PERSON_OPT_ATTRS = [
    "userPassword",
    "telephoneNumber",
    "seeAlso",
    "description"
  ];
  var SINGLE_VALUED_ATTRS = [
    "preferredDeliveryMethod",
    "displayName",
    "employeeNumber",
    "preferredLanguage"
  ];
  var OU_REQ_ATTRS = ["ou"];
  var OU_OPT_ATTRS = [
    "businessCategory",
    "description",
    "destinationIndicator",
    "facsimileTelephoneNumber",
    "internationalISDNNumber",
    "l",
    "physicalDeliveryOfficeName",
    "postalAddress",
    "postalCode",
    "postOfficeBox",
    "preferredDeliveryMethod",
    "registeredAddress",
    "searchGuide",
    "seeAlso",
    "st",
    "street",
    "telephoneNumber",
    "teletexTerminalIdentifier",
    "telexNumber",
    "userPassword",
    "x121Address"
  ];

  // src/lib/ldap_editor/lib/utils.jsx
  var import_jsx_runtime86 = __toESM(require_jsx_runtime(), 1);
  function generateUniqueId() {
    return Math.random().toString(36).substring(2, 15);
  }
  var _86 = cockpit_default.gettext;
  function getModDate(modDate, format2) {
    if (!modDate) {
      return "";
    }
    const FORMAT_OPTIONS = {
      year: "numeric",
      month: "short",
      day: "numeric",
      hour: "2-digit",
      minute: "2-digit",
      second: "2-digit",
      hour12: true
    };
    const y2 = modDate.substring(0, 4);
    const m = modDate.substring(4, 6);
    const d = modDate.substring(6, 8);
    const h = modDate.substring(8, 10);
    const min3 = modDate.substring(10, 12);
    const sec = modDate.substring(12, 14);
    const value = `${y2}-${m}-${d}T${h}:${min3}:${sec}Z`;
    const date2 = new Date(value);
    if (format2 === "local") {
      return date2.toLocaleString("en-US", FORMAT_OPTIONS);
    } else {
      return date2.toLocaleString("en-US", {
        ...FORMAT_OPTIONS,
        timeZone: "UTC"
      });
    }
  }
  function getUserSuffixes(serverId, suffixCallback) {
    const suffixCmd = [
      "dsconf",
      "-j",
      "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
      "backend",
      "suffix",
      "list",
      "--suffix"
    ];
    log_cmd("getUserSuffixes", "list suffixes", suffixCmd);
    cockpit_default.spawn(suffixCmd, { superuser: true, err: "message" }).done((content) => {
      const suffList = JSON.parse(content);
      suffixCallback(suffList.items);
    }).fail((_113) => {
      console.log("FAIL " + _113.toString());
    });
  }
  function getRootSuffixEntryDetails(params, entryDetailsCallback) {
    const timeLimit = getTimeLimit();
    const cmd = [
      "ldapsearch",
      "-LLL",
      "-o",
      "ldif-wrap=no",
      "-Y",
      "EXTERNAL",
      "-b",
      params.baseDn,
      "-H",
      "ldapi://%2fvar%2frun%2fslapd-" + params.serverId + ".socket",
      "-s",
      "base",
      "-l",
      timeLimit,
      "*",
      "numSubordinates",
      "modifyTimestamp"
      // 'entryId' // To uniquely identify the node in the treee view ==> <instanceId>_<entryId>
      // Doesn't work!! Some entries don't have an entryID (cn=config and its children for instance).
    ];
    log_cmd("getRootSuffixEntryDetails", "", cmd);
    let dn = null;
    let numSubordinates = "";
    let modifyTimestamp = "";
    let result = {};
    const entryArray = [];
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      const lines = data.split("\n");
      lines.map((currentLine) => {
        if (isAttributeLine(currentLine, "dn:")) {
          entryArray.push(splitAttributeValue(currentLine));
          const pos = currentLine.indexOf(":");
          if (currentLine.startsWith("dn::")) {
            dn = b64DecodeUnicode(currentLine.substring(pos + 2).trim());
          } else {
            dn = currentLine.substring(pos + 1).trim();
          }
        } else if (isAttributeLine(currentLine, "numSubordinates:")) {
          numSubordinates = currentLine.split(":")[1].trim();
        } else if (isAttributeLine(currentLine, "modifyTimestamp:")) {
          modifyTimestamp = currentLine.split(":")[1].trim();
        } else {
          entryArray.push(splitAttributeValue(currentLine));
        }
        return [];
      });
      result = JSON.stringify(
        {
          dn,
          numSubordinates,
          modifyTimestamp: getModDate(modifyTimestamp, "utc"),
          modifyTimestampLocal: getModDate(modifyTimestamp, "local"),
          parentId: params.parentId,
          fullEntry: entryArray,
          errorCode: 0
        }
      );
    }).fail((err) => {
      result = JSON.stringify(
        {
          dn: params.baseDn,
          numSubordinates: "???",
          modifyTimestamp: "???",
          // entryId: (Math.floor(Math.random() * Math.floor(1000000))).toString(), // Choose a random number between 0 and 1 million.
          parentId: params.parentId,
          fullEntry: [{ attribute: "???: ", value: "???" }],
          errorCode: err.exit_status
        }
      );
    }).always(() => entryDetailsCallback(result));
  }
  function getResourceLimits() {
    const timeLimit = getTimeLimit();
    const sizeLimit = getSizeLimit();
    const limits = [];
    if (timeLimit > 0) {
      limits.push("-l", timeLimit);
    }
    if (sizeLimit > 0) {
      limits.push("-z", sizeLimit);
    }
    return limits;
  }
  function getSearchEntries(params, resultCallback) {
    const cmd = [
      "ldapsearch",
      "-LLL",
      "-o",
      "ldif-wrap=no",
      "-Y",
      "EXTERNAL",
      "-b",
      params.searchBase,
      "-H",
      "ldapi://%2fvar%2frun%2fslapd-" + params.serverId + ".socket",
      "-s",
      params.searchScope,
      "-l",
      params.timeLimit,
      "-z",
      params.sizeLimit,
      params.searchFilter,
      "*",
      "+"
    ];
    log_cmd("getSearchEntries", "", cmd);
    let dn = "";
    let numSubordinates = "0";
    let modifyTimestamp = "";
    let searchResult = null;
    const allEntries = [];
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      searchResult = data;
    }).catch((err, data) => {
      if (err.exit_status === 4) {
        console.log("Size limit hit");
        searchResult = data;
        params.addNotification(
          "info",
          cockpit_default.format(_86("Size limit of $0 was exceeded. The child entries of $1 have been truncated."), params.sizeLimit, params.searchBase)
        );
      } else {
        searchResult = null;
        resultCallback(null, { status: err.exit_status, msg: err.message });
      }
    }).finally(() => {
      if (searchResult === null) {
        return;
      }
      const lines = searchResult.split("\n");
      let ldapsubentry = false;
      let isRole = false;
      let isLockable = false;
      lines.map((currentLine) => {
        const accountObjectclasses = [
          "nsaccount",
          "nsperson",
          "simplesecurityobject",
          "organization",
          "person",
          "account",
          "organizationalunit",
          "netscapeserver",
          "domain",
          "posixaccount",
          "shadowaccount",
          "posixgroup",
          "mailrecipient",
          "nsroledefinition"
        ];
        if (isAttributeLine(currentLine, "dn:")) {
          const pos = currentLine.indexOf(":");
          if (currentLine.startsWith("dn::")) {
            dn = b64DecodeUnicode(currentLine.substring(pos + 2).trim());
          } else {
            dn = currentLine.substring(pos + 1).trim();
          }
          ldapsubentry = false;
          isRole = false;
          isLockable = false;
        } else if (isAttributeLine(currentLine, "numSubordinates:")) {
          numSubordinates = currentLine.split(":")[1].trim();
        } else if (isAttributeLine(currentLine, "modifyTimestamp:")) {
          modifyTimestamp = currentLine.split(":")[1].trim();
        } else if (isAttributeLine(currentLine, "objectclass: ldapsubentry")) {
          ldapsubentry = true;
        } else if (isAttributeLine(currentLine, "objectclass: nsroledefinition")) {
          isRole = true;
        }
        for (const accountOC of accountObjectclasses) {
          if (isAttributeLine(currentLine, `objectclass: ${accountOC}`)) {
            isLockable = true;
          }
        }
        if (currentLine === "" && dn !== "") {
          const result = JSON.stringify(
            {
              dn,
              numSubordinates,
              modifyTimestamp: getModDate(modifyTimestamp, "utc"),
              modifyTimestampLocal: getModDate(modifyTimestamp, "local"),
              ldapsubentry,
              isRole,
              isLockable
            }
          );
          allEntries.push(result);
          dn = "";
          numSubordinates = "0";
          modifyTimestamp = "";
        }
        return [];
      });
      resultCallback(allEntries, null);
    });
  }
  function getBaseLevelEntryAttributes(serverId, baseDn, entryAttributesCallback) {
    const timeLimit = getTimeLimit();
    const optionTimeLimit = timeLimit > 0 ? `-l ${timeLimit}` : "";
    const cmd = [
      "/usr/bin/sh",
      "-c",
      `ldapsearch -LLL -o ldif-wrap=no -Y EXTERNAL -b "${baseDn}" -H ldapi://%2fvar%2frun%2fslapd-${serverId}.socket ${optionTimeLimit} -s base "(|(objectClass=*)(objectClass=ldapSubEntry))" nsRoleDN nsAccountLock \\*`
      // +
      // ' | /usr/bin/head -c 150001' // Taking 1 additional character to check if the
      // the entry was indeed bigger than 150K.
    ];
    log_cmd("getBaseLevelEntryAttributes", "", cmd);
    const entryArray = [];
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      const lines = data.split("\n");
      lines.map((currentLine) => {
        if (currentLine !== "") {
          if (currentLine.length < 1e3 || currentLine.substring(0, 9).toLowerCase().startsWith("jpegphoto") || currentLine.match(/.*certificate.*/i)) {
            entryArray.push(splitAttributeValue(currentLine));
          } else {
            const myTruncatedValue = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { name: "truncated", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Label, { icon: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(InfoCircleIcon, {}), color: "blue", children: _86("Value is too large to display") }) });
            entryArray.push(myTruncatedValue);
          }
        }
        return [];
      });
      entryAttributesCallback(entryArray);
    }).catch((err) => {
      if (err.message === void 0) {
      } else {
        entryAttributesCallback([{
          attribute: "???: ",
          value: "???",
          // errMsg: err.message
          errorCode: err.exit_status
        }]);
        console.log("getBaseLevelEntryAttributes failed with exit_status = " + err.exit_status);
        console.log("getBaseLevelEntryAttributes error message = " + err.message);
      }
    });
  }
  function getBaseLevelEntryFullAttributes(serverId, baseDn, entryAttributesCallback) {
    const timeLimit = getTimeLimit();
    const cmd = [
      "ldapsearch",
      "-LLL",
      "-o",
      "ldif-wrap=no",
      "-Y",
      "EXTERNAL",
      "-b",
      baseDn,
      "-H",
      "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
      "-s",
      "base",
      "-l",
      timeLimit,
      "(|(objectClass=*)(objectClass=ldapSubEntry))",
      "*",
      "+"
    ];
    log_cmd("getBaseLevelEntryFullAttributes", "", cmd);
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      entryAttributesCallback(data);
    }).fail((err) => {
      console.log("getBaseLevelEntryFullAttributes failed with exit_status = " + err.exit_status);
      console.log("getBaseLevelEntryFullAttributes error message = " + err.message);
      entryAttributesCallback("");
    });
  }
  function isAttributeLine(line, attr) {
    return line.toLowerCase().startsWith(attr.toLowerCase());
  }
  function splitAttributeValue(attrVal) {
    const index = attrVal.indexOf(":");
    if (index === -1) {
      return { attribute: "", value: "" };
    }
    const attr = attrVal.substring(0, index);
    const val = attrVal.substring(index);
    return { attribute: attr, value: val };
  }
  function getOneLevelEntries(params, oneLevelCallback) {
    const limits = getResourceLimits();
    const filter = params.filter ? params.filter : "(|(objectClass=*)(objectClass=ldapSubEntry))";
    const cmd = [
      "ldapsearch",
      "-LLL",
      "-o",
      "ldif-wrap=no",
      "-Y",
      "EXTERNAL",
      "-b",
      params.baseDn,
      "-H",
      "ldapi://%2fvar%2frun%2fslapd-" + params.serverId + ".socket",
      "-s",
      "one",
      filter,
      /* '-l',
      timeLimit,
      '-z',
      sizeLimit, */
      ...limits,
      "1.1",
      "numSubordinates",
      "modifyTimestamp",
      "objectclass"
    ];
    log_cmd("getOneLevelEntries", "", cmd);
    let dn = "";
    let numSubordinates = "";
    let modifyTimestamp = "";
    let searchResult = null;
    const allEntries = [];
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      searchResult = data;
    }).catch((err, data) => {
      console.log("FAIL err.exit_status ==> " + err.exit_status);
      console.log("FAIL err.message ==> " + err.message);
      if (err.exit_status === 4) {
        searchResult = data;
        const size_limit = getSizeLimit();
        params.addNotification(
          "info",
          cockpit_default.format(_86("Size limit of $0 was exceeded.  The child entries of $1 have been truncated. Use the 'Search' feature if you want to adjust the size limit and retrieve more entries"), size_limit, params.baseDn)
        );
      } else {
        searchResult = null;
        oneLevelCallback(null, params, { status: err.exit_status, msg: err.message });
      }
    }).finally(() => {
      if (searchResult === null) {
        return;
      }
      const lines = searchResult.split("\n");
      let ldapsubentry = false;
      let isRole = false;
      let isLockable = false;
      lines.map((currentLine) => {
        const accountObjectclasses = [
          "nsaccount",
          "nsperson",
          "simplesecurityobject",
          "organization",
          "person",
          "account",
          "organizationalunit",
          "netscapeserver",
          "domain",
          "posixaccount",
          "shadowaccount",
          "posixgroup",
          "mailrecipient",
          "nsroledefinition"
        ];
        if (isAttributeLine(currentLine, "dn:")) {
          const pos = currentLine.indexOf(":");
          if (currentLine.startsWith("dn::")) {
            dn = b64DecodeUnicode(currentLine.substring(pos + 2).trim());
          } else {
            dn = currentLine.substring(pos + 1).trim();
          }
          ldapsubentry = false;
          isRole = false;
          isLockable = false;
        } else if (isAttributeLine(currentLine, "numSubordinates:")) {
          numSubordinates = currentLine.split(":")[1].trim();
        } else if (isAttributeLine(currentLine, "modifyTimestamp:")) {
          modifyTimestamp = currentLine.split(":")[1].trim();
        } else if (isAttributeLine(currentLine, "objectclass: ldapsubentry")) {
          ldapsubentry = true;
        } else if (isAttributeLine(currentLine, "objectclass: nsroledefinition")) {
          isRole = true;
        }
        for (const accountOC of accountObjectclasses) {
          if (isAttributeLine(currentLine, `objectclass: ${accountOC}`)) {
            isLockable = true;
          }
        }
        if (currentLine === "" && dn !== "") {
          const result = JSON.stringify(
            {
              dn,
              numSubordinates,
              modifyTimestamp: getModDate(
                modifyTimestamp,
                "utc"
              ),
              modifyTimestampLocal: getModDate(
                modifyTimestamp,
                "local"
              ),
              ldapsubentry,
              isRole,
              isLockable
            }
          );
          allEntries.push(result);
          dn = "";
          numSubordinates = "0";
          modifyTimestamp = "";
        }
        return [];
      });
      oneLevelCallback(allEntries, params, null);
    });
  }
  function runGenericSearch(params, searchCallback) {
    const cmd = [
      "/usr/bin/sh",
      "-c",
      'ldapsearch -LLL -o ldif-wrap=no -Y EXTERNAL -b "' + params.baseDn + '" -H ldapi://%2fvar%2frun%2fslapd-' + params.serverId + ".socket -s " + params.scope + ' "' + params.filter + '" ' + params.attributes
    ];
    log_cmd("runGenericSearch", "", cmd);
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      const resulEntries = data.split("\n\n");
      resulEntries.pop();
      searchCallback(resulEntries);
    }).fail((err) => {
      console.log("FAIL err.exit_status ==> " + err.exit_status);
      console.log("FAIL err.message ==> " + err.message);
      searchCallback([]);
    });
  }
  function modifyLdapEntry(params, ldifArray, modifyEntryCallback) {
    const serverId = params.serverId;
    const addOption = params.isAddOp ? "-a" : "";
    let ldifData = "";
    let logLdifData = "";
    if (ldifArray.length === 0) {
      console.log("modifyLdapEntry() ==> Empty array! Nothing to do.");
      return;
    }
    for (const line of ldifArray) {
      ldifData += `${line}
`;
      if (line.toLowerCase().startsWith("userpassword")) {
        logLdifData += `userPassword: ********
`;
      } else {
        logLdifData += `${line}
`;
      }
    }
    const cmd = [
      "/usr/bin/sh",
      "-c",
      `ldapmodify ${addOption} -Y EXTERNAL -H ldapi://%2fvar%2frun%2fslapd-${serverId}.socket `
    ];
    const cmd_copy = [
      "/usr/bin/sh",
      "-c",
      `ldapmodify ${addOption} -Y EXTERNAL -H ldapi://%2fvar%2frun%2fslapd-${serverId}.socket
`,
      logLdifData
      // hides userpassword value from console log
    ];
    let result = {};
    log_cmd("modifyLdapEntry", "", cmd_copy);
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).input(ldifData, true).input().done((data) => {
      result = { errorCode: 0, output: data };
    }).fail((err) => {
      console.log("FAIL - modifyLdapEntry() ==> " + err.message);
      console.log("Error code (err.exit_status) = " + err.exit_status);
      let errMessage = "";
      for (const msg of err.message.split("\n")) {
        if (!msg.startsWith("SASL")) {
          errMessage += msg;
        }
      }
      result = { errorCode: err.exit_status, output: errMessage };
    }).always(() => {
      modifyEntryCallback(result);
    });
  }
  function createLdapEntry(serverId, ldifArray, createEntryCallback) {
    const params = {
      serverId,
      isAddOp: true
    };
    modifyLdapEntry(params, ldifArray, createEntryCallback);
  }
  function getAllObjectClasses(serverId, allOcCallback) {
    const cmd = [
      "dsconf",
      "--json",
      "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
      "schema",
      "objectclasses",
      "list",
      "--include-sup"
    ];
    const result = [];
    log_cmd("getAllObjectClasses", "", cmd);
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      const myObject = JSON.parse(data);
      for (const oc of myObject.items) {
        result.push({
          name: oc.name[0],
          // name[0] is the attribute name in lower case.
          required: oc.must,
          optional: oc.may
        });
      }
    }).fail((err) => {
      console.log("FAIL - getAllObjectClasses - err.message ==> " + err.message);
    }).always(() => {
      allOcCallback(result);
    });
  }
  function getSingleValuedAttributes(serverId, svCallback) {
    const cmd = [
      "dsconf",
      "--json",
      "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
      "schema",
      "attributetypes",
      "list"
    ];
    const result = [];
    log_cmd("getSingleValuedAttributes", "", cmd);
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      const myObject = JSON.parse(data);
      for (const attr of myObject.items) {
        if (attr.single_value) {
          result.push(attr.name[0]);
        }
      }
    }).fail((err) => {
      console.log("FAIL - getAttributeList - err.message ==> " + err.message);
    }).always(() => {
      svCallback(result);
    });
  }
  function getAttributesNameAndOid(serverId, attrCallback) {
    const cmd = [
      "dsconf",
      "--json",
      "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
      "schema",
      "attributetypes",
      "list"
    ];
    const result = [];
    log_cmd("getAttributesNameAndOid", "", cmd);
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      const myObject = JSON.parse(data);
      for (const attr of myObject.items) {
        result.push([attr.names[0], attr.oid[0]]);
      }
    }).fail((err) => {
      console.log("FAIL - getAttributesNameAndOid - err.message ==> " + err.message);
    }).always(() => {
      attrCallback(result);
    });
  }
  function deleteLdapData(serverId, entryDN, numSubordinates, deleteCallback) {
    const cmd = [
      "ldapdelete",
      "-Y",
      "EXTERNAL",
      "-H",
      "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
      entryDN
    ];
    if (numSubordinates > 0) {
      cmd.push("-r");
    }
    let result = {};
    log_cmd("deleteLdapData", "", cmd);
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      result = { errorCode: 0, output: data };
    }).fail((err) => {
      console.log("FAIL - deleteLdapData() ==> " + err.message);
      let errMessage = "";
      for (const msg of err.message.split("\n")) {
        if (!msg.startsWith("SASL")) {
          errMessage += msg;
        }
      }
      result = { errorCode: err.exit_status, output: errMessage };
    }).always(() => {
      deleteCallback(result);
    });
  }
  function showCertificate(certificate, showCertCallback) {
    const cmd = [
      "/usr/bin/sh",
      "-c",
      "echo " + certificate + " | base64 --decode | openssl x509 -inform DER -noout -subject -issuer -dates -serial ; echo HOST_TIME_GMT=`date -Iminutes`"
    ];
    let result = {};
    const certDataArray = [];
    cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((data) => {
      const lineArray = data.split("\n");
      let certEndTime = 0;
      let hostTime = 0;
      lineArray.map((line) => {
        const pos = line.indexOf("=");
        const param = line.substring(0, pos);
        const paramVal = line.substring(pos + 1);
        if (param !== "HOST_TIME_GMT") {
          certDataArray.push({
            param,
            paramVal
          });
          if (param === "notAfter") {
            certEndTime = Date.parse(paramVal);
          }
        } else {
          hostTime = Date.parse(paramVal);
        }
        return [];
      });
      result = {
        code: "OK",
        data: certDataArray,
        timeDifference: certEndTime - hostTime
      };
    }).fail((err) => {
      console.log("FAIL - showCertificate() ==> " + err.message);
      result = { code: "FAIL" };
    }).always(() => {
      showCertCallback(result);
    });
  }
  function b64DecodeUnicode(str) {
    try {
      const result = decodeURIComponent(atob(str).split("").map((c2) => {
        return "%" + ("00" + c2.charCodeAt(0).toString(16)).slice(-2);
      }).join(""));
      return result;
    } catch (e) {
      console.debug("b64DecodeUnicode failed to decode: ", str);
      return str;
    }
  }
  function decodeLine(line) {
    const pos = line.indexOf("::");
    return [
      line.substring(0, pos),
      b64DecodeUnicode(line.substring(pos + 2).trim())
    ];
  }
  function getRdnInfo(entryDn) {
    let myRdn = "";
    const myArray = entryDn.split(",");
    for (const datum of myArray) {
      myRdn += datum;
      if (datum.slice(-1) !== "\\") {
        break;
      }
      myRdn += ",";
    }
    const myRdnData = myRdn.split("=");
    return {
      rdnAttr: myRdnData[0],
      rdnVal: myRdnData[1]
    };
  }
  function generateRootEntryLdif(suffixDn, ldifCallback) {
    const rdnObj = getRdnInfo(suffixDn);
    const myRdnAttr = rdnObj.rdnAttr;
    const myRdnVal = rdnObj.rdnVal;
    let myObjectClass;
    let isValid = true;
    switch (myRdnAttr) {
      case "c":
        myObjectClass = "country";
        break;
      case "cn":
        myObjectClass = "nsContainer";
        break;
      case "dc":
        myObjectClass = "domain";
        break;
      case "o":
        myObjectClass = "organization";
        break;
      case "ou":
        myObjectClass = "organizationalUnit";
        break;
      default:
        isValid = false;
        console.log(`The RDN attribute ${myRdnAttr} is not supported for root entry creation!`);
    }
    const ldifArray = [];
    if (isValid) {
      ldifArray.push(`dn: ${suffixDn}`);
      ldifArray.push("objectClass: top");
      ldifArray.push(`objectClass: ${myObjectClass}`);
      ldifArray.push(`${myRdnAttr}: ${myRdnVal}`);
    } else {
      ldifArray.push(`The RDN attribute "${myRdnAttr}" is not supported for root entry creation!`);
    }
    ldifCallback(ldifArray);
  }
  function retrieveAllAcis(params, aciCallback) {
    const entryDn = params.baseDn;
    const resultArray = [];
    const myParams = {
      serverId: params.serverId,
      baseDn: entryDn,
      scope: "base",
      filter: "objectClass=*",
      attributes: "1.1 aci"
    };
    runGenericSearch(myParams, (result) => {
      if (result.length > 0) {
        const myAcis = result[0].split("\n");
        if (myAcis.length > 1) {
          myAcis.shift();
          const actualAcis = myAcis.map((aciLine) => {
            const pos = aciLine.indexOf(":");
            const theAci = aciLine.startsWith("aci:: ") ? b64DecodeUnicode(aciLine.substring(pos + 2).trim()) : aciLine.substring(pos + 1).trim();
            return theAci;
          });
          const myBaseDn = myParams.baseDn;
          const myObj = {
            entryDn: myBaseDn,
            aciArray: actualAcis
          };
          resultArray.push(myObj);
        }
      }
      aciCallback(resultArray);
    });
  }
  function foldLine(line) {
    if (line.length <= LDIF_MAX_CHAR_PER_LINE) {
      return [line];
    }
    const size = Math.ceil(line.length / LDIF_MAX_CHAR_PER_LINE);
    const lineArray = new Array(size);
    lineArray[0] = line.substring(0, LDIF_MAX_CHAR_PER_LINE);
    for (let i = 1; i < size; i++) {
      lineArray[i] = " " + line.substring(i * LDIF_MAX_CHAR_PER_LINE, (i + 1) * LDIF_MAX_CHAR_PER_LINE);
    }
    return lineArray;
  }
  function getBaseDNFromTree(entrydn, treeViewRootSuffixes) {
    for (const suffixObj of treeViewRootSuffixes) {
      if (entrydn.toLowerCase().indexOf(suffixObj.name.toLowerCase()) !== -1) {
        return suffixObj.name;
      }
    }
    return "";
  }

  // src/lib/ldap_editor/lib/rootSuffix.jsx
  var import_react157 = __toESM(require_react(), 1);
  var import_jsx_runtime87 = __toESM(require_jsx_runtime(), 1);
  var _87 = cockpit_default.gettext;
  var CreateRootSuffix = class extends import_react157.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        isModalOpen: false,
        ldifArray: []
      };
      this.handleCreateRootEntry = () => {
        console.log(`Creating the root entry ${this.props.suffixDn}`);
        const resultParams = {
          message: cockpit_default.format(_87("The suffix $0 was successfully created."), this.props.suffixDn),
          variant: "success"
        };
        createLdapEntry(
          this.props.editorLdapServer,
          this.state.ldifArray,
          (result) => {
            console.log(`result.errorCode = ${result.errorCode}`);
            if (result.errorCode === 0) {
              const params = { serverId: this.props.editorLdapServer, baseDn: this.props.suffixDn };
              getRootSuffixEntryDetails(params, (entryInfo) => {
                const info2 = JSON.parse(entryInfo);
                resultParams.rootEntryData = {
                  name: info2.dn,
                  fullEntry: info2.fullEntry,
                  modTime: info2.modifyTimestamp,
                  modTimeLocal: info2.modifyTimestampLocal,
                  dn: info2.dn
                };
                this.props.handleEmptySuffixToggle(resultParams);
              });
            } else {
              resultParams.message = `Failed to create the suffix ${this.props.suffixDn}.`;
              resultParams.variant = "danger";
              this.props.handleEmptySuffixToggle(resultParams);
            }
          }
        );
      };
    }
    componentDidMount() {
      generateRootEntryLdif(this.props.suffixDn, (ldifArray) => {
        this.setState({
          ldifArray
        });
      });
    }
    render() {
      const { showEmptySuffixModal, handleEmptySuffixToggle } = this.props;
      const { ldifArray } = this.state;
      const ldifOk = ldifArray.length > 1;
      const ldifItems = ldifOk ? ldifArray.map((line, index) => {
        return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(SimpleListItem, { children: line }, index);
      }) : null;
      return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
        Modal,
        {
          position: "top",
          variant: ModalVariant.medium,
          title: _87("Create Root Entry"),
          isOpen: showEmptySuffixModal,
          onClose: handleEmptySuffixToggle,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
              Button,
              {
                variant: "primary",
                isDisabled: !ldifOk,
                onClick: this.handleCreateRootEntry,
                children: _87("Create")
              },
              "create"
            ),
            /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
              Button,
              {
                variant: "link",
                onClick: handleEmptySuffixToggle,
                children: _87("Cancel")
              },
              "cancel"
            )
          ],
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
              Alert,
              {
                variant: ldifOk ? "info" : "danger",
                isInline: true,
                title: ldifOk ? _87("LDIF data to create the suffix") : _87("Failed to generate the LDIF data")
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "ds-addons-bottom-margin" }),
            !ldifOk && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Label, { variant: "outline", color: "red", children: ldifArray[0] }),
            ldifOk && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Divider, {}),
              /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(SimpleList, { "aria-label": "Simple List LDIF", children: ldifItems }),
              /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Divider, {})
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "ds-addons-bottom-margin" })
          ]
        }
      );
    }
  };
  var rootSuffix_default = CreateRootSuffix;

  // src/lib/ldap_editor/tableView.jsx
  var import_react158 = __toESM(require_react(), 1);
  var import_jsx_runtime88 = __toESM(require_jsx_runtime(), 1);
  var _88 = cockpit_default.gettext;
  var EditorTableView = (props) => {
    const {
      loading,
      columns,
      editorTableRows,
      onCollapse,
      itemCount,
      page,
      perPage,
      onSetPage,
      onPerPageSelect,
      actionResolver
      // Added actionResolver from props
    } = props;
    let tableColumns = [...columns];
    let rows = [...editorTableRows];
    let noBackend = false;
    if (rows.length === 0) {
      tableColumns = ["Database Suffixes"];
      rows = [{ cells: ["No Databases"] }];
      noBackend = true;
    }
    const renderCellContent = (cell) => {
      if (cell === null || cell === void 0) {
        return "";
      }
      if (import_react158.default.isValidElement(cell)) {
        return cell;
      }
      if (typeof cell === "object") {
        if (cell.title) {
          return import_react158.default.isValidElement(cell.title) ? cell.title : /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { children: String(cell.title) });
        }
        return "";
      }
      return String(cell);
    };
    const [parentRows, expandedContentMap] = import_react158.default.useMemo(() => {
      const parentRowsArray = [];
      const expandedMap = /* @__PURE__ */ new Map();
      for (let i = 0; i < rows.length; i++) {
        const currentRow = rows[i];
        if (i % 2 === 0) {
          parentRowsArray.push(currentRow);
          if (rows[i + 1]) {
            expandedMap.set(i, rows[i + 1]);
          }
        }
      }
      return [parentRowsArray, expandedMap];
    }, [rows]);
    const loadingBody = /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
      /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Text, { component: TextVariants.h3, children: _88("Loading ...") }) }),
      /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Spinner, { className: "ds-margin-top-lg", size: "lg" })
    ] });
    const tableBody = /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(
        Table,
        {
          "aria-label": "editor table view",
          variant: "compact",
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Tr, { children: [
              !noBackend && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Th, { screenReaderText: "Expand/Collapse Row" }),
              tableColumns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Th, { children: typeof column === "object" ? column.title : column }, columnIndex)),
              !noBackend && actionResolver && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Th, { screenReaderText: "Actions" })
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Tbody, { children: parentRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_react158.default.Fragment, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Tr, { children: [
                !noBackend && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
                  Td,
                  {
                    expand: {
                      rowIndex,
                      isExpanded: row.isOpen,
                      onToggle: () => onCollapse(null, rowIndex * 2, !row.isOpen, row)
                    }
                  }
                ),
                row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
                  Td,
                  {
                    dataLabel: tableColumns[cellIndex]?.title || tableColumns[cellIndex],
                    children: renderCellContent(cell)
                  },
                  cellIndex
                )),
                !noBackend && actionResolver && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
                  ActionsColumn,
                  {
                    items: actionResolver(row, { rowIndex: rowIndex * 2 })
                  }
                ) })
              ] }),
              row.isOpen && expandedContentMap.has(rowIndex * 2) && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Tr, { isExpanded: true, children: [
                /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Td, {}),
                /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
                  Td,
                  {
                    colSpan: tableColumns.length + (noBackend ? 0 : actionResolver ? 2 : 1),
                    noPadding: true,
                    children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(ExpandableRowContent, { children: renderCellContent(expandedContentMap.get(rowIndex * 2).cells[0]) })
                  }
                )
              ] })
            ] }, rowIndex)) })
          ]
        }
      ),
      !noBackend && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
        Pagination,
        {
          id: "ds-addons-editor-view-top",
          className: "ds-margin-top",
          widgetId: "pagination-options-menu-top",
          itemCount,
          page,
          perPage,
          onSetPage: (_evt, value) => onSetPage(value),
          onPerPageSelect: (_evt, value) => onPerPageSelect(value),
          isCompact: true,
          dropDirection: "up"
        }
      )
    ] });
    return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "ds-indent-lg ds-margin-top-lg", children: loading ? loadingBody : tableBody });
  };
  var tableView_default = EditorTableView;

  // src/lib/ldap_editor/treeView.jsx
  var import_react161 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/lib/genericPagination.jsx
  var import_react159 = __toESM(require_react(), 1);
  var import_jsx_runtime89 = __toESM(require_jsx_runtime(), 1);
  var _89 = cockpit_default.gettext;
  var GenericPagination = class extends import_react159.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "onSelectRow", (event, isSelected, rowIndex) => {
        const cellValue = this.state.pagedRows[rowIndex].cells[0];
        const allItems = [...this.state.rows];
        let index = allItems.findIndex((item) => item.cells[0] === cellValue);
        allItems[index].selected = isSelected;
        const allRows = [...this.state.allRows];
        index = allRows.findIndex((item) => item.cells[0] === cellValue);
        allRows[index].selected = isSelected;
        const selectedAttrs = allRows.filter((row) => row.selected).map((attr) => attr.cells[0]);
        this.setState({
          rows: allItems,
          allRows,
          selectedAttrs,
          pagedRows: this.getRowsToShow(this.state.page, this.state.perPage)
        });
        this.props.handleSelectedAttrs(selectedAttrs);
      });
      __publicField(this, "handleDropDownToggle", (isOpen) => {
        this.setState({
          isDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isDropDownOpen: !prevState.isDropDownOpen };
        });
      });
      __publicField(this, "handleSetPage", (_event, pageNumber) => {
        this.setState({
          page: pageNumber,
          pagedRows: this.getRowsToShow(pageNumber, this.state.perPage)
        });
      });
      __publicField(this, "handlePerPageSelect", (_event, perPage) => {
        this.setState({
          page: 1,
          perPage,
          pagedRows: this.getRowsToShow(1, perPage)
        });
      });
      __publicField(this, "getRowsToShow", (page, perPage) => {
        const start2 = (page - 1) * perPage;
        const end2 = page * perPage;
        return this.state.rows.slice(start2, end2);
      });
      __publicField(this, "buildAttrDropdown", () => {
        const { isDropDownOpen, selectedAttrs } = this.state;
        const numSelected = selectedAttrs.length;
        const items = selectedAttrs.map(
          (attr) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(DropdownItem2, { children: attr }, attr)
        );
        let badgeProps = {
          className: "ds-badge-bgcolor"
        };
        if (numSelected === 0) {
          badgeProps = {
            isRead: true
          };
        }
        return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
          Dropdown2,
          {
            className: "ds-dropdown-padding ds-margin-top-lg",
            position: DropdownPosition.left,
            onSelect: this.handleDropDownSelect,
            toggle: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(BadgeToggle, { id: "toggle-attr-select", badgeProps, onToggle: (_event, isOpen) => this.handleDropDownToggle(isOpen), children: numSelected > 0 ? /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_jsx_runtime89.Fragment, { children: [
              numSelected,
              " ",
              _89("selected"),
              " "
            ] }) : /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_jsx_runtime89.Fragment, { children: [
              "0 ",
              _89("selected"),
              " "
            ] }) }),
            isOpen: isDropDownOpen,
            dropdownItems: items
          }
        );
      });
      __publicField(this, "onSort", (_event, columnIndex, sortDirection) => {
        const mySortedRows = this.state.rows.sort((a2, b) => {
          const aValue = a2.cells[columnIndex]?.title || a2.cells[columnIndex];
          const bValue = b.cells[columnIndex]?.title || b.cells[columnIndex];
          return aValue < bValue ? -1 : aValue > bValue ? 1 : 0;
        });
        this.setState({
          sortBy: {
            index: columnIndex,
            direction: sortDirection
          },
          rows: sortDirection === "asc" ? mySortedRows : mySortedRows.reverse()
        }, () => this.setState({
          pagedRows: this.getRowsToShow(this.state.page, this.state.perPage)
        }));
      });
      __publicField(this, "renderCellContent", (cell) => {
        if (cell === null || cell === void 0) {
          return "";
        }
        if (import_react159.default.isValidElement(cell)) {
          return cell;
        }
        if (typeof cell === "object") {
          if (cell.title) {
            return import_react159.default.isValidElement(cell.title) ? cell.title : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { children: String(cell.title) });
          }
          return "";
        }
        return String(cell).trim();
      });
      this.state = {
        itemCount: 0,
        page: 1,
        perPage: 10,
        pagedRows: [],
        searchValue: "",
        selectedAttrs: [],
        sortBy: {},
        isDropDownOpen: false,
        rows: [...this.props.rows],
        allRows: [...this.props.rows]
      };
      this.handleSearchChange = (event, value) => {
        let rows = [];
        const all = [];
        const val = value.toLowerCase();
        this.props.rows.map((attr) => {
          let selected = false;
          for (const selectedAttr of this.state.selectedAttrs) {
            if (attr.cells[0].toLowerCase() === selectedAttr.toLowerCase()) {
              selected = true;
              break;
            }
          }
          all.push(
            {
              cells: [
                attr.cells[0],
                attr.cells[1]
              ],
              selected
            }
          );
          return [];
        });
        if (value !== "") {
          for (const row of all) {
            const name2 = row.cells[0].toLowerCase();
            const oid = row.cells[1].toLowerCase();
            if (name2.includes(val) || oid.includes(val)) {
              rows.push(row);
            }
          }
        } else {
          rows = all;
        }
        this.setState({
          rows,
          itemCount: rows.length,
          pagedRows: rows.slice(0, this.state.perPage)
        });
      };
    }
    componentDidMount() {
      if (this.props.rows && this.props.rows.length > 0) {
        const selectedAttrs = this.props.rows.filter((row) => row.selected).map((attr) => attr.cells[0]);
        this.setState({
          rows: [...this.props.rows],
          allRows: [...this.props.rows],
          selectedAttrs,
          pagedRows: this.getRowsToShow(1, this.state.perPage),
          page: 1,
          itemCount: this.props.rows.length
        });
      }
    }
    componentDidUpdate(prevProps) {
      if (this.props.tableModificationTime !== prevProps.tableModificationTime) {
        this.setState({
          rows: [...this.props.rows],
          allRows: [...this.props.rows]
        }, () => this.setState({
          pagedRows: this.getRowsToShow(1, this.state.perPage),
          page: 1,
          itemCount: [...this.props.rows].length
        }));
      }
    }
    render() {
      const { itemCount, page, perPage, pagedRows } = this.state;
      const { columns = [], isSelectable = false, isSearchable = false, enableSorting = false } = this.props;
      const showPagination = itemCount > 10;
      return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Grid, { children: [
        isSelectable && this.buildAttrDropdown(),
        /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(GridItem, { span: 12, className: isSelectable ? "ds-margin-top" : "", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Grid, { children: [
          isSearchable && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
            SearchInput,
            {
              className: "ds-font-size-md",
              placeholder: _89("Search"),
              value: this.state.searchValue,
              onChange: this.handleSearchChange,
              onClear: (evt) => this.handleSearchChange(evt, "")
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(GridItem, { span: isSearchable ? 7 : 12, children: showPagination && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
            Pagination,
            {
              itemCount,
              page,
              perPage,
              onSetPage: this.handleSetPage,
              onPerPageSelect: this.handlePerPageSelect,
              isCompact: true,
              widgetId: "pagination-options-menu-generic"
            }
          ) })
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Table, { "aria-label": this.props.ariaLabel || "generic table", variant: "compact", children: [
          /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Tr, { children: [
            isSelectable && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Th, {}),
            columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
              Th,
              {
                sort: enableSorting ? {
                  sortBy: this.state.sortBy,
                  onSort: (_evt, index, direction) => this.onSort(_evt, columnIndex, direction),
                  columnIndex
                } : void 0,
                children: typeof column === "object" ? column.title : column
              },
              columnIndex
            ))
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Tbody, { children: (pagedRows || []).map((row, rowIndex) => {
            const rowCells = Array.isArray(row) ? row : row.cells || [];
            return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Tr, { children: [
              isSelectable && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
                Td,
                {
                  select: {
                    rowIndex,
                    onSelect: this.onSelectRow,
                    isSelected: row.selected
                  }
                }
              ),
              rowCells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
                Td,
                {
                  dataLabel: columns[cellIndex]?.title || columns[cellIndex],
                  children: this.renderCellContent(cell)
                },
                `${rowIndex}_${cellIndex}`
              ))
            ] }, rowIndex);
          }) })
        ] }) })
      ] });
    }
  };
  GenericPagination.defaultProps = {
    rows: [],
    columns: [],
    isSelectable: false,
    isSearchable: false,
    enableSorting: false,
    handleSelectedAttrs: () => {
    },
    ariaLabel: "generic table"
  };
  var genericPagination_default = GenericPagination;

  // src/lib/ldap_editor/lib/ldapNavigator.jsx
  var import_react160 = __toESM(require_react(), 1);
  var import_prop_types84 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime90 = __toESM(require_jsx_runtime(), 1);
  var _90 = cockpit_default.gettext;
  var LdapNavigator = class extends import_react160.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "updateTreeData", () => {
        if (this.props.wizardOperationInfo.resultCode !== 0) {
          const msg = `There was an LDAP error (code ${this.props.wizardOperationInfo.resultCode}). Not updating the LDAP tree.`;
          console.log(msg);
          return;
        }
        if (this.state.activeItems.length === 0) {
          return;
        }
        switch (this.props.wizardOperationInfo.operationType) {
          case "DELETE": {
            const currentActiveNode = this.state.activeItems[0];
            const nodeId = currentActiveNode.id;
            if (nodeId.indexOf(".") === -1) {
              this.updateRootSuffixNode(false);
            } else {
              const treeAllItems = this.state.allItems;
              const parentNode = this.state.activeItems[1];
              const parentId = parentNode.id;
              const parentChildren = [...parentNode.children];
              const nodeIndex = parentChildren.findIndex((datum) => datum.id === nodeId);
              console.log(`nodeIndex = ${nodeIndex}`);
              if (nodeIndex >= 0) {
                parentChildren.splice(nodeIndex, 1);
                const parentIdObject = {
                  fullId: parentId,
                  remainingId: parentId
                };
                this.updateMyChildren(treeAllItems, parentIdObject, parentChildren, true);
                const activeItems = this.state.activeItems.shift();
                this.setState(
                  {
                    allItems: treeAllItems,
                    // Unset the current active items.
                    // If there is an active item, it will give the false perception that the
                    // entry details ( empty ) table is showing its information.
                    activeItems
                  },
                  () => {
                    this.props.handleNodeOnClick(null);
                  }
                );
              }
            }
            break;
          }
          case "ADD": {
            const nodeDn = this.props.wizardOperationInfo.entryDn;
            const relativeDn = this.props.wizardOperationInfo.relativeDn;
            const myFutureParent = this.state.activeItems[0];
            const parentId = myFutureParent.id;
            const idArray = myFutureParent.children ? myFutureParent.children.map((elt) => elt.id.split(".").pop()) : [];
            const maxId = idArray.length > 0 ? Math.max(...idArray) : 0;
            const mySubId = maxId + 1;
            const params = {
              serverId: this.props.editorLdapServer,
              baseDn: nodeDn,
              addNotification: this.props.addNotification
            };
            getRootSuffixEntryDetails(
              params,
              (result) => {
                const info2 = JSON.parse(result);
                const entryTreeData = {
                  name: relativeDn,
                  fullEntry: info2.fullEntry,
                  modTime: info2.modifyTimestamp,
                  modTimeLocal: info2.modifyTimestampLocal,
                  dn: info2.dn,
                  id: `${parentId}.${mySubId}`,
                  loadChildren: false
                };
                const treeAllItems = this.state.allItems;
                const parentIdObject = {
                  fullId: parentId,
                  remainingId: parentId
                };
                this.updateMyChildren(treeAllItems, parentIdObject, [entryTreeData]);
                this.setState({ allItems: treeAllItems });
              }
            );
            break;
          }
          case "MODRDN":
          case "MODIFY":
            this.refreshNode(this.state.activeItems[0]);
            break;
          default:
            console.log(`Unknown operation type in LdapNavigator class: ${this.props.wizardOperationInfo.operationType}`);
        }
      });
      __publicField(this, "updateDirectChildren", (potentialChildren, params, resCode) => {
        if (!this.props.skipLeafEntries) {
          return;
        }
        if (potentialChildren === null) {
          if (resCode.exit_status !== 0) {
            this.props.addNotification(
              "error",
              cockpit_default.format(_90("Error searching database - $0"), resCode.msg.split("\n").pop())
            );
          }
          return;
        }
        const updatedChildren = [];
        let nbIterations = 0;
        const child_params = {
          serverId: this.props.editorLdapServer,
          scope: "one",
          attributes: "1.1",
          addNotification: this.props.addNotification,
          filter: "(|(&(numSubordinates=*)(numSubordinates>=1))(objectClass=organizationalunit)(objectClass=organization))"
        };
        potentialChildren.map((aChild) => {
          const info2 = JSON.parse(aChild);
          params.baseDn = info2.dn;
          runGenericSearch(child_params, (resArray) => {
            if (resArray.length > 0) {
              info2.showChildren = true;
            }
            updatedChildren.push(JSON.stringify(info2));
            nbIterations++;
            if (nbIterations === potentialChildren.length) {
              this.processDirectChildren(updatedChildren, params, null);
            }
          });
          return [];
        });
      });
      // Process the entries that are direct children.
      __publicField(this, "processDirectChildren", (directChildren, params, resCode) => {
        const myActiveNode = this.state.activeItems[0];
        const myChildren = [];
        let childId = 0;
        if (directChildren === null) {
          this.setState({ ldapFailure: true });
          this.props.showTreeLoadingState(false);
          if (resCode.exit_status !== 0) {
            this.props.addNotification(
              "error",
              cockpit_default.format(_90("Error searching database - $0"), resCode.msg.split("\n").pop())
            );
            const randomId = Math.random().toString(36).substring(2, 15);
            const nodeChildren = [{
              name: _90("Encountered an error, unable to display child entries"),
              id: randomId,
              icon: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(ExclamationTriangleIcon, {}),
              isFakeEntry: true
            }];
            const treeAllItems = this.state.allItems;
            const parentIdObject = {
              fullId: myActiveNode.id,
              remainingId: myActiveNode.id
            };
            this.updateMyParent(treeAllItems, parentIdObject, nodeChildren, true);
            this.setState({
              allItems: treeAllItems
            });
          }
          return;
        } else {
          this.setState({ ldapFailure: false });
        }
        for (const aChild of directChildren) {
          const info2 = JSON.parse(aChild);
          const numSubValue = parseInt(info2.numSubordinates);
          let nodeChildren = null;
          const showChildren = !this.props.skipLeafEntries || info2.showChildren;
          if (numSubValue > 0 && showChildren) {
            const randomId = Math.random().toString(36).substring(2, 15);
            nodeChildren = [{
              name: _90("Loading..."),
              id: randomId,
              // icon: <UnknownIcon />,
              icon: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Spinner, { size: "sm" }),
              isFakeEntry: true
            }];
          }
          const childData = {
            // TODO: Use a better logic to retrieve the entry RDN!!!
            name: info2.dn.slice(0, info2.dn.length - myActiveNode.dn.length - 1),
            fullEntry: info2.fullEntry,
            // IMPORTANT: Need to add the children so the tree shows the expansion button!
            children: nodeChildren,
            modTime: info2.modifyTimestamp,
            modTimeLocal: info2.modifyTimestampLocal,
            dn: info2.dn,
            id: `${myActiveNode.id}.${childId}`,
            loadChildren: numSubValue > 0
            // Used to insert child nodes when needed.
          };
          if (numSubValue > 0) {
            childData.customBadgeContent = numSubValue;
          }
          myChildren.push(childData);
          childId++;
        }
        if (directChildren.length > 0) {
          const treeAllItems = this.state.allItems;
          const parentIdObject = {
            fullId: myActiveNode.id,
            remainingId: myActiveNode.id
          };
          this.updateMyChildren(treeAllItems, parentIdObject, myChildren, true);
          this.setState({ allItems: treeAllItems });
        }
        this.props.showTreeLoadingState(false);
      });
      this.state = {
        // Need to use an initial object to avoid a JS exception.
        allItems: [{
          name: _90("Loading LDAP entries..."),
          id: "Loading",
          icon: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Spinner, { size: "sm" })
        }],
        activeItems: [],
        ldapFailure: false
      };
      this.handleTreeOnClick = (evt, treeViewItem, parentItem) => {
        if (treeViewItem.isFakeEntry) {
          return;
        }
        if (this.state.activeItems.length > 0 && treeViewItem.dn === this.state.activeItems[0].dn) {
          return;
        }
        this.setState(
          {
            activeItems: [treeViewItem, parentItem]
            // updatingTree: true
          },
          () => {
            if (typeof this.props.showTreeLoadingState === "function") {
              this.props.showTreeLoadingState(true);
            }
            this.refreshNode(treeViewItem, true);
          }
        );
      };
      this.refreshNode = (treeViewItem, forceReloadChildren) => {
        getBaseLevelEntryAttributes(
          this.props.editorLdapServer,
          treeViewItem.dn,
          (entryDetails) => {
            treeViewItem.fullEntry = [...entryDetails];
            if (treeViewItem.id.indexOf(".") === -1 && // No dot in the id ==> Entry is a root node in the tree.
            !this.state.ldapFailure) {
              const entryIsAnEmptySuffix = entryDetails[0].errorCode === 32;
              treeViewItem.isEmptySuffix = entryIsAnEmptySuffix;
              if (entryIsAnEmptySuffix) {
                this.props.handleNodeOnClick(treeViewItem);
                this.props.showTreeLoadingState(false);
                return;
              }
            }
            if (!this.state.ldapFailure) {
              this.props.handleNodeOnClick(treeViewItem);
            }
            if (treeViewItem.loadChildren || // Load child entries if any
            forceReloadChildren) {
              const params = {
                serverId: this.props.editorLdapServer,
                baseDn: treeViewItem.dn,
                name: treeViewItem.name,
                fullEntry: treeViewItem.fullEntry,
                modTime: treeViewItem.modTime,
                modTimeLocal: treeViewItem.modTimeLocal,
                addNotification: this.props.addNotification,
                filter: this.props.skipLeafEntries ? "(|(&(numSubordinates=*)(numSubordinates>=1))(objectClass=organizationalunit)(objectClass=organization))" : null
                // getOneLevelEntries() will use its default filter '(|(objectClass=*)(objectClass=ldapSubEntry))'
              };
              if (this.props.skipLeafEntries) {
                getOneLevelEntries(params, this.updateDirectChildren);
              } else {
                getOneLevelEntries(params, this.processDirectChildren);
              }
            } else {
              this.props.showTreeLoadingState(false);
            }
          }
        );
      };
      this.updateMyParent = (treeNode, nodeIdObject, nodeChildren, removePreviousChildren) => {
        const res = nodeIdObject.remainingId.indexOf(".");
        if (res === -1) {
          const insertionNode = treeNode.find((elt) => elt.id === nodeIdObject.fullId);
          insertionNode.children = nodeChildren;
          insertionNode.loadChildren = false;
          insertionNode.customBadgeContent = "?";
        } else {
          const parentId = nodeIdObject.remainingId.substring(0, res);
          const startingId = nodeIdObject.startingId === void 0 ? parentId : `${nodeIdObject.startingId}.${parentId}`;
          const parentNode = treeNode.find((elt) => elt.id === startingId);
          const remainingId = nodeIdObject.remainingId.substring(res + 1);
          const newNodeIdObject = {
            fullId: nodeIdObject.fullId,
            remainingId,
            startingId
          };
          this.updateMyParent(parentNode.children, newNodeIdObject, nodeChildren, removePreviousChildren);
        }
      };
      this.updateMyChildren = (treeNode, nodeIdObject, childArray, removePreviousChildren) => {
        const res = nodeIdObject.remainingId.indexOf(".");
        if (res === -1) {
          const insertionNode = treeNode.find((elt) => elt.id === nodeIdObject.fullId);
          if (!insertionNode) {
            return;
          }
          const childrenInfo = insertionNode.children;
          const myCurrentChildren = removePreviousChildren || !childrenInfo ? [] : childrenInfo;
          if (childArray.length > 0 || myCurrentChildren.length > 0) {
            const myFinalChildren = [...childArray, ...myCurrentChildren];
            insertionNode.children = myFinalChildren;
            insertionNode.customBadgeContent = myFinalChildren.length;
            delete insertionNode.expandedIcon;
          } else {
            insertionNode.children = null;
            insertionNode.action = null;
            insertionNode.expandedIcon = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(FolderIcon, {});
          }
          insertionNode.loadChildren = false;
        } else {
          const parentId = nodeIdObject.remainingId.substring(0, res);
          const startingId = nodeIdObject.startingId === void 0 ? parentId : `${nodeIdObject.startingId}.${parentId}`;
          const parentNode = treeNode.find((elt) => elt.id === startingId);
          const remainingId = nodeIdObject.remainingId.substring(res + 1);
          const newNodeIdObject = {
            fullId: nodeIdObject.fullId,
            remainingId,
            startingId
          };
          this.updateMyChildren(parentNode.children, newNodeIdObject, childArray, removePreviousChildren);
        }
      };
      this.updateRootSuffixNode = (isAdded) => {
        const currentActiveNode = this.state.activeItems[0];
        const rootSuffId = currentActiveNode.id;
        const treeAllItems = this.state.allItems;
        const rootSuffixNode = treeAllItems.find((elt) => elt.id === rootSuffId);
        if (isAdded) {
          const newItem = Object.assign({}, this.props.newSuffixData.rootEntryData);
          newItem.id = rootSuffId;
          newItem.isEmptySuffix = false;
          newItem.loadChildren = false;
          treeAllItems.splice(rootSuffId, 1, newItem);
          this.setState({ allItems: treeAllItems });
          this.props.updateEntryRows(newItem);
        } else {
          const emptyItem = {
            dn: rootSuffixNode.dn,
            id: rootSuffId,
            children: null,
            isEmptySuffix: true,
            icon: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(ResourcesEmptyIcon, { color: "var(--pf-global--palette--orange-300)" }),
            name: rootSuffixNode.name,
            fullEntry: []
          };
          treeAllItems.splice(rootSuffId, 1, emptyItem);
          this.setState({ allItems: treeAllItems });
          this.props.updateEntryRows(emptyItem);
        }
      };
    }
    // End constructor.
    componentDidMount() {
      this.setState({
        allItems: [...this.props.treeItems]
      });
    }
    componentDidUpdate(prevProps) {
      if (this.props.timeOfCompletion !== prevProps.timeOfCompletion) {
        this.setState({ allItems: [...this.props.treeItems] });
      }
      if (this.props.newSuffixData !== void 0 && this.props.newSuffixData.creationDate > prevProps.newSuffixData.creationDate) {
        this.updateRootSuffixNode(true);
      }
      if (this.props.wizardOperationInfo !== void 0 && this.props.wizardOperationInfo.time !== prevProps.wizardOperationInfo.time) {
        this.updateTreeData();
      }
      if (this.props.refreshEntryTime !== prevProps.refreshEntryTime || this.props.refreshButtonTriggerTime !== prevProps.refreshButtonTriggerTime) {
        this.refreshNode(this.state.activeItems[0], true);
      }
    }
    // End processDirectChildren().
    render() {
      const { allItems, activeItems } = this.state;
      return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(import_jsx_runtime90.Fragment, { children: [
        allItems.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Bullseye, { children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { children: _90("No Databases") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: this.props.isDisabled ? "ds-disabled ds-editor-tree" : "ds-editor-tree", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
          TreeView,
          {
            data: allItems,
            onSelect: this.handleTreeOnClick,
            activeItems,
            icon: this.props.skipLeafEntries ? null : /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(FolderIcon, {}),
            expandedIcon: this.props.skipLeafEntries ? null : /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(FolderOpenIcon, {}),
            hasBadges: !this.props.skipLeafEntries
          }
        ) })
      ] });
    }
  };
  LdapNavigator.propTypes = {
    editorLdapServer: import_prop_types84.default.string,
    treeItems: import_prop_types84.default.array,
    skipLeafEntries: import_prop_types84.default.bool,
    showTreeLoadingState: import_prop_types84.default.func,
    handleNodeOnClick: import_prop_types84.default.func
  };
  LdapNavigator.defaultProps = {
    editorLdapServer: "",
    treeItems: [],
    skipLeafEntries: false
  };
  var ldapNavigator_default = LdapNavigator;

  // src/lib/ldap_editor/treeView.jsx
  var import_jsx_runtime91 = __toESM(require_jsx_runtime(), 1);
  var _91 = cockpit_default.gettext;
  var EditorTreeView = class extends import_react161.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "showEntryLoading", (isEntryLoading) => {
        this.setState({
          searching: !!isEntryLoading
        });
      });
      __publicField(this, "showTreeLoadingState", (isTreeLoading) => {
        this.setState({
          isTreeLoading
        });
      });
      __publicField(this, "updateEntryRows", (treeViewItem) => {
        if (treeViewItem === null) {
          this.setState({
            entryRows: this.tableEmtpyStateRow,
            tableModificationTime: Date.now(),
            // Passed as property.
            entryModTime: "",
            // An empty value will not be rendered.
            entryModTimeLocal: "",
            entryIcon: null,
            entryDn: "",
            // An empty value disables the actions dropdown menu.
            latestEntryRefreshTime: Date.now(),
            searching: false
          });
          return;
        }
        this.props.handleToggleEntryMenu(false);
        const entryRows = [];
        const isEmptySuffix = treeViewItem.isEmptySuffix;
        let entryIcon = treeViewItem.icon;
        let entryStateIcon = "";
        const entryDn = treeViewItem.dn === "" ? "Root DSE" : treeViewItem.dn;
        const isSuffixEntry = treeViewItem.id === "0";
        const entryModTime = treeViewItem.modTime;
        const entryModTimeLocal = treeViewItem.modTimeLocal;
        const fullEntry = treeViewItem.fullEntry;
        const encodedValues = [];
        let isRole = false;
        fullEntry.filter((data) => data.attribute + data.value !== "" && // Filter out empty lines
        data.attribute !== "???: ").map((line) => {
          if (line.attribute !== void 0) {
            const attr = line.attribute;
            const attrLowerCase = attr.trim().toLowerCase();
            let val = line.value.substring(1);
            if (line.value.substring(0, 2) === "::") {
              if (this.attributesSpecialHandling.includes(attrLowerCase)) {
                encodedValues.push({ index: entryRows.length, line });
              } else {
                if (attrLowerCase === "nssymmetrickey") {
                  val = line.value.substring(3);
                } else {
                  val = b64DecodeUnicode(line.value.substring(3));
                }
              }
            }
            if (attr.toLowerCase() === "userpassword") {
              val = "********";
            }
            entryRows.push([{ title: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("strong", { children: attr }) }, val]);
            const myVal = val.trim().toLowerCase();
            const accountObjectclasses = [
              "nsaccount",
              "nsperson",
              "simplesecurityobject",
              "organization",
              "person",
              "account",
              "organizationalunit",
              "netscapeserver",
              "domain",
              "posixaccount",
              "shadowaccount",
              "posixgroup",
              "mailrecipient",
              "nsroledefinition"
            ];
            if (accountObjectclasses.includes(myVal)) {
              entryStateIcon = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(LockIcon, { className: "ds-pf-blue-color" });
            }
            if (myVal === "nsroledefinition") {
              isRole = true;
            }
            if (!entryIcon && attrLowerCase === "objectclass") {
              if (myVal === "inetorgperson" || myVal === "posixaccount" || myVal === "person") {
                entryIcon = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(UserIcon, {});
              } else if (myVal === "organizationalunit" || myVal === "groupofuniquenames" || myVal === "groupofnames") {
                entryIcon = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(UsersIcon, {});
              } else if (myVal === "domain") {
                entryIcon = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(DomainIcon, {});
              }
            }
          } else {
            entryRows.push([{ title: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("strong", { children: line.props.attr }) }, line]);
          }
          return [];
        });
        if (!entryIcon) {
          entryIcon = isEmptySuffix ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ResourcesEmptyIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CubeIcon, {});
        }
        const lastLine = fullEntry.length > 0 ? fullEntry.slice(-1).pop() : {};
        const isEntryTooLarge = isEmptySuffix ? false : lastLine.attribute === _91("MESSAGE") && lastLine.value === _91(":ENTRY TOO LARGE - OUTPUT TRUNCATED!");
        const entryIsLoading = false;
        let entryState = "";
        const cmd = [
          "dsidm",
          "-j",
          "ldapi://%2fvar%2frun%2fslapd-" + this.props.editorLdapServer + ".socket",
          "-b",
          entryDn,
          isRole ? "role" : "account",
          "entry-status",
          entryDn
        ];
        log_cmd("updateEntryRows", "Checking if entry is activated", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
          if (entryDn !== "Root DSE" && entryStateIcon !== "") {
            const status = JSON.parse(content);
            entryState = status.info.state;
            if (entryState === "inactivity limit exceeded" || entryState.startsWith("probably activated or")) {
              entryStateIcon = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ExclamationTriangleIcon, { className: "ds-pf-yellow-color ct-icon-exclamation-triangle" });
            }
          }
        }).fail((err) => {
          const errMsg = getApiErrorMessage(err);
          if (entryDn !== "Root DSE" && entryStateIcon !== "" && !errMsg.includes("Root suffix can't be locked or unlocked")) {
            console.error(
              "updateEntryRow",
              `${isRole ? "role" : "account"} account entry-status operation failed`,
              errMsg
            );
            entryState = "error: please, check browser logs";
            entryStateIcon = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ExclamationCircleIcon, { className: "ds-pf-red-color ct-exclamation-circle" });
          }
        }).finally(() => {
          const tableModificationTime = Date.now();
          this.setState({
            entryRows,
            entryDn,
            entryState,
            isSuffixEntry,
            entryModTime,
            entryModTimeLocal,
            isEmptySuffix,
            entryIsLoading,
            isEntryTooLarge,
            tableModificationTime,
            entryIcon,
            entryStateIcon,
            isRole
          }, () => {
            const finalRows = [...this.state.entryRows];
            let numberDecoded = 0;
            encodedValues.map((myObj) => {
              const attr = myObj.line.attribute;
              const attrLowerCase = attr.trim().toLowerCase();
              const encVal = myObj.line.value.substring(3);
              let decodedValue = encVal;
              switch (attrLowerCase) {
                case "jpegphoto": {
                  decodedValue = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_jsx_runtime91.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                    "img",
                    {
                      src: `data:image/png;base64,${encVal}`,
                      alt: "",
                      style: { width: "256px" }
                    }
                  ) });
                  const myPhoto = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                    "img",
                    {
                      src: `data:image/png;base64,${encVal}`,
                      alt: "",
                      style: { width: "48px" }
                    }
                  );
                  const newRow = [{ title: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("strong", { children: attr }) }, decodedValue];
                  finalRows.splice(myObj.index, 1, newRow);
                  numberDecoded++;
                  this.setState({ entryIcon: myPhoto });
                  break;
                }
                case "userpassword":
                  numberDecoded++;
                  break;
                case "usercertificate":
                case "usercertificate;binary":
                case "cacertificate":
                case "cacertificate;binary":
                  showCertificate(
                    encVal,
                    (result) => {
                      if (result.code === "OK") {
                        const timeDiff = result.timeDifference;
                        const certDays = Math.ceil(Math.abs(timeDiff) / (1e3 * 3600 * 24));
                        const dayMsg = certDays > 1 ? `${certDays} days` : `${certDays} day`;
                        const diffMessage = timeDiff > 0 ? `Certificate is valid for ${dayMsg}` : `Certificate is expired since ${dayMsg}`;
                        const type = timeDiff < 0 ? "danger" : timeDiff < 1e3 * 3600 * 24 * 30 ? "warning" : "info";
                        const certItems = result.data.map((datum) => {
                          return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_react161.default.Fragment, { children: [
                            /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(TextListItem, { component: TextListItemVariants.dt, children: datum.param }),
                            /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(TextListItem, { component: TextListItemVariants.dd, children: datum.paramVal })
                          ] }, datum.param);
                        });
                        decodedValue = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_jsx_runtime91.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { children: [
                          /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Alert, { variant: type, isInline: true, title: diffMessage }),
                          /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(TextList, { component: TextListVariants.dl, children: certItems }) })
                        ] }) });
                        const newRow = [{ title: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("strong", { children: attr }) }, decodedValue];
                        finalRows.splice(myObj.index, 1, newRow);
                        numberDecoded++;
                        if (encodedValues.length === numberDecoded) {
                          this.setState({
                            entryRows: finalRows,
                            tableModificationTime: Date.now()
                          });
                        }
                      }
                    }
                  );
                  break;
                default:
                  console.log(`Got an unexpected line ==> ${myObj.line}`);
                  console.log(`Got an unexpected line attr ==> ${myObj.line.attribute}`);
                  console.log(`Got an unexpected line value ==> ${myObj.line.value}`);
              }
              if (encodedValues.length === numberDecoded) {
                this.setState({
                  entryRows: finalRows,
                  tableModificationTime: Date.now()
                });
              }
              return [];
            });
            this.setState({
              latestEntryRefreshTime: Date.now()
            }, () => {
              this.showEntryLoading(false);
            });
          });
        });
      });
      this.attributesSpecialHandling = [
        "jpegphoto",
        "usercertificate",
        "usercertificate;binary",
        "cacertificate",
        "cacertificate;binary",
        "userpassword"
      ];
      this.tableEmtpyStateRow = [{
        showAnEmptyTable: true,
        // Used in the render() for a quick check.
        heightAuto: true,
        cells: [{
          props: { colSpan: 8 },
          title: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Bullseye, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(EmptyState, { variant: EmptyStateVariant.sm, children: [
            /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(EmptyStateHeader, { titleText: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_jsx_runtime91.Fragment, { children: _91("No entry is selected") }), icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(EmptyStateIcon, { icon: ResourcesEmptyIcon }), headingLevel: "h2" }),
            /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(EmptyStateBody, { children: _91("Select an entry to see its details.") })
          ] }) })
        }]
      }];
      this.state = {
        alerts: [],
        firstClickOnTree: false,
        searchInput: "",
        rowsValues: [],
        entryColumns: [
          { title: _91("Attribute") },
          // { title: 'Value', transforms: [wrappable] }],
          { title: _91("Value"), cellTransforms: [breakWord] }
        ],
        entryRows: [],
        entryIsLoading: true,
        entryIcon: null,
        entryDn: "",
        entryState: "",
        entryStateIcon: null,
        isSuffixEntry: false,
        entryModTime: "",
        entryModTimeLocal: "",
        timeFormat: "utc",
        isEmptySuffix: false,
        showPagination: false,
        isEntryTooLarge: false,
        // To trigger an update in GenericPagination.componentDidUpdate().
        // Maybe just use a random number?
        tableModificationTime: 0,
        showEmptySuffixModal: false,
        newSuffixData: { creationDate: 0 },
        isTreeLoading: false,
        refreshButtonTriggerTime: 0,
        latestEntryRefreshTime: 0,
        searching: false,
        isRole: false
      };
      this.addAlert = (title, variant, key) => {
        this.setState({
          alerts: [...this.state.alerts, { title, variant, key }]
        });
      };
      this.removeAlert = (key) => {
        this.setState({ alerts: [...this.state.alerts.filter((el) => el.key !== key)] });
      };
      this.handleTimeToggle = (format2) => {
        this.setState({
          timeFormat: format2
        });
      };
      this.onNodeOnClick = (treeViewItem) => {
        if (treeViewItem && treeViewItem.dn === this.state.entryDn) {
          this.updateEntryRows(treeViewItem);
          return;
        }
        this.setState({
          searching: true
        }, () => {
          if (!this.state.firstClickOnTree) {
            this.setState({
              firstClickOnTree: true
            });
            this.props.setTreeFirstClicked(true);
          }
          this.updateEntryRows(treeViewItem);
        });
      };
      this.handleEmptySuffixToggle = (resultParams) => {
        this.onEmptySuffixToggle(resultParams);
      };
      this.onEmptySuffixToggle = (resultParams) => {
        this.setState(({ showEmptySuffixModal }) => ({
          showEmptySuffixModal: !showEmptySuffixModal
        }));
        if (resultParams.message) {
          const creationDate = Date.now();
          this.addAlert(resultParams.message, resultParams.variant, creationDate);
          if (resultParams.variant === "success") {
            const rootEntryData = resultParams.rootEntryData;
            this.setState({
              newSuffixData: { rootEntryData, creationDate }
            }, () => {
              this.props.onReload(true);
            });
          }
        }
      };
    }
    // End constructor.
    componentDidMount() {
      this.props.setTreeFirstClicked(false);
    }
    componentDidUpdate(prevProps) {
      if (this.props.loading !== prevProps.loading) {
        this.setState({ firstClickOnTree: false });
        this.props.setTreeFirstClicked(false);
      }
    }
    render() {
      const {
        alerts,
        searching,
        isSuffixEntry,
        isRole,
        firstClickOnTree,
        entryColumns,
        entryRows,
        entryIcon,
        entryDn,
        entryModTime,
        entryModTimeLocal,
        isEmptySuffix,
        isEntryTooLarge,
        tableModificationTime,
        showEmptySuffixModal,
        entryState,
        newSuffixData,
        isTreeLoading,
        refreshButtonTriggerTime,
        latestEntryRefreshTime,
        entryStateIcon,
        timeFormat: timeFormat2
      } = this.state;
      const { loading } = this.props;
      let lockingDropdown = [];
      if (entryState !== "" && !entryState.startsWith("error:")) {
        if (entryState !== "activated") {
          if (entryState.includes("probably activated") || entryState.includes("indirectly locked")) {
            lockingDropdown = [
              /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                DropdownItem2,
                {
                  component: "button",
                  name: isRole ? ENTRY_MENU.lockRole : ENTRY_MENU.lockAccount,
                  value: entryDn,
                  children: _91("Lock ...")
                },
                "tree-view-lock"
              )
            ];
          } else {
            lockingDropdown = [
              /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                DropdownItem2,
                {
                  component: "button",
                  name: isRole ? ENTRY_MENU.unlockRole : ENTRY_MENU.unlockAccount,
                  value: entryDn,
                  children: _91("Unlock ...")
                },
                "tree-view-unlock"
              )
            ];
          }
        } else {
          lockingDropdown = [
            /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
              DropdownItem2,
              {
                component: "button",
                name: isRole ? ENTRY_MENU.lockRole : ENTRY_MENU.lockAccount,
                value: entryDn,
                children: _91("Lock ...")
              },
              "tree-view-lock"
            )
          ];
        }
      }
      const dropdownItems = [
        /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
          DropdownItem2,
          {
            component: "button",
            name: ENTRY_MENU.search,
            value: entryDn,
            children: _91("Search ...")
          },
          "tree-view-search"
        ),
        /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(DropdownSeparator, {}, "separator-2"),
        /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
          DropdownItem2,
          {
            component: "button",
            name: ENTRY_MENU.edit,
            value: entryDn,
            isDisabled: isEntryTooLarge,
            children: _91("Edit ...")
          },
          "tree-view-edit"
        ),
        /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
          DropdownItem2,
          {
            component: "button",
            name: ENTRY_MENU.new,
            value: entryDn,
            children: _91("New ...")
          },
          "tree-view-new"
        ),
        /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
          DropdownItem2,
          {
            component: "button",
            name: ENTRY_MENU.rename,
            value: entryDn,
            isDisabled: isSuffixEntry,
            children: _91("Rename ...")
          },
          "tree-view-rename"
        ),
        // Lock and Unlock buttons
        ...lockingDropdown,
        /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
          DropdownItem2,
          {
            component: "button",
            name: ENTRY_MENU.acis,
            value: entryDn,
            children: _91("ACIs ...")
          },
          "tree-view-acis"
        ),
        /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
          DropdownItem2,
          {
            component: "button",
            name: ENTRY_MENU.cos,
            value: entryDn,
            children: _91("Class of Service ...")
          },
          "tree-view-cos"
        ),
        /*
        <DropdownItem
            isDisabled
            key="tree-view-refs"
            component="button"
            name="smartRefs"
            value={entryDn}
        >
            Smart Referrals ...
        </DropdownItem>,
        */
        /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(DropdownSeparator, {}, "separator-3"),
        /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
          DropdownItem2,
          {
            component: "button",
            name: ENTRY_MENU.delete,
            value: entryDn,
            children: _91("Delete ...")
          },
          "tree-view-delete"
        )
      ];
      const loadingStateComponent = /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "ds-margin-top-lg ds-indent", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Label, { icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CatalogIcon, {}), color: "blue", children: [
          /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("strong", { children: this.props.treeViewRootSuffixes.length > 1 ? _91("Suffix Trees") : _91("Suffix Tree") }),
          /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
            Button,
            {
              variant: "link",
              title: _91("Refresh all the suffixes"),
              icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(SyncAltIcon, {}),
              onClick: () => {
                this.props.onReload(true);
              }
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Text, { component: TextVariants.h3, children: _91("Loading ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Spinner, { className: "ds-margin-top-lg", size: "lg" })
        ] })
      ] });
      const loadingEntryComponent = /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "ds-margin-top-xlg ds-center", children: [
        /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Text, { component: TextVariants.h3, children: _91("Loading ...") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Spinner, { className: "ds-margin-top-lg", size: "lg" })
      ] });
      const finishedAt = /* @__PURE__ */ new Date();
      finishedAt.setTime(this.props.timeOfCompletion);
      const isValidData = entryDn ? true : entryRows[0] ? entryRows[0].showAnEmptyTable : false;
      let page_body = "";
      if (loading) {
        page_body = loadingStateComponent;
      } else {
        page_body = /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { children: [
          alerts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(AlertGroup, { isToast: true, children: alerts.map(({ key, variant, title }) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
            Alert,
            {
              isLiveRegion: true,
              variant: AlertVariant[variant],
              title,
              timeout: true,
              actionClose: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                AlertActionCloseButton,
                {
                  title: _91("Suffix creation"),
                  variantLabel: `${variant} alert`,
                  onClose: () => this.removeAlert(key)
                }
              )
            },
            key
          )) }),
          /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Grid, { hasGutter: true, className: "ds-margin-top-lg ds-indent", children: [
            /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(GridItem, { span: 6, children: [
              /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Label, { icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CatalogIcon, {}), color: "blue", children: [
                /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("strong", { children: this.props.treeViewRootSuffixes.length > 1 ? _91("Suffix Trees") : _91("Suffix Tree") }),
                /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                  Button,
                  {
                    variant: "link",
                    title: _91("Refresh all the suffixes"),
                    icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(SyncAltIcon, {}),
                    onClick: () => {
                      this.props.onReload(true);
                    }
                  }
                )
              ] }),
              !loading && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                ldapNavigator_default,
                {
                  treeItems: [...this.props.treeViewRootSuffixes],
                  timeOfCompletion: this.props.timeOfCompletion,
                  editorLdapServer: this.props.editorLdapServer,
                  wizardOperationInfo: this.props.wizardOperationInfo,
                  newSuffixData,
                  handleNodeOnClick: this.onNodeOnClick,
                  updateEntryRows: this.updateEntryRows,
                  refreshEntryTime: this.props.refreshEntryTime,
                  showTreeLoadingState: this.showTreeLoadingState,
                  refreshButtonTriggerTime,
                  handleEntryRefresh: this.refreshEntry,
                  addNotification: this.props.addNotification,
                  isDisabled: isTreeLoading || searching
                },
                this.props.loading
              )
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(GridItem, { span: 6, children: [
              firstClickOnTree && /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Label, { icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(InfoCircleIcon, {}), color: "blue", children: [
                /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("strong", { children: _91("Entry Details") }),
                /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                  Tooltip,
                  {
                    position: "top",
                    content: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { children: _91("Reload the LDAP entry.") }),
                    children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                      Button,
                      {
                        variant: "link",
                        icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(SyncAltIcon, {}),
                        onClick: () => this.setState({ refreshButtonTriggerTime: Date.now() })
                      }
                    )
                  }
                )
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "ds-margin-bottom" }),
              searching && loadingEntryComponent,
              firstClickOnTree && !loading && !searching && isValidData && /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Card, { isSelectable: true, isClickable: true, children: [
                /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CardHeader, { actions: { actions: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_jsx_runtime91.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                  Dropdown2,
                  {
                    onSelect: this.props.onSelectEntryOptions,
                    toggle: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                      KebabToggle,
                      {
                        isDisabled: isEmptySuffix || entryDn === "",
                        onToggle: this.props.handleToggleEntryMenu
                      }
                    ),
                    isOpen: this.props.entryMenuIsOpen,
                    isPlain: true,
                    dropdownItems,
                    position: "right"
                  }
                ) }), hasNoOffset: false, className: void 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Title, { headingLevel: "h6", size: "md", children: [
                  entryIcon,
                  /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("span", { children: [
                    "\u2002",
                    entryDn,
                    " "
                  ] }),
                  entryState !== "" && entryStateIcon !== "" && entryState !== "activated" ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                    Tooltip,
                    {
                      position: "bottom",
                      content: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { children: entryState }),
                      children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("a", { className: "ds-font-size-md", children: entryStateIcon })
                    }
                  ) : ""
                ] }) }),
                isEntryTooLarge && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CardTitle, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Label, { color: "orange", icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(InfoCircleIcon, {}), children: _91("Entry is too large - Table is truncated.") }) }),
                /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(CardBody, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                    genericPagination_default,
                    {
                      columns: entryColumns,
                      rows: entryRows,
                      tableModificationTime,
                      ariaLabel: "Entry details table with pagination"
                    }
                  ),
                  isEmptySuffix && /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(EmptyState, { variant: EmptyStateVariant.sm, children: [
                    /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(EmptyStateHeader, { titleText: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_jsx_runtime91.Fragment, { children: _91("Empty suffix!") }), icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(EmptyStateIcon, { icon: ResourcesEmptyIcon }), headingLevel: "h2" }),
                    /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(EmptyStateBody, { children: [
                      /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Label, { variant: "outline", color: "orange", icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(InfoCircleIcon, {}), children: _91("The suffix is configured, but it has no entries.") }),
                      /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
                        Button,
                        {
                          className: "ds-margin-top-lg",
                          variant: "link",
                          onClick: this.handleEmptySuffixToggle,
                          children: [
                            _91("Create the root suffix entry"),
                            " ",
                            /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ArrowRightIcon, {})
                          ]
                        }
                      )
                    ] })
                  ] }),
                  showEmptySuffixModal && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                    rootSuffix_default,
                    {
                      showEmptySuffixModal,
                      handleEmptySuffixToggle: this.onEmptySuffixToggle,
                      suffixDn: entryDn,
                      editorLdapServer: this.props.editorLdapServer,
                      updateEntryRows: this.updateEntryRows
                    }
                  )
                ] }),
                !isEmptySuffix && entryModTime.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(CardFooter, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { children: [
                    _91("Last Modified Time"),
                    ": ",
                    /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Label, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("i", { children: timeFormat2 === "utc" ? entryModTime : entryModTimeLocal }) }),
                    /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
                      ToggleGroup,
                      {
                        className: "ds-inline ds-left-margin",
                        isCompact: true,
                        "aria-label": "time format toggle",
                        children: [
                          /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                            ToggleGroupItem,
                            {
                              text: "UTC",
                              buttonId: "utc",
                              isSelected: timeFormat2 === "utc",
                              onChange: () => this.handleTimeToggle("utc"),
                              className: "ds-inline",
                              title: "UTC time"
                            }
                          ),
                          /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                            ToggleGroupItem,
                            {
                              text: "Local time",
                              buttonId: "local",
                              isSelected: timeFormat2 === "local",
                              onChange: () => this.handleTimeToggle("local"),
                              className: "ds-inline",
                              title: "Local time"
                            }
                          )
                        ]
                      }
                    )
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "ds-margin-bottom-md" }),
                  /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Divider, {}),
                  /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "ds-margin-bottom-md" }),
                  /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Label, { variant: "outline", color: "blue", children: [
                    _91("Last Refresh at"),
                    " ",
                    new Date(latestEntryRefreshTime).toLocaleString()
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                    Tooltip,
                    {
                      position: "top",
                      content: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { children: _91("Reload the LDAP entry.") }),
                      children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
                        Button,
                        {
                          variant: "link",
                          icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(SyncAltIcon, {}),
                          onClick: () => this.setState({ refreshButtonTriggerTime: Date.now() })
                        }
                      )
                    }
                  )
                ] })
              ] })
            ] })
          ] })
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_jsx_runtime91.Fragment, { children: page_body });
    }
  };
  var treeView_default = EditorTreeView;

  // src/lib/ldap_editor/search.jsx
  var import_react181 = __toESM(require_react(), 1);
  var import_prop_types86 = __toESM(require_prop_types(), 1);

  // src/lib/ldap_editor/wizards/genericWizard.jsx
  var import_react180 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/wizards/aci.jsx
  var import_react164 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/lib/aciParser.jsx
  function getAciAttributes(aci) {
    let startIndex = 0;
    const aciAttributes = [];
    const length = aci.length;
    for (let i = 0; i < length; i++) {
      switch (aci.charAt(i)) {
        case " ":
        // skip over space
        case "\n":
          break;
        case "(":
          i++;
        // intentional drop through to default
        // eslint-disable-next-line no-fallthrough
        default:
          i = parseAciName(aci, i, aciAttributes, startIndex);
          startIndex = i;
          break;
      }
      if (i < 0) {
        i = -i;
        console.log("ACI ERROR: cannot parse at index " + i);
        console.log(aci);
        let spaces = "";
        for (let x2 = 0; x2 < i; x2++) {
          spaces += " ";
        }
        console.log(`${spaces}^`);
        break;
      }
    }
    return aciAttributes;
  }
  function parseAciName(aci, i, aciAttributes, startIndex) {
    const length = aci.length;
    let aciName = "";
    let isNameFound = false;
    for (; i < length; i++) {
      const x2 = aci.charAt(i);
      switch (x2) {
        case "\n":
          break;
        case "(":
        // skip over leading paren
        case " ":
          if (aciName.length > 0) {
            isNameFound = true;
          }
          break;
        case "|":
        // operators
        case "<":
        case ">":
        case "!":
        case "=":
          isNameFound = true;
          break;
        case ")":
          return i;
        case ";":
          break;
        default:
          aciName += x2;
          break;
      }
      if (isNameFound) {
        if (aciName.length > 0) {
          const nameString = aciName.toString();
          if (nameString.toLowerCase() === "and" || nameString.toLowerCase() === "or") {
            const aciAttr = {
              aciName: "",
              operator: nameString,
              value: "",
              startIndex,
              endIndex: i
            };
            aciAttributes.push(aciAttr);
            startIndex = i + 1;
          } else {
            if (aci.charAt(i) === " " || aci.charAt(i) === "(") {
              i++;
            }
            i = parseAciValue(aci, i, nameString, aciAttributes, startIndex);
            startIndex = i;
          }
          if (i > 0) {
            isNameFound = false;
            aciName = null;
            aciName = "";
            i--;
            continue;
          }
        }
        return i;
      }
    }
    return i;
  }
  function parseAciValue(aci, i, aciName, aciAttributes, startIndex) {
    const length = aci.length;
    let value = "";
    let operator = "";
    let isValueFound = false;
    let isQuoteOpen = false;
    let countParenthesis = 0;
    for (; i < length; i++) {
      const x2 = aci.charAt(i);
      switch (x2) {
        case "\n":
          break;
        case "|":
        //
        case "<":
        //
        case ">":
        // skip over operators
        case "!":
        //
        case "=":
          if (value.length > 0) {
            value += x2;
          } else {
            operator += x2;
          }
          break;
        case " ":
          if (value.length > 0) {
            value += x2;
          }
          break;
        case '"':
          value += x2;
          isQuoteOpen = !isQuoteOpen;
          if (isQuoteOpen === false) {
            isValueFound = true;
          }
          break;
        case "(":
          if (isQuoteOpen === false) {
            countParenthesis++;
          }
          value += x2;
          break;
        case ")":
          if (countParenthesis > 0 || isQuoteOpen) {
            value += x2;
          }
          if (!isQuoteOpen) {
            countParenthesis--;
            if (countParenthesis <= 0) {
              isValueFound = true;
            }
          }
          break;
        case ";":
          isValueFound = true;
          break;
        default:
          value += x2;
          break;
      }
      if (isValueFound) {
        const len = value.length;
        if (len > 0) {
          let v = value.toString();
          if (v.endsWith('"')) {
            v = v.substring(0, v.length - 1);
          }
          if (v.startsWith('"')) {
            v = v.substring(1);
          }
          const aciAttr = {
            aciName,
            operator: operator.toString(),
            value: v,
            startIndex,
            endIndex: i
          };
          aciAttributes.push(aciAttr);
          return i + 1;
        }
        break;
      }
    }
    return -i;
  }
  function getAciActualName(fullAci) {
    const aciData = getAciAttributes(fullAci);
    const aciName = aciData.filter((aci) => aci.aciName === "acl");
    const aciActualName = aciName[0].value;
    return aciActualName;
  }
  function isAciPermissionAllow(fullAci) {
    const aciData = getAciAttributes(fullAci);
    const aciAllow = aciData.filter((aci) => aci.aciName === "allow");
    return aciAllow.length > 0;
  }

  // src/lib/ldap_editor/wizards/operations/aciNew.jsx
  var import_react163 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/wizards/operations/aciBindRuleTable.jsx
  var import_react162 = __toESM(require_react(), 1);
  var import_jsx_runtime92 = __toESM(require_jsx_runtime(), 1);
  var _92 = cockpit_default.gettext;
  var AciBindRuleTable = class extends import_react162.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getActions", (rowIndex) => [
        {
          title: _92("Remove Bind Rule"),
          onClick: () => this.props.removeRow(rowIndex)
        }
      ]);
      this.state = {
        columns: [
          { title: _92("Bind Rule") },
          { title: _92("Comparator") },
          { title: _92("LDAP URLs") }
        ],
        rows: []
      };
    }
    componentDidMount() {
      let columns = [
        { title: _92("Bind Rule") },
        { title: _92("Comparator") },
        { title: _92("LDAP URLs") }
      ];
      let rows = [...this.props.rows];
      if (this.props.rows.length === 0) {
        columns = [{ title: _92("Bind Rules") }];
        rows = [{ cells: [_92("No bind rules")] }];
      }
      this.setState({
        rows,
        columns
      });
    }
    render() {
      const { columns, rows } = this.state;
      const hasRows = this.props.rows.length !== 0;
      return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
        Table,
        {
          className: "ds-margin-top-lg",
          "aria-label": "bind rule Table",
          variant: "compact",
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Tr, { children: [
              columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Th, { children: column.title }, columnIndex)),
              hasRows && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Th, { screenReaderText: "Actions" })
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Tbody, { children: rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Tr, { children: [
              Array.isArray(row) ? (
                // Handle array-type rows
                row.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Td, { children: cell }, cellIndex))
              ) : (
                // Handle object-type rows (for the "No bind rules" case)
                row.cells && row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Td, { children: cell }, cellIndex))
              ),
              hasRows && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
                ActionsColumn,
                {
                  items: this.getActions(rowIndex)
                }
              ) })
            ] }, rowIndex)) })
          ]
        }
      );
    }
  };
  var aciBindRuleTable_default = AciBindRuleTable;

  // src/lib/ldap_editor/wizards/operations/aciNew.jsx
  var import_info_circle_icon4 = __toESM(require_info_circle_icon(), 1);
  var import_jsx_runtime93 = __toESM(require_jsx_runtime(), 1);
  var _93 = cockpit_default.gettext;
  var AddNewAci = class extends import_react163.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "showTreeLoadingState", (isTreeLoading) => {
        this.setState({
          isTreeLoading,
          searching: !!isTreeLoading
        });
      });
      __publicField(this, "handleCloseAddBindRuleModal", () => {
        this.setState({
          showAddBindRuleModal: false
        });
      });
      __publicField(this, "handleOpenAddBindRule", () => {
        this.setState({
          showAddBindRuleModal: true,
          bindRuleType: "userdn",
          bindRuleOperator: "=",
          bindRuleValue: "",
          authmethod: "none",
          authMethodOperator: "=",
          usersChosenOptions: [],
          usersAvailableOptions: [],
          dnsOperator: "=",
          ipOperator: "=",
          dns: "",
          ip: ""
        });
      });
      __publicField(this, "updateUserBindRulesState", () => {
        let haveUserRules = false;
        let haveUserAttrRules = false;
        let hasSelectionSelection = false;
        const specialSelect = this.state.specialSelection;
        for (const rule of this.state.bindRuleRows) {
          if (rule.cells[0].endsWith("dn")) {
            haveUserRules = true;
            if (rule.cells[0] === "userdn" && (rule.cells[2] === "ldap:///self" || rule.cells[2] === "ldap:///all" || rule.cells[2] === "ldap:///anyone" || rule.cells[2] === "ldap:///parent")) {
              hasSelectionSelection = true;
            }
          } else if (rule.cells[0] === "userattr") {
            haveUserAttrRules = true;
          }
        }
        this.setState({
          haveUserRules,
          haveUserAttrRules,
          specialSelection: hasSelectionSelection ? specialSelect : ""
        });
      });
      __publicField(this, "handleAddBindRule", () => {
        let bindRow = {};
        let selection = this.state.specialSelection;
        if (this.state.bindRuleType === "User DN Aliases") {
          if (selection === "") {
            selection = "ldap:///anyone";
          }
          bindRow = {
            cells: ["userdn", "=", selection]
          };
        } else if (this.state.bindRuleType === "authmethod") {
          bindRow = {
            cells: ["authmethod", this.state.authMethodOperator, this.state.authmethod]
          };
        } else if (this.state.bindRuleType === "ssf") {
          bindRow = {
            cells: ["ssf", this.state.ssfOperator, this.state.ssf]
          };
        } else if (this.state.bindRuleType === "ip") {
          bindRow = {
            cells: ["ip", this.state.ipOperator, this.state.ip]
          };
        } else if (this.state.bindRuleType === "dns") {
          bindRow = {
            cells: ["dns", this.state.dnsOperator, this.state.dns]
          };
        } else if (this.state.bindRuleType === "userattr") {
          const userattrVal = this.getUserattrVal();
          bindRow = {
            cells: ["userattr", this.state.userattrOperator, userattrVal]
          };
        } else {
          let value = "";
          for (const entryIdx in this.state.usersChosenOptions) {
            if (entryIdx > 0) {
              value += " || ";
            }
            const dn = this.state.usersChosenOptions[entryIdx].props.title;
            value += "ldap:///" + dn;
          }
          bindRow = {
            cells: [this.state.bindRuleType, this.state.bindRuleOperator, value]
          };
        }
        const rows = [...this.state.bindRuleRows];
        rows.push(bindRow);
        this.setState({
          bindRuleRows: rows,
          showAddBindRuleModal: false,
          specialSelection: selection
        }, () => {
          this.updateUserBindRulesState();
        });
      });
      __publicField(this, "removeBindRuleRow", (rowId) => {
        const revisedRows = [];
        for (const idx in this.state.bindRuleRows) {
          if (idx.toString() !== rowId.toString()) {
            revisedRows.push(this.state.bindRuleRows[idx]);
          }
        }
        this.setState({
          bindRuleRows: revisedRows
        }, () => {
          this.updateUserBindRulesState();
        });
      });
      this.rightsColumns = [{ title: _93("Right") }, { title: _93("Description") }];
      this.targetsColumns = [
        { title: _93("Name"), transforms: [sortable] },
        { title: _93("OID"), transforms: [sortable] }
      ];
      this.dayMap = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
      this.state = {
        // General
        editVisually: true,
        stepIdReachedVisual: 1,
        savedStepId: 1,
        isAciSyntaxValid: false,
        searchPattern: "",
        newAciName: "",
        isTreeLoading: false,
        searching: false,
        aciText: "",
        aciTextNew: "",
        attributes: [],
        resultVariant: "success",
        commandOutput: "",
        // targets
        target: this.props.wizardEntryDn,
        targetAttrs: [],
        targetAttrCompOp: "=",
        isOpenTargetAttrOperator: false,
        targetFilter: "",
        target_to: "",
        target_from: "",
        // Bind rules
        specialSelection: "",
        bindRuleRows: [],
        haveUserRules: false,
        haveUserAttrRules: false,
        userattrOperator: "=",
        userattrAttr: "",
        userattrBindType: "USERDN",
        userAttrParent0: false,
        userAttrParent1: false,
        userAttrParent2: false,
        userAttrParent3: false,
        userAttrParent4: false,
        authmethod: "none",
        authMethods: [],
        authMethodOperator: "=",
        hosts: [],
        ips: [],
        dayofweek: [],
        sunday: false,
        monday: false,
        tuesday: false,
        wednesday: false,
        thursday: false,
        friday: false,
        saturday: false,
        timeOfDayStart: "0000",
        timeStartCompOp: ">",
        timeOfDayEnd: "0000",
        timeEndCompOp: "<",
        ssf: "",
        ssfOperator: ">=",
        // Users
        usersSearchBaseDn: this.props.wizardEntryDn,
        isSearchRunning: false,
        usersAvailableOptions: [],
        usersChosenOptions: [],
        isUsersDrawerExpanded: false,
        isTargetsDrawerExpanded: false,
        // Rights
        rightType: "allow",
        isOpenRights: false,
        rightsRows: [
          { cells: [_93("read"), _93("See the values of targeted attributes")], selected: false },
          { cells: [_93("compare"), _93("Compare targeted attribute values")], selected: false },
          { cells: [_93("search"), _93("Determine if targeted attributes exist")], selected: false },
          { cells: [_93("selfwrite"), _93("Add one's own DN to the target")], selected: false },
          { cells: [_93("write"), _93("Modify targeted attributes")], selected: false },
          { cells: [_93("delete"), _93("Remove targeted entries")], selected: false },
          { cells: [_93("add"), _93("Add targeted entries")], selected: false },
          { cells: [_93("moddn"), _93("Move an entry from one subtree to another")], selected: false },
          { cells: [_93("proxy"), _93("Authenticate as another user")], selected: false }
        ],
        // Targets
        targetAttrRows: [],
        sortBy: {},
        tableModificationTime: 0,
        // Add bind rule modal
        showAddBindRuleModal: false,
        bindRuleType: "userdn",
        bindRuleOperator: "=",
        ldapURL: "",
        adding: true
      };
      this.getUserattrVal = () => {
        const {
          userAttrParent1,
          userAttrParent2,
          userAttrParent3,
          userAttrParent4,
          userattrAttr,
          userattrBindType
        } = this.state;
        let inheritVal = "";
        if (userAttrParent1 || userAttrParent2 || userAttrParent3 || userAttrParent4) {
          inheritVal = "parent[0";
          if (userAttrParent1) {
            inheritVal += ",1";
          }
          if (userAttrParent2) {
            inheritVal += ",2";
          }
          if (userAttrParent3) {
            inheritVal += ",3";
          }
          if (userAttrParent4) {
            inheritVal += ",4";
          }
          inheritVal += "].";
        }
        inheritVal += userattrAttr + "#" + userattrBindType;
        return inheritVal;
      };
      this.handleBuildAciText = () => {
        const {
          bindRuleRows,
          newAciName,
          rightsRows,
          rightType,
          target_to,
          target_from,
          target,
          targetAttrs,
          targetAttrCompOp,
          targetFilter,
          timeOfDayStart,
          timeStartCompOp,
          timeOfDayEnd,
          timeEndCompOp,
          sunday,
          monday,
          tuesday,
          wednesday,
          thursday,
          friday,
          saturday
        } = this.state;
        if (target === "") {
          this.setState({
            aciText: "??????"
          });
          return;
        }
        const userDNs = [];
        const groupDNs = [];
        const roleDNs = [];
        const authMethods = [];
        const ssfs = [];
        const ips = [];
        const dns = [];
        const userattr = [];
        for (const rule of bindRuleRows) {
          if (rule.cells[0] === "userdn") {
            userDNs.push(rule.cells[0] + rule.cells[1] + '"' + rule.cells[2] + '"');
          } else if (rule.cells[0] === "groupdn") {
            groupDNs.push(rule.cells[0] + rule.cells[1] + '"' + rule.cells[2] + '"');
          } else if (rule.cells[0] === "roledn") {
            roleDNs.push(rule.cells[0] + rule.cells[1] + '"' + rule.cells[2] + '"');
          } else if (rule.cells[0] === "authmethod") {
            authMethods.push(rule.cells[0] + rule.cells[1] + '"' + rule.cells[2] + '"');
          } else if (rule.cells[0] === "ssf") {
            ssfs.push(rule.cells[0] + rule.cells[1] + '"' + rule.cells[2] + '"');
          } else if (rule.cells[0] === "ip") {
            ips.push(rule.cells[0] + rule.cells[1] + '"' + rule.cells[2] + '"');
          } else if (rule.cells[0] === "dns") {
            dns.push(rule.cells[0] + rule.cells[1] + '"' + rule.cells[2] + '"');
          } else if (rule.cells[0] === "userattr") {
            userattr.push(rule.cells[0] + rule.cells[1] + '"' + this.getUserattrVal() + '"');
          }
        }
        let aciText = '(target="ldap:///' + target + '")';
        if (targetAttrs.length > 0) {
          aciText += "(targetattr" + targetAttrCompOp + '"';
          for (const attrIdx in targetAttrs) {
            aciText += targetAttrs[attrIdx];
            if (targetAttrs.length > 1 && Number(attrIdx) + 1 < targetAttrs.length) {
              aciText += " || ";
            }
          }
          aciText += '")';
        } else {
          aciText += '(targetattr="*")';
        }
        if (targetFilter !== "") {
          aciText += '(targetfilter="' + targetFilter + '")';
        }
        if (target_from !== "" && target_to !== "") {
          aciText += '(target_from="' + target_from + '")';
          aciText += '(target_to="' + target_to + '")';
        }
        aciText += '(version 3.0; acl "' + newAciName + '"; ';
        const rights = rightsRows.filter((item) => item.selected).map((cells) => cells.cells[0]).toString();
        aciText += rightType + "(" + rights + ")";
        let brCount = 0;
        for (const bindRule of [userDNs, groupDNs, roleDNs, authMethods, ssfs, ips, dns, userattr]) {
          if (bindRule.length > 0) {
            const many = bindRule.length > 1;
            if (brCount > 0) {
              aciText += " and ";
            } else {
              aciText += " ";
            }
            if (many) {
              aciText += "(";
            }
            for (const idx in bindRule) {
              aciText += bindRule[idx];
              if (many && idx < bindRule.length) {
                aciText += " or ";
              }
            }
            if (many) {
              aciText += ")";
            }
            brCount += 1;
          }
        }
        if (sunday || monday || tuesday || wednesday || thursday || friday || saturday) {
          if (brCount > 0) {
            aciText += " and ";
          } else {
            aciText += " ";
          }
          const allDays = [sunday, monday, tuesday, wednesday, thursday, friday, saturday];
          const days = [];
          aciText += 'dayofweek="';
          for (const idx in allDays) {
            if (allDays[idx]) {
              days.push(this.dayMap[idx]);
            }
          }
          aciText += days.join(",") + '"';
          brCount += 1;
        }
        if (timeOfDayStart !== "0000" || timeOfDayEnd !== "0000") {
          if (brCount > 0) {
            aciText += " and ";
          } else {
            aciText += " ";
          }
          aciText += _93("timeofday") + timeStartCompOp + '"' + timeOfDayStart + '"';
          aciText += _93(" and timeofday") + timeEndCompOp + '"' + timeOfDayEnd + '")';
          brCount += 1;
        }
        aciText += ";)";
        this.setState({
          aciText,
          aciTextNew: aciText
        });
      };
      this.onSelectedAttrs = (attrs) => {
        this.setState({
          targetAttrs: attrs
        });
      };
      this.usersDrawerRef = import_react163.default.createRef();
      this.targetsDrawerRef = import_react163.default.createRef();
      this.handleToggleTargetAttrOp = (_event, isOpenTargetAttrOperator) => {
        this.setState({
          isOpenTargetAttrOperator
        });
      };
      this.handleSelectTargetAttrOp = (event, selection) => {
        this.setState({
          targetAttrCompOp: selection,
          isOpenTargetAttrOperator: false
        });
      };
      this.handleToggleRights = (_event, isOpenRights) => {
        this.setState({
          isOpenRights
        });
      };
      this.handleSelectRights = (event, selection) => {
        this.setState({
          rightType: selection,
          isOpenRights: false
        });
      };
      this.onUsersDrawerExpand = () => {
        this.usersDrawerRef.current && this.usersDrawerRef.current.focus();
      };
      this.onTargetsDrawerExpand = () => {
        this.targetsDrawerRef.current && this.targetsDrawerRef.current.focus();
      };
      this.handleUsersDrawerClick = () => {
        const isUsersDrawerExpanded = !this.state.isUsersDrawerExpanded;
        this.setState({
          isUsersDrawerExpanded
        });
      };
      this.onTargetsDrawerClick = () => {
        const isTargetsDrawerExpanded = !this.state.isTargetsDrawerExpanded;
        this.setState({
          isTargetsDrawerExpanded
        });
      };
      this.handleUsersDrawerCloseClick = () => {
        this.setState({
          isUsersDrawerExpanded: false
        });
      };
      this.onTargetsDrawerCloseClick = () => {
        this.setState({
          isTargetsDrawerExpanded: false
        });
      };
      this.handleSearchClick = () => {
        if (this.state.isSearchRunning) {
          return;
        }
        this.setState({
          isSearchRunning: true,
          usersAvailableOptions: []
        }, this.getEntries);
      };
      this.handleTimeChange = (time_str, id) => {
        const time_val = time_str.replace(":", "");
        this.setState({
          [id]: time_val
        });
      };
      this.getEntries = () => {
        const searchArea = this.state.bindRuleType;
        const baseDn = this.state.usersSearchBaseDn;
        let filter = "";
        const pattern = this.state.searchPattern;
        if (searchArea === "userdn") {
          filter = pattern === "" ? "(|(objectClass=person)(objectClass=nsPerson)(objectClass=nsAccount)(objectClass=nsOrgPerson)(objectClass=posixAccount))" : `(&(|(objectClass=person)(objectClass=nsPerson)(objectClass=nsAccount)(objectClass=nsOrgPerson)(objectClass=posixAccount))(|(cn=*${pattern}*)(uid=${pattern})))`;
        } else if (searchArea === "groupdn") {
          filter = pattern === "" ? "(|(objectClass=groupofuniquenames)(objectClass=groupofnames))" : `(&(|(objectClass=groupofuniquenames)(objectClass=groupofnames))(cn=*${pattern}*))`;
        } else if (searchArea === "roledn") {
          filter = pattern === "" ? "(&(objectClass=ldapsubentry)(objectClass=nsRoleDefinition))" : `(&(objectClass=ldapsubentry)(objectClass=nsRoleDefinition)(cn=*${pattern}*))`;
        }
        const params = {
          serverId: this.props.editorLdapServer,
          searchBase: baseDn,
          searchFilter: filter,
          searchScope: "sub",
          sizeLimit: 2e3,
          timeLimit: 5,
          addNotification: this.props.addNotification
        };
        getSearchEntries(params, (resultArray) => {
          const results = resultArray.map((result) => {
            const info2 = JSON.parse(result);
            return info2.dn;
          });
          results.sort();
          const newOptionsArray = results.map((entryDN) => {
            const rdnInfo = getRdnInfo(entryDN);
            return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { title: entryDN, children: rdnInfo.rdnVal }, entryDN);
          });
          this.setState({
            usersAvailableOptions: newOptionsArray,
            isSearchRunning: false
          });
        });
      };
      this.handleRightsOnSelect = (event, isSelected, rowId) => {
        let rows;
        if (rowId === -1) {
          rows = this.state.rightsRows.map((oneRow) => ({
            ...oneRow,
            selected: isSelected
          }));
        } else {
          rows = [...this.state.rightsRows];
          rows[rowId] = {
            ...rows[rowId],
            selected: isSelected
          };
        }
        this.setState({
          rightsRows: rows
        });
      };
      this.handleSearchPattern = (searchPattern) => {
        this.setState({ searchPattern });
      };
      this.removeDuplicates = (options5) => {
        const titles = options5.map((item) => item.props.title);
        const noDuplicates = options5.filter((item, index) => {
          return titles.indexOf(item.props.title) === index;
        });
        return noDuplicates;
      };
      this.handleUsersOnListChange = (_event, newAvailableOptions, newChosenOptions) => {
        const newAvailNoDups = this.removeDuplicates(newAvailableOptions);
        const newChosenNoDups = this.removeDuplicates(newChosenOptions);
        this.setState({
          usersAvailableOptions: newAvailNoDups.sort(),
          usersChosenOptions: newChosenNoDups.sort()
        });
      };
      this.onBaseDnSelection = (treeViewItem) => {
        this.setState({
          usersSearchBaseDn: treeViewItem.dn
        }, () => {
          if (!treeViewItem.children || treeViewItem.children.length === 0) {
            this.handleUsersDrawerCloseClick();
          }
        });
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReachedVisual: this.state.stepIdReachedVisual < id ? id : this.state.stepIdReachedVisual,
          savedStepId: id
        }, this.handleBuildAciText());
        if (id === 2) {
          if (this.state.targetAttrRows.length > 0) {
            return;
          }
          getAttributesNameAndOid(this.props.editorLdapServer, (resArray) => {
            const targetAttrRows = resArray.map((item) => {
              return { cells: [item[0], item[1]], selected: false };
            });
            const attributeList = resArray.map((item) => {
              return item[0];
            });
            const tableModificationTime = Date.now();
            this.setState({
              attributeList,
              targetAttrRows,
              tableModificationTime
            });
          });
        } else if (id === 9) {
          this.addAciToEntry();
        }
      };
      this.handleBackVisual = ({ id }) => {
        this.setState({ savedStepId: id });
      };
      this.addAciToEntry = () => {
        const params = { serverId: this.props.editorLdapServer };
        const ldifArray = [];
        ldifArray.push(`dn: ${this.props.wizardEntryDn}`);
        ldifArray.push("changetype: modify");
        ldifArray.push("add: aci");
        ldifArray.push(`aci: ${this.state.aciTextNew}`);
        this.setState({
          modalSpinning: true
        });
        modifyLdapEntry(params, ldifArray, (result) => {
          this.props.refreshAciTable();
          this.setState({
            commandOutput: result.errorCode === 0 ? _93("Successfully added ACI!") : _93("Failed to add ACI: ") + result.output,
            resultVariant: result.errorCode === 0 ? "success" : "danger",
            adding: false
          }, () => {
            this.props.onReload();
          });
          const opInfo = {
            // This is what refreshes treeView
            operationType: "MODIFY",
            resultCode: result.errorCode,
            time: Date.now()
          };
          this.props.setWizardOperationInfo(opInfo);
        });
      };
      this.handleResetACIText = () => {
        const orig = this.state.aciText;
        this.setState({
          aciTextNew: orig
        });
      };
      this.handleChange = (e) => {
        const target = e.target;
        const value = target.type === "checkbox" ? target.checked : target.value;
        const attr = target.id;
        this.setState({
          [attr]: value
        });
      };
      this.handleTextChange = (_event, value) => {
        this.setState({
          aciTextNew: value
        });
      };
    }
    render() {
      const {
        aciText,
        aciTextNew,
        bindRuleRows,
        bindRuleType,
        dns,
        ip,
        isSearchRunning,
        isUsersDrawerExpanded,
        newAciName,
        rightsRows,
        savedStepId,
        searchPattern,
        stepIdReachedVisual,
        tableModificationTime,
        target,
        target_from,
        target_to,
        targetAttrRows,
        targetFilter,
        userattrAttr,
        usersAvailableOptions,
        usersChosenOptions,
        usersSearchBaseDn
      } = this.state;
      const aciNameComponent = /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Text, { component: TextVariants.h3, children: _93("Choose a name for this ACI, and set the Target") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Grid, { className: "ds-margin-top-xlg", hasGutter: true, children: [
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 1, className: "ds-label", children: _93("Name") }),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            TextInput,
            {
              validated: newAciName === "" ? ValidatedOptions.error : ValidatedOptions.default,
              id: "newAciName",
              value: newAciName,
              type: "text",
              onChange: (e, str) => {
                this.handleChange(e);
              },
              "aria-label": "Text input ACI name",
              autoComplete: "off"
            }
          ) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Grid, { className: "ds-margin-top-xlg", hasGutter: true, children: [
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 1, className: "ds-label", children: _93("Target") }),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            TextInput,
            {
              validated: target === "" ? ValidatedOptions.error : ValidatedOptions.default,
              id: "target",
              value: target,
              type: "text",
              onChange: (e, str) => {
                this.handleChange(e);
              },
              "aria-label": "Text input ACI target",
              autoComplete: "off"
            }
          ) })
        ] })
      ] });
      const usersPanelContent = /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(DrawerPanelContent, { isResizable: true, children: [
        /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(DrawerHead, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { tabIndex: isUsersDrawerExpanded ? 0 : -1, ref: this.usersDrawerRef, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("strong", { children: _93("LDAP Tree") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(DrawerActions, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(DrawerCloseButton, { onClick: this.handleUsersDrawerCloseClick }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Card, { isSelectable: true, className: "ds-indent ds-margin-bottom-md", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
          ldapNavigator_default,
          {
            treeItems: [...this.props.treeViewRootSuffixes],
            editorLdapServer: this.props.editorLdapServer,
            skipLeafEntries: true,
            handleNodeOnClick: this.onBaseDnSelection,
            showTreeLoadingState: this.showTreeLoadingState,
            addNotification: this.props.addNotification
          }
        ) }) })
      ] });
      const userDrawerContent = /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Divider, {}),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "ds-margin-bottom-md" }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
          DualListSelector,
          {
            availableOptions: usersAvailableOptions,
            chosenOptions: usersChosenOptions,
            availableOptionsTitle: _93("Available Entries"),
            chosenOptionsTitle: _93("Chosen Entries"),
            onListChange: (event, newAvailableOptions, newChosenOptions) => this.handleUsersOnListChange(event, newAvailableOptions, newChosenOptions),
            id: "usersSelector",
            className: "ds-aci-dual-select"
          }
        )
      ] });
      const usersComponent = /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
        isSearchRunning && /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("center", { className: "ds-font-size-md", children: [
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Spinner, { size: "sm" }),
          "\xA0\xA0",
          _93("Searching database ...")
        ] }),
        !isSearchRunning && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
          SearchInput,
          {
            placeholder: _93("Search for entries ..."),
            value: searchPattern,
            onChange: (evt, val) => this.handleSearchPattern(val),
            onClear: () => this.handleSearchPattern(""),
            onSearch: this.handleSearchClick,
            className: "ds-search-input"
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "ds-margin-bottom-md" }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Text, { children: [
          _93("Search Base:"),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            Text,
            {
              className: "ds-left-margin",
              component: TextVariants.a,
              onClick: this.handleUsersDrawerClick,
              href: "#",
              children: usersSearchBaseDn
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Drawer, { className: "ds-margin-top", isExpanded: isUsersDrawerExpanded, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(DrawerContent, { panelContent: usersPanelContent, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(DrawerContentBody, { children: userDrawerContent }) }) })
      ] });
      const bindRulesComponent = /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Text, { component: TextVariants.h3, children: [
          _93("Define the Bind Rules"),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            Tooltip,
            {
              position: "bottom",
              content: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { children: _93("The bind rules in an ACI define the required bind parameters that must meet so that Directory Server applies the ACI. For example user-based access uses the 'userdn' bind rule, while group access uses 'groupdn' bind rule.  There are other combinations that are possible, as well as defining the authentication method allowed or the connection security level. Please see the Administration Guide for more information.") }),
              children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("a", { className: "ds-font-size-md", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_info_circle_icon4.InfoCircleIcon, { className: "ds-info-icon" }) })
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
          aciBindRuleTable_default,
          {
            rows: this.state.bindRuleRows,
            removeRow: this.removeBindRuleRow
          },
          this.state.bindRuleRows
        ),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
          Button,
          {
            className: "ds-margin-top-lg",
            variant: "primary",
            onClick: this.handleOpenAddBindRule,
            size: "sm",
            children: _93("Add Bind Rule")
          }
        )
      ] });
      const rightsComponent = /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Text, { component: TextVariants.h3, children: [
          _93("Choose the Rights to Allow or Deny"),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            Tooltip,
            {
              position: "bottom",
              content: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { children: _93("This section defines what permissions and rights are allowed/denied by this ACI.") }),
              children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("a", { className: "ds-font-size-md", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_info_circle_icon4.InfoCircleIcon, { className: "ds-info-icon" }) })
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
          dsBasicComponents_default,
          {
            className: "ds-margin-top-lg",
            ariaLabel: "Select rights",
            onToggle: (event, isOpen) => this.handleToggleRights(event, isOpen),
            onSelect: this.handleSelectRights,
            selected: this.state.rightType,
            isOpen: this.state.isOpenRights,
            options: ["allow", "deny"]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
          Table,
          {
            "aria-label": "Selectable Table User Rights",
            variant: "compact",
            borders: false,
            className: "ds-margin-top-lg",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Tr, { children: this.rightsColumns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Th, { children: column.title }, columnIndex)) }) }),
              /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Tbody, { children: rightsRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Tr, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Td, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
                  Checkbox,
                  {
                    id: `rights-checkbox-${rowIndex}`,
                    isChecked: row.selected,
                    onChange: (checked) => this.handleRightsOnSelect(null, checked, rowIndex),
                    "aria-label": `Select ${row.cells[0]}`,
                    label: row.cells[0]
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Td, { children: row.cells[1] })
              ] }, rowIndex)) })
            ]
          }
        )
      ] });
      const targetAttrComponent = /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Text, { component: TextVariants.h3, children: [
          _93("Choose the Target Attributes"),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            Tooltip,
            {
              position: "bottom",
              content: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { children: _93("You can control what entry attributes are affected by an ACI. If no target attributes are defined then all attributes are impacted by the ACI.  It is strongly discouraged to use the comparison operator '!=' when defining target attributes because it implicitly allows access all the other attributes in the entry (including operational attributes).  This is a potential unintended security risk. Instead, just use '=' to only open up the attributes you want the ACI to allow.") }),
              children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("a", { className: "ds-font-size-md", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_info_circle_icon4.InfoCircleIcon, { className: "ds-info-icon" }) })
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "ds-margin-top-xlg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "ds-inline ds-font-size-md", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("b", { children: _93("Comparison Operator") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "ds-inline ds-left-margin ds-raise-field-md", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            dsBasicComponents_default,
            {
              ariaLabel: "Select auth compare operator",
              onToggle: (event, isOpen) => this.handleToggleTargetAttrOp(event, isOpen),
              onSelect: this.handleSelectTargetAttrOp,
              selected: this.state.targetAttrCompOp,
              isOpen: this.state.isOpenTargetAttrOperator,
              options: ["=", "!="]
            }
          ) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
          genericPagination_default,
          {
            columns: this.targetsColumns,
            rows: targetAttrRows,
            actions: null,
            isSelectable: true,
            canSelectAll: false,
            enableSorting: true,
            tableModificationTime,
            handleSelectedAttrs: this.onSelectedAttrs,
            isSearchable: true
          }
        ),
        targetAttrRows.length === 0 && // <div className="ds-margin-bottom-md" />
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Bullseye, { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("center", { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Spinner, { size: "lg" }) }) })
      ] });
      const targetFilterComponent = /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Text, { component: TextVariants.h3, children: [
          _93("Target Filter"),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            Tooltip,
            {
              position: "bottom",
              content: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { children: _93("Optionally set an LDAP search filter to further refine which entries this ACI will be applied to. Warning, using targetFilters can impact the server's performance and should be used sparingly.") }),
              children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("a", { className: "ds-font-size-md", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_info_circle_icon4.InfoCircleIcon, { className: "ds-info-icon" }) })
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Form, { className: "ds-margin-top-xlg", autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 2, className: "ds-label", children: _93("Target Filter") }),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(GridItem, { span: 10, children: [
            /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
              TextInput,
              {
                id: "targetFilter",
                "aria-label": "Add target filter",
                onChange: (e, str) => {
                  this.handleChange(e);
                },
                value: targetFilter,
                validated: targetFilter !== "" && !valid_filter(targetFilter) ? ValidatedOptions.error : ValidatedOptions.default
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormHelperText, { children: _93("The filter must be enclosed with parentheses") })
          ] })
        ] }) })
      ] });
      const moddnComponent = /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Text, { component: TextVariants.h3, children: [
          _93("Moving Entries"),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            Tooltip,
            {
              position: "bottom",
              content: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { children: _93("If you need to control access for moving an entry between specific subtrees then use the target_from and target_to keywords. These keywords use LDAP URL's to specify the database resources/locations: ldap:///uid=*,cn=staging,dc=example,dc=com, ldap:///ou=people,dc=example,dc=com") }),
              children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("a", { className: "ds-font-size-md", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_info_circle_icon4.InfoCircleIcon, { className: "ds-info-icon" }) })
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Form, { className: "ds-margin-top-xlg", autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 2, className: "ds-label", title: _93("Specifies the entries that can be moved.  Example: ldap:///uid=*,cn=staging,dc=example,dc=com"), children: _93("Target From") }),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(GridItem, { span: 10, children: [
            /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
              TextInput,
              {
                id: "target_from",
                "aria-label": "Add target_from",
                onChange: (e, str) => {
                  this.handleChange(e);
                },
                value: target_from,
                validated: target_from !== "" && !isValidLDAPUrl(target_from) ? ValidatedOptions.error : ValidatedOptions.default
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormHelperText, { children: _93("The LDAP URL must start with 'ldap:///'") })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 2, className: "ds-label", title: _93("Specifies where the entries can be moved to.  Example: ldap:///ou=people,dc=example,dc=com"), children: "Target To" }),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(GridItem, { span: 10, children: [
            /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
              TextInput,
              {
                id: "target_to",
                "aria-label": "Add target_to",
                onChange: (e, str) => {
                  this.handleChange(e);
                },
                value: target_to,
                validated: target_to !== "" && !isValidLDAPUrl(target_to) ? ValidatedOptions.error : ValidatedOptions.default
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormHelperText, { children: _93('The LDAP URL must start with "ldap:///"') })
          ] })
        ] }) })
      ] });
      const timesComponent = /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Text, { component: TextVariants.h3, children: [
          _93("Define Day and Time Restrictions"),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            Tooltip,
            {
              position: "bottom",
              content: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { children: _93("These bind rules control access based off of specific days or times. If no days are selected then all the days of the week are assumed.") }),
              children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("a", { className: "ds-font-size-md", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_info_circle_icon4.InfoCircleIcon, { className: "ds-info-icon" }) })
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TextContent, { className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Text, { component: TextVariants.h4, children: _93("Choose Days To Allow Access") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "ds-margin-top ds-margin-left", children: [
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            Checkbox,
            {
              className: "",
              label: _93("Sunday"),
              isChecked: this.state.sunday,
              onChange: (e, checked) => this.handleChange(e),
              "aria-label": "Sunday",
              id: "sunday"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            Checkbox,
            {
              className: "",
              label: _93("Monday"),
              isChecked: this.state.monday,
              onChange: (e, checked) => this.handleChange(e),
              "aria-label": "monday",
              id: "monday"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            Checkbox,
            {
              className: "",
              label: _93("Tuesday"),
              isChecked: this.state.tuesday,
              onChange: (e, checked) => this.handleChange(e),
              "aria-label": "Tuesday",
              id: "tuesday"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            Checkbox,
            {
              className: "",
              label: _93("Wednesday"),
              isChecked: this.state.wednesday,
              onChange: (e, checked) => this.handleChange(e),
              "aria-label": "wednesday",
              id: "wednesday"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            Checkbox,
            {
              className: "",
              label: _93("Thursday"),
              isChecked: this.state.thursday,
              onChange: (e, checked) => this.handleChange(e),
              "aria-label": "thursday",
              id: "thursday"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            Checkbox,
            {
              className: "",
              label: _93("Friday"),
              isChecked: this.state.friday,
              onChange: (e, checked) => this.handleChange(e),
              "aria-label": "friday",
              id: "friday"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            Checkbox,
            {
              className: "",
              label: _93("Saturday"),
              isChecked: this.state.saturday,
              onChange: (e, checked) => this.handleChange(e),
              "aria-label": "saturday",
              id: "saturday"
            }
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TextContent, { className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Text, { component: TextVariants.h4, children: _93("Time Range Restrictions") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Grid, { className: "ds-margin-top-lg ds-margin-left", children: [
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 2, className: "ds-label", title: _93("First part of the time range"), children: _93("Time Start") }),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
            FormSelect,
            {
              id: "timeStartCompOp",
              value: this.state.timeStartCompOp,
              onChange: (e, str) => {
                this.handleChange(e);
              },
              "aria-label": "FormSelect Input",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "=", value: "=" }, "="),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "!=", value: "!=" }, "!="),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: ">", value: ">" }, ">"),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "<", value: "<" }, "<"),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: ">=", value: ">=" }, ">="),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "<=", value: "<=" }, "<=")
              ]
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            TimePicker,
            {
              className: "ds-left-margin",
              time: this.state.timeOfDayStart,
              is24Hour: true,
              onChange: (_event, time2, hour, min3, seconds2, isValid) => this.handleTimeChange(time2, "timeOfDayStart")
            }
          ) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Grid, { className: "ds-margin-top ds-margin-left", children: [
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 2, className: "ds-label", title: _93("Second part of the time range"), children: _93("Time End") }),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
            FormSelect,
            {
              id: "timeEndCompOp",
              value: this.state.timeEndCompOp,
              onChange: (e, str) => {
                this.handleChange(e);
              },
              "aria-label": "FormSelect Input",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "=", value: "=" }, "="),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "!=", value: "!=" }, "!="),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: ">", value: ">" }, ">"),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "<", value: "<" }, "<"),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: ">=", value: ">=" }, ">="),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "<=", value: "<=" }, "<=")
              ]
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            TimePicker,
            {
              className: "ds-left-margin",
              time: this.state.timeOfDayEnd,
              is24Hour: true,
              onChange: (_event, time2, hour, min3, seconds2, isValid) => this.handleTimeChange(time2, "timeOfDayEnd")
            }
          ) })
        ] })
      ] });
      const reviewComponent = /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Text, { component: TextVariants.h3, children: [
          "Review & Edit",
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            Tooltip,
            {
              position: "bottom",
              content: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { children: _93("Review the new ACI, and make any edits as needed, but once you edit the ACI you can not go back to the previous wizard steps without undoing your changes.") }),
              children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("a", { className: "ds-font-size-md", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_info_circle_icon4.InfoCircleIcon, { className: "ds-info-icon" }) })
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Card, { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(CardBody, { className: "ds-indent", children: [
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            TextArea,
            {
              className: "ds-textarea",
              id: "aciTextNew",
              value: aciTextNew,
              onChange: (event, str) => this.handleTextChange(event, str),
              "aria-label": "aci text edit area",
              autoResize: true,
              resizeOrientation: "vertical"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
            Button,
            {
              className: "ds-margin-top",
              variant: "primary",
              onClick: this.handleResetACIText,
              isDisabled: aciText === aciTextNew,
              size: "sm",
              children: _93("Undo Changes")
            },
            "undo"
          )
        ] }) })
      ] });
      const resultComponent = /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "ds-addons-bottom-margin", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
          Alert,
          {
            variant: this.state.resultVariant,
            isInline: true,
            title: _93("Result for ACI addition"),
            children: [
              this.state.resultVariant === "success" ? _93("Successfully added ACI") : this.state.commandOutput,
              this.state.adding && /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { children: [
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Spinner, { className: "ds-left-margin", size: "md" }),
                "\xA0\xA0",
                _93("Adding ACI ...")
              ] })
            ]
          }
        ) }),
        this.state.resultVariant === "danger" && /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Card, { isSelectable: true, children: [
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(CardTitle, { children: '_("ACI Value")' }),
          /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(CardBody, { children: aciTextNew })
        ] })
      ] });
      const newAciStepsVisual = [
        {
          id: 1,
          name: _93("ACI Name & Target"),
          component: aciNameComponent,
          canJumpTo: stepIdReachedVisual >= 1 && aciText === aciTextNew,
          enableNext: newAciName !== "" && target !== ""
        },
        {
          id: 2,
          name: _93("Target Attributes"),
          component: targetAttrComponent,
          canJumpTo: stepIdReachedVisual >= 2 && aciText === aciTextNew
        },
        {
          id: 3,
          name: _93("Target Filter"),
          component: targetFilterComponent,
          canJumpTo: stepIdReachedVisual >= 3 && aciText === aciTextNew,
          enableNext: targetFilter === "" || targetFilter !== "" && valid_filter(targetFilter)
        },
        {
          id: 4,
          name: _93("Moving Entries"),
          component: moddnComponent,
          canJumpTo: stepIdReachedVisual >= 4 && aciText === aciTextNew,
          enableNext: (target_from === "" || (target_from === "" || target_from !== "" && isValidLDAPUrl(target_from))) && (target_to === "" || (target_to === "" || target_to !== "" && isValidLDAPUrl(target_to))) && (target_to === "" && target_from === "" || target_to !== "" && target_from !== "")
        },
        {
          id: 5,
          name: _93("Access Rights"),
          component: rightsComponent,
          canJumpTo: stepIdReachedVisual >= 5 && aciText === aciTextNew,
          enableNext: rightsRows.filter((item) => item.selected).map((cells) => cells.cells[0]).toString() !== ""
        },
        {
          id: 6,
          name: _93("Bind Rules"),
          component: bindRulesComponent,
          canJumpTo: stepIdReachedVisual >= 6 && aciText === aciTextNew,
          enableNext: bindRuleRows.length > 0
        },
        {
          id: 7,
          name: _93("Days & Times"),
          component: timesComponent,
          canJumpTo: stepIdReachedVisual >= 7 && aciText === aciTextNew
        },
        {
          id: 8,
          name: _93("Review & Edit"),
          component: reviewComponent,
          nextButtonText: _93("Add ACI"),
          canJumpTo: stepIdReachedVisual >= 8,
          hideBackButton: this.state.aciText !== this.state.aciTextNew
        },
        {
          id: 9,
          name: _93("Result"),
          component: resultComponent,
          nextButtonText: _93("Finish"),
          canJumpTo: stepIdReachedVisual >= 9,
          hideBackButton: this.state.resultVariant === "success" ? true : false,
          enableNext: !this.state.adding
        }
      ];
      const title = /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
        _93("ACI: "),
        "\xA0\xA0",
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("strong", { children: this.state.aciText })
      ] });
      return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
          Wizard,
          {
            isOpen: this.props.isWizardOpen,
            onClose: this.props.handleToggleWizard,
            onNext: this.handleNext,
            onBack: this.handleBackVisual,
            onGoToStep: this.handleBuildAciText,
            startAtStep: savedStepId,
            title: _93("Add a new Access Control Instruction"),
            description: this.state.savedStepId < 2 ? "" : title,
            steps: newAciStepsVisual
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: _93("Add Bind Rule"),
            isOpen: this.state.showAddBindRuleModal,
            onClose: this.handleCloseAddBindRuleModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleAddBindRule,
                  isDisabled: bindRuleType.endsWith("dn") && usersChosenOptions.length === 0 || bindRuleType === "dns" && !isValidHostname(dns) || bindRuleType === "ip" && !isValidIpAddress(ip) || bindRuleType === "userattr" && userattrAttr === "",
                  children: _93("Add Bind Rule")
                },
                "add"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
                Button,
                {
                  variant: "link",
                  onClick: this.handleCloseAddBindRuleModal,
                  children: _93("Cancel")
                },
                "cancel"
              )
            ],
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 3, className: "ds-label", children: _93("Choose Bind Rule") }),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(FormSelect, { id: "bindRuleType", value: bindRuleType, onChange: (e, str) => {
                  this.handleChange(e);
                }, "aria-label": "FormSelect Input", children: [
                  this.state.specialSelection === "" && !this.state.haveUserAttrRules && /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
                    /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: _93("User DN (userdn)"), value: "userdn", title: _93("Bind rules for user entries") }, "userdn"),
                    /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: _93("Group DN (groupdn)"), value: "groupdn", title: _93("Bind rules for groups") }, "groupdn"),
                    /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: _93("Role DN (roledn)"), value: "roledn", title: _93("Bind rules for Roles") }, "roledn")
                  ] }),
                  !this.state.haveUserRules && !this.state.haveUserAttrRules && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: _93("User DN Aliases (userdn)"), value: "User DN Aliases", title: _93("Special bind rules for user DN categories") }, "special"),
                  !this.state.haveUserRules && !this.state.haveUserAttrRules && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: _93("User Attribute (userattr)"), value: "userattr", title: _93("Bind rule to specify which attribute must match between the entry used to bind to the directory and the targeted entry") }, "userattr"),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: _93("Authentication Method (authmethod)"), value: "authmethod", title: _93("Specify the authentication methods to restrict") }, "authmethod"),
                  this.state.ssf === "" && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: _93("Connection Security (ssf)"), value: "ssf", title: _93("Specify the connection security strength factor (ssf)") }, "ssf"),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: _93("IP Address (ip)"), value: "ip", title: _93("Specify an IP address or range to restrict") }, "ip"),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: _93("Hostname (dns)"), value: "dns", title: _93("Specify a hostname or domain to restrict") }, "hostname")
                ] }) })
              ] }),
              bindRuleType === "User DN Aliases" && /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 3, className: "ds-label", children: _93("Select Alias URL") }),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(FormSelect, { id: "specialSelection", value: this.state.specialSelection, onChange: (e, str) => {
                  this.handleChange(e);
                }, "aria-label": "FormSelect Input", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: _93("ldap:///anyone"), value: "ldap:///anyone", title: _93("Grants Anonymous Access") }, "anyone"),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: _93("ldap:///all"), value: "ldap:///all", title: _93("Grants Access to Authenticated Users") }, "all"),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: _93("ldap:///self"), value: "ldap:///self", title: _93("Enables Users to Access Their Own Entries") }, "self"),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: _93("ldap:///parent"), value: "ldap:///parent", title: _93("Grants Access for Child Entries of a User") }, "parent")
                ] }) })
              ] }),
              bindRuleType.endsWith("dn") && /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Grid, { className: "ds-margin-top", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 3, className: "ds-label", children: _93("Choose Comparator") }),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(FormSelect, { id: "bindRuleOperator", value: bindRuleType, onChange: (e, str) => {
                    this.handleChange(e);
                  }, "aria-label": "FormSelect Input", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "=", value: "=" }, "="),
                    /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "!=", value: "!=" }, "!=")
                  ] }) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Card, { isSelectable: true, className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(CardBody, { children: usersComponent }) })
              ] }),
              bindRuleType === "ip" && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_jsx_runtime93.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 3, className: "ds-label", children: _93("IP Address") }),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(FormSelect, { id: "ipOperator", value: this.state.ipOperator, onChange: (e, str) => {
                  this.handleChange(e);
                }, "aria-label": "FormSelect Input", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "=", value: "=" }, "="),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "!=", value: "!=" }, "!=")
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(GridItem, { span: 7, className: "ds-left-margin", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
                    TextInput,
                    {
                      id: "ip",
                      "aria-label": "Add IP restriction",
                      onChange: (e, str) => {
                        this.handleChange(e);
                      },
                      value: ip,
                      autoComplete: "off",
                      validated: ip === "" || ip !== "" && !isValidIpAddress(ip) ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ),
                  (ip === "" || !isValidIpAddress(ip)) && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(HelperText, { className: "ds-left-margin", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(HelperTextItem, { variant: "error", children: _93("Invalid format for IP address") }) })
                ] })
              ] }) }),
              bindRuleType === "dns" && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_jsx_runtime93.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 3, className: "ds-label", children: _93("Hostname") }),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(FormSelect, { id: "dnsOperator", value: this.state.dnsOperator, onChange: (e, str) => {
                  this.handleChange(e);
                }, "aria-label": "FormSelect Input", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "=", value: "=" }, "="),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "!=", value: "!=" }, "!=")
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(GridItem, { span: 7, className: "ds-left-margin", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
                    TextInput,
                    {
                      id: "dns",
                      "aria-label": "Add Hostname restriction",
                      onChange: (e, str) => {
                        this.handleChange(e);
                      },
                      value: dns,
                      validated: dns === "" || dns !== "" && !isValidHostname(dns) ? ValidatedOptions.error : ValidatedOptions.default,
                      autoComplete: "off"
                    }
                  ),
                  (dns === "" || !isValidHostname(dns)) && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(HelperText, { className: "ds-left-margin", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(HelperTextItem, { variant: "error", children: _93("Invalid format for hostname") }) })
                ] })
              ] }) }),
              bindRuleType === "authmethod" && /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 3, className: "ds-label", children: _93("Authentication Method") }),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
                  FormSelect,
                  {
                    id: "authMethodOperator",
                    value: this.state.authMethodOperator,
                    onChange: (e, str) => {
                      this.handleChange(e);
                    },
                    "aria-label": "FormSelect Input",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "=", value: "=" }, "="),
                      /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "!=", value: "!=" }, "!=")
                    ]
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 7, className: "ds-left-margin", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(FormSelect, { id: "authmethod", value: this.state.authmethod, onChange: (e, str) => {
                  this.handleChange(e);
                }, "aria-label": "FormSelect Input", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { value: "none", label: "none" }, "none"),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { value: "simple", label: "simple" }, "simple"),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { value: "SSL", label: "SSL" }, "SSL"),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { value: "SASL", label: "SASL" }, "SASL"),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { value: "LDAPI", label: "LDAPI" }, "LDAPI")
                ] }) })
              ] }),
              bindRuleType === "ssf" && /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 3, className: "ds-label", title: _93("Security Strength Factor (ssf) - encryption key strength"), children: _93("Connection Security") }),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
                  FormSelect,
                  {
                    id: "ssfOperator",
                    value: this.state.ssfOperator,
                    onChange: (e, str) => {
                      this.handleChange(e);
                    },
                    "aria-label": "FormSelect Input",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "=", value: "=" }, "="),
                      /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "!=", value: "!=" }, "!="),
                      /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: ">", value: ">" }, ">"),
                      /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "<", value: "<" }, "<"),
                      /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: ">=", value: ">=" }, ">="),
                      /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "<=", value: "<=" }, "<=")
                    ]
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 7, className: "ds-left-margin", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
                  FormSelect,
                  {
                    id: "ssf",
                    value: this.state.ssf,
                    onChange: (e, str) => {
                      this.handleChange(e);
                    },
                    "aria-label": "FormSelect Input",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "0", value: "0", title: _93("No connection security restrictions") }, "0"),
                      /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "128", value: "128" }, "128"),
                      /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "192", value: "192" }, "192"),
                      /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "256", value: "256" }, "256")
                    ]
                  }
                ) })
              ] }),
              bindRuleType === "userattr" && /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Grid, { className: "ds-margin-top", children: [
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 3, className: "ds-label", children: _93("User Attribute") }),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
                  FormSelect,
                  {
                    id: "userattrOperator",
                    value: this.state.userattrOperator,
                    onChange: (e, str) => {
                      this.handleChange(e);
                    },
                    "aria-label": "FormSelect Input",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "=", value: "=" }, "="),
                      /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { label: "!=", value: "!=" }, "!=")
                    ]
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 5, className: "ds-left-margin", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(FormSelect, { id: "userattrAttr", value: this.state.userattrAttr, onChange: (e, str) => {
                  this.handleChange(e);
                }, "aria-label": "FormSelect Input", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { value: "", label: _93("Select an attribute"), isPlaceholder: true }),
                  this.state.attributeList.map((attr, index) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { value: attr, label: attr }, attr))
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 2, className: "ds-left-margin", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(FormSelect, { id: "userattrBindType", value: this.state.userattrBindType, onChange: (e, str) => {
                  this.handleChange(e);
                }, "aria-label": "FormSelect Input", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { value: "USERDN", label: "USERDN" }, "USERDN"),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { value: "GROUPDN", label: "GROUPDN" }, "GROUPDN"),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { value: "ROLEDN", label: "ROLEDN" }, "ROLEDN"),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { value: "SELFDN", label: "SELFDN" }, "SELFDN"),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FormSelectOption, { value: "LDAPURL", label: "LDAPURL" }, "LDAPURL")
                ] }) }),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(GridItem, { span: 12, className: "ds-margin-top ds-label", title: _93("Extend the application of the ACI several levels below the targeted entry. This is possible by specifying the number of levels below the target that should inherit the ACI."), children: _93("Inheritance Levels") }),
                /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(GridItem, { span: 12, className: "ds-left-indent ds-margin-top", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
                    Checkbox,
                    {
                      className: "",
                      label: "0",
                      isChecked: this.state.userAttrParent0,
                      onChange: (e, checked) => this.handleChange(e),
                      "aria-label": "0",
                      id: "userAttrParent0",
                      title: _93("Default value, this userattr bind rule only applies to the target entry (no child entries).")
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
                    Checkbox,
                    {
                      className: "",
                      label: "1",
                      isChecked: this.state.userAttrParent1,
                      onChange: (e, checked) => this.handleChange(e),
                      "aria-label": "1",
                      id: "userAttrParent1"
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
                    Checkbox,
                    {
                      className: "",
                      label: "2",
                      isChecked: this.state.userAttrParent2,
                      onChange: (e, checked) => this.handleChange(e),
                      "aria-label": "2",
                      id: "userAttrParent2"
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
                    Checkbox,
                    {
                      className: "",
                      label: "3",
                      isChecked: this.state.userAttrParent3,
                      onChange: (e, checked) => this.handleChange(e),
                      "aria-label": "3",
                      id: "userAttrParent3"
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
                    Checkbox,
                    {
                      className: "",
                      label: "4",
                      isChecked: this.state.userAttrParent4,
                      onChange: (e, checked) => this.handleChange(e),
                      "aria-label": "4",
                      id: "userAttrParent4"
                    }
                  )
                ] })
              ] })
            ]
          }
        )
      ] });
    }
  };
  var aciNew_default = AddNewAci;

  // src/lib/ldap_editor/wizards/aci.jsx
  var import_jsx_runtime94 = __toESM(require_jsx_runtime(), 1);
  var _94 = cockpit_default.gettext;
  var AciWizard = class extends import_react164.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "buildAciTable", (firstLoad) => {
        const params = {
          serverId: this.props.editorLdapServer,
          baseDn: this.props.wizardEntryDn
        };
        retrieveAllAcis(params, (resultArray) => {
          const rows = [];
          const columns = [...this.state.columns];
          const actions = this.state.actions;
          let count = 0;
          if (resultArray.length !== 0) {
            const myAciArray = [...resultArray[0].aciArray];
            for (const anAci of myAciArray) {
              const aciName = getAciActualName(anAci);
              const aciAllow = isAciPermissionAllow(anAci);
              rows.push({
                isOpen: false,
                cells: [aciName, aciAllow ? "allow" : "deny"],
                fullAci: anAci
              });
              rows.push({
                parent: count,
                fullWidth: true,
                cells: [anAci]
              });
              count += 2;
            }
          }
          this.setState({
            rows,
            columns,
            actions
          }, () => {
            if (!firstLoad) {
              this.props.onReload();
            }
          });
        });
      });
      __publicField(this, "handleToggleWizard", () => {
        this.setState({
          isWizardOpen: !this.state.isWizardOpen
        });
      });
      __publicField(this, "onToggleWizard", () => {
        this.setState({
          isWizardOpen: !this.state.isWizardOpen
        });
      });
      __publicField(this, "handleToggleManual", () => {
        this.setState({
          isManualOpen: !this.state.isManualOpen,
          aciTextNew: "",
          modalSpinning: false
        });
      });
      __publicField(this, "getActionsForRow", (rowData) => {
        if (rowData.cells.length === 1 && rowData.cells[0] === _94("No ACI's")) {
          return [];
        }
        if (!rowData.cells || rowData.parent !== void 0) {
          return [];
        }
        return [
          {
            title: _94("Edit ACI"),
            onClick: () => this.showEditAci(rowData)
          },
          {
            isSeparator: true
          },
          {
            title: _94("Remove ACI"),
            onClick: () => this.showDeleteConfirm(rowData)
          }
        ];
      });
      this.state = {
        firstLoad: true,
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _94("ACI Name"), transforms: [sortable], cellFormatters: [expandable] },
          { title: _94("ACI Rule Type"), transforms: [sortable] }
        ],
        actions: [
          {
            title: _94("Edit ACI"),
            onClick: (event, rowId, rowData, extra) => this.showEditAci(rowData)
          },
          {
            isSeparator: true
          },
          {
            title: _94("Remove ACI"),
            onClick: (event, rowId, rowData, extra) => this.showDeleteConfirm(rowData)
          }
        ],
        isWizardOpen: false,
        isManualOpen: false,
        showModal: true,
        showConfirmDelete: false,
        modalSpinning: false,
        modalChecked: false,
        showEditAci: false,
        attrName: "",
        aciText: "",
        aciTextNew: ""
      };
      this.onToggle = (isOpen) => {
        this.setState({
          isOpen
        });
      };
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1
        });
      };
      this.handleCloseModal = () => {
        this.setState({
          showModal: false
        });
      };
      this.onChange = (e) => {
        const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
        this.setState({
          [e.target.id]: value
        });
      };
      this.showDeleteConfirm = (rowData) => {
        this.setState({
          aciText: rowData.fullAci,
          aciName: rowData.cells[0],
          showDeleteConfirm: true,
          modalChecked: false,
          modalSpinning: false
        });
      };
      this.closeDeleteConfirm = (rowData) => {
        this.setState({
          aciText: "",
          showDeleteConfirm: false,
          modalChecked: false,
          modalSpinning: false
        });
      };
      this.showEditAci = (rowData) => {
        this.setState({
          aciText: rowData.fullAci,
          aciTextNew: rowData.fullAci,
          showEditAci: true,
          modalChecked: false,
          modalSpinning: false
        });
      };
      this.handleCloseEditAci = () => {
        this.setState({
          showEditAci: false
        });
      };
      this.handleResetACIText = () => {
        const orig = this.state.aciText;
        this.setState({
          aciTextNew: orig
        });
      };
      this.handleSaveACI = () => {
        const params = { serverId: this.props.editorLdapServer };
        const ldifArray = [];
        ldifArray.push(`dn: ${this.props.wizardEntryDn}`);
        ldifArray.push("changetype: modify");
        ldifArray.push("delete: aci");
        ldifArray.push(`aci: ${this.state.aciText}`);
        ldifArray.push("-");
        ldifArray.push(`add: aci`);
        ldifArray.push(`aci: ${this.state.aciTextNew}`);
        this.setState({
          modalSpinning: true
        });
        modifyLdapEntry(params, ldifArray, (result) => {
          if (result.errorCode === 0) {
            this.props.addNotification(
              "success",
              _94("Successfully replace ACI")
            );
            this.buildAciTable();
          } else {
            this.props.addNotification(
              "error",
              cockpit_default.format(_94("Failed to update ACI: error $0 - $1"), result.errorCode, result.output)
            );
          }
          this.handleCloseEditAci();
          const opInfo = {
            // This is what refreshes treeView
            operationType: "MODIFY",
            resultCode: result.errorCode,
            time: Date.now()
          };
          this.props.setWizardOperationInfo(opInfo);
        });
      };
      this.deleteACI = () => {
        const params = { serverId: this.props.editorLdapServer };
        const ldifArray = [];
        ldifArray.push(`dn: ${this.props.wizardEntryDn}`);
        ldifArray.push("changetype: modify");
        ldifArray.push("delete: aci");
        ldifArray.push(`aci: ${this.state.aciText}`);
        this.setState({
          modalSpinning: true
        });
        modifyLdapEntry(params, ldifArray, (result) => {
          if (result.errorCode === 0) {
            this.props.addNotification(
              "success",
              _94("Successfully removed ACI")
            );
            this.buildAciTable();
          } else {
            this.props.addNotification(
              "error",
              cockpit_default.format(_94("Failed to remove ACI: error $0 - $1"), result.errorCode, result.output)
            );
          }
          this.closeDeleteConfirm();
          const opInfo = {
            // This is what refreshes treeView
            operationType: "MODIFY",
            resultCode: result.errorCode,
            time: Date.now()
          };
          this.props.setWizardOperationInfo(opInfo);
        });
      };
      this.handleAddAciManual = () => {
        const params = { serverId: this.props.editorLdapServer };
        const ldifArray = [];
        ldifArray.push(`dn: ${this.props.wizardEntryDn}`);
        ldifArray.push("changetype: modify");
        ldifArray.push(`add: aci`);
        ldifArray.push(`aci: ${this.state.aciTextNew}`);
        this.setState({
          modalSpinning: true
        });
        modifyLdapEntry(params, ldifArray, (result) => {
          if (result.errorCode === 0) {
            this.props.addNotification(
              "success",
              _94("Successfully added ACI")
            );
            this.buildAciTable();
          } else {
            this.props.addNotification(
              "error",
              cockpit_default.format(_94("Failed to add ACI: error $0 - $1"), result.errorCode, result.output)
            );
          }
          this.handleToggleManual();
          const opInfo = {
            // This is what refreshes the treeView
            operationType: "MODIFY",
            resultCode: result.errorCode,
            time: Date.now()
          };
          this.props.setWizardOperationInfo(opInfo);
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleCollpase = this.handleCollpase.bind(this);
    }
    // End constructor
    componentDidMount() {
      this.buildAciTable(this.state.firstLoad);
      this.setState({
        firstLoad: false
      });
    }
    handleCollpase(event, rowKey, isOpen) {
      const { rows, perPage, page } = this.state;
      const index = perPage * (page - 1) * 2 + rowKey;
      rows[index].isOpen = isOpen;
      this.setState({
        rows
      });
    }
    handleSort(_event, index, direction) {
      const sorted_rows = [];
      const rows = [];
      let count = 0;
      for (const aci of this.state.rows) {
        if (aci.cells[1]) {
          sorted_rows.push({
            name: aci.cells[0],
            type: aci.cells[1],
            fullAci: aci.fullAci
          });
        }
      }
      if (index === 1) {
        sorted_rows.sort((a2, b) => a2.name > b.name ? 1 : -1);
      } else {
        sorted_rows.sort((a2, b) => a2.type > b.type ? 1 : -1);
      }
      if (direction !== SortByDirection.asc) {
        sorted_rows.reverse();
      }
      for (const aci of sorted_rows) {
        rows.push({
          isOpen: false,
          cells: [aci.name, aci.type],
          fullAci: aci.fullAci
        });
        rows.push({
          parent: count,
          fullWidth: true,
          cells: [aci.fullAci]
        });
        count += 2;
      }
      this.setState({
        sortBy: {
          index,
          direction
        },
        rows,
        page: 1
      });
    }
    prepareTableRows(tableRows) {
      const parentRows = [];
      const expandedContentMap = /* @__PURE__ */ new Map();
      for (let i = 0; i < tableRows.length; i += 2) {
        const currentRow = tableRows[i];
        if (currentRow) {
          parentRows.push(currentRow);
          if (tableRows[i + 1]) {
            expandedContentMap.set(i, tableRows[i + 1]);
          }
        }
      }
      return { parentRows, expandedContentMap };
    }
    render() {
      const { columns, rows, perPage, page, sortBy, showModal, actions, modalSpinning } = this.state;
      const origRows = [...rows];
      const startIdx = (perPage * page - perPage) * 2;
      let tableRows = origRows.splice(startIdx, perPage * 2);
      const { parentRows, expandedContentMap } = this.prepareTableRows(tableRows);
      let btnName = _94("Save ACI");
      const extraPrimaryProps = {};
      if (modalSpinning) {
        btnName = _94("Saving ACI ...");
        extraPrimaryProps.spinnerAriaValueText = _94("Loading");
      }
      const title = _94("Manage ACI's For ") + this.props.wizardEntryDn;
      let cols = columns;
      if (rows.length === 0) {
        tableRows = [{ cells: [_94("No ACI's")] }];
        cols = [{ title: _94("Access Control Instructions") }];
      }
      const showActions = rows.length > 0 && !(rows.length === 1 && rows[0].cells.length === 1 && rows[0].cells[0] === _94("No ACI's"));
      const isEmptyTable = !showActions;
      return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_jsx_runtime94.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
          Modal,
          {
            variant: ModalVariant.medium,
            className: "ds-modal-select",
            title,
            isOpen: showModal,
            onClose: this.handleCloseModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleToggleWizard,
                  children: _94("Add ACI Wizard")
                },
                "acc aci"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleToggleManual,
                  children: _94("Add ACI Manually")
                },
                "acc aci manual"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Button, { variant: "link", onClick: this.handleCloseModal, children: _94("Close") }, "cancel")
            ],
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
                Table,
                {
                  "aria-label": "Expandable ACI table",
                  variant: "compact",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(Tr, { children: [
                      !isEmptyTable && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                        Th,
                        {
                          screenReaderText: _94("Expand/Collapse Row")
                        }
                      ),
                      cols.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                        Th,
                        {
                          sort: column.transforms?.includes(sortable) ? {
                            sortBy,
                            onSort: (_evt, index, direction) => this.handleSort(index, direction),
                            columnIndex
                          } : void 0,
                          children: column.title
                        },
                        columnIndex
                      )),
                      showActions && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                        Th,
                        {
                          screenReaderText: _94("Actions")
                        }
                      )
                    ] }) }),
                    /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Tbody, { children: isEmptyTable ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Tr, { children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Td, { children: tableRows[0].cells[0] }) }) : parentRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_react164.default.Fragment, { children: [
                      /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(Tr, { children: [
                        /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                          Td,
                          {
                            expand: {
                              rowIndex,
                              isExpanded: row.isOpen,
                              onToggle: () => this.handleCollpase(null, rowIndex * 2, !row.isOpen)
                            }
                          }
                        ),
                        row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Td, { children: cell }, cellIndex)),
                        /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                          ActionsColumn,
                          {
                            items: this.getActionsForRow(row)
                          }
                        ) })
                      ] }),
                      row.isOpen && expandedContentMap.has(rowIndex * 2) && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Tr, { isExpanded: true, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                        Td,
                        {
                          colSpan: cols.length + 2,
                          noPadding: true,
                          children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(ExpandableRowContent, { children: expandedContentMap.get(rowIndex * 2).cells[0] })
                        }
                      ) })
                    ] }, rowIndex)) })
                  ]
                }
              ),
              !isEmptyTable && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                Pagination,
                {
                  itemCount: rows.length / 2,
                  widgetId: "pagination-options-menu-bottom",
                  perPage,
                  page,
                  variant: "bottom",
                  onSetPage: (_evt, value) => this.handleSetPage(value),
                  onPerPageSelect: (_evt, value) => this.handlePerPageSelect(value)
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "ds-margin-top-xlg" }),
              this.state.isWizardOpen && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                aciNew_default,
                {
                  wizardEntryDn: this.props.wizardEntryDn,
                  editorLdapServer: this.props.editorLdapServer,
                  onReload: this.props.onReload,
                  refreshAciTable: this.buildAciTable,
                  isWizardOpen: this.state.isWizardOpen,
                  handleToggleWizard: this.onToggleWizard,
                  setWizardOperationInfo: this.props.setWizardOperationInfo,
                  treeViewRootSuffixes: this.props.treeViewRootSuffixes,
                  addNotification: this.props.addNotification
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                DoubleConfirmModal,
                {
                  showModal: this.state.showDeleteConfirm,
                  closeHandler: this.closeDeleteConfirm,
                  handleChange: this.onChange,
                  actionHandler: this.deleteACI,
                  spinning: modalSpinning,
                  item: this.state.aciName,
                  checked: this.state.modalChecked,
                  mTitle: _94("Delete ACI"),
                  mMsg: _94("Are you sure you want to delete this ACI?"),
                  mSpinningMsg: _94("Deleting ..."),
                  mBtnName: _94("Delete ACI")
                }
              )
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: _94("Edit ACI"),
            isOpen: this.state.showEditAci,
            onClose: this.handleCloseEditAci,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleSaveACI,
                  isLoading: modalSpinning,
                  spinnerAriaValueText: modalSpinning ? _94("Loading") : void 0,
                  ...extraPrimaryProps,
                  isDisabled: this.state.aciText === this.state.aciTextNew || modalSpinning,
                  children: btnName
                },
                "acc aci"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Button, { variant: "link", onClick: this.handleCloseEditAci, children: _94("Close") }, "cancel")
            ],
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                TextArea,
                {
                  className: "ds-textarea",
                  id: "aciTextNew",
                  value: this.state.aciTextNew,
                  onChange: (e, str) => {
                    this.onChange(e);
                  },
                  "aria-label": "aci text edit area",
                  autoResize: true,
                  resizeOrientation: "vertical"
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                Button,
                {
                  className: "ds-margin-top",
                  variant: "secondary",
                  onClick: this.handleResetACIText,
                  isDisabled: this.state.aciText === this.state.aciTextNew,
                  size: "sm",
                  children: _94("Reset ACI")
                },
                "reset"
              )
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: _94("Add ACI Manually"),
            isOpen: this.state.isManualOpen,
            onClose: this.handleToggleManual,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleAddAciManual,
                  isLoading: modalSpinning,
                  spinnerAriaValueText: modalSpinning ? _94("Loading") : void 0,
                  ...extraPrimaryProps,
                  isDisabled: this.state.aciTextNew === "" || modalSpinning,
                  children: btnName
                },
                "acc aci manual add"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Button, { variant: "link", onClick: this.handleToggleManual, children: _94("Close") }, "cancel")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
              TextArea,
              {
                className: "ds-textarea",
                id: "aciTextNew",
                value: this.state.aciTextNew,
                onChange: (e, str) => {
                  this.onChange(e);
                },
                "aria-label": "aci text edit area",
                autoResize: true,
                resizeOrientation: "vertical",
                placeholder: _94("Enter ACI ...")
              }
            )
          }
        )
      ] });
    }
  };
  var aci_default = AciWizard;

  // src/lib/ldap_editor/wizards/cos.jsx
  var import_react168 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/wizards/operations/addCosDefinition.jsx
  var import_react167 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/wizards/operations/addCosTemplate.jsx
  var import_react166 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/lib/editableTable.jsx
  var import_react165 = __toESM(require_react(), 1);
  var import_prop_types85 = __toESM(require_prop_types(), 1);
  var import_jsx_runtime95 = __toESM(require_jsx_runtime(), 1);
  var _95 = cockpit_default.gettext;
  var buttonGroupStyles = {
    display: "flex",
    gap: "8px",
    alignItems: "center"
  };
  var EditButtonsCell = ({
    onClick,
    elementToFocusOnEditRef,
    rowAriaLabel = "row",
    isEditing,
    isDisabled
  }) => {
    const editButtonRef = import_react165.default.useRef();
    const onKeyDown = (event, action) => {
      if (event.key === "Enter" || event.key === " ") {
        event.preventDefault();
        event.target.click();
        setTimeout(() => {
          const focusRef = action === "edit" ? elementToFocusOnEditRef : editButtonRef;
          focusRef?.current?.focus();
        }, 0);
      }
    };
    if (isEditing) {
      return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { style: buttonGroupStyles, children: [
        /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
          Button,
          {
            "aria-label": `Save edits of ${rowAriaLabel}`,
            onClick: () => onClick("save"),
            onKeyDown: (event) => onKeyDown(event, "save"),
            variant: "plain",
            children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(CheckIcon, { style: { color: "#3E8635" } })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
          Button,
          {
            "aria-label": `Discard edits of ${rowAriaLabel}`,
            onClick: () => onClick("cancel"),
            onKeyDown: (event) => onKeyDown(event, "cancel"),
            variant: "plain",
            children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(TimesIcon, {})
          }
        )
      ] });
    }
    return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
      Button,
      {
        ref: editButtonRef,
        "aria-label": `Edit ${rowAriaLabel}`,
        onClick: () => onClick("edit"),
        onKeyDown: (event) => onKeyDown(event, "edit"),
        variant: "plain",
        isDisabled,
        children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(PencilAltIcon, {})
      }
    );
  };
  var EditableTextCell = ({
    value,
    rowIndex,
    cellIndex,
    props,
    handleTextInputChange,
    isDisabled,
    inputAriaLabel,
    onUpdate
  }) => {
    const [isEditing, setIsEditing] = import_react165.default.useState(false);
    const [editedValue, setEditedValue] = import_react165.default.useState(
      typeof value === "object" ? "" : value
    );
    const inputRef = import_react165.default.useRef(null);
    import_react165.default.useEffect(() => {
      if (isEditing && inputRef.current) {
        inputRef.current.focus();
      }
    }, [isEditing]);
    const displayValue = typeof value === "object" ? value : editedValue;
    const handleClick = (action) => {
      if (action === "edit") {
        const canEdit = onUpdate(null, "edit", true, rowIndex, null);
        if (canEdit === false) {
          setIsEditing(false);
          setEditedValue(typeof value === "object" ? "" : value);
          onUpdate(null, "cancel", false, rowIndex, null);
          return;
        }
        setIsEditing(true);
      } else if (action === "save") {
        onUpdate(null, "save", false, rowIndex, null);
        setIsEditing(false);
      } else if (action === "cancel") {
        setIsEditing(false);
        setEditedValue(typeof value === "object" ? "" : value);
        onUpdate(null, "cancel", false, rowIndex, null);
      }
    };
    return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react165.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "16px" }, children: [
      /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { style: { flex: 1 }, children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
        TextInput,
        {
          ref: inputRef,
          value: editedValue,
          onChange: (_113, newValue) => {
            setEditedValue(newValue);
            handleTextInputChange(newValue, null, rowIndex, cellIndex);
          },
          "aria-label": inputAriaLabel,
          isDisabled
        }
      ) : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { children: displayValue }) }),
      !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
        EditButtonsCell,
        {
          onClick: handleClick,
          elementToFocusOnEditRef: inputRef,
          rowAriaLabel: `row ${rowIndex + 1}`,
          isEditing,
          isDisabled
        }
      )
    ] }) });
  };
  var EditableTable = class extends import_react165.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "onTextInputChange", (newValue, evt, rowIndex, cellIndex) => {
        const newRows = [...this.state.tableRows];
        newRows[rowIndex].cells[cellIndex].props.editableValue = newValue;
        this.setState({
          tableRows: newRows
        });
      });
      __publicField(this, "handleUpdateEditableRows", (evt, type, isEditable, rowIndex, validationErrors) => {
        if (this.props.quickUpdate && type === "edit") {
          if (rowIndex === 0) {
            this.handleDnModalToggle();
            return false;
          }
          const attrCell = this.state.tableRows[rowIndex].cells[0];
          const valCell = this.state.tableRows[rowIndex].cells[1];
          const myAttr = attrCell.props.value.toLowerCase();
          const myVal = valCell.props.value;
          const rdnInfo = getRdnInfo(this.props.wizardEntryDn);
          if (myAttr === rdnInfo.rdnAttr.toLowerCase() && myVal === rdnInfo.rdnVal) {
            this.handleDnModalToggle();
            return false;
          }
        }
        if (type === "edit") {
          const myCellData = this.state.tableRows[rowIndex].cells[0];
          const myAttr = myCellData.props.value.toLowerCase();
          if (myAttr === "userpassword") {
            this.setState({
              isPasswordField: true,
              pwdRowIndex: rowIndex
            });
            return false;
          } else if (BINARY_ATTRIBUTES.includes(myAttr)) {
            this.setState({
              showFileUri: true,
              attrIsJpegPhoto: myAttr === "jpegphoto",
              currentRowIndex: rowIndex
            });
            return false;
          }
        }
        const newRows = [...this.state.tableRows];
        if (validationErrors && Object.keys(validationErrors).length) {
          newRows[rowIndex] = validateCellEdits(newRows[rowIndex], type, validationErrors);
          this.setState({ tableRows: newRows });
          return false;
        }
        if (type === "cancel") {
          newRows[rowIndex] = cancelCellEdits(newRows[rowIndex]);
          this.setState({
            tableRows: newRows
          });
          const foundEmptyValue = newRows.find((el) => el.cells[1].props.value === "");
          this.props.enableNextStep(foundEmptyValue === void 0);
          return false;
        }
        newRows[rowIndex] = applyCellEdits(newRows[rowIndex], type);
        this.setState(
          { tableRows: newRows },
          () => {
            const foundEmptyValue = newRows.find((el) => el.cells[1].props.value === "");
            if (foundEmptyValue === void 0) {
              const noEmptyValueCheck = type === "save";
              const namingAttrSet = this.state.namingRowID !== -1;
              const enableNext = noEmptyValueCheck && namingAttrSet;
              this.props.enableNextStep(enableNext);
            } else {
              this.props.enableNextStep(false);
            }
            if (type === "save") {
              const rowDataToSave = this.buildRowDataToSave();
              this.props.saveCurrentRows(rowDataToSave, this.state.namingRowID);
            }
          }
        );
        return true;
      });
      // Returns an array of row data to store in the parent component.
      __publicField(this, "buildRowDataToSave", () => {
        return this.state.tableRows.map((datum) => {
          const obj = {
            id: datum.cells[0].props.name,
            attr: datum.cells[0].props.value,
            val: datum.cells[1].props.value,
            namingAttr: datum.namingAttr,
            required: datum.required,
            objectClass: datum.objectClass,
            rowEditValidationRules: [...datum.rowEditValidationRules]
          };
          if (datum.cells[1].props.encodedvalue) {
            obj.encodedvalue = datum.cells[1].props.encodedvalue;
          }
          return obj;
        });
      });
      // Check if there is only one occurrence of an attribute
      // so we prevent its removal in case it is required.
      __publicField(this, "hasSingleOccurrence", (attributeName) => {
        let nb = 0;
        for (const datum of this.state.tableRows) {
          const attr = datum.cells[0].props.value;
          if (attr === attributeName) {
            nb++;
            if (nb > 1) {
              return false;
            }
          }
        }
        return true;
      });
      __publicField(this, "generateSingleRow", (myData) => {
        const attrName = myData.attr;
        const attrId = myData.id;
        if (attrName.toLowerCase() === "userpassword") {
          return {
            objectClass: myData.obj,
            required: myData.required,
            namingAttr: myData.namingAttr,
            rowEditValidationRules: this.attributeValidationRules,
            cells: [
              {
                title: (value, rowIndex, cellIndex, props) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                  EditableTextCell,
                  {
                    value,
                    rowIndex,
                    cellIndex,
                    props,
                    handleTextInputChange: this.onTextInputChange,
                    onUpdate: this.handleUpdateEditableRows,
                    isDisabled: true,
                    inputAriaLabel: attrName
                  }
                ),
                props: {
                  value: attrName,
                  name: attrId
                }
              },
              {
                title: (value, rowIndex, cellIndex, props) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                  EditableTextCell,
                  {
                    value: value !== "" ? "********" : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Label, { color: "red", icon: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(InfoCircleIcon, {}), children: _95("Empty value!") }),
                    rowIndex,
                    cellIndex,
                    props,
                    handleTextInputChange: this.onTextInputChange,
                    onUpdate: this.handleUpdateEditableRows,
                    inputAriaLabel: "_" + value
                  }
                ),
                props: {
                  value: myData.val,
                  encodedvalue: myData.encodedvalue,
                  name: `${attrId}_val`
                }
              }
            ]
          };
        } else {
          return {
            objectClass: myData.obj,
            required: myData.required,
            namingAttr: myData.namingAttr,
            rowEditValidationRules: this.attributeValidationRules,
            cells: [
              {
                title: (value, rowIndex, cellIndex, props) => /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                    EditableTextCell,
                    {
                      value,
                      rowIndex,
                      cellIndex,
                      props,
                      handleTextInputChange: this.onTextInputChange,
                      onUpdate: this.handleUpdateEditableRows,
                      isDisabled: true,
                      inputAriaLabel: attrName
                    }
                  ),
                  (attrId === this.state.namingRowID || myData.namingAttr) && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                    Popover,
                    {
                      headerContent: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { children: _95("Naming Attribute") }),
                      bodyContent: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { children: _95("This attribute and value are part of the entry's DN and can not be changed except by doing a Rename (modrdn) operation on the entry.") }),
                      children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("a", { href: "#", className: "ds-font-size-sm", children: _95("Naming Attribute") })
                    }
                  )
                ] }),
                props: {
                  value: attrName,
                  name: attrId
                }
              },
              {
                title: (value, rowIndex, cellIndex, props) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                  EditableTextCell,
                  {
                    value: value === "" ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Label, { color: "red", icon: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(InfoCircleIcon, {}), children: _95("Empty value!") }) : value,
                    rowIndex,
                    cellIndex,
                    props,
                    handleTextInputChange: this.onTextInputChange,
                    onUpdate: this.handleUpdateEditableRows,
                    inputAriaLabel: "_" + value
                  }
                ),
                props: {
                  value: myData.val,
                  encodedvalue: myData.encodedvalue,
                  name: `${attrId}_val`
                }
              }
            ]
          };
        }
      });
      __publicField(this, "createTableRows", () => {
        this.setState({
          namingRowID: this.props.namingRowID
        }, () => {
          const tableRows = this.props.editableTableData.map((attrData) => {
            return this.generateSingleRow(attrData);
          });
          this.setState({
            tableRows
          });
        });
      });
      __publicField(this, "actionResolver", (rowData, { rowIndex }) => {
        const myAttr = rowData.cells[0].props.value;
        const myName = rowData.cells[0].props.name;
        if (myAttr === "dn") {
          return [];
        }
        const actions = [];
        if (!(myName === this.state.namingRowID || this.props.disableNamingChange) && (this.props.namingAttr && myAttr !== this.props.namingAttr || this.props.namingAttr === "")) {
          actions.push({
            title: _95("Set as Naming Attribute"),
            onClick: () => {
              const foundEmptyValue = this.state.tableRows.find((el) => el.cells[1].props.value === "");
              this.props.enableNextStep?.(foundEmptyValue === void 0);
              this.setState({
                namingRowID: myName,
                rdnAttr: myAttr
              }, () => {
                if (typeof this.props.setNamingRowID === "function") {
                  this.props.setNamingRowID(myName);
                }
              });
            }
          });
        }
        if (actions.length > 0 && (!this.props.isAttributeSingleValued(myAttr) || !(this.state.tableRows.length === 1 || rowData.namingAttr || (this.props.isAttributeRequired(myAttr) || rowData.required) && this.hasSingleOccurrence(myAttr)))) {
          actions.push({ isSeparator: true });
        }
        if (!this.props.isAttributeSingleValued(myAttr)) {
          actions.push({
            title: _95("Add Another Value"),
            onClick: () => {
              const myData = {
                id: generateUniqueId(),
                attr: myAttr,
                val: ""
              };
              const tableRows = [...this.state.tableRows];
              const newItem = this.generateSingleRow(myData);
              tableRows.splice(rowIndex + 1, 0, newItem);
              this.setState({ tableRows }, () => {
                const rowDataToSave = this.buildRowDataToSave();
                this.props.saveCurrentRows?.(rowDataToSave, this.state.namingRowID);
                this.props.enableNextStep?.(false);
              });
            }
          });
        }
        if (actions.length > 0 && !(this.state.tableRows.length === 1 || rowData.namingAttr || (this.props.isAttributeRequired(myAttr) || rowData.required) && this.hasSingleOccurrence(myAttr))) {
          actions.push({ isSeparator: true });
        }
        if (!(this.state.tableRows.length === 1 || rowData.namingAttr || (this.props.isAttributeRequired(myAttr) || rowData.required) && this.hasSingleOccurrence(myAttr))) {
          actions.push({
            title: _95("Remove this Row"),
            onClick: () => {
              const tableRows = this.state.tableRows.filter((aRow) => aRow.cells[0].props.name !== myName);
              this.setState({ tableRows }, () => {
                const rowDataToSave = this.buildRowDataToSave();
                const foundEmptyValue = tableRows.find((el) => el.cells[1].props.value === "");
                this.props.enableNextStep?.(foundEmptyValue === void 0);
                let namingRowID = this.state.namingRowID;
                if (myName === namingRowID) {
                  namingRowID = -1;
                  if (typeof this.props.setNamingRowID === "function") {
                    this.props.setNamingRowID(-1);
                  }
                  this.props.enableNextStep?.(false);
                }
                this.setState({ namingRowID });
                this.props.saveCurrentRows?.(rowDataToSave, namingRowID);
              });
            }
          });
        }
        if (this.props.quickUpdate) {
          const quickActions = [];
          const canDuplicate = !this.props.isAttributeSingleValued(myAttr);
          const canRemove = !(this.state.tableRows.length === 1 || rowData.namingAttr || (this.props.isAttributeRequired(myAttr) || rowData.required) && this.hasSingleOccurrence(myAttr));
          if (canDuplicate) {
            quickActions.push(actions.find((action) => action.title === _95("Add Another Value")));
            if (canRemove) {
              quickActions.push({ isSeparator: true });
            }
          }
          if (canRemove) {
            quickActions.push(actions.find((action) => action.title === _95("Remove this Row")));
          } else {
            quickActions.push({
              title: _95("Required Attribute"),
              isDisabled: true
            });
          }
          return quickActions;
        }
        return actions;
      });
      this.attributeValidationRules = [
        {
          name: _95("required"),
          validator: (value) => value.trim() !== "",
          errorText: _95("This field is required")
        }
      ];
      this.columns = [
        { title: _95("Attribute") },
        { title: _95("Value"), cellTransforms: [breakWord] }
      ];
      this.state = {
        tableRows: [],
        namingRowID: 0,
        isPasswordField: false,
        showPassword: false,
        pwdValue: "",
        pwdRowIndex: -1,
        fileValue: "",
        fileName: "",
        encodedValueIsEmpty: true,
        strPathValueIsEmpty: true,
        showFileUrl: false,
        isDnModalOpen: false,
        attrIsJpegPhoto: false,
        currentRowIndex: 0,
        binaryAttributeRadio: "Upload",
        binaryAttributeFilePath: "",
        isFileTooLarge: false
      };
      this.handleDnModalToggle = () => {
        this.setState(({ isDnModalOpen }) => ({
          isDnModalOpen: !isDnModalOpen
        }));
      };
      this.handlePasswordToggle = (event) => {
        this.setState(({ isPasswordField }) => ({
          isPasswordField: !isPasswordField
        }));
      };
      this.handlePwdChange = (_event, str) => {
        this.setState({
          pwdValue: str
        });
      };
      this.handlePwdSave = () => {
        const newRows = [...this.state.tableRows];
        if (this.state.pwdRowIndex !== -1) {
          newRows[this.state.pwdRowIndex].cells[1].props.value = this.state.pwdValue;
          this.setState({
            tableRows: newRows,
            isPasswordField: false
          }, () => {
            const foundEmptyValue = newRows.find((el) => el.cells[1].props.value === "");
            if (foundEmptyValue === void 0) {
              this.props.enableNextStep(true);
            } else {
              this.props.enableNextStep(false);
            }
            const rowDataToSave = this.buildRowDataToSave();
            this.props.saveCurrentRows(rowDataToSave, this.state.namingRowID);
          });
        }
      };
      this.handleShowOrHidePassword = () => {
        this.setState(({ showPassword }) => ({
          showPassword: !showPassword
        }));
      };
      this.applyCustomPath = (filePath) => {
        const encodedValueIsEmpty = true;
        const strPathValueIsEmpty = true;
        this.setState({
          encodedValueIsEmpty,
          strPathValueIsEmpty
        });
        const encodedValue = "";
        const myDecodedValue = `file://${filePath}`;
        const newRows = [...this.state.tableRows];
        newRows[this.state.currentRowIndex].cells[1].props.value = myDecodedValue;
        newRows[this.state.currentRowIndex].cells[1].props.encodedvalue = encodedValue;
        this.setState(({ showFileUri }) => ({
          encodedValueIsEmpty: true,
          strPathValueIsEmpty: false,
          showFileUri: !showFileUri,
          tableRows: newRows
        }));
        const foundEmptyValue = newRows.find((el) => el.cells[1].props.value === "");
        if (foundEmptyValue === void 0) {
          this.props.enableNextStep(true);
        } else {
          this.props.enableNextStep(false);
        }
        const rowDataToSave = this.buildRowDataToSave();
        this.props.saveCurrentRows(rowDataToSave, this.state.namingRowID);
      };
      this.handleToggleUri = () => {
        if (!this.state.strPathValueIsEmpty) {
          this.applyCustomPath(this.state.binaryAttributeFilePath);
        } else {
          this.setState(({ showFileUri }) => ({
            showFileUri: !showFileUri
          }));
        }
      };
      this.handleClear = () => {
        this.setState({
          fileName: ""
        });
      };
      this.handleFileChange = (e, file) => {
        let encodedValue;
        const encodedValueIsEmpty = true;
        const strPathValueIsEmpty = true;
        const isFileTooLarge = false;
        this.setState({
          fileName: file.name,
          encodedValueIsEmpty,
          strPathValueIsEmpty,
          isFileTooLarge
        });
        console.debug("handleFileChange - file: ", file);
        if (file.size === void 0) {
          return;
        }
        if (file.size === 0) {
          console.log("An empty file was selected. Nothing to do.");
          return;
        }
        if (file.size > WEB_SOCKET_MAX_PAYLOAD) {
          console.log("handleFileChange - File too large!");
          this.setState({ isFileTooLarge: true });
          return;
        }
        const reader = new FileReader();
        reader.readAsDataURL(file);
        reader.onload = () => {
          const pattern = ";base64,";
          const pos = reader.result.indexOf(pattern);
          const toDel = reader.result.substring(0, pos + pattern.length);
          const isAnImage = file.type.startsWith("image/");
          encodedValue = this.state.attrIsJpegPhoto ? isAnImage ? reader.result.replace(toDel, "") : "" : file.type === "application/x-x509-ca-cert" || file.type === "application/x-x509-user-cert" || file.type === "application/pkix-cert" ? reader.result.replace(toDel, "") : "";
          if (encodedValue === "") {
            console.log("handleFileChange - encodedValue is null. Nothing to do.");
            return;
          }
          let myDecodedValue = "";
          if (isAnImage) {
            if (this.state.attrIsJpegPhoto) {
              myDecodedValue = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                "img",
                {
                  src: `data:image/png;base64,${encodedValue}`,
                  alt: "",
                  style: { width: "48px" }
                }
              );
            }
          } else {
            myDecodedValue = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Label, { icon: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(InfoCircleIcon, {}), color: "blue", children: _95("Value is too large to display") }) });
          }
          console.log(`handleFileChange - encodedValue.substring(0, 100) = ${encodedValue.substring(0, 100)}`);
          const newRows = [...this.state.tableRows];
          newRows[this.state.currentRowIndex].cells[1].props.value = myDecodedValue;
          newRows[this.state.currentRowIndex].cells[1].props.encodedvalue = encodedValue;
          this.setState({
            encodedValueIsEmpty: false,
            strPathValueIsEmpty: true,
            tableRows: newRows
          });
          const foundEmptyValue = newRows.find((el) => el.cells[1].props.value === "");
          if (foundEmptyValue === void 0) {
            this.props.enableNextStep(true);
          } else {
            this.props.enableNextStep(false);
          }
          const rowDataToSave = this.buildRowDataToSave();
          this.props.saveCurrentRows(rowDataToSave, this.state.namingRowID);
        };
        reader.onerror = (error) => {
          console.log(`handleFileChange - Failed to encode the file : ${file.name}`, error);
        };
      };
      this.handleRadioOnChange = (event, _113) => {
        this.setState({ binaryAttributeRadio: event.currentTarget.value });
      };
      this.handleBinaryAttributeInput = (_event, str) => {
        const invalidPath = !file_is_path(str);
        this.setState({
          binaryAttributeFilePath: str,
          encodedValueIsEmpty: true,
          // If we say strPathValueIsEmpty is true then the 'Confirm' button will be disabled
          // Hense if we say strPathValueIsEmpty = invalidPath = true then the button is disabled
          strPathValueIsEmpty: invalidPath
        });
      };
    }
    // End constructor().
    componentDidMount() {
      this.createTableRows();
      const foundEmptyValue = this.props.editableTableData.find((el) => el.val === "");
      this.props.enableNextStep(foundEmptyValue === void 0);
    }
    render() {
      const {
        tableRows,
        isPasswordField,
        showPassword,
        showFileUri,
        isDnModalOpen,
        fileName,
        attrIsJpegPhoto,
        encodedValueIsEmpty,
        strPathValueIsEmpty,
        binaryAttributeRadio,
        binaryAttributeFilePath,
        isFileTooLarge
      } = this.state;
      const uploadSelected = showFileUri ? binaryAttributeRadio === "Upload" : null;
      const fileUriModalTitle = uploadSelected ? `Upload File ${attrIsJpegPhoto ? "(Photo)" : "(Certificate)"}` : `Type File Path ${attrIsJpegPhoto ? "(Photo)" : "(Certificate)"}`;
      return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_jsx_runtime95.Fragment, { children: [
        isDnModalOpen && /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
          Modal,
          {
            id: "modal-dn-id",
            variant: ModalVariant.small,
            titleIconVariant: "info",
            title: _95("DN Renaming"),
            isOpen: this.state.isDnModalOpen,
            onClose: this.handleDnModalToggle,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Button, { variant: "primary", onClick: this.handleDnModalToggle, children: _95("Close") }, "close")
            ],
            children: [
              _95("You cannot modify the RDN ( Relative Distinguished Name ) in the edit mode."),
              /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("br", {}),
              _95("If you want to modify the RDN, please use the Rename action option")
            ]
          }
        ),
        isPasswordField && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
          Modal,
          {
            id: "modal-password-id",
            variant: ModalVariant.medium,
            title: _95("Set Password"),
            isOpen: isPasswordField,
            onClose: this.handlePasswordToggle,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                Button,
                {
                  variant: "primary",
                  name: "confirm",
                  onClick: this.handlePwdSave,
                  children: _95("Confirm")
                },
                "confirm"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                Button,
                {
                  variant: "link",
                  onClick: this.handlePasswordToggle,
                  children: _95("Cancel")
                },
                "cancel"
              )
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(InputGroup, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(InputGroupItem, { isFill: true, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                TextInput,
                {
                  name: _95("passwordField"),
                  id: "passwordField",
                  type: showPassword ? "text" : "password",
                  onChange: (event, str) => this.handlePwdChange(event, str),
                  "aria-label": "password field"
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(InputGroupItem, { children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                Button,
                {
                  variant: "control",
                  "aria-label": "password field icon",
                  onClick: this.handleShowOrHidePassword,
                  icon: showPassword ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(EyeSlashIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(EyeIcon, {})
                }
              ) })
            ] })
          }
        ),
        showFileUri && /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: fileUriModalTitle,
            isOpen: showFileUri,
            onClose: this.handleToggleUri,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                Button,
                {
                  variant: "primary",
                  isDisabled: encodedValueIsEmpty && strPathValueIsEmpty,
                  onClick: this.handleToggleUri,
                  children: _95("Confirm")
                },
                "confirm"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Button, { variant: "link", onClick: this.handleToggleUri, children: _95("Cancel") }, "cancel")
            ],
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                Radio,
                {
                  value: "Upload",
                  className: "ds-margin-top",
                  isChecked: uploadSelected,
                  onChange: (event, _113) => this.handleRadioOnChange(event, _113),
                  label: _95("Upload a file local to the browser."),
                  description: _95("Select a file from the machine on which the browser was launched."),
                  name: "radio-binary-attribute",
                  id: "radio-upload-binary-attribute"
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                Radio,
                {
                  className: "ds-margin-top-lg",
                  value: "TextInput",
                  isChecked: !uploadSelected,
                  onChange: (event, _113) => this.handleRadioOnChange(event, _113),
                  label: _95("Write the complete file path."),
                  description: _95("Type the full path of the file on the server host the LDAP server."),
                  name: "radio-binary-attribute",
                  id: "radio-type-binary-attribute"
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("hr", {}),
              fileName !== "" && encodedValueIsEmpty && strPathValueIsEmpty && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Alert, { variant: "danger", isInline: true, title: _95("There was an issue with the uploaded file ( incorrect type? ).") }),
              isFileTooLarge && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Alert, { variant: "danger", isInline: true, title: _95("The file size larger than 128 MB. Use the file path option.") }),
              !attrIsJpegPhoto && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Label, { className: "ds-margin-top-lg", icon: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(InfoCircleIcon, {}), color: "blue", children: _95("The certificate must be stored in the Distinguished Encoding Rules (DER) format.") }),
              uploadSelected && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                FileUpload,
                {
                  id: "file-upload",
                  type: "dataURL",
                  className: "ds-margin-top-lg",
                  filename: fileName,
                  value: fileName,
                  onFileInputChange: this.handleFileChange,
                  onClearClick: this.handleClear,
                  validated: uploadSelected && fileName === "" ? "error" : "default",
                  hideDefaultPreview: true,
                  browseButtonText: _95("Choose Binary File")
                }
              ),
              !uploadSelected && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                TextInput,
                {
                  value: binaryAttributeFilePath,
                  onChange: (event, str) => this.handleBinaryAttributeInput(event, str),
                  isRequired: true,
                  validated: file_is_path(binaryAttributeFilePath) ? ValidatedOptions.default : ValidatedOptions.error,
                  type: "text",
                  "aria-label": "File input for a binary attribute."
                }
              )
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(Table, { "aria-label": "Editable Rows Table", variant: "compact", children: [
          /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(Tr, { children: [
            this.columns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Th, { children: column.title }, columnIndex)),
            /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Th, { children: "Actions" })
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Tbody, { children: tableRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(Tr, { children: [
            row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Td, { children: typeof cell.title === "function" ? cell.title(cell.props.value, rowIndex, cellIndex, cell.props) : cell.title }, cellIndex)),
            /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Td, { children: rowIndex !== 0 && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(ActionsColumn, { items: this.actionResolver(row, { rowIndex }) }) })
          ] }, rowIndex)) })
        ] })
      ] });
    }
  };
  EditableTable.propTypes = {
    wizardEntryDn: import_prop_types85.default.string,
    editableTableData: import_prop_types85.default.array,
    isAttributeSingleValued: import_prop_types85.default.func,
    isAttributeRequired: import_prop_types85.default.func,
    enableNextStep: import_prop_types85.default.func,
    saveCurrentRows: import_prop_types85.default.func,
    disableNamingChange: import_prop_types85.default.bool
  };
  EditableTable.defaultProps = {
    wizardEntryDn: "",
    editableTableData: [],
    disableNamingChange: false
  };
  var editableTable_default = EditableTable;

  // src/lib/ldap_editor/wizards/operations/addCosTemplate.jsx
  var import_jsx_runtime96 = __toESM(require_jsx_runtime(), 1);
  var _96 = cockpit_default.gettext;
  var AddCosTemplate = class _AddCosTemplate extends import_react166.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "isAttributeSingleValued", (attr) => {
        return this.singleValuedAttributes.includes(attr.toLowerCase());
      });
      __publicField(this, "isAttributeRequired", (attr) => {
        return this.requiredAttributes.includes(attr);
      });
      __publicField(this, "enableNextStep", (yes) => {
        this.setState({
          validMods: yes
        });
      });
      __publicField(this, "saveCurrentRows", (editableTableData) => {
        let validMods = true;
        let namingVal = this.state.namingVal;
        let namingAttrVal = this.state.namingAttrVal;
        for (const row of editableTableData) {
          if (row.val === "") {
            validMods = false;
            break;
          }
          if (row.id === this.state.namingRowID) {
            namingVal = row.val;
            namingAttrVal = row.attr + "=" + row.val;
          }
        }
        this.setState({
          editableTableData,
          validMods,
          namingVal,
          namingAttrVal
        });
      });
      __publicField(this, "handleSetPageOc", (_event, pageNumber) => {
        this.setState({
          pageOc: pageNumber,
          pagedRowsOc: this.getItemsToShow(pageNumber, this.state.perPageOc, "ObjectClassTable")
        });
      });
      __publicField(this, "handleSetPageAttr", (_event, pageNumber) => {
        this.setState({
          pageAttr: pageNumber,
          pagedRowsAttr: this.getItemsToShow(pageNumber, this.state.perPageAttr, "AttributeTable")
        });
      });
      __publicField(this, "handlePerPageSelectOc", (_event, perPage) => {
        this.setState({
          pageOc: 1,
          perPageOc: perPage,
          pagedRowsOc: this.getItemsToShow(1, perPage, "ObjectClassTable")
        });
      });
      __publicField(this, "handlePerPageSelectAttr", (_event, perPage) => {
        this.setState({
          pageAttr: 1,
          perPageAttr: perPage,
          pagedRowsAttr: this.getItemsToShow(1, perPage, "AttributeTable")
        });
      });
      __publicField(this, "handleSelectOc", (event, isSelected, rowId) => {
        const rows = [...this.state.pagedRowsOc];
        rows[rowId].selected = isSelected;
        const ocName = this.state.pagedRowsOc[rowId].cells[0];
        const allItems = [...this.state.rowsOc];
        const index = allItems.findIndex((item) => item.cells[0] === ocName);
        allItems[index].selected = isSelected;
        let selectedObjectClasses = [...this.state.selectedObjectClasses];
        if (isSelected) {
          selectedObjectClasses.push(allItems[index]);
        } else {
          selectedObjectClasses = selectedObjectClasses.filter((row) => row.cells[0] !== allItems[index].cells[0]);
        }
        const attrsToRemove = [];
        if (!isSelected) {
          let ocAttrs = allItems[index].cells[1].toLowerCase().replace(/\s/g, "").split(",");
          ocAttrs = ocAttrs.concat(allItems[index].cells[2].toLowerCase().replace(/\s/g, "").split(","));
          let currAttrs = [];
          for (const oc of selectedObjectClasses) {
            currAttrs = currAttrs.concat(oc.cells[1].toLowerCase().replace(/\s/g, "").split(","));
            currAttrs = currAttrs.concat(oc.cells[2].toLowerCase().replace(/\s/g, "").split(","));
          }
          for (const attr of ocAttrs) {
            if (currAttrs.indexOf(attr) === -1) {
              attrsToRemove.push(attr);
            }
          }
        }
        this.setState({
          rowsOc: allItems,
          pagedRowsOc: rows,
          selectedObjectClasses,
          attrsToRemove
        }, () => {
          this.updateAttributeTableRows();
        });
      });
      __publicField(this, "handleSelectAttr", (event, isSelected, rowId) => {
        let newEditableData = this.state.editableTableData;
        const rows = [...this.state.pagedRowsAttr];
        if (this.state.pagedRowsAttr[rowId].disableCheckbox === true) {
          return;
        }
        rows[rowId].selected = isSelected;
        const attrName = rows[rowId].cells[0];
        const allItems = [...this.state.rowsAttr];
        const index = allItems.findIndex((item) => item.cells[0] === attrName);
        allItems[index].isAttributeSelected = isSelected;
        const selectedAttributes = allItems.filter((item) => item.isAttributeSelected).map((attrObj) => [attrObj.attributeName, attrObj.cells[1]]);
        const rowAttr = rows[rowId].attributeName.toLowerCase();
        const found = this.state.editableTableData.filter((item) => item.attr.toLowerCase() === rowAttr);
        if (isSelected) {
          if (found.length === 0 && rowAttr !== "objectclass") {
            const obj = {};
            obj.id = generateUniqueId();
            obj.attr = rows[rowId].attributeName;
            obj.val = "";
            obj.namingAttr = false;
            obj.required = false;
            newEditableData = [...newEditableData, obj];
          }
        } else if (found.length > 0) {
          newEditableData = this.state.editableTableData.filter((item) => item.attr.toLowerCase() !== rowAttr);
        }
        let validMods = true;
        for (const row of newEditableData) {
          if (row.val === "") {
            validMods = false;
          }
        }
        this.setState({
          rowsAttr: allItems,
          pagedRowsAttr: rows,
          editableTableData: newEditableData,
          selectedAttributes,
          validMods
        });
      });
      __publicField(this, "updateAttributeTableRows", () => {
        const ocToProcess = [...this.state.selectedObjectClasses];
        const rowsAttr = [];
        const attrList = [];
        let namingRowID = this.state.namingRowID;
        let namingAttr = this.state.namingAttr;
        const namingVal = this.state.namingVal;
        const cospriority = this.state.cospriority;
        for (const oc of ocToProcess) {
          const required = oc.cells[1].split(",");
          const optional = oc.cells[2].split(",");
          for (let attr of required) {
            attr = attr.trim().toLowerCase();
            if (attr === "") {
              continue;
            }
            if (!attrList.includes(attr)) {
              attrList.push(attr);
              rowsAttr.push({
                selected: true,
                disableCheckbox: true,
                // TODO: Hack until upgrading!
                isAttributeSelected: true,
                attributeName: attr,
                cells: [
                  {
                    title: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_jsx_runtime96.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("strong", { children: attr }) })
                  },
                  oc.cells[0]
                ]
              });
            }
            const found = this.state.editableTableData.filter((item) => item.attr.toLowerCase() === attr);
            if (found.length === 0 && attr !== "objectclass") {
              const new_id = generateUniqueId();
              if (namingRowID === -1) {
                namingRowID = new_id;
                namingAttr = attr;
              }
              const obj = {};
              obj.id = new_id;
              obj.attr = attr;
              if (attr.toLowerCase() === "cn") {
                obj.val = namingVal;
              } else if (attr.toLowerCase() === "cospriority") {
                obj.val = cospriority;
              } else {
                obj.val = "";
              }
              obj.namingAttr = false;
              obj.required = true;
              this.setState((prevState) => ({
                editableTableData: [...prevState.editableTableData, obj],
                validMods: false,
                namingRowID,
                namingAttr
              }));
            }
          }
          for (let attr of optional) {
            attr = attr.trim();
            if (attr === "") {
              continue;
            }
            if (!attrList.includes(attr)) {
              let selected = false;
              for (const existingRow of this.state.editableTableData) {
                if (existingRow.attr.toLowerCase() === attr.toLowerCase()) {
                  selected = true;
                  break;
                }
              }
              attrList.push(attr);
              rowsAttr.push({
                attributeName: attr,
                isAttributeSelected: selected,
                selected,
                cells: [attr, oc.cells[0]]
              });
            }
          }
        }
        rowsAttr.sort((a2, b) => a2.attributeName > b.attributeName ? 1 : -1);
        this.setState({
          rowsAttr,
          rowsAttrOrig: [...rowsAttr],
          selectedAttributes: rowsAttr.filter((item) => item.isAttributeSelected).map((attrObj) => [attrObj.attributeName, attrObj.cells[1]]),
          itemCountAttr: rowsAttr.length
        }, () => {
          this.setState({
            pagedRowsAttr: this.getItemsToShow(
              this.state.pageAttr,
              this.state.perPageAttr,
              "AttributeTable"
            )
          });
        });
      });
      __publicField(this, "generateLdifData", () => {
        const objectClassData = ["top"];
        const attribute = this.state.namingAttr;
        const value = this.state.namingVal;
        const valueData = [];
        for (const oc of this.state.selectedObjectClasses) {
          if (oc && !objectClassData.includes(oc.cells[0])) {
            objectClassData.push(oc.cells[0]);
          }
        }
        for (const item of this.state.editableTableData) {
          const attrName = item.attr;
          valueData.push(`${attrName}: ${item.val}`);
        }
        const ocArray = objectClassData.map((oc) => `ObjectClass: ${oc}`);
        const dnLine = `dn: ${attribute}=${value},${this.props.wizardEntryDn}`;
        const ldifArray = [
          dnLine,
          ...ocArray,
          ...valueData
        ];
        const cleanLdifArray = [...ldifArray];
        for (const idx in cleanLdifArray) {
          if (cleanLdifArray[idx].toLowerCase().startsWith("userpassword")) {
            cleanLdifArray[idx] = "userpassword: ********";
            break;
          }
        }
        this.setState({
          ldifArray,
          cleanLdifArray
        });
      });
      __publicField(this, "handleOCDropDownToggle", (isOpen) => {
        this.setState({
          isOCDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleOCDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isOCDropDownOpen: !prevState.isOCDropDownOpen };
        });
      });
      __publicField(this, "buildOCDropdown", () => {
        const { isOCDropDownOpen, selectedObjectClasses } = this.state;
        const numSelected = this.state.rowsOc.filter((item) => item.selected).length;
        const items = selectedObjectClasses.map(
          (oc) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(DropdownItem2, { children: oc.cells[0] }, oc.cells[0])
        );
        return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
          Dropdown2,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleOCDropDownSelect,
            position: DropdownPosition.left,
            toggle: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(BadgeToggle, { id: "toggle-oc-select", onToggle: (_event, isOpen) => this.handleOCDropDownToggle(isOpen), children: numSelected !== 0 ? /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
              numSelected,
              " ",
              _96("selected"),
              " "
            ] }) : /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
              "0 ",
              _96("selected"),
              " "
            ] }) }),
            isOpen: isOCDropDownOpen,
            dropdownItems: items
          }
        );
      });
      __publicField(this, "handleAttrDropDownToggle", (isOpen) => {
        this.setState({
          isAttrDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleAttrDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isAttrDropDownOpen: !prevState.isAttrDropDownOpen };
        });
      });
      __publicField(this, "buildAttrDropdown", () => {
        const { isAttrDropDownOpen, selectedAttributes } = this.state;
        const numSelected = selectedAttributes.length;
        const items = selectedAttributes.map(
          (attr) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(DropdownItem2, { children: attr[0] }, attr[0])
        );
        return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
          Dropdown2,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleAttrDropDownSelect,
            position: DropdownPosition.left,
            toggle: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(BadgeToggle, { id: "toggle-attr-select", onToggle: (_event, isOpen) => this.handleAttrDropDownToggle(isOpen), children: numSelected !== 0 ? /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
              numSelected,
              " ",
              _96("selected"),
              " "
            ] }) : /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
              "0 ",
              _96("selected"),
              " "
            ] }) }),
            isOpen: isAttrDropDownOpen,
            dropdownItems: items
          }
        );
      });
      __publicField(this, "setNamingRowID", (namingRowID) => {
        let namingAttrVal = "";
        let namingAttr = "";
        let namingVal = "";
        const rows = this.state.editableTableData;
        for (const row of rows) {
          if (row.id === namingRowID) {
            namingAttrVal = row.attr + "=" + row.val;
            namingAttr = row.attr;
            namingVal = row.val;
            break;
          }
        }
        this.setState({
          namingRowID,
          namingAttrVal,
          namingAttr,
          namingVal
        });
      });
      this.originalEntryRows = [];
      this.singleValuedAttributes = ["cn"];
      this.requiredAttributes = ["dn"];
      this.operationColumns = [
        { title: _96("Statement") },
        { title: _96("Attribute") },
        { title: _96("Value"), cellTransforms: [breakWord] }
      ];
      this.state = {
        loading: true,
        isOCDropDownOpen: false,
        isAttrDropDownOpen: false,
        namingAttributeData: ["", ""],
        namingAttrPropsName: "",
        namingRowID: -1,
        namingAttr: "",
        namingVal: "",
        cospriority: 0,
        editableTableData: [],
        ldifArray: [],
        cleanLdifArray: [],
        validMods: false,
        commandOutput: "",
        resultVariant: "default",
        stepIdReached: this.props.stepReached,
        itemCountOc: 0,
        pageOc: 1,
        perPageOc: 6,
        itemCountAttr: 0,
        pageAttr: 1,
        perPageAttr: 10,
        columnsAttr: [
          { title: _96("Attribute Name"), cellTransforms: [headerCol()] },
          { title: _96("From ObjectClass") }
        ],
        columnsOc: [
          { title: _96("ObjectClass Name"), cellTransforms: [headerCol()] },
          { title: _96("Required Attributes"), cellTransforms: [breakWord] },
          { title: _96("Optional Attributes"), cellTransforms: [breakWord] }
        ],
        rowsOc: [],
        rowsAttr: [],
        rowsAttrOrig: [],
        rowsValues: [],
        pagedRowsOc: [],
        pagedRowsAttr: [],
        selectedObjectClasses: [],
        selectedAttributes: [],
        attrsToRemove: [],
        adding: true,
        goBackToCoSDefinition: false,
        createdTemplate: "",
        isConfirmModalOpen: false,
        createTemplateEnd: false,
        searchValue: "",
        searchAttrValue: ""
      };
      this.handleConfirmModalToggle = () => {
        this.setState(({ isConfirmModalOpen }) => ({
          isConfirmModalOpen: !isConfirmModalOpen
        }));
      };
      this.handleCreateTemplateEnd = () => {
        this.setState({
          createTemplateEnd: true
        }, () => {
          this.props.onReload();
        });
      };
      this.handleMinusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        });
      };
      this.handleConfigChange = (event, id, min3, max3) => {
        let maxValue = this.maxValue;
        if (max3 !== 0) {
          maxValue = max3;
        }
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > maxValue ? maxValue : newValue < min3 ? min3 : newValue
        });
      };
      this.handlePlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        });
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 4) {
          this.updateAttributeTableRows();
        } else if (id === 5) {
          this.cleanUpEntry();
        } else if (id === 6) {
          this.generateLdifData();
        } else if (id === 7) {
          createLdapEntry(
            this.props.editorLdapServer,
            this.state.ldifArray,
            (result) => {
              const myDn = this.state.ldifArray[0].substring(4);
              this.setState({
                commandOutput: result.errorCode === 0 ? _96("Successfully added entry!") : _96("Failed to add entry, error: ") + result.output,
                resultVariant: result.errorCode === 0 ? "success" : "danger",
                adding: false,
                createdTemplate: myDn
              }, () => {
                this.props.onReload();
              });
              const opInfo = {
                operationType: "ADD",
                resultCode: result.errorCode,
                time: Date.now(),
                entryDn: myDn,
                relativeDn: this.state.namingAttrVal
              };
              this.props.setWizardOperationInfo(opInfo);
            }
          );
        } else if (id === 8 && this.props.cosDefCreateMoreTemplate) {
          this.setState({
            isConfirmModalOpen: true
          });
        } else if (id === 8 && this.props.definitionWizardEntryDn !== "") {
          this.setState({
            goBackToCoSDefinition: true
          }, () => {
            this.props.onReload();
          });
        }
      };
      this.handleToggleOpenWizard = () => {
        if (this.props.definitionWizardEntryDn !== "") {
          this.setState({
            goBackToCoSDefinition: true
          }, () => {
            this.props.onReload();
          });
        } else {
          this.props.handleToggleWizard();
        }
      };
      this.handleCreateTemplate = () => {
        this.setState({
          goBackToCoSDefinition: true
        });
      };
      this.cleanUpEntry = () => {
        const newRows = [];
        let validMods = true;
        for (const row of this.state.editableTableData) {
          const attr = row.attr.toLowerCase();
          if (this.state.attrsToRemove.indexOf(attr) === -1) {
            if (row.val === "") {
              validMods = false;
            }
            newRows.push(row);
          }
        }
        this.setState({
          editableTableData: newRows,
          validMods
        });
      };
      this.handleOCSearchChange = (event, value) => {
        let ocRows = [];
        const allOCs = [];
        const val = value.toLowerCase();
        this.props.allObjectclasses.map((oc) => {
          let selected = false;
          let selectionDisabled = false;
          for (const selectedOC of this.state.selectedObjectClasses) {
            if (selectedOC.cells[0].toLowerCase() === oc.name.toLowerCase()) {
              selected = true;
              break;
            }
          }
          if (oc.name === "top") {
            selectionDisabled = true;
          } else if (oc.name === "costemplate") {
            selectionDisabled = true;
            selected = true;
          }
          allOCs.push(
            {
              cells: [
                oc.name,
                oc.required.join(", "),
                oc.optional.join(", ")
              ],
              selected,
              disableSelection: selectionDisabled
            }
          );
          return [];
        });
        if (value !== "") {
          for (const row of allOCs) {
            const name2 = row.cells[0].toLowerCase();
            const reqAttrs = row.cells[1].toLowerCase();
            const optAttrs = row.cells[2].toLowerCase();
            if (name2.includes(val) || reqAttrs.includes(val) || optAttrs.includes(val)) {
              ocRows.push(row);
            }
          }
        } else {
          ocRows = allOCs;
        }
        this.setState({
          rowsOc: ocRows,
          pagedRowsOc: ocRows.slice(0, this.state.perPageOc),
          itemCountOc: ocRows.length,
          searchValue: value
        });
      };
      this.handleAttrSearchChange = (event, value) => {
        let attrRows = [];
        const allAttrs = this.state.rowsAttrOrig;
        const val = value.toLowerCase();
        if (val !== "") {
          for (const row of allAttrs) {
            const name2 = row.attributeName.toLowerCase();
            if (name2.includes(val)) {
              attrRows.push(row);
            }
          }
        } else {
          attrRows = allAttrs;
        }
        this.setState({
          rowsAttr: attrRows,
          pagedRowsAttr: attrRows.slice(0, this.state.perPageAttr),
          itemCountAttr: attrRows.length,
          searchAttrValue: value
        });
      };
    }
    componentDidMount() {
      const ocArray = [];
      getSingleValuedAttributes(
        this.props.editorLdapServer,
        (myAttrs) => {
          this.singleValuedAttributes = [...myAttrs];
        }
      );
      this.props.allObjectclasses.map((oc) => {
        let selectionDisabled = false;
        let selected = false;
        if (oc.name === "top") {
          selectionDisabled = true;
        }
        if (oc.name === "costemplate") {
          selectionDisabled = true;
          selected = true;
          ocArray.push(
            {
              cells: [
                oc.name,
                oc.required.concat(oc.optional).join(", "),
                ""
              ],
              selected,
              disableSelection: selectionDisabled
            }
          );
          const selectedOC = [...this.state.selectedObjectClasses];
          selectedOC.push(ocArray[ocArray.length - 1]);
          this.setState({
            selectedObjectClasses: selectedOC
          });
        } else {
          ocArray.push(
            {
              cells: [
                oc.name,
                oc.required.join(", "),
                oc.optional.join(", ")
              ],
              selected,
              disableSelection: selectionDisabled
            }
          );
        }
        return [];
      });
      this.setState({
        itemCountOc: ocArray.length,
        rowsOc: ocArray,
        pagedRowsOc: ocArray.slice(0, this.state.perPageOc),
        loading: false
      });
    }
    getItemsToShow(page, perPage, option) {
      const start2 = (page - 1) * perPage;
      const end2 = page * perPage;
      const newRows = option === "ObjectClassTable" ? this.state.rowsOc.slice(start2, end2) : option === "AttributeTable" ? this.state.rowsAttr.slice(start2, end2) : [];
      return newRows;
    }
    handleChange(e) {
      const attr = e.target.id;
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [attr]: value
      });
    }
    onToggleWizard() {
      this.props.handleToggleWizard();
    }
    render() {
      const {
        loading,
        itemCountOc,
        pageOc,
        perPageOc,
        columnsOc,
        pagedRowsOc,
        itemCountAttr,
        pageAttr,
        perPageAttr,
        columnsAttr,
        pagedRowsAttr,
        commandOutput,
        namingAttr,
        namingVal,
        cospriority,
        stepIdReached,
        ldifArray,
        resultVariant,
        editableTableData,
        validMods,
        cleanLdifArray,
        selectedAttributes,
        selectedObjectClasses,
        goBackToCoSDefinition,
        createTemplateEnd,
        isOCDropDownOpen,
        isAttrDropDownOpen
      } = this.state;
      if (createTemplateEnd) {
        return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
          _AddCosTemplate,
          {
            isWizardOpen: this.props.isWizardOpen,
            handleToggleWizard: this.opToggleWizard,
            wizardEntryDn: this.props.wizardEntryDn,
            editorLdapServer: this.props.editorLdapServer,
            setWizardOperationInfo: this.props.setWizardOperationInfo,
            firstStep: this.props.firstStep,
            onReload: this.props.onReload,
            allObjectclasses: this.props.allObjectclasses,
            treeViewRootSuffixes: this.props.treeViewRootSuffixes,
            stepReached: 2,
            cosDefCreateMoreTemplate: true
          }
        );
      } else if (goBackToCoSDefinition) {
        let myDn = this.state.createdTemplate;
        if (resultVariant === "danger") {
          myDn = "";
        }
        return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
          addCosDefinition_default,
          {
            isWizardOpen: this.props.isWizardOpen,
            handleToggleWizard: this.onToggleWizard,
            wizardEntryDn: this.props.definitionWizardEntryDn,
            editorLdapServer: this.props.editorLdapServer,
            setWizardOperationInfo: this.props.setWizardOperationInfo,
            firstStep: this.props.firstStep,
            onReload: this.props.onReload,
            allObjectclasses: this.props.allObjectclasses,
            treeViewRootSuffixes: this.props.treeViewRootSuffixes,
            createdTemplateDN: myDn,
            stepReached: 2,
            cosDefName: this.props.cosDefName,
            cosDefDesc: this.props.cosDefDesc,
            cosDefType: this.props.cosDefType
          }
        );
      }
      const namingValAndPriority = /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Text, { component: TextVariants.h3, children: _96("Select Name And CoS Priority") }) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(TextContent, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Text, { children: _96("The CoS template entry contains the value or values of the attributes generated by the CoS logic. The CoS template entry contains a general object class of cosTemplate. The CoS template entries for a given CoS are stored in the directory tree along with the CoS definition.") }),
            /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Text, { children: _96("The relative distinguished name (RDN) of the template entry is determined by one of the following:") }),
            /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(TextList, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TextListItem, { children: _96("The DN of the template entry alone. This type of template is associated with a pointer CoS definition.") }),
              /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TextListItem, { children: _96("The value of one of the target entry's attributes. The attribute used to provide the relative DN to the template entry is specified in the CoS definition entry using the cosIndirectSpecifier attribute. This type of template is associated with an indirect CoS definition.") }),
              /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TextListItem, { children: _96("By a combination of the DN of the subtree where the CoS performs a one level search for templates and the value of one of the target entry's attributes. This type of template is associated with a classic CoS definition.") })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Text, { children: _96("Please, consult official documentation for more information and examplesa.") })
          ] }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Form, { autoComplete: "off", children: [
          /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Grid, { className: "ds-margin-top-xlg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(GridItem, { span: 3, className: "ds-label", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Text, { children: _96("CoS Template Name") }) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
              TextInput,
              {
                value: namingVal,
                type: "text",
                id: "namingVal",
                "aria-describedby": "namingVal",
                name: "namingVal",
                onChange: (e, str) => {
                  this.handleChange(e);
                },
                validated: this.state.namingVal === "" ? ValidatedOptions.error : ValidatedOptions.default
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Grid, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(GridItem, { className: "ds-label", span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Text, { children: [
              _96("CoS Priority"),
              /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
                Tooltip,
                {
                  position: "bottom",
                  content: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { children: _96("Specifies which template provides the attribute value when CoS templates compete to provide an attribute value. This attribute represents the global priority of a template. A priority of zero is the highest priority.") }),
                  children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("a", { className: "ds-font-size-md", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(InfoCircleIcon, { className: "ds-info-icon" }) })
                }
              )
            ] }) }) }),
            /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
              NumberInput,
              {
                value: cospriority,
                min: 0,
                max: 2147483647,
                onMinus: () => {
                  this.handleMinusConfig("cospriority");
                },
                onChange: (e) => {
                  this.handleConfigChange(e, "cospriority", 0, 2147483647);
                },
                onPlus: () => {
                  this.handlePlusConfig("cospriority");
                },
                inputName: "input",
                inputAriaLabel: "number input",
                minusBtnAriaLabel: "minus",
                plusBtnAriaLabel: "plus",
                widthChars: 8
              }
            ) })
          ] })
        ] })
      ] });
      const objectClassStep = /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: "ds-container", children: [
          /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Text, { component: TextVariants.h3, children: _96("Select ObjectClasses") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
            Dropdown2,
            {
              className: "ds-dropdown-padding",
              position: "left",
              onSelect: this.handleOCDropDownSelect,
              toggle: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
                BadgeToggle,
                {
                  id: "toggle-oc-select",
                  badgeProps: {
                    className: selectedObjectClasses.length > 0 ? "ds-badge-bgcolor" : void 0,
                    isRead: selectedObjectClasses.length === 0
                  },
                  onToggle: (_event, isOpen) => this.handleOCDropDownToggle(isOpen),
                  children: selectedObjectClasses.length > 0 ? `${selectedObjectClasses.length} ${_96("selected")}` : `0 ${_96("selected")}`
                }
              ),
              isOpen: isOCDropDownOpen,
              dropdownItems: selectedObjectClasses.map(
                (oc) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(DropdownItem2, { children: oc.cells[0] }, oc.cells[0])
              )
            }
          )
        ] }),
        loading ? /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Bullseye, { className: "ds-margin-top-xlg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Title, { headingLevel: "h3", size: "lg", children: _96("Loading ObjectClasses ...") }),
          /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Spinner, { className: "ds-center", size: "lg" })
        ] }) : /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { children: [
          /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
              SearchInput,
              {
                className: "ds-font-size-md",
                placeholder: _96("Search Objectclasses"),
                value: this.state.searchValue,
                onChange: this.handleOCSearchChange,
                onClear: (evt) => this.handleOCSearchChange(evt, "")
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
              Pagination,
              {
                itemCount: itemCountOc,
                page: pageOc,
                perPage: perPageOc,
                onSetPage: this.handleSetPageOc,
                widgetId: "pagination-step-objectclass",
                onPerPageSelect: this.handlePerPageSelectOc,
                isCompact: true
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Table, { "aria-label": "Objectclasses Table", variant: "compact", children: [
            /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tr, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Th, { screenReaderText: "Selection column" }),
              columnsOc.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Th, { children: typeof column === "object" ? column.title : column }, columnIndex))
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Tbody, { children: pagedRowsOc.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tr, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
                Td,
                {
                  select: {
                    rowIndex,
                    onSelect: this.handleSelectOc,
                    isSelected: row.selected,
                    isDisabled: row.disableSelection
                  }
                }
              ),
              row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
                Td,
                {
                  dataLabel: columnsOc[cellIndex]?.title || columnsOc[cellIndex],
                  children: typeof cell === "object" ? cell.title : cell
                },
                `${rowIndex}_${cellIndex}`
              ))
            ] }, rowIndex)) })
          ] })
        ] })
      ] });
      const attributeStep = /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: "ds-container", children: [
          /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Text, { component: TextVariants.h3, children: _96("Select Attributes") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
            Dropdown2,
            {
              className: "ds-dropdown-padding",
              position: "left",
              onSelect: this.handleAttrDropDownSelect,
              toggle: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
                BadgeToggle,
                {
                  id: "toggle-attr-select",
                  badgeProps: {
                    className: selectedAttributes.length > 0 ? "ds-badge-bgcolor" : void 0,
                    isRead: selectedAttributes.length === 0
                  },
                  onToggle: (_event, isOpen) => this.handleAttrDropDownToggle(isOpen),
                  children: selectedAttributes.length > 0 ? `${selectedAttributes.length} ${_96("selected")}` : `0 ${_96("selected")}`
                }
              ),
              isOpen: isAttrDropDownOpen,
              dropdownItems: selectedAttributes.map(
                (attr) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(DropdownItem2, { children: attr[0] }, attr[0])
              )
            }
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
            SearchInput,
            {
              className: "ds-font-size-md",
              placeholder: _96("Search Attributes"),
              value: this.state.searchAttrValue,
              onChange: this.handleAttrSearchChange,
              onClear: (evt) => this.handleAttrSearchChange(evt, "")
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
            Pagination,
            {
              itemCount: itemCountAttr,
              page: pageAttr,
              perPage: perPageAttr,
              onSetPage: this.handleSetPageAttr,
              widgetId: "pagination-step-attributes",
              onPerPageSelect: this.handlePerPageSelectAttr,
              isCompact: true
            }
          ) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Table, { "aria-label": "Attributes Table", variant: "compact", children: [
          /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tr, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Th, { screenReaderText: "Selection column" }),
            columnsAttr.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Th, { children: typeof column === "object" ? column.title : column }, columnIndex))
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Tbody, { children: pagedRowsAttr.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tr, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
              Td,
              {
                select: {
                  rowIndex,
                  onSelect: this.handleSelectAttr,
                  isSelected: row.selected,
                  isDisabled: row.disableCheckbox
                }
              }
            ),
            row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
              Td,
              {
                dataLabel: columnsAttr[cellIndex]?.title || columnsAttr[cellIndex],
                children: typeof cell === "object" ? cell.title : cell
              },
              `${rowIndex}_${cellIndex}`
            ))
          ] }, rowIndex)) })
        ] })
      ] });
      const myTitle = _96("DN ( Distinguished Name )");
      const entryValuesStep = /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
          Alert,
          {
            variant: namingAttr === "" || namingVal === "" ? "warning" : "success",
            isInline: true,
            title: myTitle,
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("b", { children: [
                _96("Entry DN:"),
                "\xA0\xA0\xA0"
              ] }),
              namingAttr || "??????",
              "=",
              namingVal || "??????",
              ",",
              this.props.wizardEntryDn
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TextContent, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Text, { component: TextVariants.h3, children: _96("Set Attribute Values") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
          editableTable_default,
          {
            wizardEntryDn: this.props.wizardEntryDn,
            editableTableData,
            isAttributeSingleValued: this.isAttributeSingleValued,
            isAttributeRequired: this.isAttributeRequired,
            enableNextStep: this.enableNextStep,
            saveCurrentRows: this.saveCurrentRows,
            allObjectclasses: this.props.allObjectclasses,
            namingRowID: this.state.namingRowID,
            namingAttr: this.state.namingAttr,
            setNamingRowID: this.setNamingRowID
          },
          editableTableData
        )
      ] });
      const ldifListItems = cleanLdifArray.map(
        (line, index) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(SimpleListItem, { isActive: line.startsWith("dn: "), children: line }, index)
      );
      const ldifStatementsStep = /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "ds-addons-bottom-margin", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
          Alert,
          {
            variant: "info",
            isInline: true,
            title: _96("LDIF Statements")
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(CardBody, { children: ldifListItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(SimpleList, { "aria-label": "LDIF data User", children: ldifListItems }) }) })
      ] });
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const entryReviewStep = /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "ds-addons-bottom-margin", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
          Alert,
          {
            variant: resultVariant,
            isInline: true,
            title: _96("Result for Entry Modification"),
            children: [
              commandOutput,
              this.state.adding && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { children: [
                /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Spinner, { className: "ds-left-margin", size: "md" }),
                "\xA0\xA0",
                _96("Adding entry ...")
              ] })
            ]
          }
        ) }),
        resultVariant === "danger" && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Card, { isSelectable: true, children: [
          /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(CardTitle, { children: _96("LDIF Data") }),
          /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(CardBody, { children: ldifLines.map((line) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("h6", { children: line.data }, line.id)) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
          Modal,
          {
            variant: ModalVariant.small,
            title: _96("Create CoS Template"),
            isOpen: this.state.isConfirmModalOpen,
            onClose: this.handleConfirmModalToggle,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Button, { variant: "primary", onClick: this.handleCreateTemplateEnd, children: _96("Create Template") }, "confirm"),
              /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Button, { variant: "link", onClick: this.handleConfirmModalToggle, children: _96("Cancel") }, "cancel")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(TextContent, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Text, { children: cockpit_default.format(_96("You've chosen 'Classic' CoS type. cosTemplateDN attribute is set to $0."), this.props.wizardEntryDn) }),
              /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Text, { children: _96("Do you want to create a CoS template now?") }),
              /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Text, { children: cockpit_default.format(_96("It will be added as a child to this entry: $0"), this.props.wizardEntryDn) })
            ] }) }) })
          }
        )
      ] });
      let finishButtonName;
      if (this.props.cosDefCreateMoreTemplate) {
        finishButtonName = _96("Create More Templates");
      } else if (this.props.definitionWizardEntryDn !== "") {
        finishButtonName = _96("Back to CoS Definition");
      } else {
        finishButtonName = _96("Finish");
      }
      const addEntrySteps = [
        ...this.props.definitionWizardEntryDn !== "" || this.props.cosDefCreateMoreTemplate ? [] : [
          {
            id: 1,
            name: this.props.firstStep[0].name,
            component: this.props.firstStep[0].component,
            canJumpTo: stepIdReached >= 1 && stepIdReached < 8,
            hideBackButton: true
          }
        ],
        {
          id: 2,
          name: _96("Select Name & Priority"),
          component: namingValAndPriority,
          enableNext: namingVal !== "",
          canJumpTo: stepIdReached >= 2 && stepIdReached < 8
        },
        {
          id: 3,
          name: _96("Select ObjectClasses"),
          component: objectClassStep,
          canJumpTo: stepIdReached >= 3 && stepIdReached < 8,
          enableNext: selectedObjectClasses.length > 1
        },
        {
          id: 4,
          name: _96("Select Attributes"),
          component: attributeStep,
          canJumpTo: stepIdReached >= 4 && stepIdReached < 8,
          enableNext: selectedAttributes.length > 0
        },
        {
          id: 5,
          name: _96("Edit Values"),
          component: entryValuesStep,
          canJumpTo: stepIdReached >= 5 && stepIdReached < 8,
          enableNext: validMods
        },
        {
          id: 6,
          name: _96("LDIF Statements"),
          component: ldifStatementsStep,
          nextButtonText: _96("Create Entry"),
          canJumpTo: stepIdReached >= 6 && stepIdReached < 8
        },
        {
          id: 7,
          name: _96("Review Result"),
          component: entryReviewStep,
          nextButtonText: finishButtonName,
          canJumpTo: stepIdReached >= 7 && stepIdReached < 8,
          hideBackButton: this.state.resultVariant === "success" ? true : false,
          enableNext: !this.state.adding
        },
        ...this.props.definitionWizardEntryDn !== "" || this.props.cosDefCreateMoreTemplate ? [
          {
            id: 8,
            name: this.props.cosDefCreateMoreTemplate ? _96("Create More Templates") : _96("Back to CoS Definition"),
            component: entryReviewStep,
            nextButtonText: _96("Finish"),
            canJumpTo: stepIdReached >= 7 && stepIdReached < 8,
            hideBackButton: this.state.resultVariant === "success" ? true : false
          }
        ] : []
      ];
      const title = /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
        _96("Parent DN:"),
        " \xA0\xA0",
        /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("strong", { children: this.props.wizardEntryDn })
      ] });
      return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.handleToggleOpenWizard,
          steps: addEntrySteps,
          title: _96("Add CoS Template"),
          description: title,
          onNext: this.handleNext
        }
      );
    }
  };
  var addCosTemplate_default = AddCosTemplate;

  // src/lib/ldap_editor/wizards/operations/addCosDefinition.jsx
  var import_jsx_runtime97 = __toESM(require_jsx_runtime(), 1);
  var _97 = cockpit_default.gettext;
  var AddCosDefinition = class extends import_react167.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "onSetpageAddCoS", (_event, pageNumber) => {
        this.setState({
          pageAddCoS: pageNumber,
          pagedRowsCoS: this.getAttributesToShow(pageNumber, this.state.perpageAddCoS)
        });
      });
      __publicField(this, "onPerPageSelectAddCoS", (_event, perPage) => {
        this.setState({
          pageAddCoS: 1,
          perpageAddCoS: perPage,
          pagedRowsCoS: this.getAttributesToShow(1, perPage)
        });
      });
      __publicField(this, "isAttributeSingleValued", (attr) => {
        return this.singleValuedAttributes.includes(attr);
      });
      __publicField(this, "isAttributeRequired", (attr) => {
        return this.requiredAttributes.includes(attr);
      });
      __publicField(this, "onSelect", (event, isSelected, rowId) => {
        let rows;
        let selectedAttributes;
        if (rowId === -1) {
          rows = this.state.rowsCoS.map((oneRow) => {
            oneRow.selected = isSelected;
            oneRow.isAttributeSelected = isSelected;
            return oneRow;
          });
          rows[0].selected = true;
          rows[0].isAttributeSelected = true;
          selectedAttributes = ["cn"];
          if (this.state.cosType === "pointer") {
            selectedAttributes.push("cosPointerDefinition");
            rows[1].selected = true;
            rows[1].isAttributeSelected = true;
          } else if (this.state.cosType === "indirect") {
            selectedAttributes.push("cosIndirectDefinition");
            rows[1].selected = true;
            rows[1].isAttributeSelected = true;
          } else if (this.state.cosType === "classic") {
            selectedAttributes.push("cosClassicDefinition");
            rows[1].selected = true;
            rows[1].isAttributeSelected = true;
          }
          this.setState(
            {
              rowsCoS: rows,
              allAttributesSelected: isSelected,
              selectedAttributes
            },
            () => {
              this.setState({
                pagedRowsCoS: this.getAttributesToShow(this.state.pageAddCoS, this.state.perpageAddCoS)
              });
              this.updateValuesTableRows();
            }
          );
        } else {
          if (this.state.pagedRowsCoS[rowId].disableCheckbox === true) {
            return;
          }
          rows = [...this.state.pagedRowsCoS];
          rows[rowId].selected = isSelected;
          const attrName = this.state.pagedRowsCoS[rowId].cells[0];
          const allItems = [...this.state.rowsCoS];
          const index = allItems.findIndex((item) => item.cells[0] === attrName);
          allItems[index].isAttributeSelected = isSelected;
          const selectedAttributes2 = allItems.filter((item) => item.isAttributeSelected).map((selectedAttr) => selectedAttr.cells[0]);
          this.setState({
            rowsCoS: allItems,
            pagedRowsCoS: rows,
            selectedAttributes: selectedAttributes2
          }, () => this.updateValuesTableRows());
        }
      });
      __publicField(this, "updateValuesTableRows", (skipAttributeSelection) => {
        const newSelectedAttrs = ["cn"];
        let namingRowID = this.state.namingRowID;
        let namingAttrVal = this.state.namingAttrVal;
        let editableTableData = [];
        let namingAttr = this.state.namingAttr;
        let namingVal = this.state.namingVal;
        const cosAttrs = this.state.cosAttrs;
        if (this.state.savedRows.length === 0) {
          editableTableData = newSelectedAttrs.map((attrName) => {
            const obj = {
              id: generateUniqueId(),
              attr: attrName,
              val: namingVal || "",
              required: false,
              namingAttr: false
            };
            return obj;
          });
          editableTableData.sort((a2, b) => a2.attr > b.attr ? 1 : -1);
          namingRowID = editableTableData[0].id;
          namingAttrVal = editableTableData[0].attr + "=" + editableTableData[0].val;
          namingAttr = editableTableData[0].attr;
          namingVal = editableTableData[0].val;
        } else {
          if (skipAttributeSelection) {
            editableTableData = [...this.state.savedRows];
          } else {
            const arrayOfAttrObjects = [...this.state.savedRows];
            for (const myAttr of newSelectedAttrs) {
              const found = arrayOfAttrObjects.find((el) => el.attr === myAttr);
              if (found === void 0) {
                arrayOfAttrObjects.push({
                  id: generateUniqueId(),
                  attr: myAttr,
                  val: "",
                  required: false,
                  namingAttr: false
                });
              }
            }
            editableTableData = arrayOfAttrObjects.filter((datum) => {
              const attrName = datum.attr;
              const found = newSelectedAttrs.find((attr) => attr === attrName);
              return found !== void 0;
            });
            editableTableData.sort((a2, b) => a2.attr > b.attr ? 1 : -1);
            if (this.state.namingRowID === -1) {
              namingRowID = editableTableData[0].id;
            }
          }
        }
        if (this.state.cosDescription !== "") {
          const decs = this.state.cosDescription;
          editableTableData = editableTableData.filter((item) => item.attr.toLowerCase() !== "description" || item.val !== decs);
          editableTableData.push({
            id: generateUniqueId(),
            attr: "description",
            val: decs || "",
            required: true,
            namingAttr: false
          });
        }
        if (cosAttrs.length > 0) {
          for (const i in cosAttrs) {
            const found = editableTableData.find((el) => el.attr.toLowerCase() === "cosattribute" && el.val.toLowerCase() === cosAttrs[i].name.toLowerCase());
            const attrVal = cosAttrs[i].name + (cosAttrs[i].def ? " default" : "") + (cosAttrs[i].override ? " override" : "") + (cosAttrs[i].operational ? " operational" : "") + (cosAttrs[i].opdefault ? " operational-default" : "") + (cosAttrs[i].mergeschemes ? " merge-schemes" : "");
            if (found === void 0) {
              editableTableData.push({
                id: generateUniqueId(),
                attr: "cosattribute",
                val: attrVal,
                required: true,
                namingAttr: false
              });
            }
          }
        }
        if (this.state.cosType === "pointer") {
          const dn_val = this.state.cosTemplateDNSelected;
          editableTableData = editableTableData.filter((item) => item.attr.toLowerCase() !== "costemplatedn" || item.val !== dn_val);
          editableTableData.push({
            id: generateUniqueId(),
            attr: "cosTemplateDn",
            val: dn_val || "",
            required: false,
            namingAttr: false
          });
        }
        let spec_attr;
        if (this.state.cosType !== "pointer") {
          if (this.state.cosType === "indirect") {
            spec_attr = "cosindirectspecifier";
          } else {
            spec_attr = "cosspecifier";
          }
          const spec_val = this.state.cosspecAttr;
          editableTableData = editableTableData.filter((item) => item.attr.toLowerCase() !== spec_attr || item.val !== spec_val);
          editableTableData.push({
            id: generateUniqueId(),
            attr: spec_attr,
            val: spec_val || "",
            required: true,
            namingAttr: false
          });
        }
        this.setState({
          savedRows: editableTableData
        });
        this.setState({
          editableTableData,
          rdn: editableTableData[0].attr,
          namingRowID,
          namingAttrVal,
          namingAttr,
          namingVal
        }, () => {
          this.generateLdifData();
        });
      });
      __publicField(this, "enableNextStep", (noEmptyValue) => {
        this.setState({ noEmptyValue });
      });
      __publicField(this, "setNamingRowID", (namingRowID) => {
        let namingAttrVal = "";
        let namingAttr = "";
        let namingVal = "";
        let rows = this.state.savedRows;
        if (rows.length === 0) {
          rows = this.state.editableTableData;
        }
        for (const row of rows) {
          if (row.id === namingRowID) {
            namingAttrVal = row.attr + "=" + row.val;
            namingAttr = row.attr;
            namingVal = row.val;
            break;
          }
        }
        const dn_val = `${namingAttr}=${namingVal},${this.props.wizardEntryDn}`;
        rows = rows.filter((item) => item.attr.toLowerCase() === "costemplatedn");
        rows.push({
          id: generateUniqueId(),
          attr: "cosTemplateDn",
          val: dn_val,
          required: true,
          namingAttr: false
        });
        this.setState({
          namingRowID,
          namingAttrVal,
          namingAttr,
          namingVal,
          editableTableData: rows
        });
      });
      __publicField(this, "handleAttrDropDownToggle", (isOpen) => {
        this.setState({
          isAttrDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleAttrDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isAttrDropDownOpen: !prevState.isAttrDropDownOpen };
        });
      });
      __publicField(this, "buildAttrDropdown", () => {
        const { isAttrDropDownOpen, selectedAttributes } = this.state;
        const numSelected = selectedAttributes.length;
        const items = selectedAttributes.map(
          (attr) => /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(DropdownItem2, { children: attr }, attr)
        );
        return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
          Dropdown2,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleAttrDropDownSelect,
            position: DropdownPosition.left,
            toggle: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(BadgeToggle, { id: "toggle-attr-select", onToggle: (_event, isOpen) => this.handleAttrDropDownToggle(isOpen), children: numSelected !== 0 ? /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(import_jsx_runtime97.Fragment, { children: [
              numSelected,
              " ",
              _97("selected"),
              " "
            ] }) : /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(import_jsx_runtime97.Fragment, { children: [
              "0 ",
              _97("selected"),
              " "
            ] }) }),
            isOpen: isAttrDropDownOpen,
            dropdownItems: items
          }
        );
      });
      __publicField(this, "saveCurrentRows", (savedRows, namingID) => {
        this.setState(
          { savedRows },
          () => {
            if (namingID !== -1) {
              this.setNamingRowID(namingID);
            }
          }
        );
      });
      __publicField(this, "generateLdifData", () => {
        const objectClassData = [
          "ObjectClass: top",
          "ObjectClass: LdapSubEntry",
          "ObjectClass: cosSuperDefinition"
        ];
        if (this.state.cosType === "pointer") {
          objectClassData.push("ObjectClass: cosPointerDefinition");
        } else if (this.state.cosType === "indirect") {
          objectClassData.push("ObjectClass: cosIndirectDefinition");
        } else if (this.state.cosType === "classic") {
          objectClassData.push("ObjectClass: cosClassicDefinition");
        }
        const valueData = [];
        for (const item of this.state.savedRows) {
          const attrName = item.attr;
          valueData.push(`${attrName}: ${item.val}`);
          if (objectClassData.length === 4) {
            continue;
          }
        }
        const ldifArray = [
          `dn: ${this.state.namingAttrVal},${this.props.wizardEntryDn}`,
          ...objectClassData,
          ...valueData
        ];
        this.setState({ ldifArray });
      });
      __publicField(this, "onSelectedAttrs", (attrs) => {
        this.setState({
          cosAttrs: attrs.map((attr) => {
            return {
              name: attr,
              def: false,
              override: false,
              operational: false,
              opdefault: false,
              mergeschemes: false
            };
          })
        });
      });
      this.cosAttrsColumns = [
        { title: _97("Name"), transforms: [sortable] },
        { title: _97("OID"), transforms: [sortable] }
      ];
      this.singleValuedAttributes = ["cosTemplateDn", "cosspecifier", "cosIndirectSpecifier"];
      this.requiredAttributes = ["cn", "cosattribute", "cosspecifier", "cosIndirectSpecifier"];
      this.attributeValidationRules = [
        {
          name: "required",
          validator: (value) => value.trim() !== "",
          errorText: _97("This field is required")
        }
      ];
      this.state = {
        alertVariant: "info",
        namingRowID: -1,
        namingAttrVal: "",
        namingAttr: "",
        namingVal: this.props.cosDefName,
        cosDescription: this.props.cosDefDesc,
        ldifArray: [],
        cleanLdifArray: [],
        savedRows: [],
        commandOutput: "",
        resultVariant: "default",
        allAttributesSelected: false,
        attributeList: [],
        stepIdReached: this.props.stepReached,
        cosAttrs: [],
        // currentStepId: 1,
        itemCountAddCoS: 0,
        cosattrAttr: "",
        cosspecAttr: "",
        pageAddCoS: 1,
        perpageAddCoS: 10,
        columnsCoS: [
          { title: _97("Attribute Name"), cellTransforms: [headerCol()] },
          { title: _97("From ObjectClass") }
        ],
        rowsCoS: [],
        pagedRowsCoS: [],
        selectedAttributes: ["cn"],
        isAttrDropDownOpen: false,
        cosAttrRows: [],
        tableModificationTime: 0,
        createTemplate: false,
        createTemplateEnd: false,
        createdDefiniton: "",
        // Values
        noEmptyValue: false,
        columnsValues: [
          "Attribute",
          "Value"
        ],
        // Review step
        reviewValue: "",
        reviewInvalidText: _97("Invalid LDIF"),
        reviewIsValid: true,
        reviewValidated: "default",
        adding: true,
        // reviewHelperText: 'LDIF data'
        editableTableData: [],
        rdn: "",
        rdnValue: "",
        parentDN: "",
        isTreeLoading: false,
        cosType: this.props.cosDefType,
        cosDNs: [],
        searching: false,
        searchPattern: "",
        showLDAPNavModal: false,
        showTemplateCreateModal: false,
        cosSearchBaseDn: "",
        cosParentBaseDn: "",
        cosAvailableOptions: [],
        cosTemplateDNSelected: this.props.createdTemplateDN,
        selectedItemProps: "",
        cossChosenOptions: [],
        isConfirmModalOpen: false
      };
      this.handleConfirmModalToggle = () => {
        this.setState(({ isConfirmModalOpen }) => ({
          isConfirmModalOpen: !isConfirmModalOpen
        }));
      };
      this.onBaseDnSelection = (treeViewItem) => {
        this.setState({
          cosSearchBaseDn: treeViewItem.dn
        });
      };
      this.onParentDnSelection = (treeViewItem) => {
        this.setState({
          cosParentBaseDn: treeViewItem.dn
        });
      };
      this.showTreeLoadingState = (isTreeLoading) => {
        this.setState({
          isTreeLoading,
          searching: !!isTreeLoading
        });
      };
      this.handleOpenLDAPNavModal = () => {
        this.setState({
          showLDAPNavModal: true
        });
      };
      this.handleCloseLDAPNavModal = () => {
        this.setState({
          showLDAPNavModal: false
        });
      };
      this.handleOpenTemplateCreateModal = () => {
        this.setState({
          showTemplateCreateModal: true
        });
      };
      this.handleCloseTemplateCreateModal = () => {
        this.setState({
          showTemplateCreateModal: false
        });
      };
      this.handleCreateTemplate = () => {
        this.setState({
          createTemplate: true
        });
      };
      this.handleCreateTemplateEnd = () => {
        this.setState({
          createTemplateEnd: true
        }, () => {
          this.props.onReload();
        });
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 7) {
          this.updateValuesTableRows();
        } else if (id === 8) {
          const myLdifArray = this.state.ldifArray;
          createLdapEntry(
            this.props.editorLdapServer,
            myLdifArray,
            (result) => {
              const myDn = myLdifArray[0].substring(4);
              this.setState({
                commandOutput: result.errorCode === 0 ? _97("CoS Definition successfully created!") : _97("Failed to create cos: ") + result.output,
                resultVariant: result.errorCode === 0 ? "success" : "danger",
                adding: false,
                createdDefiniton: myDn
              }, () => {
                this.props.onReload();
              });
              const relativeDn = myLdifArray[5].replace(": ", "=");
              const opInfo = {
                operationType: "ADD",
                resultCode: result.errorCode,
                time: Date.now(),
                entryDn: myDn,
                relativeDn
              };
              this.props.setWizardOperationInfo(opInfo);
            }
          );
        } else if (id === 9 && this.state.cosType === "classic" && this.state.resultVariant !== "danger") {
          this.setState({
            isConfirmModalOpen: true
          });
        }
      };
      this.handleBack = ({ id }) => {
        if (id === 5) {
          this.updateValuesTableRows(true);
        }
      };
      this.handleSearchClick = () => {
        this.setState({
          isSearchRunning: true,
          cosAvailableOptions: []
        }, () => {
          this.getEntries();
        });
      };
      this.handleSearchPattern = (searchPattern) => {
        this.setState({ searchPattern });
      };
      this.getEntries = () => {
        const baseDn = this.state.cosSearchBaseDn;
        const pattern = this.state.searchPattern;
        const filter = pattern === "" ? "(objectClass=costemplate)" : `(&(objectClass=costemplate)(cn=*${pattern}*))`;
        const attrs = "cn";
        const params = {
          serverId: this.props.editorLdapServer,
          baseDn,
          scope: "sub",
          filter,
          attributes: attrs
        };
        runGenericSearch(params, (resultArray) => {
          const newOptionsArray = resultArray.map((result) => {
            const lines = result.split("\n");
            const pos0 = lines[0].indexOf(":: ");
            let dnLine = lines[0];
            if (pos0 > 0) {
              const decoded = decodeLine(dnLine);
              dnLine = `${decoded[0]}: ${decoded[1]}`;
            }
            return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(SimpleListItem, { children: dnLine }, dnLine);
          });
          this.setState({
            cosAvailableOptions: newOptionsArray,
            isSearchRunning: false
          });
        });
      };
      this.removeDuplicates = (options5) => {
        const titles = options5.map((item) => item.props.title);
        const noDuplicates = options5.filter((item, index) => {
          return titles.indexOf(item.props.title) === index;
        });
        return noDuplicates;
      };
      this.handleRadioChange = (event, _113) => {
        this.setState({
          cosType: event.currentTarget.id
        });
      };
      this.handleSelectTemplate = (selectedItem, selectedItemProps) => {
        this.setState({ cosTemplateDNSelected: selectedItemProps.children.substring(4) });
      };
      this.handleChange = this.handleChange.bind(this);
    }
    componentDidMount() {
      if (this.state.cosAttrRows.length > 0) {
        return;
      }
      getAttributesNameAndOid(this.props.editorLdapServer, (resArray) => {
        const cosAttrRows = resArray.map((item) => {
          return { cells: [item[0], item[1]], selected: false };
        });
        const attributeList = resArray.map((item) => {
          return item[0];
        });
        const tableModificationTime = Date.now();
        this.setState({
          cosAttrRows,
          attributeList,
          tableModificationTime
        });
      });
      this.setState({
        parentDN: this.props.wizardEntryDn,
        SearchBaseDn: this.props.wizardEntryDn
      });
    }
    getAttributesToShow(page, perPage) {
      const start2 = (page - 1) * perPage;
      const end2 = page * perPage;
      const newRows = this.state.rowsCoS.slice(start2, end2);
      return newRows;
    }
    handleChange(e) {
      const attr = e.target.id;
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [attr]: value
      });
    }
    handleCheckboxChange(e, name2) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      const param = e.target.id;
      if (param === "def") {
        this.setState((prevState) => ({
          cosAttrs: prevState.cosAttrs.map((el) => el.name === name2 ? { ...el, def: value } : el)
        }));
      } else if (param === "override") {
        this.setState((prevState) => ({
          cosAttrs: prevState.cosAttrs.map((el) => el.name === name2 ? { ...el, override: value } : el)
        }));
      } else if (param === "operational") {
        this.setState((prevState) => ({
          cosAttrs: prevState.cosAttrs.map((el) => el.name === name2 ? { ...el, operational: value } : el)
        }));
      } else if (param === "opdefault") {
        this.setState((prevState) => ({
          cosAttrs: prevState.cosAttrs.map((el) => el.name === name2 ? { ...el, opdefault: value } : el)
        }));
      } else if (param === "mergeschemes") {
        this.setState((prevState) => ({
          cosAttrs: prevState.cosAttrs.map((el) => el.name === name2 ? { ...el, mergeschemes: value } : el)
        }));
      }
    }
    onToggleWizard() {
      this.props.handleToggleWizard();
    }
    render() {
      const {
        cosDescription,
        ldifArray,
        resultVariant,
        cosAttrRows,
        stepIdReached,
        namingVal,
        cosSearchBaseDn,
        cosAvailableOptions,
        tableModificationTime,
        showLDAPNavModal,
        commandOutput,
        cosType,
        createTemplate,
        showTemplateCreateModal,
        cosTemplateDNSelected,
        createTemplateEnd,
        cosAttrs
      } = this.state;
      if (createTemplate) {
        return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
          addCosTemplate_default,
          {
            isWizardOpen: this.props.isWizardOpen,
            handleToggleWizard: this.onToggleWizard,
            wizardEntryDn: this.state.cosParentBaseDn,
            editorLdapServer: this.props.editorLdapServer,
            setWizardOperationInfo: this.props.setWizardOperationInfo,
            onReload: this.props.onReload,
            allObjectclasses: this.props.allObjectclasses,
            treeViewRootSuffixes: this.props.treeViewRootSuffixes,
            firstStep: this.props.firstStep,
            stepReached: 2,
            definitionWizardEntryDn: this.props.wizardEntryDn,
            cosDefName: this.state.namingVal,
            cosDefDesc: this.state.cosDescription,
            cosDefType: this.state.cosType
          }
        );
      } else if (createTemplateEnd) {
        return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
          addCosTemplate_default,
          {
            isWizardOpen: this.props.isWizardOpen,
            handleToggleWizard: this.onToggleWizard,
            wizardEntryDn: this.state.createdDefiniton,
            editorLdapServer: this.props.editorLdapServer,
            setWizardOperationInfo: this.props.setWizardOperationInfo,
            onReload: this.props.onReload,
            allObjectclasses: this.props.allObjectclasses,
            treeViewRootSuffixes: this.props.treeViewRootSuffixes,
            firstStep: this.props.firstStep,
            stepReached: 2,
            definitionWizardEntryDn: "",
            cosDefCreateMoreTemplate: true
          }
        );
      }
      const namingValAndTypeStep = /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text, { component: TextVariants.h3, children: _97("Select Name And CoS Type") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Form, { autoComplete: "off", children: [
          /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Grid, { className: "ds-margin-top-xlg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 2, className: "ds-label", children: _97("CoS Name") }),
            /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
              TextInput,
              {
                value: namingVal,
                type: "text",
                id: "namingVal",
                "aria-describedby": "namingVal",
                name: "namingVal",
                onChange: (e, str) => {
                  this.handleChange(e);
                },
                validated: this.state.namingVal === "" ? ValidatedOptions.error : ValidatedOptions.default
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 2, className: "ds-label ds-margin-top-xlg", children: _97("Description") }),
            /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 10, className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
              TextInput,
              {
                value: cosDescription,
                type: "text",
                id: "cosDescription",
                "aria-describedby": "cosDescription",
                name: "cosDescription",
                onChange: (e, str) => {
                  this.handleChange(e);
                }
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TextContent, { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text, { component: TextVariants.h5, children: _97("Choose CoS Type") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "ds-left-margin", children: [
            /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
              Radio,
              {
                name: "cosType",
                id: "pointer",
                value: "pointer",
                label: _97("Pointer"),
                isChecked: this.state.cosType === "pointer",
                onChange: (event, str) => this.handleRadioChange(event, str),
                description: _97("Identifies the template entry using the template DN only.")
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
              Radio,
              {
                name: "cosType",
                id: "indirect",
                value: "indirect",
                label: _97("Indirect"),
                isChecked: this.state.cosType === "indirect",
                onChange: (event, str) => this.handleRadioChange(event, str),
                description: _97("Identifies the template entry using the value of one of the target entry's attributes."),
                className: "ds-margin-top"
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
              Radio,
              {
                name: "cosType",
                id: "classic",
                value: "classic",
                label: _97("Classic"),
                isChecked: this.state.cosType === "classic",
                onChange: (event, str) => this.handleRadioChange(event, str),
                description: _97("Identifies the template entry using a combination of the template entry's base DN and the value of one of the target entry's attributes."),
                className: "ds-margin-top"
              }
            )
          ] })
        ] })
      ] });
      const selectCoSTemplate = /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_jsx_runtime97.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Form, { autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Grid, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text, { component: TextVariants.h3, children: _97("Select CoS Template") }) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TextContent, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text, { children: _97("The CoS template entry contains the value or values of the attributes generated by the CoS logic. The CoS template entry contains a general object class of cosTemplate The CoS template entries for a given CoS are stored in the directory tree along with the CoS definition.") }) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 9, className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Text, { children: [
          _97("Search Base:"),
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
            Text,
            {
              className: "ds-left-margin",
              component: TextVariants.a,
              onClick: this.handleOpenLDAPNavModal,
              href: "#",
              children: cosSearchBaseDn
            }
          )
        ] }) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 3, className: "ds-margin-top-xlg ds-right-align", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
          Button,
          {
            variant: "primary",
            onClick: this.handleOpenTemplateCreateModal,
            children: _97("Create Template")
          },
          "createTemplate"
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 12, className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
          SearchInput,
          {
            placeholder: _97("Find CoS Template..."),
            value: this.state.searchPattern,
            onChange: (evt, val) => this.handleSearchPattern(val),
            onSearch: this.handleSearchClick,
            onClear: (evt, val) => {
              this.handleSearchPattern("");
            }
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(GridItem, { span: 12, className: "ds-margin-top", children: [
          _97("CoS Template Selected:"),
          " ",
          /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("strong", { children: [
            "\xA0\xA0",
            cosTemplateDNSelected
          ] })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 12, className: "ds-margin-top-xlg", children: cosAvailableOptions.length !== 0 ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(SimpleList, { onSelect: this.handleSelectTemplate, children: cosAvailableOptions }) : "" }),
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: _97("Choose The New CoS Template Parent DN"),
            isOpen: showTemplateCreateModal,
            onClose: this.handleCloseTemplateCreateModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleConfirmModalToggle,
                  isDisabled: this.state.cosParentBaseDn === "",
                  children: _97("Confirm")
                },
                "createTemplateModal"
              ),
              /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleCloseTemplateCreateModal,
                  children: _97("Close")
                },
                "cancelCreateTemplateModal"
              )
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Card, { className: "ds-indent ds-margin-bottom-md", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
              ldapNavigator_default,
              {
                treeItems: [...this.props.treeViewRootSuffixes],
                editorLdapServer: this.props.editorLdapServer,
                handleNodeOnClick: this.onParentDnSelection,
                showTreeLoadingState: this.showTreeLoadingState,
                addNotification: this.props.addNotification
              }
            ) }) })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
          Modal,
          {
            variant: ModalVariant.small,
            title: _97("Leaving CoS Definition Creation Wizard"),
            isOpen: this.state.isConfirmModalOpen,
            onClose: this.handleConfirmModalToggle,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Button, { variant: "primary", onClick: this.handleCreateTemplate, children: _97("Confirm") }, "confirm"),
              /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Button, { variant: "link", onClick: this.handleConfirmModalToggle, children: _97("Cancel") }, "cancel")
            ],
            children: _97("You are about to leave CoS Definition creation wizard. After you click 'Confirm', you'll appear in CoS Template creation wizard and you won't able to return from there until the process is finished. Then you'll be able to use the created entry in the CoS definition creation. It'll be preselected for you automatically.")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: _97("Choose A Parent DN"),
            isOpen: showLDAPNavModal,
            onClose: this.handleCloseLDAPNavModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleCloseLDAPNavModal,
                  children: _97("Done")
                },
                "confirm"
              )
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Card, { className: "ds-indent ds-margin-bottom-md", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
              ldapNavigator_default,
              {
                treeItems: [...this.props.treeViewRootSuffixes],
                editorLdapServer: this.props.editorLdapServer,
                skipLeafEntries: true,
                handleNodeOnClick: this.onBaseDnSelection,
                showTreeLoadingState: this.showTreeLoadingState,
                addNotification: this.props.addNotification
              }
            ) }) })
          }
        )
      ] }) }) });
      const cosAttributesStep = /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(import_jsx_runtime97.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Text, { component: TextVariants.h3, children: [
          _97("Choose CoS Attributes"),
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
            Tooltip,
            {
              position: "bottom",
              content: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { children: _97("The cosAttribute contains the name of the attribute for which to generate a value for the CoS. There can be more than one cosAttribute value specified.") }),
              children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("a", { className: "ds-font-size-md", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(InfoCircleIcon, { className: "ds-info-icon" }) })
            }
          )
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
          genericPagination_default,
          {
            columns: this.cosAttrsColumns,
            rows: cosAttrRows,
            actions: null,
            isSelectable: true,
            canSelectAll: false,
            enableSorting: true,
            tableModificationTime,
            handleSelectedAttrs: this.onSelectedAttrs,
            isSearchable: true
          }
        ),
        cosAttrRows.length === 0 && // <div className="ds-margin-bottom-md" />
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Bullseye, { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("center", { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Spinner, { size: "lg" }) }) })
      ] });
      const cosConfigAttributesStep = /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(import_jsx_runtime97.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text, { component: TextVariants.h3, children: _97("Configure CoS Attributes") }) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(TextContent, { className: "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text, { children: _97("The CoS attribute contains the name of another attribute which is governed by the class of service. This attribute allows an override qualifier after the attribute value which sets how the CoS handles existing attribute values on entries when it generates attribute values.") }),
            /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text, { children: _97("Please, consult official documentation for more information.") }),
            /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text, { children: _97("If no qualifier is set, default is assumed.") })
          ] }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text, { component: TextVariants.h4, children: _97("Attribute Name") }) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text, { component: TextVariants.h4, children: _97("Override Qualifiers") }) }) })
        ] }, "header"),
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("hr", {}),
        cosAttrs.map(({ name: name2, def, override, operational, opdefault, mergeschemes }, idx) => /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { className: "ds-label", span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text, { component: TextVariants.h4, children: name2 }) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 3, title: _97("Only returns a generated value if there is no corresponding attribute value stored with the entry."), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
            Checkbox,
            {
              id: "def",
              label: _97("Default"),
              isChecked: def,
              onChange: (e, checked) => {
                this.handleCheckboxChange(e, name2, "def");
              }
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 3, title: _97("Always returns the value generated by the CoS, even when there is a value stored with the entry."), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
            Checkbox,
            {
              id: "override",
              label: _97("Override"),
              isChecked: override,
              onChange: (e, checked) => {
                this.handleCheckboxChange(e, name2, "override");
              }
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 3, title: _97("Returns a generated attribute only if it is explicitly requested in the search. Operational attributes do not need to pass a schema check in order to be returned. When operational is used, it also overrides any existing attribute values."), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
            Checkbox,
            {
              id: "operational",
              label: _97("Operational"),
              isChecked: operational,
              onChange: (e, checked) => {
                this.handleCheckboxChange(e, name2, "operational");
              }
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 3 }),
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 3, title: _97("Only returns a generated value if there is no corresponding attribute value stored with the entry and if it is explicitly requested in the search."), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
            Checkbox,
            {
              id: "opdefault",
              label: _97("Operational-Default"),
              isChecked: opdefault,
              onChange: (e, checked) => {
                this.handleCheckboxChange(e, name2, "opdefault");
              }
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 6, title: _97("Using the merge-schemes qualifier tells the CoS that it will, or can, generate multiple values for the managed attribute."), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
            Checkbox,
            {
              id: "mergeschemes",
              label: _97("Merge-Schemes"),
              isChecked: mergeschemes,
              onChange: (e, checked) => {
                this.handleCheckboxChange(e, name2, "mergeschemes");
              }
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("hr", {})
        ] }, idx))
      ] });
      const cosSpecifierStep = /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(import_jsx_runtime97.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text, { component: TextVariants.h3, children: _97("Select CoS Specifier") }) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TextContent, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text, { children: this.state.cosType === "indirect" ? _97("Indirect type of CoS identifies the template entry based on the value of one of the target entry's attributes, as specified in the cosIndirectSpecifier attribute.") : _97("Classic type of CoS identifies the template entry using both the template entry's DN (which you will assign later) and the value of one of the target entry's attributes (set in the cosSpecifier attribute).") }) }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 3, className: "ds-label", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Text, { component: TextVariants.h4, children: [
            this.state.cosType === "indirect" ? "Indirect " : "Classic ",
            "Specifier"
          ] }) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 5, className: "ds-left-margin", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(FormSelect, { id: "cosspecAttr", value: this.state.cosspecAttr, onChange: (e, str) => {
            this.handleChange(e);
          }, "aria-label": "FormSelect Input", children: [
            /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(FormSelectOption, { value: "", label: _97("Select an attribute"), isPlaceholder: true }),
            this.state.attributeList.map((attr, index) => /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(FormSelectOption, { value: attr, label: attr }, attr))
          ] }) })
        ] })
      ] });
      const ldifListItems = ldifArray.map(
        (line, index) => /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(SimpleListItem, { isActive: line.startsWith("dn: "), children: line }, index)
      );
      const cosCreationStep = /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
          Alert,
          {
            variant: "info",
            isInline: true,
            title: _97("LDIF Content for CoS Creation")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Card, { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(CardBody, { children: ldifListItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(SimpleList, { "aria-label": "LDIF data User", children: ldifListItems }) }) })
      ] });
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const cosReviewStep = /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
          Alert,
          {
            variant: resultVariant,
            isInline: true,
            title: _97("Result for CoS Creation"),
            children: [
              commandOutput,
              this.state.adding && /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { children: [
                /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Spinner, { className: "ds-left-margin", size: "md" }),
                "\xA0\xA0",
                _97("Adding CoS definition ...")
              ] })
            ]
          }
        ),
        resultVariant === "danger" && /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Card, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(CardTitle, { children: _97("LDIF Data") }),
          /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(CardBody, { children: ldifLines.map((line) => /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("h6", { children: line.data }, line.id)) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
          Modal,
          {
            variant: ModalVariant.small,
            title: _97("Create CoS Template"),
            isOpen: this.state.isConfirmModalOpen,
            onClose: this.handleConfirmModalToggle,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Button, { variant: "primary", onClick: this.handleCreateTemplateEnd, children: _97("Confirm") }, "confirm"),
              /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Button, { variant: "link", onClick: this.handleConfirmModalToggle, children: _97("Cancel") }, "cancel")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(TextContent, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text, { children: cockpit_default.format(_97("You've chosen 'Classic' CoS type. cosTemplateDN attribute is set to $0."), this.state.createdDefiniton) }),
              /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text, { children: _97("Do you want to create a CoS template now?") }),
              /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text, { children: 'cockpit.format(_("It will be added as a child to this entry: $0"), this.state.createdDefiniton)' })
            ] }) }) })
          }
        )
      ] });
      const addCoSSteps = [
        {
          id: 1,
          name: this.props.firstStep[0].name,
          component: this.props.firstStep[0].component,
          canJumpTo: stepIdReached >= 1 && stepIdReached < 9,
          hideBackButton: true
        },
        {
          id: 2,
          name: _97("Select Type"),
          component: namingValAndTypeStep,
          enableNext: namingVal !== "",
          canJumpTo: stepIdReached >= 2 && stepIdReached < 9
        },
        ...cosType === "pointer" ? [
          {
            id: 3,
            name: _97("Select CoS Template"),
            component: selectCoSTemplate,
            canJumpTo: stepIdReached >= 3 && stepIdReached < 9,
            enableNext: this.state.cosTemplateDNSelected !== ""
          }
        ] : [],
        {
          id: 4,
          name: _97("Select CoS Attributes"),
          component: cosAttributesStep,
          canJumpTo: stepIdReached >= 4 && stepIdReached < 9,
          enableNext: this.state.cosAttrs.length > 0
        },
        {
          id: 5,
          name: _97("Configure CoS Attributes"),
          component: cosConfigAttributesStep,
          canJumpTo: stepIdReached >= 5 && stepIdReached < 9,
          enableNext: this.state.cosAttrs.length > 0
        },
        ...cosType !== "pointer" ? [
          {
            id: 6,
            name: _97("Select CoS Specifier"),
            component: cosSpecifierStep,
            canJumpTo: stepIdReached >= 6 && stepIdReached < 9,
            enableNext: this.state.cosspecAttr !== ""
          }
        ] : [],
        {
          id: 7,
          name: _97("Create CoS"),
          component: cosCreationStep,
          nextButtonText: _97("Create"),
          canJumpTo: stepIdReached >= 7 && stepIdReached < 9
        },
        {
          id: 8,
          name: _97("Review Result"),
          component: cosReviewStep,
          nextButtonText: _97("Finish"),
          canJumpTo: stepIdReached >= 8 && stepIdReached < 9,
          hideBackButton: this.state.resultVariant === "success" ? true : false,
          enableNext: !this.state.adding
        },
        ...this.state.cosType === "classic" && resultVariant !== "danger" ? [
          {
            id: 9,
            name: _97("Create Templates"),
            component: cosReviewStep,
            nextButtonText: _97("Finish"),
            canJumpTo: stepIdReached > 9,
            hideBackButton: this.state.resultVariant === "success" ? true : false,
            enableNext: !this.state.adding
          }
        ] : []
      ];
      const title = /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(import_jsx_runtime97.Fragment, { children: [
        _97("Parent DN:"),
        " \xA0\xA0",
        /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("strong", { children: this.props.wizardEntryDn })
      ] });
      return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.props.handleToggleWizard,
          onNext: this.handleNext,
          onBack: this.handleBack,
          title: _97("Add A CoS Definition"),
          description: title,
          steps: addCoSSteps
        }
      );
    }
  };
  var addCosDefinition_default = AddCosDefinition;

  // src/lib/ldap_editor/wizards/cos.jsx
  var import_jsx_runtime98 = __toESM(require_jsx_runtime(), 1);
  var _98 = cockpit_default.gettext;
  var CoSEntryWizard = class extends import_react168.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleOnChange", (event, _113) => {
        this.setState({ getStartedStepRadio: event.currentTarget.value });
      });
      __publicField(this, "createInitialLayout", () => {
        return [
          {
            id: 1,
            name: _98("Get Started"),
            component: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { children: [
              /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Grid, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Text, { component: TextVariants.h3, children: _98("Select CoS Type") }) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(TextContent, { className: "ds-margin-top", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Text, { children: _98("A class of service definition (CoS) shares attributes between entries in a way that is transparent to applications. CoS simplifies entry management and reduces storage requirements.") }),
                  /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Text, { children: _98("Clients of the Directory Server read the attributes in a user's entry. With CoS, some attribute values may not be stored within the entry itself. Instead, these attribute values are generated by class of service logic as the entry is sent to the client application.") })
                ] }) })
              ] }),
              /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
                Radio,
                {
                  className: "ds-margin-top-lg",
                  value: "CoSDefinition",
                  isChecked: this.state.getStartedStepRadio === "CoSDefinition",
                  onChange: (event, _113) => this.handleOnChange(event, _113),
                  label: _98("Create a new CoS Definition"),
                  description: _98("The CoS definition entry identifies the type of CoS used. The CoS definition entry is below the branch at which it is effective."),
                  name: "radio-new-step-start",
                  id: "radio-new-step-start-1"
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
                Radio,
                {
                  className: "ds-margin-top-lg",
                  value: "CoSTemplate",
                  isChecked: this.state.getStartedStepRadio === "CoSTemplate",
                  onChange: (event, _113) => this.handleOnChange(event, _113),
                  label: _98("Create a new CoS Template"),
                  description: _98("The CoS template entry contains a list of the shared attribute values. Changes to the template entry attribute values are automatically applied to all the entries within the scope of the CoS."),
                  name: "radio-new-step-start",
                  id: "radio-new-step-start-2"
                }
              )
            ] })
          }
        ];
      });
      this.state = {
        stepIdReached: 1,
        getStartedStepRadio: "CoSDefinition"
      };
    }
    render() {
      const {
        getStartedStepRadio
      } = this.state;
      const initialStep = this.createInitialLayout();
      const wizardProps = {
        isWizardOpen: this.props.isWizardOpen,
        handleToggleWizard: this.props.handleToggleWizard,
        wizardEntryDn: this.props.wizardEntryDn,
        editorLdapServer: this.props.editorLdapServer,
        setWizardOperationInfo: this.props.setWizardOperationInfo,
        firstStep: initialStep,
        onReload: this.props.onReload,
        addNotification: this.props.addNotification
      };
      if (getStartedStepRadio === "CoSDefinition") {
        return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
          addCosDefinition_default,
          {
            ...wizardProps,
            allObjectclasses: this.props.allObjectclasses,
            treeViewRootSuffixes: this.props.treeViewRootSuffixes,
            createdTemplateDN: "",
            stepReached: 1,
            cosDefName: "",
            cosDefDesc: "",
            cosDefType: "pointer"
          }
        );
      } else if (getStartedStepRadio === "CoSTemplate") {
        return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
          addCosTemplate_default,
          {
            ...wizardProps,
            allObjectclasses: this.props.allObjectclasses,
            treeViewRootSuffixes: this.props.treeViewRootSuffixes,
            definitionWizardEntryDn: "",
            stepReached: 1
          }
        );
      }
    }
  };
  var cos_default = CoSEntryWizard;

  // src/lib/ldap_editor/wizards/newEntry.jsx
  var import_react174 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/wizards/operations/addUser.jsx
  var import_react169 = __toESM(require_react(), 1);
  var import_jsx_runtime99 = __toESM(require_jsx_runtime(), 1);
  var _99 = cockpit_default.gettext;
  var AddUser = class extends import_react169.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleSetPageAddUser", (_event, pageNumber) => {
        this.setState({
          pageAddUser: pageNumber,
          pagedRowsUser: this.getAttributesToShow(pageNumber, this.state.perPageAddUser)
        });
      });
      __publicField(this, "handlePerPageSelectAddUser", (_event, perPage) => {
        this.setState({
          pageAddUser: 1,
          perPageAddUser: perPage,
          pagedRowsUser: this.getAttributesToShow(1, perPage)
        });
      });
      __publicField(this, "isAttributeSingleValued", (attr) => {
        return this.singleValuedAttrs[this.state.accountType].includes(attr);
      });
      __publicField(this, "isAttributeRequired", (attr) => {
        return this.requiredAttrs[this.state.accountType].includes(attr);
      });
      __publicField(this, "handleSelect", (event, isSelected, rowId) => {
        if (this.state.pagedRowsUser[rowId].disableCheckbox === true) {
          return;
        }
        const rows = [...this.state.pagedRowsUser];
        rows[rowId].selected = isSelected;
        const attrName = rows[rowId].cells[0];
        const allItems = [...this.state.rowsUser];
        const allAttrs = this.state.rowsOrig;
        const index = allItems.findIndex((item) => item.cells[0] === attrName);
        allItems[index].isAttributeSelected = isSelected;
        const selectedAttributes = allAttrs.filter((item) => item.isAttributeSelected).map((selectedAttr) => selectedAttr.cells[0]);
        this.setState(
          {
            rowsUser: allItems,
            pagedRowsUser: rows,
            selectedAttributes
          },
          () => this.updateValuesTableRows()
        );
      });
      __publicField(this, "updateValuesTableRows", (skipAttributeSelection) => {
        const newSelectedAttrs = [...this.state.selectedAttributes];
        let namingRowID = this.state.namingRowID;
        let namingAttrVal = this.state.namingAttrVal;
        let editableTableData = [];
        let namingAttr = this.state.namingAttr;
        let namingVal = this.state.namingVal;
        if (this.state.savedRows.length === 0) {
          editableTableData = newSelectedAttrs.map((attrName) => {
            const obj = {
              id: generateUniqueId(),
              attr: attrName,
              val: "",
              required: false,
              namingAttr: false
            };
            return obj;
          });
          editableTableData.sort((a2, b) => a2.attr > b.attr ? 1 : -1);
          namingRowID = editableTableData[0].id;
          namingAttrVal = editableTableData[0].attr + "=" + editableTableData[0].val;
          namingAttr = editableTableData[0].attr;
          namingVal = editableTableData[0].val;
        } else {
          if (skipAttributeSelection) {
            editableTableData = [...this.state.savedRows];
          } else {
            const arrayOfAttrObjects = [...this.state.savedRows];
            for (const myAttr of newSelectedAttrs) {
              const found = arrayOfAttrObjects.find((el) => el.attr === myAttr);
              if (found === void 0) {
                arrayOfAttrObjects.push({
                  id: generateUniqueId(),
                  attr: myAttr,
                  val: "",
                  required: false,
                  namingAttr: false
                });
              }
            }
            editableTableData = arrayOfAttrObjects.filter((datum) => {
              const attrName = datum.attr;
              const found = newSelectedAttrs.find((attr) => attr === attrName);
              return found !== void 0;
            });
            editableTableData.sort((a2, b) => a2.attr > b.attr ? 1 : -1);
            if (this.state.namingRowID === -1) {
              namingRowID = editableTableData[0].id;
            }
          }
        }
        this.setState({
          editableTableData,
          rdn: editableTableData[0].attr,
          namingRowID,
          namingAttrVal,
          namingAttr,
          namingVal
        });
      });
      __publicField(this, "enableNextStep", (noEmptyValue) => {
        this.setState({ noEmptyValue });
      });
      __publicField(this, "setNamingRowID", (namingRowID) => {
        let namingAttrVal = "";
        let namingAttr = "";
        let namingVal = "";
        let rows = this.state.savedRows;
        if (rows.length === 0) {
          rows = this.state.editableTableData;
        }
        for (const row of rows) {
          if (row.id === namingRowID) {
            namingAttrVal = row.attr + "=" + row.val;
            namingAttr = row.attr;
            namingVal = row.val;
            break;
          }
        }
        this.setState({
          namingRowID,
          namingAttrVal,
          namingAttr,
          namingVal
        });
      });
      __publicField(this, "handleAttrDropDownToggle", (isOpen) => {
        this.setState({
          isAttrDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleAttrDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isAttrDropDownOpen: !prevState.isAttrDropDownOpen };
        });
      });
      __publicField(this, "buildAttrDropdown", () => {
        const { isAttrDropDownOpen, selectedAttributes } = this.state;
        const numSelected = selectedAttributes.length;
        const items = selectedAttributes.map(
          (attr) => /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(DropdownItem2, { children: attr }, attr)
        );
        return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
          Dropdown2,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleAttrDropDownSelect,
            position: DropdownPosition.left,
            toggle: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(BadgeToggle, { id: "toggle-attr-select", onToggle: (_event, isOpen) => this.handleAttrDropDownToggle(isOpen), children: numSelected !== 0 ? /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_jsx_runtime99.Fragment, { children: [
              numSelected,
              " ",
              _99("selected"),
              " "
            ] }) : /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_jsx_runtime99.Fragment, { children: [
              "0 ",
              _99("selected"),
              " "
            ] }) }),
            isOpen: isAttrDropDownOpen,
            dropdownItems: items
          }
        );
      });
      __publicField(this, "saveCurrentRows", (savedRows, namingID) => {
        this.setState({
          savedRows
        }, () => {
          if (namingID !== -1) {
            this.setNamingRowID(namingID);
          }
        });
      });
      __publicField(this, "generateLdifData", () => {
        const ldifArray = [];
        let isFilePath = false;
        const objectClassData = this.userObjectclasses[this.state.accountType];
        const cleanLdifArray = [];
        ldifArray.push(`dn: ${this.state.namingAttrVal},${this.props.wizardEntryDn}`);
        ldifArray.push(...objectClassData);
        for (const item of this.state.savedRows) {
          const attrName = item.attr;
          const attrVal = item.val;
          isFilePath = false;
          if ((typeof attrVal === "string" || attrVal instanceof String) && attrVal.toLowerCase().startsWith("file:/")) {
            isFilePath = true;
          }
          const mySeparator = BINARY_ATTRIBUTES.includes(attrName.toLowerCase()) ? isFilePath ? ":<" : "::" : ":";
          const valueToUse = item.encodedvalue ? item.encodedvalue : attrVal;
          const remainingData = foldLine(`${attrName}${mySeparator} ${valueToUse}`);
          ldifArray.push(...remainingData);
          if (attrName.toLowerCase().startsWith("userpassword")) {
            cleanLdifArray.push("userpassword: ********");
          } else if (attrName.toLowerCase().startsWith("jpegphoto") && mySeparator === "::") {
            const myTruncatedValue = /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { children: [
              "jpegphoto:: ",
              /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Label, { icon: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(InfoCircleIcon, {}), color: "blue", children: _99("Value is too large to display") })
            ] });
            cleanLdifArray.push(myTruncatedValue);
          } else {
            cleanLdifArray.push(...remainingData);
          }
        }
        this.setState({ ldifArray, cleanLdifArray });
      });
      this.userObjectclasses = {
        "Basic Account": [
          "objectclass: top",
          "objectClass: nsPerson",
          "objectClass: nsAccount",
          "objectClass: nsOrgPerson"
        ],
        "Traditional Account": [
          "objectclass: top",
          "objectClass: person",
          "objectClass: organizationalPerson",
          "objectClass: inetOrgPerson"
        ],
        "Posix Account": [
          "objectclass: top",
          "objectClass: nsPerson",
          "objectClass: nsAccount",
          "objectClass: nsOrgPerson",
          "objectClass: posixAccount"
        ],
        "Service Account": [
          "objectclass: top",
          "objectClass: applicationProcess",
          "objectClass: nsAccount"
        ]
      };
      this.allowedAttrs = {
        "Basic Account": [
          "businessCategory",
          "carLicense",
          "departmentNumber",
          "description",
          "employeeNumber",
          "employeeType",
          "homePhone",
          "homePostalAddress",
          "initials",
          "jpegPhoto",
          "labeledURI",
          "legalName",
          "mail",
          "manager",
          "mobile",
          "nsRoleDN",
          "o",
          "pager",
          "photo",
          "preferredLanguage",
          "nsCertSubjectDN",
          "nsSshPublicKey",
          "roomNumber",
          "seeAlso",
          "telephoneNumber",
          "uid",
          "userCertificate",
          "userPassword",
          "userSMIMECertificate",
          "userPKCS12",
          "x500UniqueIdentifier"
        ],
        "Traditional Account": [
          "userPassword",
          "telephoneNumber",
          "seeAlso",
          "description",
          "title",
          "registeredAddress",
          "destinationIndicator",
          "preferredDeliveryMethod",
          "telexNumber",
          "teletexTerminalIdentifier",
          "internationalISDNNumber",
          "facsimileTelephoneNumber",
          "street",
          "postOfficeBox",
          "postalCode",
          "postalAddress",
          "physicalDeliveryOfficeName",
          "ou",
          "st",
          "l",
          "audio",
          "businessCategory",
          "carLicense",
          "departmentNumber",
          "displayName",
          "employeeNumber",
          "employeeType",
          "givenName",
          "homePhone",
          "homePostalAddress",
          "initials",
          "jpegPhoto",
          "labeledURI",
          "mail",
          "manager",
          "mobile",
          "o",
          "pager",
          "photo",
          "roomNumber",
          "secretary",
          "uid",
          "userCertificate",
          "preferredLanguage",
          "userSMIMECertificate",
          "userPKCS12",
          "x500uniqueIdentifier",
          "x121Address"
        ],
        "Posix Account": [
          "businessCategory",
          "carLicense",
          "departmentNumber",
          "description",
          "employeeNumber",
          "employeeType",
          "homePhone",
          "homePostalAddress",
          "initials",
          "jpegPhoto",
          "labeledURI",
          "legalName",
          "mail",
          "manager",
          "mobile",
          "nsRoleDN",
          "o",
          "pager",
          "photo",
          "preferredLanguage",
          "nsCertSubjectDN",
          "nsSshPublicKey",
          "roomNumber",
          "seeAlso",
          "telephoneNumber",
          "userCertificate",
          "userPassword",
          "userSMIMECertificate",
          "userPKCS12",
          "x500UniqueIdentifier",
          "loginShell",
          "gecos"
        ],
        "Service Account": [
          "seeAlso",
          "ou",
          "l",
          "description",
          "userCertificate",
          "nsCertSubjectDN",
          "nsRoleDN",
          "nsSshPublicKey",
          "userPassword"
        ]
      };
      this.requiredAttrs = {
        "Basic Account": [
          "cn",
          "displayName"
        ],
        "Traditional Account": [
          "cn",
          "sn"
        ],
        "Posix Account": [
          "cn",
          "uid",
          "uidNumber",
          "gidNumber",
          "homeDirectory",
          "displayName"
        ],
        "Service Account": [
          "cn"
        ]
      };
      this.singleValuedAttrs = {
        "Basic Account": [
          "preferredDeliveryMethod",
          "displayName",
          "employeeNumber",
          "preferredLanguage",
          "userPassword"
        ],
        "Traditional Account": [
          "displayName",
          "employeeNumber",
          "preferredLanguage",
          "userPassword",
          "preferredDeliveryMethod"
        ],
        "Posix Account": [
          "preferredDeliveryMethod",
          "displayName",
          "employeeNumber",
          "preferredLanguage",
          "userPassword",
          "uidNumber",
          "gidNumber",
          "homeDirectory",
          "loginShell",
          "gecos"
        ],
        "Service Account": [
          "userpassword"
        ]
      };
      this.attributeValidationRules = [
        {
          name: _99("required"),
          validator: (value) => value.trim() !== "",
          errorText: _99("This field is required")
        }
      ];
      this.state = {
        alertVariant: "info",
        namingRowID: -1,
        namingAttrVal: "",
        namingAttr: "",
        namingVal: "",
        ldifArray: [],
        cleanLdifArray: [],
        savedRows: [],
        commandOutput: "",
        resultVariant: "default",
        searchValue: "",
        stepIdReached: 1,
        itemCountAddUser: 0,
        pageAddUser: 1,
        perPageAddUser: 10,
        columnsUser: [
          { title: _99("Attribute Name"), cellTransforms: [headerCol()] }
        ],
        rowsUser: [],
        rowsOrig: [],
        pagedRowsUser: [],
        selectedAttributes: [],
        isAttrDropDownOpen: false,
        // Values
        noEmptyValue: false,
        columnsValues: [
          _99("Attribute"),
          _99("Value")
        ],
        // Review step
        reviewValue: "",
        reviewInvalidText: _99("Invalid LDIF"),
        reviewIsValid: true,
        reviewValidated: "default",
        editableTableData: [],
        rdn: "",
        rdnValue: "",
        adding: true,
        accountType: "Basic Account",
        isOpenType: false
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 4) {
          this.updateValuesTableRows();
        } else if (id === 5) {
          this.generateLdifData();
        } else if (id === 6) {
          const myLdifArray = this.state.ldifArray;
          createLdapEntry(
            this.props.editorLdapServer,
            myLdifArray,
            (result) => {
              this.setState({
                commandOutput: result.errorCode === 0 ? _99("Successfully added user!") : _99("Failed to add user: ") + result.output,
                resultVariant: result.errorCode === 0 ? "success" : "danger",
                adding: false
              }, () => {
                this.props.onReload();
              });
              const myDn = myLdifArray[0].substring(4);
              const opInfo = {
                operationType: "ADD",
                resultCode: result.errorCode,
                time: Date.now(),
                entryDn: myDn,
                relativeDn: this.state.namingAttrVal
              };
              this.props.setWizardOperationInfo(opInfo);
            }
          );
        }
      };
      this.handleBack = ({ id }) => {
        if (id === 4) {
          this.updateValuesTableRows(true);
        }
        this.setState({
          stepIdReached: id
        });
      };
      this.handleToggleType = () => {
        const open = !this.state.isOpenType;
        this.setState({
          isOpenType: open
        });
      };
      this.handleSelectType = (event, selection) => {
        const attributesArray = [];
        let selectedAttrs = [];
        this.allowedAttrs[selection].map((attr) => {
          attributesArray.push({ cells: [attr] });
          return [];
        });
        this.requiredAttrs[selection].map((attr) => {
          attributesArray.push({
            cells: [attr],
            selected: true,
            isAttributeSelected: true,
            disableCheckbox: true
          });
          return [];
        });
        selectedAttrs = [...this.requiredAttrs[selection]];
        attributesArray.sort((a2, b) => a2.cells[0] > b.cells[0] ? 1 : -1);
        this.setState({
          itemCountAddUser: attributesArray.length,
          rowsUser: attributesArray,
          rowsOrig: [...attributesArray],
          pagedRowsUser: attributesArray.slice(0, this.state.perPageAddUser),
          accountType: selection,
          selectedAttributes: selectedAttrs,
          isOpenType: false
        });
      };
      this.handleAttrSearchChange = (value) => {
        let attrRows = [];
        let allAttrs = [];
        const val = value.toLowerCase();
        allAttrs = this.state.rowsOrig;
        if (val !== "") {
          for (const row of allAttrs) {
            const name2 = row.cells[0].toLowerCase();
            if (name2.includes(val)) {
              attrRows.push(row);
            }
          }
        } else {
          attrRows = allAttrs;
        }
        this.setState({
          rowsUser: attrRows,
          pagedRowsUser: attrRows.slice(0, this.state.perPageAttr),
          itemCountAddUser: attrRows.length,
          searchValue: value
        });
      };
    }
    componentDidMount() {
      const attributesArray = [];
      this.allowedAttrs[this.state.accountType].map((attr) => {
        attributesArray.push({ cells: [attr] });
        return [];
      });
      this.requiredAttrs[this.state.accountType].map((attr) => {
        attributesArray.push({
          cells: [attr],
          selected: true,
          isAttributeSelected: true,
          disableCheckbox: true
        });
        return [];
      });
      attributesArray.sort((a2, b) => a2.cells[0] > b.cells[0] ? 1 : -1);
      this.setState({
        itemCountAddUser: attributesArray.length,
        rowsUser: attributesArray,
        rowsOrig: [...attributesArray],
        pagedRowsUser: attributesArray.slice(0, this.state.perPageAddUser),
        selectedAttributes: [...this.requiredAttrs[this.state.accountType]]
      });
    }
    getAttributesToShow(page, perPage) {
      const start2 = (page - 1) * perPage;
      const end2 = page * perPage;
      const newRows = this.state.rowsUser.slice(start2, end2);
      return newRows;
    }
    render() {
      const {
        commandOutput,
        itemCountAddUser,
        pageAddUser,
        perPageAddUser,
        columnsUser,
        pagedRowsUser,
        ldifArray,
        cleanLdifArray,
        noEmptyValue,
        namingAttrVal,
        namingAttr,
        namingVal,
        resultVariant,
        editableTableData,
        stepIdReached
      } = this.state;
      const rdnValue = namingVal;
      const myTitle = namingAttrVal === "" || rdnValue === "" ? _99("Invalid Naming Attribute - Empty Value!") : _99("DN ( Distinguished Name )");
      const userSelectStep = /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_jsx_runtime99.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { className: "ds-container", children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Text, { component: TextVariants.h3, children: _99("Select Entry Type") }) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "ds-indent ds-margin-top", children: [
          /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
            Select,
            {
              id: "user-type-select",
              "aria-label": "Select user type",
              toggle: (toggleRef) => /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
                MenuToggle,
                {
                  ref: toggleRef,
                  onClick: this.handleToggleType,
                  isExpanded: this.state.isOpenType,
                  children: this.state.accountType
                }
              ),
              onSelect: this.handleSelectType,
              selected: this.state.accountType,
              isOpen: this.state.isOpenType,
              children: /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(SelectList, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(SelectOption, { value: "Basic Account", children: "Basic Account" }),
                /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(SelectOption, { value: "Traditional Account", children: "Traditional Account" }),
                /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(SelectOption, { value: "Posix Account", children: "Posix Account" }),
                /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(SelectOption, { value: "Service Account", children: "Service Account" })
              ] })
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(TextContent, { className: "ds-margin-top-xlg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(Text, { component: TextVariants.h6, className: "ds-margin-top-lg ds-font-size-md", children: [
              /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("b", { children: _99("Basic Account") }),
              _99(" - This type of user entry uses a common set of objectclasses (nsPerson, nsAccount, and nsOrgPerson).")
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(Text, { component: TextVariants.h6, className: "ds-margin-top-lg ds-font-size-md", children: [
              /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("b", { children: "Traditional Account" }),
              " - This type of user entry uses a traditional/legacy set of objectclasses (person, organizationalPerson, and inetOrgPerson)."
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(Text, { component: TextVariants.h6, className: "ds-margin-top-lg ds-font-size-md", children: [
              /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("b", { children: _99("Posix Account") }),
              _99(" - This type of user entry uses a similar set of objectclasses as the "),
              /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("i", { children: _99("Basic Account") }),
              " ",
              _99("(nsPerson, nsAccount, nsOrgPerson, and posixAccount), but it includes POSIX attributes like: "),
              /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("i", { children: _99("uidNumber, gidNumber, homeDirectory, loginShell, and gecos") }),
              "."
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(Text, { component: TextVariants.h6, className: "ds-margin-top-lg ds-font-size-md", children: [
              /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("b", { children: _99("Service Account") }),
              _99(" - This type of entry uses a bare minimum of objectclasses (nsAccount, and applicationProcess) and attributes to create a simple object used to represent a service (not a user identity).")
            ] })
          ] })
        ] })
      ] });
      const userAttributesStep = /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_jsx_runtime99.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "ds-container", children: [
          /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Text, { component: TextVariants.h3, children: _99("Select Entry Attributes") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
            Dropdown2,
            {
              className: "ds-dropdown-padding",
              position: "left",
              onSelect: this.handleAttrDropDownSelect,
              toggle: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
                BadgeToggle,
                {
                  id: "toggle-attr-select",
                  badgeProps: {
                    className: this.state.selectedAttributes.length > 0 ? "ds-badge-bgcolor" : void 0,
                    isRead: this.state.selectedAttributes.length === 0
                  },
                  onToggle: (_event, isOpen) => this.handleAttrDropDownToggle(isOpen),
                  children: `${this.state.selectedAttributes.length} ${_99("selected")}`
                }
              ),
              isOpen: this.state.isAttrDropDownOpen,
              dropdownItems: this.state.selectedAttributes.map(
                (attr) => /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(DropdownItem2, { children: attr }, attr)
              )
            }
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
            SearchInput,
            {
              className: "ds-font-size-md",
              placeholder: _99("Search Attributes"),
              value: this.state.searchValue,
              onChange: (_event, value) => this.handleAttrSearchChange(value),
              onClear: () => this.handleAttrSearchChange("")
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
            Pagination,
            {
              itemCount: this.state.itemCountAddUser,
              page: this.state.pageAddUser,
              perPage: this.state.perPageAddUser,
              onSetPage: this.handleSetPageAddUser,
              widgetId: "pagination-options-menu-add-user",
              onPerPageSelect: this.handlePerPageSelectAddUser,
              isCompact: true
            }
          ) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(Table, { "aria-label": "User Attributes Table", variant: "compact", children: [
          /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(Tr, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Th, { screenReaderText: "Select Attributes" }),
            this.state.columnsUser.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Th, { children: typeof column === "object" ? column.title : column }, columnIndex))
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Tbody, { children: this.state.pagedRowsUser.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(Tr, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
              Td,
              {
                select: {
                  rowIndex,
                  onSelect: this.handleSelect,
                  isSelected: row.selected,
                  isDisabled: row.disableCheckbox
                }
              }
            ),
            row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
              Td,
              {
                dataLabel: this.state.columnsUser[cellIndex]?.title || this.state.columnsUser[cellIndex],
                children: cell
              },
              `${rowIndex}_${cellIndex}`
            ))
          ] }, rowIndex)) })
        ] })
      ] });
      const userValuesStep = /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_jsx_runtime99.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Form, { autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(GridItem, { className: "ds-margin-top", span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(
            Alert,
            {
              variant: namingAttr === "" || namingVal === "" ? "warning" : "success",
              isInline: true,
              title: myTitle,
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("b", { children: [
                  _99("Entry DN:"),
                  "\xA0\xA0\xA0"
                ] }),
                namingAttr || "??????",
                "=",
                namingVal || "??????",
                ",",
                this.props.wizardEntryDn
              ]
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(GridItem, { span: 12, className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Text, { component: TextVariants.h3, children: _99("Set Attribute Values") }) }) })
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(GridItem, { className: "ds-left-margin", span: 11, children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
          editableTable_default,
          {
            editableTableData,
            isAttributeSingleValued: this.isAttributeSingleValued,
            isAttributeRequired: this.isAttributeRequired,
            enableNextStep: this.enableNextStep,
            setNamingRowID: this.setNamingRowID,
            saveCurrentRows: this.saveCurrentRows,
            namingRowID: this.state.namingRowID,
            namingAttr: this.state.namingAttr
          },
          editableTableData
        ) })
      ] });
      const ldifListItems = cleanLdifArray.map(
        (line, index) => /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(SimpleListItem, { isActive: (typeof line === "string" || line instanceof String) && line.startsWith("dn: "), children: line }, index)
      );
      const userCreationStep = /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
          Alert,
          {
            variant: "info",
            isInline: true,
            title: _99("LDIF Content for User Creation")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(CardBody, { children: ldifListItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(SimpleList, { "aria-label": "LDIF data User", children: ldifListItems }) }) })
      ] });
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const userReviewStep = /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(
          Alert,
          {
            variant: resultVariant,
            isInline: true,
            title: _99("Result for User Creation"),
            children: [
              commandOutput,
              this.state.adding && /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { children: [
                /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Spinner, { className: "ds-left-margin", size: "md" }),
                "\xA0\xA0",
                _99("Adding user ...")
              ] })
            ]
          }
        ),
        resultVariant === "danger" && /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(Card, { isSelectable: true, children: [
          /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(CardTitle, { children: _99("LDIF Data") }),
          /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(CardBody, { children: ldifLines.map((line) => /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("h6", { children: line.data }, line.id)) })
        ] })
      ] });
      const addUserSteps = [
        {
          id: 1,
          name: this.props.firstStep[0].name,
          component: this.props.firstStep[0].component,
          canJumpTo: stepIdReached >= 1 && stepIdReached < 6,
          hideBackButton: true
        },
        {
          id: 2,
          name: _99("Choose User Type"),
          component: userSelectStep,
          canJumpTo: stepIdReached >= 2 && stepIdReached < 6
        },
        {
          id: 3,
          name: _99("Select Attributes"),
          component: userAttributesStep,
          canJumpTo: stepIdReached >= 3 && stepIdReached < 6
        },
        {
          id: 4,
          name: _99("Set Values"),
          component: userValuesStep,
          canJumpTo: stepIdReached >= 4 && stepIdReached < 6,
          enableNext: noEmptyValue
        },
        {
          id: 5,
          name: _99("Create User"),
          component: userCreationStep,
          nextButtonText: _99("Create User"),
          canJumpTo: stepIdReached >= 5 && stepIdReached < 6
        },
        {
          id: 6,
          name: _99("Review Result"),
          component: userReviewStep,
          nextButtonText: _99("Finish"),
          canJumpTo: stepIdReached >= 6,
          hideBackButton: this.state.resultVariant === "success" ? true : false,
          enableNext: !this.state.adding
        }
      ];
      const title = /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_jsx_runtime99.Fragment, { children: [
        _99("Parent DN: "),
        "\xA0\xA0",
        /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("strong", { children: this.props.wizardEntryDn }),
        stepIdReached >= 2 && /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_jsx_runtime99.Fragment, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("br", {}),
          "Entry type:\xA0\xA0\xA0",
          /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("strong", { children: this.state.accountType })
        ] })
      ] });
      return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.props.handleToggleWizard,
          onNext: this.handleNext,
          onBack: this.handleBack,
          title: _99("Add A User"),
          description: title,
          steps: addUserSteps
        }
      );
    }
  };
  var addUser_default = AddUser;

  // src/lib/ldap_editor/wizards/operations/addGroup.jsx
  var import_react170 = __toESM(require_react(), 1);
  var import_jsx_runtime100 = __toESM(require_jsx_runtime(), 1);
  var _100 = cockpit_default.gettext;
  var AddGroup = class extends import_react170.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "generateLdifData", () => {
        const objectClassData = ["objectClass: top"];
        const valueData = [];
        let memberAttr = "";
        if (this.state.posixGroup) {
          objectClassData.push("objectClass: groupOfNames");
          objectClassData.push("objectClass: posixGroup");
          memberAttr = "member";
        } else {
          if (this.state.memberAttr === "uniquemember") {
            objectClassData.push("objectClass: groupOfUniqueNames");
            memberAttr = "uniquemember";
          } else {
            objectClassData.push("objectClass: groupOfNames");
            memberAttr = "member";
          }
        }
        if (this.state.groupDesc !== "") {
          valueData.push(`description: ${this.state.groupDesc}`);
        }
        if (this.state.posixGroup && this.state.gidNumber > 0) {
          valueData.push(`gidNumber: ${this.state.gidNumber}`);
        }
        for (const userObj of this.state.usersChosenOptions) {
          const dn_val = userObj.props.title.replace(/^dn: /, "");
          valueData.push(`${memberAttr}: ${dn_val}`);
        }
        const ldifArray = [
          `dn: cn=${this.state.groupName},${this.props.wizardEntryDn}`,
          ...objectClassData,
          `cn: ${this.state.groupName}`,
          ...valueData
        ];
        this.setState({ ldifArray });
      });
      this.minValue = 0;
      this.maxValue = 1878982656;
      this.state = {
        parentDN: "",
        groupName: "",
        isTreeLoading: false,
        groupType: "Basic Group",
        isOpenType: false,
        memberAttr: "member",
        members: [],
        searching: false,
        searchPattern: "",
        showLDAPNavModal: false,
        usersSearchBaseDn: "",
        usersAvailableOptions: [],
        usersChosenOptions: [],
        ldifArray: [],
        resultVariant: "default",
        commandOutput: "",
        stepIdReached: 1,
        noEmptyValue: false,
        adding: true,
        posixGroup: false,
        gidNumber: 0,
        groupDesc: ""
      };
      this.onBaseDnSelection = (treeViewItem) => {
        this.setState({
          usersSearchBaseDn: treeViewItem.dn
        });
      };
      this.showTreeLoadingState = (isTreeLoading) => {
        this.setState({
          isTreeLoading,
          searching: !!isTreeLoading
        });
      };
      this.handleOpenLDAPNavModal = () => {
        this.setState({
          showLDAPNavModal: true
        });
      };
      this.handleCloseLDAPNavModal = () => {
        this.setState({
          showLDAPNavModal: false
        });
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 5) {
          this.generateLdifData();
        } else if (id === 6) {
          const myLdifArray = this.state.ldifArray;
          createLdapEntry(
            this.props.editorLdapServer,
            myLdifArray,
            (result) => {
              this.setState({
                commandOutput: result.errorCode === 0 ? _100("Group successfully created!") : _100("Failed to create group: ") + result.output,
                resultVariant: result.errorCode === 0 ? "success" : "danger",
                adding: false
              }, () => {
                this.props.onReload();
              });
              const myDn = myLdifArray[0].substring(4);
              const relativeDn = myLdifArray[3].replace(": ", "=");
              const opInfo = {
                operationType: "ADD",
                resultCode: result.errorCode,
                time: Date.now(),
                entryDn: myDn,
                relativeDn
              };
              this.props.setWizardOperationInfo(opInfo);
            }
          );
        }
      };
      this.handleBack = ({ id }) => {
        this.setState({
          stepIdReached: id
        });
      };
      this.handleSearchClick = () => {
        this.setState({
          isSearchRunning: true,
          usersAvailableOptions: []
        }, () => {
          this.getEntries();
        });
      };
      this.handleSearchPattern = (searchPattern) => {
        this.setState({ searchPattern });
      };
      this.getEntries = () => {
        const baseDn = this.state.usersSearchBaseDn;
        const pattern = this.state.searchPattern;
        const filter = pattern === "" ? "(|(objectClass=person)(objectClass=nsPerson))" : `(&(|(objectClass=person)(objectClass=nsPerson)(objectClass=nsAccount)(objectClass=nsOrgPerson)(objectClass=posixAccount))(|(cn=*${pattern}*)(uid=${pattern})))`;
        const attrs = "cn uid";
        const params = {
          serverId: this.props.editorLdapServer,
          baseDn,
          scope: "sub",
          filter,
          attributes: attrs
        };
        runGenericSearch(params, (resultArray) => {
          const newOptionsArray = resultArray.map((result) => {
            const lines = result.split("\n");
            const pos0 = lines[0].indexOf(":: ");
            const pos1 = lines[1].indexOf(":: ");
            let dnLine = lines[0];
            if (pos0 > 0) {
              const decoded = decodeLine(dnLine);
              dnLine = `${decoded[0]}: ${decoded[1]}`;
            }
            const value = pos1 === -1 ? lines[1].split(": ")[1] : decodeLine(lines[1])[1];
            return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("span", { title: dnLine, children: value }, dnLine);
          });
          this.setState({
            usersAvailableOptions: newOptionsArray,
            isSearchRunning: false
          });
        });
      };
      this.removeDuplicates = (options5) => {
        const titles = options5.map((item) => item.props.title);
        const noDuplicates = options5.filter((item, index) => {
          return titles.indexOf(item.props.title) === index;
        });
        return noDuplicates;
      };
      this.handleUsersOnListChange = (_event, newAvailableOptions, newChosenOptions) => {
        const newAvailNoDups = this.removeDuplicates(newAvailableOptions);
        const newChosenNoDups = this.removeDuplicates(newChosenOptions);
        this.setState({
          usersAvailableOptions: newAvailNoDups.sort(),
          usersChosenOptions: newChosenNoDups.sort()
        });
      };
      this.handleRadioChange = (event, _113) => {
        this.setState({
          memberAttr: event.currentTarget.id
        });
      };
      this.handleToggleType = (_event, isOpenType) => {
        this.setState({
          isOpenType
        });
      };
      this.handleSelectType = (event, selection) => {
        this.setState({
          posixGroup: selection === "Posix Group",
          groupType: selection,
          isOpenType: false
        });
      };
      this.onMinusConfig = (id) => {
        if (Number(this.state[id]) - 1 < 1) {
          return;
        }
        this.setState({
          [id]: Number(this.state[id]) - 1
        });
      };
      this.onConfigChange = (event, id, min3) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
        });
      };
      this.onPlusConfig = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        });
      };
      this.handleChange = this.handleChange.bind(this);
    }
    componentDidMount() {
      this.setState({
        parentDN: this.props.wizardEntryDn,
        usersSearchBaseDn: this.props.wizardEntryDn
      });
    }
    handleChange(e) {
      const attr = e.target.id;
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [attr]: value
      });
    }
    render() {
      const {
        groupName,
        usersSearchBaseDn,
        usersAvailableOptions,
        usersChosenOptions,
        showLDAPNavModal,
        ldifArray,
        resultVariant,
        commandOutput,
        stepIdReached,
        groupDesc
      } = this.state;
      const groupSelectStep = /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(import_jsx_runtime100.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "ds-container", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text, { component: TextVariants.h3, children: _100("Select Group Type") }) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "ds-indent", children: [
          /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
            dsBasicComponents_default,
            {
              className: "ds-margin-top-lg",
              ariaLabel: "Select group type",
              onToggle: (event, isOpen) => this.handleToggleType(event, isOpen),
              onSelect: this.handleSelectType,
              selected: this.state.groupType,
              isOpen: this.state.isOpenType,
              options: ["Basic Group", "Posix Group"]
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(TextContent, { className: "ds-margin-top-xlg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text, { component: TextVariants.h6, className: "ds-margin-top-lg ds-font-size-md", children: [
              /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("b", { children: _100("Basic Group") }),
              _100("- This type of group can use membership attributes: member, or uniqueMember common set of objectclasses and attributes.")
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text, { component: TextVariants.h6, className: "ds-margin-top-lg ds-font-size-md", children: [
              /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("b", { children: _100("Posix Group") }),
              " ",
              _100("- This type of group uses the 'GroupOfNames' and 'PosixGroup' objectclasses which allows for attributes like <i>gidNumber</i>, etc")
            ] })
          ] })
        ] })
      ] });
      const groupNameStep = /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text, { component: TextVariants.h3, children: _100("Select Name") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Form, { autoComplete: "off", children: [
          /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Grid, { className: "ds-margin-top-xlg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(GridItem, { span: 2, className: "ds-label", children: _100("Group Name") }),
            /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
              TextInput,
              {
                value: groupName,
                type: "text",
                id: "groupName",
                "aria-describedby": "groupName",
                name: "groupName",
                onChange: (e, str) => {
                  this.handleChange(e);
                },
                validated: this.state.groupName === "" ? ValidatedOptions.error : ValidatedOptions.default
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Grid, { title: _100("Optional description for this group."), children: [
            /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(GridItem, { span: 2, className: "ds-label", children: _100("Group Description") }),
            /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
              TextInput,
              {
                value: groupDesc,
                type: "text",
                id: "groupDesc",
                "aria-describedby": "groupDesc",
                name: "groupDesc",
                onChange: (e, str) => {
                  this.handleChange(e);
                }
              }
            ) })
          ] }),
          !this.state.posixGroup && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(import_jsx_runtime100.Fragment, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(TextContent, { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text, { component: TextVariants.h5, children: _100("Choose The Membership") }) }),
            /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "ds-left-margin", children: [
              /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
                Radio,
                {
                  name: "memberAttrGroup",
                  id: "member",
                  value: "member",
                  label: _100("member"),
                  isChecked: this.state.memberAttr === "member",
                  onChange: (event, str) => this.handleRadioChange(event, str),
                  description: _100("This group uses objectclass 'GroupOfNames'.")
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
                Radio,
                {
                  name: "memberAttrGroup",
                  id: "uniquemember",
                  value: "uniquemember",
                  label: _100("uniquemember"),
                  isChecked: this.state.memberAttr === "uniquemember",
                  onChange: (event, str) => this.handleRadioChange(event, str),
                  description: _100("This group uses objectclass 'GroupOfUniqueNames'."),
                  className: "ds-margin-top"
                }
              )
            ] })
          ] }),
          this.state.posixGroup && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_jsx_runtime100.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
            Grid,
            {
              title: _100("This setting corresponds to the attribute: gidNumber.  The gid must be greater than zero for this attribute to be set."),
              className: "ds-margin-top",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(GridItem, { className: "ds-label", span: 2, children: _100("Group ID Number") }),
                /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
                  NumberInput,
                  {
                    value: this.state.gidNumber,
                    min: this.minValue,
                    max: this.maxValue,
                    onMinus: () => {
                      this.onMinusConfig("gidNumber");
                    },
                    onChange: (e) => {
                      this.onConfigChange(e, "gidNumber", 0);
                    },
                    onPlus: () => {
                      this.onPlusConfig("gidNumber");
                    },
                    inputName: "input",
                    inputAriaLabel: "number input",
                    minusBtnAriaLabel: "minus",
                    plusBtnAriaLabel: "plus",
                    widthChars: 8
                  }
                ) })
              ]
            }
          ) })
        ] })
      ] });
      const selectMembersStep = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_jsx_runtime100.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Form, { autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Grid, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text, { component: TextVariants.h3, children: _100("Add Members To The Group") }) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(GridItem, { span: 12, className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text, { children: [
          _100("Search Base:"),
          /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
            Text,
            {
              className: "ds-left-margin",
              component: TextVariants.a,
              onClick: this.handleOpenLDAPNavModal,
              href: "#",
              children: usersSearchBaseDn
            }
          )
        ] }) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(GridItem, { span: 12, className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
          SearchInput,
          {
            placeholder: _100("Find members..."),
            value: this.state.searchPattern,
            onChange: (_event, value) => this.handleSearchPattern(value),
            onSearch: this.handleSearchClick,
            onClear: () => {
              this.handleSearchPattern("");
            }
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(GridItem, { span: 12, className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
          DualListSelector,
          {
            availableOptions: usersAvailableOptions,
            chosenOptions: usersChosenOptions,
            availableOptionsTitle: _100("Available Members"),
            chosenOptionsTitle: _100("Chosen Members"),
            onListChange: (event, newAvailableOptions, newChosenOptions) => this.handleUsersOnListChange(event, newAvailableOptions, newChosenOptions),
            id: "usersSelector"
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: _100("Choose A Branch To Search"),
            isOpen: showLDAPNavModal,
            onClose: this.handleCloseLDAPNavModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleCloseLDAPNavModal,
                  children: _100("Done")
                },
                "confirm"
              )
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Card, { isSelectable: true, className: "ds-indent ds-margin-bottom-md", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
              ldapNavigator_default,
              {
                treeItems: [...this.props.treeViewRootSuffixes],
                editorLdapServer: this.props.editorLdapServer,
                skipLeafEntries: true,
                handleNodeOnClick: this.onBaseDnSelection,
                showTreeLoadingState: this.showTreeLoadingState,
                addNotification: this.props.addNotification
              }
            ) }) })
          }
        )
      ] }) }) });
      const ldifListItems = ldifArray.map(
        (line, index) => /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(SimpleListItem, { isActive: line.startsWith("dn: "), children: line }, index)
      );
      const groupCreationStep = /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
          Alert,
          {
            variant: "info",
            isInline: true,
            title: _100("LDIF Content for Group Creation")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(CardBody, { children: ldifListItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(SimpleList, { "aria-label": "LDIF data User", children: ldifListItems }) }) })
      ] });
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const groupReviewStep = /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
          Alert,
          {
            variant: resultVariant,
            isInline: true,
            title: _100("Result for Group Creation"),
            children: [
              commandOutput,
              this.state.adding && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { children: [
                /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Spinner, { className: "ds-left-margin", size: "md" }),
                "\xA0\xA0",
                _100("Adding group ...")
              ] })
            ]
          }
        ),
        resultVariant === "danger" && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Card, { isSelectable: true, children: [
          /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(CardTitle, { children: _100("LDIF Data") }),
          /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(CardBody, { children: ldifLines.map((line) => /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("h6", { children: line.data }, line.id)) })
        ] })
      ] });
      const addGroupSteps = [
        {
          id: 1,
          name: this.props.firstStep[0].name,
          component: this.props.firstStep[0].component,
          canJumpTo: stepIdReached >= 1 && stepIdReached < 6,
          hideBackButton: true
        },
        {
          id: 2,
          name: _100("Select Group Type"),
          component: groupSelectStep,
          canJumpTo: stepIdReached >= 2 && stepIdReached < 6
        },
        {
          id: 3,
          name: _100("Select Name"),
          component: groupNameStep,
          canJumpTo: stepIdReached >= 3 && stepIdReached < 6,
          enableNext: groupName !== ""
        },
        {
          id: 4,
          name: _100("Add Members"),
          component: selectMembersStep,
          canJumpTo: stepIdReached >= 4 && stepIdReached < 6
        },
        {
          id: 5,
          name: _100("Create Group"),
          component: groupCreationStep,
          nextButtonText: _100("Create"),
          canJumpTo: stepIdReached >= 5 && stepIdReached < 6
        },
        {
          id: 6,
          name: _100("Review Result"),
          component: groupReviewStep,
          nextButtonText: _100("Finish"),
          canJumpTo: stepIdReached >= 6,
          hideBackButton: this.state.resultVariant === "success" ? true : false,
          enableNext: !this.state.adding
        }
      ];
      const title = /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(import_jsx_runtime100.Fragment, { children: [
        _100("Parent DN: "),
        "\xA0\xA0\xA0",
        /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("strong", { children: this.props.wizardEntryDn }),
        stepIdReached >= 2 && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(import_jsx_runtime100.Fragment, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("br", {}),
          "Group type:\xA0\xA0",
          /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("strong", { children: this.state.groupType })
        ] })
      ] });
      return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.props.handleToggleWizard,
          onNext: this.handleNext,
          onBack: this.handleBack,
          title: _100("Add A Group"),
          description: title,
          steps: addGroupSteps
        }
      );
    }
  };
  var addGroup_default = AddGroup;

  // src/lib/ldap_editor/wizards/operations/addRole.jsx
  var import_react171 = __toESM(require_react(), 1);
  var import_jsx_runtime101 = __toESM(require_jsx_runtime(), 1);
  var _101 = cockpit_default.gettext;
  var AddRole = class extends import_react171.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleSetpageAddRole", (_event, pageNumber) => {
        this.setState({
          pageAddRole: pageNumber,
          pagedRowsRole: this.getAttributesToShow(pageNumber, this.state.perpageAddRole)
        });
      });
      __publicField(this, "handlePerPageSelectAddRole", (_event, perPage) => {
        this.setState({
          pageAddRole: 1,
          perpageAddRole: perPage,
          pagedRowsRole: this.getAttributesToShow(1, perPage)
        });
      });
      __publicField(this, "isAttributeSingleValued", (attr) => {
        return this.singleValuedAttributes.includes(attr);
      });
      __publicField(this, "isAttributeRequired", (attr) => {
        return this.requiredAttributes.includes(attr);
      });
      __publicField(this, "handleSelect", (event, isSelected, rowId) => {
        let rows;
        let selectedAttributes;
        if (rowId === -1) {
          rows = this.state.rowsRole.map((oneRow) => {
            oneRow.selected = isSelected;
            oneRow.isAttributeSelected = isSelected;
            return oneRow;
          });
          rows[0].selected = true;
          rows[0].isAttributeSelected = true;
          selectedAttributes = ["cn"];
          if (this.state.roleType === "filtered") {
            selectedAttributes.push("nsRoleFilter");
            rows[1].selected = true;
            rows[1].isAttributeSelected = true;
          } else if (this.state.roleType === "nested") {
            selectedAttributes.push("nsRoleDN");
            rows[1].selected = true;
            rows[1].isAttributeSelected = true;
          }
          this.setState(
            {
              rowsRole: rows,
              allAttributesSelected: isSelected,
              selectedAttributes
            },
            () => {
              this.setState({
                pagedRowsRole: this.getAttributesToShow(this.state.pageAddRole, this.state.perpageAddRole)
              });
              this.updateValuesTableRows();
            }
          );
        } else {
          if (this.state.pagedRowsRole[rowId].disableCheckbox === true) {
            return;
          }
          rows = [...this.state.pagedRowsRole];
          rows[rowId].selected = isSelected;
          const attrName = this.state.pagedRowsRole[rowId].cells[0];
          const allItems = [...this.state.rowsRole];
          const index = allItems.findIndex((item) => item.cells[0] === attrName);
          allItems[index].isAttributeSelected = isSelected;
          const selectedAttributes2 = allItems.filter((item) => item.isAttributeSelected).map((selectedAttr) => selectedAttr.cells[0]);
          this.setState(
            {
              rowsRole: allItems,
              pagedRowsRole: rows,
              selectedAttributes: selectedAttributes2
            },
            () => this.updateValuesTableRows()
          );
        }
      });
      __publicField(this, "updateValuesTableRows", (skipAttributeSelection) => {
        const newSelectedAttrs = this.state.allAttributesSelected ? [
          "cn",
          ...this.roleDefinitionArray,
          ...this.filteredRoleDefinitionArray,
          ...this.nestedRoleDefinitionArray
        ] : [...this.state.selectedAttributes];
        let namingRowID = this.state.namingRowID;
        let namingAttrVal = this.state.namingAttrVal;
        let editableTableData = [];
        let namingAttr = this.state.namingAttr;
        let namingVal = this.state.namingVal;
        if (this.state.savedRows.length === 0) {
          editableTableData = newSelectedAttrs.map((attrName) => {
            const obj = {
              id: generateUniqueId(),
              attr: attrName,
              val: namingVal || "",
              required: false,
              namingAttr: false
            };
            return obj;
          });
          editableTableData.sort((a2, b) => a2.attr > b.attr ? 1 : -1);
          namingRowID = editableTableData[0].id;
          namingAttrVal = editableTableData[0].attr + "=" + editableTableData[0].val;
          namingAttr = editableTableData[0].attr;
          namingVal = editableTableData[0].val;
          if (this.state.roleType === "nested") {
            for (const userObj of this.state.rolesChosenOptions) {
              const dn_val = userObj.props.title.replace(/^dn: /, "");
              editableTableData = editableTableData.filter((item) => item.attr.toLowerCase() !== "nsroledn" || item.val !== dn_val);
              editableTableData.push({
                id: generateUniqueId(),
                attr: "nsRoleDN",
                val: dn_val,
                required: true,
                namingAttr: false
              });
            }
          }
          this.setState({
            savedRows: editableTableData
          });
        } else {
          if (skipAttributeSelection) {
            editableTableData = [...this.state.savedRows];
          } else {
            const arrayOfAttrObjects = [...this.state.savedRows];
            for (const myAttr of newSelectedAttrs) {
              const found = arrayOfAttrObjects.find((el) => el.attr === myAttr);
              if (found === void 0) {
                arrayOfAttrObjects.push({
                  id: generateUniqueId(),
                  attr: myAttr,
                  val: "",
                  required: false,
                  namingAttr: false
                });
              }
            }
            editableTableData = arrayOfAttrObjects.filter((datum) => {
              const attrName = datum.attr;
              const found = newSelectedAttrs.find((attr) => attr === attrName);
              return found !== void 0;
            });
            editableTableData.sort((a2, b) => a2.attr > b.attr ? 1 : -1);
            if (this.state.namingRowID === -1) {
              namingRowID = editableTableData[0].id;
            }
          }
          if (this.state.roleType === "nested") {
            for (const userObj of this.state.rolesChosenOptions) {
              const dn_val = userObj.props.title.replace(/^dn: /, "");
              editableTableData = editableTableData.filter((item) => item.attr.toLowerCase() !== "nsroledn" || item.val !== dn_val);
              editableTableData.push({
                id: generateUniqueId(),
                attr: "nsRoleDN",
                val: dn_val,
                required: true,
                namingAttr: false
              });
            }
          }
          this.setState({
            savedRows: editableTableData
          });
        }
        this.setState({
          editableTableData,
          rdn: editableTableData[0].attr,
          namingRowID,
          namingAttrVal,
          namingAttr,
          namingVal
        });
      });
      __publicField(this, "enableNextStep", (noEmptyValue) => {
        this.setState({ noEmptyValue });
      });
      __publicField(this, "setNamingRowID", (namingRowID) => {
        let namingAttrVal = "";
        let namingAttr = "";
        let namingVal = "";
        let rows = this.state.savedRows;
        if (rows.length === 0) {
          rows = this.state.editableTableData;
        }
        for (const row of rows) {
          if (row.id === namingRowID) {
            namingAttrVal = row.attr + "=" + row.val;
            namingAttr = row.attr;
            namingVal = row.val;
            break;
          }
        }
        this.setState({
          namingRowID,
          namingAttrVal,
          namingAttr,
          namingVal
        });
      });
      __publicField(this, "handleAttrDropDownToggle", (isOpen) => {
        this.setState({
          isAttrDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleAttrDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isAttrDropDownOpen: !prevState.isAttrDropDownOpen };
        });
      });
      __publicField(this, "buildAttrDropdown", () => {
        const { isAttrDropDownOpen, selectedAttributes } = this.state;
        const numSelected = selectedAttributes.length;
        const items = selectedAttributes.map(
          (attr) => /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(DropdownItem2, { children: attr }, attr)
        );
        return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
          Dropdown2,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleAttrDropDownSelect,
            position: DropdownPosition.left,
            toggle: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(BadgeToggle, { id: "toggle-attr-select", onToggle: (_event, isOpen) => this.handleAttrDropDownToggle(isOpen), children: numSelected !== 0 ? /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(import_jsx_runtime101.Fragment, { children: [
              numSelected,
              " ",
              _101("selected"),
              " "
            ] }) : /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(import_jsx_runtime101.Fragment, { children: [
              "0 ",
              _101("selected"),
              " "
            ] }) }),
            isOpen: isAttrDropDownOpen,
            dropdownItems: items
          }
        );
      });
      __publicField(this, "saveCurrentRows", (savedRows, namingID) => {
        this.setState({
          savedRows
        }, () => {
          if (namingID !== -1) {
            this.setNamingRowID(namingID);
          }
        });
      });
      __publicField(this, "generateLdifData", () => {
        const objectClassData = [
          "ObjectClass: top",
          "ObjectClass: LdapSubEntry",
          "ObjectClass: nsRoleDefinition"
        ];
        if (this.state.roleType === "managed") {
          objectClassData.push(
            "ObjectClass: nsSimpleRoleDefinition",
            "ObjectClass: nsManagedRoleDefinition"
          );
        } else if (this.state.roleType === "filtered") {
          objectClassData.push(
            "ObjectClass: nsComplexRoleDefinition",
            "ObjectClass: nsFilteredRoleDefinition"
          );
        } else if (this.state.roleType === "nested") {
          objectClassData.push(
            "ObjectClass: nsComplexRoleDefinition",
            "ObjectClass: nsNestedRoleDefinition"
          );
        }
        const valueData = [];
        for (const item of this.state.savedRows) {
          const attrName = item.attr;
          valueData.push(`${attrName}: ${item.val}`);
          if (objectClassData.length === 5) {
            continue;
          }
        }
        const ldifArray = [
          `dn: ${this.state.namingAttrVal},${this.props.wizardEntryDn}`,
          ...objectClassData,
          ...valueData
        ];
        this.setState({ ldifArray });
      });
      this.roleDefinitionArray = ["description", "nsRoleScopeDN"];
      this.filteredRoleDefinitionArray = ["nsRoleFilter"];
      this.nestedRoleDefinitionArray = ["nsRoleDN"];
      this.singleValuedAttributes = ["nsRoleFilter", "nsRoleDN", "nsRoleScopeDN"];
      this.requiredAttributes = ["cn", "nsRoleFilter", "nsRoleDN"];
      this.attributeValidationRules = [
        {
          name: _101("required"),
          validator: (value) => value.trim() !== "",
          errorText: _101("This field is required")
        }
      ];
      this.state = {
        alertVariant: "info",
        namingRowID: -1,
        namingAttrVal: "",
        namingAttr: "",
        namingVal: "",
        ldifArray: [],
        cleanLdifArray: [],
        savedRows: [],
        commandOutput: "",
        resultVariant: "default",
        allAttributesSelected: false,
        stepIdReached: 1,
        // currentStepId: 1,
        itemCountAddRole: 0,
        pageAddRole: 1,
        perpageAddRole: 10,
        columnsRole: [
          { title: _101("Attribute Name"), cellTransforms: [headerCol()] },
          { title: _101("From ObjectClass") }
        ],
        rowsRole: [],
        pagedRowsRole: [],
        selectedAttributes: ["cn"],
        isAttrDropDownOpen: false,
        // Values
        noEmptyValue: false,
        columnsValues: [
          _101("Attribute"),
          _101("Value")
        ],
        // Review step
        reviewValue: "",
        reviewInvalidText: _101("Invalid LDIF"),
        reviewIsValid: true,
        reviewValidated: "default",
        // reviewHelperText: 'LDIF data'
        editableTableData: [],
        rdn: "",
        rdnValue: "",
        parentDN: "",
        isTreeLoading: false,
        roleType: "managed",
        roleDNs: [],
        searching: false,
        searchPattern: "",
        showLDAPNavModal: false,
        rolesSearchBaseDn: "",
        rolesAvailableOptions: [],
        rolesChosenOptions: [],
        adding: true
      };
      this.onBaseDnSelection = (treeViewItem) => {
        this.setState({
          rolesSearchBaseDn: treeViewItem.dn
        });
      };
      this.showTreeLoadingState = (isTreeLoading) => {
        this.setState({
          isTreeLoading,
          searching: !!isTreeLoading
        });
      };
      this.handleOpenLDAPNavModal = () => {
        this.setState({
          showLDAPNavModal: true
        });
      };
      this.handleCloseLDAPNavModal = () => {
        this.setState({
          showLDAPNavModal: false
        });
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 4) {
          this.updateAttributesTableRows();
          this.updateValuesTableRows();
        } else if (id === 5) {
          this.updateValuesTableRows();
        } else if (id === 6) {
          this.generateLdifData();
        } else if (id === 7) {
          const myLdifArray = this.state.ldifArray;
          createLdapEntry(
            this.props.editorLdapServer,
            myLdifArray,
            (result) => {
              this.setState({
                commandOutput: result.errorCode === 0 ? _101("Role successfully created!") : _101("Failed to create role, error: ") + result.errorCode,
                resultVariant: result.errorCode === 0 ? "success" : "danger",
                adding: false
              }, () => {
                this.props.onReload();
              });
              const myDn = myLdifArray[0].substring(4);
              const relativeDn = myLdifArray[6].replace(": ", "=");
              const opInfo = {
                operationType: "ADD",
                resultCode: result.errorCode,
                time: Date.now(),
                entryDn: myDn,
                relativeDn
              };
              this.props.setWizardOperationInfo(opInfo);
            }
          );
        }
      };
      this.handleBack = ({ id }) => {
        if (id === 5) {
          this.updateValuesTableRows(true);
        }
        this.setState({
          stepIdReached: id
        });
      };
      this.handleSearchClick = () => {
        this.setState({
          isSearchRunning: true,
          rolesAvailableOptions: []
        }, () => {
          this.getEntries();
        });
      };
      this.handleSearchPattern = (searchPattern) => {
        this.setState({ searchPattern });
      };
      this.getEntries = () => {
        const baseDn = this.state.rolesSearchBaseDn;
        const pattern = this.state.searchPattern;
        const filter = pattern === "" ? "(|(objectClass=LDAPsubentry)(objectClass=nsRoleDefinition))" : `(&(|(objectClass=LDAPsubentry)(objectClass=nsRoleDefinition)(objectClass=nsSimpleRoleDefinition)(objectClass=nsComplexRoleDefinition)(objectClass=nsManagedRoleDefinition)(objectClass=nsFilteredRoleDefinition)(objectClass=nsNestedRoleDefinition))(|(cn=*${pattern}*)(uid=${pattern})))`;
        const attrs = "cn";
        const params = {
          serverId: this.props.editorLdapServer,
          baseDn,
          scope: "sub",
          filter,
          attributes: attrs
        };
        runGenericSearch(params, (resultArray) => {
          const newOptionsArray = resultArray.map((result) => {
            const lines = result.split("\n");
            const pos0 = lines[0].indexOf(":: ");
            const pos1 = lines[1].indexOf(":: ");
            let dnLine = lines[0];
            if (pos0 > 0) {
              const decoded = decodeLine(dnLine);
              dnLine = `${decoded[0]}: ${decoded[1]}`;
            }
            const value = pos1 === -1 ? lines[1].split(": ")[1] : decodeLine(lines[1])[1];
            return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { title: dnLine, children: value }, dnLine);
          });
          this.setState({
            rolesAvailableOptions: newOptionsArray,
            isSearchRunning: false
          });
        });
      };
      this.removeDuplicates = (options5) => {
        const titles = options5.map((item) => item.props.title);
        const noDuplicates = options5.filter((item, index) => {
          return titles.indexOf(item.props.title) === index;
        });
        return noDuplicates;
      };
      this.handleUsersListChange = (_event, newAvailableOptions, newChosenOptions) => {
        const newAvailNoDups = this.removeDuplicates(newAvailableOptions);
        const newChosenNoDups = this.removeDuplicates(newChosenOptions);
        this.setState({
          rolesAvailableOptions: newAvailNoDups.sort(),
          rolesChosenOptions: newChosenNoDups.sort()
        });
      };
      this.handleRadioChange = (event, _113) => {
        this.setState({
          roleType: event.currentTarget.id
        });
      };
      this.handleChange = this.handleChange.bind(this);
    }
    updateAttributesTableRows() {
      const attributesArray = [];
      attributesArray.push({
        cells: ["cn", "LdapSubEntry"],
        selected: true,
        isAttributeSelected: true,
        disableCheckbox: true
      });
      this.roleDefinitionArray.map((attr) => {
        attributesArray.push({ cells: [attr, "nsRoleDefinition"] });
        return [];
      });
      if (this.state.roleType === "filtered") {
        this.filteredRoleDefinitionArray.map((attr) => {
          attributesArray.push({
            cells: [attr, "nsFilteredRoleDefinition"],
            selected: true,
            isAttributeSelected: true,
            disableCheckbox: true
          });
          return [];
        });
      } else if (this.state.roleType === "nested") {
        this.nestedRoleDefinitionArray.map((attr) => {
          attributesArray.push({
            cells: [attr, "nsNestedRoleDefinition"],
            selected: true,
            isAttributeSelected: true,
            disableCheckbox: true
          });
          return [];
        });
      }
      attributesArray.sort((a2, b) => a2.cells[0] > b.cells[0] ? 1 : -1);
      this.setState({
        selectedAttributes: [
          "cn",
          ...this.state.roleType === "filtered" ? ["nsRoleFilter"] : [],
          ...this.state.roleType === "nested" ? ["nsRoleDN"] : []
        ],
        itemCountAddRole: attributesArray.length,
        rowsRole: attributesArray,
        pagedRowsRole: attributesArray.slice(0, this.state.perpageAddRole),
        parentDN: this.props.wizardEntryDn,
        rolesSearchBaseDn: this.props.wizardEntryDn
      });
    }
    componentDidMount() {
      this.setState({
        parentDN: this.props.wizardEntryDn,
        rolesSearchBaseDn: this.props.wizardEntryDn
      });
    }
    getAttributesToShow(page, perPage) {
      const start2 = (page - 1) * perPage;
      const end2 = page * perPage;
      const newRows = this.state.rowsRole.slice(start2, end2);
      return newRows;
    }
    handleChange(e) {
      const attr = e.target.id;
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [attr]: value
      });
    }
    render() {
      const {
        itemCountAddRole,
        pageAddRole,
        perpageAddRole,
        columnsRole,
        pagedRowsRole,
        ldifArray,
        noEmptyValue,
        namingAttrVal,
        namingAttr,
        resultVariant,
        editableTableData,
        stepIdReached,
        namingVal,
        rolesSearchBaseDn,
        rolesAvailableOptions,
        rolesChosenOptions,
        showLDAPNavModal,
        commandOutput,
        roleType,
        isAttrDropDownOpen,
        selectedAttributes
      } = this.state;
      const rdnValue = namingVal;
      const myTitle = namingAttrVal === "" || rdnValue === "" ? _101("Invalid Naming Attribute - Empty Value!") : _101("DN ( Distinguished Name )");
      const namingValAndTypeStep = /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Text, { component: TextVariants.h3, children: _101("Select Name And Role Type") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(Form, { autoComplete: "off", children: [
          /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(Grid, { className: "ds-margin-top-xlg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(GridItem, { span: 2, className: "ds-label", children: _101("Role Name") }),
            /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
              TextInput,
              {
                value: namingVal,
                type: "text",
                id: "namingVal",
                "aria-describedby": "namingVal",
                name: "namingVal",
                onChange: (e, str) => {
                  this.handleChange(e);
                },
                validated: this.state.namingVal === "" ? ValidatedOptions.error : ValidatedOptions.default
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(TextContent, { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Text, { component: TextVariants.h5, children: _101("Choose Role Type") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "ds-left-margin", children: [
            /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
              Radio,
              {
                name: "roleType",
                id: "managed",
                value: "managed",
                label: _101("Managed"),
                isChecked: this.state.roleType === "managed",
                onChange: (event, str) => this.handleRadioChange(event, str),
                description: _101("This attribute uses objectclass 'RoleOfNames'")
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
              Radio,
              {
                name: "roleType",
                id: "filtered",
                value: "filtered",
                label: _101("Filtered"),
                isChecked: this.state.roleType === "filtered",
                onChange: (event, str) => this.handleRadioChange(event, str),
                description: _101("This attribute uses objectclass 'RoleOfUniqueNames'"),
                className: "ds-margin-top"
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
              Radio,
              {
                name: "roleType",
                id: "nested",
                value: "nested",
                label: _101("Nested"),
                isChecked: this.state.roleType === "nested",
                onChange: (event, str) => this.handleRadioChange(event, str),
                description: _101("This attribute uses objectclass 'RoleOfUniqueNames'"),
                className: "ds-margin-top"
              }
            )
          ] })
        ] })
      ] });
      const addRolesStep = /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_jsx_runtime101.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Form, { autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(Grid, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(GridItem, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Text, { component: TextVariants.h3, children: _101("Add Roles to the Nested Role") }) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(GridItem, { span: 12, className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(Text, { children: [
          _101("Search Base"),
          ":",
          /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
            Text,
            {
              className: "ds-left-margin",
              component: TextVariants.a,
              onClick: this.handleOpenLDAPNavModal,
              href: "#",
              children: rolesSearchBaseDn
            }
          )
        ] }) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(GridItem, { span: 12, className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
          SearchInput,
          {
            placeholder: _101("Find roles..."),
            value: this.state.searchPattern,
            onChange: (evt, val) => this.handleSearchPattern(val),
            onSearch: this.handleSearchClick,
            onClear: () => {
              this.handleSearchPattern("");
            }
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(GridItem, { span: 12, className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
          DualListSelector,
          {
            availableOptions: rolesAvailableOptions,
            chosenOptions: rolesChosenOptions,
            availableOptionsTitle: _101("Available Roles"),
            chosenOptionsTitle: _101("Chosen Roles"),
            onListChange: (event, newAvailableOptions, newChosenOptions) => this.handleUsersListChange(event, newAvailableOptions, newChosenOptions),
            id: "usersSelector"
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: _101("Choose A Branch To Search"),
            isOpen: showLDAPNavModal,
            onClose: this.handleCloseLDAPNavModal,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
                Button,
                {
                  variant: "primary",
                  onClick: this.handleCloseLDAPNavModal,
                  children: "Done"
                },
                "confirm"
              )
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Card, { isSelectable: true, className: "ds-indent ds-margin-bottom-md", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
              ldapNavigator_default,
              {
                treeItems: [...this.props.treeViewRootSuffixes],
                editorLdapServer: this.props.editorLdapServer,
                skipLeafEntries: true,
                handleNodeOnClick: this.onBaseDnSelection,
                showTreeLoadingState: this.showTreeLoadingState,
                addNotification: this.props.addNotification
              }
            ) }) })
          }
        )
      ] }) }) });
      const roleAttributesStep = /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(import_jsx_runtime101.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "ds-container", children: [
          /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Text, { component: TextVariants.h3, children: _101("Select Entry Attributes") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
            Dropdown2,
            {
              className: "ds-dropdown-padding",
              position: "left",
              onSelect: this.handleAttrDropDownSelect,
              toggle: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
                BadgeToggle,
                {
                  id: "toggle-attr-select",
                  badgeProps: {
                    className: selectedAttributes.length > 0 ? "ds-badge-bgcolor" : void 0,
                    isRead: selectedAttributes.length === 0
                  },
                  onToggle: (_event, isOpen) => this.handleAttrDropDownToggle(isOpen),
                  children: selectedAttributes.length > 0 ? `${selectedAttributes.length} ${_101("selected")}` : `0 ${_101("selected")}`
                }
              ),
              isOpen: isAttrDropDownOpen,
              dropdownItems: selectedAttributes.map(
                (attr) => /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(DropdownItem2, { children: attr }, attr)
              )
            }
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
          Pagination,
          {
            itemCount: itemCountAddRole,
            page: pageAddRole,
            perPage: perpageAddRole,
            onSetPage: this.handleSetpageAddRole,
            widgetId: "pagination-options-menu-add-role",
            onPerPageSelect: this.handlePerPageSelectAddRole,
            isCompact: true
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(Table, { "aria-label": "Role Attributes Table", variant: "compact", children: [
          /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(Tr, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Th, { select: {
              onSelect: (_event, isSelected) => this.handleSelect(_event, isSelected, -1),
              isSelected: this.state.allAttributesSelected
            } }),
            columnsRole.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Th, { children: typeof column === "object" ? column.title : column }, columnIndex))
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Tbody, { children: pagedRowsRole.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(Tr, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
              Td,
              {
                select: {
                  rowIndex,
                  onSelect: this.handleSelect,
                  isSelected: row.selected,
                  isDisabled: row.disableCheckbox
                }
              }
            ),
            row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
              Td,
              {
                dataLabel: columnsRole[cellIndex]?.title || columnsRole[cellIndex],
                children: cell
              },
              `${rowIndex}_${cellIndex}`
            ))
          ] }, rowIndex)) })
        ] })
      ] });
      const roleValuesStep = /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(import_jsx_runtime101.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Form, { autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(Grid, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(GridItem, { className: "ds-margin-top", span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
            Alert,
            {
              variant: namingAttr === "" || namingVal === "" ? "warning" : "success",
              isInline: true,
              title: myTitle,
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("b", { children: [
                  _101("Entry DN:"),
                  "\xA0\xA0\xA0"
                ] }),
                namingAttr || "??????",
                "=",
                namingVal || "??????",
                ",",
                this.props.wizardEntryDn
              ]
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(GridItem, { span: 12, className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Text, { component: TextVariants.h3, children: _101("Set Attribute Values") }) }) })
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(GridItem, { className: "ds-left-margin", span: 11, children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
          editableTable_default,
          {
            editableTableData,
            isAttributeSingleValued: this.isAttributeSingleValued,
            isAttributeRequired: this.isAttributeRequired,
            enableNextStep: this.enableNextStep,
            setNamingRowID: this.setNamingRowID,
            saveCurrentRows: this.saveCurrentRows,
            namingRowID: this.state.namingRowID,
            namingAttr: this.state.namingAttr
          }
        ) })
      ] });
      const ldifListItems = ldifArray.map(
        (line, index) => /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(SimpleListItem, { isActive: line.startsWith("dn: "), children: line }, index)
      );
      const roleCreationStep = /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
          Alert,
          {
            variant: "info",
            isInline: true,
            title: _101("LDIF Content for Role Creation")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(CardBody, { children: ldifListItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(SimpleList, { "aria-label": "LDIF data User", children: ldifListItems }) }) })
      ] });
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const roleReviewStep = /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
          Alert,
          {
            variant: resultVariant,
            isInline: true,
            title: _101("Result for Role Creation"),
            children: [
              commandOutput,
              this.state.adding && /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { children: [
                /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Spinner, { className: "ds-left-margin", size: "md" }),
                "\xA0\xA0",
                _101("Adding Role ...")
              ] })
            ]
          }
        ),
        resultVariant === "danger" && /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(Card, { isSelectable: true, children: [
          /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(CardTitle, { children: _101("LDIF Data") }),
          /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(CardBody, { children: ldifLines.map((line) => /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("h6", { children: line.data }, line.id)) })
        ] })
      ] });
      const addRoleSteps = [
        {
          id: 1,
          name: this.props.firstStep[0].name,
          component: this.props.firstStep[0].component,
          canJumpTo: stepIdReached >= 1 && stepIdReached < 7,
          hideBackButton: true
        },
        {
          id: 2,
          name: _101("Select Name & Type"),
          component: namingValAndTypeStep,
          enableNext: namingVal !== "",
          canJumpTo: stepIdReached >= 2 && stepIdReached < 7
        },
        ...roleType === "nested" ? [
          {
            id: 3,
            name: _101("Add Nested Roles"),
            component: addRolesStep,
            canJumpTo: stepIdReached >= 3 && stepIdReached < 7
          }
        ] : [],
        {
          id: 4,
          name: _101("Select Attributes"),
          component: roleAttributesStep,
          canJumpTo: stepIdReached >= 4 && stepIdReached < 7
        },
        {
          id: 5,
          name: _101("Set Values"),
          component: roleValuesStep,
          canJumpTo: stepIdReached >= 5 && stepIdReached < 7,
          enableNext: noEmptyValue
        },
        {
          id: 6,
          name: _101("Create Role"),
          component: roleCreationStep,
          nextButtonText: _101("Create"),
          canJumpTo: stepIdReached >= 6 && stepIdReached < 7
        },
        {
          id: 7,
          name: _101("Review Result"),
          component: roleReviewStep,
          nextButtonText: _101("Finish"),
          canJumpTo: stepIdReached >= 7,
          hideBackButton: this.state.resultVariant === "success" ? true : false,
          enableNext: !this.state.adding
        }
      ];
      const title = /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(import_jsx_runtime101.Fragment, { children: [
        _101("Parent DN: "),
        "\xA0\xA0",
        /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("strong", { children: this.props.wizardEntryDn }),
        stepIdReached >= 2 && /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(import_jsx_runtime101.Fragment, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("br", {}),
          "Role type:\xA0\xA0\xA0\xA0",
          /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("strong", { children: this.state.roleType })
        ] })
      ] });
      return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.props.handleToggleWizard,
          onNext: this.handleNext,
          onBack: this.handleBack,
          title: _101("Add A Role"),
          description: title,
          steps: addRoleSteps
        }
      );
    }
  };
  var addRole_default = AddRole;

  // src/lib/ldap_editor/wizards/operations/addLdapEntry.jsx
  var import_react172 = __toESM(require_react(), 1);
  var import_jsx_runtime102 = __toESM(require_jsx_runtime(), 1);
  var _102 = cockpit_default.gettext;
  var AddLdapEntry = class extends import_react172.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "isAttributeSingleValued", (attr) => {
        return this.singleValuedAttributes.includes(attr.toLowerCase());
      });
      __publicField(this, "isAttributeRequired", (attr) => {
        return this.requiredAttributes.includes(attr);
      });
      __publicField(this, "enableNextStep", (yes) => {
        this.setState({
          validMods: yes
        });
      });
      __publicField(this, "saveCurrentRows", (editableTableData) => {
        let validMods = true;
        let namingVal = this.state.namingVal;
        let namingAttrVal = this.state.namingAttrVal;
        for (const row of editableTableData) {
          if (row.val === "") {
            validMods = false;
            break;
          }
          if (row.id === this.state.namingRowID) {
            namingVal = row.val;
            namingAttrVal = row.attr + "=" + row.val;
          }
        }
        this.setState({
          editableTableData,
          validMods,
          namingVal,
          namingAttrVal
        });
      });
      __publicField(this, "handleSetPageOc", (_event, pageNumber) => {
        this.setState({
          pageOc: pageNumber,
          pagedRowsOc: this.getItemsToShow(pageNumber, this.state.perPageOc, "ObjectClassTable")
        });
      });
      __publicField(this, "handleSetPageAttr", (_event, pageNumber) => {
        this.setState({
          pageAttr: pageNumber,
          pagedRowsAttr: this.getItemsToShow(pageNumber, this.state.perPageAttr, "AttributeTable")
        });
      });
      __publicField(this, "handlePerPageSelectOc", (_event, perPage) => {
        this.setState({
          pageOc: 1,
          perPageOc: perPage,
          pagedRowsOc: this.getItemsToShow(1, perPage, "ObjectClassTable")
        });
      });
      __publicField(this, "handlePerPageSelectAttr", (_event, perPage) => {
        this.setState({
          pageAttr: 1,
          perPageAttr: perPage,
          pagedRowsAttr: this.getItemsToShow(1, perPage, "AttributeTable")
        });
      });
      __publicField(this, "handleSelectOc", (event, isSelected, rowId) => {
        const rows = [...this.state.pagedRowsOc];
        rows[rowId].selected = isSelected;
        const ocName = this.state.pagedRowsOc[rowId].cells[0];
        const allItems = [...this.state.rowsOc];
        const index = allItems.findIndex((item) => item.cells[0] === ocName);
        allItems[index].selected = isSelected;
        let selectedObjectClasses = [...this.state.selectedObjectClasses];
        if (isSelected) {
          selectedObjectClasses.push(allItems[index]);
        } else {
          selectedObjectClasses = selectedObjectClasses.filter((row) => row.cells[0] !== allItems[index].cells[0]);
        }
        const attrsToRemove = [];
        if (!isSelected) {
          let ocAttrs = allItems[index].cells[1].toLowerCase().replace(/\s/g, "").split(",");
          ocAttrs = ocAttrs.concat(allItems[index].cells[2].toLowerCase().replace(/\s/g, "").split(","));
          let currAttrs = [];
          for (const oc of selectedObjectClasses) {
            currAttrs = currAttrs.concat(oc.cells[1].toLowerCase().replace(/\s/g, "").split(","));
            currAttrs = currAttrs.concat(oc.cells[2].toLowerCase().replace(/\s/g, "").split(","));
          }
          for (const attr of ocAttrs) {
            if (currAttrs.indexOf(attr) === -1) {
              attrsToRemove.push(attr);
            }
          }
        }
        this.setState({
          rowsOc: allItems,
          pagedRowsOc: rows,
          selectedObjectClasses,
          attrsToRemove
        }, () => {
          this.updateAttributeTableRows();
        });
      });
      __publicField(this, "handleSelectAttr", (event, isSelected, rowId) => {
        let newEditableData = this.state.editableTableData;
        if (this.state.pagedRowsAttr[rowId].disableCheckbox === true) {
          return;
        }
        const rows = [...this.state.pagedRowsAttr];
        rows[rowId].selected = isSelected;
        const attrName = rows[rowId].cells[0];
        const allItems = [...this.state.rowsAttrOrig];
        const index = allItems.findIndex((item) => item.cells[0] === attrName);
        allItems[index].isAttributeSelected = isSelected;
        const selectedAttributes = allItems.filter((item) => item.isAttributeSelected).map((attrObj) => [attrObj.attributeName, attrObj.cells[1]]);
        const rowAttr = rows[rowId].attributeName.toLowerCase();
        const found = this.state.editableTableData.filter((item) => item.attr.toLowerCase() === rowAttr);
        if (isSelected) {
          if (found.length === 0 && rowAttr !== "objectclass") {
            const obj = {};
            obj.id = generateUniqueId();
            obj.attr = rows[rowId].attributeName;
            obj.val = "";
            obj.namingAttr = false;
            obj.required = false;
            newEditableData = [...newEditableData, obj];
          }
        } else if (found.length > 0) {
          newEditableData = this.state.editableTableData.filter((item) => item.attr.toLowerCase() !== rowAttr);
        }
        let validMods = true;
        for (const row of newEditableData) {
          if (row.val === "") {
            validMods = false;
          }
        }
        this.setState({
          rowsAttr: allItems,
          pagedRowsAttr: rows,
          editableTableData: newEditableData,
          selectedAttributes,
          validMods
        });
      });
      __publicField(this, "updateAttributeTableRows", () => {
        const ocToProcess = [...this.state.selectedObjectClasses];
        const rowsAttr = [];
        const attrList = [];
        let namingRowID = this.state.namingRowID;
        let namingAttr = this.state.namingAttr;
        for (const oc of ocToProcess) {
          const required = oc.cells[1].split(",");
          const optional = oc.cells[2].split(",");
          for (let attr of required) {
            attr = attr.trim().toLowerCase();
            if (attr === "") {
              continue;
            }
            if (!attrList.includes(attr)) {
              attrList.push(attr);
              rowsAttr.push({
                selected: true,
                disableCheckbox: true,
                // TODO: Hack until upgrading!
                isAttributeSelected: true,
                attributeName: attr,
                cells: [
                  {
                    title: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_jsx_runtime102.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("strong", { children: attr }) })
                  },
                  oc.cells[0]
                ]
              });
            }
            const found = this.state.editableTableData.filter((item) => item.attr.toLowerCase() === attr);
            if (found.length === 0 && attr !== "objectclass") {
              const new_id = generateUniqueId();
              if (namingRowID === -1) {
                namingRowID = new_id;
                namingAttr = attr;
              }
              const obj = {};
              obj.id = new_id;
              obj.attr = attr;
              obj.val = "";
              obj.namingAttr = false;
              obj.required = true;
              this.setState((prevState) => ({
                editableTableData: [...prevState.editableTableData, obj],
                validMods: false,
                namingRowID,
                namingAttr
              }));
            }
          }
          for (let attr of optional) {
            attr = attr.trim();
            if (attr === "") {
              continue;
            }
            if (!attrList.includes(attr)) {
              let selected = false;
              for (const existingRow of this.state.editableTableData) {
                if (existingRow.attr.toLowerCase() === attr.toLowerCase()) {
                  selected = true;
                  break;
                }
              }
              attrList.push(attr);
              rowsAttr.push({
                attributeName: attr,
                isAttributeSelected: selected,
                selected,
                cells: [attr, oc.cells[0]]
              });
            }
          }
        }
        rowsAttr.sort((a2, b) => a2.attributeName > b.attributeName ? 1 : -1);
        this.setState({
          rowsAttr,
          rowsAttrOrig: [...rowsAttr],
          selectedAttributes: rowsAttr.filter((item) => item.isAttributeSelected).map((attrObj) => [attrObj.attributeName, attrObj.cells[1]]),
          itemCountAttr: rowsAttr.length
        }, () => {
          this.setState({
            pagedRowsAttr: this.getItemsToShow(
              this.state.pageAttr,
              this.state.perPageAttr,
              "AttributeTable"
            )
          });
        });
      });
      __publicField(this, "generateLdifData", () => {
        const objectClassData = ["top"];
        const attribute = this.state.namingAttr;
        const value = this.state.namingVal;
        const valueData = [];
        for (const oc of this.state.selectedObjectClasses) {
          if (oc && !objectClassData.includes(oc.cells[0])) {
            objectClassData.push(oc.cells[0]);
          }
        }
        for (const item of this.state.editableTableData) {
          const attrName = item.attr;
          valueData.push(`${attrName}: ${item.val}`);
        }
        const ocArray = objectClassData.map((oc) => `ObjectClass: ${oc}`);
        const dnLine = `dn: ${attribute}=${value},${this.props.wizardEntryDn}`;
        const ldifArray = [
          dnLine,
          ...ocArray,
          ...valueData
        ];
        const cleanLdifArray = [...ldifArray];
        for (const idx in cleanLdifArray) {
          if (cleanLdifArray[idx].toLowerCase().startsWith("userpassword")) {
            cleanLdifArray[idx] = "userpassword: ********";
            break;
          }
        }
        this.setState({
          ldifArray,
          cleanLdifArray
        });
      });
      __publicField(this, "handleOCDropDownToggle", (isOpen) => {
        this.setState({
          isOCDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleOCDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isOCDropDownOpen: !prevState.isOCDropDownOpen };
        });
      });
      __publicField(this, "buildOCDropdown", () => {
        const { isOCDropDownOpen, selectedObjectClasses } = this.state;
        const numSelected = this.state.rowsOc.filter((item) => item.selected).length;
        const items = selectedObjectClasses.map(
          (oc) => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(DropdownItem2, { children: oc.cells[0] }, oc.cells[0])
        );
        return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
          Dropdown2,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleOCDropDownSelect,
            position: DropdownPosition.left,
            toggle: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(BadgeToggle, { id: "toggle-oc-select", onToggle: (_event, isOpen) => this.handleOCDropDownToggle(isOpen), children: numSelected !== 0 ? /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
              numSelected,
              " ",
              _102("selected"),
              " "
            ] }) : /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
              "0 ",
              _102("selected"),
              " "
            ] }) }),
            isOpen: isOCDropDownOpen,
            dropdownItems: items
          }
        );
      });
      __publicField(this, "handleAttrDropDownToggle", (isOpen) => {
        this.setState({
          isAttrDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleAttrDropDownSelect", (event) => {
        this.setState((prevState, props) => {
          return { isAttrDropDownOpen: !prevState.isAttrDropDownOpen };
        });
      });
      __publicField(this, "buildAttrDropdown", () => {
        const { isAttrDropDownOpen, selectedAttributes } = this.state;
        const numSelected = selectedAttributes.length;
        const items = selectedAttributes.map(
          (attr) => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(DropdownItem2, { children: attr[0] }, attr[0])
        );
        return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
          Dropdown2,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleAttrDropDownSelect,
            position: DropdownPosition.left,
            toggle: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(BadgeToggle, { id: "toggle-attr-select", onToggle: (_event, isOpen) => this.handleAttrDropDownToggle(isOpen), children: numSelected !== 0 ? /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
              numSelected,
              " ",
              _102("selected"),
              " "
            ] }) : /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
              "0 ",
              _102("selected"),
              " "
            ] }) }),
            isOpen: isAttrDropDownOpen,
            dropdownItems: items
          }
        );
      });
      __publicField(this, "setNamingRowID", (namingRowID) => {
        let namingAttrVal = "";
        let namingAttr = "";
        let namingVal = "";
        const rows = this.state.editableTableData;
        for (const row of rows) {
          if (row.id === namingRowID) {
            namingAttrVal = row.attr + "=" + row.val;
            namingAttr = row.attr;
            namingVal = row.val;
            break;
          }
        }
        this.setState({
          namingRowID,
          namingAttrVal,
          namingAttr,
          namingVal
        });
      });
      this.originalEntryRows = [];
      this.singleValuedAttributes = [];
      this.requiredAttributes = ["dn"];
      this.operationColumns = [
        { title: _102("Statement") },
        { title: _102("Attribute") },
        { title: _102("Value"), cellTransforms: [breakWord] }
      ];
      this.state = {
        loading: true,
        isOCDropDownOpen: false,
        isAttrDropDownOpen: false,
        namingAttributeData: ["", ""],
        namingAttrPropsName: "",
        namingRowID: -1,
        namingVal: "",
        editableTableData: [],
        statementRows: [],
        ldifArray: [],
        cleanLdifArray: [],
        validMods: false,
        commandOutput: "",
        resultVariant: "default",
        stepIdReached: 1,
        itemCountOc: 0,
        pageOc: 1,
        perPageOc: 6,
        itemCountAttr: 0,
        pageAttr: 1,
        perPageAttr: 10,
        columnsAttr: [
          { title: _102("Attribute Name"), cellTransforms: [headerCol()] },
          { title: _102("From ObjectClass") }
        ],
        columnsOc: [
          { title: _102("ObjectClass Name"), cellTransforms: [headerCol()] },
          { title: _102("Required Attributes"), cellTransforms: [breakWord] },
          { title: _102("Optional Attributes"), cellTransforms: [breakWord] }
        ],
        rowsOc: [],
        rowsAttr: [],
        rowsAttrOrig: [],
        rowsValues: [],
        pagedRowsOc: [],
        pagedRowsAttr: [],
        selectedObjectClasses: [],
        selectedAttributes: [],
        attrsToRemove: [],
        namingAttr: "",
        adding: true,
        searchOCValue: "",
        searchAttrValue: ""
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 3) {
          this.updateAttributeTableRows();
        } else if (id === 4) {
          this.cleanUpEntry();
        } else if (id === 5) {
          this.generateLdifData();
        } else if (id === 6) {
          createLdapEntry(
            this.props.editorLdapServer,
            this.state.ldifArray,
            (result) => {
              this.setState({
                commandOutput: result.errorCode === 0 ? _102("Successfully added entry!") : _102("Failed to add entry, error: ") + result.errorCode,
                resultVariant: result.errorCode === 0 ? "success" : "danger",
                adding: false
              }, () => {
                this.props.onReload();
              });
              const myDn = this.state.ldifArray[0].substring(4);
              const opInfo = {
                operationType: "ADD",
                resultCode: result.errorCode,
                time: Date.now(),
                entryDn: myDn,
                relativeDn: this.state.namingAttrVal
              };
              this.props.setWizardOperationInfo(opInfo);
            }
          );
        }
      };
      this.cleanUpEntry = () => {
        const newRows = [];
        let validMods = true;
        for (const row of this.state.editableTableData) {
          const attr = row.attr.toLowerCase();
          if (this.state.attrsToRemove.indexOf(attr) === -1) {
            if (row.val === "") {
              validMods = false;
            }
            newRows.push(row);
          }
        }
        this.setState({
          editableTableData: newRows,
          validMods
        });
      };
      this.handleOCSearchChange = (event, value) => {
        let ocRows = [];
        const allOCs = [];
        const val = value.toLowerCase();
        this.props.allObjectclasses.map((oc) => {
          let selected = false;
          let selectionDisabled = false;
          for (const selectedOC of this.state.selectedObjectClasses) {
            if (selectedOC.cells[0].toLowerCase() === oc.name.toLowerCase()) {
              selected = true;
              break;
            }
          }
          if (oc.name === "top") {
            selectionDisabled = true;
          }
          allOCs.push(
            {
              cells: [
                oc.name,
                oc.required.join(", "),
                oc.optional.join(", ")
              ],
              selected,
              disableSelection: selectionDisabled
            }
          );
          return [];
        });
        if (value !== "") {
          for (const row of allOCs) {
            const name2 = row.cells[0].toLowerCase();
            const reqAttrs = row.cells[1].toLowerCase();
            const optAttrs = row.cells[2].toLowerCase();
            if (name2.includes(val) || reqAttrs.includes(val) || optAttrs.includes(val)) {
              ocRows.push(row);
            }
          }
        } else {
          ocRows = allOCs;
        }
        this.setState({
          rowsOc: ocRows,
          pagedRowsOc: ocRows.slice(0, this.state.perPageOc),
          searchOCValue: value,
          itemCountOc: ocRows.length
        });
      };
      this.handleAttrSearchChange = (event, value) => {
        let attrRows = [];
        const allAttrs = this.state.rowsAttrOrig;
        const val = value.toLowerCase();
        if (val !== "") {
          for (const row of allAttrs) {
            const name2 = row.attributeName.toLowerCase();
            if (name2.includes(val)) {
              attrRows.push(row);
            }
          }
        } else {
          attrRows = allAttrs;
        }
        this.setState({
          rowsAttr: attrRows,
          pagedRowsAttr: attrRows.slice(0, this.state.perPageAttr),
          itemCountAttr: attrRows.length,
          searchAttrValue: value
        });
      };
    }
    componentDidMount() {
      const ocArray = [];
      getSingleValuedAttributes(
        this.props.editorLdapServer,
        (myAttrs) => {
          this.singleValuedAttributes = [...myAttrs];
        }
      );
      this.props.allObjectclasses.map((oc) => {
        let selectionDisabled = false;
        if (oc.name === "top") {
          selectionDisabled = true;
        }
        ocArray.push(
          {
            cells: [
              oc.name,
              oc.required.join(", "),
              oc.optional.join(", ")
            ],
            selected: false,
            disableSelection: selectionDisabled
          }
        );
        return [];
      });
      this.setState({
        itemCountOc: ocArray.length,
        rowsOc: ocArray,
        pagedRowsOc: ocArray.slice(0, this.state.perPageOc),
        loading: false
      });
    }
    getItemsToShow(page, perPage, option) {
      const start2 = (page - 1) * perPage;
      const end2 = page * perPage;
      const newRows = option === "ObjectClassTable" ? this.state.rowsOc.slice(start2, end2) : option === "AttributeTable" ? this.state.rowsAttr.slice(start2, end2) : [];
      return newRows;
    }
    render() {
      const {
        loading,
        itemCountOc,
        pageOc,
        perPageOc,
        columnsOc,
        pagedRowsOc,
        itemCountAttr,
        pageAttr,
        perPageAttr,
        columnsAttr,
        pagedRowsAttr,
        commandOutput,
        namingAttr,
        namingVal,
        stepIdReached,
        ldifArray,
        resultVariant,
        editableTableData,
        validMods,
        cleanLdifArray,
        selectedAttributes,
        selectedObjectClasses
      } = this.state;
      const objectClassStep = /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "ds-container", children: [
          /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Text, { component: TextVariants.h3, children: _102("Select ObjectClasses") }) }),
          this.buildOCDropdown()
        ] }),
        loading ? /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(Bullseye, { className: "ds-margin-top-xlg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Title, { headingLevel: "h3", size: "lg", children: _102("Loading ObjectClasses ...") }),
          /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Spinner, { className: "ds-center", size: "lg" })
        ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { children: [
          /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
              SearchInput,
              {
                className: "ds-font-size-md",
                placeholder: _102("Search Objectclasses"),
                value: this.state.searchOCValue,
                onChange: this.handleOCSearchChange,
                onClear: (evt) => this.handleOCSearchChange(evt, "")
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
              Pagination,
              {
                itemCount: itemCountOc,
                page: pageOc,
                perPage: perPageOc,
                onSetPage: this.handleSetPageOc,
                widgetId: "pagination-step-objectclass",
                onPerPageSelect: this.handlePerPageSelectOc,
                variant: "top",
                isCompact: true
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(Table, { "aria-label": "Pagination All ObjectClasses", variant: "compact", children: [
            /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(Tr, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Th, { screenReaderText: "Selection column" }),
              columnsOc.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Th, { children: typeof column === "object" ? column.title : column }, columnIndex))
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Tbody, { children: pagedRowsOc.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(Tr, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
                Td,
                {
                  select: {
                    rowIndex,
                    onSelect: this.handleSelectOc,
                    isSelected: row.selected
                  }
                }
              ),
              row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
                Td,
                {
                  dataLabel: columnsOc[cellIndex]?.title || columnsOc[cellIndex],
                  children: typeof cell === "object" ? cell.title : cell
                },
                `${rowIndex}_${cellIndex}`
              ))
            ] }, rowIndex)) })
          ] })
        ] })
      ] });
      const attributeStep = /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "ds-container", children: [
          /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Text, { component: TextVariants.h3, children: _102("Select Attributes") }) }),
          this.buildAttrDropdown()
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
            SearchInput,
            {
              className: "ds-font-size-md",
              placeholder: _102("Search Attributes"),
              value: this.state.searchAttrValue,
              onChange: this.handleAttrSearchChange,
              onClear: (evt) => this.handleAttrSearchChange(evt, "")
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
            Pagination,
            {
              itemCount: itemCountAttr,
              page: pageAttr,
              perPage: perPageAttr,
              onSetPage: this.handleSetPageAttr,
              widgetId: "pagination-step-attributes",
              onPerPageSelect: this.handlePerPageSelectAttr,
              isCompact: true
            }
          ) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(Table, { "aria-label": "Pagination Attributes", variant: "compact", children: [
          /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(Tr, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Th, { screenReaderText: "Selection column" }),
            columnsAttr.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Th, { children: typeof column === "object" ? column.title : column }, columnIndex))
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Tbody, { children: pagedRowsAttr.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(Tr, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
              Td,
              {
                select: {
                  rowIndex,
                  onSelect: this.handleSelectAttr,
                  isSelected: row.selected,
                  isDisabled: row.disableCheckbox
                }
              }
            ),
            row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
              Td,
              {
                dataLabel: columnsAttr[cellIndex]?.title || columnsAttr[cellIndex],
                children: typeof cell === "object" ? cell.title : cell
              },
              `${rowIndex}_${cellIndex}`
            ))
          ] }, rowIndex)) })
        ] })
      ] });
      const myTitle = _102("DN ( Distinguished Name )");
      const entryValuesStep = /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
          Alert,
          {
            variant: namingAttr === "" || namingVal === "" ? "warning" : "success",
            isInline: true,
            title: myTitle,
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("b", { children: [
                _102("Entry DN:"),
                "\xA0\xA0\xA0"
              ] }),
              namingAttr || "??????",
              "=",
              namingVal || "??????",
              ",",
              this.props.wizardEntryDn
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(TextContent, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Text, { component: TextVariants.h3, children: _102("Set Attribute Values") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
          editableTable_default,
          {
            wizardEntryDn: this.props.wizardEntryDn,
            editableTableData,
            isAttributeSingleValued: this.isAttributeSingleValued,
            isAttributeRequired: this.isAttributeRequired,
            enableNextStep: this.enableNextStep,
            saveCurrentRows: this.saveCurrentRows,
            allObjectclasses: this.props.allObjectclasses,
            namingRowID: this.state.namingRowID,
            namingAttr: this.state.namingAttr,
            setNamingRowID: this.setNamingRowID
          },
          editableTableData
        )
      ] });
      const ldifListItems = cleanLdifArray.map(
        (line, index) => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(SimpleListItem, { isActive: line.startsWith("dn: "), children: line }, index)
      );
      const ldifStatementsStep = /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ds-addons-bottom-margin", children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
          Alert,
          {
            variant: "info",
            isInline: true,
            title: _102("LDIF Statements")
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(CardBody, { children: ldifListItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(SimpleList, { "aria-label": "LDIF data User", children: ldifListItems }) }) })
      ] });
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const entryReviewStep = /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "ds-addons-bottom-margin", children: /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
          Alert,
          {
            variant: resultVariant,
            isInline: true,
            title: _102("Result for Entry Modification"),
            children: [
              commandOutput,
              this.state.adding && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { children: [
                /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Spinner, { className: "ds-left-margin", size: "md" }),
                "\xA0\xA0",
                _102("Adding entry ...")
              ] })
            ]
          }
        ) }),
        resultVariant === "danger" && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(Card, { isSelectable: true, children: [
          /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(CardTitle, { children: _102("LDIF Data") }),
          /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(CardBody, { children: ldifLines.map((line) => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("h6", { children: line.data }, line.id)) })
        ] })
      ] });
      const addEntrySteps = [
        {
          id: 1,
          name: this.props.firstStep[0].name,
          component: this.props.firstStep[0].component,
          canJumpTo: stepIdReached >= 1 && stepIdReached < 6,
          hideBackButton: true
        },
        {
          id: 2,
          name: _102("Select ObjectClasses"),
          component: objectClassStep,
          canJumpTo: stepIdReached >= 2 && stepIdReached < 6,
          enableNext: selectedObjectClasses.length > 0
        },
        {
          id: 3,
          name: _102("Select Attributes"),
          component: attributeStep,
          canJumpTo: stepIdReached >= 3 && stepIdReached < 6,
          enableNext: selectedAttributes.length > 0
        },
        {
          id: 4,
          name: _102("Edit Values"),
          component: entryValuesStep,
          canJumpTo: stepIdReached >= 4 && stepIdReached < 6,
          enableNext: validMods
        },
        {
          id: 5,
          name: _102("LDIF Statements"),
          component: ldifStatementsStep,
          nextButtonText: _102("Create Entry"),
          canJumpTo: stepIdReached >= 5 && stepIdReached < 6
        },
        {
          id: 6,
          name: _102("Review Result"),
          component: entryReviewStep,
          nextButtonText: _102("Finish"),
          canJumpTo: stepIdReached >= 6,
          hideBackButton: this.state.resultVariant === "success" ? true : false,
          enableNext: !this.state.adding
        }
      ];
      const title = /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
        _102("Parent DN: "),
        "\xA0\xA0",
        /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("strong", { children: this.props.wizardEntryDn })
      ] });
      return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.props.handleToggleWizard,
          steps: addEntrySteps,
          title: _102("Add An LDAP Entry"),
          description: title,
          onNext: this.handleNext
        }
      );
    }
  };
  var addLdapEntry_default = AddLdapEntry;

  // src/lib/ldap_editor/wizards/operations/genericUpdate.jsx
  var import_react173 = __toESM(require_react(), 1);
  var import_jsx_runtime103 = __toESM(require_jsx_runtime(), 1);
  var _103 = cockpit_default.gettext;
  var GenericUpdate = class extends import_react173.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleSetPage", (_event, pageNumber) => {
        this.setState({
          page: pageNumber,
          pagedRowsAttrs: this.getAttributesToShow(pageNumber, this.state.perPage)
        });
      });
      __publicField(this, "handlePerPageSelect", (_event, perPage) => {
        this.setState({
          page: 1,
          perPage,
          pagedRowsAttrs: this.getAttributesToShow(1, perPage)
        });
      });
      __publicField(this, "isAttributeSingleValued", (attr) => {
        return SINGLE_VALUED_ATTRS.includes(attr);
      });
      __publicField(this, "isAttributeRequired", (attr) => {
        switch (this.props.entryType) {
          case ENTRY_TYPE.user:
            return PERSON_REQ_ATTRS.includes(attr);
          case ENTRY_TYPE.ou:
            return OU_REQ_ATTRS.includes(attr);
          case ENTRY_TYPE.other:
            return PERSON_REQ_ATTRS.includes(attr);
          default:
            console.log(`Unknown type of LDAP entry (${this.props.entryType})`);
        }
      });
      __publicField(this, "handleSelect", (event, isSelected, rowId) => {
        let rows;
        if (rowId === -1) {
          rows = this.state.rowsAttrs.map((oneRow) => {
            if (oneRow.disableSelection === false) {
              oneRow.selected = isSelected;
              oneRow.isAttributeSelected = isSelected;
            }
            return oneRow;
          });
          this.setState(
            {
              rowsAttrs: rows,
              allAttributesSelected: isSelected
              // TEKO - May 2021 // selectedAttributes
            },
            () => {
              this.setState({
                pagedRowsAttrs: this.getAttributesToShow(this.state.page, this.state.perPage)
              });
              this.updateValuesTableRows();
            }
          );
        } else {
          if (this.state.pagedRowsAttrs[rowId].disableSelection === true) {
            return;
          }
          rows = [...this.state.pagedRowsAttrs];
          rows[rowId].selected = isSelected;
          const attrName = this.state.pagedRowsAttrs[rowId].cells[0];
          const allItems = [...this.state.rowsAttrs];
          const index = allItems.findIndex((item) => item.cells[0] === attrName);
          allItems[index].isAttributeSelected = isSelected;
          const selectedAttributes = allItems.filter((item) => item.isAttributeSelected).map((selectedAttr) => selectedAttr.cells[0]);
          this.setState(
            {
              rowsAttrs: allItems,
              pagedRowsAttrs: rows,
              selectedAttributes
            },
            () => this.updateValuesTableRows()
          );
        }
      });
      __publicField(this, "updateValuesTableRows", (skipAttributeSelection) => {
        const newSelectedAttrs = this.state.allAttributesSelected ? [
          "cn",
          "sn",
          ...PERSON_OPT_ATTRS,
          ...ORG_PERSON_ATTRS,
          ...INET_ORG_ATTRS
        ] : [...this.state.selectedAttributes];
        let editableTableData = [];
        let namingRowID = this.state.namingRowID;
        let namingAttrVal = this.state.namingAttrVal;
        if (this.state.savedRows.length === 0) {
          editableTableData = newSelectedAttrs.map((attrName) => {
            const obj = {
              id: generateUniqueId(),
              attr: attrName,
              val: "",
              required: false,
              namingAttr: false
            };
            return obj;
          });
          editableTableData.sort((a2, b) => a2.attr > b.attr ? 1 : -1);
          if (this.props.entryType === ENTRY_TYPE.ou) {
            for (const attr of editableTableData) {
              if (attr.attr === "ou") {
                namingRowID = attr.id;
                namingAttrVal = editableTableData[0].attr + "=" + editableTableData[0].val;
                break;
              }
            }
          } else {
            namingRowID = editableTableData[0].id;
            namingAttrVal = editableTableData[0].attr + "=" + editableTableData[0].val;
          }
        } else {
          if (skipAttributeSelection) {
            editableTableData = [...this.state.savedRows];
          } else {
            const arrayOfAttrObjects = [...this.state.savedRows];
            for (const myAttr of newSelectedAttrs) {
              const found = arrayOfAttrObjects.find((el) => el.attr === myAttr);
              if (found === void 0) {
                arrayOfAttrObjects.push({
                  id: generateUniqueId(),
                  attr: myAttr,
                  val: "",
                  required: false,
                  namingAttr: false
                });
              }
            }
            editableTableData = arrayOfAttrObjects.filter((datum) => {
              const attrName = datum.attr;
              const found = newSelectedAttrs.find((attr) => attr === attrName);
              return found !== void 0;
            });
            editableTableData.sort((a2, b) => a2.attr > b.attr ? 1 : -1);
            if (this.props.entryType === ENTRY_TYPE.ou && namingRowID === -1) {
              for (const attr of editableTableData) {
                if (attr.attr === "ou") {
                  namingRowID = attr.id;
                  namingAttrVal = editableTableData[0].attr + "=" + editableTableData[0].val;
                  break;
                }
              }
            }
          }
        }
        this.setState({
          editableTableData,
          rdn: editableTableData[0].attr,
          namingRowID,
          namingAttrVal
        });
      });
      __publicField(this, "enableNextStep", (noEmptyValue) => {
        this.setState({ noEmptyValue });
      });
      __publicField(this, "setNamingRowID", (namingRowID) => {
        let namingAttrVal = "";
        for (const row of this.state.savedRows) {
          if (row.id === namingRowID) {
            namingAttrVal = row.attr + "=" + row.val;
            break;
          }
        }
        this.setState({
          namingRowID,
          namingAttrVal
        });
      });
      __publicField(this, "saveCurrentRows", (savedRows, namingID) => {
        this.setState(
          { savedRows },
          () => {
            if (namingID !== -1) {
              this.setNamingRowID(namingID);
            }
          }
        );
      });
      __publicField(this, "generateLdifData", () => {
        switch (this.props.entryType) {
          case ENTRY_TYPE.user:
            this.generateLdifDataUser();
            break;
          case ENTRY_TYPE.ou:
            this.generateLdifDataOu();
            break;
          case ENTRY_TYPE.other:
            this.generateLdifDataOther();
            break;
          default:
            console.log(`Unknown type of LDAP entry (${this.props.entryType})`);
        }
      });
      __publicField(this, "generateLdifDataUser", () => {
        const objectClassData = ["ObjectClass: top", "ObjectClass: Person"];
        if (this.state.allAttributesSelected) {
          objectClassData.push(
            "ObjectClass: OrganizationalPerson",
            "ObjectClass: InetOrgPerson"
          );
        }
        const valueData = [];
        for (const item of this.state.savedRows) {
          const attrName = item.attr;
          valueData.push(`${attrName}: ${item.val}`);
          if (objectClassData.length === 4) {
            continue;
          }
          if (!objectClassData.includes("ObjectClass: InetOrgPerson") && INET_ORG_ATTRS.includes(attrName)) {
            objectClassData.push("ObjectClass: InetOrgPerson");
          }
          if (!objectClassData.includes("ObjectClass: OrganizationalPerson") && ORG_PERSON_ATTRS.includes(attrName)) {
            objectClassData.push("ObjectClass: OrganizationalPerson");
          }
        }
        const ldifArray = [
          `dn: ${this.state.namingAttrVal},${this.props.wizardEntryDn}`,
          ...objectClassData,
          ...valueData
        ];
        this.setState({ ldifArray });
      });
      __publicField(this, "generateLdifDataOu", () => {
        const objectClassData = ["ObjectClass: top", "ObjectClass: organizationalUnit"];
        const valueData = [];
        let rdnValue = "";
        for (const item of this.state.savedRows) {
          const attrName = item.attr;
          valueData.push(`${attrName}: ${item.val}`);
          if (attrName === "ou") {
            rdnValue = item.val;
          }
        }
        const ldifArray = [
          `dn: ou=${rdnValue},${this.props.wizardEntryDn}`,
          ...objectClassData,
          ...valueData
        ];
        this.setState({ ldifArray });
      });
      this.attributeValidationRules = [
        {
          name: _103("required"),
          validator: (value) => value.trim() !== "",
          errorText: _103("This field is required")
        }
      ];
      this.state = {
        alertVariant: "info",
        namingRowID: -1,
        namingAttrVal: "",
        ldifArray: [],
        savedRows: [],
        commandOutput: "",
        resultVariant: "default",
        allAttributesSelected: false,
        stepIdReached: 1,
        itemCount: 0,
        page: 1,
        perPage: 10,
        columnsAttrs: [
          { title: _103("Attribute Name"), cellTransforms: [headerCol()] },
          { title: _103("From ObjectClass") }
        ],
        rowsAttrs: [],
        pagedRowsAttrs: [],
        selectedAttributes: [],
        // Values
        noEmptyValue: false,
        columnsValues: [
          _103("Attribute"),
          _103("Value")
        ],
        rowsValues: [],
        // Review step
        reviewValue: "",
        reviewInvalidText: "Invalid LDIF",
        reviewIsValid: true,
        reviewValidated: "default",
        editableTableData: [],
        namingAttr: "",
        adding: true
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 3) {
          this.updateValuesTableRows();
        } else if (id === 4) {
          this.generateLdifData();
        } else if (id === 5) {
          const myLdifArray = this.state.ldifArray;
          createLdapEntry(
            this.props.editorLdapServer,
            myLdifArray,
            (result) => {
              this.setState({
                commandOutput: result.errorCode === 0 ? _103("Successfully added entry!") : _103("Failed to add entry: ") + result.output,
                resultVariant: result.errorCode === 0 ? "success" : "danger",
                adding: false
              }, () => {
                this.props.onReload();
              });
              const myDn = myLdifArray[0].substring(4);
              const opInfo = {
                operationType: "ADD",
                resultCode: result.errorCode,
                time: Date.now(),
                entryDn: myDn,
                relativeDn: this.state.namingAttrVal
              };
              this.props.setWizardOperationInfo(opInfo);
            }
          );
        }
      };
      this.handleBack = ({ id }) => {
        if (id === 3) {
          this.updateValuesTableRows(true);
        }
      };
    }
    componentDidMount() {
      console.log("In GenericUpdate - componentDidMount()");
      const attributesArray = [];
      let namingAttr = "";
      switch (this.props.entryType) {
        case ENTRY_TYPE.user:
          this.requiredAttributes = ["cn", "sn"];
          attributesArray.push({
            cells: ["cn", "Person"],
            selected: true,
            isAttributeSelected: true,
            // disableCheckbox: true
            disableSelection: true
          });
          attributesArray.push({
            cells: ["sn", "Person"],
            selected: true,
            isAttributeSelected: true,
            // disableCheckbox: true
            disableSelection: true
          });
          PERSON_OPT_ATTRS.map((attr) => {
            attributesArray.push({ cells: [attr, "Person"] });
            return [];
          });
          ORG_PERSON_ATTRS.map((attr) => {
            attributesArray.push({ cells: [attr, "OrganizationalPerson"] });
            return [];
          });
          INET_ORG_ATTRS.map((attr) => {
            attributesArray.push({ cells: [attr, "InetOrgPerson"] });
            return [];
          });
          break;
        case ENTRY_TYPE.ou:
          this.requiredAttributes = ["ou"];
          attributesArray.push({
            cells: ["ou", "OrganizationalUnit"],
            selected: true,
            isAttributeSelected: true,
            // disableCheckbox: true
            disableSelection: true,
            namingAttrVal: ""
          });
          OU_OPT_ATTRS.map((attr) => {
            attributesArray.push({ cells: [attr, "OrganizationalUnit"] });
            return [];
          });
          namingAttr = "ou";
          break;
        case ENTRY_TYPE.other:
          break;
        default:
          console.log(`Unknown type of LDAP entry (${this.props.entryType})`);
      }
      this.setState({
        selectedAttributes: [...this.requiredAttributes],
        itemCount: attributesArray.length,
        rowsAttrs: attributesArray,
        pagedRowsAttrs: attributesArray.slice(0, this.state.perPage),
        namingAttr
      });
    }
    getAttributesToShow(page, perPage) {
      const start2 = (page - 1) * perPage;
      const end2 = page * perPage;
      const newRows = this.state.rowsAttrs.slice(start2, end2);
      return newRows;
    }
    render() {
      const {
        commandOutput,
        itemCount,
        page,
        perPage,
        columnsAttrs,
        pagedRowsAttrs,
        ldifArray,
        noEmptyValue,
        alertVariant,
        namingAttrVal,
        stepIdReached,
        resultVariant
      } = this.state;
      const attributesStep = /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Text, { component: TextVariants.h3, children: _103("Select Entry Attributes") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
          Pagination,
          {
            itemCount,
            page,
            perPage,
            onSetPage: this.handleSetPage,
            widgetId: "pagination-options-menu-add-entry",
            onPerPageSelect: this.handlePerPageSelect,
            isCompact: true
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(
          Table,
          {
            "aria-label": "Attributes Table",
            variant: "compact",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(Tr, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Th, { screenReaderText: "Select Attributes" }),
                columnsAttrs.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Th, { children: typeof column === "object" ? column.title : column }, columnIndex))
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Tbody, { children: pagedRowsAttrs.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(Tr, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
                  Td,
                  {
                    select: {
                      rowIndex,
                      onSelect: this.handleSelect,
                      isSelected: row.selected,
                      isDisabled: row.disableSelection
                    }
                  }
                ),
                row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
                  Td,
                  {
                    dataLabel: columnsAttrs[cellIndex]?.title || columnsAttrs[cellIndex],
                    children: cell
                  },
                  `${rowIndex}_${cellIndex}`
                ))
              ] }, rowIndex)) })
            ]
          }
        )
      ] });
      const rdnValue = namingAttrVal.split("=")[1];
      const myTitle = namingAttrVal === "" || rdnValue === "" ? _103("Invalid RDN - Empty Value!") : _103("DN ( Distinguished Name )");
      const missingRdn = rdnValue === "" || rdnValue === void 0;
      const valuesStep = /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(import_jsx_runtime103.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
          Alert,
          {
            variant: alertVariant,
            isInline: true,
            title: myTitle,
            children: !missingRdn && /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(import_jsx_runtime103.Fragment, { children: [
              _103("The full DN of the entry will be: "),
              /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("strong", { children: [
                namingAttrVal,
                ",",
                this.props.wizardEntryDn
              ] })
            ] })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
          editableTable_default,
          {
            editableTableData: this.state.editableTableData,
            isAttributeSingleValued: this.isAttributeSingleValued,
            isAttributeRequired: this.isAttributeRequired,
            enableNextStep: this.enableNextStep,
            setNamingRowID: this.setNamingRowID,
            namingRowID: this.state.namingRowID,
            saveCurrentRows: this.saveCurrentRows,
            namingAttr: this.state.namingAttr
          }
        )
      ] });
      const ldifListItems = ldifArray.map(
        (line, index) => /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(SimpleListItem, { isActive: line.startsWith("dn: "), children: line }, index)
      );
      const creationStep = /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
          Alert,
          {
            variant: "info",
            isInline: true,
            title: _103("LDIF Content for Entry Creation")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(CardBody, { children: ldifListItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(SimpleList, { "aria-label": "LDIF data", children: ldifListItems }) }) })
      ] });
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const reviewStep = /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(
          Alert,
          {
            variant: resultVariant,
            isInline: true,
            title: _103("Result for Entry Creation"),
            children: [
              commandOutput,
              this.state.adding && /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { children: [
                /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Spinner, { className: "ds-left-margin", size: "md" }),
                "\xA0\xA0",
                _103("Adding entry ...")
              ] })
            ]
          }
        ),
        resultVariant === "danger" && /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(Card, { isSelectable: true, children: [
          /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(CardTitle, { children: _103("LDIF Data") }),
          /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(CardBody, { children: ldifLines.map((line) => /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("h6", { children: line.data }, line.id)) })
        ] })
      ] });
      const creationStepName = this.props.entryType === ENTRY_TYPE.user ? _103("Create User") : this.props.entryType === ENTRY_TYPE.ou ? _103("Create Organizational Unit") : _103("Create LDAP Entry");
      const addSteps = [
        {
          id: 1,
          name: this.props.firstStep[0].name,
          component: this.props.firstStep[0].component,
          canJumpTo: stepIdReached >= 1 && stepIdReached < 5,
          hideBackButton: true
        },
        {
          id: 2,
          name: _103("Select Attributes"),
          component: attributesStep,
          canJumpTo: stepIdReached >= 2 && stepIdReached < 5
        },
        {
          id: 3,
          name: _103("Set Values"),
          component: valuesStep,
          canJumpTo: stepIdReached >= 3 && stepIdReached < 5,
          enableNext: noEmptyValue
        },
        {
          id: 4,
          name: creationStepName,
          component: creationStep,
          nextButtonText: _103("Create"),
          canJumpTo: stepIdReached >= 4 && stepIdReached < 5
        },
        {
          id: 5,
          name: _103("Review Result"),
          component: reviewStep,
          nextButtonText: _103("Finish"),
          canJumpTo: stepIdReached >= 5 && stepIdReached < 5,
          hideBackButton: this.state.resultVariant === "success" ? true : false,
          enableNext: !this.state.adding
        }
      ];
      const wizardTitle = this.props.entryType === ENTRY_TYPE.user ? _103("Add A New User") : this.props.entryType === ENTRY_TYPE.ou ? _103("Add An Organizational Unit") : _103("Add A New LDAP Entry");
      const desc = /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(import_jsx_runtime103.Fragment, { children: [
        _103("Parent DN: "),
        "\xA0\xA0",
        /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("strong", { children: this.props.wizardEntryDn })
      ] });
      return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.props.handleToggleWizard,
          onNext: this.handleNext,
          onBack: this.handleBack,
          title: wizardTitle,
          description: desc,
          steps: addSteps
        }
      );
    }
  };
  var genericUpdate_default = GenericUpdate;

  // src/lib/ldap_editor/wizards/newEntry.jsx
  var import_jsx_runtime104 = __toESM(require_jsx_runtime(), 1);
  var _104 = cockpit_default.gettext;
  var NewEntryWizard = class extends import_react174.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "handleOnChange", (_113, event) => {
        this.setState({ getStartedStepRadio: event.currentTarget.value });
      });
      __publicField(this, "onToggleWizard", () => {
        this.props.handleToggleWizard();
      });
      __publicField(this, "createInitialLayout", () => {
        if (this.props.createRootEntry) {
          return [
            {
              id: 1,
              name: _104("Get Started"),
              component: /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(Card, { isSelectable: true, children: [
                /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(CardTitle, { children: _104("Requirement for a root entry creation") }),
                /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
                  Alert,
                  {
                    variant: "info",
                    isInline: true,
                    title: _104("The object class must contain the attribute used to name the suffix.")
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(CardBody, { children: _104("For example, if the entry corresponds to the suffix <code>ou=people,dc=example,dc=com</code>, then choose the<code>organizationalUnit</code>object class or another object class that allows the <code>ou</code> attribute.") }),
                /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(
                  Alert,
                  {
                    variant: "custom",
                    isInline: true,
                    title: cockpit_default.format(_104("The root entry to create is $0"), this.props.entryParentDn),
                    children: [
                      _104("Make sure to select an <strong>ObjectClass</strong>that allows or requires the attribute"),
                      /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("strong", { children: [
                        " ",
                        this.props.entryParentDn.split("=")[0]
                      ] })
                    ]
                  }
                ) })
              ] })
            }
          ];
        }
        return [
          {
            id: 1,
            name: _104("Get Started"),
            component: /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { children: [
              /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
                Radio,
                {
                  value: "User",
                  isChecked: this.state.getStartedStepRadio === "User",
                  onChange: (event, _113) => this.handleOnChange(_113, event),
                  label: _104("Create a new User"),
                  description: _104("Add a new User (inetOrgPerson objectClass)"),
                  name: "radio-new-step-start",
                  id: "radio-new-step-start-1"
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
                Radio,
                {
                  className: "ds-margin-top-lg",
                  value: "Group",
                  isChecked: this.state.getStartedStepRadio === "Group",
                  onChange: (event, _113) => this.handleOnChange(_113, event),
                  label: _104("Create a new Group"),
                  description: _104("Add a new Group (GroupOfNames/GroupOfUniqueNames objectClass)"),
                  name: "group",
                  id: "radio-new-step-start-2"
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
                Radio,
                {
                  className: "ds-margin-top-lg",
                  value: "OrganizationalUnit",
                  isChecked: this.state.getStartedStepRadio === "OrganizationalUnit",
                  onChange: (event, _113) => this.handleOnChange(_113, event),
                  label: _104("Create a new Organizational Unit"),
                  description: _104("Add a new Organizational Unit"),
                  name: "radio-new-step-start",
                  id: "radio-new-step-start-3"
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
                Radio,
                {
                  className: "ds-margin-top-lg",
                  value: "Role",
                  isChecked: this.state.getStartedStepRadio === "Role",
                  onChange: (event, _113) => this.handleOnChange(_113, event),
                  label: _104("Create a new Role"),
                  description: _104("Add a new Role (Filtered / Managed / Nested)"),
                  name: "radio-new-step-start",
                  id: "radio-new-step-start-4"
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
                Radio,
                {
                  className: "ds-margin-top-lg",
                  value: "Other",
                  isChecked: this.state.getStartedStepRadio === "Other",
                  onChange: (event, _113) => this.handleOnChange(_113, event),
                  label: _104("Create a new custom Entry"),
                  description: _104("Add a new entry by selecting ObjectClasses and Attributes"),
                  name: "radio-new-step-start",
                  id: "radio-new-step-start-7"
                }
              )
            ] })
          }
        ];
      });
      this.state = {
        stepIdReached: 1,
        getStartedStepRadio: "User"
      };
    }
    render() {
      const {
        getStartedStepRadio
      } = this.state;
      const initialStep = this.createInitialLayout();
      const wizardProps = {
        isWizardOpen: this.props.isWizardOpen,
        handleToggleWizard: this.props.handleToggleWizard,
        wizardEntryDn: this.props.wizardEntryDn,
        editorLdapServer: this.props.editorLdapServer,
        setWizardOperationInfo: this.props.setWizardOperationInfo,
        firstStep: initialStep,
        onReload: this.props.onReload,
        addNotification: this.props.addNotification
      };
      if (getStartedStepRadio === "User") {
        return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
          addUser_default,
          {
            ...wizardProps
          }
        );
      } else if (getStartedStepRadio === "Group") {
        return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
          addGroup_default,
          {
            ...wizardProps,
            treeViewRootSuffixes: this.props.treeViewRootSuffixes
          }
        );
      } else if (getStartedStepRadio === "Role") {
        return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
          addRole_default,
          {
            ...wizardProps,
            treeViewRootSuffixes: this.props.treeViewRootSuffixes
          }
        );
      } else if (getStartedStepRadio === "OrganizationalUnit") {
        return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
          genericUpdate_default,
          {
            editorLdapServer: this.props.editorLdapServer,
            entryType: ENTRY_TYPE.ou,
            isWizardOpen: this.props.isWizardOpen,
            handleToggleWizard: this.onToggleWizard,
            setWizardOperationInfo: this.props.setWizardOperationInfo,
            wizardEntryDn: this.props.wizardEntryDn,
            firstStep: initialStep,
            onReload: this.props.onReload
          }
        );
      } else {
        return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
          addLdapEntry_default,
          {
            allObjectclasses: this.props.allObjectclasses,
            ...wizardProps
          }
        );
      }
    }
  };
  var newEntry_default = NewEntryWizard;

  // src/lib/ldap_editor/wizards/operations/editLdapEntry.jsx
  var import_react177 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/wizards/operations/editGroup.jsx
  var import_react176 = __toESM(require_react(), 1);

  // src/lib/ldap_editor/wizards/operations/groupTable.jsx
  var import_react175 = __toESM(require_react(), 1);
  var import_jsx_runtime105 = __toESM(require_jsx_runtime(), 1);
  var _105 = cockpit_default.gettext;
  var GroupTable = class extends import_react175.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "getRowsToShow", (rows, page, perPage) => {
        const start2 = (page - 1) * perPage;
        const end2 = page * perPage;
        return rows.slice(start2, end2);
      });
      __publicField(this, "getActionsForRow", (rowData) => {
        if (rowData.cells.length === 1 && rowData.cells[0] === _105("No Members")) {
          return [];
        }
        if (!rowData.cells) {
          return [];
        }
        return [
          {
            title: _105("View Entry"),
            onClick: () => this.props.viewEntry(rowData.cells[0])
          },
          {
            title: _105("Edit Entry"),
            onClick: () => this.props.editEntry(rowData.cells[0])
          },
          {
            isSeparator: true
          },
          {
            title: _105("Remove Entry"),
            onClick: () => this.props.removeMember(rowData.cells[0])
          }
        ];
      });
      this.state = {
        page: 1,
        perPage: 10,
        value: "",
        sortBy: {},
        rows: [],
        columns: [
          { title: _105("Member DN"), sort: "asc" }
        ],
        pagedRows: []
      };
      this.selectedCount = 0;
      this.handleSetPage = (_event, pageNumber) => {
        this.setState({
          page: pageNumber,
          pagedRows: this.getRowsToShow(this.state.rows, pageNumber, this.state.perPage)
        });
      };
      this.handlePerPageSelect = (_event, perPage) => {
        this.setState({
          perPage,
          page: 1,
          pagedRows: this.getRowsToShow(this.state.rows, 1, perPage)
        });
      };
      this.handleSort = this.handleSort.bind(this);
      this.handleSearchChange = this.handleSearchChange.bind(this);
    }
    componentDidMount() {
      let rows = [];
      const columns = this.state.columns;
      for (const attrRow of this.props.rows) {
        let selected = false;
        if (this.props.delMemberList.includes(attrRow)) {
          selected = true;
        }
        rows.push({
          cells: [attrRow],
          selected
        });
      }
      if (rows.length === 0) {
        rows = [{ cells: [_105("No Members")], disableSelection: true }];
      }
      this.setState({
        rows,
        columns,
        pagedRows: this.getRowsToShow(rows, 1, this.state.perPage)
      });
    }
    handleSearchChange(event, value) {
      let rows = [];
      const val = value.toLowerCase();
      for (const row of this.props.rows) {
        if (val !== "" && val !== "*" && row.indexOf(val) === -1) {
          continue;
        }
        rows.push({
          cells: [row]
        });
      }
      if (rows.length === 0) {
        rows = [{ cells: [_105("No Members")], disableSelection: true }];
      }
      this.setState({
        rows,
        value,
        page: 1,
        pagedRows: this.getRowsToShow(rows, 1, this.state.perPage)
      });
    }
    handleSort(_event, columnIndex, sortDirection) {
      const rows = [];
      const sortedAttrs = [...this.props.rows];
      sortedAttrs.sort();
      if (sortDirection !== "asc") {
        sortedAttrs.reverse();
      }
      for (const attrRow of sortedAttrs) {
        rows.push({ cells: [attrRow] });
      }
      this.setState({
        sortBy: {
          index: columnIndex,
          direction: sortDirection
        },
        rows,
        page: 1,
        pagedRows: this.getRowsToShow(rows, 1, this.state.perPage)
      });
    }
    render() {
      const { columns, pagedRows, perPage, page, sortBy } = this.state;
      const extraPrimaryProps = {};
      let deleteBtnName = _105("Remove Selected Members");
      if (this.props.saving) {
        deleteBtnName = _105("Updating group ...");
        extraPrimaryProps.spinnerAriaValueText = _105("Updating");
      }
      return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "ds-margin-top-xlg ds-indent", children: [
        /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
          SearchInput,
          {
            className: "ds-margin-top",
            placeholder: _105("Search Members"),
            value: this.state.value,
            onChange: this.handleSearchChange,
            onClear: (evt) => this.handleSearchChange(evt, "")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(Table, { "aria-label": "group table", variant: "compact", children: [
          /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(Tr, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Th, { screenReaderText: "Selector" }),
            /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
              Th,
              {
                sort: {
                  sortBy,
                  onSort: this.handleSort,
                  columnIndex: 1
                },
                children: columns[0].title
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Th, { screenReaderText: "Actions" })
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Tbody, { children: pagedRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(Tr, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
              Td,
              {
                select: {
                  rowIndex,
                  onSelect: (_event, isSelecting) => {
                    this.props.onSelectMember(row.cells[0], isSelecting);
                  },
                  isSelected: row.selected,
                  isDisabled: row.disableSelection
                }
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Td, { children: row.cells[0] }),
            /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Td, { isActionCell: true, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
              ActionsColumn,
              {
                items: this.getActionsForRow(row)
              }
            ) })
          ] }, rowIndex)) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
          Pagination,
          {
            itemCount: this.props.rows.length,
            widgetId: "pagination-options-menu-bottom",
            perPage,
            page,
            onSetPage: this.handleSetPage,
            onPerPageSelect: this.handlePerPageSelect
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
          Button,
          {
            isDisabled: this.props.delMemberList.length === 0 || this.props.saving,
            variant: "primary",
            onClick: this.props.handleShowConfirmBulkDelete,
            isLoading: this.props.saving,
            ...extraPrimaryProps,
            children: deleteBtnName
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Divider, { className: "ds-margin-top-lg" })
      ] });
    }
  };
  var groupTable_default = GroupTable;

  // src/lib/ldap_editor/wizards/operations/editGroup.jsx
  var import_jsx_runtime106 = __toESM(require_jsx_runtime(), 1);
  var _106 = cockpit_default.gettext;
  var EditGroup = class extends import_react176.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        activeTabKey: 0,
        saving: false,
        isTreeLoading: false,
        members: [],
        searching: false,
        searchPattern: "",
        showLDAPNavModal: false,
        usersSearchBaseDn: "",
        usersAvailableOptions: [],
        usersChosenOptions: [],
        ldifArray: [],
        showConfirmMemberDelete: false,
        showConfirmBulkDelete: false,
        modalOpen: true,
        modalSpinning: false,
        modalChecked: false,
        delMember: "",
        bulkDeleting: false,
        delMemberList: [],
        showViewEntry: false
      };
      this.handleNavSelect = (event, tabIndex) => {
        event.preventDefault();
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.onBaseDnSelection = (treeViewItem) => {
        this.setState({
          usersSearchBaseDn: treeViewItem.dn
        });
      };
      this.showTreeLoadingState = (isTreeLoading) => {
        this.setState({
          isTreeLoading,
          searching: !!isTreeLoading
        });
      };
      this.handleOpenLDAPNavModal = () => {
        this.setState({
          showLDAPNavModal: true
        });
      };
      this.handleCloseLDAPNavModal = () => {
        this.setState({
          showLDAPNavModal: false
        });
      };
      this.handleCloseModal = () => {
        this.setState({
          modalOpen: false
        });
      };
      this.handleSearchClick = () => {
        this.setState({
          isSearchRunning: true,
          usersAvailableOptions: []
        }, () => {
          this.getEntries();
        });
      };
      this.handleSearchPattern = (searchPattern) => {
        this.setState({ searchPattern });
      };
      this.getEntries = () => {
        const baseDn = this.state.usersSearchBaseDn;
        const pattern = this.state.searchPattern;
        const coreFilter = "(|(objectClass=person)(objectClass=nsPerson)(objectClass=nsAccount)(objectClass=nsOrgPerson)(objectClass=posixAccount)(objectClass=groupOfNames)(objectClass=groupOfUniqueNames)(objectClass=posixGroup))";
        const filter = pattern === "" || pattern === "*" ? coreFilter : "(&" + coreFilter + `(|(cn=*${pattern}*)(uid=*${pattern}*)))`;
        const attrs = "dn";
        const params = {
          serverId: this.props.editorLdapServer,
          baseDn,
          scope: "sub",
          filter,
          attributes: attrs
        };
        runGenericSearch(params, (resultArray) => {
          const newOptionsArray = resultArray.map((result) => {
            const lines = result.split("\n");
            const dnEncoded = lines[0].indexOf(":: ");
            let dnLine = lines[0];
            if (dnEncoded > 0) {
              const decoded = decodeLine(dnLine);
              dnLine = decoded[1];
            } else {
              dnLine = dnLine.substring(4);
            }
            if (dnLine === props.groupdn) {
              return "skip";
            }
            for (const cOption of this.state.usersChosenOptions) {
              if (cOption.props.title === dnLine) {
                return "skip";
              }
            }
            if (this.props.members.includes(dnLine)) {
              return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "ds-pf-green-color", title: dnLine + " (ALREADY A MEMBER)", children: dnLine }, dnLine);
            } else {
              return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { title: dnLine, children: dnLine }, dnLine);
            }
          }).filter((member_option) => member_option !== "skip");
          newOptionsArray.sort((a2, b) => a2.props.children > b.props.children ? 1 : -1);
          this.setState({
            usersAvailableOptions: newOptionsArray,
            isSearchRunning: false
          });
        });
      };
      this.handleUsersOnListChange = (_event, newAvailableOptions, newChosenOptions) => {
        const newNewAvailOptions = [...newAvailableOptions];
        const newNewChosenOptions = [];
        for (const option of newChosenOptions) {
          if ("className" in option.props && option.props.className.indexOf("ds-pf-green-color") !== -1) {
            newNewAvailOptions.push(option);
          } else {
            newNewChosenOptions.push(option);
          }
        }
        this.setState({
          usersAvailableOptions: newNewAvailOptions.sort((a2, b) => a2.props.children > b.props.children ? 1 : -1),
          usersChosenOptions: newNewChosenOptions.sort((a2, b) => a2.props.children > b.props.children ? 1 : -1)
        });
      };
      this.showConfirmMemberDelete = this.showConfirmMemberDelete.bind(this);
      this.closeConfirmMemberDelete = this.closeConfirmMemberDelete.bind(this);
      this.showConfirmBulkDelete = this.showConfirmBulkDelete.bind(this);
      this.closeConfirmBulkDelete = this.closeConfirmBulkDelete.bind(this);
      this.handleAddMembers = this.handleAddMembers.bind(this);
      this.delMember = this.delMember.bind(this);
      this.handleSelectMember = this.handleSelectMember.bind(this);
      this.delBulkMembers = this.delBulkMembers.bind(this);
      this.onModalChange = this.onModalChange.bind(this);
      this.handleSwitchEditor = this.handleSwitchEditor.bind(this);
      this.editEntry = this.editEntry.bind(this);
      this.viewEntry = this.viewEntry.bind(this);
      this.handleCloseViewEntry = this.handleCloseViewEntry.bind(this);
    }
    componentDidMount() {
      this.setState({
        members: [...this.props.members],
        _members: [...this.props.members],
        usersSearchBaseDn: getBaseDNFromTree(this.props.groupdn, this.props.treeViewRootSuffixes)
      });
    }
    handleSwitchEditor() {
      this.setState({
        modalOpen: false
      }, () => {
        this.props.onReload(1);
        this.props.useGenericEditor();
      });
    }
    editEntry(memberdn) {
      this.setState({
        modalOpen: false
      });
      this.props.openEditEntry(memberdn);
    }
    viewEntry(memberdn) {
      getBaseLevelEntryAttributes(
        this.props.editorLdapServer,
        memberdn,
        (entryDetails) => {
          const ldifArray = [];
          entryDetails.filter((data) => data.attribute + data.value !== "" && // Filter out empty lines
          data.attribute !== "???: ").map((line, index) => {
            if (index === 1e3) {
              ldifArray.push({
                attribute: "... Truncated",
                value: " - Entry too large to display ..."
              });
              return [];
            } else if (index > 1e3) {
              return [];
            }
            ldifArray.push(line);
            return [];
          });
          this.setState({
            showViewEntry: true,
            ldifArray
          });
        }
      );
    }
    handleCloseViewEntry() {
      this.setState({
        showViewEntry: false,
        ldifArray: []
      });
    }
    onModalChange(e) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      this.setState({
        [e.target.id]: value
      });
    }
    showConfirmMemberDelete(name2) {
      const ldifArray = [];
      let memberAttr = "uniquemember";
      if (this.props.isGroupOfNames) {
        memberAttr = "member";
      }
      ldifArray.push(`dn: ${this.props.groupdn}`);
      ldifArray.push("changetype: modify");
      ldifArray.push(`delete:  ${memberAttr}`);
      ldifArray.push(`${memberAttr}: ${name2}`);
      this.setState({
        showConfirmMemberDelete: true,
        delMember: name2,
        modalChecked: false,
        modalSpinning: false,
        ldifArray
      });
    }
    closeConfirmMemberDelete() {
      this.setState({
        showConfirmMemberDelete: false,
        modalSpinning: false,
        modalChecked: false,
        delMember: ""
      });
    }
    handleAddMembers() {
      const params = { serverId: this.props.editorLdapServer };
      const ldifArray = [];
      let memberAttr = "uniquemember";
      let memCount = 0;
      this.setState({
        saving: true
      });
      if (this.props.isGroupOfNames) {
        memberAttr = "member";
      }
      ldifArray.push(`dn: ${this.props.groupdn}`);
      ldifArray.push("changetype: modify");
      for (const user of this.state.usersChosenOptions) {
        ldifArray.push(`add:  ${memberAttr}`);
        ldifArray.push(`${memberAttr}: ${user.props.title}`);
        ldifArray.push("-");
        memCount += 1;
      }
      modifyLdapEntry(params, ldifArray, (result) => {
        if (result.errorCode === 0) {
          const value1 = memCount > 1 ? "s" : "";
          this.props.addNotification(
            "success",
            cockpit_default.format(_106("Successfully added $0 member $1"), memCount, value1)
          );
        } else {
          this.props.addNotification(
            "error",
            _106("Failed to update group: ") + result.output
          );
        }
        this.setState({
          saving: false,
          usersChosenOptions: []
        }, () => {
          this.props.onReload(1);
        });
      });
    }
    delMember() {
      const params = { serverId: this.props.editorLdapServer };
      modifyLdapEntry(params, this.state.ldifArray, (result) => {
        if (result.errorCode === 0) {
          this.props.addNotification(
            "success",
            _106("Successfully updated group")
          );
        } else {
          this.props.addNotification(
            "error",
            _106("Failed to update group: ") + result.output
          );
        }
        this.setState({
          showConfirmMemberDelete: false,
          showConfirmBulkDelete: false,
          bulkDeleting: false
        }, () => {
          this.props.onReload(1);
        });
      });
    }
    handleSelectMember(memberdn, isSelected) {
      const delMemList = [...this.state.delMemberList];
      if (isSelected) {
        if (!delMemList.includes(memberdn)) {
          delMemList.push(memberdn);
        }
      } else {
        const idx = delMemList.indexOf(memberdn);
        if (idx !== -1) {
          delMemList.splice(idx, 1);
        }
      }
      this.setState({
        delMemberList: delMemList
      });
    }
    showConfirmBulkDelete() {
      this.setState({
        showConfirmBulkDelete: true,
        modalChecked: false,
        modalSpinning: false
      });
    }
    closeConfirmBulkDelete() {
      this.setState({
        showConfirmBulkDelete: false
      });
    }
    delBulkMembers() {
      if (this.state.delMemberList.length === 0) {
        return;
      }
      this.setState({
        bulkDeleting: true
      });
      const ldifArray = [];
      let memberAttr = "uniquemember";
      if (this.props.isGroupOfNames) {
        memberAttr = "member";
      }
      ldifArray.push(`dn: ${this.props.groupdn}`);
      ldifArray.push("changetype: modify");
      for (const member of this.state.delMemberList) {
        ldifArray.push(`delete:  ${memberAttr}`);
        ldifArray.push(`${memberAttr}: ${member}`);
        ldifArray.push(`-`);
      }
      this.setState({
        ldifArray
      }, () => this.delMember());
    }
    render() {
      const {
        usersSearchBaseDn,
        usersAvailableOptions,
        usersChosenOptions,
        showLDAPNavModal,
        members,
        modalOpen,
        saving,
        delMemberList,
        showViewEntry,
        ldifArray
      } = this.state;
      const title = /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(import_jsx_runtime106.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(UsersIcon, {}),
        "\xA0\xA0",
        this.props.groupdn
      ] });
      const extraPrimaryProps = {};
      let saveBtnName = _106("Add Members");
      if (saving) {
        saveBtnName = _106("Saving ...");
        extraPrimaryProps.spinnerAriaValueText = _106("Saving");
      }
      const delMemList = this.state.delMemberList.map((member) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: "ds-left-margin ds-left-align", children: member }, member));
      return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
        Modal,
        {
          className: "ds-modal-select-tall",
          variant: ModalVariant.large,
          title,
          isOpen: modalOpen,
          onClose: this.handleCloseModal,
          actions: [
            /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
              Button,
              {
                variant: "secondary",
                onClick: this.handleSwitchEditor,
                className: "ds-float-right",
                children: _106("Switch To Generic Editor")
              },
              "switch"
            )
          ],
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Tabs, { activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
              /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
                Tab,
                {
                  eventKey: 0,
                  title: /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(TabTitleText, { children: [
                    _106("Current Members"),
                    " ",
                    /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("font", { size: "2", children: [
                      "(",
                      this.props.members.length,
                      ")"
                    ] })
                  ] }),
                  children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
                    groupTable_default,
                    {
                      rows: members,
                      removeMember: this.showConfirmMemberDelete,
                      onSelectMember: this.handleSelectMember,
                      handleShowConfirmBulkDelete: this.showConfirmBulkDelete,
                      delMemberList,
                      viewEntry: this.viewEntry,
                      editEntry: this.props.openEditEntry,
                      saving: this.state.bulkDeleting
                    },
                    members + delMemberList
                  )
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(TabTitleText, { children: _106("Find New Members") }), children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Form, { autoComplete: "off", children: /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Grid, { className: "ds-indent", children: [
                /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(GridItem, { span: 12, className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Text, { children: [
                  _106("Search Base:"),
                  /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
                    Text,
                    {
                      className: "ds-left-margin",
                      component: TextVariants.a,
                      onClick: this.handleOpenLDAPNavModal,
                      href: "#",
                      children: usersSearchBaseDn
                    }
                  )
                ] }) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(GridItem, { span: 12, className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
                  SearchInput,
                  {
                    placeholder: _106("Find members..."),
                    value: this.state.searchPattern,
                    onChange: (evt, val) => this.handleSearchPattern(val),
                    onSearch: this.handleSearchClick,
                    onClear: () => {
                      this.handleSearchPattern("");
                    }
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(GridItem, { span: 12, className: "ds-margin-top-xlg", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
                    DualListSelector,
                    {
                      availableOptions: usersAvailableOptions,
                      chosenOptions: usersChosenOptions,
                      availableOptionsTitle: _106("Available Members"),
                      chosenOptionsTitle: _106("Chosen Members"),
                      onListChange: (event, newAvailableOptions, newChosenOptions) => this.handleUsersOnListChange(event, newAvailableOptions, newChosenOptions),
                      id: "usersSelector"
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
                    Button,
                    {
                      className: "ds-margin-top",
                      isDisabled: usersChosenOptions.length === 0 || this.state.saving,
                      variant: "primary",
                      onClick: this.handleAddMembers,
                      isLoading: this.state.saving,
                      spinnerAriaValueText: this.state.saving ? "Saving" : void 0,
                      ...extraPrimaryProps,
                      children: saveBtnName
                    }
                  )
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
                  Modal,
                  {
                    variant: ModalVariant.medium,
                    title: _106("Choose A Branch To Search"),
                    isOpen: showLDAPNavModal,
                    onClose: this.handleCloseLDAPNavModal,
                    actions: [
                      /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
                        Button,
                        {
                          variant: "primary",
                          onClick: this.handleCloseLDAPNavModal,
                          children: _106("Done")
                        },
                        "confirm"
                      )
                    ],
                    children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Card, { isSelectable: true, className: "ds-indent ds-margin-bottom-md", children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
                      ldapNavigator_default,
                      {
                        treeItems: [...this.props.treeViewRootSuffixes],
                        editorLdapServer: this.props.editorLdapServer,
                        skipLeafEntries: true,
                        handleNodeOnClick: this.onBaseDnSelection,
                        showTreeLoadingState: this.showTreeLoadingState,
                        addNotification: this.props.addNotification
                      }
                    ) }) })
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
                  Divider,
                  {
                    className: "ds-margin-top-lg"
                  }
                )
              ] }) }) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
              Modal,
              {
                variant: ModalVariant.medium,
                title: _106("View Entry"),
                isOpen: showViewEntry,
                onClose: this.handleCloseViewEntry,
                children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Card, { isSelectable: true, className: "ds-indent ds-margin-bottom-md", children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(CardBody, { className: "ds-textarea", children: ldifArray.map((line) => /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("h6", { children: [
                  line.attribute,
                  line.value
                ] }, line.attribute + line.value)) }) })
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
              DoubleConfirmModal,
              {
                showModal: this.state.showConfirmMemberDelete,
                closeHandler: this.closeConfirmMemberDelete,
                handleChange: this.onModalChange,
                actionHandler: this.delMember,
                spinning: this.state.modalSpinning,
                item: this.state.delMember,
                checked: this.state.modalChecked,
                mTitle: _106("Remove Member From Group"),
                mMsg: _106("Are you sure you want to remove this member?"),
                mSpinningMsg: _106("Deleting ..."),
                mBtnName: _106("Delete")
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
              DoubleConfirmModal,
              {
                showModal: this.state.showConfirmBulkDelete,
                closeHandler: this.closeConfirmBulkDelete,
                handleChange: this.onModalChange,
                actionHandler: this.delBulkMembers,
                spinning: this.state.modalSpinning,
                item: delMemList,
                checked: this.state.modalChecked,
                mTitle: _106("Remove Members From Group"),
                mMsg: _106("Are you sure you want to remove these members?"),
                mSpinningMsg: _106("Deleting ..."),
                mBtnName: _106("Delete Members")
              }
            )
          ]
        }
      ) });
    }
  };
  var editGroup_default = EditGroup;

  // src/lib/ldap_editor/wizards/operations/editLdapEntry.jsx
  var import_jsx_runtime107 = __toESM(require_jsx_runtime(), 1);
  var _107 = cockpit_default.gettext;
  var EditLdapEntry = class extends import_react177.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "useGroupGenericEditor", () => {
        this.originalEntryRows = [];
        this.setState({
          groupGenericEditor: true
        });
      });
      __publicField(this, "openEditEntry", (dn) => {
        const editProps = { ...this.state.localProps };
        editProps.wizardEntryDn = dn;
        this.setState({
          localProps: editProps,
          isGroupOfNames: false,
          isGroupOfUniqueNames: false
        });
      });
      __publicField(this, "isAttributeSingleValued", (attr) => {
        return this.singleValuedAttributes.includes(attr.toLowerCase());
      });
      __publicField(this, "isAttributeRequired", (attr) => {
        return this.requiredAttributes.includes(attr);
      });
      __publicField(this, "enableNextStep", (yes) => {
        this.setState({
          validMods: yes
        });
      });
      __publicField(this, "saveCurrentRows", (editableTableData) => {
        let validMods = true;
        for (const row of editableTableData) {
          if (row.val === "") {
            validMods = false;
            break;
          }
        }
        this.setState({
          editableTableData,
          validMods
        });
      });
      __publicField(this, "handleSetPageOc", (_event, pageNumber) => {
        this.setState({
          pageOc: pageNumber,
          pagedRowsOc: this.getItemsToShow(pageNumber, this.state.perPageOc, "ObjectClassTable")
        });
      });
      __publicField(this, "handleSetPageAttr", (_event, pageNumber) => {
        this.setState({
          pageAttr: pageNumber,
          pagedRowsAttr: this.getItemsToShow(pageNumber, this.state.perPageAttr, "AttributeTable")
        });
      });
      __publicField(this, "handlePerPageSelectOc", (_event, perPage) => {
        this.setState({
          pageOc: 1,
          perPageOc: perPage,
          pagedRowsOc: this.getItemsToShow(1, perPage, "ObjectClassTable")
        });
      });
      __publicField(this, "handlePerPageSelectAttr", (_event, perPage) => {
        this.setState({
          pageAttr: 1,
          perPageAttr: perPage,
          pagedRowsAttr: this.getItemsToShow(1, perPage, "AttributeTable")
        });
      });
      __publicField(this, "handleSelectOc", (event, isSelected, rowId) => {
        const rows = [...this.state.pagedRowsOc];
        rows[rowId].selected = isSelected;
        const ocName = this.state.pagedRowsOc[rowId].cells[0];
        const allItems = [...this.state.rowsOc];
        const index = allItems.findIndex((item) => item.cells[0] === ocName);
        allItems[index].selected = isSelected;
        let selectedObjectClasses = [...this.state.selectedObjectClasses];
        if (isSelected) {
          selectedObjectClasses.push(allItems[index]);
        } else {
          selectedObjectClasses = selectedObjectClasses.filter((row) => row.cells[0] !== allItems[index].cells[0]);
        }
        const attrsToRemove = [];
        if (!isSelected) {
          let ocAttrs = allItems[index].cells[1].toLowerCase().replace(/\s/g, "").split(",");
          ocAttrs = ocAttrs.concat(allItems[index].cells[2].toLowerCase().replace(/\s/g, "").split(","));
          let currAttrs = [];
          for (const oc of selectedObjectClasses) {
            currAttrs = currAttrs.concat(oc.cells[1].toLowerCase().replace(/\s/g, "").split(","));
            currAttrs = currAttrs.concat(oc.cells[2].toLowerCase().replace(/\s/g, "").split(","));
          }
          for (const attr of ocAttrs) {
            if (currAttrs.indexOf(attr) === -1) {
              attrsToRemove.push(attr);
            }
          }
        }
        this.setState({
          rowsOc: allItems,
          pagedRowsOc: rows,
          selectedObjectClasses,
          attrsToRemove
        }, () => {
          this.updateAttributeTableRows();
        });
      });
      __publicField(this, "handleSelectAttr", (event, isSelected, rowId) => {
        let newEditableData = this.state.editableTableData;
        if (this.state.pagedRowsAttr[rowId].disableCheckbox === true) {
          return;
        }
        const rows = [...this.state.pagedRowsAttr];
        rows[rowId].selected = isSelected;
        const attrName = rows[rowId].attributeName;
        const allItems = [...this.state.rowsAttr];
        const allAttrs = this.getAllAttrs();
        const index = allItems.findIndex((item) => item.attributeName === attrName);
        allItems[index].isAttributeSelected = isSelected;
        let selectedAttributes = allAttrs.filter((item) => item.isAttributeSelected).map((attrObj) => [attrObj.attributeName, attrObj.cells[1]]);
        if (isSelected) {
          selectedAttributes.push([allItems[index].attributeName, allItems[index].cells[1]]);
        } else {
          selectedAttributes = selectedAttributes.filter((row) => row[0] !== allItems[index].attributeName);
        }
        const rowAttr = rows[rowId].attributeName.toLowerCase();
        const found = this.state.editableTableData.filter((item) => item.attr.toLowerCase() === rowAttr);
        if (isSelected) {
          if (found.length === 0 && rowAttr !== "objectclass") {
            const obj = {};
            obj.id = generateUniqueId();
            obj.attr = rows[rowId].attributeName;
            obj.val = "";
            obj.namingAttr = false;
            obj.required = false;
            newEditableData = [...newEditableData, obj];
          }
        } else if (found.length > 0) {
          newEditableData = this.state.editableTableData.filter((item) => item.attr.toLowerCase() !== rowAttr);
        }
        let validMods = true;
        for (const row of newEditableData) {
          if (row.val === "") {
            validMods = false;
          }
        }
        this.setState({
          rowsAttr: allItems,
          pagedRowsAttr: rows,
          editableTableData: newEditableData,
          selectedAttributes,
          validMods
        });
      });
      __publicField(this, "getAllAttrs", () => {
        const ocToProcess = [...this.state.selectedObjectClasses];
        const rowsAttr = [];
        const attrList = [];
        ocToProcess.map((oc) => {
          const required = oc.cells[1].split(",");
          const optional = oc.cells[2].split(",");
          for (let attr of required) {
            attr = attr.trim().toLowerCase();
            if (attr === "") {
              continue;
            }
            if (!attrList.includes(attr)) {
              attrList.push(attr);
              rowsAttr.push({
                selected: true,
                disableCheckbox: true,
                // TODO: Hack until upgrading!
                isAttributeSelected: true,
                attributeName: attr,
                cells: [
                  {
                    title: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_jsx_runtime107.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("strong", { children: attr }) })
                  },
                  oc.cells[0]
                ]
              });
            }
            const found = this.state.editableTableData.filter((item) => item.attr.toLowerCase() === attr);
            if (found.length === 0 && attr !== "objectclass") {
              const obj = {};
              obj.id = generateUniqueId();
              obj.attr = attr;
              obj.val = "";
              obj.namingAttr = false;
              obj.required = false;
              this.setState((prevState) => ({
                editableTableData: [...prevState.editableTableData, obj],
                validMods: false
              }));
            }
          }
          for (let attr of optional) {
            attr = attr.trim();
            if (attr === "") {
              continue;
            }
            if (!attrList.includes(attr)) {
              let selected = false;
              for (const existingRow of this.state.editableTableData) {
                if (existingRow.attr.toLowerCase() === attr.toLowerCase()) {
                  selected = true;
                  break;
                }
              }
              attrList.push(attr);
              rowsAttr.push({
                attributeName: attr,
                isAttributeSelected: selected,
                selected,
                cells: [attr, oc.cells[0]]
              });
            }
          }
          let personOC = false;
          for (const existingOC of this.state.selectedObjectClasses) {
            if (existingOC.cells[0].toLowerCase() === "person" || existingOC.cells[0].toLowerCase() === "nsperson") {
              personOC = true;
              break;
            }
          }
          const additionalAttrs = ["nsRoleDN", "nsAccountLock"];
          for (const addAttr of additionalAttrs) {
            if (personOC && !attrList.includes(addAttr)) {
              let selected = false;
              for (const existingRow of this.state.editableTableData) {
                if (existingRow.attr.toLowerCase() === addAttr.toLowerCase()) {
                  selected = true;
                  break;
                }
              }
              attrList.push(addAttr);
              rowsAttr.push({
                attributeName: addAttr,
                isAttributeSelected: selected,
                selected,
                cells: [addAttr, ""]
              });
            }
          }
          return [];
        });
        return rowsAttr;
      });
      __publicField(this, "updateAttributeTableRows", () => {
        let rowsAttr = [];
        rowsAttr = this.getAllAttrs();
        rowsAttr.sort((a2, b) => a2.attributeName > b.attributeName ? 1 : -1);
        this.setState({
          rowsAttr,
          selectedAttributes: rowsAttr.filter((item) => item.isAttributeSelected).map((attrObj) => [attrObj.attributeName, attrObj.cells[1]]),
          itemCountAttr: rowsAttr.length
        }, () => {
          this.setState({
            pagedRowsAttr: this.getItemsToShow(
              this.state.pageAttr,
              this.state.perPageAttr,
              "AttributeTable"
            )
          });
        });
      });
      __publicField(this, "generateLdifData", () => {
        const statementRows = [];
        const updateArray = [];
        const addArray = [];
        const removeArray = [];
        const ldifArray = [];
        const cleanLdifArray = [];
        let numOfChanges = 0;
        let isFilePath = false;
        for (const originalRow of this.originalEntryRows) {
          const matchingObj = this.state.editableTableData.find((elt) => elt.id === originalRow.id);
          if (!matchingObj) {
            removeArray.push(originalRow);
            continue;
          }
          const sameValue = matchingObj.val === originalRow.val;
          if (sameValue) {
            updateArray.push({ ...originalRow });
          } else {
            const myNewObject = {
              ...originalRow,
              op: LDAP_OPERATIONS.replace,
              new: matchingObj.val
            };
            if (matchingObj.encodedvalue) {
              myNewObject.encodedvalue = matchingObj.encodedvalue;
            }
            updateArray.push(myNewObject);
          }
        }
        for (const savedRow of this.state.editableTableData) {
          let found = false;
          for (const originalRow of this.originalEntryRows) {
            if (originalRow.id === savedRow.id) {
              found = true;
              break;
            }
          }
          if (!found) {
            addArray.push(savedRow);
          }
          found = false;
        }
        for (const datum of updateArray) {
          const myAttr = datum.attr;
          let myVal = datum.val;
          const isUserPwd = myAttr.toLowerCase() === "userpassword";
          isFilePath = false;
          if (myAttr === "dn") {
            ldifArray.push(`dn: ${myVal}`);
            ldifArray.push("changetype: modify");
            cleanLdifArray.push(`dn: ${myVal}`);
            cleanLdifArray.push("changetype: modify");
          }
          if (datum.op === void 0) {
            if (isUserPwd) {
              myVal = "********";
            }
            statementRows.push({
              cells: [
                { title: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Label, { children: _107("Keep") }) },
                myAttr,
                myVal
              ]
            });
          } else {
            if (ldifArray.length >= 4) {
              ldifArray.push("-");
              cleanLdifArray.push("-");
            }
            const sameAttrArray = this.originalEntryRows.filter((obj) => obj.attr === myAttr);
            if ((typeof myVal === "string" || myVal instanceof String) && myVal.toLowerCase().startsWith("file:/")) {
              isFilePath = true;
            }
            const mySeparator = BINARY_ATTRIBUTES.includes(myAttr.toLowerCase()) ? isFilePath ? ":<" : "::" : ":";
            if (sameAttrArray.length > 1) {
              ldifArray.push(`delete: ${myAttr}`);
              ldifArray.push(`${myAttr}: ${myVal}`);
              ldifArray.push("-");
              ldifArray.push(`add: ${myAttr}`);
              cleanLdifArray.push(`delete: ${myAttr}`);
              cleanLdifArray.push(`${myAttr}: ${myVal}`);
              cleanLdifArray.push("-");
              cleanLdifArray.push(`add: ${myAttr}`);
            } else {
              ldifArray.push(`replace: ${myAttr}`);
              cleanLdifArray.push(`replace: ${myAttr}`);
            }
            const valueToUse = datum.encodedvalue ? datum.encodedvalue : datum.new;
            const remainingData = foldLine(`${myAttr}${mySeparator} ${valueToUse}`);
            ldifArray.push(...remainingData);
            if (myAttr.toLowerCase().startsWith("userpassword")) {
              cleanLdifArray.push("userpassword: ********");
            } else if (myAttr.toLowerCase().startsWith("jpegphoto") && mySeparator === "::") {
              const myTruncatedValue = /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { children: [
                "jpegphoto:: ",
                /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Label, { icon: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(InfoCircleIcon, {}), color: "blue", children: _107("Value is too large to display") })
              ] });
              cleanLdifArray.push(myTruncatedValue);
            } else {
              cleanLdifArray.push(...remainingData);
            }
            numOfChanges++;
            if (isUserPwd) {
              datum.new = "********";
              myVal = "********";
            }
            statementRows.push({
              cells: [
                { title: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Label, { color: "orange", children: _107("Replace") }) },
                myAttr,
                {
                  title: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(LabelGroup, { isVertical: true, children: [
                    /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Label, { variant: "outline", color: "red", children: [
                      /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("em", { children: _107("old:") }),
                      "\u2002",
                      myVal
                    ] }),
                    /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Label, { variant: "outline", color: "blue", children: [
                      /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("em", { children: _107("new:") }),
                      "\u2002",
                      datum.new
                    ] })
                  ] })
                }
              ]
            });
          }
        }
        for (const datum of addArray) {
          const myAttr = datum.attr;
          let myVal = datum.val;
          const isUserPwd = myAttr.toLowerCase() === "userpassword";
          numOfChanges++;
          isFilePath = false;
          if ((typeof myVal === "string" || myVal instanceof String) && myVal.toLowerCase().startsWith("file:/")) {
            isFilePath = true;
          }
          const mySeparator = BINARY_ATTRIBUTES.includes(myAttr.toLowerCase()) ? isFilePath ? ":<" : "::" : ":";
          if (ldifArray.length >= 4) {
            ldifArray.push("-");
            cleanLdifArray.push("-");
          }
          ldifArray.push("add: " + myAttr);
          cleanLdifArray.push("add: " + myAttr);
          const valueToUse = datum.encodedvalue ? datum.encodedvalue : datum.val;
          const remainingData = foldLine(`${myAttr}${mySeparator} ${valueToUse}`);
          ldifArray.push(...remainingData);
          if (myAttr.toLowerCase().startsWith("userpassword")) {
            cleanLdifArray.push("userpassword: ********");
          } else if (myAttr.toLowerCase().startsWith("jpegphoto") && mySeparator === "::") {
            const myTruncatedValue = /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { children: [
              "jpegphoto:: ",
              /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Label, { icon: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(InfoCircleIcon, {}), color: "blue", children: _107("Value is too large to display") })
            ] });
            cleanLdifArray.push(myTruncatedValue);
          } else {
            cleanLdifArray.push(...remainingData);
          }
          if (isUserPwd) {
            myVal = "********";
          }
          statementRows.push({
            cells: [
              { title: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Label, { color: "orange", children: _107("Add") }) },
              myAttr,
              {
                title: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Label, { variant: "outline", color: "blue", children: myVal })
              }
            ]
          });
        }
        for (const datum of removeArray) {
          const myAttr = datum.attr;
          let myVal = datum.val;
          const isUserPwd = myAttr.toLowerCase() === "userpassword";
          isFilePath = false;
          if (ldifArray.length >= 4) {
            ldifArray.push("-");
            cleanLdifArray.push("-");
          }
          if ((typeof myVal === "string" || myVal instanceof String) && myVal.toLowerCase().startsWith("file:/")) {
            isFilePath = true;
          }
          const mySeparator = BINARY_ATTRIBUTES.includes(myAttr.toLowerCase()) ? isFilePath ? ":<" : "::" : ":";
          const valueToUse = datum.encodedvalue ? datum.encodedvalue : datum.val;
          ldifArray.push("delete: " + myAttr);
          cleanLdifArray.push("delete: " + myAttr);
          numOfChanges++;
          if (!isUserPwd) {
            const remainingData = foldLine(`${myAttr}${mySeparator} ${valueToUse}`);
            ldifArray.push(...remainingData);
            if (myAttr.toLowerCase().startsWith("userpassword")) {
              cleanLdifArray.push("userpassword: ********");
            } else if (myAttr.toLowerCase().startsWith("jpegphoto") && mySeparator === "::") {
              const myTruncatedValue = /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { children: [
                "jpegphoto:: ",
                /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Label, { icon: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(InfoCircleIcon, {}), color: "blue", children: _107("Value is too large to display") })
              ] });
              cleanLdifArray.push(myTruncatedValue);
            } else {
              cleanLdifArray.push(...remainingData);
            }
          } else {
            myVal = "********";
          }
          statementRows.push({
            cells: [
              { title: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Label, { color: "red", children: _107("Delete") }) },
              myAttr,
              {
                title: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Label, { variant: "outline", color: "blue", children: myVal })
              }
            ]
          });
        }
        const origOCs = this.state.origOC.map((oc) => {
          return oc.cells[0].toLowerCase();
        });
        const newOCs = this.state.selectedObjectClasses.map((oc) => {
          return oc.cells[0].toLowerCase();
        });
        for (const oldOC of origOCs) {
          if (newOCs.indexOf(oldOC) === -1) {
            if (ldifArray.length >= 4) {
              ldifArray.push("-");
              cleanLdifArray.push("-");
            }
            ldifArray.push("delete: objectClass");
            ldifArray.push("objectClass: " + oldOC);
            cleanLdifArray.push("delete: objectClass");
            cleanLdifArray.push("objectClass: " + oldOC);
            statementRows.push({
              cells: [
                { title: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Label, { color: "red", children: _107("Delete") }) },
                "objectClass",
                {
                  title: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Label, { variant: "outline", color: "blue", children: oldOC })
                }
              ]
            });
            numOfChanges++;
          }
        }
        for (const newOC of newOCs) {
          if (origOCs.indexOf(newOC) === -1) {
            if (ldifArray.length >= 4) {
              ldifArray.push("-");
              cleanLdifArray.push("-");
            }
            ldifArray.push("add: objectClass");
            ldifArray.push("objectClass: " + newOC);
            cleanLdifArray.push("add: objectClass");
            cleanLdifArray.push("objectClass: " + newOC);
            statementRows.push({
              cells: [
                { title: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Label, { color: "orange", children: _107("Add") }) },
                "objectClass",
                {
                  title: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Label, { variant: "outline", color: "blue", children: newOC })
                }
              ]
            });
            numOfChanges++;
          }
        }
        this.setState({
          statementRows,
          ldifArray,
          cleanLdifArray,
          numOfChanges
        });
      });
      __publicField(this, "handleOCDropDownToggle", (isOpen) => {
        this.setState({
          isOCDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleOCDropDownSelect", (event) => {
        this.setState((prevState) => ({
          isOCDropDownOpen: !prevState.isOCDropDownOpen
        }));
      });
      __publicField(this, "buildOCDropdown", () => {
        const { isOCDropDownOpen, selectedObjectClasses } = this.state;
        const numSelected = selectedObjectClasses.length;
        const ocs = selectedObjectClasses.map((oc) => oc.cells[0]);
        ocs.sort();
        const items = ocs.map(
          (oc) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DropdownItem2, { children: oc }, oc)
        );
        return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
          Dropdown2,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleOCDropDownSelect,
            position: "left",
            toggle: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(BadgeToggle, { id: "toggle-oc-select", onToggle: this.handleOCDropDownToggle, children: numSelected !== 0 ? /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_jsx_runtime107.Fragment, { children: [
              numSelected,
              " ",
              _107("selected"),
              " "
            ] }) : /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_jsx_runtime107.Fragment, { children: [
              "0 ",
              _107("selected"),
              " "
            ] }) }),
            isOpen: isOCDropDownOpen,
            dropdownItems: items
          }
        );
      });
      __publicField(this, "handleAttrDropDownToggle", (isOpen) => {
        this.setState({
          isAttrDropDownOpen: isOpen
        });
      });
      __publicField(this, "handleAttrDropDownSelect", (event) => {
        this.setState((prevState) => ({
          isAttrDropDownOpen: !prevState.isAttrDropDownOpen
        }));
      });
      __publicField(this, "buildAttrDropdown", () => {
        const { isAttrDropDownOpen, selectedAttributes } = this.state;
        const numSelected = selectedAttributes.length;
        const attrs = selectedAttributes.map((attr) => attr[0]);
        attrs.sort();
        const items = attrs.map(
          (attr) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DropdownItem2, { children: attr }, attr)
        );
        return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
          Dropdown2,
          {
            className: "ds-dropdown-padding",
            onSelect: this.handleAttrDropDownSelect,
            position: "left",
            toggle: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
              BadgeToggle,
              {
                id: "toggle-attr-select",
                onToggle: this.handleAttrDropDownToggle,
                children: numSelected !== 0 ? /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_jsx_runtime107.Fragment, { children: [
                  numSelected,
                  " ",
                  _107("selected"),
                  " "
                ] }) : /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_jsx_runtime107.Fragment, { children: [
                  "0 ",
                  _107("selected"),
                  " "
                ] })
              }
            ),
            isOpen: isAttrDropDownOpen,
            dropdownItems: items
          }
        );
      });
      this.originalEntryRows = [];
      this.singleValuedAttributes = [];
      this.requiredAttributes = ["dn"];
      this.operationColumns = [
        { title: _107("Statement") },
        { title: _107("Attribute") },
        { title: _107("Value"), cellTransforms: [breakWord] }
      ];
      this.state = {
        loading: true,
        isOCDropDownOpen: false,
        isAttrDropDownOpen: false,
        namingAttributeData: ["", ""],
        namingAttrPropsName: "",
        namingRowIndex: -1,
        namingAttribute: "",
        namingValue: "",
        editableTableData: [],
        statementRows: [],
        ldifArray: [],
        cleanLdifArray: [],
        validMods: false,
        commandOutput: "",
        resultVariant: "default",
        stepIdReached: 1,
        itemCountOc: 0,
        pageOc: 1,
        perPageOc: 6,
        itemCountAttr: 0,
        pageAttr: 1,
        perPageAttr: 10,
        columnsAttr: [
          { title: _107("Attribute Name"), cellTransforms: [headerCol()] },
          { title: _107("From ObjectClass") }
        ],
        columnsOc: [
          { title: _107("ObjectClass Name"), cellTransforms: [headerCol()] },
          { title: _107("Required Attributes"), cellTransforms: [breakWord] },
          { title: _107("Optional Attributes"), cellTransforms: [breakWord] }
        ],
        rowsOc: [],
        rowsAttr: [],
        pagedRowsOc: [],
        pagedRowsAttr: [],
        selectedObjectClasses: [],
        selectedAttributes: [],
        attrsToRemove: [],
        modifying: true,
        isGroupOfNames: false,
        isGroupOfUniqueNames: false,
        groupMembers: [],
        groupGenericEditor: false,
        localProps: { ...this.props },
        searchOCValue: "",
        searchValue: ""
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 2) {
          this.updateAttributeTableRows();
        } else if (id === 3) {
          this.cleanUpEntry();
        } else if (id === 4) {
          this.generateLdifData();
        } else if (id === 6) {
          const params = { serverId: this.state.localProps.editorLdapServer };
          modifyLdapEntry(params, this.state.ldifArray, (result) => {
            if (result.errorCode === 0) {
              result.output = _107("Successfully modified entry");
            }
            this.setState({
              commandOutput: result.errorCode === 0 ? _107("Successfully modified entry!") : _107("Failed to modify entry: ") + result.output,
              resultVariant: result.errorCode === 0 ? "success" : "danger",
              modifying: false
            }, () => {
              this.state.localProps.onReload();
            });
            const opInfo = {
              // This is what refreshes treeView
              operationType: "MODIFY",
              resultCode: result.errorCode,
              time: Date.now()
            };
            this.state.localProps.setWizardOperationInfo(opInfo);
          });
        }
      };
      this.cleanUpEntry = () => {
        const newRows = [];
        let validMods = true;
        for (const row of this.state.editableTableData) {
          const attr = row.attr.toLowerCase();
          if (this.state.attrsToRemove.indexOf(attr) === -1) {
            if (row.val === "") {
              validMods = false;
            }
            newRows.push(row);
          }
        }
        this.setState({
          editableTableData: newRows,
          validMods
        });
      };
      this.handleOCSearchChange = (event, value) => {
        let ocRows = [];
        const allOCs = [];
        const val = value.toLowerCase();
        this.state.localProps.allObjectclasses.map((oc) => {
          let selected = false;
          let selectionDisabled = false;
          for (const selectedOC of this.state.selectedObjectClasses) {
            if (selectedOC.cells[0].toLowerCase() === oc.name.toLowerCase()) {
              selected = true;
              break;
            }
          }
          if (oc.name === "top") {
            selectionDisabled = true;
          }
          allOCs.push(
            {
              cells: [
                oc.name,
                oc.required.join(", "),
                oc.optional.join(", ")
              ],
              selected,
              disableSelection: selectionDisabled
            }
          );
          return [];
        });
        if (value !== "") {
          for (const row of allOCs) {
            const name2 = row.cells[0].toLowerCase();
            const reqAttrs = row.cells[1].toLowerCase();
            const optAttrs = row.cells[2].toLowerCase();
            if (name2.includes(val) || reqAttrs.includes(val) || optAttrs.includes(val)) {
              ocRows.push(row);
            }
          }
        } else {
          ocRows = allOCs;
        }
        this.setState({
          rowsOc: ocRows,
          pagedRowsOc: ocRows.slice(0, this.state.perPageOc),
          itemCountOc: ocRows.length,
          searchOCValue: value
        });
      };
      this.handleAttrSearchChange = (event, value) => {
        let attrRows = [];
        let allAttrs = [];
        const val = value.toLowerCase();
        allAttrs = this.getAllAttrs();
        if (val !== "") {
          for (const row of allAttrs) {
            const name2 = row.attributeName.toLowerCase();
            const oc = row.cells[1].toLowerCase();
            if (name2.includes(val) || oc.includes(val)) {
              attrRows.push(row);
            }
          }
        } else {
          attrRows = allAttrs;
        }
        this.setState({
          rowsAttr: attrRows,
          pagedRowsAttr: attrRows.slice(0, this.state.perPageAttr),
          itemCountAttr: attrRows.length,
          searchValue: value
        });
      };
      this.useGroupGenericEditor = this.useGroupGenericEditor.bind(this);
      this.handleLoadEntry = this.handleLoadEntry.bind(this);
    }
    handleLoadEntry(reload) {
      const ocArray = [];
      if (reload) {
        this.originalEntryRows = [];
      }
      getBaseLevelEntryAttributes(
        this.state.localProps.editorLdapServer,
        this.state.localProps.wizardEntryDn,
        (entryDetails) => {
          const objectclasses = [];
          const rdnInfo = getRdnInfo(this.state.localProps.wizardEntryDn);
          let namingAttr = "";
          let namingValue = "";
          let isGroupOfUniqueNames = false;
          let isGroupOfNames = false;
          const members = [];
          entryDetails.filter((data) => data.attribute + data.value !== "" && // Filter out empty lines
          data.attribute !== "???: ").map((line, index) => {
            let attrLowerCase;
            let namingAttribute = false;
            if (line.attribute !== void 0) {
              const obj = {};
              const attr = line.attribute;
              attrLowerCase = attr.trim().toLowerCase();
              let val = line.value.substring(1).trim();
              let encodedvalue = "";
              if (attrLowerCase === "objectclass") {
                objectclasses.push(val);
                if (val.toLowerCase() === "groupofnames") {
                  isGroupOfNames = true;
                } else if (val.toLowerCase() === "groupofuniquenames") {
                  isGroupOfUniqueNames = true;
                }
              } else {
                if (line.attribute === "dn") {
                }
                if (line.value.substring(0, 2) === "::") {
                  val = line.value.substring(3);
                  if (BINARY_ATTRIBUTES.includes(attrLowerCase)) {
                    if (attrLowerCase === "jpegphoto") {
                      const myPhoto = /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
                        "img",
                        {
                          src: `data:image/png;base64,${val}`,
                          alt: "",
                          style: { width: "48px" }
                        }
                      );
                      encodedvalue = val;
                      val = myPhoto;
                    } else if (attrLowerCase === "nssymmetrickey") {
                      val = line.value.substring(3);
                    }
                  } else {
                    val = b64DecodeUnicode(line.value.substring(3));
                  }
                } else {
                  if (attr === rdnInfo.rdnAttr && val === rdnInfo.rdnVal) {
                    namingAttribute = true;
                    namingAttr = attr;
                    namingValue = val;
                  }
                }
                obj.id = generateUniqueId();
                obj.attr = attr;
                obj.val = val;
                obj.encodedvalue = encodedvalue;
                obj.namingAttr = namingAttribute;
                obj.required = namingAttribute;
                this.originalEntryRows.push(obj);
              }
              if (attrLowerCase === "member" || attrLowerCase === "uniquemember") {
                members.push(val);
              }
            } else {
              const obj = {};
              obj.id = generateUniqueId();
              obj.attr = line.props.attr;
              obj.val = line;
              obj.encodedvalue = "";
              obj.namingAttr = false;
              obj.required = false;
              attrLowerCase = line.props.attr.trim().toLowerCase();
              this.originalEntryRows.push(obj);
            }
            return [];
          });
          this.state.localProps.allObjectclasses.map((oc) => {
            let selected = false;
            let selectionDisabled = false;
            for (const entryOC of objectclasses) {
              if (entryOC.toLowerCase() === oc.name.toLowerCase()) {
                for (const row of this.originalEntryRows) {
                  if (oc.required.includes(row.attr) || row.attr === "dn") {
                    row.required = true;
                  }
                }
                selected = true;
                break;
              }
            }
            if (oc.name === "top") {
              selectionDisabled = true;
            }
            ocArray.push(
              {
                cells: [
                  oc.name,
                  oc.required.join(", "),
                  oc.optional.join(", ")
                ],
                selected,
                disableSelection: selectionDisabled
              }
            );
            return [];
          });
          const selectedObjectClasses = ocArray.filter((item) => item.selected);
          this.setState({
            itemCountOc: ocArray.length,
            rowsOc: ocArray,
            pagedRowsOc: ocArray.slice(0, this.state.perPageOc),
            selectedObjectClasses,
            editableTableData: [...this.originalEntryRows],
            objectclasses,
            namingAttribute: namingAttr,
            namingValue,
            origAttrs: JSON.parse(JSON.stringify(this.originalEntryRows)),
            origOC: JSON.parse(JSON.stringify(selectedObjectClasses)),
            isGroupOfNames,
            isGroupOfUniqueNames,
            groupMembers: members.sort(),
            loading: false
          }, () => {
            this.updateAttributeTableRows();
          });
        }
      );
    }
    componentDidMount() {
      getSingleValuedAttributes(
        this.props.editorLdapServer,
        (myAttrs) => {
          this.singleValuedAttributes = [...myAttrs];
        }
      );
      this.setState({
        localProps: { ...this.props }
      }, () => {
        this.handleLoadEntry();
      });
    }
    getItemsToShow(page, perPage, option) {
      const start2 = (page - 1) * perPage;
      const end2 = page * perPage;
      const newRows = option === "ObjectClassTable" ? this.state.rowsOc.slice(start2, end2) : option === "AttributeTable" ? this.state.rowsAttr.slice(start2, end2) : [];
      return newRows;
    }
    render() {
      const {
        loading,
        columnsOc,
        pagedRowsOc,
        itemCountAttr,
        pageAttr,
        perPageAttr,
        columnsAttr,
        pagedRowsAttr,
        commandOutput,
        stepIdReached,
        ldifArray,
        statementRows,
        resultVariant,
        editableTableData,
        numOfChanges,
        validMods,
        cleanLdifArray
      } = this.state;
      const objectClassStep = /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_jsx_runtime107.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "ds-container", children: [
          /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Text, { component: TextVariants.h3, children: _107("Select ObjectClasses") }) }),
          this.buildOCDropdown()
        ] }),
        loading ? /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Bullseye, { className: "ds-margin-top-xlg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Title, { headingLevel: "h3", size: "lg", children: _107("Loading ...") }),
          /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Spinner, { className: "ds-center", size: "lg" })
        ] }) : /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { children: [
          /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
              SearchInput,
              {
                className: "ds-font-size-md",
                placeholder: _107("Search Objectclasses"),
                value: this.state.searchOCValue,
                onChange: this.handleOCSearchChange,
                onClear: (evt) => this.handleOCSearchChange(evt, "")
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
              Pagination,
              {
                itemCount: this.state.itemCountOc,
                page: this.state.pageOc,
                perPage: this.state.perPageOc,
                onSetPage: this.handleSetPageOc,
                widgetId: "pagination-step-objectclass",
                onPerPageSelect: this.handlePerPageSelectOc,
                variant: "top",
                isCompact: true
              }
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Table, { "aria-label": "Pagination All ObjectClasses", variant: "compact", children: [
            /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Tr, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Th, { screenReaderText: "Selection column" }),
              columnsOc.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Th, { children: typeof column === "object" ? column.title : column }, columnIndex))
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Tbody, { children: pagedRowsOc.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Tr, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
                Td,
                {
                  select: {
                    rowIndex,
                    onSelect: this.handleSelectOc,
                    isSelected: row.selected
                  }
                }
              ),
              row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
                Td,
                {
                  dataLabel: columnsOc[cellIndex]?.title || columnsOc[cellIndex],
                  children: cell
                },
                `${rowIndex}_${cellIndex}`
              ))
            ] }, rowIndex)) })
          ] })
        ] })
      ] });
      const attributeStep = /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_jsx_runtime107.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "ds-container", children: [
          /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Text, { component: TextVariants.h3, children: _107("Select Attributes") }) }),
          this.buildAttrDropdown()
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
            SearchInput,
            {
              className: "ds-font-size-md",
              placeholder: _107("Search Attributes"),
              value: this.state.searchValue,
              onChange: this.handleAttrSearchChange,
              onClear: (evt) => this.handleAttrSearchChange(evt, "")
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(GridItem, { span: 7, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
            Pagination,
            {
              itemCount: itemCountAttr,
              page: pageAttr,
              perPage: perPageAttr,
              onSetPage: this.handleSetPageAttr,
              widgetId: "pagination-step-attributes",
              onPerPageSelect: this.handlePerPageSelectAttr,
              variant: "top",
              isCompact: true
            }
          ) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
          Table,
          {
            "aria-label": "Pagination Attributes",
            variant: "compact",
            className: "ds-margin-top",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Tr, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Th, { screenReaderText: "Selection column" }),
                columnsAttr.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Th, { children: typeof column === "object" ? column.title : column }, columnIndex))
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Tbody, { children: pagedRowsAttr.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Tr, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
                  Td,
                  {
                    select: {
                      rowIndex,
                      onSelect: this.handleSelectAttr,
                      isSelected: row.selected,
                      isDisabled: row.disableCheckbox
                    }
                  }
                ),
                row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
                  Td,
                  {
                    dataLabel: columnsAttr[cellIndex]?.title || columnsAttr[cellIndex],
                    children: typeof cell === "object" ? cell.title : cell
                  },
                  `${rowIndex}_${cellIndex}`
                ))
              ] }, rowIndex)) })
            ]
          }
        )
      ] });
      const entryValuesStep = /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_jsx_runtime107.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Text, { component: TextVariants.h3, children: _107("Edit Attribute Values") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
          editableTable_default,
          {
            wizardEntryDn: this.state.localProps.wizardEntryDn,
            editableTableData,
            quickUpdate: true,
            isAttributeSingleValued: this.isAttributeSingleValued,
            isAttributeRequired: this.isAttributeRequired,
            enableNextStep: this.enableNextStep,
            saveCurrentRows: this.saveCurrentRows,
            allObjectclasses: this.state.localProps.allObjectclasses,
            disableNamingChange: true
          },
          editableTableData
        )
      ] });
      const ldifListItems = cleanLdifArray.map(
        (line, index) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(SimpleListItem, { isActive: (typeof line === "string" || line instanceof String) && line.startsWith("dn: "), children: typeof line === "string" || line instanceof String ? line.length < 1e3 ? line : /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { children: [
          "line.substring(0, 1000)",
          /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Label, { icon: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(InfoCircleIcon, {}), color: "blue", children: _107("Value is too large to display") })
        ] }) : line }, index)
      );
      const ldifStatementsStep = /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "ds-addons-bottom-margin", children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
          Alert,
          {
            variant: "info",
            isInline: true,
            title: _107("LDIF Statements")
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(CardBody, { children: ldifListItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(SimpleList, { "aria-label": "LDIF data User", children: ldifListItems }) }) })
      ] });
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const entryReviewStep = /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "ds-addons-bottom-margin", children: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
          Alert,
          {
            variant: resultVariant,
            isInline: true,
            title: _107("Result for Entry Modification"),
            children: [
              commandOutput,
              this.state.adding && /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { children: [
                /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Spinner, { className: "ds-left-margin", size: "md" }),
                "\xA0\xA0",
                _107("Modifying entry ...")
              ] })
            ]
          }
        ) }),
        resultVariant === "danger" && /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Card, { isSelectable: true, children: [
          /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(CardTitle, { children: _107("LDIF Data") }),
          /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(CardBody, { children: ldifLines.map((line) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("h6", { children: line.data }, line.id)) })
        ] })
      ] });
      const editEntrySteps = [
        {
          id: 1,
          name: _107("Select ObjectClasses"),
          component: objectClassStep,
          canJumpTo: stepIdReached >= 1 && stepIdReached < 6,
          enableNext: this.state.selectedObjectClasses.length > 0,
          hideBackButton: true
        },
        {
          id: 2,
          name: _107("Select Attributes"),
          component: attributeStep,
          canJumpTo: stepIdReached >= 2 && stepIdReached < 6
        },
        {
          id: 3,
          name: _107("Edit Values"),
          component: entryValuesStep,
          canJumpTo: stepIdReached >= 3 && stepIdReached < 6,
          enableNext: validMods
        },
        {
          id: 4,
          name: _107("View Changes"),
          component: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
            Table,
            {
              "aria-label": "Statement Table",
              variant: "compact",
              borders: true,
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Tr, { children: this.operationColumns.map((column, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_react177.default.Fragment, { children: typeof column === "object" ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Th, { children: column.title }) : /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Th, { children: column }) }, columnIndex)) }) }),
                /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Tbody, { children: statementRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Tr, { children: row.cells.map((cell, cellIndex) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_react177.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Td, { children: cell.title ? (
                  // For cells with React element content
                  cell.title.props.children
                ) : (
                  // For simple string cells
                  cell
                ) }) }, cellIndex)) }, rowIndex)) })
              ]
            }
          ),
          canJumpTo: stepIdReached >= 4 && stepIdReached < 6,
          enableNext: numOfChanges > 0
        },
        {
          id: 5,
          name: _107("LDIF Statements"),
          component: ldifStatementsStep,
          nextButtonText: _107("Modify Entry"),
          canJumpTo: stepIdReached >= 5 && stepIdReached < 6
        },
        {
          id: 6,
          name: _107("Review Result"),
          component: entryReviewStep,
          nextButtonText: _107("Finish"),
          canJumpTo: stepIdReached > 6,
          hideBackButton: this.state.resultVariant === "success" ? true : false,
          enableNext: !this.state.modifying
        }
      ];
      const title = /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_jsx_runtime107.Fragment, { children: [
        _107("Entry DN: "),
        "\xA0\xA0",
        /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("strong", { children: this.state.localProps.wizardEntryDn })
      ] });
      let editPage = /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
        Wizard,
        {
          isOpen: this.state.localProps.isWizardOpen,
          onClose: this.state.localProps.handleToggleWizard,
          steps: editEntrySteps,
          title: _107("Edit An LDAP Entry"),
          description: title,
          onNext: this.handleNext
        }
      );
      if (!this.state.groupGenericEditor && (this.state.isGroupOfNames || this.state.isGroupOfUniqueNames)) {
        editPage = /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
          editGroup_default,
          {
            groupdn: this.state.localProps.wizardEntryDn,
            members: this.state.groupMembers,
            useGenericEditor: this.useGroupGenericEditor,
            isGroupOfNames: this.state.isGroupOfNames,
            isGroupOfUniqueNames: this.state.isGroupOfUniqueNames,
            treeViewRootSuffixes: this.state.localProps.treeViewRootSuffixes,
            editorLdapServer: this.state.localProps.editorLdapServer,
            addNotification: this.state.localProps.addNotification,
            openEditEntry: this.openEditEntry,
            onReload: this.handleLoadEntry
          },
          this.state.groupMembers
        );
      }
      return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_jsx_runtime107.Fragment, { children: editPage });
    }
  };
  var editLdapEntry_default = EditLdapEntry;

  // src/lib/ldap_editor/wizards/operations/renameEntry.jsx
  var import_react178 = __toESM(require_react(), 1);
  var import_jsx_runtime108 = __toESM(require_jsx_runtime(), 1);
  var _108 = cockpit_default.gettext;
  var RenameEntry = class extends import_react178.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        stepIdReached: 1,
        baseDn: "",
        isTreeLoading: false,
        searching: false,
        renaming: true,
        currRdnAttr: "",
        currRdnVal: "",
        currRdnSuffix: "",
        deleteOldRdn: false,
        newRdnAttr: "",
        newRdnVal: "",
        newRdnSuffix: "",
        nextEnabled: false,
        allowedAttrs: [],
        ldifArray: [],
        resultVariant: "success",
        commandOutput: ""
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 4) {
          this.generateLdifData();
        } else if (id === 5) {
          const params = { serverId: this.props.editorLdapServer };
          modifyLdapEntry(params, this.state.ldifArray, (result) => {
            const opInfo = {
              operationType: "MODRDN",
              resultCode: result.errorCode,
              time: Date.now()
            };
            this.props.setWizardOperationInfo(opInfo);
            this.props.onModrdnReload();
            if (result.errorCode === 0) {
              result.output = _108("Successfully renamed entry");
            }
            this.setState({
              commandOutput: result.errorCode === 0 ? _108("Successfully renamed entry!") : _108("Failed to rename entry: ") + result.output,
              resultVariant: result.errorCode === 0 ? "success" : "danger",
              renaming: false
            });
          });
        }
      };
      this.onBaseDnSelection = (treeViewItem) => {
        if (treeViewItem.dn.toLowerCase().includes(this.props.wizardEntryDn.toLowerCase())) {
          this.props.addNotification(
            "warning",
            _108("Can not select a subtree that is the current entry, or a child of the current entry.")
          );
          return;
        }
        this.setState({
          newRdnSuffix: treeViewItem.dn
        });
      };
      this.showTreeLoadingState = (isTreeLoading) => {
        this.setState({
          isTreeLoading,
          searching: !!isTreeLoading
        });
      };
      this.handleRdnAttrChange = (attr) => {
        this.setState({
          newRdnAttr: attr
        });
      };
      this.handleRdnValChange = (val) => {
        this.setState({
          newRdnVal: val
        });
      };
      this.handleDelRdnChange = (_event, checked) => {
        this.setState({
          deleteOldRdn: checked
        });
      };
      this.generateLdifData = this.generateLdifData.bind(this);
    }
    componentDidMount() {
      getBaseLevelEntryAttributes(
        this.props.editorLdapServer,
        this.props.wizardEntryDn,
        (entryDetails) => {
          const objectclasses = [];
          const allowedAttrs = [];
          const rdnInfo = getRdnInfo(this.props.wizardEntryDn);
          entryDetails.filter((data) => data.attribute + data.value !== "" && // Filter out empty lines
          data.attribute !== "???: ").map((line, index) => {
            const attr = line.attribute;
            const attrLowerCase = attr.trim().toLowerCase();
            const val = line.value.substring(1).trim().toLowerCase();
            if (attrLowerCase === "objectclass") {
              objectclasses.push(val);
            }
            return [];
          });
          for (const entryOC of objectclasses) {
            for (const oc of this.props.allObjectclasses) {
              if (oc.name.toLowerCase() === entryOC) {
                for (const attr of oc.required) {
                  if (allowedAttrs.indexOf(attr) === -1) {
                    allowedAttrs.push(attr);
                  }
                }
                for (const attr of oc.optional) {
                  if (allowedAttrs.indexOf(attr) === -1) {
                    allowedAttrs.push(attr);
                  }
                }
              }
            }
          }
          const rdnSuffix = this.props.wizardEntryDn.replace(rdnInfo.rdnAttr + "=" + rdnInfo.rdnVal + ",", "").trim();
          this.setState({
            allowedAttrs,
            currRdnAttr: rdnInfo.rdnAttr,
            currRdnVal: rdnInfo.rdnVal,
            currRdnSuffix: rdnSuffix,
            newRdnAttr: rdnInfo.rdnAttr,
            newRdnVal: rdnInfo.rdnVal,
            newRdnSuffix: rdnSuffix,
            baseDn: rdnSuffix
          });
        }
      );
    }
    generateLdifData() {
      const ldifArray = [];
      ldifArray.push(`dn: ${this.props.wizardEntryDn}`);
      ldifArray.push("changetype: modrdn");
      ldifArray.push(`newrdn: ${this.state.newRdnAttr}=${this.state.newRdnVal}`);
      if (this.state.deleteOldRdn) {
        ldifArray.push(`deleteoldrdn: 1`);
      } else {
        ldifArray.push(`deleteoldrdn: 0`);
      }
      if (this.state.newRdnSuffix !== this.state.currRdnSuffix) {
        ldifArray.push(`newsuperior: ${this.state.newRdnSuffix}`);
      }
      this.setState({
        ldifArray
      });
    }
    render() {
      const {
        allowedAttrs,
        stepIdReached,
        newRdnAttr,
        newRdnVal,
        newRdnSuffix,
        ldifArray,
        resultVariant,
        commandOutput,
        currRdnAttr,
        currRdnVal,
        currRdnSuffix
      } = this.state;
      const attrValStep = /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_jsx_runtime108.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Text, { component: TextVariants.h2, children: _108("Select The Naming Attribute And Value") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(GridItem, { span: 3, className: "ds-label", children: _108("Naming Attribute") }),
          /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
            FormSelect,
            {
              id: "naming-attr",
              value: newRdnAttr,
              onChange: (e, str) => {
                this.handleRdnAttrChange(str);
              },
              "aria-label": "FormSelect Input",
              children: allowedAttrs.map((attr, index) => /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(FormSelectOption, { value: attr, label: attr }, attr))
            }
          ) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(Grid, { className: "ds-margin-top", children: [
          /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(GridItem, { span: 3, className: "ds-label", children: _108("New Name") }),
          /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(GridItem, { span: 9, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
            TextInput,
            {
              value: newRdnVal,
              type: "text",
              id: "naming-val",
              "aria-describedby": "horizontal-form-name-helper",
              name: "rdnVal",
              onChange: (e, str) => {
                this.handleRdnValChange(str);
              },
              validated: newRdnVal === "" ? ValidatedOptions.error : ValidatedOptions.default
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { title: _108("Removes the old RDN attribute from the entry, otherwise this attribute remains in the entry and references the old RDN."), children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
            Checkbox,
            {
              className: "ds-margin-top-lg",
              id: "deleteoldrdn",
              isChecked: this.state.deleteOldRdn,
              onChange: (event, isChecked) => this.handleDelRdnChange(event, isChecked),
              label: _108("Delete the old RDN attribute from the entry")
            }
          ) })
        ] })
      ] });
      const locationStep = /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_jsx_runtime108.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(TextContent, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Text, { component: TextVariants.h2, children: _108("Select The Entry Location") }),
          /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(Text, { component: TextVariants.h5, className: "ds-indent ds-margin-top-lg", title: _108("The superior DN where the entry will be located under."), children: [
            _108("Parent Subtree"),
            "\xA0\xA0",
            /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Label, { color: "blue", children: newRdnSuffix })
          ] })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(CardBody, { className: "ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
          ldapNavigator_default,
          {
            treeItems: [...this.props.treeViewRootSuffixes],
            editorLdapServer: this.props.editorLdapServer,
            handleNodeOnClick: this.onBaseDnSelection,
            showTreeLoadingState: this.showTreeLoadingState,
            addNotification: this.props.addNotification
          }
        ) })
      ] });
      const intactRdn = newRdnAttr + "=" + newRdnVal;
      const rdnAttrLabel = newRdnAttr !== currRdnAttr || newRdnVal !== currRdnVal ? /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(Label, { color: "blue", children: [
        newRdnAttr,
        "=",
        newRdnVal
      ] }) : /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "ds-lower-field", children: intactRdn });
      const rdnSuffixLabel = newRdnSuffix !== currRdnSuffix ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Label, { color: "blue", children: newRdnSuffix }) : /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "ds-lower-field", children: newRdnSuffix });
      const intactCurrRdn = currRdnAttr + "=" + currRdnVal;
      const rdnCurrAttrLabel = currRdnAttr !== newRdnAttr || newRdnVal !== currRdnVal ? /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(Label, { variant: "outline", color: "grey", children: [
        currRdnAttr,
        "=",
        currRdnVal
      ] }) : /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "ds-lower-field", children: intactCurrRdn });
      const rdnCurrSuffixLabel = newRdnSuffix !== currRdnSuffix ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Label, { variant: "outline", color: "grey", children: currRdnSuffix }) : /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "ds-lower-field", children: currRdnSuffix });
      const reviewChangesStep = /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_jsx_runtime108.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Text, { component: TextVariants.h2, children: _108("Review Changes") }) }),
        /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(Grid, { className: "ds-margin-top-lg", children: [
          /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(GridItem, { span: 2, className: "ds-label", children: _108("Original DN") }),
          /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(LabelGroup, { children: [
            rdnCurrAttrLabel,
            ",",
            rdnCurrSuffixLabel
          ] }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(Grid, { className: "ds-margin-top", children: [
          /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(GridItem, { span: 2, className: "ds-label", children: _108("New DN") }),
          /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(LabelGroup, { children: [
            rdnAttrLabel,
            ",",
            rdnSuffixLabel
          ] }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: !this.state.deleteOldRdn ? "ds-hidden" : "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(Grid, { title: _108("This attribute will be removed from the entry so that there is no trace of the old RDN in the entry."), children: [
          /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(GridItem, { span: 2, className: "ds-label", children: _108("Remove Old Rdn") }),
          /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(Label, { color: "orange", children: [
            currRdnAttr,
            ": ",
            currRdnVal
          ] }) })
        ] }) })
      ] });
      const ldifListItems = ldifArray.map(
        (line, index) => /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(SimpleListItem, { isActive: line.startsWith("dn: "), children: line }, index)
      );
      const ldifStatementsStep = /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_jsx_runtime108.Fragment, { children: [
        /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "ds-addons-bottom-margin", children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
          Alert,
          {
            variant: "info",
            isInline: true,
            title: _108("LDIF Statements")
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Card, { isSelectable: true, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(CardBody, { children: ldifListItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(SimpleList, { "aria-label": "LDIF data modrdn", children: ldifListItems }) }) })
      ] });
      let nb = -1;
      const ldifLines = ldifArray.map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const reviewStep = /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "ds-addons-bottom-margin", children: /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
          Alert,
          {
            variant: resultVariant,
            isInline: true,
            title: _108("Result for Entry Modification"),
            children: [
              commandOutput,
              this.state.renaming && /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { children: [
                /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Spinner, { className: "ds-left-margin", size: "md" }),
                "\xA0\xA0",
                _108("Renaming entry ...")
              ] })
            ]
          }
        ) }),
        resultVariant === "danger" && /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(Card, { isSelectable: true, children: [
          /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(CardTitle, { children: _108("LDIF Data") }),
          /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(CardBody, { children: ldifLines.map((line) => /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("h6", { children: line.data }, line.id)) })
        ] })
      ] });
      const renameSteps = [
        {
          id: 1,
          name: _108("Set Naming Attribute"),
          component: attrValStep,
          canJumpTo: stepIdReached < 5,
          hideBackButton: true,
          enableNext: newRdnVal !== ""
        },
        {
          id: 2,
          name: _108("Set Entry Location"),
          component: locationStep,
          canJumpTo: stepIdReached < 5 && newRdnVal !== "",
          enableNext: newRdnVal !== "" && (newRdnVal !== currRdnVal || newRdnAttr !== currRdnAttr || newRdnSuffix !== currRdnSuffix)
        },
        {
          id: 3,
          name: _108("Review Changes"),
          component: reviewChangesStep,
          canJumpTo: stepIdReached >= 3 && stepIdReached < 5
        },
        {
          id: 4,
          name: _108("LDIF Statements"),
          component: ldifStatementsStep,
          nextButtonText: _108("Change Entry Name"),
          canJumpTo: stepIdReached > 4 && stepIdReached < 5
        },
        {
          id: 5,
          name: _108("Review Result"),
          component: reviewStep,
          nextButtonText: _108("Finish"),
          canJumpTo: stepIdReached > 5,
          hideBackButton: this.state.resultVariant === "success" ? true : false,
          enableNext: !this.state.renaming
        }
      ];
      const desc = /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_jsx_runtime108.Fragment, { children: [
        _108("Old DN"),
        ": \xA0\xA0\xA0",
        /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("b", { children: [
          currRdnAttr,
          "=",
          currRdnVal,
          ",",
          currRdnSuffix
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("br", {}),
        /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("br", {}),
        _108("New DN: "),
        "\xA0\xA0",
        /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("b", { children: [
          newRdnAttr,
          "=",
          newRdnVal,
          ",",
          newRdnSuffix
        ] })
      ] });
      return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.props.handleToggleWizard,
          onNext: this.handleNext,
          title: _108("Rename LDAP Entry"),
          description: desc,
          steps: renameSteps
        }
      );
    }
  };
  var renameEntry_default = RenameEntry;

  // src/lib/ldap_editor/wizards/deleteOperation.jsx
  var import_react179 = __toESM(require_react(), 1);
  var import_jsx_runtime109 = __toESM(require_jsx_runtime(), 1);
  var _109 = cockpit_default.gettext;
  var DeleteOperationWizard = class extends import_react179.default.Component {
    constructor(props) {
      super(props);
      this.state = {
        alertVariant: "danger",
        entryLdifData: "",
        numSubordinates: -1,
        ldapsearchCmd: "",
        isAckChecked: false,
        isDelChecked: false,
        commandOutput: "",
        resultVariant: "default",
        allAttributesSelected: false,
        stepIdReached: 1,
        itemCountAddUser: 0,
        pageAddUser: 1,
        perPageAddUser: 10,
        columnsUser: [
          { title: _109("Attribute Name"), cellTransforms: [headerCol()] },
          { title: _109("From ObjectClass") }
        ],
        rowsUser: [],
        pagedRowsUser: [],
        selectedAttributes: ["cn", "sn"],
        // Values
        noEmptyValue: false,
        columnsValue: [
          "Attribute",
          "Value"
        ],
        rowsValues: [],
        // Review step
        reviewValue: "",
        reviewInvalidText: _109("Invalid LDIF"),
        reviewIsValid: true,
        reviewValidated: "default",
        // reviewHelperText: 'LDIF data',
        deleting: true
      };
      this.handleNext = ({ id }) => {
        this.setState({
          stepIdReached: this.state.stepIdReached < id ? id : this.state.stepIdReached
        });
        if (id === 4) {
          deleteLdapData(
            this.props.editorLdapServer,
            this.props.wizardEntryDn,
            this.state.numSubordinates,
            (result) => {
              this.setState({
                commandOutput: result.errorCode === 0 ? _109("Successfully deleted entry") : _109("Failed to delete entry: ") + result.output,
                resultVariant: result.errorCode === 0 ? "success" : "danger",
                deleting: false
              }, () => {
                this.props.onReload();
              });
              const opInfo = {
                // This is what refreshes treeView
                operationType: "DELETE",
                resultCode: result.errorCode,
                time: Date.now()
              };
              this.props.setWizardOperationInfo(opInfo);
            }
          );
        }
      };
      this.handleChangeAck = (_event, isAckChecked) => {
        this.setState({ isAckChecked });
      };
    }
    componentDidMount() {
      getBaseLevelEntryFullAttributes(
        this.props.editorLdapServer,
        this.props.wizardEntryDn,
        (result) => {
          if (result !== "") {
            const regex = /^numSubordinates:\s\d+?$/mi;
            const line = result.match(regex);
            const numSubordinates = line ? parseInt(line[0].split(":")[1].trim()) : 0;
            this.setState({
              entryLdifData: result,
              numSubordinates
            });
          }
        }
      );
      const ldapsearchCmd = `ldapsearch -LLL -o ldif-wrap=no -Y EXTERNAL -b "${this.props.wizardEntryDn}" -H ldapi://%2fvar%2frun%2fslapd-${this.props.editorLdapServer}.socket "(objectClass=*)" \\* +`;
      this.setState({
        ldapsearchCmd
      });
    }
    render() {
      const {
        commandOutput,
        entryLdifData,
        numSubordinates,
        resultVariant,
        isAckChecked,
        ldapsearchCmd
      } = this.state;
      const info2 = numSubordinates > 0 ? _109("It has child entries which will also be recursively deleted.") : "";
      const entryIcon = numSubordinates > 0 ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(UsersIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(UserIcon, {});
      const acknowledgementStep = /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(Card, { isSelectable: true, children: [
        /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(CardTitle, { children: _109("Delete Acknowledgement") }),
        /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(CardBody, { children: cockpit_default.format(_109("You are about to delete this entry. $0"), info2) }),
        /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(CardBody, { children: [
          entryIcon,
          "\xA0\xA0",
          /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("b", { className: "ds-info-color", children: this.props.wizardEntryDn })
        ] })
      ] }) });
      let nb = -1;
      const ldifLines = entryLdifData.split("\n").map((line) => {
        nb++;
        return { data: line, id: nb };
      });
      const ldifDataStep = /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
          Alert,
          {
            variant: "info",
            isInline: true,
            title: _109("LDIF Entry To Be Deleted")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(Card, { isSelectable: true, children: [
          numSubordinates > 0 && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_jsx_runtime109.Fragment, { children: [
            /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(CardBody, { children: _109("Run this command to retrieve the LDAP entries that will be deleted") }),
            /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
              ClipboardCopy,
              {
                variant: ClipboardCopyVariant.expansion,
                isReadOnly: true,
                hoverTip: _109("Copy"),
                clickTip: _109("Copied"),
                children: ldapsearchCmd
              }
            ) })
          ] }),
          numSubordinates === 0 && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(CardBody, { className: "ds-textarea", children: ldifLines.map((line) => /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("h6", { children: line.data }, line.id)) })
        ] })
      ] });
      const nbToDelete = numSubordinates > 0 ? _109("This entry, as well as all its child entries,") : _109("This entry");
      const deletionStep = /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
          Alert,
          {
            variant: "danger",
            isInline: true,
            title: _109("This is an irreversible operation!")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(Card, { isSelectable: true, children: [
          /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(CardTitle, { children: _109("Confirm Entry Deletion") }),
          /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(CardBody, { children: cockpit_default.format(_109("$0 will be deleted."), nbToDelete) }),
          /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(CardBody, { children: [
            entryIcon,
            "\xA0\xA0",
            /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("b", { className: "ds-info-color", children: this.props.wizardEntryDn })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
            Switch,
            {
              isDisabled: this.props.wizardEntryDn === "",
              id: "ack-switch",
              label: _109("Yes, I'm sure."),
              labelOff: _109("No, don't delete."),
              isChecked: isAckChecked,
              onChange: (event, isChecked) => this.handleChangeAck(event, isChecked)
            }
          ) })
        ] }) })
      ] });
      let reviewInfo = "";
      if (commandOutput === "" || commandOutput === "Successfully deleted entry") {
        reviewInfo = numSubordinates > 0 ? _109("The entries were") : _109("The entry was");
        reviewInfo += _109(" successfully deleted.");
      } else {
        reviewInfo = _109("There was an error during the deletion.");
      }
      const delReviewStep = /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "ds-margin-bottom-md", children: [
        /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
          Alert,
          {
            variant: resultVariant,
            title: reviewInfo,
            children: commandOutput
          }
        ),
        this.state.deleting && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "ds-center ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Spinner, { size: "xlg" }) })
      ] });
      const deleteEntrySteps = [
        {
          id: 1,
          name: _109("Acknowledgement"),
          component: acknowledgementStep,
          hideBackButton: true,
          canJumpTo: this.state.stepIdReached >= 1 && this.state.stepIdReached < 4
        },
        {
          id: 2,
          name: _109("LDIF Data"),
          component: ldifDataStep,
          canJumpTo: this.state.stepIdReached >= 2,
          enableNext: this.state.stepIdReached < 4
        },
        {
          id: 3,
          name: _109("Deletion"),
          component: deletionStep,
          nextButtonText: _109("Delete"),
          enableNext: isAckChecked,
          canJumpTo: this.state.stepIdReached === 3
        },
        {
          id: 4,
          name: _109("Review"),
          component: delReviewStep,
          nextButtonText: _109("Finish"),
          canJumpTo: this.state.stepIdReached >= 4,
          hideBackButton: true,
          enableNext: !this.state.deleting
        }
      ];
      return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
        Wizard,
        {
          isOpen: this.props.isWizardOpen,
          onClose: this.props.handleToggleWizard,
          onNext: this.handleNext,
          title: numSubordinates === 0 ? _109("Delete LDAP Entry") : _109("Delete LDAP Entries"),
          steps: deleteEntrySteps
        }
      );
    }
  };
  var deleteOperation_default = DeleteOperationWizard;

  // src/lib/ldap_editor/wizards/genericWizard.jsx
  var import_jsx_runtime110 = __toESM(require_jsx_runtime(), 1);
  var GenericWizard = class extends import_react180.default.Component {
    render() {
      const wizardProps = {
        // Properties
        isWizardOpen: this.props.isWizardOpen,
        wizardEntryDn: this.props.wizardEntryDn,
        editorLdapServer: this.props.editorLdapServer,
        // Functions
        handleToggleWizard: this.props.toggleOpenWizard,
        setWizardOperationInfo: this.props.setWizardOperationInfo,
        onReload: this.props.onReload,
        onModrdnReload: this.props.onModrdnReload,
        addNotification: this.props.addNotification,
        // LDAP Data
        treeViewRootSuffixes: this.props.treeViewRootSuffixes,
        allObjectclasses: this.props.allObjectclasses
      };
      switch (this.props.wizardName) {
        case ENTRY_MENU.acis:
          return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
            aci_default,
            {
              ...wizardProps
            }
          );
        case ENTRY_MENU.new:
          return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
            newEntry_default,
            {
              ...wizardProps
            }
          );
        case ENTRY_MENU.edit:
          return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
            editLdapEntry_default,
            {
              ...wizardProps
            }
          );
        case ENTRY_MENU.rename:
          return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
            renameEntry_default,
            {
              ...wizardProps
            }
          );
        case ENTRY_MENU.cos:
          return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
            cos_default,
            {
              ...wizardProps
            }
          );
        case ENTRY_MENU.delete:
          return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
            deleteOperation_default,
            {
              ...wizardProps
            }
          );
        default:
          console.log(`Unknown Wizard in GenericWizard class: ${this.props.wizardName}`);
          return null;
      }
    }
  };
  var genericWizard_default = GenericWizard;

  // src/lib/ldap_editor/search.jsx
  var import_jsx_runtime111 = __toESM(require_jsx_runtime(), 1);
  var _110 = cockpit_default.gettext;
  var SearchDatabase = class extends import_react181.default.Component {
    constructor(props) {
      super(props);
      // Process the entries that are direct children.
      __publicField(this, "processResults", (searchResults, resObj) => {
        let resultRows = [];
        let rowNumber = 0;
        if (searchResults) {
          if (this.state.checkIfLocked) {
            searchResults.map((aChild) => {
              const info2 = JSON.parse(aChild);
              resultRows = [...this.state.rows];
              let entryState = "";
              let entryStateIcon = "";
              entryStateIcon = /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(LockIcon, { className: "ds-pf-blue-color" });
              const cmd = [
                "dsidm",
                "-j",
                "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
                "-b",
                info2.dn,
                info2.isRole ? "role" : "account",
                "entry-status",
                info2.dn
              ];
              log_cmd("processResults", "Checking if entry is activated", cmd);
              cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
                if (info2.isLockable) {
                  const status = JSON.parse(content);
                  entryState = status.info.state;
                  if (entryState === "inactivity limit exceeded" || entryState.startsWith("probably activated or")) {
                    entryStateIcon = /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(ExclamationTriangleIcon, { className: "ds-pf-yellow-color ct-icon-exclamation-triangle" });
                  }
                }
              }).fail((err) => {
                const errMsg = getApiErrorMessage(err);
                if (info2.isLockable && !errMsg.includes("Root suffix can't be locked or unlocked")) {
                  console.error(
                    "processResults",
                    `${info2.isRole ? "role" : "account"} account entry-status operation failed`,
                    errMsg
                  );
                  entryState = "error: please, check browser logs";
                  entryStateIcon = /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(ExclamationCircleIcon, { className: "ds-pf-red-color ct-exclamation-circle" });
                }
              }).finally(() => {
                if (!info2.isLockable) {
                  console.info("processResults:", `${info2.dn} entry is not lockable`);
                }
                let ldapsubentryIcon = "";
                let entryStateIconFinal = "";
                if (info2.ldapsubentry) {
                  ldapsubentryIcon = /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(InfoCircleIcon, { title: _110("This is a hidden LDAP subentry"), className: "ds-pf-blue-color ds-info-icon" });
                }
                if (entryState !== "" && entryStateIcon !== "" && entryState !== "activated") {
                  entryStateIconFinal = /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                    Tooltip,
                    {
                      position: "bottom",
                      content: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { className: "ds-info-icon", children: entryState }),
                      children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("a", { className: "ds-font-size-md", children: entryStateIcon })
                    }
                  );
                }
                const dn = /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_jsx_runtime111.Fragment, { children: [
                  info2.dn,
                  " ",
                  ldapsubentryIcon,
                  " ",
                  entryStateIconFinal
                ] });
                resultRows.push(
                  {
                    isOpen: false,
                    cells: [
                      { title: dn },
                      info2.numSubordinates,
                      info2.modifyTimestamp
                    ],
                    rawdn: info2.dn,
                    isLockable: info2.isLockable,
                    isRole: info2.isRole,
                    entryState
                  },
                  {
                    parent: rowNumber,
                    cells: [
                      { title: this.initialResultText }
                    ]
                  }
                );
                rowNumber += 2;
                this.setState({
                  searching: false,
                  rows: resultRows,
                  // Each row is composed of a parent and its single child.
                  pagedRows: resultRows.slice(0, 2 * this.state.perPage),
                  total: resultRows.length / 2,
                  page: 1
                });
              });
              return [];
            });
          } else {
            searchResults.map((aChild) => {
              const info2 = JSON.parse(aChild);
              let dn = info2.dn;
              if (info2.ldapsubentry) {
                dn = /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: "ds-info-icon", children: [
                  info2.dn,
                  " ",
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(InfoCircleIcon, { title: _110("This is a hidden LDAP subentry"), className: "ds-info-icon" })
                ] });
              }
              resultRows.push(
                {
                  isOpen: false,
                  cells: [
                    { title: dn },
                    info2.numSubordinates,
                    info2.modifyTimestamp
                  ],
                  rawdn: info2.dn,
                  entryState: ""
                },
                {
                  parent: rowNumber,
                  cells: [
                    { title: this.initialResultText }
                  ]
                }
              );
              rowNumber += 2;
              return [];
            });
            this.setState({
              searching: false,
              rows: resultRows,
              // Each row is composed of a parent and its single child.
              pagedRows: resultRows.slice(0, 2 * this.state.perPage),
              total: resultRows.length / 2,
              page: 1
            });
          }
        } else {
          if (resObj.status !== 0) {
            this.props.addNotification(
              "error",
              cockpit_default.format(_110("Error searching the database: $0"), resObj.msg)
            );
          }
          this.setState({
            searching: false,
            rows: resultRows,
            // Each row is composed of a parent and its single child.
            pagedRows: resultRows.slice(0, 2 * this.state.perPage),
            total: resultRows.length / 2,
            page: 1
          });
        }
      });
      __publicField(this, "actionResolver", (rowData, { rowIndex }) => {
        if (rowIndex % 2 === 1) {
          return null;
        }
        let lockingDropdown = [];
        if (rowData.entryState !== "" && !rowData.entryState.startsWith("error:")) {
          if (rowData.entryState !== "activated") {
            if (rowData.entryState.includes("probably activated") || rowData.entryState.includes("indirectly locked")) {
              lockingDropdown = [{
                title: _110("Lock ..."),
                onClick: () => {
                  const entryType = rowData.isRole ? "role" : "account";
                  this.setState({
                    entryDn: rowData.rawdn,
                    entryType,
                    operationType: "lock"
                  }, () => {
                    this.handleConfirmModalToggle();
                  });
                }
              }];
            } else {
              lockingDropdown = [{
                title: _110("Unlock ..."),
                onClick: () => {
                  const entryType = rowData.isRole ? "role" : "account";
                  this.setState({
                    entryDn: rowData.rawdn,
                    entryType,
                    operationType: "unlock"
                  }, () => {
                    this.handleConfirmModalToggle();
                  });
                }
              }];
            }
          } else {
            lockingDropdown = [{
              title: _110("Lock ..."),
              onClick: () => {
                const entryType = rowData.isRole ? "role" : "account";
                this.setState({
                  entryDn: rowData.rawdn,
                  entryType,
                  operationType: "lock"
                }, () => {
                  this.handleConfirmModalToggle();
                });
              }
            }];
          }
        }
        const updateActions = [
          {
            title: _110("Search ..."),
            onClick: () => {
              this.setState({
                activeTabKey: 2,
                searchBase: rowData.rawdn
              });
            }
          },
          {
            title: _110("Edit ..."),
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.edit,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true
              });
            }
          },
          {
            title: _110("New ..."),
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.new,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true
              });
            }
          },
          ...lockingDropdown,
          {
            isSeparator: true
          },
          {
            title: _110("ACIs ..."),
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.acis,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true
              });
            }
          },
          {
            title: _110("Class of Service ..."),
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.cos,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true,
                isTreeWizardOpen: false
              });
            }
          },
          {
            isSeparator: true
          },
          {
            title: _110("Delete"),
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.delete,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true
              });
            }
          }
        ];
        return [
          ...updateActions
        ];
      });
      this.state = {
        searching: false,
        loading: false,
        searchBase: "",
        searchFilter: "",
        searchScope: "sub",
        sizeLimit: 2e3,
        timeLimit: 30,
        isExpanded: false,
        searchSuffix: "",
        baseDN: "",
        searchType: "Search Text",
        searchText: "",
        getOperationalAttrs: false,
        total: 0,
        // Search attributes
        cn: true,
        uid: true,
        sn: true,
        givenName: true,
        mail: true,
        displayName: false,
        legalName: false,
        memberOf: false,
        member: false,
        uniqueMember: false,
        customSearchAttrs: [],
        isCustomAttrOpen: false,
        isConfirmModalOpen: false,
        checkIfLocked: false,
        // Table
        columns: [
          {
            title: _110("Entry DN"),
            cellFormatters: [expandable]
          },
          {
            title: _110("Child Entries")
          },
          {
            title: _110("Last Modified")
          }
        ],
        rows: [],
        page: 0,
        perPage: 10,
        pagedRows: [],
        wizardName: "",
        isWizardOpen: false,
        wizardEntryDn: "",
        treeViewRootSuffixes: []
        // TODO when aci's are ready (is there a better list of suffixes?)
      };
      this.initialResultText = _110("Loading ...");
      this.handleChangeSwitch = (_event, checkIfLocked) => {
        this.setState({
          checkIfLocked
        });
      };
      this.handleToggle = (_event, isExpanded) => {
        this.setState({
          isExpanded
        });
      };
      this.toggleOpenWizard = () => {
        this.setState({
          isWizardOpen: !this.state.isWizardOpen
        });
      };
      this.setWizardOperationInfo = (opInfo) => {
        const wizardOperationInfo = { ...opInfo };
        this.setState({ wizardOperationInfo });
      };
      this.handleCustomAttrToggle = (_event, isCustomAttrOpen) => {
        this.setState({
          isCustomAttrOpen
        });
      };
      this.handleCustomAttrClear = () => {
        this.setState({
          customSearchAttrs: [],
          isCustomAttrOpen: false
        });
      };
      this.handleCustomAttrChange = (event, selection) => {
        this.setState({
          customSearchAttrs: Array.isArray(selection) ? selection : [],
          isCustomAttrOpen: false
        }, () => {
          this.buildSearchFilter(this.state.searchText);
        });
      };
      this.buildSearchFilter = (value) => {
        let searchFilter2 = "";
        if (this.state.searchType === "Search Text") {
          let attrs = [];
          const chkBoxAttrs = [
            "cn",
            "uid",
            "sn",
            "givenName",
            "mail",
            "displayName",
            "legalName",
            "memberOf",
            "member",
            "uniqueMember"
          ];
          for (const attr of chkBoxAttrs) {
            if (this.state[attr]) {
              attrs.push(attr);
            }
          }
          attrs = attrs.concat(this.state.customSearchAttrs);
          if (attrs.length === 0) {
            return;
          }
          if (attrs.length > 1) {
            searchFilter2 = "(|";
            for (const attr of attrs) {
              searchFilter2 += "(" + attr + "=*" + value + "*)";
            }
            searchFilter2 += ")";
          } else {
            searchFilter2 = "(" + attrs[0] + "=*" + value + "*)";
          }
        } else {
          searchFilter2 = value;
        }
        return searchFilter2;
      };
      this.handleSearchChange = (event, value) => {
        this.setState({
          searchText: value,
          searchFilter: this.buildSearchFilter(value)
        });
      };
      this.handleSearch = () => {
        if (!this.state.searchFilter) {
          return;
        }
        this.setState({
          rows: [],
          isExpanded: false,
          searching: true
        }, () => {
          const params = {
            serverId: this.props.serverId,
            searchBase: this.state.searchBase,
            searchFilter: this.state.searchFilter,
            searchScope: this.state.searchScope,
            sizeLimit: this.state.sizeLimit,
            timeLimit: this.state.timeLimit,
            addNotification: this.props.addNotification
          };
          getSearchEntries(params, this.processResults);
        });
      };
      this.handleSearchTypeClick = (event, isSelected) => {
        const id = event.currentTarget.id;
        this.setState({
          searchType: id,
          searchText: "",
          searchFilter: ""
        });
      };
      this.handleScopeClick = (event, isSelected) => {
        const id = event.currentTarget.id;
        this.setState({ searchScope: id });
      };
      this.maxValue = 2e7;
      this.onMinus = (id) => {
        this.setState({
          [id]: Number(this.state[id]) - 1
        });
      };
      this.onNumberChange = (event, id, min3) => {
        const newValue = isNaN(event.target.value) ? 0 : Number(event.target.value);
        this.setState({
          [id]: newValue > this.maxValue ? this.maxValue : newValue < min3 ? min3 : newValue
        });
      };
      this.onPlus = (id) => {
        this.setState({
          [id]: Number(this.state[id]) + 1
        });
      };
      this.handleClearSearchBase = () => {
        this.setState({
          searchBase: this.state.searchSuffix
        });
      };
      this.handleConfirmModalToggle = () => {
        this.setState(({ isConfirmModalOpen }) => ({
          isConfirmModalOpen: !isConfirmModalOpen
        }));
      };
      this.handleChange = this.handleChange.bind(this);
      this.handleSuffixChange = this.handleSuffixChange.bind(this);
      this.handleCustomAttrChange = this.handleCustomAttrChange.bind(this);
      this.getPageData = this.getPageData.bind(this);
      this.processResults = this.processResults.bind(this);
      this.handleCollapse = this.handleCollapse.bind(this);
      this.actionResolver = this.actionResolver.bind(this);
      this.handleLockUnlockEntry = this.handleLockUnlockEntry.bind(this);
    }
    componentDidMount() {
      const suffixList = this.props.suffixList;
      const searchBase = this.props.searchBase;
      let baseDN = searchBase;
      for (const suffix of suffixList) {
        if (baseDN.includes(suffix)) {
          baseDN = suffix;
          break;
        }
      }
      this.setState({
        searchBase: searchBase || (suffixList.length > 0 ? suffixList[0] : ""),
        searchSuffix: this.props.suffixList.length > 0 ? this.props.suffixList[0] : "",
        baseDN
      });
    }
    handleCollapse(event, rowKey, isOpen, data) {
      const { pagedRows } = this.state;
      pagedRows[rowKey].isOpen = isOpen;
      this.setState({
        pagedRows
      });
      const firstTime = pagedRows[rowKey + 1].cells[0].title === this.initialResultText;
      if (firstTime) {
        const baseDn = pagedRows[rowKey].rawdn;
        getBaseLevelEntryAttributes(this.props.serverId, baseDn, (entryArray) => {
          pagedRows[rowKey + 1].cells = [{
            title: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_jsx_runtime111.Fragment, { children: entryArray.map((line) => /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { children: [
              /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("strong", { children: line.attribute }),
              line.value.toLowerCase() === ": ldapsubentry" ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { className: "ds-info-color", children: line.value }) : line.attribute.toLowerCase() === "userpassword" ? ": ********" : line.attribute.toLowerCase() === "jpegphoto" ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                "img",
                {
                  src: `data:image/png;base64,${line.value.substr(3)}`,
                  alt: "",
                  style: { width: "256px" }
                }
              ) }) : line.value
            ] }, line.attribute + line.value)) })
          }];
          this.setState({
            pagedRows
          });
        });
      }
    }
    handleCustomAttrChange(value) {
      this.setState({
        customSearchAttrs: value
      });
    }
    handleSuffixChange(e) {
      const value = e.target.value;
      this.setState({
        searchSuffix: value,
        searchBase: value,
        baseDN: value
      });
    }
    handleChange(e, _str) {
      const value = e.target.type === "checkbox" ? e.target.checked : e.target.value.trim();
      this.setState({
        [e.target.id]: value
      }, () => {
        this.setState({
          searchFilter: this.buildSearchFilter(this.state.searchText)
        });
      });
    }
    getPageData(page, perPage) {
      if (page === 1) {
        const pagedRows = this.state.rows.slice(0, 2 * perPage);
        this.setState({ pagedRows, perPage, page, loading: false });
      } else {
        const start2 = 2 * (page - 1) * perPage;
        const end2 = 2 * page * perPage;
        const pagedRows = this.state.rows.slice(start2, end2);
        for (let i = 0; i < pagedRows.length - 1; i++) {
          if (i % 2 === 0) {
            pagedRows[i + 1].parent = i;
          }
        }
        this.setState({ pagedRows, perPage, page, loading: false });
      }
    }
    handleLockUnlockEntry() {
      const {
        entryDn,
        entryType,
        operationType
      } = this.state;
      const cmd = [
        "dsidm",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "-b",
        entryDn,
        entryType,
        operationType,
        entryDn
      ];
      log_cmd("handleLockUnlockEntry", `${operationType} entry`, cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((_113) => {
        this.setState({
          entryMenuIsOpen: !this.state.entryMenuIsOpen,
          refreshEntryTime: Date.now()
        }, () => {
          this.handleSearch();
          this.handleConfirmModalToggle();
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        console.error(
          "handleLockUnlockEntry",
          `${entryType} ${operationType} operation failed -`,
          errMsg
        );
        this.props.addNotification(
          `${errMsg.includes(`is already ${operationType === "unlock" ? "active" : "locked"}`) ? "warning" : "error"}`,
          `${errMsg}`
        );
        this.setState({
          entryMenuIsOpen: !this.state.entryMenuIsOpen,
          refreshEntryTime: Date.now()
        }, () => {
          this.handleSearch();
          this.handleConfirmModalToggle();
        });
      });
    }
    render() {
      const {
        suffixList
      } = this.props;
      const {
        baseDN,
        page,
        perPage,
        total,
        searching,
        wizardName,
        isWizardOpen,
        wizardEntryDn
      } = this.state;
      let columns = this.state.columns;
      let pagedRows = this.state.pagedRows;
      if (pagedRows.length === 0) {
        columns = [" "];
        pagedRows = [{ cells: [_110("No Search Results")] }];
      }
      const treeItemsProps = wizardName === "acis" ? { treeViewRootSuffixes: this.state.treeViewRootSuffixes } : {};
      return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { children: [
        isWizardOpen && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
          genericWizard_default,
          {
            wizardName,
            isWizardOpen,
            toggleOpenWizard: this.toggleOpenWizard,
            wizardEntryDn,
            editorLdapServer: this.props.serverId,
            ...treeItemsProps,
            setWizardOperationInfo: this.setWizardOperationInfo,
            onReload: this.handleSearch,
            allObjectclasses: this.props.allObjectclasses
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(Form, { className: "ds-margin-top-lg", isHorizontal: true, autoComplete: "off", children: [
          /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Grid, { className: "ds-margin-left", children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: "ds-container", children: [
            /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Text, { component: TextVariants.h3, children: _110("Search Database") }) }),
            /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(Grid, { className: "ds-left-margin", children: [
              /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
                FormSelect,
                {
                  id: "searchSuffix",
                  value: baseDN,
                  onChange: (event, value) => {
                    this.handleSuffixChange(event);
                  },
                  "aria-label": "FormSelect Input",
                  className: "ds-instance-select ds-raise-field",
                  isDisabled: suffixList.length === 0,
                  children: [
                    suffixList.map((suffix, index) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(FormSelectOption, { value: suffix, label: suffix }, suffix)),
                    suffixList.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(FormSelectOption, { isDisabled: true, value: "", label: _110("No databases") }, "No database")
                  ]
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 7, children: this.state.searchSuffix !== this.state.searchBase ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Label, { onClose: this.handleClearSearchBase, className: "ds-left-margin", color: "blue", children: this.state.searchBase }) : "" })
            ] })
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Grid, { className: "ds-margin-left", children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 5, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: "ds-container", children: [
            /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(ToggleGroup, { "aria-label": "Default with single selectable", children: [
              /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                ToggleGroupItem,
                {
                  title: _110("Text that will be used with pre-selected attributes to find matching entries."),
                  text: _110("Text"),
                  buttonId: "Search Text",
                  isSelected: this.state.searchType === "Search Text",
                  onChange: (event, isSelected) => this.handleSearchTypeClick(event, isSelected)
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                ToggleGroupItem,
                {
                  title: _110("Specific LDAP search filter for finding entries."),
                  text: _110("Filter"),
                  buttonId: "Search Filter",
                  isSelected: this.state.searchType === "Search Filter",
                  onChange: (event, isSelected) => this.handleSearchTypeClick(event, isSelected)
                }
              )
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
              SearchInput,
              {
                placeholder: this.state.searchType === "Search Text" ? _110("Enter search text ...") : _110("Enter an LDAP search filter ..."),
                value: this.state.searchText,
                onChange: (evt, val) => this.handleSearchChange(evt, val),
                onClear: (evt, val) => this.handleSearchChange(evt, ""),
                onSearch: this.handleSearch,
                className: "ds-search-input"
              }
            )
          ] }) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
            ExpandableSection,
            {
              className: "ds-margin-left",
              toggleText: this.state.isExpanded ? _110("Hide Search Criteria") : _110("Show Search Criteria"),
              onToggle: (event, isExpanded) => this.handleToggle(event, isExpanded),
              isExpanded: this.state.isExpanded,
              displaySize: this.state.isExpanded ? "large" : "default",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(Grid, { className: "ds-margin-left", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 2, className: "ds-label", children: _110("Search Base") }),
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                    TextInput,
                    {
                      value: this.state.searchBase,
                      type: "text",
                      id: "searchBase",
                      "aria-describedby": "searchBase",
                      name: _110("searchBase"),
                      onChange: (e, str) => {
                        this.handleChange(e);
                      },
                      validated: !valid_dn(this.state.searchBase) ? ValidatedOptions.error : ValidatedOptions.default
                    }
                  ) }),
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 2, className: "ds-left-margin ds-lower-field-md", children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(FormHelperText, { children: _110("Invalid DN syntax") }) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(Grid, { className: "ds-margin-left ds-margin-top", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 2, className: "ds-label", children: _110("Search Scope") }),
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 4, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(ToggleGroup, { "aria-label": "search scope", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                      ToggleGroupItem,
                      {
                        text: _110("Subtree"),
                        buttonId: "sub",
                        isSelected: this.state.searchScope === "sub",
                        onChange: (evt, val) => this.handleScopeClick(evt, val),
                        title: _110("Search for entries starting at the search base, and including all its child entries")
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                      ToggleGroupItem,
                      {
                        text: _110("One Level"),
                        buttonId: "one",
                        isSelected: this.state.searchScope === "one",
                        onChange: (evt, val) => this.handleScopeClick(evt, val),
                        title: _110("Search for entries starting at the search base, and include only the first level of child entries")
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                      ToggleGroupItem,
                      {
                        text: _110("Base"),
                        buttonId: "base",
                        isSelected: this.state.searchScope === "base",
                        onChange: (evt, val) => this.handleScopeClick(evt, val),
                        title: _110("Search for an exact entry (search base). This does not include child entries.")
                      }
                    )
                  ] }) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(Grid, { className: "ds-margin-left ds-margin-top", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 2, className: "ds-label", children: _110("Size Limit") }),
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                    NumberInput,
                    {
                      value: this.state.sizeLimit,
                      min: -1,
                      max: this.maxValue,
                      onMinus: () => {
                        this.onMinus("sizeLimit");
                      },
                      onChange: (e) => {
                        this.onNumberChange(e, "sizeLimit", -1);
                      },
                      onPlus: () => {
                        this.onPlus("sizeLimit");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 8
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(Grid, { className: "ds-margin-left ds-margin-top", title: _110("Search timeout in seconds"), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 2, className: "ds-label", children: _110("Time Limit") }),
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                    NumberInput,
                    {
                      value: this.state.timeLimit,
                      min: -1,
                      max: this.maxValue,
                      onMinus: () => {
                        this.onMinus("timeLimit");
                      },
                      onChange: (e) => {
                        this.onNumberChange(e, "timeLimit", -1);
                      },
                      onPlus: () => {
                        this.onPlus("timeLimit");
                      },
                      inputName: "input",
                      inputAriaLabel: "number input",
                      minusBtnAriaLabel: "minus",
                      plusBtnAriaLabel: "plus",
                      widthChars: 8
                    }
                  ) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(Grid, { className: "ds-margin-left ds-margin-top", title: _110("Check if the search result entries are locked, and add Lock/Unlock options to the dropdown. This setting vastly impacts the search's performance. Use only when needed."), children: [
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 2, className: "ds-label", children: _110("Show Locking") }),
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Switch, { id: "no-label-switch-on", "aria-label": "Message when on", isChecked: this.state.checkIfLocked, onChange: (event, val) => this.handleChangeSwitch(event, val) }) })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { hidden: this.state.searchType === "Search Filter", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                    Grid,
                    {
                      className: "ds-margin-left ds-margin-top",
                      title: _110("Only used for Search Text based queries.  The selected attributes will use Search Text as the attribute value in the search filter"),
                      children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 2, className: "ds-label", children: _110("Search Attributes") })
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: "ds-indent", children: [
                    /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(Grid, { className: "ds-margin-left ds-margin-top", children: [
                      /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                        Checkbox,
                        {
                          label: _110("cn"),
                          id: "cn",
                          isChecked: this.state.cn,
                          onChange: (e, checked) => {
                            this.handleChange(e);
                          },
                          "aria-label": "cn"
                        }
                      ) }),
                      /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                        Checkbox,
                        {
                          label: _110("uid"),
                          id: "uid",
                          isChecked: this.state.uid,
                          onChange: (e, checked) => {
                            this.handleChange(e);
                          },
                          "aria-label": "uid"
                        }
                      ) }),
                      /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                        Checkbox,
                        {
                          label: _110("sn"),
                          id: "sn",
                          isChecked: this.state.sn,
                          onChange: (e, checked) => {
                            this.handleChange(e);
                          },
                          "aria-label": "sn"
                        }
                      ) })
                    ] }),
                    /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(Grid, { className: "ds-margin-left ds-margin-top", children: [
                      /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                        Checkbox,
                        {
                          label: _110("givenName"),
                          id: "givenName",
                          isChecked: this.state.givenName,
                          onChange: (e, checked) => {
                            this.handleChange(e);
                          },
                          "aria-label": "givenName"
                        }
                      ) }),
                      /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                        Checkbox,
                        {
                          label: _110("mail"),
                          id: "mail",
                          isChecked: this.state.mail,
                          onChange: (e, checked) => {
                            this.handleChange(e);
                          },
                          "aria-label": "mail"
                        }
                      ) }),
                      /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                        Checkbox,
                        {
                          label: _110("displayName"),
                          id: "displayName",
                          isChecked: this.state.displayName,
                          onChange: (e, checked) => {
                            this.handleChange(e);
                          },
                          "aria-label": "displayName"
                        }
                      ) })
                    ] }),
                    /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(Grid, { className: "ds-margin-left ds-margin-top", children: [
                      /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                        Checkbox,
                        {
                          label: _110("legalName"),
                          id: "legalName",
                          isChecked: this.state.legalName,
                          onChange: (e, checked) => {
                            this.handleChange(e);
                          },
                          "aria-label": "legalName"
                        }
                      ) }),
                      /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                        Checkbox,
                        {
                          label: _110("memberOf"),
                          id: "memberOf",
                          isChecked: this.state.memberOf,
                          onChange: (e, checked) => {
                            this.handleChange(e);
                          },
                          "aria-label": "memberOf"
                        }
                      ) }),
                      /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                        Checkbox,
                        {
                          label: _110("member"),
                          id: "member",
                          isChecked: this.state.member,
                          onChange: (e, checked) => {
                            this.handleChange(e);
                          },
                          "aria-label": "member"
                        }
                      ) })
                    ] }),
                    /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Grid, { className: "ds-margin-left ds-margin-top", children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 3, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                      Checkbox,
                      {
                        label: _110("uniqueMember"),
                        id: "uniqueMember",
                        isChecked: this.state.uniqueMember,
                        onChange: (e, checked) => {
                          this.handleChange(e);
                        },
                        "aria-label": "uniqueMember"
                      }
                    ) }) }),
                    /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Grid, { className: "ds-margin-left ds-margin-top", title: _110("Enter space or comma separated list of attributes to search."), children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(GridItem, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
                      dsBasicComponents_default,
                      {
                        selected: this.state.customSearchAttrs,
                        onSelect: this.handleCustomAttrChange,
                        onClear: this.handleCustomAttrClear,
                        options: this.props.attributes,
                        isOpen: this.state.isCustomAttrOpen,
                        onToggle: this.handleCustomAttrToggle,
                        placeholder: _110("Type attributes to include in the filter ..."),
                        noResultsText: "There are no matching attributes",
                        ariaLabel: "Type attributes to include in filter ...",
                        isMulti: true
                      }
                    ) }) }),
                    /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("hr", {})
                  ] })
                ] })
              ]
            }
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: "ds-indent", children: [
          /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: this.state.searching ? "ds-margin-top-lg ds-center" : "ds-hidden", children: [
            /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(Text, { component: TextVariants.h3, children: [
              _110("Searching"),
              " ",
              /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("i", { children: this.state.searchBase }),
              " ..."
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: searching ? "ds-hidden" : "ds-margin-top", children: [
            /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("center", { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("p", { children: [
              /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("b", { children: _110("Results:") }),
              " ",
              total
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
              tableView_default,
              {
                loading: searching,
                itemCount: total,
                page,
                perPage,
                onSetPage: (value) => this.getPageData(value, perPage),
                onPerPageSelect: (value) => this.getPageData(1, value),
                editorTableRows: pagedRows,
                onCollapse: this.handleCollapse,
                columns,
                actionResolver: pagedRows.length < 2 ? null : this.actionResolver
              },
              searching
            )
          ] })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: cockpit_default.format(_110("Are you sure you want to $0 the $1?"), this.state.operationType, this.state.entryTyp),
            isOpen: this.state.isConfirmModalOpen,
            onClose: this.handleConfirmModalToggle,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Button, { variant: "primary", onClick: this.handleLockUnlockEntry, children: _110("Confirm") }, "confirm"),
              /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Button, { variant: "link", onClick: this.handleConfirmModalToggle, children: _110("Cancel") }, "cancel")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(TextContent, { className: "ds-margin-top", children: [
              /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Text, { children: this.state.entryType === "account" ? `It will ${this.state.operationType === "lock" ? "add" : "remove"} nsAccountLock attribute
                            ${this.state.operationType === "lock" ? "to" : "from"} the entry - ${this.state.entryDn}.` : `This operation will make sure that these five entries are created at the entry's root suffix (if not, they will be created):` }),
              this.state.entryType === "role" && /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_jsx_runtime111.Fragment, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(TextList, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(TextListItem, { children: "cn=nsManagedDisabledRole" }),
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(TextListItem, { children: "cn=nsDisabledRole" }),
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(TextListItem, { children: "cn=nsAccountInactivationTmp (with a child)" }),
                  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(TextListItem, { children: "cn=nsAccountInactivation_cos" })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Text, { children: `The entry - ${this.state.entryDn} - will be ${this.state.operationType === "lock" ? "added to" : "removed from"} nsRoleDN attribute in cn=nsDisabledRole entry in the root suffix.` })
              ] })
            ] })
          }
        )
      ] });
    }
  };
  SearchDatabase.propTypes = {
    attributes: import_prop_types86.default.array,
    searchBase: import_prop_types86.default.string
  };
  SearchDatabase.defaultProps = {
    attributes: [],
    searchBase: ""
  };

  // src/LDAPEditor.jsx
  var import_jsx_runtime112 = __toESM(require_jsx_runtime(), 1);
  var _111 = cockpit_default.gettext;
  var LDAPEditor = class extends import_react182.default.Component {
    constructor(props) {
      super(props);
      __publicField(this, "onNavItemClick", (id, active) => {
        if (id === "home" || active) {
          return;
        }
        if (id === "db-suffixes") {
          const navItems = this.state.navItems.slice(0, 2);
          this.setState({
            navItems,
            loading: true,
            baseDN: id
          });
          this.showSuffixes("Database Suffixes", null);
        } else {
          const listOfItems = this.state.navItems;
          let position;
          for (position = 2; position < listOfItems.length - 1; position++) {
            if (listOfItems[position].id === id) {
              break;
            }
          }
          const navItems = this.state.navItems.slice(0, position + 1);
          const len = navItems.length;
          navItems[len - 1].active = true;
          this.setState({
            navItems,
            baseDN: id,
            searching: true
          });
          const params = {
            serverId: this.props.serverId,
            baseDn: id,
            addNotification: this.props.addNotification
          };
          getOneLevelEntries(params, this.processDirectChildren);
        }
      });
      // Handle clicks on the numSubordinates links.
      __publicField(this, "handleClickNumSubordinates", (dn) => {
        const listOfItems = this.state.navItems;
        const itemsLength = listOfItems.length;
        let totalParentLength = 0;
        let pos = 0;
        while (pos < itemsLength) {
          listOfItems[pos].active = false;
          if (pos > 1) {
            totalParentLength += listOfItems[pos].label.length + 1;
          }
          pos++;
        }
        let newLabel = dn;
        if (itemsLength > 2) {
          const dnLength = dn.length;
          newLabel = dn.slice(0, dnLength - totalParentLength);
        }
        const newNavItems = [
          ...listOfItems,
          { id: dn, to: "#", label: newLabel, active: true }
        ];
        const tableTitle = this.state.columns[0].title;
        if (tableTitle === "Database Suffixes") {
          this.setState((prevState) => ({
            columns: [
              {
                title: _111("Entry DN"),
                cellFormatters: [expandable]
              },
              ...prevState.columns.slice(1)
            ]
          }));
        }
        this.setState({
          navItems: newNavItems,
          baseDN: dn,
          searching: true
        });
        const params = {
          serverId: this.props.serverId,
          baseDn: dn,
          addNotification: this.props.addNotification
        };
        getOneLevelEntries(params, this.processDirectChildren);
      });
      // Process the entries that are direct children.
      __publicField(this, "processDirectChildren", (directChildren, params) => {
        this.setState({
          loading: true
        });
        const childrenRows = [];
        let rowNumber = 0;
        directChildren.map((aChild) => {
          const info2 = JSON.parse(aChild);
          const numSubCellInfo = parseInt(info2.numSubordinates) > 0 ? {
            title: /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("a", { href: "#", onClick: (e) => this.handleClickNumSubordinates(info2.dn, false, e), children: [
              info2.numSubordinates,
              " ",
              /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(AngleRightIcon, {})
            ] })
          } : info2.numSubordinates;
          let dn = info2.dn;
          if (info2.ldapsubentry) {
            dn = /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: "ds-info-icon", children: [
              info2.dn,
              " ",
              /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(InfoCircleIcon, { title: _111("This is a hidden LDAP subentry"), className: "ds-info-icon" })
            ] });
          }
          childrenRows.push(
            {
              isOpen: false,
              cells: [
                { title: dn },
                numSubCellInfo,
                info2.modifyTimestamp
              ],
              rawdn: info2.dn,
              entryState: "",
              isRole: info2.isRole,
              isLockable: info2.isLockable,
              ldapsubentry: info2.ldapsubentry
            },
            {
              // customRowId: info.parentId + 1,
              parent: rowNumber,
              // info.parentId,
              cells: [
                { title: this.initialChildText }
              ]
            }
          );
          rowNumber += 2;
          return [];
        });
        this.setState({
          loading: false,
          searching: false,
          rows: childrenRows,
          // Each row is composed of a parent and its single child.
          pagedRows: childrenRows.slice(0, 2 * this.state.perPage),
          total: childrenRows.length / 2,
          page: 1
        }, () => {
          if (this.state.currentRowKey >= 0) {
            this.handleCollapse(null, this.state.currentRowKey, true, null);
          }
        });
      });
      // Update the table rows after getting details of the root suffixes.
      __publicField(this, "updateTableRootSuffixes", (entryDetails) => {
        const info2 = JSON.parse(entryDetails);
        if (info2.dn === null) {
          console.log('updateTableRootSuffixes: Got a NULL DN! Object "info" ===> ' + info2);
          return;
        }
        const isEmptySuffix = info2.errorCode === 32;
        const suffixCellInfo = !isEmptySuffix ? info2.dn : {
          title: /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: "ds-warning-icon", children: [
            /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ExclamationTriangleIcon, {}),
            " ",
            info2.dn
          ] })
        };
        let key = 0;
        const numSubCellInfo = parseInt(info2.numSubordinates) > 0 ? {
          title: /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("a", { href: "#", onClick: (e) => this.handleClickNumSubordinates(info2.dn, true, e), children: [
            info2.numSubordinates,
            " ",
            /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(AngleRightIcon, {})
          ] }, "link-" + info2.dn)
        } : info2.numSubordinates;
        let node_present = false;
        for (const node of this.rootSuffixesRows) {
          if (node.rawdn === info2.dn) {
            node_present = true;
            break;
          }
        }
        if (!node_present) {
          this.rootSuffixesRows = [
            ...this.rootSuffixesRows,
            {
              isOpen: false,
              cells: [
                suffixCellInfo,
                numSubCellInfo,
                info2.modifyTimestamp
              ],
              rawdn: info2.dn,
              customRowId: info2.parentId,
              isEmptySuffix,
              entryState: ""
            },
            {
              customRowId: info2.parentId + 1,
              parent: info2.parentId,
              cells: [{
                title: !isEmptySuffix ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_jsx_runtime112.Fragment, { children: info2.fullEntry.map((line) => /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("strong", { children: [
                    " ",
                    line.attribute
                  ] }),
                  line.value
                ] }, key++)) }) : /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("strong", { children: [
                    "\xA0",
                    /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("em", { children: [
                      _111("This suffix is empty!"),
                      "\xA0\xA0\xA0"
                    ] })
                  ] }),
                  /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("a", { href: "#", onClick: () => {
                    this.onHandleEmptySuffixToggle(info2.dn);
                  }, children: _111("Click here to create the top entry") }, "top-entry-" + info2.dn)
                ] })
              }]
            }
          ];
        }
        const numSubValue = parseInt(info2.numSubordinates);
        const randomId = generateUniqueId();
        const nodeChildren = [{
          name: _111("Loading..."),
          id: randomId,
          icon: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Spinner, { size: "sm" }),
          isFakeEntry: true
        }];
        const nodeDn = info2.dn === "" ? "Root DSE" : info2.dn;
        const entryTreeData = {
          name: nodeDn,
          fullEntry: info2.fullEntry,
          //
          children: numSubValue > 0 ? nodeChildren : null,
          modTime: info2.modifyTimestamp,
          modTimeLocal: info2.modifyTimestampLocal,
          // The DN value can also be retrieved from info.fullEntry
          // ( but will require to retrieve the DN line and then split it. Taking a lazy approach here ;-))
          dn: info2.dn,
          isEmptySuffix,
          loadChildren: numSubValue > 0
          // Used to insert child nodes when needed.
        };
        if (numSubValue > 0) {
          entryTreeData.customBadgeContent = numSubValue;
        }
        if (isEmptySuffix) {
          entryTreeData.icon = /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ResourcesEmptyIcon, { color: "var(--pf-global--palette--orange-300)" });
        } else {
          entryTreeData.icon = null;
        }
        node_present = false;
        for (const node of this.rootSuffixesTreeData) {
          if (node.name === entryTreeData.name) {
            node.icon = entryTreeData.icon;
            node_present = true;
            break;
          }
        }
        if (!node_present) {
          this.rootSuffixesTreeData = [...this.rootSuffixesTreeData, entryTreeData];
        }
        if (this.rootSuffixesRows.length === 2 * this.state.numberSuffixes) {
          const finalRowData = this.rootSuffixesRows.sort((e1, e22) => e1.customRowId - e22.customRowId);
          this.setState({
            loading: false,
            rows: finalRowData,
            // Each row is composed of a parent and its single child.
            pagedRows: finalRowData.slice(0, 2 * this.state.perPage),
            total: finalRowData.length / 2,
            page: 1
          });
          const myTreeRootSuffixes = [...this.rootSuffixesTreeData];
          let myLocationIdentifier = 0;
          const treeViewRootSuffixes = myTreeRootSuffixes.map((node) => {
            node.id = myLocationIdentifier.toString();
            myLocationIdentifier++;
            return node;
          });
          const timeOfCompletion = Date.now();
          this.setState({
            treeViewRootSuffixes,
            timeOfCompletion
          });
        }
      });
      // Process the root suffixes
      __publicField(this, "processRootSuffixes", (userSuffData) => {
        let loading = this.state.loading;
        let isEmpty11 = false;
        if (userSuffData === void 0 || userSuffData === null || userSuffData.length === 0) {
          isEmpty11 = true;
          loading = false;
        }
        this.rootSuffixesRows = [];
        const suffixesToProcess = isEmpty11 ? [] : [...userSuffData];
        this.setState({
          numberSuffixes: suffixesToProcess.length,
          suffixList: [...userSuffData],
          loading
        }, () => {
          let parentId = 0;
          suffixesToProcess.map((suffixDN) => {
            const params = {
              serverId: this.props.serverId,
              baseDn: suffixDN,
              parentId,
              addNotification: this.props.addNotification
            };
            getRootSuffixEntryDetails(params, this.updateTableRootSuffixes);
            parentId += 2;
            return [];
          });
        });
      });
      __publicField(this, "showSuffixes", (label, event) => {
        getUserSuffixes(this.props.serverId, this.processRootSuffixes);
        if (!!label === false) {
          return;
        }
        const isRootSuff = label === "Database Suffixes";
        this.setState({
          onRootSuffixes: isRootSuff
        });
        const tableTitle = this.state.columns[0].title;
        if (isRootSuff && tableTitle !== "Database Suffixes" || !isRootSuff && tableTitle === "Database Suffixes") {
          const firstTitle = label === "Database Suffixes" ? _111("Database Suffixes") : _111("Entry DN");
          this.setState((prevState) => ({
            columns: [
              {
                title: firstTitle,
                cellFormatters: [expandable]
              },
              ...prevState.columns.slice(1)
            ]
          }), () => {
            this.setState({ searching: false });
          });
        } else {
          this.setState({
            searching: false
          });
        }
      });
      __publicField(this, "actionResolver", (rowData, { rowIndex }) => {
        if (rowIndex % 2 === 1) {
          return null;
        }
        if (rowData.isEmptySuffix) {
          return [{
            title: _111("Create Top Entry..."),
            onClick: () => {
              this.onHandleEmptySuffixToggle(rowData.rawdn);
            }
          }];
        }
        let lockingDropdown = [];
        if (rowData.isLockable) {
          if (rowData.entryState !== "" && rowData.entryState !== "activated") {
            if (rowData.entryState.includes("probably activated") || rowData.entryState.includes("indirectly locked")) {
              lockingDropdown = [{
                title: _111("Lock ..."),
                onClick: () => {
                  const entryType = rowData.isRole ? "role" : "account";
                  this.setState({
                    entryDn: rowData.rawdn,
                    entryType,
                    operationType: "lock",
                    currentRowKey: rowData.secretTableRowKeyId
                  }, () => {
                    this.handleConfirmModalToggle();
                  });
                }
              }];
            } else {
              lockingDropdown = [{
                title: _111("Unlock ..."),
                onClick: () => {
                  const entryType = rowData.isRole ? "role" : "account";
                  this.setState({
                    entryDn: rowData.rawdn,
                    entryType,
                    operationType: "unlock",
                    currentRowKey: rowData.secretTableRowKeyId
                  }, () => {
                    this.handleConfirmModalToggle();
                  });
                }
              }];
            }
          } else if (rowData.entryState === "activated") {
            lockingDropdown = [{
              title: _111("Lock ..."),
              onClick: () => {
                const entryType = rowData.isRole ? "role" : "account";
                this.setState({
                  entryDn: rowData.rawdn,
                  entryType,
                  operationType: "lock",
                  currentRowKey: rowData.secretTableRowKeyId
                }, () => {
                  this.handleConfirmModalToggle();
                });
              }
            }];
          }
        }
        const keyIndex = this.state.keyIndex + 1;
        const updateActions = [
          {
            title: _111("Search ..."),
            onClick: () => {
              this.setState({
                activeTabKey: 2,
                searchBase: rowData.rawdn
              });
            }
          },
          {
            isSeparator: true
          },
          {
            title: _111("Edit ..."),
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.edit,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true,
                isTreeWizardOpen: false
              });
            }
          },
          {
            title: _111("New ..."),
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.new,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true,
                isTreeWizardOpen: false
              });
            }
          },
          {
            title: _111("Rename ..."),
            isDisabled: rowData.customRowId === 0,
            // can not rename root suffix
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.rename,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true,
                isTreeWizardOpen: false
              });
            }
          },
          ...lockingDropdown,
          {
            title: _111("ACIs ..."),
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.acis,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true,
                isTreeWizardOpen: false,
                keyIndex
              });
            }
          },
          {
            title: _111("Class of Service ..."),
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.cos,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true,
                isTreeWizardOpen: false,
                keyIndex
              });
            }
          },
          {
            isSeparator: true
          },
          {
            title: _111("Delete ..."),
            onClick: () => {
              this.setState({
                wizardName: ENTRY_MENU.delete,
                wizardEntryDn: rowData.rawdn,
                isWizardOpen: true,
                isTreeWizardOpen: false
              });
            }
          },
          {
            isSeparator: true
          },
          {
            title: _111("Refresh ..."),
            onClick: () => {
              this.handleReload(true);
            }
          }
        ];
        return [
          ...updateActions
        ];
      });
      this.rootSuffixesRows = [];
      this.rootSuffixesTreeData = [];
      this.initialChildText = _111("Loading...");
      this.state = {
        activeTabKey: 0,
        firstLoad: true,
        keyIndex: 0,
        suffixList: [],
        changeLayout: false,
        openNewEntry: false,
        openDeleteEntry: false,
        baseDN: "",
        emptyDN: "",
        loading: true,
        searching: false,
        perPage: 50,
        page: 0,
        total: 0,
        onRootSuffixes: true,
        numberSuffixes: 0,
        entryMenuIsOpen: false,
        wizardOperationInfo: { operationType: "", resultCode: -1, time: 0 },
        wizardName: "",
        isWizardOpen: false,
        isTreeWizardOpen: false,
        showEmptySuffixModal: false,
        wizardEntryDn: "",
        treeViewRootSuffixes: [],
        searchBase: "",
        isEntryTooLarge: false,
        refreshEntryTime: 0,
        navItems: [
          { id: "home", label: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(CatalogIcon, {}), active: false },
          { id: "db-suffixes", to: "#", label: _111("Database Suffixes"), active: true }
        ],
        columns: [
          {
            title: _111("Database Suffixes"),
            cellFormatters: [expandable]
          },
          {
            title: _111("Child Entries")
          },
          {
            title: _111("Last Modified")
          }
        ],
        rows: [],
        pagedRows: [],
        refreshing: false,
        allObjectclasses: [],
        isConfirmModalOpen: false,
        isTreeViewAction: false,
        currentRowKey: -1
      };
      this.handleConfirmModalToggle = () => {
        this.setState(({ isConfirmModalOpen }) => ({
          isConfirmModalOpen: !isConfirmModalOpen
        }));
      };
      this.handleNavSelect = (event, tabIndex) => {
        this.setState({
          activeTabKey: tabIndex
        });
      };
      this.onToggleEntryMenu = (_event, isOpen) => {
        this.setState({
          entryMenuIsOpen: isOpen
        });
      };
      this.handleSelectEntryOptions = (event) => {
        const aTarget = event.target;
        if (aTarget.name === ENTRY_MENU.refresh) {
          this.setState({
            entryMenuIsOpen: !this.state.entryMenuIsOpen,
            refreshEntryTime: Date.now()
          });
          return;
        }
        if (aTarget.name === ENTRY_MENU.search) {
          this.setState({
            activeTabKey: 2,
            searchBase: aTarget.value
          });
          return;
        }
        if (aTarget.name === ENTRY_MENU.lockRole) {
          this.setState({
            entryDn: aTarget.value,
            entryType: "role",
            operationType: "lock",
            isTreeViewAction: true
          }, () => {
            this.handleConfirmModalToggle();
          });
          return;
        }
        if (aTarget.name === ENTRY_MENU.lockAccount) {
          this.setState({
            entryDn: aTarget.value,
            entryType: "account",
            operationType: "lock",
            isTreeViewAction: true
          }, () => {
            this.handleConfirmModalToggle();
          });
          return;
        }
        if (aTarget.name === ENTRY_MENU.unlockRole) {
          this.setState({
            entryDn: aTarget.value,
            entryType: "role",
            operationType: "unlock",
            isTreeViewAction: true
          }, () => {
            this.handleConfirmModalToggle();
          });
          return;
        }
        if (aTarget.name === ENTRY_MENU.unlockAccount) {
          this.setState({
            entryDn: aTarget.value,
            entryType: "account",
            operationType: "unlock",
            isTreeViewAction: true
          }, () => {
            this.handleConfirmModalToggle();
          });
          return;
        }
        const keyIndex = this.state.keyIndex + 1;
        this.setState({
          entryMenuIsOpen: false,
          wizardName: aTarget.name,
          isTreeWizardOpen: true,
          isWizardOpen: false,
          wizardEntryDn: aTarget.value,
          keyIndex
        });
      };
      this.toggleOpenTreeWizard = () => {
        this.setState({
          isTreeWizardOpen: !this.state.isTreeWizardOpen
        });
      };
      this.handleReloadNoop = () => {
      };
      this.toggleOpenWizard = () => {
        this.setState({
          isWizardOpen: !this.state.isWizardOpen
        });
      };
      this.setWizardOperationInfo = (opInfo) => {
        const wizardOperationInfo = { ...opInfo };
        this.setState({
          wizardOperationInfo
        });
      };
      this.setTreeFirstClicked = (value) => {
        this.setState({ treeVisibleAndFirstClicked: value });
      };
      this.onHandleEmptySuffixToggle = (dn) => {
        const showEmptySuffixModal = this.state.showEmptySuffixModal;
        this.setState({
          showEmptySuffixModal: !showEmptySuffixModal,
          emptyDN: dn
        }, () => {
          this.handleReload(true);
        });
      };
      this.handleCollapse = this.handleCollapse.bind(this);
      this.onNavItemClick = this.onNavItemClick.bind(this);
      this.handleReload = this.handleReload.bind(this);
      this.getAttributes = this.getAttributes.bind(this);
      this.handleLockUnlockEntry = this.handleLockUnlockEntry.bind(this);
    }
    handleReload(refresh) {
      const params = {
        serverId: this.props.serverId,
        baseDn: this.state.baseDN,
        addNotification: this.props.addNotification
      };
      if (this.state.firstLoad) {
        this.setState({
          firstLoad: false
        });
      }
      this.setState({
        searching: true,
        loading: refresh
      });
      if (this.state.baseDN === "Database Suffixes" || this.state.baseDN === "db-suffixes" || this.state.baseDN === "") {
        this.rootSuffixesTreeData = [];
        this.showSuffixes("Database Suffixes", null);
      } else {
        let parentId = 0;
        this.state.suffixList.map((suffixDN) => {
          const params2 = {
            serverId: this.props.serverId,
            baseDn: suffixDN,
            parentId,
            addNotification: this.props.addNotification
          };
          getRootSuffixEntryDetails(params2, this.updateTableRootSuffixes);
          parentId += 2;
          return [];
        });
        getOneLevelEntries(params, this.processDirectChildren);
      }
    }
    handleLockUnlockEntry() {
      const {
        entryDn,
        entryType,
        operationType,
        isTreeViewAction
      } = this.state;
      const cmd = [
        "dsidm",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "-b",
        entryDn,
        entryType,
        operationType,
        entryDn
      ];
      log_cmd("handleLockUnlockEntry", `${operationType} entry`, cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((_113) => {
        this.setState({
          entryMenuIsOpen: !this.state.entryMenuIsOpen
        }, () => {
          this.handleConfirmModalToggle();
          if (isTreeViewAction) {
            this.setState({
              refreshEntryTime: Date.now(),
              isTreeViewAction: false
            });
          } else {
            this.handleReload(true);
          }
        });
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        console.error(
          "handleLockUnlockEntry",
          `${entryType} ${operationType} operation failed -`,
          errMsg
        );
        this.props.addNotification(
          `${errMsg.includes(`is already ${operationType === "unlock" ? "active" : "locked"}`) ? "warning" : "error"}`,
          `${errMsg}`
        );
        this.setState({
          entryMenuIsOpen: !this.state.entryMenuIsOpen
        }, () => {
          this.handleConfirmModalToggle();
          if (isTreeViewAction) {
            this.setState({
              refreshEntryTime: Date.now(),
              isTreeViewAction: false
            });
          } else {
            this.handleReload(true);
          }
        });
      });
    }
    getAttributes(callbackFunc) {
      const attr_cmd = [
        "dsconf",
        "-j",
        "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
        "schema",
        "attributetypes",
        "list"
      ];
      log_cmd("getAttributes", "Get attrs", attr_cmd);
      cockpit_default.spawn(attr_cmd, { superuser: true, err: "message" }).done((content) => {
        const attrContent = JSON.parse(content);
        const attrs = [];
        for (const content2 of attrContent.items) {
          attrs.push(content2.name[0]);
        }
        this.setState({
          attributes: attrs
        }, () => {
          callbackFunc("Database Suffixes", null);
        });
      });
    }
    componentDidMount() {
      getAllObjectClasses(this.props.serverId, (ocs) => {
        this.setState({
          allObjectclasses: ocs
        }, () => {
          this.getAttributes(this.showSuffixes);
        });
      });
    }
    componentDidUpdate(prevProps) {
      if (this.props.serverId !== prevProps.serverId) {
        getAllObjectClasses(this.props.serverId, (ocs) => {
          this.setState({
            allObjectclasses: ocs
          }, () => {
            this.getAttributes(this.showSuffixes);
          });
        });
      }
      if (this.props.wasActiveList.includes(7)) {
        if (this.state.firstLoad) {
          this.handleReload(true);
        } else {
          if (this.props.serverId !== prevProps.serverId) {
            this.handleReload(true);
          }
        }
      }
    }
    getPageData(page, perPage) {
      if (page === 1) {
        const pagedRows = this.state.rows.slice(0, 2 * perPage);
        this.setState({ pagedRows, perPage, page, loading: false });
      } else {
        const start2 = 2 * (page - 1) * perPage;
        const end2 = 2 * page * perPage;
        const pagedRows = this.state.rows.slice(start2, end2);
        for (let i = 0; i < pagedRows.length - 1; i++) {
          if (i % 2 === 0) {
            pagedRows[i + 1].parent = i;
          }
        }
        this.setState({ pagedRows, perPage, page, loading: false });
      }
    }
    handleCollapse(event, rowKey, isOpen, data) {
      const { pagedRows } = this.state;
      pagedRows[rowKey].isOpen = isOpen;
      this.setState({
        pagedRows
      });
      const firstTime = pagedRows[rowKey + 1].cells[0].title === this.initialChildText;
      if (firstTime) {
        const entryRows = [];
        let entryStateIcon = "";
        let isRole = false;
        const entryDn = pagedRows[rowKey].rawdn;
        getBaseLevelEntryAttributes(this.props.serverId, entryDn, (entryArray) => {
          entryArray.map((line) => {
            const attr = line.attribute;
            const attrJpegVal = line.attribute.toLowerCase() === "jpegphoto" ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
              "img",
              {
                src: `data:image/png;base64,${line.value.substr(3)}`,
                alt: "",
                style: { width: "256px" }
              }
            ) }) : line.value;
            const val = line.value.toLowerCase() === ": ldapsubentry" ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: "ds-info-color", children: line.value }) : line.attribute.toLowerCase() === "userpassword" ? ": ********" : attrJpegVal;
            entryRows.push({ attr, value: val });
            const myVal = line.value.substring(1).trim().toLowerCase();
            const accountObjectclasses = [
              "nsaccount",
              "nsperson",
              "simplesecurityobject",
              "organization",
              "person",
              "account",
              "organizationalunit",
              "netscapeserver",
              "domain",
              "posixaccount",
              "shadowaccount",
              "posixgroup",
              "mailrecipient",
              "nsroledefinition"
            ];
            if (accountObjectclasses.includes(myVal)) {
              entryStateIcon = /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(LockIcon, { className: "ds-pf-blue-color" });
            }
            if (myVal === "nsroledefinition") {
              isRole = true;
            }
            return [];
          });
          let entryState = "";
          const cmd = [
            "dsidm",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
            "-b",
            entryDn,
            isRole ? "role" : "account",
            "entry-status",
            entryDn
          ];
          log_cmd("handleCollapse", "Checking if entry is activated", cmd);
          cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
            if (entryDn !== "Root DSE" && entryStateIcon !== "") {
              const status = JSON.parse(content);
              entryState = status.info.state;
              if (entryState === "inactivity limit exceeded" || entryState.startsWith("probably activated or")) {
                entryStateIcon = /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ExclamationTriangleIcon, { className: "ds-pf-yellow-color ct-icon-exclamation-triangle" });
              }
            }
          }).fail((err) => {
            const errMsg = getApiErrorMessage(err);
            if (entryDn !== "Root DSE" && entryStateIcon !== "" && !errMsg.includes("Root suffix can't be locked or unlocked")) {
              console.error(
                "handleCollapse",
                `${isRole ? "role" : "account"} account entry-status operation failed`,
                errMsg
              );
              entryState = _111("error: please, check browser logs");
              entryStateIcon = /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ExclamationCircleIcon, { className: "ds-pf-red-color ct-exclamation-circle" });
            }
          }).finally(() => {
            let entryStateIconFinal = "";
            if (entryState !== "" && entryStateIcon !== "" && entryState !== "activated") {
              entryStateIconFinal = /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
                Tooltip,
                {
                  position: "bottom",
                  content: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", { className: "ds-info-icon", children: entryState }),
                  children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("a", { className: "ds-font-size-md", children: entryStateIcon })
                }
              );
            }
            pagedRows[rowKey].entryState = entryState;
            pagedRows[rowKey + 1].cells = [{
              title: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_jsx_runtime112.Fragment, { children: entryRows.map(
                (line) => {
                  let attrLine = "";
                  if (line.attr === "dn") {
                    attrLine = /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { children: [
                      /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("strong", { children: line.attr }),
                      line.value,
                      " ",
                      entryStateIconFinal
                    ] }, line.attr + line.value);
                  } else {
                    attrLine = /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { children: [
                      /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("strong", { children: line.attr }),
                      line.value
                    ] }, line.attr + line.value);
                  }
                  return attrLine;
                }
              ) })
            }];
            this.setState({
              pagedRows,
              currentRowKey: -1
            });
          });
        });
      }
    }
    render() {
      const {
        page,
        perPage,
        total,
        columns,
        pagedRows,
        loading,
        navItems,
        entryMenuIsOpen,
        wizardOperationInfo,
        isWizardOpen,
        isTreeWizardOpen,
        wizardName,
        wizardEntryDn,
        treeViewRootSuffixes,
        refreshEntryTime
      } = this.state;
      return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_jsx_runtime112.Fragment, { children: [
        isWizardOpen && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
          genericWizard_default,
          {
            wizardName,
            isWizardOpen,
            toggleOpenWizard: this.toggleOpenWizard,
            wizardEntryDn,
            editorLdapServer: this.props.serverId,
            treeViewRootSuffixes: this.state.treeViewRootSuffixes,
            setWizardOperationInfo: this.setWizardOperationInfo,
            onReload: this.handleReload,
            onModrdnReload: this.handleReload,
            allObjectclasses: this.state.allObjectclasses,
            addNotification: this.props.addNotification
          },
          this.state.keyIndex + "table"
        ),
        isTreeWizardOpen && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
          genericWizard_default,
          {
            wizardName,
            isWizardOpen: isTreeWizardOpen,
            toggleOpenWizard: this.toggleOpenTreeWizard,
            wizardEntryDn,
            editorLdapServer: this.props.serverId,
            treeViewRootSuffixes: this.state.treeViewRootSuffixes,
            setWizardOperationInfo: this.setWizardOperationInfo,
            onReload: this.handleReloadNoop,
            onModrdnReload: this.handleReload,
            allObjectclasses: this.state.allObjectclasses,
            addNotification: this.props.addNotification
          },
          this.state.keyIndex + "tree"
        ),
        /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(Tabs, { isBox: true, className: "ds-margin-top-lg ds-indent", activeKey: this.state.activeTabKey, onSelect: this.handleNavSelect, children: [
          /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Tab, { eventKey: 0, title: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(TabTitleText, { children: _111("Tree View") }), children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
            treeView_default,
            {
              handleToggleEntryMenu: this.onToggleEntryMenu,
              onSelectEntryOptions: this.handleSelectEntryOptions,
              entryMenuIsOpen,
              treeViewRootSuffixes,
              loading,
              timeOfCompletion: this.state.timeOfCompletion,
              setTreeFirstClicked: this.setTreeFirstClicked,
              editorLdapServer: this.props.serverId,
              wizardOperationInfo,
              refreshEntryTime,
              onReload: this.handleReload,
              refreshing: this.state.refreshing,
              allObjectclasses: this.state.allObjectclasses,
              addNotification: this.props.addNotification
            },
            loading
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(TabTitleText, { children: _111("Table View") }), children: [
            /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: this.state.searching ? "ds-disabled" : "", children: [
              /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Breadcrumb, { className: "ds-left-margin ds-margin-top-xlg", children: navItems.map(({ id, to, label, active }) => /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(BreadcrumbItem, { to, isActive: active, onClick: () => this.onNavItemClick(id, active), children: label }, id + label)) }),
              /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Icon, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
                SyncAltIcon,
                {
                  className: "ds-left-margin ds-refresh",
                  onClick: this.handleReload
                }
              ) })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: this.state.searching ? "ds-margin-top-xlg ds-center" : "ds-hidden", children: [
              /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(Text, { component: TextVariants.h3, children: [
                _111("Loading"),
                " ",
                /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("i", { children: this.state.searchBase }),
                " ..."
              ] }) }),
              /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Spinner, { className: "ds-margin-top-lg", size: "xl" })
            ] }),
            /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", { className: this.state.searching ? "ds-hidden" : "", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
              tableView_default,
              {
                loading,
                itemCount: total,
                page,
                perPage,
                onSetPage: (value) => this.getPageData(value, perPage),
                onPerPageSelect: (value) => this.getPageData(1, value),
                editorTableRows: pagedRows,
                onCollapse: this.handleCollapse,
                columns,
                actionResolver: this.actionResolver,
                addNotification: this.props.addNotification
              },
              loading
            ) })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(TabTitleText, { children: _111("Search") }), children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
            SearchDatabase,
            {
              serverId: this.props.serverId,
              suffixList: this.state.suffixList,
              attributes: this.state.attributes,
              searchBase: this.state.searchBase,
              allObjectclasses: this.state.allObjectclasses,
              addNotification: this.props.addNotification
            },
            this.state.suffixList + this.state.searchBase
          ) })
        ] }),
        this.state.showEmptySuffixModal && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
          rootSuffix_default,
          {
            showEmptySuffixModal: this.state.showEmptySuffixModal,
            handleEmptySuffixToggle: this.onHandleEmptySuffixToggle,
            suffixDn: this.state.emptyDN,
            editorLdapServer: this.props.serverId
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
          Modal,
          {
            variant: ModalVariant.medium,
            title: cockpit_default.format(_111("Are you sure you want to $0 the $1?"), this.state.operationType, this.state.entryType),
            isOpen: this.state.isConfirmModalOpen,
            onClose: this.handleConfirmModalToggle,
            actions: [
              /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Button, { variant: "primary", onClick: this.handleLockUnlockEntry, children: _111("Confirm") }, "confirm"),
              /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Button, { variant: "link", onClick: this.handleConfirmModalToggle, children: _111("Cancel") }, "cancel")
            ],
            children: /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(TextContent, { className: "ds-margin-top ds-hide-vertical-scrollbar", children: [
              /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(Text, { children: [
                this.state.entryType === "account" && (() => {
                  const value1 = this.state.operationType === "lock" ? _111("add") : _111("remove");
                  const value2 = this.state.operationType === "lock" ? _111("to") : _111("from");
                  return cockpit_default.format(_111("It will $0 nsAccountLock attribute $1 the entry - $2."), value1, value2, this.state.entryDn);
                })(),
                !this.state.entryType === "account" && _111("This operation will make sure that these five entries are created at the entry's root suffix (if not, they will be created):")
              ] }),
              this.state.entryType === "role" && /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(import_jsx_runtime112.Fragment, { children: [
                /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(TextList, { children: [
                  /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(TextListItem, { children: "cn=nsManagedDisabledRole" }),
                  /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(TextListItem, { children: "cn=nsDisabledRole" }),
                  /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(TextListItem, { children: "cn=nsAccountInactivationTmp (with a child)" }),
                  /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(TextListItem, { children: "cn=nsAccountInactivation_cos" })
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Text, { children: (() => {
                  const value1 = this.state.operationType === "lock" ? _111("added to") : _111("removed from");
                  return cockpit_default.format(_111("The entry - $0 - will be $1 nsRoleDN attribute in cn=nsDisabledRole entry in the root suffix."), this.state.entryDn, value1);
                })() })
              ] })
            ] })
          }
        )
      ] });
    }
  };

  // src/ds.jsx
  var import_jsx_runtime113 = __toESM(require_jsx_runtime(), 1);
  var _112 = cockpit_default.gettext;
  var staticStates = {
    noPackage: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text, { className: "ds-margin-top-xlg", component: TextVariants.h2, children: [
      _112("There is no "),
      /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("b", { children: _112("389-ds-base") }),
      _112(" package installed on this system. Sorry there is nothing to manage...")
    ] }) }),
    noInsts: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { className: "ds-margin-top-xlg ds-indent-md", component: TextVariants.h2, children: _112("There are no Directory Server instances to manage") }) }),
    notRunning: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text, { className: "ds-margin-top-xlg ds-indent-md", component: TextVariants.h2, children: [
      _112("This server instance is not running, either start it from the "),
      /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("b", { children: _112("Actions") }),
      _112(" dropdown menu, or choose a different instance")
    ] }) }),
    notConnecting: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { className: "ds-margin-top-xlg ds-indent-md", component: TextVariants.h2, children: _112("This server instance is running, but we can not connect to it. Check LDAPI is properly configured on this instance.") }) }),
    ldapiIssue: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { className: "ds-margin-top-xlg ds-indent-md", component: TextVariants.h2, children: _112("Problem accessing required server configuration. Check LDAPI is properly configured on this instance.") }) })
  };
  var DSInstance = class extends import_react183.default.Component {
    componentDidMount() {
      this.loadInstanceList();
      this.updateProgress(25);
    }
    constructor(props) {
      super(props);
      this.state = {
        pageLoadingState: { state: "loading", jsx: "" },
        serverId: "",
        instList: [],
        backupRows: [],
        notifications: [],
        activeTabKey: 1,
        createKey: 0,
        wasActiveList: [],
        progressValue: 0,
        loadingOperate: false,
        dropdownIsOpen: false,
        variant: PageSectionVariants.default,
        showDeleteConfirm: false,
        modalSpinning: false,
        modalChecked: false,
        showSchemaReloadModal: false,
        showManageBackupsModal: false,
        showCreateInstanceModal: false
      };
      this.handleToggle = (_event, dropdownIsOpen) => {
        this.setState({
          dropdownIsOpen
        });
      };
      this.handleDropdown = (event) => {
        this.setState({
          dropdownIsOpen: !this.state.dropdownIsOpen
        });
        this.onFocus();
      };
      this.onFocus = () => {
        const element = document.getElementById("ds-dropdown");
        element.focus();
      };
      this.handleNavSelect = (event, tabIndex) => {
        const { wasActiveList } = this.state;
        if (!wasActiveList.includes(tabIndex)) {
          const newList = wasActiveList.concat(tabIndex);
          this.setState({
            wasActiveList: newList,
            activeTabKey: tabIndex
          });
        } else {
          this.setState({
            activeTabKey: tabIndex
          });
        }
      };
      this.setPageSectionVariant = (isLight) => {
        const variant = isLight ? PageSectionVariants.light : PageSectionVariants.default;
        this.setState({
          variant
        });
      };
      this.handleServerIdChange = this.handleServerIdChange.bind(this);
      this.onFieldChange = this.onFieldChange.bind(this);
      this.addNotification = this.addNotification.bind(this);
      this.removeNotification = this.removeNotification.bind(this);
      this.handleNavSelect = this.handleNavSelect.bind(this);
      this.loadInstanceList = this.loadInstanceList.bind(this);
      this.loadBackups = this.loadBackups.bind(this);
      this.setServerId = this.setServerId.bind(this);
      this.updateProgress = this.updateProgress.bind(this);
      this.openCreateInstanceModal = this.openCreateInstanceModal.bind(this);
      this.closeCreateInstanceModal = this.closeCreateInstanceModal.bind(this);
      this.operateInstance = this.operateInstance.bind(this);
      this.openManageBackupsModal = this.openManageBackupsModal.bind(this);
      this.closeManageBackupsModal = this.closeManageBackupsModal.bind(this);
      this.openSchemaReloadModal = this.openSchemaReloadModal.bind(this);
      this.closeSchemaReloadModal = this.closeSchemaReloadModal.bind(this);
      this.removeInstance = this.removeInstance.bind(this);
      this.showDeleteConfirm = this.showDeleteConfirm.bind(this);
      this.closeDeleteConfirm = this.closeDeleteConfirm.bind(this);
    }
    addNotification(variant, title) {
      const key = (/* @__PURE__ */ new Date()).getTime();
      if (variant === "error" || variant === "danger") {
        variant = "danger";
        title = /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("pre", { children: title });
      }
      this.setState({
        notifications: [...this.state.notifications, { title, variant, key }]
      });
    }
    removeNotification(key) {
      this.setState({
        notifications: [...this.state.notifications.filter((el) => el.key !== key)]
      });
    }
    updateProgress(value) {
      this.setState(
        (prevState) => ({
          progressValue: prevState.progressValue + value
        }),
        () => {
          if (this.state.progressValue > 100) {
            this.setState((prevState) => ({
              pageLoadingState: {
                ...prevState.pageLoadingState,
                state: "success"
              }
            }));
          }
        }
      );
    }
    setServerId(serverId, action) {
      const cmd = ["dsctl", "-j", serverId, "status"];
      log_cmd("setServerId", "Test if instance is running ", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((status_data) => {
        const status_json = JSON.parse(status_data);
        if (status_json.running) {
          this.updateProgress(25);
          const cfg_cmd = [
            "dsconf",
            "-j",
            "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
            "config",
            "get"
          ];
          log_cmd("setServerId", "Load server configuration", cfg_cmd);
          cockpit_default.spawn(cfg_cmd, { superuser: true, err: "message" }).done((content) => {
            const config = JSON.parse(content);
            const attrs = config.attrs;
            if (Object.keys(attrs).length === 0) {
              this.setState({
                pageLoadingState: {
                  state: "ldapiIssue",
                  jsx: staticStates.ldapiIssue,
                  loading: "ldapiError"
                },
                serverId,
                wasActiveList: []
              });
              return;
            }
            const cmd2 = [
              "dsconf",
              "-j",
              "ldapi://%2fvar%2frun%2fslapd-" + serverId + ".socket",
              "backend",
              "suffix",
              "list",
              "--suffix"
            ];
            log_cmd("setServerId", "Test if instance is alive ", cmd2);
            cockpit_default.spawn(cmd2, { superuser: true, err: "message" }).done(() => {
              this.updateProgress(25);
              this.setState(
                {
                  serverId,
                  wasActiveList: [this.state.activeTabKey]
                },
                () => {
                  this.loadBackups(true);
                }
              );
              if (action === "restart") {
                this.setState(
                  {
                    serverId: "",
                    wasActiveList: []
                  },
                  () => {
                    this.setState({
                      serverId,
                      wasActiveList: [this.state.activeTabKey]
                    });
                  }
                );
              }
            }).fail((err) => {
              const errMsg = getApiErrorMessage(err);
              console.log("setServerId failed: ", errMsg);
              this.setState(
                {
                  pageLoadingState: {
                    state: "notConnecting",
                    jsx: staticStates.notConnecting
                  }
                },
                () => {
                  this.setState(
                    {
                      serverId,
                      wasActiveList: []
                    },
                    () => {
                      this.loadBackups(true);
                    }
                  );
                }
              );
            });
          }).fail((err) => {
            const errMsg = getApiErrorMessage(err);
            console.log("setServerId failed: ", errMsg);
            this.setState(
              {
                pageLoadingState: {
                  state: "notConnecting",
                  jsx: staticStates.notConnecting
                }
              },
              () => {
                this.setState(
                  {
                    serverId,
                    wasActiveList: []
                  },
                  () => {
                    this.loadBackups(true);
                  }
                );
              }
            );
          });
        } else {
          this.setState(
            {
              pageLoadingState: {
                state: "notRunning",
                jsx: staticStates.notRunning
              }
            },
            () => {
              this.setState(
                {
                  serverId,
                  wasActiveList: []
                }
              );
            }
          );
        }
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        console.log("setServerId failed: ", errMsg);
        this.setState(
          {
            pageLoadingState: {
              state: "notConnecting",
              jsx: staticStates.notConnecting
            }
          },
          () => {
            this.setState(
              {
                serverId,
                wasActiveList: []
              },
              () => {
                this.loadBackups(true);
              }
            );
          }
        );
      });
    }
    loadInstanceList(serverId, action) {
      if (serverId === void 0) {
        this.setState((prevState) => ({
          pageLoadingState: {
            ...prevState.pageLoadingState,
            state: "loading"
          }
        }));
      }
      this.setState(
        {
          wasActiveList: []
        },
        () => {
          const cmd = ["dsctl", "-l", "-j"];
          log_cmd(
            "loadInstanceList",
            "Load the instance list select",
            cmd
          );
          cockpit_default.spawn(cmd, { superuser: true }).done((data) => {
            this.updateProgress(25);
            const myObject = JSON.parse(data);
            const options5 = [];
            for (const inst of myObject.insts) {
              options5.push({ value: inst.replace("slapd-", ""), label: inst, disabled: false });
            }
            this.setState({
              instList: options5,
              loadingOperate: false
            });
            if (serverId !== void 0 && serverId !== "") {
              this.setServerId(serverId, action);
            } else {
              if (myObject.insts.length > 0) {
                this.setServerId(
                  myObject.insts[0].replace("slapd-", ""),
                  action
                );
              } else {
                this.setState({
                  serverId: "",
                  pageLoadingState: {
                    state: "noInsts",
                    jsx: staticStates.noInsts
                  }
                });
              }
            }
          }).fail((_113) => {
            this.setState({
              instList: [],
              serverId: "",
              loadingOperate: false,
              pageLoadingState: {
                state: "noInsts",
                jsx: staticStates.noInsts
              }
            });
          });
        }
      );
    }
    loadBackups(initializing) {
      let cmd = ["dsctl", "-j", this.state.serverId, "backups"];
      log_cmd("loadBackups", "Load Backups", cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content) => {
        this.updateProgress(25);
        const config = JSON.parse(content);
        const rows = [];
        for (const row of config.items) {
          rows.push([row[0], row[1], row[2]]);
        }
        cmd = ["dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.state.serverId + ".socket", "monitor", "server"];
        log_cmd("loadBackups", "Get the server version", cmd);
        cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done((content2) => {
          const monitor = JSON.parse(content2);
          this.setState({
            backupRows: rows,
            version: monitor.attrs.version[0]
          });
        }).fail((_113) => {
          this.setState({
            backupRows: rows
          });
        });
      }).fail((err) => {
        this.updateProgress(25);
        const errMsg = getApiErrorMessage(err);
        if (!initializing) {
          this.addNotification(
            "error",
            cockpit_default.format(_112("Load Backups operation failed - $0"), errMsg)
          );
        }
        this.setState({
          backupRows: []
        });
      });
    }
    handleServerIdChange(_event, e) {
      this.setState({
        pageLoadingState: { state: "loading", jsx: "" },
        progressValue: 25
      });
      this.loadInstanceList(e);
    }
    onFieldChange(e) {
      let value = e.target.type === "checkbox" ? e.target.checked : e.target.value;
      if (e.target.type === "number") {
        if (e.target.value) {
          value = parseInt(e.target.value);
        } else {
          value = 1;
        }
      }
      this.setState({
        [e.target.id]: value
      });
    }
    removeInstance() {
      this.setState({
        loadingOperate: true
      });
      const cmd = ["dsctl", "-j", this.state.serverId, "remove", "--do-it"];
      log_cmd("removeInstance", `Remove the instance`, cmd);
      cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
        this.loadInstanceList();
        this.addNotification("success", _112("Instance was successfully removed"));
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.loadInstanceList();
        this.addNotification(
          "error",
          cockpit_default.format(_112("Error during instance remove operation - $0"), errMsg)
        );
      });
      this.closeDeleteConfirm();
    }
    operateInstance(action) {
      this.setState({
        loadingOperate: true
      });
      const cmdStatus = ["dsctl", "-j", this.state.serverId, "status"];
      log_cmd("operateInstance", `Check instance status`, cmdStatus);
      cockpit_default.spawn(cmdStatus, { superuser: true, err: "message" }).done((status_data) => {
        const status_json = JSON.parse(status_data);
        if (status_json.running && action === "start") {
          this.addNotification("success", _112("Instance is already running"));
          this.setState({
            loadingOperate: false
          });
        } else if (!status_json.running && action === "stop") {
          this.addNotification("success", _112("Instance is already stopped"));
          this.setState({
            loadingOperate: false,
            pageLoadingState: {
              state: "notRunning",
              jsx: staticStates.notRunning
            }
          });
        } else {
          const cmd = ["dsctl", "-j", this.state.serverId, action];
          log_cmd("operateInstance", `Do ${action} the instance`, cmd);
          cockpit_default.spawn(cmd, { superuser: true, err: "message" }).done(() => {
            this.loadInstanceList(this.state.serverId, action);
            if (action === "stop") {
              action = "stopp";
            }
            this.addNotification("success", cockpit_default.format(_112("Instance was successfully $0"), action + "ed"));
          }).fail((err) => {
            const errMsg = getApiErrorMessage(err);
            this.addNotification(
              "error",
              cockpit_default.format(_112("Error during instance $0 operation - $1"), action, errMsg)
            );
            this.loadInstanceList(this.state.serverId, action);
          });
        }
      }).fail((err) => {
        const errMsg = getApiErrorMessage(err);
        this.addNotification(
          "error",
          cockpit_default.format(_112("Error during instance check status operation - $0"), errMsg)
        );
        this.loadInstanceList(this.state.serverId, action);
      });
    }
    openCreateInstanceModal() {
      const key = this.state.createKey + 1;
      this.setState({
        showCreateInstanceModal: true,
        createKey: key
      });
    }
    closeCreateInstanceModal() {
      this.setState({
        showCreateInstanceModal: false
      });
    }
    openManageBackupsModal() {
      this.setState({
        showManageBackupsModal: true
      });
    }
    closeManageBackupsModal() {
      this.setState({
        showManageBackupsModal: false
      });
    }
    openSchemaReloadModal() {
      this.setState({
        showSchemaReloadModal: true
      });
    }
    closeSchemaReloadModal() {
      this.setState({
        showSchemaReloadModal: false
      });
    }
    showDeleteConfirm() {
      this.setState({
        showDeleteConfirm: true,
        modalSpinning: false,
        modalChecked: false
      });
    }
    closeDeleteConfirm() {
      this.setState({
        showDeleteConfirm: false,
        modalSpinning: false,
        modalChecked: false
      });
    }
    render() {
      const {
        instList,
        serverId,
        progressValue,
        notifications,
        pageLoadingState,
        loadingOperate,
        dropdownIsOpen,
        activeTabKey
      } = this.state;
      const dropdownItems = [
        /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(DropdownItem2, { id: "start-ds", component: "button", onClick: () => this.operateInstance("start"), children: _112("Start Instance") }, "start"),
        /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(DropdownItem2, { id: "stop-ds", component: "button", onClick: () => this.operateInstance("stop"), children: _112("Stop Instance") }, "stop"),
        /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(DropdownItem2, { id: "restart-ds", component: "button", onClick: () => this.operateInstance("restart"), children: _112("Restart Instance") }, "restart"),
        /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(DropdownItem2, { id: "manage-backup-ds", component: "button", onClick: () => this.openManageBackupsModal(), children: _112("Manage Backups") }, "backups"),
        /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(DropdownItem2, { id: "reload-schema-ds", component: "button", onClick: () => this.openSchemaReloadModal(), children: _112("Reload Schema Files") }, "reload"),
        /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(DropdownSeparator, {}, "separator"),
        /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(DropdownItem2, { id: "remove-ds", component: "button", onClick: () => this.showDeleteConfirm(), children: _112("Remove This Instance") }, "remove"),
        /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(DropdownItem2, { id: "create-ds", component: "button", onClick: () => this.openCreateInstanceModal(), children: _112("Create New Instance") }, "create")
      ];
      let mainContent = "";
      if (pageLoadingState.state === "loading") {
        mainContent = /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { id: "loading-instances", className: "all-pages ds-center", children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { id: "loading-page", className: "ds-center ds-loading", children: [
          /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(TextContent, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Text, { id: "loading-msg", component: TextVariants.h3, children: _112("Loading Directory Server Configuration ...") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("p", { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("span", { className: "spinner spinner-lg spinner-inline" }) }),
          /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: "ds-margin-top-lg", children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
            Progress,
            {
              value: progressValue,
              label: `${progressValue}%`,
              measureLocation: ProgressMeasureLocation.inside,
              "aria-label": "Directory Server Configuration loading progress"
            }
          ) })
        ] }) });
      } else if (pageLoadingState.state === "noInsts") {
        mainContent = /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { id: "noInsts", className: "all-pages ds-center", children: [
          pageLoadingState.jsx,
          /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("p", { className: "ds-margin-top-xlg", children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
            Button,
            {
              id: "no-inst-create-btn",
              variant: "primary",
              onClick: () => this.openCreateInstanceModal(),
              children: _112("Create New Instance")
            }
          ) })
        ] });
      } else {
        mainContent = /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { id: pageLoadingState.state, className: "all-pages ds-center", children: pageLoadingState.jsx });
      }
      let operateSpinner = "";
      if (loadingOperate) {
        operateSpinner = /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Spinner, { className: "ds-operate-spinner", size: "md" });
      }
      let serverDropdown = "";
      if (pageLoadingState.state !== "loading" && pageLoadingState.state !== "noInsts" && pageLoadingState.state !== "noPackage") {
        serverDropdown = /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Grid, { className: "ds-logo", hidden: pageLoadingState.state === "loading", children: [
          /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(GridItem, { span: 10, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(TextContent, { className: "ds-logo-style", title: this.state.version, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Text, { id: "main-banner", component: TextVariants.h1, children: [
            /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: "ds-server-action", children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
              FormSelect,
              {
                title: _112("Directory Server instance list"),
                value: serverId,
                id: "serverId",
                onChange: this.handleServerIdChange,
                "aria-label": "FormSelect Input",
                className: "ds-instance-select",
                children: instList.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
                  FormSelectOption,
                  {
                    isDisabled: option.disabled,
                    value: option.value.replace("slapd-", ""),
                    label: option.label
                  },
                  index
                ))
              }
            ) }),
            operateSpinner
          ] }) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(GridItem, { span: 2, children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
            Dropdown2,
            {
              id: "ds-action",
              className: "ds-float-right ds-margin-top ds-margin-right",
              position: DropdownPosition.right,
              onSelect: this.handleDropdown,
              toggle: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
                DropdownToggle,
                {
                  onToggle: (event, isOpen) => this.handleToggle(event, isOpen),
                  toggleIndicator: CaretDownIcon,
                  variant: "primary",
                  id: "ds-dropdown",
                  children: _112("Actions")
                }
              ),
              isOpen: dropdownIsOpen,
              dropdownItems
            }
          ) })
        ] });
      }
      let mainPage = /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { children: mainContent });
      if (serverId !== "" && (pageLoadingState.state === "success" || pageLoadingState.state === "loading")) {
        mainPage = /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: "ds-margin-top", children: [
          /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { hidden: pageLoadingState.state === "loading" || pageLoadingState.state === "notRunning", children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(Tabs, { isFilled: true, activeKey: activeTabKey, onSelect: this.handleNavSelect, children: [
            /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Tab, { eventKey: 1, title: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(TabTitleText, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("b", { children: _112("Server") }) }), children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
              Server,
              {
                addNotification: this.addNotification,
                serverId: this.state.serverId,
                wasActiveList: this.state.wasActiveList,
                version: this.state.version
              },
              this.state.serverId
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Tab, { eventKey: 2, title: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(TabTitleText, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("b", { children: _112("Database") }) }), children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
              Database,
              {
                addNotification: this.addNotification,
                serverId: this.state.serverId,
                wasActiveList: this.state.wasActiveList
              },
              this.state.serverId
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Tab, { eventKey: 3, title: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(TabTitleText, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("b", { children: _112("Replication") }) }), children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
              Replication,
              {
                addNotification: this.addNotification,
                serverId: this.state.serverId,
                wasActiveList: this.state.wasActiveList
              },
              this.state.serverId
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Tab, { eventKey: 4, title: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(TabTitleText, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("b", { children: _112("Schema") }) }), children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
              Schema,
              {
                addNotification: this.addNotification,
                serverId: this.state.serverId,
                wasActiveList: this.state.wasActiveList
              },
              this.state.serverId
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Tab, { eventKey: 5, title: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(TabTitleText, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("b", { children: _112("Plugins") }) }), children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
              Plugins,
              {
                addNotification: this.addNotification,
                serverId: this.state.serverId,
                wasActiveList: this.state.wasActiveList
              },
              this.state.serverId
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Tab, { eventKey: 6, title: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(TabTitleText, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("b", { children: _112("Monitoring") }) }), children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
              Monitor,
              {
                addNotification: this.addNotification,
                serverId: this.state.serverId,
                wasActiveList: this.state.wasActiveList
              },
              this.state.serverId
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(Tab, { eventKey: 7, title: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(TabTitleText, { children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("b", { children: _112("LDAP Browser") }) }), children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
              LDAPEditor,
              {
                addNotification: this.addNotification,
                serverId: this.state.serverId,
                wasActiveList: this.state.wasActiveList,
                setPageSectionVariant: this.setPageSectionVariant
              },
              "ldap-editor"
            ) })
          ] }) }),
          /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { hidden: pageLoadingState.state !== "loading", children: mainContent })
        ] });
      }
      return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: loadingOperate ? "ds-disabled" : "", children: [
        /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(AlertGroup, { isToast: true, children: notifications.map(({ key, variant, title }) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
          Alert,
          {
            isLiveRegion: true,
            variant: AlertVariant[variant],
            title,
            actionClose: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
              AlertActionCloseButton,
              {
                title,
                variantLabel: `${variant} alert`,
                onClose: () => this.removeNotification(key)
              }
            ),
            timeout: true
          },
          key
        )) }),
        serverDropdown,
        mainPage,
        /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
          CreateInstanceModal,
          {
            showModal: this.state.showCreateInstanceModal,
            closeHandler: this.closeCreateInstanceModal,
            addNotification: this.addNotification,
            serverId: this.state.serverId,
            loadInstanceList: this.loadInstanceList
          },
          this.state.createKey
        ),
        /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
          SchemaReloadModal,
          {
            showModal: this.state.showSchemaReloadModal,
            closeHandler: this.closeSchemaReloadModal,
            addNotification: this.addNotification,
            serverId: this.state.serverId
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
          ManageBackupsModal,
          {
            addNotification: this.addNotification,
            serverId: this.state.serverId,
            showModal: this.state.showManageBackupsModal,
            closeHandler: this.closeManageBackupsModal,
            handleChange: this.onFieldChange,
            backups: this.state.backupRows,
            reload: this.loadBackups
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
          DoubleConfirmModal,
          {
            showModal: this.state.showDeleteConfirm,
            closeHandler: this.closeDeleteConfirm,
            handleChange: this.onFieldChange,
            actionHandler: this.removeInstance,
            spinning: this.state.modalSpinning,
            item: this.state.serverId,
            checked: this.state.modalChecked,
            mTitle: _112("Remove Instance"),
            mMsg: _112("Are you really sure you want to delete this instance?"),
            mSpinningMsg: _112("Removing Instance..."),
            mBtnName: _112("Remove Instance")
          }
        )
      ] });
    }
  };

  // src/index.js
  document.addEventListener("DOMContentLoaded", function() {
    import_react_dom.default.render(import_react184.default.createElement(DSInstance, {}), document.getElementById("dsinstance"));
  });
})();
//# sourceMappingURL=index.js.map
