@marvalt/madapter 2.2.1 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2415,16 +2415,13 @@ const MauticForm = ({ formId, title, description, className = '', form, onSubmit
2415
2415
  const submitMutation = useMauticFormSubmission();
2416
2416
  // Get Turnstile site key from environment
2417
2417
  const getTurnstilesiteKey = () => {
2418
- // Check for Vite environment (browser)
2419
- if (typeof window !== 'undefined' && window.import?.meta?.env) {
2420
- return window.import.meta.env.VITE_TURNSTILE_SITE_KEY;
2421
- }
2422
- // Check for direct import.meta (Vite)
2423
2418
  try {
2424
2419
  // @ts-ignore - import.meta is a Vite-specific global
2425
2420
  if (typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) }) !== 'undefined' && undefined) {
2426
2421
  // @ts-ignore
2427
- return undefined.VITE_TURNSTILE_SITE_KEY;
2422
+ const key = undefined.VITE_TURNSTILE_SITE_KEY;
2423
+ // Ensure we return a string or undefined, not an object
2424
+ return typeof key === 'string' ? key : undefined;
2428
2425
  }
2429
2426
  }
2430
2427
  catch (e) {