@expofp/floorplan 3.0.1 → 3.0.2

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.
Files changed (74) hide show
  1. package/dist/browser/CookieConsent-CXdWbmhr.js +7810 -0
  2. package/dist/browser/Debug-DoJ9mct3.js +51 -0
  3. package/dist/browser/Demo-BEQponkS.js +65 -0
  4. package/dist/browser/Free-UAsV9h8C.js +65 -0
  5. package/dist/browser/Gallery-BgXxqVXz.js +3257 -0
  6. package/dist/browser/GpsLoader-CgbTy8Hz.js +152 -0
  7. package/dist/browser/KioskStore-YLbphfOD.js +212 -0
  8. package/dist/browser/Mapbox-DpLJ3tpl.js +120 -0
  9. package/dist/browser/SetKioskMode-CN5fJClI.js +49 -0
  10. package/dist/browser/ShowKiosk-vj5-CuR5.js +25 -0
  11. package/dist/browser/ThreeComponent-jLYP_yNl.js +1493 -0
  12. package/dist/browser/TouchHand-BbwYQQhu.js +66 -0
  13. package/dist/browser/ViewerMenuPanel-4kghKIxV.js +106 -0
  14. package/dist/browser/add-debug-secret-listener-DM6KcZ0J.js +26 -0
  15. package/dist/browser/boolean-editor-BrtABJXb.js +206 -0
  16. package/dist/browser/bundle.json +70 -40
  17. package/dist/browser/chunk-CG6jx9YN.js +28 -0
  18. package/dist/browser/classnames-DeFT1CBt.js +39 -0
  19. package/dist/browser/client-B6hKytWh.js +7601 -0
  20. package/dist/browser/data-BsqGAaoU.js +27969 -0
  21. package/dist/browser/debug-overlay-Cb6jZH1M.js +3995 -0
  22. package/dist/browser/debug-ui-XBqahA1W.js +86 -0
  23. package/dist/browser/dist-BcuX1Cs2.js +2581 -0
  24. package/dist/browser/favicon-Caa4UHOv.js +12 -0
  25. package/dist/browser/fetch-retry.umd-D6o13_3S.js +78 -0
  26. package/dist/browser/flex-glIwYu7S.js +1045 -0
  27. package/dist/browser/floorplan.ready-Dkfm7Nqq.js +1310 -0
  28. package/dist/browser/fuse-CrFUY0W8.js +887 -0
  29. package/dist/browser/index.js +10628 -12440
  30. package/dist/browser/jsx-runtime-P5gPgaNY.js +30 -0
  31. package/dist/browser/lib-BGCrbI0c.js +1859 -0
  32. package/dist/browser/main-B7nu_ayH.js +289 -0
  33. package/dist/browser/mobx-BwL1_Ioa.js +23 -0
  34. package/dist/browser/particles.min-r4ucWEQe.js +133 -0
  35. package/dist/browser/prop-types-_4KGi_BP.js +57 -0
  36. package/dist/browser/react-dom-BeKu02fc.js +139 -0
  37. package/dist/browser/reset-all-settings-CH3gzkuQ.js +17 -0
  38. package/dist/browser/settings-D1gM4Wtx.js +69 -0
  39. package/dist/browser/src--OC9EQnB.js +19 -0
  40. package/dist/browser/store-BpwlrbtP.js +36100 -0
  41. package/dist/browser/ui-Cy6VKwPB.js +33 -0
  42. package/dist/esm/components/Map/traffic/useBuildRoute.js +2 -2
  43. package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
  44. package/dist/esm/store/RootStore.js +1 -1
  45. package/package.json +4 -4
  46. package/dist/browser/Debug-b2YI2Uxo.js +0 -40
  47. package/dist/browser/Demo-aEKqZbJJ.js +0 -47
  48. package/dist/browser/Free-BGr4o53R.js +0 -51
  49. package/dist/browser/Gallery-C9n64fhu.js +0 -71
  50. package/dist/browser/GpsLoader-ChxBR2EI.js +0 -140
  51. package/dist/browser/KioskStore-DkCSeq5I.js +0 -225
  52. package/dist/browser/Mapbox-Cl0Wxz2h.js +0 -118
  53. package/dist/browser/SetKioskMode-D3EJeF9c.js +0 -249
  54. package/dist/browser/ShowKiosk-Bs5q-1RZ.js +0 -35
  55. package/dist/browser/ThreeComponent-CSsqNYDu.js +0 -1595
  56. package/dist/browser/ViewerMenuPanel-BMmB1p03.js +0 -77
  57. package/dist/browser/boolean-editor-DpnmndKH.js +0 -157
  58. package/dist/browser/client-CN_I7kK8.js +0 -10011
  59. package/dist/browser/data-CIAMSGsv.js +0 -22125
  60. package/dist/browser/debug-overlay-DjmA0D2r.js +0 -3675
  61. package/dist/browser/debug-ui-D1QGTN8V.js +0 -67
  62. package/dist/browser/favicon-BpTKNfwa.js +0 -13
  63. package/dist/browser/fetch-retry.umd-B8hV1FNr.js +0 -123
  64. package/dist/browser/flex-09atkOGP.js +0 -400
  65. package/dist/browser/floorplan.ready-BQetaqdP.js +0 -57653
  66. package/dist/browser/index-Bw6xZlSd.js +0 -161
  67. package/dist/browser/index-C71k7nSe.js +0 -3244
  68. package/dist/browser/index-CWLY6XdC.js +0 -92
  69. package/dist/browser/index-D9pdVw-U.js +0 -882
  70. package/dist/browser/index-DPSQIIUy.js +0 -57
  71. package/dist/browser/index-jp-Zhdyp.js +0 -54
  72. package/dist/browser/jsx-runtime-CoKhM3tL.js +0 -40
  73. package/dist/browser/main-DxaHLbma.js +0 -359
  74. package/dist/browser/particles.min-CsHbc6cO.js +0 -143
@@ -0,0 +1,33 @@
1
+ (function() {
2
+ try {
3
+ var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
4
+ e.SENTRY_RELEASE = { id: "3.0.2" };
5
+ var t = new e.Error().stack;
6
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "8cb645f3-81de-4ea6-8175-6fcb76e185a9", e._sentryDebugIdIdentifier = "sentry-dbid-8cb645f3-81de-4ea6-8175-6fcb76e185a9");
7
+ } catch {}
8
+ })();
9
+ import { r as e } from "./chunk-CG6jx9YN.js";
10
+ import { t } from "./jsx-runtime-P5gPgaNY.js";
11
+ import { t as n } from "./settings-D1gM4Wtx.js";
12
+ import { t as r } from "./add-debug-secret-listener-DM6KcZ0J.js";
13
+ //#region ../debug/src/lib/ui/render-debug-ui.tsx
14
+ var i = t(), a = !1;
15
+ function o() {
16
+ if (a) return;
17
+ a = !0;
18
+ let t = n("Show Debug Button Overlay"), o = async (n) => {
19
+ let { DebugUi: r } = await import("./debug-ui-XBqahA1W.js"), { createRoot: a } = await import("./client-B6hKytWh.js").then((t) => /* @__PURE__ */ e(t.default, 1)), o = document.createElement("div");
20
+ document.body.appendChild(o), a(o).render(/* @__PURE__ */ (0, i.jsx)(r, {
21
+ useDebugButtonState: t.useState,
22
+ open: n
23
+ }));
24
+ };
25
+ if (t.get()) o(!1);
26
+ else {
27
+ let e = r(() => {
28
+ e(), t.set(!0), o(!0);
29
+ });
30
+ }
31
+ }
32
+ //#endregion
33
+ export { o as renderDebugUi };
@@ -1,7 +1,7 @@
1
- import{useCallback as x,useEffect as M,useMemo as _,useRef as v}from"react";import{BUILD_ROUTE_DOTS as U,BUILD_ROUTE_LINES as $}from"./trafficLayers";import{createCircleCanvas as S,getBounds as I}from"../../../renderer/engine-core/canvases";import{UpdateQueue as A}from"./UpdateQueue";const E=49,C=`hsl(257, 76%, ${E}%)`,K=`hsl(339.903, 82%, ${E}%)`,T=`hsl(257, 76%, ${Math.round(E*1.82)}%)`,O=4,H=O,R="U",D="R",b="S",N="P";class Y{_state=[[]];index=0;pointHashSet=new Set;locked=!1;storageKey="expofp_build_route_state";_selected=0;get points(){return this._state[this.index]}set points(t){this._state.push(t),this.setIndex(),this.save()}setIndex(){this.index=Math.max(this._state.length-1,0)}genPointHash(t){return`${t.x},${t.y}`}add(t){const a=this.genPointHash(t);this.pointHashSet.has(a)||(this.pointHashSet.add(a),this.points=[...this.points,t])}undo(){this.index&&(this._state.pop(),this.setIndex(),this.save(),this.select(this.points.length-1))}execute(t){try{if(this.locked)return;this.locked=!0,t()}finally{requestAnimationFrame(()=>{this.locked=!1})}}log(t,a=12){console.log(`%c${t}`,`color: black; font-size: ${a}px; background: LemonChiffon;`)}instruct(){this.log(`How to Build a Route:
1
+ import{useCallback as x,useEffect as M,useMemo as _,useRef as P}from"react";import{BUILD_ROUTE_DOTS as U,BUILD_ROUTE_LINES as $}from"./trafficLayers";import{createCircleCanvas as I,getBounds as S}from"../../../renderer/engine-core/canvases";import{UpdateQueue as A}from"./UpdateQueue";const v=49,C=`hsl(257, 76%, ${v}%)`,K=`hsl(339.903, 82%, ${v}%)`,T=`hsl(257, 76%, ${Math.round(v*1.82)}%)`,O=4,H=O,R="U",D="R",b="S",N="P";class Y{_state=[[]];index=0;pointHashSet=new Set;locked=!1;storageKey="expofp_build_route_state";_selected=0;get points(){return this._state[this.index]}set points(t){this._state.push(t),this.setIndex(),this.save()}setIndex(){this.index=Math.max(this._state.length-1,0)}genPointHash(t){return`${t.x},${t.y}`}add(t){const a=this.genPointHash(t);this.pointHashSet.has(a)||(this.pointHashSet.add(a),this.points=[...this.points,t])}undo(){this.index&&(this._state.pop(),this.setIndex(),this.save(),this.select(this.points.length-1))}execute(t){try{if(this.locked)return;this.locked=!0,t()}finally{requestAnimationFrame(()=>{this.locked=!1})}}log(t,a=12){console.log(`%c${t}`,`color: black; font-size: ${a}px; background: LemonChiffon;`)}instruct(){this.log(`How to Build a Route:
2
2
  Add Point: Click on the map.
3
3
  Apply Smoothing: Press ${D}.
4
4
  Apply Simplification: Press ${b}.
5
5
  Undo: Press ${R}.
6
6
  Enable/Disable Preview: Press ${N}.
7
- `,16)}applyChaikinSmoothing(t,a,d){let c=[];if(d>=1&&t.length>=2){c=[t[0]];for(let h=1;h<t.length;h++){const s=t[h-1],u=t[h];for(let o=1;o<=d;o++){const n=o/(d+1);c.push({x:s.x+(u.x-s.x)*n,y:s.y+(u.y-s.y)*n})}c.push(u)}}else c=t.slice();for(let h=0;h<a&&!(c.length<2);h++){const s=[{...c[0]}];for(let u=1;u<c.length;u++){const o=c[u-1],n=c[u];s.push({x:.75*o.x+.25*n.x,y:.75*o.y+.25*n.y}),s.push({x:.25*o.x+.75*n.x,y:.25*o.y+.75*n.y})}s.push({...c[c.length-1]}),c=s}return c}applySmoothing(){this.points.length<3||(this.points=this.applyChaikinSmoothing(this.points,1,0),this.select(this.points.length-1))}save(){try{this.points.length?sessionStorage.setItem(this.storageKey,JSON.stringify(this.points)):sessionStorage.removeItem(this.storageKey)}catch(t){console.warn(t)}}restore(){try{const t=sessionStorage.getItem(this.storageKey);if(!t)return;const a=JSON.parse(t);if(!Array.isArray(a))return;a.forEach(d=>this.add(d)),this.select(this.points.length-1)}catch(t){console.warn(t)}}topologyPreservingSimplify(t,a){if(t.length<=2)return t.map(o=>({...o}));const d=(o,n,y)=>{const g=o.x,f=o.y,e=n.x,i=n.y,r=y.x,l=y.y,m=Math.abs((l-i)*g-(r-e)*f+r*i-l*e),p=Math.sqrt((l-i)**2+(r-e)**2);return m/(p||1e-10)},c=(o,n,y,g)=>{const f=(e,i,r)=>(r.y-e.y)*(i.x-e.x)-(i.y-e.y)*(r.x-e.x);return f(o,y,g)*f(n,y,g)<0&&f(y,o,n)*f(g,o,n)<0},h=new Array(t.length).fill(!1);h[0]=h[h.length-1]=!0;const s=[],u=(o,n)=>{if(n<=o+1)return;const y=t[o],g=t[n];let f=0,e=0;for(let i=o+1;i<n;i++){const r=d(t[i],y,g);r>f&&(f=r,e=i)}if(f>a){const i=t[e];let r=!0;for(let l=0;l<s.length-1;l++)if(c(s[l],s[l+1],y,i)||c(s[l],s[l+1],i,g)){r=!1;break}r&&(h[e]=!0,u(o,e),u(e,n))}};return u(0,t.length-1),t.filter((o,n)=>h[n])}applySimplification(){this.points=this.topologyPreservingSimplify(this.points,.5),this.select(this.points.length-1)}get selected(){return this._selected}select(t){this._selected=Math.max(0,Math.min(t,this.points.length-1))}}export function useBuildRoute({enabled:w,rendererService:t}){const a=v(!1),d=v(),c=_(()=>S(O,C),[]),h=_(()=>S(O,K),[]),s=_(()=>new Y,[]),u=v(new A),o=_(()=>{if(!t.scene)return{};const e=t.scene.rootLayer.children,i=e.find(l=>l.name===$),r=e.find(l=>l.name===U);return{linesLayer:i,pointsLayer:r}},[t.scene]),n=x(()=>{if(!t?.renderer||!o||!c||!h)return;const{linesLayer:e,pointsLayer:i}=o;if(!e||!i)return;const r=s.points,l=a.current;l?i.children.length=0:i.children=r.map(({x:p,y:L},k)=>{const P=k==s.selected?h:c;return{source:P,bounds:I(p,L,P.width,P.height,d.current)}});const m=[];for(let p=1;p<r.length;p++){const L=r[p-1],k=r[p];m.push({points:[L,k],color:l?C:T,width:H})}m.length?e.children=m:e.children.length=0,u.current.add(()=>t.update(i,e)),s.instruct(),s.log(JSON.stringify(s.points))},[t,s,o,c,h]),y=x(e=>{const i=e.key.toUpperCase();s.execute(()=>{switch(i){case R:e.preventDefault(),s.undo(),a.current=!1,n();break;case D:e.preventDefault(),s.applySmoothing(),a.current=!1,n();break;case b:e.preventDefault(),s.applySimplification(),a.current=!1,n();break;case N:e.preventDefault(),a.current=!a.current,n();break}})},[s,n]),g=x(e=>{if(!t?.renderer||!o)return;const{pointsLayer:i}=o;i&&(d.current=e,s.execute(()=>{const r=i.children,l=[];for(let m=0;m<r.length;m++){const p=r[m];p.bounds=I(p.bounds.center.x,p.bounds.center.y,p.source.width,p.source.height,d.current),l.push(p)}u.current.add(()=>t.update(...l))}))},[t,o,s]),f=x(e=>{s.execute(()=>{s.add({x:e.point.x,y:e.point.y}),s.select(s.points.length-1),n()})},[s,n]);M(()=>{const e=t.renderer;if(!(!w||!e))return d.current=t.getCameraState().ptScale||window.devicePixelRatio,s.execute(()=>{s.restore(),n()}),e.events.addEventListener("pointer:click",f),e.events.addEventListener("viewport:ptscale",g),window.addEventListener("keyup",y),()=>{window.removeEventListener("keyup",y),e.events.removeEventListener("pointer:click",f),e.events.removeEventListener("viewport:ptscale",g),u.current.destroy()}},[w,t,s,n,f,g,y])}
7
+ `,16)}applyChaikinSmoothing(t,a,d){let c=[];if(d>=1&&t.length>=2){c=[t[0]];for(let h=1;h<t.length;h++){const s=t[h-1],u=t[h];for(let o=1;o<=d;o++){const n=o/(d+1);c.push({x:s.x+(u.x-s.x)*n,y:s.y+(u.y-s.y)*n})}c.push(u)}}else c=t.slice();for(let h=0;h<a&&!(c.length<2);h++){const s=[{...c[0]}];for(let u=1;u<c.length;u++){const o=c[u-1],n=c[u];s.push({x:.75*o.x+.25*n.x,y:.75*o.y+.25*n.y}),s.push({x:.25*o.x+.75*n.x,y:.25*o.y+.75*n.y})}s.push({...c[c.length-1]}),c=s}return c}applySmoothing(){this.points.length<3||(this.points=this.applyChaikinSmoothing(this.points,1,0),this.select(this.points.length-1))}save(){try{this.points.length?sessionStorage.setItem(this.storageKey,JSON.stringify(this.points)):sessionStorage.removeItem(this.storageKey)}catch(t){console.warn(t)}}restore(){try{const t=sessionStorage.getItem(this.storageKey);if(!t)return;const a=JSON.parse(t);if(!Array.isArray(a))return;a.forEach(d=>this.add(d)),this.select(this.points.length-1)}catch(t){console.warn(t)}}topologyPreservingSimplify(t,a){if(t.length<=2)return t.map(o=>({...o}));const d=(o,n,y)=>{const g=o.x,f=o.y,e=n.x,i=n.y,r=y.x,l=y.y,m=Math.abs((l-i)*g-(r-e)*f+r*i-l*e),p=Math.sqrt((l-i)**2+(r-e)**2);return m/(p||1e-10)},c=(o,n,y,g)=>{const f=(e,i,r)=>(r.y-e.y)*(i.x-e.x)-(i.y-e.y)*(r.x-e.x);return f(o,y,g)*f(n,y,g)<0&&f(y,o,n)*f(g,o,n)<0},h=new Array(t.length).fill(!1);h[0]=h[h.length-1]=!0;const s=[],u=(o,n)=>{if(n<=o+1)return;const y=t[o],g=t[n];let f=0,e=0;for(let i=o+1;i<n;i++){const r=d(t[i],y,g);r>f&&(f=r,e=i)}if(f>a){const i=t[e];let r=!0;for(let l=0;l<s.length-1;l++)if(c(s[l],s[l+1],y,i)||c(s[l],s[l+1],i,g)){r=!1;break}r&&(h[e]=!0,u(o,e),u(e,n))}};return u(0,t.length-1),t.filter((o,n)=>h[n])}applySimplification(){this.points=this.topologyPreservingSimplify(this.points,.5),this.select(this.points.length-1)}get selected(){return this._selected}select(t){this._selected=Math.max(0,Math.min(t,this.points.length-1))}}export function useBuildRoute({enabled:L,rendererService:t}){const a=P(!1),d=P(),c=_(()=>I(O,C),[]),h=_(()=>I(O,K),[]),s=_(()=>new Y,[]),u=P(new A),o=_(()=>{if(!t.scene)return{};const e=t.scene.rootLayer.children,i=e.find(l=>l.name===$),r=e.find(l=>l.name===U);return{linesLayer:i,pointsLayer:r}},[t.scene]),n=x(()=>{if(!t?.renderer||!o||!c||!h)return;const{linesLayer:e,pointsLayer:i}=o;if(!e||!i)return;const r=s.points,l=a.current;l?i.children.length=0:i.children=r.map(({x:p,y:w},k)=>{const E=k==s.selected?h:c;return{source:E,bounds:S(p,w,E.width,E.height,d.current)}});const m=[];for(let p=1;p<r.length;p++){const w=r[p-1],k=r[p];m.push({points:[w,k],color:l?C:T,width:H})}m.length?e.children=m:e.children.length=0,u.current.add(()=>t.update(i,e)),s.instruct(),s.log(JSON.stringify(s.points))},[t,s,o,c,h]),y=x(e=>{const i=e.key.toUpperCase();s.execute(()=>{switch(i){case R:e.preventDefault(),s.undo(),a.current=!1,n();break;case D:e.preventDefault(),s.applySmoothing(),a.current=!1,n();break;case b:e.preventDefault(),s.applySimplification(),a.current=!1,n();break;case N:e.preventDefault(),a.current=!a.current,n();break}})},[s,n]),g=x(e=>{if(!t?.renderer||!o)return;const{pointsLayer:i}=o;i&&(d.current=e,s.execute(()=>{const r=i.children,l=[];for(let m=0;m<r.length;m++){const p=r[m];p.bounds=S(p.bounds.center.x,p.bounds.center.y,p.source.width,p.source.height,d.current),l.push(p)}u.current.add(()=>t.update(...l))}))},[t,o,s]),f=x(e=>{s.execute(()=>{s.add({x:e.point.x,y:e.point.y}),s.select(s.points.length-1),n()})},[s,n]);M(()=>{const e=t.renderer;if(!(!L||!e))return d.current=t.scale,s.execute(()=>{s.restore(),n()}),e.events.addEventListener("pointer:click",f),e.events.addEventListener("viewport:ptscale",g),window.addEventListener("keyup",y),()=>{window.removeEventListener("keyup",y),e.events.removeEventListener("pointer:click",f),e.events.removeEventListener("viewport:ptscale",g),u.current.destroy()}},[L,t,s,n,f,g,y])}
@@ -1 +1 @@
1
- import{useEffect as yt,useRef as L}from"react";import{getBounds as k}from"../../../renderer";import{getRouteLayerRegex as pt,getRouteStopLayerRegex as wt,TRAFFIC_VEHICLES as xt}from"./trafficLayers";import{loadImage as Et}from"../../../utils/loadImage";import{createImageCanvas as It}from"../drawing/config/canvases";import{UpdateQueue as Mt}from"./UpdateQueue";import Lt from"../../../tools/base-runtime-url";import{toRadians as bt}from"../../../utils/math";const tt=2,Rt=tt*3.5,G=tt*12,at=G*.7,Ft=8,At="transport_locations",Tt=150,et="#a4aab6",it=1e3,Pt=2e4,ut=500;export function useManageTraffic({permission:e,rendererService:n,dataJsonUrl:c,websocketUrl:a}){const t=L(window.devicePixelRatio),s=L(new Map),o=L(new Map),r=L(),d=L(),f=L(performance.now()),M=L(1),x=L(new Mt),A=L(new Map),I=L(),g=L(it),y=L(new Map),i=L();yt(()=>{async function O(){if(!(!e||!n.scene))try{let h;try{h=await(await fetch(c,{method:"GET",headers:{"Content-Type":"application/json"}})).json()}catch(u){console.warn("useManageTraffic failed to get JSON",u)}if(!h||h?.disabled||h?.error)return;t.current=lt(n.getCameraState().ptScale);const V=new Map(h.routes.map(({id:u,color:m})=>[u,m])),_=n.scene.rootLayer.children,W=new Map;V.forEach(u=>{W.set(u,Ct({radius:Rt,color:u,scale:window.devicePixelRatio}))});const z=pt(),Y=_.filter(u=>z.test(u.name)),B=wt(),U=_.filter(u=>B.test(u.name));h.routes.slice(0,Y.length).forEach(({id:u,color:m,path:T,stops:R,hiddenPoints:p},w)=>{A.current.set(u,T);const E=Y[w];if(E){const S=new Map(p?.map(l=>[ot(l),l])??[]);for(let l=1;l<T.length;l++){const D=T[l-1],H=T[l];S.has(ot(D))||S.has(ot(H))||E.children.push({points:[D,H],color:m,width:tt})}E.children.length&&x.current.add(()=>n.update(E))}const N=U[w];if(N&&R?.length){const S=W.get(m);R.forEach(l=>{N.children.push({source:S,bounds:k(l.x,l.y,S.width,S.height,t.current)})}),N.children.length&&x.current.add(()=>n.update(N))}});const $=_.find(u=>u.name===xt),X=new Map;I.current=u=>{try{t.current=lt(u);const m=[];for(let R=0;R<U.length;R++){const p=U[R].children;for(let w=0;w<p.length;w++){const E=p[w];E.bounds=k(E.bounds.center.x,E.bounds.center.y,E.source.width,E.source.height,t.current,E.bounds.rotation),m.push(E)}}const T=[...s.current.values()];for(let R=0;R<T.length;R++){const p=T[R];p.bounds=k(p.bounds.center.x,p.bounds.center.y,p.source.width,p.source.height,t.current,p.bounds.rotation)}x.current.add(()=>n.update(...m,...T))}catch(m){console.error("ptscale",m)}},n.renderer.events.addEventListener("viewport:ptscale",I.current),V.forEach((u,m)=>{X.set(m,ht({id:m,width:G,height:G,color:u,scale:window.devicePixelRatio}))}),X.set(et,ht({id:"orphan",width:G,height:G,color:et,scale:window.devicePixelRatio}));let j=null;try{const u=await Et(`${Lt}icons/bus-white.svg`);j=It(u,at,at,window.devicePixelRatio)}catch(u){console.error(u)}d.current=u=>{try{const m=JSON.parse(u.data);if(m.type!==At)return;const T=u.timeStamp||performance.now();M.current=Math.round(T-f.current),f.current=T;const R=Math.max(M.current??ut,ut),p=o.current,w=s.current,E=$.children,N=x.current;let S=!1;m.data.forEach(({id:l,x:D,y:H,route_id:ct,hidden:gt})=>{if(p.has(l)&&(p.get(l)?.(),p.delete(l)),gt&&w.has(l)&&w.has(Q(l))){const P=w.get(l);P.hidden=!0;const F=w.get(Q(l));F.hidden=!0,N.add(()=>n.update(P,F));return}if(y.current.set(l,performance.now()),!w.has(l)){const P=X.get(ct)||X.get(et),F={id:l,source:P,bounds:k(D,H,P.width,P.height,t.current,0)};if(w.set(l,F),j){const q=Q(l),rt={id:q,source:j,bounds:k(D,H,j.width,j.height,t.current,0)};j.setAttribute("id",q),w.set(q,rt),E.push(F,rt)}else E.push(F);S=!0;return}const Z=w.get(l),st=w.get(Q(l)),mt=Z.bounds.center,K=Nt(mt,{x:D,y:H},A.current.get(ct));if(K.reduce((P,F,q)=>q===0?P:P+nt(K[q-1],F),0)>=Tt||document.hidden)dt({rendererService:n,updateQueue:N,vehicle:Z,vehicleFinery:st,x:D,y:H,scale:t.current,angle:vt(Z.bounds.center,{x:D,y:H})});else{const P=St(K,R,F=>{dt({rendererService:n,updateQueue:N,vehicle:Z,vehicleFinery:st,x:F.x,y:F.y,scale:t.current,angle:F.angle})});p.set(l,P)}}),S&&N.add(()=>n.update($))}catch(m){console.error("handleSocketMessage",m)}},v(),C(h.config?(Number(h.config.vehicle_inactive_interval)||20)*1e3:Pt)}catch(h){console.warn(h)}}O();function v(){r.current?.readyState===WebSocket.OPEN||r.current?.readyState===WebSocket.CONNECTING||(r.current=new WebSocket(a),r.current.onmessage=d.current,r.current.onopen=()=>{g.current=it},r.current.onclose=()=>{if(!navigator.onLine)return;setTimeout(v,g.current);const h=3e4;g.current=Math.min(g.current*2,h)})}function b(){v()}window.addEventListener("online",b);function C(h){clearInterval(i.current),i.current=window.setInterval(()=>{const V=performance.now(),_=[],W=[];y.current.forEach((z,Y)=>{if(V-z<h)return;const B=s.current.get(Y);B&&(B.hidden=!0,W.push(B),_.push(Y));const U=Q(Y),$=s.current.get(U);$&&($.hidden=!0,W.push($),_.push(U))}),W.length&&x.current.add(()=>n.update(...W)),_.forEach(z=>y.current.delete(z))},h)}return()=>{I.current&&n.renderer&&n.renderer.events.removeEventListener("viewport:ptscale",I.current),o.current.forEach(h=>h?.()),o.current.clear(),s.current.clear(),x.current.destroy(),window.removeEventListener("online",b),clearInterval(i.current)}},[e,n,c,a])}function lt(e){return Math.min(e||window.devicePixelRatio,Ft)}function vt(e,n){return Math.atan2(n.y-e.y,n.x-e.x)}function Ct({radius:e,scale:n,color:c}){const a=document.createElement("canvas"),t=a.getContext("2d");t.imageSmoothingEnabled=!1;const s=Math.ceil(e*2*n),o=s/2,r=e*.78,d=e*.33;return a.width=s,a.height=s,t.translate(o,o),t.scale(n,n),t.beginPath(),t.arc(0,0,e,0,2*Math.PI),t.fillStyle="#FFFFFF",t.fill(),t.beginPath(),t.arc(0,0,r,0,2*Math.PI),t.fillStyle=c,t.fill(),t.beginPath(),t.arc(0,0,d,0,2*Math.PI),t.fillStyle="#FFFFFF",t.fill(),a}function ht({id:e,width:n,height:c,color:a,scale:t}){const s=2*t,o=n/2*t,r=c*t,d=.6,f=.01,M=r*d,x=r,A=8*t,I=x+s+M/2+A*2,g=o*2+M+s+A*2,y=document.createElement("canvas");y.setAttribute("id",e),y.width=I,y.height=g;const i=y.getContext("2d"),O=I/2,v=g/2;i.save(),i.translate(O,v),i.rotate(-Math.PI/2),i.translate(-O,-v);const b=O,C=v-x/2+o,h=C+M;return i.shadowColor="rgba(16, 24, 40, 0.2)",i.shadowBlur=A/2,i.beginPath(),i.arc(b,C,o,Math.PI,0,!1),i.bezierCurveTo(b+o,C+r*.3,b+f*o,h,b,h),i.bezierCurveTo(b-f*o,h,b-o,C+r*.3,b-o,C),i.closePath(),i.fillStyle=a,i.fill(),i.strokeStyle="#FFFFFF",i.lineWidth=s,i.stroke(),i.restore(),y}function nt(e,n){return Math.hypot(e.x-n.x,e.y-n.y)}function Q(e){return`${e}_finery`}function dt({rendererService:e,updateQueue:n,vehicle:c,vehicleFinery:a,x:t,y:s,scale:o,angle:r}){if(c.bounds=k(t,s,c.source.width,c.source.height,o,r),c.hidden=!1,a){const d=e.getCameraState();a.bounds=k(t,s,a.source.width,a.source.height,o,bt(d.roll||0)),a.hidden=!1,n.add(()=>e.update(a,c))}else n.add(()=>e.update(c))}function J(e,n,c){return{x:e.x+(n.x-e.x)*c,y:e.y+(n.y-e.y)*c}}function ft(e,n){let c=1/0,a={index:0,t:0};for(let t=0;t<n.length-1;t++){const s=n[t],o=n[t+1],r=o.x-s.x,d=o.y-s.y,f=r*r+d*d,M=f?((e.x-s.x)*r+(e.y-s.y)*d)/f:0,x=Math.max(0,Math.min(1,M)),A=J(s,o,x),I=nt(e,A);I<c&&(c=I,a={index:t,t:x})}return a}function _t(e,n,c){const a=nt(e,n),t=Math.max(2,Math.ceil(a/c)+1),s=[];for(let o=0;o<t;o++){const r=o/(t-1),d=J(e,n,r);s.push({x:d.x,y:d.y})}return s}function Nt(e,n,c){if(!c||!c.length)return _t(e,n,10);const a=ft(e,c),t=ft(n,c),s=[],o=r=>s.push({x:r.x,y:r.y});a.index+1<c.length?o(J(c[a.index],c[a.index+1],a.t)):o(c[a.index]);for(let r=a.index+1;r<=t.index&&r<c.length;r++)o(c[r]);return t.index+1<c.length?o(J(c[t.index],c[t.index+1],t.t)):o(c[t.index]),s}function St(e,n,c,a){if(e.length<2)return()=>{};let t=null,s;const o=[];let r=0;for(let f=0;f<e.length-1;f++){const M=Math.hypot(e[f+1].x-e[f].x,e[f+1].y-e[f].y);o.push(M),r+=M}const d=f=>{t||(t=f);const M=f-t,x=Math.min(M/n,1),A=x*r;let I=0,g=0;for(;g<o.length&&I+o[g]<A;)I+=o[g],g++;g>=o.length&&(g=o.length-1);const y=e[g],i=e[Math.min(g+1,e.length-1)],O=o[g]||0,v=O===0?0:(A-I)/O,b=y.x+(i.x-y.x)*v,C=y.y+(i.y-y.y)*v,h=i.x-y.x,V=i.y-y.y,_=h===0&&V===0?0:Math.atan2(V,h);c({x:b,y:C,angle:_}),x<1?s=requestAnimationFrame(d):a&&a()};return s=requestAnimationFrame(d),()=>{s&&cancelAnimationFrame(s)}}function ot(e){return`${e.x},${e.y}`}
1
+ import{useEffect as yt,useRef as L}from"react";import{getBounds as k}from"../../../renderer";import{getRouteLayerRegex as pt,getRouteStopLayerRegex as wt,TRAFFIC_VEHICLES as xt}from"./trafficLayers";import{loadImage as Et}from"../../../utils/loadImage";import{createImageCanvas as It}from"../drawing/config/canvases";import{UpdateQueue as Mt}from"./UpdateQueue";import Lt from"../../../tools/base-runtime-url";import{toRadians as bt}from"../../../utils/math";const tt=2,Rt=tt*3.5,G=tt*12,it=G*.7,Ft=8,At="transport_locations",Tt=150,et="#a4aab6",at=1e3,Pt=2e4,ut=500;export function useManageTraffic({permission:e,rendererService:n,dataJsonUrl:c,websocketUrl:i}){const t=L(window.devicePixelRatio),s=L(new Map),o=L(new Map),r=L(),m=L(),d=L(performance.now()),M=L(1),x=L(new Mt),A=L(new Map),I=L(),f=L(at),y=L(new Map),a=L();yt(()=>{async function O(){if(!(!e||!n.scene))try{let h;try{h=await(await fetch(c,{method:"GET",headers:{"Content-Type":"application/json"}})).json()}catch(u){console.warn("useManageTraffic failed to get JSON",u)}if(!h||h?.disabled||h?.error)return;t.current=lt(n.scale);const V=new Map(h.routes.map(({id:u,color:g})=>[u,g])),C=n.scene.rootLayer.children,W=new Map;V.forEach(u=>{W.set(u,_t({radius:Rt,color:u,scale:window.devicePixelRatio}))});const z=pt(),Y=C.filter(u=>z.test(u.name)),B=wt(),U=C.filter(u=>B.test(u.name));h.routes.slice(0,Y.length).forEach(({id:u,color:g,path:T,stops:R,hiddenPoints:p},w)=>{A.current.set(u,T);const E=Y[w];if(E){const S=new Map(p?.map(l=>[ot(l),l])??[]);for(let l=1;l<T.length;l++){const D=T[l-1],H=T[l];S.has(ot(D))||S.has(ot(H))||E.children.push({points:[D,H],color:g,width:tt})}E.children.length&&x.current.add(()=>n.update(E))}const N=U[w];if(N&&R?.length){const S=W.get(g);R.forEach(l=>{N.children.push({source:S,bounds:k(l.x,l.y,S.width,S.height,t.current)})}),N.children.length&&x.current.add(()=>n.update(N))}});const $=C.find(u=>u.name===xt),X=new Map;I.current=u=>{try{t.current=lt(u);const g=[];for(let R=0;R<U.length;R++){const p=U[R].children;for(let w=0;w<p.length;w++){const E=p[w];E.bounds=k(E.bounds.center.x,E.bounds.center.y,E.source.width,E.source.height,t.current,E.bounds.rotation),g.push(E)}}const T=[...s.current.values()];for(let R=0;R<T.length;R++){const p=T[R];p.bounds=k(p.bounds.center.x,p.bounds.center.y,p.source.width,p.source.height,t.current,p.bounds.rotation)}x.current.add(()=>n.update(...g,...T))}catch(g){console.error("ptscale",g)}},n.renderer.events.addEventListener("viewport:ptscale",I.current),V.forEach((u,g)=>{X.set(g,ht({id:g,width:G,height:G,color:u,scale:window.devicePixelRatio}))}),X.set(et,ht({id:"orphan",width:G,height:G,color:et,scale:window.devicePixelRatio}));let j=null;try{const u=await Et(`${Lt}icons/bus-white.svg`);j=It(u,it,it,window.devicePixelRatio)}catch(u){console.error(u)}m.current=u=>{try{const g=JSON.parse(u.data);if(g.type!==At)return;const T=u.timeStamp||performance.now();M.current=Math.round(T-d.current),d.current=T;const R=Math.max(M.current??ut,ut),p=o.current,w=s.current,E=$.children,N=x.current;let S=!1;g.data.forEach(({id:l,x:D,y:H,route_id:ct,hidden:gt})=>{if(p.has(l)&&(p.get(l)?.(),p.delete(l)),gt&&w.has(l)&&w.has(Q(l))){const P=w.get(l);P.hidden=!0;const F=w.get(Q(l));F.hidden=!0,N.add(()=>n.update(P,F));return}if(y.current.set(l,performance.now()),!w.has(l)){const P=X.get(ct)||X.get(et),F={id:l,source:P,bounds:k(D,H,P.width,P.height,t.current,0)};if(w.set(l,F),j){const q=Q(l),rt={id:q,source:j,bounds:k(D,H,j.width,j.height,t.current,0)};j.setAttribute("id",q),w.set(q,rt),E.push(F,rt)}else E.push(F);S=!0;return}const Z=w.get(l),st=w.get(Q(l)),mt=Z.bounds.center,K=Nt(mt,{x:D,y:H},A.current.get(ct));if(K.reduce((P,F,q)=>q===0?P:P+nt(K[q-1],F),0)>=Tt||document.hidden)dt({rendererService:n,updateQueue:N,vehicle:Z,vehicleFinery:st,x:D,y:H,scale:t.current,angle:vt(Z.bounds.center,{x:D,y:H})});else{const P=St(K,R,F=>{dt({rendererService:n,updateQueue:N,vehicle:Z,vehicleFinery:st,x:F.x,y:F.y,scale:t.current,angle:F.angle})});p.set(l,P)}}),S&&N.add(()=>n.update($))}catch(g){console.error("handleSocketMessage",g)}},v(),_(h.config?(Number(h.config.vehicle_inactive_interval)||20)*1e3:Pt)}catch(h){console.warn(h)}}O();function v(){r.current?.readyState===WebSocket.OPEN||r.current?.readyState===WebSocket.CONNECTING||(r.current=new WebSocket(i),r.current.onmessage=m.current,r.current.onopen=()=>{f.current=at},r.current.onclose=()=>{if(!navigator.onLine)return;setTimeout(v,f.current);const h=3e4;f.current=Math.min(f.current*2,h)})}function b(){v()}window.addEventListener("online",b);function _(h){clearInterval(a.current),a.current=window.setInterval(()=>{const V=performance.now(),C=[],W=[];y.current.forEach((z,Y)=>{if(V-z<h)return;const B=s.current.get(Y);B&&(B.hidden=!0,W.push(B),C.push(Y));const U=Q(Y),$=s.current.get(U);$&&($.hidden=!0,W.push($),C.push(U))}),W.length&&x.current.add(()=>n.update(...W)),C.forEach(z=>y.current.delete(z))},h)}return()=>{I.current&&n.renderer&&n.renderer.events.removeEventListener("viewport:ptscale",I.current),o.current.forEach(h=>h?.()),o.current.clear(),s.current.clear(),x.current.destroy(),window.removeEventListener("online",b),clearInterval(a.current)}},[e,n,c,i])}function lt(e){return Math.min(e||window.devicePixelRatio,Ft)}function vt(e,n){return Math.atan2(n.y-e.y,n.x-e.x)}function _t({radius:e,scale:n,color:c}){const i=document.createElement("canvas"),t=i.getContext("2d");t.imageSmoothingEnabled=!1;const s=Math.ceil(e*2*n),o=s/2,r=e*.78,m=e*.33;return i.width=s,i.height=s,t.translate(o,o),t.scale(n,n),t.beginPath(),t.arc(0,0,e,0,2*Math.PI),t.fillStyle="#FFFFFF",t.fill(),t.beginPath(),t.arc(0,0,r,0,2*Math.PI),t.fillStyle=c,t.fill(),t.beginPath(),t.arc(0,0,m,0,2*Math.PI),t.fillStyle="#FFFFFF",t.fill(),i}function ht({id:e,width:n,height:c,color:i,scale:t}){const s=2*t,o=n/2*t,r=c*t,m=.6,d=.01,M=r*m,x=r,A=8*t,I=x+s+M/2+A*2,f=o*2+M+s+A*2,y=document.createElement("canvas");y.setAttribute("id",e),y.width=I,y.height=f;const a=y.getContext("2d"),O=I/2,v=f/2;a.save(),a.translate(O,v),a.rotate(-Math.PI/2),a.translate(-O,-v);const b=O,_=v-x/2+o,h=_+M;return a.shadowColor="rgba(16, 24, 40, 0.2)",a.shadowBlur=A/2,a.beginPath(),a.arc(b,_,o,Math.PI,0,!1),a.bezierCurveTo(b+o,_+r*.3,b+d*o,h,b,h),a.bezierCurveTo(b-d*o,h,b-o,_+r*.3,b-o,_),a.closePath(),a.fillStyle=i,a.fill(),a.strokeStyle="#FFFFFF",a.lineWidth=s,a.stroke(),a.restore(),y}function nt(e,n){return Math.hypot(e.x-n.x,e.y-n.y)}function Q(e){return`${e}_finery`}function dt({rendererService:e,updateQueue:n,vehicle:c,vehicleFinery:i,x:t,y:s,scale:o,angle:r}){c.bounds=k(t,s,c.source.width,c.source.height,o,r),c.hidden=!1,i?(i.bounds=k(t,s,i.source.width,i.source.height,o,bt(e.angle)),i.hidden=!1,n.add(()=>e.update(i,c))):n.add(()=>e.update(c))}function J(e,n,c){return{x:e.x+(n.x-e.x)*c,y:e.y+(n.y-e.y)*c}}function ft(e,n){let c=1/0,i={index:0,t:0};for(let t=0;t<n.length-1;t++){const s=n[t],o=n[t+1],r=o.x-s.x,m=o.y-s.y,d=r*r+m*m,M=d?((e.x-s.x)*r+(e.y-s.y)*m)/d:0,x=Math.max(0,Math.min(1,M)),A=J(s,o,x),I=nt(e,A);I<c&&(c=I,i={index:t,t:x})}return i}function Ct(e,n,c){const i=nt(e,n),t=Math.max(2,Math.ceil(i/c)+1),s=[];for(let o=0;o<t;o++){const r=o/(t-1),m=J(e,n,r);s.push({x:m.x,y:m.y})}return s}function Nt(e,n,c){if(!c||!c.length)return Ct(e,n,10);const i=ft(e,c),t=ft(n,c),s=[],o=r=>s.push({x:r.x,y:r.y});i.index+1<c.length?o(J(c[i.index],c[i.index+1],i.t)):o(c[i.index]);for(let r=i.index+1;r<=t.index&&r<c.length;r++)o(c[r]);return t.index+1<c.length?o(J(c[t.index],c[t.index+1],t.t)):o(c[t.index]),s}function St(e,n,c,i){if(e.length<2)return()=>{};let t=null,s;const o=[];let r=0;for(let d=0;d<e.length-1;d++){const M=Math.hypot(e[d+1].x-e[d].x,e[d+1].y-e[d].y);o.push(M),r+=M}const m=d=>{t||(t=d);const M=d-t,x=Math.min(M/n,1),A=x*r;let I=0,f=0;for(;f<o.length&&I+o[f]<A;)I+=o[f],f++;f>=o.length&&(f=o.length-1);const y=e[f],a=e[Math.min(f+1,e.length-1)],O=o[f]||0,v=O===0?0:(A-I)/O,b=y.x+(a.x-y.x)*v,_=y.y+(a.y-y.y)*v,h=a.x-y.x,V=a.y-y.y,C=h===0&&V===0?0:Math.atan2(V,h);c({x:b,y:_,angle:C}),x<1?s=requestAnimationFrame(m):i&&i()};return s=requestAnimationFrame(m),()=>{s&&cancelAnimationFrame(s)}}function ot(e){return`${e.x},${e.y}`}
@@ -1 +1 @@
1
- import{__esDecorate as i,__runInitializers as n}from"tslib";import{action as a,observable as se,computed as he,runInAction as ae}from"mobx";import ne from"../tools/logger";import{isWebGlSupported as ce}from"../utils";import ue,{BoothBase as oe,RegularBooth as de}from"./BoothStore";import me,{Category as Se}from"./CategoryStore";import fe,{Exhibitor as le}from"./ExhibitorStore";import pe from"./CategoryFilterStore";import ge from"./EventStore";import{GaEventActions as ke}from"../tools/gtag";import r from"../utils/is-mobile";import c from"../utils/is-webview";import ve from"./HeatmapStore";import{resetLocale as ye}from"../utils/i18n";import{LANGUAGE_TYPE as _e}from"../constants";import be,{LayersMode as re}from"./LayerStore";import we from"./MapboxStore";import xe from"./RouteStore";import Be from"./RoutePlannerStore";import Le from"./ToursStore";import Ce from"./UIState";import Ee from"./PoiTypeStore";import{sanitizeSearch as Fe}from"../utils/sanitizeText";import Te from"./FuzzySearchEngineStore";import Ie from"./SessionsFilterStore";import ze from"./SearchStore";import Me from"./SearchButtonsStore";import Oe from"./BookmarksStore";import{URLFilterManager as Ae}from"../services/URLFilterManager";import{ShortcutRegistry as Re}from"./ShortcutRegistry";import{SessionsShortcutProvider as Pe}from"./providers/SessionsShortcutProvider";import Ve from"./SpeakerStore";import Ge from"./SpeakerFilterStore";import{SpeakerShortcutProvider as Ne}from"./providers/SpeakerShortcutProvider";import{SearchShortcutProvider as qe}from"./providers/SearchShortcutProvider";import{RendererService as je}from"../renderer";let Ue=(()=>{let s=[],u,d=[],m=[],S,f=[],p=[],g,k,v,y,_,b,w,x,B,L,C,E,F,T,I,z,M,O,A,R,P,V,G,N,q,j,U,W,D,H,K,Y,$,J,Q,X,Z,ee,te,ie;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;u=[se],S=[se],g=[a],k=[a],v=[a],y=[a],_=[a],b=[a],w=[a],x=[a],B=[a],L=[a],C=[a],E=[a],F=[a],T=[a],I=[a],z=[a],M=[a],O=[a],A=[a],R=[a],P=[a],V=[a],G=[a],N=[a],q=[a],j=[a],U=[a],W=[a],D=[a],H=[a],K=[a],Y=[a],$=[a],J=[he],Q=[a],X=[a],Z=[a],ee=[a],te=[a],ie=[a],i(this,null,g,{kind:"method",name:"setResetCameraFn",static:!1,private:!1,access:{has:e=>"setResetCameraFn"in e,get:e=>e.setResetCameraFn},metadata:t},null,s),i(this,null,k,{kind:"method",name:"selectExhibitor",static:!1,private:!1,access:{has:e=>"selectExhibitor"in e,get:e=>e.selectExhibitor},metadata:t},null,s),i(this,null,v,{kind:"method",name:"selectBooth",static:!1,private:!1,access:{has:e=>"selectBooth"in e,get:e=>e.selectBooth},metadata:t},null,s),i(this,null,y,{kind:"method",name:"reset",static:!1,private:!1,access:{has:e=>"reset"in e,get:e=>e.reset},metadata:t},null,s),i(this,null,_,{kind:"method",name:"selectNone",static:!1,private:!1,access:{has:e=>"selectNone"in e,get:e=>e.selectNone},metadata:t},null,s),i(this,null,b,{kind:"method",name:"selectBookmarks",static:!1,private:!1,access:{has:e=>"selectBookmarks"in e,get:e=>e.selectBookmarks},metadata:t},null,s),i(this,null,w,{kind:"method",name:"selectVisited",static:!1,private:!1,access:{has:e=>"selectVisited"in e,get:e=>e.selectVisited},metadata:t},null,s),i(this,null,x,{kind:"method",name:"selectLanguage",static:!1,private:!1,access:{has:e=>"selectLanguage"in e,get:e=>e.selectLanguage},metadata:t},null,s),i(this,null,B,{kind:"method",name:"selectCategory",static:!1,private:!1,access:{has:e=>"selectCategory"in e,get:e=>e.selectCategory},metadata:t},null,s),i(this,null,L,{kind:"method",name:"selectEventItem",static:!1,private:!1,access:{has:e=>"selectEventItem"in e,get:e=>e.selectEventItem},metadata:t},null,s),i(this,null,C,{kind:"method",name:"selectSearch",static:!1,private:!1,access:{has:e=>"selectSearch"in e,get:e=>e.selectSearch},metadata:t},null,s),i(this,null,E,{kind:"method",name:"clickBookmarks",static:!1,private:!1,access:{has:e=>"clickBookmarks"in e,get:e=>e.clickBookmarks},metadata:t},null,s),i(this,null,F,{kind:"method",name:"clickVisited",static:!1,private:!1,access:{has:e=>"clickVisited"in e,get:e=>e.clickVisited},metadata:t},null,s),i(this,null,T,{kind:"method",name:"clickLanguage",static:!1,private:!1,access:{has:e=>"clickLanguage"in e,get:e=>e.clickLanguage},metadata:t},null,s),i(this,null,I,{kind:"method",name:"clickCategory",static:!1,private:!1,access:{has:e=>"clickCategory"in e,get:e=>e.clickCategory},metadata:t},null,s),i(this,null,z,{kind:"method",name:"clickSeminars",static:!1,private:!1,access:{has:e=>"clickSeminars"in e,get:e=>e.clickSeminars},metadata:t},null,s),i(this,null,M,{kind:"method",name:"clickBoothInList",static:!1,private:!1,access:{has:e=>"clickBoothInList"in e,get:e=>e.clickBoothInList},metadata:t},null,s),i(this,null,O,{kind:"method",name:"clickBoothInList2",static:!1,private:!1,access:{has:e=>"clickBoothInList2"in e,get:e=>e.clickBoothInList2},metadata:t},null,s),i(this,null,A,{kind:"method",name:"clickBooth",static:!1,private:!1,access:{has:e=>"clickBooth"in e,get:e=>e.clickBooth},metadata:t},null,s),i(this,null,R,{kind:"method",name:"clickExhibitor2",static:!1,private:!1,access:{has:e=>"clickExhibitor2"in e,get:e=>e.clickExhibitor2},metadata:t},null,s),i(this,null,P,{kind:"method",name:"clickExhibitor",static:!1,private:!1,access:{has:e=>"clickExhibitor"in e,get:e=>e.clickExhibitor},metadata:t},null,s),i(this,null,V,{kind:"method",name:"showMap",static:!1,private:!1,access:{has:e=>"showMap"in e,get:e=>e.showMap},metadata:t},null,s),i(this,null,G,{kind:"method",name:"showOverlay",static:!1,private:!1,access:{has:e=>"showOverlay"in e,get:e=>e.showOverlay},metadata:t},null,s),i(this,null,N,{kind:"method",name:"toggleMapOverlay",static:!1,private:!1,access:{has:e=>"toggleMapOverlay"in e,get:e=>e.toggleMapOverlay},metadata:t},null,s),i(this,null,q,{kind:"method",name:"moveToList",static:!1,private:!1,access:{has:e=>"moveToList"in e,get:e=>e.moveToList},metadata:t},null,s),i(this,null,j,{kind:"method",name:"moveToExhibitor",static:!1,private:!1,access:{has:e=>"moveToExhibitor"in e,get:e=>e.moveToExhibitor},metadata:t},null,s),i(this,null,U,{kind:"method",name:"changeActiveListIndex",static:!1,private:!1,access:{has:e=>"changeActiveListIndex"in e,get:e=>e.changeActiveListIndex},metadata:t},null,s),i(this,null,W,{kind:"method",name:"toggleModal",static:!1,private:!1,access:{has:e=>"toggleModal"in e,get:e=>e.toggleModal},metadata:t},null,s),i(this,null,D,{kind:"method",name:"openGallery",static:!1,private:!1,access:{has:e=>"openGallery"in e,get:e=>e.openGallery},metadata:t},null,s),i(this,null,H,{kind:"method",name:"closeGallery",static:!1,private:!1,access:{has:e=>"closeGallery"in e,get:e=>e.closeGallery},metadata:t},null,s),i(this,null,K,{kind:"method",name:"openActiveListItem",static:!1,private:!1,access:{has:e=>"openActiveListItem"in e,get:e=>e.openActiveListItem},metadata:t},null,s),i(this,null,Y,{kind:"method",name:"toggleCategoryFilter",static:!1,private:!1,access:{has:e=>"toggleCategoryFilter"in e,get:e=>e.toggleCategoryFilter},metadata:t},null,s),i(this,null,$,{kind:"method",name:"applyCategoryFilters",static:!1,private:!1,access:{has:e=>"applyCategoryFilters"in e,get:e=>e.applyCategoryFilters},metadata:t},null,s),i(this,null,J,{kind:"getter",name:"filteredExhibitors",static:!1,private:!1,access:{has:e=>"filteredExhibitors"in e,get:e=>e.filteredExhibitors},metadata:t},null,s),i(this,null,Q,{kind:"method",name:"selectSessions",static:!1,private:!1,access:{has:e=>"selectSessions"in e,get:e=>e.selectSessions},metadata:t},null,s),i(this,null,X,{kind:"method",name:"selectExhibitors",static:!1,private:!1,access:{has:e=>"selectExhibitors"in e,get:e=>e.selectExhibitors},metadata:t},null,s),i(this,null,Z,{kind:"method",name:"selectTours",static:!1,private:!1,access:{has:e=>"selectTours"in e,get:e=>e.selectTours},metadata:t},null,s),i(this,null,ee,{kind:"method",name:"selectSpeakers",static:!1,private:!1,access:{has:e=>"selectSpeakers"in e,get:e=>e.selectSpeakers},metadata:t},null,s),i(this,null,te,{kind:"method",name:"selectSpeaker",static:!1,private:!1,access:{has:e=>"selectSpeaker"in e,get:e=>e.selectSpeaker},metadata:t},null,s),i(this,null,ie,{kind:"method",name:"resetFilters",static:!1,private:!1,access:{has:e=>"resetFilters"in e,get:e=>e.resetFilters},metadata:t},null,s),i(null,null,u,{kind:"field",name:"initialized",static:!1,private:!1,access:{has:e=>"initialized"in e,get:e=>e.initialized,set:(e,o)=>{e.initialized=o}},metadata:t},d,m),i(null,null,S,{kind:"field",name:"resetCameraFn",static:!1,private:!1,access:{has:e=>"resetCameraFn"in e,get:e=>e.resetCameraFn,set:(e,o)=>{e.resetCameraFn=o}},metadata:t},f,p),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}categoryStore=n(this,s);exhibitorStore;boothStore;uiState;routeStore;routePlannerStore;toursStore;mapboxStore;layerStore;eventStore;poiTypeStore;heatmapStore;fuzzySearchEngineStore;categoryFilterStore;sessionsFilterStore;speakerStore;speakerFilterStore;searchStore;searchButtonsStore;bookmarksStore;urlFilterManager;shortcutRegistry;rendererService=new je;fp;initialized=n(this,d,!1);resetCameraFn=(n(this,m),n(this,f,void 0));setResetCameraFn(t){this.resetCameraFn=t}constructor(){n(this,p),this.categoryStore=new me(this),this.exhibitorStore=new fe(this),this.boothStore=new ue(this),this.routeStore=new xe(this),this.routePlannerStore=new Be(this),this.toursStore=new Le(this),this.uiState=new Ce(this),this.mapboxStore=new we(this),this.layerStore=new be,this.eventStore=new ge(this),this.heatmapStore=new ve(this),this.poiTypeStore=new Ee(this),this.fuzzySearchEngineStore=new Te(["name","title","fullName","booths.name"]),this.categoryFilterStore=new pe(this),this.sessionsFilterStore=new Ie(this),this.speakerStore=new Ve(this),this.speakerFilterStore=new Ge(this),this.searchStore=new ze(this),this.searchButtonsStore=new Me(this),this.bookmarksStore=new Oe(this),this.urlFilterManager=new Ae(this),this.shortcutRegistry=new Re,this.registerShortcutProviders()}selectExhibitor(t,e=!0){this.uiState.hoveredExhibitor=null,this.uiState.details=t;var o=t.booths.filter(h=>h.visible),l=t.booths.filter(h=>!h.visible);!o.length&&l.length&&this.layerStore.updateVisibility(l[0].layer,!0),e&&setTimeout(()=>this.moveToList(t.booths.filter(h=>h.visible)),c||r?500:50)}selectBooth(t,e=!0){let o=Array.isArray(t)?t:[t];this.uiState.details=o[0],o.length===1&&o[0].schedule?.length&&(this.uiState.desiredOverlaySize="medium"),o.length===1&&o[0].layer&&!o[0].visible&&this.layerStore.mode===re.Radio&&this.layerStore.updateVisibility(o[0].layer,!0),e&&setTimeout(()=>this.moveToList(o),c||r?500:50)}reset(){const t=window.__searchi;t&&t.querySelector&&t.querySelector("input[type=search]")&&t.querySelector("input[type=search]").blur&&t.querySelector("input[type=search]").blur(),window.setTimeout(()=>{this.uiState.setKioskModeEnabled||ye().then(()=>{ae(()=>{this.selectSearch(""),this.routeStore.defaultFrom&&!this.routeStore.defaultFrom?.visible?this.selectBooth(this.routeStore.defaultFrom):this.uiState.details=null,this.resetCameraFn?.(),this.uiState.menu=!1,this.searchStore.resetSearchBox(),this.searchButtonsStore.clearAllFilters()}),setTimeout(()=>{ae(()=>{this.uiState.inIdle=!0})},100)})},1e3)}selectNone(){window.__resett&&window.__resett(),this.uiState.details=this.uiState.selectedCategory}selectBookmarks(){this.uiState.details=null,this.uiState.list={type:"bookmarks"}}selectVisited(){this.uiState.details=null,this.uiState.list={type:"visited"}}selectLanguage(){this.uiState.details=null,this.uiState.list={type:_e}}selectCategory(t){window.__resett&&window.__resett(),this.uiState.details=t,this.uiState.list={type:"category",category:t},this.uiState.desiredOverlaySize="full",t.exhibitors.find(o=>o.booths.find(l=>l.visible))||this.layerStore.updateVisibility(t.exhibitors[0]?.booths[0]?.layer,!0),setTimeout(()=>{this.uiState.moveToBooths=t.exhibitors.filter(o=>o.booths.find(l=>l.visible)).flatMap(o=>o.booths)},200)}selectEventItem(t,e=!0){if(this.uiState.hoveredExhibitor=null,this.uiState.details=t,this.uiState.desiredOverlaySize="medium",t.boothId){const o=this.boothStore.booths.find(l=>l.id===t.boothId);o&&o.layer&&!o.visible&&this.layerStore.mode===re.Radio&&this.layerStore.updateVisibility(o.layer,!0)}e&&setTimeout(()=>{if(t.boothId){const o=this.boothStore.booths.find(l=>l.id===t.boothId);o&&this.moveToList([o])}},c||r?500:50)}selectSearch(t){window.__resett&&window.__resett(),this.uiState.details=null,this.speakerStore.clearSelectedSpeaker(),this.uiState.list={type:"search",text:Fe(t,Object.keys(this.uiState.mapSettings).map(e=>`${e}=`)),focused:!1},this.uiState.activeListIndex=-1}clickBookmarks(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectBookmarks(),this.moveToList(),this.showMap()}clickVisited(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectVisited(),this.moveToList(),this.showMap()}clickLanguage(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectLanguage()}clickCategory(t){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectCategory(t),this.uiState.onCategoryClick&&this.uiState.onCategoryClick({id:t.id,name:t.name,exhibitors:t.exhibitors.map(e=>e.id)}),setTimeout(()=>{this.moveToList(),this.showMap()},100)}clickSeminars(){this.clickCategory(this.categoryStore.seminarsCategory)}clickBoothInList(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t),this.moveToList([t]),this.showMap()}clickBoothInList2(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t,!1),window.setTimeout(()=>{this.moveToList([t]),this.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}clickBooth(t){if(this.uiState.menu=!1,this.uiState.list.type==="sessions"&&this.searchStore.selectSearch(),this.uiState.list.type==="speakers"&&this.searchStore.selectSearch(),this.uiState.list.type==="tours"&&this.searchStore.selectSearch(),this.uiState.list.type==="multi-point-tour"&&this.searchStore.selectSearch(),!(this.uiState.selectedRoute?.from&&this.uiState.selectedRoute?.to)){if(this.uiState.selectedRoute?.to&&!this.uiState.selectedRoute?.from&&t){this.routeStore.setStartPoint(t);return}if(t)this.routeStore.tempToBooth=t;else{this.uiState.details=null,this.fp.hidePathways(),this.uiState.list={type:"search",text:"",focused:!1},this.uiState.onBoothClick&&this.uiState.onBoothClick({target:null});return}if(this.uiState.onBoothClick){const e={name:"",description:""},o={target:{...t,layer:t.layer||e}};this.uiState.onBoothClick(o)}t.exhibitors.length===1&&t instanceof de?(this.heatmapStore.forceTrack={action:ke.ViewBooth,label:t.name},this.selectExhibitor(t.exhibitors[0],!1)):this.selectBooth(t,!1),this.showMap()}}clickExhibitor2(t){this.selectExhibitor(t,!0),this.showMap()}clickExhibitor(t){window.setTimeout(()=>{this.clickExhibitor2(t)},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}showMap(){const t=this.uiState.details;t&&"schedule"in t&&t.schedule?.length>0?this.uiState.desiredOverlaySize="full":this.uiState.overlayPosition==="bottom"&&ce&&(this.uiState.desiredOverlaySize="medium")}showOverlay(){this.uiState.overlayPosition==="bottom"&&(this.uiState.desiredOverlaySize="full")}toggleMapOverlay(){this.uiState.overlayPosition==="bottom"&&this.uiState.overlaySize==="full"?this.uiState.desiredOverlaySize="medium":this.uiState.overlayPosition==="bottom"&&this.uiState.overlaySize!=="full"&&(this.uiState.desiredOverlaySize="full")}moveToList(t){t=t||this.uiState.listItems;const e=[];t.forEach(o=>{o instanceof le?e.push(...o.booths.filter(l=>l.visible)):o instanceof oe&&e.push(o)}),this.uiState.moveToBooths=e}moveToExhibitor(t){this.moveToList([t])}changeActiveListIndex(t){let e=this.uiState.activeListIndex+t;e=Math.max(0,Math.min(this.uiState.listItems.length-1,e)),this.uiState.activeListIndex=e}toggleModal(t){this.uiState.modalActive[t]=!this.uiState.modalActive[t]}openGallery(){this.uiState.galleryActive=!0}closeGallery(){this.uiState.galleryActive=!1}openActiveListItem(){const t=this.uiState.listItems[this.uiState.activeListIndex];t&&(ne.log("Opening",t),t instanceof le?this.clickExhibitor(t):t instanceof Se?this.clickCategory(t):t instanceof oe&&this.clickBoothInList2(t))}toggleCategoryFilter(){this.uiState.categoryFilterOpen=!this.uiState.categoryFilterOpen}applyCategoryFilters(t){this.uiState.selectedCategoryFilters=t,this.uiState.categoryFilterOpen=!1}get filteredExhibitors(){return this.uiState.selectedCategoryFilters.length===0?this.exhibitorStore.exhibitors:this.exhibitorStore.exhibitors.filter(t=>this.uiState.selectedCategoryFilters.some(e=>t.categories.some(o=>o.id===e.id)))}selectSessions(){this.uiState.list={type:"sessions",text:"",focused:!1},this.uiState.menu=!1,this.uiState.selectedTrack=null,this.searchButtonsStore.setSubButtonId(null),this.searchButtonsStore.subButtonsEnabled&&this.searchButtonsStore.showSubButtons("sessions"),r&&(this.uiState.desiredOverlaySize="full")}selectExhibitors(){this.uiState.list={type:"exhibitors",text:"",focused:!1},this.uiState.menu=!1,r&&(this.uiState.desiredOverlaySize="full")}selectTours(){this.uiState.list={type:"tours",text:"",focused:!1},this.uiState.menu=!1,r&&(this.uiState.desiredOverlaySize="full")}selectSpeakers(){this.uiState.list={type:"speakers",text:"",focused:!1},this.uiState.menu=!1,r&&(this.uiState.desiredOverlaySize="full")}selectSpeaker(t,e=!0){this.speakerStore.selectSpeaker(t,e)}resetFilters(){this.searchButtonsStore.clearAllFilters()}registerShortcutProviders(){this.shortcutRegistry.register(new Pe(this)),this.shortcutRegistry.register(new Ne(this)),this.shortcutRegistry.register(new qe(this))}}})();export default Ue;
1
+ import{__esDecorate as i,__runInitializers as n}from"tslib";import{action as a,observable as se,computed as he,runInAction as ae}from"mobx";import ne from"../tools/logger";import{isWebGlSupported as ce}from"../utils";import ue,{BoothBase as oe,RegularBooth as de}from"./BoothStore";import me,{Category as Se}from"./CategoryStore";import fe,{Exhibitor as le}from"./ExhibitorStore";import pe from"./CategoryFilterStore";import ge from"./EventStore";import{GaEventActions as ke}from"../tools/gtag";import r from"../utils/is-mobile";import c from"../utils/is-webview";import ve from"./HeatmapStore";import{resetLocale as ye}from"../utils/i18n";import{LANGUAGE_TYPE as _e}from"../constants";import be,{LayersMode as re}from"./LayerStore";import we from"./MapboxStore";import xe from"./RouteStore";import Be from"./RoutePlannerStore";import Le from"./ToursStore";import Ce from"./UIState";import Ee from"./PoiTypeStore";import{sanitizeSearch as Fe}from"../utils/sanitizeText";import Te from"./FuzzySearchEngineStore";import Ie from"./SessionsFilterStore";import ze from"./SearchStore";import Me from"./SearchButtonsStore";import Oe from"./BookmarksStore";import{URLFilterManager as Ae}from"../services/URLFilterManager";import{ShortcutRegistry as Re}from"./ShortcutRegistry";import{SessionsShortcutProvider as Pe}from"./providers/SessionsShortcutProvider";import Ve from"./SpeakerStore";import Ge from"./SpeakerFilterStore";import{SpeakerShortcutProvider as Ne}from"./providers/SpeakerShortcutProvider";import{SearchShortcutProvider as qe}from"./providers/SearchShortcutProvider";import{RendererService as je}from"../renderer";let Ue=(()=>{let s=[],u,d=[],m=[],S,f=[],p=[],g,k,v,y,_,b,w,x,B,L,C,E,F,T,I,z,M,O,A,R,P,V,G,N,q,j,U,W,D,H,K,Y,$,J,Q,X,Z,ee,te,ie;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;u=[se],S=[se],g=[a],k=[a],v=[a],y=[a],_=[a],b=[a],w=[a],x=[a],B=[a],L=[a],C=[a],E=[a],F=[a],T=[a],I=[a],z=[a],M=[a],O=[a],A=[a],R=[a],P=[a],V=[a],G=[a],N=[a],q=[a],j=[a],U=[a],W=[a],D=[a],H=[a],K=[a],Y=[a],$=[a],J=[he],Q=[a],X=[a],Z=[a],ee=[a],te=[a],ie=[a],i(this,null,g,{kind:"method",name:"setResetCameraFn",static:!1,private:!1,access:{has:e=>"setResetCameraFn"in e,get:e=>e.setResetCameraFn},metadata:t},null,s),i(this,null,k,{kind:"method",name:"selectExhibitor",static:!1,private:!1,access:{has:e=>"selectExhibitor"in e,get:e=>e.selectExhibitor},metadata:t},null,s),i(this,null,v,{kind:"method",name:"selectBooth",static:!1,private:!1,access:{has:e=>"selectBooth"in e,get:e=>e.selectBooth},metadata:t},null,s),i(this,null,y,{kind:"method",name:"reset",static:!1,private:!1,access:{has:e=>"reset"in e,get:e=>e.reset},metadata:t},null,s),i(this,null,_,{kind:"method",name:"selectNone",static:!1,private:!1,access:{has:e=>"selectNone"in e,get:e=>e.selectNone},metadata:t},null,s),i(this,null,b,{kind:"method",name:"selectBookmarks",static:!1,private:!1,access:{has:e=>"selectBookmarks"in e,get:e=>e.selectBookmarks},metadata:t},null,s),i(this,null,w,{kind:"method",name:"selectVisited",static:!1,private:!1,access:{has:e=>"selectVisited"in e,get:e=>e.selectVisited},metadata:t},null,s),i(this,null,x,{kind:"method",name:"selectLanguage",static:!1,private:!1,access:{has:e=>"selectLanguage"in e,get:e=>e.selectLanguage},metadata:t},null,s),i(this,null,B,{kind:"method",name:"selectCategory",static:!1,private:!1,access:{has:e=>"selectCategory"in e,get:e=>e.selectCategory},metadata:t},null,s),i(this,null,L,{kind:"method",name:"selectEventItem",static:!1,private:!1,access:{has:e=>"selectEventItem"in e,get:e=>e.selectEventItem},metadata:t},null,s),i(this,null,C,{kind:"method",name:"selectSearch",static:!1,private:!1,access:{has:e=>"selectSearch"in e,get:e=>e.selectSearch},metadata:t},null,s),i(this,null,E,{kind:"method",name:"clickBookmarks",static:!1,private:!1,access:{has:e=>"clickBookmarks"in e,get:e=>e.clickBookmarks},metadata:t},null,s),i(this,null,F,{kind:"method",name:"clickVisited",static:!1,private:!1,access:{has:e=>"clickVisited"in e,get:e=>e.clickVisited},metadata:t},null,s),i(this,null,T,{kind:"method",name:"clickLanguage",static:!1,private:!1,access:{has:e=>"clickLanguage"in e,get:e=>e.clickLanguage},metadata:t},null,s),i(this,null,I,{kind:"method",name:"clickCategory",static:!1,private:!1,access:{has:e=>"clickCategory"in e,get:e=>e.clickCategory},metadata:t},null,s),i(this,null,z,{kind:"method",name:"clickSeminars",static:!1,private:!1,access:{has:e=>"clickSeminars"in e,get:e=>e.clickSeminars},metadata:t},null,s),i(this,null,M,{kind:"method",name:"clickBoothInList",static:!1,private:!1,access:{has:e=>"clickBoothInList"in e,get:e=>e.clickBoothInList},metadata:t},null,s),i(this,null,O,{kind:"method",name:"clickBoothInList2",static:!1,private:!1,access:{has:e=>"clickBoothInList2"in e,get:e=>e.clickBoothInList2},metadata:t},null,s),i(this,null,A,{kind:"method",name:"clickBooth",static:!1,private:!1,access:{has:e=>"clickBooth"in e,get:e=>e.clickBooth},metadata:t},null,s),i(this,null,R,{kind:"method",name:"clickExhibitor2",static:!1,private:!1,access:{has:e=>"clickExhibitor2"in e,get:e=>e.clickExhibitor2},metadata:t},null,s),i(this,null,P,{kind:"method",name:"clickExhibitor",static:!1,private:!1,access:{has:e=>"clickExhibitor"in e,get:e=>e.clickExhibitor},metadata:t},null,s),i(this,null,V,{kind:"method",name:"showMap",static:!1,private:!1,access:{has:e=>"showMap"in e,get:e=>e.showMap},metadata:t},null,s),i(this,null,G,{kind:"method",name:"showOverlay",static:!1,private:!1,access:{has:e=>"showOverlay"in e,get:e=>e.showOverlay},metadata:t},null,s),i(this,null,N,{kind:"method",name:"toggleMapOverlay",static:!1,private:!1,access:{has:e=>"toggleMapOverlay"in e,get:e=>e.toggleMapOverlay},metadata:t},null,s),i(this,null,q,{kind:"method",name:"moveToList",static:!1,private:!1,access:{has:e=>"moveToList"in e,get:e=>e.moveToList},metadata:t},null,s),i(this,null,j,{kind:"method",name:"moveToExhibitor",static:!1,private:!1,access:{has:e=>"moveToExhibitor"in e,get:e=>e.moveToExhibitor},metadata:t},null,s),i(this,null,U,{kind:"method",name:"changeActiveListIndex",static:!1,private:!1,access:{has:e=>"changeActiveListIndex"in e,get:e=>e.changeActiveListIndex},metadata:t},null,s),i(this,null,W,{kind:"method",name:"toggleModal",static:!1,private:!1,access:{has:e=>"toggleModal"in e,get:e=>e.toggleModal},metadata:t},null,s),i(this,null,D,{kind:"method",name:"openGallery",static:!1,private:!1,access:{has:e=>"openGallery"in e,get:e=>e.openGallery},metadata:t},null,s),i(this,null,H,{kind:"method",name:"closeGallery",static:!1,private:!1,access:{has:e=>"closeGallery"in e,get:e=>e.closeGallery},metadata:t},null,s),i(this,null,K,{kind:"method",name:"openActiveListItem",static:!1,private:!1,access:{has:e=>"openActiveListItem"in e,get:e=>e.openActiveListItem},metadata:t},null,s),i(this,null,Y,{kind:"method",name:"toggleCategoryFilter",static:!1,private:!1,access:{has:e=>"toggleCategoryFilter"in e,get:e=>e.toggleCategoryFilter},metadata:t},null,s),i(this,null,$,{kind:"method",name:"applyCategoryFilters",static:!1,private:!1,access:{has:e=>"applyCategoryFilters"in e,get:e=>e.applyCategoryFilters},metadata:t},null,s),i(this,null,J,{kind:"getter",name:"filteredExhibitors",static:!1,private:!1,access:{has:e=>"filteredExhibitors"in e,get:e=>e.filteredExhibitors},metadata:t},null,s),i(this,null,Q,{kind:"method",name:"selectSessions",static:!1,private:!1,access:{has:e=>"selectSessions"in e,get:e=>e.selectSessions},metadata:t},null,s),i(this,null,X,{kind:"method",name:"selectExhibitors",static:!1,private:!1,access:{has:e=>"selectExhibitors"in e,get:e=>e.selectExhibitors},metadata:t},null,s),i(this,null,Z,{kind:"method",name:"selectTours",static:!1,private:!1,access:{has:e=>"selectTours"in e,get:e=>e.selectTours},metadata:t},null,s),i(this,null,ee,{kind:"method",name:"selectSpeakers",static:!1,private:!1,access:{has:e=>"selectSpeakers"in e,get:e=>e.selectSpeakers},metadata:t},null,s),i(this,null,te,{kind:"method",name:"selectSpeaker",static:!1,private:!1,access:{has:e=>"selectSpeaker"in e,get:e=>e.selectSpeaker},metadata:t},null,s),i(this,null,ie,{kind:"method",name:"resetFilters",static:!1,private:!1,access:{has:e=>"resetFilters"in e,get:e=>e.resetFilters},metadata:t},null,s),i(null,null,u,{kind:"field",name:"initialized",static:!1,private:!1,access:{has:e=>"initialized"in e,get:e=>e.initialized,set:(e,o)=>{e.initialized=o}},metadata:t},d,m),i(null,null,S,{kind:"field",name:"resetCameraFn",static:!1,private:!1,access:{has:e=>"resetCameraFn"in e,get:e=>e.resetCameraFn,set:(e,o)=>{e.resetCameraFn=o}},metadata:t},f,p),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}categoryStore=n(this,s);exhibitorStore;boothStore;uiState;routeStore;routePlannerStore;toursStore;mapboxStore;layerStore;eventStore;poiTypeStore;heatmapStore;fuzzySearchEngineStore;categoryFilterStore;sessionsFilterStore;speakerStore;speakerFilterStore;searchStore;searchButtonsStore;bookmarksStore;urlFilterManager;shortcutRegistry;rendererService=new je;fp;initialized=n(this,d,!1);resetCameraFn=(n(this,m),n(this,f,void 0));setResetCameraFn(t){this.resetCameraFn=t}constructor(){n(this,p),this.categoryStore=new me(this),this.exhibitorStore=new fe(this),this.boothStore=new ue(this),this.routeStore=new xe(this),this.routePlannerStore=new Be(this),this.toursStore=new Le(this),this.uiState=new Ce(this),this.mapboxStore=new we(this),this.layerStore=new be,this.eventStore=new ge(this),this.heatmapStore=new ve(this),this.poiTypeStore=new Ee(this),this.fuzzySearchEngineStore=new Te(["name","title","fullName","booths.name"]),this.categoryFilterStore=new pe(this),this.sessionsFilterStore=new Ie(this),this.speakerStore=new Ve(this),this.speakerFilterStore=new Ge(this),this.searchStore=new ze(this),this.searchButtonsStore=new Me(this),this.bookmarksStore=new Oe(this),this.urlFilterManager=new Ae(this),this.shortcutRegistry=new Re,this.registerShortcutProviders()}selectExhibitor(t,e=!0){this.uiState.hoveredExhibitor=null,this.uiState.details=t;var o=t.booths.filter(h=>h.visible),l=t.booths.filter(h=>!h.visible);!o.length&&l.length&&this.layerStore.updateVisibility(l[0].layer,!0),e&&setTimeout(()=>this.moveToList(t.booths.filter(h=>h.visible)),c||r?500:50)}selectBooth(t,e=!0){let o=Array.isArray(t)?t:[t];this.uiState.details=o[0],o.length===1&&o[0].schedule?.length&&(this.uiState.desiredOverlaySize="medium"),o.length===1&&o[0].layer&&!o[0].visible&&this.layerStore.mode===re.Radio&&this.layerStore.updateVisibility(o[0].layer,!0),e&&setTimeout(()=>this.moveToList(o),c||r?500:50)}reset(){const t=window.__searchi;t&&t.querySelector&&t.querySelector("input[type=search]")&&t.querySelector("input[type=search]").blur&&t.querySelector("input[type=search]").blur(),window.setTimeout(()=>{this.uiState.setKioskModeEnabled||ye().then(()=>{ae(()=>{this.selectSearch(""),this.routeStore.defaultFrom&&!this.routeStore.defaultFrom?.visible?this.selectBooth(this.routeStore.defaultFrom):this.uiState.details=null,this.resetCameraFn?.(),this.uiState.menu=!1,this.searchStore.resetSearchBox(),this.searchButtonsStore.clearAllFilters()}),setTimeout(()=>{ae(()=>{this.uiState.inIdle=!0})},100)})},1e3)}selectNone(){window.__resett&&window.__resett(),this.uiState.details=this.uiState.selectedCategory}selectBookmarks(){this.uiState.details=null,this.uiState.list={type:"bookmarks"}}selectVisited(){this.uiState.details=null,this.uiState.list={type:"visited"}}selectLanguage(){this.uiState.details=null,this.uiState.list={type:_e}}selectCategory(t){window.__resett&&window.__resett(),this.uiState.details=t,this.uiState.list={type:"category",category:t},this.uiState.desiredOverlaySize="full",t.exhibitors.find(o=>o.booths.find(l=>l.visible))||this.layerStore.updateVisibility(t.exhibitors[0]?.booths[0]?.layer,!0),setTimeout(()=>{this.uiState.moveToBooths=t.exhibitors.filter(o=>o.booths.find(l=>l.visible)).flatMap(o=>o.booths)},200)}selectEventItem(t,e=!0){if(this.uiState.hoveredExhibitor=null,this.uiState.details=t,this.uiState.desiredOverlaySize="medium",t.boothId){const o=this.boothStore.booths.find(l=>l.id===t.boothId);o&&o.layer&&!o.visible&&this.layerStore.mode===re.Radio&&this.layerStore.updateVisibility(o.layer,!0)}e&&setTimeout(()=>{if(t.boothId){const o=this.boothStore.booths.find(l=>l.id===t.boothId);o&&this.moveToList([o])}},c||r?500:50)}selectSearch(t){window.__resett&&window.__resett(),this.uiState.details=null,this.speakerStore.clearSelectedSpeaker(),this.uiState.list={type:"search",text:Fe(t,Object.keys(this.uiState.mapSettings).map(e=>`${e}=`)),focused:!1},this.uiState.activeListIndex=-1}clickBookmarks(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectBookmarks(),this.moveToList(),this.showMap()}clickVisited(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectVisited(),this.moveToList(),this.showMap()}clickLanguage(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectLanguage()}clickCategory(t){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectCategory(t),this.uiState.onCategoryClick&&this.uiState.onCategoryClick({id:t.id,name:t.name,exhibitors:t.exhibitors.map(e=>e.id)}),setTimeout(()=>{this.moveToList(),this.showMap()},100)}clickSeminars(){this.clickCategory(this.categoryStore.seminarsCategory)}clickBoothInList(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t),this.moveToList([t]),this.showMap()}clickBoothInList2(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t,!1),window.setTimeout(()=>{this.moveToList([t]),this.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}clickBooth(t){if(this.uiState.menu=!1,this.uiState.list.type==="sessions"&&this.searchStore.selectSearch(),this.uiState.list.type==="speakers"&&this.searchStore.selectSearch(),this.uiState.list.type==="tours"&&this.searchStore.selectSearch(),this.uiState.list.type==="multi-point-tour"&&this.searchStore.selectSearch(),!(this.uiState.selectedRoute?.from&&this.uiState.selectedRoute?.to)){if(this.uiState.selectedRoute?.to&&!this.uiState.selectedRoute?.from&&t){this.routeStore.setStartPoint(t);return}if(t)this.routeStore.tempToBooth=t;else{this.uiState.details=null,this.fp.hidePathways(),this.uiState.list={type:"search",text:"",focused:!1},this.uiState.onBoothClick&&this.uiState.onBoothClick({target:null});return}if(this.uiState.onBoothClick){const e={name:"",description:""},o={target:{...t,layer:t.layer||e}};this.uiState.onBoothClick(o)}t.exhibitors.length===1&&t instanceof de?(this.heatmapStore.forceTrack={action:ke.ViewBooth,label:t.name},this.selectExhibitor(t.exhibitors[0],!1)):this.selectBooth(t,!1),this.showMap()}}clickExhibitor2(t){this.selectExhibitor(t,!0),this.showMap()}clickExhibitor(t){window.setTimeout(()=>{this.clickExhibitor2(t)},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}showMap(){this.uiState.overlayPosition==="bottom"&&ce&&(this.uiState.desiredOverlaySize="medium")}showOverlay(){this.uiState.overlayPosition==="bottom"&&(this.uiState.desiredOverlaySize="full")}toggleMapOverlay(){this.uiState.overlayPosition==="bottom"&&this.uiState.overlaySize==="full"?this.uiState.desiredOverlaySize="medium":this.uiState.overlayPosition==="bottom"&&this.uiState.overlaySize!=="full"&&(this.uiState.desiredOverlaySize="full")}moveToList(t){t=t||this.uiState.listItems;const e=[];t.forEach(o=>{o instanceof le?e.push(...o.booths.filter(l=>l.visible)):o instanceof oe&&e.push(o)}),this.uiState.moveToBooths=e}moveToExhibitor(t){this.moveToList([t])}changeActiveListIndex(t){let e=this.uiState.activeListIndex+t;e=Math.max(0,Math.min(this.uiState.listItems.length-1,e)),this.uiState.activeListIndex=e}toggleModal(t){this.uiState.modalActive[t]=!this.uiState.modalActive[t]}openGallery(){this.uiState.galleryActive=!0}closeGallery(){this.uiState.galleryActive=!1}openActiveListItem(){const t=this.uiState.listItems[this.uiState.activeListIndex];t&&(ne.log("Opening",t),t instanceof le?this.clickExhibitor(t):t instanceof Se?this.clickCategory(t):t instanceof oe&&this.clickBoothInList2(t))}toggleCategoryFilter(){this.uiState.categoryFilterOpen=!this.uiState.categoryFilterOpen}applyCategoryFilters(t){this.uiState.selectedCategoryFilters=t,this.uiState.categoryFilterOpen=!1}get filteredExhibitors(){return this.uiState.selectedCategoryFilters.length===0?this.exhibitorStore.exhibitors:this.exhibitorStore.exhibitors.filter(t=>this.uiState.selectedCategoryFilters.some(e=>t.categories.some(o=>o.id===e.id)))}selectSessions(){this.uiState.list={type:"sessions",text:"",focused:!1},this.uiState.menu=!1,this.uiState.selectedTrack=null,this.searchButtonsStore.setSubButtonId(null),this.searchButtonsStore.subButtonsEnabled&&this.searchButtonsStore.showSubButtons("sessions"),r&&(this.uiState.desiredOverlaySize="full")}selectExhibitors(){this.uiState.list={type:"exhibitors",text:"",focused:!1},this.uiState.menu=!1,r&&(this.uiState.desiredOverlaySize="full")}selectTours(){this.uiState.list={type:"tours",text:"",focused:!1},this.uiState.menu=!1,r&&(this.uiState.desiredOverlaySize="full")}selectSpeakers(){this.uiState.list={type:"speakers",text:"",focused:!1},this.uiState.menu=!1,r&&(this.uiState.desiredOverlaySize="full")}selectSpeaker(t,e=!0){this.speakerStore.selectSpeaker(t,e)}resetFilters(){this.searchButtonsStore.clearAllFilters()}registerShortcutProviders(){this.shortcutRegistry.register(new Pe(this)),this.shortcutRegistry.register(new Ne(this)),this.shortcutRegistry.register(new qe(this))}}})();export default Ue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expofp/floorplan",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/expofp/efp-app.git",
@@ -79,13 +79,13 @@
79
79
  "twgl.js": "^4.14.0",
80
80
  "uuid": "^9.0.1",
81
81
  "zod": "4.3.5",
82
- "@expofp/resolve": "3.0.1",
83
- "@expofp/debug": "3.0.1"
82
+ "@expofp/debug": "3.0.2",
83
+ "@expofp/resolve": "3.0.2"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@babel/plugin-proposal-decorators": "^7.29.0",
87
87
  "@babel/plugin-transform-class-properties": "^7.28.6",
88
- "@sentry/vite-plugin": "5.1.1",
88
+ "@sentry/vite-plugin": "5.2.0",
89
89
  "@types/d3": "^7.1.0",
90
90
  "@types/lz-string": "1.3.32",
91
91
  "@types/mapbox-gl": "^2.6.3",
@@ -1,40 +0,0 @@
1
- function __vite_inject_css__(css, id){ if (typeof document==='undefined') return; var parent=(typeof window!=='undefined'&&window.__efpShadowDOMStyleParent)||document.head; var s=document.createElement('style'); s.setAttribute('data-chunk-style', id); s.appendChild(document.createTextNode(css)); parent.appendChild(s);}
2
- import { j as e } from "./jsx-runtime-CoKhM3tL.js";
3
- import { c as o, a as r, s as i } from "./floorplan.ready-BQetaqdP.js";
4
- import { z as c } from "./index.js";
5
- (function() {
6
- try {
7
- var t = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
8
- t.SENTRY_RELEASE = { id: "3.0.1" };
9
- var a = new t.Error().stack;
10
- a && (t._sentryDebugIds = t._sentryDebugIds || {}, t._sentryDebugIds[a] = "150c8853-0257-4bd0-8794-846a7aff39e4", t._sentryDebugIdIdentifier = "sentry-dbid-150c8853-0257-4bd0-8794-846a7aff39e4");
11
- } catch {
12
- }
13
- })();
14
- const n = [];
15
- function l() {
16
- const t = n.map((s) => s.width * s.height).reduce((s, d) => s += d, 0), a = n.map((s) => /* @__PURE__ */ e.jsxs("div", { className: "debug__canvas", id: s.toDataURL(), children: [
17
- s.width,
18
- "x",
19
- s.height,
20
- "=",
21
- s.width * s.height,
22
- /* @__PURE__ */ e.jsx("br", {}),
23
- /* @__PURE__ */ e.jsx("img", { src: s.toDataURL(), alt: "", crossOrigin: "anonymous" })
24
- ] }, s.toDataURL()));
25
- return /* @__PURE__ */ e.jsxs("div", { className: "debug", children: [
26
- /* @__PURE__ */ e.jsx("button", { onClick: () => i.searchStore.selectSearch(""), children: c("Close") }),
27
- /* @__PURE__ */ e.jsxs("div", { children: [
28
- "Total square: ",
29
- t
30
- ] }),
31
- a
32
- ] });
33
- }
34
- const b = () => o(() => /* @__PURE__ */ e.jsx(e.Fragment, { children: r.list.type === "search" && r.list.text === "q1" ? /* @__PURE__ */ e.jsx(l, {}) : null }));
35
- export {
36
- b as default
37
- };
38
-
39
- ;/* vite-per-chunk-css */
40
- __vite_inject_css__(".debug{position:fixed;top:1rem;left:1vw;z-index:999;width:calc(100vw - 2rem);height:calc(100vh - 2rem);padding:1rem;overflow:scroll;background:var(--color-white);box-shadow:0 0 1rem #00000080}.debug label{display:block;font-weight:var(--font-weight-bold)}.debug__canvas{display:inline-block;padding:2px;vertical-align:top}.debug__canvas>img{background:var(--color-gray-300)}\n/*$vite$:1*/", "Debug.css");
@@ -1,47 +0,0 @@
1
- import { j as s } from "./jsx-runtime-CoKhM3tL.js";
2
- import { y as o } from "./index-jp-Zhdyp.js";
3
- import { u as d, a, b as f, c as l } from "./floorplan.ready-BQetaqdP.js";
4
- import { z as n } from "./index.js";
5
- (function() {
6
- try {
7
- var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
8
- e.SENTRY_RELEASE = { id: "3.0.1" };
9
- var t = new e.Error().stack;
10
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "bedd5b4f-e9b3-4464-9824-85b01f4fb92f", e._sentryDebugIdIdentifier = "sentry-dbid-bedd5b4f-e9b3-4464-9824-85b01f4fb92f");
11
- } catch {
12
- }
13
- })();
14
- const i = "note-dismissed5";
15
- function p() {
16
- const e = d(() => ({
17
- hidden: !0,
18
- get top() {
19
- return a.screenSize.width <= 820;
20
- },
21
- get classes() {
22
- return o({
23
- demo: !0,
24
- top: this.top,
25
- hidden: this.hidden
26
- });
27
- }
28
- }));
29
- return f(() => {
30
- sessionStorage.getItem(i) || window.setTimeout(() => {
31
- e.hidden = !1;
32
- }, 2e3);
33
- }), l(() => /* @__PURE__ */ s.jsx("div", { className: e.classes, children: /* @__PURE__ */ s.jsxs("section", { children: [
34
- /* @__PURE__ */ s.jsx("div", { className: "demo__message", children: /* @__PURE__ */ s.jsxs("span", { children: [
35
- n("Get your free floor plan at"),
36
- " ",
37
- /* @__PURE__ */ s.jsx("a", { href: "https://expofp.com/", target: "_blank", rel: "noopener noreferrer", children: "ExpoFP.com" })
38
- ] }) }),
39
- /* @__PURE__ */ s.jsx("a", { href: "/", onClick: t, className: "demo__dismiss", children: n("Dismiss") })
40
- ] }) }));
41
- function t(r) {
42
- r.preventDefault(), e.hidden = !0, sessionStorage.setItem(i, "1");
43
- }
44
- }
45
- export {
46
- p as default
47
- };
@@ -1,51 +0,0 @@
1
- function __vite_inject_css__(css, id){ if (typeof document==='undefined') return; var parent=(typeof window!=='undefined'&&window.__efpShadowDOMStyleParent)||document.head; var s=document.createElement('style'); s.setAttribute('data-chunk-style', id); s.appendChild(document.createTextNode(css)); parent.appendChild(s);}
2
- import { j as s } from "./jsx-runtime-CoKhM3tL.js";
3
- import { y as o } from "./index-jp-Zhdyp.js";
4
- import { u as d, a, b as f, c as l } from "./floorplan.ready-BQetaqdP.js";
5
- import { ah as c, z as i } from "./index.js";
6
- (function() {
7
- try {
8
- var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
9
- e.SENTRY_RELEASE = { id: "3.0.1" };
10
- var t = new e.Error().stack;
11
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "ce8f7f4e-2238-4650-8048-00d07181bd7a", e._sentryDebugIdIdentifier = "sentry-dbid-ce8f7f4e-2238-4650-8048-00d07181bd7a");
12
- } catch {
13
- }
14
- })();
15
- const n = "free-dismissed5";
16
- function b() {
17
- const e = d(() => ({
18
- hidden: !0,
19
- get top() {
20
- return a.screenSize.width < c;
21
- },
22
- get classes() {
23
- return o({
24
- free: !0,
25
- bottom: !this.top,
26
- hidden: this.hidden
27
- });
28
- }
29
- }));
30
- return f(() => {
31
- sessionStorage.getItem(n) || window.setTimeout(() => {
32
- e.hidden = !1;
33
- }, 2e3);
34
- }), l(() => /* @__PURE__ */ s.jsx("div", { className: e.classes, children: /* @__PURE__ */ s.jsxs("section", { children: [
35
- /* @__PURE__ */ s.jsx("div", { className: "free__message", children: /* @__PURE__ */ s.jsxs("span", { children: [
36
- i("Create a free floor plan at"),
37
- " ",
38
- /* @__PURE__ */ s.jsx("a", { href: "https://expofp.com/", target: "_blank", rel: "noopener noreferrer", children: "ExpoFP.com" })
39
- ] }) }),
40
- /* @__PURE__ */ s.jsx("a", { href: "/", onClick: t, className: "free__dismiss", children: i("Dismiss") })
41
- ] }) }));
42
- function t(r) {
43
- r.preventDefault(), e.hidden = !0, sessionStorage.setItem(n, "1");
44
- }
45
- }
46
- export {
47
- b as default
48
- };
49
-
50
- ;/* vite-per-chunk-css */
51
- __vite_inject_css__(".free{position:absolute;bottom:0;display:flex;justify-content:center;width:100%;min-height:2rem;background:#ab40a0;background:linear-gradient(90deg,#e5175c,#5c17e5);opacity:1;transition:all .5s}.free>section{display:flex;padding:.2rem .5rem;font-size:.8rem;-webkit-user-select:none;user-select:none}.free__message{display:flex;align-items:center;color:#fff}.free__message a{color:#fff;text-decoration:underline}.free__dismiss{display:flex;align-items:center;margin-inline-start:.5rem;padding:.1rem .8rem;background:#1378d5;border-radius:2px;font-size:.8rem;font-weight:500;color:#fff!important;text-decoration:none!important}.free__dismiss:hover{background:#69b7ff}@media print{.free__dismiss{display:none}}.free.top{top:0;bottom:unset;width:100%;min-height:2.5rem}.free.top>section{flex-grow:1}.free.top span{display:inline-block}.free.top .free__message{flex-grow:1}.free.bottom .free__message{font-size:1.5rem;font-weight:300;color:#ffffffe6}.free.bottom>section{padding:.5rem}.free.bottom .free__dismiss{padding:.5rem 1rem;font-size:1.2rem;font-weight:600}.free.hidden{transform:translateY(100%)}.free.top.hidden{transform:translateY(-100%)}\n/*$vite$:1*/", "Free.css");
@@ -1,71 +0,0 @@
1
- import { j as e } from "./jsx-runtime-CoKhM3tL.js";
2
- import { r as d, o as E } from "./index.js";
3
- import { y as N } from "./index-jp-Zhdyp.js";
4
- import { as as v, at as G, au as S } from "./floorplan.ready-BQetaqdP.js";
5
- (function() {
6
- try {
7
- var s = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
8
- s.SENTRY_RELEASE = { id: "3.0.1" };
9
- var a = new s.Error().stack;
10
- a && (s._sentryDebugIds = s._sentryDebugIds || {}, s._sentryDebugIds[a] = "7256ff82-0acf-4237-aaaa-6ac9e6f8d367", s._sentryDebugIdIdentifier = "sentry-dbid-7256ff82-0acf-4237-aaaa-6ac9e6f8d367");
11
- } catch {
12
- }
13
- })();
14
- const w = ({
15
- count: s,
16
- onFullscreen: a
17
- }) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
18
- /* @__PURE__ */ e.jsxs("div", { className: "gallery__badge gallery__badge-count", children: [
19
- /* @__PURE__ */ e.jsx("i", { className: "icon-image" }),
20
- /* @__PURE__ */ e.jsx("span", { children: s })
21
- ] }),
22
- /* @__PURE__ */ e.jsx("div", { className: "gallery__badge gallery__badge-fullscreen", onClick: a, children: /* @__PURE__ */ e.jsx("i", { className: "icon-maximize" }) })
23
- ] }), x = ({
24
- url: s,
25
- position: a = "center",
26
- leading: r = !1,
27
- setHeight: t = !1,
28
- fillMode: i,
29
- onClick: o,
30
- onImageLoadHeightUpdate: c
31
- }) => /* @__PURE__ */ e.jsx("div", { className: "gallery__item", onClick: o, children: /* @__PURE__ */ e.jsx(v, { position: a, fillMode: i, url: s, leading: r, setHeight: t, onImageLoadHeightUpdate: c }) }), D = (s) => {
32
- const {
33
- images: a,
34
- leading: r = !1,
35
- onImageLoadHeightUpdate: t,
36
- onOpenGallery: i,
37
- onCloseGallery: o,
38
- className: c
39
- } = s, [p, m] = d.useState(!1), [h, j] = d.useState(0), [_, u] = d.useState(!1), g = (l) => {
40
- j(l), m(!0), i && i();
41
- }, b = () => {
42
- m(!1), o && o();
43
- }, I = (l) => {
44
- let n = l.split("/");
45
- const f = n[n.length - 1];
46
- return f.indexOf("original-") === -1 && (n[n.length - 1] = "original-" + f), n.join("/");
47
- }, y = (l, n) => n ? I(l) : l;
48
- return d.useEffect(() => {
49
- (async () => {
50
- if (a.length > 0) {
51
- const n = y(a[0], !0);
52
- try {
53
- await S.load(n), u(!0);
54
- } catch {
55
- u(!1);
56
- }
57
- }
58
- })();
59
- }, [a]), /* @__PURE__ */ e.jsxs(E.Fragment, { children: [
60
- /* @__PURE__ */ e.jsxs("div", { className: N("gallery", {
61
- "gallery-leading": r
62
- }, c), children: [
63
- /* @__PURE__ */ e.jsx("div", { className: "gallery__wrapper", children: r ? /* @__PURE__ */ e.jsx(x, { url: a[0], leading: r, setHeight: !0, fillMode: "contain", onClick: () => g(0), onImageLoadHeightUpdate: t }) : a.map((l, n) => /* @__PURE__ */ e.jsx(x, { url: l, position: "top", fillMode: "cover", onClick: () => g(n), onImageLoadHeightUpdate: t }, l + n)) }),
64
- !r && /* @__PURE__ */ e.jsx(w, { onFullscreen: () => g(0), count: a.length })
65
- ] }),
66
- p && /* @__PURE__ */ e.jsx(G, { className: c, images: a.map((l) => y(l, _)), leading: r, initialSlideIndex: h, onClose: b })
67
- ] });
68
- };
69
- export {
70
- D as default
71
- };
@@ -1,140 +0,0 @@
1
- import { j as S } from "./jsx-runtime-CoKhM3tL.js";
2
- import { r as a, l as I, z as y, _ as T } from "./index.js";
3
- import { af as _, ag as A, ah as k, ai as x, s as b, aj as D, e as G } from "./floorplan.ready-BQetaqdP.js";
4
- import "./index-jp-Zhdyp.js";
5
- (function() {
6
- try {
7
- var t = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
8
- t.SENTRY_RELEASE = { id: "3.0.1" };
9
- var n = new t.Error().stack;
10
- n && (t._sentryDebugIds = t._sentryDebugIds || {}, t._sentryDebugIds[n] = "1bddcbce-15df-4a25-a120-eae5293abc43", t._sentryDebugIdIdentifier = "sentry-dbid-1bddcbce-15df-4a25-a120-eae5293abc43");
11
- } catch {
12
- }
13
- })();
14
- const v = 3;
15
- function L(t) {
16
- return Math.floor(t);
17
- }
18
- function M(t, n) {
19
- return _(t.lat, t.lng, n.lat, n.lng) >= v ? !0 : t.heading !== n.heading;
20
- }
21
- const P = 120, N = 3e3, q = 360;
22
- function H(t) {
23
- const n = a.useRef(null), r = a.useRef(null), i = a.useRef(0), s = a.useRef(null), l = a.useRef(!1), o = a.useRef(null), c = a.useRef(!1), u = a.useRef(null), d = (e) => t(e), m = (e) => {
24
- const f = Date.now();
25
- if (f - i.current < P) return;
26
- const h = s.current;
27
- if (!o.current) {
28
- o.current = e, i.current = f, s.current = e, d(e);
29
- return;
30
- }
31
- const E = _(o.current.lat, o.current.lng, e.lat, e.lng);
32
- let g;
33
- c.current ? E <= v ? (c.current = !1, o.current = e, g = {
34
- ...o.current,
35
- heading: e.heading
36
- }) : (o.current = e, g = e) : E >= v ? (c.current = !0, o.current = e, u.current = null, g = e) : (u.current == null && (u.current = f), f - u.current > N && (o.current = e), g = {
37
- ...o.current,
38
- heading: e.heading
39
- }), !(h && !M(h, g)) && (i.current = f, s.current = g, d(g));
40
- }, R = a.useCallback((e) => {
41
- var E;
42
- const f = (E = e.webkitCompassHeading) != null ? E : e.alpha != null ? q - e.alpha : null;
43
- if (f == null) return;
44
- const h = L(f);
45
- r.current !== h && (r.current = h, s.current && m({
46
- ...s.current,
47
- heading: h
48
- }));
49
- }, [t]);
50
- return {
51
- startGeolocation: () => {
52
- n.current == null && (n.current = navigator.geolocation.watchPosition((e) => {
53
- m({
54
- lat: e.coords.latitude,
55
- lng: e.coords.longitude,
56
- heading: r.current
57
- });
58
- }, (e) => I.warn("Geolocation watch error:", e), {
59
- enableHighAccuracy: !0,
60
- maximumAge: 0
61
- }));
62
- },
63
- startOrientation: () => {
64
- l.current || (l.current = !0, window.addEventListener("deviceorientation", R, !0));
65
- },
66
- stopGeolocation: () => {
67
- n.current != null && (navigator.geolocation.clearWatch(n.current), n.current = null), o.current = null, c.current = !1;
68
- },
69
- stopOrientation: () => {
70
- l.current = !1, window.removeEventListener("deviceorientation", R, !0);
71
- }
72
- };
73
- }
74
- const j = A(function({
75
- isOpen: n,
76
- onAllow: r,
77
- onCancel: i
78
- }) {
79
- return n ? /* @__PURE__ */ S.jsx(k, { title: y("Show your position on the map"), acceptText: y("Allow compass access"), rejectText: y("Not now"), onClickAccept: r, onClickReject: i, children: y("To display your current position and orient the map around you, we’ll ask for permission to access your device orientation") }) : null;
80
- });
81
- function Y({
82
- onPositionUpdate: t,
83
- onAllowCompass: n,
84
- onRejectCompass: r,
85
- orientationStorageKey: i = "compass-permission-granted",
86
- requestCompass: s = !0,
87
- requestCompassAllowed: l = !0
88
- }) {
89
- const {
90
- startOrientation: o,
91
- startGeolocation: c,
92
- stopOrientation: u,
93
- stopGeolocation: d
94
- } = H(t), [m, R] = a.useState(!1), [O, p] = a.useState(!1);
95
- a.useEffect(() => (navigator.geolocation.getCurrentPosition(() => {
96
- R(!0), c();
97
- }, (e) => {
98
- I.warn("Geolocation error:", e), R(!1);
99
- }), () => {
100
- u(), d();
101
- }), [c, d, u]);
102
- const w = async () => {
103
- typeof DeviceOrientationEvent < "u" && typeof DeviceOrientationEvent.requestPermission == "function" && await DeviceOrientationEvent.requestPermission() !== "granted" || (localStorage.setItem(i, "true"), o(), p(!1), n == null || n());
104
- }, C = a.useCallback(() => {
105
- localStorage.setItem(i, "false"), p(!1), r == null || r();
106
- }, [r]);
107
- return a.useEffect(() => {
108
- if (!m || !l || typeof navigator > "u" || !x) return;
109
- const e = localStorage.getItem(i);
110
- if (!e || s) {
111
- p(!0);
112
- return;
113
- }
114
- e === "true" && w();
115
- }, [m, s, l, w]), /* @__PURE__ */ S.jsx(j, { isOpen: O, onAllow: w, onCancel: C });
116
- }
117
- function K({
118
- requestCompassAllowed: t
119
- }) {
120
- const [n, r] = a.useState(!1), i = a.useCallback(({
121
- lat: o,
122
- lng: c,
123
- angle: u,
124
- heading: d
125
- }) => {
126
- b.routeStore.selectCurrentPosition(new D(0, 0, 0, u || d, o, c), !1);
127
- }, []), s = a.useCallback(() => {
128
- b.routeStore.requestCompass = void 0, r(!1);
129
- }, [r]), l = a.useCallback(() => {
130
- b.routeStore.requestCompass = void 0, r(!1);
131
- }, [r]);
132
- return G(() => b.uiState.hideCookieConsent, (o) => {
133
- r(o);
134
- }), G(() => b.routeStore.requestCompass, (o) => {
135
- r(o);
136
- }), /* @__PURE__ */ S.jsx(Y, { requestCompass: n, requestCompassAllowed: t, onRejectCompass: s, onAllowCompass: l, orientationStorageKey: T, onPositionUpdate: i });
137
- }
138
- export {
139
- K as default
140
- };