PageSourceSearch

https://tsofit.org.il/assets/InfoCenterPage-DaLCFW5w.js

js tsofit.org.il collected 2026-09-25 02:12:44 UTC 8,857 bytes, 1 lines download raw bytes

1import{ae as O,aa as F,r,R,d as k,j as e,b as $,aP as b,F as D,ah as M,L as T,A as z,as as B,X as G,aS as V}from"./index-BuF13C9R.js";import{L as q}from"./LoadError-DDlJU4xi.js";import{P as _}from"./play-BbfkX4y6.js";import"./refresh-cw-DvPS6Mu1.js";function g(s){const a=String(s||"").match(/(?:youtu\.be\/|youtube\.com\/(?:watch\?v=|embed\/|shorts\/|v\/))([\w-]{11})/);return a?a[1]:null}const U=s=>{const a=g(s);return a?`https://img.youtube.com/vi/${a}/hqdefault.jpg`:null};function C(s,a){var u;if(!s)return null;const c=s.module_key?a.find(i=>i.module_key===s.module_key):null;if(c)return c;const n=s.module_key&&((u=V[s.module_key])==null?void 0:u.label)||"";if(!n)return null;const m=i=>String(i||"").replace(/["'׳״]/g,"").trim(),d=m(n);return d&&a.find(i=>!i.module_key&&m(i.title).includes(d))||null}const E=[{key:"residents",label:"תושבים"},{key:"community",label:"קהילה"},{key:"info",label:"מידע"},{key:"office",label:"משרד"},{key:"messages",label:"הודעות"},{key:"emergency",label:"חירום"},{key:"general",label:"כללי"}],S=Object.fromEntries(E.map(s=>[s.key,s.label]));function L(s){if(!s)return"";const a=new Date(s);return Number.isNaN(a.getTime())?"":a.toLocaleDateString("he-IL",{day:"2-digit",month:"2-digit",year:"numeric"})}function Q(){const{t:s}=O(),{id:a}=F(),c=`/kibbutz/${a}`,[n,m]=r.useState([]),[d,u]=r.useState([]),[i,j]=r.useState(!0),[P,y]=r.useState(!1),[x,A]=r.useState("all"),[l,w]=r.useState(null),[I,p]=r.useState(!1),f=R.useCallback(async()=>{j(!0),y(!1);try{const t=await k.entities.AdminPublication.filter({kind:"ticker",is_active:!0},"display_order",200);m((t||[]).filter(h=>h.update_type==="info_center"&&(h.title||"").trim()));const o=await k.entities.AdminPublication.filter({kind:"video",is_active:!0},"display_order",100).catch(()=>[]);u((o||[]).filter(h=>g(h.video_url)))}catch(t){console.error(t),y(!0)}finally{j(!1)}},[]);r.useEffect(()=>{f()},[f]);const N=r.useMemo(()=>{const t=new Set(n.map(o=>o.category||"general"));return E.filter(o=>t.has(o.key))},[n]),v=r.useMemo(()=>x==="all"?n:n.filter(t=>(t.category||"general")===x),[n,x]);return i?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx($,{className:"w-8 h-8 text-primary animate-spin"})}):P?e.jsx("div",{dir:"rtl",children:e.jsx(q,{onRetry:f})}):e.jsxs("div",{dir:"rtl",className:"space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"w-12 h-12 rounded-2xl bg-blue-50 grid place-items-center flex-none",children:e.jsx(b,{className:"w-7 h-7 text-blue-600"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-extrabold text-slate-900",children:"מרכז מידע"}),e.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:"מדריכים, הסברים וכתבות לניהול הקהילה במערכת"})]})]}),l?e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>w(null),className:"inline-flex items-center gap-1.5 text-sm font-bold text-slate-500 hover:text-slate-700 transition-colors mb-3",children:[e.jsx(D,{className:"w-4 h-4"})," חזרה לכתבות"]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 shadow-sm overflow-hidden grid grid-cols-1 lg:grid-cols-2",children:[e.jsx("div",{className:"bg-slate-100 min-h-[240px] lg:min-h-[360px] order-1 lg:order-none",children:l.image_url?e.jsx("img",{src:l.image_url,alt:"",className:"w-full h-full max-h-[520px] object-cover"}):e.jsx("div",{className:"w-full h-full grid place-items-center py-20",children:e.jsx(b,{className:"w-12 h-12 text-slate-300"})})}),e.jsxs("div",{className:"p-6 sm:p-8",children:[l.category&&e.jsx("span",{className:"inline-block mb-2 px-2.5 py-1 rounded-full text-[11px] font-bold bg-blue-50 text-blue-700",children:S[l.category]||"כללי"}),e.jsx("h2",{className:"text-xl sm:text-2xl font-extrabold text-slate-900 mb-1.5",children:l.title}),l.updated_date&&e.jsxs("p",{className:"text-xs text-slate-400 mb-4",children:["עודכן ",L(l.updated_date)]}),l.body&&e.jsx("div",{className:"text-[15px] text-slate-700 leading-relaxed whitespace-pre-wrap",children:l.body}),(()=>{const t=C(l,d);return t?e.jsxs("div",{className:"mt-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 text-slate-700 font-bold text-sm",children:[e.jsx(_,{className:"w-4 h-4"})," סרטון בנושא"]}),e.jsxs("button",{onClick:()=>p(!0),className:"group relative w-full sm:max-w-sm aspect-video rounded-xl overflow-hidden bg-slate-900 shadow ring-1 ring-slate-200",children:[e.jsx("img",{src:U(t.video_url),alt:"",className:"absolute inset-0 w-full h-full object-cover"}),e.jsx("span",{className:"absolute inset-0 grid place-items-center bg-black/10 group-hover:bg-black/20 transition-colors",children:e.jsx("span",{className:"w-14 h-14 roun
1ded-full bg-red-600/95 grid place-items-center shadow-lg group-hover:scale-110 transition-transform",children:e.jsx(_,{className:"w-6 h-6 text-white translate-x-[1px]",fill:"currentColor"})})})]})]}):null})(),(()=>{const t=l.module_key?M(l.module_key,s):null;return t!=null&&t.path?e.jsxs(T,{to:`${c}${t.path}`,className:"mt-5 inline-flex items-center gap-2 h-11 px-5 rounded-full text-white text-sm font-bold shadow-sm hover:brightness-110 transition-all",style:{backgroundImage:"linear-gradient(90deg,#2563eb,#06b6d4)"},children:["מעבר לניהול ",t.label," ",e.jsx(z,{className:"w-4 h-4"})]}):null})()]})]})]}):e.jsxs(e.Fragment,{children:[N.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:[{key:"all",label:"הכל"},...N].map(t=>e.jsx("button",{onClick:()=>A(t.key),className:`h-9 px-4 rounded-full text-sm font-bold border-2 transition-all ${x===t.key?"bg-blue-600 border-blue-600 text-white shadow-sm":"bg-white border-slate-200 text-slate-600 hover:border-blue-300 hover:bg-blue-50"}`,children:t.label},t.key))}),v.length===0?e.jsxs("div",{className:"text-center py-20 bg-white rounded-2xl border border-slate-100 shadow-sm",children:[e.jsx(b,{className:"w-12 h-12 text-slate-300 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-slate-500",children:"אין כתבות במרכז המידע כרגע"})]}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:v.map(t=>e.jsxs("button",{onClick:()=>w(t),className:"group text-right bg-white rounded-2xl border border-slate-100 shadow-sm hover:shadow-md hover:-translate-y-0.5 transition-all overflow-hidden flex flex-col",children:[e.jsx("div",{className:"aspect-[16/9] bg-slate-100 overflow-hidden",children:t.image_url?e.jsx("img",{src:t.image_url,alt:"",className:"w-full h-full object-cover group-hover:scale-[1.03] transition-transform duration-500"}):e.jsx("div",{className:"w-full h-full grid place-items-center",children:e.jsx(b,{className:"w-8 h-8 text-slate-300"})})}),e.jsxs("div",{className:"p-4 flex-1 flex flex-col",children:[t.category&&e.jsx("span",{className:"inline-block self-start mb-1.5 px-2 py-0.5 rounded-full text-[10px] font-bold bg-blue-50 text-blue-700",children:S[t.category]||"כללי"}),e.jsx("h3",{className:"text-sm font-bold text-slate-800 leading-snug line-clamp-2",children:t.title}),t.body&&e.jsx("p",{className:"text-xs text-slate-500 mt-1 line-clamp-2 leading-relaxed",children:t.body}),e.jsxs("div",{className:"mt-auto pt-2.5 flex items-center justify-between",children:[t.updated_date?e.jsxs("span",{className:"text-[11px] text-slate-400",children:["עודכן ",L(t.updated_date)]}):e.jsx("span",{}),e.jsx("span",{className:"text-xs font-bold text-blue-600",children:"קראו עוד ←"})]})]})]},t.id))})]}),I&&l&&(()=>{const t=C(l,d);return t?B.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-3 sm:p-6",dir:"rtl",onClick:()=>p(!1),children:[e.jsx("div",{className:"absolute inset-0 bg-slate-100/80 backdrop-blur-md"}),e.jsxs("div",{className:"relative w-full max-w-[min(94vw,1000px)] bg-white rounded-3xl shadow-2xl ring-1 ring-slate-200 p-3 sm:p-4",onClick:o=>o.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 px-1 pb-2.5",children:[e.jsx("h3",{className:"text-slate-800 text-sm sm:text-base font-bold truncate",children:t.title||"סרטון"}),e.jsx("button",{onClick:()=>p(!1),"aria-label":"סגור",className:"flex-none w-9 h-9 rounded-full bg-slate-100 hover:bg-slate-200 grid place-items-center text-slate-600",children:e.jsx(G,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"relative w-full aspect-video rounded-2xl overflow-hidden bg-black",children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${g(t.video_url)}?rel=0&modestbranding=1&playsinline=1&autoplay=1`,title:t.title||"video",className:"absolute inset-0 w-full h-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})]})]}),document.body):null})()]})}export{Q 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.