@creaditor/business-ai 1.0.51 → 1.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28438,15 +28438,15 @@ rb = $h.default = (0, pK.default)(/* @__PURE__ */ (0, uK.jsx)("path", {
28438
28438
  }), "Refresh");
28439
28439
  const lb = [
28440
28440
  { id: "authentic_text", label: "טקסט אישי", questions: [{ id: "topic", label: "נושא / תיאור קצר", inputType: "multiline" }] },
28441
- {
28442
- id: "webinar",
28443
- label: "וובינר",
28444
- questions: [
28445
- { id: "date", label: "תאריך", inputType: "date" },
28446
- { id: "time", label: "שעה", inputType: "time" },
28447
- { id: "topic", label: "נושא / תיאור", inputType: "multiline" }
28448
- ]
28449
- },
28441
+ // {
28442
+ // id: "webinar",
28443
+ // label: "וובינר",
28444
+ // questions: [
28445
+ // { id: "date", label: "תאריך", inputType: "date" },
28446
+ // { id: "time", label: "שעה", inputType: "time" },
28447
+ // { id: "topic", label: "נושא / תיאור", inputType: "multiline" },
28448
+ // ],
28449
+ // },
28450
28450
  { id: "designed_mail", label: "מעוצב (מצב מהיר)", questions: [{ id: "topic", label: "נושא / תיאור קצר", inputType: "multiline" }] },
28451
28451
  { id: "studio_design", label: "מעוצב (סטודיו)", questions: [{ id: "topic", label: "נושא / תיאור קצר", inputType: "multiline" }] },
28452
28452
  { id: "designed_mail_advanced", comingSoon: !0, label: "מעצב פרו (סטודיו)", questions: [{ id: "topic", label: "נושא / תיאור קצר", inputType: "multiline" }] }
@@ -517,7 +517,7 @@ Newsletter creation ✉️, Landing pages 🎯, Digital courses 📇 and more`,s
517
517
  ${c(u,.6)} 50%,
518
518
  ${c(u,.4)} 100%
519
519
  )`,animationDelay:`${f*.15}s`}},f))})]}),A.jsxs(Ae,{className:l?gh:"",sx:{fontSize:{xs:"0.875rem",sm:"1rem"},fontWeight:500,color:"text.secondary"},children:[e,A.jsx("span",{className:fh,children:a})]}),t&&A.jsxs(K,{className:l?hh:"",sx:{width:"100%",maxWidth:"600px",display:"flex",flexDirection:"column",gap:2,mt:1},children:[A.jsx(hg,{variant:"rectangular",height:60,sx:{borderRadius:2}}),A.jsx(hg,{variant:"rectangular",height:40,width:"80%",sx:{borderRadius:2}}),A.jsx(hg,{variant:"rectangular",height:40,width:"60%",sx:{borderRadius:2}})]})]}):null}const _i=Ul,nO=["קהילה ועמותות","טכנולוגיה","בריאות","חינוך","אוכל ומסעדות","אופנה","נדל״ן","כספים וביטוח","תחבורה ולוגיסטיקה","תקשורת ושיווק","אמנות ותרבות","ספורט ופנאי","ייעוץ וניהול","מסחר קמעונאי","ייצור","אנרגיה וסביבה","משפטים","בנייה","חקלאות","תיירות","בידור","ביטחון"],aO=["מקצועי","ידידותי","פורמלי","לא פורמלי","חברתי","מעודכן","קלאסי","צעיר","משפחתי","איכותי","מהיר","אמין","יצירתי","חכם","חם","קר","מעורר השראה","מעשי","יוקרתי","נגיש"],js=e=>{if(!e||typeof e!="string")return e;const t=e.trim();return!t||/^https?:\/\//i.test(t)?t:`https://${t}`};function rO(e,t,n){let a="";const r=n.trim().toLowerCase();if(r)try{const i=/^https?:\/\//i.test(r)?r:`https://${r}`;a=new URL(i).hostname.replace(/^www\./,"")}catch{}const l=`${a} ${r} ${e.toLowerCase()} ${t.toLowerCase()}`;return/linkedin|לינקדאין|לינקדין/.test(l)?Sx:/facebook|fb\.com|fb\.me|פייסבוק/.test(l)?mx:/instagram|instagr\.am|אינסטגרם/.test(l)?vx:/youtube|youtu\.be|יוטיוב/.test(l)?xx:/(^|\.)x\.com|twitter\.com|טוויטר|טוויט/.test(l)?bx:/tiktok|טיקטוק|tik tok/.test(l)?jx:/whatsapp|wa\.me|וואטסאפ|ווטסאפ/.test(l)?wx:/telegram|t\.me|טלגרם/.test(l)?Bx:/reddit|רדיט/.test(l)?Mx:/pinterest|פינטרסט/.test(l)?Vx:/github|גיטהאב|גיטהב/.test(l)?Fx:qx}function lO({platform:e,url:t,onPlatformCommit:n,onUrlChange:a,onRemove:r}){const[l,i]=v.useState(e);v.useEffect(()=>{i(e)},[e]);const o=v.useCallback(()=>{l!==e&&n(e,l)},[e,l,n]),s=rO(e,l,t);return A.jsxs(K,{sx:{display:"flex",alignItems:"flex-start",gap:1,mb:1,flexDirection:{xs:"column",sm:"row"}},children:[A.jsx(at,{fullWidth:!0,label:"פלטפורמה",value:l,onChange:p=>i(p.target.value),onBlur:o,onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),p.target.blur())},variant:"outlined",margin:"normal",size:"small",sx:{flex:{xs:"1 1 100%",sm:"0 0 min(200px, 34%)"}},placeholder:"לדוגמה: LinkedIn",InputProps:{startAdornment:A.jsx(ug,{position:"start",sx:{mr:0},children:A.jsx(s,{sx:{fontSize:22,color:"primary.main"},"aria-hidden":!0})})}}),A.jsx(at,{fullWidth:!0,label:"קישור",value:t,onChange:p=>a(e,p.target.value),variant:"outlined",margin:"normal",size:"small",sx:{flex:1},placeholder:"https://..."}),A.jsx(Hn,{color:"error",onClick:()=>r(e),sx:{mt:1},"aria-label":"הסר רשת חברתית",children:A.jsx(Qs,{})})]})}const iO=e=>({business_name:"",industry:"",business_type:"",business_type_options:[],keywords:[],profit_intent:"",is_haredi_sector:null,business_tone:"",description:"",overall_confidence:0,owner:"",owner_gender:"",business_address:"",website:e||"",contacts:{email:"",phone:""},socials:{linkedin:"",instagram:"",facebook:""},theme:void 0,website_confidence:0,confidence_scores:{website:0,contacts:{phone:0},socials:{},overall:0},token_usage:{total:{prompt_tokens:0,completion_tokens:0,total_tokens:0},breakdown:{analyze_business:{prompt_tokens:0,completion_tokens:0,total_tokens:0}}},estimated_cost_usd:0,source_urls:[],analyzed_at:new Date().toISOString()}),Ts=e=>{var t,n;return e?{...e,business_address:e.business_address??(e==null?void 0:e.address)??"",business_type_options:Array.isArray(e.business_type_options)?e.business_type_options:[],keywords:Array.isArray(e.keywords)?e.keywords:[],description:Array.isArray(e.description)?e.description:e.description?[e.description]:[""],contacts:{email:((t=e.contacts)==null?void 0:t.email)??"",phone:((n=e.contacts)==null?void 0:n.phone)??""},socials:e.socials&&typeof e.socials=="object"?e.socials:{linkedin:"",instagram:"",facebook:""},theme:(()=>{var i;const a=(i=e.theme)==null?void 0:i.logoHeaderBackground,r=(e==null?void 0:e.logoHeaderBackground)??(e==null?void 0:e.logoBackgroundHex),l=typeof a=="string"?a:typeof r=="string"?r:void 0;if(e.theme)return{primary:e.theme.primary||"",secondary:e.theme.secondary||"",colors:Array.isArray(e.theme.colors)?e.theme.colors:[],...l?{logoHeaderBackground:l}:{}};if(l)return{primary:"",secondary:"",colors:[],logoHeaderBackground:l}})()}:null};function oO({data:e,websiteUrl:t,setActiveStep:n,onSave:a,urls:r,language:l}){var Pe,je,ot,D,te;const i=Ni(),[o,s]=v.useState(null),[p,u]=v.useState(!0),[c,d]=v.useState(null),[f,W]=v.useState(!1),[m,x]=v.useState(null),[h,g]=v.useState([]),[C,y]=v.useState([]),[E,S]=v.useState((e==null?void 0:e.logo)||(e&&typeof e=="object"&&"logo"in e?e.logo:"")),k=v.useRef(null),R=v.useRef(""),V=v.useRef(!1),b=v.useRef(!1),[B,M]=v.useState(0),F=v.useRef(new Map),z=v.useRef(0),T=()=>{F.current=new Map,z.current=0},j=U=>{const O=F.current;let Z=O.get(U);return Z||(Z=`social-row-${z.current++}`,O.set(U,Z)),Z},{shadowRoot:P,stepBeforeStep1:L,step2Data:q}=Ua(),[w,X]=v.useState(!1),ee=v.useCallback(U=>{if(!U){S(""),s(Z=>{var Ie,Se,se,xe;return!Z||!((Ie=Z.theme)!=null&&Ie.logoHeaderBackground)?Z:{...Z,theme:{...Z.theme,primary:((Se=Z.theme)==null?void 0:Se.primary)??"",secondary:((se=Z.theme)==null?void 0:se.secondary)??"",colors:((xe=Z.theme)==null?void 0:xe.colors)??[],logoHeaderBackground:void 0}}});return}U.startsWith("http://")||U.startsWith("https://")?zj(U).then(Z=>{S(Z.pngDataUrl),s(Ie=>{var Se,se,xe,Qe;return Ie&&{...Ie,theme:{...Ie.theme,primary:((Se=Ie.theme)==null?void 0:Se.primary)??"",secondary:((se=Ie.theme)==null?void 0:se.secondary)??"",colors:((xe=Ie.theme)==null?void 0:xe.colors)??[],logoHeaderBackground:((Qe=Ie.theme)==null?void 0:Qe.logoHeaderBackground)??Z.backgroundHex}}})}).catch(()=>{S(U)}):S(U)},[]),Q=U=>{var Ie;const O=(Ie=U.target.files)==null?void 0:Ie[0];if(!O)return;if(!O.type.startsWith("image/")){alert("אנא בחר קובץ תמונה בלבד");return}if(O.size>5*1024*1024){alert("קובץ התמונה גדול מדי. אנא בחר קובץ קטן מ-5MB");return}const Z=new FileReader;Z.onloadend=()=>{const Se=Z.result;S(Se)},Z.onerror=()=>{alert("שגיאה בקריאת הקובץ. אנא נסה שוב.")},Z.readAsDataURL(O)},G=()=>{S(""),s(U=>{var O,Z,Ie,Se;return(O=U==null?void 0:U.theme)!=null&&O.logoHeaderBackground?{...U,theme:{...U.theme,primary:((Z=U.theme)==null?void 0:Z.primary)??"",secondary:((Ie=U.theme)==null?void 0:Ie.secondary)??"",colors:((Se=U.theme)==null?void 0:Se.colors)??[],logoHeaderBackground:void 0}}:U}),k.current&&(k.current.value="")},Y=v.useCallback(()=>[...nO].sort(),[]),ne=v.useCallback(()=>[...aO].sort(),[]);v.useEffect(()=>{g(Y()),y(ne())},[Y,ne]),v.useEffect(()=>{if(o!=null&&o.industry){const U=Y();U.includes(o.industry)||U.push(o.industry),g(U.sort())}},[o==null?void 0:o.industry,Y]),v.useEffect(()=>{if(o!=null&&o.business_tone){const U=ne();U.includes(o.business_tone)||U.push(o.business_tone),y(U.sort())}},[o==null?void 0:o.business_tone,ne]);const fe=U=>!U||typeof U!="object"?!1:"business_name"in U||"industry"in U||"business_type"in U||"keywords"in U||"description"in U;v.useEffect(()=>{if(e&&fe(e)&&e.logo){const U=e.logo;U.startsWith("http://")||U.startsWith("https://")?ee(U):S(U)}else if(e&&"logo"in e&&e.logo){const U=e.logo;U.startsWith("http://")||U.startsWith("https://")?ee(U):S(U)}},[e,ee]),v.useEffect(()=>{!p&&o&&X(!0)},[p,o]),v.useEffect(()=>{(async()=>{var xe,Qe,Je,ft,bt,kt,Dt,rt;const O=t?js(t).replace(/\/$/,"").toLowerCase():"",Z=t&&t.trim()!=="";if(R.current===O&&o!==null&&Z){u(!1);return}if(V.current)return;const Se=!!(e&&fe(e));if(!Se&&(q!=null&&q.businessData)&&(q!=null&&q.websiteUrl)){const Xe=Ts(q.businessData);if(Xe){T(),s(Xe),u(!1),R.current="",q.logo&&(q.logo.startsWith("http://")||q.logo.startsWith("https://")?ee(q.logo):S(q.logo));return}}if(Z){const Xe=e==null?void 0:e.business_name;if(!b.current&&Se&&Xe&&Xe.trim()!==""){const _e=Ts(e);if(_e){T(),s(_e),u(!1),R.current=O;const Ve=e==null?void 0:e.logo;Ve&&(Ve.startsWith("http://")||Ve.startsWith("https://")?ee(Ve):S(Ve));return}}const ge=Array.isArray(r)?r.map(js):[];ge.push(js(t));try{V.current=!0,b.current=!1,u(!0),d(null);const _e=await ix(t,ge,"",l);let Ve=Ts(_e);const It=(xe=e==null?void 0:e.theme)==null?void 0:xe.logoHeaderBackground;if(Ve&&typeof It=="string"&&(Ve={...Ve,theme:{...Ve.theme,primary:((Qe=Ve.theme)==null?void 0:Qe.primary)??"",secondary:((Je=Ve.theme)==null?void 0:Je.secondary)??"",colors:Array.isArray((ft=Ve.theme)==null?void 0:ft.colors)?Ve.theme.colors:[],logoHeaderBackground:It}}),Ve){T(),s(Ve),R.current=O;const Tt=_e==null?void 0:_e.logo;Tt&&ee(Tt)}else d("שגיאה בעיבוד הנתונים שהתקבלו מהשרת")}catch(_e){d(_e instanceof Error?_e.message:"שגיאה בטעינת הנתונים")}finally{u(!1),V.current=!1}return}if(e&&fe(e)){const Xe=Ts(e);if(Xe){T(),s(Xe),u(!1),R.current="";const ge=e==null?void 0:e.logo;ge&&(ge.startsWith("http://")||ge.startsWith("https://")?ee(ge):S(ge));return}}const se=Array.isArray(r)?r.map(js):[];if(se.length===0){T(),s(iO(t)),u(!1),R.current="";return}try{V.current=!0,u(!0),d(null);const Xe=await ix(t,se,"",l);let ge=Ts(Xe);const _e=(bt=e==null?void 0:e.theme)==null?void 0:bt.logoHeaderBackground;if(ge&&typeof _e=="string"&&(ge={...ge,theme:{...ge.theme,primary:((kt=ge.theme)==null?void 0:kt.primary)??"",secondary:((Dt=ge.theme)==null?void 0:Dt.secondary)??"",colors:Array.isArray((rt=ge.theme)==null?void 0:rt.colors)?ge.theme.colors:[],logoHeaderBackground:_e}}),ge){T(),s(ge),R.current="";const Ve=Xe==null?void 0:Xe.logo;Ve&&ee(Ve)}else d("שגיאה בעיבוד הנתונים שהתקבלו מהשרת")}catch(Xe){d(Xe instanceof Error?Xe.message:"שגיאה בטעינת הנתונים")}finally{u(!1),V.current=!1}})()},[t,q,B]);const pe=(U,O)=>{o&&s({...o,[U]:O})},me=(U,O,Z)=>{o&&s({...o,[U]:{...o[U],[O]:Z}})},ae=(U,O)=>{if(o){const Z=o.theme||{primary:"",secondary:"",colors:[]};s({...o,theme:{...Z,[U]:O}})}},H=U=>{if(!o)return;const O={primary:"",secondary:"",colors:[],...o.theme},Z=xe=>xe.toLowerCase(),Ie=new Set(U.map(Z)),Se=O.primary&&Ie.has(Z(O.primary))?O.primary:"",se=O.secondary&&Ie.has(Z(O.secondary))?O.secondary:"";s({...o,theme:{...O,primary:Se,secondary:se,colors:U}})},Ce=(U,O,Z)=>{if(o)if(U==="description"){const Se=[...Array.isArray(o.description)?o.description:o.description?[o.description]:[""]];Se[O]=Z,s({...o,description:Se})}else{const Ie=[...o[U]];Ie[O]=Z,s({...o,[U]:Ie})}},We=()=>{if(o){const U=[...o.business_type_options,""];s({...o,business_type_options:U})}},he=U=>{if(o){const O=o.business_type_options.filter((Z,Ie)=>Ie!==U);s({...o,business_type_options:O})}},ve=()=>{if(o){const O=[...Array.isArray(o.description)?o.description:o.description?[o.description]:[""],""];s({...o,description:O})}},ce=U=>{if(o){const Z=(Array.isArray(o.description)?o.description:o.description?[o.description]:[""]).filter((Ie,Se)=>Se!==U);s({...o,description:Z.length>0?Z:[""]})}},Ze=()=>{if(o){const U={...o.socials};let O=1,Z="social_media";for(;U[Z];)Z=`social_media_${O}`,O++;U[Z]="",F.current.has(Z)||F.current.set(Z,`social-row-${z.current++}`),s({...o,socials:U})}},re=U=>{if(o){F.current.delete(U);const O={...o.socials};delete O[U],s({...o,socials:O})}},Ke=(U,O)=>{if(o&&U!==O){const Z={...o.socials},Ie=Z[U]||"";delete Z[U];const Se=O.trim(),se=F.current.get(U);se&&(F.current.delete(U),Se&&F.current.set(Se,se)),Se&&(Z[Se]&&Se!==U?Z[Se]=Ie||Z[Se]:Z[Se]=Ie),s({...o,socials:Z})}},qe=(U,O)=>{if(o){const Z={...o.socials};Z[U]=O,s({...o,socials:Z})}},Be=async()=>{var ft,bt,kt,Dt;if(!o)return;const U=(t==null?void 0:t.trim())||((ft=o.website)==null?void 0:ft.trim())||"";let O=!1;(bt=o.website)!=null&&bt.trim()||(O=!1);const Z=E||"",Ie=Z.startsWith("data:image/"),Se=(kt=o==null?void 0:o.theme)==null?void 0:kt.logoHeaderBackground,se=Se&&/^#(000|000000)$/i.test(String(Se).trim()),xe=Se&&!se?Se:Se&&se?"white":void 0,Qe=(Dt=o==null?void 0:o.theme)!=null&&Dt.logoHeaderBackground&&/^#(000|000000)$/i.test(String(o.theme.logoHeaderBackground).trim())?{...o,theme:{...o.theme,logoHeaderBackground:"white"}}:o;if(!Qe.business_name){x("שם העסק הוא שדה חובה"),W(!1);return}const Je={businessData:Qe,logo:Z,websiteUrl:U,...xe?{logoBackgroundHex:xe}:{}};Ie&&(Je.logoToUpload=Z),W(!0),x(null);try{const rt={...Qe};delete rt._id,delete rt.__v,rt.business_address!==void 0&&(rt.address=rt.business_address),Array.isArray(rt.description)&&(rt.description=rt.description.filter(Boolean).join(`
520
- `)||""),O&&await Fj(U,rt)}catch(rt){const Xe=rt instanceof Error?rt.message:String(rt);if(Xe.includes("404")||Xe.includes("not found"))console.warn("Business analysis not in DB, saving to context only:",Xe);else{console.error("Failed to save business analysis:",Xe),x(`שמירה נכשלה: ${Xe}`),W(!1);return}}W(!1),a(Je),i&&i.triggerEvent("onDataComplete",Je),window.dispatchEvent(new CustomEvent("business-analysis-saved",{detail:o,bubbles:!0,composed:!0})),n(2)};if(p)return A.jsx(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:{xs:2,sm:3,md:5},minHeight:{xs:"300px",sm:"350px",md:"400px"}},children:A.jsx(tO,{text:"Analyzing",showSkeletons:!0})});if(c)return A.jsxs(K,{sx:{padding:{xs:2,sm:3,md:5},width:{xs:"100%",sm:"500px"},maxWidth:"100%",boxSizing:"border-box"},children:[A.jsx(Ml,{severity:"error",sx:{fontSize:{xs:"0.875rem",sm:"1rem"}},children:c}),A.jsx(ze,{variant:"text",color:"primary",onClick:()=>n(L),sx:{mt:2,fontSize:{xs:"0.875rem",sm:"1rem"}},children:"חזרה"})]});if(!o)return null;const Te=(t==null?void 0:t.trim())||(e&&typeof e=="object"&&"websiteUrl"in e?(Pe=e.websiteUrl)==null?void 0:Pe.trim():"")||((je=o==null?void 0:o.website)==null?void 0:je.trim())||"";return A.jsxs(K,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,height:"100%",width:"100%",maxWidth:"100%",boxSizing:"border-box",overflow:"hidden"},children:[A.jsxs(K,{sx:{flex:1,minHeight:0,height:"100%",maxHeight:"calc(90vh - 140px)",overflowY:"auto",overflowX:"hidden",padding:{xs:2,sm:3,md:5},paddingBottom:{xs:1,sm:1.5,md:2},WebkitOverflowScrolling:"touch"},children:[Te&&A.jsx(K,{className:w?_i.fadeUp:"",sx:{mb:{xs:2,sm:2.5},mt:{xs:.5,sm:1}},children:A.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1.25,px:{xs:1.5,sm:2},py:{xs:1,sm:1.125},borderRadius:2,border:"1px solid",borderColor:"divider",maxWidth:"100%",overflow:"hidden",bgcolor:U=>un(U.palette.primary.main,.06)},children:[A.jsx(dx,{sx:{fontSize:{xs:"1.125rem",sm:"1.25rem"},color:"text.secondary",flexShrink:0,opacity:.85}}),A.jsx(Ae,{variant:"body2",sx:{fontSize:{xs:"0.8125rem",sm:"0.875rem"},color:"text.primary",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",flex:1,direction:"ltr",textAlign:"left",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',fontWeight:500},children:js(Te)}),A.jsx(Hn,{size:"small",onClick:()=>{R.current="",b.current=!0,M(U=>U+1)},disabled:p,title:"נתח מחדש",sx:{flexShrink:0,opacity:.7,"&:hover":{opacity:1}},children:A.jsx(fx,{sx:{fontSize:"1.125rem"}})})]})}),A.jsxs(K,{className:w?_i.fadeUp:"",sx:{mb:{xs:2.5,sm:3}},children:[A.jsx(Ae,{component:"h1",variant:"h4",sx:{mt:Te?{xs:1.5,sm:2}:{xs:4,sm:4},fontSize:{xs:"1.5rem",sm:"1.875rem",md:"2rem"},fontWeight:700,letterSpacing:"-0.025em",lineHeight:1.2,color:"text.primary"},children:"עריכת פרטי העסק"}),A.jsx(Ae,{variant:"body2",className:w?_i.fadeUpDelay1:"",color:"text.secondary",sx:{mt:{xs:.75,sm:1},fontSize:{xs:"0.875rem",sm:"0.9375rem"},maxWidth:"min(48ch, 100%)",lineHeight:1.55},children:"עברו על השדות, עדכנו מה שצריך, והמשיכו לשלב הבא."})]}),A.jsx(K,{className:w?_i.fadeUpDelay2:"",children:A.jsxs(ya,{title:"לוגו",description:"מומלץ קובץ שקוף או רקע בהיר. אפשר לדלג אם אין לוגו מעודכן.",children:[A.jsx("input",{ref:k,type:"file",accept:"image/*",onChange:Q,style:{display:"none"},id:"logo-upload-input"}),E?A.jsxs(K,{sx:{p:{xs:1.5,sm:2,md:2.5},border:"1px dashed",borderColor:"divider",borderRadius:2,bgcolor:U=>un(U.palette.common.black,.02),transition:"border-color 0.2s ease, background-color 0.2s ease",mb:{xs:1.5,sm:2},"&:hover":{borderColor:"text.secondary",bgcolor:U=>un(U.palette.common.black,.035)}},children:[A.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:{xs:1,sm:1.5,md:2},mb:{xs:1.5,sm:2},flexDirection:{xs:"column",sm:"row"}},children:[A.jsx(Hn,{size:"small",color:"error",onClick:G,sx:{border:"1px solid rgba(211, 47, 47, 0.3)",alignSelf:{xs:"flex-start",sm:"auto"},"&:hover":{backgroundColor:"rgba(211, 47, 47, 0.08)",borderColor:"rgba(211, 47, 47, 0.5)"}},"aria-label":"הסר לוגו",children:A.jsx(Qs,{fontSize:"small"})}),A.jsx(K,{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:{xs:"80px",sm:"90px",md:"100px"},backgroundColor:(()=>{var Z;const U=((Z=o==null?void 0:o.theme)==null?void 0:Z.logoHeaderBackground)??"white";return/^#(000|000000)$/i.test(U.trim())||/^rgb\s*\(\s*0\s*,\s*0\s*,\s*0\s*\)$/i.test(U.trim())?"white":U})(),borderRadius:1,border:"1px solid rgba(0, 0, 0, 0.08)",p:{xs:.5,sm:1},width:{xs:"100%",sm:"auto"}},children:A.jsx("img",{src:E,alt:"Logo preview",style:{maxWidth:"100%",maxHeight:"100px",objectFit:"contain"}})})]}),A.jsx("label",{htmlFor:"logo-upload-input",children:A.jsx(ze,{variant:"outlined",component:"span",startIcon:A.jsx(Ax,{}),fullWidth:!0,sx:{textTransform:"none",borderRadius:{xs:1.5,sm:2},fontSize:{xs:"0.875rem",sm:"1rem"}},children:"החלף לוגו"})})]}):A.jsxs(K,{sx:{border:"1px dashed",borderColor:"divider",borderRadius:2,p:{xs:2,sm:2.5,md:3},textAlign:"center",bgcolor:U=>un(U.palette.common.black,.02),transition:"border-color 0.2s ease, background-color 0.2s ease","&:hover":{borderColor:"text.secondary",bgcolor:U=>un(U.palette.common.black,.035)}},children:[A.jsx("label",{htmlFor:"logo-upload-input",children:A.jsx(ze,{variant:"outlined",component:"span",startIcon:A.jsx(cx,{}),sx:{textTransform:"none",borderRadius:{xs:1.5,sm:2},px:{xs:2,sm:2.5,md:3},py:{xs:.75,sm:1},fontSize:{xs:"0.875rem",sm:"1rem"}},children:"העלה לוגו"})}),A.jsx(Ae,{variant:"caption",color:"text.secondary",sx:{mt:{xs:1,sm:1.5},display:"block",fontSize:{xs:"0.7rem",sm:"0.75rem"}},children:"תמונות PNG, JPG או SVG עד 5MB"})]})]})}),A.jsxs(ut,{spacing:0,className:w?_i.fadeUpDelay3:"",children:[A.jsx(ya,{title:"פרטי העסק",description:"שם, תעשייה, כתובת והגדרות סוג עסק — משמשים לנתח ולייצר תוצרים מדויקים יותר.",children:A.jsxs(ct,{container:!0,spacing:{xs:2,sm:2.5,md:3},children:[A.jsx(ct,{item:!0,xs:12,md:6,children:A.jsx(at,{fullWidth:!0,label:"שם העסק",value:o.business_name,onChange:U=>pe("business_name",U.target.value),variant:"outlined",margin:"normal"})}),A.jsxs(ct,{item:!0,xs:12,md:6,children:[A.jsx(at,{fullWidth:!0,label:"שם בעל.ת העסק (מלא)",value:o.owner,onChange:U=>pe("owner",U.target.value),variant:"outlined",margin:"normal"}),A.jsxs(aq,{row:!0,value:o.owner_gender??"",onChange:U=>pe("owner_gender",U.target.value),sx:{mt:.5,gap:{xs:.5,sm:1},"& .MuiFormControlLabel-root":{mr:0}},children:[A.jsx(Kc,{value:"male",control:A.jsx(Wg,{size:"small"}),label:A.jsxs(K,{component:"span",sx:{display:"flex",alignItems:"center",gap:.5},children:[A.jsx(Wx,{fontSize:"small"}),A.jsx("span",{children:"זכר"})]}),labelPlacement:"end"}),A.jsx(Kc,{value:"female",control:A.jsx(Wg,{size:"small"}),label:A.jsxs(K,{component:"span",sx:{display:"flex",alignItems:"center",gap:.5},children:[A.jsx(gx,{fontSize:"small"}),A.jsx("span",{children:"נקבה"})]}),labelPlacement:"end"}),A.jsx(Kc,{value:"other",control:A.jsx(Wg,{size:"small"}),label:A.jsxs(K,{component:"span",sx:{display:"flex",alignItems:"center",gap:.5},children:[A.jsx(hx,{fontSize:"small"}),A.jsx("span",{children:"אחר"})]}),labelPlacement:"end"})]})]}),A.jsx(ct,{item:!0,xs:12,md:6,children:A.jsx($W,{freeSolo:!0,options:h,value:o.industry||"",onChange:(U,O)=>{pe("industry",O||"")},onInputChange:(U,O)=>{pe("industry",O)},inputValue:o.industry||"",openOnFocus:!0,disablePortal:!0,componentsProps:{popper:{container:(P==null?void 0:P.getElementById("cdtr-business-ai-root"))||void 0,style:{zIndex:9999},modifiers:[{name:"offset",options:{offset:[0,4]}}]}},ListboxProps:{sx:{maxHeight:"300px","& .MuiAutocomplete-option":{padding:"8px 16px","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"},"&[aria-selected='true']":{backgroundColor:"rgba(0, 0, 0, 0.08)"}}}},PaperComponent:({children:U,...O})=>A.jsx(K,{...O,sx:{borderRadius:"4px",border:"1px solid rgba(0, 0, 0, 0.1)",marginTop:"4px",backgroundColor:"white"},children:U}),renderInput:U=>A.jsx(at,{...U,label:"תעשייה",variant:"outlined",margin:"normal"}),noOptionsText:h.length===0?"הקלד תעשייה":"אין אפשרויות"})}),A.jsx(ct,{item:!0,xs:12,md:6,children:A.jsx(at,{fullWidth:!0,label:"סוג עסק",value:o.business_type,onChange:U=>pe("business_type",U.target.value),variant:"outlined",margin:"normal"})}),A.jsx(ct,{item:!0,xs:12,md:6,children:A.jsx(at,{fullWidth:!0,label:"כתובת העסק",value:o.business_address??"",onChange:U=>pe("business_address",U.target.value),variant:"outlined",margin:"normal"})}),A.jsxs(ct,{item:!0,xs:12,children:[A.jsx(Ae,{variant:"subtitle2",sx:{mb:{xs:.75,sm:1},fontSize:{xs:"0.875rem",sm:"1rem"}},children:"אפשרויות סוג עסק"}),(Array.isArray(o.business_type_options)?o.business_type_options:[]).map((U,O)=>A.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[A.jsx(at,{fullWidth:!0,value:U,onChange:Z=>Ce("business_type_options",O,Z.target.value),variant:"outlined",margin:"normal",size:"small"}),A.jsx(Hn,{color:"error",onClick:()=>he(O),sx:{mt:1},"aria-label":"הסר אפשרות",children:A.jsx(Qs,{})})]},O)),A.jsx(ze,{variant:"outlined",startIcon:A.jsx(Fl,{}),onClick:We,sx:{mt:1},children:"הוספת אפשרות"})]}),A.jsx(ct,{item:!0,xs:12,children:A.jsx(f6,{value:o.keywords,onChange:U=>pe("keywords",U)})})]})}),A.jsx(er,{sx:{my:{xs:1.5,sm:2},borderColor:"divider"}}),A.jsx(ya,{title:"צבעי מותג",description:"גררו צבעים או עדכנו ראשי ומשני — משפיעים על תצוגת המותג בחוויה.",children:A.jsx(H6,{colors:((ot=o.theme)==null?void 0:ot.colors)??[],primary:((D=o.theme)==null?void 0:D.primary)||"",secondary:((te=o.theme)==null?void 0:te.secondary)||"",onPrimaryChange:U=>ae("primary",U),onSecondaryChange:U=>ae("secondary",U),onColorsChange:H})}),A.jsx(er,{sx:{my:{xs:1.5,sm:2},borderColor:"divider"}}),A.jsx(ya,{title:"טון ותוכן",description:"איך העסק נשמע, תיאור קצר וכתובת האתר לעדכון.",children:A.jsxs(ct,{container:!0,spacing:{xs:2,sm:2.5,md:3},children:[A.jsx(ct,{item:!0,xs:12,md:6,children:A.jsx($W,{freeSolo:!0,options:C,value:o.business_tone||"",onChange:(U,O)=>{pe("business_tone",O||"")},onInputChange:(U,O)=>{pe("business_tone",O)},inputValue:o.business_tone||"",openOnFocus:!0,disablePortal:!0,componentsProps:{popper:{container:(P==null?void 0:P.getElementById("cdtr-business-ai-root"))||void 0,style:{zIndex:9999},modifiers:[{name:"offset",options:{offset:[0,4]}}]}},ListboxProps:{sx:{maxHeight:"300px","& .MuiAutocomplete-option":{padding:"8px 16px","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"},"&[aria-selected='true']":{backgroundColor:"rgba(0, 0, 0, 0.08)"}}}},PaperComponent:({children:U,...O})=>A.jsx(K,{...O,sx:{borderRadius:"4px",border:"1px solid rgba(0, 0, 0, 0.1)",marginTop:"4px",backgroundColor:"white"},children:U}),renderInput:U=>A.jsx(at,{...U,label:"טון עסקי",variant:"outlined",margin:"normal"}),noOptionsText:C.length===0?"הקלד טון עסקי":"אין אפשרויות"})}),A.jsxs(ct,{item:!0,xs:12,children:[A.jsx(Ae,{variant:"subtitle2",sx:{mb:{xs:.75,sm:1},fontSize:{xs:"0.875rem",sm:"1rem"}},children:"תיאור"}),(Array.isArray(o.description)?o.description:o.description?[o.description]:[""]).map((U,O)=>A.jsxs(K,{sx:{display:"flex",alignItems:"flex-start",gap:1,mb:1},children:[A.jsx(at,{fullWidth:!0,value:U,onChange:Z=>Ce("description",O,Z.target.value),variant:"outlined",margin:"normal",multiline:!0,rows:3,size:"small"}),A.jsx(Hn,{color:"error",onClick:()=>ce(O),sx:{mt:1},"aria-label":"הסר תיאור",children:A.jsx(Qs,{})})]},O)),A.jsx(ze,{variant:"outlined",startIcon:A.jsx(Fl,{}),onClick:ve,sx:{mt:1},children:"הוספת תיאור"})]}),A.jsx(ct,{item:!0,xs:12,md:6,children:A.jsx(at,{fullWidth:!0,label:"אתר אינטרנט",value:o.website,onChange:U=>pe("website",U.target.value),variant:"outlined",margin:"normal"})})]})}),A.jsx(er,{sx:{my:{xs:1.5,sm:2},borderColor:"divider"}}),A.jsxs(ya,{title:"קשר ורשתות",description:"אימייל וטלפון ליצירת קשר, וקישורים לפרופילים ציבוריים.",children:[A.jsxs(ct,{container:!0,spacing:{xs:1.5,sm:2},children:[A.jsx(ct,{item:!0,xs:12,md:6,children:A.jsx(at,{fullWidth:!0,label:"אימייל",value:o.contacts.email,onChange:U=>me("contacts","email",U.target.value),variant:"outlined",margin:"normal"})}),A.jsx(ct,{item:!0,xs:12,md:6,children:A.jsx(at,{fullWidth:!0,label:"טלפון",value:o.contacts.phone,onChange:U=>me("contacts","phone",U.target.value),variant:"outlined",margin:"normal"})})]}),A.jsxs(K,{sx:{mt:{xs:2,sm:2.5},p:{xs:1.5,sm:2},borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:U=>un(U.palette.common.black,.02)},children:[Object.entries(o.socials).map(([U,O])=>A.jsx(lO,{platform:U,url:O,onPlatformCommit:Ke,onUrlChange:qe,onRemove:re},j(U))),A.jsx(ze,{variant:"outlined",startIcon:A.jsx(Fl,{}),onClick:Ze,sx:{mt:1,textTransform:"none"},children:"הוספת רשת חברתית"})]})]})]})]}),A.jsxs(K,{className:w?_i.fadeUpDelay4:"",sx:{position:"fixed",bottom:0,left:0,right:0,zIndex:10,padding:{xs:1,sm:1,md:1},paddingTop:{xs:1,sm:1,md:1},backgroundColor:"background.default",borderTop:"1px solid",borderColor:"divider"},children:[m&&A.jsx(Ml,{severity:"error",sx:{mb:1},onClose:()=>x(null),children:m}),A.jsxs(ct,{container:!0,spacing:{xs:1,sm:2},sx:{justifyContent:{xs:"center",sm:"space-between"}},children:[A.jsx(ct,{item:!0,xs:12,sm:"auto",children:A.jsx(ze,{variant:"text",color:"primary",onClick:()=>n(L),fullWidth:!0,sx:{fontSize:{xs:"0.875rem",sm:"1rem"},maxWidth:{xs:"100%",sm:"auto"}},children:"חזרה"})}),A.jsx(ct,{item:!0,xs:12,sm:"auto",children:A.jsx(ze,{variant:"contained",color:"primary",onClick:Be,disabled:f,fullWidth:!0,startIcon:f?A.jsx(Va,{size:18,color:"inherit"}):null,sx:{fontSize:{xs:"0.875rem",sm:"1rem"},maxWidth:{xs:"100%",sm:"auto"},minWidth:120},children:f?"שומר...":"שלב הבא"})})]})]})]})}const sO=$t(A.jsx("path",{d:"M7 16c.55 0 1 .45 1 1 0 1.1-.9 2-2 2-.17 0-.33-.02-.5-.05.31-.55.5-1.21.5-1.95 0-.55.45-1 1-1M18.67 3c-.26 0-.51.1-.71.29L9 12.25 11.75 15l8.96-8.96c.39-.39.39-1.02 0-1.41l-1.34-1.34c-.2-.2-.45-.29-.7-.29M7 14c-1.66 0-3 1.34-3 3 0 1.31-1.16 2-2 2 .92 1.22 2.49 2 4 2 2.21 0 4-1.79 4-4 0-1.66-1.34-3-3-3"}),"BrushOutlined"),pO=$t(A.jsx("path",{d:"M20.97 7.27c.39-.39.39-1.02 0-1.41l-2.83-2.83a.9959.9959 0 0 0-1.41 0l-4.49 4.49-3.89-3.89c-.78-.78-2.05-.78-2.83 0l-1.9 1.9c-.78.78-.78 2.05 0 2.83l3.89 3.89L3 16.76V21h4.24l4.52-4.52 3.89 3.89c.95.95 2.23.6 2.83 0l1.9-1.9c.78-.78.78-2.05 0-2.83l-3.89-3.89zM5.04 6.94l1.89-1.9L8.2 6.31 7.02 7.5l1.41 1.41 1.19-1.19 1.2 1.2-1.9 1.9zm11.23 7.44-1.19 1.19 1.41 1.41 1.19-1.19 1.27 1.27-1.9 1.9-3.89-3.89 1.9-1.9zM6.41 19H5v-1.41l9.61-9.61 1.3 1.3.11.11zm9.61-12.44 1.41-1.41 1.41 1.41-1.41 1.41z"}),"DesignServicesOutlined");var Ch={},uO=Fe;Object.defineProperty(Ch,"__esModule",{value:!0});var aE=Ch.default=void 0,cO=uO(Oe()),AO=A;aE=Ch.default=(0,cO.default)((0,AO.jsx)("path",{d:"m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm0 6-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25zm-7.5-5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12zm-1.51 3.49L9 15.17l-.99-2.18L5.83 12l2.18-.99L9 8.83l.99 2.18 2.18.99z"}),"AutoAwesomeOutlined");var vh={},dO=Fe;Object.defineProperty(vh,"__esModule",{value:!0});var rE=vh.default=void 0,fO=dO(Oe()),yh=A;rE=vh.default=(0,fO.default)([(0,yh.jsx)("path",{d:"M18 10.48V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4.48l4 3.98v-11zm-2-.79V18H4V6h12z"},"0"),(0,yh.jsx)("circle",{cx:"10",cy:"10",r:"2"},"1"),(0,yh.jsx)("path",{d:"M14 15.43c0-.81-.48-1.53-1.22-1.85-.85-.37-1.79-.58-2.78-.58-.99 0-1.93.21-2.78.58C6.48 13.9 6 14.62 6 15.43V16h8z"},"2")],"VideoCameraFrontOutlined");var Sh={},WO=Fe;Object.defineProperty(Sh,"__esModule",{value:!0});var Ih=Sh.default=void 0,gO=WO(Oe()),hO=A;Ih=Sh.default=(0,gO.default)((0,hO.jsx)("path",{d:"M21 11.01 3 11v2h18zM3 16h12v2H3zM21 6H3v2.01L21 8z"}),"NotesOutlined");var xh={},mO=Fe;Object.defineProperty(xh,"__esModule",{value:!0});var lE=xh.default=void 0,CO=mO(Oe()),vO=A;lE=xh.default=(0,CO.default)((0,vO.jsx)("path",{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-1 9H9V9h10zm-4 4H9v-2h6zm4-8H9V5h10z"}),"LibraryBooks");var Eh={},yO=Fe;Object.defineProperty(Eh,"__esModule",{value:!0});var iE=Eh.default=void 0,SO=yO(Oe()),IO=A;iE=Eh.default=(0,SO.default)((0,IO.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit");var bh={},xO=Fe;Object.defineProperty(bh,"__esModule",{value:!0});var oE=bh.default=void 0,EO=xO(Oe()),bO=A;oE=bh.default=(0,EO.default)((0,bO.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const sE=[{id:"authentic_text",label:"טקסט אישי",questions:[{id:"topic",label:"נושא / תיאור קצר",inputType:"multiline"}]},{id:"webinar",label:"וובינר",questions:[{id:"date",label:"תאריך",inputType:"date"},{id:"time",label:"שעה",inputType:"time"},{id:"topic",label:"נושא / תיאור",inputType:"multiline"}]},{id:"designed_mail",label:"מעוצב (מצב מהיר)",questions:[{id:"topic",label:"נושא / תיאור קצר",inputType:"multiline"}]},{id:"studio_design",label:"מעוצב (סטודיו)",questions:[{id:"topic",label:"נושא / תיאור קצר",inputType:"multiline"}]},{id:"designed_mail_advanced",comingSoon:!0,label:"מעצב פרו (סטודיו)",questions:[{id:"topic",label:"נושא / תיאור קצר",inputType:"multiline"}]}];function pE(e){return sE.find(t=>t.id===e)}function kh(e){return e==="other"}function uE(e,t,n){if(e==="other"&&n!=null){const l=n.trim();return l?l+(l.endsWith(".")?"":"."):"אני רוצה לבנות מייל."}const a=pE(e);if(!a)return"";const r=[];if(e==="webinar"){const l=t.date||"",i=t.time||"",o=t.topic||"";return r.push("אני רוצה לבנות מייל לוובינר"),(l||i)&&r.push(`בתאריך ${l}${i?` בשעה ${i}`:""}`),o&&r.push(`, ${o}`),r.join(" ")+"."}if(e==="designed_mail"){const l=t.topic||"";return l?`אני רוצה לבנות מייל מעוצב: ${l}.`:"אני רוצה לבנות מייל מעוצב."}if(e==="studio_design"){const l=t.topic||"";return l?`אני רוצה לבנות מייל מעוצב בסטודיו: ${l}.`:"אני רוצה לבנות מייל מעוצב בסטודיו."}if(e==="authentic_text"){const l=t.topic||"";return l?`אני רוצה לבנות מייל בטקסט אישי: ${l}.`:"אני רוצה לבנות מייל בטקסט אישי."}return a.label?`אני רוצה לבנות מייל מסוג ${a.label}.`:""}var wh={},kO=Fe;Object.defineProperty(wh,"__esModule",{value:!0});var nA=wh.default=void 0,wO=kO(Oe()),RO=A;nA=wh.default=(0,wO.default)((0,RO.jsx)("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields");var Rh={},BO=Fe;Object.defineProperty(Rh,"__esModule",{value:!0});var Os=Rh.default=void 0,LO=BO(Oe()),MO=A;Os=Rh.default=(0,LO.default)((0,MO.jsx)("path",{d:"M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5C13 2.12 11.88 1 10.5 1S8 2.12 8 3.5V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7 1.49 0 2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5c1.38 0 2.5-1.12 2.5-2.5S21.88 11 20.5 11"}),"Extension");const cE=["newsletter.loadingSteps.building","newsletter.loadingSteps.searchingImages","newsletter.loadingSteps.choosingIcons","newsletter.loadingSteps.analyzing"],Bh=["https://images.pexels.com/photos/3184292/pexels-photo-3184292.jpeg?auto=compress&cs=tinysrgb&w=200","https://images.pexels.com/photos/2762247/pexels-photo-2762247.jpeg?auto=compress&cs=tinysrgb&w=200","https://images.pexels.com/photos/267350/pexels-photo-267350.jpeg?auto=compress&cs=tinysrgb&w=200"],QO={"@keyframes sceneIn":{"0%":{opacity:0,transform:"scale(0.94)"},"100%":{opacity:1,transform:"scale(1)"}},"@keyframes blockDrop":{"0%":{transform:"translate(-10px, -16px)",opacity:.5},"100%":{transform:"translate(0, 0)",opacity:1}},"@keyframes blockFloat":{"0%, 100%":{transform:"translate(0, 0)"},"50%":{transform:"translate(3px, -2px)"}}},Qn={animation:"blockDrop 0.5s ease-out both, blockFloat 2.2s ease-in-out 0.6s infinite",borderRadius:2,border:"1px solid rgba(0, 0, 0, 0.08)",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},AE={background:`linear-gradient(135deg, ${tA}61 0%, ${mh}61 100%)`};function VO(){return A.jsxs(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1.5},children:[A.jsx(K,{className:"block",sx:{...Qn,width:110,height:26,background:ta,color:"primary.contrastText"},children:A.jsx(nA,{sx:{fontSize:16}})}),A.jsx(K,{className:"block",sx:{...Qn,width:130,height:72},children:A.jsx("img",{src:Bh[0],alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})}),A.jsxs(K,{sx:{display:"flex",gap:1},children:[A.jsx(K,{className:"block",sx:{...Qn,width:36,height:36,bgcolor:"secondary.main",color:"secondary.contrastText"},children:A.jsx(Os,{sx:{fontSize:20}})}),A.jsx(K,{className:"block",sx:{...Qn,width:44,height:36,...AE}})]})]})}function UO(){return A.jsxs(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1.5},children:[A.jsx(K,{className:"block",sx:{...Qn,width:130,height:68},children:A.jsx("img",{src:Bh[1],alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})}),A.jsxs(K,{sx:{display:"flex",gap:1},children:[A.jsx(K,{className:"block",sx:{...Qn,width:100,height:24,background:ta,color:"primary.contrastText"},children:A.jsx(nA,{sx:{fontSize:14}})}),A.jsx(K,{className:"block",sx:{...Qn,width:36,height:36,bgcolor:"secondary.main",color:"secondary.contrastText"},children:A.jsx(Os,{sx:{fontSize:20}})})]}),A.jsx(K,{className:"block",sx:{...Qn,width:90,height:32,bgcolor:"grey.300"}})]})}function FO(){return A.jsxs(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1.5},children:[A.jsxs(K,{sx:{display:"flex",gap:1},children:[A.jsx(K,{className:"block",sx:{...Qn,width:38,height:38,background:ta,color:"primary.contrastText"},children:A.jsx(Os,{sx:{fontSize:22}})}),A.jsx(K,{className:"block",sx:{...Qn,width:50,height:38,...AE}}),A.jsx(K,{className:"block",sx:{...Qn,width:38,height:38,bgcolor:"secondary.main",color:"secondary.contrastText"},children:A.jsx(Os,{sx:{fontSize:20}})})]}),A.jsx(K,{className:"block",sx:{...Qn,width:120,height:70},children:A.jsx("img",{src:Bh[2],alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})}),A.jsx(K,{className:"block",sx:{...Qn,width:100,height:22,background:ta,color:"primary.contrastText"},children:A.jsx(nA,{sx:{fontSize:14}})})]})}const dE=[VO,UO,FO];function zO(e){const{t}=Nn(),[n,a]=v.useState(0),[r,l]=v.useState(0),[i,o]=v.useState(0);v.useEffect(()=>{const p=setInterval(()=>{a(u=>(u+1)%cE.length)},2500);return()=>clearInterval(p)},[]),v.useEffect(()=>{const p=setInterval(()=>{l(u=>(u+1)%dE.length)},3200);return()=>clearInterval(p)},[]),v.useEffect(()=>{const p=setInterval(()=>{o(u=>u+1)},1e3);return()=>clearInterval(p)},[]);const s=dE[r];return A.jsxs(K,{sx:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:2,paddingTop:4,...QO},children:[A.jsx(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1.5,mb:3,minHeight:180,"& .block":Qn,"& .block:nth-of-type(1)":{animationDelay:"0s, 0.6s"},"& .block:nth-of-type(2)":{animationDelay:"0.12s, 0.72s"},"& .block:nth-of-type(3)":{animationDelay:"0.24s, 0.84s"},"& .block:nth-of-type(4)":{animationDelay:"0.36s, 0.96s"},"& .block:nth-of-type(5)":{animationDelay:"0.48s, 1.08s"},"& .block:nth-of-type(6)":{animationDelay:"0.6s, 1.2s"}},children:A.jsx(K,{sx:{animation:"sceneIn 0.4s ease-out"},children:A.jsx(s,{})},r)}),A.jsx(K,{sx:{display:"flex",gap:.75,mb:1.5},children:[0,1,2,3].map(p=>A.jsx(K,{sx:{width:10,height:10,borderRadius:"50%",...p<=n?{background:ta}:{bgcolor:"action.hover"},opacity:p===n?1:p<n?.8:.4,transition:"opacity 0.3s ease, background-color 0.3s ease"}},p))}),A.jsx(Ae,{variant:"body1",sx:{fontWeight:500,color:"text.secondary"},children:t(cE[n])}),A.jsxs(Ae,{variant:"caption",sx:{mt:1,color:"text.disabled",fontVariantNumeric:"tabular-nums"},children:[Math.floor(i/60).toString().padStart(2,"0"),":",(i%60).toString().padStart(2,"0")]})]})}const fE={IL:"Israel",US:"United States",CA:"Canada",GB:"United Kingdom",UK:"United Kingdom",AU:"Australia",DE:"Germany",FR:"France",ES:"Spain",IT:"Italy",NL:"Netherlands",BR:"Brazil",MX:"Mexico",AR:"Argentina",RU:"Russia",JP:"Japan",CN:"China",IN:"India",ZA:"South Africa",AE:"United Arab Emirates",SA:"Saudi Arabia",PL:"Poland",SE:"Sweden",NO:"Norway",DK:"Denmark",FI:"Finland",CH:"Switzerland",AT:"Austria",BE:"Belgium",PT:"Portugal",GR:"Greece",TR:"Turkey",KR:"South Korea",SG:"Singapore",HK:"Hong Kong",TW:"Taiwan",NZ:"New Zealand",IE:"Ireland"},qO={"Asia/Jerusalem":"Israel","America/New_York":"United States","America/Los_Angeles":"United States","America/Chicago":"United States","America/Toronto":"Canada","America/Vancouver":"Canada","Europe/London":"United Kingdom","Europe/Paris":"France","Europe/Berlin":"Germany","Europe/Madrid":"Spain","Europe/Rome":"Italy","Europe/Amsterdam":"Netherlands","Australia/Sydney":"Australia","Australia/Melbourne":"Australia","Asia/Tokyo":"Japan","Asia/Shanghai":"China","Asia/Dubai":"United Arab Emirates","America/Sao_Paulo":"Brazil","America/Mexico_City":"Mexico"};function jO(){if(typeof navigator>"u")return null;try{const e=navigator,t=[navigator.language,...e.languages??[]].filter(Boolean);for(const n of t){if(!n)continue;const a=new Intl.Locale(n).region;if(a&&fE[a])return fE[a];if(n.startsWith("he")&&!a)return"Israel"}}catch{}try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e){const t=qO[e];if(t)return t;if(e.split("/")[0]==="Asia"&&e.includes("Jerusalem"))return"Israel"}}catch{}return null}const TO={authentic_text:Ih,webinar:rE,designed_mail:aE,studio_design:sO,designed_mail_advanced:pO};function Lh({header:e,children:t,footer:n,compactBody:a}){return A.jsxs(K,{sx:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",bgcolor:"background.paper"},children:[A.jsx(K,{sx:{flexShrink:0,pt:{xs:6,sm:7},px:2.5,pb:2,borderBottom:"1px solid",borderColor:"divider"},children:e}),a?A.jsx(K,{sx:{flex:1,minHeight:0}}):A.jsx(K,{sx:{flex:1,minHeight:0,overflow:"auto",px:2.5,py:2,WebkitOverflowScrolling:"touch"},children:t}),n?A.jsx(K,{sx:{flexShrink:0,px:2.5,py:2,borderTop:"1px solid",borderColor:"divider",bgcolor:"background.paper"},children:n}):null]})}function OO({domain:e,mergeTags:t=[],visibilityRules:n,location:a,onResult:r,result:l,language:i,context:o,onSeriesClick:s,onBack:p}){const{t:u}=Nn(),c=Ni(),{step3Draft:d,setStep3Draft:f}=rx(),[W,m]=v.useState(0),[x,h]=v.useState(null),[g,C]=v.useState({}),[y,E]=v.useState(""),[S,k]=v.useState(!1),[R,V]=v.useState(null),[b,B]=v.useState(null),M=x?pE(x):null,F=(M==null?void 0:M.questions)??[],z=a&&a.trim()||jO()||void 0,T=Y=>{h(Y),C({}),m(1)},j=(Y,ne)=>{C(fe=>({...fe,[Y]:ne}))},P=async()=>{if(!y.trim())return;k(!0),V(null);const Y=Date.now();try{const ne=uE("other",{},y),fe=await kg({prompt:ne,domain:e,mergeTags:t,structureUrl:"",textStyleUrl:"",...n&&Object.keys(n).length>0?{visibilityRules:n}:{},...i?{language:i}:{},...z?{location:z}:{},...o?{context:o}:{}});B(Math.round((Date.now()-Y)/1e3)),r(fe)}catch(ne){console.error("Newsletter generation failed:",ne),V(u("common.errorGeneric"))}finally{k(!1)}},L=async(Y,ne)=>{k(!0),V(null);const fe=Date.now();try{const pe=x==="studio_design"||x==="webinar",me=x==="designed_mail";if(me||pe){const ae=i||"he",H=Kj(o,ae),Ce={prompt:Y,accountId:H.accountId,language:ae,...t.length>0?{mergeTags:t}:{},businessContext:H},he={components:(me?await Tj(Ce):await Oj(Ce)).nodes??[]};B(Math.round((Date.now()-fe)/1e3)),r(he)}else{const ae=await kg({prompt:Y,domain:e,mergeTags:t,structureUrl:"",textStyleUrl:ne,...n&&Object.keys(n).length>0?{visibilityRules:n}:{},...i?{language:i}:{},...z?{location:z}:{},...o?{context:o}:{}});B(Math.round((Date.now()-fe)/1e3)),r(ae)}}catch(pe){console.error("Newsletter generation failed:",pe),V(u("common.errorGeneric"))}finally{k(!1)}},q=()=>{const Y=uE(x,g);Y&&L(Y,"")},w=()=>{if(c&&l){const Y=(d==null?void 0:d.components)??l.components??l.template,ne={...l,components:Y,template:Y};try{c.triggerEvent("onEditPage",ne),f(null)}catch{}}},X=()=>{r(null),m(0),h(null),C({}),E(""),V(null),B(null)},ee=()=>{m(0),h(null),C({}),E("")};if(l&&l.components)return A.jsx(Lh,{compactBody:!0,header:A.jsxs(ut,{spacing:1,children:[A.jsx(Ae,{variant:"h6",component:"h1",sx:{fontWeight:700,letterSpacing:"-0.02em",lineHeight:1.35},children:u("newsletter.successHeading")}),A.jsx(Ae,{variant:"body2",color:"text.secondary",sx:{lineHeight:1.55},children:u("newsletter.successMessage")}),b!=null&&A.jsxs(Ae,{variant:"caption",color:"text.disabled",sx:{fontVariantNumeric:"tabular-nums"},children:[Math.floor(b/60).toString().padStart(2,"0"),":",(b%60).toString().padStart(2,"0")]})]}),footer:A.jsxs(ut,{direction:"row",flexWrap:"wrap",gap:1.5,justifyContent:"flex-start",children:[A.jsx(ze,{variant:"contained",color:"primary",startIcon:A.jsx(iE,{}),onClick:w,sx:{textTransform:"none"},children:u("newsletter.editDesign")}),A.jsx(ze,{variant:"outlined",color:"primary",startIcon:A.jsx(oE,{}),onClick:X,sx:{textTransform:"none"},children:u("newsletter.startOver")})]})});if(S)return A.jsx(K,{sx:{height:"100%",minHeight:0,overflow:"auto"},children:A.jsx(zO,{language:i})});const Q=W!==1||!x?"":kh(x)?u("newsletter.tellUs"):M?u(`newsletter.types.${M.id}`):"";if(W===0)return A.jsxs(Lh,{header:A.jsxs(ut,{spacing:1,children:[p?A.jsx(ze,{variant:"text",color:"primary",onClick:p,sx:{alignSelf:"flex-start",textTransform:"none",minWidth:"auto",px:.5,ml:-.5,mt:1},children:u("newsletter.back")}):A.jsxs(A.Fragment,{children:[A.jsx("br",{}),A.jsx("br",{})]}),A.jsx(Ae,{component:"h1",variant:"h6",sx:{fontWeight:700,letterSpacing:"-0.02em",lineHeight:1.35,color:"text.primary"},children:u("newsletter.whatType")}),A.jsx(Ae,{variant:"body2",color:"text.secondary",sx:{fontSize:"0.8125rem",lineHeight:1.55,maxWidth:"52ch"},children:u("newsletter.typeSectionHint")})]}),children:[A.jsxs(ut,{spacing:1.25,children:[sE.map(Y=>{const ne=TO[Y.id]??Ih;return A.jsx(eg,{elevation:0,variant:"outlined",sx:{borderRadius:2,borderColor:"divider",bgcolor:"background.paper",transition:"border-color 0.2s ease, box-shadow 0.2s ease","&:hover":{borderColor:"primary.main",boxShadow:fe=>`0 2px 12px ${un(fe.palette.primary.main,.12)}`},...Y.comingSoon?{opacity:.5,cursor:"not-allowed"}:{}},children:A.jsx(eI,{onClick:()=>Y.comingSoon?null:T(Y.id),sx:{borderRadius:0,"&:focus-visible":{outlineOffset:-2}},children:A.jsx(ng,{sx:{py:1.75,px:2,"&:last-child":{pb:1.75}},children:A.jsxs(ut,{direction:"row",spacing:1.75,alignItems:"center",children:[A.jsx(K,{sx:{width:44,height:44,borderRadius:1.5,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:fe=>un(fe.palette.primary.main,.08),border:fe=>`1px solid ${un(fe.palette.primary.main,.16)}`},children:A.jsx(ne,{sx:{fontSize:24,...Xi}})}),A.jsx(Ae,{variant:"subtitle1",sx:{fontWeight:600,fontSize:"0.9375rem",lineHeight:1.4,letterSpacing:"-0.01em",color:"text.primary"},children:u(`newsletter.types.${Y.id}`)}),Y.comingSoon?A.jsx(vn,{label:u("newsletter.comingSoon"),size:"small",color:"primary",variant:"outlined"}):null]})})})},Y.id)}),s?A.jsx(eg,{elevation:0,variant:"outlined",sx:{borderRadius:2,borderColor:"divider",bgcolor:"background.paper",opacity:.5,cursor:"not-allowed"},children:A.jsx(eI,{onClick:void 0,disabled:!0,sx:{borderRadius:0,"&:focus-visible":{outlineOffset:-2}},children:A.jsx(ng,{sx:{py:1.75,px:2,"&:last-child":{pb:1.75}},children:A.jsxs(ut,{direction:"row",spacing:1.75,alignItems:"center",children:[A.jsx(K,{sx:{width:44,height:44,borderRadius:1.5,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:Y=>un(Y.palette.primary.main,.08),border:Y=>`1px solid ${un(Y.palette.primary.main,.16)}`},children:A.jsx(lE,{sx:{fontSize:24,...Xi}})}),A.jsx(Ae,{variant:"subtitle1",sx:{fontWeight:600,fontSize:"0.9375rem",lineHeight:1.4,letterSpacing:"-0.01em",color:"text.primary"},children:u("seriesPrompt.hub.title")}),A.jsx(vn,{label:u("newsletter.comingSoon"),size:"small",color:"primary",variant:"outlined"})]})})})}):null]}),R?A.jsx(Ae,{color:"error",variant:"body2",sx:{mt:2},children:R}):null]});const G=kh(x)?A.jsx(ut,{direction:"row",spacing:1.5,justifyContent:"flex-end",flexWrap:"wrap",children:A.jsx(ze,{variant:"contained",color:"primary",onClick:P,disabled:!y.trim()||S,sx:{textTransform:"none"},children:S?A.jsx(Va,{size:22,color:"inherit"}):u("common.send")})}):A.jsx(ut,{direction:"row",spacing:1.5,justifyContent:"flex-end",flexWrap:"wrap",children:A.jsx(ze,{variant:"contained",color:"primary",onClick:q,disabled:S,sx:{textTransform:"none"},children:S?A.jsx(Va,{size:22,color:"inherit"}):u("common.continue")})});return A.jsxs(Lh,{header:A.jsxs(ut,{spacing:1.25,children:[A.jsx(ze,{variant:"text",color:"primary",onClick:ee,sx:{alignSelf:"flex-start",textTransform:"none",minWidth:"auto",px:.5,ml:-.5,mt:-.5},children:u("newsletter.back")}),A.jsx(Ae,{variant:"h6",component:"h1",sx:{fontWeight:700,letterSpacing:"-0.02em",lineHeight:1.35},children:Q}),A.jsx(Ae,{variant:"body2",color:"text.secondary",sx:{fontSize:"0.8125rem",lineHeight:1.55},children:u("newsletter.questionsSectionHint")})]}),footer:G,children:[kh(x)?A.jsx(at,{multiline:!0,minRows:4,placeholder:u("newsletter.writeHere"),value:y,onChange:Y=>E(Y.target.value),fullWidth:!0,variant:"outlined",size:"small"}):A.jsx(ut,{spacing:2,children:F.map(Y=>A.jsx(K,{children:Y.inputType==="multiline"?A.jsxs(A.Fragment,{children:[A.jsx(Ae,{variant:"caption",sx:{mb:.75,display:"block",fontWeight:600,color:"text.secondary",letterSpacing:"0.02em"},children:u("newsletter.topicLabel")}),A.jsx(at,{multiline:!0,minRows:3,placeholder:u("newsletter.writeHere"),value:g[Y.id]??"",onChange:ne=>j(Y.id,ne.target.value),fullWidth:!0,variant:"outlined",size:"small"})]}):A.jsx(at,{label:u(x==="webinar"&&Y.id==="topic"?"newsletter.questions.topicShort":`newsletter.questions.${Y.id}`),type:Y.inputType==="date"?"date":Y.inputType==="time"?"time":"text",value:g[Y.id]??"",onChange:ne=>j(Y.id,ne.target.value),fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:Y.inputType==="date"||Y.inputType==="time"?{shrink:!0}:void 0})},Y.id))}),R?A.jsx(Ae,{color:"error",variant:"body2",sx:{mt:2},children:R}):null]})}function KO({setActiveStep:e,placeholderSuggestions:t=[],language:n,data:a={},logo:r="",mergeTags:l=[],visibilityRules:i,location:o,onDesignChange:s}){const{t:p}=Nn(),u=v.useRef(s);u.current=s;const{step2Data:c}=bg(),{step3Draft:d,setStep3Draft:f}=rx(),W=c||a,m=(W==null?void 0:W.businessData)||W,x=(W==null?void 0:W.websiteUrl)||(m==null?void 0:m.website)||"",h=Xc({...m,websiteUrl:x})??void 0,g=(c==null?void 0:c.logo)||(W&&typeof W=="object"&&"logo"in W?W.logo:r),C=(c==null?void 0:c.logoBackgroundHex)??(W==null?void 0:W.logoBackgroundHex),y=v.useRef(null),E=v.useRef(!1),S=v.useRef(null),k=v.useRef(!1),[R,V]=v.useState(0),[b,B]=v.useState(0),[M,F]=v.useState([]),[z,T]=v.useState(null);v.useEffect(()=>{var q;if(k.current)return;const L=d;(q=L==null?void 0:L.components)!=null&&q.length&&(k.current=!0,F(Array.isArray(L.components)?L.components:[]),T(L.surveyResult??null))},[d]);const j=L=>{if(L!=null&&L.components){const q=Array.isArray(L.components)?L.components:[];F(q),T(L),f({components:q,surveyResult:L})}else F([]),T(null),f(null),B(q=>q+1)};v.useEffect(()=>{},[]),v.useEffect(()=>{var X;if(M.length===0||!y.current)return;const L=y.current.querySelector("iframe");L&&L.remove(),(X=S.current)!=null&&X.parentNode&&S.current.parentNode.removeChild(S.current),S.current=null,E.current=!1,E.current=!0;const q=document.createElement("iframe");q.width="100%",q.height="100%",q.style.border="none",S.current=q,y.current.appendChild(q);let w=!1;return q.onload=()=>{if(w)return;w=!0;const ee=q.contentDocument,Q=q.contentWindow;if(!ee||!Q||ee.querySelector('script[src*="creaditor.bundle.js"]'))return;ee.open(),ee.write(`
520
+ `)||""),O&&await Fj(U,rt)}catch(rt){const Xe=rt instanceof Error?rt.message:String(rt);if(Xe.includes("404")||Xe.includes("not found"))console.warn("Business analysis not in DB, saving to context only:",Xe);else{console.error("Failed to save business analysis:",Xe),x(`שמירה נכשלה: ${Xe}`),W(!1);return}}W(!1),a(Je),i&&i.triggerEvent("onDataComplete",Je),window.dispatchEvent(new CustomEvent("business-analysis-saved",{detail:o,bubbles:!0,composed:!0})),n(2)};if(p)return A.jsx(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:{xs:2,sm:3,md:5},minHeight:{xs:"300px",sm:"350px",md:"400px"}},children:A.jsx(tO,{text:"Analyzing",showSkeletons:!0})});if(c)return A.jsxs(K,{sx:{padding:{xs:2,sm:3,md:5},width:{xs:"100%",sm:"500px"},maxWidth:"100%",boxSizing:"border-box"},children:[A.jsx(Ml,{severity:"error",sx:{fontSize:{xs:"0.875rem",sm:"1rem"}},children:c}),A.jsx(ze,{variant:"text",color:"primary",onClick:()=>n(L),sx:{mt:2,fontSize:{xs:"0.875rem",sm:"1rem"}},children:"חזרה"})]});if(!o)return null;const Te=(t==null?void 0:t.trim())||(e&&typeof e=="object"&&"websiteUrl"in e?(Pe=e.websiteUrl)==null?void 0:Pe.trim():"")||((je=o==null?void 0:o.website)==null?void 0:je.trim())||"";return A.jsxs(K,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,height:"100%",width:"100%",maxWidth:"100%",boxSizing:"border-box",overflow:"hidden"},children:[A.jsxs(K,{sx:{flex:1,minHeight:0,height:"100%",maxHeight:"calc(90vh - 140px)",overflowY:"auto",overflowX:"hidden",padding:{xs:2,sm:3,md:5},paddingBottom:{xs:1,sm:1.5,md:2},WebkitOverflowScrolling:"touch"},children:[Te&&A.jsx(K,{className:w?_i.fadeUp:"",sx:{mb:{xs:2,sm:2.5},mt:{xs:.5,sm:1}},children:A.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1.25,px:{xs:1.5,sm:2},py:{xs:1,sm:1.125},borderRadius:2,border:"1px solid",borderColor:"divider",maxWidth:"100%",overflow:"hidden",bgcolor:U=>un(U.palette.primary.main,.06)},children:[A.jsx(dx,{sx:{fontSize:{xs:"1.125rem",sm:"1.25rem"},color:"text.secondary",flexShrink:0,opacity:.85}}),A.jsx(Ae,{variant:"body2",sx:{fontSize:{xs:"0.8125rem",sm:"0.875rem"},color:"text.primary",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",flex:1,direction:"ltr",textAlign:"left",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',fontWeight:500},children:js(Te)}),A.jsx(Hn,{size:"small",onClick:()=>{R.current="",b.current=!0,M(U=>U+1)},disabled:p,title:"נתח מחדש",sx:{flexShrink:0,opacity:.7,"&:hover":{opacity:1}},children:A.jsx(fx,{sx:{fontSize:"1.125rem"}})})]})}),A.jsxs(K,{className:w?_i.fadeUp:"",sx:{mb:{xs:2.5,sm:3}},children:[A.jsx(Ae,{component:"h1",variant:"h4",sx:{mt:Te?{xs:1.5,sm:2}:{xs:4,sm:4},fontSize:{xs:"1.5rem",sm:"1.875rem",md:"2rem"},fontWeight:700,letterSpacing:"-0.025em",lineHeight:1.2,color:"text.primary"},children:"עריכת פרטי העסק"}),A.jsx(Ae,{variant:"body2",className:w?_i.fadeUpDelay1:"",color:"text.secondary",sx:{mt:{xs:.75,sm:1},fontSize:{xs:"0.875rem",sm:"0.9375rem"},maxWidth:"min(48ch, 100%)",lineHeight:1.55},children:"עברו על השדות, עדכנו מה שצריך, והמשיכו לשלב הבא."})]}),A.jsx(K,{className:w?_i.fadeUpDelay2:"",children:A.jsxs(ya,{title:"לוגו",description:"מומלץ קובץ שקוף או רקע בהיר. אפשר לדלג אם אין לוגו מעודכן.",children:[A.jsx("input",{ref:k,type:"file",accept:"image/*",onChange:Q,style:{display:"none"},id:"logo-upload-input"}),E?A.jsxs(K,{sx:{p:{xs:1.5,sm:2,md:2.5},border:"1px dashed",borderColor:"divider",borderRadius:2,bgcolor:U=>un(U.palette.common.black,.02),transition:"border-color 0.2s ease, background-color 0.2s ease",mb:{xs:1.5,sm:2},"&:hover":{borderColor:"text.secondary",bgcolor:U=>un(U.palette.common.black,.035)}},children:[A.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:{xs:1,sm:1.5,md:2},mb:{xs:1.5,sm:2},flexDirection:{xs:"column",sm:"row"}},children:[A.jsx(Hn,{size:"small",color:"error",onClick:G,sx:{border:"1px solid rgba(211, 47, 47, 0.3)",alignSelf:{xs:"flex-start",sm:"auto"},"&:hover":{backgroundColor:"rgba(211, 47, 47, 0.08)",borderColor:"rgba(211, 47, 47, 0.5)"}},"aria-label":"הסר לוגו",children:A.jsx(Qs,{fontSize:"small"})}),A.jsx(K,{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:{xs:"80px",sm:"90px",md:"100px"},backgroundColor:(()=>{var Z;const U=((Z=o==null?void 0:o.theme)==null?void 0:Z.logoHeaderBackground)??"white";return/^#(000|000000)$/i.test(U.trim())||/^rgb\s*\(\s*0\s*,\s*0\s*,\s*0\s*\)$/i.test(U.trim())?"white":U})(),borderRadius:1,border:"1px solid rgba(0, 0, 0, 0.08)",p:{xs:.5,sm:1},width:{xs:"100%",sm:"auto"}},children:A.jsx("img",{src:E,alt:"Logo preview",style:{maxWidth:"100%",maxHeight:"100px",objectFit:"contain"}})})]}),A.jsx("label",{htmlFor:"logo-upload-input",children:A.jsx(ze,{variant:"outlined",component:"span",startIcon:A.jsx(Ax,{}),fullWidth:!0,sx:{textTransform:"none",borderRadius:{xs:1.5,sm:2},fontSize:{xs:"0.875rem",sm:"1rem"}},children:"החלף לוגו"})})]}):A.jsxs(K,{sx:{border:"1px dashed",borderColor:"divider",borderRadius:2,p:{xs:2,sm:2.5,md:3},textAlign:"center",bgcolor:U=>un(U.palette.common.black,.02),transition:"border-color 0.2s ease, background-color 0.2s ease","&:hover":{borderColor:"text.secondary",bgcolor:U=>un(U.palette.common.black,.035)}},children:[A.jsx("label",{htmlFor:"logo-upload-input",children:A.jsx(ze,{variant:"outlined",component:"span",startIcon:A.jsx(cx,{}),sx:{textTransform:"none",borderRadius:{xs:1.5,sm:2},px:{xs:2,sm:2.5,md:3},py:{xs:.75,sm:1},fontSize:{xs:"0.875rem",sm:"1rem"}},children:"העלה לוגו"})}),A.jsx(Ae,{variant:"caption",color:"text.secondary",sx:{mt:{xs:1,sm:1.5},display:"block",fontSize:{xs:"0.7rem",sm:"0.75rem"}},children:"תמונות PNG, JPG או SVG עד 5MB"})]})]})}),A.jsxs(ut,{spacing:0,className:w?_i.fadeUpDelay3:"",children:[A.jsx(ya,{title:"פרטי העסק",description:"שם, תעשייה, כתובת והגדרות סוג עסק — משמשים לנתח ולייצר תוצרים מדויקים יותר.",children:A.jsxs(ct,{container:!0,spacing:{xs:2,sm:2.5,md:3},children:[A.jsx(ct,{item:!0,xs:12,md:6,children:A.jsx(at,{fullWidth:!0,label:"שם העסק",value:o.business_name,onChange:U=>pe("business_name",U.target.value),variant:"outlined",margin:"normal"})}),A.jsxs(ct,{item:!0,xs:12,md:6,children:[A.jsx(at,{fullWidth:!0,label:"שם בעל.ת העסק (מלא)",value:o.owner,onChange:U=>pe("owner",U.target.value),variant:"outlined",margin:"normal"}),A.jsxs(aq,{row:!0,value:o.owner_gender??"",onChange:U=>pe("owner_gender",U.target.value),sx:{mt:.5,gap:{xs:.5,sm:1},"& .MuiFormControlLabel-root":{mr:0}},children:[A.jsx(Kc,{value:"male",control:A.jsx(Wg,{size:"small"}),label:A.jsxs(K,{component:"span",sx:{display:"flex",alignItems:"center",gap:.5},children:[A.jsx(Wx,{fontSize:"small"}),A.jsx("span",{children:"זכר"})]}),labelPlacement:"end"}),A.jsx(Kc,{value:"female",control:A.jsx(Wg,{size:"small"}),label:A.jsxs(K,{component:"span",sx:{display:"flex",alignItems:"center",gap:.5},children:[A.jsx(gx,{fontSize:"small"}),A.jsx("span",{children:"נקבה"})]}),labelPlacement:"end"}),A.jsx(Kc,{value:"other",control:A.jsx(Wg,{size:"small"}),label:A.jsxs(K,{component:"span",sx:{display:"flex",alignItems:"center",gap:.5},children:[A.jsx(hx,{fontSize:"small"}),A.jsx("span",{children:"אחר"})]}),labelPlacement:"end"})]})]}),A.jsx(ct,{item:!0,xs:12,md:6,children:A.jsx($W,{freeSolo:!0,options:h,value:o.industry||"",onChange:(U,O)=>{pe("industry",O||"")},onInputChange:(U,O)=>{pe("industry",O)},inputValue:o.industry||"",openOnFocus:!0,disablePortal:!0,componentsProps:{popper:{container:(P==null?void 0:P.getElementById("cdtr-business-ai-root"))||void 0,style:{zIndex:9999},modifiers:[{name:"offset",options:{offset:[0,4]}}]}},ListboxProps:{sx:{maxHeight:"300px","& .MuiAutocomplete-option":{padding:"8px 16px","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"},"&[aria-selected='true']":{backgroundColor:"rgba(0, 0, 0, 0.08)"}}}},PaperComponent:({children:U,...O})=>A.jsx(K,{...O,sx:{borderRadius:"4px",border:"1px solid rgba(0, 0, 0, 0.1)",marginTop:"4px",backgroundColor:"white"},children:U}),renderInput:U=>A.jsx(at,{...U,label:"תעשייה",variant:"outlined",margin:"normal"}),noOptionsText:h.length===0?"הקלד תעשייה":"אין אפשרויות"})}),A.jsx(ct,{item:!0,xs:12,md:6,children:A.jsx(at,{fullWidth:!0,label:"סוג עסק",value:o.business_type,onChange:U=>pe("business_type",U.target.value),variant:"outlined",margin:"normal"})}),A.jsx(ct,{item:!0,xs:12,md:6,children:A.jsx(at,{fullWidth:!0,label:"כתובת העסק",value:o.business_address??"",onChange:U=>pe("business_address",U.target.value),variant:"outlined",margin:"normal"})}),A.jsxs(ct,{item:!0,xs:12,children:[A.jsx(Ae,{variant:"subtitle2",sx:{mb:{xs:.75,sm:1},fontSize:{xs:"0.875rem",sm:"1rem"}},children:"אפשרויות סוג עסק"}),(Array.isArray(o.business_type_options)?o.business_type_options:[]).map((U,O)=>A.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[A.jsx(at,{fullWidth:!0,value:U,onChange:Z=>Ce("business_type_options",O,Z.target.value),variant:"outlined",margin:"normal",size:"small"}),A.jsx(Hn,{color:"error",onClick:()=>he(O),sx:{mt:1},"aria-label":"הסר אפשרות",children:A.jsx(Qs,{})})]},O)),A.jsx(ze,{variant:"outlined",startIcon:A.jsx(Fl,{}),onClick:We,sx:{mt:1},children:"הוספת אפשרות"})]}),A.jsx(ct,{item:!0,xs:12,children:A.jsx(f6,{value:o.keywords,onChange:U=>pe("keywords",U)})})]})}),A.jsx(er,{sx:{my:{xs:1.5,sm:2},borderColor:"divider"}}),A.jsx(ya,{title:"צבעי מותג",description:"גררו צבעים או עדכנו ראשי ומשני — משפיעים על תצוגת המותג בחוויה.",children:A.jsx(H6,{colors:((ot=o.theme)==null?void 0:ot.colors)??[],primary:((D=o.theme)==null?void 0:D.primary)||"",secondary:((te=o.theme)==null?void 0:te.secondary)||"",onPrimaryChange:U=>ae("primary",U),onSecondaryChange:U=>ae("secondary",U),onColorsChange:H})}),A.jsx(er,{sx:{my:{xs:1.5,sm:2},borderColor:"divider"}}),A.jsx(ya,{title:"טון ותוכן",description:"איך העסק נשמע, תיאור קצר וכתובת האתר לעדכון.",children:A.jsxs(ct,{container:!0,spacing:{xs:2,sm:2.5,md:3},children:[A.jsx(ct,{item:!0,xs:12,md:6,children:A.jsx($W,{freeSolo:!0,options:C,value:o.business_tone||"",onChange:(U,O)=>{pe("business_tone",O||"")},onInputChange:(U,O)=>{pe("business_tone",O)},inputValue:o.business_tone||"",openOnFocus:!0,disablePortal:!0,componentsProps:{popper:{container:(P==null?void 0:P.getElementById("cdtr-business-ai-root"))||void 0,style:{zIndex:9999},modifiers:[{name:"offset",options:{offset:[0,4]}}]}},ListboxProps:{sx:{maxHeight:"300px","& .MuiAutocomplete-option":{padding:"8px 16px","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"},"&[aria-selected='true']":{backgroundColor:"rgba(0, 0, 0, 0.08)"}}}},PaperComponent:({children:U,...O})=>A.jsx(K,{...O,sx:{borderRadius:"4px",border:"1px solid rgba(0, 0, 0, 0.1)",marginTop:"4px",backgroundColor:"white"},children:U}),renderInput:U=>A.jsx(at,{...U,label:"טון עסקי",variant:"outlined",margin:"normal"}),noOptionsText:C.length===0?"הקלד טון עסקי":"אין אפשרויות"})}),A.jsxs(ct,{item:!0,xs:12,children:[A.jsx(Ae,{variant:"subtitle2",sx:{mb:{xs:.75,sm:1},fontSize:{xs:"0.875rem",sm:"1rem"}},children:"תיאור"}),(Array.isArray(o.description)?o.description:o.description?[o.description]:[""]).map((U,O)=>A.jsxs(K,{sx:{display:"flex",alignItems:"flex-start",gap:1,mb:1},children:[A.jsx(at,{fullWidth:!0,value:U,onChange:Z=>Ce("description",O,Z.target.value),variant:"outlined",margin:"normal",multiline:!0,rows:3,size:"small"}),A.jsx(Hn,{color:"error",onClick:()=>ce(O),sx:{mt:1},"aria-label":"הסר תיאור",children:A.jsx(Qs,{})})]},O)),A.jsx(ze,{variant:"outlined",startIcon:A.jsx(Fl,{}),onClick:ve,sx:{mt:1},children:"הוספת תיאור"})]}),A.jsx(ct,{item:!0,xs:12,md:6,children:A.jsx(at,{fullWidth:!0,label:"אתר אינטרנט",value:o.website,onChange:U=>pe("website",U.target.value),variant:"outlined",margin:"normal"})})]})}),A.jsx(er,{sx:{my:{xs:1.5,sm:2},borderColor:"divider"}}),A.jsxs(ya,{title:"קשר ורשתות",description:"אימייל וטלפון ליצירת קשר, וקישורים לפרופילים ציבוריים.",children:[A.jsxs(ct,{container:!0,spacing:{xs:1.5,sm:2},children:[A.jsx(ct,{item:!0,xs:12,md:6,children:A.jsx(at,{fullWidth:!0,label:"אימייל",value:o.contacts.email,onChange:U=>me("contacts","email",U.target.value),variant:"outlined",margin:"normal"})}),A.jsx(ct,{item:!0,xs:12,md:6,children:A.jsx(at,{fullWidth:!0,label:"טלפון",value:o.contacts.phone,onChange:U=>me("contacts","phone",U.target.value),variant:"outlined",margin:"normal"})})]}),A.jsxs(K,{sx:{mt:{xs:2,sm:2.5},p:{xs:1.5,sm:2},borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:U=>un(U.palette.common.black,.02)},children:[Object.entries(o.socials).map(([U,O])=>A.jsx(lO,{platform:U,url:O,onPlatformCommit:Ke,onUrlChange:qe,onRemove:re},j(U))),A.jsx(ze,{variant:"outlined",startIcon:A.jsx(Fl,{}),onClick:Ze,sx:{mt:1,textTransform:"none"},children:"הוספת רשת חברתית"})]})]})]})]}),A.jsxs(K,{className:w?_i.fadeUpDelay4:"",sx:{position:"fixed",bottom:0,left:0,right:0,zIndex:10,padding:{xs:1,sm:1,md:1},paddingTop:{xs:1,sm:1,md:1},backgroundColor:"background.default",borderTop:"1px solid",borderColor:"divider"},children:[m&&A.jsx(Ml,{severity:"error",sx:{mb:1},onClose:()=>x(null),children:m}),A.jsxs(ct,{container:!0,spacing:{xs:1,sm:2},sx:{justifyContent:{xs:"center",sm:"space-between"}},children:[A.jsx(ct,{item:!0,xs:12,sm:"auto",children:A.jsx(ze,{variant:"text",color:"primary",onClick:()=>n(L),fullWidth:!0,sx:{fontSize:{xs:"0.875rem",sm:"1rem"},maxWidth:{xs:"100%",sm:"auto"}},children:"חזרה"})}),A.jsx(ct,{item:!0,xs:12,sm:"auto",children:A.jsx(ze,{variant:"contained",color:"primary",onClick:Be,disabled:f,fullWidth:!0,startIcon:f?A.jsx(Va,{size:18,color:"inherit"}):null,sx:{fontSize:{xs:"0.875rem",sm:"1rem"},maxWidth:{xs:"100%",sm:"auto"},minWidth:120},children:f?"שומר...":"שלב הבא"})})]})]})]})}const sO=$t(A.jsx("path",{d:"M7 16c.55 0 1 .45 1 1 0 1.1-.9 2-2 2-.17 0-.33-.02-.5-.05.31-.55.5-1.21.5-1.95 0-.55.45-1 1-1M18.67 3c-.26 0-.51.1-.71.29L9 12.25 11.75 15l8.96-8.96c.39-.39.39-1.02 0-1.41l-1.34-1.34c-.2-.2-.45-.29-.7-.29M7 14c-1.66 0-3 1.34-3 3 0 1.31-1.16 2-2 2 .92 1.22 2.49 2 4 2 2.21 0 4-1.79 4-4 0-1.66-1.34-3-3-3"}),"BrushOutlined"),pO=$t(A.jsx("path",{d:"M20.97 7.27c.39-.39.39-1.02 0-1.41l-2.83-2.83a.9959.9959 0 0 0-1.41 0l-4.49 4.49-3.89-3.89c-.78-.78-2.05-.78-2.83 0l-1.9 1.9c-.78.78-.78 2.05 0 2.83l3.89 3.89L3 16.76V21h4.24l4.52-4.52 3.89 3.89c.95.95 2.23.6 2.83 0l1.9-1.9c.78-.78.78-2.05 0-2.83l-3.89-3.89zM5.04 6.94l1.89-1.9L8.2 6.31 7.02 7.5l1.41 1.41 1.19-1.19 1.2 1.2-1.9 1.9zm11.23 7.44-1.19 1.19 1.41 1.41 1.19-1.19 1.27 1.27-1.9 1.9-3.89-3.89 1.9-1.9zM6.41 19H5v-1.41l9.61-9.61 1.3 1.3.11.11zm9.61-12.44 1.41-1.41 1.41 1.41-1.41 1.41z"}),"DesignServicesOutlined");var Ch={},uO=Fe;Object.defineProperty(Ch,"__esModule",{value:!0});var aE=Ch.default=void 0,cO=uO(Oe()),AO=A;aE=Ch.default=(0,cO.default)((0,AO.jsx)("path",{d:"m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm0 6-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25zm-7.5-5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12zm-1.51 3.49L9 15.17l-.99-2.18L5.83 12l2.18-.99L9 8.83l.99 2.18 2.18.99z"}),"AutoAwesomeOutlined");var vh={},dO=Fe;Object.defineProperty(vh,"__esModule",{value:!0});var rE=vh.default=void 0,fO=dO(Oe()),yh=A;rE=vh.default=(0,fO.default)([(0,yh.jsx)("path",{d:"M18 10.48V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4.48l4 3.98v-11zm-2-.79V18H4V6h12z"},"0"),(0,yh.jsx)("circle",{cx:"10",cy:"10",r:"2"},"1"),(0,yh.jsx)("path",{d:"M14 15.43c0-.81-.48-1.53-1.22-1.85-.85-.37-1.79-.58-2.78-.58-.99 0-1.93.21-2.78.58C6.48 13.9 6 14.62 6 15.43V16h8z"},"2")],"VideoCameraFrontOutlined");var Sh={},WO=Fe;Object.defineProperty(Sh,"__esModule",{value:!0});var Ih=Sh.default=void 0,gO=WO(Oe()),hO=A;Ih=Sh.default=(0,gO.default)((0,hO.jsx)("path",{d:"M21 11.01 3 11v2h18zM3 16h12v2H3zM21 6H3v2.01L21 8z"}),"NotesOutlined");var xh={},mO=Fe;Object.defineProperty(xh,"__esModule",{value:!0});var lE=xh.default=void 0,CO=mO(Oe()),vO=A;lE=xh.default=(0,CO.default)((0,vO.jsx)("path",{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-1 9H9V9h10zm-4 4H9v-2h6zm4-8H9V5h10z"}),"LibraryBooks");var Eh={},yO=Fe;Object.defineProperty(Eh,"__esModule",{value:!0});var iE=Eh.default=void 0,SO=yO(Oe()),IO=A;iE=Eh.default=(0,SO.default)((0,IO.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit");var bh={},xO=Fe;Object.defineProperty(bh,"__esModule",{value:!0});var oE=bh.default=void 0,EO=xO(Oe()),bO=A;oE=bh.default=(0,EO.default)((0,bO.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const sE=[{id:"authentic_text",label:"טקסט אישי",questions:[{id:"topic",label:"נושא / תיאור קצר",inputType:"multiline"}]},{id:"designed_mail",label:"מעוצב (מצב מהיר)",questions:[{id:"topic",label:"נושא / תיאור קצר",inputType:"multiline"}]},{id:"studio_design",label:"מעוצב (סטודיו)",questions:[{id:"topic",label:"נושא / תיאור קצר",inputType:"multiline"}]},{id:"designed_mail_advanced",comingSoon:!0,label:"מעצב פרו (סטודיו)",questions:[{id:"topic",label:"נושא / תיאור קצר",inputType:"multiline"}]}];function pE(e){return sE.find(t=>t.id===e)}function kh(e){return e==="other"}function uE(e,t,n){if(e==="other"&&n!=null){const l=n.trim();return l?l+(l.endsWith(".")?"":"."):"אני רוצה לבנות מייל."}const a=pE(e);if(!a)return"";const r=[];if(e==="webinar"){const l=t.date||"",i=t.time||"",o=t.topic||"";return r.push("אני רוצה לבנות מייל לוובינר"),(l||i)&&r.push(`בתאריך ${l}${i?` בשעה ${i}`:""}`),o&&r.push(`, ${o}`),r.join(" ")+"."}if(e==="designed_mail"){const l=t.topic||"";return l?`אני רוצה לבנות מייל מעוצב: ${l}.`:"אני רוצה לבנות מייל מעוצב."}if(e==="studio_design"){const l=t.topic||"";return l?`אני רוצה לבנות מייל מעוצב בסטודיו: ${l}.`:"אני רוצה לבנות מייל מעוצב בסטודיו."}if(e==="authentic_text"){const l=t.topic||"";return l?`אני רוצה לבנות מייל בטקסט אישי: ${l}.`:"אני רוצה לבנות מייל בטקסט אישי."}return a.label?`אני רוצה לבנות מייל מסוג ${a.label}.`:""}var wh={},kO=Fe;Object.defineProperty(wh,"__esModule",{value:!0});var nA=wh.default=void 0,wO=kO(Oe()),RO=A;nA=wh.default=(0,wO.default)((0,RO.jsx)("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields");var Rh={},BO=Fe;Object.defineProperty(Rh,"__esModule",{value:!0});var Os=Rh.default=void 0,LO=BO(Oe()),MO=A;Os=Rh.default=(0,LO.default)((0,MO.jsx)("path",{d:"M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5C13 2.12 11.88 1 10.5 1S8 2.12 8 3.5V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7 1.49 0 2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5c1.38 0 2.5-1.12 2.5-2.5S21.88 11 20.5 11"}),"Extension");const cE=["newsletter.loadingSteps.building","newsletter.loadingSteps.searchingImages","newsletter.loadingSteps.choosingIcons","newsletter.loadingSteps.analyzing"],Bh=["https://images.pexels.com/photos/3184292/pexels-photo-3184292.jpeg?auto=compress&cs=tinysrgb&w=200","https://images.pexels.com/photos/2762247/pexels-photo-2762247.jpeg?auto=compress&cs=tinysrgb&w=200","https://images.pexels.com/photos/267350/pexels-photo-267350.jpeg?auto=compress&cs=tinysrgb&w=200"],QO={"@keyframes sceneIn":{"0%":{opacity:0,transform:"scale(0.94)"},"100%":{opacity:1,transform:"scale(1)"}},"@keyframes blockDrop":{"0%":{transform:"translate(-10px, -16px)",opacity:.5},"100%":{transform:"translate(0, 0)",opacity:1}},"@keyframes blockFloat":{"0%, 100%":{transform:"translate(0, 0)"},"50%":{transform:"translate(3px, -2px)"}}},Qn={animation:"blockDrop 0.5s ease-out both, blockFloat 2.2s ease-in-out 0.6s infinite",borderRadius:2,border:"1px solid rgba(0, 0, 0, 0.08)",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},AE={background:`linear-gradient(135deg, ${tA}61 0%, ${mh}61 100%)`};function VO(){return A.jsxs(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1.5},children:[A.jsx(K,{className:"block",sx:{...Qn,width:110,height:26,background:ta,color:"primary.contrastText"},children:A.jsx(nA,{sx:{fontSize:16}})}),A.jsx(K,{className:"block",sx:{...Qn,width:130,height:72},children:A.jsx("img",{src:Bh[0],alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})}),A.jsxs(K,{sx:{display:"flex",gap:1},children:[A.jsx(K,{className:"block",sx:{...Qn,width:36,height:36,bgcolor:"secondary.main",color:"secondary.contrastText"},children:A.jsx(Os,{sx:{fontSize:20}})}),A.jsx(K,{className:"block",sx:{...Qn,width:44,height:36,...AE}})]})]})}function UO(){return A.jsxs(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1.5},children:[A.jsx(K,{className:"block",sx:{...Qn,width:130,height:68},children:A.jsx("img",{src:Bh[1],alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})}),A.jsxs(K,{sx:{display:"flex",gap:1},children:[A.jsx(K,{className:"block",sx:{...Qn,width:100,height:24,background:ta,color:"primary.contrastText"},children:A.jsx(nA,{sx:{fontSize:14}})}),A.jsx(K,{className:"block",sx:{...Qn,width:36,height:36,bgcolor:"secondary.main",color:"secondary.contrastText"},children:A.jsx(Os,{sx:{fontSize:20}})})]}),A.jsx(K,{className:"block",sx:{...Qn,width:90,height:32,bgcolor:"grey.300"}})]})}function FO(){return A.jsxs(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1.5},children:[A.jsxs(K,{sx:{display:"flex",gap:1},children:[A.jsx(K,{className:"block",sx:{...Qn,width:38,height:38,background:ta,color:"primary.contrastText"},children:A.jsx(Os,{sx:{fontSize:22}})}),A.jsx(K,{className:"block",sx:{...Qn,width:50,height:38,...AE}}),A.jsx(K,{className:"block",sx:{...Qn,width:38,height:38,bgcolor:"secondary.main",color:"secondary.contrastText"},children:A.jsx(Os,{sx:{fontSize:20}})})]}),A.jsx(K,{className:"block",sx:{...Qn,width:120,height:70},children:A.jsx("img",{src:Bh[2],alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})}),A.jsx(K,{className:"block",sx:{...Qn,width:100,height:22,background:ta,color:"primary.contrastText"},children:A.jsx(nA,{sx:{fontSize:14}})})]})}const dE=[VO,UO,FO];function zO(e){const{t}=Nn(),[n,a]=v.useState(0),[r,l]=v.useState(0),[i,o]=v.useState(0);v.useEffect(()=>{const p=setInterval(()=>{a(u=>(u+1)%cE.length)},2500);return()=>clearInterval(p)},[]),v.useEffect(()=>{const p=setInterval(()=>{l(u=>(u+1)%dE.length)},3200);return()=>clearInterval(p)},[]),v.useEffect(()=>{const p=setInterval(()=>{o(u=>u+1)},1e3);return()=>clearInterval(p)},[]);const s=dE[r];return A.jsxs(K,{sx:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:2,paddingTop:4,...QO},children:[A.jsx(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1.5,mb:3,minHeight:180,"& .block":Qn,"& .block:nth-of-type(1)":{animationDelay:"0s, 0.6s"},"& .block:nth-of-type(2)":{animationDelay:"0.12s, 0.72s"},"& .block:nth-of-type(3)":{animationDelay:"0.24s, 0.84s"},"& .block:nth-of-type(4)":{animationDelay:"0.36s, 0.96s"},"& .block:nth-of-type(5)":{animationDelay:"0.48s, 1.08s"},"& .block:nth-of-type(6)":{animationDelay:"0.6s, 1.2s"}},children:A.jsx(K,{sx:{animation:"sceneIn 0.4s ease-out"},children:A.jsx(s,{})},r)}),A.jsx(K,{sx:{display:"flex",gap:.75,mb:1.5},children:[0,1,2,3].map(p=>A.jsx(K,{sx:{width:10,height:10,borderRadius:"50%",...p<=n?{background:ta}:{bgcolor:"action.hover"},opacity:p===n?1:p<n?.8:.4,transition:"opacity 0.3s ease, background-color 0.3s ease"}},p))}),A.jsx(Ae,{variant:"body1",sx:{fontWeight:500,color:"text.secondary"},children:t(cE[n])}),A.jsxs(Ae,{variant:"caption",sx:{mt:1,color:"text.disabled",fontVariantNumeric:"tabular-nums"},children:[Math.floor(i/60).toString().padStart(2,"0"),":",(i%60).toString().padStart(2,"0")]})]})}const fE={IL:"Israel",US:"United States",CA:"Canada",GB:"United Kingdom",UK:"United Kingdom",AU:"Australia",DE:"Germany",FR:"France",ES:"Spain",IT:"Italy",NL:"Netherlands",BR:"Brazil",MX:"Mexico",AR:"Argentina",RU:"Russia",JP:"Japan",CN:"China",IN:"India",ZA:"South Africa",AE:"United Arab Emirates",SA:"Saudi Arabia",PL:"Poland",SE:"Sweden",NO:"Norway",DK:"Denmark",FI:"Finland",CH:"Switzerland",AT:"Austria",BE:"Belgium",PT:"Portugal",GR:"Greece",TR:"Turkey",KR:"South Korea",SG:"Singapore",HK:"Hong Kong",TW:"Taiwan",NZ:"New Zealand",IE:"Ireland"},qO={"Asia/Jerusalem":"Israel","America/New_York":"United States","America/Los_Angeles":"United States","America/Chicago":"United States","America/Toronto":"Canada","America/Vancouver":"Canada","Europe/London":"United Kingdom","Europe/Paris":"France","Europe/Berlin":"Germany","Europe/Madrid":"Spain","Europe/Rome":"Italy","Europe/Amsterdam":"Netherlands","Australia/Sydney":"Australia","Australia/Melbourne":"Australia","Asia/Tokyo":"Japan","Asia/Shanghai":"China","Asia/Dubai":"United Arab Emirates","America/Sao_Paulo":"Brazil","America/Mexico_City":"Mexico"};function jO(){if(typeof navigator>"u")return null;try{const e=navigator,t=[navigator.language,...e.languages??[]].filter(Boolean);for(const n of t){if(!n)continue;const a=new Intl.Locale(n).region;if(a&&fE[a])return fE[a];if(n.startsWith("he")&&!a)return"Israel"}}catch{}try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e){const t=qO[e];if(t)return t;if(e.split("/")[0]==="Asia"&&e.includes("Jerusalem"))return"Israel"}}catch{}return null}const TO={authentic_text:Ih,webinar:rE,designed_mail:aE,studio_design:sO,designed_mail_advanced:pO};function Lh({header:e,children:t,footer:n,compactBody:a}){return A.jsxs(K,{sx:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",bgcolor:"background.paper"},children:[A.jsx(K,{sx:{flexShrink:0,pt:{xs:6,sm:7},px:2.5,pb:2,borderBottom:"1px solid",borderColor:"divider"},children:e}),a?A.jsx(K,{sx:{flex:1,minHeight:0}}):A.jsx(K,{sx:{flex:1,minHeight:0,overflow:"auto",px:2.5,py:2,WebkitOverflowScrolling:"touch"},children:t}),n?A.jsx(K,{sx:{flexShrink:0,px:2.5,py:2,borderTop:"1px solid",borderColor:"divider",bgcolor:"background.paper"},children:n}):null]})}function OO({domain:e,mergeTags:t=[],visibilityRules:n,location:a,onResult:r,result:l,language:i,context:o,onSeriesClick:s,onBack:p}){const{t:u}=Nn(),c=Ni(),{step3Draft:d,setStep3Draft:f}=rx(),[W,m]=v.useState(0),[x,h]=v.useState(null),[g,C]=v.useState({}),[y,E]=v.useState(""),[S,k]=v.useState(!1),[R,V]=v.useState(null),[b,B]=v.useState(null),M=x?pE(x):null,F=(M==null?void 0:M.questions)??[],z=a&&a.trim()||jO()||void 0,T=Y=>{h(Y),C({}),m(1)},j=(Y,ne)=>{C(fe=>({...fe,[Y]:ne}))},P=async()=>{if(!y.trim())return;k(!0),V(null);const Y=Date.now();try{const ne=uE("other",{},y),fe=await kg({prompt:ne,domain:e,mergeTags:t,structureUrl:"",textStyleUrl:"",...n&&Object.keys(n).length>0?{visibilityRules:n}:{},...i?{language:i}:{},...z?{location:z}:{},...o?{context:o}:{}});B(Math.round((Date.now()-Y)/1e3)),r(fe)}catch(ne){console.error("Newsletter generation failed:",ne),V(u("common.errorGeneric"))}finally{k(!1)}},L=async(Y,ne)=>{k(!0),V(null);const fe=Date.now();try{const pe=x==="studio_design"||x==="webinar",me=x==="designed_mail";if(me||pe){const ae=i||"he",H=Kj(o,ae),Ce={prompt:Y,accountId:H.accountId,language:ae,...t.length>0?{mergeTags:t}:{},businessContext:H},he={components:(me?await Tj(Ce):await Oj(Ce)).nodes??[]};B(Math.round((Date.now()-fe)/1e3)),r(he)}else{const ae=await kg({prompt:Y,domain:e,mergeTags:t,structureUrl:"",textStyleUrl:ne,...n&&Object.keys(n).length>0?{visibilityRules:n}:{},...i?{language:i}:{},...z?{location:z}:{},...o?{context:o}:{}});B(Math.round((Date.now()-fe)/1e3)),r(ae)}}catch(pe){console.error("Newsletter generation failed:",pe),V(u("common.errorGeneric"))}finally{k(!1)}},q=()=>{const Y=uE(x,g);Y&&L(Y,"")},w=()=>{if(c&&l){const Y=(d==null?void 0:d.components)??l.components??l.template,ne={...l,components:Y,template:Y};try{c.triggerEvent("onEditPage",ne),f(null)}catch{}}},X=()=>{r(null),m(0),h(null),C({}),E(""),V(null),B(null)},ee=()=>{m(0),h(null),C({}),E("")};if(l&&l.components)return A.jsx(Lh,{compactBody:!0,header:A.jsxs(ut,{spacing:1,children:[A.jsx(Ae,{variant:"h6",component:"h1",sx:{fontWeight:700,letterSpacing:"-0.02em",lineHeight:1.35},children:u("newsletter.successHeading")}),A.jsx(Ae,{variant:"body2",color:"text.secondary",sx:{lineHeight:1.55},children:u("newsletter.successMessage")}),b!=null&&A.jsxs(Ae,{variant:"caption",color:"text.disabled",sx:{fontVariantNumeric:"tabular-nums"},children:[Math.floor(b/60).toString().padStart(2,"0"),":",(b%60).toString().padStart(2,"0")]})]}),footer:A.jsxs(ut,{direction:"row",flexWrap:"wrap",gap:1.5,justifyContent:"flex-start",children:[A.jsx(ze,{variant:"contained",color:"primary",startIcon:A.jsx(iE,{}),onClick:w,sx:{textTransform:"none"},children:u("newsletter.editDesign")}),A.jsx(ze,{variant:"outlined",color:"primary",startIcon:A.jsx(oE,{}),onClick:X,sx:{textTransform:"none"},children:u("newsletter.startOver")})]})});if(S)return A.jsx(K,{sx:{height:"100%",minHeight:0,overflow:"auto"},children:A.jsx(zO,{language:i})});const Q=W!==1||!x?"":kh(x)?u("newsletter.tellUs"):M?u(`newsletter.types.${M.id}`):"";if(W===0)return A.jsxs(Lh,{header:A.jsxs(ut,{spacing:1,children:[p?A.jsx(ze,{variant:"text",color:"primary",onClick:p,sx:{alignSelf:"flex-start",textTransform:"none",minWidth:"auto",px:.5,ml:-.5,mt:1},children:u("newsletter.back")}):A.jsxs(A.Fragment,{children:[A.jsx("br",{}),A.jsx("br",{})]}),A.jsx(Ae,{component:"h1",variant:"h6",sx:{fontWeight:700,letterSpacing:"-0.02em",lineHeight:1.35,color:"text.primary"},children:u("newsletter.whatType")}),A.jsx(Ae,{variant:"body2",color:"text.secondary",sx:{fontSize:"0.8125rem",lineHeight:1.55,maxWidth:"52ch"},children:u("newsletter.typeSectionHint")})]}),children:[A.jsxs(ut,{spacing:1.25,children:[sE.map(Y=>{const ne=TO[Y.id]??Ih;return A.jsx(eg,{elevation:0,variant:"outlined",sx:{borderRadius:2,borderColor:"divider",bgcolor:"background.paper",transition:"border-color 0.2s ease, box-shadow 0.2s ease","&:hover":{borderColor:"primary.main",boxShadow:fe=>`0 2px 12px ${un(fe.palette.primary.main,.12)}`},...Y.comingSoon?{opacity:.5,cursor:"not-allowed"}:{}},children:A.jsx(eI,{onClick:()=>Y.comingSoon?null:T(Y.id),sx:{borderRadius:0,"&:focus-visible":{outlineOffset:-2}},children:A.jsx(ng,{sx:{py:1.75,px:2,"&:last-child":{pb:1.75}},children:A.jsxs(ut,{direction:"row",spacing:1.75,alignItems:"center",children:[A.jsx(K,{sx:{width:44,height:44,borderRadius:1.5,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:fe=>un(fe.palette.primary.main,.08),border:fe=>`1px solid ${un(fe.palette.primary.main,.16)}`},children:A.jsx(ne,{sx:{fontSize:24,...Xi}})}),A.jsx(Ae,{variant:"subtitle1",sx:{fontWeight:600,fontSize:"0.9375rem",lineHeight:1.4,letterSpacing:"-0.01em",color:"text.primary"},children:u(`newsletter.types.${Y.id}`)}),Y.comingSoon?A.jsx(vn,{label:u("newsletter.comingSoon"),size:"small",color:"primary",variant:"outlined"}):null]})})})},Y.id)}),s?A.jsx(eg,{elevation:0,variant:"outlined",sx:{borderRadius:2,borderColor:"divider",bgcolor:"background.paper",opacity:.5,cursor:"not-allowed"},children:A.jsx(eI,{onClick:void 0,disabled:!0,sx:{borderRadius:0,"&:focus-visible":{outlineOffset:-2}},children:A.jsx(ng,{sx:{py:1.75,px:2,"&:last-child":{pb:1.75}},children:A.jsxs(ut,{direction:"row",spacing:1.75,alignItems:"center",children:[A.jsx(K,{sx:{width:44,height:44,borderRadius:1.5,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:Y=>un(Y.palette.primary.main,.08),border:Y=>`1px solid ${un(Y.palette.primary.main,.16)}`},children:A.jsx(lE,{sx:{fontSize:24,...Xi}})}),A.jsx(Ae,{variant:"subtitle1",sx:{fontWeight:600,fontSize:"0.9375rem",lineHeight:1.4,letterSpacing:"-0.01em",color:"text.primary"},children:u("seriesPrompt.hub.title")}),A.jsx(vn,{label:u("newsletter.comingSoon"),size:"small",color:"primary",variant:"outlined"})]})})})}):null]}),R?A.jsx(Ae,{color:"error",variant:"body2",sx:{mt:2},children:R}):null]});const G=kh(x)?A.jsx(ut,{direction:"row",spacing:1.5,justifyContent:"flex-end",flexWrap:"wrap",children:A.jsx(ze,{variant:"contained",color:"primary",onClick:P,disabled:!y.trim()||S,sx:{textTransform:"none"},children:S?A.jsx(Va,{size:22,color:"inherit"}):u("common.send")})}):A.jsx(ut,{direction:"row",spacing:1.5,justifyContent:"flex-end",flexWrap:"wrap",children:A.jsx(ze,{variant:"contained",color:"primary",onClick:q,disabled:S,sx:{textTransform:"none"},children:S?A.jsx(Va,{size:22,color:"inherit"}):u("common.continue")})});return A.jsxs(Lh,{header:A.jsxs(ut,{spacing:1.25,children:[A.jsx(ze,{variant:"text",color:"primary",onClick:ee,sx:{alignSelf:"flex-start",textTransform:"none",minWidth:"auto",px:.5,ml:-.5,mt:-.5},children:u("newsletter.back")}),A.jsx(Ae,{variant:"h6",component:"h1",sx:{fontWeight:700,letterSpacing:"-0.02em",lineHeight:1.35},children:Q}),A.jsx(Ae,{variant:"body2",color:"text.secondary",sx:{fontSize:"0.8125rem",lineHeight:1.55},children:u("newsletter.questionsSectionHint")})]}),footer:G,children:[kh(x)?A.jsx(at,{multiline:!0,minRows:4,placeholder:u("newsletter.writeHere"),value:y,onChange:Y=>E(Y.target.value),fullWidth:!0,variant:"outlined",size:"small"}):A.jsx(ut,{spacing:2,children:F.map(Y=>A.jsx(K,{children:Y.inputType==="multiline"?A.jsxs(A.Fragment,{children:[A.jsx(Ae,{variant:"caption",sx:{mb:.75,display:"block",fontWeight:600,color:"text.secondary",letterSpacing:"0.02em"},children:u("newsletter.topicLabel")}),A.jsx(at,{multiline:!0,minRows:3,placeholder:u("newsletter.writeHere"),value:g[Y.id]??"",onChange:ne=>j(Y.id,ne.target.value),fullWidth:!0,variant:"outlined",size:"small"})]}):A.jsx(at,{label:u(x==="webinar"&&Y.id==="topic"?"newsletter.questions.topicShort":`newsletter.questions.${Y.id}`),type:Y.inputType==="date"?"date":Y.inputType==="time"?"time":"text",value:g[Y.id]??"",onChange:ne=>j(Y.id,ne.target.value),fullWidth:!0,variant:"outlined",size:"small",InputLabelProps:Y.inputType==="date"||Y.inputType==="time"?{shrink:!0}:void 0})},Y.id))}),R?A.jsx(Ae,{color:"error",variant:"body2",sx:{mt:2},children:R}):null]})}function KO({setActiveStep:e,placeholderSuggestions:t=[],language:n,data:a={},logo:r="",mergeTags:l=[],visibilityRules:i,location:o,onDesignChange:s}){const{t:p}=Nn(),u=v.useRef(s);u.current=s;const{step2Data:c}=bg(),{step3Draft:d,setStep3Draft:f}=rx(),W=c||a,m=(W==null?void 0:W.businessData)||W,x=(W==null?void 0:W.websiteUrl)||(m==null?void 0:m.website)||"",h=Xc({...m,websiteUrl:x})??void 0,g=(c==null?void 0:c.logo)||(W&&typeof W=="object"&&"logo"in W?W.logo:r),C=(c==null?void 0:c.logoBackgroundHex)??(W==null?void 0:W.logoBackgroundHex),y=v.useRef(null),E=v.useRef(!1),S=v.useRef(null),k=v.useRef(!1),[R,V]=v.useState(0),[b,B]=v.useState(0),[M,F]=v.useState([]),[z,T]=v.useState(null);v.useEffect(()=>{var q;if(k.current)return;const L=d;(q=L==null?void 0:L.components)!=null&&q.length&&(k.current=!0,F(Array.isArray(L.components)?L.components:[]),T(L.surveyResult??null))},[d]);const j=L=>{if(L!=null&&L.components){const q=Array.isArray(L.components)?L.components:[];F(q),T(L),f({components:q,surveyResult:L})}else F([]),T(null),f(null),B(q=>q+1)};v.useEffect(()=>{},[]),v.useEffect(()=>{var X;if(M.length===0||!y.current)return;const L=y.current.querySelector("iframe");L&&L.remove(),(X=S.current)!=null&&X.parentNode&&S.current.parentNode.removeChild(S.current),S.current=null,E.current=!1,E.current=!0;const q=document.createElement("iframe");q.width="100%",q.height="100%",q.style.border="none",S.current=q,y.current.appendChild(q);let w=!1;return q.onload=()=>{if(w)return;w=!0;const ee=q.contentDocument,Q=q.contentWindow;if(!ee||!Q||ee.querySelector('script[src*="creaditor.bundle.js"]'))return;ee.open(),ee.write(`
521
521
  <!DOCTYPE html>
522
522
  <html>
523
523
  <head>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@creaditor/business-ai",
3
3
  "private": false,
4
- "version": "1.0.51",
4
+ "version": "1.0.52",
5
5
  "type": "module",
6
6
  "publishConfig": {
7
7
  "access": "public"