import { __ } from '@/utils/i18n';

const FREE_TEMPLATES = [
    {
        id: 'contact-simple',
        icon: 'message-reply',
        name: __('Simple Contact Form', 'formatrica'),
        description: __(
            'Name, email, and message - the basics',
            'formatrica'
        ),
        fields: [
            {
                type: 'text',
                name: 'name',
                label: __('Your Name', 'formatrica'),
                placeholder: __('Jane Doe', 'formatrica'),
                required: true,
            },
            {
                type: 'email',
                name: 'email',
                label: __('Email Address', 'formatrica'),
                placeholder: __('jane@example.com', 'formatrica'),
                required: true,
            },
            {
                type: 'textarea',
                name: 'message',
                label: __('Message', 'formatrica'),
                placeholder: __('How can we help you?', 'formatrica'),
                required: true,
            },
            {
                type: 'button',
                label: __('Send Message', 'formatrica'),
            },
        ],
        options: {
            success_message: __(
                "Thank you! We'll get back to you soon.",
                'formatrica'
            ),
        },
    },
    {
        id: 'contact-business',
        icon: 'address-book',
        name: __('Business Contact Form', 'formatrica'),
        description: __(
            'Professional contact form with company details',
            'formatrica'
        ),
        fields: [
            {
                type: 'text',
                name: 'first_name',
                label: __('First Name', 'formatrica'),
                required: true,
            },
            {
                type: 'text',
                name: 'last_name',
                label: __('Last Name', 'formatrica'),
                required: true,
            },
            {
                type: 'email',
                name: 'email',
                label: __('Work Email', 'formatrica'),
                required: true,
            },
            {
                type: 'tel',
                name: 'phone',
                label: __('Phone Number', 'formatrica'),
                required: false,
            },
            {
                type: 'text',
                name: 'company',
                label: __('Company Name', 'formatrica'),
                required: false,
            },
            {
                type: 'select',
                name: 'company_size',
                label: __('Company Size', 'formatrica'),
                required: false,
                options: [
                    '1-10 employees',
                    '11-50 employees',
                    '51-200 employees',
                    '200+ employees',
                ],
            },
            {
                type: 'select',
                name: 'inquiry_type',
                label: __('How can we help?', 'formatrica'),
                required: true,
                options: [
                    'Sales Inquiry',
                    'Technical Support',
                    'Partnership',
                    'Other',
                ],
            },
            {
                type: 'textarea',
                name: 'message',
                label: __('Message', 'formatrica'),
                required: true,
            },
            {
                type: 'button',
                label: __('Submit Inquiry', 'formatrica'),
            },
        ],
        options: {
            success_message: __(
                "Thank you for your inquiry! We'll respond soon.",
                'formatrica'
            ),
        },
    },
    {
        id: 'newsletter',
        icon: 'mail-forward',
        name: __('Newsletter Signup', 'formatrica'),
        description: __(
            'Email subscription with consent checkbox',
            'formatrica'
        ),
        fields: [
            {
                type: 'email',
                name: 'email',
                label: __('Email Address', 'formatrica'),
                placeholder: __('your@email.com', 'formatrica'),
                required: true,
            },
            {
                type: 'text',
                name: 'first_name',
                label: __('First Name (Optional)', 'formatrica'),
                required: false,
            },
            {
                type: 'checkbox',
                name: 'consent',
                label: __('I agree to receive email updates', 'formatrica'),
                required: true,
            },
            {
                type: 'button',
                label: __('Subscribe', 'formatrica'),
            },
        ],
        options: {
            success_message: __(
                "You're subscribed! Check your email to confirm.",
                'formatrica'
            ),
        },
    },
    {
        id: 'job-application',
        icon: 'file-cv',
        name: __('Job Application Form', 'formatrica'),
        description: __(
            'Complete application with file upload for resume',
            'formatrica'
        ),
        fields: [
            {
                type: 'text',
                name: 'full_name',
                label: __('Full Name', 'formatrica'),
                required: true,
            },
            {
                type: 'email',
                name: 'email',
                label: __('Email Address', 'formatrica'),
                required: true,
            },
            {
                type: 'tel',
                name: 'phone',
                label: __('Phone Number', 'formatrica'),
                required: true,
            },
            {
                type: 'text',
                name: 'linkedin',
                label: __('LinkedIn Profile URL', 'formatrica'),
                placeholder: 'https://linkedin.com/in/yourprofile',
                required: false,
            },
            {
                type: 'select',
                name: 'position',
                label: __('Position Applied For', 'formatrica'),
                required: true,
                options: [
                    'Frontend Developer',
                    'Backend Developer',
                    'Full Stack Developer',
                    'Designer',
                ],
            },
            {
                type: 'file',
                name: 'resume',
                label: __('Resume/CV', 'formatrica'),
                required: true,
                accept: 'application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document',
                maxFileSize: 5,
            },
            {
                type: 'file',
                name: 'cover_letter',
                label: __('Cover Letter (Optional)', 'formatrica'),
                required: false,
                accept: 'application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document',
                maxFileSize: 2,
            },
            {
                type: 'textarea',
                name: 'why_you',
                label: __('Why do you want to work with us?', 'formatrica'),
                required: true,
            },
            {
                type: 'button',
                label: __('Submit Application', 'formatrica'),
            },
        ],
        options: {
            success_message: __(
                "Application received! We'll review and contact you soon.",
                'formatrica'
            ),
        },
    },
    {
        id: 'appointment-request',
        icon: 'calendar-share',
        name: __('Appointment Request', 'formatrica'),
        description: __(
            'Schedule appointments with preferred date and service',
            'formatrica'
        ),
        fields: [
            {
                type: 'text',
                name: 'full_name',
                label: __('Full Name', 'formatrica'),
                required: true,
            },
            {
                type: 'email',
                name: 'email',
                label: __('Email', 'formatrica'),
                required: true,
            },
            {
                type: 'tel',
                name: 'phone',
                label: __('Phone Number', 'formatrica'),
                required: true,
            },
            {
                type: 'date',
                name: 'preferred_date',
                label: __('Preferred Date', 'formatrica'),
                required: true,
            },
            {
                type: 'select',
                name: 'preferred_time',
                label: __('Preferred Time', 'formatrica'),
                required: true,
                options: [
                    __('09:00 AM - 10:00 AM', 'formatrica'),
                    __('10:00 AM - 11:00 AM', 'formatrica'),
                    __('11:00 AM - 12:00 PM', 'formatrica'),
                    __('01:00 PM - 02:00 PM', 'formatrica'),
                    __('02:00 PM - 03:00 PM', 'formatrica'),
                    __('03:00 PM - 04:00 PM', 'formatrica'),
                ],
            },
            {
                type: 'select',
                name: 'service',
                label: __('Service Interested In', 'formatrica'),
                required: true,
                options: [
                    __('Consultation (30 min)', 'formatrica'),
                    __('Full Service (60 min)', 'formatrica'),
                    __('Follow-up (15 min)', 'formatrica'),
                ],
            },
            {
                type: 'textarea',
                name: 'notes',
                label: __('Additional Notes', 'formatrica'),
                required: false,
                placeholder: __('Share any extra details', 'formatrica'),
            },
            {
                type: 'button',
                label: __('Submit Request', 'formatrica'),
            },
        ],
    },
    {
        id: 'real-estate-inquiry',
        icon: 'building-estate',
        name: __('Real Estate Inquiry', 'formatrica'),
        description: __(
            'Collect property interests and viewing preferences',
            'formatrica'
        ),
        fields: [
            {
                type: 'text',
                name: 'name',
                label: __('Your Name', 'formatrica'),
                required: true,
            },
            {
                type: 'email',
                name: 'email',
                label: __('Email', 'formatrica'),
                required: true,
            },
            {
                type: 'tel',
                name: 'phone',
                label: __('Phone', 'formatrica'),
                required: true,
            },
            {
                type: 'select',
                name: 'contact_preference',
                label: __('Preferred Contact Method', 'formatrica'),
                required: true,
                options: [
                    __('Email', 'formatrica'),
                    __('Phone', 'formatrica'),
                    __('Text Message', 'formatrica'),
                ],
            },
            {
                type: 'select',
                name: 'property_type',
                label: __('Property Type', 'formatrica'),
                required: true,
                options: [
                    __('House', 'formatrica'),
                    __('Apartment', 'formatrica'),
                    __('Condo', 'formatrica'),
                    __('Land', 'formatrica'),
                ],
            },
            {
                type: 'select',
                name: 'budget_range',
                label: __('Budget Range', 'formatrica'),
                required: false,
                options: [
                    __('Under $200k', 'formatrica'),
                    __('$200k - $400k', 'formatrica'),
                    __('$400k - $600k', 'formatrica'),
                    __('Above $600k', 'formatrica'),
                ],
            },
            {
                type: 'checkbox',
                name: 'schedule_viewing',
                label: __(
                    "I'd like to schedule a property viewing",
                    'formatrica'
                ),
                required: false,
            },
            {
                type: 'textarea',
                name: 'message',
                label: __('Additional Details', 'formatrica'),
                required: false,
                placeholder: __(
                    'Share property interests or questions',
                    'formatrica'
                ),
            },
            {
                type: 'button',
                label: __('Send Inquiry', 'formatrica'),
            },
        ],
    },
    {
        id: 'course-registration',
        icon: 'bookmark-question',
        name: __('Course Registration', 'formatrica'),
        description: __(
            'Enroll students in courses with experience level',
            'formatrica'
        ),
        fields: [
            {
                type: 'text',
                name: 'student_name',
                label: __('Student Name', 'formatrica'),
                required: true,
            },
            {
                type: 'email',
                name: 'email',
                label: __('Email Address', 'formatrica'),
                required: true,
            },
            {
                type: 'date',
                name: 'birth_date',
                label: __('Date of Birth', 'formatrica'),
                required: true,
            },
            {
                type: 'select',
                name: 'course',
                label: __('Select Course', 'formatrica'),
                required: true,
                options: [
                    __('Web Development Basics', 'formatrica'),
                    __('Advanced JavaScript', 'formatrica'),
                    __('UI/UX Design', 'formatrica'),
                ],
            },
            {
                type: 'radio',
                name: 'experience_level',
                label: __('Experience Level', 'formatrica'),
                required: true,
                options: [
                    __('Beginner', 'formatrica'),
                    __('Intermediate', 'formatrica'),
                    __('Advanced', 'formatrica'),
                ],
            },
            {
                type: 'checkbox',
                name: 'terms',
                label: __(
                    "I agree to the <a href='#'>terms</a> and conditions",
                    'formatrica'
                ),
                required: true,
            },
            {
                type: 'button',
                label: __('Register Now', 'formatrica'),
            },
        ],
    },
    {
        id: 'event-registration',
        icon: 'speakerphone',
        name: __('Event Registration', 'formatrica'),
        description: __(
            'Collect attendee details and ticket choices',
            'formatrica'
        ),
        fields: [
            {
                type: 'text',
                name: 'attendee_name',
                label: __('Full Name', 'formatrica'),
                required: true,
            },
            {
                type: 'email',
                name: 'email',
                label: __('Email Address', 'formatrica'),
                required: true,
            },
            {
                type: 'tel',
                name: 'phone',
                label: __('Phone Number', 'formatrica'),
                required: false,
            },
            {
                type: 'text',
                name: 'company',
                label: __('Company/Organization', 'formatrica'),
                required: false,
            },
            {
                type: 'select',
                name: 'ticket_type',
                label: __('Ticket Type', 'formatrica'),
                required: true,
                options: [
                    __('General Admission', 'formatrica'),
                    __('VIP Pass', 'formatrica'),
                    __('Student Discount', 'formatrica'),
                ],
            },
            {
                type: 'select',
                name: 'guests',
                label: __('Number of Guests', 'formatrica'),
                required: true,
                options: ['1', '2', '3', '4', '5'],
            },
            {
                type: 'select',
                name: 'dietary_restrictions',
                label: __('Dietary Restrictions', 'formatrica'),
                required: false,
                multiple: true,
                options: [
                    __('Vegetarian', 'formatrica'),
                    __('Vegan', 'formatrica'),
                    __('Gluten-free', 'formatrica'),
                    __('Dairy-free', 'formatrica'),
                ],
            },
            {
                type: 'textarea',
                name: 'special_requirements',
                label: __('Special Requirements', 'formatrica'),
                required: false,
                placeholder: __(
                    'Accessibility needs, allergies, etc.',
                    'formatrica'
                ),
            },
            {
                type: 'button',
                label: __('Complete Registration', 'formatrica'),
            },
        ],
    },
    {
        id: 'customer-feedback',
        icon: 'mail-heart',
        name: __('Customer Feedback', 'formatrica'),
        description: __(
            'Gather satisfaction scores and open comments',
            'formatrica'
        ),
        fields: [
            {
                type: 'text',
                name: 'name',
                label: __('Your Name (Optional)', 'formatrica'),
                required: false,
            },
            {
                type: 'email',
                name: 'email',
                label: __('Email (Optional)', 'formatrica'),
                required: false,
            },
            {
                type: 'select',
                name: 'rating',
                label: __('Overall Satisfaction', 'formatrica'),
                required: true,
                options: [
                    __('5 - Excellent', 'formatrica'),
                    __('4 - Good', 'formatrica'),
                    __('3 - Average', 'formatrica'),
                    __('2 - Below Average', 'formatrica'),
                    __('1 - Poor', 'formatrica'),
                ],
            },
            {
                type: 'textarea',
                name: 'what_liked',
                label: __('What did you like most?', 'formatrica'),
                required: false,
            },
            {
                type: 'textarea',
                name: 'improvements',
                label: __('What could we improve?', 'formatrica'),
                required: false,
            },
            {
                type: 'checkbox',
                name: 'recommend',
                label: __(
                    'Would you recommend us to others?',
                    'formatrica'
                ),
                required: false,
            },
            {
                type: 'button',
                label: __('Send Feedback', 'formatrica'),
            },
        ],
    },
    {
        id: 'support-ticket',
        icon: 'help-circle',
        name: __('Support Ticket', 'formatrica'),
        description: __(
            'Collect priority, category, and attachments',
            'formatrica'
        ),
        fields: [
            {
                type: 'text',
                name: 'name',
                label: __('Your Name', 'formatrica'),
                required: true,
            },
            {
                type: 'email',
                name: 'email',
                label: __('Email Address', 'formatrica'),
                required: true,
            },
            {
                type: 'text',
                name: 'order_number',
                label: __('Order/Account Number', 'formatrica'),
                required: false,
            },
            {
                type: 'select',
                name: 'priority',
                label: __('Priority Level', 'formatrica'),
                required: true,
                options: [
                    __('Low - General Question', 'formatrica'),
                    __('Medium - Issue Affecting Work', 'formatrica'),
                    __('High - Service Down', 'formatrica'),
                    __('Critical - Complete Outage', 'formatrica'),
                ],
            },
            {
                type: 'select',
                name: 'category',
                label: __('Issue Category', 'formatrica'),
                required: true,
                options: [
                    __('Technical Issue', 'formatrica'),
                    __('Billing Question', 'formatrica'),
                    __('Feature Request', 'formatrica'),
                    __('Bug Report', 'formatrica'),
                ],
            },
            {
                type: 'textarea',
                name: 'issue_description',
                label: __('Describe the Issue', 'formatrica'),
                required: true,
                placeholder: __(
                    'Please provide as much detail as possible...',
                    'formatrica'
                ),
            },
            {
                type: 'file',
                name: 'screenshot',
                label: __(
                    'Attachment (Screenshot, logs, etc.)',
                    'formatrica'
                ),
                required: false,
                accept: '.jpg,.png,.pdf,.txt,.log',
                maxFileSize: 10,
            },
            {
                type: 'button',
                label: __('Submit Ticket', 'formatrica'),
            },
        ],
    },
    {
        id: 'post-submission',
        icon: 'article',
        name: __('Front-end Post Submission', 'formatrica'),
        description: __(
            'Collect user-generated content for review before publishing.',
            'formatrica'
        ),
        fields: [
            {
                type: 'text',
                name: 'post_title',
                label: __('Post Title', 'formatrica'),
                required: true,
                placeholder: __('Give your post a headline', 'formatrica'),
            },
            {
                type: 'textarea',
                name: 'post_content',
                label: __('Post Content', 'formatrica'),
                required: true,
                placeholder: __(
                    'Share the full story. Markdown or plain text is welcome.',
                    'formatrica'
                ),
            },
            {
                type: 'file',
                name: 'featured_image',
                label: __('Featured Image', 'formatrica'),
                required: false,
                accept: 'image/jpeg,image/png,image/webp',
                maxFileSize: 5,
            },
            {
                type: 'select',
                name: 'categories',
                label: __('Categories', 'formatrica'),
                required: false,
                multiple: true,
                options: [
                    __('Announcements', 'formatrica'),
                    __('Events', 'formatrica'),
                    __('Guides', 'formatrica'),
                    __('Opinion', 'formatrica'),
                ],
            },
            {
                type: 'text',
                name: 'tags',
                label: __('Tags', 'formatrica'),
                required: false,
                placeholder: __('Separate tags with commas', 'formatrica'),
            },
            {
                type: 'textarea',
                name: 'excerpt',
                label: __('Excerpt (Optional)', 'formatrica'),
                required: false,
                placeholder: __(
                    'Short summary used in listings.',
                    'formatrica'
                ),
            },
            {
                type: 'textarea',
                name: 'custom_fields',
                label: __('Custom Fields', 'formatrica'),
                required: false,
                placeholder: __(
                    'Add meta data using key=value pairs, one per line.',
                    'formatrica'
                ),
            },
            {
                type: 'radio',
                name: 'author_handling',
                label: __('Author Attribution', 'formatrica'),
                required: true,
                options: [
                    __('Use the logged-in submitter', 'formatrica'),
                    __(
                        'Store as anonymous / editorial team submission',
                        'formatrica'
                    ),
                ],
            },
            {
                type: 'checkbox',
                name: 'content_guidelines',
                label: __(
                    'I confirm this content follows the community guidelines.',
                    'formatrica'
                ),
                required: true,
            },
            {
                type: 'button',
                label: __('Submit Post for Review', 'formatrica'),
            },
        ],
        options: {
            success_message: __(
                'Thanks for the submission! Our editors will review it shortly.',
                'formatrica'
            ),
        },
    },
    {
        id: 'quote-request',
        icon: 'bookmark-question',
        name: __('Request a Quote', 'formatrica'),
        description: __(
            'Capture project requirements, timeline, and budget for B2B inquiries.',
            'formatrica'
        ),
        fields: [
            {
                type: 'text',
                name: 'contact_name',
                label: __('Full Name', 'formatrica'),
                required: true,
            },
            {
                type: 'email',
                name: 'email',
                label: __('Business Email', 'formatrica'),
                required: true,
            },
            {
                type: 'tel',
                name: 'phone',
                label: __('Phone Number', 'formatrica'),
                required: false,
            },
            {
                type: 'text',
                name: 'company',
                label: __('Company Name', 'formatrica'),
                required: true,
            },
            {
                type: 'select',
                name: 'project_type',
                label: __('Project Type', 'formatrica'),
                required: true,
                options: [
                    __('Website Design & Build', 'formatrica'),
                    __('Application Development', 'formatrica'),
                    __('Marketing Campaign', 'formatrica'),
                    __('Consulting / Strategy', 'formatrica'),
                    __('Other (describe below)', 'formatrica'),
                ],
            },
            {
                type: 'select',
                name: 'budget_range',
                label: __('Estimated Budget', 'formatrica'),
                required: true,
                options: [
                    __('Under $5,000', 'formatrica'),
                    __('$5,000 - $10,000', 'formatrica'),
                    __('$10,000 - $25,000', 'formatrica'),
                    __('$25,000+', 'formatrica'),
                ],
            },
            {
                type: 'select',
                name: 'timeline',
                label: __('Preferred Timeline', 'formatrica'),
                required: true,
                options: [
                    __('Immediately', 'formatrica'),
                    __('Within 1-3 months', 'formatrica'),
                    __('Within 3-6 months', 'formatrica'),
                    __('Flexible / Not sure', 'formatrica'),
                ],
            },
            {
                type: 'textarea',
                name: 'project_summary',
                label: __('Project Summary', 'formatrica'),
                required: true,
                placeholder: __(
                    'Tell us about goals, audience, scope, and success criteria.',
                    'formatrica'
                ),
            },
            {
                type: 'file',
                name: 'requirements_document',
                label: __('Upload Requirements (Optional)', 'formatrica'),
                required: false,
                accept: 'application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document',
                maxFileSize: 10,
            },
            {
                type: 'checkbox',
                name: 'consent_follow_up',
                label: __(
                    'I agree to be contacted with a tailored proposal.',
                    'formatrica'
                ),
                required: true,
            },
            {
                type: 'button',
                label: __('Request My Quote', 'formatrica'),
            },
        ],
        options: {
            success_message: __(
                'Thanks! Our team will review the details and reach out with next steps.',
                'formatrica'
            ),
        },
    },
    {
        id: 'rsvp-basic',
        icon: 'calendar-stats',
        name: __('RSVP Response', 'formatrica'),
        description: __(
            'Quick attendance form with guest count and dietary notes.',
            'formatrica'
        ),
        fields: [
            {
                type: 'text',
                name: 'attendee_name',
                label: __('Name', 'formatrica'),
                required: true,
            },
            {
                type: 'email',
                name: 'attendee_email',
                label: __('Email Address', 'formatrica'),
                required: true,
            },
            {
                type: 'radio',
                name: 'attending',
                label: __('Will you attend?', 'formatrica'),
                required: true,
                options: [
                    __('Yes, I will be there', 'formatrica'),
                    __("No, I can't make it", 'formatrica'),
                ],
            },
            {
                type: 'select',
                name: 'guest_count',
                label: __('Number of Guests (including you)', 'formatrica'),
                required: true,
                options: ['0', '1', '2', '3', '4', '5'],
            },
            {
                type: 'textarea',
                name: 'dietary_notes',
                label: __('Dietary Needs or Notes', 'formatrica'),
                required: false,
                placeholder: __(
                    'Let us know about allergies or accessibility requirements.',
                    'formatrica'
                ),
            },
            {
                type: 'button',
                label: __('Send RSVP', 'formatrica'),
            },
        ],
        options: {
            success_message: __(
                "Thanks for the update! We'll save your spot and be in touch with details.",
                'formatrica'
            ),
        },
    },
    {
        id: 'volunteer-signup',
        icon: 'hand-grab',
        name: __('Volunteer Signup', 'formatrica'),
        description: __(
            'Gather availability, interests, and consent for background checks.',
            'formatrica'
        ),
        fields: [
            {
                type: 'text',
                name: 'volunteer_name',
                label: __('Full Name', 'formatrica'),
                required: true,
            },
            {
                type: 'email',
                name: 'volunteer_email',
                label: __('Email Address', 'formatrica'),
                required: true,
            },
            {
                type: 'tel',
                name: 'volunteer_phone',
                label: __('Phone Number', 'formatrica'),
                required: false,
            },
            {
                type: 'select',
                name: 'availability',
                label: __('Availability', 'formatrica'),
                required: true,
                multiple: true,
                options: [
                    __('Weekday Mornings', 'formatrica'),
                    __('Weekday Afternoons', 'formatrica'),
                    __('Weekday Evenings', 'formatrica'),
                    __('Weekends', 'formatrica'),
                    __('On-call for special events', 'formatrica'),
                ],
            },
            {
                type: 'select',
                name: 'interests',
                label: __('Volunteer Interests', 'formatrica'),
                required: true,
                multiple: true,
                options: [
                    __('Event Support', 'formatrica'),
                    __('Fundraising & Outreach', 'formatrica'),
                    __('Administrative Help', 'formatrica'),
                    __('Mentoring / Education', 'formatrica'),
                    __('Community Service Projects', 'formatrica'),
                ],
            },
            {
                type: 'textarea',
                name: 'skills',
                label: __('Relevant Skills or Experience', 'formatrica'),
                required: false,
            },
            {
                type: 'checkbox',
                name: 'background_check_consent',
                label: __(
                    'I consent to a background check if required.',
                    'formatrica'
                ),
                required: true,
            },
            {
                type: 'select',
                name: 'tshirt_size',
                label: __('T-Shirt Size', 'formatrica'),
                required: true,
                options: ['XS', 'S', 'M', 'L', 'XL', '2XL'],
            },
            {
                type: 'textarea',
                name: 'additional_notes',
                label: __('Anything else we should know?', 'formatrica'),
                required: false,
            },
            {
                type: 'button',
                label: __('Sign Up to Volunteer', 'formatrica'),
            },
        ],
        options: {
            success_message: __(
                'Thank you! Our volunteer coordinator will follow up with next steps soon.',
                'formatrica'
            ),
        },
    },
    {
        id: 'user-registration',
        icon: 'user-plus',
        name: __('User Registration', 'formatrica'),
        description: __(
            'Collect details to create a site account',
            'formatrica'
        ),
        formType: 'user_registration',
        fields: [
            {
                type: 'text',
                name: 'username',
                label: __('Username', 'formatrica'),
                required: true,
                placeholder: __('Choose a username', 'formatrica'),
            },
            {
                type: 'email',
                name: 'email',
                label: __('Email Address', 'formatrica'),
                required: true,
            },
            {
                type: 'password',
                name: 'password',
                label: __('Password', 'formatrica'),
                required: true,
                placeholder: __('Create a password', 'formatrica'),
            },
            {
                type: 'checkbox',
                name: 'terms',
                label: __(
                    "I accept the <a href='#'>terms</a> of service",
                    'formatrica'
                ),
                required: true,
            },
            {
                type: 'button',
                label: __('Create Account', 'formatrica'),
            },
        ],
        options: {
            form_type: 'user_registration',
            send_email: false,
            store_submissions: false,
            success_message: __(
                'Registration successful! Please check your email to confirm your account.',
                'formatrica'
            ),
        },
    },
    {
        id: 'woocommerce-product-order',
        icon: 'shopping-cart',
        name: __('Product Order Form', 'formatrica'),
        description: __(
            'Collect customer and billing details for WooCommerce orders. Configure products in WooCommerce integration settings.',
            'formatrica'
        ),
        fields: [
            {
                type: 'text',
                name: 'first_name',
                label: __('First Name', 'formatrica'),
                required: true,
            },
            {
                type: 'text',
                name: 'last_name',
                label: __('Last Name', 'formatrica'),
                required: true,
            },
            {
                type: 'email',
                name: 'email',
                label: __('Email Address', 'formatrica'),
                required: true,
            },
            {
                type: 'tel',
                name: 'phone',
                label: __('Phone Number', 'formatrica'),
                required: true,
            },
            {
                type: 'text',
                name: 'billing_address',
                label: __('Street Address', 'formatrica'),
                required: true,
            },
            {
                type: 'text',
                name: 'billing_city',
                label: __('City', 'formatrica'),
                required: true,
            },
            {
                type: 'country',
                name: 'billing_country',
                label: __('Country', 'formatrica'),
                required: true,
                placeholder: __('Select a country', 'formatrica'),
                woocommerce_mode: 'shipping',
            },
            {
                type: 'state',
                name: 'billing_state',
                label: __('State / Province', 'formatrica'),
                required: true,
                placeholder: __('Select a state', 'formatrica'),
                country_field: 'billing_country',
                allow_text_input: true,
            },
            {
                type: 'text',
                name: 'billing_postcode',
                label: __('Postal Code', 'formatrica'),
                required: true,
            },
            {
                type: 'textarea',
                name: 'order_notes',
                label: __('Order Notes (Optional)', 'formatrica'),
                required: false,
                placeholder: __(
                    'Any special instructions for your order',
                    'formatrica'
                ),
            },
            {
                type: 'checkbox',
                name: 'terms',
                label: __(
                    "I agree to the <a href='#'>terms and conditions</a>",
                    'formatrica'
                ),
                required: true,
            },
            {
                type: 'button',
                label: __('Place Order', 'formatrica'),
            },
        ],
        options: {
            success_message: __(
                'Thank you! Your order has been received. We will contact you shortly.',
                'formatrica'
            ),
        },
    },
    {
        id: 'woocommerce-custom-product',
        icon: 'truck-loading',
        name: __('Custom Product Request', 'formatrica'),
        description: __(
            'Custom product order with specifications for WooCommerce. Configure products in integration settings.',
            'formatrica'
        ),
        fields: [
            {
                type: 'text',
                name: 'first_name',
                label: __('First Name', 'formatrica'),
                required: true,
            },
            {
                type: 'text',
                name: 'last_name',
                label: __('Last Name', 'formatrica'),
                required: true,
            },
            {
                type: 'email',
                name: 'email',
                label: __('Email Address', 'formatrica'),
                required: true,
            },
            {
                type: 'tel',
                name: 'phone',
                label: __('Phone Number', 'formatrica'),
                required: true,
            },
            {
                type: 'text',
                name: 'company',
                label: __('Company Name (Optional)', 'formatrica'),
                required: false,
            },
            {
                type: 'select',
                name: 'product_category',
                label: __('Product Category', 'formatrica'),
                required: true,
                options: [
                    __('Custom T-Shirts', 'formatrica'),
                    __('Personalized Mugs', 'formatrica'),
                    __('Custom Posters', 'formatrica'),
                    __('Other (describe below)', 'formatrica'),
                ],
            },
            {
                type: 'textarea',
                name: 'specifications',
                label: __('Product Specifications', 'formatrica'),
                required: true,
                placeholder: __(
                    'Describe your custom product: size, color, design preferences, quantity needed, etc.',
                    'formatrica'
                ),
            },
            {
                type: 'file',
                name: 'design_file',
                label: __('Upload Design/Reference (Optional)', 'formatrica'),
                required: false,
                accept: 'image/jpeg,image/png,image/gif,application/pdf',
                maxFileSize: 10,
            },
            {
                type: 'text',
                name: 'billing_address',
                label: __('Street Address', 'formatrica'),
                required: true,
            },
            {
                type: 'text',
                name: 'billing_city',
                label: __('City', 'formatrica'),
                required: true,
            },
            {
                type: 'country',
                name: 'billing_country',
                label: __('Country', 'formatrica'),
                required: true,
                placeholder: __('Select a country', 'formatrica'),
                woocommerce_mode: 'shipping',
            },
            {
                type: 'state',
                name: 'billing_state',
                label: __('State / Province', 'formatrica'),
                required: true,
                placeholder: __('Select a state', 'formatrica'),
                country_field: 'billing_country',
                allow_text_input: true,
            },
            {
                type: 'text',
                name: 'billing_postcode',
                label: __('Postal Code', 'formatrica'),
                required: true,
            },
            {
                type: 'date',
                name: 'delivery_date',
                label: __('Desired Delivery Date', 'formatrica'),
                required: false,
            },
            {
                type: 'textarea',
                name: 'special_instructions',
                label: __('Special Instructions', 'formatrica'),
                required: false,
                placeholder: __(
                    'Any additional notes or requirements',
                    'formatrica'
                ),
            },
            {
                type: 'checkbox',
                name: 'quote_approval',
                label: __(
                    'I understand that I will receive a quote before processing',
                    'formatrica'
                ),
                required: true,
            },
            {
                type: 'button',
                label: __('Submit Custom Order Request', 'formatrica'),
            },
        ],
        options: {
            success_message: __(
                'Thank you! We received your custom product request. Our team will review it and send you a quote within 24 hours.',
                'formatrica'
            ),
        },
    },
    {
        id: 'membership-application',
        icon: 'user-heart',
        name: __('Membership Application', 'formatrica'),
        description: __(
            'Apply to join an organization or membership program',
            'formatrica'
        ),
        fields: [
            {
                type: 'text',
                name: 'full_name',
                label: __('Full Name', 'formatrica'),
                required: true,
            },
            {
                type: 'email',
                name: 'email',
                label: __('Email Address', 'formatrica'),
                placeholder: __('you@example.com', 'formatrica'),
                required: true,
            },
            {
                type: 'tel',
                name: 'phone',
                label: __('Phone Number', 'formatrica'),
                required: false,
            },
            {
                type: 'date',
                name: 'date_of_birth',
                label: __('Date of Birth', 'formatrica'),
                required: false,
            },
            {
                type: 'select',
                name: 'membership_type',
                label: __('Membership Type', 'formatrica'),
                required: true,
                options: [
                    __('Individual', 'formatrica'),
                    __('Family', 'formatrica'),
                    __('Student', 'formatrica'),
                    __('Corporate', 'formatrica'),
                ],
            },
            {
                type: 'textarea',
                name: 'address',
                label: __('Mailing Address', 'formatrica'),
                required: false,
            },
            {
                type: 'textarea',
                name: 'reason',
                label: __('Why do you want to join?', 'formatrica'),
                required: false,
            },
            {
                type: 'checkbox',
                name: 'agree_terms',
                label: __(
                    'I agree to the membership terms and code of conduct',
                    'formatrica'
                ),
                required: true,
            },
            {
                type: 'button',
                label: __('Submit Application', 'formatrica'),
            },
        ],
        options: {
            success_message: __(
                'Thank you for applying! We will review your application and be in touch soon.',
                'formatrica'
            ),
        },
    },
    {
        id: 'gdpr-data-request',
        icon: 'cookie-off',
        name: __('GDPR Data Subject Request', 'formatrica'),
        description: __(
            'Let people exercise their data rights: access, correction, erasure, and more',
            'formatrica'
        ),
        fields: [
            {
                type: 'text',
                name: 'full_name',
                label: __('Full Name', 'formatrica'),
                required: true,
            },
            {
                type: 'email',
                name: 'email',
                label: __('Email Address on File', 'formatrica'),
                placeholder: __('you@example.com', 'formatrica'),
                required: true,
            },
            {
                type: 'select',
                name: 'request_type',
                label: __('Type of Request', 'formatrica'),
                required: true,
                options: [
                    __('Access my data', 'formatrica'),
                    __('Rectify (correct) my data', 'formatrica'),
                    __('Erase my data', 'formatrica'),
                    __('Restrict processing', 'formatrica'),
                    __('Data portability', 'formatrica'),
                    __('Object to processing', 'formatrica'),
                ],
            },
            {
                type: 'textarea',
                name: 'details',
                label: __('Details of your request', 'formatrica'),
                placeholder: __(
                    'Describe what data or action your request concerns…',
                    'formatrica'
                ),
                required: false,
            },
            {
                type: 'checkbox',
                name: 'identity_confirmation',
                label: __(
                    'I confirm I am the data subject or an authorized representative',
                    'formatrica'
                ),
                required: true,
            },
            {
                type: 'checkbox',
                name: 'processing_consent',
                label: __(
                    'I understand this request will be handled in line with the privacy policy',
                    'formatrica'
                ),
                required: true,
            },
            {
                type: 'button',
                label: __('Submit Request', 'formatrica'),
            },
        ],
        options: {
            success_message: __(
                'Your data request has been received. We will respond within the legally required timeframe (usually 30 days).',
                'formatrica'
            ),
        },
    },
];

// Edition template registry (Phase 7 — plan §9.2): the Free list registers
// here; the Pro entrypoint appends its own list from src/admin-pro/templates,
// so Pro template data (fields, payment options) is absent from the Free
// bundle AND the Free-shipped readable source.
const REGISTERED_TEMPLATES = [...FREE_TEMPLATES];

/** @param {Array<object>} list extra templates appended by an edition entrypoint. */
export function registerFormTemplates(list) {
    REGISTERED_TEMPLATES.push(...(list || []));
}

/** Registration-ordered template list for this edition. */
export function formTemplates() {
    return REGISTERED_TEMPLATES;
}
