PageSourceSearch

https://blacksheepbi.com/assets/LandingPageBuilder-BG-83v_6.js

js blacksheepbi.com collected 2026-09-30 08:27:34 UTC 150,358 bytes, 48 lines download raw bytes

1import{r as D,j as e}from"./ui-CPW3-RCR.js";import{a0 as Se,aE as Ke,aR as Fe,br as Pt,ce as Dt,bm as It,ct as Lt,a9 as Rt,G as Oe,aP as Ot,aL as zt,b4 as Vt,Y as Et,ap as He,g as ve,l as ns,aZ as Ys,m as cs,n as os,o as ds,I as m,c as Ye,B as _,L as es,s as ee,d as V,bC as ss,ak as de,al as xe,f as Le,bB as Mt,am as he,Z as pe,cr as At,D as $t,U as Be,cB as xs,a2 as Me,ae as ts,e as hs,bK as Je,y as We,J as qe,aa as g,T as te,a_ as ms,a$ as us,b0 as me,b1 as ue,bc as be,bO as ze,N as U,P as se,cY as Js,a5 as Ve,d3 as Qs,af as ps,ag as js,ah as gs,aQ as Gt,X as zs,bI as Ft,cs as Qe,bb as Vs,b2 as Es,aq as Ht,ao as vs,_ as Ms,ac as Bt,$ as Wt,a as qt,z as Zt,E as Xt}from"./index-BraPXa8T.js";import{u as Kt,a as Yt,C as Jt,b as bs,S as Qt,v as Ut,c as ea,d as As,D as sa,e as ta,f as aa,g as Ue,K as la,P as ia}from"./sortable.esm-De4cortL.js";import{T as ra}from"./type-DOqr7pg5.js";import{H as na}from"./hash-C5kOXdhJ.js";import{M as ca}from"./minus-CCCsL8N7.js";import{C as oa}from"./columns-3-D2LhJmRE.js";import{M as da}from"./message-square-quote-QSvtGdI3.js";import{R as xa}from"./repeat-Bzyo7NvJ.js";import{L as as}from"./layers-Dzu1hN6i.js";import{Q as ha}from"./quote-BPj_Y_e6.js";import{A as ma}from"./award-CoYQKEQq.js";import{R as ua,Z as pa,a as ja}from"./zoom-out-DKyZmosy.js";import{T as ga}from"./timer-BUNfhu_O.js";import{C as va}from"./credit-card-CyIPEgks.js";import{S as ba}from"./share-2-ySg6qX03.js";import{P as fa}from"./phone-DY0b6ay4.js";import{T as Na}from"./toggle-left-D-Bn_MMm.js";import{P as wa}from"./play-D97WNvd1.js";import{C as Us}from"./code-Dvqr_6nk.js";import{R as ya}from"./redo-2-CbmJWvKx.js";import{L as ls}from"./link-BKA0FtFv.js";import{S as Ca}from"./scroll-area-BQtXZnuf.js";import{G as fs}from"./grip-vertical-CXGwY4jS.js";import{S as C,a as k,b as S,c as T,d as i}from"./select-DubWVshT.js";import{T as et,a as Pe}from"./toggle-group-CMTvwTF5.js";import{S as Re}from"./slider-Dfvb-YIx.js";import{T as Ee}from"./tablet-VWWqo-TL.js";import{A as st}from"./arrow-down-BufOymSL.js";import{M as Ze}from"./monitor-BThy0502.js";import{C as ka,a as Sa,b as Ta}from"./collapsible-CHuAoMFW.js";import{S as is}from"./settings-2-Pmo5V7b-.js";import{B as $s}from"./book-dashed-DUBj85Kw.js";import{C as _a}from"./compass-Czk_0Tq-.js";import{S as tt}from"./SectionPreview-jDnW7rY_.js";import{C as Pa,a as Da,b as Ia,c as ce,d as Ie}from"./context-menu-DLsz2R6S.js";import{C as La}from"./copy-plus-CbDBI1gG.js";import{C as Ra}from"./clipboard-DvtKg8d-.js";import{C as Oa}from"./clipboard-paste-CScS4YdT.js";import{F as za}from"./folder-plus-C_Qqx75d.js";import"./supabase-B2z4OhLQ.js";import"./charts-DCB9_QAo.js";import"./vendor-CIXof4MH.js";import"./index-BdQq_4o_.js";import"./index-DkD4heWV.js";import"./circle-Bi-mZyos.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Va=Se("ChartNoAxesColumn",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const Ea=Se("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
12 * @license lucide-react v0.462.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const at=Se("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/**
17 * @license lucide-react v0.462.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const Ma=Se("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
22 * @license lucide-react v0.462.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */const Aa=Se("Space",[["path",{d:"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1",key:"lt2kga"}]]);/**
27 * @license lucide-react v0.462.0 - ISC
28 *
29 * This source code is licensed under the ISC license.
30 * See the LICENSE file in the root directory of this source tree.
31 */const $a=Se("StarHalf",[["path",{d:"M12 18.338a2.1 2.1 0 0 0-.987.244L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.12 2.12 0 0 0 1.597-1.16l2.309-4.679A.53.53 0 0 1 12 2",key:"2ksp49"}]]);/**
32 * @license lucide-react v0.462.0 - ISC
33 *
34 * This source code is licensed under the ISC license.
35 * See the LICENSE file in the root directory of this source tree.
36 */const Ga=Se("TableOfContents",[["path",{d:"M16 12H3",key:"1a2rj7"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M21 12h.01",key:"msek7k"}],["path",{d:"M21 18h.01",key:"1e8rq1"}],["path",{d:"M21 6h.01",key:"1koanj"}]]);function Ae(){try{return typeof window>"u"?"he":localStorage.getItem("app-language")||"he"}catch{return"he"}}function f(t,a,s){return t==="he"?a:s}function lt(t=Ae()){return[{type:"hero",label:f(t,"Hero","Hero"),icon:Ke,category:"basic"},{type:"text",label:f(t,"טקסט","Text"),icon:ra,category:"basic"},{type:"heading",label:f(t,"כותרת","Heading"),icon:na,category:"basic"},{type:"image",label:f(t,"תמונה","Image"),icon:Fe,category:"basic"},{type:"button",label:f(t,"כפתור","Button"),icon:Pt,category:"basic"},{type:"divider",label:f(t,"מפריד","Divider"),icon:ca,category:"basic"},{type:"spacer",label:f(t,"ריווח","Spacer"),icon:Aa,category:"basic"},{type:"icon-box",label:f(t,"תיבת אייקון","Icon Box"),icon:Ma,category:"basic"},{type:"columns",label:f(t,"עמודות","Columns"),icon:at,category:"content"},{type:"inner-section",label:f(t,"סקשן פנימי","Inner Section"),icon:oa,category:"content"},{type:"video",label:f(t,"וידאו","Video"),icon:Dt,category:"content"},{type:"testimonials",label:f(t,"המלצות","Testimonials"),icon:da,category:"content"},{type:"features",label:f(t,"תכונות","Features"),icon:It,category:"content"},{type:"list",label:f(t,"רשימה","List"),icon:Lt,category:"content"},{type:"gallery",label:f(t,"גלריה","Gallery"),icon:Fe,category:"content"},{type:"logo-carousel",label:f(t,"לוגואים","Logos"),icon:xa,category:"content"},{type:"tabs",label:f(t,"טאבים","Tabs"),icon:as,category:"content"},{type:"quote",label:f(t,"ציטוט","Quote"),icon:ha,category:"content"},{type:"team",label:f(t,"צוות","Team"),icon:ma,category:"content"},{type:"alert-box",label:f(t,"תיבת התראה","Alert Box"),icon:Rt,category:"content"},{type:"table-of-contents",label:f(t,"תוכן עניינים","Table of Contents"),icon:Ga,
36category:"content"},{type:"form",label:f(t,"טופס","Form"),icon:ua,category:"interactive"},{type:"cta",label:"CTA",icon:Oe,category:"interactive"},{type:"countdown",label:f(t,"ספירה לאחור","Countdown"),icon:ga,category:"interactive"},{type:"faq",label:f(t,"שאלות נפוצות","FAQ"),icon:Ot,category:"interactive"},{type:"pricing",label:f(t,"טבלת מחירים","Pricing"),icon:va,category:"interactive"},{type:"counter",label:f(t,"מונה","Counter"),icon:zt,category:"interactive"},{type:"progress-bar",label:f(t,"מד התקדמות","Progress Bar"),icon:Va,category:"interactive"},{type:"social-icons",label:f(t,"רשתות חברתיות","Social Icons"),icon:ba,category:"interactive"},{type:"map",label:f(t,"מפה","Map"),icon:Vt,category:"interactive"},{type:"contact-info",label:f(t,"פרטי קשר","Contact Info"),icon:fa,category:"interactive"},{type:"opening-hours",label:f(t,"שעות פתיחה","Opening Hours"),icon:Et,category:"interactive"},{type:"star-rating",label:f(t,"דירוג כוכבים","Star Rating"),icon:$a,category:"interactive"},{type:"toggle",label:"Toggle",icon:Na,category:"interactive"},{type:"scroll-to-top",label:f(t,"גלול למעלה","Scroll to Top"),icon:Ea,category:"interactive"},{type:"lottie",label:f(t,"אנימציית Lottie","Lottie Animation"),icon:wa,category:"interactive"},{type:"html-embed",label:f(t,"HTML מותאם","Custom HTML"),icon:Us,category:"layout"},{type:"accordion",label:f(t,"אקורדיון","Accordion"),icon:He,category:"layout"}]}const je=lt();function it(t=Ae()){return[{key:"basic",label:f(t,"בסיסי","Basic")},{key:"content",label:f(t,"תוכן","Content")},{key:"interactive",label:f(t,"אינטראקטיבי","Interactive")},{key:"layout",label:f(t,"פריסה","Layout")}]}const Fa=it();function Ha(t,a=Ae()){switch(t){case"hero":return{title:"",subtitle:"",cta:f(a,"התחל עכשיו","Get Started"),ctaUrl:"#",bgImage:""};case"text":return{text:""};case"heading":return{text:f(a,"כותרת","Heading"),level:"h2",align:"center"};case"image":return{src:"",alt:"",width:"100%",align:"center",link:"",borderRadius:"8"};case"form":return{title:f(a,"השאר פרטים","Leave your details"),formFields:[{id:"f1",label:f(a,"שם מלא","Full name"),type:"text",required:!0},{id:"f2",label:f(a,"אימייל","Email"),type:"email",required:!0},{id:"f3",label:f(a,"טלפון","Phone"),type:"tel",required:!1}],submitText:f(a,"שלח","Submit"),webhookUrl:"",successMessage:f(a,"הטופס נשלח בהצלחה!","Form submitted successfully!"),formType:"simple"};case"columns":return{columnCount:2,columnRatio:"equal",col1Title:"",col1Text:"",col2Title:"",col2Text:""};case"inner-section":return{columnCount:2,columnRatio:"equal",columns:[{widgets:[]},{widgets:[]}]};case"cta":return{title:"",buttonText:f(a,"התחל עכשיו","Get Started"),buttonUrl:""};case"button":return{text:f(a,"לחץ כאן","Click here"),url:"#",variant:"primary",size:"md",target:"_self",icon:""};case"divider":return{style:"solid",thickness:"1"};case"spacer":return{height:"40"};case"video":return{url:"",type:"youtube",autoplay:!1};case"testimonials":return{items:[{name:"",text:"",role:"",avatar:""}]};case"countdown":return{targetDate:"",title:f(a,"המבצע נגמר בעוד:","Offer ends in:")};case"faq":return{items:[{question:"",answer:""}]};case"features":return{items:[{icon:"⭐",title:"",description:""}]};case"list":return{items:[""],style:"bullet"};case"map":return{address:"",zoom:"15"};case"icon-box":return{icon:"⭐",title:"",description:"",align:"center"};case"gallery":return{items:[{src:"",alt:""}],columns:3};case"logo-carousel":return{items:[{src:"",name:""}]};case"tabs":return{items:[{label:f(a,"טאב 1","Tab 1"),content:""},{label:f(a,"טאב 2","Tab 2"),content:""}]};case"quote":return{text:"",author:"",role:""};case"team":return{items:[{name:"",role:"",image:"",bio:""}]};case"pricing":return{items:[{name:f(a,"בסיסי","Basic"),price:"$99",period:f(a,"/חודש","/month"),features:[f(a,"תכונה 1","Feature 1"),f(a,"תכונה 2","Feature 2")],cta:f(a,"התחל","Get started"),highlighted:!1}]};case"counter":return{items:[{number:"1000",label:f(a,"לקוחות","Customers"),suffix:"+"}]};case"progress-bar":return{items:[{label:"",value:75}]};case"social-icons":return{items:[{platform:"facebook",url:""}],size:"md"};case"contact-info":return{phone:"",email:"",address:"",whatsapp:""};case"opening-hours":return{items:[{day:f(a,"ראשון-חמישי","Sunday-Thursday"),hours:"09:00-18:00"}],title:f(a,"שעות פתיחה","Opening Hours")};case"html-embed":return{html:`<div style='padding:20px;background:#f3f4f6;border-radius:8px;text-align:center;'>${f(a,"HTML מותאם אישית","Custom HTML")}</div>`};case"accordion":return{items:[{title:f(a,"פריט 1","Item 1"),content:f(a,"תוכן פריט 1","Item 1 content")},{title:f(a,"פריט 2","Item 2"),content:f(a,"תוכן פריט 2","Item 2 content")}]};case"star-rating":return{rating:4,maxStars:5,size:"lg",color:"#f59e0b",label:""};case"alert-box":return{type:"info",title:f(a,"שים לב","Please note"),text:f(a,"זוהי הודעת מידע חשובה","This is an important info message"),dismissible:!1};case"toggle":return{title:f(a,"לחץ כדי לפתוח","Click to open"),content:f(a,"תוכן מוסתר שמופיע בלחיצה","Hidden content shown on click"),defaultOpen:!1};case"scroll-to-top":return{text:"↑",showAfter:300,position:"bottom-right"};case"lottie":return{url:"",width:"200px",loop:!0,autoplay:!0};case"table-of-contents":return{title:f(a,"תוכן עניינים","Table of Contents"),style:"numbered"};default:return{}}}function $(t,a,s){return t==="he"?a:s}function Ba(t=Ae()){return[{id:"hero-classic",name:$(t,"Hero קלאסי","Classic Hero"),category:"hero",sections:[{id:"",type:"hero",order:0,content:{title:$
36(t,"הפתרון המושלם לעסק שלך","The perfect solution for your business"),subtitle:$(t,"אנחנו עוזרים לעסקים לצמוח עם טכנולוגיה מתקדמת","We help businesses grow with advanced technology"),cta:$(t,"התחל עכשיו","Get Started"),bgImage:""},style:{bgColor:"",textColor:"#ffffff",padding:"py-24 px-8"}}]},{id:"hero-gradient",name:$(t,"Hero גרדיאנט","Gradient Hero"),category:"hero",sections:[{id:"",type:"hero",order:0,content:{title:$(t,"קח את העסק שלך לשלב הבא","Take your business to the next level"),subtitle:$(t,"פלטפורמה חכמה שעובדת בשבילך 24/7","A smart platform that works for you 24/7"),cta:$(t,"צור קשר","Contact Us")},style:{bgGradient:"true",bgGradientFrom:"#667eea",bgGradientTo:"#764ba2",bgGradientAngle:"135deg",textColor:"#ffffff",padding:"py-24 px-8"}}]},{id:"features-3col",name:$(t,"3 תכונות","3 Features"),category:"content",sections:[{id:"",type:"features",order:0,content:{items:[{icon:"🚀",title:$(t,"מהיר","Fast"),description:$(t,"ביצועים מעולים ומהירות טעינה","Great performance and fast loading")},{icon:"🔒",title:$(t,"מאובטח","Secure"),description:$(t,"אבטחה ברמה הגבוהה ביותר","Top-level security")},{icon:"📱",title:$(t,"רספונסיבי","Responsive"),description:$(t,"מותאם לכל מסך ומכשיר","Works on every screen and device")}]},style:{padding:"py-16 px-8"}}]},{id:"testimonials-block",name:$(t,"המלצות לקוחות","Customer Testimonials"),category:"content",sections:[{id:"",type:"testimonials",order:0,content:{items:[{name:$(t,"ישראל כהן","Daniel Cohen"),text:$(t,"שירות מעולה! ממליץ בחום לכולם","Excellent service! Highly recommended."),role:$(t,'מנכ"ל, חברת XYZ',"CEO, XYZ Company")},{name:$(t,"שרה לוי","Sarah Levi"),text:$(t,"תוצאות מדהימות תוך זמן קצר","Amazing results in a short time."),role:$(t,'סמנכ"ל שיווק',"VP Marketing")}]},style:{padding:"py-16 px-8",bgColor:"#f8fafc"}}]},{id:"cta-bold",name:$(t,"CTA בולט","Bold CTA"),category:"interactive",sections:[{id:"",type:"cta",order:0,content:{title:$(t,"מוכנים להתחיל?","Ready to get started?"),buttonText:$(t,"קבל הצעת מחיר","Get a Quote")},style:{bgGradient:"true",bgGradientFrom:"#f97316",bgGradientTo:"#ef4444",bgGradientAngle:"135deg",textColor:"#ffffff",padding:"py-20 px-8"}}]},{id:"faq-section",name:$(t,"שאלות נפוצות","FAQ"),category:"interactive",sections:[{id:"",type:"faq",order:0,content:{items:[{question:$(t,"כמה זה עולה?","How much does it cost?"),answer:$(t,"המחירים מותאמים אישית לכל לקוח. צרו קשר לקבלת הצעת מחיר.","Pricing is tailored to each client. Contact us for a quote.")},{question:$(t,"כמה זמן לוקח?","How long does it take?"),answer:$(t,"הקמה תוך 48 שעות, תוצאות ראשונות תוך שבוע.","Setup within 48 hours, first results within a week.")},{question:$(t,"האם יש התחייבות?","Is there a commitment?"),answer:$(t,"ללא התחייבות. ניתן לבטל בכל עת.","No commitment. You can cancel anytime.")}]},style:{padding:"py-16 px-8"}}]}]}const Ns=Ba();function Wa(t=Ae()){return[{key:"hero",label:"Hero"},{key:"content",label:$(t,"תוכן","Content")},{key:"interactive",label:$(t,"אינטראקטיבי","Interactive")}]}const rt=Wa();function qa({onImportSections:t,children:a}){const[s,j]=D.useState(!1),[d,l]=D.useState(""),[r,n]=D.useState(!1),{language:o,t:b}=ve(),N=async()=>{var v;if(!d.trim())return;let p=d.trim();p.startsWith("http")||(p=`https://${p}`),n(!0);try{const{data:h,error:I}=await ee.functions.invoke("scrape-page-structure",{body:{url:p}});if(I)throw I;if(!((v=h==null?void 0:h.sections)!=null&&v.length)){V.error(b("importUrl.emptyError"));return}t(h.sections),V.success(b("importUrl.success").replace("{n}",String(h.sections.length))),j(!1),l("")}catch(h){console.error(h),V.error(b("importUrl.error"))}finally{n(!1)}};return e.jsxs(ns,{open:s,onOpenChange:j,children:[e.jsx(Ys,{asChild:!0,children:a}),e.jsxs(cs,{dir:o==="he"?"rtl":"ltr",className:"sm:max-w-md",children:[e.jsx(os,{children:e.jsxs(ds,{className:"flex items-center gap-2",children:[e.jsx(Oe,{className:"w-5 h-5"}),b("importUrl.title")]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:b("importUrl.description")}),e.jsx(m,{placeholder:"https://example.com",value:d,onChange:p=>l(p.target.value),dir:"ltr",className:"font-mono text-sm",onKeyDown:p=>p.key==="Enter"&&!r&&N()}),e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-muted/50 text-xs text-muted-foreground",children:[e.jsx(Ye,{className:"w-4 h-4 shrink-0"}),e.jsx("span",{children:b("importUrl.hint")})]}),e.jsx(_,{onClick:N,disabled:!d.trim()||r,className:"w-full gap-2",children:r?e.jsxs(e.Fragment,{children:[e.jsx(es,{className:"w-4 h-4 animate-spin"}),b("importUrl.loading")]}):e.jsxs(e.Fragment,{children:[e.jsx(Oe,{className:"w-4 h-4"}),b("importUrl.action")]})})]})]})]})}function Za({pageName:t,pageSlug:a,pageStatus:s,canUndo:j,canRedo:d,onBack:l,onUndo:r,onRedo:n,onTogglePublish:o,onExport:b,onImport:N,onPreview:p,onImportFromUrl:v}){const[h,I]=D.useState(!1),{language:B,t:L}=ve(),E=s==="published",M=B==="he",G=M?Le:Mt,z=M?{back:"חזרה לרשימה",export:"ייצוא",import:"ייבוא",importFromSite:"ייבוא מאתר",preview:"תצוגה מקדימה",copyLink:"העתק לינק",copied:"הועתק!",publish:"פרסם",published:"מפורסם"}:{back:"Back to list",export:"Export",import:"Import",importFromSite:"Import from website",preview:"Preview",copyLink:"Copy link",copied:"Copied!",publish:"Publish",published:"Published"},Z=()=>{navigator.clipboard.writeText(`https://blacksheepbi.com/lp/${a}`),I(!0),V.success(L("landing.linkCopied")),setTimeout(()=>I(!1),2e3)};return e.jsx(ss,{delayDuration:300,children:e.jsxs("div",{className:"h-11 bg-[#23272f] text-white flex items-center justify-between px-3 shrink-0 z-50 border-b border-white/10",dir:M?"rtl":"ltr",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(de,{children:[e.jsx(xe,{asChild:!0,children:e.jsx("button",{onClick:l,className:"w-8 h-8 rounded flex items-center justify-center hover:bg-white/10 transition-colors",children:e.jsx(G,{className:"w-4 h-4"})})}),e.jsx(he,{side:"bottom",className:"text-xs",children:z.back})]}),e.jsx("span",{className:"text-sm font-medium truncate max-w-[140px]",children:t}),e.jsxs(pe,{variant:"outline",className:"text-[9px] border-white/20 text-white/40 font-mono hidden sm:inline-flex",children:["/",a]})]}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsxs(de,{children:[e.jsx(xe,{asChild:!0,children:e.jsx("button",{className:"p-1.5 rounded text-white/40 hover:text-white hover:bg-white/10 disabled:opacity-20 disabled:cursor-not-allowed transition-all",onClick:r,disabled:!j,children:e.jsx(At,{className:"w-3.5 h-3.5"})})}),e.jsx(he,{side:"bottom",className:"text-xs",children:"Ctrl+Z"})]}),e.jsxs(de,{children:[e.jsx(xe,{asChild:!0,children:e.jsx("button",{className:"p-1.5 rounded text-white/40 hover:text-white hover:bg-white/10 disabled:opacity-20 disabled:cursor-not-allowed transition-all",onClick:n,disabled:!d,children:e.jsx(ya,{className:"w-3.5 h-3.5"})})}),e.jsx(he,{side:"bottom",className:"text-xs",children:"Ctrl+Shift+Z"})]})]}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsxs(de,{children:[e.jsx(xe,{asChild:!0,children:e.jsx("button",{className:"p-1.5 rounded text-white/40 hover:text-white hover:bg-white/10 transition-all",onClick:b,children:e.jsx($t,{className:"w-3.5 h-3.5"})})}),e.jsx(he,{side:"bottom",className:"text-xs",children:z.export})]}),e.jsxs(de,{children:[e.jsx(xe,{asChild:!0,children:e.jsx("button",{className:"p-1.5 rounded text-white/40 hover:text-white hover:bg-white/10 transition-all",onClick:N,children:e.jsx(Be,{className:"w-3.5 h-3.5"})})}),e.jsx(he,{side:"bottom",className:"text-xs",children:z.import})]}),e.jsxs(de,{children:[e.jsx(xe,{asChild:!0,children:e.jsx(qa,{onImportSections:v,children:e.jsx("button",{className:"p-1.5 rounded text-white/40 hover:text-white hover:bg-white/10 transition-all",children:e.jsx(xs,{className:"w-3.5 h-3.5"})})})}),e.jsx(he,{side:"bottom",className:"text-xs",children:z.importFromSite})]}),e.jsx("div",{className:"w-px h-4 bg-white/10 mx-0.5"}),e.jsxs(de,{children:[e.jsx(xe,{asChild:!0,children:e.jsx("button",{className:"p-1.5 rounded text-white/40 hover:text-white hover:bg-white/10 transition-all",onClick:p,children:e.jsx(Me,{className:"w-3.5 h-3.5"})})}),e.jsx(he,{side:"bottom",className:"text-xs",children:z.preview})]}),E&&e.jsxs(de,{children:[e.jsx(xe,{asChild:!0,children:e.jsx("button",{className:"p-1.5 rounded text-white/40 hover:text-white hover:bg-white/10 transition-all",onClick:Z,children:h?e.jsx(ts,{className:"w-3.5 h-3.5 text-green-400"}):e.jsx(ls,{className:"w-3.5 h-3.5"})})}),e.jsx(he,{side:"bottom",className:"text-xs",children:h?z.copied:z.copyLink})]}),e.jsxs(_,{size:"sm",className:`mr-1.5 h-7 text-[11px] gap-1 px-3 ${E?"bg-green-600 hover:bg-green-700":"bg-emerald-500 hover:bg-emerald-600"}`,onClick:o,children:[e.jsx(Oe,{className:"w-3 h-3"}),E?z.published:z.publish]})]})]})})}function Gs({type:t,label:a,icon:s,onAdd:j}){const{attributes:d,listeners:l,setNodeRef:r,transform:n,isDragging:o}=Kt({id:`widget-${t}`,data:{type:t,isNewWidget:!0}}),b=n?{transform:`translate3d(${n.x}px, ${n.y}px, 0)`,zIndex:100,opacity:.8}:void 0;return e.jsxs("button",{ref:r,...l,...d,style:b,className:`h-auto py-3 px-2 flex flex-col items-center justify-center gap-1.5 text-[11px] font-normal rounded-lg
37        border border-white/10 hover:border-primary/50 hover:bg-white/10 transition-all cursor-grab active:cursor-grabbing
38        ${o?"ring-2 ring-primary shadow-lg bg-white/15 scale-105":"bg-white/[0.04]"}`,onClick:()=>j(t),children:[e.jsx(s,{className:"w-5 h-5 text-white/50"}),e.jsx("span",{className:"text-white/70 leading-tight text-center",children:a})]})}function Xa({onAdd:t}){const[a,s]=D.useState(""),{t:j,dir:d,language:l}=ve(),r=d==="rtl",n=lt(l),o=it(l),b=a.trim()?n.filter(N=>N.label.toLowerCase().includes(a.toLowerCase())||N.type.includes(a.toLowerCase())):null;return e.jsxs("div",{className:"space-y-4",dir:d,children:[e.jsxs("div",{className:"relative",children:[e.jsx(hs,{className:`absolute ${r?"right-2.5":"left-2.5"} top-1/2 -translate-y-1/2 w-4 h-4 text-white/30`}),e.jsx(m,{placeholder:j("widgets.searchPlaceholder"),value:a,onChange:N=>
38s(N.target.value),className:`h-9 text-xs ${r?"pr-9":"pl-9"} bg-white/5 border-white/10 text-white placeholder:text-white/30 focus:border-primary/50`})]}),e.jsx("div",{className:"space-y-5",children:b?b.length===0?e.jsx("p",{className:"text-xs text-white/30 text-center py-8",children:j("widgets.noResults")}):e.jsx("div",{className:"grid grid-cols-3 gap-2",children:b.map(N=>e.jsx(Gs,{type:N.type,label:N.label,icon:N.icon,onAdd:t},N.type))}):o.map(N=>{const p=n.filter(v=>v.category===N.key);return e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-semibold text-white/40 uppercase tracking-wider mb-2.5",children:N.label}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:p.map(v=>e.jsx(Gs,{type:v.type,label:v.label,icon:v.icon,onAdd:t},v.type))})]},N.key)})})]})}const Fs={he:{searchPlaceholder:"חפש אלמנט...",noResults:"לא נמצאו אלמנטים",noElements:"אין אלמנטים בדף",body:"גוף הדף"},en:{searchPlaceholder:"Search element...",noResults:"No elements found",noElements:"No elements on page",body:"Body"},it:{searchPlaceholder:"Cerca elemento...",noResults:"Nessun elemento trovato",noElements:"Nessun elemento nella pagina",body:"Corpo"},fr:{searchPlaceholder:"Rechercher un élément...",noResults:"Aucun élément trouvé",noElements:"Aucun élément sur la page",body:"Corps"},pt:{searchPlaceholder:"Buscar elemento...",noResults:"Nenhum elemento encontrado",noElements:"Nenhum elemento na página",body:"Corpo"}};function Ka({sections:t,selectedId:a,onSelect:s,onToggleHidden:j}){const[d,l]=D.useState(""),[r,n]=D.useState(new Set),{language:o}=ve(),b=Fs[o]??Fs.en,N=v=>{n(h=>{const I=new Set(h);return I.has(v)?I.delete(v):I.add(v),I})},p=d.trim()?t.filter(v=>{const h=je.find(B=>B.type===v.type);return(v.label||(h==null?void 0:h.label)||v.type).toLowerCase().includes(d.toLowerCase())}):t;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx(hs,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-white/30"}),e.jsx(m,{placeholder:b.searchPlaceholder,value:d,onChange:v=>l(v.target.value),className:"h-7 text-[11px] pr-7 bg-white/5 border-white/10 text-white placeholder:text-white/30"})]}),p.length===0?e.jsx("p",{className:"text-[10px] text-white/30 text-center py-6",children:d?b.noResults:b.noElements}):e.jsxs("div",{className:"space-y-px",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 text-[11px] text-white/50 font-semibold uppercase tracking-wider",children:[e.jsx(He,{className:"w-3 h-3"}),e.jsx("span",{children:b.body})]}),p.map(v=>{const h=je.find(M=>M.type===v.type),I=(h==null?void 0:h.icon)||je[0].icon,B=v.label||(h==null?void 0:h.label)||v.type,L=a===v.id,E=r.has(v.id);return e.jsxs("div",{children:[e.jsxs("div",{className:`flex items-center gap-1 px-1 py-1 rounded cursor-pointer text-[11px] transition-all group ${L?"bg-blue-500/20 text-blue-400 border-r-2 border-blue-500":"hover:bg-white/5 text-white/70"} ${v.hidden?"opacity-40":""}`,onClick:()=>s(v.id),children:[e.jsx("div",{className:"opacity-0 group-hover:opacity-60 cursor-grab active:cursor-grabbing shrink-0",children:e.jsx(fs,{className:"w-3 h-3"})}),e.jsx("button",{className:"shrink-0 p-0.5 rounded hover:bg-white/10",onClick:M=>{M.stopPropagation(),N(v.id)},children:E?e.jsx(Le,{className:"w-3 h-3 text-white/40"}):e.jsx(He,{className:"w-3 h-3 text-white/40"})}),e.jsx(I,{className:"w-3.5 h-3.5 shrink-0"}),e.jsx("span",{className:"flex-1 truncate",children:B}),e.jsx("button",{className:"p-0.5 rounded opacity-0 group-hover:opacity-100 hover:bg-white/10 transition-opacity shrink-0",onClick:M=>{M.stopPropagation(),j(v.id)},children:v.hidden?e.jsx(Je,{className:"w-3 h-3 text-white/40"}):e.jsx(Me,{className:"w-3 h-3 text-white/30"})})]}),!E&&e.jsx("div",{className:"mr-6 border-r border-white/5",children:e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-0.5 text-[9px] text-white/30",children:[e.jsx(I,{className:"w-2.5 h-2.5"}),e.jsx("span",{children:(h==null?void 0:h.label)||v.type})]})})]},v.id)})]})]})}const Xe="__empty__",Hs=t=>t&&t.length>0?t:Xe,Bs=t=>t===Xe?"":t;function Ya({style:t,onChange:a}){return e.jsx(We,{children:e.jsxs(qe,{className:"p-3 space-y-3",children:[e.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:"סגנון גלובלי לדף"}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"פונט ראשי"}),e.jsxs(C,{value:Hs(t.fontFamily),onValueChange:s=>a({fontFamily:Bs(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"ברירת מחדל"})}),e.jsxs(T,{children:[e.jsx(i,{value:Xe,children:"ברירת מחדל"}),e.jsx(i,{value:"'Assistant', sans-serif",children:"Assistant"}),e.jsx(i,{value:"'Heebo', sans-serif",children:"Heebo"}),e.jsx(i,{value:"'Rubik', sans-serif",children:"Rubik"}),e.jsx(i,{value:"'Noto Sans Hebrew', sans-serif",children:"Noto Sans Hebrew"}),e.jsx(i,{value:"'Open Sans', sans-serif",children:"Open Sans"}),e.jsx(i,{value:"'Montserrat', sans-serif",children:"Montserrat"}),e.jsx(i,{value:"'Frank Ruhl Libre', serif",children:"Frank Ruhl Libre"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"צבע רקע"}),e.jsx(m,{type:"color",value:t.bgColor||"#ffffff",onChange:s=>a({bgColor:s.target.value}),className:"h-8"})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"צבע טקסט"}),e.jsx(m,{type:"color",value:t.textColor||"#1a1a1a",onChange:s=>a({textColor:s.target.value}),className:"h-8"})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"צבע קישורים"}),e.jsx(m,{type:"color",value:t.linkColor||"#3b82f6",onChange:s=>a({linkColor:s.target.value}),className:"h-8"})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"רוחב מקסימלי"}),e.jsxs(C,{value:Hs(t.maxWidth),onValueChange:s=>a({maxWidth:Bs(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"מלא"})}),e.jsxs(T,{children:[e.jsx(i,{value:Xe,children:"מלא (100%)"}),e.jsx(i,{value:"960px",children:"960px"}),e.jsx(i,{value:"1140px",children:"1140px"}),e.jsx(i,{value:"1280px",children:"1280px"}),e.jsx(i,{value:"1440px",children:"1440px"})]})]})]})]})})}const Ws={he:{seo:"SEO",metaTitle:"כותרת (Meta Title)",metaTitlePlaceholder:"כותרת הדף למנועי חיפוש",metaDescription:"תיאור (Meta Description)",metaDescriptionPlaceholder:"תיאור קצר לתוצאות חיפוש",social:"שיתוף ברשתות (Open Graph)",ogTitle:"OG כותרת",ogTitlePlaceholder:"כותרת לשיתוף",ogDescription:"OG תיאור",ogDescriptionPlaceholder:"תיאור לשיתוף",ogImage:"OG תמונה (URL)",favicon:"Favicon (URL)",customCode:"קוד מותאם",headCode:"קוד בראש הדף (Head)",bodyCode:"קוד בתחתית הדף (Body)"},en:{seo:"SEO",metaTitle:"Title (Meta Title)",metaTitlePlaceholder:"Page title for search engines",metaDescription:"Description (Meta Description)",metaDescriptionPlaceholder:"Short description for search results",social:"Social Sharing (Ope
38n Graph)",ogTitle:"OG Title",ogTitlePlaceholder:"Title for sharing",ogDescription:"OG Description",ogDescriptionPlaceholder:"Description for sharing",ogImage:"OG Image (URL)",favicon:"Favicon (URL)",customCode:"Custom Code",headCode:"Code in page head (Head)",bodyCode:"Code at page bottom (Body)"},it:{seo:"SEO",metaTitle:"Titolo (Meta Title)",metaTitlePlaceholder:"Titolo della pagina per i motori di ricerca",metaDescription:"Descrizione (Meta Description)",metaDescriptionPlaceholder:"Breve descrizione per i risultati di ricerca",social:"Condivisione Social (Open Graph)",ogTitle:"Titolo OG",ogTitlePlaceholder:"Titolo per la condivisione",ogDescription:"Descrizione OG",ogDescriptionPlaceholder:"Descrizione per la condivisione",ogImage:"Immagine OG (URL)",favicon:"Favicon (URL)",customCode:"Codice personalizzato",headCode:"Codice nella testa della pagina (Head)",bodyCode:"Codice in fondo alla pagina (Body)"},fr:{seo:"SEO",metaTitle:"Titre (Meta Title)",metaTitlePlaceholder:"Titre de la page pour les moteurs de recherche",metaDescription:"Description (Meta Description)",metaDescriptionPlaceholder:"Courte description pour les résultats de recherche",social:"Partage social (Open Graph)",ogTitle:"Titre OG",ogTitlePlaceholder:"Titre pour le partage",ogDescription:"Description OG",ogDescriptionPlaceholder:"Description pour le partage",ogImage:"Image OG (URL)",favicon:"Favicon (URL)",customCode:"Code personnalisé",headCode:"Code dans l’en-tête de la page (Head)",bodyCode:"Code en bas de page (Body)"},pt:{seo:"SEO",metaTitle:"Título (Meta Title)",metaTitlePlaceholder:"Título da página para mecanismos de busca",metaDescription:"Descrição (Meta Description)",metaDescriptionPlaceholder:"Descrição curta para resultados de busca",social:"Compartilhamento Social (Open Graph)",ogTitle:"Título OG",ogTitlePlaceholder:"Título para compartilhamento",ogDescription:"Descrição OG",ogDescriptionPlaceholder:"Descrição para compartilhamento",ogImage:"Imagem OG (URL)",favicon:"Favicon (URL)",customCode:"Código personalizado",headCode:"Código no cabeçalho da página (Head)",bodyCode:"Código no final da página (Body)"}};function Ja({settings:t,onChange:a}){const{language:s}=ve(),j=Ws[s]??Ws.en;return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-[11px] font-semibold text-white/40 uppercase tracking-wider",children:j.seo}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] text-white/60",children:j.metaTitle}),e.jsx(m,{placeholder:j.metaTitlePlaceholder,value:t.meta_title||"",onChange:d=>a({meta_title:d.target.value}),className:"h-8 text-xs bg-white/5 border-white/10 text-white",maxLength:60}),e.jsxs("p",{className:"text-[9px] text-white/30 mt-0.5",children:[(t.meta_title||"").length,"/60"]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] text-white/60",children:j.metaDescription}),e.jsx(te,{placeholder:j.metaDescriptionPlaceholder,value:t.meta_description||"",onChange:d=>a({meta_description:d.target.value}),className:"text-xs bg-white/5 border-white/10 text-white",rows:3,maxLength:160}),e.jsxs("p",{className:"text-[9px] text-white/30 mt-0.5",children:[(t.meta_description||"").length,"/160"]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-[11px] font-semibold text-white/40 uppercase tracking-wider",children:j.social}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] text-white/60",children:j.ogTitle}),e.jsx(m,{placeholder:j.ogTitlePlaceholder,value:t.ogTitle||"",onChange:d=>a({ogTitle:d.target.value}),className:"h-8 text-xs bg-white/5 border-white/10 text-white"})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] text-white/60",children:j.ogDescription}),e.jsx(m,{placeholder:j.ogDescriptionPlaceholder,value:t.ogDescription||"",onChange:d=>a({ogDescription:d.target.value}),className:"h-8 text-xs bg-white/5 border-white/10 text-white"})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] text-white/60",children:j.ogImage}),e.jsx(m,{placeholder:"https://...",value:t.ogImage||"",onChange:d=>
38a({ogImage:d.target.value}),className:"h-8 text-xs bg-white/5 border-white/10 text-white",dir:"ltr"})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] text-white/60",children:j.favicon}),e.jsx(m,{placeholder:"https://...",value:t.favicon||"",onChange:d=>a({favicon:d.target.value}),className:"h-8 text-xs bg-white/5 border-white/10 text-white",dir:"ltr"})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-[11px] font-semibold text-white/40 uppercase tracking-wider",children:j.customCode}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] text-white/60",children:j.headCode}),e.jsx(te,{placeholder:"<script>...<\/script>",value:t.customHeadCode||"",onChange:d=>a({customHeadCode:d.target.value}),className:"text-xs font-mono bg-white/5 border-white/10 text-white",rows:4,dir:"ltr"})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] text-white/60",children:j.bodyCode}),e.jsx(te,{placeholder:"<script>...<\/script>",value:t.customBodyCode||"",onChange:d=>a({customBodyCode:d.target.value}),className:"text-xs font-mono bg-white/5 border-white/10 text-white",rows:4,dir:"ltr"})]})]})]})]})}const K="__empty__",Y=t=>t&&t.length>0?t:K,J=t=>t===K?"":t;function nt({style:t,onChange:a}){return e.jsx("div",{className:"border rounded-lg p-3 mb-3 bg-muted/30 space-y-3",dir:"rtl",children:e.jsxs(ms,{defaultValue:"colors",dir:"rtl",children:[e.jsxs(us,{className:"w-full grid grid-cols-5 h-8",children:[e.jsx(me,{value:"colors",className:"text-[10px] h-7",children:"צבעים"}),e.jsx(me,{value:"typography",className:"text-[10px] h-7",children:"טיפוגרפיה"}),e.jsx(me,{value:"spacing",className:"text-[10px] h-7",children:"ריווח"}),e.jsx(me,{value:"effects",className:"text-[10px] h-7",children:"אפקטים"}),e.jsx(me,{value:"advanced",className:"text-[10px] h-7",children:"מתקדם"})]}),e.jsxs(ue,{value:"colors",className:"mt-2 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"צבע רקע"}),e.jsx(m,{type:"color",value:t.bgColor||"#ffffff",onChange:s=>a({bgColor:s.target.value}),className:"h-8"})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"צבע טקסט"}),e.jsx(m,{type:"color",value:t.textColor||"#000000",onChange:s=>a({textColor:s.target.value}),className:"h-8"})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"גרדיאנט רקע"}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[e.jsx(m,{type:"color",value:t.bgGradientFrom||"#3b82f6",onChange:s=>a({bgGradientFrom:s.target.value}),className:"h-8",title:"מ..."}),e.jsx(m,{type:"color",value:t.bgGradientTo||"#7c3aed",onChange:s=>a({bgGradientTo:s.target.value}),className:"h-8",title:"ל..."}),e.jsxs(C,{value:Y(t.bgGradientAngle),onValueChange:s=>{const j=J(s);a({bgGradientAngle:j,bgGradient:j?"true":""})},children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"כיוון"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"ללא"}),e.jsx(i,{value:"135deg",children:"↘ אלכסוני"}),e.jsx(i,{value:"90deg",children:"→ אופקי"}),e.jsx(i,{value:"180deg",children:"↓ אנכי"}),e.jsx(i,{value:"45deg",children:"↗ אלכסוני הפוך"}),e.jsx(i,{value:"0deg",children:"↑ למעלה"}),e.jsx(i,{value:"270deg",children:"← שמאלה"})]})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"תמונת רקע"}),e.jsx(m,{placeholder:"URL תמונת רקע",value:t.bgImage||"",onChange:s=>a({bgImage:s.target.value}),className:"h-8 text-xs mt-1",dir:"ltr"}),t.bgImage&&e.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-1",children:[e.jsxs(C,{value:t.bgImageSize||"cover",onValueChange:s=>a({bgImageSize:s}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"cover",children:"Cover"}),e.jsx(i,{value:"contain",children:"Contain"}),e.jsx(i,{value:"auto",children:"Auto"})]})]}),e.jsxs(C,{value:t.bgImagePosition||"center",onValueChange:s=>a({bgImagePosition:s}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"center",children:"מרכז"}),e.jsx(i,{value:"top",children:"למעלה"}),e.jsx(i,{value:"bottom",children:"למטה"}),e.jsx(i,{value:"left",children:"שמאל"}),e.jsx(i,{value:"right",children:"ימין"})]})]})]})]}),(t.bgImage||t.bgVideo)&&e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"שכבת כיסוי (Overlay)"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-1",children:[e.jsx(m,{type:"color",value:t.bgOverlayColor||"#000000",onChange:s=>a({bgOverlayColor:s.target.value}),className:"h-8"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Re,{value:[parseInt(t.bgOverlayOpacity||"50")],min:0,max:100,step:5,onValueChange:([s])=>a({bgOverlayOpacity:String(s)}),className:"flex-1"}),e.jsxs("span",{className:"text-[10px] w-8",children:[t.bgOverlayOpacity||50,"%"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(be,{checked:t.bgParallax||!1,onCheckedChange:s=>a({bgParallax:s})}),e.jsx(g,{className:"text-[10px]",children:"אפקט Parallax"})]})]})]}),e.jsxs(ue,{value:"typography",className:"mt-2 space-y-2",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"פונט"}),e.jsxs(C,{value:Y(t.fontFamily),onValueChange:s=>a({fontFamily:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"ברירת מחדל"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"ברירת מחדל"}),e.jsx(i,{value:"'Assistant', sans-serif",children:"Assistant"}),e.jsx(i,{value:"'Heebo', sans-serif",children:"Heebo"}),e.jsx(i,{value:"'Rubik', sans-serif",children:"Rubik"}),e.jsx(i,{value:"'Noto Sans Hebrew', sans-serif",children:"Noto Sans Hebrew"}),e.jsx(i,{value:"'Open Sans', sans-serif",children:"Open Sans"}),e.jsx(i,{value:"'Montserrat', sans-serif",children:"Montserrat"}),e.jsx(i,{value:"'Playfair Display', serif",children:"Playfair Display"}),e.jsx(i,{value:"'Frank Ruhl Libre', serif",children:"Frank Ruhl Libre"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"גודל פונט"}),e.jsxs(C,{value:Y(t.fontSize),onValueChange:s=>a({fontSize:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"ברירת מחדל"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"ברירת מחדל"}),e.jsx(i,{value:"text-xs",children:"XS"}),e.jsx(i,{value:"text-sm",children:"קטן"}),e.jsx(i,{value:"text-base",children:"רגיל"}),e.jsx(i,{value:"text-lg",children:"גדול"}),e.jsx(i,{value:"text-xl",children:"XL"}),e.jsx(i,{value:"text-2xl",children:"2XL"}),e.jsx(i,{value:"text-3xl",children:"3XL"})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"עובי פונט"}),e.jsxs(C,{value:Y(t.fontWeight),onValueChange:s=>a({fontWeight:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"ברירת מחדל"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"ברירת מחדל"}),e.jsx(i,{value:"font-thin",children:"דקיק"}),e.jsx(i,{value:"font-light",children:"דק"}),e.jsx(i,{value:"font-normal",children:"רגיל"}),e.jsx(i,{value:"font-medium",children:"בינוני"}),e.jsx(i,{value:"font-semibold",children:"חצי עבה"}),e.jsx(i,{value:"font-bold",children:"עבה"}),e.jsx(i,{value:"font-black",children:"שחור"})]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"גובה שורה"}),e.jsxs(C,{value:Y(t.lineHeight),onValueChange:s=>a({lineHeight:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"ברירת מחדל"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"ברירת מחדל"}),e.jsx(i,{value:"leading-none",children:"צפוף (1)"}),e.jsx(i,{value:"leading-tight",children:"הדוק (1.25)"}),e.jsx(i,{value:"leading-snug",children:"מעט הדוק (1.375)"}),e.jsx(i,{value:"leading-normal",children:"רגיל (1.5)"}),e.jsx(i,{value:"leading-relaxed",children:"מרווח (1.625)"}),e.jsx(i,{value:"leading-loose",children:"רחב (2)"})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"ריווח אותיות"}),e.jsxs(C,{value:Y(t.letterSpacing),onValueChange:s=>a({letterSpacing:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"ברירת מחדל"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"ברירת מחדל"}),e.jsx(i,{value:"tracking-tighter",children:"צפוף מאוד"}),e.jsx(i,{value:"tracking-tight",children:"צפוף"}),e.jsx(i,{value:"tracking-normal",children:"רגיל"}),e.jsx(i,{value:"tracking-wide",children:"רחב"}),e.jsx(i,{value:"tracking-wider",children:"רחב יותר"}),e.jsx(i,{value:"tracking-widest",children:"רחב מאוד"})]})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"יישור טקסט"}),e.jsxs(C,{value:Y(t.textAlign),onValueChange:s=>a({textAlign:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"ברירת מחדל"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"ברירת מחדל"}),e.jsx(i,{value:"text-right",children:"ימין"}),e.jsx(i,{value:"text-center",children:"מרכז"}),e.jsx(i,{value:"text-left",children:"שמאל"}
38),e.jsx(i,{value:"text-justify",children:"מיושר"})]})]})]})]}),e.jsxs(ue,{value:"spacing",className:"mt-2 space-y-3",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"ריווח פנימי (Padding)"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-1",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"למעלה (px)"}),e.jsx(m,{type:"number",value:t.paddingTop||"32",onChange:s=>a({paddingTop:s.target.value}),className:"h-8 text-xs",min:"0"})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"למטה (px)"}),e.jsx(m,{type:"number",value:t.paddingBottom||"32",onChange:s=>a({paddingBottom:s.target.value}),className:"h-8 text-xs",min:"0"})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"ימין (px)"}),e.jsx(m,{type:"number",value:t.paddingRight||"24",onChange:s=>a({paddingRight:s.target.value}),className:"h-8 text-xs",min:"0"})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"שמאל (px)"}),e.jsx(m,{type:"number",value:t.paddingLeft||"24",onChange:s=>a({paddingLeft:s.target.value}),className:"h-8 text-xs",min:"0"})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"ריווח חיצוני (Margin)"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-1",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"למעלה (px)"}),e.jsx(m,{type:"number",value:t.marginTop||"0",onChange:s=>a({marginTop:s.target.value}),className:"h-8 text-xs"})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"למטה (px)"}),e.jsx(m,{type:"number",value:t.marginBottom||"0",onChange:s=>a({marginBottom:s.target.value}),className:"h-8 text-xs"})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"גבולות"}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[e.jsxs(C,{value:Y(t.borderWidth),onValueChange:s=>a({borderWidth:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"ללא"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"ללא"}),e.jsx(i,{value:"border",children:"דק"}),e.jsx(i,{value:"border-2",children:"בינוני"}),e.jsx(i,{value:"border-4",children:"עבה"})]})]}),e.jsx(m,{type:"color",value:t.borderColor||"#e5e7eb",onChange:s=>a({borderColor:s.target.value}),className:"h-8"}),e.jsxs(C,{value:Y(t.borderRadius),onValueChange:s=>a({borderRadius:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"ללא"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"ללא"}),e.jsx(i,{value:"rounded",children:"קטן"}),e.jsx(i,{value:"rounded-lg",children:"בינוני"}),e.jsx(i,{value:"rounded-xl",children:"גדול"}),e.jsx(i,{value:"rounded-2xl",children:"XL"}),e.jsx(i,{value:"rounded-3xl",children:"2XL"})]})]})]})]})]}),e.jsxs(ue,{value:"effects",className:"mt-2 space-y-3",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"צל"}),e.jsxs(C,{value:Y(t.boxShadow),onValueChange:s=>a({boxShadow:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"ללא"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"ללא"}),e.jsx(i,{value:"shadow-sm",children:"עדין"}),e.jsx(i,{value:"shadow",children:"רגיל"}),e.jsx(i,{value:"shadow-md",children:"בינוני"}),e.jsx(i,{value:"shadow-lg",children:"גדול"}),e.jsx(i,{value:"shadow-xl",children:"XL"}),e.jsx(i,{value:"shadow-2xl",children:"2XL"})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"אנימציית כניסה"}),e.jsxs(C,{value:Y(t.animation),onValueChange:s=>a({animation:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"ללא"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"ללא"}),e.jsx(i,{value:"fade-in",children:"Fade In"}),e.jsx(i,{value:"slide-up",children:"Slide Up"}),e.jsx(i,{value:"slide-right",children:"Slide Right"}),e.jsx(i,{value:"slide-left",children:"Slide Left"}),e.jsx(i,{value:"zoom-in",children:"Zoom In"}),e.jsx(i,{value:"bounce-in",children:"Bounce In"}),e.jsx(i,{value:"flip-in",children:"Flip In"})]})]}),t.animation&&e.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-1",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"משך (ms)"}),e.jsxs(C,{value:t.animationDuration||"600",onValueChange:s=>a({animationDuration:s}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"300",children:"מהיר (300ms)"}),e.jsx(i,{value:"600",children:"רגיל (600ms)"}),e.jsx(i,{value:"1000",children:"איטי (1s)"}),e.jsx(i,{value:"1500",children:"איטי מאוד (1.5s)"})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"השהיה (ms)"}),e.jsxs(C,{value:t.animationDelay||"0",onValueChange:s=>a({animationDelay:s}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"0",children:"ללא"}),e.jsx(i,{value:"200",children:"200ms"}),e.jsx(i,{value:"500",children:"500ms"}),e.jsx(i,{value:"1000",children:"1s"})]})]})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"Shape Divider"}),e.jsxs(C,{value:Y(t.shapeDivider),onValueChange:s=>a({shapeDivider:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"ללא"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"ללא"}),e.jsx(i,{value:"wave",children:"גל"}),e.jsx(i,{value:"triangle",children:"משולש"}),e.jsx(i,{value:"curve",children:"עקומה"}),e.jsx(i,{value:"tilt",children:"שיפוע"}),e.jsx(i,{value:"zigzag",children:"זיגזג"})]})]}),t.shapeDivider&&e.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[e.jsx(m,{type:"color",value:t.shapeDividerColor||"#ffffff",onChange:s=>a({shapeDividerColor:s.target.value}),className:"h-8"}),e.jsxs(C,{value:t.shapeDividerHeight||"40",onValueChange:s=>a({shapeDividerHeight:s}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"20",children:"קטן"}),e.jsx(i,{value:"40",children:"בינוני"}),e.jsx(i,{value:"60",children:"גדול"}),e.jsx(i,{value:"80",children:"ענק"})]})]}),e.jsxs(C,{value:t.shapeDividerPosition||"bottom",onValueChange:s=>a({shapeDividerPosition:s}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"top",children:"למעלה"}),e.jsx(i,{value:"bottom",children:"למטה"}),e.jsx(i,{value:"both",children:"שניהם"})]})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"אפקט תנועה (Motion)"}),e.jsxs(C,{value:Y(t.motionEffect),onValueChange:s=>a({motionEffect:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"ללא"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"ללא"}),e.jsx(i,{value:"floating",children:"ריחוף (Floating)"}),e.jsx(i,{value:"pulse-grow",children:"פעימה (Pulse)"}),e.jsx(i,{value:"rotate",children:"סיבוב (Rotate)"})]})]}),t.motionEffect&&e.jsxs(C,{value:t.motionSpeed||"normal",onValueChange:s=>a({motionSpeed:s}),children:[e.jsx(k,{className:"h-8 text-[10px] mt-1",children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"fast",children:"מהיר"}),e.jsx(i,{value:"normal",children:"רגיל"}),e.jsx(i,{value:"slow",children:"איטי"})]})]})]})]}),e.jsxs(ue,{value:"advanced",className:"mt-2 space-y-3",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"גובה מינימלי"}),e.jsxs(C,{value:Y(t.minHeight),onValueChange:s=>a({minHeight:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"אוטומטי"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"אוטומטי"}),e.jsx(i,{value:"200px",children:"200px"}),e.jsx(i,{value:"300px",children:"300px"}),e.jsx(i,{value:"400px",children:"400px"}),e.jsx(i,{value:"500px",children:"500px"}),e.jsx(i,{value:"100vh",children:"מסך מלא (100vh)"}),e.jsx(i,{value:"80vh",children:"80vh"}),e.jsx(i,{value:"50vh",children:"50vh"})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"יישור אנכי תוכן"}),e.jsxs(C,{value:Y(t.verticalAlign),onValueChange:s=>a({verticalAlign:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"למעלה"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"למעלה (Start)"}),e.jsx(i,{value:"center",children:"מרכז (Center)"}),e.jsx(i,{value:"end",children:"למטה (End)"}),e.jsx(i,{value:"stretch",children:"מתיחה (Stretch)"})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"וידאו רקע"}),e.jsx(m,{placeholder:"URL לווידאו (mp4)",value:t.bgVideo||"",onChange:s=>a({bgVideo:s.target.value}),className:"h-8 text-xs mt-1",dir:"ltr"}),t.bgVideo&&e.jsxs("div",{className:"flex items-center gap-4 mt-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(be,{checked:t.bgVideoLoop!==!1,onCheckedChange:s=>a({bgVideoLoop:s})}),e.jsx(g,{className:"text-[10px]",children:"לופ"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(be,{checked:t.bgVideoMuted!==!1,onCheckedChange:s=>a({bgVideoMuted:s})}),e.jsx(g,{className:"text-[10px]",children:"ללא שמע"})]})]})]}),e.jsx("div",{children:e.jsx(m,{placeholder:"my-section",value:t.anchorId||"",onChange:s=>a({anchorId:s.target.value}),className:"h-8 text-xs mt-1",dir:"ltr"})}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"רוחב סקשן"}),e.jsxs(C,{value:Y(t.sectionWidth),onValueChange:s=>a({sectionWidth:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"מלא"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"מלא (100%)"}),e.jsx(i,{value:"boxed-960",children:"Boxed 960px"}),e.jsx(i,{value:"boxed-1140",children:"Boxed 1140px"}),e.jsx(i,{value:"boxed-1280",children:"Boxed 1280px"})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"מיקום (Position)"}),e.jsxs(C,{value:Y(t.position),onValueChange:s=>a({position:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"רגיל"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"רגיל (Static)"}),e.jsx(i,{value:"sticky",children:"דביק (Sticky)"}),e.jsx(i,{value:"fixed",children:"קבוע (Fixed)"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"Z-Index"}),e.jsx(m,{type:"number",value:t.zIndex||"",onChange:s=>a({zIndex:s.target.value}),className:"h-8 text-xs",placeholder:"אוטומטי",min:"0",max:"999"})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"שקיפות"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Re,{value:[parseInt(t.opacity||"100")],min:0,max:100,step:5,onValueChange:([s])=>a({opacity:String(s)}),className:"flex-1"}),e.jsxs("span",{className:"text-[10px] w-8",children:[t.opacity||100,"%"]})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"Overflow"}),e.jsxs(C,{value:Y(t.overflow),onValueChange:s=>a({overflow:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"רגיל"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"רגיל (Visible)"}),e.jsx(i,{value:"hidden",children:"מוסתר (Hidden)"}),e.jsx(i,{value:"auto",children:"אוטומטי (Auto)"})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"אפקט Hover"}),e.jsxs(C,{value:Y(t.hoverEffect),onValueChange:s=>a({hoverEffect:J(s)}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"ללא"})}),e.jsxs(T,{children:[e.jsx(i,{value:K,children:"ללא"}),e.jsx(i,{value:"scale",children:"הגדלה (Scale)"}),e.jsx(i,{value:"shadow",children:"צל מורחב"}),e.jsx(i,{value:"brightness",children:"בהירות"}
38),e.jsx(i,{value:"lift",children:"הרמה (Lift)"})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"CSS מותאם"}),e.jsx(te,{placeholder:`/* CSS מותאם לסקשן */
39color: red;
40background: #f00;`,value:t.customCSS||"",onChange:s=>a({customCSS:s.target.value}),rows:5,className:"text-xs font-mono mt-1",dir:"ltr"})]})]})]})})}function ct({style:t,onChange:a}){const[s,j]=D.useState("tablet"),d=t.responsiveOverrides||{},l=d[s]||{},r=n=>{const o={...d,[s]:{...l,...n}};a({responsiveOverrides:o})};return e.jsxs("div",{className:"border rounded-lg p-3 mb-3 bg-muted/30 space-y-3",dir:"rtl",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(g,{className:"text-xs font-semibold",children:"עריכה רספונסיבית"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(_,{variant:s==="tablet"?"default":"outline",size:"icon",className:"h-7 w-7",onClick:()=>j("tablet"),children:e.jsx(Ee,{className:"w-3.5 h-3.5"})}),e.jsx(_,{variant:s==="mobile"?"default":"outline",size:"icon",className:"h-7 w-7",onClick:()=>j("mobile"),children:e.jsx(ze,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["שינויים אלו יחולו רק ב-",s==="tablet"?"טאבלט":"מובייל"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(be,{checked:l.hidden||!1,onCheckedChange:n=>r({hidden:n})}),e.jsxs(g,{className:"text-[10px]",children:["הסתר ב-",s==="tablet"?"טאבלט":"מובייל"]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"גודל פונט"}),e.jsxs(C,{value:l.fontSize||"__inherit__",onValueChange:n=>r({fontSize:n==="__inherit__"?void 0:n}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"כמו דסקטופ"})}),e.jsxs(T,{children:[e.jsx(i,{value:"__inherit__",children:"כמו דסקטופ"}),e.jsx(i,{value:"text-xs",children:"XS"}),e.jsx(i,{value:"text-sm",children:"קטן"}),e.jsx(i,{value:"text-base",children:"רגיל"}),e.jsx(i,{value:"text-lg",children:"גדול"}),e.jsx(i,{value:"text-xl",children:"XL"}),e.jsx(i,{value:"text-2xl",children:"2XL"})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"יישור טקסט"}),e.jsxs(C,{value:l.textAlign||"__inherit__",onValueChange:n=>r({textAlign:n==="__inherit__"?void 0:n}),children:[e.jsx(k,{className:"h-8 text-[10px]",children:e.jsx(S,{placeholder:"כמו דסקטופ"})}),e.jsxs(T,{children:[e.jsx(i,{value:"__inherit__",children:"כמו דסקטופ"}),e.jsx(i,{value:"text-right",children:"ימין"}),e.jsx(i,{value:"text-center",children:"מרכז"}),e.jsx(i,{value:"text-left",children:"שמאל"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"Padding למעלה (px)"}),e.jsx(m,{type:"number",value:l.paddingTop||"",placeholder:"כמו דסקטופ",onChange:n=>r({paddingTop:n.target.value||void 0}),className:"h-8 text-xs",min:"0"})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"Padding למטה (px)"}),e.jsx(m,{type:"number",value:l.paddingBottom||"",placeholder:"כמו דסקטופ",onChange:n=>r({paddingBottom:n.target.value||void 0}),className:"h-8 text-xs",min:"0"})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"Padding ימין (px)"}),e.jsx(m,{type:"number",value:l.paddingRight||"",placeholder:"כמו דסקטופ",onChange:n=>r({paddingRight:n.target.value||void 0}),className:"h-8 text-xs",min:"0"})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"Padding שמאל (px)"}),e.jsx(m,{type:"number",value:l.paddingLeft||"",placeholder:"כמו דסקטופ",onChange:n=>r({paddingLeft:n.target.value||void 0}),className:"h-8 text-xs",min:"0"})]})]})]})}const Ge="landing-media",rs=2,Qa=rs*1024*1024,qs=["image/jpeg","image/png","image/webp","image/gif","image/svg+xml"];function Ua({open:t,onOpenChange:a,onSelect:s}){const[j,d]=D.useState([]),[l,r]=D.useState(!1),[n,o]=D.useState(!1),[b,N]=D.useState(""),p=D.useCallback(async()=>{r(!0);const{data:L,error:E}=await ee.storage.from(Ge).list("",{limit:200,sortBy:{column:"created_at",order:"desc"}});E?console.error("Error listing media:",E):d(L||[]),r(!1)},[]);D.useEffect(()=>{t&&p()},[t,p]);const v=L=>{const{data:E}=ee.storage.from(Ge).getPublicUrl(L);return E.publicUrl},h=async L=>{const E=L.target.files;if(!(E!=null&&E.length))return;o(!0);let M=0;for(const G of Array.from(E)){if(!qs.includes(G.type)){V.error(`${G.name}: סוג קובץ לא נתמך`);continue}if(G.size>Qa){V.error(`${G.name}: גודל מקסימלי ${rs}MB`);continue}const z=G.name.split(".").pop(),Z=`${Date.now()}-${Math.random().toString(36).slice(2,8)}.${z}`,{error:w}=await ee.storage.from(Ge).upload(Z,G,{contentType:G.type});w?(V.error(`שגיאה בהעלאת ${G.name}`),console.error(w)):M++}M>0&&(V.success(`${M} קבצים הועלו`),p()),o(!1),L.target.value=""},I=async L=>{const{error:E}=await ee.storage.from(Ge).remove([L]);E?V.error("שגיאה במחיקה"):(V.success("הקובץ נמחק"),d(M=>M.filter(G=>
40G.name!==L)))},B=j.filter(L=>!b||L.name.toLowerCase().includes(b.toLowerCase()));return e.jsx(ns,{open:t,onOpenChange:a,children:e.jsxs(cs,{dir:"rtl",className:"sm:max-w-2xl max-h-[80vh] flex flex-col",children:[e.jsx(os,{children:e.jsxs(ds,{className:"flex items-center gap-2",children:[e.jsx(Fe,{className:"w-5 h-5"}),"ספריית מדיה"]})}),e.jsxs(ms,{defaultValue:"library",className:"flex-1 flex flex-col min-h-0",children:[e.jsxs(us,{className:"grid w-full grid-cols-2",children:[e.jsx(me,{value:"library",children:"ספרייה"}),e.jsx(me,{value:"upload",children:"העלאה"})]}),e.jsxs(ue,{value:"library",className:"flex-1 flex flex-col min-h-0 space-y-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx(hs,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(m,{placeholder:"חיפוש...",value:b,onChange:L=>N(L.target.value),className:"pr-9"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:l?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(es,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):B.length===0?e.jsx("div",{className:"text-center py-12 text-muted-foreground text-sm",children:j.length===0?"אין תמונות בספרייה. העלה תמונות כדי להתחיל.":"לא נמצאו תוצאות"}):e.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 gap-2",children:B.map(L=>{const E=v(L.name);return e.jsxs("div",{className:"group relative aspect-square rounded-lg border overflow-hidden cursor-pointer hover:ring-2 hover:ring-primary transition-all bg-muted",onClick:()=>{s(E),a(!1)},children:[e.jsx("img",{src:E,alt:L.name,className:"w-full h-full object-cover",loading:"lazy"}),e.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/40 transition-colors flex items-center justify-center opacity-0 group-hover:opacity-100",children:e.jsx("span",{className:"text-white text-xs font-medium",children:"בחר"})}),e.jsx("button",{onClick:M=>{M.stopPropagation(),I(L.name)},className:"absolute top-1 left-1 w-6 h-6 rounded bg-red-500/80 text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-600",children:e.jsx(U,{className:"w-3 h-3"})})]},L.name)})})})]}),e.jsx(ue,{value:"upload",className:"space-y-4",children:e.jsxs("div",{className:"border-2 border-dashed rounded-xl p-8 text-center space-y-3",children:[e.jsx(Be,{className:"w-10 h-10 mx-auto text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"גרור תמונות לכאן או לחץ לבחירה"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["JPG, PNG, WebP, GIF, SVG — עד ",rs,"MB לקובץ"]})]}),e.jsxs("label",{children:[e.jsx("input",{type:"file",accept:qs.join(","),multiple:!0,onChange:h,className:"hidden"}),e.jsx(_,{variant:"outline",size:"sm",asChild:!0,disabled:n,children:e.jsxs("span",{className:"cursor-pointer gap-2",children:[n?e.jsx(es,{className:"w-4 h-4 animate-spin"}):e.jsx(Be,{className:"w-4 h-4"}),n?"מעלה...":"בחר קבצים"]})})]})]})})]})]})})}function ot({section:t,onUpdate:a}){const s=t.content||{},[j,d]=D.useState(!1);switch(t.type){case"hero":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{placeholder:"כותרת ראשית",value:s.title||"",onChange:l=>a({...s,title:l.target.value})}),e.jsx(m,{placeholder:"כותרת משנית",value:s.subtitle||"",onChange:l=>a({...s,subtitle:l.target.value})}),e.jsx(m,{placeholder:"טקסט כפתור",value:s.cta||"",onChange:l=>a({...s,cta:l.target.value})}),e.jsx(m,{placeholder:"URL רקע",value:s.bgImage||"",onChange:l=>a({...s,bgImage:l.target.value})})]});case"text":return e.jsx(te,{placeholder:"תוכן טקסט",value:s.text||"",onChange:l=>a({...s,text:l.target.value}),rows:4});case"heading":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{placeholder:"טקסט כותרת",value:s.text||"",onChange:l=>a({...s,text:l.target.value})}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs(C,{value:s.level||"h2",onValueChange:l=>a({...s,level:l}),children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"h1",children:"H1"}),e.jsx(i,{value:"h2",children:"H2"}),e.jsx(i,{value:"h3",children:"H3"}),e.jsx(i,{value:"h4",children:"H4"})]})]}),e.jsxs(C,{value:s.align||"center",onValueChange:l=>a({...s,align:l}),children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"right",children:"ימין"}),e.jsx(i,{value:"center",children:"מרכז"}),e.jsx(i,{value:"left",children:"שמאל"})]})]})]})]});case"image":return e.jsxs("div",{className:"space-y-2",children:[s.src&&e.jsx("div",{className:"relative rounded-lg overflow-hidden border bg-muted aspect-video",children:e.jsx("img",{src:s.src,alt:s.alt||"",className:"w-full h-full object-contain"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(_,{variant:"outline",size:"sm",className:"flex-1 gap-1.5 text-xs",onClick:()=>d(!0),children:[e.jsx(Fe,{className:"w-3.5 h-3.5"}),"ספריית מדיה"]}),e.jsxs("label",{className:"flex-1",children:[e.jsx("input",{type:"file",accept:"image/jpeg,image/png,image/webp,image/gif,image/svg+xml",className:"hidden",onChange:async l=>{var p;
40const r=(p=l.target.files)==null?void 0:p[0];if(!r)return;if(r.size>2*1024*1024){V.error("גודל מקסימלי 2MB");return}const n=r.name.split(".").pop(),o=`${Date.now()}-${Math.random().toString(36).slice(2,8)}.${n}`,{error:b}=await ee.storage.from("landing-media").upload(o,r,{contentType:r.type});if(b){V.error("שגיאה בהעלאה");return}const{data:N}=ee.storage.from("landing-media").getPublicUrl(o);a({...s,src:N.publicUrl}),V.success("התמונה הועלתה"),l.target.value=""}}),e.jsx(_,{variant:"outline",size:"sm",className:"w-full gap-1.5 text-xs",asChild:!0,children:e.jsxs("span",{className:"cursor-pointer",children:[e.jsx(Be,{className:"w-3.5 h-3.5"}),"העלה תמונה"]})})]})]}),e.jsx(Ua,{open:j,onOpenChange:d,onSelect:l=>a({...s,src:l})}),e.jsx(m,{placeholder:"או הדבק URL תמונה",value:s.src||"",onChange:l=>a({...s,src:l.target.value}),dir:"ltr",className:"text-xs"}),e.jsx(m,{placeholder:"Alt text",value:s.alt||"",onChange:l=>a({...s,alt:l.target.value})}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"רוחב"}),e.jsxs(C,{value:s.width||"100%",onValueChange:l=>a({...s,width:l}),children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"100%",children:"מלא"}),e.jsx(i,{value:"75%",children:"75%"}),e.jsx(i,{value:"50%",children:"50%"}),e.jsx(i,{value:"300px",children:"300px"}),e.jsx(i,{value:"200px",children:"200px"})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"יישור"}),e.jsxs(C,{value:s.align||"center",onValueChange:l=>a({...s,align:l}),children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"center",children:"מרכז"}),e.jsx(i,{value:"left",children:"שמאל"}),e.jsx(i,{value:"right",children:"ימין"})]})]})]})]}),e.jsx(m,{placeholder:"קישור (URL)",value:s.link||"",onChange:l=>a({...s,link:l.target.value}),dir:"ltr"}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"עיגול פינות (px)"}),e.jsx(Re,{value:[parseInt(s.borderRadius||"8")],min:0,max:50,step:2,onValueChange:([l])=>a({...s,borderRadius:String(l)})})]})]});case"form":{const l=s.formFields||(s.fields?s.fields.split(",").map((p,v)=>({id:`f${v}`,label:p.trim(),type:"text",required:!1})):[]),r=[{value:"text",label:"טקסט"},{value:"email",label:"אימייל"},{value:"tel",label:"טלפון"},{value:"textarea",label:"טקסט ארוך"},{value:"select",label:"בחירה מרשימה"},{value:"checkbox",label:"Checkbox"},{value:"radio",label:"בחירה יחידה (Radio)"}],n=(p,v)=>{const h=[...l];h[p]={...h[p],...v},a({...s,formFields:h,fields:void 0})},o=()=>{const p=[...l,{id:`f${Date.now()}`,label:"",type:"text",required:!1}];a({...s,formFields:p,fields:void 0})},b=p=>{const v=l.filter((h,I)=>I!==p);a({...s,formFields:v,fields:void 0})},N=(p,v)=>{const h=[...l],I=p+v;I<0||I>=h.length||([h[p],h[I]]=[h[I],h[p]],a({...s,formFields:h,fields:void 0}))};return e.jsxs("div",{className:"space-y-3",children:[e.jsx(m,{placeholder:"כותרת טופס",value:s.title||"",onChange:p=>a({...s,title:p.target.value})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{className:"text-[11px] font-semibold",children:"שדות הטופס"}),l.map((p,v)=>e.jsxs("div",{className:"border border-white/10 rounded-lg p-2 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(m,{placeholder:"שם השדה",value:p.label||"",onChange:h=>n(v,{label:h.target.value}),className:"h-7 text-xs flex-1"}),e.jsx("button",{onClick:()=>N(v,-1),className:"p-1 text-white/40 hover:text-white",title:"הזז למעלה",children:"↑"}),e.jsx("button",{onClick:()=>N(v,1),className:"p-1 text-white/40 hover:text-white",title:"הזז למטה",children:"↓"}),e.jsx("button",{onClick:()=>b(v),className:"p-1 text-red-400/60 hover:text-red-400",title:"מחק",children:e.jsx(U,{className:"w-3 h-3"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(C,{value:p.type||"text",onValueChange:h=>n(v,{type:h,options:h==="select"||h==="radio"?p.options||"אפשרות 1,אפשרות 2":void 0}),children:[e.jsx(k,{className:"h-7 text-[10px] flex-1",children:e.jsx(S,{})}),e.jsx(T,{children:r.map(h=>e.jsx(i,{value:h.value,children:h.label},h.value))})]}),e.jsxs("label",{className:"flex items-center gap-1 text-[10px] text-white/60 whitespace-nowrap cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:p.required||!1,onChange:h=>n(v,{required:h.target.checked}),className:"w-3 h-3"}),"חובה"]})]}),(p.type==="select"||p.type==="radio")&&e.jsx(m,{placeholder:"אפשרויות (מופרדות בפסיקים)",value:p.options||"",onChange:h=>n(v,{options:h.target.value}),className:"h-7 text-[10px]"}),p.type==="checkbox"&&e.jsx(m,{placeholder:"טקסט הסכמה (למשל: מאשר/ת קבלת עדכונים)",value:p.checkboxLabel||"",onChange:h=>n(v,{checkboxLabel:h.target.value}),className:"h-7 text-[10px]"}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsxs("label",{className:"flex items-center gap-1 text-[10px] text-white/50 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:!!p.condition,onChange:h=>n(v,{condition:h.target.checked?{fieldId:"",value:""}:void 0}),className:"w-3 h-3"}),"הצג בתנאי"]})}),p.condition&&e.jsxs("div",{className:"flex gap-1 items-center",children:[e.jsxs(C,{value:p.condition.fieldId||"",onValueChange:h=>n(v,{condition:{...p.condition,fieldId:h}}),children:[e.jsx(k,{className:"h-6 text-[10px] flex-1",children:e.jsx(S,{placeholder:"בחר שדה"})}),e.jsx(T,{children:l.filter((h,I)=>I!==v).map(h=>e.jsx(i,{value:h.id,children:h.label||"שדה ללא שם"},h.id))})]}),e.jsx("span",{className:"text-[10px] text-white/40",children:"="}),e.jsx(m,{placeholder:"ערך",value:p.condition.value||"",onChange:h=>n(v,{condition:{...p.condition,value:h.target.value}}),className:"h-6 text-[10px] flex-1"})]})]},p.id||v)),e.jsxs(_,{variant:"outline",size:"sm",className:"w-full text-xs gap-1",onClick:o,children:[e.jsx(se,{className:"w-3 h-3"})," הוסף שדה"]})]}),e.jsx(m,{placeholder:"טקסט כפתור שליחה",value:s.submitText||"",onChange:p=>a({...s,submitText:p.target.value})}),e.jsx(m,{placeholder:"הודעת הצלחה",value:s.successMessage||"",onChange:p=>a({...s,successMessage:p.target.value})}),e.jsx(m,{placeholder:"Webhook URL (אופציונלי)",value:s.webhookUrl||"",onChange:p=>a({...s,webhookUrl:p.target.value}),dir:"ltr"}),e.jsx(m,{placeholder:"URL הפניה לאחר שליחה",value:s.redirectUrl||"",onChange:p=>a({...s,redirectUrl:p.target.value}),dir:"ltr"}),e.jsx(m,{placeholder:"אימייל לקבלת התראות",value:s.notifyEmail||"",onChange:p=>a({...s,notifyEmail:p.target.value}),dir:"ltr"})]})}case"columns":return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs(C,{value:String(s.columnCount||2),onValueChange:l=>a({...s,columnCount:parseInt(l)}
40),children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"2",children:"2 עמודות"}),e.jsx(i,{value:"3",children:"3 עמודות"}),e.jsx(i,{value:"4",children:"4 עמודות"})]})]}),e.jsxs(C,{value:s.columnRatio||"equal",onValueChange:l=>a({...s,columnRatio:l}),children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"equal",children:"שווה"}),e.jsx(i,{value:"60-40",children:"60/40"}),e.jsx(i,{value:"40-60",children:"40/60"}),e.jsx(i,{value:"70-30",children:"70/30"}),e.jsx(i,{value:"30-70",children:"30/70"}),(s.columnCount||2)>=3&&e.jsx(i,{value:"25-50-25",children:"25/50/25"}),(s.columnCount||2)>=3&&e.jsx(i,{value:"50-25-25",children:"50/25/25"})]})]})]}),Array.from({length:s.columnCount||2}).map((l,r)=>e.jsxs("div",{className:"border rounded p-2 space-y-1",children:[e.jsx(m,{placeholder:`כותרת עמודה ${r+1}`,value:s[`col${r+1}Title`]||"",onChange:n=>a({...s,[`col${r+1}Title`]:n.target.value})}),e.jsx(m,{placeholder:`טקסט עמודה ${r+1}`,value:s[`col${r+1}Text`]||"",onChange:n=>a({...s,[`col${r+1}Text`]:n.target.value})})]},r))]});case"cta":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{placeholder:"כותרת",value:s.title||"",onChange:l=>a({...s,title:l.target.value})}),e.jsx(m,{placeholder:"טקסט כפתור",value:s.buttonText||"",onChange:l=>a({...s,buttonText:l.target.value})}),e.jsx(m,{placeholder:"קישור",value:s.buttonUrl||"",onChange:l=>a({...s,buttonUrl:l.target.value})})]});case"button":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{placeholder:"טקסט כפתור",value:s.text||"",onChange:l=>a({...s,text:l.target.value})}),e.jsx(m,{placeholder:"קישור",value:s.url||"",onChange:l=>a({...s,url:l.target.value}),dir:"ltr"}),e.jsx(m,{placeholder:"אייקון (אימוג'י)",value:s.icon||"",onChange:l=>a({...s,icon:l.target.value})}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsxs(C,{value:s.variant||"primary",onValueChange:l=>a({...s,variant:l}),children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"primary",children:"ראשי"}),e.jsx(i,{value:"secondary",children:"משני"}),e.jsx(i,{value:"outline",children:"מתאר"}),e.jsx(i,{value:"gradient",children:"גרדיאנט"})]})]}),e.jsxs(C,{value:s.size||"md",onValueChange:l=>a({...s,size:l}),children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"sm",children:"קטן"}),e.jsx(i,{value:"md",children:"בינוני"}),e.jsx(i,{value:"lg",children:"גדול"}),e.jsx(i,{value:"xl",children:"ענק"})]})]}),e.jsxs(C,{value:s.target||"_self",onValueChange:l=>a({...s,target:l}),children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"_self",children:"אותו חלון"}),e.jsx(i,{value:"_blank",children:"חלון חדש"})]})]})]})]});case"divider":return e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs(C,{value:s.style||"solid",onValueChange:l=>a({...s,style:l}),children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"solid",children:"רציף"}),e.jsx(i,{value:"dashed",children:"מקווקו"}),e.jsx(i,{value:"dotted",children:"נקודות"}),e.jsx(i,{value:"double",children:"כפול"})]})]}),e.jsxs(C,{value:s.thickness||"1",onValueChange:l=>a({...s,thickness:l}),children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"1",children:"דק"}),e.jsx(i,{value:"2",children:"בינוני"}),e.jsx(i,{value:"4",children:"עבה"})]})]})]});case"spacer":return e.jsxs(C,{value:s.height||"40",onValueChange:l=>a({...s,height:l}),children:[e.jsx(k,{className:"w-40",children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"20",children:"קטן (20px)"}),e.jsx(i,{value:"40",children:"בינוני (40px)"}),e.jsx(i,{value:"60",children:"גדול (60px)"}),e.jsx(i,{value:"100",children:"ענק (100px)"})]})]});case"icon-box":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{placeholder:"אימוג'י / אייקון",value:s.icon||"",onChange:l=>a({...s,icon:l.target.value})}),e.jsx(m,{placeholder:"כותרת",value:s.title||"",onChange:l=>a({...s,title:l.target.value})}),e.jsx(te,{placeholder:"תיאור",value:s.description||"",onChange:l=>a({...s,description:l.target.value}),rows:2})]});case"video":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{placeholder:"URL וידאו (YouTube / Vimeo / MP4)",value:s.url||"",onChange:l=>a({...s,url:l.target.value}),dir:"ltr"}),e.jsxs(C,{value:s.type||"youtube",onValueChange:l=>a({...s,type:l}),children:[e.jsx(k,{className:"w-40",children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"youtube",children:"YouTube"}),e.jsx(i,{value:"vimeo",children:"Vimeo"}),e.jsx(i,{value:"mp4",children:"MP4"})]})]})]});case"countdown":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{placeholder:"כותרת",value:s.title||"",onChange:l=>a({...s,title:l.target.value})}),e.jsx(m,{type:"datetime-local",value:s.targetDate||"",onChange:l=>a({...s,targetDate:l.target.value}),dir:"ltr"})]});case"quote":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{placeholder:"טקסט הציטוט",value:s.text||"",onChange:l=>a({...s,text:l.target.value}),rows:3}),e.jsx(m,{placeholder:"מחבר",value:s.author||"",onChange:l=>a({...s,author:l.target.value})}),e.jsx(m,{placeholder:"תפקיד",value:s.role||"",onChange:l=>a({...s,role:l.target.value})})]});case"contact-info":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{placeholder:"טלפון",value:s.phone||"",onChange:l=>a({...s,phone:l.target.value})}),e.jsx(m,{placeholder:"אימייל",value:s.email||"",onChange:l=>a({...s,email:l.target.value})}),e.jsx(m,{placeholder:"כתובת",value:s.address||"",onChange:l=>a({...s,address:l.target.value})}),e.jsx(m,{placeholder:"WhatsApp",value:s.whatsapp||"",onChange:l=>a({...s,whatsapp:l.target.value})})]});case"opening-hours":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{placeholder:"כותרת",value:s.title||"",onChange:l=>a({...s,title:l.target.value})}),e.jsx(ge,{items:s.items||[],fields:["day","hours"],labels:["יום","שעות"],onChange:l=>a({...s,items:l})})]});case"social-icons":return e.jsxs("div",{className:"space-y-2",children:[(s.items||[]).map((l,r)=>e.jsxs("div",{className:"flex gap-1",children:[e.jsxs(C,{value:l.platform||"facebook",onValueChange:n=>{const o=[...s.items||[]];o[r]={...o[r],platform:n},a({...s,items:o})},children:[e.jsx(k,{className:"w-28",children:e.jsx(S,{})}),e.jsx(T,{children:["facebook","instagram","twitter","linkedin","youtube","tiktok","whatsapp","telegram"].map(n=>e.jsx(i,{value:n,children:n},n))})]}),e.jsx(m,{placeholder:"URL",value:l.url||"",onChange:n=>{const o=[...s.items||[]];o[r]={...o[r],url:n.target.value},a({...s,items:o})},dir:"ltr",className:"flex-1"}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0",onClick:()=>{const n=(s.items||[]).filter((o,b)=>b!==r);a({...s,items:n.length?n:[{platform:"facebook",url:""}]})},children:e.jsx(U,{className:"w-3 h-3"})})]},r)),e.jsxs(_,{variant:"outline",size:"sm",className:"gap-1",onClick:()=>a({...s,items:[...s.items||[],{platform:"facebook",url:""}]}),children:[e.jsx(se,{className:"w-3 h-3"})," הוסף רשת"]})]});case"pricing":return e.jsxs("div",{className:"space-y-2",children:[(s.items||[]).map((l,r)=>e.jsxs("div",{className:"border rounded p-2 space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["תוכנית #",r+1]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{className:"text-[10px]",children:"מודגש"}),e.jsx(be,{checked:l.highlighted||!1,onCheckedChange:n=>{const o=[...s.items];o[r]={...o[r],highlighted:n},a({...s,items:o})}}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>{const n=s.items.filter((o,b)=>b!==r);a({...s,items:n})},children:e.jsx(U,{className:"w-3 h-3"})})]})]}),e.jsx(m,{placeholder:"שם תוכנית",value:l.name||"",onChange:n=>{const o=[...s.items];o[r]={...o[r],name:n.target.value},a({...s,items:o})}}),e.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[e.jsx(m,{placeholder:"מחיר",value:l.price||"",onChange:n=>{const o=[...s.items];o[r]={...o[r],price:n.target.value},a({...s,items:o})}}),e.jsx(m,{placeholder:"תקופה",value:l.period||"",onChange:n=>{const o=[...s.items];o[r]={...o[r],period:n.target.value},a({...s,items:o})}})]}),e.jsx(te,{placeholder:"תכונות (שורה לכל תכונה)",value:(l.features||[]).join(`
41`),onChange:n=>{const o=[...s.items];o[r]={...o[r],features:n.target.value.split(`
42`)},a({...s,items:o})},rows:3}),e.jsx(m,{placeholder:"טקסט כפתור",value:l.cta||"",onChange:n=>{const o=[...s.items];o[r]={...o[r],cta:n.target.value},a({...s,items:o})}})]},r)),e.jsxs(_,{variant:"outline",size:"sm",className:"gap-1",onClick:()=>a({...s,items:[...s.items||[],{name:"",price:"",period:"/חודש",features:[],cta:"התחל",highlighted:!1}]}),children:[e.jsx(se,{className:"w-3 h-3"})," הוסף תוכנית"]})]});case"counter":return e.jsx(ge,{items:s.items||[],fields:["number","label","suffix"],labels:["מספר","תווית","סיומת"],onChange:l=>a({...s,items:l})});case"progress-bar":return e.jsxs("div",{className:"space-y-2",children:[(s.items||[]).map((l,r)=>e.jsxs("div",{className:"border rounded p-2 space-y-1",children:[e.jsxs("div",{className:"flex gap-1",children:[e.jsx(m,{placeholder:"תווית",value:l.label||"",onChange:n=>{const o=[...s.items||[]];o[r]={...o[r],label:n.target.value},a({...s,items:o})},className:"flex-1"}),e.jsxs("span",{className:"text-xs self-center w-10 text-center",children:[l.value||0,"%"]}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0",onClick:()=>{const n=(s.items||[]).filter((o,b)=>b!==r);a({...s,items:n})},children:e.jsx(U,{className:"w-3 h-3"})})]}),e.jsx(Re,{value:[l.value||0],min:0,max:100,step:5,onValueChange:([n])=>{const o=[...s.items||[]];o[r]={...o[r],value:n},a({...s,items:o})}})]},r)),e.jsxs(_,{variant:"outline",size:"sm",className:"gap-1",onClick:()=>a({...s,items:[...s.items||[],{label:"",value:50}]}),children:[e.jsx(se,{className:"w-3 h-3"})," הוסף מד"]})]});case"gallery":return e.jsxs("div",{className:"space-y-2",children:[e.jsxs(C,{value:String(s.columns||3),onValueChange:l=>a({...s,columns:parseInt(l)}
42),children:[e.jsx(k,{className:"w-32",children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"2",children:"2 עמודות"}),e.jsx(i,{value:"3",children:"3 עמודות"}),e.jsx(i,{value:"4",children:"4 עמודות"})]})]}),e.jsx(ge,{items:s.items||[],fields:["src","alt"],labels:["URL תמונה","Alt"],onChange:l=>a({...s,items:l})})]});case"logo-carousel":return e.jsx(ge,{items:s.items||[],fields:["src","name"],labels:["URL לוגו","שם"],onChange:l=>a({...s,items:l})});case"tabs":return e.jsx(ge,{items:s.items||[],fields:["label","content"],labels:["שם טאב","תוכן"],onChange:l=>a({...s,items:l})});case"team":return e.jsx(ge,{items:s.items||[],fields:["name","role","image","bio"],labels:["שם","תפקיד","URL תמונה","ביו"],onChange:l=>a({...s,items:l})});case"testimonials":return e.jsx(ge,{items:s.items||[],fields:["name","role","text"],labels:["שם","תפקיד","המלצה"],onChange:l=>a({...s,items:l})});case"faq":return e.jsx(ge,{items:s.items||[],fields:["question","answer"],labels:["שאלה","תשובה"],onChange:l=>a({...s,items:l})});case"features":return e.jsx(ge,{items:s.items||[],fields:["icon","title","description"],labels:["אימוג'י","כותרת","תיאור"],onChange:l=>a({...s,items:l})});case"list":return e.jsxs("div",{className:"space-y-2",children:[e.jsxs(C,{value:s.style||"bullet",onValueChange:l=>a({...s,style:l}),children:[e.jsx(k,{className:"w-40",children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"bullet",children:"תבליטים"}),e.jsx(i,{value:"number",children:"מספרים"}),e.jsx(i,{value:"check",children:"✓ וי"}),e.jsx(i,{value:"arrow",children:"← חץ"})]})]}),(s.items||[""]).map((l,r)=>e.jsxs("div",{className:"flex gap-1",children:[e.jsx(m,{value:l,onChange:n=>{const o=[...s.items||[""]];o[r]=n.target.value,a({...s,items:o})},placeholder:`פריט ${r+1}`}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0",onClick:()=>{const n=(s.items||[""]).filter((o,b)=>b!==r);a({...s,items:n.length?n:[""]})},children:e.jsx(U,{className:"w-3 h-3"})})]},r)),e.jsxs(_,{variant:"outline",size:"sm",className:"gap-1",onClick:()=>a({...s,items:[...s.items||[""],""]}),children:[e.jsx(se,{className:"w-3 h-3"})," הוסף פריט"]})]});case"map":return e.jsx("div",{className:"space-y-2",children:e.jsx(m,{placeholder:"כתובת או קואורדינטות",value:s.address||"",onChange:l=>a({...s,address:l.target.value})})});case"html-embed":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{className:"text-[10px]",children:"קוד HTML"}),e.jsx(te,{placeholder:"<div>HTML מותאם</div>",value:s.html||"",onChange:l=>a({...s,html:l.target.value}),rows:6,className:"font-mono text-xs",dir:"ltr"})]});case"accordion":return e.jsxs("div",{className:"space-y-2",children:[(s.items||[]).map((l,r)=>e.jsxs("div",{className:"border rounded p-2 space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["#",r+1]}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>{const n=(s.items||[]).filter((o,b)=>b!==r);a({...s,items:n.length?n:[{title:"",content:""}]})},children:e.jsx(U,{className:"w-3 h-3"})})]}),e.jsx(m,{placeholder:"כותרת",value:l.title||"",onChange:n=>{const o=[...s.items||[]];o[r]={...o[r],title:n.target.value},a({...s,items:o})}}),e.jsx(te,{placeholder:"תוכן",value:l.content||"",onChange:n=>{const o=[...s.items||[]];o[r]={...o[r],content:n.target.value},a({...s,items:o})},rows:2})]},r)),e.jsxs(_,{variant:"outline",size:"sm",className:"gap-1",onClick:()=>a({...s,items:[...s.items||[],{title:"",content:""}]}),children:[e.jsx(se,{className:"w-3 h-3"})," הוסף פריט"]})]});case"star-rating":return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"דירוג"}),e.jsx(Re,{value:[s.rating||4],min:0,max:s.maxStars||5,step:1,onValueChange:([l])=>a({...s,rating:l})})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"כוכבים מקס"}),e.jsxs(C,{value:String(s.maxStars||5),onValueChange:l=>a({...s,maxStars:parseInt(l)}
42),children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"5",children:"5"}),e.jsx(i,{value:"10",children:"10"})]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"גודל"}),e.jsxs(C,{value:s.size||"lg",onValueChange:l=>a({...s,size:l}),children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"sm",children:"קטן"}),e.jsx(i,{value:"lg",children:"רגיל"}),e.jsx(i,{value:"xl",children:"גדול"})]})]})]}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"צבע"}),e.jsx(m,{type:"color",value:s.color||"#f59e0b",onChange:l=>a({...s,color:l.target.value}),className:"h-8"})]})]}),e.jsx(m,{placeholder:"תווית (אופציונלי)",value:s.label||"",onChange:l=>a({...s,label:l.target.value})})]});case"alert-box":return e.jsxs("div",{className:"space-y-2",children:[e.jsxs(C,{value:s.type||"info",onValueChange:l=>a({...s,type:l}),children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"info",children:"מידע"}),e.jsx(i,{value:"success",children:"הצלחה"}),e.jsx(i,{value:"warning",children:"אזהרה"}),e.jsx(i,{value:"error",children:"שגיאה"})]})]}),e.jsx(m,{placeholder:"כותרת",value:s.title||"",onChange:l=>a({...s,title:l.target.value})}),e.jsx(te,{placeholder:"תוכן ההתראה",value:s.text||"",onChange:l=>a({...s,text:l.target.value}),rows:2})]});case"toggle":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{placeholder:"כותרת",value:s.title||"",onChange:l=>a({...s,title:l.target.value})}),e.jsx(te,{placeholder:"תוכן מוסתר",value:s.content||"",onChange:l=>a({...s,content:l.target.value}),rows:3}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(be,{checked:s.defaultOpen||!1,onCheckedChange:l=>a({...s,defaultOpen:l})}),e.jsx(g,{className:"text-[10px]",children:"פתוח כברירת מחדל"})]})]});case"inner-section":return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs(C,{value:String(s.columnCount||2),onValueChange:l=>{const r=parseInt(l),n=Array.from({length:r},(o,b)=>{var N;return((N=s.columns)==null?void 0:N[b])||{widgets:[]}});a({...s,columnCount:r,columns:n})},children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"2",children:"2 עמודות"}),e.jsx(i,{value:"3",children:"3 עמודות"}),e.jsx(i,{value:"4",children:"4 עמודות"})]})]}),e.jsxs(C,{value:s.columnRatio||"equal",onValueChange:l=>a({...s,columnRatio:l}),children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"equal",children:"שווה"}),e.jsx(i,{value:"60-40",children:"60/40"}),e.jsx(i,{value:"40-60",children:"40/60"}),e.jsx(i,{value:"70-30",children:"70/30"}),e.jsx(i,{value:"30-70",children:"30/70"})]})]})]}),(s.columns||[]).map((l,r)=>e.jsxs("div",{className:"border rounded p-2 space-y-1",children:[e.jsxs(g,{className:"text-[10px] font-semibold",children:["עמודה ",r+1]}),(l.widgets||[]).map((n,o)=>e.jsxs("div",{className:"flex gap-1",children:[e.jsxs(C,{value:n.type||"text",onValueChange:b=>{const N=[...s.columns||[]];N[r]={...N[r],widgets:N[r].widgets.map((p,v)=>v===o?{...p,type:b}:p)},a({...s,columns:N})},children:[e.jsx(k,{className:"w-24 h-7 text-[10px]",children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"text",children:"טקסט"}),e.jsx(i,{value:"heading",children:"כותרת"}),e.jsx(i,{value:"image",children:"תמונה"}),e.jsx(i,{value:"button",children:"כפתור"}),e.jsx(i,{value:"icon-box",children:"אייקון"})]})]}),e.jsx(m,{placeholder:"תוכן",value:n.content||"",onChange:b=>{const N=[...s.columns||[]];N[r]={...N[r],widgets:N[r].widgets.map((p,v)=>v===o?{...p,content:b.target.value}:p)},a({...s,columns:N})},className:"flex-1 h-7 text-xs"}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:()=>{const b=[...s.columns||[]];b[r]={...b[r],widgets:b[r].widgets.filter((N,p)=>p!==o)},a({...s,columns:b})},children:e.jsx(U,{className:"w-3 h-3"})})]},o)),e.jsxs(_,{variant:"outline",size:"sm",className:"h-6 text-[10px] gap-1",onClick:()=>{const n=[...s.columns||[]];n[r]={...n[r],widgets:[...n[r].widgets||[],{type:"text",content:""}]},a({...s,columns:n})},children:[e.jsx(se,{className:"w-3 h-3"})," הוסף ווידג'ט"]})]},r))]});case"scroll-to-top":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{placeholder:"טקסט/אייקון",value:s.text||"↑",onCh
42ange:l=>a({...s,text:l.target.value})}),e.jsxs("div",{children:[e.jsx(g,{className:"text-[10px]",children:"הצג אחרי גלילה (px)"}),e.jsx(m,{type:"number",value:s.showAfter||300,onChange:l=>a({...s,showAfter:parseInt(l.target.value)}),className:"h-8 text-xs"})]}),e.jsxs(C,{value:s.position||"bottom-right",onValueChange:l=>a({...s,position:l}),children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"bottom-right",children:"ימין למטה"}),e.jsx(i,{value:"bottom-left",children:"שמאל למטה"})]})]})]});case"lottie":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{placeholder:"URL לקובץ Lottie JSON",value:s.url||"",onChange:l=>a({...s,url:l.target.value}),dir:"ltr"}),e.jsx(m,{placeholder:"רוחב (px)",value:s.width||"200px",onChange:l=>a({...s,width:l.target.value}),dir:"ltr"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(be,{checked:s.loop!==!1,onCheckedChange:l=>a({...s,loop:l})}),e.jsx(g,{className:"text-[10px]",children:"לופ"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(be,{checked:s.autoplay!==!1,onCheckedChange:l=>a({...s,autoplay:l})}),e.jsx(g,{className:"text-[10px]",children:"הפעלה אוטומטית"})]})]})]});case"table-of-contents":return e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{placeholder:"כותרת",value:s.title||"תוכן עניינים",onChange:l=>a({...s,title:l.target.value})}),e.jsxs(C,{value:s.style||"numbered",onValueChange:l=>a({...s,style:l}),children:[e.jsx(k,{children:e.jsx(S,{})}),e.jsxs(T,{children:[e.jsx(i,{value:"numbered",children:"ממוספר"}),e.jsx(i,{value:"bullet",children:"תבליטים"}),e.jsx(i,{value:"plain",children:"פשוט"})]})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"נוצר אוטומטית מכותרות (Heading) בדף"})]});default:return e.jsx("p",{className:"text-xs text-muted-foreground",children:"אין עורך לסקשן זה"})}}function ge({items:t,fields:a,labels:s,onChange:j}){const d=()=>{const n={};a.forEach(o=>n[o]=""),j([...t,n])},l=n=>{const o=t.filter((b,N)=>N!==n);j(o.length?o:[(()=>{const b={};return a.forEach(N=>b[N]=""),b})()])},r=(n,o,b)=>{const N=[...t];N[n]={...N[n],[o]:b},j(N)};return e.jsxs("div",{className:"space-y-2",children:[t.map((n,o)=>e.jsxs("div",{className:"border rounded p-2 space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["#",o+1]}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>l(o),children:e.jsx(U,{className:"w-3 h-3"})})]}),a.map((b,N)=>e.jsx(m,{placeholder:s[N],value:n[b]||"",onChange:p=>r(o,b,p.target.value)},b))]},o)),e.jsxs(_,{variant:"outline",size:"sm",className:"gap-1",onClick:d,children:[e.jsx(se,{className:"w-3 h-3"})," הוסף"]})]})}function el({section:t,index:a,totalSections:s,onBack:j,onUpdate:d,onUpdateStyle:l,onUpdateSection:r,onRemove:n,onDuplicate:o,onMoveUp:b,onMoveDown:N,onGenerateAI:p,isGenerating:v}){var G;const h=je.find(z=>z.type===t.type),I=(h==null?void 0:h.icon)||je[0].icon,B=t.label||(h==null?void 0:h.label)||t.type,[L,E]=D.useState(!1),M=t.hideOn||[];return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("div",{className:"px-3 pt-2 pb-1 shrink-0",children:e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-white/40",children:[e.jsx("button",{onClick:j,className:"hover:text-white/70 transition-colors",children:"דף"}),e.jsx(Le,{className:"w-2.5 h-2.5 rotate-180"}),e.jsx("span",{className:"text-white/60 truncate max-w-[120px]",children:(h==null?void 0:h.label)||t.type}),t.label&&t.label!==(h==null?void 0:h.label)&&e.jsxs(e.Fragment,{children:[e.jsx(Le,{className:"w-2.5 h-2.5 rotate-180"}),e.jsx("span",{className:"text-white/80 truncate max-w-[100px]",children:t.label})]})]})}),e.jsxs("div",{className:"px-3 py-2 border-b border-white/10 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("button",{onClick:j,className:"p-1 rounded hover:bg-white/10 transition-colors",children:e.jsx(Le,{className:"w-4 h-4 text-white/50"})}),e.jsx(I,{className:"w-4 h-4 text-white/60"}),L?e.jsx(m,{autoFocus:!0,className:"h-6 w-32 text-xs bg-white/5 border-white/10 text-white",value:t.label||"",placeholder:(h==null?void 0:h.label)||t.type,onCh
42ange:z=>r({label:z.target.value}),onBlur:()=>E(!1),onKeyDown:z=>z.key==="Enter"&&E(!1)}):e.jsx("span",{className:"text-sm font-medium text-white/90 cursor-pointer hover:text-white",onDoubleClick:()=>E(!0),title:"לחיצה כפולה לשינוי שם",children:B}),t.isGlobal&&e.jsx(pe,{className:"text-[9px] bg-purple-500/30 text-purple-300 border-purple-500/30",children:"גלובלי"})]}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7 text-white/40 hover:text-white hover:bg-white/10",onClick:b,disabled:a===0,title:"הזז למעלה",children:e.jsx(Js,{className:"w-3.5 h-3.5"})}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7 text-white/40 hover:text-white hover:bg-white/10",onClick:N,disabled:a>=s-1,title:"הזז למטה",children:e.jsx(st,{className:"w-3.5 h-3.5"})}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7 text-white/40 hover:text-white hover:bg-white/10",onClick:o,title:"שכפל",children:e.jsx(Ve,{className:"w-3.5 h-3.5"})}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7 text-white/40 hover:text-white hover:bg-white/10",onClick:p,disabled:v,title:"AI תוכן",children:e.jsx(Ye,{className:`w-3.5 h-3.5 ${v?"animate-spin":""}`})}),e.jsx(_,{variant:"ghost",size:"icon",className:`h-7 w-7 hover:bg-white/10 ${t.isGlobal?"text-purple-400":"text-white/40 hover:text-white"}`,onClick:()=>r({isGlobal:!t.isGlobal,globalId:t.isGlobal?void 0:t.id}),title:"גלובלי",children:e.jsx(xs,{className:"w-3.5 h-3.5"})}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7 text-white/40 hover:text-white hover:bg-white/10",onClick:()=>r({hidden:!t.hidden}),title:t.hidden?"הצג":"הסתר",children:t.hidden?e.jsx(Je,{className:"w-3.5 h-3.5"}):e.jsx(Me,{className:"w-3.5 h-3.5"})}),e.jsx("div",{className:"flex-1"}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7 text-red-400/60 hover:text-red-400 hover:bg-red-500/10",onClick:n,title:"מחק",children:e.jsx(U,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs(ms,{defaultValue:"content",dir:"rtl",className:"h-full flex flex-col",children:[e.jsxs(us,{className:"w-full grid grid-cols-3 h-9 rounded-none bg-white/5 border-b border-white/10 shrink-0",children:[e.jsx(me,{value:"content",className:"text-[11px] text-white/60 data-[state=active]:text-white data-[state=active]:bg-white/10 rounded-none",children:"תוכן"}),e.jsx(me,{value:"style",className:"text-[11px] text-white/60 data-[state=active]:text-white data-[state=active]:bg-white/10 rounded-none",children:"סגנון"}),e.jsx(me,{value:"advanced",className:"text-[11px] text-white/60 data-[state=active]:text-white data-[state=active]:bg-white/10 rounded-none",children:"מתקדם"})]}),e.jsx(ue,{value:"content",className:"flex-1 p-3 mt-0 overflow-auto",children:e.jsx("div",{className:"[&_input]:bg-white/5 [&_input]:border-white/10 [&_input]:text-white [&_textarea]:bg-white/5 [&_textarea]:border-white/10 [&_textarea]:text-white [&_label]:text-white/60 [&_select]:bg-white/5 [&_button[role=combobox]]:bg-white/5 [&_button[role=combobox]]:border-white/10 [&_button[role=combobox]]:text-white/70",children:e.jsx(ot,{section:t,onUpdate:d})})}),e.jsx(ue,{value:"style",className:"flex-1 p-3 mt-0 overflow-auto",children:e.jsx("div",{className:"[&_input]:bg-white/5 [&_input]:border-white/10 [&_input]:text-white [&_textarea]:bg-white/5 [&_textarea]:border-white/10 [&_textarea]:text-white [&_label]:text-white/60 [&_select]:bg-white/5 [&_button[role=combobox]]:bg-white/5 [&_button[role=combobox]]:border-white/10 [&_button[role=combobox]]:text-white/70 [&_.border]:border-white/10 [&_.bg-muted\\\\/30]:bg-white/5",children:e.jsx(nt,{style:t.style||{},onChange:l})})}),e.jsxs(ue,{value:"advanced",className:"flex-1 p-3 mt-0 overflow-auto space-y-4",children:[e.jsx("div",{className:"[&_input]:bg-white/5 [&_input]:border-white/10 [&_input]:text-white [&_label]:text-white/60 [&_select]:bg-white/5 [&_button[role=combobox]]:bg-white/5 [&_button[role=combobox]]:border-white/10 [&_button[role=combobox]]:text-white/70 [&_.border]:border-white/10 [&_.bg-muted\\\\/30]:bg-white/5",children:e.jsx(ct,{style:t.style||{},onChange:l})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{className:"text-[11px] font-semibold text-white/50",children:"הסתר במכשירים"}),e.jsxs(et,{type:"multiple",value:M,onValueChange:z=>r({hideOn:z}),className:"justify-start",children:[e.jsxs(Pe,{value:"desktop",className:"h-7 text-[10px] gap-1 text-white/50 data-[state=on]:bg-white/15 data-[state=on]:text-white border-white/10",children:[e.jsx(Ze,{className:"w-3 h-3"})," דסקטופ"]}),e.jsxs(Pe,{value:"tablet",className:"h-7 text-[10px] gap-1 text-white/50 data-[state=on]:bg-white/15 data-[state=on]:text-white border-white/10",children:[e.jsx(Ee,{className:"w-3 h-3"})," טאבלט"]}),e.jsxs(Pe,{value:"mobile",className:"h-7 text-[10px] gap-1 text-white/50 data-[state=on]:bg-white/15 data-[state=on]:text-white border-white/10",children:[e.jsx(ze,{className:"w-3 h-3"})," מובייל"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{className:"text-[11px] font-semibold text-white/50",children:"CSS מותאם"}),e.jsx(te,{placeholder:`color: red;
43background: #f0f0f0;`,value:t.customCSS||"",onChange:z=>r({customCSS:z.target.value}),rows:5,className:"text-xs font-mono bg-white/5 border-white/10 text-white",dir:"ltr"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{className:"text-[11px] font-semibold text-white/50",children:"Anchor ID"}),e.jsx(m,{placeholder:"my-section",value:((G=t.style)==null?void 0:G.anchorId)||"",onChange:z=>l({anchorId:z.target.value}),className:"h-8 text-xs bg-white/5 border-white/10 text-white",dir:"ltr"})]})]})]})})]})}function sl(){const{t}=ve(),a=[{keys:"Ctrl + Z",label:t("shortcuts.undo")},{keys:"Ctrl + Shift + Z",label:t("shortcuts.redo")},{keys:"Ctrl + Y",label:t("shortcuts.redo")},{keys:"Ctrl + C",label:t("shortcuts.copy")},{keys:"Ctrl + V",label:t("shortcuts.paste")},{keys:"Delete",label:t("shortcuts.delete")},{keys:t("shortcuts.rightClick"),label:t("shortcuts.contextMenu")},{keys:t("shortcuts.doubleClick"),label:t("shortcuts.doubleClick")}];return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-white/60",children:[e.jsx(Qs,{className:"w-4 h-4"}),e.jsx("span",{className:"text-xs font-medium",children:t("shortcuts.title")})]}),e.jsx("div",{className:"space-y-1",children:a.map((s,j)=>e.jsxs("div",{className:"flex items-center justify-between py-1.5 px-2 rounded hover:bg-white/5",children:[e.jsx("span",{className:"text-[11px] text-white/60",children:s.label}),e.jsx("kbd",{className:"text-[10px] text-white/40 bg-white/10 px-2 py-0.5 rounded font-mono",children:s.keys})]},j))})]})}function tl({section:t,index:a,isSelected:s,onSelect:j,onUpdate:d,onUp
43dateStyle:l,onUpdateSection:r,onRemove:n,onDuplicate:o,onGenerateAI:b,isGenerating:N}){const{attributes:p,listeners:v,setNodeRef:h,transform:I,transition:B,isDragging:L}=Yt({id:t.id}),[E,M]=D.useState(!1),[G,z]=D.useState(!1),[Z,w]=D.useState(!1),[H,W]=D.useState(!0),[ae,le]=D.useState(!1),Q=je.find(O=>O.type===t.type),fe=(Q==null?void 0:Q.icon)||je[0].icon,ie=t.label||(Q==null?void 0:Q.label)||t.type,R={transform:Jt.Transform.toString(I),transition:B,opacity:L?.5:1,zIndex:L?50:void 0},q=t.hideOn||[];return e.jsx("div",{ref:h,style:R,onClick:j,id:`section-editor-${t.id}`,children:e.jsx(We,{className:`group transition-all ${L?"ring-2 ring-primary shadow-xl":""} ${s?"ring-2 ring-primary/60 bg-primary/5":""} ${t.hidden?"opacity-50":""}`,children:e.jsx(qe,{className:"p-0",children:e.jsxs(ka,{open:H,onOpenChange:W,children:[e.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-transparent hover:border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{...p,...v,className:"cursor-grab active:cursor-grabbing p-1 rounded hover:bg-muted",tabIndex:-1,children:e.jsx(fs,{className:"w-4 h-4 text-muted-foreground"})}),e.jsx(fe,{className:"w-4 h-4 text-muted-foreground"}),ae?e.jsx(m,{autoFocus:!0,className:"h-6 w-28 text-xs",value:t.label||"",placeholder:(Q==null?void 0:Q.label)||t.type,onChange:O=>r({label:O.target.value}),onBlur:()=>le(!1),onKeyDown:O=>O.key==="Enter"&&le(!1),onClick:O=>O.stopPropagation()}):e.jsx("span",{className:"text-sm font-medium cursor-pointer",onDoubleClick:()=>le(!0),title:"לחיצה כפולה לשינוי שם",children:ie}),e.jsxs(pe,{variant:"outline",className:"text-[10px]",children:["#",a+1]}),t.hidden&&e.jsx(pe,{variant:"secondary",className:"text-[10px]",children:"מוסתר"}),t.isGlobal&&e.jsx(pe,{variant:"default",className:"text-[10px] bg-purple-500",children:"גלובלי"}),q.length>0&&e.jsxs(pe,{variant:"outline",className:"text-[10px] gap-0.5",children:[q.includes("mobile")&&e.jsx(ze,{className:"w-2.5 h-2.5"}),q.includes("tablet")&&e.jsx(Ee,{className:"w-2.5 h-2.5"}),q.includes("desktop")&&e.jsx(Ze,{className:"w-2.5 h-2.5"})]})]}),e.jsxs("div",{className:"flex gap-0.5",children:[e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:O=>{O.stopPropagation(),b()},disabled:N,title:"יצירת תוכן AI",children:e.jsx(Ye,{className:`w-3.5 h-3.5 ${N?"animate-spin":""}`})}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:O=>{O.stopPropagation(),M(!E)},title:"עריכת סגנון",children:e.jsx(is,{className:"w-3.5 h-3.5"})}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:O=>{O.stopPropagation(),z(!G)},title:"CSS מותאם",children:e.jsx(Us,{className:"w-3.5 h-3.5"})}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:O=>{O.stopPropagation(),w(!Z)},title:"עריכה רספונסיבית",children:e.jsx(at,{className:"w-3.5 h-3.5"})}),e.jsx(_,{variant:"ghost",size:"icon",className:`h-7 w-7 ${t.isGlobal?"text-purple-500":""}`,onClick:O=>{O.stopPropagation(),r({isGlobal:!t.isGlobal,globalId:t.isGlobal?void 0:t.id})},title:"ווידג'ט גלובלי",children:e.jsx(xs,{className:"w-3.5 h-3.5"})}),e.jsxs(ps,{children:[e.jsx(js,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:O=>O.stopPropagation(),title:"נראות",children:t.hidden?e.jsx(Je,{className:"w-3.5 h-3.5 text-muted-foreground"}):e.jsx(Me,{className:"w-3.5 h-3.5"})})}),e.jsxs(gs,{className:"w-56 p-3 space-y-3",align:"end",onClick:O=>O.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium",children:"הסתר סקשן"}),e.jsx(_,{variant:t.hidden?"default":"outline",size:"sm",className:"h-6 text-[10px]",onClick:()=>r({hidden:!t.hidden}),children:t.hidden?"מוסתר":"מוצג"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium",children:"הסתר במכשירים"}),e.jsxs(et,{type:"multiple",value:q,onValueChange:O=>r({hideOn:O}),className:"mt-1",children:[e.jsxs(Pe,{value:"desktop",className:"h-7 text-[10px] gap-1",children:[e.jsx(Ze,{className:"w-3 h-3"})," דסקטופ"]}),e.jsxs(Pe,{value:"tablet",className:"h-7 text-[10px] gap-1",children:[e.jsx(Ee,{className:"w-3 h-3"})," טאבלט"]}),e.jsxs(Pe,{value:"mobile",className:"h-7 text-[10px] gap-1",children:[e.jsx(ze,{className:"w-3 h-3"})," מובייל"]})]})]})]})]}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:O=>{O.stopPropagation(),o()},title:"שכפול",children:e.jsx(Ve,{className:"w-3.5 h-3.5"})}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:O=>{O.stopPropagation(),n()},title:"מחיקה",children:e.jsx(U,{className:"w-3.5 h-3.5 text-destructive"})}),e.jsx(Sa,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:O=>O.stopPropagation(),children:H?e.jsx(Gt,{className:"w-3.5 h-3.5"}):e.jsx(He,{className:"w-3.5 h-3.5"})})})]})]}),e.jsx(Ta,{children:e.jsxs("div",{className:"p-3 pt-0",children:[E&&e.jsx(nt,{style:t.style||{},onChange:l}),G&&e.jsxs("div",{className:"border rounded-lg p-3 mb-3 bg-muted/30 space-y-2",dir:"rtl",children:[e.jsx(g,{className:"text-[10px] font-semibold",children:"CSS מותאם לווידג'ט"}),e.jsx(te,{placeholder:`color: red;
44background: #f0f0f0;`,value:t.customCSS||"",onChange:O=>r({customCSS:O.target.value}),rows:4,className:"text-xs font-mono",dir:"ltr"})]}),Z&&e.jsx(ct,{style:t.style||{},onChange:l}),e.jsx(ot,{section:t,onUpdate:d})]})})]})})})})}function Zs({id:t,isActive:a}){const{setNodeRef:s,isOver:j}=bs({id:t});return e.jsx("div",{ref:s,className:`
45        relative transition-all duration-200 ease-in-out mx-1
46        ${a?j?"h-16 border-2 border-dashed border-primary bg-primary/10 rounded-lg":"h-8 border-2 border-dashed border-primary/30 bg-primary/5 rounded-lg":"h-1 group-hover:h-4"}
47        flex items-center justify-center
48      `,children:a&&e.jsxs("div",{className:`flex items-center gap-1.5 text-xs font-medium transition-opacity ${j?"text-primary opacity-100":"text-primary/50 opacity-70"}`,children:[e.jsx(se,{className:"w-3.5 h-3.5"}
48),e.jsx("span",{children:j?"שחרר כאן":"גרור לכאן"})]})})}function al({sections:t,globalStyle:a,selectedSectionId:s,isDraggingNewWidget:j,generatingAI:d,popups:l,revisions:r,customTemplates:n,showRevisions:o,pageSettings:b,previewDevice:N,onAddSection:p,onUpdateSection:v,onUpdateSectionStyle:h,onUpdateSectionMeta:I,onRemoveSection:B,onDuplicateSection:L,onSelectSection:E,onDeselectSection:M,onMoveSectionUp:G,onMoveSectionDown:z,onGenerateAI:Z,onUpdateGlobalStyle:w,onAddTemplate:H,onAddPopup:W,onUpdatePopup:ae,onRemovePopup:le,onSaveRevision:Q,onRestoreRevision:fe,onDeleteRevision:ie,onAddFromCustomTemplate:R,onRemoveCustomTemplate:q,onUpdatePageSettings:O,onSetDevice:Te,onToggleRevisions:Ne}){const[A,X]=D.useState("widgets"),[_e,we]=D.useState(!1),ye=s?t.find(P=>P.id===s):null,De=ye?t.findIndex(P=>P.id===s):-1,Ce=ye&&s,$e=[{id:"settings",icon:is,label:"הגדרות"},{id:"navigator",icon:_a,label:"נווט"},{id:"history",icon:Ht,label:"היסטוריה",action:Ne},{id:"responsive",icon:N==="mobile"?ze:N==="tablet"?Ee:Ze,label:"רספונסיב"},{id:"shortcuts",icon:Qs,label:"קיצורי מקלדת"}];return e.jsxs("div",{className:"w-[300px] shrink-0 bg-[#23272f] text-white flex flex-col h-full border-l border-white/10",children:[e.jsxs("div",{className:"h-12 flex items-center justify-between px-3 border-b border-white/10 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>we(!_e),className:"w-8 h-8 rounded flex items-center justify-center hover:bg-white/10 transition-colors",children:_e?e.jsx(zs,{className:"w-4 h-4"}):e.jsx(Ft,{className:"w-4 h-4"})}),e.jsx("div",{className:"w-7 h-7 rounded bg-gradient-to-br from-pink-500 to-rose-600 flex items-center justify-center text-[10px] font-bold",children:"LP"})]}),e.jsx("div",{className:"flex items-center gap-0.5",children:[{id:"widgets",icon:Qe,label:"ווידג'טים"},{id:"sections",icon:as,label:"סקשנים"},{id:"templates",icon:$s,label:"תבניות"},{id:"global",icon:Vs,label:"גלובלי"},{id:"popups",icon:Es,label:"פופאפים"}].map(P=>e.jsx(ss,{delayDuration:200,children:e.jsxs(de,{children:[e.jsx(xe,{asChild:!0,children:e.jsx("button",{className:`w-7 h-7 rounded flex items-center justify-center transition-all ${!Ce&&A===P.id?"bg-white/15 text-white":"text-white/40 hover:text-white/70 hover:bg-white/5"}`,onClick:()=>{M(),X(P.id)},children:e.jsx(P.icon,{className:"w-3.5 h-3.5"})})}),e.jsx(he,{side:"bottom",className:"text-xs",children:P.label})]})},P.id))})]}),_e&&e.jsxs("div",{className:"absolute inset-0 z-50 bg-[#1a1d23] flex flex-col",style:{width:300},children:[e.jsx("div",{className:"h-12 flex items-center px-3 border-b border-white/10",children:e.jsx("button",{onClick:()=>we(!1),className:"w-8 h-8 rounded flex items-center justify-center hover:bg-white/10",children:e.jsx(zs,{className:"w-4 h-4"})})}),e.jsx("div",{className:"p-4 space-y-1",children:[{id:"widgets",icon:Qe,label:"ווידג'טים"},{id:"sections",icon:as,label:"ניהול סקשנים"},{id:"templates",icon:$s,label:"תבניות"},{id:"global",icon:Vs,label:"סגנון גלובלי"},{id:"popups",icon:Es,label:"פופאפים"},{id:"settings",icon:is,label:"הגדרות דף"}].map(P=>e.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm text-white/70 hover:bg-white/10 hover:text-white transition-colors",onClick:()=>{X(P.id),we(!1),M()},children:[e.jsx(P.icon,{className:"w-4 h-4"}),P.label]},P.id))})]}),e.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:Ce?e.jsx(el,{section:ye,index:De,totalSections:t.length,onBack:M,onUpdate:P=>v(s,P),onUpdateStyle:P=>h(s,P),onUpdateSection:P=>I(s,P),onRemove:()=>{B(s),M()},onDuplicate:()=>L(s),onMoveUp:()=>G(s),onMoveDown:()=>z(s),onGenerateAI:()=>Z(s),isGenerating:d===s}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"px-4 py-2.5 border-b border-white/10 shrink-0 flex items-center justify-between",children:[e.jsx("h3",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:A==="widgets"?"ווידג'טים":A==="sections"?"סקשנים":A==="templates"?"תבניות":A==="navigator"?"ניווט":A==="global"?"סגנון גלובלי":A==="popups"?"פופאפים":A==="shortcuts"?"קיצורי מקלדת":"הגדרות דף"}),A==="widgets"&&e.jsx(pe,{variant:"outline",className:"text-[9px] border-white/20 text-white/40",children:"גרור או לחץ"})]}),e.jsx(Ca,{className:"flex-1",children:e.jsxs("div",{className:"p-3",children:[A==="widgets"&&e.jsx(Xa,{onAdd:p}),A==="sections"&&e.jsx(Qt,{items:t.map(P=>P.id),strategy:Ut,children:e.jsxs("div",{className:"space-y-1.5",children:[t.length===0&&!j&&e.jsxs("div",{className:"text-center py-10",children:[e.jsx(Qe,{className:"w-10 h-10 mx-auto mb-3 text-white/20"}),e.jsx("p",{className:"text-xs text-white/40",children:"אין סקשנים עדיין"}),e.jsx("p",{className:"text-[10px] text-white/30 mt-1",children:`לחץ על "ווידג'טים" כדי להוסיף`})]}),e.jsx(Zs,{id:"drop-zone-0",isActive:j}),t.map((P,re)=>e.jsxs("div",{children:[e.jsx(tl,{section:P,index:re,isSelected:s===P.id,onSelect:()=>E(P.id),onUpdate:ne=>
48v(P.id,ne),onUpdateStyle:ne=>h(P.id,ne),onUpdateSection:ne=>I(P.id,ne),onRemove:()=>B(P.id),onDuplicate:()=>L(P.id),onGenerateAI:()=>Z(P.id),isGenerating:d===P.id}),e.jsx(Zs,{id:`drop-zone-${re+1}`,isActive:j})]},P.id))]})}),A==="templates"&&e.jsx(ll,{customTemplates:n,onAddFromCustomTemplate:R,onRemoveCustomTemplate:q,onAddTemplate:H}),A==="navigator"&&e.jsx("div",{className:"[&_.card]:bg-white/5 [&_.card]:border-white/10 [&_*]:text-white/70",children:e.jsx(Ka,{sections:t,selectedId:s,onSelect:E,onToggleHidden:P=>{var re;return I(P,{hidden:!((re=t.find(ne=>ne.id===P))!=null&&re.hidden)})}})}),A==="global"&&e.jsx("div",{className:"[&_.card]:bg-white/5 [&_.card]:border-white/10 [&_label]:text-white/60 [&_p]:text-white/60 [&_*]:text-white/70",children:e.jsx(Ya,{style:a,onChange:w})}),A==="settings"&&e.jsx(Ja,{settings:b,onChange:O}),A==="popups"&&e.jsx(il,{popups:l,onAddPopup:W,onUpdatePopup:ae,onRemovePopup:le}),A==="shortcuts"&&e.jsx(sl,{}),o&&e.jsx(rl,{revisions:r,onSaveRevision:Q,onRestoreRevision:fe,onDeleteRevision:ie})]})})]})}),e.jsx("div",{className:"h-10 flex items-center justify-around border-t border-white/10 bg-[#1a1d23] shrink-0",children:e.jsx(ss,{delayDuration:200,children:$e.map(P=>e.jsxs(de,{children:[e.jsx(xe,{asChild:!0,children:e.jsx("button",{className:`w-8 h-8 rounded flex items-center justify-center transition-all ${!Ce&&A===P.id?"text-white bg-white/10":"text-white/40 hover:text-white/70 hover:bg-white/5"}`,onClick:()=>{if(P.action)P.action();else if(P.id==="responsive"){const re=["desktop","tablet","mobile"],ne=re.indexOf(N);Te(re[(ne+1)%re.length])}else M(),X(P.id)},children:e.jsx(P.icon,{className:"w-4 h-4"})})}),e.jsx(he,{side:"top",className:"text-xs",children:P.label})]},P.id))})})]})}function ll({customTemplates:t,onAddFromCustomTemplate:a,onRemoveCustomTemplate:s,onAddTemplate:j}){return e.jsxs("div",{className:"space-y-4",children:[t.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold text-white/50 uppercase tracking-wider mb-2",children:"התבניות שלי"}),e.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:t.map(d=>e.jsxs("div",{className:"relative group",children:[e.jsxs("button",{className:"w-full py-3 px-2 flex flex-col items-center gap-1.5 text-[10px] rounded-lg bg-white/5 hover:bg-white/10 border border-white/10 hover:border-white/20 transition-all text-white/70",onClick:()=>a(d.id),children:[e.jsx(vs,{className:"w-4 h-4"}),d.name]}),e.jsx("button",{className:"absolute -top-1 -right-1 w-4 h-4 bg-red-500 text-white rounded-full text-[8px] opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",onClick:()=>s(d.id),children:"✕"})]},d.id))})]}),rt.map(d=>{const l=Ns.filter(r=>r.category===d.key);return e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold text-white/50 uppercase tracking-wider mb-2",children:d.label}),e.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:l.map(r=>e.jsxs("button",{className:"py-3 px-2 flex flex-col items-center gap-1.5 text-[10px] rounded-lg bg-white/5 hover:bg-white/10 border border-white/10 hover:border-white/20 transition-all text-white/70",onClick:()=>j(r.id),children:[e.jsx(Ke,{className:"w-4 h-4"}),r.name]},r.id))})]},d.key)})]})}function il({popups:t,onAddPopup:a,onUpdatePopup:s,onRemovePopup:j}){return e.jsxs("div",{className:"space-y-3",children:[e.jsxs(_,{size:"sm",variant:"outline",className:"w-full gap-1.5 border-white/20 text-white/70 hover:text-white hover:bg-white/10",onClick:a,children:[e.jsx(se,{className:"w-3.5 h-3.5"})," פופאפ חדש"]}),t.length===0?e.jsx("p",{className:"text-[10px] text-white/30 text-center py-6",children:"אין פופאפים. צור את הראשון!"}):e.jsx("div",{className:"space-y-2",children:t.map(d=>e.jsxs("div",{className:"border border-white/10 rounded-lg p-3 space-y-2 bg-white/5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(m,{value:d.name,onChange:l=>s(d.id,{name:l.target.value}),className:"h-7 text-xs w-28 bg-white/5 border-white/10 text-white"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(pe,{variant:d.enabled?"default":"secondary",className:"text-[9px] curs
48or-pointer",onClick:()=>s(d.id,{enabled:!d.enabled}),children:d.enabled?"פעיל":"כבוי"}),e.jsx("button",{className:"p-1 rounded hover:bg-white/10",onClick:()=>j(d.id),children:e.jsx(U,{className:"w-3 h-3 text-red-400"})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[e.jsxs("select",{className:"h-7 text-[10px] border border-white/10 rounded px-1 bg-white/5 text-white/70",value:d.trigger,onChange:l=>s(d.id,{trigger:l.target.value}),children:[e.jsx("option",{value:"time-delay",children:"השהיה (שניות)"}),e.jsx("option",{value:"scroll",children:"גלילה (%)"}),e.jsx("option",{value:"exit-intent",children:"כוונת יציאה"}),e.jsx("option",{value:"click",children:"לחיצה"})]}),(d.trigger==="time-delay"||d.trigger==="scroll")&&e.jsx(m,{type:"number",value:d.triggerValue||"",onChange:l=>s(d.id,{triggerValue:l.target.value}),className:"h-7 text-[10px] bg-white/5 border-white/10 text-white",placeholder:d.trigger==="scroll"?"%":"שניות"})]})]},d.id))})]})}function rl({revisions:t,onSaveRevision:a,onRestoreRevision:s,onDeleteRevision:j}){return e.jsxs("div",{className:"mt-4 border border-white/10 rounded-lg p-3 bg-white/5 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-xs font-semibold text-white/70",children:"היסטוריית גרסאות"}),e.jsxs(_,{size:"sm",variant:"outline",className:"h-6 text-[10px] gap-1 border-white/20 text-white/60",onClick:a,children:[e.jsx(vs,{className:"w-3 h-3"})," שמור"]})]}),t.length===0?e.jsx("p",{className:"text-[10px] text-white/30 text-center py-3",children:"אין גרסאות שמורות"}):e.jsx("div",{className:"space-y-1 max-h-48 overflow-y-auto",children:[...t].reverse().map(d=>e.jsxs("div",{className:"flex items-center justify-between border border-white/10 rounded p-2 text-[10px]",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-white/70",children:d.label}),e.jsx("br",{}),e.jsx("span",{className:"text-white/40",children:new Date(d.timestamp).toLocaleString("he-IL")})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(_,{size:"sm",variant:"outline",className:"h-5 text-[9px] border-white/20 text-white/60",onClick:()=>s(d.id),children:"שחזר"}),e.jsx("button",{className:"p-0.5 rounded hover:bg-white/10",onClick:()=>j(d.id),children:e.jsx(U,{className:"w-3 h-3 text-red-400"})})]})]},d.id))})]})}function Xs({id:t,isActive:a}){const{setNodeRef:s,isOver:j}=bs({id:t});return e.jsx("div",{ref:s,className:`transition-all duration-200 ease-in-out ${a?j?"h-20 border-2 border-dashed border-blue-400 bg-blue-500/10 rounded-lg mx-4 my-1 flex items-center justify-center":"h-10 border-2 border-dashed border-blue-300/40 bg-blue-500/5 rounded-lg mx-4 my-1 flex items-center justify-center":"h-0"}`,children:a&&e.jsxs("div",{className:`flex items-center gap-1.5 text-xs font-medium transition-opacity ${j?"text-blue-500 opacity-100":"text-blue-400/50 opacity-70"}`,children:[e.jsx(se,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:j?"שחרר כאן":"גרור לכאן"})]})})}function nl({isDragging:t}){const{setNodeRef:a,isOver:s}=bs({id:"canvas-empty-drop"});return e.jsx("div",{ref:a,className:`flex-1 flex items-center justify-center min-h-[600px] transition-all ${t?s?"border-2 border-dashed border-blue-400 bg-blue-50":"border-2 border-dashed border-blue-300/50 bg-blue-50/50":""}`,children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:`w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4 transition-colors ${t?"bg-blue-100":"bg-gray-100"}`,children:e.jsx(se,{className:`w-8 h-8 ${t?"text-blue-400":"text-gray-300"}`})}),e.jsx("p",{className:`text-sm font-medium ${t?"text-blue-500":"text-gray-400"}`,children:t?"שחרר כאן כדי להוסיף":"גרור ווידג'ט מהסיידבר"}),e.jsx("p",{className:"text-gray-300 text-xs mt-1",children:"או לחץ על ווידג'ט להוספה מהירה"})]})})}function cl({onPick:t,children:a}){const[s,j]=D.useState(!1);return e.jsxs(ps,{open:s,onOpenChange:j,children:[e.jsx(js,{asChild:!0,children:a}),e.jsx(gs,{className:"w-[260px] p-3 bg-[#23272f] border-white/10",side:"top",align:"center",children:e.jsx("div",{className:"space-y-3 max-h-[300px] overflow-auto",children:rt.map(d=>{const l=Ns.filter(r=>r.category===d.key);return l.length?e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold text-white/40 uppercase tracking-wider mb-1.5",children:d.label}),e.jsx("div",{className:"grid grid-cols-2 gap-1",children:l.map(r=>e.jsxs("button",{className:"flex flex-col items-center gap-0.5 p-2 rounded text-[10px] text-white/60 hover:bg-white/10 hover:text-white transition-colors",onClick:()=>{t(r.id),j(!1)},children:[e.jsx(Ke,{className:"w-4 h-4"}),e.jsx("span",{className:"truncate w-full text-center",children:r.name})]},r.id))})]},d.key):null})})})]})}function Ks({onPick:t,children:a}){const[s,j]=D.useState(!1);return e.jsxs(ps,{open:s,onOpenChange:j,children:[e.jsx(js,{asChild:!0,children:a}),e.jsx(gs,{className:"w-[260px] p-3 bg-[#23272f] border-white/10",side:"bottom",align:"center",children:e.jsx("div",{className:"space-y-3 max-h-[300px] overflow-auto",children:Fa.map(d=>e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold text-white/40 uppercase tracking-wider mb-1.5",children:d.label}),e.jsx("div",{className:"grid grid-cols-4 gap-1",children:je.filter(l=>l.category===d.key).map(l=>e.jsxs("button",{className:"flex flex-col items-center gap-0.5 p-1.5 rounded text-[8px] text-white/60 hover:bg-white/10 hover:text-white transition-colors",onClick:()=>{t(l.type),j(!1)},title:l.label,children:[e.jsx(l.icon,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"truncate w-full text-center",children:l.label})]},l.type))})]},d.key))})})]})}function ol({sections:t,globalStyle:a,previewDevice:s,selectedSectionId:j,isDraggingNewWidget:d,draggedWidgetType:l,onSelectSection:r,onDuplicateSection:n,onMoveSectionUp:o,onMoveSectionDown:b,onRemoveSection:N,onToggleHidden:p,onGenerateAI:v,onCopyStyle:h,onPasteStyle:I,onSaveAsTemplate:B,onInlineEdit:L,copiedStyle:E,onAddSectionAt:M,onAddTemplate:G,onCopyWidget:z,onPasteWidget:Z,copiedWidget:w}){const H=D.useRef(null),[W,ae]=D.useState(100),le=s==="mobile"?"390px":s==="tablet"?"768px":"100%",Q=s==="mobile"?"390px":s==="tablet"?"768px":"100%",fe={fontFamily:a.fontFamily||void 0,backgroundColor:a.bgColor||void 0,color:a.textColor||void 0,maxWidth:a.maxWidth||void 0,margin:a.maxWidth?"0 auto":void 0},ie=t.filter(R=>{var q;
48return!(R.hidden||(q=R.hideOn)!=null&&q.includes(s))});return e.jsxs("div",{ref:H,className:"flex-1 overflow-auto bg-[#e5e7eb]",style:{backgroundImage:"radial-gradient(circle, #d1d5db 1px, transparent 1px)",backgroundSize:"20px 20px"},children:[s!=="desktop"&&e.jsx("div",{className:"flex justify-center pt-3 pb-0",children:e.jsx("div",{className:"px-3 py-1 rounded-full bg-blue-500/10 text-blue-600 text-[10px] font-medium",children:s==="mobile"?"390px — מובייל":"768px — טאבלט"})}),e.jsx("div",{className:"flex justify-center p-6 min-h-full",style:{transform:`scale(${W/100})`,transformOrigin:"top center"},children:e.jsx("div",{className:"w-full bg-white shadow-2xl overflow-hidden transition-all duration-500 min-h-[600px] flex flex-col",style:{maxWidth:Q,width:le,borderRadius:s!=="desktop"?"16px":"8px",boxShadow:s!=="desktop"?"0 0 0 8px #1a1d23, 0 25px 50px -12px rgba(0,0,0,0.5)":"0 25px 50px -12px rgba(0,0,0,0.25)"},children:ie.length===0?e.jsx(nl,{isDragging:d}):e.jsxs("div",{dir:"rtl",style:fe,children:[e.jsx(Xs,{id:"drop-zone-0",isActive:d}),ie.map((R,q)=>{var Ne;const O=t.findIndex(A=>A.id===R.id),Te=j===R.id;return e.jsxs("div",{children:[e.jsxs(Pa,{children:[e.jsx(Da,{asChild:!0,children:e.jsxs("div",{className:"relative group/preview cursor-pointer transition-all",onClick:()=>r(R.id),children:[e.jsxs("div",{className:"relative",children:[e.jsx(tt,{section:R,onInlineEdit:(A,X)=>L(R.id,A,X)}),e.jsxs("div",{className:`absolute inset-0 transition-all pointer-events-none ${Te?"opacity-100":"opacity-0 group-hover/preview:opacity-100"}`,children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-[2px] bg-blue-500"}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-[2px] bg-blue-500"}),e.jsx("div",{className:"absolute top-0 bottom-0 left-0 w-[2px] bg-blue-500"}),e.jsx("div",{className:"absolute top-0 bottom-0 right-0 w-[2px] bg-blue-500"}),e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-auto",children:e.jsxs("div",{className:"flex items-center gap-1 bg-blue-500 text-white rounded shadow-lg overflow-hidden",children:[e.jsx("div",{className:"px-1.5 py-1 hover:bg-blue-600 cursor-grab active:cursor-grabbing transition-colors",children:e.jsx(fs,{className:"w-3 h-3"})}),e.jsx("span",{className:"text-[9px] font-medium pr-1 whitespace-nowrap",children:R.label||((Ne=je.find(A=>A.type===R.type))==null?void 0:Ne.label)||R.type})]})}),e.jsx("div",{className:"absolute top-2 right-2 pointer-events-auto",children:e.jsx("button",{className:"w-6 h-6 rounded bg-blue-500 text-white flex items-center justify-center hover:bg-blue-600 transition-colors shadow",onClick:A=>{A.stopPropagation(),r(R.id)},title:"ערוך",children:e.jsx(Ms,{className:"w-3 h-3"})})}),e.jsxs("div",{className:"absolute top-2 left-2 pointer-events-auto flex gap-0.5",children:[e.jsx("button",{className:"w-6 h-6 rounded bg-blue-500 text-white flex items-center justify-center hover:bg-blue-600 transition-colors shadow",onClick:A=>{A.stopPropagation(),n(R.id)},title:"שכפל",children:e.jsx(Ve,{className:"w-3 h-3"})}),e.jsx("button",{className:"w-6 h-6 rounded bg-red-500 text-white flex items-center justify-center hover:bg-red-600 transition-colors shadow",onClick:A=>{A.stopPropagation(),N(R.id)},title:"מחק",children:e.jsx(U,{className:"w-3 h-3"})})]})]})]}),!d&&q<ie.length-1&&e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2 z-20 opacity-0 group-hover/preview:opacity-100 transition-opacity pointer-events-auto",children:e.jsx(Ks,{onPick:A=>M(A,O+1),children:e.jsx("div",{className:"w-5 h-5 rounded-full bg-blue-500 text-white flex items-center justify-center cursor-pointer hover:bg-blue-600 shadow-lg",children:e.jsx(se,{className:"w-3 h-3"})})})})]})}),e.jsxs(Ia,{className:"w-56",children:[e.jsxs(ce,{className:"gap-2",onClick:()=>r(R.id),children:[e.jsx(Ms,{className:"w-4 h-4"})," עריכת ווידג'ט"]}),e.jsx(Ie,{}),e.jsxs(ce,{className:"gap-2",onClick:()=>n(R.id),children:[e.jsx(Ve,{className:"w-4 h-4"})," שכפול"]}),e.jsxs(ce,{className:"gap-2",onClick:()=>z==null?void 0:z(R.id),children:[e.jsx(La,{className:"w-4 h-4"})," העתק ווידג'ט"]}),e.jsxs(ce,{className:"gap-2",onClick:()=>Z==null?void 0:Z(O+1),disabled:!w,children:[e.jsx(Bt,{className:"w-4 h-4"})," הדבק ווידג'ט"]}),e.jsx(Ie,{}),e.jsxs(ce,{className:"gap-2",onClick:()=>h(R.id),children:[e.jsx(Ra,{className:"w-4 h-4"})," העתק סגנון"]}),e.jsxs(ce,{className:"gap-2",onClick:()=>I(R.id),disabled:!E,children:[e.jsx(Oa,{className:"w-4 h-4"})," הדבק סגנון"]}),e.jsx(Ie,{}),e.jsxs(ce,{className:"gap-2",onClick:()=>o(R.id),disabled:q===0,children:[e.jsx(Js,{className:"w-4 h-4"})," הזז למעלה"]}),e.jsxs(ce,{className:"gap-2",onClick:()=>b(R.id),disabled:q===ie.length-1,children:[e.jsx(st,{className:"w-4 h-4"})," הזז למטה"]}),e.jsx(Ie,{}),e.jsxs(ce,{className:"gap-2",onClick:()=>p(R.id),children:[R.hidden?e.jsx(Me,{className:"w-4 h-4"}):e.jsx(Je,{className:"w-4 h-4"}),R.hidden?"הצג":"הסתר"]}),e.jsxs(ce,{className:"gap-2",onClick:()=>v(R.id),children:[e.jsx(Ye,{className:"w-4 h-4"})," יצירת תוכן AI"]}),e.jsxs(ce,{className:"gap-2",onClick:()=>B(R.id),children:[e.jsx(vs,{className:"w-4 h-4"})," שמור כתבנית"]}),e.jsx(Ie,{}),e.jsxs(ce,{className:"gap-2 text-destructive focus:text-destructive",onClick:()=>N(R.id),children:[e.jsx(U,{className:"w-4 h-4"})," מחק"]})]})]}),e.jsx(Xs,{id:`drop-zone-${O+1}`,isActive:d})]},R.id)}),!d&&e.jsxs("div",{className:"py-6 flex justify-center gap-3",children:[e.jsx(Ks,{onPick:R=>M(R,t.length),children:e.jsxs("button",{className:"flex items-center gap-2 px-6 py-3 rounded-lg border-2 border-dashed border-gray-300 text-gray-400 hover:border-blue-400 hover:text-blue-500 transition-colors",children:[e.jsx(se,{className:"w-5 h-5"}),e.jsx("span",{className:"text-sm font-medium",children:"הוסף ווידג'ט"})]})}),e.jsx(cl,{onPick:R=>G(R),children:e.jsxs("button",{className:"flex items-center gap-2 px-6 py-3 rounded-lg border-2 border-dashed border-gray-300 text-gray-400 hover:border-purple-400 hover:text-purple-500 transition-colors",children:[e.jsx(za,{className:"w-5 h-5"}),e.jsx("span",{className:"text-sm font-medium",children:"הוסף תבנית"})]})})]})]})})}),e.jsxs("div",{className:"fixed bottom-6 left-6 z-30 flex items-center gap-1 bg-[#23272f] rounded-lg shadow-lg border border-white/10 p-1",children:[e.jsx("button",{className:"w-7 h-7 rounded flex items-center justify-center text-white/50 hover:text-white hover:bg-white/10 transition-colors disabled:opacity-30",onClick:()=>ae(R=>Math.max(50,R-10)),disabled:W<=50,title:"הקטן",children:e.jsx(pa,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-[10px] text-white/60 w-10 text-center font-mono",children:[W,"%"]}),e.jsx("button",{className:"w-7 h-7 rounded flex items-center justify-center text-white/50 hover:text-white hover:bg-white/10 transition-colors disabled:opacity-30",onClick:()=>ae(R=>Math.min(150,R+10)),disabled:W>=150,title:"הגדל",children:e.jsx(ja,{className:"w-3.5 h-3.5"})}),W!==100&&e.jsx("button",{className:"w-7 h-7 rounded flex items-center justify-center text-white/50 hover:text-white hover:bg-white/10 transition-colors",onClick:()=>ae(100),title:"אפס זום",children:e.jsx(Wt,{className:"w-3 h-3"})})]})]})}function li(){const{selectedClient:t}=qt(),{t:a,language:s}=ve(),[j,d]=D.useState([]),[l,r]=D.useState(!0),[n,o]=D.useState(null),[b,N]=D.useState(!1),[p,v]=D.use
48State(""),[h,I]=D.useState(""),B=w=>w.trim().toLowerCase().replace(/[^\w\s-]/g,"").replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`page-${Date.now()}`,L=D.useCallback(async()=>{if(!t)return;r(!0);const{data:w}=await ee.from("landing_pages").select("*").eq("client_id",t.id).order("created_at",{ascending:!1});d(w||[]),r(!1)},[t==null?void 0:t.id]);D.useEffect(()=>{L()},[L]);const E=async()=>{if(!t||!p.trim())return;let w=h.trim()?h.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""):B(p);(!w||w==="-"||/^-+$/.test(w))&&(w=`page-${Date.now()}`);const{data:H}=await ee.from("landing_pages").select("id").eq("slug",w).maybeSingle();H&&(w=`${w}-${Math.random().toString(36).slice(2,6)}`);const{error:W}=await ee.from("landing_pages").insert({client_id:t.id,name:p.trim(),slug:w,page_data:{sections:[]}});if(W){V.error(a("landing.errorCreating"));return}V.success(a("landing.pageCreated")),N(!1),v(""),I(""),L()},M=async w=>{if(!t)return;const{error:H}=await ee.from("landing_pages").insert({client_id:t.id,name:`${w.name} (${a("landing.copyLabel")})`,slug:`${w.slug}-copy-${Date.now()}`,page_data:w.page_data,meta_title:w.meta_title,meta_description:w.meta_description});if(H){V.error(a("landing.errorDuplicating"));return}V.success(a("landing.pageDuplicated")),L()},G=async w=>{await ee.from("landing_pages").delete().eq("id",w),V.success(a("landing.pageDeleted")),(n==null?void 0:n.id)===w&&o(null),L()},z=async w=>{const H=w.status==="published"?"draft":"published";await ee.from("landing_pages").update({status:H,published_at:H==="published"?new Date().toISOString():null}).eq("id",w.id),V.success(a(H==="published"?"landing.pagePublished":"landing.pageDraft")),L()},Z=async(w,H)=>{await ee.from("landing_pages").update(H).eq("id",w.id);const W={...w,...H};o(W),d(ae=>ae.map(le=>le.id===w.id?W:le))};return t?e.jsxs("div",{className:"p-6 space-y-6",dir:"rtl",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"בונה דפי נחיתה"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"צור דפי נחיתה עם עריכה ויזואלית, AI ו-A/B testing"})]}),e.jsxs(ns,{open:b,onOpenChange:N,children:[e.jsx(Ys,{asChild:!0,children:e.jsxs(_,{className:"gap-1.5",children:[e.jsx(se,{className:"w-4 h-4"})," דף חדש"]})}),e.jsxs(cs,{dir:"rtl",children:[e.jsx(os,{children:e.jsx(ds,{children:"יצירת דף נחיתה"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(m,{placeholder:"שם הדף",value:p,onChange:w=>{v(w.target.value),h||I(B(w.target.value))}}),e.jsxs("div",{children:[e.jsx(m,{placeholder:"slug (כתובת URL) - יוגדר אוטומטית",value:h,onChange:w=>I(w.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),dir:"ltr"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",dir:"ltr",children:["blacksheepbi.com/lp/",h||B(p)||"..."]})]}),e.jsx(_,{onClick:E,className:"w-full",disabled:!p.trim(),children:"צור דף"})]})]})]})]}),n?e.jsx(xl,{page:n,onBack:()=>o(null),onSave:Z,onTogglePublish:z}):e.jsx(e.Fragment,{children:l?e.jsx("p",{className:"text-muted-foreground",children:"טוען..."}):j.length===0?e.jsx(We,{children:e.jsxs(qe,{className:"p-8 text-center",children:[e.jsx(Ke,{className:"w-12 h-12 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground",children:"אין דפי נחיתה עדיין. צור את הראשון!"})]})}):e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-4",children:j.map(w=>{var H;return e.jsxs(We,{className:"group cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>o(w),children:[e.jsx(Zt,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Xt,{className:"text-sm",children:w.name}),e.jsx(pe,{className:w.status==="published"?"bg-green-500/20 text-green-400 border-green-500/30":"",children:w.status==="published"?"מפורסם":"טיוטה"})]})}),e.jsxs(qe,{children:[e.jsxs("p",{className:"text-xs text-muted-foreground font-mono mb-3",children:["/",w.slug]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(pe,{variant:"outline",className:"text-[10px]",children:[(((H=w.page_data)==null?void 0:H.sections)||[]).length," סקשנים"]}),e.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[w.status==="published"&&e.jsx(dl,{slug:w.slug,size:"card"}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:W=>{W.stopPropagation(),z(w)},children:e.jsx(Oe,{className:"w-3.5 h-3.5"})}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:W=>{W.stopPropagation(),M(w)},children:e.jsx(Ve,{className:"w-3.5 h-3.5"})}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:W=>{W.stopPropagation(),G(w.id)},children:e.jsx(U,{className:"w-3.5 h-3.5 text-destructive"})})]})]})]})]},w.id)})})})]}):null}function dl({slug:t,size:a}){const[s,j]=D.useState(!1),{t:d}=ve(),l=`https://blacksheepbi.com/lp/${t}`,r=n=>{n.stopPropagation(),navigator.clipboard.writeText(l),j(!0),V.success(d("landing.linkCopied")),setTimeout(()=>j(!1),2e3)};return a==="card"?e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:r,title:"העתק לינק",children:s?e.jsx(ts,{className:"w-3.5 h-3.5 text-green-500"}):e.jsx(ls,{className:"w-3.5 h-3.5"})}):e.jsxs(_,{variant:"outline",size:"sm",className:"gap-1",onClick:r,children:[s?e.jsx(ts,{className:"w-3.5 h-3.5 text-green-500"}):e.jsx(ls,{className:"w-3.5 h-3.5"}),s?"הועתק!":"העתק לינק"]})}function xl({page:t,onBack:a,onSave:s,onTogglePublish:j}){var _s,Ps,Ds,Is,Ls,Rs;const{t:d,language:l}=ve(),r=((_s=t.page_data)==null?void 0:_s.sections)||[],n=((Ps=t.page_data)==null?void 0:Ps.globalStyle)||{},[o,b]=D.useState("desktop"),[N,p]=D.useState(null),[v,h]=D.useState(null),[I,B]=D.useState(null),[L,E]=D.useState(!1),[M,G]=D.useState(!1),z=((Ds=t.page_data)==null?void 0:Ds.customTemplates)||[],Z=((Is=t.page_data)==null?void 0:Is.popups)||[],w=((Ls=t.page_data)==null?void 0:Ls.revisions)||[],[H,W]=D.useState(!1),[ae,le]=D.use
48State(null),[Q,fe]=D.useState(null),[ie,R]=D.useState([r]),[q,O]=D.useState(0),Te=q>0,Ne=q<ie.length-1,A=ea(As(ia,{activationConstraint:{distance:8}}),As(la)),X=u=>{const c=ie.slice(0,q+1);c.push(u),c.length>50&&c.shift(),R(c),O(c.length-1),s(t,{page_data:{...t.page_data,sections:u}})},_e=()=>{if(!Te)return;const u=ie[q-1];O(q-1),s(t,{page_data:{...t.page_data,sections:u}})},we=()=>{if(!Ne)return;const u=ie[q+1];O(q+1),s(t,{page_data:{...t.page_data,sections:u}})};D.useEffect(()=>{const u=c=>{(c.ctrlKey||c.metaKey)&&c.key==="z"&&(c.preventDefault(),c.shiftKey?we():_e()),(c.ctrlKey||c.metaKey)&&c.key==="y"&&(c.preventDefault(),we())};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)});const ye=(u,c)=>{const x={id:crypto.randomUUID(),type:u,content:Ha(u,l),order:c,style:{bgColor:"",textColor:"",padding:"py-8 px-6"}},y=[...r];y.splice(c,0,x),X(y)},De=u=>{ye(u,r.length)},Ce=(u,c)=>{const x=r.find(y=>y.id===u);if(x!=null&&x.isGlobal&&(x!=null&&x.globalId)){const y=x.globalId;X(r.map(F=>F.globalId===y?{...F,content:c}:F))}else X(r.map(y=>y.id===u?{...y,content:c}:y))},$e=(u,c)=>{const x=r.find(y=>y.id===u);if(x!=null&&x.isGlobal&&(x!=null&&x.globalId)){const y=x.globalId;X(r.map(F=>F.globalId===y?{...F,style:{...F.style,...c}}:F))}else X(r.map(y=>y.id===u?{...y,style:{...y.style,...c}}:y))},P=(u,c)=>{X(r.map(x=>x.id===u?{...x,...c}:x))},re=u=>{h(u),setTimeout(()=>{const c=document.getElementById(`section-editor-${u}`);c==null||c.scrollIntoView({behavior:"smooth",block:"center"})},100)},ne=u=>X(r.filter(c=>c.id!==u)),ws=u=>{const c=r.findIndex(F=>F.id===u);if(c<0)return;const x={...r[c],id:crypto.randomUUID(),content:{...r[c].content}},y=[...r];y.splice(c+1,0,x),X(y)},ys=u=>{const c=r.findIndex(x=>x.id===u);c<=0||X(Ue(r,c,c-1))},Cs=u=>{const c=r.findIndex(x=>x.id===u);c<0||c>=r.length-1||X(Ue(r,c,c+1))},dt=u=>{var c,x;(x=(c=u.active.data)==null?void 0:c.current)!=null&&x.isNewWidget&&(W(!0),le(u.active.data.current.type||null))},xt=u=>{var oe,Os;const{active:c,over:x}=u;if(W(!1),le(null),(Os=(oe=c.data)==null?void 0:oe.current)!=null&&Os.isNewWidget){const ke=c.data.current.type;if(x!=null&&x.id&&String(x.id).startsWith("drop-zone-")){const _t=parseInt(String(x.id).replace("drop-zone-",""),10);ye(ke,_t)}else x==null||x.id,De(ke);return}if(!x||c.id===x.id)return;const y=r.findIndex(ke=>ke.id===c.id),F=r.findIndex(ke=>ke.id===x.id);y>=0&&F>=0&&X(Ue(r,y,F))},ks=async u=>{var x;const c=r.find(y=>y.id===u);if(c){p(u);try{const y=await ee.functions.invoke("ai-generate-content",{body:{section_type:c.type,current_content:c.content,page_name:t.name}});if(y.error)throw y.error;(x=y.data)!=null&&x.content&&(Ce(u,y.data.content),V.success(d("landing.aiContentCreated")))}catch{V.error(d("landing.aiContentError"))}p(null)}},ht=u=>{const c={...n,...u};s(t,{page_data:{...t.page_data,globalStyle:c,sections:r}})},mt=u=>{const c=r.find(x=>x.id===u);c!=null&&c.style&&(B({...c.style}),V.success("סגנון הועתק"))},ut=u=>{if(!I){V.error("אין סגנון להדבקה");return}$e(u,I),V.success("סגנון הודבק")},Ss=u=>{const c=r.find(oe=>oe.id===u);if(!c)return;const x=prompt("שם התבנית:");if(!x)return;const y={id:crypto.randomUUID(),name:x,section:{...c,id:crypto.randomUUID(),content:{...c.content},style:{...c.style}}},F=[...z,y];s(t,{page_data:{...t.page_data,customTemplates:F,sections:r}}),V.success(`תבנית "${x}" נשמרה`)},pt=u=>{const c=z.find(x=>x.id===u);c&&(X([...r,{...c.section,id:crypto.randomUUID()}]),V.success(`תבנית "${c.name}" נוספה`))},jt=u=>{const c=z.filter(x=>x.id!==u);s(t,{page_data:{...t.page_data,customTemplates:c,sections:r}}),V.success("תבנית נמחקה")},Ts=u=>{const c=Ns.find(y=>y.id===u);if(!c)return;const x=c.sections.map(y=>({...y,id:crypto.randomUUID(),content:{...y.content},style:{...y.style}}));X([...r,...x]),V.success(l==="he"?`תבנית "${c.name}" נוספה`:`Template "${c.name}" added`)},gt=()=>{const u={id:crypto.randomUUID(),name:`פופאפ ${Z.length+1}`,trigger:"time-delay",triggerValue:"5",sections:[],enabled:!0};s(t,{page_data:{...t.page_data,popups:[...Z,u],sections:r}}),V.success("פופאפ נוסף")},vt=(u,c)=>{s(t,{page_data:{...t.page_data,popups:Z.map(x=>x.id===u?{...x,...c}:x),sections:r}})},bt=u=>{s(t,{page_data:{...t.page_data,popups:Z.filter(c=>c.id!==u),sections:r}}),V.success("פופאפ נמחק")},ft=u=>{const c={id:crypto.randomUUID(),timestamp:new Date().toISOString(),label:`גרסה ${w.length+1}`,data:{sections:JSON.parse(JSON.stringify(r)),globalStyle:n}},x=[...w,c].slice(-20);s(t,{page_data:{...t.page_data,revisions:x,sections:r}}),V.success("גרסה נשמרה")},Nt=u=>{const c=w.find(x=>x.id===u);c&&(s(t,{page_data:{...t.page_data,sections:c.data.sections,globalStyle:c.data.globalStyle}}),V.success("גרסה שוחזרה"))},wt=u=>{s(t,{page_data:{...t.page_data,revisions:w.filter(c=>c.id!==u),sections:r}})},yt=()=>{const u=JSON.stringify(t.page_data,null,2),c=new Blob([u],{type:"application/json"}),x=URL.createObjectURL(c),y=document.createElement("a");y.href=x,y.download=`${t.slug}.json`,y.click(),URL.revokeObjectURL(x),V.success("הדף יוצא בהצלחה")},Ct=()=>{const u=document.createElement("input");u.type="file",u.accept=".json",u.onchange=async c=>{var y;const x=(y=c.target.files)==null?void 0:y[0];if(x)try{const F=await x.text(),oe=JSON.parse(F);oe.sections?(s(t,{page_data:oe}),V.success("הדף יובא בהצלחה")):V.error("קובץ לא תקי×
48Ÿ")}catch{V.error("שגיאה בייבוא")}},u.click()},kt=u=>{const c=u.map(x=>({...x,id:x.id||crypto.randomUUID(),style:x.style||{padding:"py-8 px-6"}}));X([...r,...c])},St=u=>{const c=r.find(x=>x.id===u);c&&(fe(JSON.parse(JSON.stringify(c))),V.success("ווידג'ט הועתק"))},Tt=u=>{if(!Q)return;const c={...Q,id:crypto.randomUUID()},x=[...r];x.splice(u,0,c),X(x),V.success("ווידג'ט הודבק")};if(M){const u={fontFamily:n.fontFamily||void 0,backgroundColor:n.bgColor||void 0,color:n.textColor||void 0,maxWidth:n.maxWidth||void 0,margin:n.maxWidth?"0 auto":void 0},c=o==="mobile"?"max-w-[390px]":o==="tablet"?"max-w-[768px]":"max-w-full";return e.jsxs("div",{className:"fixed inset-0 z-[100] bg-background flex flex-col",style:{right:0},children:[e.jsxs("div",{className:"h-12 bg-muted/80 border-b flex items-center justify-between px-4",children:[e.jsx(_,{variant:"outline",size:"sm",onClick:()=>G(!1),children:l==="he"?"← חזרה לעורך":"← Back to editor"}),e.jsx("div",{className:"flex gap-1",children:["desktop","tablet","mobile"].map(x=>e.jsx(_,{variant:o===x?"default":"outline",size:"sm",onClick:()=>b(x),children:x==="desktop"?"🖥":x==="tablet"?"📱":"📲"},x))}),e.jsx("div",{})]}),e.jsx("div",{className:"flex-1 overflow-auto flex justify-center bg-muted p-4",children:e.jsx("div",{className:`${c} w-full bg-white rounded-lg overflow-hidden shadow-xl`,children:e.jsx("div",{dir:l==="he"?"rtl":"ltr",style:u,children:r.filter(x=>{var y;return!x.hidden&&!((y=x.hideOn)!=null&&y.includes(o))}).map(x=>e.jsx(tt,{section:x},x.id))})})})]})}return e.jsxs("div",{className:"flex flex-col bg-[#1a1d23] -m-6 h-[calc(100vh-4rem)] overflow-hidden",dir:"rtl",children:[e.jsx(Za,{pageName:t.name,pageSlug:t.slug,pageStatus:t.status,canUndo:Te,canRedo:Ne,onBack:a,onUndo:_e,onRedo:we,onTogglePublish:()=>j(t),onExport:yt,onImport:Ct,onPreview:()=>G(!0),onImportFromUrl:kt}),e.jsx("div",{className:"flex flex-1 min-h-0",children:e.jsxs(sa,{sensors:A,collisionDetection:ta,onDragStart:dt,onDragEnd:xt,children:[e.jsx(al,{sections:r,globalStyle:n,selectedSectionId:v,isDraggingNewWidget:H,generatingAI:N,popups:Z,revisions:w,customTemplates:z,showRevisions:L,pageSettings:{meta_title:t.meta_title||"",meta_description:t.meta_description||"",...((Rs=t.page_data)==null?void 0:Rs.pageSettings)||{}},previewDevice:o,onAddSection:De,onUpdateSection:Ce,onUpdateSectionStyle:$e,onUpdateSectionMeta:P,onRemoveSection:ne,onDuplicateSection:ws,onSelectSection:re,onDeselectSection:()=>h(null),onMoveSectionUp:ys,onMoveSectionDown:Cs,onGenerateAI:ks,onUpdateGlobalStyle:ht,onAddTemplate:Ts,onAddPopup:gt,onUpdatePopup:vt,onRemovePopup:bt,onSaveRevision:()=>ft(),onRestoreRevision:Nt,onDeleteRevision:wt,onAddFromCustomTemplate:pt,onRemoveCustomTemplate:jt,onSaveAsTemplate:Ss,onSetDevice:b,onToggleRevisions:()=>E(!L),onUpdatePageSettings:u=>{var oe;const{meta_title:c,meta_description:x,...y}=u,F={};c!==void 0&&(F.meta_title=c),x!==void 0&&(F.meta_description=x),Object.keys(y).length>0&&(F.page_data={...t.page_data,pageSettings:{...((oe=t.page_data)==null?void 0:oe.pageSettings)||{},...y},sections:r}),Object.keys(F).length>0&&s(t,F)}}),e.jsx(ol,{sections:r,globalStyle:n,previewDevice:o,selectedSectionId:v,isDraggingNewWidget:H,draggedWidgetType:ae,onSelectSection:re,onDuplicateSection:ws,onMoveSectionUp:ys,onMoveSectionDown:Cs,onRemoveSection:ne,onToggleHidden:u=>{var c;return P(u,{hidden:!((c=r.find(x=>x.id===u))!=null&&c.hidden)})},onGenerateAI:ks,onCopyStyle:mt,onPasteStyle:ut,onSaveAsTemplate:Ss,onInlineEdit:(u,c,x)=>{var y;return Ce(u,{...(y=r.find(F=>F.id===u))==null?void 0:y.content,[c]:x})},copiedStyle:I,onAddSectionAt:ye,onAddTemplate:Ts,onCopyWidget:St,onPasteWidget:Tt,copiedWidget:Q}),H&&e.jsx(aa,{children:(()=>{const u=ae?je.find(x=>x.type===ae):null,c=u==null?void 0:u.icon;return e.jsxs("div",{className:"px-4 py-3 bg-blue-500 text-white rounded-lg shadow-xl text-sm font-medium opacity-90 flex items-center gap-2",children:[c&&e.jsx(c,{className:"w-4 h-4"}),(u==null?void 0:u.label)||"ווידג'ט"]})})()})]})})]})}export{li as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.