PageSourceSearch

https://www.byblack.us/assets/map-DruNrbbX.js

js byblack.us collected 2026-09-24 12:08:05 UTC 15,693 bytes, 1 lines download raw bytes

1import{r as w,j as f,a as nt}from"./vendor-react-CogcpAn1.js";import{c as V,aa as ot,d as U}from"./app-BKRNh0PA.js";import{M as R,a as rt,L as it,S as at,u as ct,N as lt,P as H}from"./vendor-maps-BqH7uyOa.js";import{U as ut}from"./change-email-BdRlB1zt.js";const K=w.createContext(!1),Q={scrollZoom:!1,boxZoom:!1,dragRotate:!1,dragPan:!1,keyboard:!1,doubleClickZoom:!1,touchZoomRotate:!1,touchPitch:!1};function W({disableInteractions:o,onLoad:t,...e}){const[s,r]=w.useState(!1),i=w.useCallback(a=>{r(!0),t?.(a)},[t]);return f.jsx(ut,{children:f.jsx(K.Provider,{value:s,children:f.jsx(rt,{...o?Q:{},...e,onLoad:i,mapStyle:"mapbox://styles/bgunter1/cmmwe26h7007u01rbbocl3sun?optimize=true",mapboxAccessToken:"pk.eyJ1IjoiYmd1bnRlcjEiLCJhIjoiY203c21raTB0MGlicjJqbjMweGlhaGVtcCJ9.RgNkCcSIb9xRYlYPAcF0aA"})})})}function ht({children:o,...t}){const{data:e}=t;return w.useContext(K)?e?f.jsx(at,{type:"geojson",...t,children:o}):f.jsx(f.Fragment,{children:o}):null}const Vt=Object.freeze(Object.defineProperty({__proto__:null,DISABLE_MAP_INTERACTION_SETTINGS:Q,GeoJsonSource:ht,Layer:it,Marker:R,Popup:H,default:W},Symbol.toStringTag,{value:"Module"})),q=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Z=1,C=8;class L{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,s]=new Uint8Array(t,0,2);if(e!==219)throw new Error("Data does not appear to be in a KDBush format.");const r=s>>4;if(r!==Z)throw new Error(`Got v${r} data when expected v${Z}.`);const i=q[s&15];if(!i)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(t,2,1),[c]=new Uint32Array(t,4,1);return new L(c,a,i,t)}constructor(t,e=64,s=Float64Array,r){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=s,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const i=q.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,n=(8-c%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${s}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,C,t),this.coords=new this.ArrayType(this.data,C+c+n,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(C+a+c+n),this.ids=new this.IndexArrayType(this.data,C,t),this.coords=new this.ArrayType(this.data,C+c+n,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Z<<4)+i]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=t,this.coords[this._pos++]=e,s}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return D(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,s,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:a,nodeSize:c}=this,n=[0,i.length-1,0],u=[];for(;n.length;){const h=n.pop()||0,l=n.pop()||0,p=n.pop()||0;if(l-p<=c){for(let _=p;_<=l;_++){const d=a[2*_],y=a[2*_+1];d>=t&&d<=s&&y>=e&&y<=r&&u.push(i[_])}continue}const m=p+l>>1,g=a[2*m],x=a[2*m+1];g>=t&&g<=s&&x>=e&&x<=r&&u.push(i[m]),(h===0?t<=g:e<=x)&&(n.push(p),n.push(m-1),n.push(1-h)),(h===0?s>=g:r>=x)&&(n.push(m+1),n.push(l),n.push(1-h))}return u}within(t,e,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:i,nodeSize:a}=this,c=[0,r.length-1,0],n=[],u=s*s;for(;c.length;){const h=c.pop()||0,l=c.pop()||0,p=c.pop()||0;if(l-p<=a){for(let _=p;_<=l;_++)$(i[2*_],i[2*_+1],t,e)<=u&&n.push(r[_]);continue}const m=p+l>>1,g=i[2*m],x=i[2*m+1];$(g,x,t,e)<=u&&n.push(r[m]),(h===0?t-s<=g:e-s<=x)&&(c.push(p),c.push(m-1),c.push(1-h)),(h===0?t+s>=g:e+s>=x)&&(c.push(m+1),c.push(l),c.push(1-h))}return n}}function D(o,t,e,s,r,i){if(r-s<=e)return;const a=s+r>>1;X(o,t,a,s,r,i),D(o,t,e,s,a-1,1-i),D(o,t,e,a+1,r,1-i)}function X(o,t,e,s,r,i){for(;r>s;){if(r-s>600){const u=r-s+1,h=e-s+1,l=Math.log(u),p=.5*Math.exp(2*l/3),m=.5*Math.sqrt(l*p*(u-p)/u)*(h-u/2<0?-1:1),g=Math.max(s,Math.floor(e-h*p/u+m)),x=Math.min(r,Math.floor(e+(u-h)*p/u+m));X(o,t,e,g,x,i)}const a=t[2*e+i];let c=s,n=r;for(O(o,t,s,e),t[2*r+i]>a&&O(o,t,s,r);c<n;){for(O(o,t,c,n),c++,n--;t[2*c+i]<a;)c++;for(;t[2*n+i]>a;)n--}t[2*s+i]===a?O(o,t,s,n):(n++,O(o,t,n,r)),n<=e&&(s=n+1),e<=n&&(r=n-1)}}function O(o,t,e,s){B(o,e,s),B(t,2*e,2*s),B(t,2*e+1,2*s+1)}function B(o,t,e){const s=o[t];o[t]=o[e],o[e]=s}function $(o,t,e,s){const r=o-e,i=t-s;return r*r+i*i}const pt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:o=>o},k=Math.fround||(o=>(t=>(o[0]=+t,o[0])))(new Float32Array(1)),A=2,S=3,b=4,P=5,tt=6;class dt{constructor(t){this.options=Object.assign(Object.create(pt),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:s,maxZoom:r}=this.options;e&&console.time("total time");const i=`prepare ${t.length} points`;e&&console.time(i),this.points=t;const a=[];for(let n=0;n<t.length;n++){const u=t[n];if(!u.geometry)continue;const[h,l]=u.geometry.coordinates,p=k(F(h)),m=k(N(l));a.push(p,m,1/0,n,-1,1),this.options.reduce&&a.push(0)}let c=this.trees[r+1]=this._createTree(a);e&&console.timeEnd(i);for(let n=r;n>=s;n--){const u=+Date.now();c=this.trees[n]=this._createTree(this._cluster(c,n)),e&&console.log("z%d: %d clusters in %dms",n,c.numItems,+Date.now()-u)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let s=((t[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,t[1]));let i=t[2]===180?180:((t[2]+180)%360+360)%360-180;const a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)s=-180,i=180;else if(s>i){const l=this.getClusters([s,r,180,a],e),p=this.getClusters([-180,r,i,a],e);return l.concat(p)}const c=this.trees[this._limitZoom(e)],n=c.range(F(s),N(a),F(i),N(r)),u=c.data,h=[];for(const l of n){const p=this.stride*l;h.push(u[p+P]>1?G(u,p,this.clusterProps):this.points[u[p+S]])}return h}getChildren(t){const e=this._getOriginId(t),s=this._getOriginZoom(t),r="No cluster with the specified id.",i=this.trees[s];if(!i)throw new Error(r);const a=i.data;if(e*this.stride>=a.length)throw new Error(r);const c=this.options.radius/(this.options.extent*Math.pow(2,s-1)),n=a[e*this.stride],u=a[e*this.stride+1],h=i.within(n,u,c),l=[];for(const p of h){const m=p*this.stride;a[m+b]===t&&l.push(a[m+P]>1?G(a,m,this.clusterProps):this.points[a[m+S]])}if(l.length===0)throw new Error(r);return l}getLeaves(t,e,s){e=e||10,s=s||0;const r=[];return this._appendLeaves(r,t,e,s,0),r}getTile(t,e,s){const r=this.trees[this._limitZoom(t)],i=Math.pow(2,t),{extent:a,radius:c}=this.options,n=c/a,u=(s-n)/i,h=(s+1+n)/i,l={features:[]};return this._addTileFeatures(r.range((e-n)/i,u,(e+1+n)/i,h),r.data,e,s,i,l),e===0&&this._addTileFeatures(r.range(1-n/i,u,1,h),r.data,i,s,i,l),e===i-1&&this._addTileFeatures(r.range(0,u,n/i,h),r.data,-1,s,i,l),l.features.length?l:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const s=this.getChildren(t);if(e++,s.length!==1)break;t=s[0].properties.cluster_id}return e}_appendLeaves(t,e,s,r,i){const a=this.getChildren(e);for(const c of a){const n=c.properties;if(n&&n.cluster?i+n.point_count<=r?i+=n.point_count:i=this._appendLeaves(t,n.cluster_id,s,r,i):i<r?i++:t.push(c),t.length===s)break}return i}_createTree(t){const e=new L(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let s=0;s<t.length;s+=this.stride)e.add(t[s],t[s+1]);return e.finish(),e.data=t,e}_addTileFeatures(t,e,s,r,i,a){for(const c of t){const n=c*this.stride,u=e[n+P]>1;let h,l,p;if(u)h=et(e,n,this.clusterProps),l=e[n],p=e[n+1];else{const x=this.points[e[n+S]];h=x.properties;const[_,d]=x.geometry.coordinates;l=F(_),p=N(d)}const m={type:1,geometry:[[Math.round(this.options.extent*(l*i-s)),Math.round(this.options.extent*(p*i-r))]],tags:h};let g;u||this.options.generateId?g=e[n+S]:g=this.points[e[n+S]].id,g!==void 0&&(m.id=g),a.features.push(m)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:s,extent:r,reduce:i,minPoints:a}=this.options,c=s/(r*Math.pow(2,e)),n=t.data,u=[],h=this.stride;for(let l=0;l<n.length;
1l+=h){if(n[l+A]<=e)continue;n[l+A]=e;const p=n[l],m=n[l+1],g=t.within(n[l],n[l+1],c),x=n[l+P];let _=x;for(const d of g){const y=d*h;n[y+A]>e&&(_+=n[y+P])}if(_>x&&_>=a){let d=p*x,y=m*x,M,I=-1;const T=((l/h|0)<<5)+(e+1)+this.points.length;for(const st of g){const E=st*h;if(n[E+A]<=e)continue;n[E+A]=e;const z=n[E+P];d+=n[E]*z,y+=n[E+1]*z,n[E+b]=T,i&&(M||(M=this._map(n,l,!0),I=this.clusterProps.length,this.clusterProps.push(M)),i(M,this._map(n,E)))}n[l+b]=T,u.push(d/_,y/_,1/0,T,-1,_),i&&u.push(I)}else{for(let d=0;d<h;d++)u.push(n[l+d]);if(_>1)for(const d of g){const y=d*h;if(!(n[y+A]<=e)){n[y+A]=e;for(let M=0;M<h;M++)u.push(n[y+M])}}}}return u}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,s){if(t[e+P]>1){const a=this.clusterProps[t[e+tt]];return s?Object.assign({},a):a}const r=this.points[t[e+S]].properties,i=this.options.map(r);return s&&i===r?Object.assign({},i):i}}function G(o,t,e){return{type:"Feature",id:o[t+S],properties:et(o,t,e),geometry:{type:"Point",coordinates:[ft(o[t]),mt(o[t+1])]}}}function et(o,t,e){const s=o[t+P],r=s>=1e4?`${Math.round(s/1e3)}k`:s>=1e3?`${Math.round(s/100)/10}k`:s,i=o[t+tt],a=i===-1?{}:Object.assign({},e[i]);return Object.assign(a,{cluster:!0,cluster_id:o[t+S],point_count:s,point_count_abbreviated:r})}function F(o){return o/360+.5}function N(o){const t=Math.sin(o*Math.PI/180),e=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return e<0?0:e>1?1:e}function ft(o){return(o-.5)*360}function mt(o){const t=(180-o*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}var J=Object.prototype.hasOwnProperty;function Y(o,t,e){for(e of o.keys())if(v(e,t))return e}function v(o,t){var e,s,r;if(o===t)return!0;if(o&&t&&(e=o.constructor)===t.constructor){if(e===Date)return o.getTime()===t.getTime();if(e===RegExp)return o.toString()===t.toString();if(e===Array){if((s=o.length)===t.length)for(;s--&&v(o[s],t[s]););return s===-1}if(e===Set){if(o.size!==t.size)return!1;for(s of o)if(r=s,r&&typeof r=="object"&&(r=Y(t,r),!r)||!t.has(r))return!1;return!0}if(e===Map){if(o.size!==t.size)return!1;for(s of o)if(r=s[0],r&&typeof r=="object"&&(r=Y(t,r),!r)||!v(s[1],t.get(r)))return!1;return!0}if(e===ArrayBuffer)o=new Uint8Array(o),t=new Uint8Array(t);else if(e===DataView){if((s=o.byteLength)===t.byteLength)for(;s--&&o.getInt8(s)===t.getInt8(s););return s===-1}if(ArrayBuffer.isView(o)){if((s=o.byteLength)===t.byteLength)for(;s--&&o[s]===t[s];);return s===-1}if(!e||typeof o=="object"){s=0;for(e in o)if(J.call(o,e)&&++s&&!J.call(t,e)||!(e in t)||!v(o[e],t[e]))return!1;return Object.keys(t).length===s}}return o!==o&&t!==t}function gt(o){var t=w.useRef(o),e=w.useRef(0);return v(o,t.current)||(t.current=o,e.current+=1),w.useMemo(function(){return t.current},[e.current])}function _t(o,t){return w.useEffect(o,gt(t))}var yt=function(t){var e=t.points,s=t.bounds,r=t.zoom,i=t.options,a=t.disableRefresh,c=w.useRef(),n=w.useRef(),u=w.useState([]),h=u[0],l=u[1],p=Math.round(r);return _t(function(){a!==!0&&((!c.current||!v(n.current,e)||!v(c.current.options,i))&&(c.current=new dt(i),c.current.load(e)),s&&l(c.current.getClusters(s,p)),n.current=e)},[e,s,p,i,a]),{clusters:h,supercluster:c.current}};const xt=o=>{if(!o.latitude||!o.longitude)return null;const t=[o.longitude,o.latitude];return{type:"Feature",properties:{cluster:!1,id:o.id||o._id,imageUrl:o.imageUrl,name:o.name},geometry:{type:"Point",coordinates:t}}},wt=o=>o.properties.cluster===!0,jt="12px",Mt="_fullScreen_150jq_6",Pt="_close_150jq_30",St="_exiting_150jq_44",Et="_closeIcon_150jq_48",At="_container_150jq_53",vt="_visitor_150jq_85",It="_visitorDot_150jq_92",Tt="_visitorPulse_150jq_93",Ct="_point_150jq_117",Ot="_cluster_150jq_127",Ft="_count_150jq_136",Nt="_popup_150jq_147",Rt="_imageContainer_150jq_154",Ut="_image_150jq_154",Zt="_placeholderImage_150jq_167",Bt="_name_150jq_187",j={POPUP_OFFSET:jt,fullScreen:Mt,close:Pt,exiting:St,closeIcon:Et,container:At,visitor:vt,visitorDot:It,visitorPulse:Tt,point:Ct,cluster:Ot,count:Ft,popup:Nt,imageContainer:Rt,image:Ut,placeholderImage:Zt,name:Bt},bt=Number.parseInt(j.POPUP_OFFSET),Dt=({imageUrl:o,name:t})=>f.jsxs("div",{className:j.popup,children:[f.jsx("div",{className:j.imageContainer,children:o?f.jsx("img",{alt:t,className:j.image,src:o}):f.jsx("div",{className:j.placeholderImage})}),f.jsx("p",{className:j.name,children:t})]}),Lt=({businesses:o,centerLatitude:t,centerLongitude:e,initialZoom:s=12,mapId:r,minHeight:i,visitorLatitude:a,visitorLongitude:c})=>{const{[r]:n}=ct(),[u,h]=w.useState(()=>({bearing:0,height:"100%",latitude:t,longitude:e,padding:{top:0,left:0,right:0,bottom:0},pitch:0,width:"100%",zoom:s})),{zoom:l}=u,p=n?.getMap()?.getBounds()?.toArray()?.flat(),m=w.useMemo(()=>o.map(xt).filter(U),[o]),g=w.useMemo(()=>{const[d,y]=m.reduce(([M,I],{geometry:{coordinates:T}})=>[Math.max(M,Math.abs(T[0]-e)),Math.max(I,Math.abs(T[1]-t))],[0,0]);if(!(!d&&!y))return[[e-d,t-y],[e+d,t+y]]},[m,t,e]);w.useEffect(()=>{n&&(g?n.fitBounds(g,{padding:48,duration:800}):n.easeTo({center:[e,t],zoom:s,duration:800}),h(d=>({...d,centerLatitude:t,centerLongitude:e,initialZoom:s})))},[n,t,e,s,g]);
1const{clusters:x,supercluster:_}=yt({bounds:p,points:m,zoom:l,options:{minZoom:2,minPoints:2,radius:60}});return f.jsxs(W,{id:r,maxZoom:15,onMove:d=>h(d.viewState),reuseMaps:!0,style:{height:"100%",minHeight:i,width:"100%"},...u,children:[f.jsx(lt,{showCompass:!1}),U(a)&&U(c)&&f.jsx(R,{latitude:a,longitude:c,style:{zIndex:1},children:f.jsxs("div",{className:j.visitor,title:"Your location",children:[f.jsx("span",{className:j.visitorPulse,"aria-hidden":!0}),f.jsx("span",{className:j.visitorDot})]})}),x.map(d=>{const[y,M]=d.geometry.coordinates;return wt(d)?f.jsx(R,{longitude:y,latitude:M,onClick:()=>{const I=Math.min(_?.getClusterExpansionZoom(d.id)??Number.POSITIVE_INFINITY,20);n?.easeTo({center:[y,M],zoom:I,duration:800})},children:f.jsx("div",{className:j.cluster,children:f.jsx("span",{className:j.count,children:d.properties.point_count})})},d.id):f.jsxs(w.Fragment,{children:[f.jsx(R,{latitude:M,longitude:y,children:f.jsx("div",{className:j.point})}),f.jsx(H,{anchor:"bottom",closeButton:!1,closeOnClick:!1,latitude:M,longitude:y,offset:bt,children:f.jsx(Dt,{imageUrl:d.properties.imageUrl,name:d.properties.name})})]},d.properties.id)})]})},zt=o=>!!o.isFullScreen,qt=({children:o,isExiting:t,onClose:e})=>nt.createPortal(f.jsxs(w.Fragment,{children:[f.jsx("button",{"aria-label":"Close map",className:V(j.close,{[j.exiting]:t}),type:"button",onClick:e,children:f.jsx(ot,{className:j.closeIcon})}),o]}),document.getElementById("modal")),$t=({className:o="",minHeight:t,...e})=>{const{centerLatitude:s,centerLongitude:r,businesses:i=[],mapId:a}=e,c=zt(e),[n,u]=w.useState(c);c&&!n&&u(!0);const h=n&&!c;if(!s||!r)return null;const l=n?qt:w.Fragment;return f.jsx(l,{...n?{isExiting:h,onClose:e.onClose}:{},children:f.jsx("div",{className:V(o,j.container,{[j.fullScreen]:n,[j.exiting]:h}),onAnimationEnd:p=>{p.target!==p.currentTarget||!h||u(!1)},children:f.jsx(Lt,{minHeight:n?"100vh":t,visitorLatitude:e.visitorLatitude,visitorLongitude:e.visitorLongitude,businesses:i,centerLatitude:s,centerLongitude:r,mapId:a})})})},Ht=Object.freeze(Object.defineProperty({__proto__:null,default:$t},Symbol.toStringTag,{value:"Module"}));export{W as B,ht as G,Vt as b,Ht as i};

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.