/**
 * Static list of components that ship as separate add-on plugins.
 *
 * Rendered as greyed "crown" teaser tiles in the builder palette (WP.org
 * Guideline 5 allows pointing out features provided by a separate plugin).
 * Informational only: a teaser can never add a component to the form (no
 * click-to-add, no drag) — clicking one only toggles a small note naming the
 * add-on, with a "Learn more" link. No prices, no "Upgrade"/"Pro"/"Premium"/
 * "Unlock"/"Buy" wording anywhere.
 *
 * `url` must resolve (verify with
 * `curl -s -o /dev/null -w '%{http_code}' -L <url>` before adding/changing
 * one); every entry links to its own page under `https://epicformbuilder.com/plugins/`.
 *
 * A teaser's icon is looked up via `getIcon(component)` (icons.ts) — same
 * lowercase-component-name lookup core uses for everything else, so there's
 * no separate icon key to keep in sync here.
 */
export interface CatalogEntry {
  /** Component name, as used by getDefaults()/getEditorPart() etc. */
  component: string
  /** Palette tile label. */
  label: string
  /** Add-on plugin slug (directory name), e.g. `epicforms-signature`. */
  addon: string
  /** Add-on display name for the "<Label> is available with the <name> add-on." note. */
  addonName: string
  url: string
  category: 'fields' | 'actions'
  /** Palette section title — must match the section the add-on itself declares via `EditorPart.section`. */
  section: string
  twinSize?: boolean
  /**
   * Name of the hardcoded core tile this teaser should render immediately
   * after, within the same section (e.g. the old, pre-extraction palette
   * placed Signature right after Paragraph). Ignored if that core tile
   * isn't in the section's core list — the teaser then appends at the end.
   */
  after?: string
}

const base = 'https://epicformbuilder.com/plugins/'

export const addonCatalog: CatalogEntry[] = [
  // Fields — Basic Fields
  { component: 'Signature', label: 'Signature', addon: 'epicforms-signature', addonName: 'Signature', url: `${ base }signature`, category: 'fields', section: 'Basic Fields', after: 'Paragraph' },

  // Fields — Files Upload
  { component: 'File', label: 'Local Upload', addon: 'epicforms-file', addonName: 'File Upload', url: `${ base }file-upload`, category: 'fields', section: 'Files Upload' },
  { component: 'AWSS3Upload', label: 'Amazon S3', addon: 'epicforms-awss3upload', addonName: 'Amazon S3 Upload', url: `${ base }file-upload-s3`, category: 'fields', section: 'Files Upload' },
  { component: 'CloudflareR2Upload', label: 'Cloudflare R2', addon: 'epicforms-cloudflarer2upload', addonName: 'Cloudflare R2 Upload', url: `${ base }file-upload-r2`, category: 'fields', section: 'Files Upload' },
  { component: 'GoogleCloudStorage', label: 'Google Storage', addon: 'epicforms-googlecloudstorage', addonName: 'Google Cloud Storage Upload', url: `${ base }file-upload-gcs`, category: 'fields', section: 'Files Upload' },

  // Fields — E-commerce product cards
  { component: 'Pricing', label: 'Pricing', addon: 'epicforms-pricing', addonName: 'Pricing', url: `${ base }pricing-fields`, category: 'fields', section: 'E-commerce product cards' },
  { component: 'PriceCustom', label: 'Custom Price', addon: 'epicforms-pricecustom', addonName: 'Custom Price', url: `${ base }custom-price`, category: 'fields', section: 'E-commerce product cards' },
  { component: 'Total', label: 'Total', addon: 'epicforms-total', addonName: 'Total', url: `${ base }total`, category: 'fields', section: 'E-commerce product cards' },

  // Fields — payment gateways
  { component: 'PayPal', label: 'PayPal', addon: 'epicforms-paypal', addonName: 'PayPal', url: `${ base }paypal`, category: 'fields', section: 'payment gateways', twinSize: true },
  { component: 'Stripe', label: 'Stripe', addon: 'epicforms-stripe', addonName: 'Stripe', url: `${ base }stripe`, category: 'fields', section: 'payment gateways', twinSize: true },
  { component: 'AuthorizeNet', label: 'Authorize.Net', addon: 'epicforms-authorizenet', addonName: 'Authorize.Net', url: `${ base }authorize-net`, category: 'fields', section: 'payment gateways', twinSize: true },

  // Actions — email
  { component: 'Autoresponder', label: 'Autoresponder', addon: 'epicforms-autoresponder', addonName: 'Autoresponder', url: `${ base }autoresponder`, category: 'actions', section: 'email', after: 'Notification' },

  // Actions — integrations
  { component: 'Mailchimp', label: 'Mailchimp', addon: 'epicforms-mailchimp', addonName: 'Mailchimp', url: `${ base }mailchimp`, category: 'actions', section: 'integrations' },
  { component: 'Zapier', label: 'Zapier', addon: 'epicforms-zapier', addonName: 'Zapier', url: `${ base }zapier`, category: 'actions', section: 'integrations' },
  { component: 'GoogleSheets', label: 'Google Sheets', addon: 'epicforms-googlesheets', addonName: 'Google Sheets', url: `${ base }google-sheets`, category: 'actions', section: 'integrations' },

  // Actions — other
  { component: 'ReCaptchaV3', label: 'reCaptcha V3', addon: 'epicforms-recaptchav3', addonName: 'reCAPTCHA v3', url: `${ base }recaptcha`, category: 'actions', section: 'other', twinSize: true },
  { component: 'Redirect', label: 'Redirect', addon: 'epicforms-redirect', addonName: 'Redirect', url: `${ base }redirect`, category: 'actions', section: 'other', twinSize: true },
]
