PageSourceSearch

https://maitre-d.online/assets/EventMessenger-CmZ7u6Au.js

js maitre-d.online collected 2026-10-04 03:07:07 UTC 25,510 bytes, 26 lines download raw bytes

vendor: 4,428 bytes, lines 1-26
1import{c as V,r as n,a as xe,u as Ge,j as e,R as Ke,b as Qe,d as Ze,e as fe,P as me,f as B,A as ge,g as ve,h as Je,i as Xe,k as Ye,l as et,m as tt,F as st,D as rt,C as at,n as nt,o as ot,T as it,M as ce,S as lt,X as H,p as b,q as N,B as E,s as ct,t as C,v as L,w as de,x as dt,y as ue,z as ut,E as ht,G as he,I as pt,V as xt,H as ft,L as mt,J as gt,K as P,N as vt,O as yt}from"./index-CzgPziot.js";/**
2 * @license lucide-react v0.475.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const jt=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],wt=V("Camera",jt);/**
7 * @license lucide-react v0.475.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const bt=[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]],Nt=V("Mic",bt);/**
12 * @license lucide-react v0.475.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const Ct=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],_t=V("Paperclip",Ct);/**
17 * @license lucide-react v0.475.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const Rt=[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]],pe=V("Reply",Rt);/**
22 * @license lucide-react v0.475.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */const Pt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],kt=V("Smile",Pt);var Q="Popover",[ye]=Qe(Q,[xe]),q=xe(),[St,F]=ye(Q),je=a=>{const{__scopePopover:i,children:h,open:d,defaultOpen:o,onOpenChange:c,modal:x=!1}=a,f=q(i),_=n.useRef(null),[y,k]=n.useState(!1),[S,R]=Ge({prop:d,defaultProp:o??!1,onChange:c,caller:Q});return e.jsx(Ke,{...f,children:e.jsx(St,{scope:i,contentId:Ze(),triggerRef:_,open:S,onOpenChange:R,onOpenToggle:n.useCallback(()=>R(j=>!j),[R]),hasCustomAnchor:y,onCustomAnchorAdd:n.useCallback(()=>k(!0),[]),onCustomAnchorRemove:n.useCallback(()=>k(!1),[]),modal:x,children:h})})};je.displayName=Q;var we="PopoverAnchor",Mt=n.forwardRef((a,i)=>{const{__scopePopover:h,...d}=a,o=F(we,h),c=q(h),{onCustomAnchorAdd:x,onCustomAnchorRemove:f}=o;return n.useEffect(()=>(x(),()=>f()),[x,f]),e.jsx(ge,{...c,...d,ref:i})});Mt.displayName=we;var be="PopoverTrigger",Ne=n.forwardRef((a,i)=>{const{__scopePopover:h,...d}=a,o=F(be,h),c=q(h),x=fe(i,o.triggerRef),f=e.jsx(me.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ke(o.open),...d,ref:x,onClick:B(a.onClick,o.onOpenToggle)});return o.hasCustomAnchor?f:e.jsx(ge,{asChild:!0,...c,children:f})});Ne.displayName=be;var Y="PopoverPortal",[Tt,At]=ye(Y,{forceMount:void 0}),Ce=a=>{const{__scopePopover:i,forceMount:h,children:d,container:o}=a,c=F(Y,i);return e.jsx(Tt,{scope:i,forceMount:h,children:e.jsx(ve,{present:h||c.open,children:e.jsx(Je,{asChild:!0,container:o,children:d})})})};Ce.displayName=Y;var $="PopoverContent",_e=n.forwardRef((a,i)=>{const h=At($,a.__scopePopover),{forceMount:d=h.forceMount,...o}=a,c=F($,a.__scopePopover);return e.jsx(ve,{present:d||c.open,children:c.modal?e.jsx(Et,{...o,ref:i}):e.jsx(Ft,{...o,ref:i})})});_e.displayName=$;var Ot=et("PopoverContent.RemoveScroll"),Et=n.forwardRef((a,i)=>{const h=F($,a.__scopePopover),d=n.useRef(null),o=fe(i,d),c=n.useRef(!1);return n.useEffect(()=>{const x=d.current;if(x)return Xe(x)},[]),e.jsx(Ye,{as:Ot,allowPinchZoom:!0,children:e.jsx(Re,{...a,ref:o,trapFocus:h.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:B(a.onCloseAutoFocus,x=>{var f;x.preventDefault(),c.current||(f=h.triggerRef.current)==null||f.focu
26s()}),onPointerDownOutside:B(a.onPointerDownOutside,x=>{const f=x.detail.originalEvent,_=f.button===0&&f.ctrlKey===!0,y=f.button===2||_;c.current=y},{checkForDefaultPrevented:!1}),onFocusOutside:B(a.onFocusOutside,x=>x.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ft=n.forwardRef((a,i)=>{const h=F($,a.__scopePopover),d=n.useRef(!1),o=n.useRef(!1);return e.jsx(Re,{...a,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{var x,f;(x=a.onCloseAutoFocus)==null||x.call(a,c),c.defaultPrevented||(d.current||(f=h.triggerRef.current)==null||f.focus(),c.preventDefault()),d.current=!1,o.current=!1},onInteractOutside:c=>{var _,y;(_=a.onInteractOutside)==null||_.call(a,c),c.defaultPrevented||(d.current=!0,c.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const x=c.target;((y=h.triggerRef.current)==null?void 0:y.contains(x))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&o.current&&c.preventDefault()}})}),Re=n.forwardRef((a,i)=>{const{__scopePopover:h,trapFocus:d,onOpenAutoFocus:o,onCloseAutoFocus:c,disableOutsidePointerEvents:x,onEscapeKeyDown:f,onPointerDownOutside:_,onFocusOutside:y,onInteractOutside:k,...S}=a,R=F($,h),j=q(h);return tt(),e.jsx(st,{asChild:!0,loop:!0,trapped:d,onMountAutoFocus:o,onUnmountAutoFocus:c,children:e.jsx(rt,{asChild:!0,disableOutsidePointerEvents:x,onInteractOutside:k,onEscapeKeyDown:f,onPointerDownOutside:_,onFocusOutside:y,onDismiss:()=>R.onOpenChange(!1),children:e.jsx(at,{"data-state":ke(R.open),role:"dialog",id:R.contentId,...j,...S,ref:i,style:{...S.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Pe="PopoverClose",Dt=n.forwardRef((a,i)=>{const{__scopePopover:h,...d}=a,o=F(Pe,h);return e.jsx(me.button,{type:"button",...d,ref:i,onClick:B(a.onClick,()=>o.onOpenChange(!1))})});Dt.displayName=Pe;var It="PopoverArrow",Lt=n.forwardRef((a,i)=>{const{__scopePopover:h,...d}=a,o=q(h);return e.jsx(nt,{...o,...d,ref:i})});Lt.displayName=It;function ke(a){return a?"open":"closed"}var $t=je,zt=Ne,Ut=Ce,Se=_e;const Ht=$t,Bt=zt,Me=n.forwardRef(({className:a,align:i="center",sideOffset:h=4,...d},o)=>e.jsx(Ut,{children:e.jsx(Se,{ref:o,align:i,sideOffset:h,className:ot("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...d})}));Me.displayName=Se.displayName;function qt({eventId:a,guestName:i,onClose:h}){const[d,o]=n.useState([]),[c,x]=n.useState(""),[f,_]=n.useState(!1),[y,k]=n.useState(!1),[S,R]=n.useState(null),[j,W]=n.useState(null),M=n.useRef(null),ee=n.useRef(null),[Te,te]=n.useState(!0),[se,Ae]=n.useState(!0),[z,re]=n.useState(""),[I,G]=n.useState(null),[Z,J]=n.useState(!1),[ae,ne]=n.useState(0),D=n.useRef(null),K=n.useRef([]),X=n.useRef(null),oe=n.useRef(null),Oe=["👍","❤️","😂","😮","😢","😡","🎉","🔥"];n.useEffect(()=>{const t=async()=>{try{const r=await P.entities.MessengerMessage.filter({event_id:a},"-created_at",50);o(p=>{const u=new Set(p.map(m=>m.id)),l=r.reverse().filter(m=>!u.has(m.id));return l.length===0?p:[...p,...l].sort((m,g)=>new Date(m.created_at)-new Date(g.created_at))})}catch(r){console.error("Messenger load error",r)}};t();const s=setInterval(()=>{document.hidden||t()},1e3);return()=>clearInterval(s)},[a]);const Ee=async()=>{try{const t=await P.entities.MessengerMessage.filter({event_id:a},"-created_at",50);o(s=>{const r=new Set(s.map(u=>u.id)),p=t.reverse().filter(u=>!r.has(u.id));return p.length===0?s:[...s,...p].sort((u,l)=>new Date(u.created_at)-new Date(l.created_at))})}catch(t){console.error("Manual refresh failed",t)}};n.useEffect(()=>{if(d.length>0&&se){const t=sessionStorage.getItem(`chat_scroll_${a}`);t&&M.current?requestAnimationFrame(()=>{if(M.current){M.current.scrollTop=parseInt(t);const{scrollTop:s,scrollHeight:r,clientHeight:p}=M.current,u=r-s-p<50;te(u)}}):ie(),Ae(!1)}else d.length>0&&Te&&ie()},[d.length,se]);const ie=()=>
26{M.current&&(M.current.scrollTop=M.current.scrollHeight)},Fe=()=>{if(!M.current)return;const{scrollTop:t,scrollHeight:s,clientHeight:r}=M.current,p=s-t-r<50;te(p),sessionStorage.setItem(`chat_scroll_${a}`,t.toString())},De=async t=>{var r;const s=(r=t.target.files)==null?void 0:r[0];if(s){if(s.size>10*1024*1024){alert("הקובץ גדול מדי (מקסימום 10MB)");return}W(s)}},Ie=async t=>{var r;const s=(r=t.target.files)==null?void 0:r[0];if(s){if(s.size>10*1024*1024){alert("הקובץ גדול מדי (מקסימום 10MB)");return}W(s)}},Le=async()=>{try{const t=await navigator.mediaDevices.getUserMedia({audio:!0}),s=new MediaRecorder(t);D.current=s,K.current=[],s.ondataavailable=r=>{r.data.size>0&&K.current.push(r.data)},s.onstop=async()=>{const r=new Blob(K.current,{type:"audio/webm"}),p=new File([r],`audio_${Date.now()}.webm`,{type:"audio/webm"});try{k(!0);const{file_url:u}=await P.integrations.Core.UploadFile({file:p}),l=`temp_${Date.now()}`,m={id:l,event_id:a,sender_name:i,content:"🎤 הודעה קולית",type:"audio",media_url:u,created_at:new Date().toISOString(),isTemp:!0,reactions:{}};o(w=>[...w,m]);const g=await P.functions.invoke("messengerSend",{event_id:a,sender_name:i,content:"🎤 הודעה קולית",type:"audio",media_url:u}),O=g.data||g;o(w=>w.some(v=>v.id===O.id)?w.filter(v=>v.id!==l):w.map(v=>v.id===l?O:v))}catch(u){console.error("Failed to send audio",u),alert("שליחת ההקלטה נכשלה")}finally{k(!1)}t.getTracks().forEach(u=>u.stop())},s.start(),J(!0),ne(0),X.current=setInterval(()=>{ne(r=>r+1)},1e3)}catch(t){console.error("Failed to start recording",t),alert("לא ניתן להקליט. וודא שנתת הרשאות למיקרופון")}},$e=()=>{D.current&&Z&&(D.current.stop(),J(!1),clearInterval(X.current))},ze=()=>{D.current&&Z&&(D.current.stop(),J(!1),clearInterval(X.current),K.current=[],D.current.stream&&D.current.stream.getTracks().forEach(t=>t.stop()))},le=async(t,s)=>{try{o(m=>m.map(g=>{if(g.id===t){const O=g.reactions||{},w=O[s]||[];let v;return w.includes(i)?(v={...O,[s]:w.filter(T=>T!==i)},v[s].length===0&&delete v[s]):v={...O,[s]:[...w,i]},{...g,reactions:v}}return g}));const r=d.find(m=>m.id===t);if(!r)return;const p=r.reactions||{},u=p[s]||[];let l;u.includes(i)?(l={...p,[s]:u.filter(m=>m!==i)},l[s].length===0&&delete l[s]):l={...p,[s]:[...u,i]},await P.entities.MessengerMessage.update(t,{reactions:l})}catch(r){console.error("Reaction failed",r)}},Ue=async t=>{if(window.confirm("למחוק הודעה זו?"))try{await P.entities.MessengerMessage.delete(t),o(s=>s.filter(r=>r.id!==t))}catch(s){console.error("Delete failed",s)}},He=async(t,s)=>{try{await P.entities.MessengerMessage.update(t,{content:s}),o(r=>r.map(p=>p.id===t?{...p,content:s}:p)),G(null)}catch(r){console.error("Edit failed",r)}},Be=async t=>{try{if(navigator.clipboard&&navigator.clipboard.writeText)await navigator.clipboard.writeText(t),alert("הועתק ללוח!");else{const s=document.createElement("textarea");s.value=t,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s),alert("הועתק ללוח!")}}catch(s){console.error("Copy failed:",s),alert("ההעתקה נכשלה")}},Ve=async(t,s="image.jpg")=>{try{const p=await(await fetch(t)).blob(),u=window.URL.createObjectURL(p),l=document.createElement("a");l.href=u,l.download=s,document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(u)}catch(r){console.error("Download failed:",r),alert("ההורדה נכשלה")}},qe=async t=>{if(t.preventDefault(),!c.trim()&&!j||f||y)return;const s=c,r=j,p=S==null?void 0:S.id;x(""),W(null),R(null),_(!0);let u=null,l=null;try{if(r){k(!0);let T=r;if(r.type.startsWith("image/")){try{T=await vt(r,{maxWidth:1280,maxHeight:1280,quality:.8,maxSizeMB:1})}catch(U){console.warn("Image compression failed, uploading original",U)}const{file_url:A}=await P.integrations.Core.UploadFile({file:T});u=A,l="image"}else if(r.type.startsWith("video/")){const{file_url:A}=await P.integrations.Core.UploadFile({file:r});u=A,l="video";try{const U=await yt(r),{file_url:We}=await P.integrations.Core.UploadFile({file:U});var m=We}catch(U){console.warn("Thumbnail generation failed",U)}}k(!1)}const g=`temp_${Date.now()}`,O={id:g,event_id:a,sender_name:i,content:s,type:l||"text",media_url:u,thumbnail_url:m,reply_to_id:p,created_at:new Date().toISOString(),isTemp:!0,reactions:{}};o(T=>[...T,O]);const w=await P.functions.invoke("messengerSend",{event_id:a,sender_name:i,content:s,type:l||"text",media_url:u,thumbnail_url:m,reply_to_id:p}),v=w.data||w;o(T=>T.some(A=>A.id===v.id)?T.filter(A=>A.id!==g):T.map(A=>A.id===g?v:A))}catch(g){console.error("Send failed",g),k(!1),alert("שליחת ההודעה נכשלה. נסה שנית.")}finally{_(!1)}};return e.jsx(it,{children:e.jsxs("div",{className:"flex flex-col h-full bg-white overflow-hidden w-full max-w-full",children:[e.jsxs("div",{className:"bg-gradient-to-r from-indigo-600 to-purple-600 p-4 flex justify-between items-center text-white",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{className:"bg-white/20 p-2 rounded-full",children:e.jsx(ce,{className:"w-5 h-5"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-bold text-lg",children:"Messenger"}),e.jsx("p",{className:"text-xs text-indigo-100",children:"צ'אט אירוע חי"})]}),e.jsxs("div",{className:"flex items-center bg-white/20 rounded-full px-3 py-1 flex-1 max-w-xs",children:[e.jsx(lt,{className:"w-4 h-4 ml-2"}),e.jsx("input",{type:"text",placeholder:"חיפוש...",value:z,onChange:t=>re(t.target.value),className:"bg-transparent border-0 outline-none text-sm text-white placeholder-white/60 w-full"}),z&&e.jsx("button",{onClick:()=>re(""),className:"mr-1",children:e.jsx(H,{className:"w-3 h-3"})})]})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsxs(b,{children:[e.jsx(N,{asChild:!0,children:e.jsx(E,{variant:"ghost",size:"icon",onClick:Ee,className:"text-white hover:bg-white/20 rounded-full",children:e.jsx(ct,{className:"w-4 h-4"})})}),e.jsx(C,{children:e.jsx("p",{children:"רענן הודעות"})})]}),e.jsxs(b,{children:[e.jsx(N,{asChild:!0,children:e.jsx(E,{variant:"ghost",size:"icon",onClick:h,className:"text-white hover:bg-white/20 rounded-full",children:e.jsx(H,{className:"w-5 h-5"})})}),e.jsx(C,{children:e.jsx("p",{children:"סגור צ'אט"})})]})]})]}),e.jsx("div",{ref:M,onScroll:Fe,className:"flex-1 overflow-y-auto p-4 bg-gray-50 space-y-4",children:d.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400 space-y-2",children:[e.jsx(L.div,{initial:{scale:.8,opacity:0}
26,animate:{scale:1,opacity:1},transition:{duration:.5},children:e.jsx(ce,{className:"w-12 h-12 opacity-20"})}),e.jsx(L.p,{initial:{y:10,opacity:0},animate:{y:0,opacity:1},transition:{delay:.2},children:"אין עדיין הודעות..."}),e.jsx(L.p,{initial:{y:10,opacity:0},animate:{y:0,opacity:1},transition:{delay:.3},className:"text-xs",children:"היה הראשון לברך!"})]}):e.jsx(de,{initial:!1,mode:"popLayout",children:d.filter(t=>{var s,r;return!z||((s=t.content)==null?void 0:s.toLowerCase().includes(z.toLowerCase()))||((r=t.sender_name)==null?void 0:r.toLowerCase().includes(z.toLowerCase()))}).map(t=>{const s=t.sender_name===i,r=t.reply_to_id?d.find(l=>l.id===t.reply_to_id):null,p=t.reactions&&Object.keys(t.reactions).length>0,u=s&&Date.now()-new Date(t.created_at).getTime()<300*1e3;return e.jsx(L.div,{layout:!0,initial:{opacity:0,x:s?50:-50,scale:.9},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,scale:.8,transition:{duration:.15}},transition:{type:"spring",stiffness:500,damping:30,layout:{duration:.2}},className:`flex flex-col ${s?"items-end":"items-start"} group`,children:e.jsxs("div",{className:`flex items-end gap-2 max-w-[85%] ${s?"flex-row-reverse":"flex-row"}`,children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold shrink-0 ${s?"bg-indigo-100 text-indigo-600":"bg-purple-100 text-purple-600"}`,children:(t.sender_name||"?").charAt(0)}),e.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[!s&&e.jsx("span",{className:"text-xs text-gray-500 ml-1 block",children:t.sender_name}),e.jsxs("div",{className:`relative px-4 py-2 rounded-2xl shadow-sm break-words text-sm ${s?"bg-indigo-600 text-white rounded-tl-none":"bg-white text-gray-800 rounded-tr-none border border-gray-100"}`,children:[r&&e.jsxs("div",{className:`mb-2 p-2 rounded text-xs border-l-2 ${s?"bg-indigo-500/50 border-white/50":"bg-gray-100 border-indigo-500"}`,children:[e.jsx("span",{className:"font-bold block mb-0.5",children:r.sender_name}),e.jsx("span",{className:"line-clamp-1",children:r.type==="image"?"📷 תמונה":r.type==="video"?"🎥 וידאו":r.content})]}),t.type==="image"&&e.jsxs("div",{className:"mb-2 rounded-lg overflow-hidden relative group/image",children:[e.jsx("img",{src:t.media_url,alt:"sent image",className:"max-w-full h-auto object-cover max-h-60",loading:"lazy"}),e.jsx("button",{onClick:()=>Ve(t.media_url,`image_${t.id}.jpg`),className:"absolute top-2 left-2 bg-black/50 text-white p-2 rounded-full opacity-0 group-hover/image:opacity-100 transition-opacity",children:e.jsx(dt,{className:"w-4 h-4"})})]}),t.type==="video"&&e.jsx("div",{className:"mb-2 rounded-lg overflow-hidden bg-black/10",children:e.jsx("video",{src:t.media_url,poster:t.thumbnail_url,controls:!0,preload:"none",className:"max-w-full h-auto max-h-60"})}),t.type==="audio"&&e.jsx("div",{className:"mb-2",children:e.jsx("audio",{src:t.media_url,controls:!0,className:"w-full max-w-xs"})}),(I==null?void 0:I.id)===t.id?e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:I.content,onChange:l=>G({...I,content:l.target.value}),className:"flex-1 bg-white/20 border-0 rounded px-2 py-1 text-sm",autoFocus:!0}),e.jsx("button",{onClick:()=>He(t.id,I.content),className:"text-green-400",children:e.jsx(ue,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>G(null),className:"text-red-400",children:e.jsx(H,{className:"w-4 h-4"})})]}):t.content&&e.jsx("div",{className:"whitespace-pre-wrap",children:t.content})]}),e.jsxs("div",{className:`flex items-center gap-2 mt-1 ${s?"flex-row-reverse":"flex-row"}`,children:[e.jsx("span",{className:"text-[10px] text-gray-400",children:new Date(t.created_at).toLocaleTimeString("he-IL",{hour:"2-digit",minute:"2-digit"})}),p&&e.jsx(L.div,{layout:!0,className:"flex gap-1 flex-wrap",children:e.jsx(de,{children:Object.entries(t.reactions).map(([l,m])=>e.jsxs(L.button,{initial:{scale:0},animate:{scale:1},exit:{scale:0},onClick:()=>le(t.id,l),className:`text-xs px-1.5 py-0.5 rounded-full border flex items-center gap-1 ${m.includes(i)?"bg-blue-100 border-blue-200":"bg-white border-gray-200"}`,children:[l," ",e.jsx("span",{className:"text-[10px] text-gray-500",children:m.length})]},l))})}),e.jsxs("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-1",children:[e.jsxs(b,{children:[e.jsx(N,{asChild:!0,children:e.jsx("button",{onClick:()=>R(t),className:"p-1 hover:bg-gray-100 rounded-full text-gray-500",children:e.jsx(pe,{className:"w-3 h-3"})})}),e.jsx(C,{children:e.jsx("p",{children:"השב"})})]}),e.jsxs(Ht,{children:[e.jsxs(b,{children:[e.jsx(N,{asChild:!0,children:e.jsx(Bt,{asChild:!0,children:e.jsx("button",{className:"p-1 hover:bg-gray-100 rounded-full text-gray-500",children:e.jsx(kt,{className:"w-3 h-3"})})})}),e.jsx(C,{children:e.jsx("p",{children:"הגב עם אימוג'י"})})]}),e.jsx(Me,{className:"w-auto p-2 flex gap-1 z-[200]",side:"top",children:Oe.map(l=>e.jsx("button",{onClick:()=>le(t.id,l),className:"hover:scale-125 transition-transform text-lg p-1",children:l},l))})]}),t.content&&e.jsxs(b,{children:[e.jsx(N,{asChild:!0,children:e.jsx("button",{onClick:()=>Be(t.content),className:"p-1 hover:bg-gray-100 rounded-full text-gray-500",children:e.jsx(ut,{className:"w-3 h-3"})})}),e.jsx(C,{children:e.jsx("p",{children:"העתק"})})]}),s&&u&&t.type==="text"&&e.jsxs(b,{children:[e.jsx(N,{asChild:!0,children:e.jsx("button",{onClick:()=>G({id:t.id,content:t.content}),className:"p-1 hover:bg-gray-100 rounded-full text-gray-500",children:e.jsx(ht,{className:"w-3 h-3"})})}),e.jsx(C,{children:e.jsx("p",{children:"ערוך"})})]}),s&&e.jsxs(b,{children:[e.jsx(N,{asChild:!0,children:e.jsx("button",{onClick:()=>Ue(t.id),className:"p-1 hover:bg-red-100 rounded-full text-red-500",children:e.jsx(he,{className:"w-3 h-3"})})}),e.jsx(C,{children:e.jsx("p",{children:"מחק"})})]})]})]})]})]})},t.id)})})}),e.jsxs("div",{className:"bg-white border-t border-gray-100 flex flex-col",children:[S&&e.jsxs("div",{className:"flex items-center justify-between bg-gray-50 px-4 py-2 text-xs border-b border-gray-100",children:[e.jsxs("div",{className:"flex items-center gap-2 text-gray-600",children:[e.jsx(pe,{className:"w-3 h-3"}
26),e.jsxs("span",{children:["משיב ל-",e.jsx("b",{children:S.sender_name})]})]}),e.jsx("button",{onClick:()=>R(null),className:"text-gray-400 hover:text-gray-600",children:e.jsx(H,{className:"w-3 h-3"})})]}),j&&e.jsxs("div",{className:"flex items-center justify-between bg-gray-50 px-4 py-2 border-b border-gray-100",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-blue-600",children:[j.type.startsWith("image/")?e.jsx(pt,{className:"w-3 h-3"}):e.jsx(xt,{className:"w-3 h-3"}),e.jsx("span",{className:"truncate max-w-[200px]",children:j.name})]}),e.jsxs(b,{children:[e.jsx(N,{asChild:!0,children:e.jsx("button",{onClick:()=>W(null),className:"text-gray-400 hover:text-red-500",children:e.jsx(he,{className:"w-3 h-3"})})}),e.jsx(C,{children:e.jsx("p",{children:"הסר קובץ"})})]})]}),e.jsxs("div",{className:"p-3 flex items-end gap-2",children:[e.jsx("input",{type:"file",ref:ee,onChange:De,className:"hidden",accept:"image/*,video/*"}),e.jsx("input",{type:"file",ref:oe,onChange:Ie,className:"hidden",accept:"image/*",capture:"environment"}),e.jsxs(b,{children:[e.jsx(N,{asChild:!0,children:e.jsx(E,{variant:"ghost",size:"icon",className:"rounded-full text-gray-400 hover:text-indigo-600 hover:bg-indigo-50",onClick:()=>{var t;return(t=ee.current)==null?void 0:t.click()},children:e.jsx(_t,{className:"w-5 h-5"})})}),e.jsx(C,{children:e.jsx("p",{children:"צרף קובץ"})})]}),e.jsxs(b,{children:[e.jsx(N,{asChild:!0,children:e.jsx(E,{variant:"ghost",size:"icon",className:"rounded-full text-gray-400 hover:text-indigo-600 hover:bg-indigo-50",onClick:()=>{var t;return(t=oe.current)==null?void 0:t.click()},children:e.jsx(wt,{className:"w-5 h-5"})})}),e.jsx(C,{children:e.jsx("p",{children:"צלם תמונה"})})]}),Z?e.jsxs("div",{className:"flex items-center gap-2 bg-red-100 px-3 py-2 rounded-full animate-pulse",children:[e.jsx("div",{className:"w-2 h-2 bg-red-600 rounded-full animate-pulse"}),e.jsxs("span",{className:"text-sm font-medium text-red-600",children:[Math.floor(ae/60),":",(ae%60).toString().padStart(2,"0")]}),e.jsx(E,{variant:"ghost",size:"icon",className:"h-6 w-6 text-red-600 hover:text-red-700",onClick:ze,children:e.jsx(H,{className:"w-4 h-4"})}),e.jsx(E,{variant:"ghost",size:"icon",className:"h-6 w-6 text-red-600 hover:text-red-700",onClick:$e,children:e.jsx(ue,{className:"w-4 h-4"})})]}):e.jsxs(b,{children:[e.jsx(N,{asChild:!0,children:e.jsx(E,{variant:"ghost",size:"icon",className:"rounded-full text-gray-400 hover:text-red-600 hover:bg-red-50",onClick:Le,children:e.jsx(Nt,{className:"w-5 h-5"})})}),e.jsx(C,{children:e.jsx("p",{children:"הקלט הודעה קולית"})})]}),e.jsxs("form",{onSubmit:qe,className:"flex-1 flex items-center gap-2 bg-gray-50 p-1.5 rounded-2xl border border-gray-200 focus-within:border-indigo-300 focus-within:ring-2 focus-within:ring-indigo-100 transition-all",children:[e.jsx(ft,{value:c,onChange:t=>x(t.target.value),placeholder:j?"הוסף כיתוב...":"כתוב הודעה...",className:"flex-1 border-0 bg-transparent focus-visible:ring-0 shadow-none h-auto min-h-[40px] max-h-[100px] py-2 px-3 resize-none"}),e.jsxs(b,{children:[e.jsx(N,{asChild:!0,children:e.jsx(E,{type:"submit",disabled:!c.trim()&&!j||f||y,size:"icon",className:`rounded-full w-10 h-10 shrink-0 transition-all ${c.trim()||j?"bg-indigo-600 hover:bg-indigo-700 text-white shadow-md hover:scale-105":"bg-gray-200 text-gray-400"}`,children:y?e.jsx(mt,{className:"w-4 h-4 animate-spin"}):e.jsx(gt,{className:"w-4 h-4 ml-0.5"})})}),e.jsx(C,{children:e.jsx("p",{children:"שלח הודעה"})})]})]})]})]})]})})}export{qt 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.