var e=(e,s,t)=>new Promise((a,i)=>{var l=e=>{try{r(t.next(e))}catch(s){i(s)}},n=e=>{try{r(t.throw(e))}catch(s){i(s)}},r=e=>e.done?a(e.value):Promise.resolve(e.value).then(l,n);r((t=t.apply(e,s)).next())});import{_ as s}from"./supabase-C8kocL5G.js";import{j as t}from"./radix-ui-CVZWoPyd.js";import{r as a}from"./react-vendor-BmlOtb7g.js";import{B as i}from"./index-BCSgDlp8.js";import{C as l,b as n,c as r,a as c}from"./card-BrVzo7bW.js";import{B as d}from"./badge-CHmVsFC8.js";import{I as o}from"./input-DClY5yZE.js";import{S as m}from"./SEO-BGpcOjpb.js";import{A as x}from"./AppSidebar-BQ3UxiE1.js";import{a as u}from"./react-router-DzDVDRUd.js";import{B as h}from"./building-2-xmYyS5DZ.js";import{M as j}from"./map-pin-BNow_pFf.js";import{C as p}from"./credit-card-CUy9-vWB.js";import{S as g}from"./search-Dj8gdQAd.js";import{P as f}from"./plus-DTFoGqPI.js";import{C as v}from"./circle-check-big-XRSq9IsA.js";import{E as N}from"./external-link-DuZiTz8-.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"./trending-up-DMpQ-MB3.js";import"./book-open-D7nUFbtH.js";import"./settings-BQk8nNSr.js";import"./chevron-right-D_Z5YBDv.js";import"./chevron-left-D5q9zZf8.js";function b(){const b=u(),[y,w]=a.useState([]),[C,S]=a.useState([]),[A,k]=a.useState([]),[F,L]=a.useState(""),[_,B]=a.useState(""),[E,G]=a.useState(""),[M,P]=a.useState(!0),[R,$]=a.useState(!1),[q,I]=a.useState(1);a.useEffect(()=>{O()},[]);const O=()=>e(this,null,function*(){try{const{getCachedAllData:t}=yield s(()=>e(this,null,function*(){const{getCachedAllData:e}=yield import("./programmaticSeoCache-DX9C344M.js");return{getCachedAllData:e}}),[]),a=yield t();w(a.businessTypes),S(a.cities),k(a.pages.funding_guide)}catch(t){console.error("Error fetching cached data:",t);try{const[e,s,t]=yield Promise.all([fetch("/api/programmatic-seo/business-types"),fetch("/api/programmatic-seo/cities"),fetch("/api/programmatic-seo/pages?type=funding_guide")]),a=yield e.json(),i=yield s.json(),l=yield t.json();a.success&&w(a.data),i.success&&S(i.data.slice(0,50)),l.success&&k(l.data)}catch(a){console.error("Error with fallback data fetch:",a)}}finally{P(!1)}}),z=A.filter(e=>{const s=e.business_types.name.toLowerCase().includes(F.toLowerCase())||e.cities.city.toLowerCase().includes(F.toLowerCase())||e.title.toLowerCase().includes(F.toLowerCase()),t=!_||e.business_types.category===_,a=!E||`${e.cities.city}, ${e.cities.state}`===E;return s&&t&&a}),D=[...new Set(y.map(e=>e.category))],T=[...new Set(A.map(e=>`${e.cities.city}, ${e.cities.state}`))],V=z.length,Y=Math.ceil(V/50),H=50*(q-1),J=H+50,W=(e=>{const s=[...e];for(let t=s.length-1;t>0;t--){const e=Math.floor(Math.random()*(t+1));[s[t],s[e]]=[s[e],s[t]]}return s})(z).slice(H,J);a.useEffect(()=>{I(1)},[F,_,E]);const K=["SBA lending options included","Local grant opportunities included","Angel investor networks included","Application strategies included","Credit preparation guide included","Alternative funding sources included","State funding programs included","Crowdfunding strategies included","Equipment financing options included","Professional resources included"];return M?t.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-emerald-600 mx-auto"}),t.jsx("p",{className:"mt-4 text-slate-600",children:"Loading funding guides..."})]})}):t.jsxs(t.Fragment,{children:[t.jsx(m,{title:"Free Business Funding Guides by Industry & Location",description:"Get comprehensive funding guides for any industry and location. SBA loans, grants, investors, and alternative funding sources for restaurants, gyms, salons, and more.",keywords:["business funding guide","small business loans","SBA lending","startup funding","business grants","angel investors","venture capital","alternative funding"],canonical:"/funding-guide-templates"}),t.jsxs("div",{className:"flex h-screen",children:[t.jsx(x,{}),t.jsxs("div",{className:"flex-1 overflow-y-auto bg-slate-50",children:[t.jsxs("div",{className:"bg-gradient-to-br from-emerald-500 to-emerald-600 text-white relative overflow-hidden",children:[t.jsx("div",{className:"absolute top-0 left-1/2 transform -translate-x-1/2 w-96 h-96 bg-white/10 rounded-full blur-3xl"}),t.jsx("div",{className:"absolute top-20 right-1/4 w-64 h-64 bg-white/15 rounded-full blur-3xl"}),t.jsx("div",{className:"absolute top-40 left-1/4 w-80 h-80 bg-green-300/20 rounded-full blur-3xl"}),t.jsx("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-16",children:t.jsxs("div",{className:"text-center",children:[t.jsx("h1",{className:"text-4xl lg:text-5xl font-bold mb-6",children:"Free Business Funding Guides"}),t.jsx("p",{className:"text-xl lg:text-2xl text-emerald-100 mb-8 max-w-3xl mx-auto",children:"Comprehensive funding guides with SBA loans, grants, investors, and alternative funding sources for any industry and location."}),t.jsxs("div",{className:"flex flex-wrap justify-center gap-4 mb-8",children:[t.jsxs(d,{variant:"secondary",className:"bg-white/20 text-white border-white/30 text-sm px-4 py-2",children:[t.jsx(h,{className:"w-4 h-4 mr-2"}),y.length,"+ Industries"]}),t.jsxs(d,{variant:"secondary",className:"bg-white/20 text-white border-white/30 text-sm px-4 py-2",children:[t.jsx(j,{className:"w-4 h-4 mr-2"}),C.length,"+ Cities"]}),t.jsxs(d,{variant:"secondary",className:"bg-white/20 text-white border-white/30 text-sm px-4 py-2",children:[t.jsx(p,{className:"w-4 h-4 mr-2"}),A.length," Funding Guides Available"]})]}),t.jsx(i,{size:"lg",className:"bg-white text-emerald-600 hover:bg-emerald-50",onClick:()=>b("/questionnaire"),children:"Create Custom Funding Strategy"})]})})]}),t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[t.jsxs(l,{className:"mb-8",children:[t.jsx(n,{children:t.jsxs(r,{className:"flex items-center",children:[t.jsx(g,{className:"w-5 h-5 mr-2"}),"Find Your Funding Guide"]})}),t.jsx(c,{children:t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:"Search Guides"}),t.jsx(o,{placeholder:"Restaurant, Chicago, Hair Salon...",value:F,onChange:e=>L(e.target.value)})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:"Filter by Category"}),t.jsxs("select",{className:"w-full px-3 py-2 border border-slate-300 rounded-md focus:outline-none focus:ring-2 focus:ring-emerald-500",value:_,onChange:e=>B(e.target.value),children:[t.jsx("option",{value:"",children:"All Categories"}),D.map(e=>t.jsx("option",{value:e,children:e},e))]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:"Filter by Location"}),t.jsxs("select",{className:"w-full px-3 py-2 border border-slate-300 rounded-md focus:outline-none focus:ring-2 focus:ring-emerald-500",value:E,onChange:e=>G(e.target.value),children:[t.jsx("option",{value:"",children:"All Locations"}),T.map(e=>t.jsx("option",{value:e,children:e},e))]})]})]})})]}),t.jsxs("div",{className:"mb-12",children:[t.jsxs("div",{className:"flex items-center justify-between mb-6",children:[t.jsxs("h2",{className:"text-3xl font-bold text-slate-900",children:["Available Funding Guides (",z.length,")"]}),R&&t.jsxs(d,{variant:"outline",className:"animate-pulse",children:[t.jsx(f,{className:"w-4 h-4 mr-1"}),"Generating..."]})]}),0===z.length?t.jsx(l,{className:"text-center py-12",children:t.jsxs(c,{children:[t.jsx(p,{className:"w-12 h-12 text-slate-400 mx-auto mb-4"}),t.jsx("h3",{className:"text-lg font-medium text-slate-900 mb-2",children:"No funding guides found"}),t.jsx("p",{className:"text-slate-600 mb-4",children:"Try adjusting your search criteria or create a custom funding strategy."}),t.jsx(i,{onClick:()=>b("/questionnaire"),children:"Create Custom Funding Strategy"})]})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:W.map(e=>{var s,a,o;return t.jsxs(l,{className:"hover:shadow-lg transition-shadow",children:[t.jsx(n,{children:t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex-1",children:[t.jsxs(r,{className:"text-lg leading-tight mb-2",children:[e.business_types.name," Funding Guide - ",e.cities.city]}),t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(d,{variant:"outline",className:"text-xs",children:e.business_types.category}),t.jsxs(d,{variant:"outline",className:"text-xs",children:[t.jsx(j,{className:"w-3 h-3 mr-1"}),e.cities.state]})]})]}),t.jsx(p,{className:"w-5 h-5 text-emerald-500 flex-shrink-0"})]})}),t.jsx(c,{children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-slate-600",children:"Startup Cost:"}),t.jsxs("span",{className:"font-medium",children:["$",(null==(s=e.business_types.avg_startup_cost)?void 0:s.toLocaleString())||"N/A"]})]}),t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-slate-600",children:"Avg. Revenue:"}),t.jsxs("span",{className:"font-medium",children:["$",(null==(a=e.business_types.avg_revenue)?void 0:a.toLocaleString())||"N/A"]})]}),t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-slate-600",children:"Population:"}),t.jsx("span",{className:"font-medium",children:null==(o=e.cities.population)?void 0:o.toLocaleString()})]}),t.jsxs("div",{className:"pt-3 border-t",children:[t.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[t.jsx(v,{className:"w-4 h-4 text-emerald-500"}),t.jsx("span",{className:"text-sm text-slate-600",children:K[Math.floor(Math.random()*K.length)]})]}),t.jsxs(i,{className:"w-full bg-emerald-600 hover:bg-emerald-700",size:"sm",onClick:()=>b(`/${e.slug}`),children:["View Funding Guide",t.jsx(N,{className:"w-4 h-4 ml-2"})]})]})]})})]},e.id)})}),Y>1&&t.jsxs("div",{className:"flex justify-center items-center mt-8 space-x-4",children:[t.jsx(i,{variant:"outline",disabled:1===q,onClick:()=>I(q-1),children:"Previous"}),t.jsx("div",{className:"flex items-center space-x-2",children:Array.from({length:Math.min(5,Y)},(e,s)=>{let a;return a=Y<=5||q<=3?s+1:q>=Y-2?Y-4+s:q-2+s,t.jsx(i,{variant:q===a?"default":"outline",size:"sm",onClick:()=>I(a),children:a},a)})}),t.jsx(i,{variant:"outline",disabled:q===Y,onClick:()=>I(q+1),children:"Next"})]}),t.jsxs("div",{className:"text-center mt-4 text-sm text-slate-600",children:["Showing ",H+1,"-",Math.min(J,V)," of ",V," funding guides"]})]}),t.jsxs(l,{className:"mb-8",children:[t.jsx(n,{children:t.jsx(r,{className:"text-2xl",children:"What's Included in Our Funding Guides?"})}),t.jsx(c,{children:t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[t.jsxs("div",{className:"flex items-start space-x-3",children:[t.jsx(v,{className:"w-6 h-6 text-emerald-500 mt-1"}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-slate-900",children:"SBA Lending Options"}),t.jsx("p",{className:"text-slate-600",children:"Complete guide to SBA 7(a), Express, and Microloan programs."})]})]}),t.jsxs("div",{className:"flex items-start space-x-3",children:[t.jsx(v,{className:"w-6 h-6 text-emerald-500 mt-1"}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-slate-900",children:"Local Funding Programs"}),t.jsx("p",{className:"text-slate-600",children:"State and city-specific grants, incentives, and programs."})]})]}),t.jsxs("div",{className:"flex items-start space-x-3",children:[t.jsx(v,{className:"w-6 h-6 text-emerald-500 mt-1"}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-slate-900",children:"Alternative Funding"}),t.jsx("p",{className:"text-slate-600",children:"Equipment financing, lines of credit, and alternative lenders."})]})]}),t.jsxs("div",{className:"flex items-start space-x-3",children:[t.jsx(v,{className:"w-6 h-6 text-emerald-500 mt-1"}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-slate-900",children:"Investor Networks"}),t.jsx("p",{className:"text-slate-600",children:"Angel investors, VCs, and crowdfunding platforms."})]})]}),t.jsxs("div",{className:"flex items-start space-x-3",children:[t.jsx(v,{className:"w-6 h-6 text-emerald-500 mt-1"}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-slate-900",children:"Application Strategy"}),t.jsx("p",{className:"text-slate-600",children:"Step-by-step application processes and success tips."})]})]}),t.jsxs("div",{className:"flex items-start space-x-3",children:[t.jsx(v,{className:"w-6 h-6 text-emerald-500 mt-1"}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-slate-900",children:"Local Resources"}),t.jsx("p",{className:"text-slate-600",children:"Professional advisors, SCORE mentors, and business groups."})]})]})]})})]}),t.jsx(l,{className:"bg-gradient-to-r from-emerald-500 to-emerald-600 text-white",children:t.jsxs(c,{className:"p-8 text-center",children:[t.jsx("h3",{className:"text-2xl font-bold mb-4",children:"Ready to Fund Your Business?"}),t.jsx("p",{className:"text-lg text-emerald-100 mb-6",children:"Get a comprehensive funding strategy tailored to your specific industry, location, and funding needs."}),t.jsx(i,{size:"lg",className:"bg-white text-emerald-600 hover:bg-emerald-50",onClick:()=>b("/questionnaire"),children:"Create Custom Funding Strategy"})]})})]})]})]})]})}export{b as default};