"use strict";
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 __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], 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 register_exports = {};
__export(register_exports, {
  registerComponent: () => registerComponent
});
module.exports = __toCommonJS(register_exports);
var import_prop_controllers = require("@makeswift/prop-controllers");
var import_controls = require("@makeswift/controls");
var import_constants = require("../constants");
var import_constants2 = require("./constants");
var import_react = require("react");
function registerComponent(runtime) {
  function isHiddenBasedOnAnimationType(props, deviceId, property) {
    const animateIn = import_prop_controllers.ResponsiveSelect.fromPropData(
      props[property]
    );
    return ((0, import_controls.findBreakpointOverride)(runtime.getBreakpoints(), animateIn, deviceId)?.value ?? "none") === "none";
  }
  const isHiddenBasedOnBoxAnimation = (props, deviceId) => isHiddenBasedOnAnimationType(props, deviceId, "boxAnimateType");
  const isHiddenBasedOnItemAnimation = (props, deviceId) => isHiddenBasedOnAnimationType(props, deviceId, "itemAnimateType");
  return runtime.registerComponent(
    (0, import_react.lazy)(() => Promise.resolve().then(() => __toESM(require("./Box")))),
    {
      type: import_constants.MakeswiftComponentType.Box,
      label: "Box",
      props: {
        id: (0, import_prop_controllers.ElementID)(),
        backgrounds: (0, import_prop_controllers.Backgrounds)(),
        width: (0, import_prop_controllers.Width)({
          format: import_prop_controllers.Width.Format.ClassName,
          defaultValue: { value: 100, unit: "%" }
        }),
        height: (0, import_prop_controllers.ResponsiveIconRadioGroup)({
          label: "Height",
          options: [
            { value: "auto", label: "Auto", icon: "HeightAuto16" },
            { value: "stretch", label: "Stretch", icon: "HeightMatch16" }
          ],
          defaultValue: "auto"
        }),
        verticalAlign: (0, import_prop_controllers.ResponsiveIconRadioGroup)({
          label: "Align items",
          options: [
            { value: "flex-start", label: "Top", icon: "VerticalAlignStart16" },
            { value: "center", label: "Middle", icon: "VerticalAlignMiddle16" },
            { value: "flex-end", label: "Bottom", icon: "VerticalAlignEnd16" },
            {
              value: "space-between",
              label: "Space between",
              icon: "VerticalAlignSpaceBetween16"
            }
          ],
          defaultValue: "flex-start"
        }),
        margin: (0, import_prop_controllers.Margin)({ format: import_prop_controllers.Margin.Format.ClassName }),
        padding: (0, import_prop_controllers.Padding)({
          format: import_prop_controllers.Padding.Format.ClassName,
          preset: [
            {
              deviceId: (0, import_controls.getBaseBreakpoint)(runtime.getBreakpoints()).id,
              value: {
                paddingTop: { value: 10, unit: "px" },
                paddingRight: { value: 10, unit: "px" },
                paddingBottom: { value: 10, unit: "px" },
                paddingLeft: { value: 10, unit: "px" }
              }
            }
          ]
        }),
        border: (0, import_prop_controllers.Border)({ format: import_prop_controllers.Border.Format.ClassName }),
        borderRadius: (0, import_prop_controllers.BorderRadius)({ format: import_prop_controllers.BorderRadius.Format.ClassName }),
        boxShadow: (0, import_prop_controllers.Shadows)({ format: import_prop_controllers.Shadows.Format.ClassName }),
        rowGap: (0, import_prop_controllers.GapY)((props) => ({
          hidden: props.children == null
        })),
        columnGap: (0, import_prop_controllers.GapX)((props) => ({
          hidden: props.children == null
        })),
        boxAnimateType: (0, import_prop_controllers.ResponsiveSelect)({
          label: "Animate box in",
          labelOrientation: "vertical",
          options: [
            { value: "none", label: "None" },
            { value: "fadeIn", label: "Fade in" },
            { value: "fadeRight", label: "Fade right" },
            { value: "fadeDown", label: "Fade down" },
            { value: "fadeLeft", label: "Fade left" },
            { value: "fadeUp", label: "Fade up" },
            { value: "blurIn", label: "Blur in" },
            { value: "scaleUp", label: "Scale up" },
            { value: "scaleDown", label: "Scale down" }
          ],
          defaultValue: "none"
        }),
        boxAnimateDuration: (0, import_prop_controllers.ResponsiveNumber)((props, device) => ({
          label: "Box duration",
          defaultValue: import_constants2.DEFAULT_BOX_ANIMATE_DURATION,
          min: 0.1,
          step: 0.05,
          suffix: "s",
          hidden: isHiddenBasedOnBoxAnimation(props, device)
        })),
        boxAnimateDelay: (0, import_prop_controllers.ResponsiveNumber)((props, device) => ({
          label: "Box delay",
          defaultValue: import_constants2.DEFAULT_BOX_ANIMATE_DELAY,
          min: 0,
          step: 0.05,
          suffix: "s",
          hidden: isHiddenBasedOnBoxAnimation(props, device)
        })),
        itemAnimateType: (0, import_prop_controllers.ResponsiveSelect)({
          label: "Animate items in",
          labelOrientation: "vertical",
          options: [
            { value: "none", label: "None" },
            { value: "fadeIn", label: "Fade in" },
            { value: "fadeRight", label: "Fade right" },
            { value: "fadeDown", label: "Fade down" },
            { value: "fadeLeft", label: "Fade left" },
            { value: "fadeUp", label: "Fade up" },
            { value: "blurIn", label: "Blur in" },
            { value: "scaleUp", label: "Scale up" },
            { value: "scaleDown", label: "Scale down" }
          ],
          defaultValue: "none"
        }),
        itemAnimateDuration: (0, import_prop_controllers.ResponsiveNumber)((props, device) => ({
          label: "Items duration",
          defaultValue: import_constants2.DEFAULT_BOX_ANIMATE_DURATION,
          min: 0.1,
          step: 0.05,
          suffix: "s",
          hidden: isHiddenBasedOnItemAnimation(props, device)
        })),
        itemAnimateDelay: (0, import_prop_controllers.ResponsiveNumber)((props, device) => ({
          label: "Items delay",
          defaultValue: import_constants2.DEFAULT_ITEM_ANIMATE_DELAY,
          min: 0,
          step: 0.05,
          suffix: "s",
          hidden: isHiddenBasedOnItemAnimation(props, device)
        })),
        itemStaggerDuration: (0, import_prop_controllers.ResponsiveNumber)((props, device) => ({
          label: "Stagger",
          min: 0,
          step: 0.05,
          suffix: "s",
          defaultValue: import_constants2.DEFAULT_ITEM_STAGGER_DURATION,
          hidden: isHiddenBasedOnItemAnimation(props, device)
        })),
        hidePlaceholder: (0, import_prop_controllers.Checkbox)((props) => ({
          label: "Hide placeholder",
          hidden: props.children != null
        })),
        children: (0, import_prop_controllers.Grid)()
      }
    }
  );
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  registerComponent
});
//# sourceMappingURL=register.js.map