Phone Sales Dialer Script
Run ID: 69c94f30a17964d77e86d93e2026-03-29Sales
PantheraHive BOS
BOS Dashboard

Generate cold call and warm call scripts with objection handling, qualifying questions, and close techniques.

This deliverable provides comprehensive, detailed, and professional phone sales dialer scripts for both cold and warm calling scenarios. Each script includes specific examples for openings, value propositions, qualifying questions, objection handling, and closing techniques.


Phone Sales Dialer Scripts: Cold & Warm Calls

This document outlines robust scripts designed to guide your sales representatives through effective cold and warm calling, maximizing their chances of converting prospects into qualified leads and ultimately, customers. Each section includes strategic advice, example dialogues, and best practices.

1. Cold Call Script

Objective: To identify potential interest, qualify the prospect, and secure a follow-up discovery meeting or a commitment for further engagement. The goal is not to sell on the first call, but to open a dialogue and move the prospect to the next stage of the sales process.

Key Principles for Cold Calling:

  • Respect Time: Acknowledge their busy schedule upfront.
  • Be Concise: Get to the point quickly with a clear value proposition.
  • Focus on Them: Frame the conversation around their potential challenges and benefits.
  • Permission-Based: Ask for permission to continue the conversation.

Cold Call Script Template

1. Opening & Permission (15-20 seconds)

  • Goal: Introduce yourself, your company, and ask if it's a good time to talk briefly.
  • Example Dialogue:

* "Hello [Prospect Name], this is [Your Name] from [Your Company]. How are you today?"

(Pause for response)*

* "Great. The reason for my call is we specialize in helping [Target Audience] achieve [Key Benefit/Result]. I know you weren't expecting my call, did I catch you at a bad time for a quick 30-second introduction?"

* Alternative (Problem-Oriented): "Hello [Prospect Name], this is [Your Name] from [Your Company]. We've been helping companies like yours [solve specific problem/achieve specific goal]. I know you weren't expecting my call, do you have a quick minute to hear why I reached out?"

2. Brief Value Proposition & Hook (20-30 seconds)

  • Goal: Briefly state what you do and hint at a common problem you solve, aiming to pique their interest.
  • Example Dialogue (following permission):

* "Thanks. We work with [similar companies/roles] to [specific problem your solution solves] by providing [your solution/service]. This typically helps them [achieve specific positive outcome, e.g., reduce costs by X%, increase efficiency, improve customer satisfaction]."

* "For example, many of our clients struggle with [common pain point related to your solution]. Is that something you've encountered at [Prospect Company Name]?"

3. Initial Qualifying Question (Discovery) (30-45 seconds)

  • Goal: Uncover a potential need or challenge that aligns with your solution. Keep it high-level.
  • Example Dialogue:

* "Based on your role as [Prospect's Title], you're likely focused on [related area, e.g., improving operational efficiency/driving sales growth]. What are some of the biggest challenges you're currently facing in that area?"

* "How are you currently handling [area your solution addresses]?"

* "What initiatives are top-of-mind for you regarding [relevant business function] this quarter?"

4. Objection Handling (Cold Call Specific)

  • Goal: Address common initial brush-offs professionally and pivot back to potential value.
  • Common Objections & Responses:

* "I'm not interested."

* Response: "I completely understand. Many people initially feel that way, but often find that [common problem your solution solves] is something they're keen to address once they see how we help. Are you currently experiencing [common problem] at all?"

Response: "That's fair enough. Could I briefly ask what you're not* interested in? Sometimes, the context can be misunderstood on a cold call, and I want to ensure I'm not missing something that could genuinely benefit you."

* "I'm too busy right now."

* Response: "I completely respect that. Would it be better if I called back at [specific time/day]? Or could I take just 30 seconds to explain the core reason for my call, in case it's timely?"

* Response: "No problem at all. What would be a better time for a quick 5-minute chat next week?"

* "Just send me some information."

* Response: "I can certainly send you some information, [Prospect Name]. To make sure I send you the most relevant details that address your specific needs, could you tell me a little bit about [specific challenge or goal]? That way, I can tailor what I send."

* Response: "Absolutely. To ensure I don't flood your inbox with irrelevant material, what specific problem or area were you hoping to find a solution for?"

* "We're all set/We already have a solution."

* Response: "That's great to hear you have a solution in place. Many of our clients were also happy with their previous provider until they discovered [unique benefit/capability your solution offers] that they weren't getting. Are there any areas where you feel your current solution could improve?"

* Response: "Understood. We often find that even with existing solutions, there are opportunities to [improve X, reduce Y, enhance Z]. Are you perfectly satisfied with [specific aspect of your solution]?"

5. Close / Next Steps (Call to Action)

  • Goal: Secure a commitment for a short, focused follow-up meeting (discovery call, demo).
  • Example Dialogue:

* "Based on our brief chat, it sounds like there might be an opportunity to explore how [Your Company] could help with [reiterate their potential challenge/goal]. Would you be open to a brief 15-20 minute discovery call next week to delve deeper and see if there's a good fit?"

* "How does [specific day, e.g., Tuesday] at [specific time, e.g., 2 PM PST] look for you? Or would [alternative day/time] be better?"

* "If I send over a calendar invite with a brief agenda, would you be able to connect for 15 minutes to discuss this further?"


2. Warm Call Script

Objective: To build on a previous interaction (e.g., email, event, referral, inbound lead), further qualify the prospect, understand their specific needs in detail, and move them closer to a solution-oriented discussion or proposal.

Key Principles for Warm Calling:

  • Reference Context: Immediately remind them of the previous interaction.
  • Personalize: Show you've done your homework and remember previous discussions.
  • Deepen Understanding: Ask more probing, open-ended questions.
  • Tailor Value: Connect your solution directly to their expressed needs.

Warm Call Script Template

1. Opening & Context Setting (15-25 seconds)

  • Goal: Remind the prospect of your previous interaction and establish the purpose of the call.
  • Example Dialogue:

* "Hi [Prospect Name], this is [Your Name] from [Your Company]. We connected on [Date/Event/Email Reference] about [Specific Topic/Problem]. Do you have a moment to chat?"

* "Hello [Prospect Name], [Your Name] from [Your Company]. I'm calling to follow up on the information I sent regarding [Topic from email/previous call]. I wanted to see if you had a chance to review it and if you had any initial questions."

* Referral: "Hi [Prospect Name], this is [Your Name] from [Your Company]. [Referral Name] suggested I reach out to you regarding [specific challenge/opportunity]. How are you today?"

2. Recap & Reconfirm Interest (20-30 seconds)

  • Goal: Briefly recap what was discussed or the context of your last interaction to ensure alignment.
  • Example Dialogue (following permission):

* "Great. When we last spoke/when you inquired, you mentioned [Pain Point/Goal/Area of Interest]. My understanding was that you were looking for ways to [desired outcome]. Is that still a priority for you?"

* "As we discussed, you expressed interest in how [Your Solution] could help you with [specific benefit]. I wanted to explore that a bit further today."

3. Deeper Qualifying Questions (Needs Analysis) (2-3 minutes)

  • Goal: Uncover specific details about their challenges, impact, budget, authority, and timeline. Use frameworks like BANT (Budget, Authority, Need, Timeline) or MEDDPICC (Metrics, Economic Buyer, Decision Criteria, Decision Process, Implicate the Pain, Champion, Competition) as a guide.
  • Example Dialogue:

* Need: "Can you tell me more about the specific challenges you're facing with [area your solution addresses]? What impact is that having on your team/business?"

* Impact: "What are the quantifiable effects of this problem? How is it affecting your [KPI, e.g., revenue, efficiency, customer retention]?"

* Vision/Goals: "Ideally, what would a successful solution look like for you? What are you hoping to achieve in the next 6-12 months regarding this?"

* Authority: "Who else at [Prospect Company Name] would typically be involved in a decision like this?" / "What's the typical decision-making process for new solutions in this area?"

* Timeline: "Do you have a specific timeline in mind for addressing this? Are there any upcoming events or deadlines driving this?"

* Budget: "Have you allocated any budget towards solving this problem or investing in a solution like ours?" (Phrase carefully, e.g., "Many of our clients set aside X for solutions like this, where are you in that process?")

4. Tailored Value Proposition & Solution Link (1 minute)

  • Goal: Connect your solution's features and benefits directly to the specific needs and pain points they've just articulated.
  • Example Dialogue:

* "Thanks for sharing that, [Prospect Name]. It sounds like [reiterate their pain point, e.g., 'the struggle with manual data entry leading to errors and delays'] is a significant concern. Our [Specific Feature] is designed precisely to [explain how it solves their problem], which typically results in [specific benefit, e.g., 'a 30% reduction in errors and a 50% faster process'], directly addressing what you're looking for."

* "Given your goal to [their stated goal], our [Solution Component] can provide [specific capability] to help you achieve that by [mechanism]."

5. Objection Handling (Warm Call Specific)

  • Goal: Address more complex objections that arise once a prospect has a better understanding of your offering.
  • Common Objections & Responses:

* "Your price is too high."

Response: "I understand it seems like a significant investment. Many of our clients initially feel that way, but then realize the ROI from [benefit 1] and [benefit 2] far outweighs the cost, often within [timeframe]. Have you considered the cost of not* solving [problem]?"

* Response: "Compared to what? Let's break down the value. What specific part of the investment gives you pause, and how does that compare to the value you expect to receive from [solution's benefits]?"

* "We're happy with our current provider."

* Response: "That's fantastic to hear you have a solution in place. What specific aspects are you happiest with? We often find that while a current provider meets baseline needs, there are opportunities for [your unique differentiator, e.g., deeper analytics, better integration, superior support] that can elevate results. Are there any areas where you feel your current solution could improve?"

* Response: "Understood. We're not looking to replace everything, but rather to see if there are specific gaps or areas

gemini Output

This deliverable provides comprehensive, detailed, and professional cold call and warm call scripts designed to optimize your phone sales dialer workflow. Each script includes specific openings, value propositions, qualifying questions, objection handling techniques, and closing strategies, structured for maximum effectiveness.


Phone Sales Dialer Scripts: Cold Call & Warm Call

General Best Practices for All Dialer Scripts

Before diving into the specific scripts, keep these universal best practices in mind for any phone sales interaction:

  • Pre-Call Research: Always do your homework. Understand the prospect's company, industry, role, and any recent news. This allows for personalization and shows you value their time.
  • Confident & Enthusiastic Tone: Your voice is your primary tool. Speak clearly, with a positive and energetic tone. Smile – it translates through the phone.
  • Active Listening: Listen more than you speak. Ask open-ended questions and truly hear their responses. Paraphrase to confirm understanding.
  • Flexibility: These are scripts, not rigid mandates. Be prepared to adapt to the conversation's flow.
  • Focus on Them: Frame benefits around their needs and challenges, not just your product's features.
  • Clear Next Steps: Always end with a defined next step, whether it's an appointment, an email, or a follow-up call.

1. Cold Call Script: PantheraReach

Goal: To secure a brief discovery meeting (15-20 minutes) to understand their current sales challenges and explore how PantheraReach might help.

Target Persona: Sales Director, VP of Sales, Head of Business Development

Product/Service: PantheraReach – an AI-powered sales engagement platform that helps B2B sales teams automate personalized outreach, optimize follow-up sequences, and gain deeper insights into prospect engagement, leading to increased conversion rates and reduced manual effort.


Cold Call Script Structure

A. Opening & Permission-Based Hook (The First 15 Seconds)

  • Caller: "Hi [Prospect Name], this is [Your Name] from PantheraReach. I know you weren't expecting my call, but I saw your role as [Prospect's Role] at [Company Name] and noticed you're likely focused on [mention a common challenge like 'scaling outbound efforts' or 'improving sales team efficiency']. Do you have about 20 seconds for me to explain why I called?"

Alternative:* "Is this a bad time?" (If they say no, proceed. If yes, "When would be a better time for a quick 5-minute chat?")

B. Value Proposition & Pain Point Identification (The "Why Bother?")

  • Caller: "Great, thanks. We primarily help B2B sales leaders like yourself who are looking to streamline their sales outreach, ensure consistent follow-up, and gain actionable insights into what's actually working – all without increasing headcount or burning out their reps. Many of our clients come to us because they're struggling with [mention specific pain points: 'manual email drafting taking too much time,' 'inconsistent follow-up leading to missed opportunities,' or 'lack of visibility into campaign performance']."

C. Qualifying Questions (BANT-Lite / Needs Assessment)

  • Caller: "Does any of that resonate with what you or your team might be experiencing?" (Listen carefully)
  • Caller: "Just so I don't waste your time, could you tell me a little bit about how your team currently handles their outbound sales outreach and follow-up?"

Follow-up 1:* "What tools are you currently using for sales engagement or CRM?"

Follow-up 2:* "What are some of the biggest challenges or bottlenecks your team faces when trying to connect with new prospects or nurture existing leads?"

Follow-up 3 (Implication):* "And how do those challenges impact your team's overall productivity or your ability to hit revenue targets?"

D. Objection Handling (Common Cold Call Objections)

  • Objection 1: "I'm not interested."

* Response: "I completely understand, [Prospect Name]. Most people aren't interested in another sales call, which is why I only wanted 20 seconds to see if there was even a remote fit. If you're not facing any challenges with [mention pain point again, e.g., 'consistent outreach' or 'sales team efficiency'], then perhaps we're not a fit. But if there's even a slight possibility we could help you [mention high-level benefit, e.g., 'increase conversions by X%'], it might be worth a quick chat. Could you tell me what makes you say you're not interested?"

Alternative:* "That's fair. Usually when people say they're not interested, it's because they're either happy with their current solution, or they don't see the immediate relevance. Which is it for you?"

  • Objection 2: "Just send me an email."

* Response: "I'd be happy to send you an email, [Prospect Name], but to make sure it's actually relevant and not just another piece of spam, could you give me a quick idea of what you'd be most interested in learning about? Is it more about [mention specific benefit 1, e.g., 'automating personalization'], or [specific benefit 2, e.g., 'getting better analytics']? That way, I can tailor the information specifically for you."

Alternative:* "I can certainly do that. However, our solution is quite tailored, and I wouldn't want to send you something generic. If I were to send you an email, what would be the one key piece of information you'd need to see to consider a 15-minute conversation?"

  • Objection 3: "We're happy with our current solution/provider."

* Response: "That's great to hear, [Prospect Name]! It sounds like you've got a good system in place. Most of our clients were happy with their existing tools too, until they saw how PantheraReach could [mention a unique differentiator or advanced capability, e.g., 'integrate AI for hyper-personalization at scale' or 'provide deeper engagement insights that their current system couldn't']. We're not looking to replace what works, but rather to see if there are areas where we could potentially enhance or optimize what you're already doing. Would you be open to a brief 15-minute chat to explore those possibilities?"

  • Objection 4: "I don't have time right now."

* Response: "I completely understand, and I appreciate you taking my call. I only need about 15-20 minutes at your convenience to show you how [PantheraReach] helps sales teams like yours [reiterate key benefit, e.g., 'save hours on outreach and improve conversion rates']. When would be a good time next week for a quick, no-pressure discovery call? How about Tuesday morning or Thursday afternoon?"

E. Closing Techniques (Appointment Setting)

  • Close 1 (Direct & Benefit-Oriented): "Based on what we've discussed, it sounds like there could be some potential value in exploring how PantheraReach specifically addresses [mention specific pain point identified]. Would you be open to a brief 15-20 minute demo next week to see it in action? We could look at [specific feature relevant to their pain point]."

Suggested times:* "How about Tuesday at 10 AM or Wednesday at 2 PM?"

  • Close 2 (Value-Driven, Soft Close): "My goal today was just to see if there was enough potential alignment to warrant a deeper conversation. It sounds like [recap a key point they mentioned]. I'd love to schedule a quick 20-minute follow-up call where we can dive deeper into your current processes and I can show you a couple of specific examples of how PantheraReach has helped companies similar to yours achieve [specific result]. Does that sound like a reasonable next step?"
  • Close 3 (Problem-Solution): "If you're serious about [solving their identified problem, e.g., 'improving your sales team's efficiency' or 'hitting your Q3 revenue targets'], then a 15-minute discovery call is really the best way to see how we can help. What does your calendar look like early next week?"

2. Warm Call Script: PantheraReach

Goal: To advance the sales cycle based on a prior interaction (e.g., downloaded content, attended webinar, referred by a colleague, previous meeting). The goal could be to schedule a demo, qualify further, or move towards a proposal.

Target Persona: Sales Director, VP of Sales, Head of Business Development (who has already shown some interest).

Product/Service: PantheraReach.


Warm Call Script Structure

A. Opening & Reference (Context is Key)

  • Caller: "Hi [Prospect Name], this is [Your Name] from PantheraReach. How are you today?"
  • Caller: "The reason for my call is related to [specific context, e.g., 'your recent download of our 'AI in Sales Outreach' whitepaper,' 'our conversation at the Sales Summit last month,' 'the demo we had on [Date],' or 'your colleague, [Referral Name], suggested I reach out to you']."
  • Caller: "Do you have a few minutes to chat about [reiterate key topic from context, e.g., 'your thoughts on scaling personalized outreach']?"

B. Recap & Re-Engage (Connecting the Dots)

  • If content download/webinar: "Based on your interest in [content topic], it seems you're exploring ways to [relate to a pain point, e.g., 'make your sales team more efficient' or 'improve lead conversion']. What specifically prompted you to download/attend?"
  • If previous meeting/demo: "I'm calling to follow up on our discussion from [Date] about how PantheraReach could help your team with [recap key benefit discussed, e.g., 'automating outreach while maintaining personalization']. Since then, have you had a chance to [mention agreed-upon action, e.g., 'discuss it internally' or 'think about the potential impact']?"
  • If referral: "[Referral Name] mentioned you might be looking into solutions for [area of interest]. Can you tell me a bit more about what you're hoping to achieve there?"

C. Deeper Discovery & Qualifying Questions (Building on Existing Knowledge)

  • Caller: "When we last spoke, you mentioned [specific challenge/goal]. Has anything changed regarding that priority since then?"
  • Caller: "What does your ideal solution look like for [specific area, e.g., 'managing outreach sequences']? What are the 'must-haves' versus the 'nice-to-haves'?"
  • Caller: "Beyond the technical aspects, what would be the biggest impact on your business if you could achieve [specific goal, e.g., 'increase sales productivity by 20%']?"
  • Caller: "What does your decision-making process typically look like for a solution like PantheraReach? Who else would need to be involved?"
  • Caller: "Do you have a specific timeline in mind for when you'd like to have a solution implemented?"
  • Caller: "Have you allocated a budget for addressing [this specific challenge]?" (If not, "What would be the cost of not addressing this problem?")

D. Objection Handling (More Specific Objections)

  • Objection 1: "The price is too high."

* Response: "I understand price is a significant consideration, [Prospect Name]. When you say 'too high,' are you comparing it to [mention competitor/alternative] or is it more about the overall budget allocation? Can you help me understand what value you're expecting to see to justify this investment?"

Alternative:* "Let's put the price aside for a moment. If PantheraReach could deliver on [reiterate key benefit they valued, e.g., 'increasing your conversion rates by 15%'], would that value outweigh the investment for you? Perhaps we can explore different package options that align with your immediate needs and budget."

  • Objection 2: "I need to think about it / Discuss with my team."

* Response: "Absolutely, it's a big decision, and internal alignment is crucial. What specific aspects do you need to think about, or what questions do you anticipate your team might have? Perhaps I can provide some additional information or resources now that would help with those discussions."

Alternative:* "That's perfectly reasonable. To help you with those internal discussions, what information or insights would be most valuable for me to provide? And who on your team would be part of that conversation? Perhaps a joint call with them would be beneficial."

  • Objection 3: "We're considering [Competitor Name]."

* Response: "That's great you're doing your due diligence! [Competitor Name] is a well-known player. From your perspective, what are the key differences or strengths you see in their offering compared to what we've discussed about PantheraReach? Often, clients choose us because of our unique [mention a specific differentiator, e.g., 'AI-driven personalization' or 'advanced analytics dashboard']. What are the most critical factors for you in making this decision?"

  • Objection 4: "Timing isn't right now / We're too busy."

Response: "I appreciate your honesty, [Prospect Name]. I know teams are always juggling priorities. What specifically is making the timing challenging right now? Is it a capacity issue, or are there other projects taking precedence? Understanding this helps me determine the best way to support you. We often find that implementing a solution like PantheraReach frees up* time in the long run, rather than consuming it."

Alternative:* "I understand. If we were to revisit

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);}});}