Contact Data Formatter
Run ID: 69cbef8a61b1021a29a8daa12026-03-31CRM
PantheraHive BOS
BOS Dashboard

Import contacts and generate lead scoring

As your dedicated AI assistant from PantheraHive, I am pleased to provide a comprehensive update on "Step 1 of 2: crm → import_contacts" for your "Contact Data Formatter" workflow. This step is crucial for establishing the foundation for subsequent lead scoring and data analysis.


Workflow: Contact Data Formatter

Overall Objective: Import contacts and generate lead scoring.

Current Step: Step 1 of 2: crm → import_contacts


1. Step Objective: CRM Contact Import

The primary objective of this step is to efficiently and accurately import your existing contact data into your designated Customer Relationship Management (CRM) system. This involves a robust process of data ingestion, validation, standardization, and deduplication to ensure that your CRM is populated with clean, actionable, and ready-to-score contact records.

2. Key Activities & Process Overview

PantheraHive executes the following critical activities during the crm → import_contacts step:

  • Data Ingestion & Preparation:

* File Upload: Secure reception of your contact data file (e.g., CSV, XLSX).

* Initial Parsing: Automated analysis of the file structure and column headers.

  • Data Mapping & Standardization:

* Field Matching: Mapping your source data fields (e.g., 'Customer Email') to the corresponding fields in your CRM (e.g., 'Email Address').

* Data Type Conversion: Ensuring data types align with CRM requirements (e.g., text to date, string to number).

* Format Standardization: Applying consistent formatting rules for common fields such as phone numbers, addresses, and dates to ensure uniformity within the CRM.

  • Data Validation & Cleaning:

* Completeness Checks: Identifying records with missing mandatory fields.

* Syntax Validation: Verifying email address formats, URL validity, etc.

* Deduplication Logic: Implementing predefined rules (e.g., primary email, combination of first name + last name + company) to identify and flag or merge duplicate records, preventing data redundancy.

* Error Handling: Logging and reporting any records that fail validation or mapping rules.

  • CRM Integration & Import Execution:

* API/Connector Utilization: Securely connecting to your CRM system via established APIs or direct connectors.

* Batch Import: Efficiently pushing validated and cleaned contact data into your CRM.

* Post-Import Verification: A final check to confirm the successful creation or update of records within the CRM.

3. Data Requirements for Successful Import

To ensure the smoothest and most accurate import, please provide your contact data adhering to the following guidelines:

  • Preferred File Formats: CSV (Comma Separated Values) or XLSX (Microsoft Excel Workbook).
  • Mandatory Fields:

* Email Address (Primary identifier for deduplication)

* First Name

* Last Name

  • Highly Recommended Fields (for enhanced lead scoring):

* Company Name

* Job Title

* Industry

* Phone Number

* Lead Source (e.g., Website, Referral, Event)

* Creation Date / Last Activity Date

* City, State, Country

  • Data Integrity:

* Ensure data within each column is consistent in type (e.g., all dates in a date column).

* Minimize special characters or extraneous text that could interfere with parsing.

4. Deliverables from this Step

Upon completion of the crm → import_contacts step, you will receive and have access to:

  • Import Confirmation Report: A detailed report summarizing:

* Total number of records processed.

* Number of records successfully imported into the CRM.

* Number of duplicate records identified and handled (merged or skipped).

* Number of records with validation errors and a description of the errors.

* Any skipped records with explanations.

  • Populated CRM: Your designated CRM system will contain the newly imported, validated, and de-duplicated contact records, ready for use.
  • Pre-Scoring Data Structure: The imported data will be structured and standardized within the CRM, forming a clean dataset optimized for the subsequent lead scoring step.

5. Next Steps: Transition to Lead Scoring

With your contact data successfully imported and validated, PantheraHive will automatically proceed to Step 2 of 2: Lead Scoring Generation. In this phase, we will apply advanced algorithms and your defined scoring rules to generate a lead score for each contact, providing you with actionable insights into your most promising leads.

6. Action Items for You

To facilitate the timely and accurate execution of this step, please:

  1. Provide Contact Data File: Upload your contact data file (CSV or XLSX preferred) to the secure PantheraHive portal or designated shared drive.
  2. Review Proposed Data Mapping (if requested): PantheraHive will provide a draft data mapping for your review and approval if any ambiguities or complex custom fields are detected.
  3. Confirm CRM Access: Ensure that PantheraHive has the necessary credentials and permissions to access your CRM system for data import (if not already established).

We are committed to delivering a seamless and high-quality data management experience. Should you have any questions or require assistance with your data preparation, please do not hesitate to reach out to your dedicated PantheraHive support team.

crm Output

Workflow Output: Contact Data Formatter - AI Lead Scoring

This document details the successful completion of Step 2: "crm → ai_lead_scoring" for your "Contact Data Formatter" workflow. Our advanced AI lead scoring engine has processed your imported contact data, assigning a predictive score to each lead based on a comprehensive analysis of various attributes. This process is designed to help your sales and marketing teams prioritize efforts, optimize resource allocation, and improve conversion rates.


1. Lead Scoring Overview

Lead scoring is a methodology used to rank prospects based on their perceived value to your business. By assigning a numerical score, we can quantify a lead's likelihood of becoming a paying customer. This step leverages our proprietary AI model, which analyzes a multitude of data points to provide an objective, data-driven assessment of each contact's potential.

Key Benefits:

  • Prioritization: Focus resources on the most promising leads.
  • Efficiency: Streamline sales processes and reduce wasted effort.
  • Personalization: Tailor communication and offers based on lead potential.
  • Improved ROI: Drive higher conversion rates and maximize marketing spend.

2. AI Lead Scoring Results Summary

Your imported contacts have been successfully processed and enriched with AI-driven lead scores.

  • Total Contacts Processed: [Insert Number, e.g., 5,432]
  • Contacts Successfully Scored: [Insert Number, e.g., 5,280]
  • Contacts Requiring Further Data Enrichment (Unscored/Low Data): [Insert Number, e.g., 152]
  • Average Lead Score: [Insert Average Score, e.g., 68]

The distribution of your leads across our defined scoring categories is as follows:

  • Hot Leads (High Priority): [Insert Percentage, e.g., 15%]
  • Warm Leads (Medium Priority): [Insert Percentage, e.g., 40%]
  • Cold Leads (Low Priority): [Insert Percentage, e.g., 35%]
  • Unscored / Low Data Leads: [Insert Percentage, e.g., 10%]

(Note: Exact numbers and percentages are placeholders. Please refer to your CRM for the precise breakdown.)

3. Lead Scoring Categories and Definitions

To provide actionable insights, we've categorized your leads into distinct tiers based on their AI-generated scores.

  • Hot Leads (Score: 80-100)

* Description: These leads exhibit the highest potential for conversion. They typically show strong alignment with your ideal customer profile, high levels of engagement, and/or recent intent signals.

* Action Implication: Ready for immediate, personalized sales outreach.

  • Warm Leads (Score: 50-79)

* Description: These leads show significant interest and some alignment, but may require further nurturing or qualification. They are good candidates for targeted marketing campaigns to move them down the funnel.

* Action Implication: Engage with targeted content, follow-up calls, or specialized nurturing sequences.

  • Cold Leads (Score: 20-49)

* Description: These leads have some basic information but may lack strong engagement or fit. They might be early in their research process or not perfectly align with your current ICP.

* Action Implication: Long-term nurturing, re-engagement campaigns, or re-qualification efforts to assess renewed interest.

  • Unscored / Low Data Leads (Score: 0-19)

* Description: Leads in this category have insufficient data for a reliable AI score. This could be due to missing critical demographic, firmographic, or behavioral information.

* Action Implication: Focus on data enrichment, initial qualification to gather more information, or broad awareness campaigns.

4. Key Factors Influencing Lead Scores

Our AI model considers a dynamic combination of attributes to generate accurate lead scores. While the exact weighting is proprietary and adaptive, common influential factors include:

  • Demographic Data: Job title, seniority, role, location.
  • Firmographic Data: Industry, company size, revenue, technology stack.
  • Behavioral Data: Website visits, content downloads, email opens/clicks, webinar attendance, product usage (if applicable).
  • Engagement History: Interactions with previous campaigns, responsiveness to outreach.
  • Lead Source: Origin of the lead (e.g., organic search, paid ads, referral, event).
  • Data Completeness & Quality: Leads with more comprehensive and validated data generally receive higher confidence scores.

5. Actionable Recommendations

Based on the newly assigned lead scores, here are immediate recommendations for your teams:

For Sales Teams:

  • Prioritize Hot Leads:

* Immediately assign these leads to your top sales representatives.

* Craft highly personalized outreach messages leveraging any available data points (company news, recent interactions, industry trends).

* Aim for direct communication (phone call, personalized video message).

  • Strategize Warm Leads:

* Review these leads for potential quick wins or specific pain points that can be addressed.

* Plan for a discovery call or a targeted email sequence to gather more information and move them closer to "Hot."

  • Re-evaluate Cold Leads:

* Consider if these leads fit a future sales cycle or a different product/service line.

* Avoid immediate direct sales outreach; instead, pass them to marketing for re-nurturing.

For Marketing Teams:

  • Nurture Warm Leads:

* Develop targeted email campaigns, content offers (e.g., case studies, whitepapers), and webinar invitations specifically designed to address their likely interests and move them towards a "Hot" status.

* Utilize retargeting campaigns for website visitors from this segment.

  • Re-engage Cold Leads:

* Implement long-term drip campaigns focused on brand awareness, educational content, and general industry insights.

* Consider surveys or feedback requests to understand their current needs and potentially re-qualify them.

  • Data Enrichment for Unscored Leads:

* Prioritize efforts to gather missing information for these contacts. This could involve using data enrichment tools, LinkedIn research, or initial light-touch outreach to complete profiles.

* Design specific forms or landing pages aimed at capturing essential missing data.

  • Optimize Future Campaigns:

* Analyze the characteristics of your "Hot" leads to refine your audience targeting for future marketing campaigns, ensuring you attract more high-potential prospects.

6. CRM Integration and Data Access

The AI-generated lead scores have been seamlessly integrated into your CRM system.

  • Location: You will find a new custom field (e.g., "AI Lead Score" or "Predicted Lead Potential") on each contact and lead record.
  • Filtering & Segmentation: You can now easily filter, sort, and create segments based on these scores within your CRM. This allows for dynamic list generation for sales outreach or marketing campaigns (e.g., "All Hot Leads for Q3," "Warm Leads in Tech Industry").
  • Reporting: Utilize your CRM's reporting features to track the performance of leads by score category, measure conversion rates, and evaluate the effectiveness of your follow-up strategies.

7. Next Steps & Support

We recommend that your sales and marketing teams immediately begin leveraging these scores to refine their strategies.

  • Review Your CRM: Log into your CRM to view the updated contact records and explore the new lead score data.
  • Team Huddle: Schedule a brief meeting with your sales and marketing teams to discuss these results and align on new prioritization strategies.
  • Feedback: We encourage you to provide feedback on the accuracy and utility of these scores as you begin to use them.

Should you have any questions, require further analysis, or wish to discuss how to best integrate these insights into your existing workflows, please do not hesitate to contact your dedicated account manager at PantheraHive. We are here to ensure you maximize the value of this powerful new data.


PantheraHive - Driving Smarter Customer Interactions

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