1import{k as G,r as g,s as W,j as e,q as K,g as U,X as Y,_ as J,u as O,$ as X,L as B,A as Z,e as $,b as ee,d as E}from"./index-9RpNC89m.js";import{S as te}from"./save-Iz8TWZJb.js";import{C as se}from"./clock-DR4hKIT7.js";import{C as ie}from"./copy-BFEtWKxh.js";import{C as z}from"./chevron-up-n_0jSiul.js";function k(s){return!s||!Array.isArray(s)?"":s.filter(i=>i==null?void 0:i.text).map(i=>`⢠${i.text}`).join(` 2`)}function oe(s){return typeof s=="string"?s:Array.isArray(s)?k(s):s&&typeof s=="object"?JSON.stringify(s):String(s??"")}const ne={"messaging-framework":[{sourceSlug:"buyer-persona",sourceName:"Buyer Persona",extractions:[{sourcePath:"painPoints",targetFieldId:"supportingMessages",transform:k},{sourcePath:"keyMessages",targetFieldId:"coreMessage",transform:k}]}],"ad-copy":[{sourceSlug:"buyer-persona",sourceName:"Buyer Persona",extractions:[{sourcePath:"demographics",targetFieldId:"audience",transform:k},{sourcePath:"buyingTriggers",targetFieldId:"headlines",transform:k}]}],okrs:[{sourceSlug:"swot-analysis",sourceName:"SWOT Analysis",extractions:[{sourcePath:"opportunities",targetFieldId:"objective1",transform:k}]}],"landing-page":[{sourceSlug:"value-proposition",sourceName:"Value Proposition Canvas",extractions:[{sourcePath:"gainCreators",targetFieldId:"headline",transform:k},{sourcePath:"painRelievers",targetFieldId:"sections",transform:k}]}],"sostac-planner":[{sourceSlug:"swot-analysis",sourceName:"SWOT Analysis",extractions:[{sourcePath:"__swot_all__",targetFieldId:"situation",transform:s=>{if(!s||typeof s!="object")return"";const i=s;return["strengths","weaknesses","opportunities","threats"].map(a=>{const r=i[a],p=a.charAt(0).toUpperCase()+a.slice(1),c=Array.isArray(r)?r.filter(o=>o==null?void 0:o.text).map(o=>` ⢠${o.text}`).join(` 3`):"";return c?`${p}: 4${c}`:""}).filter(Boolean).join(` 5 6`)}}]}]};function ae(s,i){if(i==="__swot_all__")return s;const n=i.split(".");let a=s;for(const r of n){if(a==null||typeof a!="object")return;a=a[r]}return a}function re(s,i,n,a=!0){const{workspace:r}=G(),[p,c]=g.useState([]),[o,f]=g.useState(!1),[T,N]=g.useState(!1);return g.useEffect(()=>{if(!a||!(r!=null&&r.id)||!s)return;const u=ne[s];if(!u||u.length===0){c([]);return}f(!0),N(!1);const y=[...new Set(u.map(m=>m.sourceSlug))];(async()=>{const{data:m}=await W.from("tool_data").select("tool_slug, data").eq("workspace_id",r.id).in("tool_slug",y);if(!m||m.length===0){c([]),f(!1);return}const b=new Map;for(const d of m)d.data&&typeof d.data=="object"&&b.set(d.tool_slug,d.data);const C=[];for(const d of u){const A=b.get(d.sourceSlug);if(A)for(const w of d.extractions){const v=i[w.targetFieldId];if(v&&v.trim().length>0)continue;const j=ae(A,w.sourcePath);if(j==null)continue;const P=w.transform?w.transform(j):oe(j);!P||P.trim().length===0||C.push({fieldId:w.targetFieldId,value:P,sourceToolName:d.sourceName,sourceToolSlug:d.sourceSlug})}}c(C),f(!1)})()},[r==null?void 0:r.id,s,a]),{suggestions:p,isLoading:o,dismissed:T,dismiss:()=>N(!0),applySuggestion:u=>{const y=p.find(m=>m.fieldId===u);y&&(n(y.fieldId,y.value),c(m=>m.filter(b=>b.fieldId!==u)))},applyAll:()=>{for(const u of p)(!i[u.fieldId]||i[u.fieldId].trim().length===0)&&n(u.fieldId,u.value);c([]),N(!0)}}}const le=({suggestions:s,dismissed:i,onApplyAll:n,onDismiss:a})=>{if(i||s.length===0)return null;const p=[...new Set(s.map(c=>c.sourceToolName))].join(" & ");return e.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-xl px-4 py-3 mb-4 animate-fade-in",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-blue-100 text-blue-600 flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx(K,{size:14})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsxs("p",{className:"text-xs font-bold text-blue-900",children:["ð¡ Data found from ",p]}),e.jsx("p",{className:"font-arabic text-[9px] text-blue-400",dir:"rtl",children:"Ø¨ÙØ§Ùات ٠٠أداة أخرÙ"})]}),e.jsxs("p",{className:"text-[11px] text-blue-700 leading-relaxed",children:["We can pre-fill ",s.length," empty field",s.length>
61?"s":""," with data from your ",p,". This won't overwrite anything."]}),e.jsxs("div",{className:"flex items-center gap-2 mt-2.5",children:[e.jsxs("button",{onClick:n,className:"inline-flex items-center gap-1.5 text-[11px] font-semibold text-white bg-blue-600 hover:bg-blue-700 px-3 py-1.5 rounded-lg transition-colors shadow-sm",children:[e.jsx(U,{size:11}),"Apply ",s.length," Suggestion",s.length>1?"s":""]}),e.jsx("button",{onClick:a,className:"text-[11px] text-blue-500 hover:text-blue-700 px-2 py-1.5 rounded-lg hover:bg-blue-100 transition-colors",children:"Dismiss"})]})]}),e.jsx("button",{onClick:a,className:"p-1 rounded-lg hover:bg-blue-100 text-blue-400 hover:text-blue-600 transition-colors flex-shrink-0",children:e.jsx(Y,{size:14})})]})})};function t(s,i,n,a,r=1500){return{id:s,label:i,labelAr:n,prompt:i,promptAr:n,placeholder:a,maxChars:r}}function h(s){return{...s,output:()=>[]}}const H={"icp-builder":h({slug:"icp-builder",emoji:"ð¢",name:"Ideal Customer Profile",nameAr:"برÙÙØ§ÙÙ Ø§ÙØ¹Ù Ù٠اÙ٠ثاÙÙ",description:"Define your ideal B2B customer: company size, industry, decision makers, budget",descriptionAr:"ØØ¯Ø¯ ع٠ÙÙ٠اÙ٠ثاÙÙ B2B: ØØ¬Ù Ø§ÙØ´Ø±ÙØ©Ø Ø§ÙÙ Ø¬Ø§ÙØ ØµÙØ§Ø¹ اÙÙØ±Ø§Ø±Ø ÙØ§ÙÙ ÙØ²Ø§ÙÙØ©",fields:[t("companySize","Company Size & Type","ØØ¬Ù ÙÙÙØ¹ Ø§ÙØ´Ø±ÙØ©","What size companies are ideal? (startup, SMB, enterprise, revenue range)"),t("industry","Industry & Vertical","اÙÙØ·Ø§Ø¹ ÙØ§Ù٠جاÙ","What industries or verticals do you target?"),t("decisionMakers","Decision Makers","ØµÙØ§Ø¹ اÙÙØ±Ø§Ø±","Who are the buyers? Job titles, seniority, department"),t("buyingProcess","Buying Process","ع٠ÙÙØ© Ø§ÙØ´Ø±Ø§Ø¡","How do they evaluate and purchase? Timeline, stakeholders"),t("budget","Budget Range","ÙØ·Ø§Ù اÙÙ ÙØ²Ø§ÙÙØ©","Typical budget range for your solution",500),t("technographics","Tech Stack & Tools","Ø§ÙØ£Ø¯Ùات Ø§ÙØªÙÙÙØ©","What tools do they currently use?"),t("qualificationCriteria","Qualification Criteria","٠عاÙÙØ± Ø§ÙØªØ£ÙÙÙ","What makes a lead qualified vs unqualified?")],guide:{what:"The Ideal Customer Profile defines the perfect company to sell to. It narrows your focus so marketing and sales target the right accounts.",whatAr:"برÙÙØ§ÙÙ Ø§ÙØ¹Ù Ù٠اÙ٠ثاÙÙ ÙØØ¯Ø¯ Ø§ÙØ´Ø±ÙØ© اÙ٠ثاÙÙØ© اÙÙÙ ØªØ¨ÙØ¹ ÙÙØ§. ÙØ³Ø§Ø¹Ø¯Ù ØªØ±ÙØ² جÙÙØ¯ Ø§ÙØªØ³ÙÙÙ ÙØ§ÙÙ Ø¨ÙØ¹Ø§Øª.",steps:["Define company size and industry","Identify decision makers and their roles","Map the buying process","Set qualification criteria"],example:{companySize:"SaaS companies, 50-500 employees, $5M-$50M ARR",industry:"B2B SaaS, FinTech, MarTech",decisionMakers:"VP Marketing, CMO, Head of Growth"},proTip:"Your ICP should be specific enough that your sales team can immediately tell if a lead fits or not."}}),"competitor-analysis":h({slug:"competitor-analysis",emoji:"âï¸",name:"Competitor Analysis",nameAr:"تØÙÙ٠اÙÙ ÙØ§ÙسÙÙ",description:"Track competitors: positioning, pricing, strengths, weaknesses, content strategy",descriptionAr:"ØÙÙ Ù ÙØ§ÙسÙÙ: Ø§ÙØªÙ Ø±ÙØ²Ø Ø§ÙØªØ³Ø¹ÙØ±Ø ÙÙØ§Ø· اÙÙÙØ© ÙØ§ÙØ¶Ø¹ÙØ ÙØ§Ø³ØªØ±Ø§ØªÙØ¬ÙØ© اÙÙ ØØªÙÙ",fields:[t("competitors","Key Competitors","اÙÙ ÙØ§ÙسÙÙ Ø§ÙØ±Ø¦ÙسÙÙÙ","List top 3-5 competitors and their positioning"),t("strengths","Competitor Strengths","ÙÙØ§Ø· ÙÙØ© اÙÙ ÙØ§ÙسÙÙ","What do they do well?"),t("weaknesses","Competitor Weaknesses","ÙÙØ§Ø· ضع٠اÙÙ ÙØ§ÙسÙÙ","Where do they fall short?"),t("pricing","Pricing Comparison","Ù ÙØ§Ø±ÙØ© Ø§ÙØ£Ø³Ø¹Ø§Ø±","How do their prices compare?"),t("channels","Their Marketing Channels","ÙÙÙØ§ØªÙÙ Ø§ÙØªØ³ÙÙÙÙØ©","Where do they advertise and create content?"),t("differentiation","Your Differentiation","ت٠ÙÙØ²Ù","What do you do that they can't?")],guide:{what:"Competitor Analysis maps the landscape so you can position yourself where competitors are weakest.",whatAr:"تØÙÙ٠اÙÙ ÙØ§ÙسÙÙ ÙØ±Ø³Ù Ø®Ø±ÙØ·Ø© Ø§ÙØ³ÙÙ Ø¹Ø´Ø§Ù ØªØªÙ Ø±ÙØ² Ù٠اÙÙ ÙØ§Ù اÙÙÙ Ù ÙØ§ÙسÙ٠ضعا٠ÙÙÙ.",steps:["List your top competitors","Analyze strengths and weaknesses","Compare pricing","Find your unique angle"],example:{competitors:`1. HubSpot â all-in-one, expensive 72. Mailchimp â email-focused, limited CRM`,differentiation:"Arabic-first, built for MENA market"},proTip:"Don't just track features â study their messaging, landing pages, and ad copy too."}}),positioning:h({slug:"positioning",emoji:"ð",name:"Brand Positioning",nameAr:"ØªÙ Ø±ÙØ² Ø§ÙØ¨Ø±Ø§Ùد",description:"Define your target audience, category, key benefit, and brand personality",descriptionAr:"ØØ¯Ø¯ ج٠ÙÙØ±ÙØ Ø§ÙÙØ§ØªÙØ¬ÙØ±ÙØ Ø§ÙÙ ÙØ²Ø© Ø§ÙØªÙØ§ÙØ³ÙØ©Ø ÙØ´Ø®ØµÙØ© Ø§ÙØ¨Ø±Ø§Ùد",fields:[t("targetAudience","Target Audience","Ø§ÙØ¬Ù ÙÙØ± اÙÙ Ø³ØªÙØ¯Ù","Who specifically is this positioning for?"),t("category","Market Category","اÙÙØ¦Ø© Ø§ÙØ³ÙÙÙØ©","What category do you compete in?",500),t("keyBenefit","Key Benefit","اÙÙØ§Ø¦Ø¯Ø© Ø§ÙØ±Ø¦ÙØ³ÙØ©","The single most important benefit you deliver"),t("reasonToBelieve","Reason to Believe","سبب Ø§ÙØªØµØ¯ÙÙ","Proof points, data, testimonials"),t("brandPersonality","Brand Personality","Ø´Ø®ØµÙØ© Ø§ÙØ¹Ùا٠ة","If your brand were a person, how would you describe them?"),t("positioningStatement","Positioning Statement","Ø¨ÙØ§Ù Ø§ÙØªÙ Ø±ÙØ²","For [target], [brand] is the [category] that [benefit] because [reason]")],guide:{what:"Brand Positioning defines how y
7ou want to be perceived in the market relative to competitors.",whatAr:"ØªÙ Ø±ÙØ² Ø§ÙØ¨Ø±Ø§Ùد ÙØØ¯Ø¯ ÙÙÙ ØªØ¨Ù Ø§ÙØ³ÙÙ ÙØ´ÙÙÙ Ù ÙØ§Ø±ÙØ© باÙÙ ÙØ§ÙسÙÙ.",steps:["Define your target audience","Choose your category","Articulate your key benefit","Write your positioning statement"],example:{positioningStatement:"For MENA marketing teams, DuckDash is the marketing OS that makes strategy execution bilingual and structured."},proTip:"A strong positioning statement should make your competitors' positioning feel incomplete."}}),"messaging-framework":h({slug:"messaging-framework",emoji:"ð¬",name:"Messaging Framework",nameAr:"ÙØ±ÙÙ ÙØ±Ù Ø§ÙØ±Ø³Ø§Ø¦Ù Ø§ÙØªØ³ÙÙÙÙØ©",description:"Core message, supporting messages by persona, elevator pitch, proof points",descriptionAr:"Ø§ÙØ±Ø³Ø§ÙØ© Ø§ÙØ£Ø³Ø§Ø³ÙØ©Ø Ø±Ø³Ø§Ø¦Ù ÙÙÙ Ø¨ÙØ±Ø³ÙÙØ§Ø اÙÙ elevator pitchØ ÙÙÙØ§Ø· Ø§ÙØ¥Ø«Ø¨Ø§Øª",fields:[t("coreMessage","Core Message","Ø§ÙØ±Ø³Ø§ÙØ© Ø§ÙØ£Ø³Ø§Ø³ÙØ©","The one thing you want every audience to remember"),t("supportingMessages","Supporting Messages by Persona","رسائ٠داع٠ة ØØ³Ø¨ Ø§ÙØ´Ø®ØµÙØ©","For each persona, what specific message resonates?"),t("elevatorPitch","Elevator Pitch (30 sec)","Ø§ÙØ¹Ø±Ø¶ Ø§ÙØ³Ø±Ùع","Explain what you do in 30 seconds"),t("taglines","Tagline Options","Ø®ÙØ§Ø±Ø§Øª Ø§ÙØ´Ø¹Ø§Ø±","3-5 short tagline candidates"),t("proofPoints","Proof Points","ÙÙØ§Ø· Ø§ÙØ¥Ø«Ø¨Ø§Øª","Stats, testimonials, case studies"),t("toneGuidelines","Tone Guidelines","إرشادات اÙÙØ¨Ø±Ø©","How should messages feel?")],guide:{what:"A Messaging Framework ensures everyone on your team communicates the same value consistently.",whatAr:"ÙØ±ÙÙ ÙØ±Ù Ø§ÙØ±Ø³Ø§Ø¦Ù ÙØ¶Ù ٠إ٠ÙÙ ÙØ±ÙÙÙ ÙØªÙÙ٠بÙÙØ³ اÙÙÙÙ Ø© ÙØ¨Ø´Ù٠٠تسÙ.",steps:["Write your core message","Adapt per persona","Craft elevator pitch","List proof points"],example:{coreMessage:"The only marketing OS built for MENA teams â bilingual, structured, actionable.",elevatorPitch:"DuckDash helps marketing teams in MENA plan, execute, and measure their marketing with 35 guided tools â all in Arabic and English."},proTip:"Test your elevator pitch on someone outside your industry. If they get it, you nailed it."}}),"voice-tone":h({slug:"voice-tone",emoji:"ðï¸",name:"Voice & Tone Guide",nameAr:"دÙÙÙ Ø§ÙØªÙÙ ÙØ§ÙÙ Voice",description:"Define brand personality, voice attributes, tone per channel, vocabulary guide",descriptionAr:"ØØ¯Ø¯ Ø´Ø®ØµÙØ© Ø§ÙØ¨Ø±Ø§ÙØ¯Ø ØµÙØªÙØ Ø§ÙØªÙÙ ØØ³Ø¨ ÙÙ ÙÙØ§Ø©Ø ÙØ§ÙÙ ØµØ·ÙØØ§Øª اÙ٠ستخد٠ة",fields:[t("voiceAttributes","Voice Attributes","س٠ات Ø§ÙØµÙت","3-5 adjectives describing your brand voice"),t("doList","Do's â We Sound Like","ÙØ¨Ø¯Ù ÙÙØ°Ø§","Example phrases we use"),t("dontList","Don'ts â We Never Sound Like","ÙØ§ ÙØ¨Ø¯Ù ÙÙØ°Ø§","Phrases and tones we avoid"),t("channelTone","Tone by Channel","اÙÙØ¨Ø±Ø© ØØ³Ø¨ اÙÙÙØ§Ø©","How tone shifts: Email vs Social vs Website vs Sales"),t("vocabulary","Key Vocabulary","اÙÙ ÙØ±Ø¯Ø§Øª Ø§ÙØ±Ø¦ÙØ³ÙØ©","Words we always use and words we avoid")],guide:{what:"A Voice & Tone Guide ensures your brand sounds consistent everywhere.",whatAr:"دÙÙÙ Ø§ÙØµÙت ÙØ§ÙÙØ¨Ø±Ø© ÙØ¶Ù Ù Ø¥Ù Ø¨Ø±Ø§ÙØ¯Ù ÙØªÙÙ٠بÙÙØ³ Ø§ÙØ·Ø±ÙÙØ© ÙÙ ÙÙ Ù ÙØ§Ù.",steps:["Define 3-5 voice attributes","Write do's and don'ts","Adjust tone per channel","Create vocabulary list"],example:{voiceAttributes:"Confident, Helpful, Direct, Warm, Expert",doList:`"Here's exactly how to do it" â "Let's break this down"`},proTip:"Read your copy out loud. If it doesn't sound like a real person talking, rewrite it."}}),okrs:h({slug:"okrs",emoji:"ð¯",name:"Marketing OKRs",nameAr:"اÙÙ OKRs Ø§ÙØªØ³ÙÙÙÙØ©",description:"Set quarterly objectives and key results for your marketing team",descriptionAr:"ØØ¯Ø¯ Ø£ÙØ¯Ø§Ù Ø§ÙØ±Ø¨Ø¹ ÙÙØªØ§Ø¦Ø¬ Ø±Ø¦ÙØ³ÙØ© ÙØ§Ø¨ÙØ© ÙÙÙÙØ§Ø³ ÙÙØ±ÙÙ Ø§ÙØªØ³ÙÙÙ",fields:[t("objective1","Objective 1","اÙÙØ¯Ù Ø§ÙØ£ÙÙ","What do you want to achieve this quarter?"),t("keyResults1","Key Results for Obj 1","ÙØªØ§Ø¦Ø¬ Ø±Ø¦ÙØ³ÙØ© ÙÙÙØ¯Ù 1","3 measurable results"),t("objective2","Objective 2","اÙÙØ¯Ù Ø§ÙØ«Ø§ÙÙ","Second quarterly objective"),t("keyResults2","Key Results for Obj 2","ÙØªØ§Ø¦Ø¬ Ø±Ø¦ÙØ³ÙØ© ÙÙÙØ¯Ù 2","Measurable results"),t("initiatives","Key Initiatives","اÙ٠بادرات Ø§ÙØ±Ø¦ÙØ³ÙØ©","What projects will drive these results?"),t("timeline","Timeline & Milestones","Ø§ÙØ¬Ø¯ÙÙ Ø§ÙØ²Ù ÙÙ","Key dates and checkpoints")],guide:{what:"Marketing OKRs align your team around measurable outcomes each quarter.",whatAr:"اÙÙ OKRs Ø§ÙØªØ³ÙÙÙÙØ© ØªÙØØ¯ ÙØ±ÙÙÙ ØÙÙ ÙØªØ§Ø¦Ø¬ ÙØ§Ø¨ÙØ© ÙÙÙÙØ§Ø³ Ù٠ربع.",steps:["Set 2-3 ambitious objectives","Define 3 measurable key results each","List initiatives","Set timeline"],example:{objective1:"Become the #1 marketing resource for MENA startups",keyResults1:`1. 10K MAU 82. 40% W/W retention 93. 500 paid subscribers`},proTip:"If you can't measure it, it's not a Key Result â it's a wish."}}),"pricing-strategy":h({slug:"pricing-strategy",emoji:"ð°",name:"Pricing Strategy",nameAr:"Ø§Ø³ØªØ±Ø§ØªÙØ¬ÙØ© Ø§ÙØªØ³Ø¹Ùر",description:"Value-based, competitive, and cost-plus pricing analysis",descriptionAr:"تØÙÙÙ Ø§ÙØªØ³Ø¹Ùر: ØØ³Ø¨ اÙÙÙÙ Ø©Ø Ø§ÙÙ ÙØ§ÙØ³Ø©Ø ÙØ§ÙتÙÙÙØ©",fields:[t("currentPricing","Current Pricing Model","ÙÙ ÙØ°Ø¬ Ø§ÙØªØ³Ø¹Ùر Ø§ÙØØ§ÙÙ","How do you price today?"),t("competitorPricing","Competitor Pricing","ØªØ³Ø¹ÙØ± اÙÙ ÙØ§ÙسÙÙ","How do competitors price?"),t("valueMetric","Value Metric","Ù ÙÙØ§Ø³ اÙÙÙÙ Ø©","What unit do customers pay for?",500),t("tiers","Tier Design","تص٠ÙÙ Ø§ÙØ¨Ø§Ùات","Describe your pricing tiers"),t("strategy","Pricing Strategy","Ø§ÙØ§Ø³ØªØ±Ø§ØªÙØ¬ÙØ©","Penetration, premium, freemium, value-based?")],guide:{what:"Pricing Strategy helps you find the price that maximizes revenue while staying competitive.",whatAr:"Ø§Ø³ØªØ±Ø§ØªÙØ¬ÙØ© Ø§ÙØªØ³Ø¹Ùر ØªØ³Ø§Ø¹Ø¯Ù ØªÙØ§ÙÙ Ø§ÙØ³Ø¹Ø± اÙÙÙ ÙØ²Ùد Ø§ÙØ¥Ùرادات ÙÙØ¨ÙÙ ØªÙØ§ÙسÙ.",steps:["Document current pricing","Research competitors","Identify value metric","Design tiers","Choose strategy"],example:{valueMetric:"Per workspace per month",tiers:"Free: 4 tools | Solo $19/mo: all 35 tools | Lifetime $149: forever"},proTip:"Price based on value created, not cost to deliver."}}),"gtm-planner":h({slug:"gtm-planner",emoji:"ð",name:"Go-To-Market Plan",nameAr:"خطة Go-To-Market",description:"Launch strategy: timeline, channels, messaging, success metrics",descriptionAr:"خطة Ø§ÙØ¥Ø·ÙاÙ: Ø§ÙØªØ§ÙÙ ÙØ§ÙÙØ اÙÙÙÙØ§ØªØ Ø§ÙØ±Ø³Ø§Ø¦ÙØ ÙÙ ÙØ§ÙÙØ³ اÙÙØ¬Ø§Ø",f
9ields:[t("targetMarket","Target Market for Launch","Ø§ÙØ³Ù٠اÙÙ Ø³ØªÙØ¯Ù ÙÙØ¥Ø·ÙاÙ","Who are you launching to first?"),t("channels","Launch Channels","ÙÙÙØ§Øª Ø§ÙØ¥Ø·ÙاÙ","Which channels for launch?"),t("timeline","Launch Timeline","Ø§ÙØ¬Ø¯ÙÙ Ø§ÙØ²Ù ÙÙ ÙÙØ¥Ø·ÙاÙ","Key milestones and dates"),t("messaging","Launch Messaging","Ø±Ø³Ø§Ø¦Ù Ø§ÙØ¥Ø·ÙاÙ","Core launch message, hooks, angles"),t("successMetrics","Success Metrics","Ù ÙØ§ÙÙØ³ اÙÙØ¬Ø§Ø","How will you measure launch success?"),t("risks","Risks & Mitigation","اÙ٠خاطر ÙØ§ÙتخÙÙÙ","What could go wrong?")],guide:{what:"A Go-To-Market Plan is your launch playbook â who, where, what message, and how to measure.",whatAr:"خطة اÙÙ GTM Ù٠دÙÙÙ Ø§ÙØ¥Ø·Ùا٠â Ù ÙÙ ØªØ³ØªÙØ¯ÙØ ÙÙÙØ Ø¨Ø£Ù Ø±Ø³Ø§ÙØ©Ø ÙÙÙ٠تÙÙØ³.",steps:["Define launch audience","Choose channels","Set timeline","Craft messaging","Define success metrics"],example:{targetMarket:"Marketing managers at MENA startups (Series A-B)",channels:"Product Hunt, LinkedIn, Twitter/X"},proTip:"Launch is not a moment â it's a campaign. Plan for 2+ weeks of sustained push."}}),"ad-copy":h({slug:"ad-copy",emoji:"âï¸",name:"Ad Copy Workshop",nameAr:"ÙØ±Ø´Ø© ÙØªØ§Ø¨Ø© Ø§ÙØ¥Ø¹ÙØ§ÙØ§Øª",description:"Create ad copy variations for Meta, Google, LinkedIn using AIDA/PAS frameworks",descriptionAr:"Ø§ÙØªØ¨ ÙØ³Ø® Ø¥Ø¹ÙØ§ÙÙØ© ÙÙ ÙØªØ§ ÙØ¬Ùج٠ÙÙÙÙÙØ¯Ø¥Ù باستخدا٠AIDA/PAS",fields:[t("platform","Platform","اÙÙ ÙØµØ©","Which platform? (Meta, Google, LinkedIn, TikTok)",500),t("objective","Ad Objective","ÙØ¯Ù Ø§ÙØ¥Ø¹ÙاÙ","Awareness, consideration, or conversion?",500),t("audience","Target Audience","Ø§ÙØ¬Ù ÙÙØ± اÙÙ Ø³ØªÙØ¯Ù","Who is this ad for?"),t("headlines","Headline Options (3-5)","Ø®ÙØ§Ø±Ø§Øª Ø§ÙØ¹ÙÙØ§Ù","Short, punchy headlines"),t("bodyCopy","Body Copy Variations","ÙØ³Ø® اÙÙØµ","2-3 body copy versions"),t("cta","Call to Action","Ø¯Ø¹ÙØ© ÙÙØ¥Ø¬Ø±Ø§Ø¡","What action? (Learn More, Sign Up, Buy Now)",500)],guide:{what:"The Ad Copy Workshop helps you write high-converting ad copy using AIDA and PAS frameworks.",whatAr:"ÙØ±Ø´Ø© Ø§ÙØ¥Ø¹ÙØ§ÙØ§Øª ØªØ³Ø§Ø¹Ø¯Ù ØªÙØªØ¨ ÙØ³Ø® Ø¥Ø¹ÙØ§ÙÙØ© بتØÙÙ٠عاÙÙ.",steps:["Choose platform and objective","Define audience","Write 3-5 headlines","Create body copy","Pick strongest CTA"],example:{headlines:`1. Stop guessing your marketing strategy 102. 35 tools. One OS. Zero confusion.`,cta:"Start Free â"},proTip:"Write 10 headlines, then pick the best 3. First ideas are rarely best."}}),"email-sequences":h({slug:"email-sequences",emoji:"ð§",name:"Email Sequence Builder",nameAr:"Ø¨ÙØ§Ø¡ Ø§ÙØ¥ÙÙ Ù٠سÙÙÙÙØ³",description:"Design email sequences: welcome, nurture, launch, re-engagement",descriptionAr:"ØµÙ Ù ØªØ³ÙØ³Ùات Ø§ÙØ¥ÙÙ ÙÙ: ترØÙØ¨Ø nurtureØ Ø¥Ø·ÙØ§ÙØ ÙØ§Ø³ØªØ±Ø¬Ø§Ø¹",fields:[t("sequenceType","Sequence Type","ÙÙØ¹ Ø§ÙØªØ³ÙسÙ","Welcome, nurture, launch, re-engagement?",500),t("emails","Email Outlines","٠خططات Ø§ÙØ¥ÙÙ ÙÙØ§Øª","For each email: subject line, hook, CTA",3e3),t("timing","Send Timing","تÙÙÙØª Ø§ÙØ¥Ø±Ø³Ø§Ù","Delay between emails"),t("segmentation","Audience Segment","Ø´Ø±ÙØØ© Ø§ÙØ¬Ù ÙÙØ±","Who receives this? Entry trigger?")],guide:{what:"Email Sequences automate your communication â from welcoming signups to re-engaging churned users.",whatAr:"ØªØ³ÙØ³Ùات Ø§ÙØ¥ÙÙ Ù٠تأت٠ت ØªÙØ§ØµÙÙ â Ù Ù Ø§ÙØªØ±ØÙب ÙÙØ§Ø³ØªØ±Ø¬Ø§Ø¹.",steps:["Choose sequence type","Outline each email","Set timing","Define audience segment"],example:{sequenceType:"Welcome sequence",emails:`Email 1 (Day 0): Welcome + quick win 11Email 2 (Day 2): Feature walkthrough 12Email 3 (Day 5): Case study + CTA`},proTip:"The best email sequences feel like a helpful friend, not a sales robot."}}),"landing-page":h({slug:"landing-page",emoji:"ð",name:"Landing Page Planner",nameAr:"٠خطط اÙÙØ§ÙØ¯ÙØ¬ Ø¨ÙØ¬",description:"Plan high-converting landing pages with copy framework and conversion checklist",descriptionAr:"خطط ÙØ§ÙØ¯ÙØ¬ Ø¨ÙØ¬ بتØÙÙÙ: اÙÙÙØ¨ÙØ Ø§ÙÙÙÙÙØ ÙØªØ´ÙÙÙÙØ³Øª Ø§ÙØªØÙÙÙ",fields:[t("headline","Hero Headline","Ø§ÙØ¹ÙÙØ§Ù Ø§ÙØ±Ø¦ÙسÙ","Main headline â clear benef
12it statement",500),t("subheadline","Sub-headline","Ø§ÙØ¹ÙÙØ§Ù اÙÙØ±Ø¹Ù","Supporting detail, 1-2 sentences"),t("sections","Page Sections","Ø£ÙØ³Ø§Ù Ø§ÙØµÙØØ©","List sections: Hero, Benefits, Social Proof, Pricing, FAQ, CTA"),t("socialProof","Social Proof","Ø§ÙØ¯ÙÙÙ Ø§ÙØ§Ø¬ØªÙ اعÙ","Testimonials, logos, stats"),t("cta","Primary CTA","Ø§ÙØ¯Ø¹ÙØ© Ø§ÙØ±Ø¦ÙØ³ÙØ©","Button text and destination",500),t("objections","Objection Handling","Ù Ø¹Ø§ÙØ¬Ø© Ø§ÙØ§Ø¹ØªØ±Ø§Ø¶Ø§Øª","FAQ items addressing hesitations")],guide:{what:"The Landing Page Planner helps you structure a high-converting page before you build it.",whatAr:"٠خطط اÙÙØ§ÙØ¯ÙØ¬ Ø¨ÙØ¬ ÙØ³Ø§Ø¹Ø¯Ù تبÙÙ ØµÙØØ© بتØÙÙ٠عاÙÙ ÙØ¨Ù ٠ا ØªØµÙ Ù ÙØ§.",steps:["Write compelling headline","Add sub-headline","Plan sections","Add social proof","Define CTA"],example:{headline:"Your marketing strategy, finally organized",cta:"Start Free â No credit card required"},proTip:"Every section should answer: 'Why should I care?' If it doesn't, cut it."}}),"social-planner":h({slug:"social-planner",emoji:"ð±",name:"Social Media Planner",nameAr:"٠خطط Ø§ÙØ³ÙØ´ÙØ§Ù Ù ÙØ¯Ùا",description:"Platform-specific content planning with optimal times and hashtag strategy",descriptionAr:"ØªØ®Ø·ÙØ· Ù ØØªÙÙ ÙÙÙ Ù ÙØµØ©: Ø£ÙØ¶Ù Ø£ÙÙØ§Øª اÙÙØ´Ø± ÙØ§Ø³ØªØ±Ø§ØªÙØ¬ÙØ© اÙÙØ§Ø´ØªØ§Ø¬Ø§Øª",fields:[t("platforms","Active Platforms","اÙÙ ÙØµØ§Øª اÙÙØ´Ø·Ø©","Which platforms? Goals per platform"),t("pillars","Content Pillars","أع٠دة اÙÙ ØØªÙÙ","3-5 content themes"),t("frequency","Posting Frequency","٠عد٠اÙÙØ´Ø±","How often per platform per week?"),t("bestTimes","Optimal Posting Times","Ø£ÙØ¶Ù Ø£ÙÙØ§Øª اÙÙØ´Ø±","Best days/times per platform"),t("hashtags","Hashtag Strategy","Ø§Ø³ØªØ±Ø§ØªÙØ¬ÙØ© اÙÙØ§Ø´ØªØ§Ù","Core, trending, branded hashtags")],guide:{what:"The Social Media Planner helps you create a consistent, strategic presence across platforms.",whatAr:"٠خطط Ø§ÙØ³ÙØ´ÙØ§Ù ÙØ³Ø§Ø¹Ø¯Ù تبÙÙ ØØ¶Ùر Ù ØªØ³Ù ÙØ§Ø³ØªØ±Ø§ØªÙجÙ.",steps:["Choose platforms","Define content pillars","Set frequency","Research best times","Build hashtag strategy"],example:{pillars:`1. Educational 132. Behind the scenes 143. Customer stories 154. Industry trends 165. Product updates`,frequency:"LinkedIn: 3x/week | Twitter: daily | Instagram: 4x/week"},proTip:"Pick 2-3 platforms and dominate them. You don't need to be everywhere."}}),"outreach-sequences":h({slug:"outreach-sequences",emoji:"ð¨",name:"Outreach Sequence Designer",nameAr:"تص٠Ù٠رسائ٠اÙÙ Outreach",description:"Multi-touch outreach: cold email, LinkedIn, follow-up cadences",descriptionAr:"ØµÙ Ù Ø±Ø³Ø§Ø¦Ù Ø§ÙØªÙاصÙ: cold emailØ ÙÙÙÙØ¯Ø¥ÙØ ÙØ¬Ø¯Ù٠اÙÙÙÙ٠أب",fields:[t("targetProfile","Target Profile","اÙÙ Ù٠اÙÙ Ø³ØªÙØ¯Ù","Who are you reaching out to?"),t("touchpoints","Touchpoint Sequence","ØªØ³ÙØ³Ù ÙÙØ§Ø· Ø§ÙØ§ØªØµØ§Ù","Email 1 â LinkedIn â Email 2 â etc."),t("templates","Message Templates","ÙÙØ§Ùب Ø§ÙØ±Ø³Ø§Ø¦Ù","Template for each touchpoint",3e3),t("timing","Cadence","Ø§ÙØ¥ÙÙØ§Ø¹","Timing between each touchpoint")],guide:{what:"Outreach Sequences help you design multi-channel prospecting campaigns that get replies.",whatAr:"تص٠Ù٠اÙÙ Outreach ÙØ³Ø§Ø¹Ø¯Ù تبÙÙ ØÙ ÙØ§Øª ØªÙØ§ØµÙ ٠تعددة اÙÙÙÙØ§Øª ØªØ¬ÙØ¨ Ø±Ø¯ÙØ¯.",steps:["Define target profile","Design touchpoint sequence","Write templates","Set cadence"],example:{touchpoints:`Day 1: Cold email 17Day 3: LinkedIn connect 18Day 5: Follow-up email 19Day 8: LinkedIn message 20Day 12: Break-up email`},proTip:"Personalize the first line of every message. Generic outreach gets ignored."}}),"sales-scripts":h({slug:"sales-scripts",emoji:"ð",name:"Sales Scripts & Objections",nameAr:"Ø³ÙØ±Ùبتات اÙÙ Ø¨ÙØ¹Ø§Øª",description:"Discovery call scripts, objection handling playbook, closing frameworks",descriptionAr:"Ø³ÙØ±Ùبتات اÙÙ discovery callØ Ø§ÙØ±Ø¯ عÙÙ Ø§ÙØ§Ø¹ØªØ±Ø§Ø¶Ø§ØªØ ÙØ·Ø±Ù Ø§ÙØ¥ØºÙاÙ",fields:[t("discoveryQuestions","Discovery Call Questions","Ø£Ø³Ø¦ÙØ© Ù ÙØ§ÙÙ Ø© Ø§ÙØ§ÙتشاÙ","10-15 questions to understand needs",3e3),t("demoScript","Demo Script Outline","٠خطط Ø³ÙØ±Ùبت Ø§ÙØ¹Ø±Ø¶","Key talking points, transitions"),t("objections","Objection Handling","Ù Ø¹Ø§ÙØ¬Ø© Ø§ÙØ§Ø¹ØªØ±Ø§Ø¶Ø§Øª","Top 10 objections and responses",3e3),t("closingFramework","Closing Framework","إطار Ø§ÙØ¥ØºÙاÙ","How do you ask for the sale?")],guide:{what:"Sales Scripts give your team a proven playbook for discovery, demos, and closing.",whatAr:"Ø³ÙØ±Ùبتات اÙÙ Ø¨ÙØ¹Ø§Øª ØªØ¹Ø·Ù ÙØ±ÙÙ٠دÙÙÙ Ù Ø¬Ø±ÙØ¨ ÙÙÙ ÙØ§Ù٠ات ÙØ§ÙØ¹Ø±ÙØ¶ ÙØ§ÙØ¥ØºÙØ§Ù.",steps:["Write discovery questions","Outline demo script","List objections with responses","Define closing framework"],example:{discoveryQuestions:`1. What's your biggest marketing challenge? 212. How are you solving it now? 223. What would success look like in 90 days?`},proTip:"The best salespeople ask more questions than they answer."}}),"funnel-analytics":h({slug:"funnel-analytics",emoji:"ð",name:"Funnel Analytics",nameAr:"تØÙÙ٠اÙÙØ§ÙÙ",description:"Track conversion rates by funnel stage and identify bottlenecks",descriptionAr:"تابع Ù Ø¹Ø¯ÙØ§Øª Ø§ÙØªØÙÙÙ ÙÙ Ù٠٠رØÙØ© ٠٠اÙÙØ§ÙÙ ÙØØ¯Ø¯ Ø§ÙØ§Ø®ØªÙØ§ÙØ§Øª",fields:[t("stages","Fu
22nnel Stages","٠راØÙ اÙÙ٠ع","Define stages: Visitor â Lead â MQL â SQL â Customer"),t("currentRates","Current Conversion Rates","Ù Ø¹Ø¯ÙØ§Øª Ø§ÙØªØÙÙÙ Ø§ÙØØ§ÙÙØ©","Rate between each stage"),t("benchmarks","Industry Benchmarks","اÙ٠عاÙÙØ± اÙÙÙØ§Ø³ÙØ©","Typical rates in your industry"),t("bottlenecks","Identified Bottlenecks","Ø§ÙØ§Ø®ØªÙØ§ÙØ§Øª","Biggest drop-off points"),t("improvements","Improvement Plan","خطة Ø§ÙØªØØ³ÙÙ","Changes to test at each bottleneck")],guide:{what:"Funnel Analytics helps you see exactly where prospects drop off and what to fix.",whatAr:"تØÙÙ٠اÙÙØ§ÙÙ ÙÙØ±ÙÙ Ø¨Ø§ÙØ¶Ø¨Ø· ÙÙÙ Ø§ÙØ¹Ù ÙØ§Ø¡ اÙÙ ØØªÙ ÙÙÙ ÙØ·ÙعÙÙ ÙØ¥ÙØ´ ØªØµÙØ.",steps:["Define funnel stages","Document conversion rates","Compare to benchmarks","Identify bottlenecks","Plan improvements"],example:{stages:"Visitor â Signup â Activated â Paid",currentRates:"VisitorâSignup: 3.2% | SignupâActivated: 45% | ActivatedâPaid: 8%"},proTip:"Fix the biggest bottleneck first. A 2x improvement at one stage beats small gains everywhere."}}),"weekly-review":h({slug:"weekly-review",emoji:"ð",name:"Weekly Review",nameAr:"اÙ٠راجعة Ø§ÙØ£Ø³Ø¨ÙØ¹ÙØ©",description:"Structured weekly review: what worked, learnings, next week priorities",descriptionAr:"٠راجعة Ø£Ø³Ø¨ÙØ¹ÙØ© Ù ÙØ¸Ù Ø©: Ø¥ÙÙ Ø§Ø´ØªØºÙØ Ø§ÙØ¯Ø±ÙØ³Ø ÙØ£ÙÙÙÙØ§Øª Ø§ÙØ£Ø³Ø¨Ùع Ø§ÙØ¬Ø§Ù",fields:[t("wins","Wins This Week","Ø¥ÙØ¬Ø§Ø²Ø§Øª Ø§ÙØ£Ø³Ø¨Ùع","What went well?"),t("misses","Misses & Challenges","Ø§ÙØªØØ¯Ùات","What didn't work?"),t("metrics","Key Metrics Update","ØªØØ¯ÙØ« اÙÙ ÙØ§ÙÙØ³","KPIs vs targets"),t("learnings","Key Learnings","Ø§ÙØ¯Ø±Ùس اÙÙ Ø³ØªÙØ§Ø¯Ø©","What to apply next week?"),t("nextWeek","Next Week Priorities","Ø£ÙÙÙÙØ§Øª Ø§ÙØ£Ø³Ø¨Ùع اÙÙØ§Ø¯Ù ","Top 3-5 priorities")],guide:{what:"The Weekly Review creates a habit of reflection and continuous improvement.",whatAr:"اÙ٠راجعة Ø§ÙØ£Ø³Ø¨ÙØ¹ÙØ© تبÙ٠عادة Ø§ÙØªØ£Ù Ù ÙØ§ÙØªØØ³Ù٠اÙ٠ست٠ر ÙØªØ³ÙÙÙÙ.",steps:["List wins","Document misses","Update metrics","Extract learnings","Set next week priorities"],example:{wins:"Blog post got 2.5K views, 3 new leads from LinkedIn",misses:"Email open rate dropped to 18%",nextWeek:`1. A/B test subject lines 232. Publish case study 243. Launch retargeting`},proTip:"Do this every Friday at 4pm. Consistency turns a review into a growth engine."}})};function ce(s,i){return{slug:s,emoji:"ð ï¸",name:s,nameAr:s,description:`Complete the ${s}
24 for your marketing strategy.`,descriptionAr:"",fields:[{id:"content",label:"Your content",labelAr:"اÙÙ
ØØªÙÙ",prompt:`Fill in your ${s}`,promptAr:"",placeholder:"Start writing here...",maxChars:2e3}],guide:{what:`Use this tool to build out your ${s} in the ${i} section.`,whatAr:"",steps:["Fill in the fields","Save your progress","Mark as done when complete"],example:{},proTip:"Done is better than perfect â fill in what you know today."},output:()=>[]}}const de=({tool:s,data:i,onChange:n})=>{const[a,r]=g.useState(null),p=s.output(i),c=Object.values(i).some(o=>typeof o=="string"&&o.trim().length>0);return e.jsxs("div",{className:"space-y-5",children:[s.customRender&&e.jsxs("div",{className:"lg:hidden bg-blue-50 border border-blue-100 rounded-xl p-3 flex items-center gap-2",children:[e.jsx("span",{className:"text-sm",children:"ð¥ï¸"}),e.jsx("p",{className:"text-xs text-blue-700 font-medium",children:"Best experienced on desktop for the full canvas view"})]}),!c&&!s.customRender&&e.jsxs("div",{className:"bg-white border-2 border-dashed border-stone-200 rounded-xl p-8 text-center",children:[e.jsx("p",{className:"text-2xl mb-2",children:"âï¸"}),e.jsx("p",{className:"text-sm font-semibold text-stone-700",children:"Get started by filling in the first field below"}),e.jsx("p",{className:"text-xs text-stone-400 mt-1",children:"Your progress auto-saves as you type"}),e.jsx("p",{className:"font-arabic text-[10px] text-stone-400 mt-1",dir:"rtl",children:"ابدأ بÙ
ÙØ¡ Ø§ÙØÙÙ Ø§ÙØ£ÙÙ Ø£Ø¯ÙØ§Ù"})]}),s.customRender?e.jsx("div",{className:"bg-white border border-stone-200 rounded-xl p-5 shadow-card",children:s.customRender(i,n)}):s.fields.map(o=>{const f=i[o.id]??"";return e.jsxs("div",{className:"bg-white border border-stone-200 rounded-xl p-5 shadow-card",children:[e.jsxs("div",{className:"mb-3",children:[e.jsx("p",{className:"text-xs font-bold text-stone-500 uppercase tracking-widest",children:o.label}),e.jsx("p",{className:"font-arabic text-[9px] text-stone-400 mt-0.5",dir:"rtl",children:o.labelAr}),e.jsx("p",{className:"text-sm font-semibold text-stone-900 mt-2",children:o.prompt}),e.jsx("p",{className:"font-arabic text-xs text-stone-400 mt-0.5",dir:"rtl",children:o.promptAr})]}),e.jsxs("div",{className:"relative",children:[e.jsx("textarea",{value:f,onChange:T=>n(o.id,T.target.value),placeholder:o.placeholder,maxLength:o.maxChars,rows:3,className:"w-full text-sm text-stone-800 border border-stone-200 rounded-lg px-3 py-2.5 bg-stone-50 resize-none focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors placeholder:text-stone-300"}),e.jsxs("p",{className:"text-right text-[10px] text-stone-300 mt-1",children:[f.length,"/",o.maxChars]})]})]},o.id)}),p.length>0&&e.jsxs("div",{className:"bg-emerald-50 border border-emerald-100 rounded-xl p-5",children:[e.jsx("p",{className:"text-xs font-bold text-primary uppercase tracking-widest mb-4",children:"⦠Auto-generated Output"}),p.map((o,f)=>e.jsxs("div",{className:f>0?"mt-4":"",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold text-stone-700",children:o.label}),e.jsx("p",{className:"font-arabic text-[9px] text-stone-400",dir:"rtl",children:o.labelAr})]}),e.jsxs("button",{onClick:()=>{navigator.clipboard.writeText(o.value),r(o.label),setTimeout(()=>r(null),2e3)},className:"flex items-center gap-1 text-[10px] text-stone-400 hover:text-primary transition-colors",children:[a===o.label?e.jsx($,{size:11}):e.jsx(ie,{size:11}),a===o.label?"Copied!":"Copy"]})]}),e.jsxs("p",{className:"text-sm text-stone-800 italic leading-relaxed bg-white rounded-lg px-3 py-2.5 border border-emerald-100",children:['"',o.value,'"']})]},f)),e.jsxs("button",{className:"mt-3 flex items-center gap-1.5 text-xs text-stone-400 hover:text-primary transition-colors",children:[e.jsx(K,{size:11})," Generate with AI â¦",e.jsx("span",{className:"text-[9px] opacity-60",children:"(coming soon)"})]})]})]})},ue=({tool:s})=>{const[i,n]=g.useState(!1),[a,r]=g.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"bg-white border border-stone-200 rounded-xl p-4 shadow-card",children:[e.jsx("p",{className:"text-xs font-bold text-stone-500 uppercase tracking-widest mb-2",children:"What is this?"}),e.jsx("p",{className:"text-sm text-stone-700 leading-relaxed",children:s.guide.what}),s.guide.whatAr&&e.jsx("p",{className:"font-arabic text-xs text-stone-400 mt-2",dir:"rtl",children:s.guide.whatAr})]}),e.jsxs("div",{className:"bg-white border border-stone-200 rounded-xl p-4 shadow-card",children:[e.jsx("p",{className:"text-xs font-bold text-stone-500 uppercase tracking-widest mb-2",children:"How to fill this"}),e.jsx("ol",{className:"space-y-1.5",children:s.guide.steps.map((p,c)=>e.jsxs("li",{className:"flex items-start gap-2 text-xs text-stone-600",children:[e.jsxs("span",{className:"font-mono text-stone-300 flex-shrink-0 mt-0.5",children:[c+1,"."]}),p]},c))})]}),Object.keys(s.guide.example).length>0&&e.jsxs("div",{className:"bg-white border border-stone-200 rounded-xl overflow-hidden shadow-card",children:[e.jsxs("button",{className:"w-full flex items-center justify-between px-4 py-3 text-xs font-bold text-stone-500 uppercase tracking-widest",onClick:()=>n(!i),children:[e.jsx("span",{children:"Example"}),i?e.jsx(z,{size:13}):e.jsx(E,{size:13})]}),i&&e.jsx("div",{className:"px-4 pb-4 space-y-2.5 border-t border-stone-100",children:Object.entries(s.guide.example).map(([p,c])=>e.jsxs("div",{className:"bg-stone-50 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[9px] font-semibold text-stone-400 uppercase mb-1",children:p}),e.jsxs("p",{className:"text-xs text-stone-700 italic",children:['"',c,'"']})]},p))})]}),e.jsxs("div",{className:"bg-white border border-stone-200 rounded-xl overflow-hidden shadow-card",children:[e.jsxs("button",{className:"w-full flex items-center justify-between px-4 py-3 text-xs font-bold text-stone-500 uppercase tracking-widest",onClick:()=>r(!a),children:[e.jsx("span",{children:"⦠Pro Tip"}),a?e.jsx(z,{size:13}):e.jsx(E,{size:13})]}),a&&e.jsx("div",{className:"px-4 pb-4 border-t border-stone-100",children:e.jsx("p",{className:"text-xs text-stone-600 leading-relaxed mt-3",children:s.guide.proTip})})]})]})};function ye({section:s}){const{toolSlug:i}=J(),{workspace:n,profile:a,subscription:r,isLoading:p}=G(),c=i?i.split("-").map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join(" "):"Tool",o=i&&H[i]?H[i]:ce(c,s),[f,T]=g.useState(null);g.useEffect(()=>{i&&W.from("tools").select("is_free").eq("slug",i).maybeSingle().then(({data:l})=>{T((l==null?void 0:l.is_free)??!1)})},[i]);const N=(r==null?void 0:r.plan)??(a==null?void 0:a.plan)??"free",L=r==null?void 0:r.status,F=f===!1&&!(N!=="free"&&L!=="expired"&&L!=="suspended"),[u,y]=g.useState({}),[m,b]=g.useState("empty"),[C,d]=g.useState("idle"),[A,w]=g.useState(!1),v=g.useRef(null),j=re(i,u,(l,x)=>{q(l,x)},A);g.useEffect(()=>{!(n!=null&&n.id)||!i||(w(!1),(async()=>{const{data:l,error:x}=await W.from("tool_data").select("*").eq("workspace_id",n.id).eq("tool_slug",i).maybeSingle();if(x&&x.code!=="PGRST116"){console.error("[ToolPage] Failed to load data:",x),O.error("Couldn't load your saved work. Check your connection and refresh â editing is disabled to protect your data.");return}l&&(y(l.data??{}),b(l.status)),w(!0)})())},[n==null?void 0:n.id,i]);const P=g.useCallback(async(l,x)=>{if(!(n!=null&&n.id)||!i){console.warn("[ToolPage] Cannot save â missing workspace or toolSlug"),d("idle");return}d("saving");const S=Object.values(l).filter(R=>
24typeof R=="string"&&R.trim().length>0).length,M=o.fields.length||1,I=x==="done"?100:Math.round(S/M*100),{error:D}=await W.from("tool_data").upsert({workspace_id:n.id,tool_slug:i,data:l,status:x,progress_pct:I,updated_at:new Date().toISOString()},{onConflict:"workspace_id,tool_slug"});D?(console.error("[ToolPage] Save failed:",D),d("idle"),O.error("Couldn't save your changes â check your connection and try again.")):(d("saved"),setTimeout(()=>d("idle"),2500))},[n==null?void 0:n.id,i,o.fields.length]),q=(l,x)=>{if(!A)return;const S={...u,[l]:x};y(S);const M=m==="done"?"done":"in_progress";m==="empty"&&b("in_progress"),v.current&&clearTimeout(v.current),n!=null&&n.id&&i&&(v.current=setTimeout(()=>P(S,M),1e3))},Q=async()=>{if(!(n!=null&&n.id)||!i||!A)return;const l=m==="done"?"in_progress":"done";v.current&&clearTimeout(v.current),d("saving");const x=Object.values(u).filter(D=>typeof D=="string"&&D.trim().length>0).length,S=o.fields.length||1,M=l==="done"?100:Math.round(x/S*100),{error:I}=await W.from("tool_data").upsert({workspace_id:n.id,tool_slug:i,data:u,status:l,progress_pct:M,updated_at:new Date().toISOString()},{onConflict:"workspace_id,tool_slug"});if(I){console.error("[ToolPage] Mark as Done failed:",I),d("idle"),O.error("Couldn't update the tool status â check your connection and try again.");return}b(l),d("saved"),setTimeout(()=>d("idle"),2500)},_={empty:{label:"Not Started",color:"bg-stone-100 text-stone-400"},in_progress:{label:"In Progress",color:"bg-amber-50 text-amber-600"},done:{label:"Done â",color:"bg-emerald-50 text-primary"}}[m];return F?e.jsx(X,{toolName:o.name,toolEmoji:o.emoji}):e.jsxs("div",{className:"min-h-full pb-20 animate-fade-in",children:[e.jsx("div",{className:"px-4 sm:px-6 pt-4 sm:pt-5 pb-3 sm:pb-4 border-b border-stone-200 bg-white sticky top-0 z-10",children:e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsxs("nav",{className:"text-[10px] text-stone-400 mb-2 flex items-center gap-1.5 font-mono",children:[e.jsx(B,{to:"/os",className:"hover:text-stone-600 transition-colors",children:"Dashboard"}),e.jsx("span",{children:"/"}),e.jsx(B,{to:`/os/${s}`,className:"hover:text-stone-600 transition-colors capitalize",children:s}),e.jsx("span",{children:"/"}),e.jsx("span",{className:"text-stone-600",children:o.name})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(B,{to:`/os/${s}`,className:"p-1.5 rounded-lg hover:bg-stone-100 text-stone-400 hover:text-stone-600 transition-colors flex-shrink-0",children:e.jsx(Z,{size:15})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-xl",children:o.emoji}),e.jsx("h1",{className:"text-base sm:text-lg font-bold text-stone-900",children:o.name}),e.jsx("p",{className:"font-arabic text-[10px] text-stone-400 hidden sm:block",dir:"rtl",children:o.nameAr}),e.jsx("span",{className:`text-[10px] font-semibold px-2 py-0.5 rounded-full ${_.color}`,children:_.label})]}),e.jsx("p",{className:"text-xs text-stone-500 mt-0.5 ml-8 sm:ml-10 truncate",children:o.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 ml-8 sm:ml-0",children:[C==="saving"&&e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-stone-400",children:[e.jsx(te,{size:10,className:"animate-pulse"})," Savingâ¦"]}),C==="saved"&&e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-primary font-medium",children:[e.jsx($,{size:10})," Saved"]}),e.jsxs("button",{onClick:Q,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold transition-all ${m==="done"?"bg-primary text-primary-foreground hover:opacity-90":"border border-stone-200 text-stone-600 hover:border-primary hover:text-primary"}`,children:[m==="done"?e.jsx(ee,{size:12}):e.jsx(se,{size:12}),m==="done"?"Completed â":"Mark as Done"]})]})]})]})}),e.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 py-4 sm:py-6",children:e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx(le,{suggestions:j.suggestions,dismissed:j.dismissed,onApplyAll:j.applyAll,onDismiss:j.dismiss}),e.jsx(de,{tool:o,data:u,onChange:q})]}),e.jsx("div",{className:"w-72 xl:w-80 flex-shrink-0 hidden lg:block",children:e.jsxs("div",{className:"sticky top-24",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("p",{className:"text-xs font-bold text-stone-500 uppercase tracking-widest",children:"Guide"}),e.jsx("p",{className:"font-arabic text-[9px] text-stone-400",dir:"rtl",children:"دÙÙÙ"})]}),e.jsx(ue,{tool:o})]})})]})})]})}export{ue as GuidePanel,H as TOOLS,de as TextBuilder,ye as default,ce as genericTool};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.