1import{r as a,R as C,au as I,eA as p,j as s,a8 as S}from"./index-BH8Hq4fF.js";function R(r,e){const n=a.useRef(e);a.useEffect(function(){e!==n.current&&r.attributionControl!=null&&(n.current!=null&&r.attributionControl.removeAttribution(n.current),e!=null&&r.attributionControl.addAttribution(e)),n.current=e},[r,e])}function _(r,e,n){e.center!==n.center&&r.setLatLng(e.center),e.radius!=null&&e.radius!==n.radius&&r.setRadius(e.radius)}const k=1;function z(r){return Object.freeze({__version:k,map:r})}function A(r,e){return Object.freeze({...r,...e})}const g=a.createContext(null),N=g.Provider;function b(){const r=a.useContext(g);if(r==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return r}function D(r){function e(n,t){const{instance:o,context:u}=r(n).current;return a.useImperativeHandle(t,()=>o),n.children==null?null:C.createElement(N,{value:u},n.children)}return a.forwardRef(e)}function U(r){function e(n,t){const[o,u]=a.useState(!1),{instance:c}=r(n,u).current;a.useImperativeHandle(t,()=>c),a.useEffect(function(){o&&c.update()},[c,o,n.children]);const i=c._contentNode;return i?I.createPortal(n.children,i):null}return a.forwardRef(e)}function V(r){function e(n,t){const{instance:o}=r(n).current;return a.useImperativeHandle(t,()=>o),null}return a.forwardRef(e)}function x(r,e){const n=a.useRef();a.useEffect(function(){return e!=null&&r.instance.on(e),n.current=e,function(){n.current!=null&&r.instance.off(n.current),n.current=null}},[r,e])}function v(r,e){const n=r.pane??e.pane;return n?{...r,pane:n}:r}function Z(r,e){return function(t,o){const u=b(),c=r(v(t,u),u);return R(u.map,t.attribution),x(c.current,t.eventHandlers),e(c.current,u,t,o),c}}function L(r,e,n){return Object.freeze({instance:r,context:e,container:n})}function E(r,e){return e==null?function(t,o){const u=a.useRef();return u.current||(u.current=r(t,o)),u}:function(t,o){const u=a.useRef();u.current||(u.current=r(t,o));const c=a.useRef(t),{instance:i}=u.current;return a.useEffect(function(){c.current!==t&&(e(i,t,c.current),c.current=t)},[i,t,o]),u}}function w(r,e){a.useEffect(function(){return(e.layerContainer??e.map).addLayer(r.instance),function(){var u;(u=e.layerContainer)==null||u.removeLayer(r.instance),e.map.removeLayer(r.instance)}},[e,r])}function B(r){return function(n){const t=b(),o=r(v(n,t),t);return R(t.map,n.attribution),x(o.current,n.eventHandlers),w(o.current,t),o}}function G(r,e){const n=a.useRef();a.useEffect(function(){if(e.pathOptions!==n.current){const o=e.pathOptions??{};r.instance.setStyle(o),n.current=o}},[r,e])}function W(r){return function(n){const t=b(),o=r(v(n,t),t);return x(o.current,n.eventHandlers),w(o.current,t),G(o.current,n),o}}function X(r,e){const n=E(r),t=Z(n,e);return U(t)}function q(r,e){const n=E(r,e),t=W(n);return D(t)}function F(r,e){const n=E(r,e),t=B(n);return V(t)}function J(r,e,n){const{opacity:t,zIndex:o}=e;t!=null&&t!==n.opacity&&r.setOpacity(t),o!=null&&o!==n.zIndex&&r.setZIndex(o)}const K=q(function({center:e,children:n,...t},o){const u=new p.CircleMarker(e,t);return L(u,A(o,{overlayContainer:u}))},_);function y(){return y=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=n[t])}return r},y.apply(this,arguments)}function Q({bounds:r,boundsOptions:e,center:n,children:t,className:o,id:u,placeholder:c,style:i,whenReady:f,zoom:m,...d},T){const[j]=a.useState({className:o,id:u,style:i}),[l,M]=a.useState(null);a.useImperativeHandle(T,()=>(l==null?void 0:l.map)??null,[l]);const H=a.useCallback(O=>{if(O!==null&&l===null){const h=new p.Map(O,d);n!=null&&m!=null?h.setView(n,m):r!=null&&h.fitBounds(r,e),f!=null&&h.whenReady(f),M(z(h))}},[]);a.useEffect(()=>()=>{l==null||l.map.remove()},[l]);const P=l?C.createElement(N,{value:l},t):c??null;return C.createElement("div",y({},j,{ref:H}),P)}const Y=a.forwardRef(Q),$=F(function({url:e,...n},t){const o=new p.TileLayer(e,v(n,t));return L(o,t)},function(e,n,t){J(e,n,t);const{url:o}=n;o!=null&&o!==t.url&&e.setUrl(o)}),ee=X(function(e,n){const t=new p.Tooltip(e,n.overlayContainer);return L(t,n)},function(e,n,{position:t},o){a.useEffect(function(){const c=n.overlayContainer;if(c==null)return;const{instance:i}=e,f=d=>{d.tooltip===i&&(t!=null&&i.setLatLng(t),i.update(),o(!0))},m=d=>{d.tooltip===i&&o(!1)};return c.on({tooltipopen:f,tooltipclose:m}),c.bindTooltip(i),function(){c.off({tooltipopen:f,tooltipclose:m}),c._map!=null&&c.unbindTooltip()}},[e,n,o,t])}),te={×¤× ××:"#10b981",××ש×ר:"#0ea5e9",×ת××××§×:"#f59e0b","×× ××××":"#94a3b8"};function re({caravans:r}){const e=a.useMemo(()=>r.filter(t=>t.lat!=null&&t.lng!=null&&!Number.isNaN(Number(t.lat))&&!Number.isNaN(Number(t.lng))),[r]),n=a.useMemo(()=>
1{if(!e.length)return[31.65,35.23];const t=e.reduce((u,c)=>u+Number(c.lat),0)/e.length,o=e.reduce((u,c)=>u+Number(c.lng),0)/e.length;return[t,o]},[e]);return e.length?s.jsx("div",{className:"rounded-2xl overflow-hidden border border-slate-100 shadow-sm",style:{height:"70vh"},dir:"ltr",children:s.jsxs(Y,{center:n,zoom:14,style:{height:"100%",width:"100%"},scrollWheelZoom:!0,children:[s.jsx($,{attribution:"© OpenStreetMap",url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),e.map(t=>s.jsx(K,{center:[Number(t.lat),Number(t.lng)],radius:11,pathOptions:{color:"#fff",weight:2,fillColor:te[t.status]||"#64748b",fillOpacity:.9},children:s.jsx(ee,{direction:"top",children:s.jsxs("div",{dir:"rtl",children:["קר×××× #",t.caravan_number," · ",t.status]})})},t.id))]})}):s.jsxs("div",{className:"text-center py-20 bg-white rounded-2xl border border-slate-100",dir:"rtl",children:[s.jsx(S,{className:"w-12 h-12 text-slate-300 mx-auto mb-3"}),s.jsx("p",{className:"text-sm text-slate-500",children:"××× ×§×¨×××× ×× ×¢× ×××§×× ×¢× ××פ×."}),s.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"× ××ª× ×××ס××£ ×§×××ר××× ××ת (lat/lng) ×קר×××× ××× ×©××פ××¢ ×××."})]})}export{re 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.