1import{j as e,C as ue,_ as he,cP as L,r as m,b as O,T as ge,a5 as Y,aH as fe,aJ as be,af as pe,ac as je,d as p,z as j,Z as K}from"./index-BH8Hq4fF.js";import{N as _e}from"./softDelete-X2GBluex.js";import{P as Ne}from"./PageHeader-BtIoJIMT.js";import{H as ye,V as we,D as ee,b as T,g as U,a as I,c as te,f as J,S as ve,d as X,e as Z}from"./birthdayUtils-I2qttL2F.js";import{C as ke}from"./calendar-clock-DVPPNrp2.js";import{C as Se}from"./calendar-range-MV76RTDY.js";import{U as q}from"./upload-DtbdHLAK.js";import{S as De}from"./save-B5tADMHo.js";import{I as Ce}from"./image-DgoP-ctX.js";import{E as Te}from"./eye-off-B4MzD2pP.js";import{C as Me}from"./copy-B_0EPT7Q.js";const Be=[{key:"total_sent",label:'ס×"× ×ר××ת ×©× ×©×××',icon:ue,color:"text-emerald-600",bg:"bg-emerald-50"},{key:"sent_this_month",label:"× ×©××× ××××ש",icon:ke,color:"text-blue-600",bg:"bg-blue-50"},{key:"next_month",label:"×ש××× ××××ש ×××",icon:Se,color:"text-purple-600",bg:"bg-purple-50"},{key:"until_end_of_year",label:"×ש××× ×¢× ×¡××£ ××©× ×",icon:he,color:"text-orange-600",bg:"bg-orange-50"},{key:"next_month_info",label:"×××ש ×××",icon:L,color:"text-rose-600",bg:"bg-rose-50"}];function Ee({stats:r,selected:l,onSelect:h}){return e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3 mb-6",children:Be.map(n=>{const g=n.icon,i=l===n.key,a=r[n.key]??0;return e.jsxs("button",{onClick:()=>h(i?null:n.key),className:`bg-white rounded-2xl border p-4 shadow-sm text-right transition-all hover:shadow-md ${i?"border-blue-400 ring-2 ring-blue-100":"border-border hover:border-blue-200"}`,children:[e.jsx("div",{className:`w-10 h-10 rounded-xl ${n.bg} flex items-center justify-center mb-3`,children:e.jsx(g,{className:`w-5 h-5 ${n.color}`})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:n.label}),n.key==="next_month_info"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-base font-bold text-foreground mt-1",children:ye[r.nextMonthIndex]||"-"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[a," ת×ש×××"]})]}):e.jsx("p",{className:"text-2xl font-bold text-foreground mt-1",children:a})]},n.key)})})}const Ie={direction:"ltr",unicodeBidi:"plaintext"};function Le({form:r,onChange:l,onSave:h,onTestSend:n,onImageUpload:g,onRemoveImage:i,saving:a,uploading:k,isExisting:M}){const f=m.useRef(null);function S(o){const b=f.current;if(!b)return;const y=b.selectionStart,R=b.selectionEnd,B=(r.message_template||"").slice(0,y)+o+(r.message_template||"").slice(R);l("message_template",B),setTimeout(()=>{b.focus(),b.selectionStart=b.selectionEnd=y+o.length},0)}function N(o){var y;const b=(y=o.target.files)==null?void 0:y[0];b&&g(b),o.target.value=""}return e.jsxs("div",{className:"bg-white rounded-2xl border border-border shadow-sm p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(L,{className:"w-5 h-5 text-rose-500"}),e.jsx("h3",{className:"text-base font-bold",children:"×××ר ×ר×× ×××××××ת ×××××××ת"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"×××××¢× ×ª×ש×× ××ש×ת ×-WhatsApp ×ת××©× ×××× ×××××ת ש××"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl bg-slate-50 border border-border",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"×פע×ת ש×××× ×××××××ת"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"פע×× / ×× ×¤×¢××"})]}),e.jsx("button",{onClick:()=>l("is_enabled",!r.is_enabled),className:`relative w-12 h-6 rounded-full transition-colors ${r.is_enabled?"bg-emerald-500":"bg-slate-300"}`,children:e.jsx("span",{className:`absolute top-0.5 w-5 h-5 rounded-full bg-white shadow-sm transition-all ${r.is_enabled?"right-0.5":"right-6"}`})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"ת××× ××ר××"}),e.jsx("div",{className:"flex flex-wrap gap-1.5 my-1.5",children:we.map(o=>e.jsx("button",{onClick:()=>S(o.variable),className:"px-2.5 py-1 rounded-full text-xs font-medium bg-blue-50 text-blue-600 border border-blue-100 hover:bg-blue-100 transition-colors",children:o.label},o.variable))}),e.jsx("textarea",{ref:f,value:r.message_template||"",onChange:o=>l("message_template",o.target.value),rows:5,placeholder:ee,className:"w-full rounded-lg border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-rose-100 resize-y"})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:r.include_resident_name!==!1,onChange:o=>l("include_resident_name",o.target.checked),className:"w-4 h-4 rounded"}),"××סף ×ת ×©× ×ת××©× ×ת×××ת ×××××¢×"]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"ת××× × ×××××¢×"}),r.image_url?e.jsxs("div",{className:"mt-1.5 relative rounded-xl overflow-hidden border border-border",children:[e.jsx("img",{src:r.image_url,alt:"ת××× ×ª ×ר××",className:"w-full max-h-40 object-cover"}),e.jsxs("div",{className:"flex gap-2 p-2 bg-white border-t border-border",children:[e.jsxs("label",{className:"flex-1 flex items-center justify-center gap-1.5 h-8 rounded-lg bg-slate-50 border border-border text-xs font-medium cursor-pointer hover:bg-slate-100",children:[k?e.jsx(O,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(q,{className:"w-3.5 h-3.5"}),"××××£ ת××× ×",e.jsx("input",{type:"file",accept:"image/*",onChange:N,className:"hidden"})]}),e.jsxs("button",{onClick:i,className:"flex items-center justify-center gap-1.5 h-8 px-3 rounded-lg bg-red-50 text-red-600 border border-red-100 text-xs font-medium hover:bg-red-100",children:[e.jsx(ge,{className:"w-3.5 h-3.5"}),"×סר"]})]})]}):e.jsxs("label",{className:"mt-1.5 flex flex-col items-center justify-center gap-2 h-28 rounded-xl border-2 border-dashed border-slate-200 cursor-pointer hover:border-rose-300 hover:bg-rose-50/30 transition-colors",children:[k?e.jsx(O,{className:"w-6 h-6 text-slate-400 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"w-6 h-6 text-slate-400"}),e.jsx("span",{className:"text-xs text-slate-500",children:"×××¥ ×××¢××ת ת××× ×"})]}),e.jsx("input",{type:"file",accept:"image/*",onChange:N,className:"hidden"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"שעת ש××××"}),e.jsx("input",{type:"time",value:r.send_time||"09:00",onChange:o=>l("send_time",o.target.value),style:Ie,className:"w-full h-9 rounded-lg border border-slate-200 px-3 text-sm focus:outline-none focus:ring-2 focus:ring-rose-100"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"×××××¢× ×ª×ש×× ×××× ×××××ת ××©×¢× ×©× ××ר×"})]}),e.jsxs("div",{className:"flex gap-2 pt-1",children:[e.jsxs("button",{onClick:h,disabled:a,className:"flex-1 h-10 rounded-xl bg-rose-600 text-white text-sm font-medium hover:bg-rose-700 disabled:opacity-50 flex items-center justify-center gap-2",children:[a?e.jsx(O,{className:"w-4 h-4 animate-spin"}):e.jsx(De,{className:"w-4 h-4"}),"ש××ר"]}),e.jsxs("button",{onClick:n,disabled:a||!r.message_template,className:"flex-1 h-10 rounded-xl border border-border text-sm font-medium hover:bg-accent disabled:opacity-50 flex items-center justify-center gap-2",children:[e.jsx(Y,{className:"w-4 h-4"}),"ש×× ××××§×"]})]})]})]})}function Re({template:r,includeName:l,imageUrl:h,sendTime:n,kibbutzName:g}){const i={first_name:"×× ×",full_name:"×× × ×××"},a=T(r,i,g,l);return e.jsxs("div",{className:"bg-white rounded-2xl border border-border shadow-sm p-5",children:[e.jsx("h3",{className:"text-base font-bold mb-1",children:"תצ××× ××§××××"}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"×× ×ª×ר×× ×××××¢× ×-WhatsApp"}),e.jsxs("div",{className:"rounded-xl overflow-hidden border border-border",style:{background:"#e5ddd5"},children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5",style:{background:"#075e54"},children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-white/20 flex items-center justify-center text-white text-sm font-medium",children:i.first_name[0]}),e.jsx("span",{className:"text-white text-sm font-medium",children:i.full_name})]}),e.jsx("div",{className:"p-4 min-h-[200px]",children:a?e.jsxs("div",{className:"max-w-[80%] rounded-lg p-3 shadow-sm relative",style:{background:"#dcf8c6"},children:[h&&e.jsx("img",{src:h,alt:"×ר××",className:"w-full rounded-lg mb-2 max-h-40 object-cover"}),e.jsx("p",{className:"text-sm text-slate-800 whitespace-pre-line leading-relaxed",children:a}),e.jsxs("span",{className:"text-[0.625rem] text-slate-400 block text-left mt-1",children:[n||"09:00"," ââ"]})]}):e.jsx("div",{className:"flex items-center justify-center h-40 text-center",children:e.jsx("p",{className:"text-sm text-slate-500",children:"××§×× ×ª××× ×ר×× ××× ×ר××ת תצ××× ××§××××"})})})]}),e.jsxs("div",{className:"mt-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(fe,{className:"w-4 h-4"}),"שעת ש××××: ",e.jsx("span",{className:"font-medium text-foreground",children:n||"09:00"})]}),h&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Ce,{className:"w-4 h-4"}),"ת××× × ×צ×רפת ×××××¢×"]})]})]})}const Ae={direction:"ltr",unicodeBidi:"plaintext"};function Fe({rows:r,settings:l,kibbutzName:h,onSendNow:n,onSkip:g,onViewMessage:i}){return r.length===0?e.jsx("div",{className:"bg-white rounded-2xl border border-border shadow-sm",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center px-4",children:[e.jsx("div",{className:"w-14 h-14 roun
1ded-2xl bg-slate-50 flex items-center justify-center mb-3",children:e.jsx(be,{className:"w-7 h-7 text-slate-400"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"××× × ×ª×× ×× ××צ×× ××§×××ר×× ××"})]})}):e.jsx("div",{className:"bg-white rounded-2xl border border-border shadow-sm overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border bg-slate-50",children:[e.jsx("th",{className:"text-right font-medium text-muted-foreground px-4 py-3",children:"×©× ×ת×ש×"}),e.jsx("th",{className:"text-right font-medium text-muted-foreground px-4 py-3",children:"ת×ר×× ××××"}),e.jsx("th",{className:"text-right font-medium text-muted-foreground px-4 py-3",children:"××× ××××ת ×קר××"}),e.jsx("th",{className:"text-right font-medium text-muted-foreground px-4 py-3",children:"×××"}),e.jsx("th",{className:"text-right font-medium text-muted-foreground px-4 py-3",children:"××פ××"}),e.jsx("th",{className:"text-right font-medium text-muted-foreground px-4 py-3",children:"ס×××ס"}),e.jsx("th",{className:"text-right font-medium text-muted-foreground px-4 py-3",children:"ת×ר×× ×©××××"}),e.jsx("th",{className:"text-right font-medium text-muted-foreground px-4 py-3",children:"פע×××ת"})]})}),e.jsx("tbody",{children:r.map((a,k)=>{const M=T(l==null?void 0:l.message_template,a.resident,h,l==null?void 0:l.include_resident_name);a.phone&&U(a.phone,M);const f=a.upcomingBirthday||I(a.birthDate),S=a.age??te(a.birthDate);return e.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-slate-50",children:[e.jsx("td",{className:"px-4 py-3 font-medium text-foreground",children:a.name}),e.jsx("td",{className:"px-4 py-3 text-muted-foreground",children:J(a.birthDate)}),e.jsx("td",{className:"px-4 py-3 text-muted-foreground",children:f?J(f):"-"}),e.jsx("td",{className:"px-4 py-3 text-muted-foreground",children:S??"-"}),e.jsx("td",{className:"px-4 py-3",children:a.phone?e.jsx("span",{style:Ae,className:"text-muted-foreground",children:a.phone}):e.jsx("span",{className:"text-xs text-red-500",children:"×סר"})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium border ${X[a.status]||X.scheduled}`,children:ve[a.status]||a.status})}),e.jsx("td",{className:"px-4 py-3 text-muted-foreground text-xs",children:a.sentAt?Z(a.sentAt):a.scheduledDate?Z(a.scheduledDate):"-"}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("button",{onClick:()=>n(a),disabled:!a.phone,title:"ש×× ×¢×ש××",className:"w-7 h-7 rounded-lg bg-emerald-50 text-emerald-600 flex items-center justify-center hover:bg-emerald-100 disabled:opacity-30",children:e.jsx(Y,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:()=>g(a),title:"××× ××©× ×",className:"w-7 h-7 rounded-lg bg-slate-50 text-slate-500 flex items-center justify-center hover:bg-slate-100",children:e.jsx(Te,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:()=>i(a),title:"צפ××× ×××××¢×",className:"w-7 h-7 rounded-lg bg-blue-50 text-blue-600 flex items-center justify-center hover:bg-blue-100",children:e.jsx(pe,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:()=>{var N;return(N=navigator.clipboard)==null?void 0:N.writeText(a.phone||"")},disabled:!a.phone,title:"×עתק ××פ××",className:"w-7 h-7 rounded-lg bg-slate-50 text-slate-500 flex items-center justify-center hover:bg-slate-100 disabled:opacity-30",children:e.jsx(Me,{className:"w-3.5 h-3.5"})})]})})]},a.residentId||a.id||k)})})]})})})}const Q={direction:"ltr",unicodeBidi:"plaintext"},$={is_enabled:!1,message_template:ee,include_resident_name:!0,image_url:"",send_time:"09:00",use_whatsapp:!0};function Je(){const{id:r}=je(),[l,h]=m.useState(null),[n,g]=m.useState({...$}),[i,a]=m.useState([]),[k,M]=m.useState([]),[f,S]=m.useState(""),[N,o]=m.useState(!0),[b,y]=m.useState(!1),[R,B]=m.useState(!1),[w,se]=m.useState(null),[D,A]=m.useState(null),[F,W]=m.useState(""),[ae,E]=m.useState(!1);m.useEffect(()=>{r&&z()},[r]);async function z(){o(!0);try{const[s,t,d,x]=await Promise.all([p.entities.BirthdayGreetingSettings.filter({kibbutz_id:r}).catch(()=>[]),p.entities.BirthdayGreetingLog.filter({kibbutz_id:r},"-created_date",500).catch(()=>[]),p.entities.Resident.filter({kibbutz_id:r,is_deleted:_e}
1,"-created_date",2e3).catch(()=>[]),p.entities.Kibbutz.get(r).catch(()=>null)]),c=s[0]||null;h(c),g({...$,...c||{}}),a(t),M(d),S((x==null?void 0:x.name)||"")}catch{j.error("ש×××× ×××¢×× ×ª × ×ª×× ××")}finally{o(!1)}}const v=m.useMemo(()=>k.filter(s=>{if(!s.birth_date)return!1;const t=new Date(s.birth_date);return!isNaN(t.getTime())}),[k]),_=new Date().getFullYear(),C=new Date,P=new Date(C.getFullYear(),C.getMonth()+1,1),H=new Date(C.getFullYear(),11,31,23,59,59),ne=m.useMemo(()=>{const s=i.filter(c=>c.status==="sent"),t=s.filter(c=>{if(!c.sent_at)return!1;const u=new Date(c.sent_at);return u.getMonth()===C.getMonth()&&u.getFullYear()===_}),d=v.filter(c=>new Date(c.birth_date).getMonth()===P.getMonth()),x=v.filter(c=>{const u=I(c.birth_date);return u&&u<=H});return{total_sent:s.length,sent_this_month:t.length,next_month:d.length,until_end_of_year:x.length,next_month_info:d.length,nextMonthIndex:P.getMonth()}},[i,v,_]),re=m.useMemo(()=>{if(!w)return v.map(t=>V(t)).sort((t,d)=>new Date(t.upcomingBirthday)-new Date(d.upcomingBirthday)).slice(0,30);if(w==="total_sent")return i.filter(t=>t.status==="sent").map(t=>({id:t.id,residentId:t.resident_id,name:t.resident_name,phone:t.phone,birthDate:t.birthday_date,status:t.status,scheduledDate:t.scheduled_send_at,sentAt:t.sent_at}));if(w==="sent_this_month")return i.filter(t=>{if(t.status!=="sent"||!t.sent_at)return!1;const d=new Date(t.sent_at);return d.getMonth()===C.getMonth()&&d.getFullYear()===_}).map(t=>({id:t.id,residentId:t.resident_id,name:t.resident_name,phone:t.phone,birthDate:t.birthday_date,status:t.status,scheduledDate:t.scheduled_send_at,sentAt:t.sent_at}));let s=[];return w==="next_month"||w==="next_month_info"?s=v.filter(t=>new Date(t.birth_date).getMonth()===P.getMonth()):w==="until_end_of_year"&&(s=v.filter(t=>{const d=I(t.birth_date);return d&&d<=H})),s.map(t=>V(t))},[w,v,i,_]);function V(s){const t=i.find(d=>d.resident_id===s.id&&d.year===_);return{residentId:s.id,resident:s,name:s.full_name||`${s.first_name||""} ${s.last_name||""}`.trim(),phone:s.phone||"",birthDate:s.birth_date,upcomingBirthday:I(s.birth_date),age:te(s.birth_date),status:(t==null?void 0:t.status)||(s.phone?"scheduled":"no_phone"),scheduledDate:t==null?void 0:t.scheduled_send_at,sentAt:t==null?void 0:t.sent_at}}function G(s,t){g(d=>({...d,[s]:t}))}async function de(){y(!0);try{const{id:s,created_date:t,updated_date:d,created_by_id:x,...c}=n;let u;l!=null&&l.id?u=await p.entities.BirthdayGreetingSettings.update(l.id,c):u=await p.entities.BirthdayGreetingSettings.create({...c,kibbutz_id:r}),h(u),g({...$,...u}),j.success("××××ר×ת × ×©×ר×")}catch{j.error("ש×××× ×ש××רת ×××ר×ת")}finally{y(!1)}}async function le(s){B(!0);try{const{file_url:t}=await p.integrations.Core.UploadFile({file:s});G("image_url",t),j.success("×ת××× × ×××¢×ת×")}catch{j.error("ש×××× ×××¢××ת ת××× ×")}finally{B(!1)}}function ie(){E(!0),W("")}function oe(){if(!F.trim()){j.error("×ש ××××× ×ספר ××פ××");return}const s={first_name:"×× ×",full_name:"×× × ×××"},t=T(n.message_template,s,f,n.include_resident_name),d=U(F,t);window.open(d,"_blank"),E(!1),j.success("× ×¤×ª× WhatsApp ×¢× ×××עת ×××××§×")}async function ce(s){const t=T(n.message_template,s.resident,f,n.include_resident_name),d=U(s.phone,t);window.open(d,"_blank");try{const x=i.find(u=>u.resident_id===s.residentId&&u.year===_),c={kibbutz_id:r,resident_id:s.residentId,resident_name:s.name,phone:s.phone,birthday_date:s.birthDate,status:"sent",sent_at:new Date().toISOString(),message_text:n.message_template||"",image_url:n.image_url||"",year:_};x!=null&&x.id?await p.entities.BirthdayGreetingLog.update(x.id,c):(c.scheduled_send_at=new Date().toISOString(),await p.entities.BirthdayGreetingLog.create(c)),await z(),j.success("×××××¢× × ×©×××")}catch{j.error("ש×××× ××¢×××× ×¡×××ס ש××××")}}async function me(s){try{const t=i.find(x=>x.resident_id===s.residentId&&x.year===_),d={kibbutz_id:r,resident_id:s.residentId,resident_name:s.name,phone:s.phone,birthday_date:s.birthDate,status:"skipped",message_text:n.message_template||"",image_url:n.image_url||"",year:_,scheduled_send_at:(t==null?void 0:t.scheduled_send_at)||new Date().toISOString()};t!=null&&t.id?await p.entities.BirthdayGreetingLog.update(t.id,d):await p.entities.BirthdayGreetingLog.create(d),await z(),j.success("×ת××©× ×××× ××©× ×")}catch{j.error("ש×××× ××××××")}}if(N)return e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"w-8 h-8 border-4 border-rose-100 border-t-rose-600 rounded-full animate-spin"})});const xe=D?T(n.message_template,D.resident,f,n.include_resident_name):"";return e.jsxs("div",{children:[e.jsx(Ne,{title:"×ר×× ×××××××ת",description:"×××רת ×××עת ××× ××××ת ××ש×ת שת×ש×× ×ת×ש××× ×××× ×××××ת ש×××",action:e.jsx("div",{className:"w-11 h-11 rounded-xl bg-rose-50 flex items-center justify-center",children:e.jsx(L,{className:"w-6 h-6 text-rose-500"})})}),v.length===0&&!N?e.jsx("div",{className:"bg-white rounded-2xl border border-border shadow-sm",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center px-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-rose-50 flex items-center justify-center mb-4",children:e.jsx(L,{className:"w-8 h-8 text-rose-400"})}),e.jsx("h3",{className:"text-base font-semibold text-foreground mb-2",children:"××× ×ª×ש××× ×¢× ×ª×ר×× ×××× ××ער×ת"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:"××× ××פע×× ×ר××ת ××× ××××ת, ×ש ××¢××× ×ª×ר××× ×××× ××ר×××¡× ×ת×ש×××."})]})}):e.jsxs(e.Fragment,{children:[e.jsx(Ee,{stats:ne,selected:w,onSelect:se}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6",children:[e.jsx(Le,{form:n,onChange:G,onSave:de,onTestSend:ie,onImageUpload:le,onRemoveImage:()=>G("image_url",""),saving:b,uploading:R,isExisting:!!(l!=null&&l.id)}),e.jsx(Re,{template:n.message_template,includeName:n.include_resident_name,imageUrl:n.image_url,sendTime:n.send_time,kibbutzName:f})]}),e.jsx(Fe,{rows:re,settings:n,kibbutzName:f,onSendNow:ce,onSkip:me,onViewMessage:A})]}),D&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:()=>A(null),children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl max-w-md w-full overflow-hidden",onClick:s=>s.stopPropagation(),dir:"rtl",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[e.jsxs("h3",{className:"font-bold",children:["תצ××ת ××××¢× - ",D.name]}),e.jsx("button",{onClick:()=>A(null),className:"w-8 h-8 rounded-lg hover:bg-accent flex items-center justify-center",children:e.jsx(K,{className:"w-5 h-5"})})]}),e.jsxs("div",{className:"p-4",children:[n.image_url&&e.jsx("img",{src:n.image_url,alt:"",className:"w-full rounded-lg mb-3 max-h-40 object-cover"}),e.jsx("p",{className:"text-sm whitespace-pre-line leading-relaxed bg-slate-50 rounded-lg p-3",children:xe}),e.jsxs("div",{className:"flex items-center gap-2 mt-3 text-xs text-muted-foreground",children:[e.jsx("span",{children:"××פ××:"}),e.jsx("span",{style:Q,children:D.phone||"×סר"})]})]})]})}),ae&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:()=>E(!1),children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl max-w-sm w-full",onClick:s=>s.stopPropagation(),dir:"rtl",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[e.jsx("h3",{className:"font-bold",children:"ש×××ת ××××§×"}),e.jsx("button",{onClick:()=>E(!1),className:"w-8 h-8 rounded-lg hover:bg-accent flex items-center justify-center",children:e.jsx(K,{className:"w-5 h-5"})})]}),e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"×××× × ×ספר ××פ×× ××§××ת ×××עת ××××§× ×-WhatsApp:"}),e.jsx("input",{type:"tel",value:F,onChange:s=>W(s.target.value),placeholder:"050-1234567",style:Q,className:"w-full h-10 rounded-lg border border-slate-200 px-3 text-sm focus:outline-none focus:ring-2 focus:ring-rose-100",autoFocus:!0}),e.jsxs("button",{onClick:oe,className:"w-full h-10 rounded-xl bg-emerald-600 text-white text-sm font-medium hover:bg-emerald-700 flex items-center justify-center gap-2",children:[e.jsx(Y,{className:"w-4 h-4"})," ש×× ××××§×"]})]})]})})]})}export{Je 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.