AI Sales Script Generator
Run ID: 69caf66a26e01bf7c6786d082026-03-30Business
PantheraHive BOS
BOS Dashboard

Generate conversion-optimized sales scripts for cold calls, demos, follow-ups, and objection handling with industry-specific language.

Marketing Strategy for AI Sales Script Generator

This document outlines a comprehensive marketing strategy for the "AI Sales Script Generator," designed to generate conversion-optimized sales scripts for cold calls, demos, follow-ups, and objection handling with industry-specific language. The strategy encompasses target audience analysis, channel recommendations, a messaging framework, and key performance indicators (KPIs) to measure success.


1. Target Audience Analysis

Understanding who benefits most from the AI Sales Script Generator is crucial for effective marketing. We've identified primary and secondary audiences, along with their key characteristics and pain points.

1.1 Primary Audience: Sales Leadership & Enablement

  • Job Titles: VP of Sales, Sales Director, Sales Manager, Head of Sales Enablement, Training Manager, Business Owner (SMBs with sales teams).
  • Company Size/Type: Mid-market to Enterprise B2B companies, High-growth tech startups, SaaS companies, and SMBs focused on scaling sales operations. Industries prioritizing structured sales processes (e.g., tech, finance, healthcare, professional services).
  • Demographics: Typically 30-55 years old, experienced in sales management, digitally savvy, and comfortable adopting new technologies.
  • Psychographics:

* Goal-Oriented: Driven by revenue targets, conversion rates, and sales team performance.

* Efficiency Seekers: Constantly looking for tools and processes to streamline operations and reduce manual effort.

* Data-Driven: Value insights and measurable improvements in sales outcomes.

* Growth Minded: Focused on scaling sales teams and expanding market reach.

* Innovation Adopters: Open to leveraging AI and automation for competitive advantage.

  • Pain Points:

* Inconsistent Messaging: Sales reps using varied and often ineffective scripts, leading to poor brand perception and lower conversion rates.

* High Sales Rep Ramp-Up Time: Long onboarding periods for new hires due to extensive script training and lack of readily available, effective resources.

* Ineffective Objection Handling: Reps struggling to confidently address common and complex buyer objections.

* Time-Consuming Script Creation: Managers or enablement teams spending excessive time drafting, reviewing, and updating sales scripts.

* Lack of Personalization at Scale: Difficulty in creating truly industry-specific or persona-tailored scripts for a large team.

* Difficulty in A/B Testing & Optimization: No systematic way to test and optimize script performance.

  • Needs:

* Standardized, high-performing sales scripts across the team.

* Tools to significantly reduce sales rep onboarding and training time.

* A reliable solution for dynamic and effective objection handling.

* Automation for script generation and updates.

* Customization capabilities for industry-specific language and buyer personas.

* Data-driven insights for script optimization.

1.2 Secondary Audience: Individual Sales Representatives

  • Job Titles: Account Executive, Sales Development Representative (SDR), Business Development Representative (BDR), Inside Sales Rep.
  • Psychographics: Ambitious, performance-driven, looking for tools to improve their personal sales effectiveness, confident in using technology.
  • Pain Points:

* Struggling to craft compelling opening lines for cold outreach.

* Feeling unprepared for calls or demos.

* Difficulty articulating value propositions clearly and concisely.

* Lack of confidence in handling tough objections.

* Spending too much time researching and drafting messages instead of selling.

  • Needs:

* Ready-to-use, effective scripts for various scenarios.

* Quick access to objection handling playbooks.

* Tools that boost confidence and professionalism on calls.

* Personalized content suggestions to resonate with prospects.


2. Channel Recommendations

To effectively reach our target audience, a multi-channel approach focusing on where sales professionals and leaders congregate and seek solutions is essential.

2.1 Digital Marketing Channels

  • Content Marketing & SEO:

* Strategy: Create high-value, problem-solving content that addresses the pain points of sales leaders and reps. Optimize for search engines to capture organic traffic.

* Content Types:

* Blog Posts: "5 Ways AI is Revolutionizing Sales Scripts," "How to Reduce Sales Rep Ramp-Up Time by 30%," "Mastering Cold Calls: The AI Advantage."

* Whitepapers/Ebooks: "The Definitive Guide to AI-Powered Sales Enablement," "ROI of Automated Sales Script Generation."

* Case Studies: Showcase success stories from early adopters, highlighting quantifiable results (e.g., "Company X Increased Conversion Rates by 20% with AI Scripts").

* Templates/Checklists: Offer downloadable sales script templates (e.g., "Cold Call Script Template for SaaS Sales") as lead magnets.

* Keywords: "AI sales script generator," "sales script software," "cold call script AI," "objection handling AI," "sales enablement tools," "sales productivity software."

  • Paid Advertising (SEM & Social):

* Google Ads (Search Engine Marketing): Target high-intent commercial keywords (e.g., "buy sales script generator," "sales script automation platform," "AI for sales teams"). Use remarketing campaigns for website visitors.

* LinkedIn Ads: Ideal for targeting specific job titles (VP Sales, Sales Director, Sales Enablement Manager, Business Owner) within relevant industries and company sizes. Utilize lead gen forms to capture contact information directly.

* Facebook/Instagram Ads: Primarily for retargeting website visitors, nurturing existing leads, or creating lookalike audiences from high-value customer lists.

  • Email Marketing:

* Strategy: Nurture leads generated from content downloads, webinars, and demo requests. Segment lists based on persona and engagement level.

* Campaign Types:

* Welcome Series: Introduce the product, its benefits, and provide initial value.

* Lead Nurturing: Share educational content, case studies, and product feature highlights.

* Product Updates: Inform users about new features and improvements.

* Webinar/Event Invitations: Drive attendance to live or on-demand sessions.

  • Webinars & Online Demos:

* Strategy: Host regular live and on-demand webinars demonstrating the product's features, showcasing use cases, and discussing industry trends. Offer interactive Q&A sessions.

* Topics: "Live Demo: Generate Your First AI Sales Script in 5 Minutes," "How AI Can Solve Your Sales Consistency Challenges," "Advanced Objection Handling with Intelligent Scripts."

  • Social Media Marketing:

* LinkedIn: Primary platform for thought leadership, sharing industry insights, product updates, and engaging with sales professionals. Use short video demos, infographics, and polls.

* Twitter: Share quick tips, industry news, and engage in relevant conversations using hashtags like #SalesTech, #AISales, #SalesEnablement.

2.2 Strategic Partnerships & Integrations

gemini Output

AI Sales Script Generator: Conversion-Optimized Sales Scripts

This document provides a comprehensive set of conversion-optimized sales scripts designed to elevate your sales interactions across various stages of the customer journey. Leveraging industry-specific language for AI and technology solutions, these scripts are crafted to engage prospects, articulate value, handle objections, and drive conversions.


1. Introduction: The Power of Optimized Scripts

In today's competitive landscape, generic sales pitches fall flat. This guide equips your sales team with dynamic, intelligent scripts for cold calls, product demos, follow-ups, and objection handling. Each script is engineered to be:

  • Conversion-Optimized: Focused on guiding the prospect towards a clear next step.
  • Value-Driven: Highlighting benefits and solutions, not just features.
  • Industry-Specific: Using language resonant with the AI/tech sector.
  • Adaptable: Providing a framework that can be personalized for each prospect.

2. Key Principles for Effective Sales Scripting

Before diving into the scripts, internalize these core principles for maximum impact:

  • Research & Personalize: Understand your prospect's company, role, challenges, and goals. Tailor your opening and value proposition accordingly.
  • Focus on the "Why": Explain why your solution matters to them, not just what it does.
  • Problem-Solution Framework: Clearly articulate a common pain point and position your AI solution as the ideal remedy.
  • Concise & Clear: Get to the point quickly and avoid jargon where possible.
  • Strong Call to Action (CTA): Every interaction should have a clear, easy-to-understand next step.
  • Active Listening: Be prepared to deviate from the script to address prospect questions and concerns genuinely.
  • Confidence & Authenticity: Deliver the script naturally, not robotically.

3. Cold Call Script: Initiating Engagement

Objective: To secure a brief discovery call or demo by sparking interest and demonstrating immediate value.

Target Product Example: An AI-powered Sales Enablement Platform (like an AI Sales Script Generator itself).

Key Elements:

  • Permission-Based Opening: Respect their time.
  • Personalized Hook: Connect with their company or role.
  • Problem Statement: Identify a common industry challenge.
  • Value Proposition: Briefly explain how your AI solution addresses it.
  • Benefit Statement: Focus on the tangible outcome for them.
  • Low-Commitment CTA: Offer a quick, easy next step.

Example Cold Call Script

(Sales Rep: [Your Name] from [Your Company Name] - selling an AI Sales Enablement Platform)

(Rep): "Hi [Prospect Name], this is [Your Name] from [Your Company Name]. I know I'm calling out of the blue, do you have about 30 seconds for me to explain why I reached out?"

(Prospect): "Sure, go ahead." / "What is this about?"

(Rep): "Great, thanks. I was doing some research and noticed [Prospect Company] is [Personalized Hook - e.g., rapidly expanding your sales team / focused on improving sales efficiency / investing in new tech solutions]. Many sales leaders in the AI/SaaS space like yourself are currently struggling with [Problem Statement - e.g., inconsistent messaging across a growing sales force, lengthy ramp-up times for new reps, or the challenge of rapidly updating scripts for new product features.]"

(Rep): "At [Your Company Name], we've developed an AI Sales Enablement Platform that leverages advanced generative AI to instantly create hyper-personalized, conversion-optimized sales scripts for any scenario – from cold calls to complex demos – ensuring your team always has the most effective messaging."

(Rep): "This means your sales reps can achieve [Benefit 1 - e.g., higher engagement rates], significantly [Benefit 2 - e.g., reduce their prep time], and ultimately [Benefit 3 - e.g., close more deals faster] by delivering consistent, high-impact conversations."

(Rep): "I'd love to show you how this could specifically impact [Prospect Company]'s sales performance in a quick, no-obligation 15-minute demo. Would [Day] at [Time] or [Day] at [Time] work best for you next week?"

(If they hesitate/object): "I understand you're busy, and this isn't a sales pitch. It's about exploring a proven way to boost your team's efficiency and revenue. Even a quick look can highlight potential gains."


4. Demo Script: Showcasing Value & Solutions

Objective: To effectively demonstrate how your AI solution solves the prospect's specific pain points and delivers tangible benefits, leading to deeper engagement or a proposal stage.

Target Product Example: An AI-powered Sales Enablement Platform.

Key Elements:

  • Confirmation of Needs: Reiterate their challenges.
  • Clear Agenda: Set expectations for the demo.
  • Problem Reinforcement: Remind them of the "why."
  • Feature-Benefit-Impact Walkthrough: Show, don't just tell.
  • Interactive Engagement: Ask questions, involve them.
  • Address Pain Points Directly: Connect features to their specific problems.
  • Strong Next Steps: Guide them to the next stage of the sales process.

Example Demo Script

(Sales Rep: [Your Name] from [Your Company Name] - selling an AI Sales Enablement Platform)

(Rep): "Welcome, [Prospect Name]! Thanks for taking the time today. Based on our previous conversation, I understand you're primarily looking to [Confirm Prospect's Primary Goal - e.g., standardize messaging across your growing sales team, reduce the time reps spend customizing scripts, and improve overall conversion rates]. Is that still accurate, or have there been any other priorities that have emerged?"

(Prospect): "Yes, that's spot on. Especially the consistency part."

(Rep): "Excellent. Today, I'll briefly walk you through how our AI Sales Enablement Platform directly addresses these challenges. We'll cover:

1. Automated Script Generation: How AI crafts tailored scripts in seconds.

2. Dynamic Content Integration: Ensuring accuracy and personalization with your product data.

3. Performance Analytics: Optimizing scripts for continuous improvement.

Then, we'll discuss how this fits into your current workflow and answer any questions. Sound good?"

(Prospect): "Sounds perfect."

(Rep): "Fantastic. Let's start with the core problem: traditional script writing is manual, time-consuming, and often leads to generic pitches that don't resonate. Our platform changes that.

[DEMO SEGMENT 1: Automated Script Generation - SHOW THE PLATFORM IN ACTION]

(Rep): "Here, you can see how easily a rep can input basic parameters – say, a specific product feature they want to highlight, the prospect's industry, and the call's objective. With a single click, our AI instantly generates a conversion-optimized script.

  • Feature: 'Notice how the AI uses natural language processing to understand the context and intent.'
  • Benefit: 'This means your reps no longer waste hours crafting scripts from scratch or searching for the right phrasing.'
  • Impact: 'They're always equipped with precise, compelling language, leading to more confident calls and better engagement.'

[Ask a question]: 'How much time do your reps currently spend preparing for calls, and how do you ensure their messaging is consistent?'"

**[DEMO SEGMENT 2: Dynamic Content Integration - SHOW HOW IT P

gemini Output

AI Sales Script Generator: Conversion-Optimized Scripts for B2B Sales Teams

This document provides a comprehensive suite of conversion-optimized sales scripts tailored for B2B sales teams, specifically focusing on the AI-powered CRM industry. These scripts are designed to guide your sales representatives through various stages of the sales cycle, from initial outreach to closing, while effectively addressing common objections.

Each script incorporates industry-specific language, a clear value proposition, and strategic calls to action to maximize engagement and drive conversions.


Core Principles for Script Effectiveness

Before diving into the scripts, it's crucial to understand the underlying principles that make them effective:

  • Customer-Centricity: Focus on the prospect's needs, challenges, and desired outcomes, not just your product features.
  • Value-Driven: Clearly articulate the unique benefits and ROI your AI-powered CRM offers.
  • Conciseness & Clarity: Get straight to the point, using clear, easy-to-understand language.
  • Confidence & Authority: Project expertise in your solution and its ability to solve specific problems.
  • Active Listening: While scripts provide structure, always be prepared to listen and adapt to the prospect's responses.
  • Personalization: Utilize placeholders [ ] to ensure each interaction feels tailored and relevant.

1. Cold Call Script: Initial Outreach & Discovery

Objective: To pique interest, qualify the prospect, and secure a follow-up meeting or a brief discovery call to discuss their challenges.

Target Industry Focus: AI-powered CRM for B2B Sales & Marketing Teams.


Script Variation 1: Problem-Focused Opener

(Ideal when you have a strong understanding of common industry pain points)

Rep: "Hi [Prospect Name], this is [Your Name] from [Your Company]. I know you're busy, so I'll be brief.

The reason for my call is that we're helping B2B sales teams like yours at [Prospect Company] to dramatically improve their sales forecasting accuracy and lead conversion rates, often by [mention a specific percentage or quantifiable result].

Many sales leaders I speak with are struggling with [mention a specific pain point, e.g., 'inconsistent lead qualification'] or [another pain point, e.g., 'manual data entry bogging down their reps']. Is this something you've encountered at [Prospect Company]?"

Prospect: [Responds]

Rep: "Understood. Our AI-powered CRM leverages predictive analytics and intelligent automation to address exactly those challenges, freeing up your reps to focus on selling and providing real-time insights into your pipeline.

Would you be open to a quick 15-minute chat sometime next week, say [Day] or [Day], to explore how we've helped companies similar to yours achieve [specific benefit, e.g., 'a 20% increase in deal velocity']?"

  • If Yes: "Great! What's the best email to send an invite to?"
  • If Hesitant: "I completely understand. Perhaps I could send you a brief, one-page overview demonstrating how our AI-driven lead scoring identifies high-potential prospects, saving your team significant time. Would that be helpful?"

Script Variation 2: Referral/Research-Based Opener

(Effective when you have a specific reason for calling)

Rep: "Good morning/afternoon [Prospect Name], [Your Name] here from [Your Company].

I was doing some research on [Prospect Company] and noticed [mention a specific trigger, e.g., 'your recent expansion into the EMEA market' or 'a LinkedIn post about your sales team's growth'].

We specialize in AI-powered CRM solutions that help B2B sales organizations like yours [connect your solution to their trigger, e.g., 'streamline international sales operations' or 'scale their sales processes efficiently without increasing headcount'].

I believe our platform's intelligent automation and predictive insights could be particularly beneficial for you in `[relate back to trigger, e.g., 'managing a rapidly growing global pipeline'].

Would you be open to a brief 10-minute conversation to see if there's a potential fit, perhaps on [Day] or [Day]?"

  • If Yes: "Excellent. What email address should I use for the calendar invite?"
  • If Objection (e.g., "Not interested"): "I hear you. Many of our clients initially felt that way until they saw how our AI-driven insights could turn their existing data into actionable revenue-generating strategies. Could I quickly share one key insight that might resonate with your current goals?"

Key Tips for Cold Calling:

  • Pace: Speak clearly and at a moderate pace.
  • Tone: Be confident, enthusiastic, and professional.
  • Listen: Pay attention to verbal cues and allow the prospect to speak.
  • Handle Gatekeepers: Be polite, confident, and ask for help to reach the right person.
  • Always have a clear next step.

2. Demo Scheduling / Discovery Call Script

Objective: To conduct a focused discovery of the prospect's needs and challenges, then transition to scheduling a full solution demonstration.

Target Industry Focus: AI-powered CRM for B2B Sales & Marketing Teams.


Rep: "Hi [Prospect Name], thanks for taking the time today. As discussed, the goal of this call is to understand your current sales processes and challenges, and then determine if our AI-powered CRM is a good fit to help you achieve your goals. Does that sound right?"

Prospect: [Confirms]

Rep: "Great. To start, could you tell me a bit about your current CRM solution, or how you currently manage your sales pipeline and customer interactions?"

Prospect: [Explains current situation]

Rep: "Thanks for sharing that. It sounds like [rephrase their key challenge, e.g., 'manual lead qualification is a significant bottleneck']. We often see that with companies using traditional CRMs.

How critical is it for your team to [connect to a key benefit, e.g., 'improve sales forecasting accuracy'] or [another benefit, e.g., 'automate routine sales tasks so reps can focus on revenue-generating activities']?"

Prospect: [Responds, elaborates on pain points]

Rep: "I appreciate you sharing those insights. Based on what you've told me about [specific pain points discussed], it sounds like our AI-powered CRM could be incredibly valuable, particularly with its [mention 1-2 key features related to their pain, e.g., 'predictive lead scoring engine' and 'intelligent workflow automation'].

These features are specifically designed to help B2B sales teams like yours `[reiterate benefit, e.g., 'prioritize the hottest leads, reduce manual busywork, and ultimately close more deals faster'].

Would you be open to a more in-depth, personalized demonstration of our platform, where we can show you exactly how it addresses [Prospect's specific challenge] and helps you achieve [Prospect's desired outcome]? We can block out [suggest time, e.g., '45 minutes'] next week. How does [Day], [Time] or [Day], [Time] look for you?"

  • If Yes: "Fantastic! I'll send over a calendar invite with a brief agenda. Before we wrap up, is there anyone else on your team who should be included in that demo, perhaps from sales operations or marketing?"
  • If Hesitant/Needs more info: "No problem at all. To help you decide, I can send you a short case study of a company similar to yours that achieved [specific quantifiable result] using our AI-driven insights. Would you prefer that via email?"

Key Tips for Demo Scheduling/Discovery:

  • Ask Open-Ended Questions: Encourage detailed responses beyond 'yes' or 'no'.
  • Listen Actively: Take notes and paraphrase to confirm understanding.
  • Connect Features to Benefits: Always explain how a feature solves their problem.
  • Qualify Thoroughly: Ensure they are a good fit before investing time in a demo.
  • Manage Expectations: Be clear about the demo's purpose and what they will see.

3. Follow-Up Script: Nurturing & Advancing the Sale

Objective: To maintain engagement, provide additional value, address lingering questions, and move the prospect closer to a decision.

Target Industry Focus: AI-powered CRM for B2B Sales & Marketing Teams.


Script Variation 1: Post-Discovery/Demo Follow-Up (Email)

Subject: Following Up: Your AI-Powered CRM Demo & Next Steps

Hi [Prospect Name],

It was a pleasure speaking with you/demonstrating our AI-powered CRM on [Date]. I truly enjoyed learning about your challenges with [mention 1-2 specific challenges discussed, e.g., 'inconsistent lead scoring and manual pipeline management'].

As we discussed, our platform's [mention 1-2 key features/benefits, e.g., 'predictive analytics and automated sales workflows'] are specifically designed to help B2B sales teams like yours [reiterate key outcome, e.g., 'optimize lead prioritization, accelerate deal cycles, and achieve more accurate revenue forecasts'].

To recap, here are the key areas where we believe our solution can deliver significant value for [Prospect Company]:

  • [Specific Benefit 1 related to their pain]
  • [Specific Benefit 2 related to their pain]
  • [Specific Benefit 3 related to their pain]

I’ve attached [mention relevant resource, e.g., 'the ROI calculator we discussed' or 'a concise data sheet highlighting our key AI capabilities'] for your reference.

Do you have any initial questions or thoughts since our last conversation? I'm happy to clarify anything.

What are your thoughts on next steps? Perhaps a quick 15-minute call to discuss your team's internal review, or to address any further questions you might have?

Best regards,

[Your Name]

[Your Title]

[Your Company]

[Your Phone Number]


Script Variation 2: Value-Add Follow-Up (Email/LinkedIn Message)

(When the prospect has gone quiet or you need to re-engage)

Subject: [Prospect Company] & [Relevant Industry Trend/News]

Hi [Prospect Name],

Hope you're having a productive week.

I was thinking about our previous conversation regarding [their specific challenge, e.g., 'the need for more accurate sales forecasting'] and came across [mention a relevant article, industry report, or news item, e.g., 'this recent report from Gartner on the impact of AI in sales'].

It highlights how [mention a key takeaway that relates to your solution, e.g., 'companies leveraging AI for lead scoring are seeing a 30% uplift in conversion rates within 6 months'].

This ties directly into how our AI-powered CRM helps organizations like yours [reiterate a key benefit, e.g., 'transform raw data into predictive insights, enabling your sales team to focus on high-potential opportunities and close deals more efficiently'].

Would you be open to a brief chat to discuss how these trends might impact [Prospect Company]'s sales strategy, and perhaps explore how our platform could specifically help you capitalize on them?

Let me know if you're available for a quick 10-minute call sometime next week.

Best regards,

[Your Name]


Key Tips for Follow-Ups:

  • Be Persistent, Not Annoying: Space out your follow-ups strategically.
  • Provide Value: Don't just "check in." Offer new insights, resources, or solutions.
  • Vary Your Medium: Mix emails, LinkedIn messages, and even quick calls.
  • Clear Call to Action: Always specify what you want them to do next.
  • Summarize Value: Remind them of the core problem you solve and the benefits.

4. Objection Handling Framework & Scripts

Objective: To confidently address prospect concerns, reframe their perspective, and guide them back towards the value proposition.


General Objection Handling Framework: "LAER"

  1. L - Listen: Fully understand the objection without interrupting.
  2. A - Acknowledge: Validate their concern. Show empathy. "I understand why you might feel that way," or "That's a fair point."
  3. E - Explore: Ask clarifying questions to uncover the root cause. "Could you tell me more about what concerns you about [objection]?"
  4. R - Respond: Address the objection directly, reframing if necessary, and re-emphasizing value.
  5. Reconfirm: "Does that make sense?" or "Does that address your concern?"

Common Objections & Responses (AI-Powered CRM Context)

Objection 1: "It's too expensive / We don't have the budget."

  • Acknowledge & Explore: "I completely understand budget is a critical consideration. Many of our clients initially express similar concerns. Could you tell me more about what you're currently budgeting for your sales tech stack, and what ROI you typically look for in new investments?"
  • Respond: "Our pricing is structured to reflect the significant ROI our AI-powered CRM delivers. When you consider the [mention quantifiable benefits, e.g., 'average 25% increase in lead conversion rates'], [mention another benefit, e.g., 'reduction in sales cycle time by 15%'], and [another benefit, e.g., 'elimination of manual data entry saving X hours per rep per week'], the investment quickly pays for itself. In fact, many clients see a full ROI within [X months].

Option A (Value-based):* "What would it mean for your business if you could accurately predict your quarterly revenue with 90% confidence, or if your sales reps gained an extra 5 hours a week for selling?"

Option B (Phased approach):* "We can also discuss a phased implementation plan or a scaled package to get you started, focusing on the most critical AI functionalities first."

  • Reconfirm: "Does that help put the investment into perspective?"

Objection 2: "We're happy with our current CRM / We're already using [Competitor Name]."

  • Acknowledge & Explore: "That's great to hear you have a system in place. Many companies have established CRMs. What specific functionalities of [Current/Competitor CRM] are most valuable to your team, and what, if anything, do you feel is missing or could be improved, particularly around leveraging AI for
ai_sales_script_generator.md
Download as Markdown
Copy all content
Full output as text
Download ZIP
IDE-ready project ZIP
Copy share link
Permanent URL for this run
Get Embed Code
Embed this result on any website
Print / Save PDF
Use browser print dialog
\n\n\n"); var hasSrcMain=Object.keys(extracted).some(function(k){return k.indexOf("src/main")>=0;}); if(!hasSrcMain) zip.file(folder+"src/main."+ext,"import React from 'react'\nimport ReactDOM from 'react-dom/client'\nimport App from './App'\nimport './index.css'\n\nReactDOM.createRoot(document.getElementById('root')!).render(\n \n \n \n)\n"); var hasSrcApp=Object.keys(extracted).some(function(k){return k==="src/App."+ext||k==="App."+ext;}); if(!hasSrcApp) zip.file(folder+"src/App."+ext,"import React from 'react'\nimport './App.css'\n\nfunction App(){\n return(\n
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n
\n )\n}\nexport default App\n"); zip.file(folder+"src/index.css","*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#f0f2f5;color:#1a1a2e}\n.app{min-height:100vh;display:flex;flex-direction:column}\n.app-header{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:40px}\nh1{font-size:2.5rem;font-weight:700}\n"); zip.file(folder+"src/App.css",""); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/pages/.gitkeep",""); zip.file(folder+"src/hooks/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\n## Open in IDE\nOpen the project folder in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Vue (Vite + Composition API + TypeScript) --- */ function buildVue(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "type": "module",\n "scripts": {\n "dev": "vite",\n "build": "vue-tsc -b && vite build",\n "preview": "vite preview"\n },\n "dependencies": {\n "vue": "^3.5.13",\n "vue-router": "^4.4.5",\n "pinia": "^2.3.0",\n "axios": "^1.7.9"\n },\n "devDependencies": {\n "@vitejs/plugin-vue": "^5.2.1",\n "typescript": "~5.7.3",\n "vite": "^6.0.5",\n "vue-tsc": "^2.2.0"\n }\n}\n'); zip.file(folder+"vite.config.ts","import { defineConfig } from 'vite'\nimport vue from '@vitejs/plugin-vue'\nimport { resolve } from 'path'\n\nexport default defineConfig({\n plugins: [vue()],\n resolve: { alias: { '@': resolve(__dirname,'src') } }\n})\n"); zip.file(folder+"tsconfig.json",'{"files":[],"references":[{"path":"./tsconfig.app.json"},{"path":"./tsconfig.node.json"}]}\n'); zip.file(folder+"tsconfig.app.json",'{\n "compilerOptions":{\n "target":"ES2020","useDefineForClassFields":true,"module":"ESNext","lib":["ES2020","DOM","DOM.Iterable"],\n "skipLibCheck":true,"moduleResolution":"bundler","allowImportingTsExtensions":true,\n "isolatedModules":true,"moduleDetection":"force","noEmit":true,"jsxImportSource":"vue",\n "strict":true,"paths":{"@/*":["./src/*"]}\n },\n "include":["src/**/*.ts","src/**/*.d.ts","src/**/*.tsx","src/**/*.vue"]\n}\n'); zip.file(folder+"env.d.ts","/// \n"); zip.file(folder+"index.html","\n\n\n \n \n "+slugTitle(pn)+"\n\n\n
\n \n\n\n"); var hasMain=Object.keys(extracted).some(function(k){return k==="src/main.ts"||k==="main.ts";}); if(!hasMain) zip.file(folder+"src/main.ts","import { createApp } from 'vue'\nimport { createPinia } from 'pinia'\nimport App from './App.vue'\nimport './assets/main.css'\n\nconst app = createApp(App)\napp.use(createPinia())\napp.mount('#app')\n"); var hasApp=Object.keys(extracted).some(function(k){return k.indexOf("App.vue")>=0;}); if(!hasApp) zip.file(folder+"src/App.vue","\n\n\n\n\n"); zip.file(folder+"src/assets/main.css","*{margin:0;padding:0;box-sizing:border-box}body{font-family:system-ui,sans-serif;background:#fff;color:#213547}\n"); zip.file(folder+"src/components/.gitkeep",""); zip.file(folder+"src/views/.gitkeep",""); zip.file(folder+"src/stores/.gitkeep",""); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nnpm run dev\n\`\`\`\n\n## Build\n\`\`\`bash\nnpm run build\n\`\`\`\n\nOpen in VS Code or WebStorm.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n"); } /* --- Angular (v19 standalone) --- */ function buildAngular(zip,folder,app,code,panelTxt){ var pn=pkgName(app); var C=cc(pn); var sel=pn.replace(/_/g,"-"); var extracted=extractCode(panelTxt); zip.file(folder+"package.json",'{\n "name": "'+pn+'",\n "version": "0.0.0",\n "scripts": {\n "ng": "ng",\n "start": "ng serve",\n "build": "ng build",\n "test": "ng test"\n },\n "dependencies": {\n "@angular/animations": "^19.0.0",\n "@angular/common": "^19.0.0",\n "@angular/compiler": "^19.0.0",\n "@angular/core": "^19.0.0",\n "@angular/forms": "^19.0.0",\n "@angular/platform-browser": "^19.0.0",\n "@angular/platform-browser-dynamic": "^19.0.0",\n "@angular/router": "^19.0.0",\n "rxjs": "~7.8.0",\n "tslib": "^2.3.0",\n "zone.js": "~0.15.0"\n },\n "devDependencies": {\n "@angular-devkit/build-angular": "^19.0.0",\n "@angular/cli": "^19.0.0",\n "@angular/compiler-cli": "^19.0.0",\n "typescript": "~5.6.0"\n }\n}\n'); zip.file(folder+"angular.json",'{\n "$schema": "./node_modules/@angular/cli/lib/config/schema.json",\n "version": 1,\n "newProjectRoot": "projects",\n "projects": {\n "'+pn+'": {\n "projectType": "application",\n "root": "",\n "sourceRoot": "src",\n "prefix": "app",\n "architect": {\n "build": {\n "builder": "@angular-devkit/build-angular:application",\n "options": {\n "outputPath": "dist/'+pn+'",\n "index": "src/index.html",\n "browser": "src/main.ts",\n "tsConfig": "tsconfig.app.json",\n "styles": ["src/styles.css"],\n "scripts": []\n }\n },\n "serve": {"builder":"@angular-devkit/build-angular:dev-server","configurations":{"production":{"buildTarget":"'+pn+':build:production"},"development":{"buildTarget":"'+pn+':build:development"}},"defaultConfiguration":"development"}\n }\n }\n }\n}\n'); zip.file(folder+"tsconfig.json",'{\n "compileOnSave": false,\n "compilerOptions": {"baseUrl":"./","outDir":"./dist/out-tsc","forceConsistentCasingInFileNames":true,"strict":true,"noImplicitOverride":true,"noPropertyAccessFromIndexSignature":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"paths":{"@/*":["src/*"]},"skipLibCheck":true,"esModuleInterop":true,"sourceMap":true,"declaration":false,"experimentalDecorators":true,"moduleResolution":"bundler","importHelpers":true,"target":"ES2022","module":"ES2022","useDefineForClassFields":false,"lib":["ES2022","dom"]},\n "references":[{"path":"./tsconfig.app.json"}]\n}\n'); zip.file(folder+"tsconfig.app.json",'{\n "extends":"./tsconfig.json",\n "compilerOptions":{"outDir":"./dist/out-tsc","types":[]},\n "files":["src/main.ts"],\n "include":["src/**/*.d.ts"]\n}\n'); zip.file(folder+"src/index.html","\n\n\n \n "+slugTitle(pn)+"\n \n \n \n\n\n \n\n\n"); zip.file(folder+"src/main.ts","import { bootstrapApplication } from '@angular/platform-browser';\nimport { appConfig } from './app/app.config';\nimport { AppComponent } from './app/app.component';\n\nbootstrapApplication(AppComponent, appConfig)\n .catch(err => console.error(err));\n"); zip.file(folder+"src/styles.css","* { margin: 0; padding: 0; box-sizing: border-box; }\nbody { font-family: system-ui, -apple-system, sans-serif; background: #f9fafb; color: #111827; }\n"); var hasComp=Object.keys(extracted).some(function(k){return k.indexOf("app.component")>=0;}); if(!hasComp){ zip.file(folder+"src/app/app.component.ts","import { Component } from '@angular/core';\nimport { RouterOutlet } from '@angular/router';\n\n@Component({\n selector: 'app-root',\n standalone: true,\n imports: [RouterOutlet],\n templateUrl: './app.component.html',\n styleUrl: './app.component.css'\n})\nexport class AppComponent {\n title = '"+pn+"';\n}\n"); zip.file(folder+"src/app/app.component.html","
\n
\n

"+slugTitle(pn)+"

\n

Built with PantheraHive BOS

\n
\n \n
\n"); zip.file(folder+"src/app/app.component.css",".app-header{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:60vh;gap:16px}h1{font-size:2.5rem;font-weight:700;color:#6366f1}\n"); } zip.file(folder+"src/app/app.config.ts","import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';\nimport { provideRouter } from '@angular/router';\nimport { routes } from './app.routes';\n\nexport const appConfig: ApplicationConfig = {\n providers: [\n provideZoneChangeDetection({ eventCoalescing: true }),\n provideRouter(routes)\n ]\n};\n"); zip.file(folder+"src/app/app.routes.ts","import { Routes } from '@angular/router';\n\nexport const routes: Routes = [];\n"); Object.keys(extracted).forEach(function(p){ var fp=p.startsWith("src/")?p:"src/"+p; zip.file(folder+fp,extracted[p]); }); zip.file(folder+"README.md","# "+slugTitle(pn)+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\nng serve\n# or: npm start\n\`\`\`\n\n## Build\n\`\`\`bash\nng build\n\`\`\`\n\nOpen in VS Code with Angular Language Service extension.\n"); zip.file(folder+".gitignore","node_modules/\ndist/\n.env\n.DS_Store\n*.local\n.angular/\n"); } /* --- Python --- */ function buildPython(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var reqMap={"numpy":"numpy","pandas":"pandas","sklearn":"scikit-learn","tensorflow":"tensorflow","torch":"torch","flask":"flask","fastapi":"fastapi","uvicorn":"uvicorn","requests":"requests","sqlalchemy":"sqlalchemy","pydantic":"pydantic","dotenv":"python-dotenv","PIL":"Pillow","cv2":"opencv-python","matplotlib":"matplotlib","seaborn":"seaborn","scipy":"scipy"}; var reqs=[]; Object.keys(reqMap).forEach(function(k){if(src.indexOf("import "+k)>=0||src.indexOf("from "+k)>=0)reqs.push(reqMap[k]);}); var reqsTxt=reqs.length?reqs.join("\n"):"# add dependencies here\n"; zip.file(folder+"main.py",src||"# "+title+"\n# Generated by PantheraHive BOS\n\nprint(title+\" loaded\")\n"); zip.file(folder+"requirements.txt",reqsTxt); zip.file(folder+".env.example","# Environment variables\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n\`\`\`\n\n## Run\n\`\`\`bash\npython main.py\n\`\`\`\n"); zip.file(folder+".gitignore",".venv/\n__pycache__/\n*.pyc\n.env\n.DS_Store\n"); } /* --- Node.js --- */ function buildNode(zip,folder,app,code){ var title=slugTitle(app); var pn=pkgName(app); var src=code.replace(/^\`\`\`[\w]*\n?/m,"").replace(/\n?\`\`\`$/m,"").trim(); var depMap={"mongoose":"^8.0.0","dotenv":"^16.4.5","axios":"^1.7.9","cors":"^2.8.5","bcryptjs":"^2.4.3","jsonwebtoken":"^9.0.2","socket.io":"^4.7.4","uuid":"^9.0.1","zod":"^3.22.4","express":"^4.18.2"}; var deps={}; Object.keys(depMap).forEach(function(k){if(src.indexOf(k)>=0)deps[k]=depMap[k];}); if(!deps["express"])deps["express"]="^4.18.2"; var pkgJson=JSON.stringify({"name":pn,"version":"1.0.0","main":"src/index.js","scripts":{"start":"node src/index.js","dev":"nodemon src/index.js"},"dependencies":deps,"devDependencies":{"nodemon":"^3.0.3"}},null,2)+"\n"; zip.file(folder+"package.json",pkgJson); var fallback="const express=require(\"express\");\nconst app=express();\napp.use(express.json());\n\napp.get(\"/\",(req,res)=>{\n res.json({message:\""+title+" API\"});\n});\n\nconst PORT=process.env.PORT||3000;\napp.listen(PORT,()=>console.log(\"Server on port \"+PORT));\n"; zip.file(folder+"src/index.js",src||fallback); zip.file(folder+".env.example","PORT=3000\n"); zip.file(folder+".gitignore","node_modules/\n.env\n.DS_Store\n"); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Setup\n\`\`\`bash\nnpm install\n\`\`\`\n\n## Run\n\`\`\`bash\nnpm run dev\n\`\`\`\n"); } /* --- Vanilla HTML --- */ function buildVanillaHtml(zip,folder,app,code){ var title=slugTitle(app); var isFullDoc=code.trim().toLowerCase().indexOf("=0||code.trim().toLowerCase().indexOf("=0; var indexHtml=isFullDoc?code:"\n\n\n\n\n"+title+"\n\n\n\n"+code+"\n\n\n\n"; zip.file(folder+"index.html",indexHtml); zip.file(folder+"style.css","/* "+title+" — styles */\n*{margin:0;padding:0;box-sizing:border-box}\nbody{font-family:system-ui,-apple-system,sans-serif;background:#fff;color:#1a1a2e}\n"); zip.file(folder+"script.js","/* "+title+" — scripts */\n"); zip.file(folder+"assets/.gitkeep",""); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\n## Open\nDouble-click \`index.html\` in your browser.\n\nOr serve locally:\n\`\`\`bash\nnpx serve .\n# or\npython3 -m http.server 3000\n\`\`\`\n"); zip.file(folder+".gitignore",".DS_Store\nnode_modules/\n.env\n"); } /* ===== MAIN ===== */ var sc=document.createElement("script"); sc.src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"; sc.onerror=function(){ if(lbl)lbl.textContent="Download ZIP"; alert("JSZip load failed — check connection."); }; sc.onload=function(){ var zip=new JSZip(); var base=(_phFname||"output").replace(/\.[^.]+$/,""); var app=base.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")||"my_app"; var folder=app+"/"; var vc=document.getElementById("panel-content"); var panelTxt=vc?(vc.innerText||vc.textContent||""):""; var lang=detectLang(_phCode,panelTxt); if(_phIsHtml){ buildVanillaHtml(zip,folder,app,_phCode); } else if(lang==="flutter"){ buildFlutter(zip,folder,app,_phCode,panelTxt); } else if(lang==="react-native"){ buildReactNative(zip,folder,app,_phCode,panelTxt); } else if(lang==="swift"){ buildSwift(zip,folder,app,_phCode,panelTxt); } else if(lang==="kotlin"){ buildKotlin(zip,folder,app,_phCode,panelTxt); } else if(lang==="react"){ buildReact(zip,folder,app,_phCode,panelTxt); } else if(lang==="vue"){ buildVue(zip,folder,app,_phCode,panelTxt); } else if(lang==="angular"){ buildAngular(zip,folder,app,_phCode,panelTxt); } else if(lang==="python"){ buildPython(zip,folder,app,_phCode); } else if(lang==="node"){ buildNode(zip,folder,app,_phCode); } else { /* Document/content workflow */ var title=app.replace(/_/g," "); var md=_phAll||_phCode||panelTxt||"No content"; zip.file(folder+app+".md",md); var h=""+title+""; h+="

"+title+"

"; var hc=md.replace(/&/g,"&").replace(//g,">"); hc=hc.replace(/^### (.+)$/gm,"

$1

"); hc=hc.replace(/^## (.+)$/gm,"

$1

"); hc=hc.replace(/^# (.+)$/gm,"

$1

"); hc=hc.replace(/\*\*(.+?)\*\*/g,"$1"); hc=hc.replace(/\n{2,}/g,"

"); h+="

"+hc+"

Generated by PantheraHive BOS
"; zip.file(folder+app+".html",h); zip.file(folder+"README.md","# "+title+"\n\nGenerated by PantheraHive BOS.\n\nFiles:\n- "+app+".md (Markdown)\n- "+app+".html (styled HTML)\n"); } zip.generateAsync({type:"blob"}).then(function(blob){ var a=document.createElement("a"); a.href=URL.createObjectURL(blob); a.download=app+".zip"; a.click(); URL.revokeObjectURL(a.href); if(lbl)lbl.textContent="Download ZIP"; }); }; document.head.appendChild(sc); } function phShare(){navigator.clipboard.writeText(window.location.href).then(function(){var el=document.getElementById("ph-share-lbl");if(el){el.textContent="Link copied!";setTimeout(function(){el.textContent="Copy share link";},2500);}});}function phEmbed(){var runId=window.location.pathname.split("/").pop().replace(".html","");var embedUrl="https://pantherahive.com/embed/"+runId;var code='';navigator.clipboard.writeText(code).then(function(){var el=document.getElementById("ph-embed-lbl");if(el){el.textContent="Embed code copied!";setTimeout(function(){el.textContent="Get Embed Code";},2500);}});}