@expofp/floorplan 3.46.0 → 3.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/{Button-CJtSs2s5.js → Button-DyqVe4xL.js} +5 -5
- package/dist/browser/{CookieConsent-C4fi9Tyh.js → CookieConsent-Dne5UXwi.js} +7 -7
- package/dist/browser/{Debug-Cd610X28.js → Debug-CSY6FmRs.js} +7 -7
- package/dist/browser/{DebugTools-D9g4_7Cc.js → DebugTools-CSGF0Uqi.js} +6 -6
- package/dist/browser/{Demo-CryvOcgl.js → Demo-AI-22qbf.js} +9 -9
- package/dist/browser/{Free-CJXdChTu.js → Free-BmItczwV.js} +10 -10
- package/dist/browser/{GalleryContainer-DJEByROk.js → GalleryContainer-Do5QXu8h.js} +11 -11
- package/dist/browser/{GpsLoader-DSsG-xT8.js → GpsLoader-D6boL0AQ.js} +14 -14
- package/dist/browser/{KioskStore-DOB-av5O.js → KioskStore-DodjzUdk.js} +19 -19
- package/dist/browser/{LayerStore-CRZuLMs5.js → LayerStore-DCg-juRT.js} +289 -270
- package/dist/browser/{MaplibreAdapter-C_5hoa-Y.js → MaplibreAdapter-D838jbrB.js} +148 -148
- package/dist/browser/{ModalContainer-Ch8bqPHR.js → ModalContainer-DAh3OT88.js} +10 -10
- package/dist/browser/{PermissionNotice-CiR8SfU0.js → PermissionNotice-D9dFiy8Z.js} +6 -6
- package/dist/browser/{RouteStore-D5yYhhPl.js → RouteStore-B82dztUW.js} +342 -327
- package/dist/browser/{SetKioskMode-PiwwpWpN.js → SetKioskMode-DcQFm_UG.js} +12 -12
- package/dist/browser/{ShowKiosk-uWNhreCd.js → ShowKiosk-BnuT9vM-.js} +11 -11
- package/dist/browser/{UIState-Bi4-Ri9M.js → UIState-Dd6fvko0.js} +97 -97
- package/dist/browser/{ViewerMenuPanel-B3vtTFpG.js → ViewerMenuPanel-C3B3OmlN.js} +11 -11
- package/dist/browser/{add-debug-secret-listener-Db76vB7o.js → add-debug-secret-listener-BJu3pH2x.js} +1 -1
- package/dist/browser/{adopt-global-settings-67S2v_mo.js → adopt-global-settings-BerG23m2.js} +9 -9
- package/dist/browser/{boolean-editor-B1nYYAEd.js → boolean-editor-C1i1ID8g.js} +9 -9
- package/dist/browser/{bootIntercom-BQDnVlyT.js → bootIntercom-C3tqD4Ct.js} +2 -2
- package/dist/browser/bundle.json +87 -87
- package/dist/browser/{camera-events-dIlK_9kU.js → camera-events-DzSywgw0.js} +1 -1
- package/dist/browser/{classnames-CnT6VKND.js → classnames-CQMYVTW5.js} +2 -2
- package/dist/browser/{client-iKoOfnTw.js → client-DbQnuxsE.js} +5 -5
- package/dist/browser/{components-CEmFE-HF.js → components-CzNKFauU.js} +2211 -2160
- package/dist/browser/{create-live-plan-VYe8zgCt.js → create-live-plan-D17jzmnD.js} +505 -439
- package/dist/browser/{debug-context-SM4t83oS.js → debug-context-CLE9u3W1.js} +6 -6
- package/dist/browser/{debug-overlay-BLs-zKon.js → debug-overlay-CqyQd6Tu.js} +10 -10
- package/dist/browser/{debug-ui-COzdQWZH.js → debug-ui-CopIbPwZ.js} +6 -6
- package/dist/browser/{dist-Dxs4B_bo.js → dist-CXSdtHNF.js} +6 -6
- package/dist/browser/{dist-B-cTdqLW.js → dist-DrhAFaXl.js} +5 -5
- package/dist/browser/{dist-C7DmTDRb.js → dist-mSjAoqZa.js} +3 -3
- package/dist/browser/{efp-debug-init-B_S1vuGu.js → efp-debug-init-D3gNE8Zq.js} +3 -3
- package/dist/browser/{enum-editor-CNXjKr2S.js → enum-editor-DfEZj9xj.js} +4 -4
- package/dist/browser/{es5-DXybUgTP.js → es5-CRZbJ3RK.js} +2 -2
- package/dist/browser/{event-head-ClLbm9Br.js → event-head-C5Pqy8aE.js} +1 -1
- package/dist/browser/{event-not-found-DH79zTW9.js → event-not-found-y-baKtlx.js} +3 -3
- package/dist/browser/{event-scoped-cache-DpaRX7uc.js → event-scoped-cache-CUHa0QyF.js} +3 -3
- package/dist/browser/{expofpUrl-n296mHS4.js → expofpUrl-CUIqO5kL.js} +1 -1
- package/dist/browser/{exports-lzdhlipZ.js → exports-CnYQMV4a.js} +1 -1
- package/dist/browser/{favicon-DIM65QuL.js → favicon-DtPw8IL3.js} +1 -1
- package/dist/browser/{fetch-retry.umd-vSI4xMC_.js → fetch-retry.umd-DjnZ3Ut9.js} +2 -2
- package/dist/browser/{flex-BAVIARsK.js → flex-C5mQXGq5.js} +5 -5
- package/dist/browser/{floorplan.loader-eMUdl6jt.js → floorplan.loader-DEaS-fgT.js} +12 -12
- package/dist/browser/{floorplan.ready-1Txw5bTb.js → floorplan.ready-BOnFLVHj.js} +269 -243
- package/dist/browser/{framing-rect-BTpvle_p.js → framing-rect-BIpsCqTB.js} +426 -351
- package/dist/browser/{freeBanner-F3TTYS8Q.js → freeBanner-BQ-1hI0V.js} +2 -2
- package/dist/browser/{fuse-CaTg1KbU.js → fuse-jVBfzHic.js} +2 -2
- package/dist/browser/{i18n-C_4TK-u4.js → i18n-DlquqKCP.js} +333 -318
- package/dist/browser/index.js +33 -33
- package/dist/browser/{index.module-DRBCPeTj.js → index.module-CN0EtZcO.js} +4 -4
- package/dist/browser/{init-ui-BYGB5Nye.js → init-ui-BQ7d5hKB.js} +19 -19
- package/dist/browser/{integrateKiosk-BYXxa3GA.js → integrateKiosk-CumGPvbc.js} +6 -6
- package/dist/browser/{is-debug-D3IYeseH.js → is-debug-IkNSAGo8.js} +4 -4
- package/dist/browser/{is-own-domain-Sd0Gyaz6.js → is-own-domain-yrTLx04R.js} +1 -1
- package/dist/browser/{is-webview-DkUEFd5j.js → is-webview-DA6FLdme.js} +1 -1
- package/dist/browser/{jsx-runtime-Z0-uGdH1.js → jsx-runtime-BzLvm2y2.js} +2 -2
- package/dist/browser/{kiosk-mode-D9JdlNtc.js → kiosk-mode-zD8K_fUT.js} +3 -3
- package/dist/browser/{kiosk-record-U7MDU1j1.js → kiosk-record-Ckxa0L0B.js} +1 -1
- package/dist/browser/{kioskApi-CZmWdnyx.js → kioskApi-CG3QGuUx.js} +7 -7
- package/dist/browser/{ktx2-DBt1EdxU.js → ktx2-Dx_h97CR.js} +2 -2
- package/dist/browser/{lib-Bpc7qOXg.js → lib-5KOc2jVl.js} +3 -3
- package/dist/browser/{loadImage-Dy1_5knL.js → loadImage-iqS2KHgN.js} +1 -1
- package/dist/browser/{logDeviceInfo-DFiuu0JW.js → logDeviceInfo-DhvfxT2K.js} +9 -9
- package/dist/browser/{mobx-NvAhKUmy.js → mobx-CUFHrL57.js} +4 -4
- package/dist/browser/{mobx.module-Bv5V3v5d.js → mobx.module-BTnTbXnp.js} +1 -1
- package/dist/browser/{optional-boolean-editor-BEOwiXCN.js → optional-boolean-editor-C3k-DXeF.js} +3 -3
- package/dist/browser/{optional-enum-editor-C6KjlpRA.js → optional-enum-editor-CeY1nCnF.js} +4 -4
- package/dist/browser/{optional-string-editor-CFrCSmMd.js → optional-string-editor-DrVHjvsL.js} +4 -4
- package/dist/browser/{particles.min-C2A0DA4i.js → particles.min-BPS1Hdpf.js} +2 -2
- package/dist/browser/{react-CabZjr3N.js → react-XuvSZP7j.js} +2 -2
- package/dist/browser/{react-dom-RP6YFh3Z.js → react-dom-Cg1Pcvni.js} +3 -3
- package/dist/browser/{rolldown-runtime-fogUk23q.js → rolldown-runtime-5rOLGCTp.js} +1 -1
- package/dist/browser/{scene-DuvbPaPD.js → scene-CeKqMicD.js} +10 -10
- package/dist/browser/{scheduler-k2rbX-LJ.js → scheduler-D5sEY0Dn.js} +2 -2
- package/dist/browser/{select-DDC9fvlH.js → select-Cbv7ufJV.js} +10 -10
- package/dist/browser/{settings-BozBuwXD.js → settings-DgySPhLO.js} +2 -2
- package/dist/browser/{settings-item-D4rlEKz6.js → settings-item-e3YLYS4G.js} +6 -6
- package/dist/browser/{store-CbRrBMLs.js → store-DTvNQcN7.js} +2 -2
- package/dist/browser/{string-editor-CExhbakJ.js → string-editor-Dbv6xI9s.js} +4 -4
- package/dist/browser/{text-field-BV3Vp6cI.js → text-field-Cg5awwlh.js} +5 -5
- package/dist/browser/{theme-E8keDBEa.js → theme-BRoMMdQq.js} +8 -8
- package/dist/browser/{three.core-C_nLFu2C.js → three.core-DvpRLNmt.js} +1 -1
- package/dist/browser/{ui-CgHs1m5h.js → ui-DNMlY_VB.js} +8 -8
- package/dist/browser/{useRenderTarget-D7wRx7QW.js → useRenderTarget-C__MnkX7.js} +4 -4
- package/dist/browser/{viewport-BH6xyD06.js → viewport-DBuFXrrj.js} +3 -3
- package/dist/browser/{wayfinding-BiZuXF9Q.js → wayfinding-BUQns13Y.js} +516 -510
- package/dist/esm/components/BaseFilterModal.d.ts +4 -2
- package/dist/esm/components/BaseFilterModal.js +1 -1
- package/dist/esm/components/CategoryFilterModal.js +1 -1
- package/dist/esm/components/Map/drawing/config/booth-badge-anchor.d.ts +57 -5
- package/dist/esm/components/Map/drawing/config/booth-badge-anchor.js +1 -1
- package/dist/esm/components/Map/drawing/config/booth-fill-color.d.ts +16 -0
- package/dist/esm/components/Map/drawing/config/booth-fill-color.js +1 -0
- package/dist/esm/components/Map/drawing/config/config-booth-badge.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-bg.js +1 -1
- package/dist/esm/components/SearchButtons/SearchButton.d.ts +1 -0
- package/dist/esm/components/SearchButtons/SearchButton.js +1 -1
- package/dist/esm/floorplan.ready.js +1 -1
- package/dist/esm/services/URLFilterManager.d.ts +8 -0
- package/dist/esm/services/URLFilterManager.js +1 -1
- package/dist/esm/store/CategoryFilterStore.d.ts +33 -1
- package/dist/esm/store/CategoryFilterStore.js +1 -1
- package/dist/esm/store/RootStore.js +1 -1
- package/dist/esm/store/RouteStore.d.ts +9 -1
- package/dist/esm/store/RouteStore.js +1 -1
- package/dist/esm/store/SearchStore.js +1 -1
- package/dist/esm/store/providers/SearchShortcutProvider.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsActions.d.ts +7 -0
- package/dist/esm/store/search-buttons/SearchButtonsActions.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsFactory.d.ts +2 -2
- package/dist/esm/store/search-buttons/SearchButtonsFactory.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsFilters.d.ts +2 -2
- package/dist/esm/store/search-buttons/SearchButtonsFilters.js +1 -1
- package/dist/esm/store/search-buttons/constants.d.ts +0 -3
- package/dist/esm/store/search-buttons/constants.js +1 -1
- package/dist/esm/store/search-buttons/utils.d.ts +23 -2
- package/dist/esm/store/search-buttons/utils.js +1 -1
- package/dist/esm/store/types.d.ts +5 -0
- package/dist/esm/test/store-harness.js +1 -1
- package/dist/esm/utils/filter-groups.d.ts +9 -0
- package/dist/esm/utils/filter-groups.js +1 -0
- package/dist/esm/utils/gps.d.ts +5 -1
- package/dist/esm/utils/gps.js +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as o}from"tslib";import{action as s,computed as y,observable as S,runInAction as c}from"mobx";import{LANGUAGE_TYPE as w}from"../constants";import{URLFilterManager as v}from"../services/URLFilterManager";import{GaEventActions as n,sendEventToGa as p}from"../tools/gtag";import b from"../tools/logger";import{isWebGlSupported as g}from"../utils";import{resetLocale as k}from"../utils/i18n";import h from"../utils/is-mobile";import u from"../utils/is-webview";import{sanitizeSearch as x}from"../utils/sanitizeText";import B from"./BookmarksStore";import _,{BoothBase as f,RegularBooth as L}from"./BoothStore";import E from"./CategoryFilterStore";import C,{Category as T}from"./CategoryStore";import I,{EventItem as F}from"./EventStore";import M,{Exhibitor as m}from"./ExhibitorStore";import O from"./FuzzySearchEngineStore";import z from"./HeatmapStore";import A from"./IntercomStore";import R,{LayersMode as d}from"./LayerStore";import P from"./MaplibreStore";import V from"./OverlayStore";import G from"./PoiMarkerStore";import q from"./PoiTypeStore";import{SearchShortcutProvider as N}from"./providers/SearchShortcutProvider";import{SessionsShortcutProvider as U}from"./providers/SessionsShortcutProvider";import{SpeakerShortcutProvider as W}from"./providers/SpeakerShortcutProvider";import j from"./RoutePlannerStore";import D from"./RouteStore";import H from"./SearchButtonsStore";import K from"./SearchStore";import Y from"./SessionsFilterStore";import{ShortcutRegistry as $}from"./ShortcutRegistry";import J from"./SpeakerFilterStore";import Q from"./SpeakerStore";import{SpeakerItem as X}from"./SpeakerStore";import Z from"./ToursStore";import tt from"./UIState";export default class i{setResetCameraFn(t){this.resetCameraFn=t}constructor(){this.initialized=!1,this.categoryStore=new C(this),this.exhibitorStore=new M(this),this.boothStore=new _(this),this.routeStore=new D(this),this.routePlannerStore=new j(this),this.toursStore=new Z(this),this.uiState=new tt(this),this.overlayStore=new V(this),this.maplibreStore=new P(this),this.layerStore=new R,this.intercomStore=new A,this.eventStore=new I(this),this.heatmapStore=new z,this.poiTypeStore=new q(this),this.poiMarkerStore=new G(this),this.fuzzySearchEngineStore=new O(["name","title","fullName","booths.name"]),this.categoryFilterStore=new E(this),this.sessionsFilterStore=new Y(this),this.speakerStore=new Q(this),this.speakerFilterStore=new J(this),this.searchStore=new K(this),this.searchButtonsStore=new H(this),this.bookmarksStore=new B(this),this.urlFilterManager=new v(this),this.shortcutRegistry=new $,this.registerShortcutProviders()}selectExhibitor(t,r=!0){this.uiState.hoveredExhibitor=null,this.uiState.details=t;var e=t.booths.filter(a=>a.visible),l=t.booths.filter(a=>!a.visible);!e.length&&l.length&&this.layerStore.updateVisibility(l[0].layer,!0),r&&setTimeout(()=>this.moveToList(t.booths.filter(a=>a.visible)),u||h?500:50)}selectBooth(t,r=!0){let e=Array.isArray(t)?t:[t];this.uiState.details=e[0],e.length===1&&e[0].schedule?.length&&(this.uiState.desiredOverlaySize="medium"),e.length===1&&e[0].layer&&!e[0].visible&&this.layerStore.mode===d.Radio&&this.layerStore.updateVisibility(e[0].layer,!0),r&&setTimeout(()=>this.moveToList(e),u||h?500:50)}reset(){const t=window.__searchi;t&&t.querySelector&&t.querySelector("input[type=search]")&&t.querySelector("input[type=search]").blur&&t.querySelector("input[type=search]").blur(),window.setTimeout(()=>{this.uiState.setKioskModeEnabled||k().then(()=>{c(()=>{this.selectSearch(""),this.uiState.details=null,this.resetCameraFn?.(),this.uiState.menu=!1,this.searchStore.resetSearchBox(),this.searchButtonsStore.clearAllFilters()}),setTimeout(()=>{c(()=>{this.uiState.inIdle=!0})},100)})},1e3)}selectNone(){window.__resett&&window.__resett(),this.uiState.details=this.uiState.selectedCategory}selectBookmarks(){this.uiState.details=null,this.uiState.list={type:"bookmarks"}}selectVisited(){this.uiState.details=null,this.uiState.list={type:"visited"}}selectLanguage(){this.uiState.details=null,this.uiState.list={type:w}}selectCategory(t){window.__resett&&window.__resett(),this.uiState.details=t,this.uiState.list={type:"category",category:t},this.uiState.desiredOverlaySize="full",t.exhibitors.find(e=>e.booths.find(l=>l.visible))||this.layerStore.updateVisibility(t.exhibitors[0]?.booths[0]?.layer,!0),setTimeout(()=>{this.uiState.moveToBooths=t.exhibitors.filter(e=>e.booths.find(l=>l.visible)).flatMap(e=>e.booths)},200)}selectEventItem(t,r=!0){if(this.uiState.hoveredExhibitor=null,this.uiState.details=t,this.uiState.desiredOverlaySize="medium",t.boothId){const e=this.boothStore.booths.find(l=>l.id===t.boothId);e&&e.layer&&!e.visible&&this.layerStore.mode===d.Radio&&this.layerStore.updateVisibility(e.layer,!0)}r&&setTimeout(()=>{if(t.boothId){const e=this.boothStore.booths.find(l=>l.id===t.boothId);e&&this.moveToList([e])}},u||h?500:50)}selectSearch(t){window.__resett&&window.__resett(),this.uiState.details=null,this.speakerStore.clearSelectedSpeaker(),this.uiState.list={type:"search",text:x(t,Object.keys(this.uiState.mapSettings).map(r=>`${r}=`)),focused:!1},this.uiState.activeListIndex=-1}clickBookmarks(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectBookmarks(),this.moveToList(),this.showMap()}clickVisited(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectVisited(),this.moveToList(),this.showMap()}clickLanguage(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectLanguage()}clickCategory(t){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectCategory(t),this.uiState.onCategoryClick&&this.uiState.onCategoryClick({id:t.id,name:t.name,exhibitors:t.exhibitors.map(r=>r.id)}),setTimeout(()=>{this.moveToList(),this.showMap()},100)}clickSeminars(){this.clickCategory(this.categoryStore.seminarsCategory)}clickBoothInList(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t),this.moveToList([t]),this.showMap()}clickBoothInList2(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t,!1),window.setTimeout(()=>{this.moveToList([t]),this.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}clickBooth(t){const r=this.uiState.details;if(this.uiState.menu=!1,this.uiState.list.type==="sessions"&&this.searchStore.selectSearch(),this.uiState.list.type==="speakers"&&this.searchStore.selectSearch(),this.uiState.list.type==="tours"&&this.searchStore.selectSearch(),this.uiState.list.type==="multi-point-tour"&&this.searchStore.selectSearch(),!(this.uiState.selectedRoute?.from&&this.uiState.selectedRoute?.to)){if(this.uiState.selectedRoute?.to&&!this.uiState.selectedRoute?.from&&t){this.routeStore.setStartPoint(t);return}if(t)this.routeStore.tempToBooth=t;else{this.uiState.details=null,this.fp.hidePathways(),this.uiState.list={type:"search",text:"",focused:!1},this.uiState.onBoothClick&&this.uiState.onBoothClick({target:null});return}if(this.uiState.onBoothClick){const e={name:"",description:""},l={target:{...t,layer:t.layer||e}};this.uiState.onBoothClick(l)}if(t.exhibitors.length===1&&t instanceof L){const e=t.exhibitors[0];r===e?p(n.ViewBooth,t.name):this.heatmapStore.forceTrack={action:n.ViewBooth,label:t.name,exhibitor:e},this.selectExhibitor(e,!1)}else r===t&&p(n.ViewBooth,t.name),this.selectBooth(t,!1);this.showMap()}}clickExhibitor2(t){this.selectExhibitor(t,!0),this.showMap()}clickExhibitor(t){window.setTimeout(()=>{this.clickExhibitor2(t)},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}showMap(){this.uiState.overlayPosition==="bottom"&&g&&(this.uiState.desiredOverlaySize="medium")}showOverlay(){this.uiState.overlayPosition==="bottom"&&(this.uiState.desiredOverlaySize="full")}toggleMapOverlay(){this.uiState.overlayPosition==="bottom"&&this.uiState.overlaySize==="full"?this.uiState.desiredOverlaySize="medium":this.uiState.overlayPosition==="bottom"&&this.uiState.overlaySize!=="full"&&(this.uiState.desiredOverlaySize="full")}moveToList(t){t=t||this.uiState.listItems;const r=[];t.forEach(e=>{if(e instanceof m)r.push(...e.booths.filter(l=>l.visible));else if(e instanceof f)e.visible&&r.push(e);else if(e instanceof F&&e.boothId){const l=this.boothStore.boothById.get(e.boothId);l?.visible&&r.push(l)}else e instanceof X&&this.speakerStore.getEventsBySpeaker(e.id).forEach(l=>{if(!l.boothId)return;const a=this.boothStore.boothById.get(l.boothId);a?.visible&&r.push(a)})}),this.uiState.moveToBooths=r}moveToExhibitor(t){this.moveToList([t])}changeActiveListIndex(t){let r=this.uiState.activeListIndex+t;r=Math.max(0,Math.min(this.uiState.listItems.length-1,r)),this.uiState.activeListIndex=r}toggleModal(t){this.uiState.modalActive[t]=!this.uiState.modalActive[t]}openGallery(){this.uiState.galleryActive=!0}closeGallery(){this.uiState.galleryActive=!1}openActiveListItem(){const t=this.uiState.listItems[this.uiState.activeListIndex];t&&(b.log("Opening",t),t instanceof m?this.clickExhibitor(t):t instanceof T?this.clickCategory(t):t instanceof f&&this.clickBoothInList2(t))}toggleCategoryFilter(){this.uiState.categoryFilterOpen=!this.uiState.categoryFilterOpen}applyCategoryFilters(t){this.uiState.selectedCategoryFilters=t,this.uiState.categoryFilterOpen=!1}get filteredExhibitors(){return this.uiState.selectedCategoryFilters.length===0?this.exhibitorStore.exhibitors:this.exhibitorStore.exhibitors.filter(t=>this.uiState.selectedCategoryFilters.some(r=>t.categories.some(e=>e.id===r.id)))}selectSessions(){this.uiState.list={type:"sessions",text:"",focused:!1},this.uiState.menu=!1,this.uiState.selectedTrack=null,this.searchButtonsStore.setSubButtonId(null),this.searchButtonsStore.subButtonsEnabled&&this.searchButtonsStore.showSubButtons("sessions"),h&&(this.uiState.desiredOverlaySize="full")}selectExhibitors(){this.uiState.list={type:"exhibitors",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectTours(){this.uiState.list={type:"tours",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectSpeakers(){this.uiState.list={type:"speakers",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectSpeaker(t,r=!0){this.speakerStore.selectSpeaker(t,r)}resetFilters(){this.searchButtonsStore.clearAllFilters()}registerShortcutProviders(){this.shortcutRegistry.register(new U(this)),this.shortcutRegistry.register(new W(this)),this.shortcutRegistry.register(new N(this))}}o([S],i.prototype,"initialized",void 0),o([S],i.prototype,"resetCameraFn",void 0),o([s],i.prototype,"setResetCameraFn",null),o([s],i.prototype,"selectExhibitor",null),o([s],i.prototype,"selectBooth",null),o([s],i.prototype,"reset",null),o([s],i.prototype,"selectNone",null),o([s],i.prototype,"selectBookmarks",null),o([s],i.prototype,"selectVisited",null),o([s],i.prototype,"selectLanguage",null),o([s],i.prototype,"selectCategory",null),o([s],i.prototype,"selectEventItem",null),o([s],i.prototype,"selectSearch",null),o([s],i.prototype,"clickBookmarks",null),o([s],i.prototype,"clickVisited",null),o([s],i.prototype,"clickLanguage",null),o([s],i.prototype,"clickCategory",null),o([s],i.prototype,"clickSeminars",null),o([s],i.prototype,"clickBoothInList",null),o([s],i.prototype,"clickBoothInList2",null),o([s],i.prototype,"clickBooth",null),o([s],i.prototype,"clickExhibitor2",null),o([s],i.prototype,"clickExhibitor",null),o([s],i.prototype,"showMap",null),o([s],i.prototype,"showOverlay",null),o([s],i.prototype,"toggleMapOverlay",null),o([s],i.prototype,"moveToList",null),o([s],i.prototype,"moveToExhibitor",null),o([s],i.prototype,"changeActiveListIndex",null),o([s],i.prototype,"toggleModal",null),o([s],i.prototype,"openGallery",null),o([s],i.prototype,"closeGallery",null),o([s],i.prototype,"openActiveListItem",null),o([s],i.prototype,"toggleCategoryFilter",null),o([s],i.prototype,"applyCategoryFilters",null),o([y],i.prototype,"filteredExhibitors",null),o([s],i.prototype,"selectSessions",null),o([s],i.prototype,"selectExhibitors",null),o([s],i.prototype,"selectTours",null),o([s],i.prototype,"selectSpeakers",null),o([s],i.prototype,"selectSpeaker",null),o([s],i.prototype,"resetFilters",null);
|
|
1
|
+
import{__decorate as o}from"tslib";import{action as s,computed as y,observable as S,runInAction as c}from"mobx";import{LANGUAGE_TYPE as w}from"../constants";import{URLFilterManager as v}from"../services/URLFilterManager";import{GaEventActions as n,sendEventToGa as p}from"../tools/gtag";import b from"../tools/logger";import{isWebGlSupported as g}from"../utils";import{resetLocale as k}from"../utils/i18n";import h from"../utils/is-mobile";import u from"../utils/is-webview";import{sanitizeSearch as x}from"../utils/sanitizeText";import B from"./BookmarksStore";import _,{BoothBase as f,RegularBooth as L}from"./BoothStore";import E from"./CategoryFilterStore";import C,{Category as T}from"./CategoryStore";import I,{EventItem as F}from"./EventStore";import M,{Exhibitor as m}from"./ExhibitorStore";import O from"./FuzzySearchEngineStore";import z from"./HeatmapStore";import A from"./IntercomStore";import R,{LayersMode as d}from"./LayerStore";import P from"./MaplibreStore";import V from"./OverlayStore";import G from"./PoiMarkerStore";import q from"./PoiTypeStore";import{SearchShortcutProvider as N}from"./providers/SearchShortcutProvider";import{SessionsShortcutProvider as U}from"./providers/SessionsShortcutProvider";import{SpeakerShortcutProvider as W}from"./providers/SpeakerShortcutProvider";import j from"./RoutePlannerStore";import D from"./RouteStore";import H from"./SearchButtonsStore";import K from"./SearchStore";import Y from"./SessionsFilterStore";import{ShortcutRegistry as $}from"./ShortcutRegistry";import J from"./SpeakerFilterStore";import Q from"./SpeakerStore";import{SpeakerItem as X}from"./SpeakerStore";import Z from"./ToursStore";import tt from"./UIState";export default class i{setResetCameraFn(t){this.resetCameraFn=t}constructor(){this.initialized=!1,this.categoryStore=new C(this),this.exhibitorStore=new M(this),this.boothStore=new _(this),this.routeStore=new D(this),this.routePlannerStore=new j(this),this.toursStore=new Z(this),this.uiState=new tt(this),this.overlayStore=new V(this),this.maplibreStore=new P(this),this.layerStore=new R,this.intercomStore=new A,this.eventStore=new I(this),this.heatmapStore=new z,this.poiTypeStore=new q(this),this.poiMarkerStore=new G(this),this.fuzzySearchEngineStore=new O(["name","title","fullName","booths.name"]),this.categoryFilterStore=new E(this),this.sessionsFilterStore=new Y(this),this.speakerStore=new Q(this),this.speakerFilterStore=new J(this),this.searchStore=new K(this),this.searchButtonsStore=new H(this),this.bookmarksStore=new B(this),this.urlFilterManager=new v(this),this.shortcutRegistry=new $,this.registerShortcutProviders()}selectExhibitor(t,r=!0){this.uiState.hoveredExhibitor=null,this.uiState.details=t;var e=t.booths.filter(a=>a.visible),l=t.booths.filter(a=>!a.visible);!e.length&&l.length&&this.layerStore.updateVisibility(l[0].layer,!0),r&&setTimeout(()=>this.moveToList(t.booths.filter(a=>a.visible)),u||h?500:50)}selectBooth(t,r=!0){let e=Array.isArray(t)?t:[t];this.uiState.details=e[0]??null,e.length===1&&e[0].schedule?.length&&(this.uiState.desiredOverlaySize="medium"),e.length===1&&e[0].layer&&!e[0].visible&&this.layerStore.mode===d.Radio&&this.layerStore.updateVisibility(e[0].layer,!0),r&&setTimeout(()=>this.moveToList(e),u||h?500:50)}reset(){const t=window.__searchi;t&&t.querySelector&&t.querySelector("input[type=search]")&&t.querySelector("input[type=search]").blur&&t.querySelector("input[type=search]").blur(),window.setTimeout(()=>{this.uiState.setKioskModeEnabled||k().then(()=>{c(()=>{this.selectSearch(""),this.uiState.details=null,this.resetCameraFn?.(),this.uiState.menu=!1,this.searchStore.resetSearchBox(),this.searchButtonsStore.clearAllFilters()}),setTimeout(()=>{c(()=>{this.uiState.inIdle=!0})},100)})},1e3)}selectNone(){window.__resett&&window.__resett(),this.uiState.details=this.uiState.selectedCategory}selectBookmarks(){this.uiState.details=null,this.uiState.list={type:"bookmarks"}}selectVisited(){this.uiState.details=null,this.uiState.list={type:"visited"}}selectLanguage(){this.uiState.details=null,this.uiState.list={type:w}}selectCategory(t){window.__resett&&window.__resett(),this.uiState.details=t,this.uiState.list={type:"category",category:t},this.uiState.desiredOverlaySize="full",t.exhibitors.find(e=>e.booths.find(l=>l.visible))||this.layerStore.updateVisibility(t.exhibitors[0]?.booths[0]?.layer,!0),setTimeout(()=>{this.uiState.moveToBooths=t.exhibitors.filter(e=>e.booths.find(l=>l.visible)).flatMap(e=>e.booths)},200)}selectEventItem(t,r=!0){if(this.uiState.hoveredExhibitor=null,this.uiState.details=t,this.uiState.desiredOverlaySize="medium",t.boothId){const e=this.boothStore.booths.find(l=>l.id===t.boothId);e&&e.layer&&!e.visible&&this.layerStore.mode===d.Radio&&this.layerStore.updateVisibility(e.layer,!0)}r&&setTimeout(()=>{if(t.boothId){const e=this.boothStore.booths.find(l=>l.id===t.boothId);e&&this.moveToList([e])}},u||h?500:50)}selectSearch(t){window.__resett&&window.__resett(),this.uiState.details=null,this.speakerStore.clearSelectedSpeaker(),this.uiState.list={type:"search",text:x(t,Object.keys(this.uiState.mapSettings).map(r=>`${r}=`)),focused:!1},this.uiState.activeListIndex=-1}clickBookmarks(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectBookmarks(),this.moveToList(),this.showMap()}clickVisited(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectVisited(),this.moveToList(),this.showMap()}clickLanguage(){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectLanguage()}clickCategory(t){window.__resett&&window.__resett(),this.uiState.menu=!1,this.selectCategory(t),this.uiState.onCategoryClick&&this.uiState.onCategoryClick({id:t.id,name:t.name,exhibitors:t.exhibitors.map(r=>r.id)}),setTimeout(()=>{this.moveToList(),this.showMap()},100)}clickSeminars(){this.clickCategory(this.categoryStore.seminarsCategory)}clickBoothInList(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t),this.moveToList([t]),this.showMap()}clickBoothInList2(t){window.__resett&&window.__resett(),this.uiState.hoveredBooth=null,this.selectBooth(t,!1),window.setTimeout(()=>{this.moveToList([t]),this.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}clickBooth(t){const r=this.uiState.details;if(this.uiState.menu=!1,this.uiState.list.type==="sessions"&&this.searchStore.selectSearch(),this.uiState.list.type==="speakers"&&this.searchStore.selectSearch(),this.uiState.list.type==="tours"&&this.searchStore.selectSearch(),this.uiState.list.type==="multi-point-tour"&&this.searchStore.selectSearch(),!(this.uiState.selectedRoute?.from&&this.uiState.selectedRoute?.to)){if(this.uiState.selectedRoute?.to&&!this.uiState.selectedRoute?.from&&t){this.routeStore.setStartPoint(t);return}if(t)this.routeStore.tempToBooth=t;else{this.uiState.details=null,this.fp.hidePathways(),this.uiState.list={type:"search",text:"",focused:!1},this.uiState.onBoothClick&&this.uiState.onBoothClick({target:null});return}if(this.uiState.onBoothClick){const e={name:"",description:""},l={target:{...t,layer:t.layer||e}};this.uiState.onBoothClick(l)}if(t.exhibitors.length===1&&t instanceof L){const e=t.exhibitors[0];r===e?p(n.ViewBooth,t.name):this.heatmapStore.forceTrack={action:n.ViewBooth,label:t.name,exhibitor:e},this.selectExhibitor(e,!1)}else r===t&&p(n.ViewBooth,t.name),this.selectBooth(t,!1);this.showMap()}}clickExhibitor2(t){this.selectExhibitor(t,!0),this.showMap()}clickExhibitor(t){window.setTimeout(()=>{this.clickExhibitor2(t)},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50)}showMap(){this.uiState.overlayPosition==="bottom"&&g&&(this.uiState.desiredOverlaySize="medium")}showOverlay(){this.uiState.overlayPosition==="bottom"&&(this.uiState.desiredOverlaySize="full")}toggleMapOverlay(){this.uiState.overlayPosition==="bottom"&&this.uiState.overlaySize==="full"?this.uiState.desiredOverlaySize="medium":this.uiState.overlayPosition==="bottom"&&this.uiState.overlaySize!=="full"&&(this.uiState.desiredOverlaySize="full")}moveToList(t){t=t||this.uiState.listItems;const r=[];t.forEach(e=>{if(e instanceof m)r.push(...e.booths.filter(l=>l.visible));else if(e instanceof f)e.visible&&r.push(e);else if(e instanceof F&&e.boothId){const l=this.boothStore.boothById.get(e.boothId);l?.visible&&r.push(l)}else e instanceof X&&this.speakerStore.getEventsBySpeaker(e.id).forEach(l=>{if(!l.boothId)return;const a=this.boothStore.boothById.get(l.boothId);a?.visible&&r.push(a)})}),this.uiState.moveToBooths=r}moveToExhibitor(t){this.moveToList([t])}changeActiveListIndex(t){let r=this.uiState.activeListIndex+t;r=Math.max(0,Math.min(this.uiState.listItems.length-1,r)),this.uiState.activeListIndex=r}toggleModal(t){this.uiState.modalActive[t]=!this.uiState.modalActive[t]}openGallery(){this.uiState.galleryActive=!0}closeGallery(){this.uiState.galleryActive=!1}openActiveListItem(){const t=this.uiState.listItems[this.uiState.activeListIndex];t&&(b.log("Opening",t),t instanceof m?this.clickExhibitor(t):t instanceof T?this.clickCategory(t):t instanceof f&&this.clickBoothInList2(t))}toggleCategoryFilter(){this.uiState.categoryFilterOpen=!this.uiState.categoryFilterOpen}applyCategoryFilters(t){this.uiState.selectedCategoryFilters=t,this.uiState.categoryFilterOpen=!1}get filteredExhibitors(){return this.uiState.selectedCategoryFilters.length===0?this.exhibitorStore.exhibitors:this.exhibitorStore.exhibitors.filter(t=>this.uiState.selectedCategoryFilters.some(r=>t.categories.some(e=>e.id===r.id)))}selectSessions(){this.uiState.list={type:"sessions",text:"",focused:!1},this.uiState.menu=!1,this.uiState.selectedTrack=null,this.searchButtonsStore.setSubButtonId(null),this.searchButtonsStore.subButtonsEnabled&&this.searchButtonsStore.showSubButtons("sessions"),h&&(this.uiState.desiredOverlaySize="full")}selectExhibitors(){this.uiState.list={type:"exhibitors",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectTours(){this.uiState.list={type:"tours",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectSpeakers(){this.uiState.list={type:"speakers",text:"",focused:!1},this.uiState.menu=!1,h&&(this.uiState.desiredOverlaySize="full")}selectSpeaker(t,r=!0){this.speakerStore.selectSpeaker(t,r)}resetFilters(){this.searchButtonsStore.clearAllFilters()}registerShortcutProviders(){this.shortcutRegistry.register(new U(this)),this.shortcutRegistry.register(new W(this)),this.shortcutRegistry.register(new N(this))}}o([S],i.prototype,"initialized",void 0),o([S],i.prototype,"resetCameraFn",void 0),o([s],i.prototype,"setResetCameraFn",null),o([s],i.prototype,"selectExhibitor",null),o([s],i.prototype,"selectBooth",null),o([s],i.prototype,"reset",null),o([s],i.prototype,"selectNone",null),o([s],i.prototype,"selectBookmarks",null),o([s],i.prototype,"selectVisited",null),o([s],i.prototype,"selectLanguage",null),o([s],i.prototype,"selectCategory",null),o([s],i.prototype,"selectEventItem",null),o([s],i.prototype,"selectSearch",null),o([s],i.prototype,"clickBookmarks",null),o([s],i.prototype,"clickVisited",null),o([s],i.prototype,"clickLanguage",null),o([s],i.prototype,"clickCategory",null),o([s],i.prototype,"clickSeminars",null),o([s],i.prototype,"clickBoothInList",null),o([s],i.prototype,"clickBoothInList2",null),o([s],i.prototype,"clickBooth",null),o([s],i.prototype,"clickExhibitor2",null),o([s],i.prototype,"clickExhibitor",null),o([s],i.prototype,"showMap",null),o([s],i.prototype,"showOverlay",null),o([s],i.prototype,"toggleMapOverlay",null),o([s],i.prototype,"moveToList",null),o([s],i.prototype,"moveToExhibitor",null),o([s],i.prototype,"changeActiveListIndex",null),o([s],i.prototype,"toggleModal",null),o([s],i.prototype,"openGallery",null),o([s],i.prototype,"closeGallery",null),o([s],i.prototype,"openActiveListItem",null),o([s],i.prototype,"toggleCategoryFilter",null),o([s],i.prototype,"applyCategoryFilters",null),o([y],i.prototype,"filteredExhibitors",null),o([s],i.prototype,"selectSessions",null),o([s],i.prototype,"selectExhibitors",null),o([s],i.prototype,"selectTours",null),o([s],i.prototype,"selectSpeakers",null),o([s],i.prototype,"selectSpeaker",null),o([s],i.prototype,"resetFilters",null);
|
|
@@ -19,6 +19,10 @@ export default class RouteStore {
|
|
|
19
19
|
prevMarkers: Marker[];
|
|
20
20
|
/** Cancels the camera move still waiting for a floor to come on screen (see `revealLayer`). */
|
|
21
21
|
private pendingReveal;
|
|
22
|
+
/** The last `onDirection` sent; `undefined` before the first. */
|
|
23
|
+
private lastDirection;
|
|
24
|
+
private directionScheduled;
|
|
25
|
+
private pendingDetails;
|
|
22
26
|
showAccessible: boolean;
|
|
23
27
|
onlyAccessible: boolean;
|
|
24
28
|
currentRouteLayer: Layer | null;
|
|
@@ -74,7 +78,11 @@ export default class RouteStore {
|
|
|
74
78
|
} | null;
|
|
75
79
|
updateRoute(routeLines: RouteLine[], distance?: number): void;
|
|
76
80
|
updateRouteDistance(distance: number): void;
|
|
77
|
-
|
|
81
|
+
/** Wayfinding reports a route in steps; they share one flush that reads the final state (#1756). */
|
|
82
|
+
private scheduleDirection;
|
|
83
|
+
private directionPayload;
|
|
84
|
+
/** Drops a repeat of the last event; an explicit `null` always goes out. */
|
|
85
|
+
private emitDirection;
|
|
78
86
|
checkRoutes(): void;
|
|
79
87
|
isGpsTrackingEnabled: boolean;
|
|
80
88
|
setGpsTrackingEnabled(value: boolean): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as n}from"tslib";import{Box as x,boxContainsPoint as z,pointDistance as S}from"@expofp/geometry";import{action as f,computed as y,observable as u}from"mobx";import{getName as F}from"../components/Kiosk/SetKiosk";import{mapCamera as L}from"../components/Map/camera";import{DEFAULT_UNITS as T,ORIENTATION_GRANTED_KEY as G}from"../constants";import E from"../data";import{getFpGeo as P}from"../data/fpGeo.js";import{getLayerSvg as U,getSvgArea as $}from"../data/svg.js";import{GaEventActions as V,sendEventToGa as K}from"../tools/gtag";import w from"../tools/logger";import{areLayersEnabled as W}from"../utils/areLayersEnabled";import{calcSpeed as D}from"../utils/calcSpeed";import{calcTravelTime as A}from"../utils/calcTravelTime";import{calculateRelativeBearing as Z,convertGpsToLocal as I,isValidPointCoords as g}from"../utils/gps";import{boothToEndpoint as C,buildRoute as q,CURRENT_LOCATION_NAME as j,CURRENT_POSITION_POINT_ID as X,isWayfindingReady as Y,KIOSK_ANCHOR_POINT_ID as H,toArbitraryPoint as M}from"../wayfinding";import c,{layersStore as b,uiState as p}from".";import{BoothBase as m}from"./BoothStore";import{LayersMode as J}from"./LayerStore";import{revealLayer as N}from"./reveal-layer.js";function d(r){return typeof r=="string"?Number(r.replace(",",".")):r}export default class i{constructor(t){this.routeLines=[],this.routeDistance=null,this.currentPosition=null,this.requestCompass=!1,this.iconType=0,this.tappedBooth=null,this.focusEnabled=!0,this.prevZ=null,this.markersData={icons:[],markers:[]},this.prevMarkers=[],this.pendingReveal=null,this.showAccessible=!1,this.onlyAccessible=!1,this.currentRouteLayer=null,this.currentRouteExhibitor=null,this.routeUnits=T,this.isGpsTrackingEnabled=!0,this.rootStore=t,this.focusEnabled=!window.location.search}get tempToBooth(){const t=this.tappedBooth;return t?.exhibitors.some(e=>e===p.details)?t:null}set tempToBooth(t){this.tappedBooth=t}get canFindLocation(){return!!p.kioskData||!!this.currentPosition}selectRoute(t,e=!0,o=!1){if(e&&(p.list={type:"search",text:"",focused:!1}),t&&!t.from&&t.to){const s=this.resolveFallbackFrom();s&&(t=new Route(s,t.to,t.waypoints))}t?.from&&t?.to&&t.from===t.to&&(t=null);const a=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from instanceof m&&t.from.visible&&a.push(t.from),t?.to instanceof m&&t.to.visible&&(this.tempToBooth=null,a.push(t.to)),!t&&c.fp.onDirection&&c.fp.onDirection(null);const l=f(()=>{if(this.rootStore.moveToList(a),p.details=t,t&&(!t.from||!t.to)&&p.overlayBottom&&(p.desiredOverlaySize="medium"),t?.to&&t?.from){const s=Q(t.from);s&&this.rootStore.layerStore.updateVisibility(s,!0)}if(!this.currentRouteLayer){const s=O(this.rootStore.layerStore,t?.from),h=O(this.rootStore.layerStore,t?.to);s?this.currentRouteLayer=s:h&&(this.currentRouteLayer=h)}e&&t?.from&&t?.to&&K(V.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)});o?l():setTimeout(l,200)}rebuildRouteFromPosition(t){const e=p.selectedRoute;e?.to&&this.selectRoute(new Route(t,e.to,e.waypoints),!1,!0)}resolveFallbackFrom(){if(this.currentPosition)return M(this.currentPosition,j,X);const t=p.kioskData;return t?M({x:t.x,y:t.y,z:t.z??void 0},F(),H):null}setStartPoint(t){const e=p.selectedRoute;if(e?.to&&!e?.from&&t){const o=new Route(t,e.to,e.waypoints);this.selectRoute(o)}}get pathLayers(){return c.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,o)=>o.indexOf(t)===e).map((t,e)=>({id:e+1,layer:c.layerStore.findLayer(t)}))}getNearestBooth(t){if(!t)return null;const e=this.rootStore.layerStore.findLayer(t.z),o=P()?.properties.config,a=!!(t.lat&&t.lng),l=o&&a?I(t,o):t;return!l||!g(l.x)||!g(l.y)?null:this.rootStore.boothStore.booths.filter(s=>b.mode===J.Default||!e?s.visible&&s.rect:s.rect&&(typeof t.z!="number"&&!t.z&&s.visible||e.name===s.layer?.name)).sort((s,h)=>S(l,s.rect.center)-S(l,h.rect.center))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(tt),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const o=this.markersData.markers.find(l=>l.id===t);this.markersData.markers.forEach(l=>l.active=!1),o&&(o.active=!0);const a=c.layerStore.findLayer(o?.z);if(e&&o){a&&!a?.visible&&b.updateVisibility(a,!0);const l=L();return l?l.api.panTo({x:o.x,y:o.y}):(w.warn("Map camera is not mounted. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(t=>t.active)}get layers(){const t=[];return c.routeStore.routeLines?.map(e=>e.p0.layer).forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>c.layerStore.layers.find(o=>o.name===e)).filter(e=>!!e)}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=!1,p.list.type==="route-planner"&&(p.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(t,e))}selectCurrentPosition(t,e=!0,o){clearTimeout(this.cpTimeout),t&&(t.x=d(t.x),t.y=d(t.y),t.lat!==void 0&&(t.lat=d(t.lat)),t.lng!==void 0&&(t.lng=d(t.lng)),W()||(t.z=void 0));const a=e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),l=e&&!a&&(this.focusEnabled||this.prevZ!=t?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString()??null,this.iconType=o?1:0;const s=t?et(t):null;if(!t||!s){this.currentPosition=null;return}const h=c.layerStore.findLayer(t.z),R=new CurrentPosition(s.x,s.y,h?.name||this.currentRouteLayer?.name,Z(s),t.lat,t.lng);let k=!this.routeLines?.length;h&&this.routeLines?.length&&(k=!!this.routeLines.find(v=>v.p0.layer===h.name||v.p1.layer===h.name));const _=l&&k;this.currentPosition=R,_&&this.focusOnPosition(R,h),this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(!this.canFindLocation)return;const t=this.currentPosition??p.kioskData;t&&(this.currentPosition&&localStorage.getItem(G)==="false"&&(c.routeStore.requestCompass=!0),this.pendingReveal?.(),this.pendingReveal=N({layer:c.layerStore.findLayer(t.z),show:e=>b.updateVisibility(e,!0),then:()=>{p.moveToRect=this.findLocationRect(t)}}))}findLocationRect(t){const e=x.fromCenter(t,{x:100,y:100}),o=$();if(e.intersects(o))return e;const a=Math.max(o.min.x,Math.min(t.x,o.max.x)),l=Math.max(o.min.y,Math.min(t.y,o.max.y)),s=Math.min(o.size.width,o.size.height)*.3,h=x.fromCenter({x:a,y:l},{x:s,y:s}).intersection(o);return h?x.fromUnion(e,h):e}focusOnPosition(t,e){this.pendingReveal?.(),this.pendingReveal=N({layer:e,show:o=>b.updateVisibility(o,!0),then:()=>{if(c.maplibreStore.showMaplibre){p.moveToLocation=!0;return}const o=L();if(o){o.api.panTo({x:t.x,y:t.y});return}w.warn("Map camera is not mounted. Cannot pan to current position.")}})}get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:A(t,D(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.updateRoutePoints())}updateRouteDistance(t){if(t==null)return;const e=U(),o=(e.getAttribute("units")||T).toLowerCase?.().trim(),a=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(a?1:10)),this.routeUnits=o,this.updateRoutePoints()}updateRoutePoints(){const t=p.selectedRoute,e=this.routeDistance,o=this.routeUnits;c.fp.onDirection&&setTimeout(()=>{c.fp.onDirection({from:B(t?.from??null),to:B(t?.to??null),lines:this.routeLines,distance:e==null?"":`${e}${o}`,units:o,time:A(e??0,D(o))})},200)}checkRoutes(){if(!Y()){console.warn("checkRoutes: wayfinding is not initialized \u2014 call createWayfinding() first. Skipping route check.");return}const t=c.boothStore.booths;console.info(`Route check started ${t.length}.... `);for(let e=0;e<t.length;e++){const o=t[e];for(let a=e+1;a<t.length;a++){const l=t[a];q(C(o),C(l)).lines.length||console.warn(`No route found from ${o.name} to ${l.name}`)}}console.info("Route check done....")}setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return E.autoTrackingGps&&this.isGpsTrackingEnabled&&!E.enableIPS}setOnlyAccessible(t){this.onlyAccessible=t}}n([u],i.prototype,"routeLines",void 0),n([u],i.prototype,"routeDistance",void 0),n([u],i.prototype,"currentPosition",void 0),n([u],i.prototype,"requestCompass",void 0),n([u],i.prototype,"iconType",void 0),n([u],i.prototype,"tappedBooth",void 0),n([u],i.prototype,"focusEnabled",void 0),n([u],i.prototype,"prevZ",void 0),n([u],i.prototype,"markersData",void 0),n([u],i.prototype,"prevMarkers",void 0),n([u],i.prototype,"showAccessible",void 0),n([u],i.prototype,"onlyAccessible",void 0),n([u],i.prototype,"currentRouteLayer",void 0),n([u],i.prototype,"currentRouteExhibitor",void 0),n([y],i.prototype,"canFindLocation",null),n([f],i.prototype,"selectRoute",null),n([f],i.prototype,"rebuildRouteFromPosition",null),n([f],i.prototype,"setStartPoint",null),n([y({keepAlive:!0})],i.prototype,"pathLayers",null),n([f],i.prototype,"setMarkers",null),n([f],i.prototype,"selectMarker",null),n([y({keepAlive:!0})],i.prototype,"selectedMarkers",null),n([y({keepAlive:!0})],i.prototype,"layers",null),n([f],i.prototype,"clickRoute",null),n([f],i.prototype,"selectCurrentPosition",null),n([f],i.prototype,"findLocation",null),n([u],i.prototype,"routeUnits",void 0),n([y],i.prototype,"routeInfo",null),n([f],i.prototype,"updateRoute",null),n([f],i.prototype,"updateRouteDistance",null),n([f],i.prototype,"updateRoutePoints",null),n([f],i.prototype,"checkRoutes",null),n([u],i.prototype,"isGpsTrackingEnabled",void 0),n([f],i.prototype,"setGpsTrackingEnabled",null),n([y({keepAlive:!0})],i.prototype,"gpsEnabled",null),n([f],i.prototype,"setOnlyAccessible",null);function Q(r){if(r)return r instanceof m?r.layer?.name:r.layer}function O(r,t){return t?t instanceof m?t.layer??null:r.findLayer(t.layer):null}function tt(r){return{...r,x:d(r.x),y:d(r.y),lat:r.lat===void 0?void 0:d(r.lat),lng:r.lng===void 0?void 0:d(r.lng)}}function et(r){const t=P()?.properties.config??null;let e=null;return t&&z({min:t.p0,max:t.p2},r)?e={...r}:t&&g(r.lat)&&g(r.lng)?e=I(r,t):t||(e=r),e||null}export function findBooth(r){return c.boothStore.findBooth(r)||c.exhibitorStore.findExhibitor(r)?.booths[0]}export function findEntityByExternalId(r){const t=c.boothStore.boothByExternalId.get(r);if(t)return{type:"booth",entity:t};const e=c.exhibitorStore.exhibitorByExternalId.get(r);if(e)return{type:"exhibitor",entity:e}}export function separateExternalIds(r){const t=[],e=[];for(const o of r){const a=findEntityByExternalId(o);a&&(a.type==="booth"?t.push(o):e.push(o))}return{boothExternalIds:t,exhibitorExternalIds:e}}export function extractRoute(r,t,e){return new Route(findBooth(r)??null,findBooth(t)??null,e?.map(o=>findBooth(o)).filter(o=>!!o))}export class Route{constructor(t,e,o){this.from=t,this.to=e,this.waypoints=o;const a=t instanceof m?t.id:void 0,l=e instanceof m?e.id:void 0;this.waypoints=o?.filter(s=>s&&s.id!==a&&s.id!==l)}}function B(r){return r?r instanceof m?{id:r.id,name:r.name,externalId:r.externalId,layer:{name:r.layer?.name,description:r.layer?.description}}:{id:Number.MAX_SAFE_INTEGER,name:r.name,externalId:void 0,layer:{name:r.layer,description:void 0}}:null}export class CurrentPosition{constructor(t,e,o,a,l,s){this.x=t,this.y=e,this.z=o,this.angle=a,this.lat=l,this.lng=s}}
|
|
1
|
+
import{__decorate as n}from"tslib";import{Box as S,boxContainsPoint as z,pointDistance as v}from"@expofp/geometry";import{action as d,comparer as F,computed as y,observable as f}from"mobx";import{getName as G}from"../components/Kiosk/SetKiosk";import{mapCamera as L}from"../components/Map/camera";import{DEFAULT_UNITS as D,ORIENTATION_GRANTED_KEY as U}from"../constants";import T from"../data";import{getFpGeo as E}from"../data/fpGeo.js";import{getLayerSvg as $,getSvgArea as V}from"../data/svg.js";import{GaEventActions as K,sendEventToGa as Z}from"../tools/gtag";import P from"../tools/logger";import{areLayersEnabled as q}from"../utils/areLayersEnabled";import{calcSpeed as w}from"../utils/calcSpeed";import{calcTravelTime as A}from"../utils/calcTravelTime";import{calculateRelativeBearing as W,convertGpsToLocal as C,isValidPointCoords as b,toCoordinate as p}from"../utils/gps";import{boothToEndpoint as I,buildRoute as j,CURRENT_LOCATION_NAME as X,CURRENT_POSITION_POINT_ID as Y,isWayfindingReady as H,KIOSK_ANCHOR_POINT_ID as J,toArbitraryPoint as M}from"../wayfinding";import h,{layersStore as x,uiState as u}from".";import{BoothBase as m}from"./BoothStore";import{LayersMode as Q}from"./LayerStore";import{revealLayer as N}from"./reveal-layer.js";export default class r{constructor(t){this.routeLines=[],this.routeDistance=null,this.currentPosition=null,this.requestCompass=!1,this.iconType=0,this.tappedBooth=null,this.focusEnabled=!0,this.prevZ=null,this.markersData={icons:[],markers:[]},this.prevMarkers=[],this.pendingReveal=null,this.lastDirection=void 0,this.directionScheduled=!1,this.showAccessible=!1,this.onlyAccessible=!1,this.currentRouteLayer=null,this.currentRouteExhibitor=null,this.routeUnits=D,this.isGpsTrackingEnabled=!0,this.rootStore=t,this.focusEnabled=!window.location.search}get tempToBooth(){const t=this.tappedBooth;return t?.exhibitors.some(e=>e===u.details)?t:null}set tempToBooth(t){this.tappedBooth=t}get canFindLocation(){return!!u.kioskData||!!this.currentPosition}selectRoute(t,e=!0,o=!1){if(e&&(u.list={type:"search",text:"",focused:!1}),t&&!t.from&&t.to){const c=this.resolveFallbackFrom();c&&(t=new Route(c,t.to,t.waypoints))}t?.from&&t?.to&&t.from===t.to&&(t=null);const s=[];t?.from&&t?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),t?.from instanceof m&&t.from.visible&&s.push(t.from),t?.to instanceof m&&t.to.visible&&(this.tempToBooth=null,s.push(t.to)),t||this.emitDirection(null);const a=d(()=>{if(this.rootStore.moveToList(s),u.details=t,t&&(this.lastDirection=void 0),t&&(!t.from||!t.to)&&u.overlayBottom&&(u.desiredOverlaySize="medium"),t?.to&&t?.from){const c=tt(t.from);c&&this.rootStore.layerStore.updateVisibility(c,!0)}if(!this.currentRouteLayer){const c=O(this.rootStore.layerStore,t?.from),g=O(this.rootStore.layerStore,t?.to);c?this.currentRouteLayer=c:g&&(this.currentRouteLayer=g)}e&&t?.from&&t?.to&&Z(K.ClickDirections,`${t?.from?"From "+t.from.name:""} ${t?.to?"To "+t.to.name:""}`)});if(clearTimeout(this.pendingDetails),this.pendingDetails=void 0,o||!t){a();return}const l=u.details;this.pendingDetails=window.setTimeout(()=>{this.pendingDetails=void 0,u.details===l&&a()},200)}rebuildRouteFromPosition(t){if(this.pendingDetails!==void 0)return;const e=u.selectedRoute;e?.to&&this.selectRoute(new Route(t,e.to,e.waypoints),!1,!0)}resolveFallbackFrom(){if(this.currentPosition)return M(this.currentPosition,X,Y);const t=u.kioskData;return t?M({x:t.x,y:t.y,z:t.z??void 0},G(),J):null}setStartPoint(t){const e=u.selectedRoute;if(e?.to&&!e?.from&&t){const o=new Route(t,e.to,e.waypoints);this.selectRoute(o)}}get pathLayers(){return h.routeStore.routeLines?.map(t=>t.p0.layer)?.filter((t,e,o)=>o.indexOf(t)===e).map((t,e)=>({id:e+1,layer:h.layerStore.findLayer(t)}))}getNearestBooth(t){if(!t)return null;const e=this.rootStore.layerStore.findLayer(t.z),o=E()?.properties.config,s=!!(t.lat&&t.lng),a=o&&s?C(t,o):t;return!a||!b(a.x)||!b(a.y)?null:this.rootStore.boothStore.booths.filter(l=>x.mode===Q.Default||!e?l.visible&&l.rect:l.rect&&(typeof t.z!="number"&&!t.z&&l.visible||e.name===l.layer?.name)).sort((l,c)=>v(a,l.rect.center)-v(a,c.rect.center))[0]||null}setMarkers(t){this.markersData.markers=(t?.markers??[]).map(et),this.markersData.icons=t?.icons??[]}selectMarker(t,e){const o=this.markersData.markers.find(a=>a.id===t);this.markersData.markers.forEach(a=>a.active=!1),o&&(o.active=!0);const s=h.layerStore.findLayer(o?.z);if(e&&o){s&&!s?.visible&&x.updateVisibility(s,!0);const a=L();return a?a.api.panTo({x:o.x,y:o.y}):(P.warn("Map camera is not mounted. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(t=>t.active)}get layers(){const t=[];return h.routeStore.routeLines?.map(e=>e.p0.layer).forEach(e=>{t.indexOf(e)===-1&&t.push(e)}),t.map(e=>h.layerStore.layers.find(o=>o.name===e)).filter(e=>!!e)}clickRoute(t,e){window.__resett&&window.__resett(),this.rootStore.uiState.menu=!1,u.list.type==="route-planner"&&(u.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(t,e))}selectCurrentPosition(t,e=!0,o){clearTimeout(this.cpTimeout),t&&(t.x=p(t.x),t.y=p(t.y),t.lat!==void 0&&(t.lat=p(t.lat)),t.lng!==void 0&&(t.lng=p(t.lng)),q()||(t.z=void 0));const s=e&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),a=e&&!s&&(this.focusEnabled||this.prevZ!=t?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=t?.z?.toString()??null,this.iconType=o?1:0;const l=t?ot(t):null;if(!t||!l){this.currentPosition=null;return}const c=h.layerStore.findLayer(t.z),g=new CurrentPosition(l.x,l.y,c?.name||this.currentRouteLayer?.name,W(l),t.lat,t.lng);let k=!this.routeLines?.length;c&&this.routeLines?.length&&(k=!!this.routeLines.find(R=>R.p0.layer===c.name||R.p1.layer===c.name));const _=a&&k;this.currentPosition=g,_&&this.focusOnPosition(g,c),this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(!this.canFindLocation)return;const t=this.currentPosition??u.kioskData;t&&(this.currentPosition&&localStorage.getItem(U)==="false"&&(h.routeStore.requestCompass=!0),this.pendingReveal?.(),this.pendingReveal=N({layer:h.layerStore.findLayer(t.z),show:e=>x.updateVisibility(e,!0),then:()=>{u.moveToRect=this.findLocationRect(t)}}))}findLocationRect(t){const e=S.fromCenter(t,{x:100,y:100}),o=V();if(e.intersects(o))return e;const s=Math.max(o.min.x,Math.min(t.x,o.max.x)),a=Math.max(o.min.y,Math.min(t.y,o.max.y)),l=Math.min(o.size.width,o.size.height)*.3,c=S.fromCenter({x:s,y:a},{x:l,y:l}).intersection(o);return c?S.fromUnion(e,c):e}focusOnPosition(t,e){this.pendingReveal?.(),this.pendingReveal=N({layer:e,show:o=>x.updateVisibility(o,!0),then:()=>{if(h.maplibreStore.showMaplibre){u.moveToLocation=!0;return}const o=L();if(o){o.api.panTo({x:t.x,y:t.y});return}P.warn("Map camera is not mounted. Cannot pan to current position.")}})}get routeInfo(){const t=this.routeDistance,e=this.routeUnits;return t?{distance:`${t}${e}`,units:e,time:A(t,w(e))}:null}updateRoute(t,e){!t?.length&&!this.routeLines.length||(this.routeLines=t,this.scheduleDirection())}updateRouteDistance(t){if(t==null)return;const e=$(),o=(e.getAttribute("units")||D).toLowerCase?.().trim(),s=e.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(t/(s?1:10)),this.routeUnits=o,this.scheduleDirection()}scheduleDirection(){this.directionScheduled||(this.directionScheduled=!0,Promise.resolve().then(()=>{this.directionScheduled=!1,this.emitDirection(this.directionPayload())}))}directionPayload(){const t=u.selectedRoute,e=this.routeDistance,o=this.routeUnits;return{from:B(t?.from??null),to:B(t?.to??null),lines:this.routeLines,distance:e==null?"":`${e}${o}`,units:o,time:A(e??0,w(o))}}emitDirection(t){t&&it(this.lastDirection,t)||(this.lastDirection=t,this.rootStore.fp.onDirection?.(t))}checkRoutes(){if(!H()){console.warn("checkRoutes: wayfinding is not initialized \u2014 call createWayfinding() first. Skipping route check.");return}const t=h.boothStore.booths;console.info(`Route check started ${t.length}.... `);for(let e=0;e<t.length;e++){const o=t[e];for(let s=e+1;s<t.length;s++){const a=t[s];j(I(o),I(a)).lines.length||console.warn(`No route found from ${o.name} to ${a.name}`)}}console.info("Route check done....")}setGpsTrackingEnabled(t){this.isGpsTrackingEnabled=t}get gpsEnabled(){return T.autoTrackingGps&&this.isGpsTrackingEnabled&&!T.enableIPS}setOnlyAccessible(t){this.onlyAccessible=t}}n([f],r.prototype,"routeLines",void 0),n([f],r.prototype,"routeDistance",void 0),n([f],r.prototype,"currentPosition",void 0),n([f],r.prototype,"requestCompass",void 0),n([f],r.prototype,"iconType",void 0),n([f],r.prototype,"tappedBooth",void 0),n([f],r.prototype,"focusEnabled",void 0),n([f],r.prototype,"prevZ",void 0),n([f],r.prototype,"markersData",void 0),n([f],r.prototype,"prevMarkers",void 0),n([f],r.prototype,"showAccessible",void 0),n([f],r.prototype,"onlyAccessible",void 0),n([f],r.prototype,"currentRouteLayer",void 0),n([f],r.prototype,"currentRouteExhibitor",void 0),n([y],r.prototype,"canFindLocation",null),n([d],r.prototype,"selectRoute",null),n([d],r.prototype,"rebuildRouteFromPosition",null),n([d],r.prototype,"setStartPoint",null),n([y({keepAlive:!0})],r.prototype,"pathLayers",null),n([d],r.prototype,"setMarkers",null),n([d],r.prototype,"selectMarker",null),n([y({keepAlive:!0})],r.prototype,"selectedMarkers",null),n([y({keepAlive:!0})],r.prototype,"layers",null),n([d],r.prototype,"clickRoute",null),n([d],r.prototype,"selectCurrentPosition",null),n([d],r.prototype,"findLocation",null),n([f],r.prototype,"routeUnits",void 0),n([y],r.prototype,"routeInfo",null),n([d],r.prototype,"updateRoute",null),n([d],r.prototype,"updateRouteDistance",null),n([d],r.prototype,"checkRoutes",null),n([f],r.prototype,"isGpsTrackingEnabled",void 0),n([d],r.prototype,"setGpsTrackingEnabled",null),n([y({keepAlive:!0})],r.prototype,"gpsEnabled",null),n([d],r.prototype,"setOnlyAccessible",null);function tt(i){if(i)return i instanceof m?i.layer?.name:i.layer}function O(i,t){return t?t instanceof m?t.layer??null:i.findLayer(t.layer):null}function et(i){return{...i,x:p(i.x),y:p(i.y),lat:i.lat===void 0?void 0:p(i.lat),lng:i.lng===void 0?void 0:p(i.lng)}}function ot(i){const t=E()?.properties.config??null;let e=null;return t&&z({min:t.p0,max:t.p2},i)?e={...i}:t&&b(i.lat)&&b(i.lng)?e=C(i,t):t||(e=i),e||null}export function findBooth(i){return h.boothStore.findBooth(i)||h.exhibitorStore.findExhibitor(i)?.booths[0]}export function findEntityByExternalId(i){const t=h.boothStore.boothByExternalId.get(i);if(t)return{type:"booth",entity:t};const e=h.exhibitorStore.exhibitorByExternalId.get(i);if(e)return{type:"exhibitor",entity:e}}export function separateExternalIds(i){const t=[],e=[];for(const o of i){const s=findEntityByExternalId(o);s&&(s.type==="booth"?t.push(o):e.push(o))}return{boothExternalIds:t,exhibitorExternalIds:e}}export function extractRoute(i,t,e){return new Route(findBooth(i)??null,findBooth(t)??null,e?.map(o=>findBooth(o)).filter(o=>!!o))}export class Route{constructor(t,e,o){this.from=t,this.to=e,this.waypoints=o;const s=t instanceof m?t.id:void 0,a=e instanceof m?e.id:void 0;this.waypoints=o?.filter(l=>l&&l.id!==s&&l.id!==a)}}function B(i){return i?i instanceof m?{id:i.id,name:i.name,externalId:i.externalId,layer:{name:i.layer?.name,description:i.layer?.description}}:{id:Number.MAX_SAFE_INTEGER,name:i.name,externalId:void 0,layer:{name:i.layer,description:void 0}}:null}function it(i,t){return i===void 0?!1:i===null?!t.from&&!t.to&&!t.lines.length:F.structural(i,t)}export class CurrentPosition{constructor(t,e,o,s,a,l){this.x=t,this.y=e,this.z=o,this.angle=s,this.lat=a,this.lng=l}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as s}from"tslib";import{action as a,computed as o,observable as u}from"mobx";import{LANGUAGE_TYPE as y,MOBILE_BREAKPOINT as x}from"../constants";import c from"../data";import{goBack as d}from"../services/url-sync";import p from"../tools/settings";import{t as l}from"../utils/i18n";import{sanitizeSearch as B}from"../utils/sanitizeText";import{Route as n}from"./RouteStore";class r{static closeDetails(t){return t.details?(t.details=null,!0):!1}static closeMultiPointTour(t){return t.rootStore.fp.hidePathways(),!0}static clearSearchAndFocus(t){return t.searchText?(t.setSearchText(""),t.setFocused(!0),!0):!1}static returnToSearch(t,i=!1){t.list={type:"search",text:"",focused:i}}static returnToSessions(t,i=!1){t.list={type:"sessions",text:"",focused:i}}static returnToTours(t,i=!1){t.list={type:"tours",text:"",focused:i}}static openMenu(t){t.menu=!0}static closeMenu(t){t.menu=!1}static clearListScroll(t,i){t.clearListScroll(i)}static resetActiveListIndex(t){t.activeListIndex=-1}}export default class e{constructor(t){this.searchText="",this.isFocused=!1,this.isClearMode=!1,this.skipInputFocus=!1,this.rootStore=t}get uiState(){return this.rootStore.uiState}get searchBoxConfig(){return this.uiState.searchBoxConfig}get searchBoxMode(){return this.searchBoxConfig.mode}get searchBoxTitle(){return this.searchBoxConfig.title}get searchBoxSubtitle(){return this.searchBoxConfig.subtitle}get searchBoxBadge(){return this.searchBoxConfig.badge}get searchBoxIcon(){return this.searchBoxConfig.icon}get searchBoxActions(){return this.uiState.searchBoxActions}get shouldShowSearchInput(){return this.searchBoxMode==="search"}get shouldShowCloseButton(){const{menu:t,details:i,list:h}=this.uiState,S=c.isRebooking&&h.type==="exhibitors";return!this.shouldShowSearchInput||h.type==="sessions"||h.type==="tours"||h.type==="speakers"||h.type==="exhibitors"&&!S?!0:t||i!==null||!!this.searchText||this.isClearMode||this.isFocused}get closeButtonAction(){return!this.shouldShowSearchInput||this.searchBoxMode==="details"||this.uiState.list.type==="sessions"||this.uiState.list.type==="speakers"||this.uiState.list.type==="exhibitors"&&!c.isRebooking?"close":this.searchText?"clear":"close"}get shouldShowShadow(){const{menu:t,details:i,list:h}=this.uiState,S=h.type==="search"&&!!h.text;return!(this.rootStore.fp.alwaysShowSidebar||t||i!==null||h.type!=="search"||S||this.isFocused||this.uiState.heatmap)}get placeholder(){const{list:t,heatmapYah:i}=this.uiState;return t.type==="sessions"?l("Search sessions"):t.type==="tours"?l("Search Guided Tours"):t.type==="exhibitors"?l("Search exhibitors"):t.type==="speakers"?l("Search speakers"):p.EXPO.startsWith("lenzerheidemotorclassics")?"SUCHE":p.EXPO.startsWith("jetlag")?"Search location or artist":i?l("Find values greater than"):this.uiState.hasAppliedFilters?l("Search"):c.searchText||l("Search")}get searchBoxClass(){return{"is-details":this.searchBoxMode==="details"&&!(this.uiState.details instanceof n),"is-interface":this.searchBoxMode==="interface","has-shadow":this.shouldShowShadow,"has-subtitle":!!this.searchBoxConfig.subtitle,"has-badge":!!this.searchBoxConfig.badge,"has-icon":!!this.searchBoxConfig.icon,"is-overlay-full":this.uiState.isOverlayOpen&&this.uiState.overlaySize==="full","is-featured-exhibitor":this.uiState.isFeaturedExhibitorActive,"is-route":this.uiState.details instanceof n,"is-guided-tours":this.uiState.isGuidedToursActive,"is-overlay-scrolled":this.uiState.isOverlayScrolled,"overlay-pulse":this.uiState.kiosk&&this.uiState.inIdle&&!this.uiState.setKioskModeEnabled}}get ariaLabel(){return!this.shouldShowSearchInput||this.searchBoxMode==="details"?l("Close"):this.searchText?l("Clear search"):l("Close")}selectSearch(t){window.__resett&&window.__resett(),this.uiState.details=null;const i=B(t||"",Object.keys(this.uiState.mapSettings).map(h=>`${h}=`));this.setSearchText(i),this.uiState.activeListIndex=-1}selectSearchAndFocus(t){this.selectSearch(t),this.setFocused(!0)}setSearchText(t){this.searchText=t,this.uiState.hasAppliedFilters?this.rootStore.moveToList():this.uiState.centerMap=!0,this.uiState.activeListIndex=t?0:-1,this.uiState.list.type!=="sessions"&&this.uiState.list.type!=="tours"&&this.uiState.list.type!=="speakers"&&this.uiState.list.type!=="exhibitors"?this.uiState.list={type:"search",text:t,focused:this.isFocused}:this.uiState.list.type==="exhibitors"&&(this.uiState.list={type:"exhibitors",text:t,focused:this.isFocused}),this.uiState.searchClearMode=this.isClearMode}setFocused(t){this.isFocused=t,this.isClearMode=!1,this.skipInputFocus=!1,this.uiState.searchFocused=t,this.uiState.searchClearMode=!1,this.uiState.desiredOverlaySize="full"}handleBackAction(){const{uiState:t}=this,{list:i}=t;if(t.desiredOverlaySize="full",this.backMode==="menu"){this.resetSearchButtonState(),r.openMenu(t);return}if(i.type==="route-planner"){this.rootStore.routePlannerStore.close(),this.rootStore.selectBookmarks(),d();return}if(i.type==="multi-point-tour"&&!t.details){r.returnToTours(t,!1),this.rootStore.fp.hidePathways();return}if(t.details){t.details=null,d();return}if(t.menu){i.type==="sessions"?t.list={type:"sessions",text:"",focused:!0}:i.type==="exhibitors"?t.list={type:"exhibitors",text:"",focused:!0}:t.list={type:"search",text:"",focused:!0},this.setFocused(!0),this.isClearMode=!0,r.closeMenu(t);return}if(i.type==="tours"&&t.details instanceof n){t.details=null;return}if(i.type==="sessions"||i.type==="tours"||i.type==="exhibitors"){if(r.closeDetails(t))return;this.clearActiveFilters(),r.returnToSearch(t,!1),this.selectSearchAndFocus();return}switch(i.type){case"filter":t.details=null;return;case"multi-point-tour":this.rootStore.fp.hidePathways(),r.closeDetails(t)?r.returnToTours(t,!1):d();return;case"category":this.rootStore.selectCategory(i.category);return;case"speakers":if(r.closeDetails(t))return;r.returnToSessions(t,!1);return;case"bookmarks":case"visited":if(r.closeDetails(t))return;this.selectSearchAndFocus();return;case y:r.returnToSearch(t,!1),r.openMenu(t);return}r.closeDetails(t)||r.clearSearchAndFocus(this)||r.openMenu(t)}closeSearch(){const{uiState:t}=this,{list:i}=t;if(i.type==="route-planner"){this.rootStore.routePlannerStore.close(),r.returnToSearch(t,!1),this.resetSearchBox();return}if(r.closeDetails(t),r.clearListScroll(t,i.type),r.closeMultiPointTour(t),i.type==="bookmarks"){r.returnToSearch(t,!1),this.resetSearchBox();return}if(t.selectedCategory){r.returnToSearch(t,!1),this.resetSearchBox();return}if(i.type==="sessions"){this.closeSessions();return}if(i.type==="exhibitors"){if(c.isRebooking){this.searchBoxMode==="search"&&this.searchText?(this.setSearchText(""),this.isClearMode=!0,this.clearActiveFilters()):this.resetSearchBox();return}this.closeExhibitors();return}if(t.menu){r.closeMenu(t),this.resetSearchBox();return}if(this.searchBoxMode==="search"&&!t.details&&this.searchText){this.setSearchText(""),this.isClearMode=!0,this.clearActiveFilters();return}r.returnToSearch(t,!1),this.searchText="",this.resetSearchBox(),t.details=null,this.clearActiveFilters()}clearActiveFilters(){this.rootStore.searchButtonsStore.setPoiFilterId(null),this.rootStore.uiState.selectedPoiTypeFilters=[],this.rootStore.uiState.selectedCategoryFilters=[],this.rootStore.categoryFilterStore.state.selectedItems=[],this.rootStore.categoryFilterStore.state.pendingItems=[],this.rootStore.searchButtonsStore.searchShortcutState.activeParentId=null,this.rootStore.searchButtonsStore.searchShortcutState.activeChildren.clear(),this.rootStore.searchButtonsStore.searchShortcutState.isShortcutsVisible=!1,this.rootStore.urlFilterManager&&this.rootStore.urlFilterManager.isInitialized&&this.rootStore.urlFilterManager.clearAllFilters()}resetSearchButtonState(){const{uiState:t}=this;this.rootStore.searchButtonsStore.clearAllFilters(),this.rootStore.searchButtonsStore.setSubButtonId(null),this.rootStore.searchButtonsStore.hideSubButtons(),t.selectedTrack=null,this.searchText="",this.isClearMode=!1}handleSearchAction(){this.isFocused||this.setFocused(!0)}openOverlayWithoutInputFocus(){this.skipInputFocus=!0,this.isFocused=!0,this.isClearMode=!1,this.uiState.searchFocused=!0,this.uiState.searchClearMode=!1,this.uiState.desiredOverlaySize="full"}closeSessions(){this.searchText="",r.returnToSearch(this.uiState,!1),this.uiState.details=null,r.resetActiveListIndex(this.uiState),this.uiState.selectedTrack=null,this.rootStore.searchButtonsStore.setSubButtonId(null),this.rootStore.searchButtonsStore.hideSubButtons()}closeExhibitors(){this.searchText="",r.returnToSearch(this.uiState,!1),this.uiState.details=null,r.resetActiveListIndex(this.uiState)}resetSearchBox(){this.setFocused(!1),this.isClearMode=!1,this.syncWithUIState()}syncWithUIState(){this.searchText=(this.uiState.list.type==="search"||this.uiState.list.type==="exhibitors")&&this.uiState.list.text||"",this.isFocused=this.uiState.searchFocused,this.isClearMode=this.uiState.searchClearMode}get actionButtonIcon(){return this.shouldShowSearchInput?this.shouldShowCloseButton?"icon-close":"icon-search":"icon-close"}clearAndSelectSearch(){this.selectSearch(""),this.setFocused(!1)}get backMode(){const t=this.uiState.list.type;return(t==="bookmarks"||t==="visited")&&!this.uiState.details&&!this.uiState.menu||this.shouldShowSearchInput&&!this.searchText?"menu":"back"}get isMobileDetailsMode(){return window.innerWidth<x&&this.uiState.details!==null&&this.uiState.overlaySize==="full"&&!(this.uiState.details instanceof n)}get shouldShowTitle(){return!this.shouldShowSearchInput}get searchState(){return{text:this.searchText,isFocused:this.isFocused,isClearMode:this.isClearMode,mode:this.searchBoxMode,title:this.searchBoxConfig.title,subtitle:this.searchBoxConfig.subtitle,badge:this.searchBoxConfig.badge,icon:this.searchBoxConfig.icon}}}s([u],e.prototype,"searchText",void 0),s([u],e.prototype,"isFocused",void 0),s([u],e.prototype,"isClearMode",void 0),s([u],e.prototype,"skipInputFocus",void 0),s([o],e.prototype,"searchBoxConfig",null),s([o],e.prototype,"searchBoxMode",null),s([o],e.prototype,"searchBoxTitle",null),s([o],e.prototype,"searchBoxSubtitle",null),s([o],e.prototype,"searchBoxBadge",null),s([o],e.prototype,"searchBoxIcon",null),s([o],e.prototype,"searchBoxActions",null),s([o],e.prototype,"shouldShowSearchInput",null),s([o],e.prototype,"shouldShowCloseButton",null),s([o],e.prototype,"closeButtonAction",null),s([o],e.prototype,"shouldShowShadow",null),s([o],e.prototype,"placeholder",null),s([o],e.prototype,"searchBoxClass",null),s([o],e.prototype,"ariaLabel",null),s([a],e.prototype,"selectSearch",null),s([a],e.prototype,"selectSearchAndFocus",null),s([a],e.prototype,"setSearchText",null),s([a],e.prototype,"setFocused",null),s([a],e.prototype,"handleBackAction",null),s([a],e.prototype,"closeSearch",null),s([a],e.prototype,"clearActiveFilters",null),s([a],e.prototype,"resetSearchButtonState",null),s([a],e.prototype,"handleSearchAction",null),s([a],e.prototype,"openOverlayWithoutInputFocus",null),s([a],e.prototype,"closeSessions",null),s([a],e.prototype,"closeExhibitors",null),s([a],e.prototype,"resetSearchBox",null),s([a],e.prototype,"syncWithUIState",null),s([o],e.prototype,"actionButtonIcon",null),s([a],e.prototype,"clearAndSelectSearch",null),s([o],e.prototype,"backMode",null),s([o],e.prototype,"isMobileDetailsMode",null),s([o],e.prototype,"shouldShowTitle",null),s([o],e.prototype,"searchState",null);
|
|
1
|
+
import{__decorate as s}from"tslib";import{action as a,computed as o,observable as u}from"mobx";import{LANGUAGE_TYPE as y,MOBILE_BREAKPOINT as x}from"../constants";import c from"../data";import{goBack as d}from"../services/url-sync";import p from"../tools/settings";import{t as l}from"../utils/i18n";import{sanitizeSearch as B}from"../utils/sanitizeText";import{Route as n}from"./RouteStore";class r{static closeDetails(t){return t.details?(t.details=null,!0):!1}static closeMultiPointTour(t){return t.rootStore.fp.hidePathways(),!0}static clearSearchAndFocus(t){return t.searchText?(t.setSearchText(""),t.setFocused(!0),!0):!1}static returnToSearch(t,i=!1){t.list={type:"search",text:"",focused:i}}static returnToSessions(t,i=!1){t.list={type:"sessions",text:"",focused:i}}static returnToTours(t,i=!1){t.list={type:"tours",text:"",focused:i}}static openMenu(t){t.menu=!0}static closeMenu(t){t.menu=!1}static clearListScroll(t,i){t.clearListScroll(i)}static resetActiveListIndex(t){t.activeListIndex=-1}}export default class e{constructor(t){this.searchText="",this.isFocused=!1,this.isClearMode=!1,this.skipInputFocus=!1,this.rootStore=t}get uiState(){return this.rootStore.uiState}get searchBoxConfig(){return this.uiState.searchBoxConfig}get searchBoxMode(){return this.searchBoxConfig.mode}get searchBoxTitle(){return this.searchBoxConfig.title}get searchBoxSubtitle(){return this.searchBoxConfig.subtitle}get searchBoxBadge(){return this.searchBoxConfig.badge}get searchBoxIcon(){return this.searchBoxConfig.icon}get searchBoxActions(){return this.uiState.searchBoxActions}get shouldShowSearchInput(){return this.searchBoxMode==="search"}get shouldShowCloseButton(){const{menu:t,details:i,list:h}=this.uiState,S=c.isRebooking&&h.type==="exhibitors";return!this.shouldShowSearchInput||h.type==="sessions"||h.type==="tours"||h.type==="speakers"||h.type==="exhibitors"&&!S?!0:t||i!==null||!!this.searchText||this.isClearMode||this.isFocused}get closeButtonAction(){return!this.shouldShowSearchInput||this.searchBoxMode==="details"||this.uiState.list.type==="sessions"||this.uiState.list.type==="speakers"||this.uiState.list.type==="exhibitors"&&!c.isRebooking?"close":this.searchText?"clear":"close"}get shouldShowShadow(){const{menu:t,details:i,list:h}=this.uiState,S=h.type==="search"&&!!h.text;return!(this.rootStore.fp.alwaysShowSidebar||t||i!==null||h.type!=="search"||S||this.isFocused||this.uiState.heatmap)}get placeholder(){const{list:t,heatmapYah:i}=this.uiState;return t.type==="sessions"?l("Search sessions"):t.type==="tours"?l("Search Guided Tours"):t.type==="exhibitors"?l("Search exhibitors"):t.type==="speakers"?l("Search speakers"):p.EXPO.startsWith("lenzerheidemotorclassics")?"SUCHE":p.EXPO.startsWith("jetlag")?"Search location or artist":i?l("Find values greater than"):this.uiState.hasAppliedFilters?l("Search"):c.searchText||l("Search")}get searchBoxClass(){return{"is-details":this.searchBoxMode==="details"&&!(this.uiState.details instanceof n),"is-interface":this.searchBoxMode==="interface","has-shadow":this.shouldShowShadow,"has-subtitle":!!this.searchBoxConfig.subtitle,"has-badge":!!this.searchBoxConfig.badge,"has-icon":!!this.searchBoxConfig.icon,"is-overlay-full":this.uiState.isOverlayOpen&&this.uiState.overlaySize==="full","is-featured-exhibitor":this.uiState.isFeaturedExhibitorActive,"is-route":this.uiState.details instanceof n,"is-guided-tours":this.uiState.isGuidedToursActive,"is-overlay-scrolled":this.uiState.isOverlayScrolled,"overlay-pulse":this.uiState.kiosk&&this.uiState.inIdle&&!this.uiState.setKioskModeEnabled}}get ariaLabel(){return!this.shouldShowSearchInput||this.searchBoxMode==="details"?l("Close"):this.searchText?l("Clear search"):l("Close")}selectSearch(t){window.__resett&&window.__resett(),this.uiState.details=null;const i=B(t||"",Object.keys(this.uiState.mapSettings).map(h=>`${h}=`));this.setSearchText(i),this.uiState.activeListIndex=-1}selectSearchAndFocus(t){this.selectSearch(t),this.setFocused(!0)}setSearchText(t){this.searchText=t,this.uiState.hasAppliedFilters?this.rootStore.moveToList():this.uiState.centerMap=!0,this.uiState.activeListIndex=t?0:-1,this.uiState.list.type!=="sessions"&&this.uiState.list.type!=="tours"&&this.uiState.list.type!=="speakers"&&this.uiState.list.type!=="exhibitors"?this.uiState.list={type:"search",text:t,focused:this.isFocused}:this.uiState.list.type==="exhibitors"&&(this.uiState.list={type:"exhibitors",text:t,focused:this.isFocused}),this.uiState.searchClearMode=this.isClearMode}setFocused(t){this.isFocused=t,this.isClearMode=!1,this.skipInputFocus=!1,this.uiState.searchFocused=t,this.uiState.searchClearMode=!1,this.uiState.desiredOverlaySize="full"}handleBackAction(){const{uiState:t}=this,{list:i}=t;if(t.desiredOverlaySize="full",this.backMode==="menu"){this.resetSearchButtonState(),r.openMenu(t);return}if(i.type==="route-planner"){this.rootStore.routePlannerStore.close(),this.rootStore.selectBookmarks(),d();return}if(i.type==="multi-point-tour"&&!t.details){r.returnToTours(t,!1),this.rootStore.fp.hidePathways();return}if(t.details){t.details=null,d();return}if(t.menu){i.type==="sessions"?t.list={type:"sessions",text:"",focused:!0}:i.type==="exhibitors"?t.list={type:"exhibitors",text:"",focused:!0}:t.list={type:"search",text:"",focused:!0},this.setFocused(!0),this.isClearMode=!0,r.closeMenu(t);return}if(i.type==="tours"&&t.details instanceof n){t.details=null;return}if(i.type==="sessions"||i.type==="tours"||i.type==="exhibitors"){if(r.closeDetails(t))return;this.clearActiveFilters(),r.returnToSearch(t,!1),this.selectSearchAndFocus();return}switch(i.type){case"filter":t.details=null;return;case"multi-point-tour":this.rootStore.fp.hidePathways(),r.closeDetails(t)?r.returnToTours(t,!1):d();return;case"category":this.rootStore.selectCategory(i.category);return;case"speakers":if(r.closeDetails(t))return;r.returnToSessions(t,!1);return;case"bookmarks":case"visited":if(r.closeDetails(t))return;this.selectSearchAndFocus();return;case y:r.returnToSearch(t,!1),r.openMenu(t);return}r.closeDetails(t)||r.clearSearchAndFocus(this)||r.openMenu(t)}closeSearch(){const{uiState:t}=this,{list:i}=t;if(i.type==="route-planner"){this.rootStore.routePlannerStore.close(),r.returnToSearch(t,!1),this.resetSearchBox();return}if(r.closeDetails(t),r.clearListScroll(t,i.type),r.closeMultiPointTour(t),i.type==="bookmarks"){r.returnToSearch(t,!1),this.resetSearchBox();return}if(t.selectedCategory){r.returnToSearch(t,!1),this.resetSearchBox();return}if(i.type==="sessions"){this.closeSessions();return}if(i.type==="exhibitors"){if(c.isRebooking){this.searchBoxMode==="search"&&this.searchText?(this.setSearchText(""),this.isClearMode=!0,this.clearActiveFilters()):this.resetSearchBox();return}this.closeExhibitors();return}if(t.menu){r.closeMenu(t),this.resetSearchBox();return}if(this.searchBoxMode==="search"&&!t.details&&this.searchText){this.setSearchText(""),this.isClearMode=!0,this.clearActiveFilters();return}r.returnToSearch(t,!1),this.searchText="",this.resetSearchBox(),t.details=null,this.clearActiveFilters()}clearActiveFilters(){this.rootStore.searchButtonsStore.setPoiFilterId(null),this.rootStore.uiState.selectedPoiTypeFilters=[],this.rootStore.uiState.selectedCategoryFilters=[],this.rootStore.categoryFilterStore.state.selectedItems=[],this.rootStore.categoryFilterStore.state.pendingItems=[],this.rootStore.categoryFilterStore.setOwner(null),this.rootStore.searchButtonsStore.searchShortcutState.activeParentId=null,this.rootStore.searchButtonsStore.searchShortcutState.activeChildren.clear(),this.rootStore.searchButtonsStore.searchShortcutState.isShortcutsVisible=!1,this.rootStore.urlFilterManager&&this.rootStore.urlFilterManager.isInitialized&&this.rootStore.urlFilterManager.clearAllFilters()}resetSearchButtonState(){const{uiState:t}=this;this.rootStore.searchButtonsStore.clearAllFilters(),this.rootStore.searchButtonsStore.setSubButtonId(null),this.rootStore.searchButtonsStore.hideSubButtons(),t.selectedTrack=null,this.searchText="",this.isClearMode=!1}handleSearchAction(){this.isFocused||this.setFocused(!0)}openOverlayWithoutInputFocus(){this.skipInputFocus=!0,this.isFocused=!0,this.isClearMode=!1,this.uiState.searchFocused=!0,this.uiState.searchClearMode=!1,this.uiState.desiredOverlaySize="full"}closeSessions(){this.searchText="",r.returnToSearch(this.uiState,!1),this.uiState.details=null,r.resetActiveListIndex(this.uiState),this.uiState.selectedTrack=null,this.rootStore.searchButtonsStore.setSubButtonId(null),this.rootStore.searchButtonsStore.hideSubButtons()}closeExhibitors(){this.searchText="",r.returnToSearch(this.uiState,!1),this.uiState.details=null,r.resetActiveListIndex(this.uiState)}resetSearchBox(){this.setFocused(!1),this.isClearMode=!1,this.syncWithUIState()}syncWithUIState(){this.searchText=(this.uiState.list.type==="search"||this.uiState.list.type==="exhibitors")&&this.uiState.list.text||"",this.isFocused=this.uiState.searchFocused,this.isClearMode=this.uiState.searchClearMode}get actionButtonIcon(){return this.shouldShowSearchInput?this.shouldShowCloseButton?"icon-close":"icon-search":"icon-close"}clearAndSelectSearch(){this.selectSearch(""),this.setFocused(!1)}get backMode(){const t=this.uiState.list.type;return(t==="bookmarks"||t==="visited")&&!this.uiState.details&&!this.uiState.menu||this.shouldShowSearchInput&&!this.searchText?"menu":"back"}get isMobileDetailsMode(){return window.innerWidth<x&&this.uiState.details!==null&&this.uiState.overlaySize==="full"&&!(this.uiState.details instanceof n)}get shouldShowTitle(){return!this.shouldShowSearchInput}get searchState(){return{text:this.searchText,isFocused:this.isFocused,isClearMode:this.isClearMode,mode:this.searchBoxMode,title:this.searchBoxConfig.title,subtitle:this.searchBoxConfig.subtitle,badge:this.searchBoxConfig.badge,icon:this.searchBoxConfig.icon}}}s([u],e.prototype,"searchText",void 0),s([u],e.prototype,"isFocused",void 0),s([u],e.prototype,"isClearMode",void 0),s([u],e.prototype,"skipInputFocus",void 0),s([o],e.prototype,"searchBoxConfig",null),s([o],e.prototype,"searchBoxMode",null),s([o],e.prototype,"searchBoxTitle",null),s([o],e.prototype,"searchBoxSubtitle",null),s([o],e.prototype,"searchBoxBadge",null),s([o],e.prototype,"searchBoxIcon",null),s([o],e.prototype,"searchBoxActions",null),s([o],e.prototype,"shouldShowSearchInput",null),s([o],e.prototype,"shouldShowCloseButton",null),s([o],e.prototype,"closeButtonAction",null),s([o],e.prototype,"shouldShowShadow",null),s([o],e.prototype,"placeholder",null),s([o],e.prototype,"searchBoxClass",null),s([o],e.prototype,"ariaLabel",null),s([a],e.prototype,"selectSearch",null),s([a],e.prototype,"selectSearchAndFocus",null),s([a],e.prototype,"setSearchText",null),s([a],e.prototype,"setFocused",null),s([a],e.prototype,"handleBackAction",null),s([a],e.prototype,"closeSearch",null),s([a],e.prototype,"clearActiveFilters",null),s([a],e.prototype,"resetSearchButtonState",null),s([a],e.prototype,"handleSearchAction",null),s([a],e.prototype,"openOverlayWithoutInputFocus",null),s([a],e.prototype,"closeSessions",null),s([a],e.prototype,"closeExhibitors",null),s([a],e.prototype,"resetSearchBox",null),s([a],e.prototype,"syncWithUIState",null),s([o],e.prototype,"actionButtonIcon",null),s([a],e.prototype,"clearAndSelectSearch",null),s([o],e.prototype,"backMode",null),s([o],e.prototype,"isMobileDetailsMode",null),s([o],e.prototype,"shouldShowTitle",null),s([o],e.prototype,"searchState",null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as c}from"tslib";import{computed as h}from"mobx";import{BaseShortcutProvider as a}from"../ShortcutProvider";export class SearchShortcutProvider extends a{constructor(t){super(),this.rootStore=t,this.id="search"}createShortcuts(){const{searchButtonsStore:t}=this.rootStore,o=[],r=t.getActiveParent();if(r&&r.children){const s=r.children.filter(e=>e.visible);if(r.type==="poi_types"&&s.length===1)return o;s.forEach(e=>{if(e.type==="poi_types"
|
|
1
|
+
import{__decorate as c}from"tslib";import{computed as h}from"mobx";import{BaseShortcutProvider as a}from"../ShortcutProvider";export class SearchShortcutProvider extends a{constructor(t){super(),this.rootStore=t,this.id="search"}createShortcuts(){const{searchButtonsStore:t}=this.rootStore,o=[],r=t.getActiveParent();if(r&&r.children){const s=r.children.filter(e=>e.visible);if(r.type==="poi_types"&&s.length===1)return o;s.forEach(e=>{if(e.type==="poi_types"){const i=e.id?.toString()||e.name,n=t.isChildActive(i);o.push({id:i,label:e.name,enabled:!0,active:n,tooltip:n?`Remove ${e.name} from filter (show all ${r.name})`:`Filter only by ${e.name}`,variant:"default",action:"toggle",showResetButton:!1})}})}return o}get shortcuts(){return this.createShortcuts()}shouldShowShortcuts(){const{searchButtonsStore:t}=this.rootStore;return t.hasActiveParentWithChildren}handleShortcutClick(t){const{searchButtonsStore:o}=this.rootStore;o.toggleChildFilter(t)}handleShortcutReset(){const{searchButtonsStore:t}=this.rootStore;t.clearAllChildFilters()}}c([h],SearchShortcutProvider.prototype,"shortcuts",null);
|
|
@@ -39,6 +39,13 @@ export declare class SearchButtonsActions {
|
|
|
39
39
|
private handleBookmarksClick;
|
|
40
40
|
private handleVisitedClick;
|
|
41
41
|
private handleToursClick;
|
|
42
|
+
/**
|
|
43
|
+
* Opens the category modal. Without a scope it is the built-in Categories
|
|
44
|
+
* button — the whole catalog; with one, the custom `type: 'categories'` button
|
|
45
|
+
* that narrows the modal to its own children. Either takes the selection over
|
|
46
|
+
* only on Apply. Getting there is identical either way: leave whatever other
|
|
47
|
+
* filter is on, then open.
|
|
48
|
+
*/
|
|
42
49
|
private handleCategoriesClick;
|
|
43
50
|
private handleExhibitorsClick;
|
|
44
51
|
private handlePoiTypeClick;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as r}from"tslib";import{action as l}from"mobx";import{MOBILE_BREAKPOINT as n}from"../../constants";import c from"../../tools/track-event";import{PREFIXES as h,SearchButtonType as o}from"./constants";import{extractPoiTypeId as u,getButtonConfig as S}from"./utils";export class SearchButtonsActions{constructor(e,t,i){this.rootStore=e,this.state=t,this.filters=i}reportActivation(e){e&&c("sbtnview",e)}handleSearchButtonClick(e,t){const s={[o.BOOKMARKS]:()=>this.handleBookmarksClick(t),[o.VISITED]:()=>this.handleVisitedClick(t),[o.SESSIONS]:()=>this.handleSessionsClick(t),[o.TOURS]:()=>this.handleToursClick(t),[o.CATEGORIES]:()=>this.handleCategoriesClick(t),[o.EXHIBITORS]:()=>this.handleExhibitorsClick(t)}[e];if(s){s();return}e.startsWith(h.POI_TYPE)&&this.handlePoiTypeClick(e,t)}handleExtendedSearchButtonClick(e){const t=S(e);if(!t)return;const i=t.name;if(t.type==="link"){this.handleLinkClick(t,i);return}const s=t.children?.filter(a=>a.visible)||[];if(s.length===1&&s[0].type==="poi_types"&&s[0].name===t.name){this.handleSearchButtonClick(e,i);return}t.children&&s.length>0?this.handleParentButton(e,t,i):this.handleSearchButtonClick(e,i)}handleMainButtonClick(e){this.handleSearchButtonClick(e)}handleSessionsClick(e){const{uiState:t}=this.rootStore;t.list.type==="sessions"?this.switchToSearch():(this.reportActivation(e),this.resetAllFilters(),t.details=null,t.menu=!1,t.list={type:"sessions",text:"",focused:!1},this.state.setSubButton(null),t.selectedTrack=null,this.state.subButtonsEnabled&&this.showSubButtons("sessions"),this.isMobile&&(t.desiredOverlaySize="full"))}togglePoiType(e){this.handleSearchButtonClick(`${h.POI_TYPE}${e}`)}clearAllFilters(){this.switchToSearch()}deactivateForNavigation(){const{uiState:e}=this.rootStore;(this.state.activePoiFilterId!==null||this.state.searchShortcutState.activeParentId!==null||e.hasAppliedFilters)&&this.clearActiveFilters()}showSubButtons(e){this.state.subButtonsEnabled&&(this.state.setSubButtonParent(e),this.state.setSubButton(null),this.rootStore.uiState.subButtonsVisible=!0)}hideSubButtons(){this.state.setSubButtonParent(null),this.state.setSubButton(null),this.rootStore.uiState.subButtonsVisible=!1}handleSubButtonClick(e){this.state.activeSubButtonId!==e&&this.state.setSubButton(e)}toggleListView(e,t,i){this.rootStore.uiState.list.type===e?this.switchToSearch():(this.reportActivation(i),this.resetAllFilters(),t())}handleBookmarksClick(e){this.toggleListView("bookmarks",()=>{this.rootStore.clickBookmarks()},e)}handleVisitedClick(e){this.toggleListView("visited",()=>{this.rootStore.clickVisited()},e)}handleToursClick(e){const{uiState:t}=this.rootStore;t.list.type==="tours"?this.switchToSearch():(this.reportActivation(e),this.resetAllFilters(),t.details=null,t.menu=!1,t.list={type:"tours",text:"",focused:!1},this.isMobile&&(t.desiredOverlaySize="full"))}handleCategoriesClick(e){const{uiState:
|
|
1
|
+
import{__decorate as r}from"tslib";import{action as l}from"mobx";import{MOBILE_BREAKPOINT as n}from"../../constants";import c from"../../tools/track-event";import{PREFIXES as h,SearchButtonType as o}from"./constants";import{extractPoiTypeId as u,getButtonConfig as S,getScopeCategoryIds as d}from"./utils";export class SearchButtonsActions{constructor(e,t,i){this.rootStore=e,this.state=t,this.filters=i}reportActivation(e){e&&c("sbtnview",e)}handleSearchButtonClick(e,t){const s={[o.BOOKMARKS]:()=>this.handleBookmarksClick(t),[o.VISITED]:()=>this.handleVisitedClick(t),[o.SESSIONS]:()=>this.handleSessionsClick(t),[o.TOURS]:()=>this.handleToursClick(t),[o.CATEGORIES]:()=>this.handleCategoriesClick(void 0,t),[o.EXHIBITORS]:()=>this.handleExhibitorsClick(t)}[e];if(s){s();return}e.startsWith(h.POI_TYPE)&&this.handlePoiTypeClick(e,t)}handleExtendedSearchButtonClick(e){const t=S(e);if(!t)return;const i=t.name;if(t.type==="link"){this.handleLinkClick(t,i);return}const s=t.children?.filter(a=>a.visible)||[];if(s.length===1&&s[0].type==="poi_types"&&s[0].name===t.name){this.handleSearchButtonClick(e,i);return}if(t.type===o.CATEGORIES){this.handleCategoriesClick({buttonId:e,buttonConfig:t},i);return}t.children&&s.length>0?this.handleParentButton(e,t,i):this.handleSearchButtonClick(e,i)}handleMainButtonClick(e){this.handleSearchButtonClick(e)}handleSessionsClick(e){const{uiState:t}=this.rootStore;t.list.type==="sessions"?this.switchToSearch():(this.reportActivation(e),this.resetAllFilters(),t.details=null,t.menu=!1,t.list={type:"sessions",text:"",focused:!1},this.state.setSubButton(null),t.selectedTrack=null,this.state.subButtonsEnabled&&this.showSubButtons("sessions"),this.isMobile&&(t.desiredOverlaySize="full"))}togglePoiType(e){this.handleSearchButtonClick(`${h.POI_TYPE}${e}`)}clearAllFilters(){this.switchToSearch()}deactivateForNavigation(){const{uiState:e}=this.rootStore;(this.state.activePoiFilterId!==null||this.state.searchShortcutState.activeParentId!==null||e.hasAppliedFilters)&&this.clearActiveFilters()}showSubButtons(e){this.state.subButtonsEnabled&&(this.state.setSubButtonParent(e),this.state.setSubButton(null),this.rootStore.uiState.subButtonsVisible=!0)}hideSubButtons(){this.state.setSubButtonParent(null),this.state.setSubButton(null),this.rootStore.uiState.subButtonsVisible=!1}handleSubButtonClick(e){this.state.activeSubButtonId!==e&&this.state.setSubButton(e)}toggleListView(e,t,i){this.rootStore.uiState.list.type===e?this.switchToSearch():(this.reportActivation(i),this.resetAllFilters(),t())}handleBookmarksClick(e){this.toggleListView("bookmarks",()=>{this.rootStore.clickBookmarks()},e)}handleVisitedClick(e){this.toggleListView("visited",()=>{this.rootStore.clickVisited()},e)}handleToursClick(e){const{uiState:t}=this.rootStore;t.list.type==="tours"?this.switchToSearch():(this.reportActivation(e),this.resetAllFilters(),t.details=null,t.menu=!1,t.list={type:"tours",text:"",focused:!1},this.isMobile&&(t.desiredOverlaySize="full"))}handleCategoriesClick(e,t){const{uiState:i}=this.rootStore;this.reportActivation(t),i.list.type!=="search"?this.switchToSearch():this.state.activePoiFilterId&&this.filters.clearPoiTypeFilters(),this.state.searchShortcutState.activeParentId&&(this.state.setActiveParentId(null),this.state.clearChildren(),this.state.showShortcuts(!1),this.filters.clearAllChildFilters()),e?this.rootStore.categoryFilterStore.openFilterForButton(e.buttonId,d(e.buttonConfig),e.buttonConfig.name):this.rootStore.categoryFilterStore.openFilter()}handleExhibitorsClick(e){const{uiState:t}=this.rootStore;t.list.type==="exhibitors"?this.switchToSearch():(this.reportActivation(e),this.resetAllFilters(),t.details=null,t.menu=!1,t.list={type:"exhibitors",text:"",focused:!1},this.isMobile&&(t.desiredOverlaySize="full"))}handlePoiTypeClick(e,t){const{uiState:i}=this.rootStore,s=this.state.activePoiFilterId!==e;s&&this.reportActivation(t);const a=i.list.type==="search"&&i.list.text||"";i.list.type!=="search"?this.switchToSearch(!0):i.selectedCategoryFilters.length>0&&this.filters.clearCategoryFilters(),this.state.searchShortcutState.activeParentId&&(this.state.setActiveParentId(null),this.state.clearChildren(),this.state.showShortcuts(!1),this.filters.clearAllChildFilters()),s?this.setPoiFilterFromString(e):this.filters.clearPoiTypeFilters(),a&&i.list.type==="search"&&(i.list={type:"search",text:a,focused:!1}),this.rootStore.searchStore.selectSearchAndFocus(a)}handleLinkClick(e,t){const i=e.children?.find(s=>s.type==="link");i&&"linkUrl"in i&&(this.reportActivation(t),window.open(i.linkUrl,"_blank"))}handleParentButton(e,t,i){const{uiState:s}=this.rootStore;if(this.state.searchShortcutState.activeParentId===e){this.state.setActiveParentId(null),this.state.clearChildren(),this.state.showShortcuts(!1),this.filters.clearAllChildFilters(),this.rootStore.urlFilterManager.clearAllFilters(),s.centerMap=!0,s.overlaySize==="full"&&s.searchFocused&&this.rootStore.searchStore.setFocused(!1);return}this.reportActivation(i),s.list.type!=="search"&&this.switchToSearch(),this.state.activePoiFilterId&&this.state.setPoiFilter(null),this.state.setActiveParentId(e),this.state.showShortcuts(!0),this.state.clearChildren(),this.filters.applyAllChildrenFilters(t),this.rootStore.searchStore.selectSearchAndFocus()}preserveSearchText(e){const{uiState:t}=this.rootStore,i=t.list.type==="search"&&t.list.text||"";e(),t.list.type==="search"&&i&&(t.list={type:"search",text:i,focused:!1})}switchToSearch(e=!1){const t=()=>{this.resetAllFilters(),this.rootStore.uiState.details=null,this.rootStore.uiState.menu=!1,this.rootStore.uiState.list={type:"search",text:"",focused:!1}};e?this.preserveSearchText(t):t()}resetAllFilters(){this.clearActiveFilters(),this.rootStore.fp.hidePathways()}clearActiveFilters(){this.state.reset(),this.rootStore.uiState.selectedPoiTypeFilters=[],this.rootStore.categoryFilterStore.clearSelection(),this.rootStore.urlFilterManager.clearAllFilters()}setPoiFilterFromString(e){this.state.setPoiFilter(e);const t=u(e);if(t!==null){const i=this.rootStore.poiTypeStore.poiTypes.find(s=>s.id===t);i&&(this.rootStore.uiState.selectedPoiTypeFilters=[i],this.rootStore.urlFilterManager.setPoiType(i.name))}}get isMobile(){return typeof window<"u"&&window.innerWidth<=n}}r([l],SearchButtonsActions.prototype,"handleSearchButtonClick",null),r([l],SearchButtonsActions.prototype,"handleExtendedSearchButtonClick",null),r([l],SearchButtonsActions.prototype,"handleMainButtonClick",null),r([l],SearchButtonsActions.prototype,"handleSessionsClick",null),r([l],SearchButtonsActions.prototype,"togglePoiType",null),r([l],SearchButtonsActions.prototype,"clearAllFilters",null),r([l],SearchButtonsActions.prototype,"deactivateForNavigation",null),r([l],SearchButtonsActions.prototype,"showSubButtons",null),r([l],SearchButtonsActions.prototype,"hideSubButtons",null),r([l],SearchButtonsActions.prototype,"handleSubButtonClick",null);
|
|
@@ -11,11 +11,12 @@ export declare class SearchButtonsFactory {
|
|
|
11
11
|
createButtons(configs: SearchButtonTypeConfig[]): SearchButtonConfig[];
|
|
12
12
|
private createButton;
|
|
13
13
|
private createBaseButton;
|
|
14
|
-
private createButtonId;
|
|
15
14
|
private createBookmarksButton;
|
|
16
15
|
private createVisitedButton;
|
|
17
16
|
private createCategoriesButton;
|
|
18
17
|
private createSimpleCategoriesButton;
|
|
18
|
+
/** Whether the category modal is open on this button (`null`: the built-in one). */
|
|
19
|
+
private isModalOpenFor;
|
|
19
20
|
private createSessionsButton;
|
|
20
21
|
private createGuidedToursButton;
|
|
21
22
|
private createPoiTypeButton;
|
|
@@ -23,7 +24,6 @@ export declare class SearchButtonsFactory {
|
|
|
23
24
|
private shouldFlattenToSinglePoiType;
|
|
24
25
|
private createLinkButton;
|
|
25
26
|
private createExhibitorsButton;
|
|
26
|
-
private countCategories;
|
|
27
27
|
private countPoiTypes;
|
|
28
28
|
private dedupeButtons;
|
|
29
29
|
private countBookmarks;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import d from"../../data";import{getContrastTextColor as S}from"../../utils/getContrastTextColor";import{tIfExists as B}from"../../utils/i18n";import{BUTTON_ICONS as a,PREFIXES as p,SearchButtonType as n}from"./constants";import{countScopedCategories as C,deriveSearchButtonId as c,getScopeCategoryIds as T}from"./utils";export class SearchButtonsFactory{constructor(t,e,o){this.rootStore=t,this.state=e,this.actions=o,this.buttonFactories={[n.BOOKMARKS]:r=>this.createBookmarksButton(r),[n.VISITED]:r=>this.createVisitedButton(r),[n.CATEGORIES]:r=>this.createCategoriesButton(r),[n.SESSIONS]:r=>this.createSessionsButton(r),[n.TOURS]:r=>this.createGuidedToursButton(r),[n.POI_TYPE]:r=>this.createPoiTypeButton(r),[n.POI_TYPES]:r=>this.createPoiTypesButton(r),[n.LINK]:r=>this.createLinkButton(r),[n.EXHIBITORS]:r=>this.createExhibitorsButton(r)}}createButtons(t){return this.dedupeButtons(t).filter(e=>e.visible).map(e=>({button:this.createButton(e),order:e.order??Number.MAX_SAFE_INTEGER})).filter(e=>e.button!==null).sort((e,o)=>e.order-o.order).map(e=>e.button)}createButton(t){const e=this.buttonFactories[t.type];return e?e(t):null}createBaseButton(t){const e=t.color&&t.color.toUpperCase()!=="#FFFFFF",o=B(t.name);return{id:c(t),label:o,text:o,enabled:!0,isDimmed:!1,isClickable:!0,backgroundColor:e?t.color:void 0,textColor:e&&t.color?S(t.color):void 0}}createBookmarksButton(t){const{uiState:e}=this.rootStore;return e.kiosk||e.disableBookmarked||d.hideBookmarks?null:{...this.createBaseButton(t),id:n.BOOKMARKS,icon:a.BOOKMARKS,active:e.list.type==="bookmarks",count:this.countBookmarks(),onClick:()=>this.actions.handleSearchButtonClick(n.BOOKMARKS,t.name)}}createVisitedButton(t){const{uiState:e}=this.rootStore;return e.kiosk?null:{...this.createBaseButton(t),id:n.VISITED,icon:a.VISITED,active:e.list.type==="visited",count:this.countVisited(),onClick:()=>this.actions.handleSearchButtonClick(n.VISITED,t.name)}}createCategoriesButton(t){if(!t.children?.length){const l=this.getCategoriesTotalCount();return l>0?this.createSimpleCategoriesButton(t,l):null}const e=C(this.rootStore.categoryStore.categories,T(t));if(e===0)return null;const o=c(t),{categoryFilterStore:r,uiState:s}=this.rootStore,u=r.scopeButtonId===o?s.selectedCategoryFilters.length:0,h=this.isModalOpenFor(o);return{...this.createBaseButton(t),id:o,active:u>0||h,expanded:h,count:u>0?u:e,showZeroCount:!0,variant:"action",onClick:()=>this.actions.handleExtendedSearchButtonClick(o)}}createSimpleCategoriesButton(t,e){const{categoryFilterStore:o,uiState:r}=this.rootStore,i=o.scopeButtonId===null?r.selectedCategoryFilters.length:0,u=i>0?i:e;return{...this.createBaseButton(t),id:n.CATEGORIES,active:i>0&&!this.state.searchShortcutState.activeParentId,expanded:this.isModalOpenFor(null),count:u,showZeroCount:!0,variant:"action",onClick:()=>this.actions.handleSearchButtonClick(n.CATEGORIES,t.name)}}isModalOpenFor(t){const{categoryFilterStore:e}=this.rootStore;return e.state.isOpen&&e.viewScope?.buttonId===t}createSessionsButton(t){const{uiState:e}=this.rootStore,o=this.getSessionsTotalCount();return o===0?null:{...this.createBaseButton(t),id:n.SESSIONS,icon:a.SESSIONS,active:e.list.type==="sessions",count:o,showZeroCount:!0,hasSubButtons:!0,onClick:()=>this.actions.handleSessionsClick(t.name)}}createGuidedToursButton(t){const{uiState:e}=this.rootStore,o=this.getGuidedToursTotalCount();return o===0?null:{...this.createBaseButton(t),id:"guided_tours",active:e.list.type==="tours"||e.list.type==="multi-point-tour",count:o,showZeroCount:!0,onClick:()=>this.actions.handleSearchButtonClick("guided_tours",t.name)}}createPoiTypeButton(t){const e=this.rootStore.poiTypeStore.poiTypes.find(s=>s.name===t.name);if(!e)return null;const o=`${p.POI_TYPE}${e.id}`,r=this.getPoiTypeTotalCount(e.id);return r===0?null:{...this.createBaseButton(t),id:o,active:this.state.activePoiFilterId===o,count:r,showZeroCount:!0,onClick:()=>this.actions.handleSearchButtonClick(o,t.name)}}createPoiTypesButton(t){if(!t.children?.length)return this.createPoiTypeButton(t);const e=t.children.filter(i=>i.visible);if(e.length===0)return null;if(this.shouldFlattenToSinglePoiType(e,t))return this.createPoiTypeButton(t);const o=e.filter(i=>i.type!=="link"),r=this.countPoiTypes(o),s=c(t);return{...this.createBaseButton(t),id:s,active:this.state.searchShortcutState.activeParentId===s,count:r,showZeroCount:!0,onClick:()=>this.actions.handleExtendedSearchButtonClick(s)}}shouldFlattenToSinglePoiType(t,e){return t.length===1&&t[0].type==="poi_types"&&t[0].name===e.name}createLinkButton(t){const e=c(t);return{...this.createBaseButton(t),id:e,active:!1,onClick:()=>this.actions.handleExtendedSearchButtonClick(e)}}createExhibitorsButton(t){const{uiState:e}=this.rootStore,o=this.getExhibitorsTotalCount();return o===0?null:{...this.createBaseButton(t),id:n.EXHIBITORS,icon:a.EXHIBITORS,active:e.list.type==="exhibitors",count:o,showZeroCount:!0,onClick:()=>this.actions.handleSearchButtonClick(n.EXHIBITORS,t.name)}}countPoiTypes(t){return t.reduce((e,o)=>{if(o.type!=="poi_types")return e;if(o.count!==void 0)return e+o.count;const r=Number(o.id),s=this.rootStore.poiTypeStore.poiTypes.find(i=>i.id===r);if(s){const i=this.rootStore.boothStore.booths.filter(u=>u.poiTypeId===s.id).length;return e+i}return e},0)}dedupeButtons(t){const e=new Set;return t.filter(o=>{const r=`${o.type}_${o.name}`;return e.has(r)?!1:(e.add(r),!0)})}countBookmarks(){return this.rootStore.exhibitorStore.bookmarked.length+this.rootStore.eventStore.bookmarked.length+this.rootStore.speakerStore.bookmarked.length+this.rootStore.boothStore.booths.filter(t=>t.exhibitors.length===0&&t.bookmarkedDirectly).length}countVisited(){return this.rootStore.exhibitorStore.visited.length+this.rootStore.eventStore.visited.length}getSessionsTotalCount(){return this.rootStore.eventStore.eventItems.length}getGuidedToursTotalCount(){return this.rootStore.toursStore.hasTours?this.rootStore.toursStore.tourItems.length:0}getCategoriesTotalCount(){return this.rootStore.categoryStore.categories.filter(t=>t.exhibitors.length>0).length}getPoiTypeTotalCount(t){return this.rootStore.boothStore.booths.filter(e=>e.poiTypeId===t).length}getExhibitorsTotalCount(){return this.rootStore.exhibitorStore.exhibitors.length}}
|
|
@@ -14,7 +14,7 @@ export declare class SearchButtonsFilters {
|
|
|
14
14
|
getActiveParent(): SearchButtonTypeConfig | null;
|
|
15
15
|
areAllSelected(): boolean;
|
|
16
16
|
getChildrenCount(): number;
|
|
17
|
-
private
|
|
18
|
-
private
|
|
17
|
+
private collectPoiTypes;
|
|
18
|
+
private collectSelectedPoiTypes;
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=SearchButtonsFilters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as
|
|
1
|
+
import{__decorate as o}from"tslib";import{action as s}from"mobx";import{getButtonConfig as a}from"./utils";export class SearchButtonsFilters{constructor(t,r){this.rootStore=t,this.state=r}applyAllChildrenFilters(t){if(!t.children)return;const{uiState:r}=this.rootStore,e=t.children.filter(i=>i.visible);r.selectedPoiTypeFilters=this.collectPoiTypes(e),this.rootStore.categoryFilterStore.clearSelection()}applyChildFilters(){const{uiState:t}=this.rootStore,r=Array.from(this.state.searchShortcutState.activeChildren);if(t.selectedPoiTypeFilters=[],this.rootStore.categoryFilterStore.clearSelection(),r.length===0)return;const e=a(this.state.searchShortcutState.activeParentId);if(!e?.children)return;const i=e.children.filter(l=>l.visible);t.selectedPoiTypeFilters=this.collectSelectedPoiTypes(i,r)}clearAllChildFilters(){this.state.clearChildren(),this.rootStore.uiState.selectedPoiTypeFilters=[],this.rootStore.categoryFilterStore.clearSelection()}clearCategoryFilters(){this.rootStore.categoryFilterStore.clearSelection(),this.rootStore.urlFilterManager.setCategories([])}clearPoiTypeFilters(){this.state.setPoiFilter(null),this.rootStore.uiState.selectedPoiTypeFilters=[],this.rootStore.urlFilterManager.setPoiType(null)}toggleChildFilter(t){const r=a(this.state.searchShortcutState.activeParentId);r?.children&&(this.state.toggleChild(t),this.state.hasActiveChildren?this.applyChildFilters():this.applyAllChildrenFilters(r))}getActiveParent(){return this.state.searchShortcutState.activeParentId?a(this.state.searchShortcutState.activeParentId):null}areAllSelected(){if(!this.state.searchShortcutState.activeParentId)return!1;const t=a(this.state.searchShortcutState.activeParentId);if(!t?.children)return!1;const e=t.children.filter(i=>i.visible).filter(i=>i.type!=="link");return e.length>0&&e.every(i=>{const l=i.id?.toString()||i.name;return this.state.isChildActive(l)})}getChildrenCount(){if(!this.state.searchShortcutState.activeParentId)return 0;const t=a(this.state.searchShortcutState.activeParentId);return t?.children?t.children.filter(e=>e.visible).filter(e=>e.type!=="link").length:0}collectPoiTypes(t){const r=[];return t.forEach(e=>{if(e.type!=="poi_types")return;const i=this.rootStore.poiTypeStore.poiTypes.find(l=>l.id===Number(e.id));i&&r.push(i)}),r}collectSelectedPoiTypes(t,r){const e=[];return r.forEach(i=>{const l=t.find(n=>n.type==="link"?!1:(n.id?.toString()||n.name)===i);if(l?.type!=="poi_types")return;const c=this.rootStore.poiTypeStore.poiTypes.find(n=>n.id===Number(l.id));c&&e.push(c)}),e}}o([s],SearchButtonsFilters.prototype,"applyAllChildrenFilters",null),o([s],SearchButtonsFilters.prototype,"applyChildFilters",null),o([s],SearchButtonsFilters.prototype,"clearAllChildFilters",null),o([s],SearchButtonsFilters.prototype,"clearCategoryFilters",null),o([s],SearchButtonsFilters.prototype,"clearPoiTypeFilters",null),o([s],SearchButtonsFilters.prototype,"toggleChildFilter",null);
|
|
@@ -11,9 +11,6 @@ export declare enum SearchButtonType {
|
|
|
11
11
|
}
|
|
12
12
|
export declare const PREFIXES: {
|
|
13
13
|
readonly POI_TYPE: 'poiType_';
|
|
14
|
-
readonly CATEGORIES: 'categories_';
|
|
15
|
-
readonly POI_TYPES: 'poi_types_';
|
|
16
|
-
readonly LINK: 'link_';
|
|
17
14
|
};
|
|
18
15
|
export declare const BUTTON_ICONS: {
|
|
19
16
|
readonly BOOKMARKS: 'icon-bookmark';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var SearchButtonType;(function(i){i.BOOKMARKS="bookmarks",i.VISITED="visited",i.SESSIONS="sessions",i.TOURS="guided_tours",i.CATEGORIES="categories",i.POI_TYPE="poi_type",i.POI_TYPES="poi_types",i.LINK="link",i.EXHIBITORS="exhibitors"})(SearchButtonType||(SearchButtonType={}));export const PREFIXES={POI_TYPE:"poiType_"
|
|
1
|
+
export var SearchButtonType;(function(i){i.BOOKMARKS="bookmarks",i.VISITED="visited",i.SESSIONS="sessions",i.TOURS="guided_tours",i.CATEGORIES="categories",i.POI_TYPE="poi_type",i.POI_TYPES="poi_types",i.LINK="link",i.EXHIBITORS="exhibitors"})(SearchButtonType||(SearchButtonType={}));export const PREFIXES={POI_TYPE:"poiType_"},BUTTON_ICONS={BOOKMARKS:"icon-bookmark",VISITED:"icon-checkmark",SESSIONS:"icon-schedule",EXHIBITORS:"icon-exhibitors"};
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import { type SearchButtonTypeConfig } from '../types';
|
|
2
2
|
export declare function extractPoiTypeId(filterId: string): number | null;
|
|
3
|
+
/**
|
|
4
|
+
* The id of a configured search button — the platform's own `id` when it sends
|
|
5
|
+
* one, otherwise `<type>_<name>`. The single formula: the factory that builds a
|
|
6
|
+
* button and every lookup that resolves one back (the click handler, the URL's
|
|
7
|
+
* `filters[searchButton]` owner) must agree, or a button whose `id` the platform
|
|
8
|
+
* omitted — most of them — resolves to nothing and its click silently does
|
|
9
|
+
* nothing.
|
|
10
|
+
*/
|
|
11
|
+
export declare function deriveSearchButtonId(config: SearchButtonTypeConfig): string;
|
|
3
12
|
export declare function getButtonConfig(buttonId: string): SearchButtonTypeConfig | null;
|
|
4
|
-
export declare function
|
|
5
|
-
|
|
13
|
+
export declare function getScopeCategoryIds(config: SearchButtonTypeConfig): number[];
|
|
14
|
+
/**
|
|
15
|
+
* How many of a custom button's scoped categories the category modal will
|
|
16
|
+
* actually draw. `CategoryFilterModal` skips a category with no exhibitors, and
|
|
17
|
+
* a configured child id may name no catalog category at all — counting the raw
|
|
18
|
+
* `children` promised a badge the modal could not fill, and was not the
|
|
19
|
+
* consistency with the built-in button's count it claimed to be.
|
|
20
|
+
*/
|
|
21
|
+
export declare function countScopedCategories(categories: readonly {
|
|
22
|
+
id: number;
|
|
23
|
+
exhibitors: readonly unknown[];
|
|
24
|
+
}[], scopeIds: readonly number[]): number;
|
|
25
|
+
export declare function countMapValues(map: Map<unknown, number>): number;
|
|
26
|
+
export declare function isValidConfig(config: unknown): boolean;
|
|
6
27
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from"../../data";import{PREFIXES as u}from"./constants";export function extractPoiTypeId(t){try{const e=t.replace(u.POI_TYPE,""),r=parseInt(e,10);return isNaN(r)?null:r}catch{return null}}export function deriveSearchButtonId(t){return t.id||`${t.type}_${t.name}`}export function getButtonConfig(t){const e=o.filterButtonsConfig;return!e?.searchButtons||!Array.isArray(e.searchButtons)?null:e.searchButtons.find(n=>deriveSearchButtonId(n)===t)||null}export function getScopeCategoryIds(t){return(t.children??[]).filter(e=>e.visible===!0&&e.type==="categories").map(e=>Number(e.id)).filter(e=>Number.isFinite(e))}export function countScopedCategories(t,e){return t.filter(r=>e.includes(r.id)&&r.exhibitors.length>0).length}export function countMapValues(t){let e=0;for(const r of t.values())e+=r;return e}export function isValidConfig(t){return!!t&&typeof t=="object"&&Array.isArray(t.searchButtons)&&t.searchButtons.length>0}
|
|
@@ -93,6 +93,7 @@ export interface URLFilters {
|
|
|
93
93
|
poiType: string | null;
|
|
94
94
|
poiTypes: string[];
|
|
95
95
|
exhibitors: boolean;
|
|
96
|
+
searchButton: string | null;
|
|
96
97
|
}
|
|
97
98
|
export interface TourItem {
|
|
98
99
|
id: string;
|
|
@@ -167,6 +168,10 @@ export interface SearchButtonConfig {
|
|
|
167
168
|
enabled: boolean;
|
|
168
169
|
active: boolean;
|
|
169
170
|
count?: number;
|
|
171
|
+
/** `'action'` draws a chevron: the click opens a modal instead of toggling a filter in place. */
|
|
172
|
+
variant?: 'toggle' | 'action';
|
|
173
|
+
/** Whether an `'action'` button's modal is open right now — its `aria-expanded`. */
|
|
174
|
+
expanded?: boolean;
|
|
170
175
|
modalComponent?: React.ComponentType;
|
|
171
176
|
isDimmed?: boolean;
|
|
172
177
|
isClickable?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setConfig as
|
|
1
|
+
import{setConfig as w}from"@expofp/config";import{vi as e}from"vitest";let c={};async function S(r={}){g();const{default:o}=await import("../store/UIState.js"),n={fp:{},...r};return n.uiState=c=new o(n),n}export async function createUIState(r={}){return(await S(r)).uiState}export async function createRouteStore(r={}){const o=await S({fp:{},moveToList:e.fn(),showMap:e.fn(),layerStore:{layers:[],updateVisibility:e.fn(),findLayer:e.fn(()=>null)},...r}),{default:n,Route:t}=await import("../store/RouteStore.js"),a=new n(o);return o.routeStore=a,{routeStore:a,uiState:o.uiState,rootStore:o,Route:t}}export async function createSearchButtonsStore(r={}){const{routeStore:o,uiState:n,rootStore:t,Route:a}=await createRouteStore({fp:{hidePathways:e.fn(),getOptimizedRoutes:()=>[]},boothStore:{booths:[]},poiTypeStore:{poiTypes:[]},searchStore:{selectSearchAndFocus:e.fn(),setFocused:e.fn()},...r}),{default:f}=await import("../store/CategoryFilterStore.js"),{default:l}=await import("../store/RoutePlannerStore.js"),{URLFilterManager:p}=await import("../services/URLFilterManager.js"),{default:d}=await import("../store/search-buttons/SearchButtonsStore.js");t.categoryFilterStore=new f(t);const s=new l(t);t.routePlannerStore=s;const i=new d(t);t.searchButtonsStore=i;const u=new p(t);return t.urlFilterManager=u,{searchButtonsStore:i,routePlannerStore:s,routeStore:o,urlFilterManager:u,uiState:n,rootStore:t,Route:a}}function g(){window.__efpEvent="demo",HTMLCanvasElement.prototype.getContext=(()=>new Proxy({},{get:()=>()=>{}})),e.doMock("../store/index.js",()=>({get uiState(){return c}})),e.doMock("../data/svg.js",()=>({svgArea:()=>null,svgAreaExplicit:()=>null,getLayerSvg:()=>document.createElementNS("http://www.w3.org/2000/svg","svg")})),e.doMock("../tools/gtag.js",()=>({hasUserConsent:()=>!1,sendEventToGa:e.fn(),GaEventActions:{}})),w({expo:"demo",fpSvgJsRef:{},fpSvgLayerJsRefs:{}})}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FilterGroup } from '../store/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Narrows filter groups to a text query. A group survives either because its own name
|
|
4
|
+
* matches — `CategoryFilterModal` splits `"Food/Beverages"` into the group `Food` plus
|
|
5
|
+
* the item `Beverages`, so matching items alone would never find `"food"` — or because
|
|
6
|
+
* some of its items match, in which case only those items remain.
|
|
7
|
+
*/
|
|
8
|
+
export declare const filterGroups: (groups: FilterGroup[], query: string) => FilterGroup[];
|
|
9
|
+
//# sourceMappingURL=filter-groups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const filterGroups=(r,n)=>{const t=n.trim().toLowerCase();if(!t)return r;const o=[];for(const e of r){if(e.groupName.toLowerCase().includes(t)){o.push(e);continue}const s=e.items.filter(i=>i.name.toLowerCase().includes(t));s.length>0&&o.push({...e,items:s})}return o};
|
package/dist/esm/utils/gps.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CurrentPosition } from '../store/RouteStore';
|
|
1
|
+
import { type CurrentPosition } from '../store/RouteStore';
|
|
2
2
|
export interface GpsConfig {
|
|
3
3
|
p0: {
|
|
4
4
|
x: number;
|
|
@@ -25,6 +25,10 @@ export interface PointWithAngle {
|
|
|
25
25
|
angle?: number;
|
|
26
26
|
}
|
|
27
27
|
export declare function isValidPointCoords(value: unknown): value is number;
|
|
28
|
+
/** A coordinate as the SDK may deliver it — `1.5`, or `"1,5"` from a comma locale. */
|
|
29
|
+
export declare function toCoordinate(value: string | number): number;
|
|
30
|
+
/** Whether `toCoordinate` turns `value` into a finite number; a blank string does not count. */
|
|
31
|
+
export declare function isCoordinate(value: unknown): boolean;
|
|
28
32
|
export declare function convertGpsToLocal({ lat, lng, angle }: Pick<CurrentPosition, 'lat' | 'lng' | 'angle'>, config: GpsConfig): PointWithAngle | null;
|
|
29
33
|
export declare function convertLocalToGps(x: number, y: number, geoConfig: GpsConfig): [number, number];
|
|
30
34
|
export declare function calculateRelativeBearing(point: PointWithAngle): number;
|
package/dist/esm/utils/gps.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{haversineDistance as m,lineCenter as x,lineLength as d,pointDistance as
|
|
1
|
+
import{haversineDistance as m,lineCenter as x,lineLength as d,pointDistance as b,projectGpsToLocal as y,projectLocalToGps as G}from"@expofp/geometry";import{getFpGeo as N}from"../data/fpGeo.js";import a from"../tools/logger";import{planBearing as C}from"./planBearing";function c(n){return[{local:{x:n.p0.x,y:n.p0.y},geo:{lat:n.p0.lat,lng:n.p0.lng}},{local:{x:n.p2.x,y:n.p2.y},geo:{lat:n.p2.lat,lng:n.p2.lng}}]}export function isValidPointCoords(n){return typeof n=="number"&&Number.isFinite(n)}export function toCoordinate(n){return typeof n=="string"?Number(n.replace(",",".")):n}export function isCoordinate(n){return typeof n=="string"?n.trim()!==""&&isValidPointCoords(toCoordinate(n)):isValidPointCoords(n)}export function convertGpsToLocal({lat:n,lng:t,angle:o},i){if(!(isValidPointCoords(n)&&isValidPointCoords(t)))return null;const{p0:e,p2:r}=i,p=m(e,r);if(!isValidPointCoords(p)||p<=0)return a.warn("Invalid GPS config: zero or negative distance",{fullGpsDistance:p,p0:e,p2:r}),null;const[s,u]=c(i),l=y({lat:n,lng:t},s,u),g=d({p0:l,p1:x({p0:e,p1:r})}),f=b(e,r);return g>5*f?(a.warn("Current position too far"),null):{...l,angle:o}}export function convertLocalToGps(n,t,o){const[i,e]=c(o),{lat:r,lng:p}=G({x:n,y:t},i,e);return[p,r]}export function calculateRelativeBearing(n){const t=N()?.properties?.config,o=t?C(t.p0,t.p2):NaN,i=Number.isFinite(o)?o:t?.bearing??0;return n?.angle===null?0:((((n.angle??NaN)-i)%360+360)%360-90+360)%360}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expofp/floorplan",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.47.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/expofp/efp-app.git",
|
|
@@ -69,15 +69,15 @@
|
|
|
69
69
|
"tslib": "^2.3.0",
|
|
70
70
|
"uuid": "^9.0.1",
|
|
71
71
|
"zod": "4.4.3",
|
|
72
|
-
"@expofp/config": "3.
|
|
73
|
-
"@expofp/debug": "3.
|
|
74
|
-
"@expofp/geometry": "3.
|
|
75
|
-
"@expofp/renderer": "3.
|
|
76
|
-
"@expofp/resolve": "3.
|
|
77
|
-
"@expofp/schema": "3.
|
|
78
|
-
"@expofp/ui": "3.
|
|
79
|
-
"@expofp/utils": "3.
|
|
80
|
-
"@expofp/wayfinding": "3.
|
|
72
|
+
"@expofp/config": "3.47.0",
|
|
73
|
+
"@expofp/debug": "3.47.0",
|
|
74
|
+
"@expofp/geometry": "3.47.0",
|
|
75
|
+
"@expofp/renderer": "3.47.0",
|
|
76
|
+
"@expofp/resolve": "3.47.0",
|
|
77
|
+
"@expofp/schema": "3.47.0",
|
|
78
|
+
"@expofp/ui": "3.47.0",
|
|
79
|
+
"@expofp/utils": "3.47.0",
|
|
80
|
+
"@expofp/wayfinding": "3.47.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@babel/plugin-proposal-decorators": "^8.0.2",
|