@marvalt/digivalt-core 0.1.7 → 0.2.1

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +47 -4
  3. package/bin/init.cjs +406 -25
  4. package/dist/config.cjs +520 -0
  5. package/dist/config.cjs.map +1 -0
  6. package/dist/config.d.ts +307 -0
  7. package/dist/config.esm.js +502 -0
  8. package/dist/config.esm.js.map +1 -0
  9. package/dist/generators.cjs +2481 -0
  10. package/dist/generators.cjs.map +1 -0
  11. package/dist/generators.d.ts +19 -0
  12. package/dist/generators.esm.js +2475 -0
  13. package/dist/generators.esm.js.map +1 -0
  14. package/dist/index.cjs +18 -7955
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.ts +18 -1196
  17. package/dist/index.esm.js +13 -7929
  18. package/dist/index.esm.js.map +1 -1
  19. package/dist/runtime/env.d.ts +4 -0
  20. package/dist/runtime/lazy.d.ts +1 -0
  21. package/dist/services/cf-wp-webhook.d.ts +2 -0
  22. package/dist/services/gravityForms.d.ts +3 -0
  23. package/dist/services/mautic.d.ts +5 -1
  24. package/dist/services/suitecrm.d.ts +2 -0
  25. package/dist/services.cjs +1339 -0
  26. package/dist/services.cjs.map +1 -0
  27. package/dist/services.d.ts +432 -0
  28. package/dist/services.esm.js +1322 -0
  29. package/dist/services.esm.js.map +1 -0
  30. package/dist/static/index.d.ts +4 -0
  31. package/dist/static.cjs +997 -0
  32. package/dist/static.cjs.map +1 -0
  33. package/dist/static.d.ts +410 -0
  34. package/dist/static.esm.js +962 -0
  35. package/dist/static.esm.js.map +1 -0
  36. package/dist/types.cjs +3 -0
  37. package/dist/types.cjs.map +1 -0
  38. package/dist/types.d.ts +134 -0
  39. package/dist/types.esm.js +2 -0
  40. package/dist/types.esm.js.map +1 -0
  41. package/package.json +30 -2
  42. package/template/DIGIVALT_SETUP.md +73 -0
  43. package/template/scripts/deploy-secrets.js +55 -23
  44. package/template/scripts/generate.ts +3 -17
@@ -0,0 +1,997 @@
1
+ 'use strict';
2
+
3
+ require('clsx');
4
+ require('tailwind-merge');
5
+
6
+ /**
7
+ * Decodes HTML entities in a string
8
+ * Handles both named entities (&, ") and numeric entities (', ’)
9
+ * @param text - The text string with HTML entities
10
+ * @returns Decoded text string
11
+ */
12
+ function decodeHtmlEntities(text) {
13
+ if (!text)
14
+ return '';
15
+ // Use browser's built-in decoder if available (most efficient)
16
+ if (typeof document !== 'undefined') {
17
+ const textarea = document.createElement('textarea');
18
+ textarea.innerHTML = text;
19
+ return textarea.value;
20
+ }
21
+ // Fallback for server-side or when document is not available
22
+ // Decode common named entities
23
+ const namedEntities = {
24
+ '&': '&',
25
+ '&lt;': '<',
26
+ '&gt;': '>',
27
+ '&quot;': '"',
28
+ '&apos;': "'",
29
+ '&nbsp;': ' ',
30
+ '&copy;': '©',
31
+ '&reg;': '®',
32
+ '&trade;': '™',
33
+ '&hellip;': '…',
34
+ '&mdash;': '—',
35
+ '&ndash;': '–',
36
+ '&lsquo;': '\u2018', // Left single quotation mark
37
+ '&rsquo;': '\u2019', // Right single quotation mark
38
+ '&ldquo;': '\u201C', // Left double quotation mark
39
+ '&rdquo;': '\u201D', // Right double quotation mark
40
+ };
41
+ let decoded = text;
42
+ // Decode numeric entities (&#039;, &#8217;, etc.)
43
+ decoded = decoded.replace(/&#(\d+);/g, (match, dec) => {
44
+ return String.fromCharCode(parseInt(dec, 10));
45
+ });
46
+ // Decode hex entities (&#x27;, etc.)
47
+ decoded = decoded.replace(/&#x([0-9a-fA-F]+);/g, (match, hex) => {
48
+ return String.fromCharCode(parseInt(hex, 16));
49
+ });
50
+ // Decode named entities
51
+ Object.entries(namedEntities).forEach(([entity, char]) => {
52
+ decoded = decoded.replace(new RegExp(entity, 'g'), char);
53
+ });
54
+ return decoded;
55
+ }
56
+ /**
57
+ * Replaces common WordPress HTML entities so they display as expected (e.g. en dash as hyphen, &#038;/&amp; as &).
58
+ * Use on block innerHTML or other WP-rendered HTML before passing to dangerouslySetInnerHTML.
59
+ */
60
+ function normalizeWordPressHtmlEntities(html) {
61
+ if (!html)
62
+ return '';
63
+ return decodeHtmlEntities(html.replace(/&#8211;/g, '-'));
64
+ }
65
+
66
+ // @ts-nocheck
67
+ /**
68
+ * Cloudflare Images URL helpers
69
+ *
70
+ * Many endpoints (e.g., cloudflare_image_standardized) return the base URL
71
+ * without a variant/transform segment. Append a variant at render-time to
72
+ * control size and improve LCP/SEO.
73
+ */
74
+ const isCloudflareImageUrl = (url) => {
75
+ if (!url)
76
+ return false;
77
+ try {
78
+ const u = new URL(url);
79
+ return u.hostname.toLowerCase().includes('imagedelivery.net');
80
+ }
81
+ catch {
82
+ return false;
83
+ }
84
+ };
85
+ /**
86
+ * Append Cloudflare Images variant to the base URL if not already present.
87
+ * Example output: https://imagedelivery.net/<account>/<id>/w=1024,h=600
88
+ */
89
+ const getCloudflareVariantUrl = (url, options) => {
90
+ if (!isCloudflareImageUrl(url))
91
+ return url;
92
+ // If a transform already exists, return as-is
93
+ if (/\/w=\d+/.test(url) || /\/(public|thumbnail|banner|avatar)/.test(url)) {
94
+ return url;
95
+ }
96
+ const { width, height } = options;
97
+ const hasTrailingSlash = url.endsWith('/');
98
+ const base = hasTrailingSlash ? url.slice(0, -1) : url;
99
+ const variant = `w=${Math.max(1, Math.floor(width))}` + (height ? `,h=${Math.max(1, Math.floor(height))}` : '');
100
+ return `${base}/${variant}`;
101
+ };
102
+
103
+ // @ts-nocheck
104
+ // Minimal browser-safe static data loader to avoid importing Node-only code in the runtime bundle.
105
+ /** Recursively normalize WordPress HTML entities (e.g. &#8211; → "-") in block innerHTML. */
106
+ function normalizeBlocksHtml(blocks) {
107
+ if (!blocks)
108
+ return;
109
+ for (const block of blocks) {
110
+ if (block.innerHTML && typeof block.innerHTML === 'string') {
111
+ block.innerHTML = normalizeWordPressHtmlEntities(block.innerHTML);
112
+ }
113
+ if (block.innerBlocks?.length)
114
+ normalizeBlocksHtml(block.innerBlocks);
115
+ }
116
+ }
117
+ /** Recursively decode HTML entities in all string values of an event_meta-like object (mutate in place). */
118
+ function normalizeEventMetaStrings(meta) {
119
+ for (const key of Object.keys(meta)) {
120
+ const v = meta[key];
121
+ if (typeof v === 'string') {
122
+ meta[key] = decodeHtmlEntities(v);
123
+ }
124
+ else if (Array.isArray(v)) {
125
+ for (let i = 0; i < v.length; i++) {
126
+ const el = v[i];
127
+ if (typeof el === 'string') {
128
+ v[i] = decodeHtmlEntities(el);
129
+ }
130
+ else if (el && typeof el === 'object' && !Array.isArray(el)) {
131
+ normalizeEventMetaStrings(el);
132
+ }
133
+ }
134
+ }
135
+ }
136
+ }
137
+ /** Normalize title.rendered, excerpt.rendered, content.rendered, content_cloudflare on a WP-like item (mutate in place). */
138
+ function normalizeRenderedStrings(item) {
139
+ if (!item || typeof item !== 'object')
140
+ return;
141
+ if (typeof item.title?.rendered === 'string') {
142
+ item.title.rendered = normalizeWordPressHtmlEntities(item.title.rendered);
143
+ }
144
+ if (typeof item.excerpt?.rendered === 'string') {
145
+ item.excerpt.rendered = normalizeWordPressHtmlEntities(item.excerpt.rendered);
146
+ }
147
+ if (typeof item.content?.rendered === 'string') {
148
+ item.content.rendered = normalizeWordPressHtmlEntities(item.content.rendered);
149
+ }
150
+ if (typeof item.content_cloudflare === 'string') {
151
+ item.content_cloudflare = normalizeWordPressHtmlEntities(item.content_cloudflare);
152
+ }
153
+ }
154
+ /**
155
+ * Mask email for privacy: first char of local + ***@****** + last char of domain name + TLD.
156
+ * Example: name@example.com.au → n***@******e.com.au
157
+ */
158
+ function maskEmail(email) {
159
+ const s = typeof email === 'string' ? email.trim() : '';
160
+ if (!s || !s.includes('@'))
161
+ return '***@***.***';
162
+ const parts = s.split('@', 2);
163
+ const local = parts[0];
164
+ const domain = parts[1];
165
+ if (!local || !domain)
166
+ return '***@***.***';
167
+ const localFirst = local.slice(0, 1);
168
+ const domainBits = domain.split('.');
169
+ if (domainBits.length < 2)
170
+ return localFirst + '***@******.' + domain;
171
+ const domainName = domainBits.shift() ?? '';
172
+ const tld = domainBits.join('.');
173
+ const domainLast = domainName.slice(-1);
174
+ return localFirst + '***@******' + domainLast + '.' + tld;
175
+ }
176
+ /** Replace raw members_email with masked value on each member in member arrays. */
177
+ function maskMemberEmailsInStaticData(data) {
178
+ if (!data)
179
+ return;
180
+ const memberKeys = ['chapter_member', 'members', 'member'];
181
+ const dataRecord = data;
182
+ for (const key of memberKeys) {
183
+ const arr = dataRecord[key];
184
+ if (!Array.isArray(arr))
185
+ continue;
186
+ for (const item of arr) {
187
+ if (item && typeof item === 'object') {
188
+ const obj = item;
189
+ if (obj.member_meta && typeof obj.member_meta === 'object') {
190
+ const meta = obj.member_meta;
191
+ if (meta.members_email != null)
192
+ meta.members_email = maskEmail(meta.members_email);
193
+ }
194
+ if (obj.public_profile && typeof obj.public_profile === 'object') {
195
+ const profile = obj.public_profile;
196
+ if (profile.members_email != null)
197
+ profile.members_email = maskEmail(profile.members_email);
198
+ }
199
+ }
200
+ }
201
+ }
202
+ }
203
+ /** Walk static data and normalize block HTML and .rendered/content fields so entities like &#8211; display correctly. */
204
+ function normalizeWordPressHtmlInStaticData(data) {
205
+ if (!data)
206
+ return;
207
+ if (data.pages) {
208
+ for (const page of data.pages) {
209
+ normalizeRenderedStrings(page);
210
+ if (page.blocks)
211
+ normalizeBlocksHtml(page.blocks);
212
+ }
213
+ }
214
+ if (data.posts) {
215
+ for (const post of data.posts) {
216
+ normalizeRenderedStrings(post);
217
+ }
218
+ }
219
+ const cptKeys = ['eventbrite_event', 'member', 'testimonial', 'chapter_member', 'members'];
220
+ const dataRecord = data;
221
+ for (const key of cptKeys) {
222
+ const arr = dataRecord[key];
223
+ if (Array.isArray(arr)) {
224
+ for (const item of arr) {
225
+ normalizeRenderedStrings(item);
226
+ if (key === 'eventbrite_event' && item?.event_meta && typeof item.event_meta === 'object' && !Array.isArray(item.event_meta)) {
227
+ normalizeEventMetaStrings(item.event_meta);
228
+ }
229
+ }
230
+ }
231
+ }
232
+ if (data.site_settings && typeof data.site_settings === 'object') {
233
+ const settings = data.site_settings;
234
+ if (typeof settings.name === 'string')
235
+ settings.name = normalizeWordPressHtmlEntities(settings.name);
236
+ if (typeof settings.description === 'string')
237
+ settings.description = normalizeWordPressHtmlEntities(settings.description);
238
+ }
239
+ if (data.header?.blocks)
240
+ normalizeBlocksHtml(data.header.blocks);
241
+ if (data.footer?.blocks)
242
+ normalizeBlocksHtml(data.footer.blocks);
243
+ }
244
+ let wpStaticCache = null;
245
+ const loadWordPressData = async (path = '/wordpress-data.json') => {
246
+ if (wpStaticCache)
247
+ return;
248
+ const res = await fetch(path);
249
+ if (!res.ok)
250
+ throw new Error(`Failed to load WordPress static data: ${res.status}`);
251
+ wpStaticCache = (await res.json());
252
+ normalizeWordPressHtmlInStaticData(wpStaticCache);
253
+ maskMemberEmailsInStaticData(wpStaticCache);
254
+ // Expose cache globally for theme loading (temporary workaround)
255
+ if (typeof window !== 'undefined') {
256
+ window.__wpStaticCache = wpStaticCache;
257
+ }
258
+ };
259
+ /**
260
+ * Get WordPress static data (includes theme_styles)
261
+ */
262
+ const getWordPressData = () => wpStaticCache;
263
+ const getWordPressPosts = () => wpStaticCache?.posts ?? [];
264
+ const getWordPressPages = () => wpStaticCache?.pages ?? [];
265
+ const getWordPressPageBySlug = (slug) => {
266
+ const pages = getWordPressPages();
267
+ return pages.find(page => page.slug === slug);
268
+ };
269
+ const getWordPressPageById = (id) => {
270
+ const pages = getWordPressPages();
271
+ return pages.find(page => page.id === id);
272
+ };
273
+ const getWordPressMedia = () => wpStaticCache?.media ?? [];
274
+ const getWordPressCategories = () => wpStaticCache?.categories ?? [];
275
+ const getWordPressTags = () => wpStaticCache?.tags ?? [];
276
+ const getWordPressMembers = () => wpStaticCache?.chapter_member ?? wpStaticCache?.members ?? wpStaticCache?.member ?? [];
277
+ const getWordPressEvents = () => wpStaticCache?.eventbrite_event ?? [];
278
+ const getWordPressTestimonials = () => wpStaticCache?.testimonial ?? [];
279
+ /** Returns a member by slug from the same list the grid uses. Call after loadWordPressData(). */
280
+ const getWordPressMemberBySlug = (slug) => getWordPressMembers().find((m) => m.slug === slug);
281
+ const getWordPressMemberRoles = () => wpStaticCache?.['member-role'] ?? wpStaticCache?.memberRoles ?? [];
282
+ const getSiteSettings = () => {
283
+ return wpStaticCache?.site_settings;
284
+ };
285
+ const getHeader = () => {
286
+ const data = getWordPressData();
287
+ return data?.header;
288
+ };
289
+ /**
290
+ * Get the first navigation block's menu ID from header blocks (for responsive header menu).
291
+ */
292
+ function findFirstNavRef(blocks) {
293
+ for (const block of blocks || []) {
294
+ if (block?.blockName === 'core/navigation') {
295
+ const ref = block?.attrs?.['ref'] ?? block?.attrs?.['menuId'] ?? block?.attrs?.['menu'];
296
+ if (ref != null)
297
+ return parseInt(String(ref), 10);
298
+ }
299
+ const inner = block?.innerBlocks;
300
+ if (Array.isArray(inner)) {
301
+ const found = findFirstNavRef(inner);
302
+ if (found != null)
303
+ return found;
304
+ }
305
+ }
306
+ return undefined;
307
+ }
308
+ const getHeaderMenuId = () => {
309
+ const header = getHeader();
310
+ return header?.blocks ? findFirstNavRef(header.blocks) : undefined;
311
+ };
312
+ const getParsedHeader = () => {
313
+ const header = getHeader();
314
+ const hasHeader = !!(header?.blocks && header.blocks.length > 0);
315
+ return {
316
+ hasHeader,
317
+ menuId: hasHeader ? getHeaderMenuId() : undefined,
318
+ };
319
+ };
320
+ const getNavigationMenu = () => {
321
+ const data = getWordPressData();
322
+ return data?.navigation_menu;
323
+ };
324
+ /**
325
+ * Get a menu by ID from static data
326
+ * @param menuId Menu ID to retrieve
327
+ * @returns Menu data if found, undefined otherwise
328
+ */
329
+ const getMenuById = (menuId) => {
330
+ const data = getWordPressData();
331
+ if (data?.menus) {
332
+ // JSON keys are strings, so convert menuId to string for lookup
333
+ const menuKey = String(menuId);
334
+ if (data.menus[menuKey]) {
335
+ return data.menus[menuKey];
336
+ }
337
+ // Also try numeric key in case it's stored as number
338
+ if (data.menus[menuId]) {
339
+ return data.menus[menuId];
340
+ }
341
+ }
342
+ // Fallback: check if it's the header menu
343
+ if (data?.navigation_menu && data.navigation_menu.id === menuId) {
344
+ return data.navigation_menu;
345
+ }
346
+ return undefined;
347
+ };
348
+ const getFooter = () => {
349
+ return wpStaticCache?.footer;
350
+ };
351
+ // Helper to get logo URL (prefers Cloudflare URL if available)
352
+ // Appends /w=80 to Cloudflare URLs for proper display
353
+ const getLogoUrl = () => {
354
+ const settings = getSiteSettings();
355
+ if (!settings?.logo)
356
+ return null;
357
+ // Prefer Cloudflare URL if available
358
+ const logoUrl = settings.logo.cloudflare_url || settings.logo.url;
359
+ if (!logoUrl)
360
+ return null;
361
+ return getCloudflareVariantUrl(logoUrl, { width: 80 }) || logoUrl;
362
+ };
363
+ // Helper to get site icon URL (prefers Cloudflare URL if available)
364
+ const getSiteIconUrl = () => {
365
+ const settings = getSiteSettings();
366
+ if (!settings?.site_icon)
367
+ return null;
368
+ return settings.site_icon.cloudflare_url || settings.site_icon.url || null;
369
+ };
370
+ // Helper to get site name
371
+ const getSiteName = () => {
372
+ const settings = getSiteSettings();
373
+ return settings?.site_name || 'DigiVAlt';
374
+ };
375
+
376
+ const isBrowserEnvironment = () => {
377
+ return typeof window !== 'undefined' && typeof document !== 'undefined';
378
+ };
379
+
380
+ // @ts-nocheck
381
+ // Gravity Forms data store with proper environment handling
382
+ const transformForm = (formData) => {
383
+ // Transform fields to ensure proper structure
384
+ const transformedFields = (formData.fields || []).map((field) => ({
385
+ id: field.id.toString(), // Ensure ID is string
386
+ type: field.type,
387
+ label: field.label,
388
+ description: field.description,
389
+ isRequired: field.isRequired || false,
390
+ placeholder: field.placeholder,
391
+ defaultValue: field.defaultValue,
392
+ cssClass: field.cssClass,
393
+ inputs: field.inputs || null,
394
+ choices: field.choices || [],
395
+ validation: {
396
+ message: field.errorMessage,
397
+ pattern: field.inputMaskValue
398
+ }
399
+ }));
400
+ return {
401
+ id: formData.id.toString(), // Ensure ID is string
402
+ title: formData.title || formData.name || `Form ${formData.id}`,
403
+ description: formData.description,
404
+ fields: transformedFields,
405
+ button: {
406
+ text: formData.button?.text || 'Submit',
407
+ type: formData.button?.type || 'text',
408
+ imageUrl: formData.button?.imageUrl,
409
+ },
410
+ confirmation: {
411
+ type: formData.confirmation?.type || 'message',
412
+ message: formData.confirmation?.message,
413
+ url: formData.confirmation?.url,
414
+ pageId: formData.confirmation?.pageId,
415
+ queryString: formData.confirmation?.queryString,
416
+ isDefault: formData.confirmation?.isDefault,
417
+ },
418
+ settings: {
419
+ enableHoneypot: formData.enableHoneypot || false,
420
+ enableAnimation: formData.enableAnimation || false,
421
+ validationSummary: formData.validationSummary || false,
422
+ saveAndContinue: formData.save?.enabled || false,
423
+ limitEntries: {
424
+ enabled: formData.limitEntries || false,
425
+ limit: formData.limitEntriesCount,
426
+ message: formData.limitEntriesMessage
427
+ },
428
+ scheduleForm: {
429
+ enabled: formData.scheduleForm || false,
430
+ start: formData.scheduleStart,
431
+ end: formData.scheduleEnd,
432
+ message: formData.scheduleMessage
433
+ },
434
+ },
435
+ isActive: formData.isActive === true || formData.is_active === "1" || formData.is_active === true,
436
+ isPublished: formData.isPublished === true || formData.is_trash === "0" || formData.is_trash === false || formData.is_active === "1" || formData.is_active === true,
437
+ };
438
+ };
439
+ // Default fallback data
440
+ const defaultData = {
441
+ generated_at: new Date().toISOString(),
442
+ total_forms: 0,
443
+ forms: []
444
+ };
445
+ // Load static data from the generated JSON file
446
+ exports.gravityFormsData = defaultData;
447
+ // Function to load data dynamically
448
+ const loadGravityFormsData = async () => {
449
+ if (!isBrowserEnvironment()) {
450
+ return exports.gravityFormsData;
451
+ }
452
+ try {
453
+ console.log('🔄 Loading Gravity Forms data from /gravity-forms-data.json...');
454
+ const response = await fetch('/gravity-forms-data.json');
455
+ if (response.ok) {
456
+ const jsonData = await response.json();
457
+ console.log('🔍 Gravity Forms Data Load Debug:', {
458
+ totalForms: jsonData.total_forms,
459
+ formsCount: jsonData.forms?.length || 0,
460
+ firstForm: jsonData.forms?.[0] ? {
461
+ id: jsonData.forms[0].id,
462
+ title: jsonData.forms[0].title,
463
+ is_active: jsonData.forms[0].is_active,
464
+ isActive: jsonData.forms[0].isActive,
465
+ isPublished: jsonData.forms[0].isPublished
466
+ } : null
467
+ });
468
+ // Transform the data to ensure it matches our interface
469
+ const transformedForms = jsonData.forms.map((form) => transformForm(form));
470
+ exports.gravityFormsData = {
471
+ generated_at: jsonData.generated_at,
472
+ total_forms: jsonData.total_forms,
473
+ forms: transformedForms
474
+ };
475
+ console.log('🔍 Form Transformation Debug:', {
476
+ originalForms: jsonData.forms.map((f) => ({ id: f.id, title: f.title, is_active: f.is_active })),
477
+ transformedForms: transformedForms.map(f => ({ id: f.id, title: f.title, isActive: f.isActive, isPublished: f.isPublished }))
478
+ });
479
+ console.log('🔍 Transformed Forms Debug:', {
480
+ totalForms: exports.gravityFormsData.total_forms,
481
+ formsCount: exports.gravityFormsData.forms.length,
482
+ activeForms: exports.gravityFormsData.forms.filter(f => f.isActive).length,
483
+ publishedForms: exports.gravityFormsData.forms.filter(f => f.isPublished).length
484
+ });
485
+ return exports.gravityFormsData;
486
+ }
487
+ else {
488
+ console.error('❌ Failed to load gravityForms.json:', response.status, response.statusText);
489
+ }
490
+ }
491
+ catch (error) {
492
+ console.error('❌ Error loading gravityForms.json:', error);
493
+ }
494
+ return defaultData;
495
+ };
496
+ const getActiveForms = () => exports.gravityFormsData.forms.filter(form => form.isActive);
497
+ const getPublishedForms$1 = () => exports.gravityFormsData.forms.filter(form => form.isPublished);
498
+ const getFormById$1 = (id) => {
499
+ const idStr = String(id);
500
+ const idNum = typeof id === 'number' ? id : parseInt(idStr, 10);
501
+ return exports.gravityFormsData.forms.find(form => String(form.id) === idStr || form.id === idNum);
502
+ };
503
+ const getFormByTitle = (title) => exports.gravityFormsData.forms.find(form => form.title === title);
504
+
505
+ var generated_at = "2026-03-19T05:29:48.840Z";
506
+ var forms = [
507
+ {
508
+ id: 3,
509
+ name: "Eventbright Form",
510
+ alias: "eventbrigh",
511
+ description: null,
512
+ isPublished: true,
513
+ fields: [
514
+ {
515
+ id: 10,
516
+ label: "First Name",
517
+ showLabel: true,
518
+ alias: "first_name",
519
+ type: "text",
520
+ defaultValue: null,
521
+ isRequired: true,
522
+ validationMessage: null,
523
+ helpMessage: null,
524
+ order: 1,
525
+ properties: {
526
+ placeholder: null
527
+ },
528
+ validation: [
529
+ ],
530
+ parent: null,
531
+ conditions: [
532
+ ],
533
+ labelAttributes: null,
534
+ inputAttributes: null,
535
+ containerAttributes: null,
536
+ leadField: "firstname",
537
+ saveResult: true,
538
+ isAutoFill: true,
539
+ isReadOnly: false,
540
+ mappedObject: "contact",
541
+ mappedField: "firstname"
542
+ },
543
+ {
544
+ id: 11,
545
+ label: "Last Name",
546
+ showLabel: true,
547
+ alias: "last_name",
548
+ type: "text",
549
+ defaultValue: null,
550
+ isRequired: true,
551
+ validationMessage: null,
552
+ helpMessage: null,
553
+ order: 2,
554
+ properties: {
555
+ placeholder: null
556
+ },
557
+ validation: [
558
+ ],
559
+ parent: null,
560
+ conditions: [
561
+ ],
562
+ labelAttributes: null,
563
+ inputAttributes: null,
564
+ containerAttributes: null,
565
+ leadField: "lastname",
566
+ saveResult: true,
567
+ isAutoFill: true,
568
+ isReadOnly: false,
569
+ mappedObject: "contact",
570
+ mappedField: "lastname"
571
+ },
572
+ {
573
+ id: 8,
574
+ label: "Email",
575
+ showLabel: true,
576
+ alias: "email",
577
+ type: "email",
578
+ defaultValue: null,
579
+ isRequired: true,
580
+ validationMessage: null,
581
+ helpMessage: null,
582
+ order: 3,
583
+ properties: {
584
+ placeholder: null
585
+ },
586
+ validation: [
587
+ ],
588
+ parent: null,
589
+ conditions: [
590
+ ],
591
+ labelAttributes: null,
592
+ inputAttributes: null,
593
+ containerAttributes: null,
594
+ leadField: "email",
595
+ saveResult: true,
596
+ isAutoFill: true,
597
+ isReadOnly: false,
598
+ mappedObject: "contact",
599
+ mappedField: "email"
600
+ },
601
+ {
602
+ id: 9,
603
+ label: "Submit",
604
+ showLabel: true,
605
+ alias: "submit",
606
+ type: "button",
607
+ defaultValue: null,
608
+ isRequired: false,
609
+ validationMessage: null,
610
+ helpMessage: null,
611
+ order: 4,
612
+ properties: [
613
+ ],
614
+ validation: [
615
+ ],
616
+ parent: null,
617
+ conditions: [
618
+ ],
619
+ labelAttributes: null,
620
+ inputAttributes: "class=\"btn btn-ghost\"",
621
+ containerAttributes: null,
622
+ leadField: null,
623
+ saveResult: true,
624
+ isAutoFill: false,
625
+ isReadOnly: false,
626
+ mappedObject: null,
627
+ mappedField: null
628
+ }
629
+ ],
630
+ actions: [
631
+ {
632
+ id: 1,
633
+ name: "Email",
634
+ description: null,
635
+ type: "lead.addutmtags",
636
+ order: 1,
637
+ properties: [
638
+ ]
639
+ },
640
+ {
641
+ id: 2,
642
+ name: "THank You Notif 1",
643
+ description: null,
644
+ type: "email.send.user",
645
+ order: 2,
646
+ properties: {
647
+ useremail: {
648
+ email: "2"
649
+ },
650
+ user_id: [
651
+ 1
652
+ ]
653
+ }
654
+ },
655
+ {
656
+ id: 3,
657
+ name: "Registered +10 (HOT)",
658
+ description: null,
659
+ type: "lead.changetags",
660
+ order: 3,
661
+ properties: {
662
+ add_tags: [
663
+ "HOT"
664
+ ],
665
+ remove_tags: [
666
+ ]
667
+ }
668
+ }
669
+ ],
670
+ postAction: "message",
671
+ postActionProperty: "Thanks for your submission. An email will be sent to you shortly.",
672
+ formType: "campaign"
673
+ },
674
+ {
675
+ id: 2,
676
+ name: "second form",
677
+ alias: "second_for",
678
+ description: null,
679
+ isPublished: true,
680
+ fields: [
681
+ {
682
+ id: 4,
683
+ label: "Name",
684
+ showLabel: false,
685
+ alias: "f_name",
686
+ type: "text",
687
+ defaultValue: null,
688
+ isRequired: true,
689
+ validationMessage: "this field is required",
690
+ helpMessage: null,
691
+ order: 1,
692
+ properties: {
693
+ placeholder: "your first name"
694
+ },
695
+ validation: [
696
+ ],
697
+ parent: null,
698
+ conditions: [
699
+ ],
700
+ labelAttributes: null,
701
+ inputAttributes: null,
702
+ containerAttributes: null,
703
+ leadField: "firstname",
704
+ saveResult: true,
705
+ isAutoFill: false,
706
+ isReadOnly: false,
707
+ mappedObject: "contact",
708
+ mappedField: "firstname"
709
+ },
710
+ {
711
+ id: 5,
712
+ label: "Email",
713
+ showLabel: true,
714
+ alias: "email",
715
+ type: "email",
716
+ defaultValue: null,
717
+ isRequired: true,
718
+ validationMessage: "this is a required field",
719
+ helpMessage: null,
720
+ order: 2,
721
+ properties: {
722
+ placeholder: "email"
723
+ },
724
+ validation: [
725
+ ],
726
+ parent: null,
727
+ conditions: [
728
+ ],
729
+ labelAttributes: null,
730
+ inputAttributes: null,
731
+ containerAttributes: null,
732
+ leadField: "email",
733
+ saveResult: true,
734
+ isAutoFill: false,
735
+ isReadOnly: false,
736
+ mappedObject: "contact",
737
+ mappedField: "email"
738
+ },
739
+ {
740
+ id: 6,
741
+ label: "Message",
742
+ showLabel: false,
743
+ alias: "f_message",
744
+ type: "textarea",
745
+ defaultValue: null,
746
+ isRequired: true,
747
+ validationMessage: "we need your message",
748
+ helpMessage: null,
749
+ order: 3,
750
+ properties: [
751
+ ],
752
+ validation: [
753
+ ],
754
+ parent: null,
755
+ conditions: [
756
+ ],
757
+ labelAttributes: null,
758
+ inputAttributes: null,
759
+ containerAttributes: null,
760
+ leadField: "companyaddress1",
761
+ saveResult: true,
762
+ isAutoFill: false,
763
+ isReadOnly: false,
764
+ mappedObject: "company",
765
+ mappedField: "companyaddress1"
766
+ },
767
+ {
768
+ id: 7,
769
+ label: "Submit",
770
+ showLabel: true,
771
+ alias: "submit",
772
+ type: "button",
773
+ defaultValue: null,
774
+ isRequired: false,
775
+ validationMessage: null,
776
+ helpMessage: null,
777
+ order: 4,
778
+ properties: [
779
+ ],
780
+ validation: [
781
+ ],
782
+ parent: null,
783
+ conditions: [
784
+ ],
785
+ labelAttributes: null,
786
+ inputAttributes: "class=\"btn btn-ghost\"",
787
+ containerAttributes: null,
788
+ leadField: null,
789
+ saveResult: true,
790
+ isAutoFill: false,
791
+ isReadOnly: false,
792
+ mappedObject: null,
793
+ mappedField: null
794
+ }
795
+ ],
796
+ actions: [
797
+ ],
798
+ postAction: "message",
799
+ postActionProperty: "Great, you have made it!",
800
+ formType: "standalone"
801
+ },
802
+ {
803
+ id: 1,
804
+ name: "Simple form",
805
+ alias: "simple_for",
806
+ description: null,
807
+ isPublished: true,
808
+ fields: [
809
+ {
810
+ id: 1,
811
+ label: "Name",
812
+ showLabel: false,
813
+ alias: "f_name",
814
+ type: "text",
815
+ defaultValue: null,
816
+ isRequired: true,
817
+ validationMessage: "This field is required",
818
+ helpMessage: null,
819
+ order: 1,
820
+ properties: {
821
+ placeholder: "Your name"
822
+ },
823
+ validation: [
824
+ ],
825
+ parent: null,
826
+ conditions: [
827
+ ],
828
+ labelAttributes: null,
829
+ inputAttributes: null,
830
+ containerAttributes: null,
831
+ leadField: "firstname",
832
+ saveResult: true,
833
+ isAutoFill: false,
834
+ isReadOnly: false,
835
+ mappedObject: "contact",
836
+ mappedField: "firstname"
837
+ },
838
+ {
839
+ id: 2,
840
+ label: "EMail",
841
+ showLabel: false,
842
+ alias: "email",
843
+ type: "email",
844
+ defaultValue: null,
845
+ isRequired: true,
846
+ validationMessage: "This field is required",
847
+ helpMessage: null,
848
+ order: 2,
849
+ properties: {
850
+ placeholder: "Your email"
851
+ },
852
+ validation: [
853
+ ],
854
+ parent: null,
855
+ conditions: [
856
+ ],
857
+ labelAttributes: null,
858
+ inputAttributes: null,
859
+ containerAttributes: null,
860
+ leadField: "email",
861
+ saveResult: true,
862
+ isAutoFill: false,
863
+ isReadOnly: false,
864
+ mappedObject: "contact",
865
+ mappedField: "email"
866
+ },
867
+ {
868
+ id: 3,
869
+ label: "Submit",
870
+ showLabel: true,
871
+ alias: "submit",
872
+ type: "button",
873
+ defaultValue: null,
874
+ isRequired: false,
875
+ validationMessage: null,
876
+ helpMessage: null,
877
+ order: 3,
878
+ properties: [
879
+ ],
880
+ validation: [
881
+ ],
882
+ parent: null,
883
+ conditions: [
884
+ ],
885
+ labelAttributes: null,
886
+ inputAttributes: "class=\"btn btn-ghost\"",
887
+ containerAttributes: null,
888
+ leadField: null,
889
+ saveResult: true,
890
+ isAutoFill: false,
891
+ isReadOnly: false,
892
+ mappedObject: null,
893
+ mappedField: null
894
+ }
895
+ ],
896
+ actions: [
897
+ ],
898
+ postAction: "redirect",
899
+ postActionProperty: "/mautic-test",
900
+ formType: "standalone"
901
+ }
902
+ ];
903
+ var mauticFormsData = {
904
+ generated_at: generated_at,
905
+ forms: forms
906
+ };
907
+
908
+ // @ts-nocheck
909
+ // Import the generated Mautic forms data
910
+ // Create the data store
911
+ const mauticData = {
912
+ generated_at: mauticFormsData.generated_at,
913
+ forms: mauticFormsData.forms
914
+ };
915
+ // Helper functions
916
+ const getPublishedForms = () => mauticData.forms.filter(form => form.isPublished);
917
+ const getFormById = (id) => mauticData.forms.find(form => form.id === id);
918
+ const getFormByAlias = (alias) => mauticData.forms.find(form => form.alias === alias);
919
+
920
+ // @ts-nocheck
921
+ // Auto-generated WordPress static data - DO NOT EDIT MANUALLY
922
+ // Generated at: 2025-07-16T05:00:36.928Z
923
+ // Build ID: 1752642036928
924
+ const wordpressData = {
925
+ "generated_at": "2025-07-16T05:00:36.905Z",
926
+ "frontend_id": "react-wp-template",
927
+ "frontend_name": "React WordPress Template",
928
+ "config": {
929
+ "frontend_id": "react-wp-template",
930
+ "frontend_name": "React WordPress Template",
931
+ "post_types": {
932
+ "posts": {
933
+ "max_items": 50,
934
+ "include_embedded": true,
935
+ "orderby": "date",
936
+ "order": "desc"
937
+ },
938
+ "pages": {
939
+ "max_items": 20,
940
+ "include_embedded": true
941
+ },
942
+ "case_studies": {
943
+ "max_items": 20,
944
+ "include_embedded": true
945
+ },
946
+ "projects": {
947
+ "max_items": 20,
948
+ "include_embedded": true
949
+ },
950
+ "members": {
951
+ "max_items": 20,
952
+ "include_embedded": true
953
+ }
954
+ }
955
+ },
956
+ "posts": [],
957
+ "pages": [],
958
+ "case_studies": [],
959
+ "projects": [],
960
+ "members": []
961
+ };
962
+
963
+ exports.getActiveForms = getActiveForms;
964
+ exports.getFooter = getFooter;
965
+ exports.getFormByAlias = getFormByAlias;
966
+ exports.getGravityFormById = getFormById$1;
967
+ exports.getGravityFormByTitle = getFormByTitle;
968
+ exports.getHeader = getHeader;
969
+ exports.getHeaderMenuId = getHeaderMenuId;
970
+ exports.getLogoUrl = getLogoUrl;
971
+ exports.getMauticFormById = getFormById;
972
+ exports.getMenuById = getMenuById;
973
+ exports.getNavigationMenu = getNavigationMenu;
974
+ exports.getParsedHeader = getParsedHeader;
975
+ exports.getPublishedGravityForms = getPublishedForms$1;
976
+ exports.getPublishedMauticForms = getPublishedForms;
977
+ exports.getSiteIconUrl = getSiteIconUrl;
978
+ exports.getSiteName = getSiteName;
979
+ exports.getSiteSettings = getSiteSettings;
980
+ exports.getWordPressCategories = getWordPressCategories;
981
+ exports.getWordPressData = getWordPressData;
982
+ exports.getWordPressEvents = getWordPressEvents;
983
+ exports.getWordPressMedia = getWordPressMedia;
984
+ exports.getWordPressMemberBySlug = getWordPressMemberBySlug;
985
+ exports.getWordPressMemberRoles = getWordPressMemberRoles;
986
+ exports.getWordPressMembers = getWordPressMembers;
987
+ exports.getWordPressPageById = getWordPressPageById;
988
+ exports.getWordPressPageBySlug = getWordPressPageBySlug;
989
+ exports.getWordPressPages = getWordPressPages;
990
+ exports.getWordPressPosts = getWordPressPosts;
991
+ exports.getWordPressTags = getWordPressTags;
992
+ exports.getWordPressTestimonials = getWordPressTestimonials;
993
+ exports.loadGravityFormsData = loadGravityFormsData;
994
+ exports.loadWordPressData = loadWordPressData;
995
+ exports.mauticData = mauticData;
996
+ exports.wordpressData = wordpressData;
997
+ //# sourceMappingURL=static.cjs.map