PageSourceSearch

https://socialselling.ai/_next/static/chunks/57186.8528c39c2c673cf7.js

js socialselling.ai collected 2026-10-05 14:51:45 UTC 156,882 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[57186],{57186:function(e,s,a){a.r(s),a.d(s,{BenefitsBlock:function(){return sg.I},BlockLibrary:function(){return A},BlockRenderer:function(){return Q.H},BlockWrapper:function(){return s_.q},BuilderCanvas:function(){return F},BuilderToolbar:function(){return S},ButtonBlock:function(){return sf.a},BuyButtonBlock:function(){return sw.D},CTABlock:function(){return sa.e},ColumnsBlock:function(){return sp.z},ComparisonBlock:function(){return sz.E},CountdownBlock:function(){return sv.v},EmailCaptureBlock:function(){return sj.Q},FAQBlock:function(){return sd.C},FeaturesBlock:function(){return st.U},FooterBlock:function(){return si.r},FormBlock:function(){return so.b},GalleryBlock:function(){return sh.$},HeaderBlock:function(){return sl.V},HeroBlock:function(){return se.U},ImageBlock:function(){return sx.r},LandingPageBuilder:function(){return e9},LogosBlock:function(){return sI.S},MapBlock:function(){return sb.Q},PricingBlock:function(){return sn.Y},ProductBlock:function(){return sC.v},PropertiesPanel:function(){return ek},ReviewsBlock:function(){return sk.z},SectionBlock:function(){return su.A},SocialLinksBlock:function(){return sN.F},StatsBlock:function(){return sc.x},TeamBlock:function(){return sy.p},TestimonialsBlock:function(){return sr.S},TextBlock:function(){return ss.a},VideoBlock:function(){return sm.n},blockCategories:function(){return B.OK},blockComponents:function(){return Q.j},blockRegistry:function(){return B.gG},getAllBlockTypes:function(){return B.Od},getBlockDefinition:function(){return B.Ys},getBlocksByCategory:function(){return B.Fh},useBuilderStore:function(){return x.i}});var t=a(57437),l=a(2265),i=a(99376),n=a(10795),r=a(93662),c=a(14438),d=a(71837),o=a(5442),x=a(90743),m=a(93448),h=a(12381),u=a(40279),p=a(32060),g=a(32660),j=a(14064),v=a(18477),f=a(99897),N=a(28553),y=a(33388),b=a(30401),w=a(15863),C=a(83229),k=a(6076),I=a(40875),z=a(96362),_=a(61341);function S(e){let{onSave:s,onPreview:a,onPublish:l,onOpenAI:n,isPublishing:r=!1,className:c}=e,d=(0,i.useRouter)(),{pageName:o,setPageName:S,deviceView:D,setDeviceView:P,undo:Z,redo:B,canUndo:T,canRedo:A,isSaving:Q,lastSaved:L,hasUnsavedChanges:R,status:F,pageSlug:U}=(0,x.i)();return(0,t.jsxs)("div",{className:(0,m.cn)("h-16 flex items-center justify-between px-4 gap-4 shadow-sm",c),style:{background:"linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%)"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)(h.z,{variant:"ghost",size:"sm",onClick:()=>d.push("/dashboard/landing-pages"),className:"gap-2 text-white hover:bg-white/20 hover:text-white",children:[(0,t.jsx)(g.Z,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Back"})]}),(0,t.jsx)("div",{className:"h-6 w-px bg-white/30"}),(0,t.jsx)(u.I,{value:o,onChange:e=>S(e.target.value),className:"w-52 h-9 text-sm font-medium bg-white/20 border-white/30 text-white placeholder:text-white/60 hover:bg-white/30 focus:bg-white focus:text-gray-800 focus:border-white rounded-lg",placeholder:"Page name"}),R&&(0,t.jsx)("span",{className:"text-xs text-amber-900 bg-amber-300 px-2.5 py-1 rounded-full font-medium",children:"Unsaved"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 mr-2",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"icon",className:"h-9 w-9 text-white hover:bg-white/20 hover:text-white rounded-lg",onClick:Z,disabled:!T(),title:"Undo (Ctrl+Z)",children:(0,t.jsx)(j.Z,{className:"w-4 h-4"})}),(0,t.jsx)(h.z,{variant:"ghost",size:"icon",className:"h-9 w-9 text-white hover:bg-white/20 hover:text-white rounded-lg",onClick:B,disabled:!A(),title:"Redo (Ctrl+Shift+Z)",children:(0,t.jsx)(v.Z,{className:"w-4 h-4"})})]}),(0,t.jsxs)("div",{className:"flex items-center bg-white/20 rounded-xl p-1",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"icon",className:(0,m.cn)("h-8 w-8 rounded-lg transition-all","desktop"===D?"bg-white text-emerald-600 shadow-sm":"text-white hover:bg-white/20"),onClick:()=>P("desktop"),title:"Desktop view",children:(0,t.jsx)(f.Z,{className:"w-4 h-4"})}),(0,t.jsx)(h.z,{variant:"ghost",size:"icon",className:(0,m.cn)("h-8 w-8 rounded-lg transition-all","tablet"===D?"bg-white text-emerald-600 shadow-sm":"text-white hover:bg-white/20"),onClick:()=>P("tablet"),title:"Tablet view",children:(0,t.jsx)(N.Z,{className:"w-4 h-4"})}),(0,t.jsx)(h.z,{variant:"ghost",size:"icon",className:(0,m.cn)("h-8 w-8 rounded-lg transition-all","mobile"===D?"bg-white text-emerald-600 shadow-sm":"text-white hover:bg-white/20"),onClick:()=>P("mobile"),title:"Mobile view",children:(0,t.jsx)(y.Z,{className:"w-4 h-4"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[L&&!R&&(0,t.jsxs)("span",{className:"text-xs text-white/90 hidden sm:flex items-center gap-1 bg-white/20 px-2.5 py-1 rounded-full",children:[(0,t.jsx)(b.Z,{className:"w-3 h-3 text-white"}),"Saved ",(()=>{if(!L)return null;let e=Math.floor((new Date().getTime()-L.getTime())/6e4);return e<1?"Just now":1===e?"1 minute ago":e<60?"".concat(e," minutes ago"):L.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})()]}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>s(),disabled:Q||!R,className:"gap-2 bg-white/20 border-white/30 text-white hover:bg-white hover:text-emerald-600 rounded-lg h-9",children:[Q?(0,t.jsx)(w.Z,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(C.Z,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Save"})]}),(0,t.jsxs)(p.h_,{children:[(0,t.jsx)(p.$F,{asChild:!0,children:(0,t.jsxs)(h.z,{size:"sm",className:"gap-2 bg-white text-emerald-600 hover:bg-emerald-50 hover:text-emerald-700 rounded-lg h-9 shadow-sm",disabled:r,children:[r?(0,t.jsx)(w.Z,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(k.Z,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:r?"Publishing...":"published"===F?"Published":"Publish"}),(0,t.jsx)(I.Z,{className:"w-3 h-3"})]})}),(0,t.jsxs)(p.AW,{align:"end",className:"w-48 rounded-xl",children:[(0,t.jsxs)(p.Xi,{onClick:l,disabled:r,className:"rounded-lg",children:[r?(0,t.jsx)(w.Z,{className:"w-4 h-4 mr-2 animate-spin"}):(0,t.jsx)(k.Z,{className:"w-4 h-4 mr-2 text-emerald-500"}),"published"===F?"Update Live Page":"Publish Page"]}),(0,t.jsxs)(p.Xi,{onClick:()=>U&&window.open("/landing/".concat(U),"_blank"),disabled:"published"!==F,className:"rounded-lg",children:[(0,t.jsx)(z.Z,{className:"w-4 h-4 mr-2 text-blue-500"}),"View Live Page"]}),(0,t.jsx)(p.VD,{}),(0,t.jsxs)(p.Xi,{disabled:r,className:"rounded-lg",children:[(0,t.jsx)(_.Z,{className:"w-4 h-4 mr-2 text-purple-500"}),"Deploy to Bheem Cloud"]})]})]})]})]})}var D=a(90641),P=a(41905),Z=a(73247),B=a(66042);function T(e){let{block:s}=e,{attributes:a,listeners:l,setNodeRef:i,isDragging:r}=(0,n.O1)({id:"new-".concat(s.type),data:{type:"new-block",blockType:s.type,blockDefinition:s}}),c=s.icon;return(0,t.jsxs)("div",{ref:i,...l,...a,className:(0,m.cn)("flex items-center gap-3 p-3 rounded-lg border border-gray-200 bg-white","cursor-grab active:cursor-grabbing hover:border-blue-300 hover:bg-blue-50/50","transition-all group",r&&"opacity-50 ring-2 ring-blue-500"),children:[(0,t.jsx)("div",{className:"p-2 rounded-md bg-gray-100 dark:bg-gray-800 group-hover:bg-blue-100 dar
1k:group-hover:bg-blue-900/50 transition-colors",children:(0,t.jsx)(c,{className:"w-4 h-4 text-gray-600 dark:text-gray-400 group-hover:text-blue-600 dark:group-hover:text-blue-400"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-medium truncate",children:s.name}),(0,t.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:s.description})]}),(0,t.jsx)(P.Z,{className:"w-4 h-4 text-gray-400 dark:text-gray-500 opacity-0 group-hover:opacity-100 transition-opacity"})]})}function A(e){let{className:s}=e,[a,i]=(0,l.useState)(""),[n,r]=(0,l.useState)(new Set(["layout","content","conversion"])),c=e=>{r(s=>{let a=new Set(s);return a.has(e)?a.delete(e):a.add(e),a})},d=a?Object.values(B.gG).filter(e=>e.name.toLowerCase().includes(a.toLowerCase())||e.description.toLowerCase().includes(a.toLowerCase())||e.type.toLowerCase().includes(a.toLowerCase())):null;return(0,t.jsxs)("div",{"data-tour":"builder-block-library",className:(0,m.cn)("flex flex-col h-full bg-gray-50 border-r",s),children:[(0,t.jsxs)("div",{className:"p-4 border-b bg-white",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Blocks"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(Z.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),(0,t.jsx)(u.I,{type:"text",placeholder:"Search blocks...",value:a,onChange:e=>i(e.target.value),className:"pl-9 h-9 text-sm"})]})]}),(0,t.jsx)(D.x,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-4 space-y-4",children:d?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("p",{className:"text-xs text-gray-500 mb-3",children:[d.length," block",1!==d.length?"s":""," found"]}),d.map(e=>(0,t.jsx)(T,{block:e},e.type)),0===d.length&&(0,t.jsx)("p",{className:"text-sm text-gray-500 text-center py-8",children:"No blocks match your search"})]}):B.OK.map(e=>{let s=(0,B.Fh)(e.id),a=n.has(e.id),l=e.icon;return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("button",{onClick:()=>c(e.id),className:(0,m.cn)("flex items-center gap-2 w-full px-2 py-1.5 rounded-md","text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"),children:[(0,t.jsx)(l,{className:"w-4 h-4 text-gray-500 dark:text-gray-400"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.name}),(0,t.jsx)("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:s.length}),(0,t.jsx)("svg",{className:(0,m.cn)("w-4 h-4 text-gray-400 transition-transform",a&&"rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),a&&(0,t.jsx)("div",{className:"space-y-2 pl-2",children:s.map(e=>(0,t.jsx)(T,{block:e},e.type))})]},e.id)})})}),(0,t.jsx)("div",{className:"px-3 pt-3 pb-2 border-t bg-amber-50",children:(0,t.jsxs)("p",{className:"text-xs text-amber-700",children:[(0,t.jsx)("span",{className:"font-semibold",children:"Tip:"})," Add a ",(0,t.jsx)("span",{className:"font-semibold",children:"Contact Form"})," from Conversion section to capture leads into your pipeline."]})}),(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:(0,t.jsx)("p",{className:"text-xs text-gray-500 text-center",children:"Drag blocks to the canvas to add them"})})]})}var Q=a(26033),L=a(37533),R=a(99397);function F(e){let{className:s}=e,{blocks:a,selectedBlockId:l,selectBlock:i,deviceView:c,isPreviewMode:d}=(0,x.i)(),{setNodeRef:o,isOver:h}=(0,n.Zj)({id:"canvas-drop-zone"});return(0,t.jsx)("div",{className:(0,m.cn)("flex-1 bg-gray-100 overflow-auto",s),onClick:e=>{e.target===e.currentTarget&&i(null)},children:(0,t.jsx)("div",{className:"min-h-full p-8 flex justify-center",children:(0,t.jsxs)("div",{ref:o,style:{width:{desktop:"100%",tablet:"768px",mobile:"375px"}[c],maxWidth:"100%"},className:(0,m.cn)("bg-white shadow-lg rounded-lg overflow-hidden min-h-[600px] transition-all duration-300",h&&"ring-2 ring-blue-500 ring-offset-4","mobile"===c&&"rounded-[32px] border-8 border-gray-800","tablet"===c&&"rounded-2xl border-4 border-gray-700"),children:["desktop"!==c&&(0,t.jsx)("div",{className:(0,m.cn)("bg-gray-800 flex items-center justify-center","mobile"===c?"h-6":"h-4"),children:"mobile"===c&&(0,t.jsx)("div",{className:"w-16 h-1 bg-gray-700 rounded-full"})}),(0,t.jsxs)("div",{className:"relative",children:[0===a.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-32 px-4",children:[(0,t.jsx)("div",{className:"w-16 h-16 rounded-full bg-blue-50 flex items-center justify-center mb-4",children:(0,t.jsx)(L.Z,{className:"w-8 h-8 text-blue-500"})}),(0,t.jsx)("h3",{className:(0,m.cn)("font-semibold text-gray-900 mb-2 text-center","mobile"===c?"text-base":"text-lg"),children:"Start Building Your Page"}),(0,t.jsx)("p",{className:(0,m.cn)("text-gray-500 text-center mb-6","mobile"===c?"text-xs max-w-[280px]":"text-sm max-w-sm"),children:"Drag blocks from the left panel and drop them here to start building your landing page."}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-blue-600",children:[(0,t.jsx)(R.Z,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Drag your first block here"})]})]}):(0,t.jsx)(r.Fo,{items:a.map(e=>e.id),strategy:r.qw,children:(0,t.jsxs)("div",{className:(0,m.cn)("relative","desktop"===c&&"pl-12 pr-12","tablet"===c&&"pl-6 pr-6","mobile"===c&&"pl-2 pr-2"),children:[a.map((e,s)=>(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:(0,m.cn)("absolute -top-1 left-0 right-0 h-2 z-10","opacity-0 hover:opacity-100 transition-opacity",!d&&"cursor-pointer"),children:(0,t.jsx)("div",{className:"h-0.5 bg-blue-500 mx-4"})}),(0,t.jsx)(Q.H,{block:e,isPreview:d,deviceView:c})]},e.id)),!d&&(0,t.jsx)("div",{className:"py-8 flex justify-center",children:(0,t.jsxs)("div",{className:(0,m.cn)("flex items-center gap-2 px-4 py-2 rounded-lg","border-2 border-dashed border-gray-300 text-gray-500","hover:border-blue-400 hover:text-blue-600 transition-colors cursor-pointer"),children:[(0,t.jsx)(R.Z,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Add block"})]})})]})}),h&&(0,t.jsx)("div",{className:"absolute inset-0 bg-blue-500/10 border-2 border-blue-500 border-dashed rounded-lg flex items-center justify-center pointer-events-none",children:(0,t.jsx)("div",{className:"bg-blue-500 text-white px-4 py-2 rounded-lg font-medium",children:"Drop block here"})})]}),"desktop"!==c&&(0,t.jsx)("div",{className:(0,m.cn)("bg-gray-800 flex items-center justify-center","mobile"===c?"h-8":"h-4"),children:"mobile"===c&&(0,t.jsx)("div",{className:"w-10 h-10 border-2 border-gray-700 rounded-full"})})]})})})}var U=a(75060),V=a(23675),E=a(17168),q=a(15291),M=a(94589),O=a(31397),G=a(98728),H=a(82023),Y=a(32489),K=a(12805),W=a(18930),$=a(22135),X=a(17689),J=a(98335);function ee(e){let{value:s,onChange:a,label:i="Image",className:n}=e,[r,o]=(0,l.useState)(!1),[x,p]=(0,l.useState)(!1),[g,j]=(0,l.useState)(""),v=(0,l.useRef)(null),f=async e=>{var s,t;let l=null===(s=e.target.files)||void 0===s?void 0:s[0];if(l){if(!l.type.startsWith("image/")){c.A.error("Please select an image file");return}if(l.size>5242880){c.A.error("Image must be less than 5MB");return}o(!0);try{let e=new FormData;e.append("file",l);let s=(await d.api.post("/upload/image",e,{headers:{"Content-Type":"multipart/form-data"}})).data;if(s.success&&(null===(t=s.data)||void 0===t?void 0:t.url))a(s.data.url),c.A.success("Image uploaded!");else throw Error("Upload failed")}catch(s){let e=new FileReader;e.onloadend=()=>{a(e.result),c.A.success("Image loaded locally")}
1,e.readAsDataURL(l)}finally{o(!1),v.current&&(v.current.value="")}}},N=()=>{g.trim()&&(a(g.trim()),j(""),p(!1),c.A.success("Image URL added"))};return(0,t.jsxs)("div",{className:(0,m.cn)("space-y-2",n),children:[(0,t.jsx)(U._,{className:"text-sm",children:i}),s?(0,t.jsxs)("div",{className:"relative group",children:[(0,t.jsx)("div",{className:"relative aspect-video rounded-lg overflow-hidden bg-gray-100 border",children:(0,t.jsx)("img",{src:s,alt:"Preview",className:"w-full h-full object-cover",onError:e=>{e.target.src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect fill="%23f3f4f6" width="100" height="100"/><text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" fill="%239ca3af" font-size="12">Invalid Image</text></svg>'}})}),(0,t.jsx)(h.z,{variant:"destructive",size:"icon",className:"absolute top-2 right-2 h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>{a("")},children:(0,t.jsx)(Y.Z,{className:"w-4 h-4"})})]}):(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:(0,m.cn)("border-2 border-dashed rounded-lg p-4 text-center cursor-pointer transition-colors","hover:border-blue-400 hover:bg-blue-50/50",r&&"pointer-events-none opacity-50"),onClick:()=>{var e;return null===(e=v.current)||void 0===e?void 0:e.click()},children:[(0,t.jsx)("input",{ref:v,type:"file",accept:"image/*",onChange:f,className:"hidden"}),r?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 py-2",children:[(0,t.jsx)(w.Z,{className:"w-6 h-6 text-blue-500 animate-spin"}),(0,t.jsx)("p",{className:"text-xs text-gray-500",children:"Uploading..."})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 py-2",children:[(0,t.jsx)(X.Z,{className:"w-6 h-6 text-gray-400"}),(0,t.jsx)("p",{className:"text-xs text-gray-600",children:"Click to upload image"}),(0,t.jsx)("p",{className:"text-xs text-gray-400",children:"PNG, JPG up to 5MB"})]})]}),x?(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(u.I,{placeholder:"https://example.com/image.jpg",value:g,onChange:e=>j(e.target.value),onKeyDown:e=>"Enter"===e.key&&N(),className:"flex-1 h-9 text-sm"}),(0,t.jsx)(h.z,{size:"sm",onClick:N,children:"Add"}),(0,t.jsx)(h.z,{variant:"ghost",size:"sm",onClick:()=>{p(!1),j("")},children:(0,t.jsx)(Y.Z,{className:"w-4 h-4"})})]}):(0,t.jsxs)(h.z,{variant:"outline",size:"sm",className:"w-full",onClick:()=>p(!0),children:[(0,t.jsx)(J.Z,{className:"w-4 h-4 mr-2"}),"Use image URL"]})]})]})}var es=a(81328),ea=a(19680),et=a(17494),el=a(7586),ei=a(28645),en=a(31734),er=a(58310),ec=a(17881),ed=a(29985);function eo(e){let{label:s,value:a,onChange:i}=e,n=(0,l.useRef)(null),[r,c]=(0,l.useState)(!1),[d,o]=(0,l.useState)(""),[x,m]=(0,l.useState)(!1);(0,l.useEffect)(()=>{n.current&&(!x||document.activeElement!==n.current)&&(n.current.innerHTML=a||"",m(!0))},[a,x]);let u=()=>{n.current&&i(n.current.innerHTML)},p=(e,s)=>{var a;document.execCommand(e,!1,s),null===(a=n.current)||void 0===a||a.focus(),u()},g=[{icon:es.Z,command:"bold",title:"Bold"},{icon:ea.Z,command:"italic",title:"Italic"},{icon:et.Z,command:"underline",title:"Underline"}],j=[{icon:el.Z,command:"insertUnorderedList",title:"Bullet List"},{icon:ei.Z,command:"insertOrderedList",title:"Numbered List"}],v=[{icon:en.Z,command:"justifyLeft",title:"Align Left"},{icon:er.Z,command:"justifyCenter",title:"Align Center"},{icon:ec.Z,command:"justifyRight",title:"Align Right"}],f=()=>{d&&(p("createLink",d),o(""),c(!1))};return(0,t.jsxs)("div",{className:"space-y-2",children:[s&&(0,t.jsx)(U._,{className:"text-sm",children:s}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 p-1 border rounded-t-md bg-gray-50",children:[g.map(e=>{let{icon:s,command:a,title:l}=e;return(0,t.jsx)(h.z,{type:"button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0",title:l,onClick:()=>p(a),children:(0,t.jsx)(s,{className:"h-3.5 w-3.5"})},a)}),(0,t.jsx)("div",{className:"w-px h-6 bg-gray-300 mx-1"}),j.map(e=>{let{icon:s,command:a,title:l}=e;return(0,t.jsx)(h.z,{type:"button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0",title:l,onClick:()=>p(a),children:(0,t.jsx)(s,{className:"h-3.5 w-3.5"})},a)}),(0,t.jsx)("div",{className:"w-px h-6 bg-gray-300 mx-1"}),v.map(e=>{let{icon:s,command:a,title:l}=e;return(0,t.jsx)(h.z,{type:"button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0",title:l,onClick:()=>p(a),children:(0,t.jsx)(s,{className:"h-3.5 w-3.5"})},a)}),(0,t.jsx)("div",{className:"w-px h-6 bg-gray-300 mx-1"}),(0,t.jsx)(h.z,{type:"button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0",title:"Insert Link",onClick:()=>c(!r),children:(0,t.jsx)(ed.Z,{className:"h-3.5 w-3.5"})})]}),r&&(0,t.jsxs)("div",{className:"flex gap-1 p-2 border-x bg-gray-50",children:[(0,t.jsx)("input",{type:"url",placeholder:"Enter URL...",value:d,onChange:e=>o(e.target.value),className:"flex-1 px-2 py-1 text-sm border rounded",onKeyDown:e=>"Enter"===e.key&&f()}),(0,t.jsx)(h.z,{type:"button",size:"sm",className:"h-7",onClick:f,children:"Add"})]}),(0,t.jsx)("div",{ref:n,contentEditable:!0,className:"min-h-[120px] max-h-[300px] overflow-y-auto p-3 border border-t-0 rounded-b-md bg-white focus:outline-none focus:ring-2 focus:ring-emerald-500 prose prose-sm max-w-none",onInput:u,onBlur:u,suppressContentEditableWarning:!0}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Use the toolbar to format your text with bold, italic, lists, and links."})]})}var ex=a(75277),em=a(48736),eh=a(70112),eu=a(86595),ep=a(53113),eg=a(29374),ej=a(42820),ev=a(78867),ef=a(44743),eN=a(40039),ey=a(69064);let eb=[{id:"headlines",label:"Headlines",icon:ex.Z,color:"text-blue-600 bg-blue-50 hover:bg-blue-100"},{id:"copy",label:"Copy",icon:em.Z,color:"text-green-600 bg-green-50 hover:bg-green-100"},{id:"cta",label:"CTA",icon:L.Z,color:"text-orange-600 bg-orange-50 hover:bg-orange-100"},{id:"faq",label:"FAQ",icon:eh.Z,color:"text-purple-600 bg-purple-50 hover:bg-purple-100"},{id:"testimonials",label:"Reviews",icon:eu.Z,color:"text-yellow-600 bg-yellow-50 hover:bg-yellow-100"},{id:"images",label:"Images",icon:ep.Z,color:"text-pink-600 bg-pink-50 hover:bg-pink-100"},{id:"videos",label:"Videos",icon:eg.Z,color:"text-red-600 bg-red-50 hover:bg-red-100"},{id:"improve",label:"Improve",icon:ej.Z,color:"text-indigo-600 bg-indigo-50 hover:bg-indigo-100"}],ew={id:"1",role:"assistant",content:"Hi! I can help you create content for your landing page. Select a content type below and describe what you need.",timestamp:new Date};function eC(e){var s,a;let{onInsertContent:i,pageContext:n="",pageId:r="",className:c}=e,o=r?"ai_chat_".concat(r):null,[x,p]=(0,l.useState)([ew]),[g,j]=(0,l.useState)(!1);(0,l.useEffect)(()=>
1{if(!o){j(!0);return}try{let e=sessionStorage.getItem(o);if(e){let s=JSON.parse(e).map(e=>({...e,timestamp:new Date(e.timestamp)}));p(s)}}catch(e){console.error("Failed to load chat history:",e)}j(!0)},[o]),(0,l.useEffect)(()=>{if(o&&g)try{sessionStorage.setItem(o,JSON.stringify(x))}catch(e){console.error("Failed to save chat history:",e)}},[x,o,g]);let[v,f]=(0,l.useState)(""),[N,y]=(0,l.useState)(!1),[C,k]=(0,l.useState)(null),[I,z]=(0,l.useState)(null),[_,S]=(0,l.useState)("minimax-video"),[P,Z]=(0,l.useState)("5"),B={"minimax-video":{name:"Basic",cost:"4cr/s",creditsPerSec:4,durations:[4,5,6],maxDuration:6,tier:"Normal"},"veo3-fast":{name:"Fast",cost:"31cr/s",creditsPerSec:31,durations:[4,6,8],maxDuration:8,tier:"Premium"},"kling-2.1-master":{name:"Pro",cost:"50cr/s",creditsPerSec:50,durations:[5,10],maxDuration:10,tier:"Premium"},veo3:{name:"Ultra",cost:"75cr/s",creditsPerSec:75,durations:[4,6,8],maxDuration:8,tier:"Excellent"}},T=()=>{var e;return(null===(e=B[_])||void 0===e?void 0:e.durations)||[5]},[A,Q]=(0,l.useState)(!1),L=(0,l.useRef)(null),F=(0,l.useRef)(null);(0,l.useEffect)(()=>{var e;null===(e=L.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},[x]);let V=e=>{var s;k(e),Q("videos"===e),null===(s=F.current)||void 0===s||s.focus();let a={id:Date.now().toString(),role:"assistant",content:{headlines:"Describe your product/service and I'll generate compelling headlines.",copy:"What section do you need copy for? Describe your product/service.",cta:"What action do you want users to take? Describe the context.",faq:"What topics should the FAQ cover? Describe your product/service.",testimonials:"Describe your product and target customers for realistic testimonials.",images:"Describe the image you want. Include style, colors, and composition.",videos:"Describe your video. Select model and duration below, then describe the content.",improve:"Paste the content you want to improve and describe the changes needed."}[e],type:e,timestamp:new Date};p(e=>[...e,a])},E=async()=>{var e,s,a,t,l,i,c,o,x,m;if(!v.trim()||N)return;if(!C){ey.default.error("Please select a content type first");return}let h={id:Date.now().toString(),role:"user",content:v.trim(),timestamp:new Date};p(e=>[...e,h]),f(""),y(!0);try{let x="",m={};switch(C){case"headlines":x="/landing-pages/ai/generate-headlines",m={context:h.content,tone:"professional",max_length:60,count:5};break;case"copy":x="/landing-pages/ai/generate-copy",m={context:h.content,section_type:"benefits",tone:"professional",word_count:150};break;case"cta":x="/landing-pages/ai/generate-cta",m={context:h.content,action:"signup",urgency:!1,count:5};break;case"faq":x="/landing-pages/ai/generate-faq",m={context:h.content,count:5,answer_length:"medium"};break;case"testimonials":x="/landing-pages/ai/generate-testimonials",m={context:h.content,count:3,include_metrics:!0};break;case"images":x="/ai-studio/generate/image",m={prompt:h.content,model:"flux-pro",size:"1024x1024",num_images:1};break;case"videos":x="/ai-studio/generate/video",m={prompt:h.content,model:_,aspect_ratio:"16:9",duration:parseInt(P)};break;case"improve":x="/landing-pages/ai/improve-content",m={content:h.content,improvement_type:"clarity",context:n}}let u=(await d.api.post(x,m)).data;if(u.success){let n=[],d="";if("images"===C)d=(n=((null===(e=u.data)||void 0===e?void 0:e.images)||[]).map(e=>({url:e.s3_url||e.url,prompt:h.content}))).length>0?"Here's the image I generated:":"Failed to generate image.";else if("videos"===C){let e=(null===(t=u.data)||void 0===t?void 0:null===(a=t.videos)||void 0===a?void 0:null===(s=a[0])||void 0===s?void 0:s.s3_url)||(null===(c=u.data)||void 0===c?void 0:null===(i=c.videos)||void 0===i?void 0:null===(l=i[0])||void 0===l?void 0:l.url)||(null===(o=u.data)||void 0===o?void 0:o.videoUrl);e?(n=[{url:e,prompt:h.content}],d="Here's the video I generated:"):d="Video is being processed. Please check back later."}else{let e=(n=Array.isArray(u.content)?u.content:[u.content]).length,s="testimonials"===C?"reviews":"headlines"===C?"headlines":C;d="Here ".concat(1===e?"is":"are"," ").concat(e," ").concat(s,' I generated. Click "Insert" to add to your page:')}let x={id:Date.now().toString(),role:"assistant",content:d,type:C,generatedItems:n,timestamp:new Date};if(p(e=>[...e,x]),"images"!==C&&"videos"!==C)try{await (0,eN.wQ)("ai_content_enhance",1,{source:"landing_page_builder",content_type:C,page_id:r}),(0,eN.X8)()}catch(e){console.error("Credit deduction failed:",e)}else(0,eN.X8)()}else throw Error(u.error||"Generation failed")}catch(l){console.error("AI generation error:",l);let e=C?({headlines:"headline",copy:"copy",cta:"CTA",faq:"FAQ",testimonials:"review",images:"image",videos:"video",improve:"content improvement"})[C]:"content",s="Sorry, ".concat(e," generation failed. Please try again later."),a=(null===(m=l.response)||void 0===m?void 0:null===(x=m.data)||void 0===x?void 0:x.detail)||l.message||"";a.toLowerCase().includes("timeout")?s="Sorry, ".concat(e," generation took too long. Please try again with a simpler request."):a.toLowerCase().includes("unavailable")||a.toLowerCase().includes("temporarily")?s="Sorry, ".concat(e," generation is temporarily unavailable. Please try again later."):a.toLowerCase().includes("rate limit")||a.toLowerCase().includes("too many")?s="Sorry, too many requests. Please wait a moment and try again.":(a.toLowerCase().includes("not configured")||a.toLowerCase().includes("api key"))&&(s="Sorry, ".concat(e," generation service is not available. Please contact support."));let t={id:Date.now().toString(),role:"assistant",content:s,timestamp:new Date};p(e=>[...e,t]),ey.default.error("".concat(e.charAt(0).toUpperCase()+e.slice(1)," generation failed"))}finally{y(!1)}},M=(e,s)=>{navigator.clipboard.writeText("string"==typeof e?e:JSON.stringify(e)),z(s),setTimeout(()=>z(null),2e3),ey.default.success("Copied!")},O=(e,s)=>{let a=e;"headlines"===s&&"string"==typeof e?a=e:"copy"===s&&"string"==typeof e?a=e:"improve"===s&&"string"==typeof e?a=e:"cta"===s&&"object"==typeof e?a=e:"faq"===s&&"object"==typeof e?a=e:"testimonials"===s&&"object"==typeof e?a=e:"images"===s&&"object"==typeof e?a={url:e.url,prompt:e.prompt}:"videos"===s&&"object"==typeof e&&(a={url:e.url,prompt:e.prompt}),i(a,s),ey.default.success("Content inserted to page!")},G=(e,s,a,l)=>{let i="".concat(l,"-").concat(s);if("images"===a)return(0,t.jsxs)("div",{className:"mt-2 rounded-lg overflow-hidden border bg-white",children:[(0,t.jsx)("img",{src:e.url,alt:"Generated",className:"w-full h-40 object-cover"}),(0,t.jsx)("div",{className:"p-2 flex gap-2 border-t",children:(0,t.jsxs)(h.z,{size:"sm",className:"flex-1 h-8 text-xs",onClick:()=>O(e,a),children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Insert to Page"]})})]},s);if("videos"===a)return(0,t.jsxs)("div",{className:"mt-2 rounded-lg overflow-hidden border bg-white",children:[(0,t.jsx)("video",{src:e.url,controls:!0,className:"w-full h-40 object-cover"}),(0,t.jsx)("div",{className:"p-2 flex gap-2 border-t",children:(0,t.jsxs)(h.z,{size:"sm",className:"flex-1 h-8 text-xs",onClick:()=>O(e,a),children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Insert to Page"]})})]},s);if("cta"===a&&"object"==typeof e)return(0,t.jsxs)("div",{className:"mt-2 p-3 bg-white rounded-lg border",children:[(0,t.jsx)("div",{className:"font-semibold text-blue-600",children:e.button}),e.subtext&&(0,t.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:e.subtext}),(0,t.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,t.jsxs)(h.z,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>M(e.button,i),children:[I===i?(0,t.jsx)(b.Z,{className:"w-3 h-3 mr-1"}):(0,t.jsx)(ev.Z,{className:"w-3 h-3 mr-1"})," Copy"]}),(0,t.jsxs)(h.z,{size:"sm",className:"h-7 text-xs",onClick:()=>O(e,a),children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Insert"]})]})]},s);if("faq"===a&&"object"==typeof e)return(0,t.jsxs)("div",{className:"mt-2 p-3 bg-white rounded-lg border",children:[(0,t.jsxs)("div",{className:"font-medium text-sm",children:["Q: ",e.question]}),(0,t.jsxs)("div",{className:"text-gray-600 mt-1 text-xs",children:["A: ",e.answer]}),(0,t.jsx)("div",{className:"flex gap-2 mt-2",children:(0,t.jsxs)(h.z,{size:"sm",className:"h-7 text-xs",onClick:()=>O(e,a),children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Insert"]})})]},s);if("testimonials"===a&&"object"==typeof e)return(0,t.jsxs)("div",{className:"mt-2 p-3 bg-white rounded-lg border",children:[(0,t.jsxs)("div",{className:"italic text-sm",children:['"',e.quote,'"']}),(0,t.jsxs)("div",{className:"text-xs text-gray-500 mt-2",children:["— ",e.name,", ",e.role,e.company?", ".concat(e.company):""]}),(0,t.jsx)("div",{className:"flex gap-2 mt-2",children:(0,t.jsxs)(h.z,{size:"sm",className:"h-7 text-xs",onClick:()=>O(e,a),children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Insert"]})})]},s);let n="string"==typeof e?e:JSON.stringify(e);return(0,t.jsxs)("div",{className:"mt-2 p-3 bg-white rounded-lg border",children:[(0,t.jsx)("p",{className:"text-sm text-gray-800",children:n}),(0,t.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,t.jsxs)(h.z,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>M(n,i),children:[I===i?(0,t.jsx)(b.Z,{className:"w-3 h-3 mr-1"}):(0,t.jsx)(ev.Z,{className:"w-3 h-3 mr-1"})," Copy"]}),(0,t.jsxs)(h.z,{size:"sm",className:"h-7 text-xs",onClick:()=>O(n,a),children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Insert"]})]})]},s)};return(0,t.jsxs)("div",{className:(0,m.cn)("flex flex-col h-full bg-white",c),children:[(0,t.jsxs)("div",{className:"px-4 py-3 border-b flex items-center justify-between bg-gradient-to-r from-purple-50 to-blue-50 shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(H.Z,{className:"w-4 h-4 text-purple-500"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-gray-800",children:"AI Assistant"})]}),(0,t.jsxs)(h.z,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{p([ew]),k(null),Q(!1),o&&sessionStorage.removeItem(o)},children:[(0,t.jsx)(Y.Z,{className:"w-3 h-3 mr-1"})," Clear"]})]}),(0,t.jsx)(D.x,{className:"flex-1 px-3 py-2",children:(0,t.jsxs)("div",{className:"space-y-3",children:[x.map(e=>(0,t.jsx)("div",{className:(0,m.cn)("flex","user"===e.role?"justify-end":"justify-start"),children:(0,t.jsxs)("div",{className:(0,m.cn)("max-w-[90%] rounded-lg px-3 py-2 text-sm","user"===e.role?"bg-blue-500 text-white":"bg-gray-100 text-gray-800"),children:[(0,t.jsx)("p",{children:e.content}),e.generatedItems&&e.type&&(0,t.jsx)("div",{className:"mt-1",children:e.generatedItems.map((s,a)=>G(s,a,e.type,e.id))})]})},e.id)),N&&C&&(0,t.jsx)("div",{className:"flex justify-start",children:(0,t.jsxs)("div",{className:"bg-gradient-to-r from-purple-50 to-blue-50 rounded-lg px-4 py-3 flex items-center gap-3 border border-purple-100",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(w.Z,{className:"w-5 h-5 animate-spin text-purple-500"}),(0,t.jsx)("div",{className:"absolute inset-0 w-5 h-5 animate-ping opacity-30",children:(0,t.jsx)(H.Z,{className:"w-5 h-5 text-purple-400"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["headlines"===C&&"Crafting compelling headlines...","copy"===C&&"Writing engaging copy...","cta"===C&&"Creating powerful CTAs...","faq"===C&&"Generating helpful FAQs...","testimonials"===C&&"Creating authentic reviews...","images"===C&&"Generating your image...","videos"===C&&"Creating your video...","improve"===C&&"Improving your content..."]}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:"This may take a few seconds"})]})]})}),(0,t.jsx)("div",{ref:L})]})}),(0,t.jsxs)("div",{className:"shrink-0 border-t bg-white",children:[(0,t.jsx)("div",{className:"px-2 py-2 bg-gray-50 border-b",children:(0,t.jsx)("div",{className:"grid grid-cols-4 gap-1",children:eb.map(e=>{let s=e.icon,a=C===e.id;return(0,t.jsxs)("button",{onClick:()=>V(e.id),className:(0,m.cn)("flex flex-col items-center gap-0.5 px-1 py-1.5 rounded-lg text-[10px] font-medium transition-all",a?"bg-purple-500 text-white shadow-sm":"bg-white hover:bg-gray-100 text-gray-700 border"),children:[(0,t.jsx)(s,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"truncate w-full text-center",children:e.label})]},e.id)})})}),A&&(0,t.jsxs)("div",{className:"px-2 py-2 bg-yellow-50 border-b",children:[(0,t.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(U._,{className:"text-[10px] text-gray-600",children:"Model"}),(0,t.jsxs)(q.Ph,{value:_,onValueChange:e=>{S(e);let s=B[e];s&&!s.durations.includes(parseInt(P))&&Z(s.durations[0].toString())},children:[(0,t.jsx)(q.i4,{className:"h-7 text-xs mt-0.5",children:(0,t.jsx)(q.ki,{})}),(0,t.jsxs)(q.Bw,{children:[(0,t.jsxs)(q.Ql,{value:"minimax-video",children:["Basic (",B["minimax-video"].cost,") \uD83D\uDCB0"]}),(0,t.jsxs)(q.Ql,{value:"veo3-fast",children:["Fast (",B["veo3-fast"].cost,")"]}),(0,t.jsxs)(q.Ql,{value:"kling-2.1-master",children:["Pro (",B["kling-2.1-master"].cost,")"]}),(0,t.jsxs)(q.Ql,{value:"veo3",children:["Ultra (",B.veo3.cost,")"]})]})]})]}),(0,t.jsxs)("div",{className:"w-20",children:[(0,t.jsx)(U._,{className:"text-[10px] text-gray-600",children:"Duration"}),(0,t.jsxs)(q.Ph,{value:P,onValueChange:Z,children:[(0,t.jsx)(q.i4,{className:"h-7 text-xs mt-0.5",children:(0,t.jsx)(q.ki,{})}),(0,t.jsx)(q.Bw,{children:T().map(e=>(0,t.jsxs)(q.Ql,{value:e.toString(),children:[e,"s"]},e))})]})]})]}),(0,t.jsxs)("p",{className:"text-[10px] text-gray-500 mt-1",children:[null===(s=B[_])||void 0===s?void 0:s.name," supports: ",T().join(", "),"s"]}),(0,t.jsxs)("p",{className:"text-[10px] text-emerald-600 font-medium",children:["Est. cost: ",((null===(a=B[_])||void 0===a?void 0:a.creditsPerSec)||0)*parseInt(P)," credits"]})]}),(0,t.jsx)("div",{className:"p-3",children:(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(u.I,{ref:F,value:v,onCh
1ange:e=>f(e.target.value),onKeyPress:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),E())},placeholder:C?"Describe your ".concat(C,"..."):"Select a content type...",className:"flex-1 h-10",disabled:N||!C}),(0,t.jsx)(h.z,{onClick:E,disabled:!v.trim()||N||!C,className:"h-10 w-10 p-0",children:N?(0,t.jsx)(w.Z,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(ef.Z,{className:"w-4 h-4"})})]})})]})]})}function ek(e){let{className:s,onInsertContent:a}=e,{blocks:i,selectedBlockId:n,selectBlock:r,updateBlock:c,removeBlock:d,pageName:o,setPageName:p,settings:g,updateSettings:j,seo:v,updateSeo:f,pageId:N}=(0,x.i)(),y=i.find(e=>e.id===n),b=y?(0,B.Ys)(y.type):null,[w,C]=(0,l.useState)("ai"),[k,I]=(0,l.useState)("ai");if(!y)return(0,t.jsxs)("div",{"data-tour":"builder-properties-panel",className:(0,m.cn)("flex flex-col h-full bg-white border-l",s),children:[(0,t.jsxs)("div",{className:"flex border-b",children:[(0,t.jsxs)("button",{onClick:()=>C("settings"),className:(0,m.cn)("flex-1 px-4 py-3 text-sm font-medium transition-colors","settings"===w?"text-blue-600 border-b-2 border-blue-600 bg-blue-50":"text-gray-600 hover:text-gray-800 hover:bg-gray-50"),children:[(0,t.jsx)(G.Z,{className:"w-4 h-4 inline mr-1.5"}),"Settings"]}),(0,t.jsxs)("button",{onClick:()=>C("ai"),className:(0,m.cn)("flex-1 px-4 py-3 text-sm font-medium transition-colors","ai"===w?"text-purple-600 border-b-2 border-purple-600 bg-purple-50":"text-gray-600 hover:text-gray-800 hover:bg-gray-50"),children:[(0,t.jsx)(H.Z,{className:"w-4 h-4 inline mr-1.5"}),"AI Assistant"]})]}),"settings"===w&&(0,t.jsx)(D.x,{className:"flex-1",children:(0,t.jsxs)("div",{className:"p-4 space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{htmlFor:"page-name",children:"Page Name"}),(0,t.jsx)(u.I,{id:"page-name",value:o,onChange:e=>p(e.target.value),placeholder:"My Landing Page"})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-gray-700",children:"Design"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{children:"Primary Color"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(u.I,{type:"color",value:g.primaryColor,onChange:e=>j({primaryColor:e.target.value}),className:"w-12 h-10 p-1 cursor-pointer"}),(0,t.jsx)(u.I,{value:g.primaryColor,onChange:e=>j({primaryColor:e.target.value}),placeholder:"#3b82f6"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{children:"Font Family"}),(0,t.jsxs)(q.Ph,{value:g.fontFamily,onValueChange:e=>j({fontFamily:e}),children:[(0,t.jsx)(q.i4,{children:(0,t.jsx)(q.ki,{})}),(0,t.jsxs)(q.Bw,{children:[(0,t.jsx)(q.Ql,{value:"Inter",children:"Inter"}),(0,t.jsx)(q.Ql,{value:"Roboto",children:"Roboto"}),(0,t.jsx)(q.Ql,{value:"Open Sans",children:"Open Sans"}),(0,t.jsx)(q.Ql,{value:"Lato",children:"Lato"}),(0,t.jsx)(q.Ql,{value:"Poppins",children:"Poppins"}),(0,t.jsx)(q.Ql,{value:"Montserrat",children:"Montserrat"})]})]})]})]})]})}),"ai"===w&&a&&(0,t.jsx)(eC,{onInsertContent:a,pageContext:o,pageId:N||"",className:"flex-1"})]});let z=null==b?void 0:b.icon;return(0,t.jsxs)("div",{"data-tour":"builder-properties-panel",className:(0,m.cn)("flex flex-col h-full bg-white border-l",s),children:[(0,t.jsxs)("div",{className:"p-4 border-b flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[z&&(0,t.jsx)(z,{className:"w-4 h-4 text-gray-500"}),(0,t.jsx)("h2",{className:"text-sm font-semibold text-gray-900",children:(null==b?void 0:b.name)||y.type})]}),(0,t.jsx)(h.z,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>r(null),children:(0,t.jsx)(Y.Z,{className:"w-4 h-4"})})]}),(0,t.jsxs)(E.Tabs,{value:k,onValueChange:I,className:"flex-1 flex flex-col overflow-hidden",children:[(0,t.jsxs)(E.TabsList,{className:"w-full justify-start px-2 h-10 bg-gray-50 rounded-none border-b shrink-0",children:[(0,t.jsxs)(E.TabsTrigger,{value:"content",className:"text-xs",children:[(0,t.jsx)(G.Z,{className:"w-3 h-3 mr-1"}),"Content"]}),(0,t.jsxs)(E.TabsTrigger,{value:"style",className:"text-xs",children:[(0,t.jsx)(K.Z,{className:"w-3 h-3 mr-1"}),"Style"]}),(0,t.jsxs)(E.TabsTrigger,{value:"ai",className:"text-xs",children:[(0,t.jsx)(H.Z,{className:"w-3 h-3 mr-1"}),"AI"]})]}),(0,t.jsx)(E.TabsContent,{value:"content",className:"flex-1 overflow-auto mt-0",children:(0,t.jsx)(D.x,{className:"h-full",children:(0,t.jsx)("div",{className:"p-4 space-y-4",children:(0,t.jsx)(eI,{block:y,onUpdate:e=>c(y.id,{content:e})})})})}),(0,t.jsx)(E.TabsContent,{value:"style",className:"flex-1 overflow-auto mt-0",children:(0,t.jsx)(D.x,{className:"h-full",children:(0,t.jsx)("div",{className:"p-4 space-y-4",children:(0,t.jsx)(eG,{block:y,onUpdate:e=>c(y.id,{style:e})})})})}),(0,t.jsx)(E.TabsContent,{value:"ai",className:"flex-1 mt-0 flex flex-col overflow-hidden",children:a&&(0,t.jsx)(eC,{onInsertContent:a,pageContext:o,pageId:N||"",className:"flex-1"})})]}),(0,t.jsx)("div",{className:"p-3 border-t shrink-0",children:(0,t.jsxs)(h.z,{variant:"destructive",size:"sm",className:"w-full",onClick:()=>{confirm("Delete this block?")&&d(y.id)},children:[(0,t.jsx)(W.Z,{className:"w-4 h-4 mr-2"}),"Delete Block"]})})]})}function eI(e){var s;let{block:a,onUpdate:l}=e,i=(e,s)=>{l({...a.content,[e]:s})},n=(e,s)=>{if(e.startsWith("_"))return null;let l=e.replace(/([A-Z])/g," $1").replace(/^./,e=>e.toUpperCase()).replace(/Cta/g,"CTA").replace(/Url/g,"URL");if("boolean"==typeof s)return(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:l}),(0,t.jsx)(M.r,{checked:s,onCheckedChange:s=>i(e,s)})]},e);if("string"==typeof s){if("video"===a.type){if("url"===e)return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Video URL"}),(0,t.jsx)(u.I,{value:s,onChange:s=>i(e,s.target.value),placeholder:"https://youtube.com/watch?v=... or https://vimeo.com/..."}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Paste a YouTube or Vimeo link"})]},e);if("type"===e)return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Video Platform"}),(0,t.jsxs)(q.Ph,{value:s||"youtube",onValueChange:s=>i(e,s),children:[(0,t.jsx)(q.i4,{className:"h-9",children:(0,t.jsx)(q.ki,{})}),(0,t.jsxs)(q.Bw,{children:[(0,t.jsx)(q.Ql,{value:"youtube",children:"YouTube"}),(0,t.jsx)(q.Ql,{value:"vimeo",children:"Vimeo"})]})]})]},e);
1if("thumbnail"===e)return(0,t.jsx)(ee,{label:"Thumbnail Image (optional)",value:s,onChange:s=>i(e,s)},e)}let n=e.toLowerCase();return n.includes("image")||n.includes("avatar")||n.includes("logo")||n.includes("thumbnail")||n.includes("photo")||n.includes("picture")||"src"===n&&"image"===a.type||n.includes("backgroundimage")?(0,t.jsx)(ee,{label:l,value:s,onChange:s=>i(e,s)},e):"text"===a.type&&"content"===e?(0,t.jsx)(eo,{label:l,value:s,onChange:s=>i(e,s)},e):e.includes("content")||e.includes("description")||e.includes("subheadline")||e.includes("subtitle")?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{className:"text-sm",children:l}),(0,t.jsx)(V.g,{value:s,onChange:s=>i(e,s.target.value),rows:3})]},e):(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{className:"text-sm",children:l}),(0,t.jsx)(u.I,{value:s,onChange:s=>i(e,s.target.value)})]},e)}return Array.isArray(s)?"members"===e&&"team"===a.type?(0,t.jsx)(ez,{members:s,onChange:s=>i(e,s)},e):"links"===e&&"social-links"===a.type?(0,t.jsx)(e_,{links:s,onChange:s=>i(e,s)},e):"testimonials"===e?(0,t.jsx)(eS,{testimonials:s,onChange:s=>i(e,s)},e):"features"===e&&"features"===a.type?(0,t.jsx)(eD,{features:s,onChange:s=>i(e,s)},e):"benefits"===e&&"benefits"===a.type?(0,t.jsx)(eP,{benefits:s,onChange:s=>i(e,s)},e):"plans"===e&&"pricing"===a.type?(0,t.jsx)(eZ,{plans:s,onChange:s=>i(e,s)},e):"products"===e&&"product"===a.type?(0,t.jsx)(eB,{products:s,onChange:s=>i(e,s)},e):"reviews"===e&&"reviews"===a.type?(0,t.jsx)(eT,{reviews:s,onChange:s=>i(e,s)},e):"logos"===e&&"logos"===a.type?(0,t.jsx)(eA,{logos:s,onChange:s=>i(e,s)},e):"stats"===e?(0,t.jsx)(eQ,{stats:s,onChange:s=>i(e,s)},e):"faqs"===e?(0,t.jsx)(eL,{faqs:s,onChange:s=>i(e,s)},e):"navLinks"===e?(0,t.jsx)(eR,{links:s,onChange:s=>i(e,s)},e):"images"===e&&"gallery"===a.type?(0,t.jsx)(eF,{images:s,onChange:s=>i(e,s)},e):"columns"===e&&"footer"===a.type?(0,t.jsx)(eU,{columns:s,onChange:s=>i(e,s)},e):"socialLinks"===e&&"footer"===a.type?(0,t.jsx)(e_,{links:s,onChange:s=>i(e,s)},e):"plans"===e&&"comparison"===a.type?(0,t.jsx)(eV,{plans:s,onChange:s=>i(e,s)},e):"features"===e&&"comparison"===a.type?(0,t.jsx)(eE,{features:s,plansCount:(a.content.plans||[]).length,onChange:s=>i(e,s)},e):"items"===e&&"columns"===a.type?(0,t.jsx)(eq,{items:s,onChange:s=>i(e,s)},e):"fields"===e&&"form"===a.type?(0,t.jsx)(eM,{fields:s,onChange:s=>i(e,s)},e):"steps"===e&&"multi-step-form"===a.type?(0,t.jsx)(eO,{steps:s,onChange:s=>i(e,s)},e):(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{className:"text-sm",children:l}),(0,t.jsxs)("p",{className:"text-xs text-gray-500",children:[s.length," items configured"]})]},e):null},r="hero"===a.type?{...a.content,alignBullets:null!==(s=a.content.alignBullets)&&void 0!==s&&s}:a.content;return(0,t.jsx)("div",{className:"space-y-4",children:Object.entries(r).map(e=>{let[s,a]=e;return n(s,a)})})}function ez(e){let{members:s,onChange:a}=e,[i,n]=(0,l.useState)(null),r=e=>{a(s.filter((s,a)=>a!==e))},c=(e,t,l)=>{let i=[...s];i[e]={...i[e],[t]:l},a(i)};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Team Members"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>{a([...s,{name:"New Member",role:"Role",bio:"",avatar:"",linkedin:"",twitter:"",email:""}]),n(s.length)},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 cursor-pointer",onClick:()=>n(i===s?null:s),children:[(0,t.jsx)("span",{className:"text-sm font-medium truncate",children:e.name||"Unnamed"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:e=>{e.stopPropagation(),r(s)},children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})}),i===s?(0,t.jsx)($.Z,{className:"w-4 h-4"}):(0,t.jsx)(I.Z,{className:"w-4 h-4"})]})]}),i===s&&(0,t.jsxs)("div",{className:"p-3 space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Name"}),(0,t.jsx)(u.I,{value:e.name||"",onChange:e=>c(s,"name",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Role"}),(0,t.jsx)(u.I,{value:e.role||"",onChange:e=>c(s,"role",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Bio"}),(0,t.jsx)(V.g,{value:e.bio||"",onChange:e=>c(s,"bio",e.target.value),rows:2})]}),(0,t.jsx)(ee,{label:"Avatar",value:e.avatar||"",onChange:e=>c(s,"avatar",e)}
1),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"LinkedIn URL"}),(0,t.jsx)(u.I,{value:e.linkedin||"",onChange:e=>c(s,"linkedin",e.target.value),className:"h-8",placeholder:"https://linkedin.com/in/..."})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Twitter URL"}),(0,t.jsx)(u.I,{value:e.twitter||"",onChange:e=>c(s,"twitter",e.target.value),className:"h-8",placeholder:"https://twitter.com/..."})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Email"}),(0,t.jsx)(u.I,{value:e.email||"",onChange:e=>c(s,"email",e.target.value),className:"h-8",placeholder:"[email protected]"})]})]})]},s))})]})}function e_(e){let{links:s,onChange:a}=e,l=["twitter","facebook","instagram","linkedin","youtube","github"],i=e=>{a(s.filter((s,a)=>a!==e))},n=(e,t,l)=>{let i=[...s];i[e]={...i[e],[t]:l},a(i)};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Social Links"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>{a([...s,{platform:"twitter",url:"#"}])},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"flex items-center gap-2 p-2 border rounded-lg",children:[(0,t.jsxs)(q.Ph,{value:e.platform,onValueChange:e=>n(s,"platform",e),children:[(0,t.jsx)(q.i4,{className:"w-28 h-8",children:(0,t.jsx)(q.ki,{})}),(0,t.jsx)(q.Bw,{children:l.map(e=>(0,t.jsx)(q.Ql,{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),(0,t.jsx)(u.I,{value:e.url||"",onChange:e=>n(s,"url",e.target.value),placeholder:"https://...",className:"flex-1 h-8"}),(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>i(s),children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})})]},s))})]})}function eS(e){let{testimonials:s,onChange:a}=e,[i,n]=(0,l.useState)(null),r=e=>{a(s.filter((s,a)=>a!==e))},c=(e,t,l)=>{let i=[...s];i[e]={...i[e],[t]:l},a(i)};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Testimonials"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>{a([...s,{quote:"New testimonial...",author:"Author Name",role:"Role",avatar:"",rating:5}]),n(s.length)},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 cursor-pointer",onClick:()=>n(i===s?null:s),children:[(0,t.jsx)("span",{className:"text-sm font-medium truncate",children:e.author||"Unnamed"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:e=>{e.stopPropagation(),r(s)},children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})}),i===s?(0,t.jsx)($.Z,{className:"w-4 h-4"}):(0,t.jsx)(I.Z,{className:"w-4 h-4"})]})]}),i===s&&(0,t.jsxs)("div",{className:"p-3 space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Quote"}),(0,t.jsx)(V.g,{value:e.quote||"",onChange:e=>c(s,"quote",e.target.value),rows:3})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Author"}),(0,t.jsx)(u.I,{value:e.author||"",onChange:e=>c(s,"author",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Role"}),(0,t.jsx)(u.I,{value:e.role||"",onChange:e=>c(s,"role",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Rating (1-5)"}),(0,t.jsx)(u.I,{type:"number",min:"1",max:"5",value:e.rating||5,onChange:e=>c(s,"rating",parseInt(e.target.value)),className:"h-8"})]}),(0,t.jsx)(ee,{label:"Avatar",value:e.avatar||"",onChange:e=>c(s,"avatar",e)}
1)]})]},s))})]})}function eD(e){let{features:s,onChange:a}=e,[i,n]=(0,l.useState)(null),r=["zap","shield","globe","clock","code","trending-up","star","heart","check","users"],c=e=>{a(s.filter((s,a)=>a!==e))},d=(e,t,l)=>{let i=[...s];i[e]={...i[e],[t]:l},a(i)};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Features"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>{a([...s,{icon:"zap",title:"New Feature",description:"Feature description"}]),n(s.length)},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 cursor-pointer",onClick:()=>n(i===s?null:s),children:[(0,t.jsx)("span",{className:"text-sm font-medium truncate",children:e.title||"Unnamed"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:e=>{e.stopPropagation(),c(s)},children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})}),i===s?(0,t.jsx)($.Z,{className:"w-4 h-4"}):(0,t.jsx)(I.Z,{className:"w-4 h-4"})]})]}),i===s&&(0,t.jsxs)("div",{className:"p-3 space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Icon"}),(0,t.jsxs)(q.Ph,{value:e.icon,onValueChange:e=>d(s,"icon",e),children:[(0,t.jsx)(q.i4,{className:"h-8",children:(0,t.jsx)(q.ki,{})}),(0,t.jsx)(q.Bw,{children:r.map(e=>(0,t.jsx)(q.Ql,{value:e,children:e},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Title"}),(0,t.jsx)(u.I,{value:e.title||"",onChange:e=>d(s,"title",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Description"}),(0,t.jsx)(V.g,{value:e.description||"",onChange:e=>d(s,"description",e.target.value),rows:2})]})]})]},s))})]})}function eP(e){let{benefits:s,onChange:a}=e,l=e=>{a(s.filter((s,a)=>a!==e))},i=(e,t)=>{let l=[...s];l[e]=t,a(l)};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Benefits"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>{a([...s,"New benefit"])},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.I,{value:e,onChange:e=>i(s,e.target.value),className:"flex-1 h-8"}),(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>l(s),children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})})]},s))})]})}function eZ(e){let{plans:s,onChange:a}=e,[i,n]=(0,l.useState)(null),r=e=>{a(s.filter((s,a)=>a!==e))},c=(e,t,l)=>{let i=[...s];i[e]={...i[e],[t]:l},a(i)};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Pricing Plans"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>{a([...s,{name:"New Plan",price:"$0",period:"month",description:"",features:[],ctaText:"Get Started",highlighted:!1}]),n(s.length)},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 cursor-pointer",onClick:()=>n(i===s?null:s),children:[(0,t.jsxs)("span",{className:"text-sm font-medium truncate",children:[e.name," - ",e.price]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:e=>{e.stopPropagation(),r(s)},children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})}),i===s?(0,t.jsx)($.Z,{className:"w-4 h-4"}):(0,t.jsx)(I.Z,{className:"w-4 h-4"})]})]}),i===s&&(0,t.jsxs)("div",{className:"p-3 space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Plan Name"}),(0,t.jsx)(u.I,{value:e.name||"",onChange:e=>c(s,"name",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Price"}),(0,t.jsx)(u.I,{value:e.price||"",onChange:e=>c(s,"price",e.target.value),className:"h-8",placeholder:"$29"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Period"}),(0,t.jsx)(u.I,{value:e.period||"",onChange:e=>c(s,"period",e.target.value),className:"h-8",placeholder:"month"})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Description"}),(0,t.jsx)(u.I,{value:e.description||"",onChange:e=>c(s,"description",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Features (one per line)"}),(0,t.jsx)(V.g,{value:(e.features||[]).join("\n"),onChange:e=>c(s,"features",e.target.value.split("\n").filter(e=>e.trim())),rows:4,placeholder:"Feature 1 Feature 2 Feature 3"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Button Text"}),(0,t.jsx)(u.I,{value:e.ctaText||"",onChange:e=>c(s,"ctaText",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Highlighted (Popular)"}),(0,t.jsx)(M.r,{checked:e.highlighted||!1,onCheckedChange:e=>c(s,"highlighted",e)})]})]})]},s))})]})}function eB(e){let{products:s,onChange:a}=e,[i,n]=(0,l.useState)(null),r=e=>{a(s.filter((s,a)=>a!==e))},c=(e,t,l)=>{let i=[...s];i[e]={...i[e],[t]:l},a(i)};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Products"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>
1{a([...s,{name:"New Product",price:"$99",originalPrice:"",image:"",badge:"",rating:5,reviews:0,url:"#"}]),n(s.length)},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 cursor-pointer",onClick:()=>n(i===s?null:s),children:[(0,t.jsxs)("span",{className:"text-sm font-medium truncate",children:[e.name," - ",e.price]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:e=>{e.stopPropagation(),r(s)},children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})}),i===s?(0,t.jsx)($.Z,{className:"w-4 h-4"}):(0,t.jsx)(I.Z,{className:"w-4 h-4"})]})]}),i===s&&(0,t.jsxs)("div",{className:"p-3 space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Name"}),(0,t.jsx)(u.I,{value:e.name||"",onChange:e=>c(s,"name",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Price"}),(0,t.jsx)(u.I,{value:e.price||"",onChange:e=>c(s,"price",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Original Price"}),(0,t.jsx)(u.I,{value:e.originalPrice||"",onChange:e=>c(s,"originalPrice",e.target.value),className:"h-8",placeholder:"$149"})]})]}),(0,t.jsx)(ee,{label:"Product Image",value:e.image||"",onChange:e=>c(s,"image",e)}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Badge (e.g., Sale, New)"}),(0,t.jsx)(u.I,{value:e.badge||"",onChange:e=>c(s,"badge",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Rating (1-5)"}),(0,t.jsx)(u.I,{type:"number",min:"1",max:"5",value:e.rating||5,onChange:e=>c(s,"rating",parseInt(e.target.value)),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Reviews Count"}),(0,t.jsx)(u.I,{type:"number",value:e.reviews||0,onChange:e=>c(s,"reviews",parseInt(e.target.value)),className:"h-8"})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Product URL"}),(0,t.jsx)(u.I,{value:e.url||"",onChange:e=>c(s,"url",e.target.value),className:"h-8",placeholder:"https://..."})]})]})]},s))})]})}function eT(e){let{reviews:s,onChange:a}=e,[i,n]=(0,l.useState)(null),r=e=>{a(s.filter((s,a)=>a!==e))},c=(e,t,l)=>{let i=[...s];i[e]={...i[e],[t]:l},a(i)};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Reviews"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>{a([...s,{author:"Reviewer",rating:5,title:"",content:"Great product!",date:"",verified:!0,helpful:0}]),n(s.length)},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 cursor-pointer",onClick:()=>n(i===s?null:s),children:[(0,t.jsxs)("span",{className:"text-sm font-medium truncate",children:[e.author," - ",e.rating,"★"]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:e=>{e.stopPropagation(),r(s)},children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})}),i===s?(0,t.jsx)($.Z,{className:"w-4 h-4"}):(0,t.jsx)(I.Z,{className:"w-4 h-4"})]})]}),i===s&&(0,t.jsxs)("div",{className:"p-3 space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Author"}),(0,t.jsx)(u.I,{value:e.author||"",onChange:e=>c(s,"author",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Rating (1-5)"}),(0,t.jsx)(u.I,{type:"number",min:"1",max:"5",value:e.rating||5,onChange:e=>c(s,"rating",parseInt(e.target.value)),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Date"}),(0,t.jsx)(u.I,{value:e.date||"",onChange:e=>c(s,"date",e.target.value),className:"h-8",placeholder:"Jan 15, 2024"})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Title"}),(0,t.jsx)(u.I,{value:e.title||"",onChange:e=>c(s,"title",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Content"}),(0,t.jsx)(V.g,{value:e.content||"",onChange:e=>c(s,"content",e.target.value),rows:3})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Verified Purchase"}),(0,t.jsx)(M.r,{checked:e.verified||!1,onCheckedChange:e=>c(s,"verified",e)})]})]})]},s))})]})}function eA(e){let{logos:s,onChange:a}=e,[i,n]=(0,l.useState)(null),r=e=>{a(s.filter((s,a)=>a!==e)),i===e&&n(null)},c=(e,t,l)=>{let i=[...s];i[e]={...i[e],[t]:l},a(i)};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Logos"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>{a([...s,{name:"Company",image:""}]),n(s.length)},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 cursor-pointer",onClick:()=>n(i===s?null:s),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[e.image&&(0,t.jsx)("img",{src:e.image,alt:"",className:"w-8 h-8 rounded object-contain bg-white flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium truncate",children:e.name||"Logo ".concat(s+1)})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:e=>{e.stopPropagation(),r(s)},children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})}),i===s?(0,t.jsx)($.Z,{className:"w-4 h-4"}):(0,t.jsx)(I.Z,{className:"w-4 h-4"})]})]}),i===s&&(0,t.jsxs)("div",{className:"p-3 space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Company Name"}),(0,t.jsx)(u.I,{value:e.name||"",onChange:e=>c(s,"name",e.target.value),placeholder:"Company Name",className:"h-8"})]}),(0,t.jsx)(ee,{label:"Logo Image",value:e.image||"",onChange:e=>c(s,"image",e)})]})]},s))})]})}function eQ(e){let{stats:s,onChange:a}=e,l=e=>{a(s.filter((s,a)=>a!==e))},i=(e,t,l)=>{let i=[...s];i[e]={...i[e],[t]:l},a(i)};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Statistics"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>{a([...s,{value:"0",label:"New Stat"}])},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"flex items-center gap-2 p-2 border rounded-lg",children:[(0,t.jsx)(u.I,{value:e.value||"",onChange:e=>i(s,"value",e.target.value),placeholder:"10K+",className:"w-20 h-8"}),(0,t.jsx)(u.I,{value:e.label||"",onChange:e=>i(s,"label",e.target.value),placeholder:"Label",className:"flex-1 h-8"}),(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>l(s),children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})})]},s))})]})}function eL(e){let{faqs:s,onChange:a}=e,[i,n]=(0,l.useState)(null),r=e=>{a(s.filter((s,a)=>a!==e))},c=(e,t,l)=>{let i=[...s];i[e]={...i[e],[t]:l},a(i)};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"FAQs"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>{a([...s,{question:"New question?",answer:"Answer here..."}]),n(s.length)},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 cursor-pointer",onClick:()=>n(i===s?null:s),children:[(0,t.jsx)("span",{className:"text-sm font-medium truncate",children:e.question||"Question?"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:e=>{e.stopPropagation(),r(s)},children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})}),i===s?(0,t.jsx)($.Z,{className:"w-4 h-4"}):(0,t.jsx)(I.Z,{className:"w-4 h-4"})]})]}),i===s&&(0,t.jsxs)("div",{className:"p-3 space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Question"}),(0,t.jsx)(u.I,{value:e.question||"",onChange:e=>c(s,"question",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Answer"}),(0,t.jsx)(V.g,{value:e.answer||"",onChange:e=>c(s,"answer",e.target.value),rows:3})]})]})]},s))})]})}function eR(e){let{links:s,onChange:a}=e,l=e=>{a(s.filter((s,a)=>a!==e))},i=(e,t,l)=>{let i=[...s];i[e]={...i[e],[t]:l},a(i)};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Navigation Links"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>{a([...s,{text:"Link",url:"#"}])},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"flex items-center gap-2 p-2 border rounded-lg",children:[(0,t.jsx)(u.I,{value:e.text||"",onChange:e=>i(s,"text",e.target.value),placeholder:"Text",className:"w-24 h-8"}),(0,t.jsx)(u.I,{value:e.url||"",onChange:e=>i(s,"url",e.target.value),placeholder:"URL",className:"flex-1 h-8"}),(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>l(s),children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})})]},s))})]})}function eF(e){let{images:s,onChange:a}=e,[i,n]=(0,l.useState)(null),r=e=>{a(s.filter((s,a)=>a!==e)),i===e&&n(null)},c=(e,t,l)=>{let i=[...s];i[e]={...i[e],[t]:l},a(i)};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Gallery Images"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>{a([...s,{src:"",alt:"Image",caption:""}]),n(s.length)},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 cursor-pointer",onClick:()=>n(i===s?null:s),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[e.src&&(0,t.jsx)("img",{src:e.src,alt:"",className:"w-8 h-8 rounded object-cover flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium truncate",children:e.alt||"Image ".concat(s+1)})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:e=>{e.stopPropagation(),r(s)},children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})}),i===s?(0,t.jsx)($.Z,{className:"w-4 h-4"}):(0,t.jsx)(I.Z,{className:"w-4 h-4"})]})]}),i===s&&(0,t.jsxs)("div",{className:"p-3 space-y-3",children:[(0,t.jsx)(ee,{label:"Image",value:e.src||"",onChange:e=>c(s,"src",e)}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Alt Text"}),(0,t.jsx)(u.I,{value:e.alt||"",onChange:e=>c(s,"alt",e.target.value),placeholder:"Describe the image",className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Caption (optional)"}),(0,t.jsx)(u.I,{value:e.caption||"",onChange:e=>c(s,"caption",e.target.value),placeholder:"Image caption",className:"h-8"})]})]})]},s))})]})}
1function eU(e){let{columns:s,onChange:a}=e,[i,n]=(0,l.useState)(null),r=e=>{a(s.filter((s,a)=>a!==e))},c=(e,t,l)=>{let i=[...s];i[e]={...i[e],[t]:l},a(i)},d=e=>{let t=[...s];t[e].links=[...t[e].links||[],{text:"Link",url:"#"}],a(t)},o=(e,t)=>{let l=[...s];l[e].links=l[e].links.filter((e,s)=>s!==t),a(l)},x=(e,t,l,i)=>{let n=[...s];n[e].links[t]={...n[e].links[t],[l]:i},a(n)};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Footer Columns"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>{a([...s,{title:"New Column",links:[{text:"Link",url:"#"}]}]),n(s.length)},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 cursor-pointer",onClick:()=>n(i===s?null:s),children:[(0,t.jsx)("span",{className:"text-sm font-medium truncate",children:e.title||"Column"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:e=>{e.stopPropagation(),r(s)},children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})}),i===s?(0,t.jsx)($.Z,{className:"w-4 h-4"}):(0,t.jsx)(I.Z,{className:"w-4 h-4"})]})]}),i===s&&(0,t.jsxs)("div",{className:"p-3 space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Column Title"}),(0,t.jsx)(u.I,{value:e.title||"",onChange:e=>c(s,"title",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Links"}),(0,t.jsxs)(h.z,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>d(s),children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add Link"]})]}),(e.links||[]).map((e,a)=>(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(u.I,{value:e.text||"",onChange:e=>x(s,a,"text",e.target.value),placeholder:"Text",className:"w-20 h-7 text-xs"}),(0,t.jsx)(u.I,{value:e.url||"",onChange:e=>x(s,a,"url",e.target.value),placeholder:"URL",className:"flex-1 h-7 text-xs"}),(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o(s,a),children:(0,t.jsx)(Y.Z,{className:"w-3 h-3 text-red-500"})})]},a))]})]})]},s))})]})}function eV(e){let{plans:s,onChange:a}=e,l=e=>{a(s.filter((s,a)=>a!==e))},i=(e,t,l)=>{let i=[...s];i[e]={...i[e],[t]:l},a(i)};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Comparison Plans"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>{a([...s,{name:"New Plan",price:"$0/mo",highlighted:!1,ctaText:"Get Started",ctaUrl:"#"}])},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"p-2 border rounded-lg space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.I,{value:e.name||"",onChange:e=>i(s,"name",e.target.value),placeholder:"Plan Name",className:"flex-1 h-8"}),(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>l(s),children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})})]}),(0,t.jsx)(u.I,{value:e.price||"",onChange:e=>i(s,"price",e.target.value),placeholder:"$29/mo",className:"h-8"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsx)(u.I,{value:e.ctaText||"",onChange:e=>i(s,"ctaText",e.target.value),placeholder:"Button Text",className:"h-8"}),(0,t.jsx)(u.I,{value:e.ctaUrl||"",onChange:e=>i(s,"ctaUrl",e.target.value),placeholder:"URL",className:"h-8"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Highlighted"}),(0,t.jsx)(M.r,{checked:e.highlighted||!1,onCheckedChange:e=>i(s,"highlighted",e)})]})]},s))})]})}function eE(e){let{features:s,plansCount:a,onChange:i}=e,[n,r]=(0,l.useState)(null),c=e=>{i(s.filter((s,a)=>a!==e))},d=(e,a,t)=>{let l=[...s];l[e]={...l[e],[a]:t},i(l)},o=(e,a,t)=>{let l=[...s],n=[...l[e].values||[]];n[a]=t,l[e]={...l[e],values:n},i(l)};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Comparison Features"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>{i([...s,{name:"New Feature",description:"",values:Array(a).fill(!0)}]),r(s.length)},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 cursor-pointer",onClick:()=>r(n===s?null:s),children:[(0,t.jsx)("span",{className:"text-sm font-medium truncate",children:e.name||"Feature"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:e=>{e.stopPropagation(),c(s)},children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})}),n===s?(0,t.jsx)($.Z,{className:"w-4 h-4"}):(0,t.jsx)(I.Z,{className:"w-4 h-4"})]})]}),n===s&&(0,t.jsxs)("div",{className:"p-3 space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Feature Name"}),(0,t.jsx)(u.I,{value:e.name||"",onChange:e=>d(s,"name",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Description (optional)"}),(0,t.jsx)(u.I,{value:e.description||"",onChange:e=>d(s,"description",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Values (per plan: true/false or text)"}),(0,t.jsx)("div",{className:"space-y-1",children:(e.values||[]).map((e,a)=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"text-xs text-gray-500 w-16",children:["Plan ",a+1,":"]}),(0,t.jsx)(u.I,{value:"boolean"==typeof e?e?"true":"false":e,onChange:e=>{let t=e.target.value;o(s,a,"true"===t||"false"!==t&&t)},placeholder:"true/false or text",className:"flex-1 h-7 text-xs"})]},a))})]})]})]},s))})]})}function eq(e){let{items:s,onChange:a}=e,[i,n]=(0,l.useState)(null),r=e=>{a(s.filter((s,a)=>a!==e))},c=(e,t,l)=>{let i=[...s];i[e]={...i[e],[t]:l},a(i)};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Column Items"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>{a([...s,{title:"New Column",content:"Add your content here"}]),n(s.length)},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 cursor-pointer",onClick:()=>n(i===s?null:s),children:[(0,t.jsx)("span",{className:"text-sm font-medium truncate",children:e.title||"Column"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:e=>{e.stopPropagation(),r(s)},children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})}),i===s?(0,t.jsx)($.Z,{className:"w-4 h-4"}):(0,t.jsx)(I.Z,{className:"w-4 h-4"})]})]}),i===s&&(0,t.jsxs)("div",{className:"p-3 space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Title"}),(0,t.jsx)(u.I,{value:e.title||"",onChange:e=>c(s,"title",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Content"}),(0,t.jsx)(V.g,{value:e.content||"",onChange:e=>c(s,"content",e.target.value),rows:3})]})]})]},s))})]})}function eM(e){let{fields:s,onChange:a}=e,[i,n]=(0,l.useState)(null),[r,c]=(0,l.useState)({}),d=[{value:"text",label:"Text",category:"Basic"},{value:"email",label:"Email",category:"Basic"},{value:"tel",label:"Phone (Basic)",category:"Basic"},{value:"textarea",label:"Text Area",category:"Basic"},{value:"number",label:"Number",category:"Basic"},{value:"url",label:"URL",category:"Basic"},{value:"select",label:"Dropdown",category:"Choice"},{value:"checkbox",label:"Checkboxes",category:"Choice"},{value:"radio",label:"Radio Buttons",category:"Choice"},{value:"date",label:"Date",category:"Date/Time"},{value:"time",label:"Time",category:"Date/Time"},{value:"datetime",label:"Date & Time",category:"Date/Time"},{value:"phone",label:"Phone (Country Code)",category:"Advanced"},{value:"rating",label:"Star Rating",category:"Advanced"},{value:"file",label:"File Upload",category:"Advanced"},{value:"range",label:"Range Slider",category:"Advanced"},{value:"hidden",label:"Hidden Field",category:"Special"}],o=d.reduce((e,s)=>(e[s.category]||(e[s.category]=[]),e[s.category].push(s),e),{}),x=e=>{a(s.filter((s,a)=>a!==e)),i===e&&n(null)},m=(e,t,l)=>{let i=[...s];i[e]={...i[e],[t]:l},a(i)},p=(e,t,l)=>{let i=[...s];i[e]={...i[e],validation:{...i[e].validation||{},[t]:l}},a(i)},g=e=>["select","checkbox","radio"].includes(e),j=e=>"file"===e,v=e=>["number","range"].includes(e);return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm",children:"Form Fields"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>{a([...s,{type:"text",name:"new_field",label:"New Field",placeholder:"",required:!1}]),n(s.length)},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>{var a,l,f,N,y,b,w,C,k,z,_;return(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 cursor-pointer",onClick:()=>n(i===s?null:s),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded",children:(null===(a=d.find(s=>s.value===e.type))||void 0===a?void 0:a.label)||e.type}),(0,t.jsx)("span",{className:"text-sm font-medium truncate",children:e.label||e.name})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:e=>{e.stopPropagation(),x(s)},children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})}),i===s?(0,t.jsx)($.Z,{className:"w-4 h-4"}):(0,t.jsx)(I.Z,{className:"w-4 h-4"})]})]}),i===s&&(0,t.jsxs)("div",{className:"p-3 space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Field Type"}),(0,t.jsxs)(q.Ph,{value:e.type||"text",onValueChange:e=>m(s,"type",e),children:[(0,t.jsx)(q.i4,{className:"h-8",children:(0,t.jsx)(q.ki,{})}),(0,t.jsx)(q.Bw,{children:Object.entries(o).map(e=>{let[s,a]=e;return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"px-2 py-1 text-xs font-semibold text-gray-500 bg-gray-50",children:s}),a.map(e=>(0,t.jsx)(q.Ql,{value:e.value,children:e.label},e.value))]},s)})})]})]}
1),"hidden"!==e.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Label"}),(0,t.jsx)(u.I,{value:e.label||"",onChange:e=>m(s,"label",e.target.value),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Field Name"}),(0,t.jsx)(u.I,{value:e.name||"",onChange:e=>m(s,"name",e.target.value),className:"h-8",placeholder:"field_name"})]})]}),"hidden"===e.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Field Name (e.g., utm_source)"}),(0,t.jsx)(u.I,{value:e.name||"",onChange:e=>m(s,"name",e.target.value),className:"h-8",placeholder:"utm_source"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Default Value"}),(0,t.jsx)(u.I,{value:e.defaultValue||"",onChange:e=>m(s,"defaultValue",e.target.value),className:"h-8",placeholder:"Will capture from URL param if empty"})]}),(0,t.jsx)("p",{className:"text-xs text-gray-500",children:"Hidden fields capture URL parameters automatically (e.g., ?utm_source=google)"})]}),!["checkbox","radio","rating","file","hidden","range"].includes(e.type)&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Placeholder"}),(0,t.jsx)(u.I,{value:e.placeholder||"",onChange:e=>m(s,"placeholder",e.target.value),className:"h-8"})]}),g(e.type)&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Options (one per line)"}),(0,t.jsx)(V.g,{value:(e.options||[]).join("\n"),onChange:e=>m(s,"options",e.target.value.split("\n").filter(e=>e.trim())),rows:4,placeholder:"Option 1 Option 2 Option 3"})]}),"phone"===e.type&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Default Country Code"}),(0,t.jsxs)(q.Ph,{value:e.countryCode||"+91",onValueChange:e=>m(s,"countryCode",e),children:[(0,t.jsx)(q.i4,{className:"h-8",children:(0,t.jsx)(q.ki,{})}),(0,t.jsxs)(q.Bw,{children:[(0,t.jsx)(q.Ql,{value:"+91",children:"\uD83C\uDDEE\uD83C\uDDF3 India (+91)"}),(0,t.jsx)(q.Ql,{value:"+1",children:"\uD83C\uDDFA\uD83C\uDDF8 USA (+1)"}),(0,t.jsx)(q.Ql,{value:"+44",children:"\uD83C\uDDEC\uD83C\uDDE7 UK (+44)"}),(0,t.jsx)(q.Ql,{value:"+971",children:"\uD83C\uDDE6\uD83C\uDDEA UAE (+971)"}),(0,t.jsx)(q.Ql,{value:"+61",children:"\uD83C\uDDE6\uD83C\uDDFA Australia (+61)"}),(0,t.jsx)(q.Ql,{value:"+49",children:"\uD83C\uDDE9\uD83C\uDDEA Germany (+49)"}),(0,t.jsx)(q.Ql,{value:"+33",children:"\uD83C\uDDEB\uD83C\uDDF7 France (+33)"}),(0,t.jsx)(q.Ql,{value:"+65",children:"\uD83C\uDDF8\uD83C\uDDEC Singapore (+65)"})]})]})]}),j(e.type)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Accepted File Types"}),(0,t.jsx)(u.I,{value:e.accept||"",onChange:e=>m(s,"accept",e.target.value),className:"h-8",placeholder:"image/*,.pdf,.doc,.docx"}),(0,t.jsx)("p",{className:"text-xs text-gray-400",children:"e.g., image/*, .pdf, .doc"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Max File Size (MB)"}),(0,t.jsx)(u.I,{type:"number",value:e.maxFileSize||10,onChange:e=>m(s,"maxFileSize",parseInt(e.target.value)),className:"h-8",min:1,max:50})]})]}),v(e.type)&&(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Min"}),(0,t.jsx)(u.I,{type:"number",value:null!==(C=null===(l=e.validation)||void 0===l?void 0:l.min)&&void 0!==C?C:"",onChange:e=>p(s,"min",e.target.value?parseInt(e.target.value):void 0),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Max"}),(0,t.jsx)(u.I,{type:"number",value:null!==(k=null===(f=e.validation)||void 0===f?void 0:f.max)&&void 0!==k?k:"",onChange:e=>p(s,"max",e.target.value?parseInt(e.target.value):void 0),className:"h-8"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Step"}),(0,t.jsx)(u.I,{type:"number",value:e.step||1,onChange:e=>m(s,"step",parseInt(e.target.value)),className:"h-8",min:1})]})]}
1),"hidden"!==e.type&&(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Required"}),(0,t.jsx)(M.r,{checked:e.required||!1,onCheckedChange:e=>m(s,"required",e)})]}),!["hidden","checkbox","radio","rating","file"].includes(e.type)&&(0,t.jsxs)("div",{className:"border-t pt-3 mt-3",children:[(0,t.jsxs)("button",{type:"button",className:"flex items-center justify-between w-full text-xs text-gray-600 hover:text-gray-800",onClick:()=>c({...r,[s]:!r[s]}),children:[(0,t.jsx)("span",{children:"Validation Rules"}),r[s]?(0,t.jsx)($.Z,{className:"w-3 h-3"}):(0,t.jsx)(I.Z,{className:"w-3 h-3"})]}),r[s]&&(0,t.jsxs)("div",{className:"mt-2 space-y-2",children:[["text","textarea","email","tel","phone","url"].includes(e.type)&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Min Length"}),(0,t.jsx)(u.I,{type:"number",value:null!==(z=null===(N=e.validation)||void 0===N?void 0:N.minLength)&&void 0!==z?z:"",onChange:e=>p(s,"minLength",e.target.value?parseInt(e.target.value):void 0),className:"h-7 text-xs",min:0})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Max Length"}),(0,t.jsx)(u.I,{type:"number",value:null!==(_=null===(y=e.validation)||void 0===y?void 0:y.maxLength)&&void 0!==_?_:"",onChange:e=>p(s,"maxLength",e.target.value?parseInt(e.target.value):void 0),className:"h-7 text-xs",min:0})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Pattern (Regex)"}),(0,t.jsx)(u.I,{value:(null===(b=e.validation)||void 0===b?void 0:b.pattern)||"",onChange:e=>p(s,"pattern",e.target.value),className:"h-7 text-xs",placeholder:"e.g., ^[A-Za-z]+$"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Custom Error Message"}),(0,t.jsx)(u.I,{value:(null===(w=e.validation)||void 0===w?void 0:w.customMessage)||"",onChange:e=>p(s,"customMessage",e.target.value),className:"h-7 text-xs",placeholder:"Please enter a valid value"})]})]})]})]})]},s)})}),0===s.length&&(0,t.jsx)("p",{className:"text-xs text-gray-400 text-center py-4",children:'No fields yet. Click "Add" to create one.'})]})}function eO(e){let{steps:s,onChange:a}=e,[i,n]=(0,l.useState)(0),[r,c]=(0,l.useState)(null),d=[{value:"text",label:"Text",category:"Basic"},{value:"email",label:"Email",category:"Basic"},{value:"tel",label:"Phone (Basic)",category:"Basic"},{value:"textarea",label:"Text Area",category:"Basic"},{value:"number",label:"Number",category:"Basic"},{value:"url",label:"URL",category:"Basic"},{value:"select",label:"Dropdown",category:"Choice"},{value:"checkbox",label:"Checkboxes",category:"Choice"},{value:"radio",label:"Radio Buttons",category:"Choice"},{value:"date",label:"Date",category:"Date/Time"},{value:"time",label:"Time",category:"Date/Time"},{value:"datetime",label:"Date & Time",category:"Date/Time"},{value:"phone",label:"Phone (Country Code)",category:"Advanced"},{value:"rating",label:"Star Rating",category:"Advanced"},{value:"file",label:"File Upload",category:"Advanced"},{value:"range",label:"Range Slider",category:"Advanced"},{value:"hidden",label:"Hidden Field",category:"Special"}],o=d.reduce((e,s)=>(e[s.category]||(e[s.category]=[]),e[s.category].push(s),e),{}),x=e=>{s.length<=1||(a(s.filter((s,a)=>a!==e)),i===e&&n(Math.max(0,e-1)))},m=(e,t,l)=>{let i=[...s];i[e]={...i[e],[t]:l},a(i)},p=e=>{let t=[...s];t[e].fields=[...t[e].fields,{type:"text",name:"field_".concat(Date.now()),label:"New Field",placeholder:"",required:!1}],a(t),c({step:e,field:t[e].fields.length-1})},g=(e,t)=>{let l=[...s];l[e].fields=l[e].fields.filter((e,s)=>s!==t),a(l),c(null)},j=(e,t,l,i)=>{let n=[...s];n[e].fields[t]={...n[e].fields[t],[l]:i},a(n)},v=e=>["select","checkbox","radio"].includes(e),f=(e,t)=>{let l="up"===t?e-1:e+1;if(l<0||l>=s.length)return;let i=[...s];[i[e],i[l]]=[i[l],i[e]],a(i),n(l)};return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-sm font-medium",children:"Form Steps"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",onClick:()=>
1{let e={id:"step-".concat(Date.now()),title:"Step ".concat(s.length+1),description:"",fields:[]};a([...s,e]),n(s.length)},children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Add Step"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,a)=>{var l,N;return(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 bg-blue-50 cursor-pointer",onClick:()=>n(i===a?null:a),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"flex items-center justify-center w-6 h-6 rounded-full bg-blue-600 text-white text-xs font-medium",children:a+1}),(0,t.jsx)("span",{className:"text-sm font-medium",children:e.title||"Step ".concat(a+1)}),(0,t.jsxs)("span",{className:"text-xs text-gray-500",children:["(",(null===(l=e.fields)||void 0===l?void 0:l.length)||0," fields)"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",disabled:0===a,onClick:e=>{e.stopPropagation(),f(a,"up")},children:(0,t.jsx)($.Z,{className:"w-3 h-3"})}),(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",disabled:a===s.length-1,onClick:e=>{e.stopPropagation(),f(a,"down")},children:(0,t.jsx)(I.Z,{className:"w-3 h-3"})}),(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",disabled:s.length<=1,onClick:e=>{e.stopPropagation(),x(a)},children:(0,t.jsx)(W.Z,{className:"w-3 h-3 text-red-500"})})]})]}),i===a&&(0,t.jsxs)("div",{className:"p-3 space-y-3 bg-white",children:[(0,t.jsxs)("div",{className:"space-y-2 pb-3 border-b",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Step Title"}),(0,t.jsx)(u.I,{value:e.title||"",onChange:e=>m(a,"title",e.target.value),className:"h-8",placeholder:"Step title"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Description (optional)"}),(0,t.jsx)(u.I,{value:e.description||"",onChange:e=>m(a,"description",e.target.value),className:"h-8",placeholder:"Brief description for this step"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-xs text-gray-600",children:"Fields in this step"}),(0,t.jsxs)(h.z,{variant:"outline",size:"sm",className:"h-6 text-xs",onClick:()=>p(a),children:[(0,t.jsx)(R.Z,{className:"w-3 h-3 mr-1"})," Field"]})]}),null===(N=e.fields)||void 0===N?void 0:N.map((e,s)=>{var l;return(0,t.jsxs)("div",{className:"border rounded-md overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 cursor-pointer",onClick:()=>c((null==r?void 0:r.step)===a&&(null==r?void 0:r.field)===s?null:{step:a,field:s}),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs px-1.5 py-0.5 bg-gray-200 text-gray-600 rounded",children:(null===(l=d.find(s=>s.value===e.type))||void 0===l?void 0:l.label)||e.type}),(0,t.jsx)("span",{className:"text-xs font-medium truncate",children:e.label||e.name}),e.required&&(0,t.jsx)("span",{className:"text-red-500 text-xs",children:"*"})]}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:e=>{e.stopPropagation(),g(a,s)},children:(0,t.jsx)(Y.Z,{className:"w-3 h-3 text-gray-400 hover:text-red-500"})})})]}),(null==r?void 0:r.step)===a&&(null==r?void 0:r.field)===s&&(0,t.jsxs)("div",{className:"p-2 space-y-2 bg-white",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Type"}),(0,t.jsxs)(q.Ph,{value:e.type||"text",onValueChange:e=>j(a,s,"type",e),children:[(0,t.jsx)(q.i4,{className:"h-7 text-xs",children:(0,t.jsx)(q.ki,{})}),(0,t.jsx)(q.Bw,{children:Object.entries(o).map(e=>{let[s,a]=e;return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"px-2 py-1 text-xs font-semibold text-gray-500 bg-gray-50",children:s}),a.map(e=>(0,t.jsx)(q.Ql,{value:e.value,children:e.label},e.value))]},s)})})]})]}
1),"hidden"!==e.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Label"}),(0,t.jsx)(u.I,{value:e.label||"",onChange:e=>j(a,s,"label",e.target.value),className:"h-7 text-xs"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Field Name"}),(0,t.jsx)(u.I,{value:e.name||"",onChange:e=>j(a,s,"name",e.target.value),className:"h-7 text-xs"})]}),!["checkbox","radio","rating","file","range"].includes(e.type)&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Placeholder"}),(0,t.jsx)(u.I,{value:e.placeholder||"",onChange:e=>j(a,s,"placeholder",e.target.value),className:"h-7 text-xs"})]})]}),v(e.type)&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Options (one per line)"}),(0,t.jsx)(V.g,{value:(e.options||[]).join("\n"),onChange:e=>j(a,s,"options",e.target.value.split("\n").filter(e=>e.trim())),rows:3,className:"text-xs"})]}),"phone"===e.type&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Default Country Code"}),(0,t.jsxs)(q.Ph,{value:e.countryCode||"+91",onValueChange:e=>j(a,s,"countryCode",e),children:[(0,t.jsx)(q.i4,{className:"h-7 text-xs",children:(0,t.jsx)(q.ki,{})}),(0,t.jsxs)(q.Bw,{children:[(0,t.jsx)(q.Ql,{value:"+91",children:"\uD83C\uDDEE\uD83C\uDDF3 India (+91)"}),(0,t.jsx)(q.Ql,{value:"+1",children:"\uD83C\uDDFA\uD83C\uDDF8 USA (+1)"}),(0,t.jsx)(q.Ql,{value:"+44",children:"\uD83C\uDDEC\uD83C\uDDE7 UK (+44)"}),(0,t.jsx)(q.Ql,{value:"+971",children:"\uD83C\uDDE6\uD83C\uDDEA UAE (+971)"})]})]})]}),"hidden"!==e.type&&(0,t.jsxs)("div",{className:"flex items-center justify-between pt-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Required"}),(0,t.jsx)(M.r,{checked:e.required||!1,onCheckedChange:e=>j(a,s,"required",e)})]})]})]},s)}),(!e.fields||0===e.fields.length)&&(0,t.jsx)("p",{className:"text-xs text-gray-400 text-center py-3",children:'No fields in this step. Click "Field" to add one.'})]})]})]},e.id||a)})}),0===s.length&&(0,t.jsx)("p",{className:"text-xs text-gray-400 text-center py-4",children:'No steps yet. Click "Add Step" to create one.'})]})}function eG(e){var s,a,l,i;let{block:n,onUpdate:r}=e,c=(e,s)=>{r({...n.style,[e]:s})},d=["cta","hero","button","header","pricing","form","email-capture"].includes(n.type);return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-gray-700",children:"Backgroun
1d"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Color"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(u.I,{type:"color",value:n.style.backgroundColor||"#ffffff",onChange:e=>c("backgroundColor",e.target.value),className:"w-12 h-9 p-1 cursor-pointer"}),(0,t.jsx)(u.I,{value:n.style.backgroundColor||"",onChange:e=>c("backgroundColor",e.target.value),placeholder:"transparent",className:"flex-1"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-gray-700",children:"Text"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Color"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(u.I,{type:"color",value:n.style.textColor||"#1e293b",onChange:e=>c("textColor",e.target.value),className:"w-12 h-9 p-1 cursor-pointer"}),(0,t.jsx)(u.I,{value:n.style.textColor||"",onChange:e=>c("textColor",e.target.value),placeholder:"#1e293b",className:"flex-1"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Alignment"}),(0,t.jsxs)(q.Ph,{value:n.style.textAlign||"left",onValueChange:e=>c("textAlign",e),children:[(0,t.jsx)(q.i4,{className:"h-9",children:(0,t.jsx)(q.ki,{})}),(0,t.jsxs)(q.Bw,{children:[(0,t.jsx)(q.Ql,{value:"left",children:"Left"}),(0,t.jsx)(q.Ql,{value:"center",children:"Center"}),(0,t.jsx)(q.Ql,{value:"right",children:"Right"})]})]})]})]}),d&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-gray-700",children:"Primary Button"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Backgroun
1d Color"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(u.I,{type:"color",value:n.style.buttonBackgroundColor||"#3b82f6",onChange:e=>c("buttonBackgroundColor",e.target.value),className:"w-12 h-9 p-1 cursor-pointer"}),(0,t.jsx)(u.I,{value:n.style.buttonBackgroundColor||"",onChange:e=>c("buttonBackgroundColor",e.target.value),placeholder:"#3b82f6",className:"flex-1"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Text Color"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(u.I,{type:"color",value:n.style.buttonTextColor||"#ffffff",onChange:e=>c("buttonTextColor",e.target.value),className:"w-12 h-9 p-1 cursor-pointer"}),(0,t.jsx)(u.I,{value:n.style.buttonTextColor||"",onChange:e=>c("buttonTextColor",e.target.value),placeholder:"#ffffff",className:"flex-1"})]})]})]}),"hero"===n.type&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-gray-700",children:"Secondary Button"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Backgroun
1d Color"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(u.I,{type:"color",value:n.style.secondaryButtonBackgroundColor||"#ffffff",onChange:e=>c("secondaryButtonBackgroundColor",e.target.value),className:"w-12 h-9 p-1 cursor-pointer"}),(0,t.jsx)(u.I,{value:n.style.secondaryButtonBackgroundColor||"",onChange:e=>c("secondaryButtonBackgroundColor",e.target.value),placeholder:"#ffffff",className:"flex-1"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Text Color"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(u.I,{type:"color",value:n.style.secondaryButtonTextColor||"#374151",onChange:e=>c("secondaryButtonTextColor",e.target.value),className:"w-12 h-9 p-1 cursor-pointer"}),(0,t.jsx)(u.I,{value:n.style.secondaryButtonTextColor||"",onChange:e=>c("secondaryButtonTextColor",e.target.value),placeholder:"#374151",className:"flex-1"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Border Color"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(u.I,{type:"color",value:n.style.secondaryButtonBorderColor||"#d1d5db",onChange:e=>c("secondaryButtonBorderColor",e.target.value),className:"w-12 h-9 p-1 cursor-pointer"}),(0,t.jsx)(u.I,{value:n.style.secondaryButtonBorderColor||"",onChange:e=>c("secondaryButtonBorderColor",e.target.value),placeholder:"#d1d5db",className:"flex-1"})]})]})]}),("header"===n.type||"navbar"===n.type)&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-gray-700",children:"Logo"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Height (px)"}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(O.i,{value:[n.style.logoHeight||48],onValueChange:e=>{let[s]=e;return c("logoHeight",s)},min:24,max:120,step:4,className:"flex-1"}),(0,t.jsxs)("span",{className:"text-xs text-gray-500 w-10 text-right",children:[n.style.logoHeight||48,"px"]})]})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-gray-700",children:"Padding"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Top"}),(0,t.jsx)(u.I,{type:"number",value:(null===(s=n.style.padding)||void 0===s?void 0:s.top)||0,onChange:e=>c("padding",{...n.style.padding,top:parseInt(e.target.value)||0,unit:"px"}),className:"h-9"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Bottom"}),(0,t.jsx)(u.I,{type:"number",value:(null===(a=n.style.padding)||void 0===a?void 0:a.bottom)||0,onChange:e=>c("padding",{...n.style.padding,bottom:parseInt(e.target.value)||0,unit:"px"}),className:"h-9"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Left"}),(0,t.jsx)(u.I,{type:"number",value:(null===(l=n.style.padding)||void 0===l?void 0:l.left)||0,onChange:e=>c("padding",{...n.style.padding,left:parseInt(e.target.value)||0,unit:"px"}),className:"h-9"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Right"}),(0,t.jsx)(u.I,{type:"number",value:(null===(i=n.style.padding)||void 0===i?void 0:i.right)||0,onChange:e=>c("padding",{...n.style.padding,right:parseInt(e.target.value)||0,unit:"px"}),className:"h-9"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-gray-700",children:"Border"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Radius"}),(0,t.jsx)(u.I,{value:n.style.borderRadius||"",onChange:e=>c("borderRadius",e.target.value),placeholder:"8px",className:"h-9"})]})]})]})}var eH=a(66901);function eY(e){let{isVisible:s,stage:a="saving"}=e;return s?(0,t.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/40 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl p-8 flex flex-col items-center gap-6 min-w-[280px]",children:[(0,t.jsx)("div",{className:"relative",children:"done"===a?(0,t.jsx)("div",{className:"w-20 h-20 rounded-full bg-emerald-100 flex items-center justify-center animate-in zoom-in duration-300",children:(0,t.jsx)(eH.Z,{className:"w-10 h-10 text-emerald-500"})}):(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"absolute inset-0 w-20 h-20 rounded-full bg-gradient-to-br from-orange-400 to-red-500 blur-xl opacity-40 animate-pulse"}),(0,t.jsx)("div",{className:"relative w-20 h-20 rounded-full bg-gradient-to-br from-emerald-500 to-teal-600 flex items-center justify-center shadow-lg",children:(0,t.jsx)("div",{className:"transform ".concat("publishing"===a?"animate-bounce":""),children:(0,t.jsx)(k.Z,{className:"w-10 h-10 text-white transform -rotate-45"})})}),"publishing"===a&&(0,t.jsxs)("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 flex gap-1",children:[(0,t.jsx)("div",{className:"w-2 h-4 bg-gradient-to-t from-orange-500 to-yellow-400 rounded-full animate-pulse",style:{animationDelay:"0ms"}}),(0,t.jsx)("div",{className:"w-3 h-6 bg-gradient-to-t from-orange-500 to-yellow-400 rounded-full animate-pulse",style:{animationDelay:"100ms"}}),(0,t.jsx)("div",{className:"w-2 h-4 bg-gradient-to-t from-orange-500 to-yellow-400 rounded-full animate-pulse",style:{animationDelay:"200ms"}})]})]})}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("p",{className:"text-gray-800 font-semibold text-lg",children:"saving"===a?"Saving your changes...":"publishing"===a?"Publishing to the world...":"Successfully published!"}),"done"!==a&&(0,t.jsxs)("p",{className:"text-gray-500 text-sm mt-1 flex items-center justify-center gap-2",children:[(0,t.jsx)(w.Z,{className:"w-3 h-3 animate-spin"}),"Please wait..."]})]}),"done"!==a&&(0,t.jsx)("div",{className:"w-full h-1.5 bg-gray-200 rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:"h-full bg-gradient-to-r from-emerald-500 to-teal-500 rounded-full transition-all duration-1000 ".concat("saving"===a?"w-1/3":"w-2/3"," animate-pulse")})})]})}):null}var eK=a(69174),eW=a(82431),e$=a(92735),eX=a(33276),eJ=a(74656),e0=a(91723);let e1=[{value:"flux-schnell",label:"Basic",desc:"Budget-friendly",credits:2,tier:"Normal",estimatedGenTime:15},{value:"sdxl-turbo",label:"Fast",desc:"Quick generation",credits:2,tier:"Normal",estimatedGenTime:10}
1,{value:"flux-pro",label:"Pro",desc:"Professional quality",credits:15,tier:"Premium",estimatedGenTime:30},{value:"ideogram",label:"Ultra",desc:"Best for text & logos",credits:15,tier:"Excellent",estimatedGenTime:25}],e2=[{value:"minimax-video",label:"Basic",desc:"Budget-friendly",creditsPerSec:4,maxDuration:6,validDurations:[4,5,6],tier:"Normal",estimatedGenTime:360},{value:"veo3-fast",label:"Fast",desc:"Quick generation",creditsPerSec:31,maxDuration:8,validDurations:[4,6,8],tier:"Premium",estimatedGenTime:120},{value:"kling-2.1-master",label:"Pro",desc:"Professional quality",creditsPerSec:50,maxDuration:10,validDurations:[5,10],tier:"Premium",estimatedGenTime:180},{value:"veo3",label:"Ultra",desc:"Cinematic quality",creditsPerSec:75,maxDuration:8,validDurations:[4,6,8],tier:"Excellent",estimatedGenTime:240}],e3={Normal:"bg-emerald-100 text-emerald-700 border-emerald-300",Premium:"bg-blue-100 text-blue-700 border-blue-300",Excellent:"bg-purple-100 text-purple-700 border-purple-300"},e4=[{value:4,label:"4s",desc:"Quick clip"},{value:5,label:"5s",desc:"Short clip"},{value:6,label:"6s",desc:"Standard"},{value:8,label:"8s",desc:"Medium"},{value:10,label:"10s",desc:"Full length"}],e5=e=>{let s=e2.find(s=>s.value===e);return s?e4.filter(e=>s.validDurations.includes(e.value)):e4};function e8(e){let{isOpen:s,onClose:a,onInsertContent:i,pageContext:n=""}=e,[r,c]=(0,l.useState)("headlines"),[x,p]=(0,l.useState)(!1),[g,j]=(0,l.useState)(null),[v,f]=(0,l.useState)(null),[N,y]=(0,l.useState)(null),[C,k]=(0,l.useState)(n),[z,_]=(0,l.useState)(""),[S,P]=(0,l.useState)("professional"),[Z,B]=(0,l.useState)(5),[T,A]=(0,l.useState)(60),[Q,R]=(0,l.useState)(""),[F,O]=(0,l.useState)("benefits"),[G,K]=(0,l.useState)(100),[W,X]=(0,l.useState)("signup"),[J,ee]=(0,l.useState)(!1),[es,ea]=(0,l.useState)(""),[et,el]=(0,l.useState)("medium"),[ei,en]=(0,l.useState)(""),[er,ec]=(0,l.useState)(""),[ed,eo]=(0,l.useState)(!0),[eu,ef]=(0,l.useState)(""),[eN,eb]=(0,l.useState)("clarity"),[ew,eC]=(0,l.useState)(""),[ek,eI]=(0,l.useState)("photorealistic"),[ez,e_]=(0,l.useState)("16:9"),[eS,eD]=(0,l.useState)("flux-schnell"),[eP,eZ]=(0,l.useState)([]),[eB,eT]=(0,l.useState)(""),[eA,eQ]=(0,l.useState)("cinematic"),[eL,eR]=(0,l.useState)("16:9"),[eF,eU]=(0,l.useState)(5),[eV,eE]=(0,l.useState)("minimax-video"),[eq,eM]=(0,l.useState)([]),eO=async()=>{if(!C.trim()&&"improve"!==r&&"images"!==r&&"videos"!==r){ey.default.error("Please provide context about your product or service");return}if("improve"===r&&!eu.trim()){ey.default.error("Please provide content to improve");return}if("images"===r&&!ew.trim()){ey.default.error("Please provide a description for the image");return}if("videos"===r&&!eB.trim()){ey.default.error("Please provide a description for the video");return}p(!0),j(null);try{let i="",n={};switch(r){case"headlines":i="/landing-pages/ai/generate-headlines",n={context:C,target_audience:z||void 0,tone:S,max_length:T,count:Z,keywords:Q?Q.split(",").map(e=>e.trim()):void 0};break;case"copy":i="/landing-pages/ai/generate-copy",n={context:C,section_type:F,target_audience:z||void 0,tone:S,word_count:G};break;case"cta":i="/landing-pages/ai/generate-cta",n={context:C,action:W,urgency:J,count:Z};break;case"faq":i="/landing-pages/ai/generate-faq",n={context:C,topics:es?es.split(",").map(e=>e.trim()):void 0,count:Z,answer_length:et};break;case"testimonials":i="/landing-pages/ai/generate-testimonials",n={context:C,industry:ei||void 0,personas:er?er.split(",").map(e=>e.trim()):void 0,count:Z,include_metrics:ed};break;case"improve":i="/landing-pages/ai/improve-content",n={content:eu,improvement_type:eN,context:C||void 0};break;case"images":i="/ai-studio/generate/image",n={prompt:"".concat(ew).concat("photorealistic"!==ek?", ".concat(ek," style"):""),model:eS,size:({"1:1":"1024x1024","16:9":"1792x1024","9:16":"1024x1792","4:3":"1024x768"})[ez]||"1024x1024",num_images:1};break;case"videos":i="/ai-studio/generate/video",n={prompt:"".concat(eB).concat("cinematic"!==eA?", ".concat(eA," style"):""),model:eV,aspect_ratio:eL,duration:eF}}let c=(await d.api.post(i,n)).data;if(c.success){var e,s,a,t,l;if("images"===r){let s=((null===(e=c.data)||void 0===e?void 0:e.images)||[]).map(e=>({url:e.s3_url||e.url||e.local_url,prompt:e.prompt||ew,style:ek,aspectRatio:ez}));if(s.length>0)eZ(e=>[...s,...e]),j({type:r,items:s,timestamp:new Date});else throw Error("No images generated")}else if("videos"===r){let e=(null===(s=c.data)||void 0===s?void 0:s.videos)||[],i=(null===(a=e[0])||void 0===a?void 0:a.s3_url)||(null===(t=e[0])||void 0===t?void 0:t.url)||(null===(l=c.data)||void 0===l?void 0:l.videoUrl)||c.videoUrl;if(!i)throw Error("No video URL in response");let n={url:i,prompt:eB,style:eA,aspectRatio:eL,duration:eF};eM(e=>[n,...e]),j({type:r,items:[n],timestamp:new Date})}else{let e=Array.isArray(c.content)?c.content:[c.content];j({type:r,items:e,timestamp:new Date})}ey.default.success("Content generated successfully!")}else throw Error(c.error||"Generation failed")}catch(e){console.error("[AIContentPanel] AI generation error:",e),ey.default.error((0,o._V)(e,"Unable to generate content. Please try again."))}finally{p(!1)}},eG=(e,s)=>{navigator.clipboard.writeText(e),f(s),setTimeout(()=>f(null),2e3),ey.default.success("Copied to clipboard!")},eH=e=>{i(e,r),ey.default.success("Content inserted!")};return s?(0,t.jsxs)("div",{className:"fixed inset-y-0 right-0 w-96 bg-white shadow-2xl z-50 flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 border-b",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(H.Z,{className:"w-5 h-5 text-purple-600"}),(0,t.jsx)("h2",{className:"font-semibold text-gray-900",children:"AI Content Studio"})]}),(0,t.jsx)(h.z,{variant:"ghost",size:"sm",onClick:a,children:(0,t.jsx)(Y.Z,{className:"w-4 h-4"})})]}),(0,t.jsx)(D.x,{className:"flex-1",children:(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(U._,{className:"text-xs text-gray-600",children:"Product/Business Context"}),(0,t.jsx)(V.g,{value:C,onChange:e=>k(e.target.value),placeholder:"Describe your product or service (e.g., 'SaaS project management tool for remote teams')",rows:2,className:"mt-1 text-sm"})]}),(0,t.jsxs)(E.Tabs,{value:r,onValueChange:e=>c(e),children:[(0,t.jsxs)(E.TabsList,{className:"grid grid-cols-3 mb-4",children:[(0,t.jsxs)(E.TabsTrigger,{value:"headlines",className:"text-xs",children:[(0,t.jsx)(ex.Z,{className:"w-3 h-3 mr-1"}),"Headlines"]}),(0,t.jsxs)(E.TabsTrigger,{value:"copy",className:"text-xs",children:[(0,t.jsx)(em.Z,{className:"w-3 h-3 mr-1"}),"Copy"]}),(0,t.jsxs)(E.TabsTrigger,{value:"cta",className:"text-xs",children:[(0,t.jsx)(L.Z,{className:"w-3 h-3 mr-1"}),"CTA"]})]}),(0,t.jsxs)(E.TabsList,{className:"grid grid-cols-4 mb-2",children:[(0,t.jsxs)(E.TabsTrigger,{value:"faq",className:"text-xs",children:[(0,t.jsx)(eh.Z,{className:"w-3 h-3 mr-1"}),"FAQ"]}),(0,t.jsxs)(E.TabsTrigger,{value:"testimonials",className:"text-xs",children:[(0,t.jsx)(eJ.Z,{className:"w-3 h-3 mr-1"}),"Reviews"]}),(0,t.jsxs)(E.TabsTrigger,{value:"images",className:"text-xs",children:[(0,t.jsx)(ep.Z,{className:"w-3 h-3 mr-1"}),"Images"]}),(0,t.jsxs)(E.TabsTrigger,{value:"videos",className:"text-xs",children:[(0,t.jsx)(eg.Z,{className:"w-3 h-3 mr-1"}),"Videos"]})]}),(0,t.jsx)(E.TabsList,{className:"grid grid-cols-1 mb-4",children:(0,t.jsxs)(E.TabsTrigger,{value:"improve",className:"text-xs",children:[(0,t.jsx)(ej.Z,{className:"w-3 h-3 mr-1"}
1),"Improve Existing Content"]})}),(0,t.jsxs)(E.TabsContent,{value:"headlines",className:"space-y-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Tone"}),(0,t.jsxs)(q.Ph,{value:S,onValueChange:P,children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{})}),(0,t.jsxs)(q.Bw,{children:[(0,t.jsx)(q.Ql,{value:"professional",children:"Professional"}),(0,t.jsx)(q.Ql,{value:"casual",children:"Casual"}),(0,t.jsx)(q.Ql,{value:"urgent",children:"Urgent"}),(0,t.jsx)(q.Ql,{value:"friendly",children:"Friendly"}),(0,t.jsx)(q.Ql,{value:"bold",children:"Bold"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Count"}),(0,t.jsxs)(q.Ph,{value:Z.toString(),onValueChange:e=>B(parseInt(e)),children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{})}),(0,t.jsx)(q.Bw,{children:[3,5,7,10].map(e=>(0,t.jsxs)(q.Ql,{value:e.toString(),children:[e," headlines"]},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Max Length"}),(0,t.jsx)(u.I,{type:"number",value:T,onChange:e=>A(parseInt(e.target.value)),className:"h-8 text-xs mt-1",min:30,max:120})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Keywords (comma-separated)"}),(0,t.jsx)(u.I,{value:Q,onChange:e=>R(e.target.value),placeholder:"e.g., productivity, teams, collaboration",className:"h-8 text-xs mt-1"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Target Audience (optional)"}),(0,t.jsx)(u.I,{value:z,onChange:e=>_(e.target.value),placeholder:"e.g., small business owners",className:"h-8 text-xs mt-1"})]})]}),(0,t.jsxs)(E.TabsContent,{value:"copy",className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Section Type"}),(0,t.jsxs)(q.Ph,{value:F,onValueChange:O,children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{})}),(0,t.jsxs)(q.Bw,{children:[(0,t.jsx)(q.Ql,{value:"benefits",children:"Benefits"}),(0,t.jsx)(q.Ql,{value:"features",children:"Features"}),(0,t.jsx)(q.Ql,{value:"problem",children:"Problem Statement"}),(0,t.jsx)(q.Ql,{value:"solution",children:"Solution"}),(0,t.jsx)(q.Ql,{value:"about",children:"About Us"})]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Tone"}),(0,t.jsxs)(q.Ph,{value:S,onValueChange:P,children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{})}),(0,t.jsxs)(q.Bw,{children:[(0,t.jsx)(q.Ql,{value:"professional",children:"Professional"}),(0,t.jsx)(q.Ql,{value:"casual",children:"Casual"}),(0,t.jsx)(q.Ql,{value:"friendly",children:"Friendly"}),(0,t.jsx)(q.Ql,{value:"authoritative",children:"Authoritative"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Word Count"}),(0,t.jsxs)(q.Ph,{value:G.toString(),onValueChange:e=>K(parseInt(e)),children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{})}),(0,t.jsxs)(q.Bw,{children:[(0,t.jsx)(q.Ql,{value:"50",children:"~50 words"}),(0,t.jsx)(q.Ql,{value:"100",children:"~100 words"}),(0,t.jsx)(q.Ql,{value:"200",children:"~200 words"}),(0,t.jsx)(q.Ql,{value:"300",children:"~300 words"})]})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Target Audience (optional)"}),(0,t.jsx)(u.I,{value:z,onChange:e=>_(e.target.value),placeholder:"e.g., marketing professionals",className:"h-8 text-xs mt-1"})]})]}),(0,t.jsxs)(E.TabsContent,{value:"cta",className:"space-y-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Action Type"}),(0,t.jsxs)(q.Ph,{value:W,onValueChange:X,children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{})}),(0,t.jsxs)(q.Bw,{children:[(0,t.jsx)(q.Ql,{value:"signup",children:"Sign Up"}),(0,t.jsx)(q.Ql,{value:"buy",children:"Purchase"}),(0,t.jsx)(q.Ql,{value:"download",children:"Download"}),(0,t.jsx)(q.Ql,{value:"contact",children:"Contact"}),(0,t.jsx)(q.Ql,{value:"learn",children:"Learn More"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Count"}),(0,t.jsxs)(q.Ph,{value:Z.toString(),onValueChange:e=>B(parseInt(e)),children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{})}),(0,t.jsx)(q.Bw,{children:[3,5,7].map(e=>(0,t.jsxs)(q.Ql,{value:e.toString(),children:[e," CTAs"]},e))})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Add Urgency"}),(0,t.jsx)(M.r,{checked:J,onCheckedChange:ee})]})]}),(0,t.jsxs)(E.TabsContent,{value:"faq",className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Topics (comma-separated)"}),(0,t.jsx)(u.I,{value:es,onChange:e=>ea(e.target.value),placeholder:"e.g., pricing, features, support",className:"h-8 text-xs mt-1"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Answer Length"}),(0,t.jsxs)(q.Ph,{value:et,onValueChange:el,children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{})}),(0,t.jsxs)(q.Bw,{children:[(0,t.jsx)(q.Ql,{value:"short",children:"Short"}),(0,t.jsx)(q.Ql,{value:"medium",children:"Medium"}),(0,t.jsx)(q.Ql,{value:"detailed",children:"Detailed"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Count"}),(0,t.jsxs)(q.Ph,{value:Z.toString(),onValueChange:e=>B(parseInt(e)),children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{})}),(0,t.jsx)(q.Bw,{children:[3,5,7,10].map(e=>(0,t.jsxs)(q.Ql,{value:e.toString(),children:[e," Q&As"]},e))})]})]})]})]}),(0,t.jsxs)(E.TabsContent,{value:"testimonials",className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Industry (optional)"}),(0,t.jsx)(u.I,{value:ei,onChange:e=>en(e.target.value),placeholder:"e.g., Technology, Healthcare",className:"h-8 text-xs mt-1"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Customer Types (comma-separated)"}
1),(0,t.jsx)(u.I,{value:er,onChange:e=>ec(e.target.value),placeholder:"e.g., CEO, Marketing Manager, Developer",className:"h-8 text-xs mt-1"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Count"}),(0,t.jsxs)(q.Ph,{value:Z.toString(),onValueChange:e=>B(parseInt(e)),children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{})}),(0,t.jsx)(q.Bw,{children:[3,5,7].map(e=>(0,t.jsxs)(q.Ql,{value:e.toString(),children:[e," reviews"]},e))})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-5",children:[(0,t.jsx)(U._,{className:"text-xs",children:"Include Metrics"}),(0,t.jsx)(M.r,{checked:ed,onCheckedChange:eo})]})]})]}),(0,t.jsxs)(E.TabsContent,{value:"improve",className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Content to Improve"}),(0,t.jsx)(V.g,{value:eu,onChange:e=>ef(e.target.value),placeholder:"Paste the content you want to improve...",rows:4,className:"mt-1 text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Improvement Type"}),(0,t.jsxs)(q.Ph,{value:eN,onValueChange:eb,children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{})}),(0,t.jsxs)(q.Bw,{children:[(0,t.jsx)(q.Ql,{value:"clarity",children:"Improve Clarity"}),(0,t.jsx)(q.Ql,{value:"persuasion",children:"More Persuasive"}),(0,t.jsx)(q.Ql,{value:"seo",children:"SEO Optimize"}),(0,t.jsx)(q.Ql,{value:"brevity",children:"Make Shorter"}),(0,t.jsx)(q.Ql,{value:"engagement",children:"More Engaging"})]})]})]})]}),(0,t.jsxs)(E.TabsContent,{value:"images",className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Image Description"}),(0,t.jsx)(V.g,{value:ew,onChange:e=>eC(e.target.value),placeholder:"Describe the image you want to generate (e.g., 'Professional team meeting in modern office with large windows')",rows:3,className:"mt-1 text-sm"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Style"}),(0,t.jsxs)(q.Ph,{value:ek,onValueChange:eI,children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{})}),(0,t.jsxs)(q.Bw,{children:[(0,t.jsx)(q.Ql,{value:"photorealistic",children:"Photorealistic"}),(0,t.jsx)(q.Ql,{value:"illustration",children:"Illustration"}),(0,t.jsx)(q.Ql,{value:"3d",children:"3D Render"}),(0,t.jsx)(q.Ql,{value:"minimal",children:"Minimal"}),(0,t.jsx)(q.Ql,{value:"artistic",children:"Artistic"}),(0,t.jsx)(q.Ql,{value:"cartoon",children:"Cartoon"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Aspect Ratio"}),(0,t.jsxs)(q.Ph,{value:ez,onValueChange:e_,children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{})}),(0,t.jsxs)(q.Bw,{children:[(0,t.jsx)(q.Ql,{value:"1:1",children:"Square (1:1)"}),(0,t.jsx)(q.Ql,{value:"16:9",children:"Landscape (16:9)"}),(0,t.jsx)(q.Ql,{value:"9:16",children:"Portrait (9:16)"}),(0,t.jsx)(q.Ql,{value:"4:3",children:"Standard (4:3)"})]})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Model"}),(0,t.jsxs)(q.Ph,{value:eS,onValueChange:eD,children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{children:(()=>{let e=e1.find(e=>e.value===eS);return e?"".concat(e.label," (").concat(e.credits," cr)"):"Select model"})()})}),(0,t.jsx)(q.Bw,{children:e1.map(e=>(0,t.jsx)(q.Ql,{value:e.value,className:"text-xs",children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 w-full",children:[(0,t.jsx)("span",{children:e.label}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(eK.C,{className:"text-[9px] px-1 py-0 h-4 ".concat(e3[e.tier]),children:e.tier}),(0,t.jsxs)("span",{className:"font-semibold text-emerald-600",children:[e.credits," cr"]})]})]})},e.value))})]}),(()=>{let e=e1.find(e=>e.value===eS);return e&&(0,t.jsxs)("p",{className:"text-[10px] text-slate-500 mt-1",children:["Cost: ",(0,t.jsxs)("span",{className:"text-emerald-600 font-medium",children:[e.credits," credits"]})," per image"]})})()]}),eP.length>0&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)(U._,{className:"text-xs text-gray-600",children:"Recent Images"}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-2 mt-2",children:eP.slice(0,4).map((e,s)=>(0,t.jsx)("div",{className:"relative aspect-square rounded-lg overflow-hidden bg-gray-100 cursor-pointer hover:ring-2 hover:ring-blue-400 transition-all",onClick:()=>eH({url:e.url,prompt:e.prompt}),children:(0,t.jsx)("img",{src:e.url,alt:e.prompt,className:"w-full h-full object-cover"})},s))})]})]}),(0,t.jsxs)(E.TabsContent,{value:"videos",className:"space-y-3",children:[(0,t.jsx)("div",{className:"p-3 bg-amber-50 border border-amber-200 rounded-lg",children:(0,t.jsxs)("p",{className:"text-xs text-amber-700 flex items-center gap-1",children:[(0,t.jsx)(e0.Z,{className:"w-3 h-3"}),"Video generation takes 1-5 minutes depending on model. Please be patient."]})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Video Description"}),(0,t.jsx)(V.g,{value:eB,onChange:e=>eT(e.target.value),placeholder:"Describe the video you want to generate (e.g., 'Aerial drone shot of modern city skyline at sunset with smooth camera movement')",rows:3,className:"mt-1 text-sm"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Style"}),(0,t.jsxs)(q.Ph,{value:eA,onValueChange:eQ,children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{})}),(0,t.jsxs)(q.Bw,{children:[(0,t.jsx)(q.Ql,{value:"cinematic",children:"Cinematic"}),(0,t.jsx)(q.Ql,{value:"corporate",children:"Corporate"}),(0,t.jsx)(q.Ql,{value:"dynamic",children:"Dynamic"}),(0,t.jsx)(q.Ql,{value:"minimal",children:"Minimal"}),(0,t.jsx)(q.Ql,{value:"abstract",children:"Abstract"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Aspect Ratio"}),(0,t.jsxs)(q.Ph,{value:eL,onValueChange:eR,children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{})}),(0,t.jsxs)(q.Bw,{children:[(0,t.jsx)(q.Ql,{value:"16:9",children:"Landscape (16:9)"}),(0,t.jsx)(q.Ql,{value:"9:16",children:"Portrait (9:16)"}),(0,t.jsx)(q.Ql,{value:"1:1",children:"Square (1:1)"})]})]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Duration"}),(0,t.jsxs)(q.Ph,{value:eF.toString(),onValueChange:e=>eU(parseInt(e)),children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{})}),(0,t.jsx)(q.Bw,{children:e5(eV).map(e=>(0,t.jsxs)(q.Ql,{value:e.value.toString(),children:[e.label," - ",e.desc]},e.value))})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(U._,{className:"text-xs",children:"Model"}),(0,t.jsxs)(q.Ph,{value:eV,onValueChange:e=>{eE(e);let s=e2.find(s=>
1s.value===e);s&&!s.validDurations.includes(eF)&&eU(s.validDurations[0])},children:[(0,t.jsx)(q.i4,{className:"h-8 text-xs mt-1",children:(0,t.jsx)(q.ki,{children:(()=>{let e=e2.find(e=>e.value===eV);return e?"".concat(e.label," (").concat(e.creditsPerSec," cr/s)"):"Select model"})()})}),(0,t.jsx)(q.Bw,{children:e2.map(e=>(0,t.jsx)(q.Ql,{value:e.value,className:"text-xs",children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 w-full",children:[(0,t.jsx)("span",{children:e.label}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(eK.C,{className:"text-[9px] px-1 py-0 h-4 ".concat(e3[e.tier]),children:e.tier}),(0,t.jsxs)("span",{className:"font-semibold text-emerald-600",children:[e.creditsPerSec," cr/s"]})]})]})},e.value))})]})]})]}),(()=>{let e=e2.find(e=>e.value===eV),s=e?e.creditsPerSec*eF:0;return e&&(0,t.jsxs)("p",{className:"text-[10px] text-slate-500",children:["Estimated cost: ",(0,t.jsxs)("span",{className:"text-emerald-600 font-semibold",children:[s," credits"]}),(0,t.jsxs)("span",{className:"text-slate-400 ml-1",children:["(",eF,"s x ",e.creditsPerSec," cr/s)"]})]})})(),eq.length>0&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)(U._,{className:"text-xs text-gray-600",children:"Recent Videos"}),(0,t.jsx)("div",{className:"space-y-2 mt-2",children:eq.slice(0,3).map((e,s)=>(0,t.jsxs)("div",{className:"relative rounded-lg overflow-hidden bg-gray-100",children:[(0,t.jsx)("video",{src:e.url,className:"w-full aspect-video object-cover",controls:!0,muted:!0}),(0,t.jsx)("div",{className:"absolute bottom-2 right-2 flex gap-1",children:(0,t.jsx)(h.z,{size:"sm",className:"h-7 bg-white/90 text-gray-700 hover:bg-white",onClick:()=>eH({url:e.url,type:"video"}),children:"Insert"})})]},s))})]})]})]}),(0,t.jsx)(h.z,{className:"w-full mt-4",onClick:eO,disabled:x,children:x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Z,{className:"w-4 h-4 mr-2 animate-spin"}),"images"===r?"Generating Image...":"videos"===r?"Generating Video...":"Generating..."]}):(0,t.jsxs)(t.Fragment,{children:["images"===r?(0,t.jsx)(ep.Z,{className:"w-4 h-4 mr-2"}):"videos"===r?(0,t.jsx)(eg.Z,{className:"w-4 h-4 mr-2"}):(0,t.jsx)(H.Z,{className:"w-4 h-4 mr-2"}),"Generate ","improve"===r?"Improved Content":"images"===r?"Image":"videos"===r?"Video":r.charAt(0).toUpperCase()+r.slice(1)]})}),g?(0,t.jsxs)("div",{className:"space-y-3 mt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-gray-700",children:"Generated Content"}),(0,t.jsxs)(h.z,{variant:"ghost",size:"sm",onClick:eO,disabled:x,children:[(0,t.jsx)(eW.Z,{className:(0,m.cn)("w-3 h-3 mr-1",x&&"animate-spin")}),"Regenerate"]})]}),(0,t.jsx)("div",{className:"space-y-2",children:g.items.map((e,s)=>(0,t.jsxs)("div",{className:"p-3 bg-gray-50 rounded-lg border border-gray-200 hover:border-blue-300 transition-colors",children:["headlines"===g.type&&(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-sm font-medium flex-1",children:e}),(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>eG(e,s),children:v===s?(0,t.jsx)(b.Z,{className:"w-3 h-3 text-green-500"}):(0,t.jsx)(ev.Z,{className:"w-3 h-3"})}),(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>eH(e),children:"Insert"})]})]}),"copy"===g.type&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm whitespace-pre-wrap",children:e}),(0,t.jsxs)("div",{className:"flex justify-end gap-1 mt-2",children:[(0,t.jsxs)(h.z,{variant:"ghost",size:"sm",className:"h-7",onClick:()=>eG(e,s),children:[v===s?(0,t.jsx)(b.Z,{className:"w-3 h-3 mr-1"}):(0,t.jsx)(ev.Z,{className:"w-3 h-3 mr-1"}),"Copy"]}),(0,t.jsx)(h.z,{size:"sm",className:"h-7",onClick:()=>eH(e),children:"Insert"})]})]}),"cta"===g.type&&(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e.button}),e.subtext&&(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:e.subtext})]}),(0,t.jsx)(h.z,{size:"sm",className:"h-7",onClick:()=>eH(e),children:"Insert"})]}),"faq"===g.type&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{className:"flex items-center justify-between w-full text-left",onClick:()=>y(N===s?null:s),children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:e.question}),N===s?(0,t.jsx)($.Z,{className:"w-4 h-4 text-gray-400"}):(0,t.jsx)(I.Z,{className:"w-4 h-4 text-gray-400"})]}),N===s&&(0,t.jsxs)("div",{className:"mt-2 pt-2 border-t",children:[(0,t.jsx)("p",{className:"text-sm text-gray-600",children:e.answer}),(0,t.jsxs)("div",{className:"flex justify-end gap-1 mt-2",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-7",onClick:()=>eG("Q: ".concat(e.question,"\nA: ").concat(e.answer),s),children:"Copy"}),(0,t.jsx)(h.z,{size:"sm",className:"h-7",onClick:()=>eH(e),children:"Insert"})]})]})]}),"testimonials"===g.type&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"text-sm italic",children:['"',e.quote,'"']}),(0,t.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[(0,t.jsxs)("p",{className:"text-xs text-gray-500",children:["- ",e.author,e.role?", ".concat(e.role):"",e.company?", ".concat(e.company):""]}),(0,t.jsx)(h.z,{size:"sm",className:"h-7",onClick:()=>eH(e),children:"Insert"})]})]}),"improve"===g.type&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm whitespace-pre-wrap",children:e}),(0,t.jsxs)("div",{className:"flex justify-end gap-1 mt-2",children:[(0,t.jsx)(h.z,{variant:"ghost",size:"sm",className:"h-7",onClick:()=>eG(e,s),children:"Copy"}),(0,t.jsx)(h.z,{size:"sm",className:"h-7",onClick:()=>eH(e),children:"Use This"})]})]}),"images"===g.type&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"relative aspect-video rounded-lg overflow-hidden bg-gray-100",children:(0,t.jsx)("img",{src:e.url,alt:e.prompt,className:"w-full h-full object-cover"})}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-2 truncate",title:e.prompt,children:e.prompt}),(0,t.jsxs)("div",{className:"flex justify-end gap-1 mt-2",children:[(0,t.jsxs)(h.z,{variant:"ghost",size:"sm",className:"h-7",onClick:()=>window.open(e.url,"_blank"),children:[(0,t.jsx)(e$.Z,{className:"w-3 h-3 mr-1"}),"Open"]}),(0,t.jsx)(h.z,{size:"sm",className:"h-7",onClick:()=>eH({url:e.url,prompt:e.prompt}),children:"Insert"})]})]}),"videos"===g.type&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"relative aspect-video rounded-lg overflow-hidden bg-gray-900",children:[(0,t.jsx)("video",{src:e.url,className:"w-full h-full object-cover",controls:!0,muted:!0,autoPlay:!0,loop:!0}),(0,t.jsxs)("div",{className:"absolute top-2 left-2 bg-black/50 text-white text-xs px-2 py-1 rounded flex items-center gap-1",children:[(0,t.jsx)(eX.Z,{className:"w-3 h-3"}),e.duration||5,"s"]})]}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-2 truncate",title:e.prompt,children:e.prompt}),(0,t.jsxs)("div",{className:"flex justify-end gap-1 mt-2",children:[(0,t.jsxs)(h.z,{variant:"ghost",size:"sm",className:"h-7",onClick:()=>window.open(e.url,"_blank"),children:[(0,t.jsx)(e$.Z,{className:"w-3 h-3 mr-1"}),"Open"]}),(0,t.jsx)(h.z,{size:"sm",className:"h-7",onClick:()=>eH({url:e.url,type:"video",prompt:e.prompt}),children:"Insert"})]})]})]},s))})]}):null]})}),(0,t.jsx)("div",{className:"p-3 border-t bg-gray-50",children:(0,t.jsx)("p",{className:"text-xs text-gray-500 text-center",children:"AI-generated content. Review and edit before publishing."})})]}):null}var e6=a(83426),e7=a(92110);function e9(e){let{pageId:s,returnTo:a,campaignId:m}=e,h=(0,i.useRouter)(),u=(0,l.useRef)(s),[p,g]=(0,l.useState)(!1),[j,v]=(0,l.useState)("saving"),[f,N]=(0,l.useState)(!1),{setPage:y,blocks:b,addBlock:w,moveBlock:C,setIsDragging:k,setIsSaving:I,markSaved:z,pageName:_,settings:D,seo:P,hasUnsavedChanges:Z,reset:T,selectedBlockId:L,updateBlock:R}=(0,x.i)(),U=(0,n.Dy)((0,n.VT)(n.we,{activationConstraint:{distance:8}}),(0,n.VT)(n.Lg,{coordinateGetter:r.is})),[V,E]=(0,l.useState)(null),[q,M]=(0,l.useState)(null);(0,l.useEffect)(()=>((async()=>
1{if("new"===s){T();return}try{let e=(await d.api.get("/landing-pages/".concat(s))).data;if(e.success&&e.data.page){let s=e.data.page;y({id:s.id,name:s.name,slug:s.slug,blocks:s.blocks||[],settings:s.settings,seo:s.seo,status:s.status})}}catch(e){console.error("[LandingPageBuilder] Failed to load page:",e),c.A.error((0,o._V)(e,"Unable to load page. Starting with a blank page.")),y({id:s,name:"New Landing Page",slug:"new-page",blocks:[],status:"draft"})}})(),()=>{T()}),[s,y,T]),(0,l.useEffect)(()=>{let e=e=>{if((e.ctrlKey||e.metaKey)&&"z"===e.key&&!e.shiftKey&&(e.preventDefault(),x.i.getState().undo()),(e.ctrlKey||e.metaKey)&&"z"===e.key&&e.shiftKey&&(e.preventDefault(),x.i.getState().redo()),(e.ctrlKey||e.metaKey)&&"s"===e.key&&(e.preventDefault(),O()),("Backspace"===e.key||"Delete"===e.key)&&!["INPUT","TEXTAREA"].includes(e.target.tagName)){let{selectedBlockId:s,removeBlock:a}=x.i.getState();s&&(e.preventDefault(),a(s))}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let O=(0,l.useCallback)(async function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];I(!0);try{let s=x.i.getState(),a=u.current;if("new"!==a)return await d.api.put("/landing-pages/".concat(a),{name:s.pageName,blocks:s.blocks,settings:s.settings,seo:s.seo},{timeout:6e4}),e&&c.A.success("Page saved!"),z(),a;{let a=(await d.api.post("/landing-pages/",{name:s.pageName||"Untitled Page",blocks:s.blocks,settings:s.settings,seo:s.seo},{timeout:6e4})).data;if(a.success){let s=a.data.page.id;return u.current=s,e&&c.A.success("Page created!"),window.history.replaceState(null,"","/dashboard/landing-pages/".concat(s,"/builder")),z(),s}}return null}catch(e){var s;return"ECONNABORTED"===e.code||(null===(s=e.message)||void 0===s?void 0:s.includes("timeout"))?c.A.warning("Save request timed out. Your changes may have been saved - please refresh to verify."):(console.error("[LandingPageBuilder] Save error:",e),c.A.error((0,o._V)(e,"Unable to save page. Please try again."))),null}finally{I(!1)}},[I,z]),G=(0,l.useCallback)(()=>{let e=x.i.getState();e.pageSlug?window.open("/landing/".concat(e.pageSlug),"_blank"):c.A.info("Save the page first to preview")},[]),H=(0,l.useCallback)((e,s)=>{let a=x.i.getState();if(a.selectedBlockId){let c=a.blocks.find(e=>e.id===a.selectedBlockId);if(c){var t,l,i,n,r;if("headlines"===s&&"string"==typeof e){if("hero"===c.type){R(a.selectedBlockId,{content:{headline:e}});return}if("text"===c.type){let s=((null===(t=c.content)||void 0===t?void 0:t.content)||"").replace("<p>Add your text content here.</p>","");R(a.selectedBlockId,{content:{content:"".concat(s,"<h2>").concat(e,"</h2>")}});return}}if(("copy"===s||"improve"===s)&&"string"==typeof e){if("hero"===c.type){R(a.selectedBlockId,{content:{subheadline:e}});return}if("text"===c.type){let s=((null===(l=c.content)||void 0===l?void 0:l.content)||"").replace("<p>Add your text content here.</p>","");R(a.selectedBlockId,{content:{content:"".concat(s,"<p>").concat(e,"</p>")}});return}if("features"===c.type){R(a.selectedBlockId,{content:{subheadline:e}});return}}if("cta"===s&&"object"==typeof e&&"button"in e){if("hero"===c.type){R(a.selectedBlockId,{content:{ctaText:e.button,subheadline:e.subtext||(null===(i=c.content)||void 0===i?void 0:i.subheadline)||""}});return}if("cta"===c.type){R(a.selectedBlockId,{content:{ctaText:e.button,secondaryText:e.subtext||""}});return}let s=(0,B.Ys)("cta");s&&w("cta",{headline:"Ready to Get Started?",subheadline:e.subtext||"",ctaText:e.button},s.defaultStyle);return}if("faq"===s&&"object"==typeof e&&"faq"===c.type){let s=(null===(n=c.content)||void 0===n?void 0:n.faqs)||[];R(a.selectedBlockId,{content:{faqs:[...s,e]}});return}if("testimonials"===s&&"object"==typeof e&&"testimonials"===c.type){let s=(null===(r=c.content)||void 0===r?void 0:r.testimonials)||[];R(a.selectedBlockId,{content:{testimonials:[...s,e]}});return}if("images"===s&&"object"==typeof e&&"url"in e){if("hero"===c.type){R(a.selectedBlockId,{content:{image:e.url}});return}if("image"===c.type){R(a.selectedBlockId,{content:{src:e.url}});return}}if("videos"===s&&"object"==typeof e&&"url"in e&&"video"===c.type){R(a.selectedBlockId,{
1content:{videoUrl:e.url}});return}}}let c=(0,B.Ys)("text");if("headlines"===s&&"string"==typeof e&&c)w("text",{content:"<h2>".concat(e,"</h2>")},c.defaultStyle);else if(("copy"===s||"improve"===s)&&"string"==typeof e&&c)w("text",{content:"<p>".concat(e,"</p>")},c.defaultStyle);else if("cta"===s&&"object"==typeof e&&"button"in e){let s=(0,B.Ys)("cta");s&&w("cta",{headline:"Ready to Get Started?",subheadline:e.subtext||"",ctaText:e.button},s.defaultStyle)}else if("faq"===s){let s=(0,B.Ys)("faq");s&&w("faq",{faqs:[e]},s.defaultStyle)}else if("testimonials"===s){let s=(0,B.Ys)("testimonials");s&&w("testimonials",{testimonials:[e]},s.defaultStyle)}else if("images"===s&&"object"==typeof e&&"url"in e){let s=(0,B.Ys)("image");s&&w("image",{src:e.url,alt:e.prompt||"AI Generated Image"},s.defaultStyle)}else if("videos"===s&&"object"==typeof e&&"url"in e){let s=(0,B.Ys)("video");s&&w("video",{videoUrl:e.url,autoplay:!0,muted:!0,loop:!0,title:e.prompt||"AI Generated Video"},s.defaultStyle)}},[w,R]),Y=(0,l.useCallback)(async()=>{if(!p){g(!0),v("saving");try{await new Promise(e=>setTimeout(e,800));let e=await O(!1);if(!e){c.A.error("Failed to save page"),g(!1);return}v("publishing"),await new Promise(e=>setTimeout(e,800)),(await d.api.post("/landing-pages/".concat(e,"/publish"),{},{timeout:6e4})).data.success&&(v("done"),await new Promise(e=>setTimeout(e,2500)),"campaign"===a&&m?h.push("/dashboard/campaigns/new?id=".concat(m)):h.push("/dashboard/landing-pages"))}catch(s){var e;"ECONNABORTED"===s.code||(null===(e=s.message)||void 0===e?void 0:e.includes("timeout"))?c.A.warning("Publish request timed out. Your page may have been published - please check the landing pages list."):(console.error("[LandingPageBuilder] Publish error:",s),c.A.error((0,o._V)(s,"Unable to publish page. Please try again."))),g(!1)}}},[p,O,h,a,m]),K=(()=>{if(!V)return null;if("new"!==q)return b.find(e=>e.id===V);{let e=String(V).replace("new-",""),s=(0,B.Ys)(e);if(s)return{id:"drag-preview",type:e,content:s.defaultContent,style:s.defaultStyle,order:0}}return null})();return(0,t.jsxs)(n.LB,{sensors:U,collisionDetection:n.pE,onDragStart:e=>{k(!0),E(e.active.id),M(String(e.active.id).startsWith("new-")?"new":"existing")},onDragOver:e=>{},onDragEnd:e=>{let{active:s,over:a}=e;if(k(!1),E(null),M(null),!a)return;let t=String(s.id),l=String(a.id);if(t.startsWith("new-")){let e=t.replace("new-",""),s=(0,B.Ys)(e);if(s){let a=b.length;if("canvas-drop-zone"!==l){let e=b.findIndex(e=>e.id===l);-1!==e&&(a=e)}w(e,{...s.defaultContent},{...s.defaultStyle},a)}return}let i=b.findIndex(e=>e.id===t),n=b.findIndex(e=>e.id===l);-1!==i&&-1!==n&&i!==n&&C(i,n)},onDragCancel:()=>{k(!1),E(null),M(null)},children:[(0,t.jsxs)("div",{className:"h-screen flex flex-col bg-gradient-to-br from-slate-100 to-slate-200",children:[(0,t.jsx)(S,{onSave:O,onPreview:G,onPublish:Y,onOpenAI:()=>N(!0),isPublishing:p}),(0,t.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,t.jsx)(A,{className:"w-[360px] shrink-0"}),(0,t.jsx)(F,{className:"flex-1"}),(0,t.jsx)(ek,{className:"w-80 shrink-0",onInsertContent:H})]})]}),(0,t.jsx)(n.y9,{children:K&&(0,t.jsx)("div",{className:"opacity-80 shadow-2xl scale-95 pointer-events-none",children:(0,t.jsx)("div",{className:"bg-white rounded-lg overflow-hidden max-w-sm",children:(0,t.jsx)(Q.H,{block:K,isPreview:!0})})})}),(0,t.jsx)(eY,{isVisible:p,stage:j}),(0,t.jsx)(e6.X,{pageId:e7.H8,steps:e7.Wk}),(0,t.jsx)(e8,{isOpen:f,onClose:()=>N(!1),onInsertContent:H,pageContext:_||""})]})}var se=a(57685),ss=a(8515),sa=a(67115),st=a(75203),sl=a(75577),si=a(75568),sn=a(34110),sr=a(80156),sc=a(31675),sd=a(99204),so=a(46112),sx=a(92677),sm=a(73931),sh=a(5590),su=a(66867),sp=a(42302),sg=a(39038),sj=a(33122),sv=a(89798),sf=a(24924),sN=a(65282),sy=a(41616),sb=a(92624),sw=a(99645),sC=a(63292),sk=a(41760),sI=a(68009),sz=a(48544),s_=a(63010)},32060:function(e,s,a){a.d(s,{$F:function(){return d},AW:function(){return o},Ju:function(){return h},VD:function(){return u},Xi:function(){return x},bO:function(){return m},h_:function(){return c}});var t=a(57437),l=a(2265),i=a(70085),n=a(93448),r=a(20653);let c=i.fC,d=i.xz;i.ZA,i.Uv,i.Tr,i.Ee,l.forwardRef((e,s)=>{let{className:a,inset:l,children:c,...d}=e;return(0,t.jsxs)(i.fF,{ref:s,className:(0,n.cn)("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",l&&"pl-8",a),...d,children:[c,(0,t.jsx)(r.XCv,{className:"ml-auto"})]})}).displayName=i.fF.displayName,l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(i.tu,{ref:s,className:(0,n.cn)("z-50 min-w-[8rem] overflow-hidden rounded-[4px] border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
1de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",a),...l})}).displayName=i.tu.displayName;let o=l.forwardRef((e,s)=>{let{className:a,sideOffset:l=4,...r}=e;return(0,t.jsx)(i.Uv,{children:(0,t.jsx)(i.VY,{ref:s,sideOffset:l,className:(0,n.cn)("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-[4px] border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",a),...r})})});o.displayName=i.VY.displayName;let x=l.forwardRef((e,s)=>{let{className:a,inset:l,...r}=e;return(0,t.jsx)(i.ck,{ref:s,className:(0,n.cn)("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",l&&"pl-8",a),...r})});x.displayName=i.ck.displayName;let m=l.forwardRef((e,s)=>{let{className:a,children:l,checked:c,...d}=e;return(0,t.jsxs)(i.oC,{ref:s,className:(0,n.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),checked:c,...d,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(i.wU,{children:(0,t.jsx)(r.nQG,{className:"h-4 w-4"})})}),l]})});m.displayName=i.oC.displayName,l.forwardRef((e,s)=>{let{className:a,children:l,...c}=e;return(0,t.jsxs)(i.Rk,{ref:s,className:(0,n.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...c,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(i.wU,{children:(0,t.jsx)(r.jXb,{className:"h-2 w-2 fill-current"})})}),l]})}).displayName=i.Rk.displayName;let h=l.forwardRef((e,s)=>{let{className:a,inset:l,...r}=e;return(0,t.jsx)(i.__,{ref:s,className:(0,n.cn)("px-2 py-1.5 text-sm font-semibold",l&&"pl-8",a),...r})});h.displayName=i.__.displayName;let u=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(i.Z0,{ref:s,className:(0,n.cn)("-mx-1 my-1 h-px bg-muted",a),...l})});u.displayName=i.Z0.displayName},75060:function(e,s,a){a.d(s,{_:function(){return d}});var t=a(57437),l=a(2265),i=a(6394),n=a(90535),r=a(93448);let c=(0,n.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(i.f,{ref:s,className:(0,r.cn)(c(),a),...l})});d.displayName=i.f.displayName},90641:function(e,s,a){a.d(s,{x:function(){return r}});var t=a(57437),l=a(2265),i=a(43643),n=a(93448);let r=l.forwardRef((e,s)=>{let{className:a,children:l,...r}=e;return(0,t.jsxs)(i.fC,{ref:s,className:(0,n.cn)("relative overflow-hidden",a),...r,children:[(0,t.jsx)(i.l_,{className:"h-full w-full rounded-[inherit]",children:l}),(0,t.jsx)(c,{}),(0,t.jsx)(i.Ns,{})]})});r.displayName=i.fC.displayName;let c=l.forwardRef((e,s)=>{let{className:a,orientation:l="vertical",...r}=e;return(0,t.jsx)(i.gb,{ref:s,orientation:l,forceMount:!0,className:(0,n.cn)("flex touch-none select-none transition-colors","vertical"===l&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===l&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",a),...r,children:(0,t.jsx)(i.q4,{className:"relative flex-1 rounded-full bg-slate-300 dark:bg-slate-600 hover:bg-slate-400 dark:hover:bg-slate-500 transition-colors"})})});c.displayName=i.gb.displayName},15291:function(e,s,a){a.d(s,{Bw:function(){return h},DI:function(){return o},Ph:function(){return d},Ql:function(){return p},i4:function(){return m},ki:function(){return x},n5:function(){return u}});var t=a(57437),l=a(2265),i=a(56873),n=a(40875),r=a(30401),c=a(93448);let d=i.fC,o=i.ZA,x=i.B4,m=l.forwardRef((e,s)=>{let{className:a,children:l,...r}=e;
1return(0,t.jsxs)(i.xz,{ref:s,className:(0,c.cn)("flex h-10 w-full items-center justify-between rounded-[4px] border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 dark:text-gray-100 px-3 py-2 text-sm ring-offset-white dark:ring-offset-gray-950 placeholder:text-gray-500 dark:placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-950 dark:focus:ring-gray-300 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),...r,children:[l,(0,t.jsx)(i.JO,{asChild:!0,children:(0,t.jsx)(n.Z,{className:"h-4 w-4 opacity-50"})})]})});m.displayName=i.xz.displayName;let h=l.forwardRef((e,s)=>{let{className:a,children:l,position:n="popper",...r}=e;return(0,t.jsx)(i.h_,{children:(0,t.jsx)(i.VY,{ref:s,className:(0,c.cn)("relative z-50 min-w-[8rem] overflow-hidden rounded-[4px] border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-950 dark:text-gray-100 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:n,...r,children:(0,t.jsx)(i.l_,{className:(0,c.cn)("p-1 max-h-[300px] overflow-y-auto","popper"===n&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:l})})})});h.displayName=i.VY.displayName;let u=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(i.__,{ref:s,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...l})});u.displayName=i.__.displayName;let p=l.forwardRef((e,s)=>{let{className:a,children:l,...n}=e;return(0,t.jsxs)(i.ck,{ref:s,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-gray-100 dark:focus:bg-gray-700 focus:text-gray-900 dark:focus:text-gray-100 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...n,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(i.wU,{children:(0,t.jsx)(r.Z,{className:"h-4 w-4"})})}),(0,t.jsx)(i.eT,{children:l})]})});p.displayName=i.ck.displayName,l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(i.Z0,{ref:s,className:(0,c.cn)("-mx-1 my-1 h-px bg-gray-100 dark:bg-gray-700",a),...l})}).displayName=i.Z0.displayName},31397:function(e,s,a){a.d(s,{i:function(){return r}});var t=a(57437),l=a(2265),i=a(38846),n=a(93448);let r=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsxs)(i.fC,{ref:s,className:(0,n.cn)("relative flex w-full touch-none select-none items-center",a),...l,children:[(0,t.jsx)(i.fQ,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:(0,t.jsx)(i.e6,{className:"absolute h-full bg-primary"})}),(0,t.jsx)(i.bU,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]})});r.displayName=i.fC.displayName},94589:function(e,s,a){a.d(s,{r:function(){return r}});var t=a(57437),l=a(2265),i=a(50721),n=a(93448);let r=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(i.fC,{className:(0,n.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-950 dark:focus-visible:ring-gray-300 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-950 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-gray-900 dark:data-[state=checked]:bg-gray-100 data-[state=unchecked]:bg-gray-200 dark:data-[state=unchecked]:bg-gray-700",a),...l,ref:s,children:(0,t.jsx)(i.bU,{className:(0,n.cn)("pointer-events-none block h-5 w-5 rounded-full bg-white dark:bg-gray-900 shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})})});r.displayName=i.fC.displayName},17168:function(e,s,a){a.d(s,{Tabs:function(){return r},TabsContent:function(){return o},TabsList:function(){return c},TabsTrigger:function(){return d}});var t=a(57437),l=a(2265),i=a(20271),n=a(93448);let r=i.fC,c=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(i.aV,{ref:s,className:(0,n.cn)("inline-flex h-10 items-center justify-center rounded-[4px] bg-gray-100 dark:bg-gray-800 p-1 text-gray-500 dark:text-gray-400",a),...l})});c.displayName=i.aV.displayName;let d=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(i.xz,{ref:s,className:(0,n.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-white dark:ring-offset-gray-950 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-950 dark:focus-visible:ring-gray-300 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-white dark:data-[state=active]:bg-gray-900 data-[state=active]:text-gray-950 dark:data-[state=active]:text-gray-100 data-[state=active]:shadow-sm",a),...l})});d.displayName=i.xz.displayName;let o=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(i.VY,{ref:s,className:(0,n.cn)("mt-2 ring-offset-white dark:ring-offset-gray-950 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-950 dark:focus-visible:ring-gray-300 focus-visible:ring-offset-2",a),...l})});o.displayName=i.VY.displayName},23675:function(e,s,a){a.d(s,{g:function(){return n}});var t=a(57437),l=a(2265),i=a(93448);let n=l.forwardRef((e,s)=>{let{className:a,error:l,...n}=e;return(0,t.jsx)("textarea",{"aria-invalid":l?"true":void 0,className:(0,i.cn)("flex min-h-[80px] w-full rounded-[4px] border border-input bg-background px-3 py-2 text-sm r
1ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",l&&"border-red-500 focus-visible:ring-red-500",a),ref:s,...n})});n.displayName="Textarea"},92110:function(e,s,a){a.d(s,{H8:function(){return n},Wk:function(){return i},df:function(){return t},zF:function(){return l}});let t=[{target:'[data-tour="landing-pages-create"]',title:"Create Landing Page",content:"Click here to create a new landing page. Choose from templates or start with a blank page.",placement:"bottom"},{target:'[data-tour="landing-pages-list"]',title:"Your Landing Pages",content:"View and manage all your landing pages here. Click any page to edit it in the builder.",placement:"top"}],l="landing-pages",i=[{target:'[data-tour="builder-block-library"]',title:"Block Library",content:"Drag and drop blocks from here onto your page. Choose from headers, text, images, forms, and more.",placement:"right"},{target:'[data-tour="builder-properties-panel"]',title:"Style Panel",content:"Customize the selected block here. Change colors, fonts, spacing, and other styling options.",placement:"left"}],n="landing-page-builder"}}]);

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.