var e=Object.defineProperty,s=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,a=(s,t,l)=>t in s?e(s,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[t]=l;import{j as r,v as i}from"./radix-ui-CVZWoPyd.js";import{r as n}from"./react-vendor-BmlOtb7g.js";import{d as c,B as o,S as d}from"./index-BCSgDlp8.js";import{C as m,b as x,c as h,a as p}from"./card-BrVzo7bW.js";import{B as b}from"./badge-CHmVsFC8.js";import{S as u}from"./SEO-BGpcOjpb.js";import{A as j}from"./AppSidebar-BQ3UxiE1.js";import{b as g,a as f}from"./react-router-DzDVDRUd.js";import{A as N}from"./arrow-left-C1RZbPAl.js";import{B as v}from"./building-2-xmYyS5DZ.js";import{M as w}from"./map-pin-BNow_pFf.js";import{T as y}from"./trending-up-DMpQ-MB3.js";import{C as k}from"./clock-Ci74tMNm.js";import{T as _}from"./tag-jWhWv7mv.js";import{E as $}from"./external-link-DuZiTz8-.js";import"./supabase-C8kocL5G.js";import"./utils-Ceo22G_t.js";import"./use-mobile-onbIdywO.js";import"./CheckoutButton-BXcL0vXQ.js";import"./analytics-CgKQjs6u.js";import"./arrow-right-CcptuZBy.js";import"./wrench-n19foI4n.js";import"./x-DIEzjPMA.js";import"./log-out-DrMwdybL.js";import"./briefcase-Cj6O7NU7.js";import"./circle-plus-C5zM2HoU.js";import"./sparkles-D1jOictl.js";import"./book-open-D7nUFbtH.js";import"./settings-BQk8nNSr.js";import"./chevron-right-D_Z5YBDv.js";import"./chevron-left-D5q9zZf8.js";import"./credit-card-CUy9-vWB.js";const S=n.forwardRef((e,n)=>{var o=e,{className:d,orientation:m="horizontal",decorative:x=!0}=o,h=((e,a)=>{var r={};for(var i in e)t.call(e,i)&&a.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&s)for(var i of s(e))a.indexOf(i)<0&&l.call(e,i)&&(r[i]=e[i]);return r})(o,["className","orientation","decorative"]);return r.jsx(i,((e,r)=>{for(var i in r||(r={}))t.call(r,i)&&a(e,i,r[i]);if(s)for(var i of s(r))l.call(r,i)&&a(e,i,r[i]);return e})({ref:n,decorative:x,orientation:m,className:c("shrink-0 bg-border","horizontal"===m?"h-[1px] w-full":"h-full w-[1px]",d)},h))});function C(){var e;const{slug:s}=g(),t=f(),[l,a]=n.useState(null),[i,c]=n.useState(!0),[C,P]=n.useState(null);n.useEffect(()=>{s&&L()},[s]);const L=()=>{return e=this,t=null,l=function*(){c(!0),P(null);try{const e=yield fetch(`/api/programmatic-seo/pages/${s}`),t=yield e.json();t.success?a(t.data):P(t.error||"Page not found")}catch(e){P("Failed to load page"),console.error(e)}finally{c(!1)}},new Promise((s,a)=>{var r=e=>{try{n(l.next(e))}catch(s){a(s)}},i=e=>{try{n(l.throw(e))}catch(s){a(s)}},n=e=>e.done?s(e.value):Promise.resolve(e.value).then(r,i);n((l=l.apply(e,t)).next())});var e,t,l};if(i)return r.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center",children:r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),r.jsx("p",{className:"mt-4 text-slate-600",children:"Loading..."})]})});if(C||!l)return r.jsx("div",{className:"min-h-screen flex flex-col items-center justify-center bg-gradient-to-b from-blue-50/80 to-white p-4",children:r.jsxs("div",{className:"text-center max-w-md",children:[r.jsx("h1",{className:"text-9xl font-bold text-blue-600 mb-4",children:"404"}),r.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Page Not Found"}),r.jsx("p",{className:"text-lg text-gray-600 mb-8",children:"The page you're looking for doesn't exist or has been moved."}),r.jsxs("div",{className:"flex flex-col sm:flex-row justify-center gap-4",children:[r.jsxs(o,{onClick:()=>t(-1),variant:"outline",className:"flex items-center gap-2",children:[r.jsx(N,{className:"h-4 w-4"}),"Go Back"]}),r.jsx(o,{onClick:()=>t("/"),className:"bg-blue-600 hover:bg-blue-700",children:"Return to Home"})]})]})});const B="marketing_plan"===l.page_type,z=B?"Marketing Plan":"Business Plan";return r.jsxs(r.Fragment,{children:[r.jsx(u,{title:l.title,description:l.meta_description,keywords:(null==(e=l.target_keywords)?void 0:e.map(e=>e.keyword))||[],canonical:`/${l.slug}`}),r.jsxs("div",{className:"flex h-screen",children:[r.jsx(j,{}),r.jsxs("div",{className:"flex-1 overflow-y-auto bg-slate-50 relative",children:[r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[70%] h-[65%] bg-blue-500/15 rounded-full blur-3xl pointer-events-none"}),r.jsx("div",{className:"absolute top-1/3 right-0 w-[50%] h-[50%] bg-blue-400/15 rounded-full blur-3xl pointer-events-none"}),r.jsx("div",{className:"absolute bottom-1/4 left-0 w-[40%] h-[35%] bg-sky-500/10 rounded-full blur-3xl pointer-events-none"}),r.jsx("div",{className:"relative z-10 bg-gradient-to-br from-blue-500 to-blue-600 text-white",children:r.jsx("div",{className:"w-full px-4 sm:px-6 lg:px-8 py-12 lg:py-16",children:r.jsx("div",{className:"max-w-7xl mx-auto",children:r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 lg:gap-8 items-center",children:[r.jsxs("div",{className:"lg:col-span-2",children:[r.jsxs("div",{className:"flex items-center space-x-3 mb-4",children:[r.jsxs(b,{variant:"secondary",className:"bg-white/20 text-white border-white/30",children:[r.jsx(v,{className:"w-4 h-4 mr-1"}),l.business_types.category]}),r.jsxs(b,{variant:"secondary",className:"bg-white/20 text-white border-white/30",children:[r.jsx(w,{className:"w-4 h-4 mr-1"}),l.cities.city,", ",l.cities.state]})]}),r.jsx("h1",{className:"text-3xl lg:text-4xl xl:text-5xl font-bold mb-6 leading-tight",children:l.title}),r.jsx("p",{className:"text-lg lg:text-xl text-blue-100 mb-8 leading-relaxed",children:l.meta_description}),r.jsxs("div",{className:"flex flex-wrap gap-4",children:[r.jsx(o,{size:"lg",className:"bg-white text-blue-600 hover:bg-blue-50",onClick:()=>t("/questionnaire"),children:"Create Your Custom Plan"}),r.jsxs(o,{size:"lg",variant:"outline",className:"border-white text-white hover:bg-white/10",onClick:()=>{navigator.share?navigator.share({title:null==l?void 0:l.title,text:null==l?void 0:l.meta_description,url:window.location.href}):navigator.clipboard.writeText(window.location.href)},children:[r.jsx(d,{className:"w-5 h-5 mr-2"}),"Share"]})]})]}),r.jsx("div",{className:"lg:col-span-1",children:r.jsxs(m,{className:"bg-white/10 border-white/20 text-white",children:[r.jsx(x,{children:r.jsxs(h,{className:"text-white flex items-center",children:[r.jsx(y,{className:"w-5 h-5 mr-2"}),"Market Overview"]})}),r.jsxs(p,{className:"space-y-4",children:[r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-blue-100",children:"Population:"}),r.jsx("span",{className:"font-semibold",children:l.cities.population.toLocaleString()})]}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-blue-100",children:"Median Income:"}),r.jsxs("span",{className:"font-semibold",children:["$",l.cities.median_income.toLocaleString()]})]}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-blue-100",children:"Avg Revenue:"}),r.jsxs("span",{className:"font-semibold",children:["$",l.business_types.avg_revenue.toLocaleString()]})]}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-blue-100",children:"Startup Cost:"}),r.jsxs("span",{className:"font-semibold",children:["$",l.business_types.avg_startup_cost.toLocaleString()]})]})]})]})})]})})})}),r.jsx("div",{className:"relative z-10 w-full px-4 sm:px-6 lg:px-8 py-8 lg:py-12",children:r.jsx("div",{className:"w-full",children:r.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 lg:gap-8",children:[r.jsxs("div",{className:"lg:col-span-3",children:[r.jsxs(m,{className:"bg-white/90 backdrop-blur-sm border-slate-200/60",children:[r.jsx(x,{children:r.jsx("div",{className:"flex items-center justify-between",children:r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx(b,{variant:B?"default":"secondary",children:z}),r.jsxs("div",{className:"flex items-center text-sm text-slate-500",children:[r.jsx(k,{className:"w-4 h-4 mr-1"}),"Updated ",new Date(l.last_updated).toLocaleDateString()]})]})})}),r.jsx(p,{children:r.jsx("div",{className:"prose prose-lg max-w-none prose-headings:text-slate-900 prose-p:text-slate-700 prose-li:text-slate-700",dangerouslySetInnerHTML:{__html:(e=>{let s=e;return s=s.replace(/(\|[^|\n]+\|[^|\n]*\|[^\n]*\n)+/g,e=>{const s=e.trim().split("\n");if(s.length<2)return e;const t=e=>/^[\s\-|:]*$/.test(e);let l='<div class="overflow-x-auto my-6"><table class="min-w-full bg-white border border-slate-200 rounded-lg shadow-sm">';return s.forEach((e,a)=>{if(t(e))return;const r=e.split("|").map(e=>e.trim()).filter(e=>""!==e);if(0===r.length)return;const i=0===a||1===a&&t(s[1]),n=i?"th":"td",c=i?"px-4 py-3 bg-slate-50 text-left text-sm font-semibold text-slate-900 border-b border-slate-200":"px-4 py-3 text-sm text-slate-700 border-b border-slate-100";l+="<tr>",r.forEach(e=>{l+=`<${n} class="${c}">${e}</${n}>`}),l+="</tr>"}),l+="</table></div>",l}),s=s.replace(/^# (.*$)/gm,'<h1 class="text-3xl font-bold text-slate-900 mb-6 mt-8">$1</h1>').replace(/^## (.*$)/gm,'<h2 class="text-2xl font-semibold text-slate-800 mb-4 mt-8">$1</h2>').replace(/^### (.*$)/gm,'<h3 class="text-xl font-medium text-slate-700 mb-3 mt-6">$1</h3>').replace(/^#### (.*$)/gm,'<h4 class="text-lg font-medium text-slate-700 mb-2 mt-4">$1</h4>').replace(/\*\*(.*?)\*\*/g,'<strong class="font-semibold text-slate-900">$1</strong>').replace(/\*(.*?)\*/g,'<em class="italic">$1</em>').replace(/^(\d+)\.\s+(.*$)/gm,'<li class="mb-2 text-slate-700">$1. $2</li>').replace(/^[•*-]\s+(.*$)/gm,'<li class="mb-2 ml-4 text-slate-700 relative"><span class="absolute -left-4 text-blue-500 font-bold">•</span>$1</li>').replace(/^\s{2,}[•*-]\s+(.*$)/gm,'<li class="mb-2 ml-8 text-slate-700 relative"><span class="absolute -left-4 text-slate-400 text-sm">–</span>$1</li>').replace(/\n\n/g,'</p><p class="mb-4 text-slate-700 leading-relaxed">').replace(/\n/g,"<br>"),s.startsWith("<h")||s.startsWith("<li")||s.startsWith("<div")||(s='<p class="mb-4 text-slate-700 leading-relaxed">'+s),s.endsWith("</p>")||s.endsWith("</li>")||s.endsWith("</h1>")||s.endsWith("</h2>")||s.endsWith("</h3>")||s.endsWith("</h4>")||s.endsWith("</div>")||(s+="</p>"),s=s.replace(new RegExp("(<li[^>]*>.*?<\\/li>)(\\s*<li[^>]*>.*?<\\/li>)*","gs"),e=>'<ul class="space-y-2 mb-6">'+e+"</ul>"),s})(l.content)}})})]}),r.jsx(m,{className:"mt-6 bg-amber-50/90 backdrop-blur-sm border-amber-200/60",children:r.jsx(p,{className:"p-6",children:r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx("div",{className:"w-6 h-6 bg-amber-100 rounded-full flex items-center justify-center",children:r.jsx("span",{className:"text-amber-600 text-sm font-bold",children:"!"})})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("h4",{className:"text-sm font-semibold text-amber-800 mb-2",children:"Important Disclaimer"}),r.jsx("p",{className:"text-sm text-amber-700 leading-relaxed",children:"This content is generated by artificial intelligence and is provided for informational purposes only. It should not be considered as professional legal, financial, or business advice. Before making any business decisions, please consult with qualified professionals who can provide personalized guidance based on your specific circumstances and local regulations."})]})]})})}),r.jsx(m,{className:"mt-6 bg-gradient-to-r from-blue-500 to-blue-600 text-white",children:r.jsxs(p,{className:"p-6 lg:p-8 text-center",children:[r.jsxs("h3",{className:"text-xl lg:text-2xl font-bold mb-4",children:["Ready to Start Your ",l.business_types.name," in ",l.cities.city,"?"]}),r.jsx("p",{className:"text-lg lg:text-xl text-blue-100 mb-6",children:"Get personalized guidance and create a comprehensive business plan tailored to your specific needs."}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[r.jsx(o,{size:"lg",className:"bg-white text-blue-600 hover:bg-blue-50",onClick:()=>t("/questionnaire"),children:"Create Custom Plan"}),r.jsx(o,{size:"lg",variant:"outline",className:"border-white text-white hover:bg-white/10",children:"Get Expert Help"})]})]})})]}),r.jsxs("div",{className:"lg:col-span-1 space-y-6",children:[r.jsxs(m,{className:"bg-white/90 backdrop-blur-sm border-slate-200/60",children:[r.jsx(x,{children:r.jsxs(h,{className:"flex items-center text-slate-900",children:[r.jsx(v,{className:"w-5 h-5 mr-2"}),"Business Details"]})}),r.jsxs(p,{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-slate-900",children:"Business Type"}),r.jsx("p",{className:"text-slate-600",children:l.business_types.name})]}),r.jsx(S,{}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-slate-900",children:"Category"}),r.jsx("p",{className:"text-slate-600",children:l.business_types.category})]}),r.jsx(S,{}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-slate-900",children:"Investment Range"}),r.jsxs("p",{className:"text-slate-600",children:["$",(.7*l.business_types.avg_startup_cost).toLocaleString()," - $",(1.3*l.business_types.avg_startup_cost).toLocaleString()]})]})]})]}),r.jsxs(m,{className:"bg-white/90 backdrop-blur-sm border-slate-200/60",children:[r.jsx(x,{children:r.jsxs(h,{className:"flex items-center text-slate-900",children:[r.jsx(w,{className:"w-5 h-5 mr-2"}),"Location Details"]})}),r.jsxs(p,{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-slate-900",children:"City"}),r.jsxs("p",{className:"text-slate-600",children:[l.cities.city,", ",l.cities.state]})]}),r.jsx(S,{}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-slate-900",children:"Population"}),r.jsx("p",{className:"text-slate-600",children:l.cities.population.toLocaleString()})]}),r.jsx(S,{}),r.jsxs("div",{children:[r.jsx("h4",{className:"font-medium text-slate-900",children:"Market Potential"}),r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:"flex-1 bg-slate-200 rounded-full h-2",children:r.jsx("div",{className:"bg-blue-500 h-2 rounded-full",style:{width:`${Math.min(l.cities.median_income/1e5*100,100)}%`}})}),r.jsx("span",{className:"ml-2 text-sm text-slate-600",children:l.cities.median_income>6e4?"High":l.cities.median_income>4e4?"Medium":"Low"})]})]})]})]}),l.target_keywords&&l.target_keywords.length>0&&r.jsxs(m,{className:"bg-white/90 backdrop-blur-sm border-slate-200/60",children:[r.jsx(x,{children:r.jsxs(h,{className:"flex items-center text-slate-900",children:[r.jsx(_,{className:"w-5 h-5 mr-2"}),"Related Topics"]})}),r.jsx(p,{children:r.jsx("div",{className:"flex flex-wrap gap-2",children:l.target_keywords.slice(0,10).map((e,s)=>r.jsx(b,{variant:"outline",className:"text-xs",children:e.keyword},s))})})]}),r.jsxs(m,{className:"bg-white/90 backdrop-blur-sm border-slate-200/60",children:[r.jsx(x,{children:r.jsx(h,{className:"text-slate-900",children:"Related Resources"})}),r.jsxs(p,{className:"space-y-3",children:[r.jsxs("a",{href:"/marketing-calculators",className:"flex items-center w-full p-3 border border-slate-200 rounded-md hover:bg-slate-50 transition-colors",children:[r.jsx($,{className:"w-4 h-4 mr-2"}),"Marketing Calculators"]}),r.jsxs("a",{href:"/blog",className:"flex items-center w-full p-3 border border-slate-200 rounded-md hover:bg-slate-50 transition-colors",children:[r.jsx($,{className:"w-4 h-4 mr-2"}),"Business Blog"]}),r.jsxs("a",{href:"/support",className:"flex items-center w-full p-3 border border-slate-200 rounded-md hover:bg-slate-50 transition-colors",children:[r.jsx($,{className:"w-4 h-4 mr-2"}),"Get Expert Help"]})]})]})]})]})})})]})]})]})}S.displayName=i.displayName;export{C as default};