PageSourceSearch

https://tsofit.org.il/assets/ResidentsTable-hwNjE91v.js

js tsofit.org.il collected 2026-10-02 14:24:20 UTC 24,888 bytes, 1 lines download raw bytes

1import{r as V,j as e,cz as pe,cm as Se,c8 as P,cy as Ce,t as fe,R as y,cF as ie,cG as le,cI as oe,C as $e,aH as Ke,aM as Me,cB as B,cC as D,cb as Ee,cs as A,a8 as T,aC as Le,aD as Fe,ck as Re,z as Oe}from"./index-BH8Hq4fF.js";import{I as Pe}from"./input-RnZK1Sdh.js";import{S as Be,a as De,b as Ge,c as Ue,d as He}from"./select-D1fi8zWO.js";import{P as ce,E as de}from"./ContactIcons-DsYCwA1M.js";import{B as je}from"./ban-BN2sGUaC.js";import{C as ze}from"./chevrons-up-down-CUcS79e_.js";import{C as Ae}from"./chevron-up-Nk0mcmku.js";import"./index-CikwpBsl.js";import"./popover-B7t_DJYN.js";import"./phone-call-BXoHXz4O.js";function W({value:t,type:a="text",options:r=[],onSave:c,displayValue:l}){const[i,m]=V.useState(!1),[p,b]=V.useState(t||"");V.useEffect(()=>{i&&b(t||"")},[i,t]);const j=d=>{const u=d!==void 0?d:p;m(!1),u!==(t||"")&&c(u)};return i?a==="select"?e.jsx("div",{onClick:d=>d.stopPropagation(),className:"min-w-[130px]",children:e.jsxs(Be,{dir:"rtl",value:p,onValueChange:d=>j(d),open:i,onOpenChange:d=>{d||m(!1)},children:[e.jsx(De,{className:"h-7 text-xs",children:e.jsx(Ge,{})}),e.jsx(Ue,{children:r.map(d=>{const u=d.icon;return e.jsx(He,{value:d.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[u&&e.jsx(u,{className:`w-3.5 h-3.5 flex-shrink-0 ${d.iconClass||""}`}),e.jsx("span",{children:d.label})]})},d.value)})})]})}):e.jsx(Pe,{autoFocus:!0,value:p,onChange:d=>b(d.target.value),onBlur:()=>j(),onKeyDown:d=>{d.key==="Enter"&&j(),d.key==="Escape"&&m(!1)},className:"h-7 text-xs",onClick:d=>d.stopPropagation()}):e.jsx("span",{onClick:d=>{d.stopPropagation(),m(!0)},className:"cursor-pointer hover:bg-accent px-1.5 py-0.5 rounded transition-colors inline-block min-w-[30px]",children:l||t||"-"})}const ee=new Intl.Collator("he",{sensitivity:"base",numeric:!0}),q=(t,a)=>{const r=Object.keys(t),c=r.indexOf(String(a||""));return c===-1?r.length:c};function ue(t){const a=String(t??"").trim();return a?(a.match(/\d+|[^\d\s/,-]+/g)||[]).map(r=>/^\d+$/.test(r)?Number(r):r):[]}function ge(t,a){const r=ue(t),c=ue(a);for(let l=0;l<Math.max(r.length,c.length);l+=1){const i=r[l],m=c[l];if(i===void 0)return-1;if(m===void 0)return 1;if(typeof i=="number"&&typeof m=="number"){if(i!==m)return i-m}else{const p=ee.compare(String(i),String(m));if(p!==0)return p}}return 0}const ye={first_name:{get:t=>t.first_name||"",kind:"text"},last_name:{get:t=>t.last_name||t.family_name||"",kind:"text"},family_name:{get:t=>t.family_name||t.last_name||"",kind:"text"},family_role:{get:t=>q(Ce,t.family_role),kind:"number",empty:t=>!t.family_role},age:{get:t=>P(t.birth_date),kind:"number"},birth_date:{get:t=>P(t.birth_date),kind:"number"},gender:{get:t=>q(Se,t.gender),kind:"number",empty:t=>!t.gender},street:{get:t=>t.street||"",kind:"text"},house_number:{get:t=>t.house_number||"",kind:"house"},neighborhood:{get:t=>t.neighborhood||"",kind:"text"},national_id:{get:t=>t.national_id||"",kind:"text"},budget:{get:t=>t.budget===""||t.budget==null?null:Number(t.budget),kind:"number"},status:{get:t=>q(pe,t.registration_status),kind:"number",empty:t=>!t.registration_status},parents:{kind:"text"}},Y=t=>t==null||t===""||typeof t=="number"&&Number.isNaN(t);function We(t,a,r,c="asc",l={}){const i=ye[r],m=g=>i!=null&&i.get?i.get(g):l.value?l.value(r,g):"",p=m(t),b=m(a),j=i!=null&&i.empty?i.empty(t):Y(p),d=i!=null&&i.empty?i.empty(a):Y(b);if(j&&d)return 0;if(j)return 1;if(d)return-1;let u;return(i==null?void 0:i.kind)==="house"?u=ge(p,b):(i==null?void 0:i.kind)==="number"?u=Number(p)-Number(b):u=ee.compare(String(p),String(b)),c==="desc"?-u:u}function qe(t=[],a,r="asc",c={}){const l=[...t||[]];return l.sort((i,m)=>We(i,m,a,r,c)),l}function Ye(t,a){var c,l;const r=((c=ye[t])==null?void 0:c.kind)||((l=te[t])==null?void 0:l.kind)||"text";return r==="number"||r==="house"?a==="asc"?"מהקטן לגדול":"מהגדול לקטן":a==="asc"?"א׳–ת׳":"ת׳–א׳"}const Ze=t=>String(t||"").replace(/^\s*משפחת\s+/,"").trim(),te={name:{get:t=>Ze(t.name),kind:"text"},head_first_name:{get:t=>t.head_first_name||"",kind:"text"},member_count:{get:t=>t.member_count==null?null:Number(t.member_count),kind:"number"},street:{get:t=>t.street||"",kind:"text"},house_number:{get:t=>t.house_number||"",kind:"house"},neighborhood:{get:t=>t.neighborhood||"",kind:"text"},location:{get:t=>t.latitude&&t.longitude?0:1,kind:"number"},status:{get:t=>q(pe,t.status),kind:"number",empty:t=>!t.status}};function Ie(t,a,r,c="asc"){const l=te[r];if(!l)return 0;const i=l.get(t),m=l.get(a),p=l.empty?l.empty(t):Y(i),b=l.empty?l.empty(a):Y(m);
1if(p&&b)return 0;if(p)return 1;if(b)return-1;let j;return l.kind==="house"?j=ge(i,m):l.kind==="number"?j=Number(i)-Number(m):j=ee.compare(String(i),String(m)),c==="desc"?-j:j}function Xe(t=[],a,r="asc"){const c=[...t||[]];return te[a]&&c.sort((l,i)=>Ie(l,i,a,r)),c}const Je=[{value:"approved",label:"מאושר",icon:$e,iconClass:"text-emerald-600"},{value:"pending_approval",label:"ממתין לאישור",icon:Ke,iconClass:"text-amber-500"},{value:"rejected",label:"נדחה",icon:Me,iconClass:"text-red-500"},{value:"inactive",label:"לא פעיל",icon:je,iconClass:"text-slate-400"}],Qe=[50,100,200],se=50;function me({resident:t,onReactivate:a}){const r=Re(t);return r?e.jsxs("span",{className:"flex items-center gap-1.5 mt-1",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[0.625rem] font-bold bg-amber-50 text-amber-700",title:"לכן התושב אינו מופיע בתצוגת פעילים",children:[e.jsx(je,{className:"w-3 h-3"})," ",r.label]}),r.fixable&&a&&e.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),a(t)},className:"text-[0.625rem] font-bold text-blue-600 hover:text-blue-700 underline underline-offset-2",children:"החזרה לפעילים"})]}):null}function O({checked:t,onClick:a}){return e.jsx("div",{onClick:r=>{r.stopPropagation(),a()},className:`w-5 h-5 rounded-md border-2 flex items-center justify-center transition-all cursor-pointer flex-shrink-0 ${t?"bg-blue-600 border-blue-600":"border-slate-300 bg-white hover:border-blue-400"}`,children:t&&e.jsx(Le,{className:"w-3.5 h-3.5 text-white",strokeWidth:3})})}function xe(t,a){const r=a==null?void 0:a[t.field_key];if(r==null||r==="")return"-";if(t.field_type==="file"&&typeof r=="object"){const c=Object.values(r).filter(Boolean).length;return c?`${c} קבצים`:"-"}return Array.isArray(r)?r.join(", ")||"-":typeof r=="object"?Object.values(r).filter(Boolean).join(", ")||"-":r===!0||r==="true"?"כן":r===!1||r==="false"?"לא":String(r)}function dt({mode:t="residents",residents:a,families:r,kibbutzId:c,onQuickEdit:l,onReactivate:i,onFamilyDelete:m,onOpenFamily:p,getParentNames:b,visibleColumns:j,customColumns:d=[],selectedIds:u=[],onToggleId:g,onToggleAllVisible:C,highlightId:$,loading:M=!1,paginationKey:G=""}){const N=fe(),[U,K]=y.useState(null),E=y.useRef(null),[L,F]=y.useState(1),[k,H]=y.useState(se),[x,Z]=y.useState({key:"last_name",dir:"asc"}),n=s=>Z(S=>S.key===s?{key:s,dir:S.dir==="asc"?"desc":"asc"}:{key:s,dir:"asc"}),w=y.useMemo(()=>({value:(s,S)=>{if(s==="parents")return b?b(S):"";if(String(s).startsWith("custom:")){const R=d.find(_=>`custom:${_.field_key}`===s);return R?xe(R,S.custom_fields):""}return""}}),[b,d]),v=y.useMemo(()=>qe(a,x.key,x.dir,w),[a,x.key,x.dir,w]),I=Math.max(1,Math.ceil(v.length/k)),X=y.useMemo(()=>v.slice((L-1)*k,L*k),[v,L,k]);y.useEffect(()=>{F(1)},[t,k,G,x.key,x.dir]),y.useEffect(()=>{F(s=>Math.min(Math.max(1,s),I))},[I]),y.useEffect(()=>{if(!$||t==="families"||E.current===$)return;const s=v.findIndex(_=>_.id===$);if(s<0)return;E.current=$,F(Math.floor(s/k)+1),K($);const S=requestAnimationFrame(()=>{const _=Array.from(document.querySelectorAll(`[data-resident-row="${$}"]`)).find(ae=>ae instanceof HTMLElement&&ae.offsetParent!==null);_==null||_.scrollIntoView({block:"center",behavior:"smooth"})}),R=setTimeout(()=>K(null),2200);return()=>{cancelAnimationFrame(S),clearTimeout(R)}},[$,v,t,k]);const J=y.useMemo(()=>new Set(u),[u]),Ne=t==="families"?(r||[]).length:(a||[]).length;if(M&&Ne===0)return e.jsx(Te,{mode:t});if(t==="families")return!r||r.length===0?e.jsx(be,{message:"אין משפחות להצגה"}):e.jsx(Ve,{families:r,kibbutzId:c,onOpenFamily:p,visibleColumns:j,selectedIds:u,onToggleId:g,onToggleAllVisible:C,paginationKey:G});if(!a||a.length===0)return e.jsx(be,{message:t==="children"?"אין ילדים להצגה":"אין תושבים להצגה"});const Q=t!=="children",ne=s=>{try{sessionStorage.setItem(`resident-return:${c}`,s.id)}catch{}N(`/kibbutz/${c}/residents/${s.id}`)},we=j||[],o=s=>we.includes(s),z=X.map(s=>s.id),re=v.map(s=>s.id),ke=z.length>0&&z.every(s=>J.has(s)),ve=()=>C==null?void 0:C(z);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block 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",{className:"border-b border-border",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 bg-slate-50 w-10",children:e.jsx(O,{checked:ke,onClick:ve})}
1),Q?e.jsxs(e.Fragment,{children:[o("first_name")&&e.jsx(h,{label:"שם פרטי",sortKey:"first_name",sort:x,onSort:n}),o("last_name")&&e.jsx(h,{label:"שם משפחה",sortKey:"last_name",sort:x,onSort:n}),o("family_role")&&e.jsx(h,{label:"תפקיד במשפחה",sortKey:"family_role",sort:x,onSort:n}),o("phone")&&e.jsx(he,{children:"טלפון"}),o("email")&&e.jsx(he,{children:"אימייל"}),o("age")&&e.jsx(h,{label:"גיל",sortKey:"age",sort:x,onSort:n}),o("gender")&&e.jsx(h,{label:"מגדר",sortKey:"gender",sort:x,onSort:n}),o("street")&&e.jsx(h,{label:"רחוב",sortKey:"street",sort:x,onSort:n}),o("house_number")&&e.jsx(h,{label:"מספר בית",sortKey:"house_number",sort:x,onSort:n}),o("neighborhood")&&e.jsx(h,{label:"שכונה",sortKey:"neighborhood",sort:x,onSort:n}),o("national_id")&&e.jsx(h,{label:"תעודת זהות",sortKey:"national_id",sort:x,onSort:n}),o("budget")&&e.jsx(h,{label:"תקציב",sortKey:"budget",sort:x,onSort:n}),o("status")&&e.jsx(h,{label:"סטטוס",sortKey:"status",sort:x,onSort:n})]}):e.jsxs(e.Fragment,{children:[o("last_name")&&e.jsx(h,{label:"שם משפחה",sortKey:"last_name",sort:x,onSort:n}),o("first_name")&&e.jsx(h,{label:"שם פרטי",sortKey:"first_name",sort:x,onSort:n}),o("age")&&e.jsx(h,{label:"גיל",sortKey:"age",sort:x,onSort:n}),o("gender")&&e.jsx(h,{label:"מגדר",sortKey:"gender",sort:x,onSort:n}),o("street")&&e.jsx(h,{label:"רחוב",sortKey:"street",sort:x,onSort:n}),o("house_number")&&e.jsx(h,{label:"מספר בית",sortKey:"house_number",sort:x,onSort:n}),o("neighborhood")&&e.jsx(h,{label:"שכונה",sortKey:"neighborhood",sort:x,onSort:n}),o("parents")&&e.jsx(h,{label:"הורי הילד",sortKey:"parents",sort:x,onSort:n}),o("status")&&e.jsx(h,{label:"סטטוס",sortKey:"status",sort:x,onSort:n})]}),d.map(s=>e.jsx(h,{label:s.display_name,sortKey:`custom:${s.field_key}`,sort:x,onSort:n},s.field_key))]})}),e.jsx("tbody",{children:X.map(s=>{const S=J.has(s.id),R=U===s.id;return e.jsxs("tr",{"data-resident-row":s.id,onClick:()=>ne(s),className:`border-b border-border last:border-0 cursor-pointer transition-colors duration-1000 ${R?"bg-emerald-100":S?"bg-blue-50/50":"hover:bg-muted/30"}`,children:[e.jsx("td",{className:"px-4 py-3 w-10",children:e.jsx(O,{checked:S,onClick:()=>g==null?void 0:g(s.id)})}),Q?e.jsxs(e.Fragment,{children:[o("first_name")&&e.jsx(f,{children:s.first_name||"-"}),o("last_name")&&e.jsx(f,{children:s.last_name||"-"}),o("family_role")&&e.jsx("td",{className:"px-3 py-2.5 whitespace-nowrap",children:e.jsx("span",{className:`inline-block px-2 py-0.5 rounded-full text-xs ${le(s.family_role)}`,children:ie(s.family_role)})}),o("phone")&&e.jsx("td",{className:"px-3 py-2.5 whitespace-nowrap",children:e.jsx(ce,{phone:s.phone})}),o("email")&&e.jsx("td",{className:"px-3 py-2.5 whitespace-nowrap",children:e.jsx(de,{email:s.email})}),o("age")&&e.jsx(f,{muted:!0,children:P(s.birth_date)??"-"}),o("gender")&&e.jsx(f,{muted:!0,children:oe(s.gender)}),o("street")&&e.jsx("td",{className:"px-3 py-2.5 whitespace-nowrap",children:e.jsx(W,{value:s.street,type:"text",onSave:_=>l(s,"street",_)})}),o("house_number")&&e.jsx("td",{className:"px-3 py-2.5 whitespace-nowrap",children:e.jsx(W,{value:s.house_number,type:"text",onSave:_=>l(s,"house_number",_)})}),o("neighborhood")&&e.jsx("td",{className:"px-3 py-2.5 whitespace-nowrap",children:e.jsx(W,{value:s.neighborhood,type:"text",onSave:_=>l(s,"neighborhood",_)})}),o("national_id")&&e.jsx(f,{muted:!0,children:s.national_id||"-"}),o("budget")&&e.jsx(f,{muted:!0,children:(s.budget??"")===""?"-":s.budget}),o("status")&&e.jsxs("td",{className:"px-3 py-2.5 whitespace-nowrap",children:[e.jsx(W,{value:s.registration_status,type:"select",options:Je,onSave:_=>l(s,"registration_status",_),displayValue:e.jsx("span",{className:`inline-block px-2 py-0.5 rounded-full text-xs ${D(s.registration_status)}`,children:B(s.registration_status)})}),e.jsx(me,{resident:s,onReactivate:i})]})]}):e.jsxs(e.Fragment,{children:[o("last_name")&&e.jsx(f,{children:s.last_name||s.family_name||"-"}),o("first_name")&&e.jsx(f,{children:s.first_name||"-"}),o("age")&&e.jsx(f,{muted:!0,children:P(s.birth_date)??"-"}),o("gender")&&e.jsx(f,{muted:!0,children:oe(s.gender)}),o("street")&&e.jsx(f,{children:s.street||"-"}),o("house_number")&&e.jsx(f,{children:s.house_number||"-"}),o("neighborhood")&&e.jsx(f,{children:s.neighborhood||"-"}),o("parents")&&e.jsx(f,{muted:!0,children:b?b(s):"-"}),o("status")&&e.jsxs("td",{className:"px-3 py-2.5 whitespace-nowrap",children:[e.jsx("span",{className:`inline-block px-2 py-0.5 rounded-full text-xs ${D(s.registration_status)}`,children:B(s.registration_status)}),e.jsx(me,{resident:s,onReactivate:i})]})]}),d.map(_=>e.jsx(f,{muted:!0,children:xe(_,s.custom_fields)},_.field_key))]},s.id)})})]})})}),e.jsx("div",{className:"md:hidden space-y-3",children:X.map(s=>{const S=J.has(s.id),R=U===s.id;return e.jsxs("div",{"data-resident-row":s.id,onClick:()=>ne(s),className:`rounded-xl border shadow-sm p-4 cursor-pointer transition-colors duration-1000 ${R?"border-emerald-300 bg-emerald-100":S?"border-blue-300 bg-blue-50/30":"border-border bg-white active:bg-accent/50"}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{checked:S,onClick:()=>g==null?void 0:g(s.id)}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:Ee(s)}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-1 flex-wrap",children:[Q&&e.jsx("span",{className:`inline-block px-2 py-0.5 rounded-full text-xs ${le(s.family_role)}`,children:ie(s.family_role)}),e.jsx("span",{className:`inline-block px-2 py-0.5 rounded-full text-xs ${D(s.registration_status)}`,children:B(s.registration_status)}),t==="children"&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["גיל: ",P(s.birth_date)??"-"]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ce,{phone:s.phone}),e.jsx(de,{email:s.email})]})]}),t==="children"&&b&&e.jsxs("p",{className:"text-xs text-muted-foreground mb-1",children:["הורים: ",b(s)]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[[s.street,s.house_number].filter(
1Boolean).join(" ")||"-",s.neighborhood?`, ${s.neighborhood}`:""]})]},s.id)})}),e.jsx(_e,{label:"תושבים",total:v.length,page:L,totalPages:I,pageSize:k,onPage:F,onPageSize:H,onSelectAll:re.length>z.length?()=>C==null?void 0:C(re):null})]})}function Ve({families:t,kibbutzId:a,onOpenFamily:r,visibleColumns:c,selectedIds:l=[],onToggleId:i,onToggleAllVisible:m,paginationKey:p=""}){const b=fe(),j=n=>{if(r){r(n);return}const w=n.head_id||n.first_member_id;w?b(`/kibbutz/${a}/residents/${w}`):Oe("למשפחה זו אין בני משפחה משויכים",{icon:"ℹ️"})},d=c||[],u=n=>d.includes(n),g=y.useMemo(()=>new Set(l),[l]),[C,$]=y.useState(1),[M,G]=y.useState(se),[N,U]=y.useState({key:"name",dir:"asc"}),K=n=>U(w=>w.key===n?{key:n,dir:w.dir==="asc"?"desc":"asc"}:{key:n,dir:"asc"}),E=y.useMemo(()=>Xe(t,N.key,N.dir),[t,N.key,N.dir]),L=Math.max(1,Math.ceil(E.length/M)),F=y.useMemo(()=>E.slice((C-1)*M,C*M),[E,C,M]);y.useEffect(()=>{$(1)},[p,M,N.key,N.dir]),y.useEffect(()=>{$(n=>Math.min(Math.max(1,n),L))},[L]);const k=F.map(n=>n.id),H=E.map(n=>n.id),x=k.length>0&&k.every(n=>g.has(n)),Z=()=>m==null?void 0:m(k);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block 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",{className:"border-b border-border",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 bg-slate-50 w-10",children:e.jsx(O,{checked:x,onClick:Z})}),u("name")&&e.jsx(h,{label:"שם המשפחה",sortKey:"name",sort:N,onSort:K}),u("head_first_name")&&e.jsx(h,{label:"ראש המשפחה",sortKey:"head_first_name",sort:N,onSort:K}),u("member_count")&&e.jsx(h,{label:"מספר נפשות",sortKey:"member_count",sort:N,onSort:K}),u("street")&&e.jsx(h,{label:"רחוב",sortKey:"street",sort:N,onSort:K}),u("house_number")&&e.jsx(h,{label:"מספר בית",sortKey:"house_number",sort:N,onSort:K}),u("neighborhood")&&e.jsx(h,{label:"שכונה",sortKey:"neighborhood",sort:N,onSort:K}),e.jsx(h,{label:"מיקום",sortKey:"location",sort:N,onSort:K}),u("status")&&e.jsx(h,{label:"סטטוס",sortKey:"status",sort:N,onSort:K})]})}),e.jsx("tbody",{children:F.map(n=>{var v;const w=g.has(n.id);return e.jsxs("tr",{onClick:()=>j(n),className:`border-b border-border last:border-0 hover:bg-muted/30 cursor-pointer transition-colors ${w?"bg-blue-50/50":""}`,children:[e.jsx("td",{className:"px-4 py-3 w-10",children:e.jsx(O,{checked:w,onClick:()=>i==null?void 0:i(n.id)})}),u("name")&&e.jsx(f,{children:n.name||"-"}),u("head_first_name")&&e.jsx(f,{children:n.head_first_name||"-"}),u("member_count")&&e.jsx(f,{children:n.member_count}),u("street")&&e.jsx(f,{children:n.street||"-"}),u("house_number")&&e.jsx(f,{children:n.house_number||"-"}),u("neighborhood")&&e.jsx(f,{children:n.neighborhood||"-"}),e.jsx("td",{className:"px-3 py-2.5 whitespace-nowrap",children:n.latitude&&n.longitude?e.jsx("span",{className:`inline-flex items-center justify-center w-6 h-6 rounded-full ${((v=A[n.location_status])==null?void 0:v.badge)||A.confirmed.badge}`,title:n.location_status||"confirmed",children:e.jsx(T,{className:"w-3.5 h-3.5"})}):e.jsx("span",{className:"inline-flex items-center justify-center w-6 h-6 rounded-full bg-slate-50 text-slate-300",title:"ללא מיקום",children:e.jsx(T,{className:"w-3.5 h-3.5"})})}),u("status")&&e.jsx("td",{className:"px-3 py-2.5 whitespace-nowrap",children:e.jsx("span",{className:`inline-block px-2 py-0.5 rounded-full text-xs ${D(n.status)}`,children:B(n.status)})})]},n.id)})})]})})}),e.jsx("div",{className:"md:hidden space-y-3",children:F.map(n=>{var v;const w=g.has(n.id);return e.jsxs("div",{onClick:()=>j(n),className:`bg-white rounded-xl border shadow-sm p-4 cursor-pointer active:bg-accent/50 transition-colors ${w?"border-blue-300 bg-blue-50/30":"border-border"}`,children:[e.jsx("div",{className:"flex items-start justify-between mb-2",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{checked:w,onClick:()=>i==null?void 0:i(n.id)}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:n.name||"-"}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-1 flex-wrap",children:[e.jsx("span",{className:`inline-block px-2 py-0.5 rounded-full text-xs ${D(n.status)}`,children:B(n.status)}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[n.member_count," נפשות"]}),n.latitude&&n.longitude&&e.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-xs ${((v=A[n.location_status])==null?void 0:v.badge)||A.confirmed.badge}`,children:[e.jsx(T,{className:"w-3 h-3"})," מיקום"]})]})]})]})}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[[n.street,n.house_number].filter(
1Boolean).join(" ")||"-",n.neighborhood?`, ${n.neighborhood}`:""]}),n.head_first_name&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["ראש המשפחה: ",n.head_first_name]})]},n.id)})}),e.jsx(_e,{label:"משפחות",total:E.length,page:C,totalPages:L,pageSize:M,onPage:$,onPageSize:G,onSelectAll:H.length>k.length?()=>m==null?void 0:m(H):null})]})}function _e({label:t,total:a,page:r,totalPages:c,pageSize:l,onPage:i,onPageSize:m,onSelectAll:p}){if(a<=l&&a<=se)return null;const b=a===0?0:(r-1)*l+1,j=Math.min(a,r*l),d=r>1,u=r<c;return e.jsxs("div",{className:"mt-3 flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-xl border border-border bg-white px-4 py-3 text-sm",dir:"rtl",children:[e.jsxs("div",{className:"font-medium text-slate-700",children:["מציגים ",b.toLocaleString("he-IL"),"–",j.toLocaleString("he-IL")," מתוך ",a.toLocaleString("he-IL")," ",t]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[p&&e.jsxs("button",{type:"button",onClick:p,className:"h-9 px-3 rounded-full border border-blue-200 bg-blue-50 text-blue-700 font-medium hover:bg-blue-100",children:["בחר את כל ",a.toLocaleString("he-IL")," התוצאות"]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-slate-500",children:[e.jsx("span",{children:"שורות"}),e.jsx("select",{value:l,onChange:g=>m(Number(g.target.value)),className:"h-9 rounded-full border border-slate-200 bg-white px-3 text-slate-700 focus:outline-none focus:ring-2 focus:ring-blue-100",children:Qe.map(g=>e.jsx("option",{value:g,children:g},g))})]}),e.jsx("button",{type:"button",disabled:!d,onClick:()=>i(Math.max(1,r-1)),className:"h-9 px-3 rounded-full border border-slate-200 disabled:opacity-40 disabled:cursor-not-allowed hover:bg-slate-50",children:"הקודם"}),e.jsxs("span",{className:"text-slate-500",children:["עמוד ",r.toLocaleString("he-IL")," / ",c.toLocaleString("he-IL")]}),e.jsx("button",{type:"button",disabled:!u,onClick:()=>i(Math.min(c,r+1)),className:"h-9 px-3 rounded-full border border-slate-200 disabled:opacity-40 disabled:cursor-not-allowed hover:bg-slate-50",children:"הבא"})]})]})}function he({children:t}){return e.jsx("th",{className:"px-4 py-3 text-right text-xs font-semibold text-slate-600 uppercase tracking-wide whitespace-nowrap bg-slate-50",children:t})}function h({label:t,sortKey:a,sort:r,onSort:c}){const l=r.key===a,i=l?r.dir==="asc"?Ae:Fe:ze;return e.jsx("th",{className:"px-4 py-3 text-right text-xs font-semibold text-slate-600 uppercase tracking-wide whitespace-nowrap bg-slate-50",children:e.jsxs("button",{type:"button",onClick:()=>c(a),title:`מיון ${Ye(a,l&&r.dir==="asc"?"desc":"asc")}`,className:"inline-flex items-center gap-1 hover:text-slate-900 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 rounded",children:[t,e.jsx(i,{className:`w-3.5 h-3.5 ${l?"text-blue-600":"text-slate-300"}`,"aria-hidden":"true"})]})})}function f({children:t,muted:a}){return e.jsx("td",{className:`px-4 py-3 whitespace-nowrap ${a?"text-muted-foreground":"font-medium"}`,children:t})}function Te({mode:t}){const a=t==="families"?"טוען משפחות…":t==="children"?"טוען ילדים…":"טוען תושבים…";return e.jsxs("div",{className:"bg-white rounded-2xl border border-border shadow-sm overflow-hidden",role:"status","aria-live":"polite","aria-busy":"true",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border bg-slate-50",children:[e.jsx("span",{className:"w-4 h-4 border-2 border-slate-200 border-t-slate-500 rounded-full animate-spin","aria-hidden":"true"}),e.jsx("span",{className:"text-xs font-semibold text-slate-600",children:a})]}),e.jsx("div",{className:"divide-y divide-border",children:Array.from({length:8}).map((r,c)=>e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3.5",children:[e.jsx("span",{className:"w-5 h-5 rounded-md bg-slate-100 animate-pulse flex-shrink-0"}),e.jsx("span",{className:"h-3.5 rounded bg-slate-100 animate-pulse flex-1 max-w-[10rem]"}),e.jsx("span",{className:"h-3.5 rounded bg-slate-100 animate-pulse flex-1 max-w-[8rem] hidden sm:block"}),e.jsx("span",{className:"h-3.5 rounded bg-slate-100 animate-pulse flex-1 max-w-[7rem] hidden md:block"}),e.jsx("span",{className:"h-3.5 rounded bg-slate-100 animate-pulse flex-1 max-w-[6rem] hidden lg:block"})]},c))})]})}function be({message:t}){return e.jsx("div",{className:"bg-white rounded-2xl border border-border shadow-sm",children:e.jsx("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:t})})})}export{dt 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.