import {
  _extends
} from "./chunk-Z2OVS3AP.js";
import {
  createComponent
} from "./chunk-GN454KVF.js";
import {
  Placeholder,
  useNode
} from "./chunk-JTURMJFW.js";
import {
  __commonJS,
  __objRest,
  __spreadProps,
  __spreadValues,
  __toESM
} from "./chunk-Z67LV52D.js";

// ../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js
var require_react_is_development = __commonJS({
  "../../node_modules/prop-types/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" || 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 Element = REACT_ELEMENT_TYPE;
        var ForwardRef = REACT_FORWARD_REF_TYPE;
        var Fragment2 = REACT_FRAGMENT_TYPE;
        var Lazy = REACT_LAZY_TYPE;
        var Memo = REACT_MEMO_TYPE;
        var Portal = 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 isElement(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 = Element;
        exports.ForwardRef = ForwardRef;
        exports.Fragment = Fragment2;
        exports.Lazy = Lazy;
        exports.Memo = Memo;
        exports.Portal = Portal;
        exports.Profiler = Profiler;
        exports.StrictMode = StrictMode;
        exports.Suspense = Suspense;
        exports.isAsyncMode = isAsyncMode;
        exports.isConcurrentMode = isConcurrentMode;
        exports.isContextConsumer = isContextConsumer;
        exports.isContextProvider = isContextProvider;
        exports.isElement = isElement;
        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/prop-types/node_modules/react-is/index.js
var require_react_is = __commonJS({
  "../../node_modules/prop-types/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 s = 1; s < arguments.length; s++) {
        from = Object(arguments[s]);
        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 (x) {
        }
      };
    }
    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 (x) {
        }
      };
    }
    function emptyFunctionThatReturnsNull() {
      return null;
    }
    module.exports = function(isValidElement, 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(x, y) {
        if (x === y) {
          return x !== 0 || 1 / x === 1 / y;
        } else {
          return x !== x && y !== y;
        }
      }
      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] && 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 (!isValidElement(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 = getClassName(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 || isValidElement(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 getClassName(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;
  }
});

// ../toolpad-components/dist/PageRow.js
import * as React from "react";
import { Stack } from "@mui/material";
function PageRow({ spacing, children, alignItems, justifyContent }) {
  return React.createElement(Stack, { direction: "row", sx: { gap: spacing, p: spacing, alignItems, justifyContent, flexWrap: "wrap" } }, children);
}
PageRow.defaultProps = {
  spacing: 2,
  alignItems: "center",
  justifyContent: "start"
};
var PageRow_default = createComponent(PageRow, {
  argTypes: {
    spacing: {
      typeDef: { type: "number" }
    },
    alignItems: {
      typeDef: {
        type: "string",
        enum: ["start", "center", "end", "stretch", "baseline"]
      },
      label: "Vertical alignment",
      control: { type: "VerticalAlign" }
    },
    justifyContent: {
      typeDef: {
        type: "string",
        enum: ["start", "center", "end", "space-between", "space-around", "space-evenly"]
      },
      label: "Horizontal alignment",
      control: { type: "HorizontalAlign" }
    },
    children: {
      typeDef: { type: "element" },
      control: { type: "slots" }
    }
  }
});

// ../toolpad-components/dist/Stack.js
import { Stack as Stack2 } from "@mui/material";

// ../toolpad-components/dist/utils/addDefaultProps.js
import * as React2 from "react";
function withDefaultProps(Component, defaultProps) {
  const Wrapped = React2.forwardRef((props, ref) => React2.createElement(Component, __spreadValues({ ref }, props)));
  Wrapped.defaultProps = defaultProps;
  return Wrapped;
}

// ../toolpad-components/dist/Stack.js
var Stack_default = createComponent(withDefaultProps(Stack2, {
  gap: 2,
  direction: "row",
  alignItems: "start",
  justifyContent: "start"
}), {
  argTypes: {
    gap: {
      typeDef: { type: "number" }
    },
    margin: {
      typeDef: { type: "number" }
    },
    direction: {
      typeDef: {
        type: "string",
        enum: ["row", "row-reverse", "column", "column-reverse"]
      }
    },
    alignItems: {
      typeDef: {
        type: "string",
        enum: ["start", "center", "end", "stretch", "baseline"]
      }
    },
    justifyContent: {
      typeDef: {
        type: "string",
        enum: ["start", "center", "end", "space-between", "space-around", "space-evenly"]
      }
    },
    children: {
      typeDef: { type: "element" },
      control: { type: "slots" }
    },
    sx: {
      typeDef: { type: "object" }
    }
  }
});

// ../toolpad-components/dist/Button.js
import * as React4 from "react";

// ../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
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;
}

// ../../node_modules/@mui/lab/LoadingButton/LoadingButton.js
var import_prop_types = __toESM(require_prop_types());
import * as React3 from "react";

// ../../node_modules/@mui/utils/esm/chainPropTypes.js
function chainPropTypes(propType1, propType2) {
  if (false) {
    return () => null;
  }
  return function validate(...args) {
    return propType1(...args) || propType2(...args);
  };
}

// ../../node_modules/@mui/lab/LoadingButton/LoadingButton.js
import { capitalize, unstable_useId as useId } from "@mui/material/utils";

// ../../node_modules/@mui/base/composeClasses/composeClasses.js
function composeClasses(slots, getUtilityClass, classes) {
  const output = {};
  Object.keys(slots).forEach((slot) => {
    output[slot] = slots[slot].reduce((acc, key) => {
      if (key) {
        if (classes && classes[key]) {
          acc.push(classes[key]);
        }
        acc.push(getUtilityClass(key));
      }
      return acc;
    }, []).join(" ");
  });
  return output;
}

// ../../node_modules/@mui/base/className/ClassNameGenerator.js
var defaultGenerator = (componentName) => componentName;
var createClassNameGenerator = () => {
  let generate = defaultGenerator;
  return {
    configure(generator) {
      generate = generator;
    },
    generate(componentName) {
      return generate(componentName);
    },
    reset() {
      generate = defaultGenerator;
    }
  };
};
var ClassNameGenerator = createClassNameGenerator();
var ClassNameGenerator_default = ClassNameGenerator;

// ../../node_modules/@mui/base/generateUtilityClass/generateUtilityClass.js
var globalStateClassesMapping = {
  active: "Mui-active",
  checked: "Mui-checked",
  completed: "Mui-completed",
  disabled: "Mui-disabled",
  error: "Mui-error",
  expanded: "Mui-expanded",
  focused: "Mui-focused",
  focusVisible: "Mui-focusVisible",
  required: "Mui-required",
  selected: "Mui-selected"
};
function generateUtilityClass(componentName, slot) {
  const globalStateClass = globalStateClassesMapping[slot];
  return globalStateClass || `${ClassNameGenerator_default.generate(componentName)}-${slot}`;
}

// ../../node_modules/@mui/base/generateUtilityClasses/generateUtilityClasses.js
function generateUtilityClasses(componentName, slots) {
  const result = {};
  slots.forEach((slot) => {
    result[slot] = generateUtilityClass(componentName, slot);
  });
  return result;
}

// ../../node_modules/@mui/lab/LoadingButton/LoadingButton.js
import { styled, useThemeProps } from "@mui/material/styles";
import Button from "@mui/material/Button";
import CircularProgress from "@mui/material/CircularProgress";

// ../../node_modules/@mui/lab/LoadingButton/loadingButtonClasses.js
function getLoadingButtonUtilityClass(slot) {
  return generateUtilityClass("MuiLoadingButton", slot);
}
var loadingButtonClasses = generateUtilityClasses("MuiLoadingButton", ["root", "loading", "loadingIndicator", "loadingIndicatorCenter", "loadingIndicatorStart", "loadingIndicatorEnd", "endIconLoadingEnd", "startIconLoadingStart"]);
var loadingButtonClasses_default = loadingButtonClasses;

// ../../node_modules/@mui/lab/LoadingButton/LoadingButton.js
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
var _excluded = ["children", "disabled", "id", "loading", "loadingIndicator", "loadingPosition", "variant"];
var useUtilityClasses = (ownerState) => {
  const {
    loading,
    loadingPosition,
    classes
  } = ownerState;
  const slots = {
    root: ["root", loading && "loading"],
    startIcon: [loading && `startIconLoading${capitalize(loadingPosition)}`],
    endIcon: [loading && `endIconLoading${capitalize(loadingPosition)}`],
    loadingIndicator: ["loadingIndicator", loading && `loadingIndicator${capitalize(loadingPosition)}`]
  };
  const composedClasses = composeClasses(slots, getLoadingButtonUtilityClass, classes);
  return _extends({}, classes, composedClasses);
};
var rootShouldForwardProp = (prop) => prop !== "ownerState" && prop !== "theme" && prop !== "sx" && prop !== "as" && prop !== "classes";
var LoadingButtonRoot = styled(Button, {
  shouldForwardProp: (prop) => rootShouldForwardProp(prop) || prop === "classes",
  name: "MuiLoadingButton",
  slot: "Root",
  overridesResolver: (props, styles) => {
    return [styles.root, styles.startIconLoadingStart && {
      [`& .${loadingButtonClasses_default.startIconLoadingStart}`]: styles.startIconLoadingStart
    }, styles.endIconLoadingEnd && {
      [`& .${loadingButtonClasses_default.endIconLoadingEnd}`]: styles.endIconLoadingEnd
    }];
  }
})(({
  ownerState,
  theme
}) => _extends({
  [`& .${loadingButtonClasses_default.startIconLoadingStart}, & .${loadingButtonClasses_default.endIconLoadingEnd}`]: {
    transition: theme.transitions.create(["opacity"], {
      duration: theme.transitions.duration.short
    }),
    opacity: 0
  }
}, ownerState.loadingPosition === "center" && {
  transition: theme.transitions.create(["background-color", "box-shadow", "border-color"], {
    duration: theme.transitions.duration.short
  }),
  [`&.${loadingButtonClasses_default.loading}`]: {
    color: "transparent"
  }
}, ownerState.loadingPosition === "start" && ownerState.fullWidth && {
  [`& .${loadingButtonClasses_default.startIconLoadingStart}, & .${loadingButtonClasses_default.endIconLoadingEnd}`]: {
    transition: theme.transitions.create(["opacity"], {
      duration: theme.transitions.duration.short
    }),
    opacity: 0,
    marginRight: -8
  }
}, ownerState.loadingPosition === "end" && ownerState.fullWidth && {
  [`& .${loadingButtonClasses_default.startIconLoadingStart}, & .${loadingButtonClasses_default.endIconLoadingEnd}`]: {
    transition: theme.transitions.create(["opacity"], {
      duration: theme.transitions.duration.short
    }),
    opacity: 0,
    marginLeft: -8
  }
}));
var LoadingButtonLoadingIndicator = styled("div", {
  name: "MuiLoadingButton",
  slot: "LoadingIndicator",
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.loadingIndicator, styles[`loadingIndicator${capitalize(ownerState.loadingPosition)}`]];
  }
})(({
  theme,
  ownerState
}) => _extends({
  position: "absolute",
  visibility: "visible",
  display: "flex"
}, ownerState.loadingPosition === "start" && (ownerState.variant === "outlined" || ownerState.variant === "contained") && {
  left: ownerState.size === "small" ? 10 : 14
}, ownerState.loadingPosition === "start" && ownerState.variant === "text" && {
  left: 6
}, ownerState.loadingPosition === "center" && {
  left: "50%",
  transform: "translate(-50%)",
  color: theme.palette.action.disabled
}, ownerState.loadingPosition === "end" && (ownerState.variant === "outlined" || ownerState.variant === "contained") && {
  right: ownerState.size === "small" ? 10 : 14
}, ownerState.loadingPosition === "end" && ownerState.variant === "text" && {
  right: 6
}, ownerState.loadingPosition === "start" && ownerState.fullWidth && {
  position: "relative",
  left: -10
}, ownerState.loadingPosition === "end" && ownerState.fullWidth && {
  position: "relative",
  right: -10
}));
var LoadingButton = /* @__PURE__ */ React3.forwardRef(function LoadingButton2(inProps, ref) {
  const props = useThemeProps({
    props: inProps,
    name: "MuiLoadingButton"
  });
  const {
    children,
    disabled = false,
    id: idProp,
    loading = false,
    loadingIndicator: loadingIndicatorProp,
    loadingPosition = "center",
    variant = "text"
  } = props, other = _objectWithoutPropertiesLoose(props, _excluded);
  const id = useId(idProp);
  const loadingIndicator = loadingIndicatorProp != null ? loadingIndicatorProp : /* @__PURE__ */ _jsx(CircularProgress, {
    "aria-labelledby": id,
    color: "inherit",
    size: 16
  });
  const ownerState = _extends({}, props, {
    disabled,
    loading,
    loadingIndicator,
    loadingPosition,
    variant
  });
  const classes = useUtilityClasses(ownerState);
  return /* @__PURE__ */ _jsx(LoadingButtonRoot, _extends({
    disabled: disabled || loading,
    id,
    ref
  }, other, {
    variant,
    classes,
    ownerState,
    children: ownerState.loadingPosition === "end" ? /* @__PURE__ */ _jsxs(React3.Fragment, {
      children: [children, loading && /* @__PURE__ */ _jsx(LoadingButtonLoadingIndicator, {
        className: classes.loadingIndicator,
        ownerState,
        children: loadingIndicator
      })]
    }) : /* @__PURE__ */ _jsxs(React3.Fragment, {
      children: [loading && /* @__PURE__ */ _jsx(LoadingButtonLoadingIndicator, {
        className: classes.loadingIndicator,
        ownerState,
        children: loadingIndicator
      }), children]
    })
  }));
});
true ? LoadingButton.propTypes = {
  children: import_prop_types.default.node,
  classes: import_prop_types.default.object,
  disabled: import_prop_types.default.bool,
  id: import_prop_types.default.string,
  loading: import_prop_types.default.bool,
  loadingIndicator: import_prop_types.default.node,
  loadingPosition: chainPropTypes(import_prop_types.default.oneOf(["start", "end", "center"]), (props) => {
    if (props.loadingPosition === "start" && !props.startIcon) {
      return new Error(`MUI: The loadingPosition="start" should be used in combination with startIcon.`);
    }
    if (props.loadingPosition === "end" && !props.endIcon) {
      return new Error(`MUI: The loadingPosition="end" should be used in combination with endIcon.`);
    }
    return null;
  }),
  sx: import_prop_types.default.oneOfType([import_prop_types.default.arrayOf(import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.object, import_prop_types.default.bool])), import_prop_types.default.func, import_prop_types.default.object]),
  variant: import_prop_types.default.oneOfType([import_prop_types.default.oneOf(["contained", "outlined", "text"]), import_prop_types.default.string])
} : void 0;
var LoadingButton_default = LoadingButton;

// ../toolpad-components/dist/Button.js
function Button2(_a2) {
  var _b = _a2, { content } = _b, props = __objRest(_b, ["content"]);
  return React4.createElement(LoadingButton_default, __spreadValues({}, props), content);
}
Button2.defaultProps = {
  content: "Button Text",
  variant: "contained",
  color: "primary"
};
var Button_default = createComponent(Button2, {
  argTypes: {
    content: {
      typeDef: { type: "string" }
    },
    onClick: {
      typeDef: { type: "function" }
    },
    disabled: {
      typeDef: { type: "boolean" }
    },
    variant: {
      typeDef: { type: "string", enum: ["contained", "outlined", "text"] }
    },
    color: {
      typeDef: { type: "string", enum: ["primary", "secondary"] }
    },
    loading: {
      typeDef: { type: "boolean" }
    },
    sx: {
      typeDef: { type: "object" }
    }
  }
});

// ../toolpad-components/dist/DataGrid.js
import { DataGridPro, GridToolbar, LicenseInfo, useGridApiContext, gridColumnsTotalWidthSelector, gridColumnPositionsSelector } from "@mui/x-data-grid-pro";
import * as React5 from "react";
import { debounce, LinearProgress, Skeleton } from "@mui/material";
function mulberry32(a) {
  return () => {
    let t = a += 1831565813;
    t = Math.imul(t ^ t >>> 15, t | 1);
    t ^= t + Math.imul(t ^ t >>> 7, t | 61);
    return ((t ^ t >>> 14) >>> 0) / 4294967296;
  };
}
function randomBetween(seed, min, max) {
  const random = mulberry32(seed);
  return () => min + (max - min) * random();
}
function SkeletonLoadingOverlay() {
  var _a2, _b;
  const apiRef = useGridApiContext();
  const dimensions = (_a2 = apiRef.current) == null ? void 0 : _a2.getRootDimensions();
  const viewportHeight = (_b = dimensions == null ? void 0 : dimensions.viewportInnerSize.height) != null ? _b : 0;
  const rowHeight = apiRef.current.unstable_getRowHeight();
  const skeletonRowsCount = Math.ceil(viewportHeight / rowHeight);
  const totalWidth = gridColumnsTotalWidthSelector(apiRef);
  const positions = gridColumnPositionsSelector(apiRef);
  const inViewportCount = React5.useMemo(() => positions.filter((value) => value <= totalWidth).length, [totalWidth, positions]);
  const columns = apiRef.current.getVisibleColumns().slice(0, inViewportCount);
  const children = React5.useMemo(() => {
    const random = randomBetween(12345, 25, 75);
    const array = [];
    for (let i = 0; i < skeletonRowsCount; i += 1) {
      for (const column of columns) {
        const width = Math.round(random());
        array.push(React5.createElement("div", { key: `${i}-${column.field}`, style: {
          display: "flex",
          flexDirection: "row",
          justifyContent: column.align,
          height: rowHeight,
          alignItems: "center"
        } }, React5.createElement(Skeleton, { sx: { mx: 1 }, width: `${width}%` })));
      }
    }
    return array;
  }, [skeletonRowsCount, columns, rowHeight]);
  const rowsCount = apiRef.current.getRowsCount();
  return rowsCount > 0 ? React5.createElement(LinearProgress, null) : React5.createElement("div", { style: {
    display: "grid",
    gridTemplateColumns: `${columns.map(({ computedWidth }) => `${computedWidth}px`).join(" ")}`,
    gridTemplateRows: `repeat(auto-fill, ${rowHeight}px)`
  } }, children);
}
function inferColumnType(value) {
  if (value instanceof Date) {
    return "dateTime";
  }
  const valueType = typeof value;
  switch (typeof value) {
    case "number":
    case "boolean":
    case "string":
      return valueType;
    default:
      return void 0;
  }
}
function inferColumns(rows) {
  if (rows.length < 1) {
    return [];
  }
  const firstRow = rows[0];
  return Object.entries(firstRow).map(([field, value]) => ({
    field,
    type: inferColumnType(value)
  }));
}
var _a;
var LICENSE = typeof window !== "undefined" ? (_a = window.document.querySelector("meta[name=x-data-grid-pro-license]")) == null ? void 0 : _a.getAttribute("content") : null;
if (LICENSE) {
  LicenseInfo.setLicenseKey(LICENSE);
}
var EMPTY_COLUMNS = [];
var EMPTY_ROWS = [];
var DataGridComponent = React5.forwardRef(function DataGridComponent2(_a2, ref) {
  var _b = _a2, { columns: columnsProp, rows: rowsProp, rowIdField: rowIdFieldProp, error: errorProp, selection, onSelectionChange } = _b, props = __objRest(_b, ["columns", "rows", "rowIdField", "error", "selection", "onSelectionChange"]);
  const nodeRuntime = useNode();
  const handleResize = React5.useMemo(() => debounce((params) => {
    if (!nodeRuntime) {
      return;
    }
    nodeRuntime.updateAppDomConstProp("columns", (columns2) => columns2 == null ? void 0 : columns2.map((column) => column.field === params.colDef.field ? __spreadProps(__spreadValues({}, column), { width: params.width }) : column));
  }, 500), [nodeRuntime]);
  React5.useEffect(() => handleResize.clear(), [handleResize]);
  const handleColumnOrderChange = React5.useMemo(() => debounce((params) => {
    if (!nodeRuntime) {
      return;
    }
    nodeRuntime.updateAppDomConstProp("columns", (columns2) => {
      if (!columns2) {
        return columns2;
      }
      const old = columns2.find((colDef) => colDef.field === params.field);
      if (!old) {
        return columns2;
      }
      const withoutOld = columns2.filter((column) => column.field !== params.field);
      return [
        ...withoutOld.slice(0, params.targetIndex),
        old,
        ...withoutOld.slice(params.targetIndex)
      ];
    });
  }, 500), [nodeRuntime]);
  React5.useEffect(() => handleColumnOrderChange.clear(), [handleColumnOrderChange]);
  const rowsInput = rowsProp || EMPTY_ROWS;
  const hasExplicitRowId = React5.useMemo(() => {
    const hasRowIdField = !!(rowIdFieldProp && rowIdFieldProp !== "id");
    const parsedRows = rowsInput;
    return parsedRows.length === 0 || hasRowIdField || !!parsedRows[0].id;
  }, [rowIdFieldProp, rowsInput]);
  const rows = React5.useMemo(() => hasExplicitRowId ? rowsInput : rowsInput.map((row, id) => __spreadProps(__spreadValues({}, row), { id })), [hasExplicitRowId, rowsInput]);
  const columnsInitRef = React5.useRef(false);
  const hasColumnsDefined = columnsProp && columnsProp.length > 0;
  React5.useEffect(() => {
    if (!nodeRuntime || hasColumnsDefined || rows.length <= 0 || columnsInitRef.current) {
      return;
    }
    let inferredColumns = inferColumns(rows);
    if (!hasExplicitRowId) {
      inferredColumns = inferredColumns.filter((column) => column.field !== "id");
    }
    nodeRuntime.updateAppDomConstProp("columns", inferredColumns);
    columnsInitRef.current = true;
  }, [hasColumnsDefined, rows, nodeRuntime, hasExplicitRowId]);
  const getRowId = React5.useCallback((row) => {
    return rowIdFieldProp && row[rowIdFieldProp] ? row[rowIdFieldProp] : row.id;
  }, [rowIdFieldProp]);
  const onSelectionModelChange = React5.useCallback((ids) => {
    onSelectionChange(ids.length > 0 ? rows.find((row) => row.id === ids[0]) : null);
  }, [rows, onSelectionChange]);
  const columns = columnsProp || EMPTY_COLUMNS;
  return React5.createElement("div", { ref, style: { height: 350, width: "100%" } }, React5.createElement(DataGridPro, __spreadValues({ components: { Toolbar: GridToolbar, LoadingOverlay: SkeletonLoadingOverlay }, onColumnResize: handleResize, onColumnOrderChange: handleColumnOrderChange, rows, columns, key: rowIdFieldProp, getRowId, onSelectionModelChange, selectionModel: selection ? [selection.id] : [], error: errorProp, componentsProps: {
    errorOverlay: { message: typeof errorProp === "string" ? errorProp : errorProp == null ? void 0 : errorProp.message }
  } }, props)));
});
DataGridComponent.defaultProps = {
  selection: null,
  density: "compact"
};
var DataGrid_default = createComponent(DataGridComponent, {
  errorProp: "error",
  loadingPropSource: ["rows", "columns"],
  loadingProp: "loading",
  argTypes: {
    rows: {
      typeDef: { type: "array", schema: "/schemas/DataGridRows.json" }
    },
    columns: {
      typeDef: { type: "array", schema: "/schemas/DataGridColumns.json" },
      control: { type: "GridColumns" }
    },
    density: {
      typeDef: { type: "string", enum: ["compact", "standard", "comfortable"] }
    },
    sx: {
      typeDef: { type: "object" }
    },
    selection: {
      typeDef: { type: "object" },
      onChangeProp: "onSelectionChange"
    },
    loading: {
      typeDef: { type: "boolean" }
    },
    rowIdField: {
      typeDef: { type: "string" },
      control: { type: "RowIdFieldSelect" },
      label: "Id field"
    }
  }
});

// ../toolpad-components/dist/Container.js
import { Container } from "@mui/material";
var Container_default = createComponent(withDefaultProps(Container, {}), {
  argTypes: {
    children: {
      typeDef: { type: "element" },
      control: { type: "slot" }
    },
    sx: {
      typeDef: { type: "object" }
    }
  }
});

// ../toolpad-components/dist/TextField.js
import { TextField } from "@mui/material";
var TextField_default = createComponent(withDefaultProps(TextField, {
  variant: "outlined",
  size: "small",
  value: ""
}), {
  argTypes: {
    label: {
      typeDef: { type: "string" }
    },
    variant: {
      typeDef: { type: "string", enum: ["outlined", "filled", "standard"] }
    },
    size: {
      typeDef: { type: "string", enum: ["small", "normal"] }
    },
    value: {
      typeDef: { type: "string" },
      onChangeProp: "onChange",
      onChangeHandler: (event) => event.target.value
    },
    sx: {
      typeDef: { type: "object" }
    }
  }
});

// ../toolpad-components/dist/Typography.js
import * as React6 from "react";
import { Skeleton as Skeleton2, Typography as MuiTypography } from "@mui/material";
function Typography(_a2) {
  var _b = _a2, { value, loading, sx } = _b, props = __objRest(_b, ["value", "loading", "sx"]);
  return React6.createElement(MuiTypography, __spreadValues({ sx: __spreadValues({ minWidth: loading ? 150 : void 0 }, sx) }, props), loading ? React6.createElement(Skeleton2, null) : value);
}
Typography.defaultProps = {
  value: "Text",
  loading: false
};
var Typography_default = createComponent(Typography, {
  loadingPropSource: ["value"],
  loadingProp: "loading",
  argTypes: {
    value: {
      typeDef: { type: "string" }
    },
    variant: {
      typeDef: {
        type: "string",
        enum: ["h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2"]
      }
    },
    loading: {
      typeDef: { type: "boolean" }
    },
    sx: {
      typeDef: { type: "object" }
    }
  }
});

// ../toolpad-components/dist/Select.js
import * as React7 from "react";
import { FormControl, InputLabel, Select as MuiSelect, MenuItem } from "@mui/material";
function Select(_a2) {
  var _b = _a2, { sx, label, options } = _b, props = __objRest(_b, ["sx", "label", "options"]);
  var _a3;
  const labelId = React7.useId();
  return React7.createElement(FormControl, { size: "small", sx: __spreadValues({ minWidth: 120 }, sx) }, React7.createElement(InputLabel, { id: labelId }, label), React7.createElement(MuiSelect, __spreadValues({ labelId, label }, props), (_a3 = options.map((option) => {
    var _a4;
    const parsedOption = typeof option === "string" ? { value: option } : option;
    return React7.createElement(MenuItem, { key: parsedOption.value, value: parsedOption.value }, (_a4 = parsedOption.label) != null ? _a4 : parsedOption.value);
  })) != null ? _a3 : null));
}
Select.defaultProps = {
  label: "",
  variant: "outlined",
  size: "small",
  value: "",
  options: []
};
var Select_default = createComponent(Select, {
  loadingPropSource: ["value", "options"],
  loadingProp: "disabled",
  argTypes: {
    label: {
      typeDef: { type: "string" }
    },
    disabled: {
      typeDef: { type: "boolean" }
    },
    variant: {
      typeDef: { type: "string", enum: ["outlined", "filled", "standard"] }
    },
    size: {
      typeDef: { type: "string", enum: ["small", "normal"] }
    },
    value: {
      typeDef: { type: "string" },
      onChangeProp: "onChange",
      onChangeHandler: (event) => event.target.value
    },
    options: {
      typeDef: { type: "array", schema: "/schemas/SelectOptions.json" },
      control: { type: "json" }
    },
    sx: {
      typeDef: { type: "object" }
    }
  }
});

// ../toolpad-components/dist/Paper.js
import { Paper } from "@mui/material";
var Paper_default = createComponent(withDefaultProps(Paper, { elevation: 1 }), {
  argTypes: {
    elevation: {
      typeDef: { type: "number", minimum: 0 }
    },
    children: {
      typeDef: { type: "element" },
      control: { type: "slot" }
    },
    sx: {
      typeDef: { type: "object" }
    }
  }
});

// ../toolpad-components/dist/CustomLayout.js
import * as React8 from "react";
import { Grid } from "@mui/material";
function CustomLayout({ child1, child2, child3 }) {
  return React8.createElement(Grid, { container: true }, React8.createElement(Grid, { item: true }, React8.createElement(Placeholder, { prop: "child1" }, child1)), React8.createElement(Grid, { item: true }, React8.createElement(Placeholder, { prop: "child2" }, child2)), React8.createElement(Grid, { item: true }, child3));
}
CustomLayout.defaultProps = {};
var CustomLayout_default = createComponent(CustomLayout, {
  argTypes: {
    child3: {
      typeDef: { type: "element" },
      control: { type: "slot" }
    }
  }
});

// ../toolpad-components/dist/Image.js
import { Box, Skeleton as Skeleton3 } from "@mui/material";
import * as React9 from "react";
function Image({ sx: sxProp, src, width, height, alt, loading: loadingProp, fit }) {
  const sx = React9.useMemo(() => __spreadProps(__spreadValues({}, sxProp), {
    width,
    height,
    position: "relative",
    display: "flex",
    alignItems: "center",
    justifyContent: "center"
  }), [sxProp, width, height]);
  const [imgLoading, setImgLoading] = React9.useState(true);
  const handleLoad = React9.useCallback(() => setImgLoading(false), []);
  const loading = loadingProp || imgLoading;
  return React9.createElement(Box, { sx }, loading ? React9.createElement(Skeleton3, { variant: "rectangular", width, height }) : null, React9.createElement(Box, { component: "img", src, alt, sx: {
    width: "100%",
    height: "100%",
    objectFit: fit,
    position: "absolute",
    visibility: loading ? "hidden" : "visible"
  }, onLoad: handleLoad }));
}
Image.defaultProps = {
  alt: "",
  sx: { maxWidth: "100%" },
  width: 400,
  height: 300,
  loading: false,
  fit: "contain"
};
var Image_default = createComponent(Image, {
  loadingPropSource: ["src"],
  loadingProp: "loading",
  argTypes: {
    src: {
      typeDef: { type: "string" }
    },
    alt: {
      typeDef: { type: "string" }
    },
    fit: {
      typeDef: { type: "string", enum: ["contain", "cover", "fill", "none", "scale-down"] }
    },
    width: {
      typeDef: { type: "number" }
    },
    height: {
      typeDef: { type: "number" }
    },
    loading: {
      typeDef: { type: "boolean" }
    },
    sx: {
      typeDef: { type: "object" }
    }
  }
});
export {
  Button_default as Button,
  Container_default as Container,
  CustomLayout_default as CustomLayout,
  DataGrid_default as DataGrid,
  Image_default as Image,
  PageRow_default as PageRow,
  Paper_default as Paper,
  Select_default as Select,
  Stack_default as Stack,
  TextField_default as TextField,
  Typography_default as Typography,
  inferColumns
};
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/** @license MUI v5.0.0-alpha.78
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/** @license MUI v5.0.0-alpha.79
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
/** @license React v16.13.1
 * react-is.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
