@expofp/floorplan 3.0.0-alpha.14 → 3.0.0-alpha.16

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 (103) hide show
  1. package/dist/browser/{Debug-Pul6-ZdY.js → Debug-DazuGIJc.js} +19 -10
  2. package/dist/browser/Demo-CXdISYQf.js +47 -0
  3. package/dist/browser/{Free-Dm2FRajw.js → Free-CVgHQ8yt.js} +29 -20
  4. package/dist/browser/Gallery-BMcvPLO_.js +288 -0
  5. package/dist/browser/GpsLoader-BiwFO3QG.js +140 -0
  6. package/dist/browser/{KioskStore-Bvvm0aNQ.js → KioskStore-NqUeUutQ.js} +58 -49
  7. package/dist/browser/Mapbox-PHCrBnx5.js +118 -0
  8. package/dist/browser/{SetKioskMode-BecTBVRp.js → SetKioskMode-DMQej1ec.js} +86 -77
  9. package/dist/browser/{ShowKiosk-C-6DHz7T.js → ShowKiosk-BWlBMcI7.js} +28 -19
  10. package/dist/browser/{ThreeComponent-Brnrh22I.js → ThreeComponent-Dmt2HPyX.js} +181 -172
  11. package/dist/browser/ViewerMenuPanel-CuqRZ7m1.js +77 -0
  12. package/dist/browser/boolean-editor-zsvPcNpX.js +157 -0
  13. package/dist/browser/bundle.json +32 -29
  14. package/dist/browser/{client-D3Op9Jdd.js → client-B2kCMH8A.js} +590 -581
  15. package/dist/browser/{data-0pZ-ZMEi.js → data-BtD6blv7.js} +276 -267
  16. package/dist/browser/{debug-overlay-6c_tWF4O.js → debug-overlay-CF0imHRX.js} +98 -89
  17. package/dist/browser/debug-ui-Zt7T7T-N.js +67 -0
  18. package/dist/browser/{favicon-DalyEhbd.js → favicon-Dj8hNa7i.js} +11 -2
  19. package/dist/browser/fetch-retry.umd-B-swKpFA.js +123 -0
  20. package/dist/browser/{flex-OW_m-DBA.js → flex-COa6XN1F.js} +80 -71
  21. package/dist/browser/{floorplan.ready-D-VQ-QvS.js → floorplan.ready-CNnM_Yyc.js} +12217 -14231
  22. package/dist/browser/fonts/efp-symbols.woff +0 -0
  23. package/dist/browser/index-B1P-x0sk.js +92 -0
  24. package/dist/browser/index-BEcZnTgd.js +54 -0
  25. package/dist/browser/{index-BUq8_R36.js → index-BeS6l0j-.js} +50 -41
  26. package/dist/browser/index-C04zJbbt.js +12475 -0
  27. package/dist/browser/index-CgWDjED_.js +57 -0
  28. package/dist/browser/{index-BuJlIIdP.js → index-CqICVJZO.js} +96 -87
  29. package/dist/browser/{index-AJbTBu7z.js → index-atMSRNM1.js} +258 -249
  30. package/dist/browser/index.js +11 -2
  31. package/dist/browser/jsx-runtime-DAY7g56y.js +40 -0
  32. package/dist/browser/locales/ar.json +3 -1
  33. package/dist/browser/locales/de.json +3 -1
  34. package/dist/browser/locales/es.json +3 -1
  35. package/dist/browser/locales/fr.json +3 -1
  36. package/dist/browser/locales/he.json +3 -1
  37. package/dist/browser/locales/it.json +3 -1
  38. package/dist/browser/locales/kk.json +3 -1
  39. package/dist/browser/locales/ko.json +3 -1
  40. package/dist/browser/locales/mn.json +3 -1
  41. package/dist/browser/locales/nl.json +3 -1
  42. package/dist/browser/locales/pl.json +3 -1
  43. package/dist/browser/locales/pt.json +3 -1
  44. package/dist/browser/locales/ru.json +3 -1
  45. package/dist/browser/locales/sv.json +3 -1
  46. package/dist/browser/locales/th.json +3 -1
  47. package/dist/browser/locales/tr.json +3 -1
  48. package/dist/browser/locales/uk.json +3 -1
  49. package/dist/browser/locales/vi.json +3 -1
  50. package/dist/browser/locales/zh.json +3 -1
  51. package/dist/browser/{main-CD9JioNt.js → main-DZpmA53N.js} +24 -15
  52. package/dist/browser/{particles.min-BZTb0pvb.js → particles.min-DXab_WLN.js} +43 -34
  53. package/dist/esm/components/Alert.d.ts +2 -0
  54. package/dist/esm/components/Alert.js +1 -1
  55. package/dist/esm/components/Badge.d.ts +3 -2
  56. package/dist/esm/components/Badge.js +1 -1
  57. package/dist/esm/components/CookieConsent.js +1 -1
  58. package/dist/esm/components/Kiosk/SetKiosk/storage.d.ts +1 -1
  59. package/dist/esm/components/Kiosk/SetKiosk/storage.js +1 -1
  60. package/dist/esm/components/Kiosk/ShowKiosk.js +1 -1
  61. package/dist/esm/components/Menu.js +1 -1
  62. package/dist/esm/components/Overlay.d.ts +2 -0
  63. package/dist/esm/components/Overlay.js +1 -1
  64. package/dist/esm/components/OverlayContainer.js +1 -1
  65. package/dist/esm/components/RoutePlanner/RoutePlanner.js +1 -1
  66. package/dist/esm/components/RoutePlanner/RoutePlannerHeader.js +1 -1
  67. package/dist/esm/components/RoutePlanner/RoutePlannerStopItem.js +1 -1
  68. package/dist/esm/components/Schedule.js +1 -1
  69. package/dist/esm/components/SearchBox.js +1 -1
  70. package/dist/esm/components/ViewerMenuPanel.d.ts +5 -0
  71. package/dist/esm/components/ViewerMenuPanel.js +1 -0
  72. package/dist/esm/constants.d.ts +2 -0
  73. package/dist/esm/constants.js +1 -1
  74. package/dist/esm/floorplan.loader.d.ts +2 -0
  75. package/dist/esm/floorplan.loader.js +1 -1
  76. package/dist/esm/floorplan.ready.js +1 -1
  77. package/dist/esm/services/routing.js +1 -1
  78. package/dist/esm/store/LayerStore.d.ts +1 -0
  79. package/dist/esm/store/LayerStore.js +1 -1
  80. package/dist/esm/store/RoutePlannerStore.d.ts +16 -0
  81. package/dist/esm/store/RoutePlannerStore.js +1 -1
  82. package/dist/esm/store/UIState.d.ts +1 -0
  83. package/dist/esm/store/UIState.js +1 -1
  84. package/dist/esm/store/init/init-layers.js +1 -1
  85. package/dist/esm/tools/telemetry.d.ts +35 -0
  86. package/dist/esm/tools/telemetry.js +1 -0
  87. package/dist/esm/tools/track-event.d.ts +3 -1
  88. package/dist/esm/tools/track-event.js +1 -1
  89. package/dist/esm/utils/i18n.d.ts +2 -2
  90. package/dist/esm/utils/i18n.js +1 -1
  91. package/package.json +4 -3
  92. package/dist/browser/Demo-DN_Ej-P_.js +0 -38
  93. package/dist/browser/Gallery-TLr-wfCG.js +0 -279
  94. package/dist/browser/GpsLoader-CeS0cp98.js +0 -131
  95. package/dist/browser/Mapbox-DizBJSb0.js +0 -109
  96. package/dist/browser/boolean-editor-Duwgypgb.js +0 -148
  97. package/dist/browser/debug-ui-TGRI1j4k.js +0 -58
  98. package/dist/browser/fetch-retry.umd-BZ52tMyv.js +0 -114
  99. package/dist/browser/index-B2YV6GNs.js +0 -48
  100. package/dist/browser/index-D0SjrKD-.js +0 -45
  101. package/dist/browser/index-Vc2rrV4B.js +0 -83
  102. package/dist/browser/index-Zz9lJz5_.js +0 -10224
  103. package/dist/browser/jsx-runtime-jIxVPx5o.js +0 -31
@@ -1 +1 @@
1
- import{jsx as R,jsxs as J}from"react/jsx-runtime";import ae from"classnames";import{useEffect as D,useRef as v,useState as u,useCallback as a,useMemo as Q,createContext as de}from"react";import{uiState as j}from"../store";import X from"../tools/debounce";import fe from"./OverlayParticles";import{useWindowSize as me}from"../hooks/useWindowSize";import{useDragGesture as ge}from"../hooks/useDragGesture";import{MOBILE_BREAKPOINT as Y}from"../constants";import"./Overlay.scss";export const OverlayScrollContext=de(null);const Z=70,he="0.3s",ve=10,B=()=>window!==window.top&&(document.documentElement.clientHeight||document.body.clientHeight)||window.innerHeight,$=(d=B(),s,r,I)=>({small:d/s,medium:d/r,full:d-I}),we=({children:d,open:s,size:r="medium",particles:I=!1,className:V,onChangeSize:U,onScrollStateChange:w,smallSizeMultiplier:x=12.6,mediumSizeMultiplier:O=2.6,fullSizeOffset:S=0,scrollThreshold:C=ve})=>{const{width:A,height:z}=me(),[t,ee]=u(()=>$(B(),x,O,S)),[c,te]=u(()=>A<=Y),[p,F]=u(!1),[l,oe]=u(()=>t[r]),[g,N]=u(()=>t[r]),[h,y]=u(!1),[ne,G]=u(s),[b,M]=u(!1),L=v(),P=v(),W=v(null),K=v(null),f=v(null),i=a(e=>{const o=t[e];oe(o),N(o),U?.(e)},[t,U]),re=Q(()=>c?{height:s||h?g:0}:{height:s?"auto":void 0},[c,s,g,p,r,h]),q=a(e=>{const o=[t.small,t.medium,t.full].sort();if(e>=t.full){i("full");return}if(e<=t.small){i("small");return}const n=l||t.medium,m=e>n?o.find(E=>E+Z>=e)||t.full:o.reverse().find(E=>E-Z<=e)||t.small;m===t.full?i("full"):m===t.medium?i("medium"):i("small")},[t,l,i]),se=a(e=>{F(!0),L.current=e},[]),le=a(e=>{const o=L.current;if(o===void 0)return;const n=f.current;if(n?.scrollTop>0&&l===t.full)return;const m=o-e;let _=(l||t.medium)+m;n&&l===t.full&&_<l&&(n.style.overflow="hidden"),_=Math.min(Math.max(_,t.small),t.full),P.current=m,N(_)},[l,t]),ie=a(()=>{F(!1),L.current=void 0;const e=f.current;e&&e.style.removeProperty("overflow");const o=P.current;P.current=void 0,o!==void 0&&g!==void 0&&q(g)},[g,q]),k=a(e=>{if(p)return;i(r==="small"?"medium":r==="medium"?"full":"small")},[p,r,i]),{touchHandlers:T,mouseHandlers:H}=ge({onDragStart:se,onDragMove:le,onDragEnd:ie}),ce=a(()=>{const e=f.current;if(!e)return;const n=e.scrollTop>=C;b!==n&&(M(n),w?.(n))},[C,b,w]),ue=Q(()=>X(()=>{window.__resett?.()},250),[]);D(()=>{if(!c)return;const e=W.current,o=K.current,n=f.current;e&&(e.ontouchstart=T.onTouchStart,e.ontouchend=T.onTouchEnd,window.ontouchmove=T.onTouchMove,e.onmousedown=H.onMouseDown,e.onmouseup=H.onMouseUp,window.onmousemove=H.onMouseMove),o&&o.addEventListener("mouseup",k);const m=()=>{l&&l<t.full&&n&&(n.style.overflow="hidden")};return n&&(n.ontouchstart=m),()=>{e&&(window.ontouchmove=null,window.onmousemove=null),o&&o.removeEventListener("mouseup",k)}},[c,T,H,k,l,t]),D(()=>{te(A<=Y);const e=B();ee($(e,x,O,S))},[A,z,x,O,S]),D(()=>{if(s){G(!0),y(!0);const e=setTimeout(()=>{i(r),y(!1)},10);return()=>clearTimeout(e)}else{y(!0),c&&N(0);const e=setTimeout(()=>{G(!1),y(!1),M(!1)},parseFloat(he)*1e3);return()=>clearTimeout(e)}},[s,r,i,c]),D(()=>{s&&!h&&(f.current?.scrollTo({top:0}),M(!1),w?.(!1))},[s,h,w,j.details,j.list.type]);const pe=a(X(()=>{window.__resett?.()},250),[j.kiosk]);return ne?R(OverlayScrollContext.Provider,{value:f.current,children:J("div",{className:ae("efp-overlay",{"is-open":s,"is-draggable":p,"is-small":r==="small","is-medium":r==="medium","is-full":r==="full","is-mobile":c,"is-desktop":!c,"is-hidden":!c&&!s,"is-animating":h,"is-scrolled":b},V),style:re,ref:W,children:[R("div",{className:"efp-overlay__draghandle",ref:K}),J("div",{className:"efp-overlay__scroll",ref:f,onScroll:e=>{ce(),ue()},children:[I?R(fe,{}):null,R("div",{className:"efp-overlay__content",children:d||"No content"})]})]})}):null};export default we;
1
+ import{jsx as R,jsxs as X}from"react/jsx-runtime";import fe from"classnames";import{useEffect as I,useRef as v,useState as u,useCallback as a,useMemo as Y,createContext as me}from"react";import{uiState as U}from"../store";import Z from"../tools/debounce";import ge from"./OverlayParticles";import{useWindowSize as he}from"../hooks/useWindowSize";import{useDragGesture as ve}from"../hooks/useDragGesture";import{MOBILE_BREAKPOINT as $}from"../constants";import"./Overlay.scss";export const OverlayScrollContext=me(null);const V=70,we="0.3s",pe=10,x=()=>window!==window.top&&(document.documentElement.clientHeight||document.body.clientHeight)||window.innerHeight,z=(d=x(),r,s,D)=>({small:d/r,medium:d/s,full:d-D}),ye=({children:d,open:r,size:s="medium",particles:D=!1,className:ee,onChangeSize:C,onScrollStateChange:w,smallSizeMultiplier:O=12.6,mediumSizeMultiplier:S=2.6,fullSizeOffset:A=0,scrollThreshold:G=pe,disableDrag:W=!1,forceFull:N=!1})=>{const{width:M,height:te}=he(),[t,oe]=u(()=>z(x(),O,S,A)),[l,ne]=u(()=>M<=$),[p,K]=u(!1),[i,re]=u(()=>t[s]),[g,b]=u(()=>t[s]),[h,y]=u(!1),[se,q]=u(r),[L,P]=u(!1),k=v(),j=v(),F=v(null),J=v(null),f=v(null),c=a(e=>{const o=t[e];re(o),b(o),C?.(e)},[t,C]),le=Y(()=>l?N&&r?{height:x()}:{height:r||h?g:0}:{height:r?"auto":void 0},[l,r,g,p,s,h,N]),Q=a(e=>{const o=[t.small,t.medium,t.full].sort();if(e>=t.full){c("full");return}if(e<=t.small){c("small");return}const n=i||t.medium,m=e>n?o.find(E=>E+V>=e)||t.full:o.reverse().find(E=>E-V<=e)||t.small;m===t.full?c("full"):m===t.medium?c("medium"):c("small")},[t,i,c]),ie=a(e=>{K(!0),k.current=e},[]),ce=a(e=>{const o=k.current;if(o===void 0)return;const n=f.current;if(n?.scrollTop>0&&i===t.full)return;const m=o-e;let _=(i||t.medium)+m;n&&i===t.full&&_<i&&(n.style.overflow="hidden"),_=Math.min(Math.max(_,t.small),t.full),j.current=m,b(_)},[i,t]),ue=a(()=>{K(!1),k.current=void 0;const e=f.current;e&&e.style.removeProperty("overflow");const o=j.current;j.current=void 0,o!==void 0&&g!==void 0&&Q(g)},[g,Q]),B=a(e=>{if(p)return;c(s==="small"?"medium":s==="medium"?"full":"small")},[p,s,c]),{touchHandlers:T,mouseHandlers:H}=ve({onDragStart:ie,onDragMove:ce,onDragEnd:ue}),ae=a(()=>{const e=f.current;if(!e)return;const n=e.scrollTop>=G;L!==n&&(P(n),w?.(n))},[G,L,w]),de=Y(()=>Z(()=>{window.__resett?.()},250),[]);I(()=>{if(!l||W)return;const e=F.current,o=J.current,n=f.current;e&&(e.ontouchstart=T.onTouchStart,e.ontouchend=T.onTouchEnd,window.ontouchmove=T.onTouchMove,e.onmousedown=H.onMouseDown,e.onmouseup=H.onMouseUp,window.onmousemove=H.onMouseMove),o&&o.addEventListener("mouseup",B);const m=()=>{i&&i<t.full&&n&&(n.style.overflow="hidden")};return n&&(n.ontouchstart=m),()=>{e&&(window.ontouchmove=null,window.onmousemove=null),o&&o.removeEventListener("mouseup",B)}},[l,T,H,B,i,t]),I(()=>{ne(M<=$);const e=x();oe(z(e,O,S,A))},[M,te,O,S,A]),I(()=>{if(r){q(!0),y(!0);const e=setTimeout(()=>{c(s),y(!1)},10);return()=>clearTimeout(e)}else{y(!0),l&&b(0);const e=setTimeout(()=>{q(!1),y(!1),P(!1)},parseFloat(we)*1e3);return()=>clearTimeout(e)}},[r,s,c,l]),I(()=>{r&&!h&&(f.current?.scrollTo({top:0}),P(!1),w?.(!1))},[r,h,w,U.details,U.list.type]);const Te=a(Z(()=>{window.__resett?.()},250),[U.kiosk]);return se?R(OverlayScrollContext.Provider,{value:f.current,children:X("div",{className:fe("efp-overlay",{"is-open":r,"is-draggable":p,"is-small":s==="small","is-medium":s==="medium","is-full":s==="full","is-mobile":l,"is-desktop":!l,"is-hidden":!l&&!r,"is-animating":h,"is-scrolled":L,"is-forced-full":N&&l},ee),style:le,ref:F,children:[!W&&R("div",{className:"efp-overlay__draghandle",ref:J}),X("div",{className:"efp-overlay__scroll",ref:f,onScroll:e=>{ae(),de()},children:[D?R(ge,{}):null,R("div",{className:"efp-overlay__content",children:d||"No content"})]})]})}):null};export default ye;
@@ -1 +1 @@
1
- import{jsx as o,jsxs as v}from"react/jsx-runtime";import{useMemo as S,useCallback as a}from"react";import{observer as y}from"mobx-react-lite";import g,{uiState as e}from"../store";import h from"./Overlay";import k from"./Menu";import C from"./Search";import z from"./Exhibitor";import O from"./Booth/Booth";import b from"./Bookmarks";import x from"./Visited";import A from"./Language";import P from"./Category";import E from"./Wayfinding";import M from"./Filter";import R from"./Sessions";import j from"./Speakers";import B from"./Tours";import F from"./TourPoints";import I from"./RoutePlanner/RoutePlanner";import _ from"./Event";import w from"./Speaker";import T from"classnames";const $={full:"full",medium:"medium",small:"medium"},L=t=>$[t],N=y(({isGDPR:t,allowConsent:l})=>{const m=a(r=>{e.desiredOverlaySize=r},[]),n=a(r=>{e.setOverlayScrolled(r)},[]),c=L(e.overlaySize),f=e.selectedRoute?.from&&e.selectedRoute?.to,d=e.list.type==="search"&&!e.details?9:f?7:3,p=e.fullSizeOffset,u=S(()=>{const r={"-backdrop":e.canvasStarted&&e.shouldUseBackdrop&&!e.dimmed&&!e.galleryActive,"-no-transition":e.dimmed,"-gallery-active":e.galleryActive,collapsed:e.overlayCollapsed,kiosk:e.kiosk,start:e.overlayPosition==="left",bottom:e.overlayPosition!=="left",[e.overlaySize]:!0},i=T(r),s=e.overlayInterfaceClasses.join(" ");return s?`${i} ${s}`:i},[e.canvasStarted,e.shouldUseBackdrop,e.dimmed,e.galleryActive,e.overlayCollapsed,e.kiosk,e.inIdle,e.setKioskModeEnabled,e.overlayPosition,e.overlaySize,e.overlayInterfaceClasses]);return v(h,{open:e.isOverlayOpen,size:c,particles:e.isFeaturedExhibitorActive,className:u,mediumSizeMultiplier:d,fullSizeOffset:p,onChangeSize:m,onScrollStateChange:n,children:[o(k,{isGDPR:t,allowConsent:l}),o(C,{}),o(z,{}),o(O,{}),o(b,{}),o(x,{}),o(A,{}),o(P,{}),o(E,{}),o(M,{}),o(R,{showFilters:!0}),o(j,{showFilters:!0}),o(B,{}),o(F,{}),o(I,{}),o(_,{}),o(w,{})]},`overlay-container-language-${g.languageStore.language?.id}`)});export default N;
1
+ import{jsx as o,jsxs as v}from"react/jsx-runtime";import{useMemo as S,useCallback as a}from"react";import{observer as y}from"mobx-react-lite";import g,{uiState as e}from"../store";import h from"./Overlay";import k from"./Menu";import C from"./Search";import z from"./Exhibitor";import O from"./Booth/Booth";import b from"./Bookmarks";import x from"./Visited";import M from"./Language";import A from"./Category";import P from"./Wayfinding";import E from"./Filter";import R from"./Sessions";import j from"./Speakers";import w from"./Tours";import F from"./TourPoints";import B from"./RoutePlanner/RoutePlanner";import I from"./Event";import _ from"./Speaker";import T from"classnames";const $={full:"full",medium:"medium",small:"medium"},D=t=>$[t],L=y(({isGDPR:t,allowConsent:l})=>{const m=a(r=>{e.desiredOverlaySize=r},[]),n=a(r=>{e.setOverlayScrolled(r)},[]),c=D(e.overlaySize),d=e.selectedRoute?.from&&e.selectedRoute?.to,f=e.list.type==="search"&&!e.details?9:d?7:3,u=e.fullSizeOffset,p=S(()=>{const r={"-backdrop":e.canvasStarted&&e.shouldUseBackdrop&&!e.dimmed&&!e.galleryActive,"-no-transition":e.dimmed,"-gallery-active":e.galleryActive,collapsed:e.overlayCollapsed,kiosk:e.kiosk,start:e.overlayPosition==="left",bottom:e.overlayPosition!=="left",[e.overlaySize]:!0},i=T(r),s=e.overlayInterfaceClasses.join(" ");return s?`${i} ${s}`:i},[e.canvasStarted,e.shouldUseBackdrop,e.dimmed,e.galleryActive,e.overlayCollapsed,e.kiosk,e.inIdle,e.setKioskModeEnabled,e.overlayPosition,e.overlaySize,e.overlayInterfaceClasses]);return v(h,{open:e.isOverlayOpen,size:c,particles:e.isFeaturedExhibitorActive,className:p,mediumSizeMultiplier:f,fullSizeOffset:u,disableDrag:e.viewerMode&&e.menu,forceFull:e.viewerMode&&e.menu,onChangeSize:m,onScrollStateChange:n,children:[o(k,{isGDPR:t,allowConsent:l}),o(C,{}),o(z,{}),o(O,{}),o(b,{}),o(x,{}),o(M,{}),o(A,{}),o(P,{}),o(E,{}),o(R,{showFilters:!0}),o(j,{showFilters:!0}),o(w,{}),o(F,{}),o(B,{}),o(I,{}),o(_,{})]},`overlay-container-language-${g.languageStore.language?.id}`)});export default L;
@@ -1 +1 @@
1
- import{jsx as r,jsxs as s}from"react/jsx-runtime";import{useObserver as a}from"mobx-react-lite";import l,{uiState as i}from"../../store";import{t as p}from"../../utils/i18n";import m from"./RoutePlannerHeader";import u from"./RoutePlannerStartPoint";import f from"./RoutePlannerStopItem";import"./RoutePlanner.scss";function c(){return a(()=>{const n=l.routePlannerStore,t=n.items;return s("div",{className:"efp-planner",children:[t.length>0&&r(m,{}),s("div",{className:"efp-planner__stops",children:[t.length>0&&r(u,{startPoint:n.startPoint,onSelectStartPoint:e=>n.setStartPoint(e)}),t.map((e,o)=>r(f,{item:e,isLast:o===t.length-1},`${e.type}-${e.entity.id}-${o}`))]}),t.length===0&&r("div",{className:"efp-planner__empty",children:p("Add stops to build a route")})]})})}function d(){return a(()=>i.list.type==="route-planner"&&!i.menu?r(c,{}):null)}export default d;
1
+ import{jsx as o,jsxs as s}from"react/jsx-runtime";import{useObserver as i}from"mobx-react-lite";import a,{uiState as n}from"../../store";import{Route as u}from"../../store/RouteStore";import{t as m}from"../../utils/i18n";import p from"./RoutePlannerHeader";import c from"../WayfindingFloorSelector";import f from"./RoutePlannerStartPoint";import d from"./RoutePlannerStopItem";import"./RoutePlanner.scss";function P(){return i(()=>{const t=a.routePlannerStore,r=t.items;return s("div",{className:"efp-planner",children:[r.length>0&&o(p,{}),r.length>0&&t.routeFloors.length>1&&t.currentRouteFloor&&o(c,{floors:t.routeFloors,current:t.currentRouteFloor,onClickFloor:e=>t.setRouteFloor(e)}),s("div",{className:"efp-planner__stops",children:[r.length>0&&o(f,{startPoint:t.startPoint,onSelectStartPoint:e=>t.setStartPoint(e)}),r.map((e,l)=>o(d,{item:e,isLast:l===r.length-1},`${e.type}-${e.entity.id}-${l}`))]}),r.length===0&&o("div",{className:"efp-planner__empty",children:m("Add stops to build a route")})]})})}function h(){return i(()=>{const t=n.details&&!(n.details instanceof u);return n.list.type==="route-planner"&&!n.menu&&!t?o(P,{}):null})}export default h;
@@ -1 +1 @@
1
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import{observer as l}from"mobx-react-lite";import i from"../../store";const o=l(()=>{const r=i.routePlannerStore,{from:s,stops:t,distance:n}=r.subtitleParts;return a("div",{className:"efp-planner__header",children:[e("div",{className:"efp-planner__title",children:r.title}),a("div",{className:"efp-planner__details",children:[s&&e("span",{children:s}),e("span",{children:t}),n&&e("span",{children:n})]})]})});export default o;
1
+ import{jsx as e,jsxs as i}from"react/jsx-runtime";import{observer as l}from"mobx-react-lite";import o from"../../store";import d from"../Alert";import{t as c}from"../../utils/i18n";const p=l(()=>{const r=o.routePlannerStore,{from:n,stops:a,distance:s,travelTime:t}=r.subtitleParts;return i("div",{className:"efp-planner__header",children:[e("div",{className:"efp-planner__title",children:r.title}),i("div",{className:"efp-planner__details",children:[n&&e("span",{children:n}),e("span",{children:a}),s&&e("span",{children:s}),t&&e("span",{children:t})]}),r.excludedVisitedCount>0&&e("div",{className:"efp-planner__alert",children:e(d,{variant:"warning",inline:!0,showIcon:!1,size:"sm",children:c("{{count}} visited bookmarks excluded",{count:r.excludedVisitedCount})})})]})});export default p;
@@ -1 +1 @@
1
- import{jsx as o,jsxs as t}from"react/jsx-runtime";import p from"classnames";const d={exhibitor:"icon-exhibitor-solid",event:"icon-event-solid",booth:"icon-booth-solid"},m=({item:i,isLast:l})=>{const{type:e,entity:c,booth:n}=i,a=d[e]||"icon-booth-solid",r=c.name??"",s=(e==="exhibitor"||e==="event")&&n?n.name:null;return t("div",{className:p("efp-planner__stop",{"is-last":l}),children:[o("div",{className:"efp-planner__stop-timeline",children:o("div",{className:"efp-planner__stop-icon",style:{"--dot-color":`var(--color-${e})`},children:o("i",{className:a})})}),t("div",{className:"efp-planner__stop-content",children:[o("strong",{children:r}),s&&o("span",{children:s})]})]})};export default m;
1
+ import{jsx as o,Fragment as x,jsxs as l}from"react/jsx-runtime";import _ from"classnames";import u from"../Badge";import r from"../../store";const N={exhibitor:"icon-exhibitor-solid",event:"icon-event-solid",booth:"icon-booth-solid"},p=s=>/^\d+$/.test(s),y=({item:s,isLast:m})=>{const{type:n,entity:c,booth:t}=s,f=N[n]||"icon-booth-solid",h=c.name??"",i=(n==="exhibitor"||n==="event")&&t?t.name:null,e=t?.layer?.shortName??null,b=i||e,v=[h,i,e?p(e)?`Level ${e}`:e:null].filter(Boolean).join(", "),d=()=>{n==="exhibitor"?r.selectExhibitor(c):t&&r.selectBooth(t),r.showMap()};return l("div",{className:_("efp-planner__stop",{"is-last":m}),children:[o("div",{className:"efp-planner__stop-timeline",children:o("div",{className:"efp-planner__stop-icon",style:{"--dot-color":`var(--color-${n})`},children:o("i",{className:f})})}),l("div",{className:"efp-planner__stop-content",role:"button",tabIndex:0,"aria-label":v,onClick:d,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),d())},children:[o("strong",{children:h}),b&&l(u,{variant:"location",size:"xs",inline:!0,noMargins:!0,children:[i&&o("span",{children:i}),e&&l("span",{children:[p(e)&&o(x,{children:"Level\xA0"}),e]})]})]})]})};export default y;
@@ -1 +1 @@
1
- import{jsx as o,jsxs as i,Fragment as B}from"react/jsx-runtime";import _ from"classnames";import h from"dateformat";import{useEffect as C,useState as G}from"react";import{observer as O}from"mobx-react-lite";import z from"../utils/sanitizeHtml";import{t as w}from"../utils/i18n";import A from"./Button";import L from"./EventBadge";import"./Schedule.scss";import S from"../store";function W(l,d){const m=new Date;return l<=m&&m<=d}function q(l){const d=new Date;return new Date(l)<d}const J=O(({events:l=[],descriptionMaxLength:d=200,showMoreButton:m=!0,showBooths:k=!1,isSessions:g=!1,onEventClick:p})=>{const[j,F]=G({}),y=new Date,E=l.filter(e=>(e.endDate?new Date(e.endDate):new Date(e.startDate))>y),P=l.filter(e=>(e.endDate?new Date(e.endDate):new Date(e.startDate))<=y),f=E.reduce((e,t)=>{const[r]=t.startDate.split("T");return e[r]?e[r].push(t):e[r]=[t],e},{}),u=P.reduce((e,t)=>{const[r]=t.startDate.split("T");return e[r]?e[r].push(t):e[r]=[t],e},{});C(()=>{const e={};for(const t in f)e[t]=f[t].map(()=>({showFullDescription:!1}));for(const t in u)e[t]=u[t].map(()=>({showFullDescription:!1}));F(e)},[l.map(e=>e.id).join(",")]);const I=(e,t,r)=>{e.preventDefault(),e.stopPropagation(),F(a=>{const n={...a};return Array.isArray(n[t])||(n[t]=[]),n[t][r]||(n[t][r]={showFullDescription:!1}),n[t][r].showFullDescription=!n[t][r].showFullDescription,n})},M=(e,t)=>e.length>d&&!t?e.slice(0,d)+"...":e,b=e=>{const t=S.sessionsFilterStore.state.filters.use24hFormat.value,r=new Date(e);return h(r,t?"HH:MM":"h:MMtt")},T=e=>{const[t,r,a]=e.split("-"),n=new Date(parseInt(t),parseInt(r)-1,parseInt(a));return{day:a,month:h(n,"mmm"),weekday:h(n,"ddd"),full:h(n,"dddd, mmmm d")}},H=({children:e,link:t,current:r,ended:a,event:n})=>{const s=c=>{p&&(c.preventDefault(),p(n))};return t?o("a",{href:t,className:_("efp-schedule__event",r,a),target:"_blank",rel:"noopener noreferrer",onClick:s,children:e}):o("div",{className:_("efp-schedule__event",{ended:a}),onClick:s,children:e})},N=(e,t=!1)=>Object.entries(e).map(([r,a])=>{const n=T(r);return i("div",{className:"efp-schedule__item",children:[o("div",{className:"efp-schedule__date","aria-label":`Date: ${n.full}`,children:i("div",{className:"efp-schedule__date-sticky",children:[o("div",{children:n.day}),o("div",{children:n.month}),o("div",{children:n.weekday})]})}),o("div",{className:"efp-schedule__events",role:"list",children:a.map((s,c)=>{const v=s.boothId?S.boothStore.boothById.get(Number(s.boothId)):null,D=j[r]?.[c]?.showFullDescription??!1;return o("div",{role:"listitem","data-event-id":s.id,onClick:()=>p?.(s),style:{cursor:p?"pointer":"default"},children:i(H,{link:"",ended:s.isEnded||q(s.endDate||s.startDate),current:W(s.startDate,s.endDate),event:s,children:[i("span",{children:[b(s.startDate),s.endDate?` - ${b(s.endDate)}`:null]}),i("strong",{children:[s.name,o(L,{event:s})]}),o("div",{className:"efp-schedule__event-booth-and-tracks",children:v&&k&&o("div",{className:"efp-schedule__event-booth",children:o("div",{children:v.name})})}),s.logoFile&&o("div",{className:"efp-schedule__event-logo",children:o("img",{src:s.logoFile,alt:s.name,crossOrigin:"anonymous"})}),s.description&&!g&&i("div",{className:"efp-schedule__event-desc",children:[o("div",{dangerouslySetInnerHTML:{__html:z(M(s.description,D))}}),s.description.length>d&&m&&o(A,{variant:"gray-border",size:"sm",inline:!0,onClick:$=>I($,r,c),"aria-expanded":D,"aria-controls":`event-desc-${r}-${c}`,children:D?w("Show Less"):w("Show More")})]})]})},s.id)})})]},r)});return i("div",{className:_("efp-schedule",{"is-sessions":g}),children:[N(f),Object.keys(u).length>0&&i(B,{children:[o("div",{className:"efp-schedule__past-events-header",children:w("Past Sessions")}),N(u,!0)]})]})});export default J;
1
+ import{jsx as a,jsxs as i,Fragment as B}from"react/jsx-runtime";import _ from"classnames";import h from"dateformat";import{useEffect as C,useState as G}from"react";import{observer as O}from"mobx-react-lite";import z from"../utils/sanitizeHtml";import{t as w}from"../utils/i18n";import{Button as A,EventBadge as L}from"./";import"./Schedule.scss";import S from"../store";function W(l,d){const m=new Date;return l<=m&&m<=d}function q(l){const d=new Date;return new Date(l)<d}const J=O(({events:l=[],descriptionMaxLength:d=200,showMoreButton:m=!0,showBooths:k=!1,isSessions:g=!1,onEventClick:p})=>{const[j,F]=G({}),y=new Date,E=l.filter(e=>(e.endDate?new Date(e.endDate):new Date(e.startDate))>y),P=l.filter(e=>(e.endDate?new Date(e.endDate):new Date(e.startDate))<=y),f=E.reduce((e,t)=>{const[r]=t.startDate.split("T");return e[r]?e[r].push(t):e[r]=[t],e},{}),u=P.reduce((e,t)=>{const[r]=t.startDate.split("T");return e[r]?e[r].push(t):e[r]=[t],e},{});C(()=>{const e={};for(const t in f)e[t]=f[t].map(()=>({showFullDescription:!1}));for(const t in u)e[t]=u[t].map(()=>({showFullDescription:!1}));F(e)},[l.map(e=>e.id).join(",")]);const I=(e,t,r)=>{e.preventDefault(),e.stopPropagation(),F(o=>{const n={...o};return Array.isArray(n[t])||(n[t]=[]),n[t][r]||(n[t][r]={showFullDescription:!1}),n[t][r].showFullDescription=!n[t][r].showFullDescription,n})},M=(e,t)=>e.length>d&&!t?e.slice(0,d)+"...":e,b=e=>{const t=S.sessionsFilterStore.state.filters.use24hFormat.value,r=new Date(e);return h(r,t?"HH:MM":"h:MMtt")},T=e=>{const[t,r,o]=e.split("-"),n=new Date(parseInt(t),parseInt(r)-1,parseInt(o));return{day:o,month:h(n,"mmm"),weekday:h(n,"ddd"),full:h(n,"dddd, mmmm d")}},H=({children:e,link:t,current:r,ended:o,event:n})=>{const s=c=>{p&&(c.preventDefault(),p(n))};return t?a("a",{href:t,className:_("efp-schedule__event",r,o),target:"_blank",rel:"noopener noreferrer",onClick:s,children:e}):a("div",{className:_("efp-schedule__event",{ended:o}),onClick:s,children:e})},N=(e,t=!1)=>Object.entries(e).map(([r,o])=>{const n=T(r);return i("div",{className:"efp-schedule__item",children:[a("div",{className:"efp-schedule__date","aria-label":`Date: ${n.full}`,children:i("div",{className:"efp-schedule__date-sticky",children:[a("div",{children:n.day}),a("div",{children:n.month}),a("div",{children:n.weekday})]})}),a("div",{className:"efp-schedule__events",role:"list",children:o.map((s,c)=>{const v=s.boothId?S.boothStore.boothById.get(Number(s.boothId)):null,D=j[r]?.[c]?.showFullDescription??!1;return a("div",{role:"listitem","data-event-id":s.id,onClick:()=>p?.(s),style:{cursor:p?"pointer":"default"},children:i(H,{link:"",ended:s.isEnded||q(s.endDate||s.startDate),current:W(s.startDate,s.endDate),event:s,children:[i("span",{children:[b(s.startDate),s.endDate?` - ${b(s.endDate)}`:null]}),i("strong",{children:[s.name,a(L,{event:s})]}),a("div",{className:"efp-schedule__event-booth-and-tracks",children:v&&k&&a("div",{className:"efp-schedule__event-booth",children:a("div",{children:v.name})})}),s.logoFile&&a("div",{className:"efp-schedule__event-logo",children:a("img",{src:s.logoFile,alt:s.name,crossOrigin:"anonymous"})}),s.description&&!g&&i("div",{className:"efp-schedule__event-desc",children:[a("div",{dangerouslySetInnerHTML:{__html:z(M(s.description,D))}}),s.description.length>d&&m&&a(A,{variant:"gray-border",size:"sm",inline:!0,onClick:$=>I($,r,c),"aria-expanded":D,"aria-controls":`event-desc-${r}-${c}`,children:D?w("Show Less"):w("Show More")})]})]})},s.id)})})]},r)});return i("div",{className:_("efp-schedule",{"is-sessions":g}),children:[N(f),Object.keys(u).length>0&&i(B,{children:[a("div",{className:"efp-schedule__past-events-header",children:w("Past Sessions")}),N(u,!0)]})]})});export default J;
@@ -1 +1 @@
1
- import{jsx as a,jsxs as f}from"react/jsx-runtime";import b from"classnames";import{useObserver as D}from"mobx-react-lite";import k,{useEffect as C,useRef as v,useCallback as T}from"react";import s,{searchStore as e}from"../store";import{t as i}from"../utils/i18n";import{useAutorun as l}from"../utils/mobx";import z from"../tools/debounce";import{GaEventActions as j,sendEventToGa as K}from"../tools/gtag";import{handleCustomCommand as L}from"../utils/customCommands";import{Badge as P}from"./";import"./SearchBox.scss";const G=1e3;function R({className:g}){const B=v(),p=v(null);function I(t){let o=0;switch(t.key){case"Down":case"ArrowDown":o=1;break;case"Up":case"ArrowUp":o=-1;break;case"Enter":t.preventDefault(),s.openActiveListItem();const n=c();n&&L(n.value,!0);return;case"Escape":t.preventDefault(),e.closeSearch();return}o&&(t.preventDefault(),s.changeActiveListIndex(o))}function c(){return p.current}const[w,u]=k.useState(""),[h,E]=k.useState(!1);l(()=>{E(s.uiState.kiosk&&s.uiState.inIdle)}),C(()=>{if(!h){u("");return}const t=[i("Find Companies..."),i("Find Categories..."),i("Find Sessions..."),i("Search...")];let o=0,n=0,r=!1,S;const _=()=>{const d=t[o];r?(u(d.substring(0,n-1)),n--):(u(d.substring(0,n+1)),n++);let m=r?50:100;!r&&n===d.length?(r=!0,m=2e3):r&&n===0&&(r=!1,o=(o+1)%t.length,m=500),S=setTimeout(_,m)};return _(),()=>clearTimeout(S)},[h]),l(()=>{const t=document.activeElement;s.uiState.overlaySize!=="full"&&t===c()&&!e.isFocused&&c()?.blur()}),l(()=>{s.uiState.menu&&s.uiState.kiosk&&e.setFocused(!1)}),l(()=>{const t=c(),o=document.activeElement;t&&e.isFocused&&o!==t&&!e.skipInputFocus&&t.focus()}),C(()=>{s.fuzzySearchEngineStore.loadEngine()},[]);const N=T(z(()=>{e.searchText&&K(j.Search,e.searchText),window.__resett?.()},G),[]);function y(){e.setSearchText(c()?.value||""),N()}function A(){e.setFocused(!0),window.__resett?.()}function F(){e.isFocused||(e.handleSearchAction(),setTimeout(()=>{c()?.focus()},100))}function M(){e.handleBackAction()}function x(){e.closeSearch()}return D(()=>f("div",{className:b("search-box",g,e.searchBoxClass,{"efp-semi-transparent":s.uiState.setKioskModeEnabled}),ref:B,children:[a("button",{className:b("search-box__button","search-box__button--back",{"is-mobile-details":e.isMobileDetailsMode}),onClick:M,type:"button","aria-label":e.backMode==="back"?i("Go back"):i("Main menu"),children:a("i",{className:e.backMode==="back"?"icon-chevron-left":"icon-menu"})}),a("div",{className:"search-box__input-wrapper",children:e.shouldShowSearchInput?a("input",{ref:p,type:"search",className:"search-box__input",placeholder:h?w:e.placeholder,"aria-label":"Search",value:e.searchText,onChange:y,onKeyDown:I,onFocus:A,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",disabled:s.uiState.setKioskModeEnabled}):f("div",{className:"search-box__title",children:[e.searchBoxIcon&&a("i",{className:b("search-box__title-icon",e.searchBoxIcon)}),f("div",{className:"search-box__title-content",children:[a("strong",{className:"search-box__title-text",children:e.searchBoxTitle}),e.searchBoxSubtitle&&a("span",{className:"search-box__title-subtitle",children:e.searchBoxSubtitle})]}),e.searchBoxBadge?a(P,{variant:"lightgray",size:"md",rounded:!0,noMargins:!0,children:e.searchBoxBadge}):null]})}),!e.shouldShowSearchInput&&e.searchBoxActions.map(t=>a("button",{className:"search-box__button search-box__button--ui-action",onClick:t.handler,type:"button","aria-label":t.label,title:t.label,children:a("i",{className:t.icon})},t.id)),a("button",{className:"search-box__button search-box__button--action",onClick:e.shouldShowSearchInput?e.shouldShowCloseButton?x:F:x,type:"button","aria-label":e.ariaLabel,children:a("i",{className:e.actionButtonIcon})})]}))}export default R;
1
+ import{jsx as a,jsxs as f}from"react/jsx-runtime";import b from"classnames";import{useObserver as D}from"mobx-react-lite";import k,{useEffect as v,useRef as C,useCallback as T}from"react";import o,{searchStore as e}from"../store";import{t as i}from"../utils/i18n";import{useAutorun as l}from"../utils/mobx";import z from"../tools/debounce";import{GaEventActions as j,sendEventToGa as K}from"../tools/gtag";import{handleCustomCommand as L}from"../utils/customCommands";import{Badge as P}from"./";import"./SearchBox.scss";const G=1e3;function R({className:g}){const B=C(),p=C(null);function w(t){let s=0;switch(t.key){case"Down":case"ArrowDown":s=1;break;case"Up":case"ArrowUp":s=-1;break;case"Enter":t.preventDefault(),o.openActiveListItem();const n=c();n&&L(n.value,!0);return;case"Escape":t.preventDefault(),e.closeSearch();return}s&&(t.preventDefault(),o.changeActiveListIndex(s))}function c(){return p.current}const[I,u]=k.useState(""),[h,E]=k.useState(!1);l(()=>{E(o.uiState.kiosk&&o.uiState.inIdle)}),v(()=>{if(!h){u("");return}const t=[i("Find Companies..."),i("Find Categories..."),i("Find Sessions..."),i("Search...")];let s=0,n=0,r=!1,S;const _=()=>{const d=t[s];r?(u(d.substring(0,n-1)),n--):(u(d.substring(0,n+1)),n++);let m=r?50:100;!r&&n===d.length?(r=!0,m=2e3):r&&n===0&&(r=!1,s=(s+1)%t.length,m=500),S=setTimeout(_,m)};return _(),()=>clearTimeout(S)},[h]),l(()=>{const t=document.activeElement;o.uiState.overlaySize!=="full"&&t===c()&&!e.isFocused&&c()?.blur()}),l(()=>{o.uiState.menu&&o.uiState.kiosk&&e.setFocused(!1)}),l(()=>{const t=c(),s=document.activeElement;t&&e.isFocused&&s!==t&&!e.skipInputFocus&&t.focus()}),v(()=>{o.fuzzySearchEngineStore.loadEngine()},[]);const N=T(z(()=>{e.searchText&&K(j.Search,e.searchText),window.__resett?.()},G),[]);function y(){e.setSearchText(c()?.value||""),N()}function M(){e.setFocused(!0),window.__resett?.()}function A(){e.isFocused||(e.handleSearchAction(),setTimeout(()=>{c()?.focus()},100))}function F(){e.handleBackAction()}function x(){e.closeSearch()}return D(()=>f("div",{className:b("search-box",g,e.searchBoxClass,{"efp-semi-transparent":o.uiState.setKioskModeEnabled}),ref:B,children:[a("button",{className:b("search-box__button","search-box__button--back",{"is-mobile-details":e.isMobileDetailsMode}),onClick:F,type:"button","aria-label":e.backMode==="back"?i("Go back"):i("Main menu"),children:a("i",{className:e.backMode==="back"?"icon-chevron-left":o.uiState.viewerMode?"icon-home":"icon-menu"})}),a("div",{className:"search-box__input-wrapper",children:e.shouldShowSearchInput?a("input",{ref:p,type:"search",className:"search-box__input",placeholder:h?I:e.placeholder,"aria-label":"Search",value:e.searchText,onChange:y,onKeyDown:w,onFocus:M,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false",disabled:o.uiState.setKioskModeEnabled}):f("div",{className:"search-box__title",children:[e.searchBoxIcon&&a("i",{className:b("search-box__title-icon",e.searchBoxIcon)}),f("div",{className:"search-box__title-content",children:[a("strong",{className:"search-box__title-text",children:e.searchBoxTitle}),e.searchBoxSubtitle&&a("span",{className:"search-box__title-subtitle",children:e.searchBoxSubtitle})]}),e.searchBoxBadge?a(P,{variant:"lightgray",size:"md",rounded:!0,noMargins:!0,children:e.searchBoxBadge}):null]})}),!e.shouldShowSearchInput&&e.searchBoxActions.map(t=>a("button",{className:"search-box__button search-box__button--ui-action",onClick:t.handler,type:"button","aria-label":t.label,title:t.label,children:a("i",{className:t.icon})},t.id)),a("button",{className:"search-box__button search-box__button--action",onClick:e.shouldShowSearchInput?e.shouldShowCloseButton?x:A:x,type:"button","aria-label":e.ariaLabel,children:a("i",{className:e.actionButtonIcon})})]}))}export default R;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import "./ViewerMenuPanel.scss";
3
+ declare const ViewerMenuPanel: React.FC;
4
+ export default ViewerMenuPanel;
5
+ //# sourceMappingURL=ViewerMenuPanel.d.ts.map
@@ -0,0 +1 @@
1
+ import{jsx as e,Fragment as w,jsxs as s}from"react/jsx-runtime";import{observer as _}from"mobx-react-lite";import a from"../data";import o,{uiState as x}from"../store";import{t as r}from"../utils/i18n";import{Button as l}from"./";import"./ViewerMenuPanel.scss";function N(n){if(!n)return{venue:"",dateRange:""};const t=n.split(" | ");return{venue:t[0]?.trim()||"",dateRange:t[1]?.trim()||""}}function D(n,t){if(!n||!t)return!1;const c=Date.now();return c>=new Date(n).getTime()&&c<=new Date(t+"T23:59:59").getTime()}const S=_(()=>{const{venue:n,dateRange:t}=N(a.subtitle),u=!(!!a.startDate&&!!a.endDate),d=D(a.startDate,a.endDate),m=o.eventStore.eventItems.length>0,v=o.toursStore.hasTours;function p(i){i.preventDefault(),x.menu=!1}function h(i){i.preventDefault(),o.selectExhibitors()}function f(i){i.preventDefault(),o.selectSessions()}function g(i){i.preventDefault(),o.selectTours()}return s("div",{className:"viewer-panel",children:[s("div",{className:"viewer-panel__info",children:[e("div",{className:"viewer-panel__title",children:a.title}),s("div",{className:"viewer-panel__row",children:[e("i",{className:"viewer-panel__icon icon-schedule"}),u?e("span",{children:r("Ongoing")}):s(w,{children:[e("span",{children:t}),d&&e("div",{className:"viewer-panel__now-badge",children:r("Now")})]})]}),n&&s("div",{className:"viewer-panel__row",children:[e("i",{className:"viewer-panel__icon icon-marker-pin"}),e("span",{children:n})]})]}),s("div",{className:"viewer-panel__buttons",children:[e(l,{variant:"gray",size:"lg",text:r("Map"),onClick:p}),e(l,{variant:"gray",size:"lg",text:r("Exhibitors"),onClick:h}),m&&e(l,{variant:"gray",size:"lg",text:r("Sessions"),onClick:f}),v&&e(l,{variant:"gray",size:"lg",text:r("Guided tours"),onClick:g})]})]})});export default S;
@@ -32,4 +32,6 @@ export declare const FONT_WEIGHT_PRIMARY_EXHIBITOR = "--expofp-exhibitor-main-we
32
32
  export declare const FONT_WEIGHT_SECONDARY_EXHIBITOR = "--expofp-exhibitor-details-weight";
33
33
  export declare const FONT_WEIGHT_PRIMARY_SPECIAL = "--expofp-booth-special-weight";
34
34
  export declare const ORIENTATION_GRANTED_KEY = "efp-compass-permission-granted";
35
+ export declare const VIEWER_MODE_QUERY = "viewermode";
36
+ export declare const VIEWER_MODE_STORAGE_KEY = "___viewer_mode";
35
37
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- export const VISIBILITY_STORAGE_KEY="___visibility",PREVIEW_MODE_QUERY="previewMode",PREVIEW_MODE_STORAGE_KEY="___preview_mode",PREVIEW_MODE_ATTRIBUTE="data-preview-mode",BOOTHS_PAINTER_MARKER="booths",SEPARATOR=":",LAYER_LOGOS_MARKER="logos",LAYER_ICONS_MARKER="icons",STRING_META_DELIMITER="$$",KIOSK_ENABLE_KEY="kiosk",SET_KIOSK_KEY="setkiosk",BOOKMARK_PAINTER_MARKER="booth-bookmark",MAP_SETTINGS_KEY="expofp-map-settings",DEBUG_KEY="debug",DEFAULT_UNITS="ft",BUILD_ROUTE_KEY="build-route",PLANNER_KEY="planner",PLANNER_SOURCE_KEY="source",PLANNER_FROM_KEY="from",PATHWAY_KEY="pathway",CACHE_DURATION=1e3,MOBILE_BREAKPOINT=768,LANG_KEY="lang",UI_SCALE_PARAM_KEY="uiscale",UI_SCALE_RESET_PARAM_KEY="resetuiscale",UI_SCALE_STORAGE_KEY="___ui-scale",MAX_ROUTE_WAYPOINTS=8,FONT_FACE="--expofp-font-face",FONT_WEIGHT_PRIMARY_BOOTH="--expofp-booth-main-weight",FONT_WEIGHT_SECONDARY_BOOTH="--expofp-booth-details-weight",FONT_WEIGHT_PRIMARY_EXHIBITOR="--expofp-exhibitor-main-weight",FONT_WEIGHT_SECONDARY_EXHIBITOR="--expofp-exhibitor-details-weight",FONT_WEIGHT_PRIMARY_SPECIAL="--expofp-booth-special-weight",ORIENTATION_GRANTED_KEY="efp-compass-permission-granted";
1
+ export const VISIBILITY_STORAGE_KEY="___visibility",PREVIEW_MODE_QUERY="previewMode",PREVIEW_MODE_STORAGE_KEY="___preview_mode",PREVIEW_MODE_ATTRIBUTE="data-preview-mode",BOOTHS_PAINTER_MARKER="booths",SEPARATOR=":",LAYER_LOGOS_MARKER="logos",LAYER_ICONS_MARKER="icons",STRING_META_DELIMITER="$$",KIOSK_ENABLE_KEY="kiosk",SET_KIOSK_KEY="setkiosk",BOOKMARK_PAINTER_MARKER="booth-bookmark",MAP_SETTINGS_KEY="expofp-map-settings",DEBUG_KEY="debug",DEFAULT_UNITS="ft",BUILD_ROUTE_KEY="build-route",PLANNER_KEY="planner",PLANNER_SOURCE_KEY="source",PLANNER_FROM_KEY="from",PATHWAY_KEY="pathway",CACHE_DURATION=1e3,MOBILE_BREAKPOINT=768,LANG_KEY="lang",UI_SCALE_PARAM_KEY="uiscale",UI_SCALE_RESET_PARAM_KEY="resetuiscale",UI_SCALE_STORAGE_KEY="___ui-scale",MAX_ROUTE_WAYPOINTS=8,FONT_FACE="--expofp-font-face",FONT_WEIGHT_PRIMARY_BOOTH="--expofp-booth-main-weight",FONT_WEIGHT_SECONDARY_BOOTH="--expofp-booth-details-weight",FONT_WEIGHT_PRIMARY_EXHIBITOR="--expofp-exhibitor-main-weight",FONT_WEIGHT_SECONDARY_EXHIBITOR="--expofp-exhibitor-details-weight",FONT_WEIGHT_PRIMARY_SPECIAL="--expofp-booth-special-weight",ORIENTATION_GRANTED_KEY="efp-compass-permission-granted",VIEWER_MODE_QUERY="viewermode",VIEWER_MODE_STORAGE_KEY="___viewer_mode";
@@ -15,6 +15,7 @@ export default class FloorPlanLoader implements FloorPlan {
15
15
  readonly allowConsent: boolean | undefined;
16
16
  readonly onInit: (fp: FloorPlan) => void;
17
17
  readonly disableRuntimeAlerts: boolean;
18
+ readonly viewerMode: boolean;
18
19
  protected efpStyleLoadHandler: (e: Event) => void;
19
20
  protected resolveReady: () => void;
20
21
  readonly icons: Map<FloorPlanIcon, HTMLImageElement>;
@@ -32,6 +33,7 @@ export default class FloorPlanLoader implements FloorPlan {
32
33
  onExhibitorCustomButtonClick: (e: FloorPlanCustomButtonEvent) => void;
33
34
  onGetCoordsClick: (e: FloorPlanGetCoordsEvent) => void;
34
35
  onMarkerClick: (e: FloorPlanMarkerEvent) => void;
36
+ onLeaveEvent: () => void;
35
37
  selectBooth(nameOrExternalId: string | string[]): void;
36
38
  selectExhibitor(nameOrExternalId: string | string[]): void;
37
39
  selectRoute(startOrWaypoints: RouteWaypoint | RouteWaypoint[], to?: RouteWaypoint): void;
@@ -1 +1 @@
1
- import{PREVIEW_MODE_ATTRIBUTE as M}from"./constants";import l from"./tools/base-runtime-url";import{buildRebookingUrl as V,getRebookingToken as H,retainRebookingToken as z}from"./tools/rebookingUrl";import{loadCss as x,loadFont as g,loadJs as b}from"./tools/loaders";import U from"./tools/logger";import{sleep as G}from"./utils";import{initI18n as N}from"./utils/i18n";import S from"./utils/is-webview";import{loadCustomCss as Q}from"./utils/loadCustomCss";import{loadIcons as q}from"./utils/loadIcons";import W from"./utils/mergeExhibitors";import L from"./utils/use-shadow";import $ from"./utils/is-debug";import J from"./utils/is-localhost";import{initSentry as K}from"./tools/sentry";function t(){throw new Error("FloorPlan not ready")}export default class Y{options;renderTarget;_ready;element;eventId;dataUrl;noOverlay;offHistory;ignoreQuery;allowConsent;onInit;disableRuntimeAlerts;efpStyleLoadHandler;resolveReady;icons=new Map;enableRotation=!0;alwaysShowSidebar=!1;get ready(){return this._ready}get previewMode(){return this.options.previewMode||this.element.hasAttribute(M)}onBoothClick;onBookmarkClick;onVisitedClick;onCategoryClick;onFpConfigured;onDirection;onDetails;onExhibitorCustomButtonClick;onGetCoordsClick;onMarkerClick;selectBooth(e){t()}selectExhibitor(e){t()}selectRoute(e,a){t()}getOptimizedRoutes(e){t()}selectCurrentPosition(e,a,h){t()}setBookmarks(e){t()}setEntitiesBookmarks(e){t()}setEntitiesVisited(e){t()}setMarkers(e){t()}updateLayerVisibility(e,a){t()}getCenterCoordinates(){t()}applyParameters(e){t()}exhibitorsList(){t()}boothsList(){t()}categoriesList(){t()}selectCategory(e){t()}getVisibility(){t()}setVisibility(e){t()}findLocation(){t()}zoomIn(){t()}zoomOut(){t()}zoomTo(e,a){t()}switchView(){t()}fitBounds(){t()}getBounds(e){t()}getBoothRect(e){t()}convertToGeo(e,a){t()}unstable_destroy(){t()}highlightExhibitors(e){t()}highlightBooths(e){t()}onCurrentPositionChanged(e){t()}search(e){t()}getFloors(){t()}onFloorActivated(e){t()}activateFloor(e){t()}showPathway(e,a){t()}showPathwayOnly(e,a){t()}hidePathways(){t()}showSearch(){t()}changeLanguage(e){t()}isGpsTrackingEnabled(){t()}setGpsTrackingEnabled(e){t()}deselectCurrentPosition(){t()}deselectRoute(){t()}reset(){t()}constructor(e){this.options=e,this.noOverlay=!!e.noOverlay,this.offHistory=!!e.offHistory,this.ignoreQuery=e.ignoreQuery,this.allowConsent=J&&!$?!1:e.allowConsent,this.onBoothClick=e.onBoothClick,this.onBookmarkClick=e.onBookmarkClick,this.onVisitedClick=e.onVisitedClick,this.onCategoryClick=e.onCategoryClick,this.onDetails=e.onDetails,this.onExhibitorCustomButtonClick=e.onExhibitorCustomButtonClick,this.onGetCoordsClick=e.onGetCoordsClick,this.onMarkerClick=e.onMarkerClick,this.onFpConfigured=e.onFpConfigured,this.onDirection=e.onDirection,this.onInit=e.onInit,this.onCurrentPositionChanged=e.onCurrentPositionChanged,this.onFloorActivated=e.onFloorActivated,this.disableRuntimeAlerts=e.disableRuntimeAlerts??!0,this._ready=new Promise((d,i)=>{this.resolveReady=d});const a=e.element;if(this.element=a,a.__expofp)throw new Error("Element already in use");if(a.__expofp=this,a.getAttribute("data-event-id")||a.getAttribute("data-event"))throw new Error("data-xxx attributes are removed, use options instead");const h=e.expo||e.event;if(!h)throw new Error("`expo` option is required");K({eventId:h||"",isWebview:S}),this.eventId=h,window.__efpEvent=h,window.__efpElement=a;const E=[...a.classList];a.classList.remove(...E),a.classList.add("expofp-floorplan-default",...E);const B=document.head||document.getElementsByTagName("head")[0],P=document.createElement("style");B.prepend(P),P.textContent=".expofp-floorplan-default { width: 100%; height: 100%;}";const m=document.createElement("div");m.style.height="100%",m.style.width="100%",a.appendChild(m);let s;if(S&&(this.allowConsent=!0),e.allowConsent===void 0){const i=new URL(window.location.href).searchParams.get("allowConsent");i&&(this.allowConsent=i==="true")}if(L){s=m.attachShadow({mode:"open"});const d=s,i=document;d.createElement=(...r)=>i.createElement(...r),d.createElementNS=(...r)=>i.createElementNS(...r),d.createTextNode=(...r)=>i.createTextNode(...r)}else s=m;const y=document.createElement("div");if(y.style.height="100%",y.style.width="100%",s.appendChild(y),L&&Object.defineProperty(y,"ownerDocument",{value:s}),this.renderTarget=y,a.getAttribute("data-data-url"))throw new Error("data-xxx attributes are removed, use options instead");const u=e.legacyDataUrlBase;window.__dataUrlBase=u,this.dataUrl=u,U.log("Instantiating ExpoFP floorplan",e.element,h);const O=u+"data.js",j=u+"wf.data.js",R=u+"fp.svg.js",D=[b(j),b(O),b(R)];let v=0;this.efpStyleLoadHandler=function(d){const i=window.__efpStyleElements;for(;v<i.length;){const r=i[v];s.appendChild(r),v++}},window.addEventListener("__efpStyleLoad",this.efpStyleLoadHandler);const k=this;(async function(){await Promise.all(D);let i=0;for(;window.__fpPending&&!window.__fp;)await G(2e3),await b(R+`?v=${++i}`);const r=window.__data;await N();const f=new URLSearchParams(window.location.search);let w,C;if(r?.trackerUrl)try{w=new URL(r.trackerUrl),C=w.searchParams.get("expoId")}catch(o){console.error(o)}const I=async o=>{if(!w||!C)return Promise.reject(new Error("trackerUrl or expoId is missing"));const n=new URL(o.dataUrl,w.origin),c=await fetch(n.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expoId:C,token:decodeURIComponent(f.get("t"))})});let p=[];c.ok&&(p=(await c.json()).map(o.dataMapper)),window.__heatmapDataYah={yah:p}};if(f.get("heatmap")==="true")try{if(f.get("type")==="yah")f.get("subtype")==="kiosk"?await I({dataUrl:"/api/kiosks/list/viewer",dataMapper:o=>({...o,id:o.key,name:`Kiosk ${o.key}`})}):await I({dataUrl:"/api/v1/you-are-here/qr-code/list/viewer",dataMapper:(o,n)=>({...o,name:`QR Code #${n+1}`})});else{const o=new URL("/api/fp-stats/get",w.origin);o.searchParams.set("expoId",C),o.searchParams.set("type","booview"),o.searchParams.set("t",decodeURIComponent(f.get("t")));const n=new URL("api/fp-stats/get",w.origin);n.searchParams.set("expoId",C),n.searchParams.set("type","exview"),n.searchParams.set("t",decodeURIComponent(f.get("t")));const[c,p]=await Promise.all([fetch(o.toString()),fetch(n.toString())]),[_,A]=await Promise.all([c.json(),p.json()]);window.__heatmapData={booths:_,exhibitors:A}}}catch(o){console.error("Heatmap: Initialization error",o)}try{const o=H();if(o){z(o);const n=V("api/rebooking-data",{rt:o,expoKey:h}),c=await fetch(n);if(c.ok){const p=await c.json();W(r,p)}r.isRebooking=c.ok}else r.isRebooking=!1}catch(o){console.error(o)}const T=[x(l+"vendor/sanitize-css/sanitize.css",s),x(l+"vendor/perfect-scrollbar/css/perfect-scrollbar.css",s),x(l+"vendor/mapbox/mapbox-gl.css",s),g("Oswald",l+"fonts/oswald-v17-cyrillic_latin-300.woff",{weight:300}),g("Oswald",l+"fonts/oswald-v17-cyrillic_latin-500.woff",{weight:500}),g("Inter",l+"fonts/inter-400.woff2",{weight:400}),g("Inter",l+"fonts/inter-500.woff2",{weight:500}),g("Inter",l+"fonts/inter-600.woff2",{weight:600}),g("efp-symbols",l+"fonts/efp-symbols.woff",{weight:400}),Q(r),q(k.icons)];await Promise.all(T),k.enableRotation=r?.enableRotation??!1,k.alwaysShowSidebar=r?.alwaysShowSidebar??!1,U.log("Data loaded");const{default:F}=await import("./floorplan.ready");for(document.querySelectorAll(".expofp-floorplan-loader").forEach(o=>o.remove());a.firstChild&&a.firstChild!==m;)a.removeChild(a.firstChild);Object.setPrototypeOf(k,F.prototype).init()})()}}
1
+ import{PREVIEW_MODE_ATTRIBUTE as A}from"./constants";import l from"./tools/base-runtime-url";import{buildRebookingUrl as V,getRebookingToken as H,retainRebookingToken as z}from"./tools/rebookingUrl";import{loadCss as x,loadFont as g,loadJs as b}from"./tools/loaders";import U from"./tools/logger";import{sleep as G}from"./utils";import{initI18n as N}from"./utils/i18n";import S from"./utils/is-webview";import{loadCustomCss as Q}from"./utils/loadCustomCss";import{loadIcons as q}from"./utils/loadIcons";import W from"./utils/mergeExhibitors";import L from"./utils/use-shadow";import $ from"./utils/is-debug";import J from"./utils/is-localhost";import{initSentry as K}from"./tools/sentry";function t(){throw new Error("FloorPlan not ready")}export default class Y{options;renderTarget;_ready;element;eventId;dataUrl;noOverlay;offHistory;ignoreQuery;allowConsent;onInit;disableRuntimeAlerts;viewerMode;efpStyleLoadHandler;resolveReady;icons=new Map;enableRotation=!0;alwaysShowSidebar=!1;get ready(){return this._ready}get previewMode(){return this.options.previewMode||this.element.hasAttribute(A)}onBoothClick;onBookmarkClick;onVisitedClick;onCategoryClick;onFpConfigured;onDirection;onDetails;onExhibitorCustomButtonClick;onGetCoordsClick;onMarkerClick;onLeaveEvent;selectBooth(e){t()}selectExhibitor(e){t()}selectRoute(e,a){t()}getOptimizedRoutes(e){t()}selectCurrentPosition(e,a,h){t()}setBookmarks(e){t()}setEntitiesBookmarks(e){t()}setEntitiesVisited(e){t()}setMarkers(e){t()}updateLayerVisibility(e,a){t()}getCenterCoordinates(){t()}applyParameters(e){t()}exhibitorsList(){t()}boothsList(){t()}categoriesList(){t()}selectCategory(e){t()}getVisibility(){t()}setVisibility(e){t()}findLocation(){t()}zoomIn(){t()}zoomOut(){t()}zoomTo(e,a){t()}switchView(){t()}fitBounds(){t()}getBounds(e){t()}getBoothRect(e){t()}convertToGeo(e,a){t()}unstable_destroy(){t()}highlightExhibitors(e){t()}highlightBooths(e){t()}onCurrentPositionChanged(e){t()}search(e){t()}getFloors(){t()}onFloorActivated(e){t()}activateFloor(e){t()}showPathway(e,a){t()}showPathwayOnly(e,a){t()}hidePathways(){t()}showSearch(){t()}changeLanguage(e){t()}isGpsTrackingEnabled(){t()}setGpsTrackingEnabled(e){t()}deselectCurrentPosition(){t()}deselectRoute(){t()}reset(){t()}constructor(e){this.options=e,this.noOverlay=!!e.noOverlay,this.offHistory=!!e.offHistory,this.ignoreQuery=e.ignoreQuery,this.allowConsent=J&&!$?!1:e.allowConsent,this.onBoothClick=e.onBoothClick,this.onBookmarkClick=e.onBookmarkClick,this.onVisitedClick=e.onVisitedClick,this.onCategoryClick=e.onCategoryClick,this.onDetails=e.onDetails,this.onExhibitorCustomButtonClick=e.onExhibitorCustomButtonClick,this.onGetCoordsClick=e.onGetCoordsClick,this.onMarkerClick=e.onMarkerClick,this.onFpConfigured=e.onFpConfigured,this.onDirection=e.onDirection,this.onInit=e.onInit,this.onCurrentPositionChanged=e.onCurrentPositionChanged,this.onFloorActivated=e.onFloorActivated,this.onLeaveEvent=e.onLeaveEvent,this.viewerMode=!!e.viewerMode,this.disableRuntimeAlerts=e.disableRuntimeAlerts??!0,this._ready=new Promise((d,i)=>{this.resolveReady=d});const a=e.element;if(this.element=a,a.__expofp)throw new Error("Element already in use");if(a.__expofp=this,a.getAttribute("data-event-id")||a.getAttribute("data-event"))throw new Error("data-xxx attributes are removed, use options instead");const h=e.expo||e.event;if(!h)throw new Error("`expo` option is required");K({eventId:h||"",isWebview:S}),this.eventId=h,window.__efpEvent=h,window.__efpElement=a;const E=[...a.classList];a.classList.remove(...E),a.classList.add("expofp-floorplan-default",...E);const B=document.head||document.getElementsByTagName("head")[0],P=document.createElement("style");B.prepend(P),P.textContent=".expofp-floorplan-default { width: 100%; height: 100%;}";const m=document.createElement("div");m.style.height="100%",m.style.width="100%",a.appendChild(m);let s;if(S&&(this.allowConsent=!0),e.allowConsent===void 0){const i=new URL(window.location.href).searchParams.get("allowConsent");i&&(this.allowConsent=i==="true")}if(L){s=m.attachShadow({mode:"open"});const d=s,i=document;d.createElement=(...r)=>i.createElement(...r),d.createElementNS=(...r)=>i.createElementNS(...r),d.createTextNode=(...r)=>i.createTextNode(...r)}else s=m;const y=document.createElement("div");if(y.style.height="100%",y.style.width="100%",s.appendChild(y),L&&Object.defineProperty(y,"ownerDocument",{value:s}),this.renderTarget=y,a.getAttribute("data-data-url"))throw new Error("data-xxx attributes are removed, use options instead");const u=e.legacyDataUrlBase;window.__dataUrlBase=u,this.dataUrl=u,U.log("Instantiating ExpoFP floorplan",e.element,h);const O=u+"data.js",j=u+"wf.data.js",R=u+"fp.svg.js",D=[b(j),b(O),b(R)];let v=0;this.efpStyleLoadHandler=function(d){const i=window.__efpStyleElements;for(;v<i.length;){const r=i[v];s.appendChild(r),v++}},window.addEventListener("__efpStyleLoad",this.efpStyleLoadHandler);const k=this;(async function(){await Promise.all(D);let i=0;for(;window.__fpPending&&!window.__fp;)await G(2e3),await b(R+`?v=${++i}`);const r=window.__data;await N();const f=new URLSearchParams(window.location.search);let w,C;if(r?.trackerUrl)try{w=new URL(r.trackerUrl),C=w.searchParams.get("expoId")}catch(o){console.error(o)}const I=async o=>{if(!w||!C)return Promise.reject(new Error("trackerUrl or expoId is missing"));const n=new URL(o.dataUrl,w.origin),c=await fetch(n.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expoId:C,token:decodeURIComponent(f.get("t"))})});let p=[];c.ok&&(p=(await c.json()).map(o.dataMapper)),window.__heatmapDataYah={yah:p}};if(f.get("heatmap")==="true")try{if(f.get("type")==="yah")f.get("subtype")==="kiosk"?await I({dataUrl:"/api/kiosks/list/viewer",dataMapper:o=>({...o,id:o.key,name:`Kiosk ${o.key}`})}):await I({dataUrl:"/api/v1/you-are-here/qr-code/list/viewer",dataMapper:(o,n)=>({...o,name:`QR Code #${n+1}`})});else{const o=new URL("/api/fp-stats/get",w.origin);o.searchParams.set("expoId",C),o.searchParams.set("type","booview"),o.searchParams.set("t",decodeURIComponent(f.get("t")));const n=new URL("api/fp-stats/get",w.origin);n.searchParams.set("expoId",C),n.searchParams.set("type","exview"),n.searchParams.set("t",decodeURIComponent(f.get("t")));const[c,p]=await Promise.all([fetch(o.toString()),fetch(n.toString())]),[_,F]=await Promise.all([c.json(),p.json()]);window.__heatmapData={booths:_,exhibitors:F}}}catch(o){console.error("Heatmap: Initialization error",o)}try{const o=H();if(o){z(o);const n=V("api/rebooking-data",{rt:o,expoKey:h}),c=await fetch(n);if(c.ok){const p=await c.json();W(r,p)}r.isRebooking=c.ok}else r.isRebooking=!1}catch(o){console.error(o)}const T=[x(l+"vendor/sanitize-css/sanitize.css",s),x(l+"vendor/perfect-scrollbar/css/perfect-scrollbar.css",s),x(l+"vendor/mapbox/mapbox-gl.css",s),g("Oswald",l+"fonts/oswald-v17-cyrillic_latin-300.woff",{weight:300}),g("Oswald",l+"fonts/oswald-v17-cyrillic_latin-500.woff",{weight:500}),g("Inter",l+"fonts/inter-400.woff2",{weight:400}),g("Inter",l+"fonts/inter-500.woff2",{weight:500}),g("Inter",l+"fonts/inter-600.woff2",{weight:600}),g("efp-symbols",l+"fonts/efp-symbols.woff",{weight:400}),Q(r),q(k.icons)];await Promise.all(T),k.enableRotation=r?.enableRotation??!1,k.alwaysShowSidebar=r?.alwaysShowSidebar??!1,U.log("Data loaded");const{default:M}=await import("./floorplan.ready");for(document.querySelectorAll(".expofp-floorplan-loader").forEach(o=>o.remove());a.firstChild&&a.firstChild!==m;)a.removeChild(a.firstChild);Object.setPrototypeOf(k,M.prototype).init()})()}}
@@ -1 +1 @@
1
- import{jsx as p,Fragment as L,jsxs as T}from"react/jsx-runtime";import{reaction as C}from"mobx";import{createRoot as R}from"react-dom/client";import{install as I}from"resize-observer";import V from"./components/Layout";import $ from"./floorplan.loader";import{applyParameters as M,destroyHistory as j,initRouting as z}from"./services/routing";import t from"./store";import{Route as S,findBooth as x,separateExternalIds as E}from"./store/RouteStore";import{destroyUiHandlers as G}from"./store/init/init-ui";import{GaEventActions as P,destroyGtag as _,sendEventToGa as w,setConsentSettings as q}from"./tools/gtag";import N from"./tools/report-error";import{resetGlobalVariables as Y}from"./tools/reset";import H from"./tools/track-event";import{fpGeo as v}from"./components/Mapbox/utils/fpGeo";import{convertLocalToGps as O,isValidPointCoords as d}from"./utils/gps";import m from"./core/Rect";import{mapEntity as y}from"./utils/mapEntity";import{LANG_KEY as X,MAX_ROUTE_WAYPOINTS as g,PATHWAY_KEY as U}from"./constants";import{getStorage as B}from"./utils/entity-storage";import{ErrorBoundary as K}from"@sentry/react";import{POISelectorsSchema as F,BoundsSchema as D,ZoomToOptionsSchema as A}from"./schemas/sdk.schemas";import W from"debug";import{buildOptimizedRoute as Q}from"./utils/buildOptimizedRoute";const b=W("efp:api");I();export default class Z extends ${root;init(){this.ignoreQuery||z(this.offHistory),H("load"),t.fp=this,q(this.allowConsent),w(P.Load,""),this.root=R(this.renderTarget),this.root.render(p(K,{children:p(V,{offHistory:this.offHistory,allowConsent:this.allowConsent})})),w(P.Rendered,""),C(()=>t.layerStore.layersLoaded,()=>{this.resolveReady(),t.initialized||this.onInit?.(this),t.initialized=!0})}selectBooth(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectBooth","Parameter must be a string or an array of strings.","EFP000000");return}const i=t.boothStore.booths.filter(o=>typeof e=="string"?o.name===e||o.externalId===e:e.includes(o.name)||e.includes(o.externalId));t.selectBooth(i)}selectExhibitor(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectExhibitor","Parameter must be a string or an array of strings.","EFP000100");return}if(!e?.length){t.uiState.menu=!1,t.searchStore.resetSearchBox(),t.uiState.details=null;return}const i=t.exhibitorStore.exhibitors.filter(s=>typeof e=="string"?s.name===e||s.externalId===e:e.includes(s.name)||e.includes(s.externalId));if(!i?.length)return;if(typeof e=="string"){t.selectExhibitor(i[0]),t.moveToList([i[0]]);return}const o=i.flatMap(s=>s.booths.map(r=>r.layer)),{description:n}=o.reduce((s,r)=>(s.freq[r.description]=(s.freq[r.description]||0)+1,s.freq[r.description]>s.maxCount&&(s.maxCount=s.freq[r.description],s.mostFrequent=r),s),{freq:{},mostFrequent:o[0],maxCount:0}).mostFrequent;t.layerStore.updateVisibility(n,!0),t.uiState.menu=!1,t.searchStore.resetSearchBox(),t.uiState.details=null,t.uiState.list={type:"filter",items:i,query:{key:"exhibitors",value:i.map(s=>s.externalId).join(",")}},t.moveToList()}highlightExhibitors(e){Array.isArray(e)||a("highlightExhibitors","Parameter must be an array of strings.","EFP000200"),t.boothStore.highlightedByExternalIds=[],t.exhibitorStore.highlightedByExternalIds=[...e]}highlightBooths(e){Array.isArray(e)||a("highlightBooths","Parameter must be an array of strings.","EFP000300"),t.exhibitorStore.highlightedByExternalIds=[],t.boothStore.highlightedByExternalIds=[...e]}highlightEntities(e){Array.isArray(e)||a("highlightEntities","Parameter must be an array of strings.","EFP000400");const{boothExternalIds:i,exhibitorExternalIds:o}=E(e);t.boothStore.highlightedByExternalIds=[...i],t.exhibitorStore.highlightedByExternalIds=[...o]}selectRoute(e,i){if(Array.isArray(e)){let o=[...e];const n=o.shift(),s=o.pop();if(o.length>g)throw new Error(`The maximum number of waypoints is ${g}.`);if(!n||!s){a("selectRoute","Invalid route format: When providing an array, it must include at least two points: a start and a destination.","EFP000401");return}t.routeStore.selectRoute(new S(f(n),f(s),o.map(f)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),t.routeStore.selectRoute(new S(f(e),f(i)))}getOptimizedRoutes(e){if(!Array.isArray(e))return a("getOptimizedRoutes","Parameter must be an array.","EFP000500"),[];if(e.length>g)throw new Error(`The maximum number of waypoints is ${g}.`);const i=e.map(f).filter(n=>!!n);if(!i.length)throw new Error("No booths found for the provided waypoints.");const o=new Map;for(const n of i){const s=n.layer?.name??"",r=o.get(s);r?r.push(n):o.set(s,[n])}return Array.from(o.values()).map(n=>({waypoints:Q(n.map(s=>[s.name,{cx:s.rect.cx,cy:s.rect.cy}]))}))}selectCurrentPosition(e,i,o){const n=d(e.x)&&d(e.y),s=d(e.lng)&&d(e.lat);!n&&!s&&a("selectCurrentPosition","A point must be passed. Either (x,y) or (lat,lng) are required.","EFP000600"),t.routeStore.selectCurrentPosition(e,i,o),this.onCurrentPositionChanged?.(e)}setBookmarks(e){(!Array.isArray(e)||!e.length)&&a("setBookmarks","Parameter must be an array.","EFP000700"),e.forEach(i=>{const o=t.exhibitorStore.exhibitors.find(n=>n.name===i.name||n.externalId===i.externalId);o&&(o.bookmarked=i.bookmarked)})}setEntitiesBookmarks(e){if(!Array.isArray(e)||!e.length){a("setEntitiesBookmarks","Parameter must be an array.","EFP000701");return}const i=["exhibitor","event","speaker","booth"],o=e.find(r=>!r.type||!i.includes(r.type));if(o){a("setEntitiesBookmarks",`Invalid entity type: ${o.type}. Must be one of: ${i.join(", ")}.`,"EFP000702");return}const n=B("bookmarked"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:r=>t.exhibitorStore.findExhibitor(r),replacer:r=>t.exhibitorStore.replaceBookmarked(r)},event:{existingIds:new Set(n.events||[]),finder:r=>t.eventStore.findByNameOrSlug(r),replacer:r=>t.eventStore.replaceBookmarked(r)},speaker:{existingIds:new Set(n.speakers||[]),finder:r=>t.speakerStore.speakers.find(l=>l.name===r||l.externalId===r||l.slug===r),replacer:r=>t.speakerStore.replaceBookmarked(r)},booth:{existingIds:new Set(n.booths||[]),finder:r=>{const l=t.boothStore.findBooth(r);return l?.exhibitors.length===0?l:void 0},replacer:r=>t.boothStore.replaceBookmarked(r)}};e.forEach(r=>{const l=s[r.type],h=r.name||r.externalId||"",c=l.finder(h);c?r.bookmarked?l.existingIds.add(c.id):l.existingIds.delete(c.id):console.warn(`Entity not found: ${r.type} with query "${h}"`)}),Object.values(s).forEach(r=>{r.replacer(Array.from(r.existingIds))})}setEntitiesVisited(e){if(!Array.isArray(e)||!e.length){a("setEntitiesVisited","Parameter must be an array.","EFP000703");return}const i=["exhibitor","event"],o=e.find(r=>!r.type||!i.includes(r.type));if(o){a("setEntitiesVisited",`Invalid entity type: ${o.type}. Must be one of: ${i.join(", ")}.`,"EFP000704");return}const n=B("visited"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:r=>t.exhibitorStore.findExhibitor(r),replacer:r=>t.exhibitorStore.replaceVisited(r)},event:{existingIds:new Set(n.events||[]),finder:r=>t.eventStore.findByNameOrSlug(r),replacer:r=>t.eventStore.replaceVisited(r)}};e.forEach(r=>{const l=s[r.type],h=r.name||r.externalId||"",c=l.finder(h);c?r.visited?l.existingIds.add(c.id):l.existingIds.delete(c.id):console.warn(`Entity not found: ${r.type} with query "${h}"`)}),Object.values(s).forEach(r=>{r.replacer(Array.from(r.existingIds))})}setMarkers(e){if(!e||!Array.isArray(e.icons)||!Array.isArray(e.markers)){a("setMarkers","Invalid input.","EFP000800");return}t.routeStore.setMarkers(e)}selectMarker(e,i=!0){return typeof e!="string"&&a("selectMarker","The identifier must be passed.","EFP000900"),t.routeStore.selectMarker(e,i)}drawCircles(e){Array.isArray(e)||a("drawCircles","Invalid input.","EFP000A00"),t.uiState.debugCircles=e}checkRoutes(){t.routeStore.checkRoutes()}updateLayerVisibility(e,i){typeof e!="string"&&a("updateLayerVisibility","The layer name (string) must be passed.","EFP000B00"),i||a("updateLayerVisibility","Passing a false value to visible will have no effect.","EFP000B01"),t.layerStore.updateVisibility(e,i)}getCenterCoordinates(){return t.fp.getCenterCoordinates()}exhibitorsList(){return t.exhibitorStore.exhibitors.map(e=>y(e))}boothsList(){return t.boothStore.booths.map(e=>y(e))}categoriesList(){return t.categoryStore.categories.map(e=>y(e))}selectCategory(e){if(e==null||typeof e!="string"){t.searchStore.selectSearch();return}const i=e?.toLowerCase(),o=t.categoryStore.categories.find(({name:n,slug:s})=>n?.toLowerCase()===i||s?.toLowerCase()===i);if(!o){a("selectCategory",`Category ${e} not found.`,"EFP000C01");return}t.selectCategory(o)}applyParameters(e){typeof e!="string"&&a("applyParameters","A query string must be passed.","EFP000D00"),M(e)}getVisibility(){return t.uiState.visibility}setVisibility(e){(typeof e!="object"||!Object.keys(e).length)&&a("setVisibility","The parameter must be passed.","EFP000E00"),t.uiState.setVisibility(e)}findLocation(){t.routeStore.findLocation()}zoomIn(){t.uiState.zoomIn()}zoomOut(){t.uiState.zoomOut()}switchView(){t.mapboxStore.activateMapbox()}zoomTo(e,i){b("zoomTo called with selectors=%O options=%O",e,i);const o=F.safeParse(e);if(!o.success){a("zoomTo",o.error.message,"EFP001600");return}const n=A.safeParse(i);if(!n.success){a("zoomTo",n.error.message,"EFP001601");return}const s=this.getBounds(e);s&&this.fitBounds(s,i)}getBounds(e){b("getBounds called with selectors=%O",e);const i=F.safeParse(e);if(!i.success){a("getBounds",i.error.message,"EFP001400");return}const o=[];if(e.booths?.forEach(s=>{let r;s.externalId?r=t.boothStore.boothByExternalId.get(s.externalId):s.name&&(r=t.boothStore.boothByName.get(s.name.toLowerCase())),r?.rect&&o.push(r.rect)}),e.exhibitors?.forEach(s=>{let r;s.externalId?r=t.exhibitorStore.exhibitorByExternalId.get(s.externalId):s.name&&(r=t.exhibitorStore.exhibitorByName.get(s.name.toLowerCase())),r?.booths?.forEach(l=>{l.rect&&o.push(l.rect)})}),o.length===0)return;const n=m.fromMultiple(o);return{leftTop:{x:n.x1,y:n.y1},rightBottom:{x:n.x2,y:n.y2}}}fitBounds(e,i){if(b("fitBounds called with bounds=%O options=%O",e,i),!e){t.uiState.fitBounds();return}const o=D.safeParse(e);if(!o.success){a("fitBounds",o.error.message,"EFP001500");return}const n=A.safeParse(i);if(!n.success){a("fitBounds",n.error.message,"EFP001501");return}let s;if(i?.padding){const r=i.padding;s=m.fromX1y1x2y2(e.leftTop.x-r,e.leftTop.y-r,e.rightBottom.x+r,e.rightBottom.y+r)}else s=m.fromX1y1x2y2(e.leftTop.x,e.leftTop.y,e.rightBottom.x,e.rightBottom.y);t.uiState.moveToRect=s}getBoothRect(e){return typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00"),x(e)?.rect}convertToGeo(e,i){if(!v?.properties?.config){a("convertToGeo","The coordinates cannot be converted because the GPS configuration is not defined.","EFP001000");return}if(!e||!i){a("convertToGeo","Both coordinates must be passed.","EFP001001");return}return O(e,i,v.properties.config)}unstable_destroy(){let e=window.__efpElement.firstChild;Y(),window.removeEventListener("__efpStyleLoad",this.efpStyleLoadHandler),window.removeEventListener("error",N),j(),G(),_(),[...document.getElementsByTagName("script")].filter(o=>o.src.indexOf("/fp.svg")>-1||o.src.indexOf("/wf.data.js")>-1||o.src.indexOf("/data.js")>-1).forEach(o=>o.remove()),this.root.unmount(),e.remove()}search(e){return typeof e!="string"&&a("search","A search string must be passed.","EFP001100"),t.fuzzySearchEngineStore.loadEngine().then(()=>(t.searchStore.selectSearch(e),t.uiState.fuzzySearchItems.map(i=>({item:y(i.item),score:i.score}))))}getFloors(){return t.layerStore.floors.map(e=>({name:e.name,shortName:e.shortName,description:e.description,active:e.active,disabled:e.disabled,index:e.index}))}activateFloor(e){if(!e?.name&&e?.index==null){a("activateFloor","Invalid floorId. It must contain either a name or an index.","EFP001200");return}const i=this.getFloors();if(e.name){const o=i.find(n=>n.name===e.name||n.shortName===e.name);if(!o){a("activateFloor",`Floor with name "${e.name}" not found.`,"EFP001201");return}if(o.active)return;this.updateLayerVisibility(o.name,!0);return}if(e.index!==null){const o=i.find(s=>s.index===e.index),n=o?.name;if(!n){a("activateFloor",`Floor at index ${e.index} does not exist.`,"EFP001203");return}if(o.active)return;this.updateLayerVisibility(n,!0);return}}showPathway(e,i){const o=new URLSearchParams;if(o.set(U,e),i?.length){const{boothExternalIds:n,exhibitorExternalIds:s}=E(i);n.length>0&&o.set("booths",n.join(",")),s.length>0&&o.set("exhibitors",s.join(","))}this.applyParameters(o.toString())}showPathwayOnly(e,i){this.activateFloor({name:i}),t.layerStore.showPathWay(e),t.uiState.setPathwayOnlyMode(!0);const o=t.layerStore.findLayer(e),n=t.layerStore.findLayer(i),s=o?.rect||o?.viewbox?o:n;if(s?.rect||s?.viewbox){const r=s.viewbox??s.rect;t.uiState.moveToRect=m.fromX1y1x2y2(r.x1,r.y1,r.x2,r.y2)}}hidePathways(){this.highlightBooths([]),t.layerStore.hidePathways(),t.uiState.setPathwayOnlyMode(!1)}showSearch(){t.selectSearch("")}changeLanguage(e){const i=e?.toLowerCase?.();if(!t.languageStore.languageIds.has(i)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${[...t.languageStore.languageIds].join(",")}`,"EFP001300");return}const o=new URLSearchParams;o.set(X,i),this.applyParameters(o.toString())}isGpsTrackingEnabled(){return t.routeStore.gpsEnabled}setGpsTrackingEnabled(e){t.routeStore.setGpsTrackingEnabled(e)}deselectCurrentPosition(){t.routeStore.selectCurrentPosition(null,!1)}deselectRoute(){t.routeStore.selectRoute(null)}reset(){this.selectBooth(""),this.selectExhibitor(""),this.selectCategory(),this.deselectCurrentPosition(),this.deselectRoute(),this.highlightEntities([]),this.fitBounds()}}function f(u){return typeof u=="string"?x(u):t.routeStore.getNearestBooth(u)}let k=0;function a(u,e,i){const o=`Error calling "${u}" SDK method.`,n=`${e.endsWith(".")?e:e+"."} More information at`;let s="https://developer.expofp.com/guide/java-script-api-reference";if(i&&(s+=`#error-${i}`),console.error(`${o} ${n} ${s}`),t.fp.disableRuntimeAlerts)return;t.uiState.setGlobalErrorMessage({title:o,body:T(L,{children:[n," ",p("a",{href:s,target:"_blank",children:s})]})}),clearTimeout(k);const r=8e3;k=window.setTimeout(()=>{const l=async()=>{t.uiState.globalErrorMessages.length>0&&(t.uiState.popGlobalErrorMessage(),await new Promise(h=>setTimeout(h,r/2)),l())};l()},r)}
1
+ import{jsx as p,Fragment as L,jsxs as C}from"react/jsx-runtime";import{reaction as T}from"mobx";import{createRoot as R}from"react-dom/client";import{install as I}from"resize-observer";import V from"./components/Layout";import $ from"./floorplan.loader";import{applyParameters as M,destroyHistory as j,initRouting as z}from"./services/routing";import t from"./store";import{Route as S,findBooth as x,separateExternalIds as E}from"./store/RouteStore";import{destroyUiHandlers as G}from"./store/init/init-ui";import{GaEventActions as P,destroyGtag as _,sendEventToGa as w,setConsentSettings as q}from"./tools/gtag";import N from"./tools/report-error";import{resetGlobalVariables as Y}from"./tools/reset";import H from"./tools/track-event";import{fpGeo as v}from"./components/Mapbox/utils/fpGeo";import{convertLocalToGps as O,isValidPointCoords as d}from"./utils/gps";import m from"./core/Rect";import{mapEntity as y}from"./utils/mapEntity";import{LANG_KEY as X,MAX_ROUTE_WAYPOINTS as g,PATHWAY_KEY as U}from"./constants";import{getStorage as B}from"./utils/entity-storage";import{ErrorBoundary as D}from"@sentry/react";import{POISelectorsSchema as F,BoundsSchema as K,ZoomToOptionsSchema as A}from"./schemas/sdk.schemas";import W from"debug";import{buildOptimizedRoute as Q}from"./utils/buildOptimizedRoute";const b=W("efp:api");I();export default class Z extends ${root;init(){this.ignoreQuery||z(this.offHistory),H("load"),t.fp=this,q(this.allowConsent),w(P.Load,""),this.root=R(this.renderTarget),this.root.render(p(D,{children:p(V,{offHistory:this.offHistory,allowConsent:this.allowConsent})})),w(P.Rendered,""),T(()=>t.layerStore.layersLoaded,()=>{this.resolveReady(),t.initialized||this.onInit?.(this),t.initialized=!0})}selectBooth(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectBooth","Parameter must be a string or an array of strings.","EFP000000");return}const i=t.boothStore.booths.filter(o=>typeof e=="string"?o.name===e||o.externalId===e:e.includes(o.name)||e.includes(o.externalId));t.selectBooth(i)}selectExhibitor(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectExhibitor","Parameter must be a string or an array of strings.","EFP000100");return}if(!e?.length){t.uiState.menu=!1,t.searchStore.resetSearchBox(),t.uiState.details=null;return}const i=t.exhibitorStore.exhibitors.filter(s=>typeof e=="string"?s.name===e||s.externalId===e:e.includes(s.name)||e.includes(s.externalId));if(!i?.length)return;if(typeof e=="string"){t.selectExhibitor(i[0]),t.moveToList([i[0]]);return}const o=i.flatMap(s=>s.booths.map(r=>r.layer)),{description:n}=o.reduce((s,r)=>(s.freq[r.description]=(s.freq[r.description]||0)+1,s.freq[r.description]>s.maxCount&&(s.maxCount=s.freq[r.description],s.mostFrequent=r),s),{freq:{},mostFrequent:o[0],maxCount:0}).mostFrequent;t.layerStore.updateVisibility(n,!0),t.uiState.menu=!1,t.searchStore.resetSearchBox(),t.uiState.details=null,t.uiState.list={type:"filter",items:i,query:{key:"exhibitors",value:i.map(s=>s.externalId).join(",")}},t.moveToList()}highlightExhibitors(e){Array.isArray(e)||a("highlightExhibitors","Parameter must be an array of strings.","EFP000200"),t.boothStore.highlightedByExternalIds=[],t.exhibitorStore.highlightedByExternalIds=[...e]}highlightBooths(e){Array.isArray(e)||a("highlightBooths","Parameter must be an array of strings.","EFP000300"),t.exhibitorStore.highlightedByExternalIds=[],t.boothStore.highlightedByExternalIds=[...e]}highlightEntities(e){Array.isArray(e)||a("highlightEntities","Parameter must be an array of strings.","EFP000400");const{boothExternalIds:i,exhibitorExternalIds:o}=E(e);t.boothStore.highlightedByExternalIds=[...i],t.exhibitorStore.highlightedByExternalIds=[...o]}selectRoute(e,i){if(Array.isArray(e)){let o=[...e];const n=o.shift(),s=o.pop();if(o.length>g)throw new Error(`The maximum number of waypoints is ${g}.`);if(!n||!s){a("selectRoute","Invalid route format: When providing an array, it must include at least two points: a start and a destination.","EFP000401");return}t.routeStore.selectRoute(new S(f(n),f(s),o.map(f)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),t.routeStore.selectRoute(new S(f(e),f(i)))}getOptimizedRoutes(e){if(!Array.isArray(e))return a("getOptimizedRoutes","Parameter must be an array.","EFP000500"),[];if(e.length>g)throw new Error(`The maximum number of waypoints is ${g}.`);const i=e.map(f).filter(n=>!!n);if(!i.length)throw new Error("No booths found for the provided waypoints.");const o=new Map;for(const n of i){const s=n.layer?.name??"",r=o.get(s);r?r.push(n):o.set(s,[n])}return Array.from(o.values()).map(n=>({waypoints:Q(n.map(s=>[s.name,{cx:s.rect.cx,cy:s.rect.cy}]))}))}selectCurrentPosition(e,i,o){const n=d(e.x)&&d(e.y),s=d(e.lng)&&d(e.lat);!n&&!s&&a("selectCurrentPosition","A point must be passed. Either (x,y) or (lat,lng) are required.","EFP000600"),t.routeStore.selectCurrentPosition(e,i,o),this.onCurrentPositionChanged?.(e)}setBookmarks(e){(!Array.isArray(e)||!e.length)&&a("setBookmarks","Parameter must be an array.","EFP000700"),e.forEach(i=>{const o=t.exhibitorStore.exhibitors.find(n=>n.name===i.name||n.externalId===i.externalId);o&&(o.bookmarked=i.bookmarked)})}setEntitiesBookmarks(e){if(!Array.isArray(e)||!e.length){a("setEntitiesBookmarks","Parameter must be an array.","EFP000701");return}const i=["exhibitor","event","speaker","booth"],o=e.find(r=>!r.type||!i.includes(r.type));if(o){a("setEntitiesBookmarks",`Invalid entity type: ${o.type}. Must be one of: ${i.join(", ")}.`,"EFP000702");return}const n=B("bookmarked"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:r=>t.exhibitorStore.findExhibitor(r),replacer:r=>t.exhibitorStore.replaceBookmarked(r)},event:{existingIds:new Set(n.events||[]),finder:r=>t.eventStore.findByNameOrSlug(r),replacer:r=>t.eventStore.replaceBookmarked(r)},speaker:{existingIds:new Set(n.speakers||[]),finder:r=>t.speakerStore.speakers.find(l=>l.name===r||l.externalId===r||l.slug===r),replacer:r=>t.speakerStore.replaceBookmarked(r)},booth:{existingIds:new Set(n.booths||[]),finder:r=>{const l=t.boothStore.findBooth(r);return l?.exhibitors.length===0?l:void 0},replacer:r=>t.boothStore.replaceBookmarked(r)}};e.forEach(r=>{const l=s[r.type],h=r.name||r.externalId||"",c=l.finder(h);c?r.bookmarked?l.existingIds.add(c.id):l.existingIds.delete(c.id):console.warn(`Entity not found: ${r.type} with query "${h}"`)}),Object.values(s).forEach(r=>{r.replacer(Array.from(r.existingIds))})}setEntitiesVisited(e){if(!Array.isArray(e)||!e.length){a("setEntitiesVisited","Parameter must be an array.","EFP000703");return}const i=["exhibitor","event"],o=e.find(r=>!r.type||!i.includes(r.type));if(o){a("setEntitiesVisited",`Invalid entity type: ${o.type}. Must be one of: ${i.join(", ")}.`,"EFP000704");return}const n=B("visited"),s={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:r=>t.exhibitorStore.findExhibitor(r),replacer:r=>t.exhibitorStore.replaceVisited(r)},event:{existingIds:new Set(n.events||[]),finder:r=>t.eventStore.findByNameOrSlug(r),replacer:r=>t.eventStore.replaceVisited(r)}};e.forEach(r=>{const l=s[r.type],h=r.name||r.externalId||"",c=l.finder(h);c?r.visited?l.existingIds.add(c.id):l.existingIds.delete(c.id):console.warn(`Entity not found: ${r.type} with query "${h}"`)}),Object.values(s).forEach(r=>{r.replacer(Array.from(r.existingIds))})}setMarkers(e){if(!e||!Array.isArray(e.icons)||!Array.isArray(e.markers)){a("setMarkers","Invalid input.","EFP000800");return}t.routeStore.setMarkers(e)}selectMarker(e,i=!0){return typeof e!="string"&&a("selectMarker","The identifier must be passed.","EFP000900"),t.routeStore.selectMarker(e,i)}drawCircles(e){Array.isArray(e)||a("drawCircles","Invalid input.","EFP000A00"),t.uiState.debugCircles=e}checkRoutes(){t.routeStore.checkRoutes()}updateLayerVisibility(e,i){typeof e!="string"&&a("updateLayerVisibility","The layer name (string) must be passed.","EFP000B00"),i||a("updateLayerVisibility","Passing a false value to visible will have no effect.","EFP000B01"),t.layerStore.updateVisibility(e,i)}getCenterCoordinates(){return t.fp.getCenterCoordinates()}exhibitorsList(){return t.exhibitorStore.exhibitors.map(e=>y(e))}boothsList(){return t.boothStore.booths.map(e=>y(e))}categoriesList(){return t.categoryStore.categories.map(e=>y(e))}selectCategory(e){if(e==null||typeof e!="string"){t.searchStore.selectSearch();return}const i=e?.toLowerCase(),o=t.categoryStore.categories.find(({name:n,slug:s})=>n?.toLowerCase()===i||s?.toLowerCase()===i);if(!o){a("selectCategory",`Category ${e} not found.`,"EFP000C01");return}t.selectCategory(o)}applyParameters(e){typeof e!="string"&&a("applyParameters","A query string must be passed.","EFP000D00"),M(e)}getVisibility(){return t.uiState.visibility}setVisibility(e){(typeof e!="object"||!Object.keys(e).length)&&a("setVisibility","The parameter must be passed.","EFP000E00"),t.uiState.setVisibility(e)}findLocation(){t.routeStore.findLocation()}zoomIn(){t.uiState.zoomIn()}zoomOut(){t.uiState.zoomOut()}switchView(){t.mapboxStore.activateMapbox()}zoomTo(e,i){b("zoomTo called with selectors=%O options=%O",e,i);const o=F.safeParse(e);if(!o.success){a("zoomTo",o.error.message,"EFP001600");return}const n=A.safeParse(i);if(!n.success){a("zoomTo",n.error.message,"EFP001601");return}const s=this.getBounds(e);s&&this.fitBounds(s,i)}getBounds(e){b("getBounds called with selectors=%O",e);const i=F.safeParse(e);if(!i.success){a("getBounds",i.error.message,"EFP001400");return}const o=[];if(e.booths?.forEach(s=>{let r;s.externalId?r=t.boothStore.boothByExternalId.get(s.externalId):s.name&&(r=t.boothStore.boothByName.get(s.name.toLowerCase())),r?.rect&&o.push(r.rect)}),e.exhibitors?.forEach(s=>{let r;s.externalId?r=t.exhibitorStore.exhibitorByExternalId.get(s.externalId):s.name&&(r=t.exhibitorStore.exhibitorByName.get(s.name.toLowerCase())),r?.booths?.forEach(l=>{l.rect&&o.push(l.rect)})}),o.length===0)return;const n=m.fromMultiple(o);return{leftTop:{x:n.x1,y:n.y1},rightBottom:{x:n.x2,y:n.y2}}}fitBounds(e,i){if(b("fitBounds called with bounds=%O options=%O",e,i),!e){t.uiState.fitBounds();return}const o=K.safeParse(e);if(!o.success){a("fitBounds",o.error.message,"EFP001500");return}const n=A.safeParse(i);if(!n.success){a("fitBounds",n.error.message,"EFP001501");return}let s;if(i?.padding){const r=i.padding;s=m.fromX1y1x2y2(e.leftTop.x-r,e.leftTop.y-r,e.rightBottom.x+r,e.rightBottom.y+r)}else s=m.fromX1y1x2y2(e.leftTop.x,e.leftTop.y,e.rightBottom.x,e.rightBottom.y);t.uiState.moveToRect=s}getBoothRect(e){return typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00"),x(e)?.rect}convertToGeo(e,i){if(!v?.properties?.config){a("convertToGeo","The coordinates cannot be converted because the GPS configuration is not defined.","EFP001000");return}if(!e||!i){a("convertToGeo","Both coordinates must be passed.","EFP001001");return}return O(e,i,v.properties.config)}unstable_destroy(){let e=window.__efpElement.firstChild;Y(),window.removeEventListener("__efpStyleLoad",this.efpStyleLoadHandler),window.removeEventListener("error",N),j(),G(),_(),[...document.getElementsByTagName("script")].filter(o=>o.src.indexOf("/fp.svg")>-1||o.src.indexOf("/wf.data.js")>-1||o.src.indexOf("/data.js")>-1).forEach(o=>o.remove()),this.root.unmount(),e.remove()}search(e){return typeof e!="string"&&a("search","A search string must be passed.","EFP001100"),t.fuzzySearchEngineStore.loadEngine().then(()=>(t.searchStore.selectSearch(e),t.uiState.fuzzySearchItems.map(i=>({item:y(i.item),score:i.score}))))}getFloors(){return t.layerStore.floors.map(e=>({name:e.name,shortName:e.shortName,description:e.description,active:e.active,disabled:e.disabled,index:e.index}))}activateFloor(e){if(!e?.name&&e?.index==null){a("activateFloor","Invalid floorId. It must contain either a name or an index.","EFP001200");return}const i=this.getFloors();if(e.name){const o=i.find(n=>n.name===e.name||n.shortName===e.name);if(!o){a("activateFloor",`Floor with name "${e.name}" not found.`,"EFP001201");return}if(o.active)return;this.updateLayerVisibility(o.name,!0);return}if(e.index!==null){const o=i.find(s=>s.index===e.index),n=o?.name;if(!n){a("activateFloor",`Floor at index ${e.index} does not exist.`,"EFP001203");return}if(o.active)return;this.updateLayerVisibility(n,!0);return}}showPathway(e,i){const o=new URLSearchParams;if(o.set(U,e),i?.length){const{boothExternalIds:n,exhibitorExternalIds:s}=E(i);n.length>0&&o.set("booths",n.join(",")),s.length>0&&o.set("exhibitors",s.join(","))}this.applyParameters(o.toString())}showPathwayOnly(e,i){this.activateFloor({name:i}),t.layerStore.showPathWay(e),t.uiState.setPathwayOnlyMode(!0);const o=t.layerStore.findLayer(e),n=t.layerStore.findLayer(i),s=o?.rect||o?.viewbox?o:n;if(s?.rect||s?.viewbox){const r=s.viewbox??s.rect;t.uiState.moveToRect=m.fromX1y1x2y2(r.x1,r.y1,r.x2,r.y2)}}hidePathways(){this.highlightBooths([]),t.layerStore.hidePathways(),t.uiState.setPathwayOnlyMode(!1)}showSearch(){t.selectSearch("")}changeLanguage(e){const i=e?.toLowerCase?.();if(!t.languageStore.languageIds.has(i)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${[...t.languageStore.languageIds].join(",")}`,"EFP001300");return}const o=new URLSearchParams;o.set(X,i),this.applyParameters(o.toString())}isGpsTrackingEnabled(){return t.routeStore.gpsEnabled}setGpsTrackingEnabled(e){t.routeStore.setGpsTrackingEnabled(e)}deselectCurrentPosition(){t.routeStore.selectCurrentPosition(null,!1)}deselectRoute(){t.routeStore.selectRoute(null)}reset(){this.selectBooth(""),this.selectExhibitor(""),this.selectCategory(),this.deselectCurrentPosition(),this.deselectRoute(),this.highlightEntities([]),t.uiState.kioskData&&t.resetCameraFn?t.resetCameraFn?.():this.fitBounds()}}function f(u){return typeof u=="string"?x(u):t.routeStore.getNearestBooth(u)}let k=0;function a(u,e,i){const o=`Error calling "${u}" SDK method.`,n=`${e.endsWith(".")?e:e+"."} More information at`;let s="https://developer.expofp.com/guide/java-script-api-reference";if(i&&(s+=`#error-${i}`),console.error(`${o} ${n} ${s}`),t.fp.disableRuntimeAlerts)return;t.uiState.setGlobalErrorMessage({title:o,body:C(L,{children:[n," ",p("a",{href:s,target:"_blank",children:s})]})}),clearTimeout(k);const r=8e3;k=window.setTimeout(()=>{const l=async()=>{t.uiState.globalErrorMessages.length>0&&(t.uiState.popGlobalErrorMessage(),await new Promise(h=>setTimeout(h,r/2)),l())};l()},r)}
@@ -1 +1 @@
1
- import{createBrowserHistory as Z}from"history";import{autorun as _,reaction as k}from"mobx";import{handleCustomCommand as M}from"../utils/customCommands";import{BUILD_ROUTE_KEY as ee,KIOSK_ENABLE_KEY as O,MAP_SETTINGS_KEY as te,PREVIEW_MODE_QUERY as L,PREVIEW_MODE_STORAGE_KEY as A,SEPARATOR as x,PATHWAY_KEY as F,PLANNER_KEY as P,PLANNER_SOURCE_KEY as $,PLANNER_FROM_KEY as N,LANG_KEY as K,UI_SCALE_PARAM_KEY as W,UI_SCALE_RESET_PARAM_KEY as Y}from"../constants";import E from"../data";import s,{uiState as i}from"../store";import{CurrentPosition as oe,extractRoute as se,findBooth as re}from"../store/RouteStore";import{setConsentSettings as H}from"../tools/gtag";import I from"../tools/logger";import{isLocalStorageAvailable as V}from"../utils/localStorage";import{yahKey as ae}from"../utils/yah";import{areLayersEnabled as ie}from"../utils/areLayersEnabled";import ne from"../core/Rect";import{getMostFrequent as le}from"../utils/getMostFrequent";import{runInAction as R}from"mobx";import{recoverKioskFromUrlPrams as ce}from"../components/Kiosk/recoverKioskFromUrlPrams";let m=!1,v=!1,G=null,z=null,D=null,j;const h=Z(),U=window.location.pathname,S=[];export function getLocationHistory(){return S}function b(t){return U+t}function ue(t){m||h.push(b(t))}export function historyReplace(t){m||h.push(b(t))}function f(t){return t.replace(/=&/g,"&").replace(/=$/,"")}function q(){let t="";const n=i.selectedExhibitor,a=i.selectedBooth,e=i.selectedEventItem,o=i.selectedRoute,r=i.selectedSpeaker,l=i.setKioskModeEnabled;if(i.list.type==="route-planner"){const d=s.routePlannerStore;if(d.source==="bookmarks")t=`${P}&${$}=bookmarks`;else{const w=d.items.map(g=>g.entity.slug).filter(Boolean).join(x);t=`${P}=${w}`}const p=d.startPoint?.slug;p&&(t+=`&${N}=${p}`)}else if(o&&!i.isMultiPointRoute){const d=o.from?`:${o.from.slug}`:"",p=o.to?`:${o.to.slug}`:"",w=s.routeStore.onlyAccessible?":true":":false",g=o.waypoints?.map(u=>`:${u.slug}`).join("");t=`route${p}${d}${w}${g||""}`}else if(n)t=n.slug;else if(a)t=a.slug;else if(e)t=e.slug;else if(r)t=r.slug;else if(l)t="";else switch(i.list.type){case"bookmarks":t="bookmarks";break;case"visited":t="visited";break;case"category":t=i.selectedCategory.slug;break;case"search":t=i.list.text||"";break;case"language":t=i.list.type;break;case"filter":t=`${i.list.query.key}=${i.list.query.value}`;break;case"sessions":t="sessions";break;case"exhibitors":t="exhibitors";break;case"speakers":t="speakers";break;case"tours":t="tours";break;case"multi-point-tour":t=`tour=${i.list.tourId}`;break;default:throw new Error("Unkown list.type")}if(v)return;const c=t?"?"+encodeURIComponent(t):"";h.location.search!==c&&(n!==G||a!==z||e!==D?ue(c):historyReplace(c),G=n,z=a,D=e)}function Q(){const t=i.selectedExhibitor,n=i.selectedEventItem,a=i.selectedSpeaker;let e="";t?e=t.name:n?e=n.name:a?e=a.name:i.list.type==="search"&&i.list.text?e="`"+(i.list.text||"")+"`":i.list.type==="multi-point-tour"&&i.tourTitle&&(e=i.tourTitle),e.length&&(e+=" \u2013 "),e+=E.title,E.subtitle&&(e+=" \u2013 "+E.subtitle),e+=" \u2013 Expo Floor Plan by ExpoFP",document.title=e}function C(){const t=h.location.search.length>1?decodeURIComponent(h.location.search.substring(1)):"";return M(t,!1)}function y(){const t=h.location.search.length>1?decodeURIComponent(h.location.search.substring(1)):"";v=!0;const n=s.boothStore.booths.find(e=>e.slug?.toLowerCase()===t?.toLowerCase()||e.externalId?.toLowerCase()===t?.toLowerCase()||e.externalId?.toLowerCase()?.replace(/\s+/g,"")===t?.toLowerCase()),a=new URLSearchParams(decodeURIComponent(window.location.search));if(ce(a),he(a),!C())if(a.has("yah")){const e=a.get("yah");M(`${ae} ${e}`,!0)}else if(a.has(O)){const e=a.get(O);e==="1"?i.kiosk=!0:e==="0"&&(i.kiosk=!1,i.resetUIScale())}else if(t==="tours")s.selectTours();else if(t.startsWith("tour=")){const e=t.split("=")[1],o=s.toursStore.getTourById(e);o?s.toursStore.launchTour(o,o.name,o.description):(console.warn(`Route with id "${e}" not found`),s.selectTours())}else if(a.has(P)){const e=a.get($),o=a.get(N),r=o?re(o):null;if(e==="bookmarks")s.routePlannerStore.launchFromBookmarks(r??void 0);else{const l=(a.get(P)||"").split(x).filter(Boolean);s.routePlannerStore.launchFromSlugs(l,r??void 0)}}else if(t.startsWith("route")){const e=t.split(x);R(()=>{s.routeStore.onlyAccessible=e[3]==="true"});const o=se(e[2],e[1],e.slice(4));s.routeStore.selectRoute(o);const l=e.slice(4).length>0;s.uiState.setIsMultiPointRoute(l);const d=new URLSearchParams(window.location.search).get("title");d&&s.uiState.setRouteTitle(d)}else if(t==="bookmarks")s.selectBookmarks();else if(t==="visited")s.selectVisited();else if(t==="language")s.selectLanguage();else if(a.has(K)){const e=a.get(K)?.toLowerCase();s.languageStore.languageIds.has(e)&&s.languageStore.changeLanguage(e)}else if(t==="sessions")s.selectSessions();else if(t==="exhibitors")s.selectExhibitors();else if(t==="speakers")s.selectSpeakers();else if(t==="-pdf")s.uiState.printingPdf=!0;else if(t.startsWith("hide"))s.uiState.setVisibility(new URLSearchParams(t).get("hide").split(",").filter(Boolean).reduce((e,o)=>({...e,[o]:!1}),{}));else if(n)setTimeout(()=>s.selectBooth(n),250);else if(t===ee)s.uiState.startBuildRoute();else if(a.get(F)){const e=a.get(F),o=a.get("booths")?.split(",")||[],r=a.get("exhibitors")?.split(",")||[],l=a.get("tour");if(l){const u=s.toursStore.getTourById(l);u&&R(()=>{s.uiState.setTourTitle(u.name),s.uiState.setTourDescription(u.description),s.uiState.setIsMultiPointTour(!0),s.uiState.setMultiPointTourList(u.id)})}const c=s.boothStore.booths,d=s.exhibitorStore.exhibitors,p=c.filter(u=>o.includes(u.externalId)),w=d.filter(u=>r.includes(u.externalId)).flatMap(u=>u.booths),g=[...p,...w];if(ie()){const u=g.map(X=>X.layer.name),T=le(u);T&&s.fp.activateFloor({name:T})}(o.length>0||r.length>0)&&s.fp.highlightEntities([...o,...r]),s.layerStore.showPathWay(e),g.length>0&&R(()=>{s.uiState.moveToRect=ne.fromMultiple(g.map(u=>u.rect).filter(Boolean)),s.uiState.rollReset=!0})}else{const e=s.eventStore.eventItems.find(o=>o.slug?.toLowerCase()===t?.toLowerCase()||o.externalId?.toLowerCase()===t?.toLowerCase());if(e)s.selectEventItem(e,!0);else{const o=s.exhibitorStore.exhibitors.find(r=>r.slug?.toLowerCase()===t?.toLowerCase()||r.externalId?.toLowerCase()===t?.toLowerCase());if(t.startsWith("exhibitors")){const r=t.split("=")[1].split(",");setTimeout(()=>s.fp.selectExhibitor(r),250)}else if(o)setTimeout(()=>s.clickExhibitor(o),250);else if(t.includes("=")&&(t.startsWith("categories=")||t.startsWith("poiType=")))I.log("Skipping filter parameter in dispatchFromUrl:",t);else{const l=s.categoryStore.categories.find(c=>c.slug===t);if(l)s.selectCategory(l);else{const c=s.speakerStore.findBySlug(t);c?s.selectSpeaker(c,!0):t.includes("heatmap=true")||s.searchStore.selectSearch(t)}}}}v=!1,q(),Q()}function B(){const t=h.location.search;if(t.includes("heatmap")){const e=new URL(window.location.href);if(e.searchParams.get("heatmap")==="true")if(e.searchParams.get("type")==="yah"){let r=f(e.search);m=!0,historyReplace(r),s.uiState.heatmapYah=!0,s.uiState.monochrome=!0,s.uiState.hideLogoInBooth=!0,s.uiState.hideHeaderLogo=!0,s.uiState.disableBookmarked=!0}else{e.searchParams.delete("heatmap");let r=f(e.search);m=!0,historyReplace(r),s.uiState.heatmap=!0}}if(t.startsWith("?preview="))historyReplace("?");else if(t.startsWith("?b="))historyReplace("?bookmarks");else if(t.startsWith("?ba=")){const e=new URL(window.location.href),o=parseInt(e.searchParams.get("ba")),r=s.exhibitorStore.exhibitorById.get(o);historyReplace(r?"?"+r.slug:"?bookmarks")}else t.startsWith("?mapbox=false")&&(s.mapboxStore.isMapbox=!1,historyReplace("?"));if(t.includes("blue-dot")){const e=new URL(window.location.href),o=e.searchParams.get("blue-dot").split(",");if(e.searchParams.delete("blue-dot"),o.length>1){const l=s.layerStore.findLayer(o[2])?.name,c=new oe(Number(o[0])||void 0,Number(o[1])||void 0,l,void 0,Number(o[3])||void 0,Number(o[4])||void 0);s.layerStore.layersLoaded?s.routeStore.selectCurrentPosition(c,!1,1):k(()=>s.layerStore.layersLoaded,()=>{s.routeStore.selectCurrentPosition(c,!1,1)})}let r=f(e.search);historyReplace(r)}if(t.includes("copy_exh")){const e=new URL(window.location.href),o=e.searchParams.get("copy_exh");e.searchParams.delete("copy_exh"),historyReplace("?")}if(t.includes("noOverlay")){const e=new URL(window.location.href),o=e.searchParams.get("noOverlay");e.searchParams.delete("noOverlay");let r=f(e.search);o==="true"?s.uiState.hideOverlay=!0:o==="false"&&(s.uiState.hideOverlay=!1),historyReplace(r)}if(t.includes("allowConsent")){const e=new URL(window.location.href),o=e.searchParams.get("allowConsent");e.searchParams.delete("allowConsent");const r=f(e.search);o==="true"?H(!0):o==="false"&&H(!1),historyReplace(r)}if(t.includes("hideHeaderLogo")){const e=new URL(window.location.href),o=e.searchParams.get("hideHeaderLogo");e.searchParams.delete("hideHeaderLogo");const r=f(e.search);o==="true"&&(i.hideHeaderLogo=!0),historyReplace(r)}if(t.includes("hideLogoInBooth")){const e=new URL(window.location.href),o=e.searchParams.get("hideLogoInBooth");e.searchParams.delete("hideLogoInBooth");const r=f(e.search);o==="true"&&(i.hideLogoInBooth=!0),historyReplace(r)}if(t.includes("disableFeatured")){const e=new URL(window.location.href),o=e.searchParams.get("disableFeatured");e.searchParams.delete("disableFeatured");const r=f(e.search);o==="true"&&s.exhibitorStore.exhibitors.forEach(l=>l.featured=!1),historyReplace(r)}if(t.includes("disableBookmarked")){const e=new URL(window.location.href),o=e.searchParams.get("disableBookmarked");e.searchParams.delete("disableBookmarked");const r=f(e.search);o==="true"&&(i.disableBookmarked=!0),historyReplace(r)}if(t.includes("disableGps")){const e=new URL(window.location.href),o=e.searchParams.get("disableGps");e.searchParams.delete("disableGps");const r=f(e.search);o==="true"&&s.routeStore.setGpsTrackingEnabled(!1),historyReplace(r)}if(t.includes("monochrome")){const e=new URL(window.location.href),o=e.searchParams.get("monochrome");e.searchParams.delete("monochrome");const r=f(e.search);o==="true"&&(i.monochrome=!0),historyReplace(r)}if((t.startsWith("?fbclid")||t.startsWith("?_ga"))&&historyReplace("?"),t.includes(L)){const e=new URL(window.location.href),o=e.searchParams.get(L);o==="true"?V&&localStorage.setItem(A,"1"):o==="false"&&V&&localStorage.removeItem(A),e.searchParams.delete(L),historyReplace(f(e.search))}if(i.previewExhibitor&&historyReplace("?"+i.previewExhibitor.slug),h.location.search.includes("&")||h.location.search.includes("%26")){let e=h.location.search;e=e.startsWith("?")?e.slice(1):e;const o=e.includes("&")?"&":"%26",l=e.split(o).map(c=>{const d=s.exhibitorStore.exhibitors.find(p=>p.slug===c||p.externalId===c);return d?d.name:c}).join("&");historyReplace("?"+l)}const n=new URLSearchParams(window.location.search);if(n.has(Y)){s.uiState.resetUIScale();const e=new URL(window.location.href);e.searchParams.delete(Y);let o=f(e.search);m=!0,historyReplace(o),m=!1}const a=n.get(W);if(a){const e=a.replace(",","."),o=parseFloat(e);!isNaN(o)&&o>=.8&&o<=1.4?s.uiState.setUIScale(o,!0):I.warn(`Invalid ui-scale parameter: ${a}. Must be a number between 0.8 and 1.4.`);const r=new URL(window.location.href);r.searchParams.delete(W);let l=f(r.search);m=!0,historyReplace(l),m=!1}}export function initRouting(t=!1){m=t,!m&&b(h.location.search)===U&&S.push(b(h.location.search)),j=h.listen((n,a)=>{m||(S.push(b(n.search)),I.log("history",a,n),a==="POP"&&y())}),B(),C(),k(()=>s.layerStore.layersLoaded,()=>{s.urlFilterManager&&!s.urlFilterManager.isInitialized&&s.urlFilterManager.initialize(),y(),_(Q),_(q)})}export function applyParameters(t=""){historyReplace("?"+decodeURIComponent(t.toString())),s.layerStore.layersLoaded?(B(),y()):(C(),k(()=>s.layerStore.layersLoaded,()=>{B(),y()}))}export function destroyHistory(){j()}export function goBack(){if(console.log("goBack"),S.length>1){S.pop();const n=S[S.length-1].replace(U,"");return m=!0,h.replace(n),m=!1,y(),!0}else return h.go(-1),!1}function he(t){try{let n={};const a=i.defaultMapSettings;if(new Set(t.keys()).size)n=J(Object.fromEntries(t.entries()),a);else{const e=sessionStorage.getItem(te);e&&(n=J(JSON.parse(e),a))}if(i.setMapSettings(n),n.z){const e=s.layerStore.layers.find(o=>o.name===n.z);e&&s.layerStore.updateVisibility(e,!0)}}catch(n){console.error("Failed to process or save map settings.",n)}}function J(t,n){const a={};for(const e in t){if(!Object.prototype.hasOwnProperty.call(n,e)||!Object.prototype.hasOwnProperty.call(t,e))continue;const o=t[e];typeof n[e]=="number"&&typeof o=="string"?a[e]=parseFloat(o):a[e]=o}return a}
1
+ import{createBrowserHistory as te}from"history";import{autorun as O,reaction as k}from"mobx";import{handleCustomCommand as A}from"../utils/customCommands";import{BUILD_ROUTE_KEY as oe,KIOSK_ENABLE_KEY as F,MAP_SETTINGS_KEY as se,PREVIEW_MODE_QUERY as E,PREVIEW_MODE_STORAGE_KEY as $,SEPARATOR as I,PATHWAY_KEY as N,PLANNER_KEY as P,PLANNER_SOURCE_KEY as W,PLANNER_FROM_KEY as K,LANG_KEY as Y,UI_SCALE_PARAM_KEY as V,UI_SCALE_RESET_PARAM_KEY as H,VIEWER_MODE_QUERY as R,VIEWER_MODE_STORAGE_KEY as G}from"../constants";import x from"../data";import s,{uiState as i}from"../store";import{CurrentPosition as re,extractRoute as ae,findBooth as ie}from"../store/RouteStore";import{setConsentSettings as D}from"../tools/gtag";import v from"../tools/logger";import{isLocalStorageAvailable as L}from"../utils/localStorage";import{yahKey as ne}from"../utils/yah";import{areLayersEnabled as le}from"../utils/areLayersEnabled";import ce from"../core/Rect";import{getMostFrequent as ue}from"../utils/getMostFrequent";import{runInAction as U}from"mobx";import{recoverKioskFromUrlPrams as he}from"../components/Kiosk/recoverKioskFromUrlPrams";let m=!1,C=!1,z=null,j=null,q=null,Q;const h=te(),B=window.location.pathname,S=[];export function getLocationHistory(){return S}function b(t){return B+t}function fe(t){m||h.push(b(t))}export function historyReplace(t){m||h.push(b(t))}function f(t){return t.replace(/=&/g,"&").replace(/=$/,"")}function J(){let t="";const n=i.selectedExhibitor,a=i.selectedBooth,e=i.selectedEventItem,o=i.selectedRoute,r=i.selectedSpeaker,l=i.setKioskModeEnabled;if(i.list.type==="route-planner"&&!n&&!a&&!e){const d=s.routePlannerStore;if(d.source==="bookmarks")t=`${P}&${W}=bookmarks`;else{const w=d.items.map(g=>g.entity.slug).filter(Boolean).join(I);t=`${P}=${w}`}const p=d.startPoint?.slug;p&&(t+=`&${K}=${p}`)}else if(o&&!i.isMultiPointRoute){const d=o.from?`:${o.from.slug}`:"",p=o.to?`:${o.to.slug}`:"",w=s.routeStore.onlyAccessible?":true":":false",g=o.waypoints?.map(u=>`:${u.slug}`).join("");t=`route${p}${d}${w}${g||""}`}else if(n)t=n.slug;else if(a)t=a.slug;else if(e)t=e.slug;else if(r)t=r.slug;else if(l)t="";else switch(i.list.type){case"bookmarks":t="bookmarks";break;case"visited":t="visited";break;case"category":t=i.selectedCategory.slug;break;case"search":t=i.list.text||"";break;case"language":t=i.list.type;break;case"filter":t=`${i.list.query.key}=${i.list.query.value}`;break;case"sessions":t="sessions";break;case"exhibitors":t="exhibitors";break;case"speakers":t="speakers";break;case"tours":t="tours";break;case"multi-point-tour":t=`tour=${i.list.tourId}`;break;default:throw new Error("Unkown list.type")}if(C)return;const c=t?"?"+encodeURIComponent(t):"";h.location.search!==c&&(n!==z||a!==j||e!==q?fe(c):historyReplace(c),z=n,j=a,q=e)}function X(){const t=i.selectedExhibitor,n=i.selectedEventItem,a=i.selectedSpeaker;let e="";t?e=t.name:n?e=n.name:a?e=a.name:i.list.type==="search"&&i.list.text?e="`"+(i.list.text||"")+"`":i.list.type==="multi-point-tour"&&i.tourTitle&&(e=i.tourTitle),e.length&&(e+=" \u2013 "),e+=x.title,x.subtitle&&(e+=" \u2013 "+x.subtitle),e+=" \u2013 Expo Floor Plan by ExpoFP",document.title=e}function _(){const t=h.location.search.length>1?decodeURIComponent(h.location.search.substring(1)):"";return A(t,!1)}function y(){const t=h.location.search.length>1?decodeURIComponent(h.location.search.substring(1)):"";C=!0;const n=s.boothStore.booths.find(e=>e.slug?.toLowerCase()===t?.toLowerCase()||e.externalId?.toLowerCase()===t?.toLowerCase()||e.externalId?.toLowerCase()?.replace(/\s+/g,"")===t?.toLowerCase()),a=new URLSearchParams(decodeURIComponent(window.location.search));if(he(a),de(a),!_())if(a.has("yah")){const e=a.get("yah");A(`${ne} ${e}`,!0)}else if(a.has(F)){const e=a.get(F);e==="1"?i.kiosk=!0:e==="0"&&(i.kiosk=!1,i.resetUIScale())}else if(t==="tours")s.selectTours();else if(t.startsWith("tour=")){const e=t.split("=")[1],o=s.toursStore.getTourById(e);o?s.toursStore.launchTour(o,o.name,o.description):(console.warn(`Route with id "${e}" not found`),s.selectTours())}else if(a.has(P)){const e=a.get(W),o=a.get(K),r=o?ie(o):null;if(e==="bookmarks")s.routePlannerStore.launchFromBookmarks(r??void 0);else{const l=(a.get(P)||"").split(I).filter(Boolean);s.routePlannerStore.launchFromSlugs(l,r??void 0)}}else if(t.startsWith("route")){const e=t.split(I);U(()=>{s.routeStore.onlyAccessible=e[3]==="true"});const o=ae(e[2],e[1],e.slice(4));s.routeStore.selectRoute(o);const l=e.slice(4).length>0;s.uiState.setIsMultiPointRoute(l);const d=new URLSearchParams(window.location.search).get("title");d&&s.uiState.setRouteTitle(d)}else if(t==="bookmarks")s.selectBookmarks();else if(t==="visited")s.selectVisited();else if(t==="language")s.selectLanguage();else if(a.has(Y)){const e=a.get(Y)?.toLowerCase();s.languageStore.languageIds.has(e)&&s.languageStore.changeLanguage(e)}else if(t==="sessions")s.selectSessions();else if(t==="exhibitors")s.selectExhibitors();else if(t==="speakers")s.selectSpeakers();else if(t==="-pdf")s.uiState.printingPdf=!0;else if(t.startsWith("hide"))s.uiState.setVisibility(new URLSearchParams(t).get("hide").split(",").filter(Boolean).reduce((e,o)=>({...e,[o]:!1}),{}));else if(n)setTimeout(()=>s.selectBooth(n),250);else if(t===oe)s.uiState.startBuildRoute();else if(a.get(N)){const e=a.get(N),o=a.get("booths")?.split(",")||[],r=a.get("exhibitors")?.split(",")||[],l=a.get("tour");if(l){const u=s.toursStore.getTourById(l);u&&U(()=>{s.uiState.setTourTitle(u.name),s.uiState.setTourDescription(u.description),s.uiState.setIsMultiPointTour(!0),s.uiState.setMultiPointTourList(u.id)})}const c=s.boothStore.booths,d=s.exhibitorStore.exhibitors,p=c.filter(u=>o.includes(u.externalId)),w=d.filter(u=>r.includes(u.externalId)).flatMap(u=>u.booths),g=[...p,...w];if(le()){const u=g.map(ee=>ee.layer.name),M=ue(u);M&&s.fp.activateFloor({name:M})}(o.length>0||r.length>0)&&s.fp.highlightEntities([...o,...r]),s.layerStore.showPathWay(e),g.length>0&&U(()=>{s.uiState.moveToRect=ce.fromMultiple(g.map(u=>u.rect).filter(Boolean)),s.uiState.rollReset=!0})}else{const e=s.eventStore.eventItems.find(o=>o.slug?.toLowerCase()===t?.toLowerCase()||o.externalId?.toLowerCase()===t?.toLowerCase());if(e)s.selectEventItem(e,!0);else{const o=s.exhibitorStore.exhibitors.find(r=>r.slug?.toLowerCase()===t?.toLowerCase()||r.externalId?.toLowerCase()===t?.toLowerCase());if(t.startsWith("exhibitors")){const r=t.split("=")[1].split(",");setTimeout(()=>s.fp.selectExhibitor(r),250)}else if(o)setTimeout(()=>s.clickExhibitor(o),250);else if(t.includes("=")&&(t.startsWith("categories=")||t.startsWith("poiType=")))v.log("Skipping filter parameter in dispatchFromUrl:",t);else{const l=s.categoryStore.categories.find(c=>c.slug===t);if(l)s.selectCategory(l);else{const c=s.speakerStore.findBySlug(t);c?s.selectSpeaker(c,!0):t.includes("heatmap=true")||s.searchStore.selectSearch(t)}}}}C=!1,J(),X()}function T(){const t=h.location.search;if(t.includes("heatmap")){const e=new URL(window.location.href);if(e.searchParams.get("heatmap")==="true")if(e.searchParams.get("type")==="yah"){let r=f(e.search);m=!0,historyReplace(r),s.uiState.heatmapYah=!0,s.uiState.monochrome=!0,s.uiState.hideLogoInBooth=!0,s.uiState.hideHeaderLogo=!0,s.uiState.disableBookmarked=!0}else{e.searchParams.delete("heatmap");let r=f(e.search);m=!0,historyReplace(r),s.uiState.heatmap=!0}}if(t.startsWith("?preview="))historyReplace("?");else if(t.startsWith("?b="))historyReplace("?bookmarks");else if(t.startsWith("?ba=")){const e=new URL(window.location.href),o=parseInt(e.searchParams.get("ba")),r=s.exhibitorStore.exhibitorById.get(o);historyReplace(r?"?"+r.slug:"?bookmarks")}else t.startsWith("?mapbox=false")&&(s.mapboxStore.isMapbox=!1,historyReplace("?"));if(t.includes("blue-dot")){const e=new URL(window.location.href),o=e.searchParams.get("blue-dot").split(",");if(e.searchParams.delete("blue-dot"),o.length>1){const l=s.layerStore.findLayer(o[2])?.name,c=new re(Number(o[0])||void 0,Number(o[1])||void 0,l,void 0,Number(o[3])||void 0,Number(o[4])||void 0);s.layerStore.layersLoaded?s.routeStore.selectCurrentPosition(c,!1,1):k(()=>s.layerStore.layersLoaded,()=>{s.routeStore.selectCurrentPosition(c,!1,1)})}let r=f(e.search);historyReplace(r)}if(t.includes("copy_exh")){const e=new URL(window.location.href),o=e.searchParams.get("copy_exh");e.searchParams.delete("copy_exh"),historyReplace("?")}if(t.includes("noOverlay")){const e=new URL(window.location.href),o=e.searchParams.get("noOverlay");e.searchParams.delete("noOverlay");let r=f(e.search);o==="true"?s.uiState.hideOverlay=!0:o==="false"&&(s.uiState.hideOverlay=!1),historyReplace(r)}if(t.includes("allowConsent")){const e=new URL(window.location.href),o=e.searchParams.get("allowConsent");e.searchParams.delete("allowConsent");const r=f(e.search);o==="true"?D(!0):o==="false"&&D(!1),historyReplace(r)}if(t.includes("hideHeaderLogo")){const e=new URL(window.location.href),o=e.searchParams.get("hideHeaderLogo");e.searchParams.delete("hideHeaderLogo");const r=f(e.search);o==="true"&&(i.hideHeaderLogo=!0),historyReplace(r)}if(t.includes("hideLogoInBooth")){const e=new URL(window.location.href),o=e.searchParams.get("hideLogoInBooth");e.searchParams.delete("hideLogoInBooth");const r=f(e.search);o==="true"&&(i.hideLogoInBooth=!0),historyReplace(r)}if(t.includes("disableFeatured")){const e=new URL(window.location.href),o=e.searchParams.get("disableFeatured");e.searchParams.delete("disableFeatured");const r=f(e.search);o==="true"&&s.exhibitorStore.exhibitors.forEach(l=>l.featured=!1),historyReplace(r)}if(t.includes("disableBookmarked")){const e=new URL(window.location.href),o=e.searchParams.get("disableBookmarked");e.searchParams.delete("disableBookmarked");const r=f(e.search);o==="true"&&(i.disableBookmarked=!0),historyReplace(r)}if(t.includes("disableGps")){const e=new URL(window.location.href),o=e.searchParams.get("disableGps");e.searchParams.delete("disableGps");const r=f(e.search);o==="true"&&s.routeStore.setGpsTrackingEnabled(!1),historyReplace(r)}if(t.includes("monochrome")){const e=new URL(window.location.href),o=e.searchParams.get("monochrome");e.searchParams.delete("monochrome");const r=f(e.search);o==="true"&&(i.monochrome=!0),historyReplace(r)}if((t.startsWith("?fbclid")||t.startsWith("?_ga"))&&historyReplace("?"),t.includes(R)){const e=new URL(window.location.href),o=e.searchParams.get(R);o==="1"||o==="true"?L&&localStorage.setItem(G,"1"):(o==="0"||o==="false")&&L&&localStorage.removeItem(G),e.searchParams.delete(R),historyReplace(f(e.search))}if(t.includes(E)){const e=new URL(window.location.href),o=e.searchParams.get(E);o==="true"?L&&localStorage.setItem($,"1"):o==="false"&&L&&localStorage.removeItem($),e.searchParams.delete(E),historyReplace(f(e.search))}if(i.previewExhibitor&&historyReplace("?"+i.previewExhibitor.slug),h.location.search.includes("&")||h.location.search.includes("%26")){let e=h.location.search;e=e.startsWith("?")?e.slice(1):e;const o=e.includes("&")?"&":"%26",l=e.split(o).map(c=>{const d=s.exhibitorStore.exhibitors.find(p=>p.slug===c||p.externalId===c);return d?d.name:c}).join("&");historyReplace("?"+l)}const n=new URLSearchParams(window.location.search);if(n.has(H)){s.uiState.resetUIScale();const e=new URL(window.location.href);e.searchParams.delete(H);let o=f(e.search);m=!0,historyReplace(o),m=!1}const a=n.get(V);if(a){const e=a.replace(",","."),o=parseFloat(e);!isNaN(o)&&o>=.8&&o<=1.4?s.uiState.setUIScale(o,!0):v.warn(`Invalid ui-scale parameter: ${a}. Must be a number between 0.8 and 1.4.`);const r=new URL(window.location.href);r.searchParams.delete(V);let l=f(r.search);m=!0,historyReplace(l),m=!1}}export function initRouting(t=!1){m=t,!m&&b(h.location.search)===B&&S.push(b(h.location.search)),Q=h.listen((n,a)=>{m||(S.push(b(n.search)),v.log("history",a,n),a==="POP"&&y())}),T(),_(),k(()=>s.layerStore.layersLoaded,()=>{s.urlFilterManager&&!s.urlFilterManager.isInitialized&&s.urlFilterManager.initialize(),y(),O(X),O(J),i.viewerMode&&(i.menu=!0)})}export function applyParameters(t=""){historyReplace("?"+decodeURIComponent(t.toString())),s.layerStore.layersLoaded?(T(),y()):(_(),k(()=>s.layerStore.layersLoaded,()=>{T(),y()}))}export function destroyHistory(){Q()}export function goBack(){if(console.log("goBack"),S.length>1){S.pop();const n=S[S.length-1].replace(B,"");return m=!0,h.replace(n),m=!1,y(),!0}else return h.go(-1),!1}function de(t){try{let n={};const a=i.defaultMapSettings;if(new Set(t.keys()).size)n=Z(Object.fromEntries(t.entries()),a);else{const e=sessionStorage.getItem(se);e&&(n=Z(JSON.parse(e),a))}if(i.setMapSettings(n),n.z){const e=s.layerStore.layers.find(o=>o.name===n.z);e&&s.layerStore.updateVisibility(e,!0)}}catch(n){console.error("Failed to process or save map settings.",n)}}function Z(t,n){const a={};for(const e in t){if(!Object.prototype.hasOwnProperty.call(n,e)||!Object.prototype.hasOwnProperty.call(t,e))continue;const o=t[e];typeof n[e]=="number"&&typeof o=="string"?a[e]=parseFloat(o):a[e]=o}return a}
@@ -26,6 +26,7 @@ export declare class Layer {
26
26
  mode: LayerMode;
27
27
  children: LayerDef[];
28
28
  pathway?: boolean;
29
+ floorIndex?: number;
29
30
  loaded: boolean;
30
31
  visible: boolean;
31
32
  get shortName(): string;
@@ -1 +1 @@
1
- import{__esDecorate as l,__runInitializers as o}from"tslib";import{action as w,computed as v,observable as u,runInAction as C}from"mobx";import n from".";import I from"../components/Map/drawing/config/config-load-layer";import W from"../core/Rect";import{shortenName as j}from"../utils/shortenName";import{areLayersEnabled as D}from"../utils/areLayersEnabled";export var LayersMode;(function(i){i[i.Default=0]="Default",i[i.Separated=1]="Separated",i[i.Radio=2]="Radio",i[i.CheckBox=3]="CheckBox"})(LayersMode||(LayersMode={}));export var LayerMode;(function(i){i[i.Unset=0]="Unset",i[i.AlwaysVisible=1]="AlwaysVisible",i[i.AlwaysHidden=2]="AlwaysHidden",i[i.TurnedOn=3]="TurnedOn",i[i.TurnedOff=4]="TurnedOff"})(LayerMode||(LayerMode={}));let O=(()=>{let i,h=[],y=[],m,p=[],_=[];return class{static{const c=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;i=[u],m=[u],l(null,null,i,{kind:"field",name:"loaded",static:!1,private:!1,access:{has:s=>"loaded"in s,get:s=>s.loaded,set:(s,f)=>{s.loaded=f}},metadata:c},h,y),l(null,null,m,{kind:"field",name:"visible",static:!1,private:!1,access:{has:s=>"visible"in s,get:s=>s.visible,set:(s,f)=>{s.visible=f}},metadata:c},p,_),c&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c})}basePriority;name;description;frozen;rect=null;viewbox=null;configured;childLayers=[];rootParent=null;mode;children=[];pathway;loaded=o(this,h,void 0);visible=(o(this,y),o(this,p,void 0));get shortName(){return j(this.description)}constructor(){o(this,_)}}})();export{O as Layer};let N=(()=>{let i=[],h,y=[],m=[],p,_=[],b=[],c,s=[],f=[],L,S=[],P=[],k,x,A,R,T,V,z,E;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;h=[u],p=[u],c=[u],L=[u],k=[v({keepAlive:!0})],x=[v({keepAlive:!0})],A=[v({keepAlive:!0})],R=[v],T=[v],V=[w],z=[w],E=[w],l(this,null,k,{kind:"getter",name:"visible",static:!1,private:!1,access:{has:e=>"visible"in e,get:e=>e.visible},metadata:t},null,i),l(this,null,x,{kind:"getter",name:"loaded",static:!1,private:!1,access:{has:e=>"loaded"in e,get:e=>e.loaded},metadata:t},null,i),l(this,null,A,{kind:"getter",name:"rectangle",static:!1,private:!1,access:{has:e=>"rectangle"in e,get:e=>e.rectangle},metadata:t},null,i),l(this,null,R,{kind:"getter",name:"pathwayLayers",static:!1,private:!1,access:{has:e=>"pathwayLayers"in e,get:e=>e.pathwayLayers},metadata:t},null,i),l(this,null,T,{kind:"getter",name:"floors",static:!1,private:!1,access:{has:e=>"floors"in e,get:e=>e.floors},metadata:t},null,i),l(this,null,V,{kind:"method",name:"updateVisibility",static:!1,private:!1,access:{has:e=>"updateVisibility"in e,get:e=>e.updateVisibility},metadata:t},null,i),l(this,null,z,{kind:"method",name:"showPathWay",static:!1,private:!1,access:{has:e=>"showPathWay"in e,get:e=>e.showPathWay},metadata:t},null,i),l(this,null,E,{kind:"method",name:"hidePathways",static:!1,private:!1,access:{has:e=>"hidePathways"in e,get:e=>e.hidePathways},metadata:t},null,i),l(null,null,h,{kind:"field",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers,set:(e,a)=>{e.layers=a}},metadata:t},y,m),l(null,null,p,{kind:"field",name:"defaultLayer",static:!1,private:!1,access:{has:e=>"defaultLayer"in e,get:e=>e.defaultLayer,set:(e,a)=>{e.defaultLayer=a}},metadata:t},_,b),l(null,null,c,{kind:"field",name:"mode",static:!1,private:!1,access:{has:e=>"mode"in e,get:e=>e.mode,set:(e,a)=>{e.mode=a}},metadata:t},s,f),l(null,null,L,{kind:"field",name:"layersLoaded",static:!1,private:!1,access:{has:e=>"layersLoaded"in e,get:e=>e.layersLoaded,set:(e,a)=>{e.layersLoaded=a}},metadata:t},S,P),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}layers=(o(this,i),o(this,y,[]));defaultLayer=(o(this,m),o(this,_,void 0));mode=(o(this,b),o(this,s,void 0));layersLoaded=(o(this,f),o(this,S,!1));updateVisibilityTimeout=(o(this,P),0);get visible(){return this.layers.filter(t=>t.frozen||t.visible)}get loaded(){return this.layers.filter(t=>t.loaded)}get rectangle(){var t=this.visible.filter(e=>!e.frozen).map(e=>e.viewbox??e.rect);return this.mode!==LayersMode.Radio||!t.length?null:W.fromMultiple(t)||null}get pathwayLayers(){return this.layers.filter(t=>t.pathway)}get floors(){if(!D())return[];const t=new Set(this.layers.filter(a=>a&&!a.frozen&&!a.rootParent&&!a.pathway).concat(n.routeStore.layers.filter(a=>a&&a.mode!==LayerMode.AlwaysHidden&&a.mode!==LayerMode.AlwaysVisible))),e=Array.from(t).reverse();return e.map((a,r)=>{const d=n.routeStore.layers.length>0&&n.routeStore.layers.indexOf(a)===-1,g=n.toursStore.tourLayers.length>0&&n.toursStore.tourLayers.indexOf(a)===-1;return{layer:a,name:a.name,shortName:a.shortName,description:a.description,active:a.visible,disabled:!!(d||g),index:e.length-r-1}})}updateVisibility(t,e){if(this.mode===LayersMode.Radio&&!e)return;const a=t instanceof O?t:this.findLayer(t);if(!a||a.visible===e){a&&n.routeStore.currentRouteLayer!==a&&(n.routeStore.currentRouteLayer=a);return}I(a,n.rendererService).then(()=>{this.mode===LayersMode.Radio&&this.layers.filter(r=>!r.pathway).forEach(r=>{r.name!==a.name&&!r.frozen&&r.visible&&(r.visible=!1,r.childLayers.forEach(d=>{d.visible=!1}))}),a&&(a.visible=e,a.childLayers.forEach(r=>{r.visible=e}),e&&(n.routeStore.currentRouteLayer=a),typeof n.fp.onFloorActivated=="function"&&(clearTimeout(this.updateVisibilityTimeout),this.updateVisibilityTimeout=setTimeout(()=>{const r=n.fp.getFloors();n.fp.onFloorActivated(r.find(d=>d.name===a.name))})))})}findLayer(t){if(t==null)return null;const e=this.layers.filter(r=>!r.rootParent);if(typeof t=="number"&&(a=e.filter(r=>!r.frozen)[t],a))return a;t=t.toString().toLowerCase();var a=e.find(r=>{const d=(r.name.match(/(-?[0-9]+)/)||"")[0];return t===r?.name.toLowerCase()||t===r?.description.toLowerCase()||t===r?.shortName.toLowerCase()||t===d});return!a&&!/\D/.test(t)&&(a=e.filter(r=>!r.frozen)[parseInt(t)]),a}getPathwayList(){return this.layers.filter(t=>t.pathway)}async showPathWay(t){try{const e=this.findLayer(t);if(!e)throw new Error(`There is no pathway with this name. ${t}`);await I(e,n.rendererService);const a=this.getPathwayList();C(()=>{a.forEach(r=>{const d=r.name===t;r.visible=d,r.childLayers.forEach(g=>{g.visible=d})})})}catch(e){console.error("showPathWay",e)}}hidePathways(){this.getPathwayList().forEach(e=>{e.visible=!1,e.childLayers.forEach(a=>{a.visible=!1})})}}})();export default N;
1
+ import{__esDecorate as l,__runInitializers as o}from"tslib";import{action as w,computed as v,observable as u,runInAction as C}from"mobx";import n from".";import E from"../components/Map/drawing/config/config-load-layer";import W from"../core/Rect";import{shortenName as j}from"../utils/shortenName";import{areLayersEnabled as D}from"../utils/areLayersEnabled";export var LayersMode;(function(i){i[i.Default=0]="Default",i[i.Separated=1]="Separated",i[i.Radio=2]="Radio",i[i.CheckBox=3]="CheckBox"})(LayersMode||(LayersMode={}));export var LayerMode;(function(i){i[i.Unset=0]="Unset",i[i.AlwaysVisible=1]="AlwaysVisible",i[i.AlwaysHidden=2]="AlwaysHidden",i[i.TurnedOn=3]="TurnedOn",i[i.TurnedOff=4]="TurnedOff"})(LayerMode||(LayerMode={}));let O=(()=>{let i,h=[],y=[],m,p=[],_=[];return class{static{const c=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;i=[u],m=[u],l(null,null,i,{kind:"field",name:"loaded",static:!1,private:!1,access:{has:s=>"loaded"in s,get:s=>s.loaded,set:(s,f)=>{s.loaded=f}},metadata:c},h,y),l(null,null,m,{kind:"field",name:"visible",static:!1,private:!1,access:{has:s=>"visible"in s,get:s=>s.visible,set:(s,f)=>{s.visible=f}},metadata:c},p,_),c&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c})}basePriority;name;description;frozen;rect=null;viewbox=null;configured;childLayers=[];rootParent=null;mode;children=[];pathway;floorIndex;loaded=o(this,h,void 0);visible=(o(this,y),o(this,p,void 0));get shortName(){return j(this.description)}constructor(){o(this,_)}}})();export{O as Layer};let N=(()=>{let i=[],h,y=[],m=[],p,_=[],b=[],c,s=[],f=[],L,S=[],x=[],P,k,A,I,R,T,V,z;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;h=[u],p=[u],c=[u],L=[u],P=[v({keepAlive:!0})],k=[v({keepAlive:!0})],A=[v({keepAlive:!0})],I=[v],R=[v],T=[w],V=[w],z=[w],l(this,null,P,{kind:"getter",name:"visible",static:!1,private:!1,access:{has:e=>"visible"in e,get:e=>e.visible},metadata:t},null,i),l(this,null,k,{kind:"getter",name:"loaded",static:!1,private:!1,access:{has:e=>"loaded"in e,get:e=>e.loaded},metadata:t},null,i),l(this,null,A,{kind:"getter",name:"rectangle",static:!1,private:!1,access:{has:e=>"rectangle"in e,get:e=>e.rectangle},metadata:t},null,i),l(this,null,I,{kind:"getter",name:"pathwayLayers",static:!1,private:!1,access:{has:e=>"pathwayLayers"in e,get:e=>e.pathwayLayers},metadata:t},null,i),l(this,null,R,{kind:"getter",name:"floors",static:!1,private:!1,access:{has:e=>"floors"in e,get:e=>e.floors},metadata:t},null,i),l(this,null,T,{kind:"method",name:"updateVisibility",static:!1,private:!1,access:{has:e=>"updateVisibility"in e,get:e=>e.updateVisibility},metadata:t},null,i),l(this,null,V,{kind:"method",name:"showPathWay",static:!1,private:!1,access:{has:e=>"showPathWay"in e,get:e=>e.showPathWay},metadata:t},null,i),l(this,null,z,{kind:"method",name:"hidePathways",static:!1,private:!1,access:{has:e=>"hidePathways"in e,get:e=>e.hidePathways},metadata:t},null,i),l(null,null,h,{kind:"field",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers,set:(e,a)=>{e.layers=a}},metadata:t},y,m),l(null,null,p,{kind:"field",name:"defaultLayer",static:!1,private:!1,access:{has:e=>"defaultLayer"in e,get:e=>e.defaultLayer,set:(e,a)=>{e.defaultLayer=a}},metadata:t},_,b),l(null,null,c,{kind:"field",name:"mode",static:!1,private:!1,access:{has:e=>"mode"in e,get:e=>e.mode,set:(e,a)=>{e.mode=a}},metadata:t},s,f),l(null,null,L,{kind:"field",name:"layersLoaded",static:!1,private:!1,access:{has:e=>"layersLoaded"in e,get:e=>e.layersLoaded,set:(e,a)=>{e.layersLoaded=a}},metadata:t},S,x),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}layers=(o(this,i),o(this,y,[]));defaultLayer=(o(this,m),o(this,_,void 0));mode=(o(this,b),o(this,s,void 0));layersLoaded=(o(this,f),o(this,S,!1));updateVisibilityTimeout=(o(this,x),0);get visible(){return this.layers.filter(t=>t.frozen||t.visible)}get loaded(){return this.layers.filter(t=>t.loaded)}get rectangle(){var t=this.visible.filter(e=>!e.frozen).map(e=>e.viewbox??e.rect);return this.mode!==LayersMode.Radio||!t.length?null:W.fromMultiple(t)||null}get pathwayLayers(){return this.layers.filter(t=>t.pathway)}get floors(){if(!D())return[];const t=new Set(this.layers.filter(a=>a&&!a.frozen&&!a.rootParent&&!a.pathway).concat(n.routeStore.layers.filter(a=>a&&a.mode!==LayerMode.AlwaysHidden&&a.mode!==LayerMode.AlwaysVisible))),e=Array.from(t).reverse();return e.map((a,r)=>{const d=n.routeStore.layers.length>0&&n.routeStore.layers.indexOf(a)===-1,g=n.toursStore.tourLayers.length>0&&n.toursStore.tourLayers.indexOf(a)===-1;return{layer:a,name:a.name,shortName:a.shortName,description:a.description,active:a.visible,disabled:!!(d||g),index:a.floorIndex??e.length-r-1}})}updateVisibility(t,e){if(this.mode===LayersMode.Radio&&!e)return;const a=t instanceof O?t:this.findLayer(t);if(!a||a.visible===e){a&&n.routeStore.currentRouteLayer!==a&&(n.routeStore.currentRouteLayer=a);return}E(a,n.rendererService).then(()=>{this.mode===LayersMode.Radio&&this.layers.filter(r=>!r.pathway).forEach(r=>{r.name!==a.name&&!r.frozen&&r.visible&&(r.visible=!1,r.childLayers.forEach(d=>{d.visible=!1}))}),a&&(a.visible=e,a.childLayers.forEach(r=>{r.visible=e}),e&&(n.routeStore.currentRouteLayer=a),typeof n.fp.onFloorActivated=="function"&&(clearTimeout(this.updateVisibilityTimeout),this.updateVisibilityTimeout=setTimeout(()=>{const r=n.fp.getFloors();n.fp.onFloorActivated(r.find(d=>d.name===a.name))})))})}findLayer(t){if(t==null)return null;const e=this.layers.filter(r=>!r.rootParent);if(typeof t=="number"&&(a=e.filter(r=>!r.frozen)[t],a))return a;t=t.toString().toLowerCase();var a=e.find(r=>{const d=(r.name.match(/(-?[0-9]+)/)||"")[0];return t===r?.name.toLowerCase()||t===r?.description.toLowerCase()||t===r?.shortName.toLowerCase()||t===d});return!a&&!/\D/.test(t)&&(a=e.filter(r=>!r.frozen)[parseInt(t)]),a}getPathwayList(){return this.layers.filter(t=>t.pathway)}async showPathWay(t){try{const e=this.findLayer(t);if(!e)throw new Error(`There is no pathway with this name. ${t}`);await E(e,n.rendererService);const a=this.getPathwayList();C(()=>{a.forEach(r=>{const d=r.name===t;r.visible=d,r.childLayers.forEach(g=>{g.visible=d})})})}catch(e){console.error("showPathWay",e)}}hidePathways(){this.getPathwayList().forEach(e=>{e.visible=!1,e.childLayers.forEach(a=>{a.visible=!1})})}}})();export default N;
@@ -13,6 +13,7 @@ export default class RoutePlannerStore {
13
13
  items: PlannerItem[];
14
14
  startPoint: Booth | null;
15
15
  source: PlannerSource | null;
16
+ excludedVisitedCount: number;
16
17
  constructor(rootStore: RootStore);
17
18
  get resolvedBooths(): Booth[];
18
19
  get stopsCount(): number;
@@ -26,7 +27,22 @@ export default class RoutePlannerStore {
26
27
  stops: string;
27
28
  from: string | undefined;
28
29
  distance: string | undefined;
30
+ travelTime: string | undefined;
29
31
  };
32
+ get routeFloors(): {
33
+ id: number;
34
+ name: string;
35
+ description?: string;
36
+ basePriority?: number;
37
+ }[];
38
+ get currentRouteFloor(): {
39
+ id: number;
40
+ name: string;
41
+ } | undefined;
42
+ setRouteFloor(floor: {
43
+ id: number;
44
+ name: string;
45
+ }): void;
30
46
  launch(items: PlannerItem[], source?: PlannerSource, initialStartPoint?: Booth | null): void;
31
47
  launchFromBookmarks(initialStartPoint?: Booth | null): void;
32
48
  launchFromSlugs(slugs: string[], initialStartPoint?: Booth | null): void;
@@ -1 +1 @@
1
- import{__esDecorate as r,__runInitializers as c}from"tslib";import{action as h,computed as m,observable as p}from"mobx";import{findBooth as $,Route as G}from"./RouteStore";import{t as b}from"../utils/i18n";let H=(()=>{let n=[],S,g=[],_=[],P,v=[],k=[],y,B=[],I=[],R,x,w,O,F,z,C,E,A,N,L,M,T,j;return class{static{const e=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;S=[p],P=[p],y=[p],R=[m],x=[m],w=[m],O=[m],F=[m],z=[m],C=[h],E=[h],A=[h],N=[h],L=[h],M=[h],T=[h],j=[h],r(this,null,R,{kind:"getter",name:"resolvedBooths",static:!1,private:!1,access:{has:t=>"resolvedBooths"in t,get:t=>t.resolvedBooths},metadata:e},null,n),r(this,null,x,{kind:"getter",name:"stopsCount",static:!1,private:!1,access:{has:t=>"stopsCount"in t,get:t=>t.stopsCount},metadata:e},null,n),r(this,null,w,{kind:"getter",name:"startPointBoothOptions",static:!1,private:!1,access:{has:t=>"startPointBoothOptions"in t,get:t=>t.startPointBoothOptions},metadata:e},null,n),r(this,null,O,{kind:"getter",name:"startPointAutocompleteOptions",static:!1,private:!1,access:{has:t=>"startPointAutocompleteOptions"in t,get:t=>t.startPointAutocompleteOptions},metadata:e},null,n),r(this,null,F,{kind:"getter",name:"title",static:!1,private:!1,access:{has:t=>"title"in t,get:t=>t.title},metadata:e},null,n),r(this,null,z,{kind:"getter",name:"subtitleParts",static:!1,private:!1,access:{has:t=>"subtitleParts"in t,get:t=>t.subtitleParts},metadata:e},null,n),r(this,null,C,{kind:"method",name:"launch",static:!1,private:!1,access:{has:t=>"launch"in t,get:t=>t.launch},metadata:e},null,n),r(this,null,E,{kind:"method",name:"launchFromBookmarks",static:!1,private:!1,access:{has:t=>"launchFromBookmarks"in t,get:t=>t.launchFromBookmarks},metadata:e},null,n),r(this,null,A,{kind:"method",name:"launchFromSlugs",static:!1,private:!1,access:{has:t=>"launchFromSlugs"in t,get:t=>t.launchFromSlugs},metadata:e},null,n),r(this,null,N,{kind:"method",name:"buildRoute",static:!1,private:!1,access:{has:t=>"buildRoute"in t,get:t=>t.buildRoute},metadata:e},null,n),r(this,null,L,{kind:"method",name:"setStartPoint",static:!1,private:!1,access:{has:t=>"setStartPoint"in t,get:t=>t.setStartPoint},metadata:e},null,n),r(this,null,M,{kind:"method",name:"removeItem",static:!1,private:!1,access:{has:t=>"removeItem"in t,get:t=>t.removeItem},metadata:e},null,n),r(this,null,T,{kind:"method",name:"reorderItems",static:!1,private:!1,access:{has:t=>"reorderItems"in t,get:t=>t.reorderItems},metadata:e},null,n),r(this,null,j,{kind:"method",name:"close",static:!1,private:!1,access:{has:t=>"close"in t,get:t=>t.close},metadata:e},null,n),r(null,null,S,{kind:"field",name:"items",static:!1,private:!1,access:{has:t=>"items"in t,get:t=>t.items,set:(t,s)=>{t.items=s}},metadata:e},g,_),r(null,null,P,{kind:"field",name:"startPoint",static:!1,private:!1,access:{has:t=>"startPoint"in t,get:t=>t.startPoint,set:(t,s)=>{t.startPoint=s}},metadata:e},v,k),r(null,null,y,{kind:"field",name:"source",static:!1,private:!1,access:{has:t=>"source"in t,get:t=>t.source,set:(t,s)=>{t.source=s}},metadata:e},B,I),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}rootStore=c(this,n);items=c(this,g,[]);startPoint=(c(this,_),c(this,v,null));source=(c(this,k),c(this,B,null));constructor(e){c(this,I),this.rootStore=e}get resolvedBooths(){const e=new Map;return this.startPoint&&e.set(this.startPoint.id,this.startPoint),this.items.forEach(t=>{t.booth&&e.set(t.booth.id,t.booth)}),Array.from(e.values())}get stopsCount(){return this.items.length}get startPointBoothOptions(){const e=this.rootStore.boothStore.booths,t=this.rootStore.routeStore.defaultFrom;return t?[...e,t]:e}get startPointAutocompleteOptions(){const{exhibitorStore:e}=this.rootStore,t=this.startPointBoothOptions,s=[],i=new Set;return e.exhibitors.forEach(o=>{o.booths.forEach(l=>{i.add(l.id),s.push({value:l.id.toString(),label:`${o.name} - ${l.name}`})})}),t.filter(o=>!i.has(o.id)).forEach(o=>{s.push({value:o.id.toString(),label:o.name})}),s.sort((o,l)=>o.label.localeCompare(l.label,void 0,{sensitivity:"base"}))}get title(){return this.source==="bookmarks"?b("Bookmarks route"):""}get subtitleParts(){const{routeInfo:e}=this.rootStore.routeStore;return{stops:b("{{count}} stops",{count:this.stopsCount}),from:this.startPoint?b("From {{name}}",{name:this.startPoint.name}):void 0,distance:e?e.distance:void 0}}launch(e,t="custom",s){this.items=e.filter(a=>a.type==="exhibitor"?!a.entity.visited:!0),this.source=t,this.startPoint=s!==void 0?s:this.detectStartPoint();const{uiState:i}=this.rootStore;i.list={type:"route-planner",source:t},i.details=null,i.menu=!1,this.buildRoute()}launchFromBookmarks(e){const{exhibitorStore:t,eventStore:s,boothStore:i}=this.rootStore,a=[];t.bookmarked.forEach(o=>{a.push({type:"exhibitor",entity:o,booth:o.booths[0]||null})}),i.booths.filter(o=>o.exhibitors.length===0&&o.bookmarkedDirectly).forEach(o=>{a.push({type:"booth",entity:o,booth:o})}),this.launch(a,"bookmarks",e)}launchFromSlugs(e,t){const s=this.resolveSlugs(e);this.launch(s,"custom",t)}resolveSlugs(e){const{exhibitorStore:t,eventStore:s,boothStore:i}=this.rootStore;return e.filter(Boolean).map(a=>{const o=a.toLowerCase(),l=t.exhibitors.find(f=>f.slug?.toLowerCase()===o||f.externalId?.toLowerCase()===o);if(l)return{type:"exhibitor",entity:l,booth:l.booths[0]||null};const d=$(a);return d?{type:"booth",entity:d,booth:d}:null}).filter(a=>a!==null)}buildRoute(){const e=[];if(this.startPoint&&this.startPoint.name&&e.push(this.startPoint.name),this.items.forEach(u=>{u.booth&&u.booth.name&&e.push(u.booth.name)}),e.length<2){this.rootStore.routeStore.updateRoute([]);return}let t;try{const u=this.rootStore.fp?.getOptimizedRoutes?.(e);t=Array.isArray(u)?u.flatMap(D=>D?.waypoints??[]):[]}catch{t=[]}const s=new Set(e),i=new Set(t),a=e.length>0&&[...s].every(u=>i.has(u));(!t.length||!a)&&(t=e.slice()),this.reorderItemsByNames(t);const o=this.resolvedBooths;if(o.length<2){this.rootStore.routeStore.updateRoute([]);return}const l=o[0],d=o[o.length-1],f=o.slice(1,-1),q=new G(l,d,f);this.rootStore.routeStore.selectRoute(q,!1),this.rootStore.uiState.setIsMultiPointRoute(f.length>0)}reorderItemsByNames(e){const t=this.startPoint?this.startPoint.name:null,s=new Map;this.items.forEach(a=>{const o=a.booth?a.booth.name:null;o&&(s.has(o)||s.set(o,[]),s.get(o).push(a))});const i=[];e.forEach(a=>{if(a!==t){const o=s.get(a);o&&o.length>0&&i.push(...o.splice(0))}}),this.items=i}detectStartPoint(){const{boothStore:e,poiTypeStore:t}=this.rootStore,s=["entrance","entrances"],i=t.poiTypes.find(a=>s.includes(a.name.toLowerCase()));return i&&e.booths.find(a=>a.poiTypeId===i.id)||null}setStartPoint(e){this.startPoint=e,this.buildRoute()}removeItem(e){this.items.splice(e,1),this.buildRoute()}reorderItems(e,t){const[s]=this.items.splice(e,1);this.items.splice(t,0,s),this.buildRoute()}close(){this.items=[],this.startPoint=null,this.source=null,this.rootStore.uiState.details=null,this.rootStore.uiState.list={type:"search",text:"",focused:!1},this.rootStore.routeStore.selectRoute(null,!1)}}})();export default H;
1
+ import{__esDecorate as r,__runInitializers as u}from"tslib";import{action as c,computed as d,observable as g}from"mobx";import{findBooth as Q,Route as U}from"./RouteStore";import{t as p}from"../utils/i18n";let W=(()=>{let n=[],_,S=[],b=[],P,v=[],y=[],k,R=[],x=[],F,B=[],I=[],C,w,O,z,V,E,L,A,N,M,T,j,q,D,$,G,H;return class{static{const e=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;_=[g],P=[g],k=[g],F=[g],C=[d],w=[d],O=[d],z=[d],V=[d],E=[d],L=[d],A=[d],N=[c],M=[c],T=[c],j=[c],q=[c],D=[c],$=[c],G=[c],H=[c],r(this,null,C,{kind:"getter",name:"resolvedBooths",static:!1,private:!1,access:{has:t=>"resolvedBooths"in t,get:t=>t.resolvedBooths},metadata:e},null,n),r(this,null,w,{kind:"getter",name:"stopsCount",static:!1,private:!1,access:{has:t=>"stopsCount"in t,get:t=>t.stopsCount},metadata:e},null,n),r(this,null,O,{kind:"getter",name:"startPointBoothOptions",static:!1,private:!1,access:{has:t=>"startPointBoothOptions"in t,get:t=>t.startPointBoothOptions},metadata:e},null,n),r(this,null,z,{kind:"getter",name:"startPointAutocompleteOptions",static:!1,private:!1,access:{has:t=>"startPointAutocompleteOptions"in t,get:t=>t.startPointAutocompleteOptions},metadata:e},null,n),r(this,null,V,{kind:"getter",name:"title",static:!1,private:!1,access:{has:t=>"title"in t,get:t=>t.title},metadata:e},null,n),r(this,null,E,{kind:"getter",name:"subtitleParts",static:!1,private:!1,access:{has:t=>"subtitleParts"in t,get:t=>t.subtitleParts},metadata:e},null,n),r(this,null,L,{kind:"getter",name:"routeFloors",static:!1,private:!1,access:{has:t=>"routeFloors"in t,get:t=>t.routeFloors},metadata:e},null,n),r(this,null,A,{kind:"getter",name:"currentRouteFloor",static:!1,private:!1,access:{has:t=>"currentRouteFloor"in t,get:t=>t.currentRouteFloor},metadata:e},null,n),r(this,null,N,{kind:"method",name:"setRouteFloor",static:!1,private:!1,access:{has:t=>"setRouteFloor"in t,get:t=>t.setRouteFloor},metadata:e},null,n),r(this,null,M,{kind:"method",name:"launch",static:!1,private:!1,access:{has:t=>"launch"in t,get:t=>t.launch},metadata:e},null,n),r(this,null,T,{kind:"method",name:"launchFromBookmarks",static:!1,private:!1,access:{has:t=>"launchFromBookmarks"in t,get:t=>t.launchFromBookmarks},metadata:e},null,n),r(this,null,j,{kind:"method",name:"launchFromSlugs",static:!1,private:!1,access:{has:t=>"launchFromSlugs"in t,get:t=>t.launchFromSlugs},metadata:e},null,n),r(this,null,q,{kind:"method",name:"buildRoute",static:!1,private:!1,access:{has:t=>"buildRoute"in t,get:t=>t.buildRoute},metadata:e},null,n),r(this,null,D,{kind:"method",name:"setStartPoint",static:!1,private:!1,access:{has:t=>"setStartPoint"in t,get:t=>t.setStartPoint},metadata:e},null,n),r(this,null,$,{kind:"method",name:"removeItem",static:!1,private:!1,access:{has:t=>"removeItem"in t,get:t=>t.removeItem},metadata:e},null,n),r(this,null,G,{kind:"method",name:"reorderItems",static:!1,private:!1,access:{has:t=>"reorderItems"in t,get:t=>t.reorderItems},metadata:e},null,n),r(this,null,H,{kind:"method",name:"close",static:!1,private:!1,access:{has:t=>"close"in t,get:t=>t.close},metadata:e},null,n),r(null,null,_,{kind:"field",name:"items",static:!1,private:!1,access:{has:t=>"items"in t,get:t=>t.items,set:(t,o)=>{t.items=o}},metadata:e},S,b),r(null,null,P,{kind:"field",name:"startPoint",static:!1,private:!1,access:{has:t=>"startPoint"in t,get:t=>t.startPoint,set:(t,o)=>{t.startPoint=o}},metadata:e},v,y),r(null,null,k,{kind:"field",name:"source",static:!1,private:!1,access:{has:t=>"source"in t,get:t=>t.source,set:(t,o)=>{t.source=o}},metadata:e},R,x),r(null,null,F,{kind:"field",name:"excludedVisitedCount",static:!1,private:!1,access:{has:t=>"excludedVisitedCount"in t,get:t=>t.excludedVisitedCount,set:(t,o)=>{t.excludedVisitedCount=o}},metadata:e},B,I),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}rootStore=u(this,n);items=u(this,S,[]);startPoint=(u(this,b),u(this,v,null));source=(u(this,y),u(this,R,null));excludedVisitedCount=(u(this,x),u(this,B,0));constructor(e){u(this,I),this.rootStore=e}get resolvedBooths(){const e=new Map;return this.startPoint&&e.set(this.startPoint.id,this.startPoint),this.items.forEach(t=>{t.booth&&e.set(t.booth.id,t.booth)}),Array.from(e.values())}get stopsCount(){return this.items.length}get startPointBoothOptions(){const e=this.rootStore.boothStore.booths,t=this.rootStore.routeStore.defaultFrom;return t?[...e,t]:e}get startPointAutocompleteOptions(){const{exhibitorStore:e}=this.rootStore,t=this.startPointBoothOptions,o=[],a=new Set;return e.exhibitors.forEach(s=>{s.booths.forEach(l=>{a.add(l.id),o.push({value:l.id.toString(),label:`${s.name} - ${l.name}`})})}),t.filter(s=>!a.has(s.id)).forEach(s=>{o.push({value:s.id.toString(),label:s.name})}),o.sort((s,l)=>s.label.localeCompare(l.label,void 0,{sensitivity:"base"}))}get title(){return this.source==="bookmarks"?p("Bookmarks route"):""}get subtitleParts(){const{routeInfo:e}=this.rootStore.routeStore;let t;if(e?.time){const o=e.time;t=o<60?p("< 1 min"):p("~ {{n}} min",{n:Math.round(o/60)})}return{stops:p("{{count}} stops",{count:this.stopsCount}),from:this.startPoint?p("From {{name}}",{name:this.startPoint.name}):void 0,distance:e?e.distance:void 0,travelTime:t}}get routeFloors(){return this.rootStore.routeStore.pathLayers.map(e=>({id:e.id,name:e.layer?.shortName,description:e.layer?.description,basePriority:e.layer?.basePriority??0}))}get currentRouteFloor(){const e=this.routeFloors,t=this.rootStore.routeStore.currentRouteLayer;if(!e.length)return;if(!t)return e[0]?{id:e[0].id,name:e[0].name}:void 0;const o=e.find(a=>a.description?.toLowerCase()===t.description?.toLowerCase());return o?{id:o.id,name:o.name}:{id:e[0].id,name:e[0].name}}setRouteFloor(e){const t=this.rootStore.routeStore.pathLayers.find(o=>o.id===e.id);t?.layer&&this.rootStore.layerStore.updateVisibility(t.layer,!0)}launch(e,t="custom",o){this.excludedVisitedCount=e.filter(i=>i.type==="exhibitor"&&i.entity.visited).length,this.items=e.filter(i=>i.type==="exhibitor"?!i.entity.visited:!0),this.source=t,this.startPoint=o!==void 0?o:this.detectStartPoint();const{uiState:a}=this.rootStore;a.list={type:"route-planner",source:t},a.details=null,a.menu=!1,this.buildRoute()}launchFromBookmarks(e){const{exhibitorStore:t,eventStore:o,boothStore:a}=this.rootStore,i=[];t.bookmarked.forEach(s=>{i.push({type:"exhibitor",entity:s,booth:s.booths[0]||null})}),a.booths.filter(s=>s.exhibitors.length===0&&s.bookmarkedDirectly).forEach(s=>{i.push({type:"booth",entity:s,booth:s})}),this.launch(i,"bookmarks",e)}launchFromSlugs(e,t){const o=this.resolveSlugs(e);this.launch(o,"custom",t)}resolveSlugs(e){const{exhibitorStore:t,eventStore:o,boothStore:a}=this.rootStore;return e.filter(Boolean).map(i=>{const s=i.toLowerCase(),l=t.exhibitors.find(f=>f.slug?.toLowerCase()===s||f.externalId?.toLowerCase()===s);if(l)return{type:"exhibitor",entity:l,booth:l.booths[0]||null};const m=Q(i);return m?{type:"booth",entity:m,booth:m}:null}).filter(i=>i!==null)}buildRoute(){const e=[];if(this.startPoint&&this.startPoint.name&&e.push(this.startPoint.name),this.items.forEach(h=>{h.booth&&h.booth.name&&e.push(h.booth.name)}),e.length<2){this.rootStore.routeStore.updateRoute([]);return}let t;try{const h=this.rootStore.fp?.getOptimizedRoutes?.(e);t=Array.isArray(h)?h.flatMap(K=>K?.waypoints??[]):[]}catch{t=[]}const o=new Set(e),a=new Set(t),i=e.length>0&&[...o].every(h=>a.has(h));(!t.length||!i)&&(t=e.slice()),this.reorderItemsByNames(t);const s=this.resolvedBooths;if(s.length<2){this.rootStore.routeStore.updateRoute([]);return}const l=s[0],m=s[s.length-1],f=s.slice(1,-1),J=new U(l,m,f);this.rootStore.routeStore.selectRoute(J,!1),this.rootStore.uiState.setIsMultiPointRoute(f.length>0)}reorderItemsByNames(e){const t=this.startPoint?this.startPoint.name:null,o=new Map;this.items.forEach(i=>{const s=i.booth?i.booth.name:null;s&&(o.has(s)||o.set(s,[]),o.get(s).push(i))});const a=[];e.forEach(i=>{if(i!==t){const s=o.get(i);s&&s.length>0&&a.push(...s.splice(0))}}),this.items=a}detectStartPoint(){const{boothStore:e,poiTypeStore:t}=this.rootStore,o=["entrance","entrances"],a=t.poiTypes.find(i=>o.includes(i.name.toLowerCase()));return a&&e.booths.find(i=>i.poiTypeId===a.id)||null}setStartPoint(e){this.startPoint=e,this.buildRoute()}removeItem(e){this.items.splice(e,1),this.buildRoute()}reorderItems(e,t){const[o]=this.items.splice(e,1);this.items.splice(t,0,o),this.buildRoute()}close(){this.items=[],this.startPoint=null,this.source=null,this.excludedVisitedCount=0,this.rootStore.uiState.details=null,this.rootStore.uiState.list={type:"search",text:"",focused:!1},this.rootStore.routeStore.selectRoute(null,!1)}}})();export default W;
@@ -192,6 +192,7 @@ export default class UIState {
192
192
  zoomOut(): void;
193
193
  fitBounds(): void;
194
194
  get previewMode(): boolean;
195
+ get viewerMode(): boolean;
195
196
  get selectedEventItem(): EventItem | null;
196
197
  /**
197
198
  * @warning If the property is of a numeric type, set the default value to be numeric, otherwise they will be cast incorrectly.