1import{j as e,m as x,A as me}from"./vendor-motion-DTnOrSui.js";import{a as d,H as G,j as T,f as Y,U as A,C as K,h as Q,k as V,i as X,m as Z,S as ge,B as ee,A as xe,n as be,p as pe}from"./landing-Co9FYvFE.js";import{c as he,u as ue,b as fe,L as P}from"./vendor-react-hqdvDTQC.js";import{u as ye,b as je,s as j,c as ve,z as N,f as Ne,P as w,d as y,a as L}from"./index-BP6pcBou.js";import{c as te,b as we}from"./blogPosts-WMnUOnd3.js";import{f as $e}from"./utils-D_3MOlfD.js";import"./dashboard-mermaid-Dm9IuZEA.js";import"./dashboard-flow-BpoJ1xxm.js";import"./dashboard-charts-B3AZkMia.js";import"./dashboard-editor-BBIZRU6f.js";import"./vendor-antd-pd--rL5f.js";const De=()=>{var q,R,H,U,J;const{slug:b}=he(),p=ue(),{isDarkMode:t}=ye(),{user:u}=je(),{isAuthenticated:F}=fe(a=>a.auth),[s,$]=d.useState(null),[r,_]=d.useState(null),[se,k]=d.useState(!0),[ae,D]=d.useState(!1),[re,M]=d.useState(!1),[O,E]=d.useState([]),[v,W]=d.useState(!1),[n,C]=d.useState({isOpen:!1,title:"",message:"",confirmText:"Confirm",cancelText:"Cancel",onConfirm:()=>{},onCancel:()=>{},variant:"danger"});d.useEffect(()=>{window.scrollTo({top:0,behavior:"instant"})},[b]),d.useEffect(()=>{b&&ie()},[b]),d.useEffect(()=>{le()},[u,s]);const le=async()=>{if(!u||!s){D(!1),M(!1);return}const{data:a}=await j.from("user_profiles").select("role, is_active").eq("id",u.id).single();if(a){const l=a.role==="super_admin"&&a.is_active===!0,i=s.author_id===u.id&&a.role==="blogger"&&a.is_active===!0;M(l),D(l||i)}},ie=async()=>{k(!0);try{const a=b?await ve(b):null;if(!a){const i=te(b||"");i?(_(i),$(null)):(N.error("Blog not found"),p("/blog/")),k(!1);return}let l={...a,author:null};if(a.author_id&&u){const{data:i}=await j.from("user_profiles").select("role").eq("id",u.id).single();if((i==null?void 0:i.role)==="super_admin")try{const{data:c}=await j.from("user_profiles").select("first_name, last_name, email").eq("id",a.author_id).single();c&&(l.author={full_name:[c.first_name,c.last_name].filter(Boolean).join(" ")||c.email,email:c.email})}catch{}}$(l),_(null);try{await j.rpc("increment_view_count",{blog_id:a.id})}catch{}if(a.tags&&a.tags.length>0)try{const{blogs:i}=await Ne({limit:12,offset:0}),c=i.filter(h=>{var f;return h.id!==a.id&&((f=h.tags)==null?void 0:f.some(m=>a.tags.includes(m)))}).slice(0,3);E(c||[])}catch{E([])}}catch{const a=te(b||"");a?(_(a),$(null)):p("/blog/")}finally{k(!1)}},oe=()=>{s&&C({isOpen:!0,title:"Delete Blog Post",message:`Are you sure you want to delete "${s.title}"? This action cannot be undone.`,confirmText:"Delete",cancelText:"Cancel",onConfirm:async()=>{C(a=>({...a,isOpen:!1}));try{const{error:a}=await j.from("blogs").delete().eq("id",s.id);if(a)throw a;N.success("Blog deleted successfully"),p("/blog/")}catch{N.error("Failed to delete blog")}},onCancel:()=>{C(a=>({...a,isOpen:!1}))},variant:"danger"})},I=()=>{navigator.clipboard.writeText(window.location.href),W(!0),N.success("Link copied to clipboard!"),setTimeout(()=>W(!1),2e3)},ne=a=>a.startsWith("<")||a.includes("<p>")||a.includes("<h")?a:`<p>${a.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*\*(.*?)\*\*\*/g,"<strong><em>$1</em></strong>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/```([\s\S]*?)```/g,"<pre><code>$1</code></pre>").replace(/`(.*?)`/g,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank">$1</a>').replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br/>")}</p>`,ce=a=>{const l=a.trim().split(` 2`),i=[];let c=[],h=!1,f="";const m=()=>{c.length>0&&(i.push(e.jsx("ul",{className:`list-disc list-outside ml-6 space-y-2 mb-6 ${t?"text-gray-300":"text-gray-700"}`,children:c.map((o,g)=>e.jsx("li",{className:"leading-relaxed",children:o},g))},`list-${i.length}`)),c=[])};return l.forEach((o,g)=>{if(o.startsWith("```")){h?(i.push(e.jsx("pre",{className:`p-4 sm:p-5 rounded-xl mb-6 overflow-x-auto border ${t?"bg-gray-800/50 border-gray-700/50":"bg-gray-50 border-gray-200"}`,children:e.jsx("code",{className:`text-sm font-mono ${t?"text-gray-300":"text-gray-800"}`,children:f.trim()})},`code-${g}`)),h=!1):(m(),h=!0,f="");return}if(h){f+=o+` 3`;return}if(o.startsWith("# "))m(),i.push(e.jsx("h1",{className:`text-2xl sm:text-3xl font-bold mt-10 mb-4 ${t?"text-white":"text-gray-900"}`,children:o.slice(2)},g));else if(o.startsWith("## "))m(),i.push(e.jsx("h2",{className:`text-xl sm:text-2xl font-bold mt-10 mb-4 ${t?"text-white":"text-gray-900"}`,children:o.slice(3)},g));else if(o.startsWith("### "))m(),i.push(e.jsx("h3",{className:`text-lg sm:text-xl font-bold mt-8 mb-3 ${t?"text-white":"text-gray-900"}`,children:o.slice(4)},g));else if(o.startsWith("- ")||o.startsWith("* "))c.push(o.slice(2));else if(/^\d+\.\s/.test(o))c.push(o.replace(/^\d+\.\s/,""));else if(o.startsWith("|")){if(m(),!o.includes("---")){const B=o.split("|").filter(S=>S.trim());i.push(e.jsx("div",{className:`flex border-b ${t?"border-gray-700/50":"border-gray-200"}`,children:B.map((S,de)=>e.jsx("div",{className:`flex-1 px-3 sm:px-4 py-2 text-sm ${t?"text-gray-300":"text-gray-700"}`,children:S.trim()},de))},g))}}else if(o.trim()){m();let B=o.replace(/\*\*(.*?)\*\*/g,'<strong class="font-semibold">$1</strong>').replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`(.*?)`/g,`<code class="${t?"bg-gray-800/80 text-blue-400":"bg-gray-100 text-blue-600"} px-1.5 py-0.5 rounded text-sm font-mono">$1</code>`).replace(/\[(.*?)\]\((.*?)\)/g,'<a href="$2" class="text-blue-500 hover:text-blue-400 underline underline-offset-2">$1</a>');i.push(e.jsx("p",{className:`mb-5 leading-relaxed text-base sm:text-lg ${t?"text-gray-300":"text-gray-700"}`,dangerouslySetInnerHTML:{__html:B}},g))}}),m(),i},z=a=>{try{return $e(new Date(a),"MMMM d, yyyy")}catch{return new Date(a).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}};if(se)return e.jsxs(e.Fragment,{children:[e.jsx(w,{}),e.jsx("div",{className:`min-h-screen ${t?"bg-[#0a0a0f]":"bg-gradient-to-b from-gray-50 to-white"}`,children:e.jsx("div",{className:"pt-32 pb-24 px-4",children:e.jsxs("div",{className:"max-w-4xl mx-auto animate-pulse",children:[e.jsx("div",{className:`h-8 rounded w-3/4 mb-4 ${t?"bg-gray-800":"bg-gray-200"}`}),e.jsx("div",{className:`h-4 rounded w-1/2 mb-8 ${t?"bg-gray-800":"bg-gray-200"}`}),e.jsx("div",{className:`aspect-video rounded-lg mb-8 ${t?"bg-gray-800":"bg-gray-200"}`}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:`h-4 rounded w-full ${t?"bg-gray-800":"bg-gray-200"}`}),e.jsx("div",{className:`h-4 rounded w-5/6 ${t?"bg-gray-800":"bg-gray-200"}`}),e.jsx("div",{className:`h-4 rounded w-4/6 ${t?"bg-gray-800":"bg-gray-200"}`})]})]})})})]});if(r){const a=we.filter(l=>l.category===r.category&&l.id!==r.id).slice(0,3);return e.jsxs(e.Fragment,{children:[e.jsxs(G,{children:[e.jsx("title",{children:r.metaTitle||r.title}),e.jsx("meta",{name:"description",content:r.metaDescription||r.excerpt}),e.jsx("meta",{name:"keywords",content:((q=r.keywords)==null?void 0:q.join(", "))||((R=r.tags)==null?void 0:R.join(", "))||""}),e.jsx("link",{rel:"canonical",href:y(`/blog/${r.slug}`)}),e.jsx("meta",{property:"og:type",content:"article"}),e.jsx("meta",{property:"og:title",content:r.metaTitle||r.title}),e.jsx("meta",{property:"og:description",content:r.metaDescription||r.excerpt}),e.jsx("meta",{property:"og:url",content:y(`/blog/${r.slug}`)}),r.coverImage&&e.jsx("meta",{property:"og:image",content:r.coverImage}),e.jsx("meta",{property:"article:published_time",content:r.publishedAt}),e.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),e.jsx("meta",{name:"twitter:title",content:r.metaTitle||r.title}),e.jsx("meta",{name:"twitter:description",content:r.metaDescription||r.excerpt}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BlogPosting",headline:r.title,de
3scription:r.metaDescription,author:{"@type":"Person",name:r.author.name},publisher:{"@type":"Organization",name:"Fonada AI",url:"https://fonada.ai/",logo:{"@type":"ImageObject",url:"https://fonada.ai/logo.png"}},datePublished:r.publishedAt,dateModified:r.updatedAt,keywords:r.keywords.join(", "),mainEntityOfPage:y(`/blog/${r.slug}`)})})]}),e.jsx(w,{}),e.jsxs("div",{className:`min-h-screen transition-colors duration-300 ${t?"bg-[#0a0a0f]":"bg-gradient-to-b from-gray-50 to-white"}`,children:[e.jsxs("section",{className:"relative pt-8 pb-12 lg:pt-12 lg:pb-16 overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 pointer-events-none overflow-hidden",children:t?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"absolute top-0 left-1/4 w-[500px] h-[500px] bg-blue-500/10 rounded-full blur-[120px]"}),e.jsx("div",{className:"absolute bottom-0 right-1/4 w-[400px] h-[400px] bg-purple-500/10 rounded-full blur-[100px]"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"absolute top-0 left-1/4 w-[500px] h-[500px] bg-blue-100/60 rounded-full blur-[120px]"}),e.jsx("div",{className:"absolute bottom-0 right-1/4 w-[400px] h-[400px] bg-purple-100/60 rounded-full blur-[100px]"})]})}),e.jsxs("div",{className:"relative max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsxs(x.button,{onClick:()=>p("/blog/"),className:`inline-flex items-center text-sm font-medium mb-6 sm:mb-8 px-3 py-2 rounded-lg transition-colors ${t?"text-gray-400 hover:text-white hover:bg-gray-800/50":"text-gray-600 hover:text-gray-900 hover:bg-gray-100"}`,initial:{opacity:0,x:-20},animate:{opacity:1,x:0},children:[e.jsx(T,{size:16,className:"mr-2"})," Back to Blog"]}),e.jsxs(x.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-4",children:[e.jsx("span",{className:`inline-flex items-center px-3 py-1.5 rounded-full text-xs font-medium ${t?"bg-blue-500/10 text-blue-400 border border-blue-500/20":"bg-blue-100 text-blue-700"}`,children:r.category}),e.jsxs("span",{className:`flex items-center text-sm ${t?"text-gray-400":"text-gray-500"}`,children:[e.jsx(Y,{size:14,className:"mr-1"})," ",r.readTime," min read"]})]}),e.jsx("h1",{className:`text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-bold mb-6 leading-tight ${t?"text-white":"text-gray-900"}`,children:r.title}),e.jsxs("div",{className:`flex flex-wrap items-center gap-4 sm:gap-6 ${t?"text-gray-400":"text-gray-600"}`,children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:`w-10 h-10 rounded-full flex items-center justify-center mr-3 ${t?"bg-gradient-to-br from-blue-500/20 to-purple-500/20 border border-gray-700/50":"bg-gradient-to-br from-blue-100 to-purple-100"}`,children:e.jsx(A,{size:18,className:t?"text-blue-400":"text-blue-600"})}),e.jsxs("div",{children:[e.jsx("div",{className:`font-semibold text-sm ${t?"text-white":"text-gray-900"}`,children:r.author.name}),e.jsx("div",{className:"text-xs",children:r.author.role})]})]}),e.jsxs("div",{className:"flex items-center text-sm",children:[e.jsx(K,{size:14,className:"mr-1.5"}),z(r.publishedAt)]})]})]})]})]}),e.jsx("section",{className:"py-8 lg:py-12",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"grid lg:grid-cols-12 gap-8 lg:gap-12",children:[e.jsxs(x.article,{className:"lg:col-span-8",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},children:[e.jsxs("div",{className:`p-5 sm:p-8 rounded-2xl border ${t?"bg-gradient-to-br from-gray-800/30 to-gray-900/30 border-gray-700/50":"bg-white border-gray-200 shadow-sm"}`,children:[e.jsx("div",{className:"prose prose-lg max-w-none",children:ce(r.content)}),e.jsxs("div",{className:`mt-10 pt-8 border-t ${t?"border-gray-700/50":"border-gray-200"}`,children:[e.jsx("h4",{className:`text-sm font-semibold mb-3 ${t?"text-gray-400":"text-gray-500"}`,children:"Tags"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.tags.map(l=>e.jsxs("span",{className:`inline-flex items-center px-3 py-1.5 rounded-lg text-sm ${t?"bg-gray-700/50 text-gray-300":"bg-gray-100 text-gray-600"}`,children:[e.jsx(Q,{size:12,className:"mr-1.5"})," ",l]},l))})]})]}),e.jsx("div",{className:`mt-6 p-5 rounded-2xl border ${t?"bg-gradient-to-br from-gray-800/30 to-gray-900/30 border-gray-700/50":"bg-white border-gray-200 shadow-sm"}`,children:e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(V,{size:18,className:"text-blue-500 mr-3"}),e.jsx("span",{className:`font-semibold ${t?"text-white":"text-gray-900"}`,children:"Share this article"})]}),e.jsx("div",{className:"flex gap-2",children:e.jsx("button",{type:"button",onClick:I,title:"Copy link","aria-label":"Copy link",className:`p-3 rounded-xl transition-colors ${v?"bg-green-500/20 text-green-500":t?"bg-gray-700/50 hover:bg-gray-700 text-gray-300":"bg-gray-100 hover:bg-gray-200 text-gray-600"}`,children:v?e.jsx(X,{size:18}):e.jsx(Z,{size:18})})})]})})]}),e.jsx(x.aside,{className:"lg:col-span-4",initial:{opacity:0,x:20}
3,animate:{opacity:1,x:0},transition:{delay:.3},children:e.jsxs("div",{className:"sticky top-24 space-y-6",children:[e.jsx("div",{className:`p-6 rounded-2xl overflow-hidden relative ${t?"bg-gradient-to-br from-blue-900/50 to-purple-900/50 border border-blue-500/20":"bg-gradient-to-br from-blue-500 to-purple-600"}`,children:e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(ge,{size:18,className:"text-yellow-400"}),e.jsx("span",{className:`text-sm font-medium ${t?"text-blue-300":"text-white/90"}`,children:"Try Fonada AI"})]}),e.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:"Build Your First AI Agent"}),e.jsx("p",{className:`text-sm mb-5 ${t?"text-gray-300":"text-white/80"}`,children:"Get started in 5 minutes. No credit card required."}),e.jsx("button",{onClick:()=>p(F?"/dashboard/overview":"/login"),className:"w-full py-3 rounded-xl font-semibold bg-white text-blue-600 hover:bg-gray-100 transition-all duration-200",children:F?"Dashboard":"Start Free Trial"})]})}),e.jsxs("div",{className:`p-6 rounded-2xl border ${t?"bg-gradient-to-br from-gray-800/30 to-gray-900/30 border-gray-700/50":"bg-white border-gray-200 shadow-sm"}`,children:[e.jsxs("h4",{className:`font-bold mb-4 flex items-center gap-2 ${t?"text-white":"text-gray-900"}`,children:[e.jsx(ee,{size:16,className:"text-blue-500"})," Topics Covered"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.keywords.map(l=>e.jsx("span",{className:`px-3 py-1.5 rounded-lg text-xs font-medium ${t?"bg-gray-700/50 text-gray-300":"bg-gray-100 text-gray-600"}`,children:l},l))})]})]})})]})})}),a.length>0&&e.jsx("section",{className:`py-16 ${t?"bg-gradient-to-b from-gray-900/50 to-[#0a0a0f]":"bg-gray-50"}`,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsx("h2",{className:`text-xl sm:text-2xl font-bold mb-8 ${t?"text-white":"text-gray-900"}`,children:"Related Articles"}),e.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-6",children:a.map(l=>e.jsxs("div",{onClick:()=>p(`/blog/${l.slug}/`),className:`group p-5 rounded-2xl border cursor-pointer transition-all duration-300 hover:shadow-lg ${t?"bg-gradient-to-br from-gray-800/50 to-gray-900/50 border-gray-700/50 hover:border-blue-500/30":"bg-white border-gray-200 hover:border-blue-300"}`,children:[e.jsx("h3",{className:`font-bold mb-2 line-clamp-2 ${t?"text-white":"text-gray-900"}`,children:l.title}),e.jsx("p",{className:`text-sm line-clamp-2 mb-3 ${t?"text-gray-400":"text-gray-600"}`,children:l.excerpt}),e.jsxs("span",{className:`text-sm font-medium ${t?"text-blue-400":"text-blue-600"}`,children:["Read more ",e.jsx(xe,{size:12,className:"inline ml-1"})]})]},l.id))})]})})]}),e.jsx(L,{})]})}return s?e.jsxs(e.Fragment,{children:[e.jsxs(G,{children:[e.jsx("title",{children:s.meta_title||s.title}),e.jsx("meta",{name:"description",content:s.meta_description||s.excerpt||s.title}),e.jsx("meta",{name:"keywords",content:((H=s.tags)==null?void 0:H.join(", "))||""}),e.jsx("link",{rel:"canonical",href:y(`/blog/${s.slug}`)}),e.jsx("meta",{property:"og:type",content:"article"}),e.jsx("meta",{property:"og:title",content:s.meta_title||s.title}),e.jsx("meta",{property:"og:description",content:s.meta_description||s.excerpt||s.title}),e.jsx("meta",{property:"og:url",content:y(`/blog/${s.slug}`)}),e.jsx("meta",{property:"og:image",content:s.cover_image_url||"https://fonada.ai/og-image.svg"}),e.jsx("meta",{property:"article:published_time",content:s.published_at||s.created_at}),e.jsx("meta",{property:"article:author",content:"FonadaLabs Team"}),(U=s.tags)==null?void 0:U.map(a=>e.jsx("meta",{property:"article:tag",content:a},a)),e.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),e.jsx("meta",{name:"twitter:title",content:s.meta_title||s.title}),e.jsx("meta",{name:"twitter:description",content:s.meta_description||s.excerpt||s.title}),e.jsx("meta",{name:"twitter:image",content:s.cover_image_url||"https://fonada.ai/og-image.svg"}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BlogPosting",headline:s.meta_title||s.title,de
3scription:s.meta_description||s.excerpt||s.title,image:s.cover_image_url||void 0,author:{"@type":"Organization",name:"FonadaLabs",url:"https://fonada.ai/"},publisher:{"@type":"Organization",name:"Fonada AI",url:"https://fonada.ai/",logo:{"@type":"ImageObject",url:"https://fonada.ai/logo.png"}},datePublished:s.published_at||s.created_at,dateModified:s.created_at,mainEntityOfPage:y(`/blog/${s.slug}`),keywords:((J=s.tags)==null?void 0:J.join(", "))||"",wordCount:s.reading_time_minutes?s.reading_time_minutes*200:void 0,timeRequired:`PT${s.reading_time_minutes||1}M`})})]}),e.jsx(w,{}),e.jsxs("div",{className:`min-h-screen transition-colors duration-300 ${t?"bg-[#0a0a0f]":"bg-gradient-to-b from-gray-50 to-white"}`,children:[e.jsxs("section",{className:"relative pt-8 pb-12 lg:pt-12 lg:pb-16 overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 pointer-events-none overflow-hidden",children:t?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"absolute top-0 left-1/4 w-[500px] h-[500px] bg-blue-500/10 rounded-full blur-[120px]"}),e.jsx("div",{className:"absolute bottom-0 right-1/4 w-[400px] h-[400px] bg-purple-500/10 rounded-full blur-[100px]"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"absolute top-0 left-1/4 w-[500px] h-[500px] bg-blue-100/60 rounded-full blur-[120px]"}),e.jsx("div",{className:"absolute bottom-0 right-1/4 w-[400px] h-[400px] bg-purple-100/60 rounded-full blur-[100px]"})]})}),e.jsxs("div",{className:"relative max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs(x.button,{onClick:()=>p("/blog/"),className:`inline-flex items-center text-sm font-medium px-3 py-2 rounded-lg transition-colors ${t?"text-gray-400 hover:text-white hover:bg-gray-800/50":"text-gray-600 hover:text-gray-900 hover:bg-gray-100"}`,initial:{opacity:0,x:-20},animate:{opacity:1,x:0},children:[e.jsx(T,{size:16,className:"mr-2"})," Back to Blog"]}),ae&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(P,{to:`/blog/edit/${s.id}/`,children:e.jsxs("button",{className:`inline-flex items-center px-3 py-2 rounded-lg text-sm font-medium border transition-colors ${t?"border-gray-700 text-gray-300 hover:bg-gray-800":"border-gray-200 text-gray-700 hover:bg-gray-100"}`,children:[e.jsx(be,{size:14,className:"mr-1"})," Edit"]})}),e.jsxs("button",{onClick:oe,className:"inline-flex items-center px-3 py-2 rounded-lg text-sm font-medium border border-red-500/50 text-red-500 hover:bg-red-500/10 transition-colors",children:[e.jsx(pe,{size:14,className:"mr-1"})," Delete"]})]})]}),e.jsxs(x.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:[s.tags&&s.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 mb-4",children:s.tags.map(a=>e.jsxs("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-xs font-medium ${t?"bg-gray-700/50 text-gray-300 border border-gray-600":"bg-gray-100 text-gray-600 border border-gray-200"}`,children:[e.jsx(Q,{size:12,className:"mr-1"})," ",a]},a))}),e.jsx("h1",{className:`text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-bold mb-6 leading-tight ${t?"text-white":"text-gray-900"}`,children:s.title}),e.jsxs("div",{className:`flex flex-wrap items-center gap-4 pb-8 border-b ${t?"text-gray-400 border-gray-700/50":"text-gray-600 border-gray-200"}`,children:[re&&s.author?e.jsxs("span",{className:"flex items-center bg-blue-500/10 px-3 py-1.5 rounded-md text-blue-400 font-medium text-sm",children:[e.jsx(A,{size:14,className:"mr-2"})," Author: ",s.author.full_name]}):e.jsxs("span",{className:"flex items-center text-sm",children:[e.jsx(A,{size:14,className:"mr-2"})," FonadaLabs Team"]}),e.jsxs("span",{className:"flex items-center text-sm",children:[e.jsx(K,{size:14,className:"mr-2"}),s.published_at?z(s.published_at):z(s.created_at)]}),e.jsxs("span",{className:"flex items-center text-sm",children:[e.jsx(Y,{size:14,className:"mr-2"})," ",s.reading_time_minutes," min read"]})]})]})]})]}),e.jsx("section",{className:"py-8 lg:py-12",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:[s.cover_image_url&&e.jsx("div",{className:"aspect-video rounded-2xl overflow-hidden mb-8",children:e.jsx("img",{src:s.cover_image_url,alt:s.title,className:"w-full h-full object-cover"})}),e.jsxs("div",{className:`p-5 sm:p-8 rounded-2xl border ${t?"bg-gradient-to-br from-gray-800/30 to-gray-900/30 border-gray-700/50":"bg-white border-gray-200 shadow-sm"}`,children:[e.jsx("div",{className:`max-w-none blog-content ${t?"text-gray-200":"text-gray-700"}`,dangerouslySetInnerHTML:{__html:ne(s.content)}}),e.jsx("style",{children:` 4 .blog-content { line-height: 1.8; } 5 .blog-content h1 { font-size: 1.75rem; font-weight: 700; margin-top: 2.5rem; margin-bottom: 1rem; color: ${t?"#fff":"#111827"}; } 6 .blog-content h2 { font-size: 1.5rem; font-weight: 600; margin-top: 2rem; margin-bottom: 0.75rem; color: ${t?"#fff":"#111827"}; } 7 .blog-content h3 { font-size: 1.25rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.5rem; color: ${t?"#fff":"#111827"}; } 8 .blog-content p { margin-bottom: 1rem; line-height: 1.8; } 9 .blog-content ul { list-style-type: disc; padding-left: 1.5rem; margin-bottom: 1rem; } 10 .blog-content ol { list-style-type: decimal; padding-left: 1.5rem; margin-bottom: 1rem; } 11 .blog-content li { margin-bottom: 0.25rem; } 12 .blog-content blockquote { border-left: 4px solid ${t?"#374151":"#d1d5db"}; padding-left: 1rem; margin: 1rem 0; font-style: italic;
12 color: ${t?"#9ca3af":"#6b7280"}; } 13 .blog-content code { background: ${t?"#1f2937":"#f3f4f6"}; padding: 0.2rem 0.4rem; border-radius: 0.25rem; font-family: monospace; font-size: 0.9em; color: #ec4899; } 14 .blog-content pre { background: ${t?"#1f2937":"#f3f4f6"}; border: 1px solid ${t?"#374151":"#e5e7eb"}; border-radius: 0.5rem; padding: 1rem; margin: 1rem 0; overflow-x: auto; } 15 .blog-content pre code { background: transparent; padding: 0; color: #22c55e; } 16 .blog-content a { color: #3b82f6; text-decoration: underline; } 17 .blog-content a:hover { color: #2563eb; } 18 .blog-content img { max-width: 100%; height: auto; border-radius: 0.5rem; margin: 1rem 0; } 19 .blog-content hr { border-color: ${t?"#374151":"#e5e7eb"}; margin: 2rem 0; } 20 .blog-content mark { background: rgba(234, 179, 8, 0.3); border-radius: 0.25rem; padding: 0 0.25rem; } 21 .blog-content strong { color: ${t?"#fff":"#111827"}; font-weight: 600; } 22 .blog-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; } 23 .blog-content th { border: 1px solid ${t?"#374151":"#e5e7eb"}; background: ${t?"rgba(31,41,55,0.5)":"rgba(243,244,246,0.5)"}; padding: 0.75rem; text-align: left; font-weight: 600; color: ${t?"#fff":"#111827"}; } 24 .blog-content td { border: 1px solid ${t?"#374151":"#e5e7eb"}; padding: 0.75rem; } 25 .blog-content iframe { width: 100%; aspect-ratio: 16/9; border-radius: 0.5rem; margin: 1rem 0; } 26 `})]}),e.jsx("div",{className:`mt-6 p-5 rounded-2xl border ${t?"bg-gradient-to-br from-gray-800/30 to-gray-900/30 border-gray-700/50":"bg-white border-gray-200 shadow-sm"}`,children:e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(V,{size:18,className:"text-blue-500 mr-3"}),e.jsx("span",{className:`font-semibold ${t?"text-white":"text-gray-900"}`,children:"Share this article"})]}),e.jsx("div",{className:"flex gap-2",children:e.jsx("button",{type:"button",onClick:I,title:"Copy link","aria-label":"Copy link",className:`p-3 rounded-xl transition-colors ${v?"bg-green-500/20 text-green-500":t?"bg-gray-700/50 hover:bg-gray-700 text-gray-300":"bg-gray-100 hover:bg-gray-200 text-gray-600"}`,children:v?e.jsx(X,{size:18}):e.jsx(Z,{size:18})})})]})})]})}),O.length>0&&e.jsx("section",{className:`py-16 ${t?"bg-gradient-to-b from-gray-900/50 to-[#0a0a0f]":"bg-gray-50"}`,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsx("h2",{className:`text-xl sm:text-2xl font-bold mb-8 ${t?"text-white":"text-gray-900"}`,children:"Related Articles"}),e.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-6",children:O.map(a=>e.jsx(P,{to:`/blog/${a.slug}/`,children:e.jsxs("div",{className:`rounded-2xl border p-4 transition-all duration-300 hover:shadow-lg ${t?"bg-gradient-to-br from-gray-800/50 to-gray-900/50 border-gray-700/50 hover:border-blue-500/30":"bg-white border-gray-200 hover:border-blue-300"}`,children:[a.cover_image_url&&e.jsx("div",{className:"aspect-video rounded-lg overflow-hidden mb-4",children:e.jsx("img",{src:a.cover_image_url,alt:a.title,className:"w-full h-full object-cover"})}),e.jsx("h3",{className:`font-semibold mb-2 line-clamp-2 ${t?"text-white":"text-gray-900"}`,children:a.title}),e.jsx("p",{className:`text-sm line-clamp-2 ${t?"text-gray-400":"text-gray-600"}`,children:a.excerpt})]})},a.id))})]})})]}),e.jsx(L,{}),e.jsx(me,{children:n.isOpen&&e.jsx(x.div,{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50",initial:{opacity:0}
26,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},onClick:n.onCancel,children:e.jsxs(x.div,{className:`rounded-xl shadow-2xl max-w-md w-full mx-4 p-6 ${t?"bg-gray-800 border border-gray-700":"bg-white"}`,initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{duration:.25,ease:[.4,0,.2,1]},onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center mb-4",children:[e.jsxs("div",{className:`w-10 h-10 rounded-full flex items-center justify-center mr-3 ${n.variant==="danger"?"bg-red-100":n.variant==="warning"?"bg-yellow-100":"bg-blue-100"}`,children:[n.variant==="danger"&&e.jsx("svg",{className:"w-5 h-5 text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.732-.833-2.5 0L4.732 18.5c-.77.833.192 2.5 1.732 2.5z"})}),n.variant==="warning"&&e.jsx("svg",{className:"w-5 h-5 text-yellow-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.732-.833-2.5 0L4.732 18.5c-.77.833.192 2.5 1.732 2.5z"})}),n.variant==="info"&&e.jsx("svg",{className:"w-5 h-5 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),e.jsx("h3",{className:`text-lg font-semibold ${t?"text-white":"text-gray-900"}`,children:n.title})]}),e.jsx("p",{className:`mb-6 text-sm leading-relaxed ${t?"text-gray-300":"text-gray-600"}`,children:n.message}),e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx("button",{onClick:n.onCancel,className:`px-4 py-2 rounded-lg text-sm font-medium border transition-all duration-200 ${t?"border-gray-600 text-gray-300 hover:bg-gray-700":"border-gray-300 text-gray-700 hover:bg-gray-50"}`,children:n.cancelText}),e.jsx("button",{onClick:n.onConfirm,className:`px-4 py-2 rounded-lg text-sm font-medium text-white transition-all duration-200 ${n.variant==="danger"?"bg-red-600 hover:bg-red-700":"bg-blue-600 hover:bg-blue-700"}`,children:n.confirmText})]})]})})})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{}),e.jsx("div",{className:`min-h-screen flex items-center justify-center ${t?"bg-[#0a0a0f]":"bg-gradient-to-b from-gray-50 to-white"}`,children:e.jsxs("div",{className:"text-center px-4",children:[e.jsx(ee,{size:64,className:`mx-auto mb-4 ${t?"text-gray-600":"text-gray-400"}`}),e.jsx("h1",{className:`text-2xl font-bold mb-4 ${t?"text-white":"text-gray-900"}`,children:"Blog not found"}),e.jsx(P,{to:"/blog/",children:e.jsxs("button",{className:"inline-flex items-center px-6 py-3 bg-gradient-to-r from-blue-500 to-purple-500 text-white font-semibold rounded-xl",children:[e.jsx(T,{size:18,className:"mr-2"})," Back to Blog"]})})]})}),e.jsx(L,{})]})};export{De as default};
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.