@proximahq-dev/map 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/proxima-map.umd.js +1 -1
- package/package.json +1 -1
package/dist/proxima-map.umd.js
CHANGED
|
@@ -2389,7 +2389,7 @@ html body {
|
|
|
2389
2389
|
top: ${o}px !important;
|
|
2390
2390
|
left: ${L}px !important;
|
|
2391
2391
|
}
|
|
2392
|
-
`),()=>{document.head.removeChild(F)}},[s]),wr.jsx(J8,{isPresent:s,childRef:f,sizeRef:_,children:N.cloneElement(i,{ref:f})})}const eU=({children:i,initial:s,isPresent:c,onExitComplete:f,custom:_,presenceAffectsLayout:E,mode:T})=>{const A=lb(tU),o=N.useId(),L=N.useCallback(V=>{A.set(V,!0);for(const W of A.values())if(!W)return;f&&f()},[A,f]),F=N.useMemo(()=>({id:o,initial:s,isPresent:c,custom:_,onExitComplete:L,register:V=>(A.set(V,!1),()=>A.delete(V))}),E?[Math.random(),L]:[c,L]);return N.useMemo(()=>{A.forEach((V,W)=>A.set(W,!1))},[c]),N.useEffect(()=>{!c&&!A.size&&f&&f()},[c]),T==="popLayout"&&(i=wr.jsx(Q8,{isPresent:c,children:i})),wr.jsx(jy.Provider,{value:F,children:i})};function tU(){return new Map}const Zy=i=>i.key||"";function FP(i){const s=[];return N.Children.forEach(i,c=>{N.isValidElement(c)&&s.push(c)}),s}const rU=({children:i,exitBeforeEnter:s,custom:c,initial:f=!0,onExitComplete:_,presenceAffectsLayout:E=!0,mode:T="sync"})=>{const A=N.useMemo(()=>FP(i),[i]),o=A.map(Zy),L=N.useRef(!0),F=N.useRef(A),V=lb(()=>new Map),[W,X]=N.useState(A),[Q,re]=N.useState(A);xP(()=>{L.current=!1,F.current=A;for(let ne=0;ne<Q.length;ne++){const fe=Zy(Q[ne]);o.includes(fe)?V.delete(fe):V.get(fe)!==!0&&V.set(fe,!1)}},[Q,o.length,o.join("-")]);const K=[];if(A!==W){let ne=[...A];for(let fe=0;fe<Q.length;fe++){const Ie=Q[fe],Pe=Zy(Ie);o.includes(Pe)||(ne.splice(fe,0,Ie),K.push(Ie))}T==="wait"&&K.length&&(ne=K),re(FP(ne)),X(A);return}const{forceRender:ae}=N.useContext(Y1);return wr.jsx(wr.Fragment,{children:Q.map(ne=>{const fe=Zy(ne),Ie=A===Q||o.includes(fe),Pe=()=>{if(V.has(fe))V.set(fe,!0);else return;let Se=!0;V.forEach(Te=>{Te||(Se=!1)}),Se&&(ae==null||ae(),re(F.current),_&&_())};return wr.jsx(eU,{isPresent:Ie,initial:!L.current||f?void 0:!1,custom:Ie?void 0:c,presenceAffectsLayout:E,mode:T,onExitComplete:Ie?void 0:Pe,children:ne},fe)})})},nU=()=>{const{categories:i,handleFilterChange:s,filters:c,maxDistance:f}=F_(),_=i.filter(E=>E.name!=="DEVELOPMENT").map(E=>({label:I0(E.name),value:E.name}));return wr.jsxs("div",{className:"filter-content",children:[wr.jsxs("div",{className:"filter-section",children:[wr.jsx("h4",{children:"Type"}),wr.jsx(Up,{mode:"multiple",style:{width:"100%"},placeholder:"Select categories",options:_,value:c.Category||[],onChange:E=>s("Category",E),allowClear:!0,maxTagCount:5,listHeight:300})]}),wr.jsxs("div",{className:"filter-section",children:[wr.jsx("h4",{children:"Distance"}),wr.jsxs("div",{className:"slider-range-labels",children:[wr.jsx("span",{children:"0 km"}),wr.jsxs("span",{children:[f," km"]})]}),wr.jsx(R6,{range:{draggableTrack:!0},min:0,max:f,step:.1,value:c.distanceInKm||[0,f],onChange:E=>{const[T,A]=E,o=[0,Math.max(.5,A)];s("distanceInKm",o)}})]})]})},iU=()=>{const{sort:i,handleSort:s}=F_(),c=`${i.orderBy}-${i.order}`,f=_=>{if(_===c)s("","asc");else{const[E,T]=_.split("-");s(E,T)}};return wr.jsxs("div",{className:"sort-content",children:[wr.jsxs("div",{className:"sort-section",children:[wr.jsx("h4",{children:"Distance"}),wr.jsxs("div",{className:"sort-options",children:[wr.jsxs("div",{className:"sort-option",children:[wr.jsx("span",{className:"label",children:"Closest"}),wr.jsx(Wp,{checked:c==="distanceInKm-asc",onChange:()=>f("distanceInKm-asc")})]}),wr.jsxs("div",{className:"sort-option",children:[wr.jsx("span",{className:"label",children:"Farthest"}),wr.jsx(Wp,{checked:c==="distanceInKm-desc",onChange:()=>f("distanceInKm-desc")})]})]})]}),wr.jsxs("div",{className:"sort-section",children:[wr.jsx("h4",{children:"Point of Interest"}),wr.jsxs("div",{className:"sort-options",children:[wr.jsxs("div",{className:"sort-option",children:[wr.jsx("span",{className:"label",children:"A - Z"}),wr.jsx(Wp,{checked:c==="properties.Name-asc",onChange:()=>f("properties.Name-asc")})]}),wr.jsxs("div",{className:"sort-option",children:[wr.jsx("span",{className:"label",children:"Z - A"}),wr.jsx(Wp,{checked:c==="properties.Name-desc",onChange:()=>f("properties.Name-desc")})]})]})]})]})},oU=()=>wr.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[wr.jsx("path",{d:"M10 16.25C13.4518 16.25 16.25 13.4518 16.25 10C16.25 6.54822 13.4518 3.75 10 3.75C6.54822 3.75 3.75 6.54822 3.75 10C3.75 13.4518 6.54822 16.25 10 16.25Z",stroke:"#4D5456",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),wr.jsx("path",{d:"M10 12.5C11.3807 12.5 12.5 11.3807 12.5 10C12.5 8.61929 11.3807 7.5 10 7.5C8.61929 7.5 7.5 8.61929 7.5 10C7.5 11.3807 8.61929 12.5 10 12.5Z",stroke:"#4D5456",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),wr.jsx("path",{d:"M10 3.33341V1.66675",stroke:"#4D5456",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),wr.jsx("path",{d:"M3.33341 10H1.66675",stroke:"#4D5456",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),wr.jsx("path",{d:"M10 16.6667V18.3334",stroke:"#4D5456",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),wr.jsx("path",{d:"M16.6667 10H18.3334",stroke:"#4D5456",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]}),aU=()=>wr.jsx("svg",{width:"11",height:"11",viewBox:"0 0 11 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:wr.jsx("path",{d:"M1.75293 14L4.00987 11.2222M8.52376 14L7.01913 11.2222L4.76219 9.13889L5.5145 4.97222M5.5145 2.19444C5.5145 2.37862 5.59377 2.55526 5.73485 2.68549C5.87594 2.81572 6.06729 2.88889 6.26682 2.88889C6.46634 2.88889 6.6577 2.81572 6.79879 2.68549C6.93987 2.55526 7.01913 2.37862 7.01913 2.19444C7.01913 2.01027 6.93987 1.83363 6.79879 1.7034C6.6577 1.57316 6.46634 1.5 6.26682 1.5C6.06729 1.5 5.87594 1.57316 5.73485 1.7034C5.59377 1.83363 5.5145 2.01027 5.5145 2.19444Z",stroke:"currentColor",strokeWidth:"1.38889",strokeLinecap:"round",strokeLinejoin:"round"})}),sU=()=>wr.jsx("svg",{width:"11",height:"11",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:wr.jsx("path",{d:"M38.59,225c-2.31,78.89-.44,161.14,3.08,202,0,31.59,21.18,26.37,21.18,26.37H82.77v34.1C82.77,501,96.69,512,113.86,512S145,501,145,487.51v-34.1H376.35v34.1c0,13.54,14,24.49,31.14,24.49s31.14-11,31.14-24.49v-34.1h6.48s25,3.41,26.58-11.45c0-40.78,2.59-131.21.44-216.55a25.7,25.7,0,0,0,18.17-24.54V150.8a25.83,25.83,0,0,0-23.77-25.63C462.34,84.33,455.68,52.49,445.11,40,401.71-11.44,97.41-15.19,62.91,40c-8.48,13.54-14.42,45.23-18.38,85.28A25.72,25.72,0,0,0,21.7,150.8v50.07A25.75,25.75,0,0,0,38.59,225Zm102,188.1A33.2,33.2,0,1,1,173.77,380,33.2,33.2,0,0,1,140.55,413.13Zm229,0A33.2,33.2,0,1,1,402.82,380,33.22,33.22,0,0,1,369.58,413.13ZM137.18,47.3H370.85V82.69H137.18Zm-40.93,55H411.78V267.83H96.25Z",fill:"currentColor"})}),lU=()=>{var Se;const{filteredFeatures:i,categories:s,expandedPoi:c,expandedCategory:f,setActiveFeature:_,setExpandedPoi:E,setExpandedCategory:T,filters:A,developmentPin:o,clearFilters:L,clearSort:F,sort:V,maxDistance:W}=F_(),[X,Q]=N.useState(!0),[re,K]=N.useState(null),ae=N.useRef({}),ne=Te=>{E(c===Te.properties.Number?null:Te.properties.Number),_(Te)},fe=((Se=A.Category)==null?void 0:Se.length)>0||A.distanceInKm&&(A.distanceInKm[0]>0||A.distanceInKm[1]<W),Ie=V.orderBy!=="",Pe=Te=>{K(re===Te?null:Te)};return N.useEffect(()=>{setTimeout(()=>{var Te,Oe,ge,He;f&&c&&((Oe=(Te=ae.current)==null?void 0:Te[f])!=null&&Oe[c])&&((He=(ge=ae.current[f])==null?void 0:ge[c])==null||He.scrollIntoView({behavior:"smooth"}))},500)},[c]),wr.jsxs("div",{className:`hover-widget-container ${X?"expanded":"collapsed"}`,children:[wr.jsxs("div",{className:"widget-header",onClick:()=>Q(!X),children:[wr.jsx("h2",{className:"widget-title",children:"Points of Interest"}),wr.jsx(xp,{className:"expand-icon",style:{fontSize:"18px"}})]}),wr.jsxs(pb.div,{initial:!1,animate:{height:X?"auto":0,opacity:X?1:0},transition:{duration:.3,ease:"easeInOut"},style:{overflow:"auto"},children:[wr.jsxs("div",{className:"categories-container",children:[wr.jsx("div",{className:"development-item",children:wr.jsxs("div",{className:"poi-item",onClick:()=>{_(o),E(o.properties.Number)},children:[wr.jsx("span",{className:"poi-name",children:o.properties.Name}),wr.jsx(oU,{})]})}),wr.jsx(rU,{initial:!1,children:s.filter(Te=>Te.name==="DEVELOPMENT"?!1:i.some(ge=>ge.properties.Category===Te.name&&ge.properties.Number!==0)).map(Te=>wr.jsxs(pb.div,{className:"category-section",initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{opacity:{duration:.2},height:{duration:.3}},children:[wr.jsxs("div",{className:"category-header",onClick:()=>T(f===Te.name?null:Te.name),children:[wr.jsx("span",{children:I0(Te.name)}),wr.jsx("span",{className:"expand-icon",children:f===Te.name?wr.jsx(xp,{style:{fontSize:"12px"}}):wr.jsx(xp,{style:{fontSize:"12px",transform:"rotate(-90deg)"}})})]}),wr.jsx(pb.div,{initial:!1,animate:{height:f===Te.name?"auto":0,opacity:f===Te.name?1:0},transition:{duration:.3,ease:"easeInOut"},style:{overflow:"hidden"},children:wr.jsx("div",{className:"category-content",children:i.filter(Oe=>Oe.properties.Category===Te.name&&Oe.properties.Number!==0).map(Oe=>wr.jsxs("div",{className:"poi-container",children:[wr.jsxs("div",{className:"poi-item",onClick:()=>ne(Oe),ref:ge=>{var ze;const{Category:He,Number:Ke}=Oe.properties;((ze=ae.current)[He]??(ze[He]={}))[Ke]=ge},children:[wr.jsxs("span",{className:"poi-number",children:[Oe.properties.Number,"."]}),wr.jsx("span",{className:"poi-name",children:Oe.properties.Name})]}),c===Oe.properties.Number&&wr.jsxs("div",{className:"distance-info",children:[wr.jsx(aU,{}),wr.jsxs("span",{children:[Oe.distanceInMin," min"]}),wr.jsx(oS,{}),wr.jsxs("span",{children:[Oe.drivingDistanceInMin," min"]}),wr.jsx(sU,{}),wr.jsxs("span",{children:[Oe.busDistanceInMin," min"]})]})]},Oe.properties.Number))})})]},Te.name))})]}),wr.jsx("div",{className:"filters-container",children:wr.jsx(gy,{activeKey:re==="filters"?["filters"]:[],onChange:()=>Pe("filters"),children:wr.jsx(gy.Panel,{header:wr.jsxs("div",{className:"filter-header",children:[wr.jsxs("div",{className:"header-left",children:[wr.jsx("span",{children:"Filters"}),fe&&wr.jsx($T,{style:{backgroundColor:"#F5222D",color:"white",borderRadius:"20px",padding:"0 6px",fontWeight:600},count:i.filter(Te=>Te.properties.Number!==0).length})]}),wr.jsxs("div",{className:"header-right",children:[fe&&wr.jsx(wy,{type:"link",onClick:L,children:"Clear"}),wr.jsx(xp,{className:"expand-icon",style:{fontSize:"18px"}})]})]}),children:wr.jsx(nU,{})},"filters")})}),wr.jsx("div",{className:"sort-container",children:wr.jsx(gy,{activeKey:re==="sort"?["sort"]:[],onChange:()=>Pe("sort"),children:wr.jsx(gy.Panel,{header:wr.jsxs("div",{className:"sort-header",children:[wr.jsx("div",{className:"header-left",children:wr.jsx("span",{children:"Sort"})}),wr.jsxs("div",{className:"header-right",children:[Ie&&wr.jsx(wy,{type:"link",onClick:F,children:"Clear"}),wr.jsx(xp,{className:"expand-icon",style:{fontSize:"18px"}})]})]}),children:wr.jsx(iU,{})},"sort")})})]})]})},cU=({mapboxToken:i,mapboxStyleUrl:s,initialCenter:c,initialZoom:f,initialFeatures:_})=>wr.jsx(Z3,{initialFeatures:_,children:wr.jsxs("div",{className:"proxima-map-container",children:[wr.jsx("div",{className:"map-wrapper",children:wr.jsx(eD,{accessToken:i,styleUrl:s,center:c,zoom:f})}),wr.jsx(lU,{})]})}),uU=async(i,s,c,f)=>{var _,E;try{const T=await fetch("https://cms.proximahq.io/graphql",{method:"POST",headers:{"Content-Type":"application/json",authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiMDZiNDgwOWYtYWQyZS00MzE1LTkxMGItYWQ2ZDBlNDk4ZjQ1In0sImlhdCI6MTY4MDczMzMzM30.yxzZfDId5rR7jt7LLVWItSYbDOq8N5tT0juLC61dVUc"},body:JSON.stringify({query:i,variables:s,dataString:c,nestedString:f})});if(!T.ok)throw console.error(`HTTP error: ${T.status}: ${T.statusText}`),new Error(`HTTP error: ${T.status}: ${T.statusText}`);const A=await T.json();if(A.errors)throw new Error(`GraphQL error: ${c}: ${A.errors.map(L=>L.message).join(", ")}`);const o=f?(_=A.data)==null?void 0:_[c][f]:(E=A.data)==null?void 0:E[c];if(!o&&!A.data.hasOwnProperty(c))throw new Error(`${c} is missing`);return o}catch(T){throw T}},hU=async i=>await uU(`query MapboxInfo($slug: String!, $pageCategory: String) {
|
|
2392
|
+
`),()=>{document.head.removeChild(F)}},[s]),wr.jsx(J8,{isPresent:s,childRef:f,sizeRef:_,children:N.cloneElement(i,{ref:f})})}const eU=({children:i,initial:s,isPresent:c,onExitComplete:f,custom:_,presenceAffectsLayout:E,mode:T})=>{const A=lb(tU),o=N.useId(),L=N.useCallback(V=>{A.set(V,!0);for(const W of A.values())if(!W)return;f&&f()},[A,f]),F=N.useMemo(()=>({id:o,initial:s,isPresent:c,custom:_,onExitComplete:L,register:V=>(A.set(V,!1),()=>A.delete(V))}),E?[Math.random(),L]:[c,L]);return N.useMemo(()=>{A.forEach((V,W)=>A.set(W,!1))},[c]),N.useEffect(()=>{!c&&!A.size&&f&&f()},[c]),T==="popLayout"&&(i=wr.jsx(Q8,{isPresent:c,children:i})),wr.jsx(jy.Provider,{value:F,children:i})};function tU(){return new Map}const Zy=i=>i.key||"";function FP(i){const s=[];return N.Children.forEach(i,c=>{N.isValidElement(c)&&s.push(c)}),s}const rU=({children:i,exitBeforeEnter:s,custom:c,initial:f=!0,onExitComplete:_,presenceAffectsLayout:E=!0,mode:T="sync"})=>{const A=N.useMemo(()=>FP(i),[i]),o=A.map(Zy),L=N.useRef(!0),F=N.useRef(A),V=lb(()=>new Map),[W,X]=N.useState(A),[Q,re]=N.useState(A);xP(()=>{L.current=!1,F.current=A;for(let ne=0;ne<Q.length;ne++){const fe=Zy(Q[ne]);o.includes(fe)?V.delete(fe):V.get(fe)!==!0&&V.set(fe,!1)}},[Q,o.length,o.join("-")]);const K=[];if(A!==W){let ne=[...A];for(let fe=0;fe<Q.length;fe++){const Ie=Q[fe],Pe=Zy(Ie);o.includes(Pe)||(ne.splice(fe,0,Ie),K.push(Ie))}T==="wait"&&K.length&&(ne=K),re(FP(ne)),X(A);return}const{forceRender:ae}=N.useContext(Y1);return wr.jsx(wr.Fragment,{children:Q.map(ne=>{const fe=Zy(ne),Ie=A===Q||o.includes(fe),Pe=()=>{if(V.has(fe))V.set(fe,!0);else return;let Se=!0;V.forEach(Te=>{Te||(Se=!1)}),Se&&(ae==null||ae(),re(F.current),_&&_())};return wr.jsx(eU,{isPresent:Ie,initial:!L.current||f?void 0:!1,custom:Ie?void 0:c,presenceAffectsLayout:E,mode:T,onExitComplete:Ie?void 0:Pe,children:ne},fe)})})},nU=()=>{const{categories:i,handleFilterChange:s,filters:c,maxDistance:f}=F_(),_=i.filter(E=>E.name!=="DEVELOPMENT").map(E=>({label:I0(E.name),value:E.name}));return wr.jsxs("div",{className:"filter-content",children:[wr.jsxs("div",{className:"filter-section",children:[wr.jsx("h4",{children:"Type"}),wr.jsx(Up,{mode:"multiple",style:{width:"100%"},placeholder:"Select categories",options:_,value:c.Category||[],onChange:E=>s("Category",E),allowClear:!0,maxTagCount:5,listHeight:300})]}),wr.jsxs("div",{className:"filter-section",children:[wr.jsx("h4",{children:"Distance"}),wr.jsxs("div",{className:"slider-range-labels",children:[wr.jsx("span",{children:"0 km"}),wr.jsxs("span",{children:[f," km"]})]}),wr.jsx(R6,{range:{draggableTrack:!0},min:0,max:f,step:.1,value:c.distanceInKm||[0,f],onChange:E=>{const[T,A]=E,o=[0,Math.max(.5,A)];s("distanceInKm",o)}})]})]})},iU=()=>{const{sort:i,handleSort:s}=F_(),c=`${i.orderBy}-${i.order}`,f=_=>{if(_===c)s("","asc");else{const[E,T]=_.split("-");s(E,T)}};return wr.jsxs("div",{className:"sort-content",children:[wr.jsxs("div",{className:"sort-section",children:[wr.jsx("h4",{children:"Distance"}),wr.jsxs("div",{className:"sort-options",children:[wr.jsxs("div",{className:"sort-option",children:[wr.jsx("span",{className:"label",children:"Closest"}),wr.jsx(Wp,{checked:c==="distanceInKm-asc",onChange:()=>f("distanceInKm-asc")})]}),wr.jsxs("div",{className:"sort-option",children:[wr.jsx("span",{className:"label",children:"Farthest"}),wr.jsx(Wp,{checked:c==="distanceInKm-desc",onChange:()=>f("distanceInKm-desc")})]})]})]}),wr.jsxs("div",{className:"sort-section",children:[wr.jsx("h4",{children:"Point of Interest"}),wr.jsxs("div",{className:"sort-options",children:[wr.jsxs("div",{className:"sort-option",children:[wr.jsx("span",{className:"label",children:"A - Z"}),wr.jsx(Wp,{checked:c==="properties.Name-asc",onChange:()=>f("properties.Name-asc")})]}),wr.jsxs("div",{className:"sort-option",children:[wr.jsx("span",{className:"label",children:"Z - A"}),wr.jsx(Wp,{checked:c==="properties.Name-desc",onChange:()=>f("properties.Name-desc")})]})]})]})]})},oU=()=>wr.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[wr.jsx("path",{d:"M10 16.25C13.4518 16.25 16.25 13.4518 16.25 10C16.25 6.54822 13.4518 3.75 10 3.75C6.54822 3.75 3.75 6.54822 3.75 10C3.75 13.4518 6.54822 16.25 10 16.25Z",stroke:"#4D5456",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),wr.jsx("path",{d:"M10 12.5C11.3807 12.5 12.5 11.3807 12.5 10C12.5 8.61929 11.3807 7.5 10 7.5C8.61929 7.5 7.5 8.61929 7.5 10C7.5 11.3807 8.61929 12.5 10 12.5Z",stroke:"#4D5456",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),wr.jsx("path",{d:"M10 3.33341V1.66675",stroke:"#4D5456",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),wr.jsx("path",{d:"M3.33341 10H1.66675",stroke:"#4D5456",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),wr.jsx("path",{d:"M10 16.6667V18.3334",stroke:"#4D5456",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),wr.jsx("path",{d:"M16.6667 10H18.3334",stroke:"#4D5456",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]}),aU=()=>wr.jsx("svg",{width:"11",height:"11",viewBox:"0 0 11 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:wr.jsx("path",{d:"M1.75293 14L4.00987 11.2222M8.52376 14L7.01913 11.2222L4.76219 9.13889L5.5145 4.97222M5.5145 2.19444C5.5145 2.37862 5.59377 2.55526 5.73485 2.68549C5.87594 2.81572 6.06729 2.88889 6.26682 2.88889C6.46634 2.88889 6.6577 2.81572 6.79879 2.68549C6.93987 2.55526 7.01913 2.37862 7.01913 2.19444C7.01913 2.01027 6.93987 1.83363 6.79879 1.7034C6.6577 1.57316 6.46634 1.5 6.26682 1.5C6.06729 1.5 5.87594 1.57316 5.73485 1.7034C5.59377 1.83363 5.5145 2.01027 5.5145 2.19444Z",stroke:"currentColor",strokeWidth:"1.38889",strokeLinecap:"round",strokeLinejoin:"round"})}),sU=()=>wr.jsx("svg",{width:"11",height:"11",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:wr.jsx("path",{d:"M38.59,225c-2.31,78.89-.44,161.14,3.08,202,0,31.59,21.18,26.37,21.18,26.37H82.77v34.1C82.77,501,96.69,512,113.86,512S145,501,145,487.51v-34.1H376.35v34.1c0,13.54,14,24.49,31.14,24.49s31.14-11,31.14-24.49v-34.1h6.48s25,3.41,26.58-11.45c0-40.78,2.59-131.21.44-216.55a25.7,25.7,0,0,0,18.17-24.54V150.8a25.83,25.83,0,0,0-23.77-25.63C462.34,84.33,455.68,52.49,445.11,40,401.71-11.44,97.41-15.19,62.91,40c-8.48,13.54-14.42,45.23-18.38,85.28A25.72,25.72,0,0,0,21.7,150.8v50.07A25.75,25.75,0,0,0,38.59,225Zm102,188.1A33.2,33.2,0,1,1,173.77,380,33.2,33.2,0,0,1,140.55,413.13Zm229,0A33.2,33.2,0,1,1,402.82,380,33.22,33.22,0,0,1,369.58,413.13ZM137.18,47.3H370.85V82.69H137.18Zm-40.93,55H411.78V267.83H96.25Z",fill:"currentColor"})}),lU=()=>{var Se;const{filteredFeatures:i,categories:s,expandedPoi:c,expandedCategory:f,setActiveFeature:_,setExpandedPoi:E,setExpandedCategory:T,filters:A,developmentPin:o,clearFilters:L,clearSort:F,sort:V,maxDistance:W}=F_(),[X,Q]=N.useState(!0),[re,K]=N.useState(null),ae=N.useRef({}),ne=Te=>{E(c===Te.properties.Number?null:Te.properties.Number),_(Te)},fe=((Se=A.Category)==null?void 0:Se.length)>0||A.distanceInKm&&(A.distanceInKm[0]>0||A.distanceInKm[1]<W),Ie=V.orderBy!=="",Pe=Te=>{K(re===Te?null:Te)};return N.useEffect(()=>{setTimeout(()=>{var Te,Oe,ge,He;f&&c&&((Oe=(Te=ae.current)==null?void 0:Te[f])!=null&&Oe[c])&&((He=(ge=ae.current[f])==null?void 0:ge[c])==null||He.scrollIntoView({behavior:"smooth",block:"center"}))},500)},[c]),wr.jsxs("div",{className:`hover-widget-container ${X?"expanded":"collapsed"}`,children:[wr.jsxs("div",{className:"widget-header",onClick:()=>Q(!X),children:[wr.jsx("h2",{className:"widget-title",children:"Points of Interest"}),wr.jsx(xp,{className:"expand-icon",style:{fontSize:"18px"}})]}),wr.jsxs(pb.div,{initial:!1,animate:{height:X?"auto":0,opacity:X?1:0},transition:{duration:.3,ease:"easeInOut"},style:{overflow:"auto"},children:[wr.jsxs("div",{className:"categories-container",children:[wr.jsx("div",{className:"development-item",children:wr.jsxs("div",{className:"poi-item",onClick:()=>{_(o),E(o.properties.Number)},children:[wr.jsx("span",{className:"poi-name",children:o.properties.Name}),wr.jsx(oU,{})]})}),wr.jsx(rU,{initial:!1,children:s.filter(Te=>Te.name==="DEVELOPMENT"?!1:i.some(ge=>ge.properties.Category===Te.name&&ge.properties.Number!==0)).map(Te=>wr.jsxs(pb.div,{className:"category-section",initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{opacity:{duration:.2},height:{duration:.3}},children:[wr.jsxs("div",{className:"category-header",onClick:()=>T(f===Te.name?null:Te.name),children:[wr.jsx("span",{children:I0(Te.name)}),wr.jsx("span",{className:"expand-icon",children:f===Te.name?wr.jsx(xp,{style:{fontSize:"12px"}}):wr.jsx(xp,{style:{fontSize:"12px",transform:"rotate(-90deg)"}})})]}),wr.jsx(pb.div,{initial:!1,animate:{height:f===Te.name?"auto":0,opacity:f===Te.name?1:0},transition:{duration:.3,ease:"easeInOut"},style:{overflow:"hidden"},children:wr.jsx("div",{className:"category-content",children:i.filter(Oe=>Oe.properties.Category===Te.name&&Oe.properties.Number!==0).map(Oe=>wr.jsxs("div",{className:"poi-container",children:[wr.jsxs("div",{className:"poi-item",onClick:()=>ne(Oe),ref:ge=>{var ze;const{Category:He,Number:Ke}=Oe.properties;((ze=ae.current)[He]??(ze[He]={}))[Ke]=ge},children:[wr.jsxs("span",{className:"poi-number",children:[Oe.properties.Number,"."]}),wr.jsx("span",{className:"poi-name",children:Oe.properties.Name})]}),c===Oe.properties.Number&&wr.jsxs("div",{className:"distance-info",children:[wr.jsx(aU,{}),wr.jsxs("span",{children:[Oe.distanceInMin," min"]}),wr.jsx(oS,{}),wr.jsxs("span",{children:[Oe.drivingDistanceInMin," min"]}),wr.jsx(sU,{}),wr.jsxs("span",{children:[Oe.busDistanceInMin," min"]})]})]},Oe.properties.Number))})})]},Te.name))})]}),wr.jsx("div",{className:"filters-container",children:wr.jsx(gy,{activeKey:re==="filters"?["filters"]:[],onChange:()=>Pe("filters"),children:wr.jsx(gy.Panel,{header:wr.jsxs("div",{className:"filter-header",children:[wr.jsxs("div",{className:"header-left",children:[wr.jsx("span",{children:"Filters"}),fe&&wr.jsx($T,{style:{backgroundColor:"#F5222D",color:"white",borderRadius:"20px",padding:"0 6px",fontWeight:600},count:i.filter(Te=>Te.properties.Number!==0).length})]}),wr.jsxs("div",{className:"header-right",children:[fe&&wr.jsx(wy,{type:"link",onClick:L,children:"Clear"}),wr.jsx(xp,{className:"expand-icon",style:{fontSize:"18px"}})]})]}),children:wr.jsx(nU,{})},"filters")})}),wr.jsx("div",{className:"sort-container",children:wr.jsx(gy,{activeKey:re==="sort"?["sort"]:[],onChange:()=>Pe("sort"),children:wr.jsx(gy.Panel,{header:wr.jsxs("div",{className:"sort-header",children:[wr.jsx("div",{className:"header-left",children:wr.jsx("span",{children:"Sort"})}),wr.jsxs("div",{className:"header-right",children:[Ie&&wr.jsx(wy,{type:"link",onClick:F,children:"Clear"}),wr.jsx(xp,{className:"expand-icon",style:{fontSize:"18px"}})]})]}),children:wr.jsx(iU,{})},"sort")})})]})]})},cU=({mapboxToken:i,mapboxStyleUrl:s,initialCenter:c,initialZoom:f,initialFeatures:_})=>wr.jsx(Z3,{initialFeatures:_,children:wr.jsxs("div",{className:"proxima-map-container",children:[wr.jsx("div",{className:"map-wrapper",children:wr.jsx(eD,{accessToken:i,styleUrl:s,center:c,zoom:f})}),wr.jsx(lU,{})]})}),uU=async(i,s,c,f)=>{var _,E;try{const T=await fetch("https://cms.proximahq.io/graphql",{method:"POST",headers:{"Content-Type":"application/json",authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiMDZiNDgwOWYtYWQyZS00MzE1LTkxMGItYWQ2ZDBlNDk4ZjQ1In0sImlhdCI6MTY4MDczMzMzM30.yxzZfDId5rR7jt7LLVWItSYbDOq8N5tT0juLC61dVUc"},body:JSON.stringify({query:i,variables:s,dataString:c,nestedString:f})});if(!T.ok)throw console.error(`HTTP error: ${T.status}: ${T.statusText}`),new Error(`HTTP error: ${T.status}: ${T.statusText}`);const A=await T.json();if(A.errors)throw new Error(`GraphQL error: ${c}: ${A.errors.map(L=>L.message).join(", ")}`);const o=f?(_=A.data)==null?void 0:_[c][f]:(E=A.data)==null?void 0:E[c];if(!o&&!A.data.hasOwnProperty(c))throw new Error(`${c} is missing`);return o}catch(T){throw T}},hU=async i=>await uU(`query MapboxInfo($slug: String!, $pageCategory: String) {
|
|
2393
2393
|
project(slug: $slug, pageCategory: $pageCategory) {
|
|
2394
2394
|
id
|
|
2395
2395
|
slug
|