"use strict";
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: 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var types_exports = {};
__export(types_exports, {
  validators: () => validators
});
module.exports = __toCommonJS(types_exports);
const validators = {
  required: (label) => (v) => v.trim() ? null : `${label} is required`,
  url: (v) => {
    if (!v.trim()) return "URL is required";
    try {
      const url = new URL(v);
      if (!["http:", "https:"].includes(url.protocol)) {
        return "URL must use http:// or https://";
      }
      return null;
    } catch {
      return "Invalid URL format";
    }
  },
  positiveNumber: (v) => {
    if (!v.trim()) return null;
    const num = parseInt(v, 10);
    if (isNaN(num) || num <= 0) return "Must be a positive number";
    return null;
  },
  slashFormat: (v) => {
    if (!v.trim()) return "Model ID is required";
    if (!v.includes("/")) return "Must use format: provider/model-name";
    return null;
  }
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  validators
});
