var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
    for (var name in all) __defProp(target, name, {
      get: all[name],
      enumerable: !0
    });
  },
  __copyProps = (to, from, except, desc) => {
    if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
      get: () => from[key],
      enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
    });
    return to;
  };
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
  value: !0
}), mod);
var Button_exports = {};
__export(Button_exports, {
  Button: () => Button
});
module.exports = __toCommonJS(Button_exports);
var import_tamagui = require("tamagui"),
  import_Icon = require("./Icon.cjs"),
  import_typography = require("./typography.cjs");
const ButtonContext = (0, import_tamagui.createStyledContext)({
    variant: void 0,
    loading: !1,
    density: "0"
  }),
  ButtonFrame = (0, import_tamagui.styled)(import_tamagui.XStack, {
    paddingLeft: 16,
    paddingRight: 16,
    name: "Button",
    context: ButtonContext,
    alignItems: "center",
    alignSelf: "flex-start",
    flexDirection: "row",
    justifyContent: "center",
    br: "$shape.corner_full",
    maxHeight: 40,
    height: 40,
    gap: 8,
    cursor: "pointer",
    hoverStyle: {
      cur: "pointer",
      bc: "$primaryContainer"
    },
    pressStyle: {
      // bc: '$backgroundPress',
    },
    disabledStyle: {
      o: 0.4,
      pe: "none",
      cursor: "default"
    },
    variants: {
      variant: {
        outlined: {
          brc: "$outline",
          btc: "$outline",
          bbc: "$outline",
          blc: "$outline",
          bw: "$border.outline",
          background: "transparent",
          hoverStyle: {
            cur: "pointer",
            bc: "$primaryContainer"
          }
        },
        filled: {
          backgroundColor: "$primary"
        },
        "filled-tonal": {
          backgroundColor: "$secondaryContainer"
        },
        "filled-error": {
          backgroundColor: "$errorContainer",
          hoverStyle: {
            backgroundColor: "$error"
          }
        },
        tonal: {
          bg: "$secondaryContainer"
        },
        "tonal-success": {
          bg: "$successContainer",
          hoverStyle: {
            backgroundColor: "$success"
          }
        },
        "tonal-warning": {
          backgroundColor: "$warningContainer",
          hoverStyle: {
            backgroundColor: "$warning"
          }
        },
        "tonal-info": {
          backgroundColor: "$infoContainer",
          hoverStyle: {
            backgroundColor: "$info"
          }
        },
        elevated: {
          bg: "$surfaceContainerLow",
          shadowColor: "$shadow_opacity",
          shadowRadius: "$shadow.1"
        },
        text: {
          bc: "transparent",
          hoverStyle: {
            bc: "$primaryContainer"
          }
        },
        warning: {
          backgroundColor: "$warning",
          hoverStyle: {
            backgroundColor: "$warningContainer"
          }
        }
      },
      loading: {
        true: {},
        false: {}
      },
      density: {
        0: {},
        "-1": {
          height: 36
        },
        "-2": {
          height: 32
        },
        "-3": {
          height: 28
        }
      },
      shape: {
        none: {
          borderRadius: 0
        },
        xs: {
          borderRadius: "$shape.corner_xs"
        },
        sm: {
          borderRadius: "$shape.corner_sm"
        },
        m: {
          borderRadius: "$shape.corner_m"
        },
        l: {
          borderRadius: "$shape.corner_l"
        },
        xl: {
          borderRadius: "$shape.corner_xl"
        },
        full: {
          borderRadius: "$shape.corner_full"
        }
      }
    },
    defaultVariants: {
      variant: "filled",
      density: "0"
    }
  }),
  ButtonText = (0, import_tamagui.styled)(import_typography.Label, {
    name: "ButtonText",
    size: "large",
    context: ButtonContext,
    variants: {
      size: {
        "...fontSize": (name, {
          font
        }) => ({
          fos: font?.size[name]
        })
      },
      variant: {
        filled: {
          col: "$onPrimary"
        },
        outlined: {
          col: "$primary"
        },
        "filled-tonal": {
          col: "$onSecondaryContainer"
        },
        "filled-error": {
          col: "$onErrorContainer"
        },
        tonal: {
          col: "$onSecondaryContainer"
        },
        "tonal-success": {
          col: "$onSuccessContainer",
          hoverStyle: {
            col: "$onSuccess"
          }
        },
        "tonal-warning": {
          col: "$onWarningContainer",
          hoverStyle: {
            col: "$onWarning"
          }
        },
        "tonal-info": {
          col: "$onInfoContainer",
          "$group-button-hover": {
            col: "$onInfo"
          }
        },
        elevated: {
          col: "$primary"
        },
        warning: {
          col: "$onWarning",
          hoverStyle: {
            col: "$onWarningContainer"
          }
        }
      }
    }
  }),
  ButtonSpinner = (0, import_tamagui.styled)(import_tamagui.Spinner, {
    name: "ButtonSpinner",
    context: ButtonContext,
    variants: {
      loading: {
        false: {
          display: "none"
        }
      },
      variant: {
        filled: {
          col: "$onPrimary"
        },
        "filled-error": {
          col: "$onError"
        },
        "tonal-warning": {
          col: "$onWarningContainer"
        },
        "tonal-info": {
          col: "$onInfoContainer"
        },
        warning: {
          col: "$onWarning"
        }
      }
    }
  }),
  ButtonIcon = (0, import_tamagui.styled)(import_Icon.Icon, {
    context: ButtonContext,
    name: "ButtonIcon",
    size: 18,
    variants: {
      variant: {
        filled: {
          col: "$onPrimary"
        },
        outlined: {
          col: "$primary"
        },
        "filled-tonal": {
          col: "$onSecondaryContainer"
        },
        "filled-error": {
          col: "$onErrorContainer"
        },
        tonal: {
          col: "$onSecondaryContainer"
        },
        "tonal-success": {
          col: "$onSuccessContainer"
        },
        "tonal-warning": {
          col: "$onWarningContainer"
        },
        "tonal-info": {
          col: "$onInfoContainer",
          "$group-button-hover": {
            col: "$onInfo"
          }
        },
        elevated: {
          col: "$primary"
        },
        warning: {
          col: "$onWarning",
          hoverStyle: {
            col: "$onWarningContainer"
          }
        }
      }
    }
  }),
  Button = (0, import_tamagui.withStaticProperties)(ButtonFrame, {
    Text: ButtonText,
    Icon: ButtonIcon,
    Props: ButtonContext.Provider,
    Spinner: ButtonSpinner
  });